1
0
mirror of https://github.com/ZeroCatDev/Classworks.git synced 2026-05-14 03:45:07 +00:00
Classworks/assets/vendor-sentry-Ctu4DUyU.js

502 lines
310 KiB
JavaScript

const R=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,V=globalThis,Ft="10.48.0";function jt(){return as(V),V}function as(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Ft,t[Ft]=t[Ft]||{}}function Sn(e,t,n=V){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[Ft]=r[Ft]||{};return s[e]||(s[e]=t())}const Td=["debug","info","warn","error","log","assert","trace"],wd="Sentry Logger ",Wr={};function rt(e){if(!("console"in V))return e();const t=V.console,n={},r=Object.keys(Wr);r.forEach(s=>{const i=Wr[s];n[s]=t[s],t[s]=i});try{return e()}finally{r.forEach(s=>{t[s]=n[s]})}}function Id(){Oi().enabled=!0}function kd(){Oi().enabled=!1}function xc(){return Oi().enabled}function Cd(...e){Di("log",...e)}function Rd(...e){Di("warn",...e)}function xd(...e){Di("error",...e)}function Di(e,...t){R&&xc()&&rt(()=>{V.console[e](`${wd}[${e}]:`,...t)})}function Oi(){return R?Sn("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const b={enable:Id,disable:kd,isEnabled:xc,log:Cd,warn:Rd,error:xd},Mc=50,Ut="?",Ro=/\(error: (.*)\)/,xo=/captureMessage|captureException/;function Ac(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const i=[],o=n.split(`
`);for(let c=r;c<o.length;c++){let a=o[c];a.length>1024&&(a=a.slice(0,1024));const u=Ro.test(a)?a.replace(Ro,"$1"):a;if(!u.includes("Error: ")){for(const d of t){const l=d(u);if(l){i.push(l);break}}if(i.length>=Mc+s)break}}return Ad(i.slice(s))}}function Md(e){return Array.isArray(e)?Ac(...e):e}function Ad(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(pr(t).function||"")&&t.pop(),t.reverse(),xo.test(pr(t).function||"")&&(t.pop(),xo.test(pr(t).function||"")&&t.pop()),t.slice(0,Mc).map(n=>({...n,filename:n.filename||pr(t).filename,function:n.function||Ut}))}function pr(e){return e[e.length-1]||{}}const ks="<anonymous>";function lt(e){try{return!e||typeof e!="function"?ks:e.name||ks}catch{return ks}}function Mo(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function Nc(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const kr={},Ao={};function Rt(e,t){kr[e]=kr[e]||[],kr[e].push(t)}function xt(e,t){if(!Ao[e]){Ao[e]=!0;try{t()}catch(n){R&&b.error(`Error while instrumenting ${e}`,n)}}}function qe(e,t){const n=e&&kr[e];if(n)for(const r of n)try{r(t)}catch(s){R&&b.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${lt(r)}
Error:`,s)}}let Cs=null;function Lc(e){const t="error";Rt(t,e),xt(t,Nd)}function Nd(){Cs=V.onerror,V.onerror=function(e,t,n,r,s){return qe("error",{column:r,error:s,line:n,msg:e,url:t}),Cs?Cs.apply(this,arguments):!1},V.onerror.__SENTRY_INSTRUMENTED__=!0}let Rs=null;function Dc(e){const t="unhandledrejection";Rt(t,e),xt(t,Ld)}function Ld(){Rs=V.onunhandledrejection,V.onunhandledrejection=function(e){return qe("unhandledrejection",e),Rs?Rs.apply(this,arguments):!0},V.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Oc=Object.prototype.toString;function cs(e){switch(Oc.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return dt(e,Error)}}function bn(e,t){return Oc.call(e)===`[object ${t}]`}function Pc(e){return bn(e,"ErrorEvent")}function No(e){return bn(e,"DOMError")}function Dd(e){return bn(e,"DOMException")}function ot(e){return bn(e,"String")}function Pi(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function cn(e){return e===null||Pi(e)||typeof e!="object"&&typeof e!="function"}function On(e){return bn(e,"Object")}function us(e){return typeof Event<"u"&&dt(e,Event)}function Od(e){return typeof Element<"u"&&dt(e,Element)}function Pd(e){return bn(e,"RegExp")}function Gn(e){return!!(e!=null&&e.then&&typeof e.then=="function")}function Fd(e){return On(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function dt(e,t){try{return e instanceof t}catch{return!1}}function Fc(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}function Fi(e){return typeof Request<"u"&&dt(e,Request)}const $i=V,$d=80;function Ne(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let i=0,o=0;const c=" > ",a=c.length;let u;const d=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||$d;for(;n&&i++<r&&(u=Bd(n,d),!(u==="html"||i>1&&o+s.length*a+u.length>=l));)s.push(u),o+=u.length,n=n.parentNode;return s.reverse().join(c)}catch{return"<unknown>"}}function Bd(e,t){const n=e,r=[];if(!(n!=null&&n.tagName))return"";if($i.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=t!=null&&t.length?t.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(s!=null&&s.length)s.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const i=n.className;if(i&&ot(i)){const o=i.split(/\s+/);for(const c of o)r.push(`.${c}`)}}for(const i of["aria-label","type","name","title","alt"]){const o=n.getAttribute(i);o&&r.push(`[${i}="${o}"]`)}return r.join("")}function qt(){try{return $i.document.location.href}catch{return""}}function $c(e){if(!$i.HTMLElement)return null;let t=e;const n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function Ae(e,t,n){if(!(t in e))return;const r=e[t];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&Bc(s,r);try{e[t]=s}catch{R&&b.log(`Failed to replace method "${t}" in object`,e)}}function Le(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{R&&b.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function Bc(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,Le(e,"__sentry_original__",t)}catch{}}function Bi(e){return e.__sentry_original__}function Hc(e){if(cs(e))return{message:e.message,name:e.name,stack:e.stack,...Do(e)};if(us(e)){const t={type:e.type,target:Lo(e.target),currentTarget:Lo(e.currentTarget),...Do(e)};return typeof CustomEvent<"u"&&dt(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Lo(e){try{return Od(e)?Ne(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Do(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function Hd(e){const t=Object.keys(Hc(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let Yt;function Yn(e){if(Yt!==void 0)return Yt?Yt(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=V;return t in n&&typeof n[t]=="function"?(Yt=n[t],Yt(e)):(Yt=null,e())}function Et(){return Yn(()=>Math.random())}function Kn(){return Yn(()=>Date.now())}function Qs(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Oo(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const s=e[r];try{Fc(s)?n.push(Nc(s)):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Cr(e,t,n=!1){return ot(e)?Pd(t)?t.test(e):ot(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function at(e,t=[],n=!1){return t.some(r=>Cr(e,r,n))}function Ud(){const e=V;return e.crypto||e.msCrypto}let xs;function Wd(){return Et()*16}function $e(e=Ud()){try{if(e!=null&&e.randomUUID)return Yn(()=>e.randomUUID()).replace(/-/g,"")}catch{}return xs||(xs="10000000100040008000"+1e11),xs.replace(/[018]/g,t=>(t^(Wd()&15)>>t/4).toString(16))}function Uc(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}function Nt(e){const{message:t,event_id:n}=e;if(t)return t;const r=Uc(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ei(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type="Error")}function un(e,t){const n=Uc(e);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...t},t&&"data"in t){const i={...s==null?void 0:s.data,...t.data};n.mechanism.data=i}}function Po(e){if(zd(e))return!0;try{Le(e,"__sentry_captured__",!0)}catch{}return!1}function zd(e){try{return e.__sentry_captured__}catch{}}const Wc=1e3;function Vt(){return Kn()/Wc}function jd(){const{performance:e}=V;if(!(e!=null&&e.now)||!e.timeOrigin)return Vt;const t=e.timeOrigin;return()=>(t+Yn(()=>e.now()))/Wc}let Fo;function me(){return(Fo??(Fo=jd()))()}let Ms=null;function qd(){var o;const{performance:e}=V;if(!(e!=null&&e.now))return;const t=3e5,n=Yn(()=>e.now()),r=Kn(),s=e.timeOrigin;if(typeof s=="number"&&Math.abs(s+n-r)<t)return s;const i=(o=e.timing)==null?void 0:o.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<t?i:r-n}function He(){return Ms===null&&(Ms=qd()),Ms}function Vd(e){const t=me(),n={sid:$e(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Yd(n)};return e&&ln(n,e),n}function ln(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||me(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:$e()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function Gd(e,t){let n={};e.status==="ok"&&(n={status:"exited"}),ln(e,n)}function Yd(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Xn(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;const r={...e};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=Xn(r[s],t[s],n-1));return r}function ft(){return $e()}function ct(){return $e().substring(16)}const ti="_sentrySpan";function Pn(e,t){t?Le(e,ti,t):delete e[ti]}function zr(e){return e[ti]}const Kd=100;class nt{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:ft(),sampleRand:Et()}}clone(){const t=new nt;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Pn(t,zr(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&ln(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,r=n instanceof nt?n.getScopeData():On(n)?t:void 0,{tags:s,attributes:i,extra:o,user:c,contexts:a,level:u,fingerprint:d=[],propagationContext:l,conversationId:f}=r||{};return this._tags={...this._tags,...s},this._attributes={...this._attributes,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...a},c&&Object.keys(c).length&&(this._user=c),u&&(this._level=u),d.length&&(this._fingerprint=d),l&&(this._propagationContext=l),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,Pn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:ft(),sampleRand:Et()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){var i;const r=typeof n=="number"?n:Kd;if(r<=0)return this;const s={timestamp:Vt(),...t,message:t.message?Qs(t.message,2048):t.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),(i=this._client)==null||i.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:zr(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Xn(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=(n==null?void 0:n.event_id)||$e();if(!this._client)return R&&b.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:s,...n,event_id:r},this),r}captureMessage(t,n,r){const s=(r==null?void 0:r.event_id)||$e();if(!this._client)return R&&b.warn("No client configured on scope - will not capture message!"),s;const i=(r==null?void 0:r.syntheticException)??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:i,...r,event_id:s},this),s}captureEvent(t,n){const r=t.event_id||(n==null?void 0:n.event_id)||$e();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(R&&b.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}function Xd(){return Sn("defaultCurrentScope",()=>new nt)}function Jd(){return Sn("defaultIsolationScope",()=>new nt)}const $o=e=>e instanceof Promise&&!e[zc],zc=Symbol("chained PromiseLike"),Zd=(e,t,n)=>{const r=e.then(s=>(t(s),s),s=>{throw n(s),s});return $o(r)&&$o(e)?r:Qd(e,r)},Qd=(e,t)=>{let n=!1;for(const r in e){if(r in t)continue;n=!0;const s=e[r];typeof s=="function"?Object.defineProperty(t,r,{value:(...i)=>s.apply(e,i),enumerable:!0,configurable:!0,writable:!0}):t[r]=s}return n&&Object.assign(t,{[zc]:!0}),t};class ef{constructor(t,n){let r;t?r=t:r=new nt;let s;n?s=n:s=new nt,this._stack=[{scope:r}],this._isolationScope=s}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(s){throw this._popScope(),s}return Gn(r)?Zd(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function dn(){const e=jt(),t=as(e);return t.stack=t.stack||new ef(Xd(),Jd())}function tf(e){return dn().withScope(e)}function nf(e,t){const n=dn();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Bo(e){return dn().withScope(()=>e(dn().getIsolationScope()))}function rf(){return{withIsolationScope:Bo,withScope:tf,withSetScope:nf,withSetIsolationScope:(e,t)=>Bo(t),getCurrentScope:()=>dn().getScope(),getIsolationScope:()=>dn().getIsolationScope()}}function En(e){const t=as(e);return t.acs?t.acs:rf()}function ne(){const e=jt();return En(e).getCurrentScope()}function Ce(){const e=jt();return En(e).getIsolationScope()}function jc(){return Sn("globalScope",()=>new nt)}function Hi(...e){const t=jt(),n=En(t);if(e.length===2){const[r,s]=e;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(e[0])}function W(){return ne().getClient()}function sf(e){const t=e.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=t,i={trace_id:n,span_id:s||ct()};return r&&(i.parent_span_id=r),i}const Fe="sentry.source",Ui="sentry.sample_rate",qc="sentry.previous_trace_sample_rate",pt="sentry.op",pe="sentry.origin",Fn="sentry.idle_span_finish_reason",Jn="sentry.measurement_unit",Zn="sentry.measurement_value",Ho="sentry.custom_span_name",Wi="sentry.profile_id",vn="sentry.exclusive_time",of="sentry.link.type",af="gen_ai.conversation.id",Vc=0,ls=1,Se=2;function cf(e){if(e<400&&e>=100)return{code:ls};if(e>=400&&e<500)switch(e){case 401:return{code:Se,message:"unauthenticated"};case 403:return{code:Se,message:"permission_denied"};case 404:return{code:Se,message:"not_found"};case 409:return{code:Se,message:"already_exists"};case 413:return{code:Se,message:"failed_precondition"};case 429:return{code:Se,message:"resource_exhausted"};case 499:return{code:Se,message:"cancelled"};default:return{code:Se,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:Se,message:"unimplemented"};case 503:return{code:Se,message:"unavailable"};case 504:return{code:Se,message:"deadline_exceeded"};default:return{code:Se,message:"internal_error"}}return{code:Se,message:"internal_error"}}function Gc(e,t){e.setAttribute("http.response.status_code",t);const n=cf(t);n.message!=="unknown_error"&&e.setStatus(n)}const Yc="_sentryScope",Kc="_sentryIsolationScope";function uf(e){try{const t=V.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function lf(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}function df(e,t,n){e&&(Le(e,Kc,uf(n)),Le(e,Yc,t))}function jr(e){const t=e;return{scope:t[Yc],isolationScope:lf(t[Kc])}}const qr="sentry-",ff=8192;function Xc(e){const t=hf(e);if(!t)return;const n=Object.entries(t).reduce((r,[s,i])=>{if(s.startsWith(qr)){const o=s.slice(qr.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function pf(e){if(!e)return;const t=Object.entries(e).reduce((n,[r,s])=>(s&&(n[`${qr}${r}`]=s),n),{});return mf(t)}function hf(e){if(!(!e||!ot(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=Uo(n);return Object.entries(r).forEach(([s,i])=>{t[s]=i}),t},{}):Uo(e)}function Uo(e){return e.split(",").map(t=>{const n=t.indexOf("=");if(n===-1)return[];const r=t.slice(0,n),s=t.slice(n+1);return[r,s].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function mf(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],s)=>{const i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=s===0?i:`${t},${i}`;return o.length>ff?(R&&b.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):o},"")}const _f=/^o(\d+)\./,gf=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function yf(e){return e==="http"||e==="https"}function Tn(e,t=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:c,publicKey:a}=e;return`${c}://${a}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function Sf(e){const t=gf.exec(e);if(!t){rt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,s="",i="",o="",c=""]=t.slice(1);let a="",u=c;const d=u.split("/");if(d.length>1&&(a=d.slice(0,-1).join("/"),u=d.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return Jc({host:i,pass:s,path:a,projectId:u,port:o,protocol:n,publicKey:r})}function Jc(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function bf(e){if(!R)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(o=>e[o]?!1:(b.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?yf(r)?t&&isNaN(parseInt(t,10))?(b.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(b.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(b.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Ef(e){const t=e.match(_f);return t==null?void 0:t[1]}function vf(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=Ef(n)),r}function Tf(e){const t=typeof e=="string"?Sf(e):Jc(e);if(!(!t||!bf(t)))return t}function Wt(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}const Zc=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function wf(e){if(!e)return;const t=e.match(Zc);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function If(e,t){const n=wf(e),r=Xc(t);if(!(n!=null&&n.traceId))return{traceId:ft(),sampleRand:Et()};const s=kf(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 Qc(e=ft(),t=ct(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function eu(e=ft(),t=ct(),n){return`00-${e}-${t}-${n?"01":"00"}`}function kf(e,t){const n=Wt(t==null?void 0:t.sample_rand);if(n!==void 0)return n;const r=Wt(t==null?void 0:t.sample_rate);return r&&(e==null?void 0:e.parentSampled)!==void 0?e.parentSampled?Et()*r:r+Et()*(1-r):Et()}const tu=0,ds=1;let Wo=!1;function Cf(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:s,parent_span_id:i,status:o,origin:c,links:a}=te(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:s,status:o,origin:c,links:a}}function Rf(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:te(e).parent_span_id,i=jr(e).scope,o=r?(i==null?void 0:i.getPropagationContext().propagationSpanId)||ct():t;return{parent_span_id:s,span_id:o,trace_id:n}}function xf(e){const{traceId:t,spanId:n}=e.spanContext(),r=Mt(e);return Qc(t,n,r)}function Mf(e){const{traceId:t,spanId:n}=e.spanContext(),r=Mt(e);return eu(t,n,r)}function nu(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...s},attributes:i})=>({span_id:t,trace_id:n,sampled:r===ds,attributes:i,...s}))}function Af(e){if(e!=null&&e.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:s})=>({span_id:t,trace_id:n,sampled:r===ds,attributes:s}))}function $t(e){return typeof e=="number"?zo(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?zo(e.getTime()):me()}function zo(e){return e>9999999999?e/1e3:e}function te(e){if(Df(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(Lf(e)){const{attributes:r,startTime:s,name:i,endTime:o,status:c,links:a}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:Nf(e),start_timestamp:$t(s),timestamp:$t(o)||void 0,status:ru(c),op:r[pt],origin:r[pe],links:nu(a)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Nf(e){var t;return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?(t=e.parentSpanContext)==null?void 0:t.spanId:void 0}function Lf(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Df(e){return typeof e.getSpanJSON=="function"}function Mt(e){const{traceFlags:t}=e.spanContext();return t===ds}function ru(e){if(!(!e||e.code===Vc))return e.code===ls?"ok":e.message||"internal_error"}function Of(e){return!e||e.code===ls||e.code===Vc||e.message==="cancelled"?"ok":"error"}const Bt="_sentryChildSpans",ni="_sentryRootSpan";function su(e,t){const n=e[ni]||e;Le(t,ni,n),e[Bt]?e[Bt].add(t):Le(e,Bt,new Set([t]))}function Pf(e,t){e[Bt]&&e[Bt].delete(t)}function Rr(e){const t=new Set;function n(r){if(!t.has(r)&&Mt(r)){t.add(r);const s=r[Bt]?Array.from(r[Bt]):[];for(const i of s)n(i)}}return n(e),Array.from(t)}const ve=Ff;function Ff(e){return e[ni]||e}function Te(){const e=jt(),t=En(e);return t.getActiveSpan?t.getActiveSpan():zr(ne())}function ri(){Wo||(rt(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Wo=!0)}let jo=!1;function $f(){if(jo)return;function e(){const t=Te(),n=t&&ve(t);if(n){const r="internal_error";R&&b.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:Se,message:r})}}e.tag="sentry_tracingErrorCallback",jo=!0,Lc(e),Dc(e)}function Ve(e){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const t=e||((n=W())==null?void 0:n.getOptions());return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function qo(e){b.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function $n(e,t){if(!(t!=null&&t.length)||!e.description)return!1;for(const n of t){if(Hf(n)){if(Cr(e.description,n))return R&&qo(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?Cr(e.description,n.name):!0,s=n.op?e.op&&Cr(e.op,n.op):!0;if(r&&s)return R&&qo(e),!0}return!1}function Bf(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const s of e)s.parent_span_id===r&&(s.parent_span_id=n)}function Hf(e){return typeof e=="string"||e instanceof RegExp}const zi="production",iu="_frozenDsc";function xr(e,t){Le(e,iu,t)}function ou(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s={environment:n.environment||zi,release:n.release,public_key:r,trace_id:e,org_id:vf(t)};return t.emit("createDsc",s),s}function au(e,t){const n=t.getPropagationContext();return n.dsc||ou(n.traceId,e)}function ht(e){var h;const t=W();if(!t)return{};const n=ve(e),r=te(n),s=r.data,i=n.spanContext().traceState,o=(i==null?void 0:i.get("sentry.sample_rate"))??s[Ui]??s[qc];function c(m){return(typeof o=="number"||typeof o=="string")&&(m.sample_rate=`${o}`),m}const a=n[iu];if(a)return c(a);const u=i==null?void 0:i.get("sentry.dsc"),d=u&&Xc(u);if(d)return c(d);const l=ou(e.spanContext().traceId,t),f=s[Fe]??s["sentry.span.source"],p=r.description;return f!=="url"&&p&&(l.transaction=p),Ve()&&(l.sampled=String(Mt(n)),l.sample_rand=(i==null?void 0:i.get("sentry.sample_rand"))??((h=jr(n).scope)==null?void 0:h.getPropagationContext().sampleRand.toString())),c(l),t.emit("createDsc",l,n),l}class tt{constructor(t={}){this._traceId=t.traceId||ft(),this._spanId=t.spanId||ct(),this.dropReason=t.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:tu}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}}function cu(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function Je(e,t=100,n=1/0){try{return si("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function uu(e,t=3,n=100*1024){const r=Je(e,t);return jf(r)>n?uu(e,t-1,n):r}function si(e,t,n=1/0,r=1/0,s=qf()){const[i,o]=s;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;const c=Uf(e,t);if(!c.startsWith("[object "))return c;if(t.__sentry_skip_normalization__)return t;const a=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(a===0)return c.replace("object ","");if(i(t))return"[Circular ~]";const u=t;if(u&&typeof u.toJSON=="function")try{const p=u.toJSON();return si("",p,a-1,r,s)}catch{}const d=Array.isArray(t)?[]:{};let l=0;const f=Hc(t);for(const p in f){if(!Object.prototype.hasOwnProperty.call(f,p))continue;if(l>=r){d[p]="[MaxProperties ~]";break}const h=f[p];d[p]=si(p,h,a-1,r,s),l++}return o(t),d}function Uf(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Fc(t))return Nc(t);if(Fd(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${lt(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=Wf(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Wf(e){const t=Object.getPrototypeOf(e);return t!=null&&t.constructor?t.constructor.name:"null prototype"}function zf(e){return~-encodeURI(e).split(/%..|./).length}function jf(e){return zf(JSON.stringify(e))}function qf(){const e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function At(e,t=[]){return[e,t]}function Vf(e,t){const[n,r]=e;return[n,[...r,t]]}function ii(e,t){const n=e[1];for(const r of n){const s=r[0].type;if(t(r,s))return!0}return!1}function Gf(e,t){return ii(e,(n,r)=>t.includes(r))}function oi(e){const t=as(V);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Yf(e){const[t,n]=e;let r=JSON.stringify(t);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[oi(r),i]:r.push(typeof i=="string"?oi(i):i)}for(const i of n){const[o,c]=i;if(s(`
${JSON.stringify(o)}
`),typeof c=="string"||c instanceof Uint8Array)s(c);else{let a;try{a=JSON.stringify(c)}catch{a=JSON.stringify(Je(c))}s(a)}}return typeof r=="string"?r:Kf(r)}function Kf(e){const t=e.reduce((s,i)=>s+i.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Xf(e){return[{type:"span"},e]}function Jf(e){const t=typeof e.data=="string"?oi(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const lu={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 Zf(e){return e in lu}function Vo(e){return Zf(e)?lu[e]:e}function ji(e){if(!(e!=null&&e.sdk))return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function du(e,t,n,r){var i;const s=(i=e.sdkProcessingMetadata)==null?void 0:i.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Tn(r)},...s&&{trace:s}}}function Qf(e,t){var r,s,i,o;if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...((r=e.sdk)==null?void 0:r.integrations)||[],...t.integrations||[]],packages:[...((s=e.sdk)==null?void 0:s.packages)||[],...t.packages||[]],settings:(i=e.sdk)!=null&&i.settings||t.settings?{...(o=e.sdk)==null?void 0:o.settings,...t.settings}:void 0},e}function ep(e,t,n,r){const s=ji(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:Tn(t)}},o="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return At(i,[o])}function tp(e,t,n,r){const s=ji(n),i=e.type&&e.type!=="replay_event"?e.type:"event";Qf(e,n==null?void 0:n.sdk);const o=du(e,s,r,t);return delete e.sdkProcessingMetadata,At(o,[[{type:i},e]])}function np(e,t){function n(p){return!!p.trace_id&&!!p.public_key}const r=ht(e[0]),s=t==null?void 0:t.getDsn(),i=t==null?void 0:t.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&s&&{dsn:Tn(s)}},{beforeSendSpan:c,ignoreSpans:a}=(t==null?void 0:t.getOptions())||{},u=a!=null&&a.length?e.filter(p=>!$n(te(p),a)):e,d=e.length-u.length;d&&(t==null||t.recordDroppedEvent("before_send","span",d));const l=c?p=>{const h=te(p),m=cu(c)?h:c(h);return m||(ri(),h)}:te,f=[];for(const p of u){const h=l(p);h&&f.push(Xf(h))}return At(o,f)}function rp(e){if(!R)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=te(e),{spanId:s}=e.spanContext(),i=Mt(e),o=ve(e),c=o===e,a=`[Tracing] Starting ${i?"sampled":"unsampled"} ${c?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${s}`];if(r&&u.push(`parent ID: ${r}`),!c){const{op:d,description:l}=te(o);u.push(`root ID: ${o.spanContext().spanId}`),d&&u.push(`root op: ${d}`),l&&u.push(`root description: ${l}`)}b.log(`${a}
${u.join(`
`)}`)}function sp(e){if(!R)return;const{description:t="< unknown name >",op:n="< unknown op >"}=te(e),{spanId:r}=e.spanContext(),i=ve(e)===e,o=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${t}" with ID ${r}`;b.log(o)}function ip(e,t,n,r=Te()){const s=r&&ve(r);s&&(R&&b.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),s.addEvent(e,{[Zn]:t,[Jn]:n}))}function Go(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},s=r[Jn],i=r[Zn];typeof s=="string"&&typeof i=="number"&&(t[n.name]={value:i,unit:s})}),t}function Qn(e){return e.getOptions().traceLifecycle==="stream"}const Yo=1e3;class fs{constructor(t={}){this._traceId=t.traceId||ft(),this._spanId=t.spanId||ct(),this._startTime=t.startTimestamp||me(),this._links=t.links,this._attributes={},this.setAttributes({[pe]:"manual",[pt]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._links?this._links.push(t):this._links=[t],this}addLinks(t){return this._links?this._links.push(...t):this._links=t,this}recordException(t,n){}spanContext(){const{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?ds:tu}}setAttribute(t,n){return n===void 0?delete this._attributes[t]:this._attributes[t]=n,this}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._startTime=$t(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute(Fe,"custom"),this}end(t){this._endTime||(this._endTime=$t(t),sp(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[pt],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:ru(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[pe],profile_id:this._attributes[Wi],exclusive_time:this._attributes[vn],measurements:Go(this._events),is_segment:this._isStandaloneSpan&&ve(this)===this||void 0,segment_id:this._isStandaloneSpan?ve(this).spanContext().spanId:void 0,links:nu(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===ve(this),status:Of(this._status),attributes:this._attributes,links:Af(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){R&&b.log("[Tracing] Adding an event to span:",t);const s=Ko(n)?n:r||me(),i=Ko(n)?{}:n||{},o={name:t,time:$t(s),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=W();if(t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===ve(this)))return;if(this._isStandaloneSpan){this._sampled?ap(np([this],t)):(R&&b.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}else if(t&&Qn(t)){t.emit("afterSegmentSpanEnd",this);return}const r=this._convertSpanToTransaction();r&&(jr(this).scope||ne()).captureEvent(r)}_convertSpanToTransaction(){var d;if(!Xo(te(this)))return;this._name||(R&&b.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=jr(this),r=(d=t==null?void 0:t.getScopeData().sdkProcessingMetadata)==null?void 0:d.normalizedRequest;if(this._sampled!==!0)return;const i=Rr(this).filter(l=>l!==this&&!op(l)).map(l=>te(l)).filter(Xo),o=this._attributes[Fe];delete this._attributes[Ho],i.forEach(l=>{delete l.data[Ho]});const c={contexts:{trace:Cf(this)},spans:i.length>Yo?i.sort((l,f)=>l.start_timestamp-f.start_timestamp).slice(0,Yo):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:ht(this)},request:r,...o&&{transaction_info:{source:o}}},a=Go(this._events);return a&&Object.keys(a).length&&(R&&b.log("[Measurements] Adding measurements to transaction event",JSON.stringify(a,void 0,2)),c.measurements=a),c}}function Ko(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function Xo(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function op(e){return e instanceof fs&&e.isStandaloneSpan()}function ap(e){const t=W();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function cp(e,t,n){if(!Ve(e))return[!1];let r,s;typeof e.tracesSampler=="function"?(s=e.tracesSampler({...t,inheritOrSampleWith:c=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):c}),r=!0):t.parentSampled!==void 0?s=t.parentSampled:typeof e.tracesSampleRate<"u"&&(s=e.tracesSampleRate,r=!0);const i=Wt(s);if(i===void 0)return R&&b.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 R&&b.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];const o=n<i;return o||R&&b.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),[o,i,r]}const up="__SENTRY_SUPPRESS_TRACING__";function It(e){const t=pu();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=dp(e),{forceTransaction:r,parentSpan:s}=e;return(e.scope?o=>Hi(e.scope,o):s!==void 0?o=>fu(s,o):o=>o())(()=>{const o=ne(),c=pp(o,s);return e.onlyIfParent&&!c?new tt:lp({parentSpan:c,spanArguments:n,forceTransaction:r,scope:o})})}function fu(e,t){const n=pu();return n.withActiveSpan?n.withActiveSpan(e,t):Hi(r=>(Pn(r,e||void 0),t(r)))}function lp({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!Ve()){const c=new tt;if(n||!e){const a={sampled:"false",sample_rate:"0",transaction:t.name,...ht(c)};xr(c,a)}return c}const s=W();if(hp(s,t))return qi(r)||s==null||s.recordDroppedEvent("ignored","span"),new tt({dropReason:"ignored",traceId:(e==null?void 0:e.spanContext().traceId)??r.getPropagationContext().traceId});const i=Ce();let o;if(e&&!n)o=fp(e,r,t),su(e,o);else if(e){const c=ht(e),{traceId:a,spanId:u}=e.spanContext(),d=Mt(e);o=Jo({traceId:a,parentSpanId:u,...t},r,d),xr(o,c)}else{const{traceId:c,dsc:a,parentSpanId:u,sampled:d}={...i.getPropagationContext(),...r.getPropagationContext()};o=Jo({traceId:c,parentSpanId:u,...t},r,d),a&&xr(o,a)}return rp(o),df(o,r,i),o}function dp(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=$t(e.startTime),delete r.startTime,r}return n}function pu(){const e=jt();return En(e)}function Jo(e,t,n){var m;const r=W(),s=(r==null?void 0:r.getOptions())||{},{name:i=""}=e,o={spanAttributes:{...e.attributes},spanName:i,parentSampled:n};r==null||r.emit("beforeSampling",o,{decision:!1});const c=o.parentSampled??n,a=o.spanAttributes,u=t.getPropagationContext(),d=qi(t),[l,f,p]=d?[!1]:cp(s,{name:i,parentSampled:c,attributes:a,parentSampleRate:Wt((m=u.dsc)==null?void 0:m.sample_rate)},u.sampleRand),h=new fs({...e,attributes:{[Fe]:"custom",[Ui]:f!==void 0&&p?f:void 0,...a},sampled:l});return!l&&r&&!d&&(R&&b.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",Qn(r)?"span":"transaction")),r&&r.emit("spanStart",h),h}function fp(e,t,n){const{spanId:r,traceId:s}=e.spanContext(),i=qi(t),o=i?!1:Mt(e),c=o?new fs({...n,parentSpanId:r,traceId:s,sampled:o}):new tt({traceId:s});su(e,c);const a=W();return a&&(Qn(a)&&c instanceof tt&&(e instanceof tt&&e.dropReason?(c.dropReason=e.dropReason,a.recordDroppedEvent(e.dropReason,"span")):i||(c.dropReason="sample_rate",a.recordDroppedEvent("sample_rate","span"))),a.emit("spanStart",c),n.endTimestamp&&(a.emit("spanEnd",c),a.emit("afterSpanEnd",c))),c}function pp(e,t){if(t)return t;if(t===null)return;const n=zr(e);if(!n)return;const r=W();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?ve(n):n}function hp(e,t){var r;const n=e==null?void 0:e.getOptions().ignoreSpans;return!e||!Qn(e)||!(n!=null&&n.length)?!1:$n({description:t.name||"",op:((r=t.attributes)==null?void 0:r[pt])||t.op},n)}function qi(e){return e.getScopeData().sdkProcessingMetadata[up]===!0}const Mr={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},mp="heartbeatFailed",_p="idleTimeout",gp="finalTimeout",yp="externalFinish";function hu(e,t={}){const n=new Map;let r=!1,s,i=yp,o=!t.disableAutoFinish;const c=[],{idleTimeout:a=Mr.idleTimeout,finalTimeout:u=Mr.finalTimeout,childSpanTimeout:d=Mr.childSpanTimeout,beforeSpanEnd:l,trimIdleSpanEndTimestamp:f=!0}=t,p=W();if(!p||!Ve()){const y=new tt,w={sample_rate:"0",sampled:"false",...ht(y)};return xr(y,w),y}const h=ne(),m=Te(),_=Sp(e);_.end=new Proxy(_.end,{apply(y,w,F){if(l&&l(_),w instanceof tt)return;const[E,...x]=F,T=E||me(),k=$t(T),M=Rr(_).filter(I=>I!==_),J=te(_);if(!M.length||!f)return A(k),Reflect.apply(y,w,[k,...x]);const K=p.getOptions().ignoreSpans,Z=M==null?void 0:M.reduce((I,L)=>{const ee=te(L);return!ee.timestamp||K&&$n(ee,K)?I:I?Math.max(I,ee.timestamp):ee.timestamp},void 0),v=J.start_timestamp,$=Math.min(v?v+u/1e3:1/0,Math.max(v||-1/0,Math.min(k,Z||1/0)));return A($),Reflect.apply(y,w,[$,...x])}});function g(){s&&(clearTimeout(s),s=void 0)}function S(y){g(),s=setTimeout(()=>{!r&&n.size===0&&o&&(i=_p,_.end(y))},a)}function N(y){s=setTimeout(()=>{!r&&o&&(i=mp,_.end(y))},d)}function C(y){g(),n.set(y,!0);const w=me();N(w+d/1e3)}function U(y){if(n.has(y)&&n.delete(y),n.size===0){const w=me();S(w+a/1e3)}}function A(y){r=!0,n.clear(),c.forEach(M=>M()),Pn(h,m);const w=te(_),{start_timestamp:F}=w;if(!F)return;w.data[Fn]||_.setAttribute(Fn,i);const x=w.status;(!x||x==="unknown")&&_.setStatus({code:ls}),b.log(`[Tracing] Idle span "${w.op}" finished`);const T=Rr(_).filter(M=>M!==_);let k=0;T.forEach(M=>{M.isRecording()&&(M.setStatus({code:Se,message:"cancelled"}),M.end(y),R&&b.log("[Tracing] Cancelling span since span ended early",JSON.stringify(M,void 0,2)));const J=te(M),{timestamp:K=0,start_timestamp:Z=0}=J,v=Z<=y,$=(u+a)/1e3,I=K-Z<=$;if(R){const L=JSON.stringify(M,void 0,2);v?I||b.log("[Tracing] Discarding span since it finished after idle span final timeout",L):b.log("[Tracing] Discarding span since it happened after idle span was finished",L)}(!I||!v)&&(Pf(_,M),k++)}),k>0&&_.setAttribute("sentry.idle_span_discarded_spans",k)}return c.push(p.on("spanStart",y=>{if(r||y===_||te(y).timestamp||y instanceof fs&&y.isStandaloneSpan())return;Rr(_).includes(y)&&C(y.spanContext().spanId)})),c.push(p.on("spanEnd",y=>{r||U(y.spanContext().spanId)})),c.push(p.on("idleSpanEnableAutoFinish",y=>{y===_&&(o=!0,S(),n.size&&N())})),t.disableAutoFinish||S(),setTimeout(()=>{r||(_.setStatus({code:Se,message:"deadline_exceeded"}),i=gp,_.end())},u),_}function Sp(e){const t=It(e);return Pn(ne(),t),R&&b.log("[Tracing] Started span is an idle span"),t}function bp(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=t;Ep(e,t),r&&wp(e,r),Ip(e,n),vp(e,s),Tp(e,i)}function Zo(e,t){const{extra:n,tags:r,attributes:s,user:i,contexts:o,level:c,sdkProcessingMetadata:a,breadcrumbs:u,fingerprint:d,eventProcessors:l,attachments:f,propagationContext:p,transactionName:h,span:m}=t;Cn(e,"extra",n),Cn(e,"tags",r),Cn(e,"attributes",s),Cn(e,"user",i),Cn(e,"contexts",o),e.sdkProcessingMetadata=Xn(e.sdkProcessingMetadata,a,2),c&&(e.level=c),h&&(e.transactionName=h),m&&(e.span=m),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),f.length&&(e.attachments=[...e.attachments,...f]),e.propagationContext={...e.propagationContext,...p}}function Cn(e,t,n){e[t]=Xn(e[t],n,1)}function mu(e,t){const n=jc().getScopeData();return e&&Zo(n,e.getScopeData()),t&&Zo(n,t.getScopeData()),n}function Ep(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:c}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(s).length&&(e.user={...s,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),o&&(e.level=o),c&&e.type!=="transaction"&&(e.transaction=c)}function vp(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Tp(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function wp(e,t){e.contexts={trace:Rf(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ht(t),...e.sdkProcessingMetadata};const n=ve(t),r=te(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Ip(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}const As=0,Qo=1,ea=2;function er(e){return new Bn(t=>{t(e)})}function Vi(e){return new Bn((t,n)=>{n(e)})}class Bn{constructor(t){this._state=As,this._handlers=[],this._runExecutor(t)}then(t,n){return new Bn((r,s)=>{this._handlers.push([!1,i=>{if(!t)r(i);else try{r(t(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new Bn((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,t&&t()},o=>{i=!0,s=o,t&&t()}).then(()=>{if(i){r(s);return}n(s)})})}_executeHandlers(){if(this._state===As)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Qo&&n[1](this._value),this._state===ea&&n[2](this._value),n[0]=!0)})}_runExecutor(t){const n=(i,o)=>{if(this._state===As){if(Gn(o)){o.then(r,s);return}this._state=i,this._value=o,this._executeHandlers()}},r=i=>{n(Qo,i)},s=i=>{n(ea,i)};try{t(r,s)}catch(i){s(i)}}}function kp(e,t,n,r=0){try{const s=ai(t,n,e,r);return Gn(s)?s:er(s)}catch(s){return Vi(s)}}function ai(e,t,n,r){const s=n[r];if(!e||!s)return e;const i=s({...e},t);return R&&i===null&&b.log(`Event processor "${s.id||"?"}" dropped event`),Gn(i)?i.then(o=>ai(o,t,n,r+1)):ai(i,t,n,r+1)}let st,ta,na,_t;function Cp(e){const t=V._sentryDebugIds,n=V._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],s=n?Object.keys(n):[];if(_t&&r.length===ta&&s.length===na)return _t;ta=r.length,na=s.length,_t={},st||(st={});const i=(o,c)=>{for(const a of o){const u=c[a],d=st==null?void 0:st[a];if(d&&_t&&u)_t[d[0]]=u,st&&(st[a]=[d[0],u]);else if(u){const l=e(a);for(let f=l.length-1;f>=0;f--){const p=l[f],h=p==null?void 0:p.filename;if(h&&_t&&st){_t[h]=u,st[a]=[h,u];break}}}}};return t&&i(r,t),n&&i(s,n),_t}function _u(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:c=1e3}=e,a={...t,event_id:t.event_id||n.event_id||$e(),timestamp:t.timestamp||Vt()},u=n.integrations||e.integrations.map(g=>g.name);Rp(a,e),Ap(a,u),s&&s.emit("applyFrameMetadata",t),t.type===void 0&&xp(a,e.stackParser);const d=Lp(r,n.captureContext);n.mechanism&&un(a,n.mechanism);const l=s?s.getEventProcessors():[],f=mu(i,d),p=[...n.attachments||[],...f.attachments];p.length&&(n.attachments=p),bp(a,f);const h=[...l,...f.eventProcessors];return(n.data&&n.data.__sentry__===!0?er(a):kp(h,a,n)).then(g=>(g&&Mp(g),typeof o=="number"&&o>0?Np(g,o,c):g))}function Rp(e,t){var c,a;const{environment:n,release:r,dist:s,maxValueLength:i}=t;e.environment=e.environment||n||zi,!e.release&&r&&(e.release=r),!e.dist&&s&&(e.dist=s);const o=e.request;o!=null&&o.url&&i&&(o.url=Qs(o.url,i)),i&&((a=(c=e.exception)==null?void 0:c.values)==null||a.forEach(u=>{u.value&&(u.value=Qs(u.value,i))}))}function xp(e,t){var r,s;const n=Cp(t);(s=(r=e.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,c;(c=(o=i.stacktrace)==null?void 0:o.frames)==null||c.forEach(a=>{a.filename&&(a.debug_id=n[a.filename])})})}function Mp(e){var r,s;const t={};if((s=(r=e.exception)==null?void 0:r.values)==null||s.forEach(i=>{var o,c;(c=(o=i.stacktrace)==null?void 0:o.frames)==null||c.forEach(a=>{a.debug_id&&(a.abs_path?t[a.abs_path]=a.debug_id:a.filename&&(t[a.filename]=a.debug_id),delete a.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([i,o])=>{n.push({type:"sourcemap",code_file:i,debug_id:o})})}function Ap(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Np(e,t,n){var s,i;if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:Je(o.data,t,n)}}))},...e.user&&{user:Je(e.user,t,n)},...e.contexts&&{contexts:Je(e.contexts,t,n)},...e.extra&&{extra:Je(e.extra,t,n)}};return(s=e.contexts)!=null&&s.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Je(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:Je(o.data,t,n)}}))),(i=e.contexts)!=null&&i.flags&&r.contexts&&(r.contexts.flags=Je(e.contexts.flags,3,n)),r}function Lp(e,t){if(!t)return e;const n=e?e.clone():new nt;return n.update(t),n}function Dp(e){if(e)return Op(e)?{captureContext:e}:Fp(e)?{captureContext:e}:e}function Op(e){return e instanceof nt||typeof e=="function"}const Pp=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Fp(e){return Object.keys(e).some(t=>Pp.includes(t))}function ps(e,t){return ne().captureException(e,Dp(t))}function gu(e,t){return ne().captureEvent(e,t)}function $p(e,t){Ce().setContext(e,t)}function M0(e,t){Ce().setTag(e,t)}function A0(e){Ce().setUser(e)}function Bp(){const e=W();return(e==null?void 0:e.getOptions().enabled)!==!1&&!!(e!=null&&e.getTransport())}function Hp(e){Ce().addEventProcessor(e)}function ra(e){const t=Ce(),{user:n}=mu(t,ne()),{userAgent:r}=V.navigator||{},s=Vd({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return(i==null?void 0:i.status)==="ok"&&ln(i,{status:"exited"}),yu(),t.setSession(s),s}function yu(){const e=Ce(),n=ne().getSession()||e.getSession();n&&Gd(n),Su(),e.setSession()}function Su(){const e=Ce(),t=W(),n=e.getSession();n&&t&&t.captureSession(n)}function Ns(e=!1){if(e){yu();return}Su()}const Up="7";function Wp(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function zp(e){return`${Wp(e)}${e.projectId}/envelope/`}function jp(e,t){const n={sentry_version:Up};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function qp(e,t,n){return t||`${zp(e)}?${jp(e,n)}`}const sa=[];function Vp(e){const t={};return e.forEach(n=>{const{name:r}=n,s=t[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function Gp(e){const t=e.defaultIntegrations||[],n=e.integrations;t.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){const s=n(t);r=Array.isArray(s)?s:[s]}else r=t;return Vp(r)}function Yp(e,t){const n={};return t.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&bu(e,r,n)}),n}function ia(e,t){for(const n of t)n!=null&&n.afterAllSetup&&n.afterAllSetup(e)}function bu(e,t,n){if(n[t.name]){R&&b.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!sa.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),sa.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(s,i)=>r(s,i,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),s=Object.assign((i,o)=>r(i,o,e),{id:t.name});e.addEventProcessor(s)}R&&b.log(`Integration installed: ${t.name}`)}function oa(e){const t=W();if(!t){R&&b.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function Kp(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Xp(e,t,n,r){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Tn(r)),At(s,[Kp(e)])}function ci(e,t){const n=t??Jp(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Xp(n,r._metadata,r.tunnel,e.getDsn());Eu().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function Jp(e){return Eu().get(e)}function Eu(){return Sn("clientToLogBufferMap",()=>new WeakMap)}function Zp(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function Qp(e,t,n,r){const s={};return t!=null&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Tn(r)),At(s,[Zp(e)])}function vu(e,t){const n=t??eh(e)??[];if(n.length===0)return;const r=e.getOptions(),s=Qp(n,r._metadata,r.tunnel,e.getDsn());Tu().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}function eh(e){return Tu().get(e)}function Tu(){return Sn("clientToMetricBufferMap",()=>new WeakMap)}function wu(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}const Gi=Symbol.for("SentryBufferFullError");function Yi(e=100){const t=new Set;function n(){return t.size<e}function r(o){t.delete(o)}function s(o){if(!n())return Vi(Gi);const c=o();return t.add(c),c.then(()=>r(c),()=>r(c)),c}function i(o){if(!t.size)return er(!0);const c=Promise.allSettled(Array.from(t)).then(()=>!0);if(!o)return c;const a=[c,new Promise(u=>wu(setTimeout(()=>u(!1),o)))];return Promise.race(a)}return{get $(){return Array.from(t)},add:s,drain:i}}const th=60*1e3;function nh(e,t=Kn()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?th:r-t}function rh(e,t){return e[t]||e.all||0}function Iu(e,t,n=Kn()){return rh(e,t)>n}function ku(e,{statusCode:t,headers:n},r=Kn()){const s={...e},i=n==null?void 0:n["x-sentry-rate-limits"],o=n==null?void 0:n["retry-after"];if(i)for(const c of i.trim().split(",")){const[a,u,,,d]=c.split(":",5),l=parseInt(a,10),f=(isNaN(l)?60:l)*1e3;if(!u)s.all=r+f;else for(const p of u.split(";"))p==="metric_bucket"?(!d||d.split(";").includes("custom"))&&(s[p]=r+f):s[p]=r+f}else o?s.all=r+nh(o,r):t===429&&(s.all=r+60*1e3);return s}const Cu=64;function sh(e,t,n=Yi(e.bufferSize||Cu)){let r={};const s=o=>n.drain(o);function i(o){const c=[];if(ii(o,(l,f)=>{const p=Vo(f);Iu(r,p)?e.recordDroppedEvent("ratelimit_backoff",p):c.push(l)}),c.length===0)return Promise.resolve({});const a=At(o[0],c),u=l=>{if(Gf(a,["client_report"])){R&&b.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}ii(a,(f,p)=>{e.recordDroppedEvent(l,Vo(p))})},d=()=>t({body:Yf(a)}).then(l=>l.statusCode===413?(R&&b.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),l):(R&&l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&b.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=ku(r,l),l),l=>{throw u("network_error"),R&&b.error("Encountered error running transport request:",l),l});return n.add(d).then(l=>l,l=>{if(l===Gi)return R&&b.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:i,flush:s}}function ih(e,t,n){const r=[{type:"client_report"},{timestamp:Vt(),discarded_events:e}];return At(t?{dsn:t}:{},[r])}function Ru(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];n!=null&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function oh(e){var a;const{trace_id:t,parent_span_id:n,span_id:r,status:s,origin:i,data:o,op:c}=((a=e.contexts)==null?void 0:a.trace)??{};return{data:o??{},description:e.transaction,op:c,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:s,timestamp:e.timestamp,trace_id:t??"",origin:i,profile_id:o==null?void 0:o[Wi],exclusive_time:o==null?void 0:o[vn],measurements:e.measurements,is_segment:!0}}function ah(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[Wi]:e.profile_id},...e.exclusive_time&&{[vn]:e.exclusive_time}}}},measurements:e.measurements}}const aa="Not capturing exception because it's already been captured.",ca="Discarded session because of missing or non-string release",xu=Symbol.for("SentryInternalError"),Mu=Symbol.for("SentryDoNotSendEventError"),ch=5e3;function Ar(e){return{message:e,[xu]:!0}}function Ls(e){return{message:e,[Mu]:!0}}function ua(e){return!!e&&typeof e=="object"&&xu in e}function la(e){return!!e&&typeof e=="object"&&Mu in e}function da(e,t,n,r,s){let i=0,o,c=!1;e.on(n,()=>{i=0,clearTimeout(o),c=!1}),e.on(t,a=>{i+=r(a),i>=8e5?s(e):c||(c=!0,o=wu(setTimeout(()=>{s(e)},ch)))}),e.on("flush",()=>{s(e)})}class uh{constructor(t){var r,s,i;if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Yi(((r=t.transportOptions)==null?void 0:r.bufferSize)??Cu),t.dsn?this._dsn=Tf(t.dsn):R&&b.warn("No DSN provided, client will not send events."),this._dsn){const o=qp(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:o})}this._options.enableLogs=this._options.enableLogs??((s=this._options._experiments)==null?void 0:s.enableLogs),this._options.enableLogs&&da(this,"afterCaptureLog","flushLogs",ph,ci),(this._options.enableMetrics??((i=this._options._experiments)==null?void 0:i.enableMetrics)??!0)&&da(this,"afterCaptureMetric","flushMetrics",fh,vu)}captureException(t,n,r){const s=$e();if(Po(t))return R&&b.log(aa),s;const i={event_id:s,...n};return this._process(()=>this.eventFromException(t,i).then(o=>this._captureEvent(o,i,r)).then(o=>o),"error"),i.event_id}captureMessage(t,n,r,s){const i={event_id:$e(),...r},o=Pi(t)?t:String(t),c=cn(t),a=c?this.eventFromMessage(o,n,i):this.eventFromException(t,i);return this._process(()=>a.then(u=>this._captureEvent(u,i,s)),c?"unknown":"error"),i.event_id}captureEvent(t,n,r){const s=$e();if(n!=null&&n.originalException&&Po(n.originalException))return R&&b.log(aa),s;const i={event_id:s,...n},o=t.sdkProcessingMetadata||{},c=o.capturedSpanScope,a=o.capturedSpanIsolationScope,u=fa(t.type);return this._process(()=>this._captureEvent(t,i,c||r,a),u),i.event_id}captureSession(t){this.sendSession(t),ln(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){const n=this._transport;if(!n)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(t),s=await n.flush(t);return r&&s}async close(t){ci(this);const n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),bu(this,t,this._integrations),n||ia(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=tp(t,this._dsn,this._options._metadata,this._options.tunnel);for(const s of n.attachments||[])r=Vf(r,Jf(s));this.sendEnvelope(r).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){const{release:n,environment:r=zi}=this._options;if("aggregates"in t){const i=t.attrs||{};if(!i.release&&!n){R&&b.warn(ca);return}i.release=i.release||n,i.environment=i.environment||r,t.attrs=i}else{if(!t.release&&!n){R&&b.warn(ca);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);const s=ep(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){const s=`${t}:${n}`;R&&b.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(t,n){const r=this._hooks[t]=this._hooks[t]||new Set,s=(...i)=>n(...i);return r.add(s),()=>{r.delete(s)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(s=>s(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return R&&b.error("Error while sending envelope:",n),{}}return R&&b.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=Yp(this,t),ia(this,t)}_updateSessionFromEvent(t,n){var a,u;let r=n.level==="fatal",s=!1;const i=(a=n.exception)==null?void 0:a.values;if(i){s=!0,r=!1;for(const d of i)if(((u=d.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const o=t.status==="ok";(o&&t.errors===0||o&&r)&&(ln(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,s){const i=this.getOptions(),o=Object.keys(this._integrations);return!n.integrations&&(o!=null&&o.length)&&(n.integrations=o),this.emit("preprocessEvent",t,n),t.type||s.setLastEventId(t.event_id||n.event_id),_u(i,t,n,r,this,s).then(c=>{var u;if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts={trace:{...(u=c.contexts)==null?void 0:u.trace,...sf(r)},...c.contexts};const a=au(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:a,...c.sdkProcessingMetadata},c})}_captureEvent(t,n={},r=ne(),s=Ce()){return R&&ui(t)&&b.log(`Captured error event \`${Ru(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,s).then(i=>i.event_id,i=>{R&&(la(i)?b.log(i.message):ua(i)?b.warn(i.message):b.warn(i))})}_processEvent(t,n,r,s){const i=this.getOptions(),{sampleRate:o}=i,c=Au(t),a=ui(t),d=`before send for type \`${t.type||"error"}\``,l=typeof o>"u"?void 0:Wt(o);if(a&&typeof l=="number"&&Et()>l)return this.recordDroppedEvent("sample_rate","error"),Vi(Ls(`Discarding event because it's not included in the random sample (sampling rate = ${o})`));const f=fa(t.type);return this._prepareEvent(t,n,r,s).then(p=>{var _;if(p===null)throw this.recordDroppedEvent("event_processor",f),Ls("An event processor returned `null`, will not send event.");if(((_=n.data)==null?void 0:_.__sentry__)===!0)return p;const m=dh(this,i,p,n);return lh(m,d)}).then(p=>{var _;if(p===null){if(this.recordDroppedEvent("before_send",f),c){const S=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",S)}throw Ls(`${d} returned \`null\`, will not send event.`)}const h=r.getSession()||s.getSession();if(a&&h&&this._updateSessionFromEvent(h,p),c){const g=((_=p.sdkProcessingMetadata)==null?void 0:_.spanCountBeforeProcessing)||0,S=p.spans?p.spans.length:0,N=g-S;N>0&&this.recordDroppedEvent("before_send","span",N)}const m=p.transaction_info;if(c&&m&&p.transaction!==t.transaction){const g="custom";p.transaction_info={...m,source:g}}return this.sendEvent(p,n),p}).then(null,p=>{throw la(p)||ua(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),Ar(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: ${p}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Gi&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[s,i]=n.split(":");return{reason:s,category:i,quantity:r}})}_flushOutcomes(){R&&b.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){R&&b.log("No outcomes to send");return}if(!this._dsn){R&&b.log("No dsn provided, will not send outcomes");return}R&&b.log("Sending outcomes:",t);const n=ih(t,this._options.tunnel&&Tn(this._dsn));this.sendEnvelope(n)}}function fa(e){return e==="replay_event"?"replay":e||"error"}function lh(e,t){const n=`${t} must return \`null\` or a valid event.`;if(Gn(e))return e.then(r=>{if(!On(r)&&r!==null)throw Ar(n);return r},r=>{throw Ar(`${t} rejected with ${r}`)});if(!On(e)&&e!==null)throw Ar(n);return e}function dh(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,ignoreSpans:o}=t,c=!cu(t.beforeSendSpan)&&t.beforeSendSpan;let a=n;if(ui(a)&&s)return s(a,r);if(Au(a)){if(c||o){const u=oh(a);if(o!=null&&o.length&&$n(u,o))return null;if(c){const d=c(u);d?a=Xn(n,ah(d)):ri()}if(a.spans){const d=[],l=a.spans;for(const p of l){if(o!=null&&o.length&&$n(p,o)){Bf(l,p);continue}if(c){const h=c(p);h?d.push(h):(ri(),d.push(p))}else d.push(p)}const f=a.spans.length-d.length;f&&e.recordDroppedEvent("before_send","span",f),a.spans=d}}if(i){if(a.spans){const u=a.spans.length;a.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return i(a,r)}}return a}function ui(e){return e.type===void 0}function Au(e){return e.type==="transaction"}function fh(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Nu(e.attributes)}function ph(e){let t=0;return e.message&&(t+=e.message.length*2),t+Nu(e.attributes)}function Nu(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*pa(n[0]):cn(n)?t+=pa(n):t+=100}),t}function pa(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function hh(e){return cs(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function ha(e){return hh(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function mh(e,t){t.debug===!0&&(R?b.enable():rt(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),ne().update(t.initialScope);const r=new e(t);return _h(r),r.init(),r}function _h(e){ne().setClient(e)}const gh="thismessage:/";function Ki(e){return"isRelative"in e}function Xi(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?gh:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const s=new URL(e,r);return n?{isRelative:n,pathname:s.pathname,search:s.search,hash:s.hash}:s}catch{}}function yh(e){if(Ki(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function Ht(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Sh(e){return e.split(/[?#]/,1)[0]}function vt(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=e.includes(";base64,"),i=e.indexOf(",");let o="";if(t&&i!==-1){const c=e.slice(i+1);o=c.length>10?`${c.slice(0,10)}... [truncated]`:c}return`data:${r}${s?",base64":""}${o?`,${o}`:""}`}return e}function bh(e,t){const n=t==null?void 0:t.getDsn(),r=t==null?void 0:t.getOptions().tunnel;return vh(e,n)||Eh(e,r)}function Eh(e,t){return t?ma(e)===ma(t):!1}function vh(e,t){const n=Xi(e);return!n||Ki(n)?!1:t?n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search):!1}function ma(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function Th(e){var t;"aggregates"in e?((t=e.attrs)==null?void 0:t.ip_address)===void 0&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):e.ipAddress===void 0&&(e.ipAddress="{{auto}}")}function Lu(e,t,n=[t],r="npm"){const s=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${t}`,s.packages=n.map(i=>({name:`${r}:@sentry/${i}`,version:Ft})),s.version=Ft)}function Du(e={}){const t=e.client||W();if(!Bp()||!t)return{};const n=jt(),r=En(n);if(r.getTraceData)return r.getTraceData(e);const s=e.scope||ne(),i=e.span||Te(),o=i?xf(i):wh(s),c=i?ht(i):au(t,s),a=pf(c);if(!Zc.test(o))return b.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":o,baggage:a};return e.propagateTraceparent&&(d.traceparent=i?Mf(i):Ih(s)),d}function wh(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Qc(t,r,n)}function Ih(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return eu(t,r,n)}function kh(e,t,n){let r,s,i;const o=n!=null&&n.maxWait?Math.max(n.maxWait,t):0,c=(n==null?void 0:n.setTimeoutImpl)||setTimeout;function a(){return u(),r=e(),r}function u(){s!==void 0&&clearTimeout(s),i!==void 0&&clearTimeout(i),s=i=void 0}function d(){return s!==void 0||i!==void 0?a():r}function l(){return s&&clearTimeout(s),s=c(a,t),o&&i===void 0&&(i=c(a,o)),r}return l.cancel=u,l.flush=d,l}const Ch=100;function kt(e,t){const n=W(),r=Ce();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=Ch}=n.getOptions();if(i<=0)return;const c={timestamp:Vt(),...e},a=s?rt(()=>s(c,t)):c;a!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}let _a;const Rh="FunctionToString",ga=new WeakMap,xh=()=>({name:Rh,setupOnce(){_a=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=Bi(this),n=ga.has(W())&&t!==void 0?t:this;return _a.apply(n,e)}}catch{}},setup(e){ga.set(e,!0)}}),Mh=xh,Ah=[/^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$/],Nh="EventFilters",Lh=(e={})=>{let t;return{name:Nh,setup(n){const r=n.getOptions();t=ya(e,r)},processEvent(n,r,s){if(!t){const i=s.getOptions();t=ya(e,i)}return Oh(n,t)?null:n}}},Dh=(e={})=>({...Lh(e),name:"InboundFilters"});function ya(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Ah],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Oh(e,t){if(e.type){if(e.type==="transaction"&&Fh(e,t.ignoreTransactions))return R&&b.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${Nt(e)}`),!0}else{if(Ph(e,t.ignoreErrors))return R&&b.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${Nt(e)}`),!0;if(Uh(e))return R&&b.warn(`Event dropped due to not having an error message, error type or stacktrace.
Event: ${Nt(e)}`),!0;if($h(e,t.denyUrls))return R&&b.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${Nt(e)}.
Url: ${Vr(e)}`),!0;if(!Bh(e,t.allowUrls))return R&&b.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${Nt(e)}.
Url: ${Vr(e)}`),!0}return!1}function Ph(e,t){return t!=null&&t.length?Ru(e).some(n=>at(n,t)):!1}function Fh(e,t){if(!(t!=null&&t.length))return!1;const n=e.transaction;return n?at(n,t):!1}function $h(e,t){if(!(t!=null&&t.length))return!1;const n=Vr(e);return n?at(n,t):!1}function Bh(e,t){if(!(t!=null&&t.length))return!0;const n=Vr(e);return n?at(n,t):!0}function Hh(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Vr(e){var t,n;try{const r=[...((t=e.exception)==null?void 0:t.values)??[]].reverse().find(i=>{var o,c,a;return((o=i.mechanism)==null?void 0:o.parent_id)===void 0&&((a=(c=i.stacktrace)==null?void 0:c.frames)==null?void 0:a.length)}),s=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return s?Hh(s):null}catch{return R&&b.error(`Cannot extract url for event ${Nt(e)}`),null}}function Uh(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)!=null&&n.length?!e.message&&!e.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function Wh(e,t,n,r,s,i){var c;if(!((c=s.exception)!=null&&c.values)||!i||!dt(i.originalException,Error))return;const o=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;o&&(s.exception.values=li(e,t,r,i.originalException,n,s.exception.values,o,0))}function li(e,t,n,r,s,i,o,c){if(i.length>=n+1)return i;let a=[...i];if(dt(r[s],Error)){Sa(o,c,r);const u=e(t,r[s]),d=a.length;ba(u,s,d,c),a=li(e,t,n,r[s],s,[u,...a],u,d)}return Ou(r)&&r.errors.forEach((u,d)=>{if(dt(u,Error)){Sa(o,c,r);const l=e(t,u),f=a.length;ba(l,`errors[${d}]`,f,c),a=li(e,t,n,u,s,[l,...a],l,f)}}),a}function Ou(e){return Array.isArray(e.errors)}function Sa(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Ou(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function ba(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function zh(e){const t="console";Rt(t,e),xt(t,jh)}function jh(){"console"in V&&Td.forEach(function(e){e in V.console&&Ae(V.console,e,function(t){return Wr[e]=t,function(...n){qe("console",{args:n,level:e});const s=Wr[e];s==null||s.apply(V.console,n)}})})}function Pu(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const qh="Dedupe",Vh=()=>{let e;return{name:qh,processEvent(t){if(t.type)return t;try{if(Yh(t,e))return R&&b.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},Gh=Vh;function Yh(e,t){return t?!!(Kh(e,t)||Xh(e,t)):!1}function Kh(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!$u(e,t)||!Fu(e,t))}function Xh(e,t){const n=Ea(t),r=Ea(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!$u(e,t)||!Fu(e,t))}function Fu(e,t){let n=Mo(e),r=Mo(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s<r.length;s++){const i=r[s],o=n[s];if(i.filename!==o.filename||i.lineno!==o.lineno||i.colno!==o.colno||i.function!==o.function)return!1}return!0}function $u(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function Ea(e){var t,n;return(n=(t=e.exception)==null?void 0:t.values)==null?void 0:n[0]}const Jh="ConversationId",Zh=()=>({name:Jh,setup(e){e.on("spanStart",t=>{const n=ne().getScopeData(),r=Ce().getScopeData(),s=n.conversationId||r.conversationId;s&&t.setAttribute(af,s)})}}),Qh=Zh;function em(e,t,n,r,s){if(!e.fetchData)return;const{method:i,url:o}=e.fetchData,c=Ve()&&t(o);if(e.endTimestamp){const p=e.fetchData.__span;if(!p)return;const h=r[p];h&&(c&&(rm(h,e),tm(h,e,s)),delete r[p]);return}const{spanOrigin:a="auto.http.browser",propagateTraceparent:u=!1}=typeof s=="object"?s:{spanOrigin:s},d=!!Te(),l=c&&d?It(im(o,i,a)):new tt;if(e.fetchData.__span=l.spanContext().spanId,r[l.spanContext().spanId]=l,n(e.fetchData.url)){const p=e.args[0],h={...e.args[1]||{}},m=nm(p,h,Ve()&&d?l:void 0,u);m&&(e.args[1]=h,h.headers=m)}const f=W();if(f){const p={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};f.emit("beforeOutgoingRequestSpan",l,p)}return l}function tm(e,t,n){var s;const r=typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0;r==null||r(e,{headers:(s=t.response)==null?void 0:s.headers,error:t.error})}function nm(e,t,n,r){const s=Du({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,c=s.traceparent;if(!i)return;const a=t.headers||(Fi(e)?e.headers:void 0);if(a)if(sm(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 d=u.get("baggage");d?hr(d)||u.set("baggage",`${d},${o}`):u.set("baggage",o)}return u}else if(Array.isArray(a)){const u=[...a];a.find(l=>l[0]==="sentry-trace")||u.push(["sentry-trace",i]),r&&c&&!a.find(l=>l[0]==="traceparent")&&u.push(["traceparent",c]);const d=a.find(l=>l[0]==="baggage"&&hr(l[1]));return o&&!d&&u.push(["baggage",o]),u}else{const u="sentry-trace"in a?a["sentry-trace"]:void 0,d="traceparent"in a?a.traceparent:void 0,l="baggage"in a?a.baggage:void 0,f=l?Array.isArray(l)?[...l]:[l]:[],p=l&&(Array.isArray(l)?l.find(m=>hr(m)):hr(l));o&&!p&&f.push(o);const h={...a,"sentry-trace":u??i,baggage:f.length>0?f.join(","):void 0};return r&&c&&!d&&(h.traceparent=c),h}else return{...s}}function rm(e,t){var n,r;if(t.response){Gc(e,t.response.status);const s=(r=(n=t.response)==null?void 0:n.headers)==null?void 0:r.get("content-length");if(s){const i=parseInt(s);i>0&&e.setAttribute("http.response_content_length",i)}}else t.error&&e.setStatus({code:Se,message:"internal_error"});e.end()}function hr(e){return e.split(",").some(t=>t.trim().startsWith(qr))}function sm(e){return typeof Headers<"u"&&dt(e,Headers)}function im(e,t,n){if(e.startsWith("data:")){const i=vt(e);return{name:`${t} ${i}`,attributes:va(e,void 0,t,n)}}const r=Xi(e),s=r?yh(r):e;return{name:`${t} ${s}`,attributes:va(e,r,t,n)}}function va(e,t,n,r){const s={url:vt(e),type:"fetch","http.method":n,[pe]:r,[pt]:"http.client"};return t&&(Ki(t)||(s["http.url"]=vt(t.href),s["server.address"]=t.host),t.search&&(s["http.query"]=t.search),t.hash&&(s["http.fragment"]=t.hash)),s}function om(e,t={},n=ne()){const{message:r,name:s,email:i,url:o,source:c,associatedEventId:a,tags:u}=e,d={contexts:{feedback:{contact_email:i,name:s,message:r,url:o,source:c,associated_event_id:a}},type:"feedback",level:"info",tags:u},l=(n==null?void 0:n.getClient())||W();return l&&l.emit("beforeSendFeedback",d,t),n.captureEvent(d,t)}function Bu(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}const Hn=V;function am(){return"history"in Hn&&!!Hn.history}function cm(){if(!("fetch"in Hn))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function di(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function um(){var n;if(typeof EdgeRuntime=="string")return!0;if(!cm())return!1;if(di(Hn.fetch))return!0;let e=!1;const t=Hn.document;if(t&&typeof t.createElement=="function")try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(e=di(r.contentWindow.fetch)),t.head.removeChild(r)}catch(r){R&&b.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return e}function Hu(e,t){const n="fetch";Rt(n,e),xt(n,()=>Uu(void 0,t))}function lm(e){const t="fetch-body-resolved";Rt(t,e),xt(t,()=>Uu(fm))}function Uu(e,t=!1){t&&!um()||Ae(V,"fetch",function(n){return function(...r){const s=new Error,{method:i,url:o}=pm(r),c={args:r,fetchData:{method:i,url:o},startTimestamp:me()*1e3,virtualError:s,headers:hm(r)};return e||qe("fetch",{...c}),n.apply(V,r).then(async a=>(e?e(a):qe("fetch",{...c,endTimestamp:me()*1e3,response:a}),a),a=>{qe("fetch",{...c,endTimestamp:me()*1e3,error:a}),cs(a)&&a.stack===void 0&&(a.stack=s.stack,Le(a,"framesToPop",1));const u=W(),d=(u==null?void 0:u.getOptions().enhanceFetchErrorMessages)??"always";if(d!==!1&&a instanceof TypeError&&(a.message==="Failed to fetch"||a.message==="Load failed"||a.message==="NetworkError when attempting to fetch resource."))try{const p=new URL(c.fetchData.url).host;d==="always"?a.message=`${a.message} (${p})`:Le(a,"__sentry_fetch_url_host__",p)}catch{}throw a})}})}async function dm(e,t){if(e!=null&&e.body){const n=e.body,r=n.getReader(),s=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let i=!0;for(;i;){let o;try{o=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:c}=await r.read();clearTimeout(o),c&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(o)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}}function fm(e){let t;try{t=e.clone()}catch{return}dm(t,()=>{qe("fetch-body-resolved",{endTimestamp:me()*1e3,response:e})})}function Nr(e,t){return!!e&&typeof e=="object"&&!!e[t]}function Ta(e){return typeof e=="string"?e:e?Nr(e,"url")?e.url:e.toString?e.toString():"":""}function pm(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:Ta(n),method:Nr(r,"method")?String(r.method).toUpperCase():Fi(n)&&Nr(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:Ta(t),method:Nr(t,"method")?String(t.method).toUpperCase():"GET"}}function hm(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Fi(t))return new Headers(t.headers)}catch{}}function mm(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function _m(){return"npm"}function gm(){return!mm()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Gr(){return typeof window<"u"&&(!gm()||ym())}function ym(){const e=V.process;return(e==null?void 0:e.type)==="renderer"}const Qe=V,se=Qe.document,xn=Qe.navigator,Wu="Report a Bug",Sm="Cancel",bm="Send Bug Report",Em="Confirm",vm="Report a Bug",Tm="your.email@example.org",wm="Email",Im="What's the bug? What did you expect?",km="Description",Cm="Your Name",Rm="Name",xm="Thank you for your report!",Mm="(required)",Am="Add a screenshot",Nm="Remove screenshot",Lm="Highlight",Dm="Hide",Om="Remove",Pm="widget",Fm="api",$m=5e3,Bm=(e,t={includeReplay:!0})=>{if(!e.message)throw new Error("Unable to submit feedback with empty message");const n=W();if(!n)throw new Error("No client setup, cannot send feedback.");e.tags&&Object.keys(e.tags).length&&ne().setTags(e.tags);const r=om({source:Fm,url:qt(),...e},t);return new Promise((s,i)=>{const o=setTimeout(()=>i("Unable to determine if Feedback was correctly sent."),3e4),c=n.on("afterSendEvent",(a,u)=>{if(a.event_id===r)return clearTimeout(o),c(),u!=null&&u.statusCode&&u.statusCode>=200&&u.statusCode<300?s(r):(u==null?void 0:u.statusCode)===403?i("Unable to send feedback. This could be because this domain is not in your list of allowed domains."):i("Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.")})})},Lr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Hm(){return!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(xn.userAgent)||/Macintosh/i.test(xn.userAgent)&&xn.maxTouchPoints&&xn.maxTouchPoints>1||!isSecureContext)}function mr(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{var n,r;(n=t.onFormOpen)==null||n.call(t),(r=e.onFormOpen)==null||r.call(e)},onFormClose:()=>{var n,r;(n=t.onFormClose)==null||n.call(t),(r=e.onFormClose)==null||r.call(e)},onSubmitSuccess:(n,r)=>{var s,i;(s=t.onSubmitSuccess)==null||s.call(t,n,r),(i=e.onSubmitSuccess)==null||i.call(e,n,r)},onSubmitError:n=>{var r,s;(r=t.onSubmitError)==null||r.call(t,n),(s=e.onSubmitError)==null||s.call(e,n)},onFormSubmitted:()=>{var n,r;(n=t.onFormSubmitted)==null||n.call(t),(r=e.onFormSubmitted)==null||r.call(e)},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function Um(e){const t=se.createElement("style");return t.textContent=`
.widget__actor {
position: fixed;
z-index: var(--z-index);
margin: var(--page-margin);
inset: var(--actor-inset);
display: flex;
align-items: center;
gap: 8px;
padding: 16px;
font-family: inherit;
font-size: var(--font-size);
font-weight: 600;
line-height: 1.14em;
text-decoration: none;
background: var(--actor-background, var(--background));
border-radius: var(--actor-border-radius, 1.7em/50%);
border: var(--actor-border, var(--border));
box-shadow: var(--actor-box-shadow, var(--box-shadow));
color: var(--actor-color, var(--foreground));
fill: var(--actor-color, var(--foreground));
cursor: pointer;
opacity: 1;
transition: transform 0.2s ease-in-out;
transform: translate(0, 0) scale(1);
}
.widget__actor[aria-hidden="true"] {
opacity: 0;
pointer-events: none;
visibility: hidden;
transform: translate(0, 16px) scale(0.98);
}
.widget__actor:hover {
background: var(--actor-hover-background, var(--background));
filter: var(--interactive-filter);
}
.widget__actor svg {
width: 1.14em;
height: 1.14em;
}
@media (max-width: 600px) {
.widget__actor span {
display: none;
}
}
`,e&&t.setAttribute("nonce",e),t}function Pe(e,t){return Object.entries(t).forEach(([n,r])=>{e.setAttributeNS(null,n,r)}),e}const Kt=20,Wm="http://www.w3.org/2000/svg";function zm(){const e=c=>Qe.document.createElementNS(Wm,c),t=Pe(e("svg"),{width:`${Kt}`,height:`${Kt}`,viewBox:`0 0 ${Kt} ${Kt}`,fill:"var(--actor-color, var(--foreground))"}),n=Pe(e("g"),{clipPath:"url(#clip0_57_80)"}),r=Pe(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.4556 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z"});t.appendChild(n).appendChild(r);const s=e("defs"),i=Pe(e("clipPath"),{id:"clip0_57_80"}),o=Pe(e("rect"),{width:`${Kt}`,height:`${Kt}`,fill:"white"});return i.appendChild(o),s.appendChild(i),t.appendChild(s).appendChild(i).appendChild(o),t}function jm({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){const s=se.createElement("button");if(s.type="button",s.className="widget__actor",s.ariaHidden="false",s.ariaLabel=t||e||Wu,s.appendChild(zm()),e){const o=se.createElement("span");o.appendChild(se.createTextNode(e)),s.appendChild(o)}const i=Um(r);return{el:s,appendToDom(){n.appendChild(i),n.appendChild(s)},removeFromDom(){s.remove(),i.remove()},show(){s.ariaHidden="false"},hide(){s.ariaHidden="true"}}}const zu="rgba(88, 74, 192, 1)",qm={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:zu,successColor:"#268d75",errorColor:"#df3338",border:"1.5px solid rgba(41, 35, 47, 0.13)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(95%)"},wa={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:zu,successColor:"#2da98c",errorColor:"#f55459",border:"1.5px solid rgba(235, 230, 239, 0.15)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(150%)"};function Ia(e){return`
--foreground: ${e.foreground};
--background: ${e.background};
--accent-foreground: ${e.accentForeground};
--accent-background: ${e.accentBackground};
--success-color: ${e.successColor};
--error-color: ${e.errorColor};
--border: ${e.border};
--box-shadow: ${e.boxShadow};
--outline: ${e.outline};
--interactive-filter: ${e.interactiveFilter};
`}function ka({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){const s=se.createElement("style");return s.textContent=`
:host {
--font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;
--font-size: 14px;
--z-index: 100000;
--page-margin: 16px;
--inset: auto 0 0 auto;
--actor-inset: var(--inset);
font-family: var(--font-family);
font-size: var(--font-size);
${e!=="system"?`color-scheme: only ${e};`:""}
${Ia(e==="dark"?{...wa,...t}:{...qm,...n})}
}
${e==="system"?`
@media (prefers-color-scheme: dark) {
:host {
color-scheme: only dark;
${Ia({...wa,...t})}
}
}`:""}
`,r&&s.setAttribute("nonce",r),s}const Vm=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>({id:s="sentry-feedback",autoInject:i=!0,showBranding:o=!0,isEmailRequired:c=!1,isNameRequired:a=!1,showEmail:u=!0,showName:d=!0,enableScreenshot:l=!0,useSentryUser:f={email:"email",name:"username"},tags:p,styleNonce:h,scriptNonce:m,colorScheme:_="system",themeLight:g={},themeDark:S={},addScreenshotButtonLabel:N=Am,cancelButtonLabel:C=Sm,confirmButtonLabel:U=Em,emailLabel:A=wm,emailPlaceholder:y=Tm,formTitle:w=vm,isRequiredLabel:F=Mm,messageLabel:E=km,messagePlaceholder:x=Im,nameLabel:T=Rm,namePlaceholder:k=Cm,removeScreenshotButtonLabel:M=Nm,submitButtonLabel:J=bm,successMessageText:K=xm,triggerLabel:Z=Wu,triggerAriaLabel:v="",highlightToolText:$=Lm,hideToolText:I=Dm,removeHighlightText:L=Om,onFormOpen:ee,onFormClose:X,onSubmitSuccess:he,onSubmitError:De,onFormSubmitted:Ue}={})=>{const be={id:s,autoInject:i,showBranding:o,isEmailRequired:c,isNameRequired:a,showEmail:u,showName:d,enableScreenshot:l,useSentryUser:f,tags:p,styleNonce:h,scriptNonce:m,colorScheme:_,themeDark:S,themeLight:g,triggerLabel:Z,triggerAriaLabel:v,cancelButtonLabel:C,submitButtonLabel:J,confirmButtonLabel:U,formTitle:w,emailLabel:A,emailPlaceholder:y,messageLabel:E,messagePlaceholder:x,nameLabel:T,namePlaceholder:k,successMessageText:K,isRequiredLabel:F,addScreenshotButtonLabel:N,removeScreenshotButtonLabel:M,highlightToolText:$,hideToolText:I,removeHighlightText:L,onFormClose:X,onFormOpen:ee,onSubmitError:De,onSubmitSuccess:he,onFormSubmitted:Ue};let Ee=null,Ge=null,Ye=[];const kn=G=>{if(!Ee){const ue=se.createElement("div");ue.id=String(G.id),se.body.appendChild(ue),Ee=ue.attachShadow({mode:"open"}),Ge=ka(G),Ee.appendChild(Ge)}return Ee},dr=async G=>{const ue=G.enableScreenshot&&Hm();let Re,ye;try{Re=(t?t():await e("feedbackModalIntegration",m))(),oa(Re)}catch{throw Lr&&b.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{const H=ue?n?n():await e("feedbackScreenshotIntegration",m):void 0;H&&(ye=H(),oa(ye))}catch{Lr&&b.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}const le=Re.createDialog({options:{...G,onFormClose:()=>{var H;le==null||le.close(),(H=G.onFormClose)==null||H.call(G)},onFormSubmitted:()=>{var H;le==null||le.close(),(H=G.onFormSubmitted)==null||H.call(G)}},screenshotIntegration:ye,sendFeedback:Bm,shadow:kn(G)});return le},fr=(G,ue={})=>{const Re=mr(be,ue),ye=typeof G=="string"?se.querySelector(G):typeof G.addEventListener=="function"?G:null;if(!ye)throw Lr&&b.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let le=null;const H=async()=>{le||(le=await dr({...Re,onFormSubmitted:()=>{var z;le==null||le.removeFromDom(),(z=Re.onFormSubmitted)==null||z.call(Re)}})),le.appendToDom(),le.open()};ye.addEventListener("click",H);const we=()=>{Ye=Ye.filter(z=>z!==we),le==null||le.removeFromDom(),le=null,ye.removeEventListener("click",H)};return Ye.push(we),we},Ke=(G={})=>{const ue=mr(be,G),Re=kn(ue),ye=jm({triggerLabel:ue.triggerLabel,triggerAriaLabel:ue.triggerAriaLabel,shadow:Re,styleNonce:h});return fr(ye.el,{...ue,onFormOpen(){ye.hide()},onFormClose(){ye.show()},onFormSubmitted(){ye.show()}}),ye};return{name:"Feedback",setupOnce(){!Gr()||!be.autoInject||(se.readyState==="loading"?se.addEventListener("DOMContentLoaded",()=>Ke().appendToDom()):Ke().appendToDom())},attachTo:fr,createWidget(G={}){const ue=Ke(mr(be,G));return ue.appendToDom(),ue},async createForm(G={}){return dr(mr(be,G))},setTheme(G){if(be.colorScheme=G,Ee){const ue=ka(be);Ge?Ee.replaceChild(ue,Ge):Ee.prepend(ue),Ge=ue}},remove(){var G;Ee&&((G=Ee.parentElement)==null||G.remove(),Ee=null,Ge=null),Ye.forEach(ue=>ue()),Ye=[]}}};var hs,oe,ju,Lt,Ca,qu,fi,Un={},Ji=[],Gm=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Zi=Array.isArray;function bt(e,t){for(var n in t)e[n]=t[n];return e}function Vu(e){var t=e.parentNode;t&&t.removeChild(e)}function q(e,t,n){var r,s,i,o={};for(i in t)i=="key"?r=t[i]:i=="ref"?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?hs.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)o[i]===void 0&&(o[i]=e.defaultProps[i]);return Dr(e,o,r,s,null)}function Dr(e,t,n,r,s){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++ju,__i:-1,__u:0};return s==null&&oe.vnode!=null&&oe.vnode(i),i}function tr(e){return e.children}function Or(e,t){this.props=e,this.context=t}function fn(e,t){if(t==null)return e.__?fn(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?fn(e):null}function Ym(e,t,n){var r,s=e.__v,i=s.__e,o=e.__P;if(o)return(r=bt({},s)).__v=s.__v+1,oe.vnode&&oe.vnode(r),Qi(o,r,s,e.__n,o.ownerSVGElement!==void 0,32&s.__u?[i]:null,t,i??fn(s),!!(32&s.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=i&&Gu(r),r}function Gu(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return Gu(e)}}function Ra(e){(!e.__d&&(e.__d=!0)&&Lt.push(e)&&!Yr.__r++||Ca!==oe.debounceRendering)&&((Ca=oe.debounceRendering)||qu)(Yr)}function Yr(){var e,t,n,r=[],s=[];for(Lt.sort(fi);e=Lt.shift();)e.__d&&(n=Lt.length,t=Ym(e,r,s)||t,n===0||Lt.length>n?(pi(r,t,s),s.length=r.length=0,t=void 0,Lt.sort(fi)):t&&oe.__c&&oe.__c(t,Ji));t&&pi(r,t,s),Yr.__r=0}function Yu(e,t,n,r,s,i,o,c,a,u,d){var l,f,p,h,m,_=r&&r.__k||Ji,g=t.length;for(n.__d=a,Km(n,t,_),a=n.__d,l=0;l<g;l++)(p=n.__k[l])!=null&&typeof p!="boolean"&&typeof p!="function"&&(f=p.__i===-1?Un:_[p.__i]||Un,p.__i=l,Qi(e,p,f,s,i,o,c,a,u,d),h=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&eo(f.ref,null,p),d.push(p.ref,p.__c||h,p)),m==null&&h!=null&&(m=h),65536&p.__u||f.__k===p.__k?a=Ku(p,a,e):typeof p.type=="function"&&p.__d!==void 0?a=p.__d:h&&(a=h.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=a,n.__e=m}function Km(e,t,n){var r,s,i,o,c,a=t.length,u=n.length,d=u,l=0;for(e.__k=[],r=0;r<a;r++)(s=e.__k[r]=(s=t[r])==null||typeof s=="boolean"||typeof s=="function"?null:typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?Dr(null,s,null,null,s):Zi(s)?Dr(tr,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?Dr(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)!=null?(s.__=e,s.__b=e.__b+1,c=Xm(s,n,o=r+l,d),s.__i=c,i=null,c!==-1&&(d--,(i=n[c])&&(i.__u|=131072)),i==null||i.__v===null?(c==-1&&l--,typeof s.type!="function"&&(s.__u|=65536)):c!==o&&(c===o+1?l++:c>o?d>a-o?l+=c-o:l--:l=c<o&&c==o-1?c-o:0,c!==r+l&&(s.__u|=65536))):(i=n[r])&&i.key==null&&i.__e&&(i.__e==e.__d&&(e.__d=fn(i)),hi(i,i,!1),n[r]=null,d--);if(d)for(r=0;r<u;r++)(i=n[r])!=null&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=fn(i)),hi(i,i))}function Ku(e,t,n){var r,s;if(typeof e.type=="function"){for(r=e.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=e,t=Ku(r[s],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function Xm(e,t,n,r){var s=e.key,i=e.type,o=n-1,c=n+1,a=t[n];if(a===null||a&&s==a.key&&i===a.type)return n;if(r>(a!=null&&!(131072&a.__u)?1:0))for(;o>=0||c<t.length;){if(o>=0){if((a=t[o])&&!(131072&a.__u)&&s==a.key&&i===a.type)return o;o--}if(c<t.length){if((a=t[c])&&!(131072&a.__u)&&s==a.key&&i===a.type)return c;c++}}return-1}function xa(e,t,n){t[0]==="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||Gm.test(t)?n:n+"px"}function _r(e,t,n,r,s){var i;e:if(t==="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||xa(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||xa(e.style,t,n[t])}else if(t[0]==="o"&&t[1]==="n")i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?Aa:Ma,i)):e.removeEventListener(t,i?Aa:Ma,i);else{if(s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!=="width"&&t!=="height"&&t!=="href"&&t!=="list"&&t!=="form"&&t!=="tabIndex"&&t!=="download"&&t!=="rowSpan"&&t!=="colSpan"&&t!=="role"&&t in e)try{e[t]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,n))}}function Ma(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(oe.event?oe.event(e):e)}}function Aa(e){if(this.l)return this.l[e.type+!0](oe.event?oe.event(e):e)}function Qi(e,t,n,r,s,i,o,c,a,u){var d,l,f,p,h,m,_,g,S,N,C,U,A,y,w,F=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(a=!!(32&n.__u),i=[c=t.__e=n.__e]),(d=oe.__b)&&d(t);e:if(typeof F=="function")try{if(g=t.props,S=(d=F.contextType)&&r[d.__c],N=d?S?S.props.value:d.__:r,n.__c?_=(l=t.__c=n.__c).__=l.__E:("prototype"in F&&F.prototype.render?t.__c=l=new F(g,N):(t.__c=l=new Or(g,N),l.constructor=F,l.render=Zm),S&&S.sub(l),l.props=g,l.state||(l.state={}),l.context=N,l.__n=r,f=l.__d=!0,l.__h=[],l._sb=[]),l.__s==null&&(l.__s=l.state),F.getDerivedStateFromProps!=null&&(l.__s==l.state&&(l.__s=bt({},l.__s)),bt(l.__s,F.getDerivedStateFromProps(g,l.__s))),p=l.props,h=l.state,l.__v=t,f)F.getDerivedStateFromProps==null&&l.componentWillMount!=null&&l.componentWillMount(),l.componentDidMount!=null&&l.__h.push(l.componentDidMount);else{if(F.getDerivedStateFromProps==null&&g!==p&&l.componentWillReceiveProps!=null&&l.componentWillReceiveProps(g,N),!l.__e&&(l.shouldComponentUpdate!=null&&l.shouldComponentUpdate(g,l.__s,N)===!1||t.__v===n.__v)){for(t.__v!==n.__v&&(l.props=g,l.state=l.__s,l.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(E){E&&(E.__=t)}),C=0;C<l._sb.length;C++)l.__h.push(l._sb[C]);l._sb=[],l.__h.length&&o.push(l);break e}l.componentWillUpdate!=null&&l.componentWillUpdate(g,l.__s,N),l.componentDidUpdate!=null&&l.__h.push(function(){l.componentDidUpdate(p,h,m)})}if(l.context=N,l.props=g,l.__P=e,l.__e=!1,U=oe.__r,A=0,"prototype"in F&&F.prototype.render){for(l.state=l.__s,l.__d=!1,U&&U(t),d=l.render(l.props,l.state,l.context),y=0;y<l._sb.length;y++)l.__h.push(l._sb[y]);l._sb=[]}else do l.__d=!1,U&&U(t),d=l.render(l.props,l.state,l.context),l.state=l.__s;while(l.__d&&++A<25);l.state=l.__s,l.getChildContext!=null&&(r=bt(bt({},r),l.getChildContext())),f||l.getSnapshotBeforeUpdate==null||(m=l.getSnapshotBeforeUpdate(p,h)),Yu(e,Zi(w=d!=null&&d.type===tr&&d.key==null?d.props.children:d)?w:[w],t,n,r,s,i,o,c,a,u),l.base=t.__e,t.__u&=-161,l.__h.length&&o.push(l),_&&(l.__E=l.__=null)}catch(E){t.__v=null,a||i!=null?(t.__e=c,t.__u|=a?160:32,i[i.indexOf(c)]=null):(t.__e=n.__e,t.__k=n.__k),oe.__e(E,t,n)}else i==null&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Jm(n.__e,t,n,r,s,i,o,a,u);(d=oe.diffed)&&d(t)}function pi(e,t,n){for(var r=0;r<n.length;r++)eo(n[r],n[++r],n[++r]);oe.__c&&oe.__c(t,e),e.some(function(s){try{e=s.__h,s.__h=[],e.some(function(i){i.call(s)})}catch(i){oe.__e(i,s.__v)}})}function Jm(e,t,n,r,s,i,o,c,a){var u,d,l,f,p,h,m,_=n.props,g=t.props,S=t.type;if(S==="svg"&&(s=!0),i!=null){for(u=0;u<i.length;u++)if((p=i[u])&&"setAttribute"in p==!!S&&(S?p.localName===S:p.nodeType===3)){e=p,i[u]=null;break}}if(e==null){if(S===null)return document.createTextNode(g);e=s?document.createElementNS("http://www.w3.org/2000/svg",S):document.createElement(S,g.is&&g),i=null,c=!1}if(S===null)_===g||c&&e.data===g||(e.data=g);else{if(i=i&&hs.call(e.childNodes),_=n.props||Un,!c&&i!=null)for(_={},u=0;u<e.attributes.length;u++)_[(p=e.attributes[u]).name]=p.value;for(u in _)p=_[u],u=="children"||(u=="dangerouslySetInnerHTML"?l=p:u==="key"||u in g||_r(e,u,null,p,s));for(u in g)p=g[u],u=="children"?f=p:u=="dangerouslySetInnerHTML"?d=p:u=="value"?h=p:u=="checked"?m=p:u==="key"||c&&typeof p!="function"||_[u]===p||_r(e,u,p,_[u],s);if(d)c||l&&(d.__html===l.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(l&&(e.innerHTML=""),Yu(e,Zi(f)?f:[f],t,n,r,s&&S!=="foreignObject",i,o,i?i[0]:n.__k&&fn(n,0),c,a),i!=null)for(u=i.length;u--;)i[u]!=null&&Vu(i[u]);c||(u="value",h!==void 0&&(h!==e[u]||S==="progress"&&!h||S==="option"&&h!==_[u])&&_r(e,u,h,_[u],!1),u="checked",m!==void 0&&m!==e[u]&&_r(e,u,m,_[u],!1))}return e}function eo(e,t,n){try{typeof e=="function"?e(t):e.current=t}catch(r){oe.__e(r,n)}}function hi(e,t,n){var r,s;if(oe.unmount&&oe.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||eo(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(i){oe.__e(i,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&hi(r[s],t,n||typeof e.type!="function");n||e.__e==null||Vu(e.__e),e.__=e.__e=e.__d=void 0}function Zm(e,t,n){return this.constructor(e,n)}function Qm(e,t,n){var r,s,i,o;oe.__&&oe.__(e,t),s=(r=!1)?null:t.__k,i=[],o=[],Qi(t,e=t.__k=q(tr,null,[e]),s||Un,Un,t.ownerSVGElement!==void 0,s?null:t.firstChild?hs.call(t.childNodes):null,i,s?s.__e:t.firstChild,r,o),e.__d=void 0,pi(i,e,o)}hs=Ji.slice,oe={__e:function(e,t,n,r){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&i.getDerivedStateFromError!=null&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(e,r||{}),o=s.__d),o)return s.__E=s}catch(c){e=c}throw e}},ju=0,Or.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=bt({},this.state),typeof e=="function"&&(e=e(bt({},n),this.props)),e&&bt(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Ra(this))},Or.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Ra(this))},Or.prototype.render=tr,Lt=[],qu=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,fi=function(e,t){return e.__v.__b-t.__v.__b},Yr.__r=0;var mt,ie,Ds,Na,pn=0,Xu=[],Pr=[],de=oe,La=de.__b,Da=de.__r,Oa=de.diffed,Pa=de.__c,Fa=de.unmount,$a=de.__;function Gt(e,t){de.__h&&de.__h(ie,e,pn||t),pn=0;var n=ie.__H||(ie.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Pr}),n.__[e]}function Dt(e){return pn=1,Ju(Qu,e)}function Ju(e,t,n){var r=Gt(mt++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Qu(void 0,t),function(c){var a=r.__N?r.__N[0]:r.__[0],u=r.t(a,c);a!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=ie,!ie.u)){var s=function(c,a,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(f){return!!f.__c});if(d.every(function(f){return!f.__N}))return!i||i.call(this,c,a,u);var l=!1;return d.forEach(function(f){if(f.__N){var p=f.__[0];f.__=f.__N,f.__N=void 0,p!==f.__[0]&&(l=!0)}}),!(!l&&r.__c.props===c)&&(!i||i.call(this,c,a,u))};ie.u=!0;var i=ie.shouldComponentUpdate,o=ie.componentWillUpdate;ie.componentWillUpdate=function(c,a,u){if(this.__e){var d=i;i=void 0,s(c,a,u),i=d}o&&o.call(this,c,a,u)},ie.shouldComponentUpdate=s}return r.__N||r.__}function e_(e,t){var n=Gt(mt++,3);!de.__s&&to(n.__H,t)&&(n.__=e,n.i=t,ie.__H.__h.push(n))}function Zu(e,t){var n=Gt(mt++,4);!de.__s&&to(n.__H,t)&&(n.__=e,n.i=t,ie.__h.push(n))}function t_(e){return pn=5,nr(function(){return{current:e}},[])}function n_(e,t,n){pn=6,Zu(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},n==null?n:n.concat(e))}function nr(e,t){var n=Gt(mt++,7);return to(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function on(e,t){return pn=8,nr(function(){return e},t)}function r_(e){var t=ie.context[e.__c],n=Gt(mt++,9);return n.c=e,t?(n.__==null&&(n.__=!0,t.sub(ie)),t.props.value):e.__}function s_(e,t){de.useDebugValue&&de.useDebugValue(t?t(e):e)}function i_(e){var t=Gt(mt++,10),n=Dt();return t.__=e,ie.componentDidCatch||(ie.componentDidCatch=function(r,s){t.__&&t.__(r,s),n[1](r)}),[n[0],function(){n[1](void 0)}]}function o_(){var e=Gt(mt++,11);if(!e.__){for(var t=ie.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function a_(){for(var e;e=Xu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Fr),e.__H.__h.forEach(mi),e.__H.__h=[]}catch(t){e.__H.__h=[],de.__e(t,e.__v)}}de.__b=function(e){ie=null,La&&La(e)},de.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),$a&&$a(e,t)},de.__r=function(e){Da&&Da(e),mt=0;var t=(ie=e.__c).__H;t&&(Ds===ie?(t.__h=[],ie.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=Pr,n.__N=n.i=void 0})):(t.__h.forEach(Fr),t.__h.forEach(mi),t.__h=[],mt=0)),Ds=ie},de.diffed=function(e){Oa&&Oa(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Xu.push(t)!==1&&Na===de.requestAnimationFrame||((Na=de.requestAnimationFrame)||c_)(a_)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==Pr&&(n.__=n.__V),n.i=void 0,n.__V=Pr})),Ds=ie=null},de.__c=function(e,t){t.some(function(n){try{n.__h.forEach(Fr),n.__h=n.__h.filter(function(r){return!r.__||mi(r)})}catch(r){t.some(function(s){s.__h&&(s.__h=[])}),t=[],de.__e(r,n.__v)}}),Pa&&Pa(e,t)},de.unmount=function(e){Fa&&Fa(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{Fr(r)}catch(s){t=s}}),n.__H=void 0,t&&de.__e(t,n.__v))};var Ba=typeof requestAnimationFrame=="function";function c_(e){var t,n=function(){clearTimeout(r),Ba&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Ba&&(t=requestAnimationFrame(n))}function Fr(e){var t=ie,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),ie=t}function mi(e){var t=ie;e.__c=e.__(),ie=t}function to(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function Qu(e,t){return typeof t=="function"?t(e):t}const u_=Object.defineProperty({__proto__:null,useCallback:on,useContext:r_,useDebugValue:s_,useEffect:e_,useErrorBoundary:i_,useId:o_,useImperativeHandle:n_,useLayoutEffect:Zu,useMemo:nr,useReducer:Ju,useRef:t_,useState:Dt},Symbol.toStringTag,{value:"Module"}),l_="http://www.w3.org/2000/svg";function d_(){const e=r=>se.createElementNS(l_,r),t=Pe(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=Pe(e("path"),{transform:"translate(11, 11)",d:"M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"});return t.appendChild(n),t}function f_({options:e}){const t=nr(()=>({__html:d_().outerHTML}),[]);return q("h2",{class:"dialog__header"},q("span",{class:"dialog__title"},e.formTitle),e.showBranding?q("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function p_(e,t){const n=[];return t.isNameRequired&&!e.name&&n.push(t.nameLabel),t.isEmailRequired&&!e.email&&n.push(t.emailLabel),e.message||n.push(t.messageLabel),n}function Os(e,t){const n=e.get(t);return typeof n=="string"?n.trim():""}function h_({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:s,onSubmitSuccess:i,onSubmitError:o,showEmail:c,showName:a,screenshotInput:u}){const{tags:d,addScreenshotButtonLabel:l,removeScreenshotButtonLabel:f,cancelButtonLabel:p,emailLabel:h,emailPlaceholder:m,isEmailRequired:_,isNameRequired:g,messageLabel:S,messagePlaceholder:N,nameLabel:C,namePlaceholder:U,submitButtonLabel:A,isRequiredLabel:y}=e,[w,F]=Dt(!1),[E,x]=Dt(null),[T,k]=Dt(!1),M=u==null?void 0:u.input,[J,K]=Dt(null),Z=on(I=>{K(I),k(!1)},[]),v=on(I=>{const L=p_(I,{emailLabel:h,isEmailRequired:_,isNameRequired:g,messageLabel:S,nameLabel:C});return L.length>0?x(`Please enter in the following required fields: ${L.join(", ")}`):x(null),L.length===0},[h,_,g,S,C]),$=on(async I=>{F(!0);try{if(I.preventDefault(),!(I.target instanceof HTMLFormElement))return;const L=new FormData(I.target),ee=await(u&&T?u.value():void 0),X={name:Os(L,"name"),email:Os(L,"email"),message:Os(L,"message"),attachments:ee?[ee]:void 0};if(!v(X))return;try{const he=await s({name:X.name,email:X.email,message:X.message,source:Pm,tags:d},{attachments:X.attachments});i(X,he)}catch(he){Lr&&b.error(he),x(he),o(he)}}finally{F(!1)}},[u&&T,i,o]);return q("form",{class:"form",onSubmit:$},M&&T?q(M,{onError:Z}):null,q("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:w},q("div",{class:"form__top"},E?q("div",{class:"form__error-container"},E):null,a?q("label",{for:"name",class:"form__label"},q(Ps,{label:C,isRequiredLabel:y,isRequired:g}),q("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:U,required:g,type:"text"})):q("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),c?q("label",{for:"email",class:"form__label"},q(Ps,{label:h,isRequiredLabel:y,isRequired:_}),q("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:m,required:_,type:"email"})):q("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),q("label",{for:"message",class:"form__label"},q(Ps,{label:S,isRequiredLabel:y,isRequired:!0}),q("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:N,required:!0,rows:5})),M?q("label",{for:"screenshot",class:"form__label"},q("button",{class:"btn btn--default",disabled:w,type:"button",onClick:()=>{K(null),k(I=>!I)}},T?f:l),J?q("div",{class:"form__error-container"},J.message):null):null),q("div",{class:"btn-group"},q("button",{class:"btn btn--primary",disabled:w,type:"submit"},A),q("button",{class:"btn btn--default",disabled:w,type:"button",onClick:r},p))))}function Ps({label:e,isRequired:t,isRequiredLabel:n}){return q("span",{class:"form__label__text"},e,t&&q("span",{class:"form__label__text--required"},n))}const gr=16,Ha=17,m_="http://www.w3.org/2000/svg";function __(){const e=a=>Qe.document.createElementNS(m_,a),t=Pe(e("svg"),{width:`${gr}`,height:`${Ha}`,viewBox:`0 0 ${gr} ${Ha}`,fill:"inherit"}),n=Pe(e("g"),{clipPath:"url(#clip0_57_156)"}),r=Pe(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),s=Pe(e("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173 10.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});t.appendChild(n).append(s,r);const i=e("defs"),o=Pe(e("clipPath"),{id:"clip0_57_156"}),c=Pe(e("rect"),{width:`${gr}`,height:`${gr}`,fill:"white",transform:"translate(0 0.5)"});return o.appendChild(c),i.appendChild(o),t.appendChild(i).appendChild(o).appendChild(c),t}function g_({open:e,onFormSubmitted:t,...n}){const r=n.options,s=nr(()=>({__html:__().outerHTML}),[]),[i,o]=Dt(null),c=on(()=>{i&&(clearTimeout(i),o(null)),t()},[i]),a=on((u,d)=>{n.onSubmitSuccess(u,d),o(setTimeout(()=>{t(),o(null)},$m))},[t]);return q(tr,null,i?q("div",{class:"success__position",onClick:c},q("div",{class:"success__content"},r.successMessageText,q("span",{class:"success__icon",dangerouslySetInnerHTML:s}))):q("dialog",{class:"dialog",onClick:r.onFormClose,open:e},q("div",{class:"dialog__position"},q("div",{class:"dialog__content",onClick:u=>{u.stopPropagation()}},q(f_,{options:r}),q(h_,{...n,onSubmitSuccess:a})))))}const y_=`
.dialog {
position: fixed;
z-index: var(--z-index);
margin: 0;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
padding: 0;
height: 100vh;
width: 100vw;
color: var(--dialog-color, var(--foreground));
fill: var(--dialog-color, var(--foreground));
line-height: 1.75em;
background-color: rgba(0, 0, 0, 0.05);
border: none;
inset: 0;
opacity: 1;
transition: opacity 0.2s ease-in-out;
}
.dialog__position {
position: fixed;
z-index: var(--z-index);
inset: var(--dialog-inset);
padding: var(--page-margin);
display: flex;
max-height: calc(100vh - (2 * var(--page-margin)));
}
@media (max-width: 600px) {
.dialog__position {
inset: var(--page-margin);
padding: 0;
}
}
.dialog__position:has(.editor) {
inset: var(--page-margin);
padding: 0;
}
.dialog:not([open]) {
opacity: 0;
pointer-events: none;
visibility: hidden;
}
.dialog:not([open]) .dialog__content {
transform: translate(0, -16px) scale(0.98);
}
.dialog__content {
display: flex;
flex-direction: column;
gap: 16px;
padding: var(--dialog-padding, 24px);
max-width: 100%;
width: 100%;
max-height: 100%;
overflow: auto;
background: var(--dialog-background, var(--background));
border-radius: var(--dialog-border-radius, 20px);
border: var(--dialog-border, var(--border));
box-shadow: var(--dialog-box-shadow, var(--box-shadow));
transform: translate(0, 0) scale(1);
transition: transform 0.2s ease-in-out;
}
`,S_=`
.dialog__header {
display: flex;
gap: 4px;
justify-content: space-between;
font-weight: var(--dialog-header-weight, 600);
margin: 0;
}
.dialog__title {
align-self: center;
width: var(--form-width, 272px);
}
@media (max-width: 600px) {
.dialog__title {
width: auto;
}
}
.dialog__position:has(.editor) .dialog__title {
width: auto;
}
.brand-link {
display: inline-flex;
}
.brand-link:focus-visible {
outline: var(--outline);
}
`,b_=`
.form {
display: flex;
overflow: auto;
flex-direction: row;
gap: 16px;
flex: 1 0;
}
.form fieldset {
border: none;
margin: 0;
padding: 0;
}
.form__right {
flex: 0 0 auto;
display: flex;
overflow: auto;
flex-direction: column;
justify-content: space-between;
gap: 20px;
width: var(--form-width, 100%);
}
.dialog__position:has(.editor) .form__right {
width: var(--form-width, 272px);
}
.form__top {
display: flex;
flex-direction: column;
gap: 8px;
}
.form__error-container {
color: var(--error-color);
fill: var(--error-color);
}
.form__label {
display: flex;
flex-direction: column;
gap: 4px;
margin: 0px;
}
.form__label__text {
display: flex;
gap: 4px;
align-items: center;
}
.form__label__text--required {
font-size: 0.85em;
}
.form__input {
font-family: inherit;
line-height: inherit;
background: transparent;
box-sizing: border-box;
border: var(--input-border, var(--border));
border-radius: var(--input-border-radius, 6px);
color: var(--input-color, inherit);
fill: var(--input-color, inherit);
font-size: var(--input-font-size, inherit);
font-weight: var(--input-font-weight, 500);
padding: 6px 12px;
}
.form__input::placeholder {
opacity: 0.65;
color: var(--input-placeholder-color, inherit);
filter: var(--interactive-filter);
}
.form__input:focus-visible {
outline: var(--input-focus-outline, var(--outline));
}
.form__input--textarea {
font-family: inherit;
resize: vertical;
}
.error {
color: var(--error-color);
fill: var(--error-color);
}
`,E_=`
.btn-group {
display: grid;
gap: 8px;
}
.btn {
line-height: inherit;
border: var(--button-border, var(--border));
border-radius: var(--button-border-radius, 6px);
cursor: pointer;
font-family: inherit;
font-size: var(--button-font-size, inherit);
font-weight: var(--button-font-weight, 600);
padding: var(--button-padding, 6px 16px);
}
.btn[disabled] {
opacity: 0.6;
pointer-events: none;
}
.btn--primary {
color: var(--button-primary-color, var(--accent-foreground));
fill: var(--button-primary-color, var(--accent-foreground));
background: var(--button-primary-background, var(--accent-background));
border: var(--button-primary-border, var(--border));
border-radius: var(--button-primary-border-radius, 6px);
font-weight: var(--button-primary-font-weight, 500);
}
.btn--primary:hover {
color: var(--button-primary-hover-color, var(--accent-foreground));
fill: var(--button-primary-hover-color, var(--accent-foreground));
background: var(--button-primary-hover-background, var(--accent-background));
filter: var(--interactive-filter);
}
.btn--primary:focus-visible {
background: var(--button-primary-hover-background, var(--accent-background));
filter: var(--interactive-filter);
outline: var(--button-primary-focus-outline, var(--outline));
}
.btn--default {
color: var(--button-color, var(--foreground));
fill: var(--button-color, var(--foreground));
background: var(--button-background, var(--background));
border: var(--button-border, var(--border));
border-radius: var(--button-border-radius, 6px);
font-weight: var(--button-font-weight, 500);
}
.btn--default:hover {
color: var(--button-color, var(--foreground));
fill: var(--button-color, var(--foreground));
background: var(--button-hover-background, var(--background));
filter: var(--interactive-filter);
}
.btn--default:focus-visible {
background: var(--button-hover-background, var(--background));
filter: var(--interactive-filter);
outline: var(--button-focus-outline, var(--outline));
}
`,v_=`
.success__position {
position: fixed;
inset: var(--dialog-inset);
padding: var(--page-margin);
z-index: var(--z-index);
}
.success__content {
background: var(--success-background, var(--background));
border: var(--success-border, var(--border));
border-radius: var(--success-border-radius, 1.7em/50%);
box-shadow: var(--success-box-shadow, var(--box-shadow));
font-weight: var(--success-font-weight, 600);
color: var(--success-color);
fill: var(--success-color);
padding: 12px 24px;
line-height: 1.75em;
display: grid;
align-items: center;
grid-auto-flow: column;
gap: 6px;
cursor: default;
}
.success__icon {
display: flex;
}
`;function T_(e){const t=se.createElement("style");return t.textContent=`
:host {
--dialog-inset: var(--inset);
}
${y_}
${S_}
${b_}
${E_}
${v_}
`,e&&t.setAttribute("nonce",e),t}function w_(){const e=ne().getUser(),t=Ce().getUser(),n=jc().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}const I_=()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{const s=r,i=e.useSentryUser,o=w_(),c=se.createElement("div"),a=T_(e.styleNonce);let u="";const d={get el(){return c},appendToDom(){!s.contains(a)&&!s.contains(c)&&(s.appendChild(a),s.appendChild(c))},removeFromDom(){c.remove(),a.remove(),se.body.style.overflow=u},open(){var p,h;f(!0),(p=e.onFormOpen)==null||p.call(e),(h=W())==null||h.emit("openFeedbackWidget"),u=se.body.style.overflow,se.body.style.overflow="hidden"},close(){f(!1),se.body.style.overflow=u}},l=t==null?void 0:t.createInput({h:q,hooks:u_,dialog:d,options:e}),f=p=>{Qm(q(g_,{options:e,screenshotInput:l,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(i&&(o==null?void 0:o[i.name])||""),defaultEmail:String(i&&(o==null?void 0:o[i.email])||""),onFormClose:()=>{var h;f(!1),(h=e.onFormClose)==null||h.call(e)},onSubmit:n,onSubmitSuccess:(h,m)=>{var _;f(!1),(_=e.onSubmitSuccess)==null||_.call(e,h,m)},onSubmitError:h=>{var m;(m=e.onSubmitError)==null||m.call(e,h)},onFormSubmitted:()=>{var h;(h=e.onFormSubmitted)==null||h.call(e)},open:p}),c)};return d}});function k_({h:e}){return function(){return e("svg",{"data-test-id":"icon-close",viewBox:"0 0 16 16",fill:"#2B2233",height:"25px",width:"25px"},e("circle",{r:"7",cx:"8",cy:"8",fill:"white"}),e("path",{strokeWidth:"1.5",d:"M8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16ZM8,1.53A6.47,6.47,0,1,0,14.47,8,6.47,6.47,0,0,0,8,1.53Z"}),e("path",{strokeWidth:"1.5",d:"M5.34,11.41a.71.71,0,0,1-.53-.22.74.74,0,0,1,0-1.06l5.32-5.32a.75.75,0,0,1,1.06,1.06L5.87,11.19A.74.74,0,0,1,5.34,11.41Z"}),e("path",{strokeWidth:"1.5",d:"M10.66,11.41a.74.74,0,0,1-.53-.22L4.81,5.87A.75.75,0,0,1,5.87,4.81l5.32,5.32a.74.74,0,0,1,0,1.06A.71.71,0,0,1,10.66,11.41Z"}))}}function C_(e){const t=se.createElement("style"),n="#1A141F",r="#302735";return t.textContent=`
.editor {
display: flex;
flex-grow: 1;
flex-direction: column;
}
.editor__image-container {
justify-items: center;
padding: 15px;
position: relative;
height: 100%;
border-radius: var(--menu-border-radius, 6px);
background-color: ${n};
background-image: repeating-linear-gradient(
-145deg,
transparent,
transparent 8px,
${n} 8px,
${n} 11px
),
repeating-linear-gradient(
-45deg,
transparent,
transparent 15px,
${r} 15px,
${r} 16px
);
}
.editor__canvas-container {
width: 100%;
height: 100%;
position: relative;
display: flex;
align-items: center;
justify-content: center;
}
.editor__canvas-container > * {
object-fit: contain;
position: absolute;
}
.editor__tool-container {
padding-top: 8px;
display: flex;
justify-content: center;
}
.editor__tool-bar {
display: flex;
gap: 8px;
}
.editor__tool {
display: flex;
padding: 8px 12px;
justify-content: center;
align-items: center;
border: var(--button-border, var(--border));
border-radius: var(--button-border-radius, 6px);
background: var(--button-background, var(--background));
color: var(--button-color, var(--foreground));
}
.editor__tool--active {
background: var(--button-primary-background, var(--accent-background));
color: var(--button-primary-color, var(--accent-foreground));
}
.editor__rect {
position: absolute;
z-index: 2;
}
.editor__rect button {
opacity: 0;
position: absolute;
top: -12px;
right: -12px;
cursor: pointer;
padding: 0;
z-index: 3;
border: none;
background: none;
}
.editor__rect:hover button {
opacity: 1;
}
`,e&&t.setAttribute("nonce",e),t}function R_({h:e}){return function({action:n,setAction:r,options:s}){return e("div",{class:"editor__tool-container"},e("div",{class:"editor__tool-bar"},e("button",{type:"button",class:`editor__tool ${n==="highlight"?"editor__tool--active":""}`,onClick:()=>{r(n==="highlight"?"":"highlight")}},s.highlightToolText),e("button",{type:"button",class:`editor__tool ${n==="hide"?"editor__tool--active":""}`,onClick:()=>{r(n==="hide"?"":"hide")}},s.hideToolText)))}}function x_({hooks:e}){function t(){const[n,r]=e.useState(Qe.devicePixelRatio??1);return e.useEffect(()=>{const s=()=>{r(Qe.devicePixelRatio)},i=matchMedia(`(resolution: ${Qe.devicePixelRatio}dppx)`);return i.addEventListener("change",s),()=>{i.removeEventListener("change",s)}},[]),n}return function({onBeforeScreenshot:r,onScreenshot:s,onAfterScreenshot:i,onError:o}){const c=t();e.useEffect(()=>{(async()=>{r();const u=await xn.mediaDevices.getDisplayMedia({video:{width:Qe.innerWidth*c,height:Qe.innerHeight*c},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),d=se.createElement("video");await new Promise((l,f)=>{d.srcObject=u,d.onloadedmetadata=()=>{s(d,c),u.getTracks().forEach(p=>p.stop()),l()},d.play().catch(f)}),i()})().catch(o)},[])}}function M_(e,t,n){switch(e.type){case"highlight":{t.shadowColor="rgba(0, 0, 0, 0.7)",t.shadowBlur=50,t.fillStyle=n,t.fillRect(e.x-1,e.y-1,e.w+2,e.h+2),t.clearRect(e.x,e.y,e.w,e.h);break}case"hide":t.fillStyle="rgb(0, 0, 0)",t.fillRect(e.x,e.y,e.w,e.h);break}}function gt(e,t,n){if(!e)return;const r=e.getContext("2d",t);r&&n(e,r)}function Fs(e,t){gt(e,{alpha:!0},(n,r)=>{r.drawImage(t,0,0,t.width,t.height,0,0,n.width,n.height)})}function $s(e,t,n){gt(e,{alpha:!0},(r,s)=>{n.length&&(s.fillStyle="rgba(0, 0, 0, 0.25)",s.fillRect(0,0,r.width,r.height)),n.forEach(i=>{M_(i,s,t)})})}function A_({h:e,hooks:t,outputBuffer:n,dialog:r,options:s}){const i=x_({hooks:t}),o=R_({h:e}),c=k_({h:e}),a={__html:C_(s.styleNonce).innerText},u=r.el.style,d=({screenshot:l})=>{const[f,p]=t.useState("highlight"),[h,m]=t.useState([]),_=t.useRef(null),g=t.useRef(null),S=t.useRef(null),N=t.useRef(null),[C,U]=t.useState(1),A=t.useMemo(()=>{const T=se.getElementById(s.id);if(!T)return"white";const k=getComputedStyle(T);return k.getPropertyValue("--button-primary-background")||k.getPropertyValue("--accent-background")},[s.id]);t.useLayoutEffect(()=>{const T=()=>{const k=_.current;k&&(gt(l.canvas,{alpha:!1},M=>{const J=Math.min(k.clientWidth/M.width,k.clientHeight/M.height);U(J)}),(k.clientHeight===0||k.clientWidth===0)&&setTimeout(T,0))};return T(),Qe.addEventListener("resize",T),()=>{Qe.removeEventListener("resize",T)}},[l]);const y=t.useCallback((T,k)=>{gt(T,{alpha:!0},(M,J)=>{J.scale(k,k),M.width=l.canvas.width,M.height=l.canvas.height})},[l]);t.useEffect(()=>{y(g.current,l.dpi),Fs(g.current,l.canvas)},[l]),t.useEffect(()=>{y(S.current,l.dpi),gt(S.current,{alpha:!0},(T,k)=>{k.clearRect(0,0,T.width,T.height)}),$s(S.current,A,h)},[h,A]),t.useEffect(()=>{y(n,l.dpi),Fs(n,l.canvas),gt(se.createElement("canvas"),{alpha:!0},(T,k)=>{k.scale(l.dpi,l.dpi),T.width=l.canvas.width,T.height=l.canvas.height,$s(T,A,h),Fs(n,T)})},[h,l,A]);const w=T=>{if(!f||!N.current)return;const k=N.current.getBoundingClientRect(),M={type:f,x:T.offsetX/C,y:T.offsetY/C},J=(v,$)=>{const I=($.clientX-k.x)/C,L=($.clientY-k.y)/C;return{type:v.type,x:Math.min(v.x,I),y:Math.min(v.y,L),w:Math.abs(I-v.x),h:Math.abs(L-v.y)}},K=v=>{gt(S.current,{alpha:!0},($,I)=>{I.clearRect(0,0,$.width,$.height)}),$s(S.current,A,[...h,J(M,v)])},Z=v=>{const $=J(M,v);$.w*C>=1&&$.h*C>=1&&m(I=>[...I,$]),se.removeEventListener("mousemove",K),se.removeEventListener("mouseup",Z)};se.addEventListener("mousemove",K),se.addEventListener("mouseup",Z)},F=t.useCallback(T=>k=>{k.preventDefault(),k.stopPropagation(),m(M=>{const J=[...M];return J.splice(T,1),J})},[]),E={width:`${l.canvas.width*C}px`,height:`${l.canvas.height*C}px`},x=T=>{T.stopPropagation()};return e("div",{class:"editor"},e("style",{nonce:s.styleNonce,dangerouslySetInnerHTML:a}),e("div",{class:"editor__image-container"},e("div",{class:"editor__canvas-container",ref:_},e("canvas",{ref:g,id:"background",style:E}),e("canvas",{ref:S,id:"foreground",style:E}),e("div",{ref:N,onMouseDown:w,style:E},h.map((T,k)=>e("div",{key:k,class:"editor__rect",style:{top:`${T.y*C}px`,left:`${T.x*C}px`,width:`${T.w*C}px`,height:`${T.h*C}px`}},e("button",{"aria-label":s.removeHighlightText,onClick:F(k),onMouseDown:x,onMouseUp:x,type:"button"},e(c,null))))))),e(o,{options:s,action:f,setAction:p}))};return function({onError:f}){const[p,h]=t.useState();return i({onBeforeScreenshot:t.useCallback(()=>{u.display="none"},[]),onScreenshot:t.useCallback((m,_)=>{gt(se.createElement("canvas"),{alpha:!1},(g,S)=>{S.scale(_,_),g.width=m.videoWidth,g.height=m.videoHeight,S.drawImage(m,0,0,g.width,g.height),h({canvas:g,dpi:_})}),n.width=m.videoWidth,n.height=m.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{u.display="block"},[]),onError:t.useCallback(m=>{u.display="block",f(m)},[])}),p?e(d,{screenshot:p}):e("div",null)}}const N_=()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{const s=se.createElement("canvas");return{input:A_({h:e,hooks:t,outputBuffer:s,dialog:n,options:r}),value:async()=>{const i=await new Promise(o=>{s.toBlob(o,"image/png")});if(i)return{data:new Uint8Array(await i.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}}),Y=V;let _i=0;function el(){return _i>0}function L_(){_i++,setTimeout(()=>{_i--})}function hn(e,t={}){function n(s){return typeof s=="function"}if(!n(e))return e;try{const s=e.__sentry_wrapped__;if(s)return typeof s=="function"?s:e;if(Bi(e))return e}catch{return e}const r=function(...s){try{const i=s.map(o=>hn(o,t));return e.apply(this,i)}catch(i){throw L_(),Hi(o=>{o.addEventProcessor(c=>(t.mechanism&&(ei(c,void 0),un(c,t.mechanism)),c.extra={...c.extra,arguments:s},c)),ps(i)}),i}};try{for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=e[s])}catch{}Bc(r,e),Le(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function no(){const e=qt(),{referrer:t}=Y.document||{},{userAgent:n}=Y.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}const N0=Vm({getModalIntegration:()=>I_,getScreenshotIntegration:()=>N_});function ro(e,t){const n=so(e,t),r={type:$_(t),value:B_(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function D_(e,t,n,r){const s=W(),i=s==null?void 0:s.getOptions().normalizeDepth,o=j_(t),c={__serialized__:uu(t,i)};if(o)return{exception:{values:[ro(e,o)]},extra:c};const a={exception:{values:[{type:us(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:W_(t,{isUnhandledRejection:r})}]},extra:c};if(n){const u=so(e,n);u.length&&(a.exception.values[0].stacktrace={frames:u})}return a}function Bs(e,t){return{exception:{values:[ro(e,t)]}}}function so(e,t){const n=t.stacktrace||t.stack||"",r=P_(t),s=F_(t);try{return e(n,r,s)}catch{}return[]}const O_=/Minified React error #\d+;/i;function P_(e){return e&&O_.test(e.message)?1:0}function F_(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function tl(e){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?e instanceof WebAssembly.Exception:!1}function $_(e){const t=e==null?void 0:e.name;return!t&&tl(e)?e.message&&Array.isArray(e.message)&&e.message.length==2?e.message[0]:"WebAssembly.Exception":t}function B_(e){const t=e==null?void 0:e.message;return tl(e)?Array.isArray(e.message)&&e.message.length==2?e.message[1]:"wasm exception":t?t.error&&typeof t.error.message=="string"?ha(t.error):ha(e):"No error message"}function H_(e,t,n,r){const s=(n==null?void 0:n.syntheticException)||void 0,i=io(e,t,s,r);return un(i),i.level="error",n!=null&&n.event_id&&(i.event_id=n.event_id),er(i)}function U_(e,t,n="info",r,s){const i=(r==null?void 0:r.syntheticException)||void 0,o=gi(e,t,i,s);return o.level=n,r!=null&&r.event_id&&(o.event_id=r.event_id),er(o)}function io(e,t,n,r,s){let i;if(Pc(t)&&t.error)return Bs(e,t.error);if(No(t)||Dd(t)){const o=t;if("stack"in t)i=Bs(e,t);else{const c=o.name||(No(o)?"DOMError":"DOMException"),a=o.message?`${c}: ${o.message}`:c;i=gi(e,a,n,r),ei(i,a)}return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}return cs(t)?Bs(e,t):On(t)||us(t)?(i=D_(e,t,n,s),un(i,{synthetic:!0}),i):(i=gi(e,t,n,r),ei(i,`${t}`),un(i,{synthetic:!0}),i)}function gi(e,t,n,r){const s={};if(r&&n){const i=so(e,n);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]}),un(s,{synthetic:!0})}if(Pi(t)){const{__sentry_template_string__:i,__sentry_template_values__:o}=t;return s.logentry={message:i,params:o},s}return s.message=t,s}function W_(e,{isUnhandledRejection:t}){const n=Hd(e),r=t?"promise rejection":"exception";return Pc(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:us(e)?`Event \`${z_(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function z_(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function j_(e){return Object.values(e).find(t=>t instanceof Error)}class q_ extends uh{constructor(t){var d;const n=V_(t),r=Y.SENTRY_SDK_SOURCE||_m();Lu(n,"browser",["browser"],r),(d=n._metadata)!=null&&d.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:s,sendClientReports:i,enableLogs:o,_experiments:c,enableMetrics:a}=this._options,u=a??(c==null?void 0:c.enableMetrics)??!0;Y.document&&(i||o||u)&&Y.document.addEventListener("visibilitychange",()=>{Y.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),o&&ci(this),u&&vu(this))}),s&&this.on("beforeSendSession",Th)}eventFromException(t,n){return H_(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return U_(this._options.stackParser,t,n,r,this._options.attachStacktrace)}_prepareEvent(t,n,r,s){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r,s)}}function V_(e){var t;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(t=Y.SENTRY_RELEASE)==null?void 0:t.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const zt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,P=V,G_=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",rr=(e,t,n,r)=>{let s,i;return o=>{t.value>=0&&(o||r)&&(i=t.value-(s??0),(i||s===void 0)&&(s=t.value,t.delta=i,t.rating=G_(t.value,n),e(t)))}},sr=(e=!0)=>{var n,r;const t=(r=(n=P.performance)==null?void 0:n.getEntriesByType)==null?void 0:r.call(n,"navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},wn=()=>{const e=sr();return(e==null?void 0:e.activationStart)??0};function Tt(e,t,n){P.document&&P.addEventListener(e,t,n)}function Kr(e,t,n){P.document&&P.removeEventListener(e,t,n)}let an=-1;const nl=new Set,Y_=()=>{var e,t;return((e=P.document)==null?void 0:e.visibilityState)==="hidden"&&!((t=P.document)!=null&&t.prerendering)?0:1/0},$r=e=>{if(K_(e)&&an>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of nl)t();isFinite(an)||(an=e.type==="visibilitychange"?e.timeStamp:0,Kr("prerenderingchange",$r,!0))}},ir=()=>{var e;if(P.document&&an<0){const t=wn();an=(P.document.prerendering||(e=globalThis.performance.getEntriesByType("visibility-state").filter(r=>r.name==="hidden"&&r.startTime>t)[0])==null?void 0:e.startTime)??Y_(),Tt("visibilitychange",$r,!0),Tt("pagehide",$r,!0),Tt("prerenderingchange",$r,!0)}return{get firstHiddenTime(){return an},onHidden(t){nl.add(t)}}};function K_(e){var t;return e.type==="pagehide"||((t=P.document)==null?void 0:t.visibilityState)==="hidden"}const X_=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,or=(e,t=-1)=>{var i,o;const n=sr();let r="navigate";return n&&((i=P.document)!=null&&i.prerendering||wn()>0?r="prerender":(o=P.document)!=null&&o.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:X_(),navigationType:r}},Hs=new WeakMap;function oo(e,t){try{return Hs.get(e)||Hs.set(e,new t),Hs.get(e)}catch{return new t}}class Xr{constructor(){Xr.prototype.__init.call(this),Xr.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){var s;if(t.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&t.startTime-r.startTime<1e3&&t.startTime-n.startTime<5e3?(this._sessionValue+=t.value,this._sessionEntries.push(t)):(this._sessionValue=t.value,this._sessionEntries=[t]),(s=this._onAfterProcessingUnexpectedShift)==null||s.call(this,t)}}const In=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{t(s.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},ao=e=>{let t=!1;return()=>{t||(e(),t=!0)}},ms=e=>{var t;(t=P.document)!=null&&t.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},J_=[1800,3e3],Z_=(e,t={})=>{ms(()=>{const n=ir(),r=or("FCP");let s;const o=In("paint",c=>{for(const a of c)a.name==="first-contentful-paint"&&(o.disconnect(),a.startTime<n.firstHiddenTime&&(r.value=Math.max(a.startTime-wn(),0),r.entries.push(a),s(!0)))});o&&(s=rr(e,r,J_,t.reportAllChanges))})},Q_=[.1,.25],eg=(e,t={})=>{Z_(ao(()=>{var a;const n=or("CLS",0);let r;const s=ir(),i=oo(t,Xr),o=u=>{for(const d of u)i._processEntry(d);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},c=In("layout-shift",o);c&&(r=rr(e,n,Q_,t.reportAllChanges),s.onHidden(()=>{o(c.takeRecords()),r(!0)}),(a=P==null?void 0:P.setTimeout)==null||a.call(P,r))}))};let rl=0,Us=1/0,yr=0;const tg=e=>{e.forEach(t=>{t.interactionId&&(Us=Math.min(Us,t.interactionId),yr=Math.max(yr,t.interactionId),rl=yr?(yr-Us)/7+1:0)})};let yi;const sl=()=>yi?rl:performance.interactionCount||0,ng=()=>{"interactionCount"in performance||yi||(yi=In("event",tg,{type:"event",buffered:!0,durationThreshold:0}))},Ws=10;let il=0;const rg=()=>sl()-il;class Jr{constructor(){Jr.prototype.__init.call(this),Jr.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){il=sl(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(rg()/50));return this._longestInteractionList[t]}_processEntry(t){var s,i;if((s=this._onBeforeProcessingEntry)==null||s.call(this,t),!(t.interactionId||t.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(t.interactionId);if(r||this._longestInteractionList.length<Ws||t.duration>n._latency){if(r?t.duration>r._latency?(r.entries=[t],r._latency=t.duration):t.duration===r._latency&&t.startTime===r.entries[0].startTime&&r.entries.push(t):(r={id:t.interactionId,entries:[t],_latency:t.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((o,c)=>c._latency-o._latency),this._longestInteractionList.length>Ws){const o=this._longestInteractionList.splice(Ws);for(const c of o)this._longestInteractionMap.delete(c.id)}(i=this._onAfterProcessingINPCandidate)==null||i.call(this,r)}}}const ol=e=>{var n;const t=P.requestIdleCallback||P.setTimeout;((n=P.document)==null?void 0:n.visibilityState)==="hidden"?e():(e=ao(e),Tt("visibilitychange",e,{once:!0,capture:!0}),Tt("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Kr("visibilitychange",e,{capture:!0}),Kr("pagehide",e,{capture:!0})}))},sg=[200,500],ig=40,og=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=ir();ms(()=>{ng();const r=or("INP");let s;const i=oo(t,Jr),o=a=>{ol(()=>{for(const d of a)i._processEntry(d);const u=i._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,s())})},c=In("event",o,{durationThreshold:t.durationThreshold??ig});s=rr(e,r,sg,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(c.takeRecords()),s(!0)}))})};class ag{_processEntry(t){var n;(n=this._onBeforeProcessingEntry)==null||n.call(this,t)}}const cg=[2500,4e3],ug=(e,t={})=>{ms(()=>{const n=ir(),r=or("LCP");let s;const i=oo(t,ag),o=a=>{t.reportAllChanges||(a=a.slice(-1));for(const u of a)i._processEntry(u),u.startTime<n.firstHiddenTime&&(r.value=Math.max(u.startTime-wn(),0),r.entries=[u],s())},c=In("largest-contentful-paint",o);if(c){s=rr(e,r,cg,t.reportAllChanges);const a=ao(()=>{o(c.takeRecords()),c.disconnect(),s(!0)}),u=d=>{d.isTrusted&&(ol(a),Kr(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])Tt(d,u,{capture:!0})}})},lg=[800,1800],Si=e=>{var t,n;(t=P.document)!=null&&t.prerendering?ms(()=>Si(e)):((n=P.document)==null?void 0:n.readyState)!=="complete"?addEventListener("load",()=>Si(e),!0):setTimeout(e)},dg=(e,t={})=>{const n=or("TTFB"),r=rr(e,n,lg,t.reportAllChanges);Si(()=>{const s=sr();s&&(n.value=Math.max(s.responseStart-wn(),0),n.entries=[s],r(!0))})},Mn={},Zr={};let al,cl,ul,ll;function co(e,t=!1){return _s("cls",e,pg,al,t)}function uo(e,t=!1){return _s("lcp",e,hg,cl,t)}function fg(e){return _s("ttfb",e,mg,ul)}function dl(e){return _s("inp",e,_g,ll)}function mn(e,t){return fl(e,t),Zr[e]||(gg(e),Zr[e]=!0),pl(e,t)}function ar(e,t){const n=Mn[e];if(n!=null&&n.length)for(const r of n)try{r(t)}catch(s){zt&&b.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${lt(r)}
Error:`,s)}}function pg(){return eg(e=>{ar("cls",{metric:e}),al=e},{reportAllChanges:!0})}function hg(){return ug(e=>{ar("lcp",{metric:e}),cl=e},{reportAllChanges:!0})}function mg(){return dg(e=>{ar("ttfb",{metric:e}),ul=e})}function _g(){return og(e=>{ar("inp",{metric:e}),ll=e})}function _s(e,t,n,r,s=!1){fl(e,t);let i;return Zr[e]||(i=n(),Zr[e]=!0),r&&t({metric:r}),pl(e,t,s?i:void 0)}function gg(e){const t={};e==="event"&&(t.durationThreshold=0),In(e,n=>{ar(e,{entries:n})},t)}function fl(e,t){Mn[e]=Mn[e]||[],Mn[e].push(t)}function pl(e,t,n){return()=>{n&&n();const r=Mn[e];if(!r)return;const s=r.indexOf(t);s!==-1&&r.splice(s,1)}}function yg(e){return"duration"in e}const Sg=e=>{const t=n=>{var r;(n.type==="pagehide"||((r=P.document)==null?void 0:r.visibilityState)==="hidden")&&e(n)};Tt("visibilitychange",t,{capture:!0,once:!0}),Tt("pagehide",t,{capture:!0,once:!0})};function zs(e){return typeof e=="number"&&isFinite(e)}function Ct(e,t,n,{...r}){const s=te(e).start_timestamp;return s&&s>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),fu(e,()=>{const i=It({startTime:t,...r});return i&&i.end(n),i})}function lo(e){var _;const t=W();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:o,environment:c,sendDefaultPii:a}=t.getOptions(),u=t.getIntegrationByName("Replay"),d=u==null?void 0:u.getReplayId(),l=ne(),f=l.getUser(),p=f!==void 0?f.email||f.id||f.ip_address:void 0;let h;try{h=l.getScopeData().contexts.profile.profile_id}catch{}const m={release:o,environment:c,user:p||void 0,profile_id:h||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":(_=P.navigator)==null?void 0:_.userAgent,"client.address":a?"{{auto}}":void 0,...s};return It({name:n,attributes:m,startTime:i,experimental:{standalone:!0}})}function gs(){return P.addEventListener&&P.performance}function ge(e){return e/1e3}function bg(e){let t="unknown",n="unknown",r="";for(const s of e){if(s==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}function hl(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function ml(e,t){let n,r=!1;function s(c){!r&&n&&t(c,n),r=!0}Sg(()=>{s("pagehide")});const i=e.on("beforeStartNavigationSpan",(c,a)=>{a!=null&&a.isRedirect||(s("navigation"),i(),o())}),o=e.on("afterStartPageLoadSpan",c=>{n=c.spanContext().spanId,o()})}function Eg(e){let t=0,n;if(!hl("layout-shift"))return;const r=co(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);ml(e,(s,i)=>{vg(t,n,i,s),r()})}function vg(e,t,n,r){var u;zt&&b.log(`Sending CLS span (${e})`);const s=t?ge((He()||0)+t.startTime):me(),i=ne().getScopeData().transactionName,o=t?Ne((u=t.sources[0])==null?void 0:u.node):"Layout shift",c={[pe]:"auto.http.browser.cls",[pt]:"ui.webvital.cls",[vn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t!=null&&t.sources&&t.sources.forEach((d,l)=>{c[`cls.source.${l+1}`]=Ne(d.node)});const a=lo({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("cls",{[Jn]:"",[Zn]:e}),a.end(s))}function Tg(e){let t=0,n;if(!hl("largest-contentful-paint"))return;const r=uo(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(t=s.value,n=i)},!0);ml(e,(s,i)=>{wg(t,n,i,s),r()})}function wg(e,t,n,r){zt&&b.log(`Sending LCP span (${e})`);const s=ge((He()||0)+((t==null?void 0:t.startTime)||0)),i=ne().getScopeData().transactionName,o=t?Ne(t.element):"Largest contentful paint",c={[pe]:"auto.http.browser.lcp",[pt]:"ui.webvital.lcp",[vn]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(c["lcp.element"]=Ne(t.element)),t.id&&(c["lcp.id"]=t.id),t.url&&(c["lcp.url"]=t.url),t.loadTime!=null&&(c["lcp.loadTime"]=t.loadTime),t.renderTime!=null&&(c["lcp.renderTime"]=t.renderTime),t.size!=null&&(c["lcp.size"]=t.size));const a=lo({name:o,transaction:i,attributes:c,startTime:s});a&&(a.addEvent("lcp",{[Jn]:"millisecond",[Zn]:e}),a.end(s))}function ze(e){return e&&((He()||performance.timeOrigin)+e)/1e3}function _l(e){var n;const t={};if(e.nextHopProtocol!=null){const{name:r,version:s}=bg(e.nextHopProtocol);t["network.protocol.version"]=s,t["network.protocol.name"]=r}return He()||(n=gs())!=null&&n.timeOrigin?Ig({...t,"http.request.redirect_start":ze(e.redirectStart),"http.request.redirect_end":ze(e.redirectEnd),"http.request.worker_start":ze(e.workerStart),"http.request.fetch_start":ze(e.fetchStart),"http.request.domain_lookup_start":ze(e.domainLookupStart),"http.request.domain_lookup_end":ze(e.domainLookupEnd),"http.request.connect_start":ze(e.connectStart),"http.request.secure_connection_start":ze(e.secureConnectionStart),"http.request.connection_end":ze(e.connectEnd),"http.request.request_start":ze(e.requestStart),"http.request.response_start":ze(e.responseStart),"http.request.response_end":ze(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Ig(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const kg=2147483647;let Ua=0,Ze={},Me,en;function Cg({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=gs();if(r&&He()){r.mark&&P.performance.mark("sentry-tracing-init");const s=t?Tg(n):Ng(),i=Lg(),o=e?Eg(n):Ag();return()=>{s==null||s(),i(),o==null||o()}}return()=>{}}function Rg(){mn("longtask",({entries:e})=>{const t=Te();if(!t)return;const{op:n,start_timestamp:r}=te(t);for(const s of e){const i=ge(He()+s.startTime),o=ge(s.duration);n==="navigation"&&r&&i<r||Ct(t,i,i+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[pe]:"auto.ui.browser.metrics"}})}})}function xg(){new PerformanceObserver(t=>{const n=Te();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const s=ge(He()+r.startTime),{start_timestamp:i,op:o}=te(n);if(o==="navigation"&&i&&s<i)continue;const c=ge(r.duration),a={[pe]:"auto.ui.browser.metrics"},u=r.scripts[0],{invoker:d,invokerType:l,sourceURL:f,sourceFunctionName:p,sourceCharPosition:h}=u;a["browser.script.invoker"]=d,a["browser.script.invoker_type"]=l,f&&(a["code.filepath"]=f),p&&(a["code.function"]=p),h!==-1&&(a["browser.script.source_char_position"]=h),Ct(n,s,s+c,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:a})}}).observe({type:"long-animation-frame",buffered:!0})}function Mg(){mn("event",({entries:e})=>{const t=Te();if(t){for(const n of e)if(n.name==="click"){const r=ge(He()+n.startTime),s=ge(n.duration),i={name:Ne(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[pe]:"auto.ui.browser.metrics"}},o=$c(n.target);o&&(i.attributes["ui.component_name"]=o),Ct(t,r,r+s,i)}}})}function Ag(){return co(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Ze.cls={value:e.value,unit:""},en=t)},!0)}function Ng(){return uo(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(Ze.lcp={value:e.value,unit:"millisecond"},Me=t)},!0)}function Lg(){return fg(({metric:e})=>{e.entries[e.entries.length-1]&&(Ze.ttfb={value:e.value,unit:"millisecond"})})}function Dg(e,t){const n=gs(),r=He();if(!(n!=null&&n.getEntries)||!r)return;const s=ge(r),i=n.getEntries(),{op:o,start_timestamp:c}=te(e);i.slice(Ua).forEach(a=>{const u=ge(a.startTime),d=ge(Math.max(0,a.duration));if(!(o==="navigation"&&c&&s+u<c))switch(a.entryType){case"navigation":{$g(e,a,s);break}case"mark":case"paint":case"measure":{Pg(e,a,u,d,s,t.ignorePerformanceApiSpans);const l=ir(),f=a.startTime<l.firstHiddenTime;a.name==="first-paint"&&f&&(Ze.fp={value:a.startTime,unit:"millisecond"}),a.name==="first-contentful-paint"&&f&&(Ze.fcp={value:a.startTime,unit:"millisecond"});break}case"resource":{Ug(e,a,a.name,u,d,s,t.ignoreResourceSpans);break}}}),Ua=Math.max(i.length-1,0),Wg(e),o==="pageload"&&(qg(Ze),t.recordClsOnPageloadSpan||delete Ze.cls,t.recordLcpOnPageloadSpan||delete Ze.lcp,Object.entries(Ze).forEach(([a,u])=>{ip(a,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",s),e.setAttribute("performance.activationStart",wn()),zg(e,t)),Me=void 0,en=void 0,Ze={}}function Og(e){if((e==null?void 0:e.entryType)==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function Pg(e,t,n,r,s,i){if(Og(t)||["mark","measure"].includes(t.entryType)&&at(t.name,i))return;const o=sr(!1),c=ge(o?o.requestStart:0),a=s+Math.max(n,c),u=s+n,d=u+r,l={[pe]:"auto.resource.browser.metrics"};a!==u&&(l["sentry.browser.measure_happened_before_request"]=!0,l["sentry.browser.measure_start_time"]=a),Fg(l,t),a<=d&&Ct(e,a,d,{name:t.name,op:t.entryType,attributes:l})}function Fg(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&cn(s))e[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch{}return}if(cn(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function $g(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Sr(e,t,r,n)}),Sr(e,t,"secureConnection",n,"TLS/SSL"),Sr(e,t,"fetch",n,"cache"),Sr(e,t,"domainLookup",n,"DNS"),Hg(e,t,n)}function Sr(e,t,n,r,s=n){const i=Bg(n),o=t[i],c=t[`${n}Start`];!c||!o||Ct(e,r+ge(c),r+ge(o),{op:`browser.${s}`,name:t.name,attributes:{[pe]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function Bg(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function Hg(e,t,n){const r=n+ge(t.requestStart),s=n+ge(t.responseEnd),i=n+ge(t.responseStart);t.responseEnd&&(Ct(e,r,s,{op:"browser.request",name:t.name,attributes:{[pe]:"auto.ui.browser.metrics"}}),Ct(e,i,s,{op:"browser.response",name:t.name,attributes:{[pe]:"auto.ui.browser.metrics"}}))}function Ug(e,t,n,r,s,i,o){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const c=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(o!=null&&o.includes(c))return;const a={[pe]:"auto.resource.browser.metrics"},u=Ht(n);u.protocol&&(a["url.scheme"]=u.protocol.split(":").pop()),u.host&&(a["server.address"]=u.host),a["url.same_origin"]=n.includes(P.location.origin),jg(t,a,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const d={...a,..._l(t)},l=i+r,f=l+s;Ct(e,l,f,{name:n.replace(P.location.origin,""),op:c,attributes:d})}function Wg(e){const t=P.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),zs(n.rtt)&&(Ze["connection.rtt"]={value:n.rtt,unit:"millisecond"})),zs(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),zs(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function zg(e,t){Me&&t.recordLcpOnPageloadSpan&&(Me.element&&e.setAttribute("lcp.element",Ne(Me.element)),Me.id&&e.setAttribute("lcp.id",Me.id),Me.url&&e.setAttribute("lcp.url",Me.url.trim().slice(0,200)),Me.loadTime!=null&&e.setAttribute("lcp.loadTime",Me.loadTime),Me.renderTime!=null&&e.setAttribute("lcp.renderTime",Me.renderTime),e.setAttribute("lcp.size",Me.size)),en!=null&&en.sources&&t.recordClsOnPageloadSpan&&en.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,Ne(n.node)))}function jg(e,t,n){n.forEach(([r,s])=>{const i=e[r];i!=null&&(typeof i=="number"&&i<kg||typeof i=="string")&&(t[s]=i)})}function qg(e){const t=sr(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const Vg=1e3;let Wa,bi,Ei;function gl(e){const t="dom";Rt(t,e),xt(t,Gg)}function Gg(){if(!P.document)return;const e=qe.bind(null,"dom"),t=za(e,!0);P.document.addEventListener("click",t,!1),P.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{var i,o;const s=(i=P[n])==null?void 0:i.prototype;(o=s==null?void 0:s.hasOwnProperty)!=null&&o.call(s,"addEventListener")&&(Ae(s,"addEventListener",function(c){return function(a,u,d){if(a==="click"||a=="keypress")try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},f=l[a]=l[a]||{refCount:0};if(!f.handler){const p=za(e);f.handler=p,c.call(this,a,p,d)}f.refCount++}catch{}return c.call(this,a,u,d)}}),Ae(s,"removeEventListener",function(c){return function(a,u,d){if(a==="click"||a=="keypress")try{const l=this.__sentry_instrumentation_handlers__||{},f=l[a];f&&(f.refCount--,f.refCount<=0&&(c.call(this,a,f.handler,d),f.handler=void 0,delete l[a]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return c.call(this,a,u,d)}}))})}function Yg(e){if(e.type!==bi)return!1;try{if(!e.target||e.target._sentryId!==Ei)return!1}catch{}return!0}function Kg(e,t){return e!=="keypress"?!1:t!=null&&t.tagName?!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable):!0}function za(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Xg(n);if(Kg(n.type,r))return;Le(n,"_sentryCaptured",!0),r&&!r._sentryId&&Le(r,"_sentryId",$e());const s=n.type==="keypress"?"input":n.type;Yg(n)||(e({event:n,name:s,global:t}),bi=n.type,Ei=r?r._sentryId:void 0),clearTimeout(Wa),Wa=P.setTimeout(()=>{Ei=void 0,bi=void 0},Vg)}}function Xg(e){try{return e.target}catch{return null}}let br;function ys(e){const t="history";Rt(t,e),xt(t,Jg)}function Jg(){if(P.addEventListener("popstate",()=>{const t=P.location.href,n=br;if(br=t,n===t)return;qe("history",{from:n,to:t})}),!am())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=br,i=Zg(String(r));if(br=i,s===i)return t.apply(this,n);qe("history",{from:s,to:i})}return t.apply(this,n)}}Ae(P.history,"pushState",e),Ae(P.history,"replaceState",e)}function Zg(e){try{return new URL(e,P.location.origin).toString()}catch{return e}}const Br={};function yl(e){const t=Br[e];if(t)return t;let n=P[e];if(di(n))return Br[e]=n.bind(P);const r=P.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const i=s.contentWindow;i!=null&&i[e]&&(n=i[e]),r.head.removeChild(s)}catch(s){zt&&b.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,s)}return n&&(Br[e]=n.bind(P))}function Qg(e){Br[e]=void 0}function cr(...e){return yl("setTimeout")(...e)}const Ot="__sentry_xhr_v3__";function Sl(e){const t="xhr";Rt(t,e),xt(t,ey)}function ey(){if(!P.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=new Error,i=me()*1e3,o=ot(r[0])?r[0].toUpperCase():void 0,c=ty(r[1]);if(!o||!c)return t.apply(n,r);n[Ot]={method:o,url:c,request_headers:{}},o==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const a=()=>{const u=n[Ot];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:me()*1e3,startTimestamp:i,xhr:n,virtualError:s};qe("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,l){return a(),u.apply(d,l)}}):n.addEventListener("readystatechange",a),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,l){const[f,p]=l,h=d[Ot];return h&&ot(f)&&ot(p)&&(h.request_headers[f.toLowerCase()]=p),u.apply(d,l)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const s=n[Ot];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:me()*1e3,xhr:n};return qe("xhr",i),t.apply(n,r)}})}function ty(e){if(ot(e))return e;try{return e.toString()}catch{}}const ny=Symbol.for("sentry__originalRequestBody");function bl(e){return new URLSearchParams(e).toString()}function El(e,t=b){try{if(typeof e=="string")return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[bl(e)];if(!e)return[void 0]}catch(n){return zt&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return zt&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function vl(e=[]){if(e.length>=2&&e[1]&&typeof e[1]=="object"&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){const n=e[0][ny];return n!==void 0?n:void 0}}function Tl(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return zt&&b.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r
`).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const js=[],Hr=new Map,Xt=new Map,ry=60;function sy(){if(gs()&&He()){const t=iy();return()=>{t()}}return()=>{}}const vi={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 iy(){return dl(oy)}const oy=({metric:e})=>{if(e.value==null)return;const t=ge(e.value);if(t>ry)return;const n=e.entries.find(h=>h.duration===e.value&&vi[h.name]);if(!n)return;const{interactionId:r}=n,s=vi[n.name],i=ge(He()+n.startTime),o=Te(),c=o?ve(o):void 0,a=r!=null?Hr.get(r):void 0,u=(a==null?void 0:a.span)||c,d=u?te(u).description:ne().getScopeData().transactionName,l=(a==null?void 0:a.elementName)||Ne(n.target),f={[pe]:"auto.http.browser.inp",[pt]:`ui.interaction.${s}`,[vn]:n.duration},p=lo({name:l,transaction:d,attributes:f,startTime:i});p&&(p.addEvent("inp",{[Jn]:"millisecond",[Zn]:e.value}),p.end(i+t))};function ay(){const e=Object.keys(vi);Gr()&&e.forEach(s=>{P.addEventListener(s,t,{capture:!0,passive:!0})});function t(s){const i=s.target;if(!i)return;const o=Ne(i),c=Math.round(s.timeStamp);if(Xt.set(c,o),Xt.size>50){const a=Xt.keys().next().value;a!==void 0&&Xt.delete(a)}}function n(s){const i=Math.round(s.startTime);let o=Xt.get(i);if(!o)for(let c=-5;c<=5;c++){const a=Xt.get(i+c);if(a){o=a;break}}return o||"<unknown>"}const r=({entries:s})=>{const i=Te(),o=i&&ve(i);s.forEach(c=>{if(!yg(c))return;const a=c.interactionId;if(a==null||Hr.has(a))return;const u=c.target?Ne(c.target):n(c);if(js.length>10){const d=js.shift();Hr.delete(d)}js.push(a),Hr.set(a,{span:o,elementName:u})})};mn("event",r),mn("first-input",r)}const cy=40;function uy(e,t=yl("fetch")){let n=0,r=0;async function s(i){const o=i.body.length;n+=o,r++;const c={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const a=await t(e.url,c);return{statusCode:a.status,headers:{"x-sentry-rate-limits":a.headers.get("X-Sentry-Rate-Limits"),"retry-after":a.headers.get("Retry-After")}}}catch(a){throw Qg("fetch"),a}finally{n-=o,r--}}return sh(e,s,Yi(e.bufferSize||cy))}const Be=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,ly=30,dy=50;function Ti(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?Ut:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const fy=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,py=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,hy=/\((\S*)(?::(\d+))(?::(\d+))\)/,my=/at (.+?) ?\(data:(.+?),/,_y=e=>{var s;const t=e.match(my);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=fy.exec(e);if(n){const[,i,o,c]=n;return Ti(i,Ut,+o,+c)}const r=py.exec(e);if(r){if(((s=r[2])==null?void 0:s.indexOf("eval"))===0){const a=hy.exec(r[2]);a&&(r[2]=a[1],r[3]=a[2],r[4]=a[3])}const[o,c]=wl(r[1]||Ut,r[2]);return Ti(c,o,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},gy=[ly,_y],yy=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Sy=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,by=e=>{const t=yy.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const i=Sy.exec(t[3]);i&&(t[1]=t[1]||"eval",t[3]=i[1],t[4]=i[2],t[5]="")}let r=t[3],s=t[1]||Ut;return[s,r]=wl(s,r),Ti(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},Ey=[dy,by],vy=[gy,Ey],Ty=Ac(...vy),wl=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:Ut,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Er=1024,wy="Breadcrumbs",Iy=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:wy,setup(n){t.console&&zh(xy(n)),t.dom&&gl(Ry(n,t.dom)),t.xhr&&Sl(My(n)),t.fetch&&Hu(Ay(n)),t.history&&ys(Ny(n)),t.sentry&&n.on("beforeSendEvent",Cy(n))}}},ky=Iy;function Cy(e){return function(n){W()===e&&kt({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Nt(n)},{event:n})}}function Ry(e,t){return function(r){if(W()!==e)return;let s,i,o=typeof t=="object"?t.serializeAttribute:void 0,c=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;c&&c>Er&&(Be&&b.warn(`\`dom.maxStringLength\` cannot exceed ${Er}, but a value of ${c} was configured. Sentry will use ${Er} instead.`),c=Er),typeof o=="string"&&(o=[o]);try{const u=r.event,d=Ly(u)?u.target:u;s=Ne(d,{keyAttrs:o,maxStringLength:c}),i=$c(d)}catch{s="<unknown>"}if(s.length===0)return;const a={category:`ui.${r.name}`,message:s};i&&(a.data={"ui.component_name":i}),kt(a,{event:r.event,name:r.name,global:r.global})}}function xy(e){return function(n){if(W()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:Pu(n.level),message:Oo(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${Oo(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;kt(r,{input:n.args,level:n.level})}}function My(e){return function(n){if(W()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,i=n.xhr[Ot];if(!r||!s||!i)return;const{method:o,url:c,status_code:a,body:u}=i,d={method:o,url:c,status_code:a},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:s},f={category:"xhr",data:d,type:"http",level:Bu(a)};e.emit("beforeOutgoingRequestBreadcrumb",f,l),kt(f,l)}}function Ay(e){return function(n){if(W()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},o={category:"fetch",data:n.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",o,i),kt(o,i)}else{const i=n.response,o={...n.fetchData,status_code:i==null?void 0:i.status},c={input:n.args,response:i,startTimestamp:r,endTimestamp:s},a={category:"fetch",data:o,type:"http",level:Bu(o.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,c),kt(a,c)}}}function Ny(e){return function(n){if(W()!==e)return;let r=n.from,s=n.to;const i=Ht(Y.location.href);let o=r?Ht(r):void 0;const c=Ht(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),kt({category:"navigation",data:{from:r,to:s}})}}function Ly(e){return!!e&&!!e.target}const Dy="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(","),Oy="BrowserApiErrors",Py=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:Oy,setupOnce(){t.setTimeout&&Ae(Y,"setTimeout",ja),t.setInterval&&Ae(Y,"setInterval",ja),t.requestAnimationFrame&&Ae(Y,"requestAnimationFrame",$y),t.XMLHttpRequest&&"XMLHttpRequest"in Y&&Ae(XMLHttpRequest.prototype,"send",By);const n=t.eventTarget;n&&(Array.isArray(n)?n:Dy).forEach(s=>Hy(s,t))}}},Fy=Py;function ja(e){return function(...t){const n=t[0];return t[0]=hn(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${lt(e)}`}}),e.apply(this,t)}}function $y(e){return function(t){return e.apply(this,[hn(t,{mechanism:{data:{handler:lt(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function By(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&Ae(n,s,function(i){const o={mechanism:{data:{handler:lt(i)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},c=Bi(i);return c&&(o.mechanism.data.handler=lt(c)),hn(i,o)})}),e.apply(this,t)}}function Hy(e,t){var s,i;const r=(s=Y[e])==null?void 0:s.prototype;(i=r==null?void 0:r.hasOwnProperty)!=null&&i.call(r,"addEventListener")&&(Ae(r,"addEventListener",function(o){return function(c,a,u){try{Uy(a)&&(a.handleEvent=hn(a.handleEvent,{mechanism:{data:{handler:lt(a),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&Wy(this,c,a),o.apply(this,[c,hn(a,{mechanism:{data:{handler:lt(a),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),Ae(r,"removeEventListener",function(o){return function(c,a,u){try{const d=a.__sentry_wrapped__;d&&o.call(this,c,d,u)}catch{}return o.call(this,c,a,u)}}))}function Uy(e){return typeof e.handleEvent=="function"}function Wy(e,t,n){e&&typeof e=="object"&&"removeEventListener"in e&&typeof e.removeEventListener=="function"&&e.removeEventListener(t,n)}const zy=(e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(typeof Y.document>"u"){Be&&b.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}ra({ignoreDuration:!0}),Ns();const n=Ce();let r=n.getUser();n.addScopeListener(s=>{const i=s.getUser();((r==null?void 0:r.id)!==(i==null?void 0:i.id)||(r==null?void 0:r.ip_address)!==(i==null?void 0:i.ip_address))&&(Ns(),r=i)}),t==="route"&&ys(({from:s,to:i})=>{s!==i&&(ra({ignoreDuration:!0}),Ns())})}}},jy="CultureContext",qy=()=>({name:jy,preprocessEvent(e){var n;const t=Gy();t&&(e.contexts={...e.contexts,culture:{...t,...(n=e.contexts)==null?void 0:n.culture}})}}),Vy=qy;function Gy(){try{const e=Y.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const Yy="GlobalHandlers",Ky=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:Yy,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(Jy(n),qa("onerror")),t.onunhandledrejection&&(Zy(n),qa("onunhandledrejection"))}}},Xy=Ky;function Jy(e){Lc(t=>{const{stackParser:n,attachStacktrace:r}=Il();if(W()!==e||el())return;const{msg:s,url:i,line:o,column:c,error:a}=t,u=tS(io(n,a||s,void 0,r,!1),i,o,c);u.level="error",gu(u,{originalException:a,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function Zy(e){Dc(t=>{const{stackParser:n,attachStacktrace:r}=Il();if(W()!==e||el())return;const s=Qy(t),i=cn(s)?eS(s):io(n,s,void 0,r,!0);i.level="error",gu(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function Qy(e){if(cn(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function eS(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function tS(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},c=o.stacktrace=o.stacktrace||{},a=c.frames=c.frames||[];return a.length===0&&a.push({colno:r,lineno:n,filename:nS(t)??qt(),function:Ut,in_app:!0}),e}function qa(e){Be&&b.log(`Global Handler attached: ${e}`)}function Il(){const e=W();return(e==null?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function nS(e){if(!(!ot(e)||e.length===0))return e.startsWith("data:")?`<${vt(e,!1)}>`:e}const rS=()=>({name:"HttpContext",preprocessEvent(e){var r;if(!Y.navigator&&!Y.location&&!Y.document)return;const t=no(),n={...t.headers,...(r=e.request)==null?void 0:r.headers};e.request={...t,...e.request,headers:n}}}),sS="cause",iS=5,oS="LinkedErrors",aS=(e={})=>{const t=e.limit||iS,n=e.key||sS;return{name:oS,preprocessEvent(r,s,i){const o=i.getOptions();Wh(ro,o.stackParser,n,t,r,s)}}},cS=aS;function uS(){return lS()?(Be&&rt(()=>{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 lS(){var s;if(typeof Y.window>"u")return!1;const e=Y;if(e.nw)return!1;const t=e.chrome||e.browser;if(!((s=t==null?void 0:t.runtime)!=null&&s.id))return!1;const n=qt();return!(Y===Y.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function kl(e){return[Dh(),Mh(),Qh(),Fy(),ky(),Xy(),cS(),Gh(),rS(),Vy(),zy()]}function dS(e={}){const t=!e.skipBrowserExtensionCheck&&uS();let n=e.defaultIntegrations==null?kl():e.defaultIntegrations;const r={...e,enabled:t?!1:e.enabled,stackParser:Md(e.stackParser||Ty),integrations:Gp({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||uy};return mh(q_,r)}const ce=V,fo="sentryReplaySession",fS="replay_event",po="Unable to send Replay",pS=3e5,hS=9e5,mS=5e3,_S=5500,gS=6e4,yS=5e3,SS=3,Va=15e4,vr=5e3,bS=3e3,ES=300,ho=2e7,vS=4999,TS=5e4,Ga=36e5;var wS=Object.defineProperty,IS=(e,t,n)=>t in e?wS(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ya=(e,t,n)=>IS(e,typeof t!="symbol"?t+"":t,n),_e=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(_e||{});function kS(e){return e.nodeType===e.ELEMENT_NODE}function An(e){const t=e==null?void 0:e.host;return(t==null?void 0:t.shadowRoot)===e}function Nn(e){return Object.prototype.toString.call(e)==="[object ShadowRoot]"}function CS(e){return e.includes(" background-clip: text;")&&!e.includes(" -webkit-background-clip: text;")&&(e=e.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),e}function RS(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return e.layerName===""?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}function Qr(e){try{const t=e.rules||e.cssRules;return t?CS(Array.from(t,Cl).join("")):null}catch{return null}}function xS(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,s=r[n],i=r.getPropertyPriority(s);t+=`${s}:${r.getPropertyValue(s)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}function Cl(e){let t;if(AS(e))try{t=Qr(e.styleSheet)||RS(e)}catch{}else if(NS(e)){let n=e.cssText;const r=e.selectorText.includes(":"),s=typeof e.style.all=="string"&&e.style.all;if(s&&(n=xS(e)),r&&(n=MS(n)),r||s)return n}return t||e.cssText}function MS(e){const t=/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm;return e.replace(t,"$1\\$2")}function AS(e){return"styleSheet"in e}function NS(e){return"selectorText"in e}class Rl{constructor(){Ya(this,"idNodeMap",new Map),Ya(this,"nodeMetaMap",new WeakMap)}getId(t){var r;return t?((r=this.getMeta(t))==null?void 0:r.id)??-1:-1}getNode(t){return this.idNodeMap.get(t)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(t){return this.nodeMetaMap.get(t)||null}removeNodeFromMap(t){const n=this.getId(t);this.idNodeMap.delete(n),t.childNodes&&t.childNodes.forEach(r=>this.removeNodeFromMap(r))}has(t){return this.idNodeMap.has(t)}hasNode(t){return this.nodeMetaMap.has(t)}add(t,n){const r=n.id;this.idNodeMap.set(r,t),this.nodeMetaMap.set(t,n)}replace(t,n){const r=this.getNode(t);if(r){const s=this.nodeMetaMap.get(r);s&&this.nodeMetaMap.set(n,s)}this.idNodeMap.set(t,n)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function LS(){return new Rl}function Ss({maskInputOptions:e,tagName:t,type:n}){return t==="OPTION"&&(t="SELECT"),!!(e[t.toLowerCase()]||n&&e[n]||n==="password"||t==="INPUT"&&!n&&e.text)}function Wn({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function _n(e){return e.toLowerCase()}function wi(e){return e.toUpperCase()}const Ka="__rrweb_original__";function DS(e){const t=e.getContext("2d");if(!t)return!0;const n=50;for(let r=0;r<e.width;r+=n)for(let s=0;s<e.height;s+=n){const i=t.getImageData,o=Ka in i?i[Ka]:i;if(new Uint32Array(o.call(t,r,s,Math.min(n,e.width-r),Math.min(n,e.height-s)).data.buffer).some(a=>a!==0))return!1}return!0}function mo(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?_n(t):null}function es(e,t,n){return t==="INPUT"&&(n==="radio"||n==="checkbox")?e.getAttribute("value")||"":e.value}function xl(e,t){let n;try{n=new URL(e,t??window.location.href)}catch{return null}const r=/\.([0-9a-z]+)(?:$)/i,s=n.pathname.match(r);return(s==null?void 0:s[1])??null}const Xa={};function Ml(e){const t=Xa[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return Xa[e]=r.bind(window)}function Ii(...e){return Ml("setTimeout")(...e)}function Al(...e){return Ml("clearTimeout")(...e)}function Nl(e){try{return e.contentDocument}catch{}}let OS=1;const PS=new RegExp("[^a-z0-9-_:]"),zn=-2;function _o(){return OS++}function FS(e){if(e instanceof HTMLFormElement)return"form";const t=_n(e.tagName);return PS.test(t)?"div":t}function $S(e){let t="";return e.indexOf("//")>-1?t=e.split("/").slice(0,3).join("/"):t=e.split("/")[0],t=t.split("?")[0],t}let Jt,Ja;const BS=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,HS=/^(?:[a-z+]+:)?\/\//i,US=/^www\..*/i,WS=/^(data:)([^,]*),(.*)/i;function zS(e,t){if(!e||t.size===0)return e;try{const n=e.split(";"),r=[];for(let s of n){if(s=s.trim(),!s)continue;const i=s.indexOf(":");if(i===-1){r.push(s);continue}const o=s.slice(0,i).trim();t.has(o)||r.push(s)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(n){return console.warn("Error filtering CSS properties:",n),e}}function ts(e,t){return(e||"").replace(BS,(n,r,s,i,o,c)=>{const a=s||o||c,u=r||i||"";if(!a)return n;if(HS.test(a)||US.test(a))return`url(${u}${a}${u})`;if(WS.test(a))return`url(${u}${a}${u})`;if(a[0]==="/")return`url(${u}${$S(t)+a}${u})`;const d=t.split("/"),l=a.split("/");d.pop();for(const f of l)f!=="."&&(f===".."?d.pop():d.push(f));return`url(${u}${d.join("/")}${u})`})}const jS=/^[^ \t\n\r\u000c]+/,qS=/^[, \t\n\r\u000c]+/;function VS(e,t){if(t.trim()==="")return t;let n=0;function r(i){let o;const c=i.exec(t.substring(n));return c?(o=c[0],n+=o.length,o):""}const s=[];for(;r(qS),!(n>=t.length);){let i=r(jS);if(i.slice(-1)===",")i=tn(e,i.substring(0,i.length-1)),s.push(i);else{let o="";i=tn(e,i);let c=!1;for(;;){const a=t.charAt(n);if(a===""){s.push((i+o).trim());break}else if(c)a===")"&&(c=!1);else if(a===","){n+=1,s.push((i+o).trim());break}else a==="("&&(c=!0);o+=a,n+=1}}}return s.join(", ")}const Za=new WeakMap;function tn(e,t){return!t||t.trim()===""?t:bs(e,t)}function GS(e){return!!(e.tagName==="svg"||e.ownerSVGElement)}function bs(e,t){let n=Za.get(e);if(n||(n=e.createElement("a"),Za.set(e,n)),!t)t="";else if(t.startsWith("blob:")||t.startsWith("data:"))return t;return n.setAttribute("href",t),n.href}function Ll(e,t,n,r,s,i,o){if(!r)return r;if(n==="src"||n==="href"&&!(t==="use"&&r[0]==="#"))return tn(e,r);if(n==="xlink:href"&&r[0]!=="#")return tn(e,r);if(n==="background"&&(t==="table"||t==="td"||t==="th"))return tn(e,r);if(n==="srcset")return VS(e,r);if(n==="style"){let c=ts(r,bs(e));return o&&o.size>0&&(c=zS(c,o)),c}else if(t==="object"&&n==="data")return tn(e,r);return typeof i=="function"?i(n,r,s):r}function Dl(e,t,n){return(e==="video"||e==="audio")&&t==="autoplay"}function YS(e,t,n,r){try{if(r&&e.matches(r))return!1;if(typeof t=="string"){if(e.classList.contains(t))return!0}else for(let s=e.classList.length;s--;){const i=e.classList[s];if(t.test(i))return!0}if(n)return e.matches(n)}catch{}return!1}function KS(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}function Pt(e,t,n=1/0,r=0){return!e||e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:Pt(e.parentNode,t,n,r+1)}function nn(e,t){return n=>{const r=n;if(r===null)return!1;try{if(e){if(typeof e=="string"){if(r.matches(`.${e}`))return!0}else if(KS(r,e))return!0}return!!(t&&r.matches(t))}catch{return!1}}}function gn(e,t,n,r,s,i){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(o===null)return!1;if(o.tagName==="INPUT"){const u=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(u))return!0}let c=-1,a=-1;if(i){if(a=Pt(o,nn(r,s)),a<0)return!0;c=Pt(o,nn(t,n),a>=0?a:1/0)}else{if(c=Pt(o,nn(t,n)),c<0)return!1;a=Pt(o,nn(r,s),c>=0?c:1/0)}return c>=0?a>=0?c<=a:!0:a>=0?!1:!!i}catch{}return!!i}function XS(e,t,n){const r=e.contentWindow;if(!r)return;let s=!1,i;try{i=r.document.readyState}catch{return}if(i!=="complete"){const c=Ii(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{Al(c),s=!0,t()});return}const o="about:blank";if(r.location.href!==o||e.src===o||e.src==="")return Ii(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}function JS(e,t,n){let r=!1,s;try{s=e.sheet}catch{return}if(s)return;const i=Ii(()=>{r||(t(),r=!0)},n);e.addEventListener("load",()=>{Al(i),r=!0,t()})}function ZS(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskAttributeFn:a,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,inlineStylesheet:p,maskInputOptions:h={},maskTextFn:m,maskInputFn:_,dataURLOptions:g={},inlineImages:S,recordCanvas:N,keepIframeSrcFn:C,newlyAddedElement:U=!1,ignoreCSSAttributes:A}=t,y=QS(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return e.compatMode!=="CSS1Compat"?{type:_e.Document,childNodes:[],compatMode:e.compatMode}:{type:_e.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:_e.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:y};case e.ELEMENT_NODE:return tb(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:a,maskInputOptions:h,maskInputFn:_,dataURLOptions:g,inlineImages:S,recordCanvas:N,keepIframeSrcFn:C,newlyAddedElement:U,rootId:y,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,ignoreCSSAttributes:A});case e.TEXT_NODE:return eb(e,{doc:n,maskAllText:c,maskTextClass:u,unmaskTextClass:d,maskTextSelector:l,unmaskTextSelector:f,maskTextFn:m,maskInputOptions:h,maskInputFn:_,rootId:y});case e.CDATA_SECTION_NODE:return{type:_e.CDATA,textContent:"",rootId:y};case e.COMMENT_NODE:return{type:_e.Comment,textContent:e.textContent||"",rootId:y};default:return!1}}function QS(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return n===1?void 0:n}function eb(e,t){var g;const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:c,maskInputOptions:a,maskInputFn:u,rootId:d}=t,l=e.parentNode&&e.parentNode.tagName;let f=e.textContent;const p=l==="STYLE"?!0:void 0,h=l==="SCRIPT"?!0:void 0,m=l==="TEXTAREA"?!0:void 0;if(p&&f){try{e.nextSibling||e.previousSibling||(g=e.parentNode.sheet)!=null&&g.cssRules&&(f=Qr(e.parentNode.sheet))}catch(S){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${S}`,e)}f=ts(f,bs(t.doc))}h&&(f="SCRIPT_PLACEHOLDER");const _=gn(e,r,i,s,o,n);if(!p&&!h&&!m&&f&&_&&(f=c?c(f,e.parentElement):f.replace(/[\S]/g,"*")),m&&f&&(a.textarea||_)&&(f=u?u(f,e.parentNode):f.replace(/[\S]/g,"*")),l==="OPTION"&&f){const S=Ss({type:null,tagName:l,maskInputOptions:a});f=Wn({isMasked:gn(e,r,i,s,o,S),element:e,value:f,maskInputFn:u})}return{type:_e.Text,textContent:f||"",isStyle:p,rootId:d}}function tb(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:c={},maskAttributeFn:a,maskInputFn:u,dataURLOptions:d={},inlineImages:l,recordCanvas:f,keepIframeSrcFn:p,newlyAddedElement:h=!1,rootId:m,maskTextClass:_,unmaskTextClass:g,maskTextSelector:S,unmaskTextSelector:N,ignoreCSSAttributes:C}=t,U=YS(e,r,s,i),A=FS(e);let y={};const w=e.attributes.length;for(let E=0;E<w;E++){const x=e.attributes[E];x.name&&!Dl(A,x.name,x.value)&&(y[x.name]=Ll(n,A,_n(x.name),x.value,e,a,C))}if(A==="link"&&o){const E=Array.from(n.styleSheets).find(T=>T.href===e.href);let x=null;E&&(x=Qr(E)),x&&(y.rel=null,y.href=null,y.crossorigin=null,y._cssText=ts(x,E.href))}if(A==="style"&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const E=Qr(e.sheet);E&&(y._cssText=ts(E,bs(n)))}if(A==="input"||A==="textarea"||A==="select"||A==="option"){const E=e,x=mo(E),T=es(E,wi(A),x),k=E.checked;if(x!=="submit"&&x!=="button"&&T){const M=gn(E,_,S,g,N,Ss({type:x,tagName:wi(A),maskInputOptions:c}));y.value=Wn({isMasked:M,element:E,value:T,maskInputFn:u})}k&&(y.checked=k)}if(A==="option"&&(e.selected&&!c.select?y.selected=!0:delete y.selected),A==="canvas"&&f){if(e.__context==="2d")DS(e)||(y.rr_dataURL=e.toDataURL(d.type,d.quality));else if(!("__context"in e)){const E=e.toDataURL(d.type,d.quality),x=n.createElement("canvas");x.width=e.width,x.height=e.height;const T=x.toDataURL(d.type,d.quality);E!==T&&(y.rr_dataURL=E)}}if(A==="img"&&l){Jt||(Jt=n.createElement("canvas"),Ja=Jt.getContext("2d"));const E=e,x=E.currentSrc||E.getAttribute("src")||"<unknown-src>",T=E.crossOrigin,k=()=>{E.removeEventListener("load",k);try{Jt.width=E.naturalWidth,Jt.height=E.naturalHeight,Ja.drawImage(E,0,0),y.rr_dataURL=Jt.toDataURL(d.type,d.quality)}catch(M){if(E.crossOrigin!=="anonymous"){E.crossOrigin="anonymous",E.complete&&E.naturalWidth!==0?k():E.addEventListener("load",k);return}else console.warn(`Cannot inline img src=${x}! Error: ${M}`)}E.crossOrigin==="anonymous"&&(T?y.crossOrigin=T:E.removeAttribute("crossorigin"))};E.complete&&E.naturalWidth!==0?k():E.addEventListener("load",k)}if((A==="audio"||A==="video")&&(y.rr_mediaState=e.paused?"paused":"played",y.rr_mediaCurrentTime=e.currentTime),h||(e.scrollLeft&&(y.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(y.rr_scrollTop=e.scrollTop)),U){const{width:E,height:x}=e.getBoundingClientRect();y={class:y.class,rr_width:`${E}px`,rr_height:`${x}px`}}A==="iframe"&&!p(y.src)&&(!U&&!Nl(e)&&(y.rr_src=y.src),delete y.src);let F;try{customElements.get(A)&&(F=!0)}catch{}return{type:_e.Element,tagName:A,attributes:y,childNodes:[],isSVG:GS(e)||void 0,needBlock:U,rootId:m,isCustom:F}}function ae(e){return e==null?"":e.toLowerCase()}function nb(e,t){if(t.comment&&e.type===_e.Comment)return!0;if(e.type===_e.Element){if(t.script&&(e.tagName==="script"||e.tagName==="link"&&(e.attributes.rel==="preload"||e.attributes.rel==="modulepreload")||e.tagName==="link"&&e.attributes.rel==="prefetch"&&typeof e.attributes.href=="string"&&xl(e.attributes.href)==="js"))return!0;if(t.headFavicon&&(e.tagName==="link"&&e.attributes.rel==="shortcut icon"||e.tagName==="meta"&&(ae(e.attributes.name).match(/^msapplication-tile(image|color)$/)||ae(e.attributes.name)==="application-name"||ae(e.attributes.rel)==="icon"||ae(e.attributes.rel)==="apple-touch-icon"||ae(e.attributes.rel)==="shortcut icon")))return!0;if(e.tagName==="meta"){if(t.headMetaDescKeywords&&ae(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(ae(e.attributes.property).match(/^(og|twitter|fb):/)||ae(e.attributes.name).match(/^(og|twitter):/)||ae(e.attributes.name)==="pinterest"))return!0;if(t.headMetaRobots&&(ae(e.attributes.name)==="robots"||ae(e.attributes.name)==="googlebot"||ae(e.attributes.name)==="bingbot"))return!0;if(t.headMetaHttpEquiv&&e.attributes["http-equiv"]!==void 0)return!0;if(t.headMetaAuthorship&&(ae(e.attributes.name)==="author"||ae(e.attributes.name)==="generator"||ae(e.attributes.name)==="framework"||ae(e.attributes.name)==="publisher"||ae(e.attributes.name)==="progid"||ae(e.attributes.property).match(/^article:/)||ae(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&(ae(e.attributes.name)==="google-site-verification"||ae(e.attributes.name)==="yandex-verification"||ae(e.attributes.name)==="csrf-token"||ae(e.attributes.name)==="p:domain_verify"||ae(e.attributes.name)==="verify-v1"||ae(e.attributes.name)==="verification"||ae(e.attributes.name)==="shopify-checkout-api-token"))return!0}}return!1}function rn(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f=!1,inlineStylesheet:p=!0,maskInputOptions:h={},maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:S,dataURLOptions:N={},inlineImages:C=!1,recordCanvas:U=!1,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:w=5e3,onBlockedImageLoad:F,onStylesheetLoad:E,stylesheetLoadTimeout:x=5e3,keepIframeSrcFn:T=()=>!1,newlyAddedElement:k=!1,ignoreCSSAttributes:M}=t;let{preserveWhiteSpace:J=!0}=t;const K=ZS(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,dataURLOptions:N,inlineImages:C,recordCanvas:U,keepIframeSrcFn:T,newlyAddedElement:k,ignoreCSSAttributes:M});if(!K)return console.warn(e,"not serialized"),null;let Z;r.hasNode(e)?Z=r.getId(e):nb(K,S)||!J&&K.type===_e.Text&&!K.isStyle&&!K.textContent.replace(/^\s+|\s+$/gm,"").length?Z=zn:Z=_o();const v=Object.assign(K,{id:Z});if(r.add(e,v),Z===zn)return null;A&&A(e);let $=!f;if(v.type===_e.Element){$=$&&!v.needBlock;const I=e.shadowRoot;I&&Nn(I)&&(v.isShadowHost=!0)}if((v.type===_e.Document||v.type===_e.Element)&&$){S.headWhitespace&&v.type===_e.Element&&v.tagName==="head"&&(J=!1);const I={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:c,unblockSelector:o,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:f,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:S,dataURLOptions:N,inlineImages:C,recordCanvas:U,preserveWhiteSpace:J,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:w,onBlockedImageLoad:F,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:T,ignoreCSSAttributes:M},L=e.childNodes?Array.from(e.childNodes):[];for(const ee of L){const X=rn(ee,I);X&&v.childNodes.push(X)}if(kS(e)&&e.shadowRoot)for(const ee of Array.from(e.shadowRoot.childNodes)){const X=rn(ee,I);X&&(Nn(e.shadowRoot)&&(X.isShadow=!0),v.childNodes.push(X))}}if(e.parentNode&&An(e.parentNode)&&Nn(e.parentNode)&&(v.isShadow=!0),v.type===_e.Element&&v.tagName==="iframe"&&!v.needBlock&&XS(e,()=>{const I=Nl(e);if(I&&y){const L=rn(I,{doc:I,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:S,dataURLOptions:N,inlineImages:C,recordCanvas:U,preserveWhiteSpace:J,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:T,ignoreCSSAttributes:M});L&&y(e,L)}},w),v.type===_e.Element&&v.tagName==="img"&&!e.complete&&v.needBlock){const I=e,L=()=>{if(I.isConnected&&!I.complete&&F)try{const ee=I.getBoundingClientRect();ee.width>0&&ee.height>0&&F(I,v,ee)}catch{}I.removeEventListener("load",L)};I.isConnected&&I.addEventListener("load",L)}return v.type===_e.Element&&v.tagName==="link"&&typeof v.attributes.rel=="string"&&(v.attributes.rel==="stylesheet"||v.attributes.rel==="preload"&&typeof v.attributes.href=="string"&&xl(v.attributes.href)==="css")&&JS(e,()=>{if(E){const I=rn(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:c,maskTextClass:a,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:l,skipChild:!1,inlineStylesheet:p,maskInputOptions:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:S,dataURLOptions:N,inlineImages:C,recordCanvas:U,preserveWhiteSpace:J,onSerialize:A,onIframeLoad:y,iframeLoadTimeout:w,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:T,ignoreCSSAttributes:M});I&&E(e,I)}},x),v.type===_e.Element&&delete v.needBlock,v}function rb(e,t){const{mirror:n=new Rl,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:c="rr-mask",unmaskTextClass:a=null,maskTextSelector:u=null,unmaskTextSelector:d=null,inlineStylesheet:l=!0,inlineImages:f=!1,recordCanvas:p=!1,maskAllInputs:h=!1,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOM:S=!1,dataURLOptions:N,preserveWhiteSpace:C,onSerialize:U,onIframeLoad:A,iframeLoadTimeout:y,onBlockedImageLoad:w,onStylesheetLoad:F,stylesheetLoadTimeout:E,keepIframeSrcFn:x=()=>!1,ignoreCSSAttributes:T=new Set([])}=t||{};return rn(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:c,unmaskTextClass:a,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:l,maskInputOptions:h===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:h===!1?{}:h,maskAttributeFn:m,maskTextFn:_,maskInputFn:g,slimDOMOptions:S===!0||S==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:S==="all",headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}:S===!1?{}:S,dataURLOptions:N,inlineImages:f,recordCanvas:p,preserveWhiteSpace:C,onSerialize:U,onIframeLoad:A,iframeLoadTimeout:y,onBlockedImageLoad:w,onStylesheetLoad:F,stylesheetLoadTimeout:E,keepIframeSrcFn:x,newlyAddedElement:!1,ignoreCSSAttributes:T})}function ke(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Zt=`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 Qa={map:{},getId(){return console.error(Zt),-1},getNode(){return console.error(Zt),null},removeNodeFromMap(){console.error(Zt)},has(){return console.error(Zt),!1},reset(){console.error(Zt)}};typeof window<"u"&&window.Proxy&&window.Reflect&&(Qa=new Proxy(Qa,{get(e,t,n){return t==="map"&&console.error(Zt),Reflect.get(e,t,n)}}));function jn(e,t,n={}){let r=null,s=0;return function(...i){const o=Date.now();!s&&n.leading===!1&&(s=o);const c=t-(o-s),a=this;c<=0||c>t?(r&&(lb(r),r=null),s=o,e.apply(a,i)):!r&&n.trailing!==!1&&(r=Es(()=>{s=n.leading===!1?0:Date.now(),r=null,e.apply(a,i)},c))}}function Ol(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(o){Es(()=>{n.set.call(this,o)},0),i&&i.set&&i.set.call(this,o)}}),()=>Ol(e,t,i||{},!0)}function go(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return typeof s=="function"&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}let ns=Date.now;/[1-9][0-9]{12}/.test(Date.now().toString())||(ns=()=>new Date().getTime());function Pl(e){var n,r,s,i,o,c;const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:e.pageXOffset!==void 0?e.pageXOffset:(t==null?void 0:t.documentElement.scrollLeft)||((r=(n=t==null?void 0:t.body)==null?void 0:n.parentElement)==null?void 0:r.scrollLeft)||((s=t==null?void 0:t.body)==null?void 0:s.scrollLeft)||0,top:t.scrollingElement?t.scrollingElement.scrollTop:e.pageYOffset!==void 0?e.pageYOffset:(t==null?void 0:t.documentElement.scrollTop)||((o=(i=t==null?void 0:t.body)==null?void 0:i.parentElement)==null?void 0:o.scrollTop)||((c=t==null?void 0:t.body)==null?void 0:c.scrollTop)||0}}function Fl(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function $l(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function Bl(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Oe(e,t,n,r,s){if(!e)return!1;const i=Bl(e);if(!i)return!1;const o=nn(t,n);if(!s){const u=r&&i.matches(r);return o(i)&&!u}const c=Pt(i,o);let a=-1;return c<0?!1:(r&&(a=Pt(i,nn(null,r))),c>-1&&a<0?!0:c<a)}function sb(e,t){return t.getId(e)!==-1}function qs(e,t){return t.getId(e)===zn}function Hl(e,t){if(An(e))return!1;const n=t.getId(e);return t.has(n)?e.parentNode&&e.parentNode.nodeType===e.DOCUMENT_NODE?!1:e.parentNode?Hl(e.parentNode,t):!0:!0}function ki(e){return!!e.changedTouches}function ib(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...t)=>{let n=t[0];if(!(0 in t))throw new TypeError("1 argument is required");do if(this===n)return!0;while(n=n&&n.parentNode);return!1})}function Ul(e,t){return!!(e.nodeName==="IFRAME"&&t.getMeta(e))}function Wl(e,t){return!!(e.nodeName==="LINK"&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&e.getAttribute("rel")==="stylesheet"&&t.getMeta(e))}function Ci(e){return!!(e!=null&&e.shadowRoot)}class ob{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(t){return this.styleIDMap.get(t)??-1}has(t){return this.styleIDMap.has(t)}add(t,n){if(this.has(t))return this.getId(t);let r;return n===void 0?r=this.id++:r=n,this.styleIDMap.set(t,r),this.idStyleMap.set(r,t),r}getStyle(t){return this.idStyleMap.get(t)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function zl(e){var n,r;let t=null;return((r=(n=e.getRootNode)==null?void 0:n.call(e))==null?void 0:r.nodeType)===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function ab(e){let t=e,n;for(;n=zl(t);)t=n;return t}function cb(e){const t=e.ownerDocument;if(!t)return!1;const n=ab(e);return t.contains(n)}function jl(e){const t=e.ownerDocument;return t?t.contains(e)||cb(e):!1}const ec={};function yo(e){const t=ec[e];if(t)return t;const n=window.document;let r=window[e];if(n&&typeof n.createElement=="function")try{const s=n.createElement("iframe");s.hidden=!0,n.head.appendChild(s);const i=s.contentWindow;i&&i[e]&&(r=i[e]),n.head.removeChild(s)}catch{}return ec[e]=r.bind(window)}function ub(...e){return yo("requestAnimationFrame")(...e)}function Es(...e){return yo("setTimeout")(...e)}function lb(...e){return yo("clearTimeout")(...e)}var j=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(j||{}),B=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(B||{}),Ie=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(Ie||{}),it=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(it||{}),Qt=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Qt||{});function So(e){try{return e.contentDocument}catch{}}function db(e){try{return e.contentWindow}catch{}}function tc(e){return"__ln"in e}class fb{constructor(){this.length=0,this.head=null,this.tail=null}get(t){if(t>=this.length)throw new Error("Position outside of list range");let n=this.head;for(let r=0;r<t;r++)n=(n==null?void 0:n.next)||null;return n}addNode(t){const n={value:t,previous:null,next:null};if(t.__ln=n,t.previousSibling&&tc(t.previousSibling)){const r=t.previousSibling.__ln.next;n.next=r,n.previous=t.previousSibling.__ln,t.previousSibling.__ln.next=n,r&&(r.previous=n)}else if(t.nextSibling&&tc(t.nextSibling)&&t.nextSibling.__ln.previous){const r=t.nextSibling.__ln.previous;n.previous=r,n.next=t.nextSibling.__ln,t.nextSibling.__ln.previous=n,r&&(r.next=n)}else this.head&&(this.head.previous=n),n.next=this.head,this.head=n;n.next===null&&(this.tail=n),this.length++}removeNode(t){const n=t.__ln;this.head&&(n.previous?(n.previous.next=n.next,n.next?n.next.previous=n.previous:this.tail=n.previous):(this.head=n.next,this.head?this.head.previous=null:this.tail=null),t.__ln&&delete t.__ln,this.length--)}}const nc=(e,t)=>`${e}@${t}`;class pb{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=t=>{t.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const t=[],n=new Set,r=new fb,s=a=>{let u=a,d=zn;for(;d===zn;)u=u&&u.nextSibling,d=u&&this.mirror.getId(u);return d},i=a=>{if(!a.parentNode||!jl(a))return;const u=An(a.parentNode)?this.mirror.getId(zl(a)):this.mirror.getId(a.parentNode),d=s(a);if(u===-1||d===-1)return r.addNode(a);const l=rn(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=>{Ul(f,this.mirror)&&!Oe(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(f),Wl(f,this.mirror)&&this.stylesheetManager.trackLinkElement(f),Ci(a)&&this.shadowDomManager.addShadowRoot(a.shadowRoot,this.doc)},onIframeLoad:(f,p)=>{Oe(f,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(f,p),f.contentWindow&&this.canvasManager.addWindow(f.contentWindow),this.shadowDomManager.observeAttachShadow(f))},onStylesheetLoad:(f,p)=>{this.stylesheetManager.attachLinkElement(f,p)},onBlockedImageLoad:(f,p,{width:h,height:m})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:p.id,attributes:{style:{width:`${h}px`,height:`${m}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});l&&(t.push({parentId:u,nextId:d,node:l}),n.add(l.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const a of this.movedSet)rc(this.removes,a,this.mirror)&&!this.movedSet.has(a.parentNode)||i(a);for(const a of this.addedSet)!sc(this.droppedSet,a)&&!rc(this.removes,a,this.mirror)||sc(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),d=s(o.value);u!==-1&&d!==-1&&(a=o)}if(!a){let u=r.tail;for(;u;){const d=u;if(u=u.previous,d){const l=this.mirror.getId(d.value.parentNode);if(s(d.value)===-1)continue;if(l!==-1){a=d;break}else{const p=d.value;if(p.parentNode&&p.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const h=p.parentNode.host;if(this.mirror.getId(h)!==-1){a=d;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 d=JSON.stringify(a.styleDiff),l=JSON.stringify(a._unchangedStyles);d.length<u.style.length&&(d+l).split("var(").length===u.style.split("var(").length&&(u.style=a.styleDiff)}return{id:this.mirror.getId(a.node),attributes:u}}).filter(a=>!n.has(a.id)).filter(a=>this.mirror.has(a.id)),removes:this.removes,adds:t};!c.texts.length&&!c.attributes.length&&!c.removes.length&&!c.adds.length||(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(c))},this.processMutation=t=>{if(!qs(t.target,this.mirror))switch(t.type){case"characterData":{const n=t.target.textContent;!Oe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&n!==t.oldValue&&this.texts.push({value:gn(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&n?this.maskTextFn?this.maskTextFn(n,Bl(t.target)):n.replace(/[\S]/g,"*"):n,node:t.target});break}case"attributes":{const n=t.target;let r=t.attributeName,s=t.target.getAttribute(r);if(r==="value"){const o=mo(n),c=n.tagName;s=es(n,c,o);const a=Ss({maskInputOptions:this.maskInputOptions,tagName:c,type:o}),u=gn(t.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,a);s=Wn({isMasked:u,element:n,value:s,maskInputFn:this.maskInputFn})}if(Oe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||s===t.oldValue)return;let i=this.attributeMap.get(t.target);if(n.tagName==="IFRAME"&&r==="src"&&!this.keepIframeSrcFn(s))if(!So(n))r="rr_src";else return;if(i||(i={node:t.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(i),this.attributeMap.set(t.target,i)),r==="type"&&n.tagName==="INPUT"&&(t.oldValue||"").toLowerCase()==="password"&&n.setAttribute("data-rr-is-password","true"),!Dl(n.tagName,r)&&(i.attributes[r]=Ll(this.doc,_n(n.tagName),_n(r),s,n,this.maskAttributeFn),r==="style")){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch{this.unattachedDoc=this.doc}const o=this.unattachedDoc.createElement("span");t.oldValue&&o.setAttribute("style",t.oldValue);for(const c of Array.from(n.style)){const a=n.style.getPropertyValue(c),u=n.style.getPropertyPriority(c);a!==o.style.getPropertyValue(c)||u!==o.style.getPropertyPriority(c)?u===""?i.styleDiff[c]=a:i.styleDiff[c]=[a,u]:i._unchangedStyles[c]=[a,u]}for(const c of Array.from(o.style))n.style.getPropertyValue(c)===""&&(i.styleDiff[c]=!1)}break}case"childList":{if(Oe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;t.addedNodes.forEach(n=>this.genAdds(n,t.target)),t.removedNodes.forEach(n=>{const r=this.mirror.getId(n),s=An(t.target)?this.mirror.getId(t.target.host):this.mirror.getId(t.target);Oe(t.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||qs(n,this.mirror)||!sb(n,this.mirror)||(this.addedSet.has(n)?(Ri(this.addedSet,n),this.droppedSet.add(n)):this.addedSet.has(t.target)&&r===-1||Hl(t.target,this.mirror)||(this.movedSet.has(n)&&this.movedMap[nc(r,s)]?Ri(this.movedSet,n):this.removes.push({parentId:s,id:r,isShadow:An(t.target)&&Nn(t.target)?!0:void 0})),this.mapRemoves.push(n))});break}}},this.genAdds=(t,n)=>{if(!this.processedNodeManager.inOtherBuffer(t,this)&&!(this.addedSet.has(t)||this.movedSet.has(t))){if(this.mirror.hasNode(t)){if(qs(t,this.mirror))return;this.movedSet.add(t);let r=null;n&&this.mirror.hasNode(n)&&(r=this.mirror.getId(n)),r&&r!==-1&&(this.movedMap[nc(this.mirror.getId(t),r)]=!0)}else this.addedSet.add(t),this.droppedSet.delete(t);Oe(t,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(t.childNodes&&t.childNodes.forEach(r=>this.genAdds(r)),Ci(t)&&t.shadowRoot.childNodes.forEach(r=>{this.processedNodeManager.add(r,this),this.genAdds(r,t)}))}}}init(t){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(n=>{this[n]=t[n]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Ri(e,t){var n;e.delete(t),(n=t.childNodes)==null||n.forEach(r=>Ri(e,r))}function rc(e,t,n){return e.length===0?!1:hb(e,t,n)}function hb(e,t,n){let r=t.parentNode;for(;r;){const s=n.getId(r);if(e.some(i=>i.id===s))return!0;r=r.parentNode}return!1}function sc(e,t){return e.size===0?!1:ql(e,t)}function ql(e,t){const{parentNode:n}=t;return n?e.has(n)?!0:ql(e,n):!1}let Ln;function mb(e){Ln=e}function _b(){Ln=void 0}const Q=e=>Ln?(...n)=>{try{return e(...n)}catch(r){if(Ln&&Ln(r)===!0)return()=>{};throw r}}:e,sn=[];function ur(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Vl(e,t){var o,c;const n=new pb;sn.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=(c=(o=window==null?void 0:window.Zone)==null?void 0:o.__symbol__)==null?void 0:c.call(o,"MutationObserver");s&&window[s]&&(r=window[s]);const i=new r(Q(a=>{e.onMutation&&e.onMutation(a)===!1||n.processMutations.bind(n)(a)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function gb({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(t.mousemove===!1)return()=>{};const s=typeof t.mousemove=="number"?t.mousemove:50,i=typeof t.mousemoveCallback=="number"?t.mousemoveCallback:500;let o=[],c;const a=jn(Q(l=>{const f=Date.now()-c;e(o.map(p=>(p.timeOffset-=f,p)),l),o=[],c=null}),i),u=Q(jn(Q(l=>{const f=ur(l),{clientX:p,clientY:h}=ki(l)?l.changedTouches[0]:l;c||(c=ns()),o.push({x:p,y:h,id:r.getId(f),timeOffset:ns()-c}),a(typeof DragEvent<"u"&&l instanceof DragEvent?B.Drag:l instanceof MouseEvent?B.MouseMove:B.TouchMove)}),s,{trailing:!1})),d=[ke("mousemove",u,n),ke("touchmove",u,n),ke("drag",u,n)];return Q(()=>{d.forEach(l=>l())})}function yb({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){if(o.mouseInteraction===!1)return()=>{};const c=o.mouseInteraction===!0||o.mouseInteraction===void 0?{}:o.mouseInteraction,a=[];let u=null;const d=l=>f=>{const p=ur(f);if(Oe(p,r,s,i,!0))return;let h=null,m=l;if("pointerType"in f){switch(f.pointerType){case"mouse":h=it.Mouse;break;case"touch":h=it.Touch;break;case"pen":h=it.Pen;break}h===it.Touch?Ie[l]===Ie.MouseDown?m="TouchStart":Ie[l]===Ie.MouseUp&&(m="TouchEnd"):it.Pen}else ki(f)&&(h=it.Touch);h!==null?(u=h,(m.startsWith("Touch")&&h===it.Touch||m.startsWith("Mouse")&&h===it.Mouse)&&(h=null)):Ie[l]===Ie.Click&&(h=u,u=null);const _=ki(f)?f.changedTouches[0]:f;if(!_)return;const g=n.getId(p),{clientX:S,clientY:N}=_;Q(e)({type:Ie[m],id:g,x:S,y:N,...h!==null&&{pointerType:h}})};return Object.keys(Ie).filter(l=>Number.isNaN(Number(l))&&!l.endsWith("_Departed")&&c[l]!==!1).forEach(l=>{let f=_n(l);const p=d(l);if(window.PointerEvent)switch(Ie[l]){case Ie.MouseDown:case Ie.MouseUp:f=f.replace("mouse","pointer");break;case Ie.TouchStart:case Ie.TouchEnd:return}a.push(ke(f,p,t))}),Q(()=>{a.forEach(l=>l())})}function Gl({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){const c=Q(jn(Q(a=>{const u=ur(a);if(!u||Oe(u,r,s,i,!0))return;const d=n.getId(u);if(u===t&&t.defaultView){const l=Pl(t.defaultView);e({id:d,x:l.left,y:l.top})}else e({id:d,x:u.scrollLeft,y:u.scrollTop})}),o.scroll||100));return ke("scroll",c,t)}function Sb({viewportResizeCb:e},{win:t}){let n=-1,r=-1;const s=Q(jn(Q(()=>{const i=Fl(),o=$l();(n!==i||r!==o)&&(e({width:Number(o),height:Number(i)}),n=i,r=o)}),200));return ke("resize",s,t)}const bb=["INPUT","TEXTAREA","SELECT"],ic=new WeakMap;function Eb({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:c,maskInputOptions:a,maskInputFn:u,sampling:d,userTriggeredOnInput:l,maskTextClass:f,unmaskTextClass:p,maskTextSelector:h,unmaskTextSelector:m}){function _(y){let w=ur(y);const F=y.isTrusted,E=w&&wi(w.tagName);if(E==="OPTION"&&(w=w.parentElement),!w||!E||bb.indexOf(E)<0||Oe(w,r,s,i,!0))return;const x=w;if(x.classList.contains(o)||c&&x.matches(c))return;const T=mo(w);let k=es(x,E,T),M=!1;const J=Ss({maskInputOptions:a,tagName:E,type:T}),K=gn(w,f,h,p,m,J);(T==="radio"||T==="checkbox")&&(M=w.checked),k=Wn({isMasked:K,element:w,value:k,maskInputFn:u}),g(w,l?{text:k,isChecked:M,userTriggered:F}:{text:k,isChecked:M});const Z=w.name;T==="radio"&&Z&&M&&t.querySelectorAll(`input[type="radio"][name="${Z}"]`).forEach(v=>{if(v!==w){const $=Wn({isMasked:K,element:v,value:es(v,E,T),maskInputFn:u});g(v,l?{text:$,isChecked:!M,userTriggered:!1}:{text:$,isChecked:!M})}})}function g(y,w){const F=ic.get(y);if(!F||F.text!==w.text||F.isChecked!==w.isChecked){ic.set(y,w);const E=n.getId(y);Q(e)({...w,id:E})}}const N=(d.input==="last"?["change"]:["input","change"]).map(y=>ke(y,Q(_),t)),C=t.defaultView;if(!C)return()=>{N.forEach(y=>y())};const U=C.Object.getOwnPropertyDescriptor(C.HTMLInputElement.prototype,"value"),A=[[C.HTMLInputElement.prototype,"value"],[C.HTMLInputElement.prototype,"checked"],[C.HTMLSelectElement.prototype,"value"],[C.HTMLTextAreaElement.prototype,"value"],[C.HTMLSelectElement.prototype,"selectedIndex"],[C.HTMLOptionElement.prototype,"selected"]];return U&&U.set&&N.push(...A.map(y=>Ol(y[0],y[1],{set(){Q(_)({target:this,isTrusted:!1})}},!1,C))),Q(()=>{N.forEach(y=>y())})}function rs(e){const t=[];function n(r,s){if(Tr("CSSGroupingRule")&&r.parentRule instanceof CSSGroupingRule||Tr("CSSMediaRule")&&r.parentRule instanceof CSSMediaRule||Tr("CSSSupportsRule")&&r.parentRule instanceof CSSSupportsRule||Tr("CSSConditionRule")&&r.parentRule instanceof CSSConditionRule){const o=Array.from(r.parentRule.cssRules).indexOf(r);s.unshift(o)}else if(r.parentStyleSheet){const o=Array.from(r.parentStyleSheet.cssRules).indexOf(r);s.unshift(o)}return s}return n(e,t)}function yt(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function vb({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Q((d,l,f)=>{const[p,h]=f,{id:m,styleId:_}=yt(l,t,n.styleMirror);return(m&&m!==-1||_&&_!==-1)&&e({id:m,styleId:_,adds:[{rule:p,index:h}]}),d.apply(l,f)})});const i=r.CSSStyleSheet.prototype.deleteRule;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Q((d,l,f)=>{const[p]=f,{id:h,styleId:m}=yt(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,removes:[{index:p}]}),d.apply(l,f)})});let o;r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Q((d,l,f)=>{const[p]=f,{id:h,styleId:m}=yt(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replace:p}),d.apply(l,f)})}));let c;r.CSSStyleSheet.prototype.replaceSync&&(c=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(c,{apply:Q((d,l,f)=>{const[p]=f,{id:h,styleId:m}=yt(l,t,n.styleMirror);return(h&&h!==-1||m&&m!==-1)&&e({id:h,styleId:m,replaceSync:p}),d.apply(l,f)})}));const a={};wr("CSSGroupingRule")?a.CSSGroupingRule=r.CSSGroupingRule:(wr("CSSMediaRule")&&(a.CSSMediaRule=r.CSSMediaRule),wr("CSSConditionRule")&&(a.CSSConditionRule=r.CSSConditionRule),wr("CSSSupportsRule")&&(a.CSSSupportsRule=r.CSSSupportsRule));const u={};return Object.entries(a).forEach(([d,l])=>{u[d]={insertRule:l.prototype.insertRule,deleteRule:l.prototype.deleteRule},l.prototype.insertRule=new Proxy(u[d].insertRule,{apply:Q((f,p,h)=>{const[m,_]=h,{id:g,styleId:S}=yt(p.parentStyleSheet,t,n.styleMirror);return(g&&g!==-1||S&&S!==-1)&&e({id:g,styleId:S,adds:[{rule:m,index:[...rs(p),_||0]}]}),f.apply(p,h)})}),l.prototype.deleteRule=new Proxy(u[d].deleteRule,{apply:Q((f,p,h)=>{const[m]=h,{id:_,styleId:g}=yt(p.parentStyleSheet,t,n.styleMirror);return(_&&_!==-1||g&&g!==-1)&&e({id:_,styleId:g,removes:[{index:[...rs(p),m]}]}),f.apply(p,h)})})}),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(([d,l])=>{l.prototype.insertRule=u[d].insertRule,l.prototype.deleteRule=u[d].deleteRule})})}function Yl({mirror:e,stylesheetManager:t},n){var o,c,a;let r=null;n.nodeName==="#document"?r=e.getId(n):r=e.getId(n.host);const s=n.nodeName==="#document"?(o=n.defaultView)==null?void 0:o.Document:(a=(c=n.ownerDocument)==null?void 0:c.defaultView)==null?void 0:a.ShadowRoot,i=s!=null&&s.prototype?Object.getOwnPropertyDescriptor(s==null?void 0:s.prototype,"adoptedStyleSheets"):void 0;return r===null||r===-1||!s||!i?()=>{}:(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){var u;return(u=i.get)==null?void 0:u.call(this)},set(u){var l;const d=(l=i.set)==null?void 0:l.call(this,u);if(r!==null&&r!==-1)try{t.adoptStyleSheets(u,r)}catch{}return d}}),Q(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})}))}function Tb({styleDeclarationCb:e,mirror:t,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 m;const[d,l,f]=u;if(n.has(d))return i.apply(a,[d,l,f]);const{id:p,styleId:h}=yt((m=a.parentRule)==null?void 0:m.parentStyleSheet,t,r.styleMirror);return(p&&p!==-1||h&&h!==-1)&&e({id:p,styleId:h,set:{property:d,value:l,priority:f},index:rs(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[d]=u;if(n.has(d))return o.apply(a,[d]);const{id:l,styleId:f}=yt((p=a.parentRule)==null?void 0:p.parentStyleSheet,t,r.styleMirror);return(l&&l!==-1||f&&f!==-1)&&e({id:l,styleId:f,remove:{property:d},index:rs(a.parentRule)}),c.apply(a,u)})}),Q(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}function wb({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const c=Q(u=>jn(Q(d=>{const l=ur(d);if(!l||Oe(l,t,n,r,!0))return;const{currentTime:f,volume:p,muted:h,playbackRate:m}=l;e({type:u,id:s.getId(l),currentTime:f,volume:p,muted:h,playbackRate:m})}),i.media||500)),a=[ke("play",c(Qt.Play),o),ke("pause",c(Qt.Pause),o),ke("seeked",c(Qt.Seeked),o),ke("volumechange",c(Qt.VolumeChange),o),ke("ratechange",c(Qt.RateChange),o)];return Q(()=>{a.forEach(u=>u())})}function Ib({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(a,u,d){const l=new i(a,u,d);return s.set(l,{family:a,buffer:typeof u!="string",descriptors:d,fontSource:typeof u=="string"?u:JSON.stringify(Array.from(new Uint8Array(u)))}),l};const o=go(t.fonts,"add",function(c){return function(a){return Es(Q(()=>{const u=s.get(a);u&&(e(u),s.delete(a))}),0),c.apply(this,[a])}});return r.push(()=>{n.FontFace=i}),r.push(o),Q(()=>{r.forEach(c=>c())})}function kb(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let c=!0;const a=Q(()=>{const u=t.getSelection();if(!u||c&&(u!=null&&u.isCollapsed))return;c=u.isCollapsed||!1;const d=[],l=u.rangeCount||0;for(let f=0;f<l;f++){const p=u.getRangeAt(f),{startContainer:h,startOffset:m,endContainer:_,endOffset:g}=p;Oe(h,r,s,i,!0)||Oe(_,r,s,i,!0)||d.push({start:n.getId(h),startOffset:m,end:n.getId(_),endOffset:g})}o({ranges:d})});return a(),ke("selectionchange",a)}function Cb({doc:e,customElementCb:t}){const n=e.defaultView;return!n||!n.customElements?()=>{}:go(n.customElements,"define",function(s){return function(i,o,c){try{t({define:{name:i}})}catch{}return s.apply(this,[i,o,c])}})}function Rb(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=Vl(e,e.doc));const s=gb(e),i=yb(e),o=Gl(e),c=Sb(e,{win:n}),a=Eb(e),u=wb(e);let d=()=>{},l=()=>{},f=()=>{},p=()=>{};e.recordDOM&&(d=vb(e,{win:n}),l=Yl(e,e.doc),f=Tb(e,{win:n}),e.collectFonts&&(p=Ib(e)));const h=kb(e),m=Cb(e),_=[];for(const g of e.plugins)_.push(g.observer(g.callback,n,g.options));return Q(()=>{sn.forEach(g=>g.reset()),r==null||r.disconnect(),s(),i(),o(),c(),a(),u(),d(),l(),f(),p(),h(),m(),_.forEach(g=>g())})}function Tr(e){return typeof window[e]<"u"}function wr(e){return!!(typeof window[e]<"u"&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class xi{constructor(t){this.generateIdFn=t,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(t,n,r,s){const i=r||this.getIdToRemoteIdMap(t),o=s||this.getRemoteIdToIdMap(t);let c=i.get(n);return c||(c=this.generateIdFn(),i.set(n,c),o.set(c,n)),c}getIds(t,n){const r=this.getIdToRemoteIdMap(t),s=this.getRemoteIdToIdMap(t);return n.map(i=>this.getId(t,i,r,s))}getRemoteId(t,n,r){const s=r||this.getRemoteIdToIdMap(t);if(typeof n!="number")return n;const i=s.get(n);return i||-1}getRemoteIds(t,n){const r=this.getRemoteIdToIdMap(t);return n.map(s=>this.getRemoteId(t,s,r))}reset(t){if(!t){this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap;return}this.iframeIdToRemoteIdMap.delete(t),this.iframeRemoteIdToIdMap.delete(t)}getIdToRemoteIdMap(t){let n=this.iframeIdToRemoteIdMap.get(t);return n||(n=new Map,this.iframeIdToRemoteIdMap.set(t,n)),n}getRemoteIdToIdMap(t){let n=this.iframeRemoteIdToIdMap.get(t);return n||(n=new Map,this.iframeRemoteIdToIdMap.set(t,n)),n}}class xb{constructor(){this.crossOriginIframeMirror=new xi(_o),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Mb{constructor(t){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new xi(_o),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=t.mutationCb,this.wrappedEmit=t.wrappedEmit,this.stylesheetManager=t.stylesheetManager,this.recordCrossOriginIframes=t.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new xi(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=t.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(t){this.iframes.set(t,!0),t.contentWindow&&this.crossOriginIframeMap.set(t.contentWindow,t)}addLoadListener(t){this.loadListener=t}attachIframe(t,n){var s,i;this.mutationCb({adds:[{parentId:this.mirror.getId(t),nextId:null,node:n}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&((s=t.contentWindow)==null||s.addEventListener("message",this.handleMessage.bind(this))),(i=this.loadListener)==null||i.call(this,t);const r=So(t);r&&r.adoptedStyleSheets&&r.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(r.adoptedStyleSheets,this.mirror.getId(r))}handleMessage(t){const n=t;if(n.data.type!=="rrweb"||n.origin!==n.data.origin||!t.source)return;const s=this.crossOriginIframeMap.get(t.source);if(!s)return;const i=this.transformCrossOriginEvent(s,n.data.event);i&&this.wrappedEmit(i,n.data.isCheckout)}transformCrossOriginEvent(t,n){var r;switch(n.type){case j.FullSnapshot:{this.crossOriginIframeMirror.reset(t),this.crossOriginIframeStyleMirror.reset(t),this.replaceIdOnNode(n.data.node,t);const s=n.data.node.id;return this.crossOriginIframeRootIdMap.set(t,s),this.patchRootIdOnNode(n.data.node,s),{timestamp:n.timestamp,type:j.IncrementalSnapshot,data:{source:B.Mutation,adds:[{parentId:this.mirror.getId(t),nextId:null,node:n.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case j.Meta:case j.Load:case j.DomContentLoaded:return!1;case j.Plugin:return n;case j.Custom:return this.replaceIds(n.data.payload,t,["id","parentId","previousId","nextId"]),n;case j.IncrementalSnapshot:switch(n.data.source){case B.Mutation:return n.data.adds.forEach(s=>{this.replaceIds(s,t,["parentId","nextId","previousId"]),this.replaceIdOnNode(s.node,t);const i=this.crossOriginIframeRootIdMap.get(t);i&&this.patchRootIdOnNode(s.node,i)}),n.data.removes.forEach(s=>{this.replaceIds(s,t,["parentId","id"])}),n.data.attributes.forEach(s=>{this.replaceIds(s,t,["id"])}),n.data.texts.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case B.Drag:case B.TouchMove:case B.MouseMove:return n.data.positions.forEach(s=>{this.replaceIds(s,t,["id"])}),n;case B.ViewportResize:return!1;case B.MediaInteraction:case B.MouseInteraction:case B.Scroll:case B.CanvasMutation:case B.Input:return this.replaceIds(n.data,t,["id"]),n;case B.StyleSheetRule:case B.StyleDeclaration:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleId"]),n;case B.Font:return n;case B.Selection:return n.data.ranges.forEach(s=>{this.replaceIds(s,t,["start","end"])}),n;case B.AdoptedStyleSheet:return this.replaceIds(n.data,t,["id"]),this.replaceStyleIds(n.data,t,["styleIds"]),(r=n.data.styles)==null||r.forEach(s=>{this.replaceStyleIds(s,t,["styleId"])}),n}}return!1}replace(t,n,r,s){for(const i of s)!Array.isArray(n[i])&&typeof n[i]!="number"||(Array.isArray(n[i])?n[i]=t.getIds(r,n[i]):n[i]=t.getId(r,n[i]));return n}replaceIds(t,n,r){return this.replace(this.crossOriginIframeMirror,t,n,r)}replaceStyleIds(t,n,r){return this.replace(this.crossOriginIframeStyleMirror,t,n,r)}replaceIdOnNode(t,n){this.replaceIds(t,n,["id","rootId"]),"childNodes"in t&&t.childNodes.forEach(r=>{this.replaceIdOnNode(r,n)})}patchRootIdOnNode(t,n){t.type!==_e.Document&&!t.rootId&&(t.rootId=n),"childNodes"in t&&t.childNodes.forEach(r=>{this.patchRootIdOnNode(r,n)})}}class Ab{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class Nb{constructor(t){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=t.mutationCb,this.scrollCb=t.scrollCb,this.bypassOptions=t.bypassOptions,this.mirror=t.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(t,n){if(!Nn(t)||this.shadowDoms.has(t))return;this.shadowDoms.add(t),this.bypassOptions.canvasManager.addShadowRoot(t);const r=Vl({...this.bypassOptions,doc:n,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},t);this.restoreHandlers.push(()=>r.disconnect()),this.restoreHandlers.push(Gl({...this.bypassOptions,scrollCb:this.scrollCb,doc:t,mirror:this.mirror})),Es(()=>{t.adoptedStyleSheets&&t.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(t.adoptedStyleSheets,this.mirror.getId(t.host)),this.restoreHandlers.push(Yl({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},t))},0)}observeAttachShadow(t){const n=So(t),r=db(t);!n||!r||this.patchAttachShadow(r.Element,n)}patchAttachShadow(t,n){const r=this;this.restoreHandlers.push(go(t.prototype,"attachShadow",function(s){return function(i){const o=s.call(this,i);return this.shadowRoot&&jl(this)&&r.addShadowRoot(this.shadowRoot,n),o}}))}reset(){this.restoreHandlers.forEach(t=>{try{t()}catch{}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}var oc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Lb=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(var Ir=0;Ir<oc.length;Ir++)Lb[oc.charCodeAt(Ir)]=Ir;class ac{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class Db{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new ob,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,n){"_cssText"in n.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:n.id,attributes:n.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,n){if(t.length===0)return;const r={id:n,styleIds:[]},s=[];for(const i of t){let o;this.styleMirror.has(i)?o=this.styleMirror.getId(i):(o=this.styleMirror.add(i),s.push({styleId:o,rules:Array.from(i.rules||CSSRule,(c,a)=>({rule:Cl(c),index:a}))})),r.styleIds.push(o)}s.length>0&&(r.styles=s),this.adoptedStyleSheetCb(r)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class Ob{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(t,n){const r=this.nodeMap.get(t);return r&&Array.from(r).some(s=>s!==n)}add(t,n){this.active||(this.active=!0,ub(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(n))}destroy(){}}let fe,ss;var Rc;try{if(Array.from([1],e=>e*2)[0]!==2){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=((Rc=e.contentWindow)==null?void 0:Rc.Array.from)||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const Xe=LS();function ut(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:c="rr-ignore",ignoreSelector:a=null,maskAllText:u=!1,maskTextClass:d="rr-mask",unmaskTextClass:l=null,maskTextSelector:f=null,unmaskTextSelector:p=null,inlineStylesheet:h=!0,maskAllInputs:m,maskInputOptions:_,slimDOMOptions:g,maskAttributeFn:S,maskInputFn:N,maskTextFn:C,maxCanvasSize:U=null,packFn:A,sampling:y={},dataURLOptions:w={},mousemoveWait:F,recordDOM:E=!0,recordCanvas:x=!1,recordCrossOriginIframes:T=!1,recordAfter:k=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:M=!1,collectFonts:J=!1,inlineImages:K=!1,plugins:Z,keepIframeSrcFn:v=()=>!1,ignoreCSSAttributes:$=new Set([]),errorHandler:I,onMutation:L,getCanvasManager:ee}=e;mb(I);const X=T?window.parent===window:!0;let he=!1;if(!X)try{window.parent.document&&(he=!1)}catch{he=!0}if(X&&!t)throw new Error("emit function is required");if(!X&&!he)return()=>{};F!==void 0&&y.mousemove===void 0&&(y.mousemove=F),Xe.reset();const De=m===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:_!==void 0?_:{},Ue=g===!0||g==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:g==="all",headMetaDescKeywords:g==="all"}:g||{};ib();let be,Ee=0;const Ge=H=>{for(const we of Z||[])we.eventProcessor&&(H=we.eventProcessor(H));return A&&!he&&(H=A(H)),H};fe=(H,we)=>{var xe;const z=H;if(z.timestamp=ns(),(xe=sn[0])!=null&&xe.isFrozen()&&z.type!==j.FullSnapshot&&!(z.type===j.IncrementalSnapshot&&z.data.source===B.Mutation)&&sn.forEach(We=>We.unfreeze()),X)t==null||t(Ge(z),we);else if(he){const We={type:"rrweb",event:Ge(z),origin:window.location.origin,isCheckout:we};window.parent.postMessage(We,"*")}if(z.type===j.FullSnapshot)be=z,Ee=0;else if(z.type===j.IncrementalSnapshot){if(z.data.source===B.Mutation&&z.data.isAttachIframe)return;Ee++;const We=r&&Ee>=r,re=n&&be&&z.timestamp-be.timestamp>n;(We||re)&&le(!0)}};const Ye=H=>{fe({type:j.IncrementalSnapshot,data:{source:B.Mutation,...H}})},kn=H=>fe({type:j.IncrementalSnapshot,data:{source:B.Scroll,...H}}),dr=H=>fe({type:j.IncrementalSnapshot,data:{source:B.CanvasMutation,...H}}),fr=H=>fe({type:j.IncrementalSnapshot,data:{source:B.AdoptedStyleSheet,...H}}),Ke=new Db({mutationCb:Ye,adoptedStyleSheetCb:fr}),G=typeof __RRWEB_EXCLUDE_IFRAME__=="boolean"&&__RRWEB_EXCLUDE_IFRAME__?new xb:new Mb({mirror:Xe,mutationCb:Ye,stylesheetManager:Ke,recordCrossOriginIframes:T,wrappedEmit:fe});for(const H of Z||[])H.getMirror&&H.getMirror({nodeMirror:Xe,crossOriginIframeMirror:G.crossOriginIframeMirror,crossOriginIframeStyleMirror:G.crossOriginIframeStyleMirror});const ue=new Ob,Re=Fb(ee,{mirror:Xe,win:window,mutationCb:H=>fe({type:j.IncrementalSnapshot,data:{source:B.CanvasMutation,...H}}),recordCanvas:x,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:U,sampling:y.canvas,dataURLOptions:w,errorHandler:I}),ye=typeof __RRWEB_EXCLUDE_SHADOW_DOM__=="boolean"&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Ab:new Nb({mutationCb:Ye,scrollCb:kn,bypassOptions:{onMutation:L,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskInputOptions:De,dataURLOptions:w,maskAttributeFn:S,maskTextFn:C,maskInputFn:N,recordCanvas:x,inlineImages:K,sampling:y,slimDOMOptions:Ue,iframeManager:G,stylesheetManager:Ke,canvasManager:Re,keepIframeSrcFn:v,processedNodeManager:ue,ignoreCSSAttributes:$},mirror:Xe}),le=(H=!1)=>{if(!E)return;fe({type:j.Meta,data:{href:window.location.href,width:$l(),height:Fl()}},H),Ke.reset(),ye.init(),sn.forEach(z=>z.lock());const we=rb(document,{mirror:Xe,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,inlineStylesheet:h,maskAllInputs:De,maskAttributeFn:S,maskInputFn:N,maskTextFn:C,slimDOM:Ue,dataURLOptions:w,recordCanvas:x,inlineImages:K,onSerialize:z=>{Ul(z,Xe)&&G.addIframe(z),Wl(z,Xe)&&Ke.trackLinkElement(z),Ci(z)&&ye.addShadowRoot(z.shadowRoot,document)},onIframeLoad:(z,xe)=>{G.attachIframe(z,xe),z.contentWindow&&Re.addWindow(z.contentWindow),ye.observeAttachShadow(z)},onStylesheetLoad:(z,xe)=>{Ke.attachLinkElement(z,xe)},onBlockedImageLoad:(z,xe,{width:We,height:re})=>{Ye({adds:[],removes:[],texts:[],attributes:[{id:xe.id,attributes:{style:{width:`${We}px`,height:`${re}px`}}}]})},keepIframeSrcFn:v,ignoreCSSAttributes:$});if(!we)return console.warn("Failed to snapshot the document");fe({type:j.FullSnapshot,data:{node:we,initialOffset:Pl(window)}}),sn.forEach(z=>z.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&Ke.adoptStyleSheets(document.adoptedStyleSheets,Xe.getId(document))};ss=le;try{const H=[],we=xe=>{var We;return Q(Rb)({onMutation:L,mutationCb:Ye,mousemoveCb:(re,Is)=>fe({type:j.IncrementalSnapshot,data:{source:Is,positions:re}}),mouseInteractionCb:re=>fe({type:j.IncrementalSnapshot,data:{source:B.MouseInteraction,...re}}),scrollCb:kn,viewportResizeCb:re=>fe({type:j.IncrementalSnapshot,data:{source:B.ViewportResize,...re}}),inputCb:re=>fe({type:j.IncrementalSnapshot,data:{source:B.Input,...re}}),mediaInteractionCb:re=>fe({type:j.IncrementalSnapshot,data:{source:B.MediaInteraction,...re}}),styleSheetRuleCb:re=>fe({type:j.IncrementalSnapshot,data:{source:B.StyleSheetRule,...re}}),styleDeclarationCb:re=>fe({type:j.IncrementalSnapshot,data:{source:B.StyleDeclaration,...re}}),canvasMutationCb:dr,fontCb:re=>fe({type:j.IncrementalSnapshot,data:{source:B.Font,...re}}),selectionCb:re=>{fe({type:j.IncrementalSnapshot,data:{source:B.Selection,...re}})},customElementCb:re=>{fe({type:j.IncrementalSnapshot,data:{source:B.CustomElement,...re}})},blockClass:s,ignoreClass:c,ignoreSelector:a,maskAllText:u,maskTextClass:d,unmaskTextClass:l,maskTextSelector:f,unmaskTextSelector:p,maskInputOptions:De,inlineStylesheet:h,sampling:y,recordDOM:E,recordCanvas:x,inlineImages:K,userTriggeredOnInput:M,collectFonts:J,doc:xe,maskAttributeFn:S,maskInputFn:N,maskTextFn:C,keepIframeSrcFn:v,blockSelector:i,unblockSelector:o,slimDOMOptions:Ue,dataURLOptions:w,mirror:Xe,iframeManager:G,stylesheetManager:Ke,shadowDomManager:ye,processedNodeManager:ue,canvasManager:Re,ignoreCSSAttributes:$,plugins:((We=Z==null?void 0:Z.filter(re=>re.observer))==null?void 0:We.map(re=>({observer:re.observer,options:re.options,callback:Is=>fe({type:j.Plugin,data:{plugin:re.name,payload:Is}})})))||[]},{})};G.addLoadListener(xe=>{try{H.push(we(xe.contentDocument))}catch(We){console.warn(We)}});const z=()=>{le(),H.push(we(document))};return document.readyState==="interactive"||document.readyState==="complete"?z():(H.push(ke("DOMContentLoaded",()=>{fe({type:j.DomContentLoaded,data:{}}),k==="DOMContentLoaded"&&z()})),H.push(ke("load",()=>{fe({type:j.Load,data:{}}),k==="load"&&z()},window))),()=>{H.forEach(xe=>xe()),ue.destroy(),ss=void 0,_b()}}catch(H){console.warn(H)}}function Pb(e){if(!ss)throw new Error("please take full snapshot after start recording");ss(e)}ut.mirror=Xe;ut.takeFullSnapshot=Pb;function Fb(e,t){try{return e?e(t):new ac}catch{return console.warn("Unable to initialize CanvasManager"),new ac}}var cc;(function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"})(cc||(cc={}));const $b=3,Bb=5;function bo(e){return e>9999999999?e:e*1e3}function Vs(e){return e>9999999999?e/1e3:e}function lr(e,t){t.category!=="sentry.transaction"&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:j.Custom,timestamp:(t.timestamp||0)*1e3,data:{tag:"breadcrumb",payload:Je(t,10,1e3)}}),t.category==="console")))}const Hb="button,a";function Kl(e){return e.closest(Hb)||e}function Xl(e){const t=Jl(e);return!t||!(t instanceof Element)?t:Kl(t)}function Jl(e){return Ub(e)?e.target:e}function Ub(e){return typeof e=="object"&&!!e&&"target"in e}let St;function Wb(e){return St||(St=[],zb()),St.push(e),()=>{const t=St?St.indexOf(e):-1;t>-1&&St.splice(t,1)}}function zb(){Ae(ce,"open",function(e){return function(...t){if(St)try{St.forEach(n=>n())}catch{}return e.apply(ce,t)}})}const jb=new Set([B.Mutation,B.StyleSheetRule,B.StyleDeclaration,B.AdoptedStyleSheet,B.CanvasMutation,B.Selection,B.MediaInteraction]);function qb(e,t,n){e.handleClick(t,n)}class Vb{constructor(t,n,r=lr){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=n.timeout/1e3,this._threshold=n.threshold/1e3,this._scrollTimeout=n.scrollTimeout/1e3,this._replay=t,this._ignoreSelector=n.ignoreSelector,this._addBreadcrumbEvent=r}addListeners(){const t=Wb(()=>{this._lastMutation=uc()});this._teardown=()=>{t(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(t,n){if(Yb(n,this._ignoreSelector)||!Kb(t))return;const r={timestamp:Vs(t.timestamp),clickBreadcrumb:t,clickCount:0,node:n};this._clicks.some(s=>s.node===r.node&&Math.abs(s.timestamp-r.timestamp)<1)||(this._clicks.push(r),this._clicks.length===1&&this._scheduleCheckClicks())}registerMutation(t=Date.now()){this._lastMutation=Vs(t)}registerScroll(t=Date.now()){this._lastScroll=Vs(t)}registerClick(t){const n=Kl(t);this._handleMultiClick(n)}_handleMultiClick(t){this._getClicks(t).forEach(n=>{n.clickCount++})}_getClicks(t){return this._clicks.filter(n=>n.node===t)}_checkClicks(){const t=[],n=uc();this._clicks.forEach(r=>{!r.mutationAfter&&this._lastMutation&&(r.mutationAfter=r.timestamp<=this._lastMutation?this._lastMutation-r.timestamp:void 0),!r.scrollAfter&&this._lastScroll&&(r.scrollAfter=r.timestamp<=this._lastScroll?this._lastScroll-r.timestamp:void 0),r.timestamp+this._timeout<=n&&t.push(r)});for(const r of t){const s=this._clicks.indexOf(r);s>-1&&(this._generateBreadcrumbs(r),this._clicks.splice(s,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(t){const n=this._replay,r=t.scrollAfter&&t.scrollAfter<=this._scrollTimeout,s=t.mutationAfter&&t.mutationAfter<=this._threshold,i=!r&&!s,{clickCount:o,clickBreadcrumb:c}=t;if(i){const a=Math.min(t.mutationAfter||this._timeout,this._timeout)*1e3,u=a<this._timeout*1e3?"mutation":"timeout",d={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.slowClickDetected",data:{...c.data,url:ce.location.href,route:n.getCurrentRoute(),timeAfterClickMs:a,endReason:u,clickCount:o||1}};this._addBreadcrumbEvent(n,d);return}if(o>1){const a={type:"default",message:c.message,timestamp:c.timestamp,category:"ui.multiClick",data:{...c.data,url:ce.location.href,route:n.getCurrentRoute(),clickCount:o,metric:!0}};this._addBreadcrumbEvent(n,a)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=cr(()=>this._checkClicks(),1e3)}}const Gb=["A","BUTTON","INPUT"];function Yb(e,t){return!!(!Gb.includes(e.tagName)||e.tagName==="INPUT"&&!["submit","button"].includes(e.getAttribute("type")||"")||e.tagName==="A"&&(e.hasAttribute("download")||e.hasAttribute("target")&&e.getAttribute("target")!=="_self")||t&&e.matches(t))}function Kb(e){return!!(e.data&&typeof e.data.nodeId=="number"&&e.timestamp)}function uc(){return Date.now()/1e3}function Xb(e,t){try{if(!Jb(t))return;const{source:n}=t.data;if(jb.has(n)&&e.registerMutation(t.timestamp),n===B.Scroll&&e.registerScroll(t.timestamp),Zb(t)){const{type:r,id:s}=t.data,i=ut.mirror.getNode(s);i instanceof HTMLElement&&r===Ie.Click&&e.registerClick(i)}}catch{}}function Jb(e){return e.type===$b}function Zb(e){return e.data.source===B.MouseInteraction}function et(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var Eo=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(Eo||{});const Qb=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function eE(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const n in e)if(Qb.has(n)){let r=n;(n==="data-testid"||n==="data-test-id")&&(r="testId"),t[r]=e[n]}return t}const tE=e=>t=>{if(!e.isEnabled())return;const n=nE(t);if(!n)return;const r=t.name==="click",s=r?t.event:void 0;r&&e.clickDetector&&(s!=null&&s.target)&&!s.altKey&&!s.metaKey&&!s.ctrlKey&&!s.shiftKey&&qb(e.clickDetector,n,Xl(t.event)),lr(e,n)};function Zl(e,t){const n=ut.mirror.getId(e),r=n&&ut.mirror.getNode(n),s=r&&ut.mirror.getMeta(r),i=s&&sE(s)?s:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(o=>o.type===Eo.Text&&o.textContent).filter(Boolean).map(o=>o.trim()).join(""),attributes:eE(i.attributes)}}:{}}}function nE(e){const{target:t,message:n}=rE(e);return et({category:`ui.${e.name}`,...Zl(t,n)})}function rE(e){const t=e.name==="click";let n,r=null;try{r=t?Xl(e.event):Jl(e.event),n=Ne(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}function sE(e){return e.type===Eo.Element}function iE(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=oE(t);n&&lr(e,n)}function oE(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=e;if(!o||aE(o)||!i)return null;const c=t||r||s,a=i.length===1;if(!c&&a)return null;const u=Ne(o,{maxStringLength:200})||"<unknown>",d=Zl(o,u);return et({category:"ui.keyDown",message:u,data:{...d.data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}function aE(e){return e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable}const cE={resource:pE,paint:dE,navigation:fE};function Gs(e,t){return({metric:n})=>void t.replayPerformanceEntries.push(e(n))}function uE(e){return e.map(lE).filter(Boolean)}function lE(e){const t=cE[e.entryType];return t?t(e):null}function yn(e){return((He()||ce.performance.timeOrigin)+e)/1e3}function dE(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=yn(s);return{type:n,name:r,start:i,end:i+t,data:void 0}}function fE(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,domInteractive:u,loadEventStart:d,loadEventEnd:l,redirectCount:f,startTime:p,transferSize:h,type:m}=e;return s===0?null:{type:`${t}.${m}`,start:yn(p),end:yn(i),name:n,data:{size:h,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:u,domContentLoadedEventStart:c,domContentLoadedEventEnd:a,loadEventStart:d,loadEventEnd:l,domComplete:i,redirectCount:f}}}function pE(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:c,responseStatus:a,transferSize:u}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:yn(i),end:yn(s),name:r,data:{size:u,statusCode:a,decodedBodySize:o,encodedBodySize:c}}}function hE(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.element?[t.element]:void 0;return vo(e,"largest-contentful-paint",n)}function mE(e){return e.sources!==void 0}function _E(e){const t=[],n=[];for(const r of e.entries)if(mE(r)){const s=[];for(const i of r.sources)if(i.node){n.push(i.node);const o=ut.mirror.getId(i.node);o&&s.push(o)}t.push({value:r.value,nodeIds:s.length?s:void 0})}return vo(e,"cumulative-layout-shift",n,t)}function gE(e){const t=e.entries[e.entries.length-1],n=t!=null&&t.target?[t.target]:void 0;return vo(e,"interaction-to-next-paint",n)}function vo(e,t,n,r){const s=e.value,i=e.rating,o=yn(s);return{type:"web-vital",name:t,start:o,end:o,data:{value:s,size:s,rating:i,nodeIds:n?n.map(c=>ut.mirror.getId(c)):void 0,attributions:r}}}function yE(e){function t(s){e.performanceEntries.includes(s)||e.performanceEntries.push(s)}function n({entries:s}){s.forEach(t)}const r=[];return["navigation","paint","resource"].forEach(s=>{r.push(mn(s,n))}),r.push(uo(Gs(hE,e)),co(Gs(_E,e)),dl(Gs(gE,e))),()=>{r.forEach(s=>s())}}const D=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,SE='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 bE(){const e=new Blob([SE]);return URL.createObjectURL(e)}const lc=["log","warn","error"],Ur="[Replay] ";function Ys(e,t="info"){kt({category:"console",data:{logger:"replay"},level:t,message:`${Ur}${e}`},{level:t})}function EE(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:r=>{e=!!r.captureExceptions,t=!!r.traceInternals}};return D?(lc.forEach(r=>{n[r]=(...s)=>{b[r](Ur,...s),t&&Ys(s.join(""),Pu(r))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),b.error(Ur,r),e?ps(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&Ys(r,"error")},n.infoTick=(...r)=>{b.log(Ur,...r),t&&setTimeout(()=>Ys(r[0]),0)}):lc.forEach(r=>{n[r]=()=>{}}),n}const O=EE();class To extends Error{constructor(){super(`Event buffer exceeded maximum size of ${ho}.`)}}class Ql{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(t){const n=JSON.stringify(t).length;if(this._totalSize+=n,this._totalSize>ho)throw new To;this.events.push(t)}finish(){return new Promise(t=>{const n=this.events;this.clear(),t(JSON.stringify(n))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let t=null;for(const{timestamp:n}of this.events)(t===null||n<t)&&(t=n);return t===null?t:bo(t)}}class vE{constructor(t){this._worker=t,this._id=0}ensureReady(){return this._ensureReadyPromise?this._ensureReadyPromise:(this._ensureReadyPromise=new Promise((t,n)=>{this._worker.addEventListener("message",({data:r})=>{r.success?t():(D&&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=>{D&&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(){D&&O.log("Destroying compression worker"),this._worker.terminate()}postMessage(t,n){const r=this._getAndIncrementId();return new Promise((s,i)=>{const o=({data:c})=>{const a=c;if(a.method===t&&a.id===r){if(this._worker.removeEventListener("message",o),!a.success){D&&O.error("Error in compression worker: ",a.response),i(new Error("Error in compression worker"));return}s(a.response)}};this._worker.addEventListener("message",o),this._worker.postMessage({id:r,method:t,arg:n})})}_getAndIncrementId(){return this._id++}}class TE{constructor(t){this._worker=new vE(t),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(t){const n=bo(t.timestamp);(!this._earliestTimestamp||n<this._earliestTimestamp)&&(this._earliestTimestamp=n);const r=JSON.stringify(t);return this._totalSize+=r.length,this._totalSize>ho?Promise.reject(new To):this._sendEventToWorker(r)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,t=>{D&&O.exception(t,'Sending "clear" message to worker failed',t)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(t){return this._worker.postMessage("addEvent",t)}async _finishRequest(){const t=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,t}}class wE{constructor(t){this._fallback=new Ql,this._compression=new TE(t),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(t){this._used.hasCheckout=t}set waitForCheckout(t){this._used.waitForCheckout=t}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(t){return this._used.addEvent(t)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(t){D&&O.exception(t,"Failed to load the compression worker, falling back to simple buffer");return}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:t,hasCheckout:n,waitForCheckout:r}=this._fallback,s=[];for(const i of t)s.push(this._compression.addEvent(i));this._compression.hasCheckout=n,this._compression.waitForCheckout=r,this._used=this._compression;try{await Promise.all(s),this._fallback.clear()}catch(i){D&&O.exception(i,"Failed to add events when switching buffers.")}}}function IE({useCompression:e,workerUrl:t}){if(e&&window.Worker){const n=kE(t);if(n)return n}return D&&O.log("Using simple buffer"),new Ql}function kE(e){try{const t=e||CE();if(!t)return;D&&O.log(`Using compression worker${e?` from ${e}`:""}`);const n=new Worker(t);return new wE(n)}catch(t){D&&O.exception(t,"Failed to create compression worker")}}function CE(){return typeof __SENTRY_EXCLUDE_REPLAY_WORKER__>"u"||!__SENTRY_EXCLUDE_REPLAY_WORKER__?bE():""}function wo(){try{return"sessionStorage"in ce&&!!ce.sessionStorage}catch{return!1}}function RE(e){xE(),e.session=void 0}function xE(){if(wo())try{ce.sessionStorage.removeItem(fo)}catch{}}function ed(e){return e===void 0?!1:Math.random()<e}function vs(e){if(wo())try{ce.sessionStorage.setItem(fo,JSON.stringify(e))}catch{}}function td(e){const t=Date.now(),n=e.id||$e(),r=e.started||t,s=e.lastActivity||t,i=e.segmentId||0,o=e.sampled,c=e.previousSessionId,a=e.dirty||!1;return{id:n,started:r,lastActivity:s,segmentId:i,sampled:o,previousSessionId:c,dirty:a}}function ME(e,t){return ed(e)?"session":t?"buffer":!1}function dc({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=ME(e,t),i=td({sampled:s,previousSessionId:r});return n&&vs(i),i}function AE(){if(!wo())return null;try{const e=ce.sessionStorage.getItem(fo);if(!e)return null;const t=JSON.parse(e);return D&&O.infoTick("Loading existing session"),td(t)}catch{return null}}function Mi(e,t,n=+new Date){return e===null||t===void 0||t<0?!0:t===0?!1:e+t<=n}function nd(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return Mi(e.started,t,r)||Mi(e.lastActivity,n,r)}function rd(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!(!nd(e,{sessionIdleExpire:t,maxReplayDuration:n})||e.sampled==="buffer"&&e.segmentId===0)}function Ks({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const s=r.stickySession&&AE();return s?rd(s,{sessionIdleExpire:e,maxReplayDuration:t})?(D&&O.infoTick("Session in sessionStorage is expired, creating new one..."),dc(r,{previousSessionId:s.id})):s:(D&&O.infoTick("Creating new session"),dc(r,{previousSessionId:n}))}function NE(e){return e.type===j.Custom}function Io(e,t,n){return id(e,t)?(sd(e,t,n),!0):!1}function LE(e,t,n){return id(e,t)?sd(e,t,n):Promise.resolve(null)}async function sd(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const s=e.recordingMode==="buffer";try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const i=e.getOptions(),o=DE(t,i.beforeAddRecordingEvent);return o?await r.addEvent(o):void 0}catch(i){const o=i&&i instanceof To,c=o?"addEventSizeExceeded":"addEvent",a=W();if(a){const u=o?"buffer_overflow":"internal_sdk_error";a.recordDroppedEvent(u,"replay")}if(o&&s)return r.clear(),r.waitForCheckout=!0,null;e.handleException(i),await e.stop({reason:c})}}function id(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=bo(t.timestamp);return n+e.timeouts.sessionIdlePause<Date.now()?!1:n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration?(D&&O.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),!1):!0}function DE(e,t){try{if(typeof t=="function"&&NE(e))return t(e)}catch(n){return D&&O.exception(n,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}function ko(e){return!e.type}function Ai(e){return e.type==="transaction"}function OE(e){return e.type==="replay_event"}function fc(e){return e.type==="feedback"}function PE(e){return(t,n)=>{if(!e.isEnabled()||!ko(t)&&!Ai(t))return;const r=n.statusCode;if(!(!r||r<200||r>=300)){if(Ai(t)){FE(e,t);return}$E(e,t)}}}function FE(e,t){var r,s;const n=e.getContext();(s=(r=t.contexts)==null?void 0:r.trace)!=null&&s.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}function $E(e,t){var s;const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),e.recordingMode!=="buffer"||!((s=t.tags)!=null&&s.replayId))return;const{beforeErrorSampling:r}=e.getOptions();typeof r=="function"&&!r(t)||cr(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(i){e.handleException(i)}})}function BE(e){return t=>{!e.isEnabled()||!ko(t)||HE(e,t)}}function HE(e,t){var r,s,i;const n=(i=(s=(r=t.exception)==null?void 0:r.values)==null?void 0:s[0])==null?void 0:i.value;if(typeof n=="string"&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))){const o=et({category:"replay.hydrate-error",data:{url:qt()}});lr(e,o)}}function UE(e){const t=W();t&&t.on("beforeAddBreadcrumb",n=>WE(e,n))}function WE(e,t){if(!e.isEnabled()||!od(t))return;const n=zE(t);n&&lr(e,n)}function zE(e){return!od(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:e.category==="console"?jE(e):et(e)}function jE(e){var s;const t=(s=e.data)==null?void 0:s.arguments;if(!Array.isArray(t)||t.length===0)return et(e);let n=!1;const r=t.map(i=>{if(!i)return i;if(typeof i=="string")return i.length>vr?(n=!0,`${i.slice(0,vr)}`):i;if(typeof i=="object")try{const o=Je(i,7);return JSON.stringify(o).length>vr?(n=!0,`${JSON.stringify(o,null,2).slice(0,vr)}`):o}catch{}return i});return et({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}function od(e){return!!e.category}function qE(e,t){var n,r,s;return e.type||!((r=(n=e.exception)==null?void 0:n.values)!=null&&r.length)?!1:!!((s=t.originalException)!=null&&s.__rrweb__)}function ad(){const e=ne().getPropagationContext().dsc;e&&delete e.replay_id;const t=Te();if(t){const n=ht(t);delete n.replay_id}}function VE(e,t){e.triggerUserActivity(),e.addUpdate(()=>t.timestamp?(e.throttledAddEvent({type:j.Custom,timestamp:t.timestamp*1e3,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1):!0)}function GE(e,t){return e.recordingMode!=="buffer"||t.message===po||!t.exception||t.type?!1:ed(e.getOptions().errorSampleRate)}function YE(e){return Object.assign((t,n)=>{var o;if(!e.isEnabled()||e.isPaused())return t;if(OE(t))return delete t.breadcrumbs,t;if(!ko(t)&&!Ai(t)&&!fc(t))return t;if(!e.checkAndHandleExpiredSession())return ad(),t;if(fc(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),VE(e,t),t;if(qE(t,n)&&!e.getOptions()._experiments.captureExceptions)return D&&O.log("Ignoring error from rrweb internals",t),null;const s=GE(e,t);if((s||e.recordingMode==="session")&&(t.tags={...t.tags,replayId:e.getSessionId()}),s&&e.recordingMode==="buffer"&&((o=e.session)==null?void 0:o.sampled)==="buffer"){const c=e.session;c.dirty=!0,e.getOptions().stickySession&&vs(c)}return t},{id:"Replay"})}function Ts(e,t){return t.map(({type:n,start:r,end:s,name:i,data:o})=>{const c=e.throttledAddEvent({type:j.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 KE(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}function XE(e){return t=>{if(!e.isEnabled())return;const n=KE(t);n!==null&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(Ts(e,[n]),!1)))}}function JE(e,t){return D&&e.getOptions()._experiments.traceInternals?!1:bh(t,W())}function cd(e,t){e.isEnabled()&&t!==null&&(JE(e,t.name)||e.addUpdate(()=>(Ts(e,[t]),!0)))}function ws(e){if(!e)return;const t=new TextEncoder;try{if(typeof e=="string")return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=bl(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function ud(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function is(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function ld(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:o,request:c,response:a}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:{method:i,statusCode:o,request:c,response:a}}}function qn(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function wt(e,t,n){if(!t&&Object.keys(e).length===0)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:s,warnings:i}=ZE(n);return r.body=s,i!=null&&i.length&&(r._meta={warnings:i}),r}function Ni(e,t){return Object.entries(e).reduce((n,[r,s])=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=s),n},{})}function ZE(e){if(!e||typeof e!="string")return{body:e};const t=e.length>Va,n=QE(e);if(t){const r=e.slice(0,Va);return n?{body:r,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${r}`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}function QE(e){const t=e[0],n=e[e.length-1];return t==="["&&n==="]"||t==="{"&&n==="}"}function os(e,t){const n=ev(e);return at(n,t)}function ev(e,t=ce.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(ce.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}async function tv(e,t,n){try{const r=await rv(e,t,n),s=ld("resource.fetch",r);cd(n.replay,s)}catch(r){D&&O.exception(r,"Failed to capture fetch breadcrumb")}}function nv(e,t){const{input:n,response:r}=t,s=n?vl(n):void 0,i=ws(s),o=r?ud(r.headers.get("content-length")):void 0;i!==void 0&&(e.data.request_body_size=i),o!==void 0&&(e.data.response_body_size=o)}async function rv(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=t,{url:o,method:c,status_code:a=0,request_body_size:u,response_body_size:d}=e.data,l=os(o,n.networkDetailAllowUrls)&&!os(o,n.networkDetailDenyUrls),f=l?sv(n,t.input,u):qn(u),p=await iv(l,n,t.response,d);return{startTimestamp:s,endTimestamp:i,url:o,method:c,statusCode:a,request:f,response:p}}function sv({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?cv(n,t):{};if(!e)return wt(s,r,void 0);const i=vl(n),[o,c]=El(i,O),a=wt(s,r,o);return c?is(a,c):a}async function iv(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&s!==void 0)return qn(s);const i=r?dd(r.headers,n):{};if(!r||!t&&s!==void 0)return wt(i,s,void 0);const[o,c]=await av(r),a=ov(o,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:i});return c?is(a,c):a}function ov(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e!=null&&e.length&&n===void 0?ws(e):n;return r?t?wt(s,i,e):wt(s,i,void 0):qn(i)}catch(i){return D&&O.exception(i,"Failed to serialize response body"),wt(s,n,void 0)}}async function av(e){const t=uv(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{return[await lv(t)]}catch(n){return n instanceof Error&&n.message.indexOf("Timeout")>-1?(D&&O.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(D&&O.exception(n,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}function dd(e,t){const n={};return t.forEach(r=>{e.get(r)&&(n[r]=e.get(r))}),n}function cv(e,t){return e.length===1&&typeof e[0]!="string"?pc(e[0],t):e.length===2?pc(e[1],t):{}}function pc(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?dd(n,t):Array.isArray(n)?{}:Ni(n,t):{}}function uv(e){try{return e.clone()}catch(t){D&&O.exception(t,"Failed to clone response body")}}function lv(e){return new Promise((t,n)=>{const r=cr(()=>n(new Error("Timeout while trying to read response body")),500);dv(e).then(s=>t(s),s=>n(s)).finally(()=>clearTimeout(r))})}async function dv(e){return await e.text()}async function fv(e,t,n){try{const r=hv(e,t,n),s=ld("resource.xhr",r);cd(n.replay,s)}catch(r){D&&O.exception(r,"Failed to capture xhr breadcrumb")}}function pv(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=ws(r),i=n.getResponseHeader("content-length")?ud(n.getResponseHeader("content-length")):gv(n.response,n.responseType);s!==void 0&&(e.data.request_body_size=s),i!==void 0&&(e.data.response_body_size=i)}function hv(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:c}=t,{url:a,method:u,status_code:d=0,request_body_size:l,response_body_size:f}=e.data;if(!a)return null;if(!c||!os(a,n.networkDetailAllowUrls)||os(a,n.networkDetailDenyUrls)){const A=qn(l),y=qn(f);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:A,response:y}}const p=c[Ot],h=p?Ni(p.request_headers,n.networkRequestHeaders):{},m=Ni(Tl(c),n.networkResponseHeaders),[_,g]=n.networkCaptureBodies?El(o,O):[void 0],[S,N]=n.networkCaptureBodies?mv(c):[void 0],C=wt(h,l,_),U=wt(m,f,S);return{startTimestamp:s,endTimestamp:i,url:a,method:u,statusCode:d,request:g?is(C,g):C,response:N?is(U,N):U}}function mv(e){const t=[];try{return[e.responseText]}catch(n){t.push(n)}try{return _v(e.response,e.responseType)}catch(n){t.push(n)}return D&&O.warn("Failed to get xhr response body",...t),[void 0]}function _v(e,t){try{if(typeof e=="string")return[e];if(e instanceof Document)return[e.body.outerHTML];if(t==="json"&&e&&typeof e=="object")return[JSON.stringify(e)];if(!e)return[void 0]}catch(n){return D&&O.exception(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return D&&O.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function gv(e,t){try{const n=t==="json"&&e&&typeof e=="object"?JSON.stringify(e):e;return ws(n)}catch{return}}function yv(e){const t=W();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o}=e.getOptions(),c={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o};t&&t.on("beforeAddBreadcrumb",(a,u)=>Sv(c,a,u))}catch{}}function Sv(e,t,n){if(t.data)try{bv(t)&&vv(n)&&(pv(t,n),fv(t,n,e)),Ev(t)&&Tv(n)&&(nv(t,n),tv(t,n,e))}catch(r){D&&O.exception(r,"Error when enriching network breadcrumb")}}function bv(e){return e.category==="xhr"}function Ev(e){return e.category==="fetch"}function vv(e){return e==null?void 0:e.xhr}function Tv(e){return e==null?void 0:e.response}function wv(e){const t=W();gl(tE(e)),ys(XE(e)),UE(e),yv(e);const n=YE(e);Hp(n),t&&(t.on("beforeSendEvent",BE(e)),t.on("afterSendEvent",PE(e)),t.on("createDsc",r=>{const s=e.getSessionId();s&&e.isEnabled()&&e.recordingMode==="session"&&e.checkAndHandleExpiredSession()&&(r.replay_id=s)}),t.on("spanStart",r=>{e.lastActiveSpan=r}),t.on("spanEnd",r=>{e.lastActiveSpan=r}),t.on("beforeSendFeedback",async(r,s)=>{var o;const i=e.getSessionId();s!=null&&s.includeReplay&&e.isEnabled()&&i&&((o=r.contexts)!=null&&o.feedback)&&(r.contexts.feedback.source==="api"&&await e.sendBufferedReplayOrFlush(),r.contexts.feedback.replay_id=i)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}async function Iv(e){try{return Promise.all(Ts(e,[kv(ce.performance.memory)]))}catch{return[]}}function kv(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}function Cv(e,t,n){return kh(e,t,{...n,setTimeoutImpl:cr})}const je=V.navigator;function Rv(){return/iPhone|iPad|iPod/i.test((je==null?void 0:je.userAgent)??"")||/Macintosh/i.test((je==null?void 0:je.userAgent)??"")&&(je!=null&&je.maxTouchPoints)&&(je==null?void 0:je.maxTouchPoints)>1?{sampling:{mousemove:!1}}:{}}function xv(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession()){D&&O.warn("Received replay event after session expired.");return}const s=r||!t;t=!0,e.clickDetector&&Xb(e.clickDetector,n),e.addUpdate(()=>{if(e.recordingMode==="buffer"&&s&&e.setInitialState(),!Io(e,n,s))return!0;if(!s)return!1;const i=e.session;if(Av(e,s),e.recordingMode==="buffer"&&i&&e.eventBuffer&&!i.dirty){const o=e.eventBuffer.getEarliestTimestamp();o&&(D&&O.log(`Updating session start time to earliest event in buffer to ${new Date(o)}`),i.started=o,e.getOptions().stickySession&&vs(i))}return i!=null&&i.previousSessionId||e.recordingMode==="session"&&e.flush(),!0})}}function Mv(e){const t=e.getOptions();return{type:j.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:e.eventBuffer?e.eventBuffer.type==="worker":!1,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}function Av(e,t){var n;!t||((n=e.session)==null?void 0:n.segmentId)!==0||Io(e,Mv(e),!1)}function Nv(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}function Lv(e,t,n,r){return At(du(e,ji(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:typeof t=="string"?new TextEncoder().encode(t).length:t.length},t]])}function Dv({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}
`;if(typeof e=="string")n=`${r}${e}`;else{const i=new TextEncoder().encode(r);n=new Uint8Array(i.length+e.length),n.set(i),n.set(e,i.length)}return n}async function Ov({client:e,scope:t,replayId:n,event:r}){const s=typeof e._integrations=="object"&&e._integrations!==null&&!Array.isArray(e._integrations)?Object.keys(e._integrations):void 0,i={event_id:n,integrations:s};e.emit("preprocessEvent",r,i);const o=await _u(e.getOptions(),r,i,t,e,Ce());if(!o)return null;e.emit("postprocessEvent",o,i),o.platform=o.platform||"javascript";const c=e.getSdkMetadata(),{name:a,version:u,settings:d}=(c==null?void 0:c.sdk)||{};return o.sdk={...o.sdk,name:a||"sentry.javascript.unknown",version:u||"0.0.0",settings:d},o}async function Pv({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const o=Dv({recordingData:e,headers:{segment_id:n}}),{urls:c,errorIds:a,traceIds:u,initialTimestamp:d}=r,l=W(),f=ne(),p=l==null?void 0:l.getTransport(),h=l==null?void 0:l.getDsn();if(!l||!p||!h||!i.sampled)return Promise.resolve({});const m={type:fS,replay_start_timestamp:d/1e3,timestamp:s/1e3,error_ids:a,trace_ids:u,urls:c,replay_id:t,segment_id:n,replay_type:i.sampled},_=await Ov({scope:f,client:l,replayId:t,event:m});if(!_)return l.recordDroppedEvent("event_processor","replay"),D&&O.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete _.sdkProcessingMetadata;const g=Lv(_,o,h,l.getOptions().tunnel);let S;try{S=await p.send(g)}catch(C){const U=new Error(po);try{U.cause=C}catch{}throw U}const N=ku({},S);if(Iu(N,"replay"))throw new Co(N);if(typeof S.statusCode=="number"&&(S.statusCode<200||S.statusCode>=300))throw new fd(S.statusCode);return S}class fd extends Error{constructor(t){super(`Transport returned status code ${t}`)}}class Co extends Error{constructor(t){super("Rate limit hit"),this.rateLimits=t}}class hc extends Error{constructor(){super("Session is too long, not sending replay")}}async function pd(e,t={count:0,interval:yS}){const{recordingData:n,onError:r}=e;if(n.length)try{return await Pv(e),!0}catch(s){if(s instanceof fd||s instanceof Co)throw s;if($p("Replays",{_retryCount:t.count}),r&&r(s),t.count>=SS){const i=new Error(`${po} - max retries exceeded`);try{i.cause=s}catch{}throw i}return t.interval*=++t.count,new Promise((i,o)=>{cr(async()=>{try{await pd(e,t),i(!0)}catch(c){o(c)}},t.interval)})}}const hd="__THROTTLED",Fv="__SKIPPED";function $v(e,t,n){const r=new Map,s=c=>{const a=c-n;r.forEach((u,d)=>{d<a&&r.delete(d)})},i=()=>[...r.values()].reduce((c,a)=>c+a,0);let o=!1;return(...c)=>{const a=Math.floor(Date.now()/1e3);if(s(a),i()>=t){const d=o;return o=!0,d?Fv:hd}o=!1;const u=r.get(a)||0;return r.set(a,u+1),e(...c)}}class Bv{constructor({options:t,recordingOptions:n}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:pS,sessionIdleExpire:hS},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=n,this._options=t,this._debouncedFlush=Cv(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=$v((o,c)=>LE(this,o,c),300,5);const{slowClickTimeout:r,slowClickIgnoreSelectors:s}=this.getOptions(),i=r?{threshold:Math.min(bS,r),timeout:r,scrollTimeout:ES,ignoreSelector:s?s.join(","):""}:void 0;if(i&&(this.clickDetector=new Vb(this,i)),D){const o=t._experiments;O.setConfig({captureExceptions:!!o.captureExceptions,traceInternals:!!o.traceInternals})}this._handleVisibilityChange=()=>{ce.document.visibilityState==="visible"?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const o=et({category:"ui.blur"});this._doChangeToBackgroundTasks(o)},this._handleWindowFocus=()=>{const o=et({category:"ui.focus"});this._doChangeToForegroundTasks(o)},this._handleKeyboardEvent=o=>{iE(this,o)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return!!this._canvas}getOptions(){return this._options}handleException(t){D&&O.exception(t),this._options.onError&&this._options.onError(t)}initializeSampling(t){const{errorSampleRate:n,sessionSampleRate:r}=this._options,s=n<=0&&r<=0;if(this._requiresManualStart=s,!s){if(this._initializeSessionForSampling(t),!this.session){D&&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",D&&O.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording())}}start(){if(this._isEnabled&&this.recordingMode==="session"){D&&O.log("Recording is already in progress");return}if(this._isEnabled&&this.recordingMode==="buffer"){D&&O.log("Buffering is in progress, call `flush()` to save the replay");return}D&&O.infoTick("Starting replay in session mode"),this._updateUserActivity();const t=Ks({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=t,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled){D&&O.log("Buffering is in progress, call `flush()` to save the replay");return}D&&O.infoTick("Starting replay in buffer mode");const t=Ks({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=t,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const t=this._canvas;this._stopRecording=ut({...this._recordingOptions,...this.recordingMode==="buffer"?{checkoutEveryNms:gS}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:xv(this),...Rv(),onMutation:this._onMutationHandler.bind(this),...t?{recordCanvas:t.recordCanvas,getCanvasManager:t.getCanvasManager,sampling:t.sampling,dataURLOptions:t.dataURLOptions}:{}})}catch(t){this.handleException(t)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(t){return this.handleException(t),!1}}async stop({forceFlush:t=!1,reason:n}={}){var r;if(this._isEnabled){this._isEnabled=!1,this.recordingMode="buffer";try{D&&O.log(`Stopping Replay${n?` triggered by ${n}`:""}`),ad(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),t&&await this._flush({force:!0}),(r=this.eventBuffer)==null||r.destroy(),this.eventBuffer=null,RE(this)}catch(s){this.handleException(s)}}}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),D&&O.log("Pausing replay"))}resume(){!this._isPaused||!this._checkSession()||(this._isPaused=!1,this.startRecording(),D&&O.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:t=!0}={}){if(this.recordingMode==="session")return this.flushImmediate();const n=Date.now();D&&O.log("Converting buffer to session"),await this.flushImmediate();const r=this.stopRecording();!t||!r||this.recordingMode!=="session"&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(n),this._updateSessionActivity(n),this._maybeSaveSession()),this.startRecording())}addUpdate(t){const n=t();this.recordingMode==="buffer"||!this._isEnabled||n!==!0&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),!this._stopRecording){if(!this._checkSession())return;this.resume();return}this.checkAndHandleExpiredSession(),this._updateSessionActivity()}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return this.recordingMode==="buffer"?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(t){var n,r;if(!(t&&((n=this.session)==null?void 0:n.sampled)===!1))return(r=this.session)==null?void 0:r.id}checkAndHandleExpiredSession(){var t;if(this._lastActivity&&Mi(this._lastActivity,this.timeouts.sessionIdlePause)&&((t=this.session)==null?void 0:t.sampled)==="session"){this.pause();return}return!!this._checkSession()}setInitialState(){const t=`${ce.location.pathname}${ce.location.hash}${ce.location.search}`,n=`${ce.location.origin}${t}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=n,this._context.initialTimestamp=Date.now(),this._context.urls.push(n)}throttledAddEvent(t,n){const r=this._throttledAddEvent(t,n);if(r===hd){const s=et({category:"replay.throttled"});this.addUpdate(()=>!Io(this,{type:Bb,timestamp:s.timestamp||0,data:{tag:"breadcrumb",payload:s,metric:!0}}))}return r}getCurrentRoute(){const t=this.lastActiveSpan||Te(),n=t&&ve(t),s=(n&&te(n).data||{})[Fe];if(!(!n||!s||!["route","custom"].includes(s)))return te(n).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=IE({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(t){const n=this._options.errorSampleRate>0,r=Ks({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:t},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:n});this.session=r}_checkSession(){if(!this.session)return!1;const t=this.session;return rd(t,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})?(this._refreshSession(t),!1):!0}async _refreshSession(t){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(t.id))}_addListeners(){try{ce.document.addEventListener("visibilitychange",this._handleVisibilityChange),ce.addEventListener("blur",this._handleWindowBlur),ce.addEventListener("focus",this._handleWindowFocus),ce.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(wv(this),this._hasInitializedCoreListeners=!0)}catch(t){this.handleException(t)}this._performanceCleanupCallback=yE(this)}_removeListeners(){try{ce.document.removeEventListener("visibilitychange",this._handleVisibilityChange),ce.removeEventListener("blur",this._handleWindowBlur),ce.removeEventListener("focus",this._handleWindowFocus),ce.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(t){this.handleException(t)}}_doChangeToBackgroundTasks(t){!this.session||nd(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(t&&this._createCustomBreadcrumb(t),this.conditionalFlush())}_doChangeToForegroundTasks(t){if(!this.session)return;if(!this.checkAndHandleExpiredSession()){D&&O.log("Document has become active, but session has expired");return}t&&this._createCustomBreadcrumb(t)}_updateUserActivity(t=Date.now()){this._lastActivity=t}_updateSessionActivity(t=Date.now()){this.session&&(this.session.lastActivity=t,this._maybeSaveSession())}_createCustomBreadcrumb(t){this.addUpdate(()=>{this.throttledAddEvent({type:j.Custom,timestamp:t.timestamp||0,data:{tag:"breadcrumb",payload:t}})})}_addPerformanceEntries(){let t=uE(this.performanceEntries).concat(this.replayPerformanceEntries);if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const n=this._context.initialTimestamp/1e3;t=t.filter(r=>r.start>=n)}return Promise.all(Ts(this,t))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:t,eventBuffer:n}=this;if(!t||!n||this._requiresManualStart||t.segmentId)return;const r=n.getEarliestTimestamp();r&&r<this._context.initialTimestamp&&(this._context.initialTimestamp=r)}_popEventContext(){const t={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),t}async _runFlush(){var n;const t=this.getSessionId();if(!this.session||!this.eventBuffer||!t){D&&O.error("No session or eventBuffer found to flush.");return}if(await this._addPerformanceEntries(),!!((n=this.eventBuffer)!=null&&n.hasEvents)&&(await Iv(this),!!this.eventBuffer&&t===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const r=Date.now();if(r-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new hc;const s=this._popEventContext(),i=this.session.segmentId++;this._maybeSaveSession();const o=await this.eventBuffer.finish();await pd({replayId:t,recordingData:o,segmentId:i,eventContext:s,session:this.session,timestamp:r,onError:c=>this.handleException(c)})}catch(r){this.handleException(r),this.stop({reason:"sendReplay"});const s=W();if(s){let i;r instanceof Co?i="ratelimit_backoff":r instanceof hc?i="invalid":i="send_error",s.recordDroppedEvent(i,"replay")}}}async _flush({force:t=!1}={}){if(!this._isEnabled&&!t)return;if(!this.checkAndHandleExpiredSession()){D&&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){D&&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&&D&&O.log("Flushing initial segment without checkout.");const a=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(u){this.handleException(u)}finally{this._flushLock=void 0,a&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&vs(this.session)}_onMutationHandler(t){const{ignoreMutations:n}=this._options._experiments;if(n!=null&&n.length&&t.some(c=>{const a=Nv(c.target),u=n.join(",");return a==null?void 0:a.matches(u)}))return!1;const r=t.length,s=this._options.mutationLimit,i=this._options.mutationBreadcrumbLimit,o=s&&r>s;if(r>i||o){const c=et({category:"replay.mutations",data:{count:r,limit:o}});this._createCustomBreadcrumb(c)}return o?(this.stop({reason:"mutationLimit",forceFlush:this.recordingMode==="session"}),!1):!0}}function Rn(e,t){return[...e,...t].join(",")}function Hv({mask:e,unmask:t,block:n,unblock:r,ignore:s}){const i=["base","iframe[srcdoc]:not([src])"],o=Rn(e,[".sentry-mask","[data-sentry-mask]"]),c=Rn(t,[]);return{maskTextSelector:o,unmaskTextSelector:c,blockSelector:Rn(n,[".sentry-block","[data-sentry-block]",...i]),unblockSelector:Rn(r,[]),ignoreSelector:Rn(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}function Uv({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return!r||s.unmaskTextSelector&&e.matches(s.unmaskTextSelector)?i:n.includes(t)||t==="value"&&e.tagName==="INPUT"&&["submit","button"].includes(e.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i}const mc='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Wv=["content-length","content-type","accept"],zv=Symbol.for("sentry__originalRequestBody");let _c=!1,gc=!1;function jv(){if(typeof Request>"u"||gc)return;const e=Request;try{const t=function(n,r){const s=new e(n,r);return(r==null?void 0:r.body)!=null&&(s[zv]=r.body),s};t.prototype=e.prototype,V.Request=t,gc=!0}catch{}}const L0=e=>new qv(e);class qv{constructor({flushMinDelay:t=mS,flushMaxDelay:n=_S,minReplayDuration:r=vS,maxReplayDuration:s=Ga,stickySession:i=!0,useCompression:o=!0,workerUrl:c,_experiments:a={},maskAllText:u=!0,maskAllInputs:d=!0,blockAllMedia:l=!0,mutationBreadcrumbLimit:f=750,mutationLimit:p=1e4,slowClickTimeout:h=7e3,slowClickIgnoreSelectors:m=[],networkDetailAllowUrls:_=[],networkDetailDenyUrls:g=[],networkCaptureBodies:S=!0,networkRequestHeaders:N=[],networkResponseHeaders:C=[],mask:U=[],maskAttributes:A=["title","placeholder","aria-label"],unmask:y=[],block:w=[],unblock:F=[],ignore:E=[],maskFn:x,beforeAddRecordingEvent:T,beforeErrorSampling:k,onError:M,attachRawBodyFromRequest:J=!1}={}){this.name="Replay";const K=Hv({mask:U,unmask:y,block:w,unblock:F,ignore:E});if(this._recordingOptions={maskAllInputs:d,maskAllText:u,maskInputOptions:{password:!0},maskTextFn:x,maskInputFn:x,maskAttributeFn:(Z,v,$)=>Uv({maskAttributes:A,maskAllText:u,privacyOptions:K,key:Z,value:v,el:$}),...K,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:Z=>{try{Z.__rrweb__=!0}catch{}},recordCrossOriginIframes:!!a.recordCrossOriginIframes},this._initialOptions={flushMinDelay:t,flushMaxDelay:n,minReplayDuration:Math.min(r,TS),maxReplayDuration:Math.min(s,Ga),stickySession:i,useCompression:o,workerUrl:c,blockAllMedia:l,maskAllInputs:d,maskAllText:u,mutationBreadcrumbLimit:f,mutationLimit:p,slowClickTimeout:h,slowClickIgnoreSelectors:m,networkDetailAllowUrls:_,networkDetailDenyUrls:g,networkCaptureBodies:S,networkRequestHeaders:yc(N),networkResponseHeaders:yc(C),beforeAddRecordingEvent:T,beforeErrorSampling:k,onError:M,attachRawBodyFromRequest:J,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${mc}`:mc,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Gr())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return _c}set _isInitialized(t){_c=t}afterAllSetup(t){!Gr()||this._replay||(this._initialOptions.attachRawBodyFromRequest&&jv(),this._setup(t),this._initialize(t))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:this._replay.recordingMode==="session"}):Promise.resolve()}flush(t){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(t):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(t){var n;if((n=this._replay)!=null&&n.isEnabled())return this._replay.getSessionId(t)}getRecordingMode(){var t;if((t=this._replay)!=null&&t.isEnabled())return this._replay.recordingMode}_initialize(t){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(t),this._replay.initializeSampling())}_setup(t){const n=Vv(this._initialOptions,t);this._replay=new Bv({options:n,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(t){try{const n=t.getIntegrationByName("ReplayCanvas");if(!n)return;this._replay._canvas=n.getOptions()}catch{}}}function Vv(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},s=Wt(n.replaysSessionSampleRate),i=Wt(n.replaysOnErrorSampleRate);return s==null&&i==null&&rt(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),s!=null&&(r.sessionSampleRate=s),i!=null&&(r.errorSampleRate=i),r}function yc(e){return[...Wv,...e.map(t=>t.toLowerCase())]}function Gv(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function md(e){try{return new URL(e,Y.location.origin).href}catch{return}}function Yv(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function _d(e){try{return new Headers(e)}catch{return}}const Sc=new WeakMap,Xs=new Map,gd={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function Kv(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:c,onRequestSpanStart:a,onRequestSpanEnd:u}={...gd,...t},d=typeof i=="function"?i:h=>!0,l=h=>Jv(h,c),f={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(h=>(h.type==="transaction"&&h.spans&&h.spans.forEach(m=>{if(m.op==="http.client"){const _=Xs.get(m.span_id);_&&(m.timestamp=_/1e3,Xs.delete(m.span_id))}}),h)),s&&lm(h=>{if(h.response){const m=Sc.get(h.response);m&&h.endTimestamp&&Xs.set(m,h.endTimestamp)}}),Hu(h=>{const m=em(h,d,l,f,{propagateTraceparent:p,onRequestSpanEnd:u});if(h.response&&h.fetchData.__span&&Sc.set(h.response,h.fetchData.__span),m){const _=md(h.fetchData.url),g=_?Ht(_).host:void 0;m.setAttributes({"http.url":_?vt(_):void 0,"server.address":g}),o&&bc(m,e),a==null||a(m,{headers:h.headers})}})),r&&Sl(h=>{var _;const m=Zv(h,d,l,f,p,u);m&&(o&&bc(m,e),a==null||a(m,{headers:_d((_=h.xhr.__sentry_xhr_v3__)==null?void 0:_.request_headers)}))})}const Xv=300;function bc(e,t){const{url:n}=te(e).data;if(!n||typeof n!="string")return;let r=()=>void setTimeout(s);if(Qn(t)){const i=e.end.bind(e);e.end=o=>{const c=o??me();let a=!1;const u=()=>{a||(a=!0,setTimeout(s),i(c),clearTimeout(d))};r=u;const d=setTimeout(u,Xv)}}const s=mn("resource",({entries:i})=>{i.forEach(o=>{Yv(o)&&o.name.endsWith(n)&&(e.setAttributes(_l(o)),r())})})}function Jv(e,t){const n=qt();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?at(r.toString(),t)||i&&at(r.pathname,t):i}else{const r=!!e.match(/^\/(?!\/)/);return t?at(e,t):r}}function Zv(e,t,n,r,s,i){const o=e.xhr,c=o==null?void 0:o[Ot];if(!o||o.__sentry_own_request__||!c)return;const{url:a,method:u}=c,d=Ve()&&t(a);if(e.endTimestamp){const g=o.__sentry_xhr_span_id__;if(!g)return;const S=r[g];S&&(d&&c.status_code!==void 0&&(Gc(S,c.status_code),S.end(),i==null||i(S,{headers:_d(Tl(o)),error:e.error})),delete r[g]);return}const l=md(a),f=Ht(l||a),p=vt(Sh(a)),h=!!Te(),m=d&&h?It({name:`${u} ${p}`,attributes:{url:vt(a),type:"xhr","http.method":u,"http.url":l?vt(l):void 0,"server.address":f==null?void 0:f.host,[pe]:"auto.http.browser",[pt]:"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 tt;o.__sentry_xhr_span_id__=m.spanContext().spanId,r[o.__sentry_xhr_span_id__]=m,n(a)&&Qv(o,Ve()&&h?m:void 0,s);const _=W();return _&&_.emit("beforeOutgoingRequestSpan",m,e),m}function Qv(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=Du({span:t,propagateTraceparent:n});r&&e0(e,r,s,i)}function e0(e,t,n,r){var i;const s=(i=e.__sentry_xhr_v3__)==null?void 0:i.request_headers;if(!(s!=null&&s["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!(s!=null&&s.traceparent)&&e.setRequestHeader("traceparent",r),n){const o=s==null?void 0:s.baggage;(!o||!Gv(o))&&e.setRequestHeader("baggage",n)}}catch{}}function t0(){Y.document?Y.document.addEventListener("visibilitychange",()=>{const e=Te();if(!e)return;const t=ve(e);if(Y.document.hidden&&t){const n="cancelled",{op:r,status:s}=te(t);Be&&b.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||t.setStatus({code:Se,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Be&&b.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const n0=3600,yd="sentry_previous_trace",r0="sentry.previous_trace";function s0(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let s=r?a0():void 0;e.on("spanStart",o=>{if(ve(o)!==o)return;const c=ne().getPropagationContext();s=i0(s,o,c),r&&o0(s)});let i=!0;n&&e.on("beforeSampling",o=>{if(!s)return;const c=ne(),a=c.getPropagationContext();if(i&&a.parentSpanId){i=!1;return}c.setPropagationContext({...a,dsc:{...a.dsc,sample_rate:String(s.sampleRate),sampled:String(Li(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=Li(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[qc]:s.sampleRate}})}function i0(e,t,n){const r=te(t);function s(){var c,a;try{return Number((c=n.dsc)==null?void 0:c.sample_rate)??Number((a=r.data)==null?void 0:a[Ui])}catch{return 0}}const i={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!e)return i;const o=e.spanContext;return o.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=n0&&(Be&&b.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:o,attributes:{[of]:"previous_trace"}}),t.setAttribute(r0,`${o.traceId}-${o.spanId}-${Li(o)?1:0}`)),i)}function o0(e){try{Y.sessionStorage.setItem(yd,JSON.stringify(e))}catch(t){Be&&b.warn("Could not store previous trace in sessionStorage",t)}}function a0(){var e;try{const t=(e=Y.sessionStorage)==null?void 0:e.getItem(yd);return JSON.parse(t)}catch{return}}function Li(e){return e.traceFlags===1}const c0="BrowserTracing",u0=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function l0(){const e=Y.navigator;return e!=null&&e.userAgent?u0.test(e.userAgent):!1}const d0={...Mr,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...gd},Ec=(e={})=>{"enableElementTiming"in e&&rt(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=Y.document,{enableInp:r,enableLongTask:s,enableLongAnimationFrame:i,_experiments:{enableInteractions:o,enableStandaloneClsSpans:c,enableStandaloneLcpSpans:a},beforeStartSpan:u,idleTimeout:d,finalTimeout:l,childSpanTimeout:f,markBackgroundSpan:p,traceFetch:h,traceXHR:m,trackFetchStreamPerformance:_,shouldCreateSpanForRequest:g,enableHTTPTimings:S,ignoreResourceSpans:N,ignorePerformanceApiSpans:C,instrumentPageLoad:U,instrumentNavigation:A,detectRedirects:y,linkPreviousTrace:w,consistentTraceSampling:F,enableReportPageLoaded:E,onRequestSpanStart:x,onRequestSpanEnd:T}={...d0,...e},k=l0();let M,J,K;function Z(v,$,I=!0){const L=$.op==="pageload",ee=$.name,X=u?u($):$,he=X.attributes||{};if(ee!==X.name&&(he[Fe]="custom",X.attributes=he),!I){const be=Vt();It({...X,startTime:be}).end(be);return}t.name=X.name,t.source=he[Fe];const De=hu(X,{idleTimeout:d,finalTimeout:l,childSpanTimeout:f,disableAutoFinish:L,beforeSpanEnd:be=>{M==null||M(),Dg(be,{recordClsOnPageloadSpan:!c,recordLcpOnPageloadSpan:!a,ignoreResourceSpans:N,ignorePerformanceApiSpans:C}),wc(v,void 0);const Ee=ne(),Ge=Ee.getPropagationContext();Ee.setPropagationContext({...Ge,traceId:De.spanContext().traceId,sampled:Mt(De),dsc:ht(be)}),L&&(K=void 0)},trimIdleSpanEndTimestamp:!E});L&&E&&(K=De),wc(v,De);function Ue(){n&&["interactive","complete"].includes(n.readyState)&&v.emit("idleSpanEnableAutoFinish",De)}L&&!E&&n&&(n.addEventListener("readystatechange",()=>{Ue()}),Ue())}return{name:c0,setup(v){var I;if(k){Be&&b.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if($f(),M=Cg({recordClsStandaloneSpans:c||!1,recordLcpStandaloneSpans:a||!1,client:v}),r&&sy(),i&&V.PerformanceObserver&&((I=PerformanceObserver.supportedEntryTypes)!=null&&I.includes("long-animation-frame"))?xg():s&&Rg(),o&&Mg(),y&&n){const L=()=>{J=me()};addEventListener("click",L,{capture:!0}),addEventListener("keydown",L,{capture:!0,passive:!0})}function $(){const L=Vn(v);L&&!te(L).timestamp&&(Be&&b.log(`[Tracing] Finishing current active span with op: ${te(L).op}`),L.setAttribute(Fn,"cancelled"),L.end())}v.on("startNavigationSpan",(L,ee)=>{if(W()!==v)return;if(ee!=null&&ee.isRedirect){Be&&b.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),Z(v,{op:"navigation.redirect",...L},!1);return}J=void 0,$(),Ce().setPropagationContext({traceId:ft(),sampleRand:Math.random(),propagationSpanId:Ve()?void 0:ct()});const X=ne();X.setPropagationContext({traceId:ft(),sampleRand:Math.random(),propagationSpanId:Ve()?void 0:ct()}),X.setSDKProcessingMetadata({normalizedRequest:void 0}),Z(v,{op:"navigation",...L,parentSpan:null,forceTransaction:!0})}),v.on("startPageLoadSpan",(L,ee={})=>{if(W()!==v)return;$();const X=ee.sentryTrace||vc("sentry-trace")||Tc("sentry-trace"),he=ee.baggage||vc("baggage")||Tc("baggage"),De=If(X,he),Ue=ne();Ue.setPropagationContext(De),Ve()||(Ue.getPropagationContext().propagationSpanId=ct()),Ue.setSDKProcessingMetadata({normalizedRequest:no()}),Z(v,{op:"pageload",...L})}),v.on("endPageloadSpan",()=>{E&&K&&(K.setAttribute(Fn,"reportPageLoaded"),K.end())})},afterAllSetup(v){if(k)return;let $=qt();if(w!=="off"&&s0(v,{linkPreviousTrace:w,consistentTraceSampling:F}),Y.location){if(U){const I=He();f0(v,{name:Y.location.pathname,startTime:I?I/1e3:void 0,attributes:{[Fe]:"url",[pe]:"auto.pageload.browser"}})}A&&ys(({to:I,from:L})=>{if(L===void 0&&($==null?void 0:$.indexOf(I))!==-1){$=void 0;return}$=void 0;const ee=Xi(I),X=Vn(v),he=X&&y&&h0(X,J);Sd(v,{name:(ee==null?void 0:ee.pathname)||Y.location.pathname,attributes:{[Fe]:"url",[pe]:"auto.navigation.browser"}},{url:I,isRedirect:he})})}p&&t0(),o&&p0(v,d,l,f,t),r&&ay(),Kv(v,{traceFetch:h,traceXHR:m,trackFetchStreamPerformance:_,tracePropagationTargets:v.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:g,enableHTTPTimings:S,onRequestSpanStart:x,onRequestSpanEnd:T})}}};function f0(e,t,n){e.emit("startPageLoadSpan",t,n),ne().setTransactionName(t.name);const r=Vn(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function Sd(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=ne();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...no(),url:r}}),Vn(e)}function vc(e){const t=Y.document,n=t==null?void 0:t.querySelector(`meta[name=${e}]`);return(n==null?void 0:n.getAttribute("content"))||void 0}function Tc(e){var r,s,i;const t=(s=(r=Y.performance)==null?void 0:r.getEntriesByType)==null?void 0:s.call(r,"navigation")[0],n=(i=t==null?void 0:t.serverTiming)==null?void 0:i.find(o=>o.name===e);return n==null?void 0:n.description}function p0(e,t,n,r,s){const i=Y.document;let o;const c=()=>{const a="ui.action.click",u=Vn(e);if(u){const d=te(u).op;if(["navigation","pageload"].includes(d)){Be&&b.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(Fn,"interactionInterrupted"),o.end(),o=void 0),!s.name){Be&&b.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=hu({name:s.name,op:a,attributes:{[Fe]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",c,{capture:!0})}const bd="_sentry_idleSpan";function Vn(e){return e[bd]}function wc(e,t){Le(e,bd,t)}const Ic=1.5;function h0(e,t){const n=te(e),r=Vt(),s=n.start_timestamp;return!(r-s>Ic||t&&r-t<=Ic)}const Ed=["activate","mount"],vd=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,m0=/(?:^|[-_])(\w)/g,_0=e=>e.replace(m0,t=>t.toUpperCase()).replace(/[-_]/g,""),g0="<Root>",Js="<Anonymous>",y0=(e,t)=>e.repeat(t),Dn=(e,t)=>{if(!e)return Js;if(e.$root===e)return g0;if(!e.$options)return Js;const n=e.$options;let r=n.name||n._componentTag||n.__name;const s=n.__file;if(!r&&s){const i=s.match(/([^/\\]+)\.vue$/);i&&(r=i[1])}return(r?`<${_0(r)}>`:Js)+(s&&t!==!1?` at ${s}`:"")},S0=e=>{if(e&&(e._isVue||e.__isVue)&&e.$parent){const t=[];let n=0;for(;e;){if(t.length>0){const s=t[t.length-1];if(s.constructor===e.constructor){n++,e=e.$parent;continue}else n>0&&(t[t.length-1]=[s,n],n=0)}t.push(e),e=e.$parent}return`
found in
${t.map((s,i)=>`${(i===0?"---> ":y0(" ",5+i*2))+(Array.isArray(s)?`${Dn(s[0])}... (${s[1]} recursive calls)`:Dn(s))}`).join(`
`)}`}return`
(found in ${Dn(e)})`},b0=(e,t)=>{const{errorHandler:n}=e.config;e.config.errorHandler=(r,s,i)=>{var u;const o=Dn(s,!1),c=s?S0(s):"",a={componentName:o,lifecycleHook:i,trace:c};if((t==null?void 0:t.attachProps)!==!1&&s&&((u=s.$options)!=null&&u.propsData?a.propsData=s.$options.propsData:s.$props&&(a.propsData=s.$props)),setTimeout(()=>{ps(r,{captureContext:{contexts:{vue:a}},mechanism:{handled:!!n,type:"auto.function.vue.error_handler"}})}),typeof n=="function"&&e.config.errorHandler)n.call(e,r,s,i);else throw r}},kc="ui.vue",E0={activate:["activated","deactivated"],create:["beforeCreate","created"],unmount:["beforeUnmount","unmounted"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]};function Zs(e,t,n){e.$_sentryRootComponentSpanTimer&&clearTimeout(e.$_sentryRootComponentSpanTimer),e.$_sentryRootComponentSpanTimer=setTimeout(()=>{var r;(r=e.$root)!=null&&r.$_sentryRootComponentSpan&&(e.$root.$_sentryRootComponentSpan.end(t),e.$root.$_sentryRootComponentSpan=void 0)},n)}function v0(e,t){function n(s){return s.replace(/^<([^\s]*)>(?: at [^\s]*)?$/,"$1")}return e.some(s=>n(t)===n(s))}const T0=(e={})=>{const t=(e.hooks||[]).concat(Ed).filter((s,i,o)=>o.indexOf(s)===i),n={},r=e.timeout||2e3;for(const s of t){const i=E0[s];if(!i){vd&&b.warn(`Unknown hook: ${s}`);continue}for(const o of i)n[o]=function(){var f;const c=this.$root===this;c&&(this.$_sentryRootComponentSpan=this.$_sentryRootComponentSpan||It({name:"Application Render",op:`${kc}.render`,attributes:{[pe]:"auto.ui.vue"},onlyIfParent:!0}),Zs(this,me(),r));const a=Dn(this,!1);if(!(c||(Array.isArray(e.trackComponents)?v0(e.trackComponents,a):e.trackComponents))){Zs(this,me(),r);return}this.$_sentryComponentSpans=this.$_sentryComponentSpans||{};const d=o===i[0],l=((f=this.$root)==null?void 0:f.$_sentryRootComponentSpan)||Te();if(d){if(l){const p=this.$_sentryComponentSpans[s];p&&p.end(),this.$_sentryComponentSpans[s]=It({name:`Vue ${a}`,op:`${kc}.${s}`,attributes:{[pe]:"auto.ui.vue"},onlyIfParent:!0})}}else{const p=this.$_sentryComponentSpans[s];if(!p)return;p.end(),Zs(this,me(),r)}}}return n},w0=V,I0={Vue:w0.Vue,attachProps:!0,attachErrorHandler:!0,tracingOptions:{hooks:Ed,timeout:2e3,trackComponents:!1}},k0="Vue",C0=(e={})=>({name:k0,setup(t){const n={...I0,...t.getOptions(),...e};if(!n.Vue&&!n.app){rt(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue specific errors will not be captured. Update your `Sentry.init` call with an appropriate config option: `app` (Application Instance - Vue 3) or `Vue` (Vue Constructor - Vue 2).")});return}n.app?(Array.isArray(n.app)?n.app:[n.app]).forEach(s=>Cc(s,n)):n.Vue&&Cc(n.Vue,n)}}),Cc=(e,t)=>{var n;vd&&((n=e._instance)==null?void 0:n.isMounted)===!0&&rt(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.")}),t.attachErrorHandler&&b0(e,t),Ve(t)&&e.mixin(T0(t.tracingOptions))};function D0(e={}){const t={defaultIntegrations:[...kl(),C0()],...e};return Lu(t,"vue"),dS(t)}function R0(e,t,n){let r=!1;const s="mode"in e;e.onError(i=>ps(i,{mechanism:{handled:!1}})),e.beforeEach((i,o,...c)=>{const a=r?void 0:x0(),u={};for(const f of Object.keys(i.params))u[`url.path.parameter.${f}`]=i.params[f],u[`params.${f}`]=i.params[f];for(const f of Object.keys(i.query)){const p=i.query[f];p&&(u[`query.${f}`]=p)}let d=i.path,l="url";if(i.name&&t.routeLabel!=="path")d=i.name.toString(),l="custom";else if(i.matched.length>0){const f=i.matched.length-1;d=i.matched[f].path,l="route"}if(ne().setTransactionName(d),t.instrumentPageLoad&&a&&(te(a).data[Fe]!=="custom"&&(a.updateName(d),a.setAttribute(Fe,l)),a.setAttributes({...u,[pe]:"auto.pageload.vue"}),r=!0),t.instrumentNavigation&&!a&&n({name:d,op:"navigation",attributes:{...u,[pe]:"auto.navigation.vue",[Fe]:l}}),s){const f=c[0];typeof f=="function"&&f()}})}function x0(){const e=Te(),t=e&&ve(e);return t&&te(t).op==="pageload"?t:void 0}function O0(e={}){if(!e.router)return Ec(e);const t=Ec({...e,instrumentNavigation:!1}),{router:n,instrumentNavigation:r=!0,instrumentPageLoad:s=!0,routeLabel:i="name"}=e;return{...t,afterAllSetup(o){t.afterAllSetup(o),R0(n,{routeLabel:i,instrumentNavigation:r,instrumentPageLoad:s},a=>{Sd(o,a)})}}}export{M0 as a,O0 as b,N0 as f,W as g,D0 as i,L0 as r,A0 as s};