!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="eb535f1a-786f-5081-ac45-ead2beadfd9a")}catch(e){}}(); import{r as Zt}from"./index-DwaoyV61.js";import{D as R,d as g,g as vn,G as L,b as M,e as O,S as le,i as bt,f as nt,h as Ie,T as Rn,n as Er,j as br,k as Bt,l as ce,s as b,m as Ir,o as ft,p as Ce,q as ke,t as H,r as re,u as N,v as vr,w as ve,x as $,y as Rr,z as lt,A as Nr,B as wr,C as D,E as en,F as w,H as Ve,I as tn,J as Ar,K as Pr,L as z,M as Nn,N as mt,_ as gt,O as wn,P as An,Q as Cr,R as Ye,U as Pn,V as Cn,W as kr,X as kn,Y as we,Z as Lr,$ as Hr,a0 as Mr,a1 as xr,a2 as Or,a3 as Dr,a4 as Ur,a5 as Fr,a6 as $r,a7 as Br,a8 as Ln,a9 as qt,aa as qr,ab as Wr,ac as Ht,ad as Gr,ae as rt,af as Wt,ag as Vr,ah as Yr,ai as jr,aj as zr,a as Jr,ak as U,al as X,am as je,an as nn,ao as Xr,ap as ze,aq as Kr,ar as Qr,as as Zr,at as Hn}from"./_commonjs-dynamic-modules-BHkRu4p0.js";const Je={},rn={};function ge(e,t){Je[e]=Je[e]||[],Je[e].push(t)}function he(e,t){if(!rn[e]){rn[e]=!0;try{t()}catch(n){R&&g.error(`Error while instrumenting ${e}`,n)}}}function J(e,t){const n=e&&Je[e];if(n)for(const r of n)try{r(t)}catch(a){R&&g.error(`Error while triggering instrumentation handler. Type: ${e} Name: ${vn(r)} Error:`,a)}}let It=null;function ea(e){const t="error";ge(t,e),he(t,ta)}function ta(){It=L.onerror,L.onerror=function(e,t,n,r,a){return J("error",{column:r,error:a,line:n,msg:e,url:t}),It?It.apply(this,arguments):!1},L.onerror.__SENTRY_INSTRUMENTED__=!0}let vt=null;function na(e){const t="unhandledrejection";ge(t,e),he(t,ra)}function ra(){vt=L.onunhandledrejection,L.onunhandledrejection=function(e){return J("unhandledrejection",e),vt?vt.apply(this,arguments):!0},L.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}let an=!1;function aa(){if(an)return;function e(){const t=M(),n=t&&O(t);if(n){const r="internal_error";R&&g.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:le,message:r})}}e.tag="sentry_tracingErrorCallback",an=!0,ea(e),na(e)}function sn(e){g.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Mn(e,t){if(!t?.length||!e.description)return!1;for(const n of t){if(sa(n)){if(bt(e.description,n))return R&&sn(e),!0;continue}if(!n.name&&!n.op)continue;const r=n.name?bt(e.description,n.name):!0,a=n.op?e.op&&bt(e.op,n.op):!0;if(r&&a)return R&&sn(e),!0}return!1}function qi(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const a of e)a.parent_span_id===r&&(a.parent_span_id=n)}function sa(e){return typeof e=="string"||e instanceof RegExp}class ae{constructor(t={}){this._traceId=t.traceId||nt(),this._spanId=t.spanId||Ie()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Rn}}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 Gt(e,t=[]){return[e,t]}function Wi(e,t){const[n,r]=e;return[n,[...r,t]]}function ia(e,t){const n=e[1];for(const r of n){const a=r[0].type;if(t(r,a))return!0}return!1}function Gi(e,t){return ia(e,(n,r)=>t.includes(r))}function Mt(e){const t=br(L);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Vi(e){const[t,n]=e;let r=JSON.stringify(t);function a(s){typeof r=="string"?r=typeof s=="string"?r+s:[Mt(r),s]:r.push(typeof s=="string"?Mt(s):s)}for(const s of n){const[i,c]=s;if(a(` ${JSON.stringify(i)} `),typeof c=="string"||c instanceof Uint8Array)a(c);else{let o;try{o=JSON.stringify(c)}catch{o=JSON.stringify(Er(c))}a(o)}}return typeof r=="string"?r:oa(r)}function oa(e){const t=e.reduce((a,s)=>a+s.length,0),n=new Uint8Array(t);let r=0;for(const a of e)n.set(a,r),r+=a.length;return n}function ca(e){return[{type:"span"},e]}function Yi(e){const t=typeof e.data=="string"?Mt(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const xn={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 ua(e){return e in xn}function ji(e){return ua(e)?xn[e]:e}function On(e){if(!e?.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function da(e,t,n,r){const a=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Bt(r)},...a&&{trace:a}}}function pa(e,t){if(!t)return e;const n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function zi(e,t,n,r){const a=On(n),s={sent_at:new Date().toISOString(),...a&&{sdk:a},...!!r&&t&&{dsn:Bt(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Gt(s,[i])}function Ji(e,t,n,r){const a=On(n),s=e.type&&e.type!=="replay_event"?e.type:"event";pa(e,n?.sdk);const i=da(e,a,r,t);return delete e.sdkProcessingMetadata,Gt(i,[[{type:s},e]])}function fa(e,t){function n(l){return!!l.trace_id&&!!l.public_key}const r=ce(e[0]),a=t?.getDsn(),s=t?.getOptions().tunnel,i={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!s&&a&&{dsn:Bt(a)}},{beforeSendSpan:c,ignoreSpans:o}=t?.getOptions()||{},u=o?.length?e.filter(l=>!Mn(b(l),o)):e,d=e.length-u.length;d&&t?.recordDroppedEvent("before_send","span",d);const p=c?l=>{const f=b(l),h=c(f);return h||(Ir(),f)}:b,m=[];for(const l of u){const f=p(l);f&&m.push(ca(f))}return Gt(i,m)}function la(e){if(!R)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=b(e),{spanId:a}=e.spanContext(),s=ft(e),i=O(e),c=i===e,o=`[Tracing] Starting ${s?"sampled":"unsampled"} ${c?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${a}`];if(r&&u.push(`parent ID: ${r}`),!c){const{op:d,description:p}=b(i);u.push(`root ID: ${i.spanContext().spanId}`),d&&u.push(`root op: ${d}`),p&&u.push(`root description: ${p}`)}g.log(`${o} ${u.join(` `)}`)}function ma(e){if(!R)return;const{description:t="< unknown name >",op:n="< unknown op >"}=b(e),{spanId:r}=e.spanContext(),s=O(e)===e,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${t}" with ID ${r}`;g.log(i)}function ga(e,t,n,r=M()){const a=r&&O(r);a&&(R&&g.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),a.addEvent(e,{[ke]:t,[Ce]:n}))}function on(e){if(!e||e.length===0)return;const t={};return e.forEach(n=>{const r=n.attributes||{},a=r[Ce],s=r[ke];typeof a=="string"&&typeof s=="number"&&(t[n.name]={value:s,unit:a})}),t}const cn=1e3;class ht{constructor(t={}){this._traceId=t.traceId||nt(),this._spanId=t.spanId||Ie(),this._startTime=t.startTimestamp||H(),this._links=t.links,this._attributes={},this.setAttributes({[N]:"manual",[re]: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?vr:Rn}}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=ve(t)}setStatus(t){return this._status=t,this}updateName(t){return this._name=t,this.setAttribute($,"custom"),this}end(t){this._endTime||(this._endTime=ve(t),ma(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[re],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:wr(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[N],profile_id:this._attributes[Nr],exclusive_time:this._attributes[lt],measurements:on(this._events),is_segment:this._isStandaloneSpan&&O(this)===this||void 0,segment_id:this._isStandaloneSpan?O(this).spanContext().spanId:void 0,links:Rr(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){R&&g.log("[Tracing] Adding an event to span:",t);const a=un(n)?n:r||H(),s=un(n)?{}:n||{},i={name:t,time:ve(a),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const t=D();if(t&&t.emit("spanEnd",this),!(this._isStandaloneSpan||this===O(this)))return;if(this._isStandaloneSpan){this._sampled?_a(fa([this],t)):(R&&g.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}const r=this._convertSpanToTransaction();r&&(en(this).scope||w()).captureEvent(r)}_convertSpanToTransaction(){if(!dn(b(this)))return;this._name||(R&&g.warn("Transaction has no name, falling back to ``."),this._name="");const{scope:t,isolationScope:n}=en(this),r=t?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const s=Ve(this).filter(d=>d!==this&&!ha(d)).map(d=>b(d)).filter(dn),i=this._attributes[$];delete this._attributes[tn],s.forEach(d=>{delete d.data[tn]});const c={contexts:{trace:Ar(this)},spans:s.length>cn?s.sort((d,p)=>d.start_timestamp-p.start_timestamp).slice(0,cn):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:ce(this)},request:r,...i&&{transaction_info:{source:i}}},o=on(this._events);return o&&Object.keys(o).length&&(R&&g.log("[Measurements] Adding measurements to transaction event",JSON.stringify(o,void 0,2)),c.measurements=o),c}}function un(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function dn(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function ha(e){return e instanceof ht&&e.isStandaloneSpan()}function _a(e){const t=D();if(!t)return;const n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function Sa(e,t,n=()=>{},r=()=>{}){let a;try{a=e()}catch(s){throw t(s),n(),s}return Ta(a,t,n,r)}function Ta(e,t,n,r){return Pr(e)?e.then(a=>(n(),r(a),a),a=>{throw t(a),n(),a}):(n(),r(e),e)}function ya(e,t,n){if(!z(e))return[!1];let r,a;typeof e.tracesSampler=="function"?(a=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?a=t.parentSampled:typeof e.tracesSampleRate<"u"&&(a=e.tracesSampleRate,r=!0);const s=Nn(a);if(s===void 0)return R&&g.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(a)} of type ${JSON.stringify(typeof a)}.`),[!1];if(!s)return R&&g.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,s,r];const i=nIa(s)(()=>{const u=w(),d=$n(u,s),m=e.onlyIfParent&&!d?new ae:Un({parentSpan:d,spanArguments:r,forceTransaction:a,scope:u});return gt(u,m),Sa(()=>t(m),()=>{const{status:l}=b(m);m.isRecording()&&(!l||l==="ok")&&m.setStatus({code:le,message:"internal_error"})},()=>{m.end()})}))}function _e(e){const t=Yt();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=Fn(e),{forceTransaction:r,parentSpan:a}=e;return(e.scope?i=>mt(e.scope,i):a!==void 0?i=>Vt(a,i):i=>i())(()=>{const i=w(),c=$n(i,a);return e.onlyIfParent&&!c?new ae:Un({parentSpan:c,spanArguments:n,forceTransaction:r,scope:i})})}function Vt(e,t){const n=Yt();return n.withActiveSpan?n.withActiveSpan(e,t):mt(r=>(gt(r,e||void 0),t(r)))}function Un({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){if(!z()){const i=new ae;if(n||!e){const c={sampled:"false",sample_rate:"0",transaction:t.name,...ce(i)};Ye(i,c)}return i}const a=Pn();let s;if(e&&!n)s=ba(e,r,t),Cn(e,s);else if(e){const i=ce(e),{traceId:c,spanId:o}=e.spanContext(),u=ft(e);s=pn({traceId:c,parentSpanId:o,...t},r,u),Ye(s,i)}else{const{traceId:i,dsc:c,parentSpanId:o,sampled:u}={...a.getPropagationContext(),...r.getPropagationContext()};s=pn({traceId:i,parentSpanId:o,...t},r,u),c&&Ye(s,c)}return la(s),kr(s,r,a),s}function Fn(e){const n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const r={...n};return r.startTimestamp=ve(e.startTime),delete r.startTime,r}return n}function Yt(){const e=wn();return An(e)}function pn(e,t,n){const r=D(),a=r?.getOptions()||{},{name:s=""}=e,i={spanAttributes:{...e.attributes},spanName:s,parentSampled:n};r?.emit("beforeSampling",i,{decision:!1});const c=i.parentSampled??n,o=i.spanAttributes,u=t.getPropagationContext(),[d,p,m]=t.getScopeData().sdkProcessingMetadata[Dn]?[!1]:ya(a,{name:s,parentSampled:c,attributes:o,parentSampleRate:Nn(u.dsc?.sample_rate)},u.sampleRand),l=new ht({...e,attributes:{[$]:"custom",[kn]:p!==void 0&&m?p:void 0,...o},sampled:d});return!d&&r&&(R&&g.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",l),l}function ba(e,t,n){const{spanId:r,traceId:a}=e.spanContext(),s=t.getScopeData().sdkProcessingMetadata[Dn]?!1:ft(e),i=s?new ht({...n,parentSpanId:r,traceId:a,sampled:s}):new ae({traceId:a});Cn(e,i);const c=D();return c&&(c.emit("spanStart",i),n.endTimestamp&&c.emit("spanEnd",i)),i}function $n(e,t){if(t)return t;if(t===null)return;const n=Cr(e);if(!n)return;const r=D();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?O(n):n}function Ia(e){return e!==void 0?t=>Vt(e,t):t=>t()}const Xe={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},va="heartbeatFailed",Ra="idleTimeout",Na="finalTimeout",wa="externalFinish";function Bn(e,t={}){const n=new Map;let r=!1,a,s=wa,i=!t.disableAutoFinish;const c=[],{idleTimeout:o=Xe.idleTimeout,finalTimeout:u=Xe.finalTimeout,childSpanTimeout:d=Xe.childSpanTimeout,beforeSpanEnd:p,trimIdleSpanEndTimestamp:m=!0}=t,l=D();if(!l||!z()){const T=new ae,A={sample_rate:"0",sampled:"false",...ce(T)};return Ye(T,A),T}const f=w(),h=M(),_=Aa(e);_.end=new Proxy(_.end,{apply(T,A,ue){if(p&&p(_),A instanceof ae)return;const[$e,...V]=ue,ye=$e||H(),K=ve(ye),C=Ve(_).filter(v=>v!==_),de=b(_);if(!C.length||!m)return Fe(K),Reflect.apply(T,A,[K,...V]);const ee=l.getOptions().ignoreSpans,Y=C?.reduce((v,E)=>{const k=b(E);return!k.timestamp||ee&&Mn(k,ee)?v:v?Math.max(v,k.timestamp):k.timestamp},void 0),j=de.start_timestamp,y=Math.min(j?j+u/1e3:1/0,Math.max(j||-1/0,Math.min(K,Y||1/0)));return Fe(y),Reflect.apply(T,A,[y,...V])}});function W(){a&&(clearTimeout(a),a=void 0)}function G(T){W(),a=setTimeout(()=>{!r&&n.size===0&&i&&(s=Ra,_.end(T))},o)}function Ue(T){a=setTimeout(()=>{!r&&i&&(s=va,_.end(T))},d)}function yt(T){W(),n.set(T,!0);const A=H();Ue(A+d/1e3)}function Et(T){if(n.has(T)&&n.delete(T),n.size===0){const A=H();G(A+o/1e3)}}function Fe(T){r=!0,n.clear(),c.forEach(C=>C()),gt(f,h);const A=b(_),{start_timestamp:ue}=A;if(!ue)return;A.data[we]||_.setAttribute(we,s);const V=A.status;(!V||V==="unknown")&&_.setStatus({code:Lr}),g.log(`[Tracing] Idle span "${A.op}" finished`);const ye=Ve(_).filter(C=>C!==_);let K=0;ye.forEach(C=>{C.isRecording()&&(C.setStatus({code:le,message:"cancelled"}),C.end(T),R&&g.log("[Tracing] Cancelling span since span ended early",JSON.stringify(C,void 0,2)));const de=b(C),{timestamp:ee=0,start_timestamp:Y=0}=de,j=Y<=T,y=(u+o)/1e3,v=ee-Y<=y;if(R){const E=JSON.stringify(C,void 0,2);j?v||g.log("[Tracing] Discarding span since it finished after idle span final timeout",E):g.log("[Tracing] Discarding span since it happened after idle span was finished",E)}(!v||!j)&&(Hr(_,C),K++)}),K>0&&_.setAttribute("sentry.idle_span_discarded_spans",K)}return c.push(l.on("spanStart",T=>{if(r||T===_||b(T).timestamp||T instanceof ht&&T.isStandaloneSpan())return;Ve(_).includes(T)&&yt(T.spanContext().spanId)})),c.push(l.on("spanEnd",T=>{r||Et(T.spanContext().spanId)})),c.push(l.on("idleSpanEnableAutoFinish",T=>{T===_&&(i=!0,G(),n.size&&Ue())})),t.disableAutoFinish||G(),setTimeout(()=>{r||(_.setStatus({code:le,message:"deadline_exceeded"}),s=Na,_.end())},u),_}function Aa(e){const t=_e(e);return gt(w(),t),R&&g.log("[Tracing] Started span is an idle span"),t}const Pa="thismessage:/";function qn(e){return"isRelative"in e}function Wn(e,t){const n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=n?Pa:void 0;try{if("canParse"in URL&&!URL.canParse(e,r))return;const a=new URL(e,r);return n?{isRelative:n,pathname:a.pathname,search:a.search,hash:a.hash}:a}catch{}}function Ca(e){if(qn(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 at(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 ka(e){return e.split(/[?#]/,1)[0]}function oe(e,t=!0){if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",a=e.includes(";base64,"),s=e.indexOf(",");let i="";if(t&&s!==-1){const c=e.slice(s+1);i=c.length>10?`${c.slice(0,10)}... [truncated]`:c}return`data:${r}${a?",base64":""}${i?`,${i}`:""}`}return e}function Gn(e={}){const t=e.client||D();if(!Mr()||!t)return{};const n=wn(),r=An(n);if(r.getTraceData)return r.getTraceData(e);const a=e.scope||w(),s=e.span||M(),i=s?xr(s):La(a),c=s?ce(s):Or(t,a),o=Dr(c);if(!Ur.test(i))return g.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":i,baggage:o};return e.propagateTraceparent&&(d.traceparent=s?Fr(s):Ha(a)),d}function La(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return $r(t,r,n)}function Ha(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Br(t,r,n)}function Ma(e,t,n,r,a){if(!e.fetchData)return;const{method:s,url:i}=e.fetchData,c=z()&&t(i);if(e.endTimestamp){const l=e.fetchData.__span;if(!l)return;const f=r[l];f&&(c&&(Da(f,e),xa(f,e,a)),delete r[l]);return}const{spanOrigin:o="auto.http.browser",propagateTraceparent:u=!1}=typeof a=="object"?a:{spanOrigin:a},d=!!M(),p=c&&d?_e(Fa(i,s,o)):new ae;if(e.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(e.fetchData.url)){const l=e.args[0],f={...e.args[1]||{}},h=Oa(l,f,z()&&d?p:void 0,u);h&&(e.args[1]=f,f.headers=h)}const m=D();if(m){const l={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};m.emit("beforeOutgoingRequestSpan",p,l)}return p}function xa(e,t,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(e,{headers:t.response?.headers,error:t.error})}function Oa(e,t,n,r){const a=Gn({span:n,propagateTraceparent:r}),s=a["sentry-trace"],i=a.baggage,c=a.traceparent;if(!s)return;const o=t.headers||(qt(e)?e.headers:void 0);if(o)if(Ua(o)){const u=new Headers(o);if(u.get("sentry-trace")||u.set("sentry-trace",s),r&&c&&!u.get("traceparent")&&u.set("traceparent",c),i){const d=u.get("baggage");d?Be(d)||u.set("baggage",`${d},${i}`):u.set("baggage",i)}return u}else if(Array.isArray(o)){const u=[...o];o.find(p=>p[0]==="sentry-trace")||u.push(["sentry-trace",s]),r&&c&&!o.find(p=>p[0]==="traceparent")&&u.push(["traceparent",c]);const d=o.find(p=>p[0]==="baggage"&&Be(p[1]));return i&&!d&&u.push(["baggage",i]),u}else{const u="sentry-trace"in o?o["sentry-trace"]:void 0,d="traceparent"in o?o.traceparent:void 0,p="baggage"in o?o.baggage:void 0,m=p?Array.isArray(p)?[...p]:[p]:[],l=p&&(Array.isArray(p)?p.find(h=>Be(h)):Be(p));i&&!l&&m.push(i);const f={...o,"sentry-trace":u??s,baggage:m.length>0?m.join(","):void 0};return r&&c&&!d&&(f.traceparent=c),f}else return{...a}}function Da(e,t){if(t.response){Ln(e,t.response.status);const n=t.response?.headers?.get("content-length");if(n){const r=parseInt(n);r>0&&e.setAttribute("http.response_content_length",r)}}else t.error&&e.setStatus({code:le,message:"internal_error"});e.end()}function Be(e){return e.split(",").some(t=>t.trim().startsWith(Wr))}function Ua(e){return typeof Headers<"u"&&qr(e,Headers)}function Fa(e,t,n){if(e.startsWith("data:")){const s=oe(e);return{name:`${t} ${s}`,attributes:fn(e,void 0,t,n)}}const r=Wn(e),a=r?Ca(r):e;return{name:`${t} ${a}`,attributes:fn(e,r,t,n)}}function fn(e,t,n,r){const a={url:oe(e),type:"fetch","http.method":n,[N]:r,[re]:"http.client"};return t&&(qn(t)||(a["http.url"]=oe(t.href),a["server.address"]=t.host),t.search&&(a["http.query"]=t.search),t.hash&&(a["http.fragment"]=t.hash)),a}const Ae=L;function $a(){return"history"in Ae&&!!Ae.history}function Ba(){if(!("fetch"in Ae))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function ln(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function qa(){if(typeof EdgeRuntime=="string")return!0;if(!Ba())return!1;if(ln(Ae.fetch))return!0;let e=!1;const t=Ae.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow?.fetch&&(e=ln(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){R&&g.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}function Wa(e,t){const n="fetch";ge(n,e),he(n,()=>Vn(void 0,t))}function Ga(e){const t="fetch-body-resolved";ge(t,e),he(t,()=>Vn(Ya))}function Vn(e,t=!1){t&&!qa()||Ht(L,"fetch",function(n){return function(...r){const a=new Error,{method:s,url:i}=ja(r),c={args:r,fetchData:{method:s,url:i},startTimestamp:H()*1e3,virtualError:a,headers:za(r)};return e||J("fetch",{...c}),n.apply(L,r).then(async o=>(e?e(o):J("fetch",{...c,endTimestamp:H()*1e3,response:o}),o),o=>{J("fetch",{...c,endTimestamp:H()*1e3,error:o}),Gr(o)&&o.stack===void 0&&(o.stack=a.stack,rt(o,"framesToPop",1));const d=D()?.getOptions().enhanceFetchErrorMessages??"always";if(d!==!1&&o instanceof TypeError&&(o.message==="Failed to fetch"||o.message==="Load failed"||o.message==="NetworkError when attempting to fetch resource."))try{const l=new URL(c.fetchData.url).host;d==="always"?o.message=`${o.message} (${l})`:rt(o,"__sentry_fetch_url_host__",l)}catch{}throw o})}})}async function Va(e,t){if(e?.body){const n=e.body,r=n.getReader(),a=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let s=!0;for(;s;){let i;try{i=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:c}=await r.read();clearTimeout(i),c&&(t(),s=!1)}catch{s=!1}finally{clearTimeout(i)}}clearTimeout(a),r.releaseLock(),n.cancel().then(null,()=>{})}}function Ya(e){let t;try{t=e.clone()}catch{return}Va(t,()=>{J("fetch-body-resolved",{endTimestamp:H()*1e3,response:e})})}function Ke(e,t){return!!e&&typeof e=="object"&&!!e[t]}function mn(e){return typeof e=="string"?e:e?Ke(e,"url")?e.url:e.toString?e.toString():"":""}function ja(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:mn(n),method:Ke(r,"method")?String(r.method).toUpperCase():qt(n)&&Ke(n,"method")?String(n.method).toUpperCase():"GET"}}const t=e[0];return{url:mn(t),method:Ke(t,"method")?String(t.method).toUpperCase():"GET"}}function za(e){const[t,n]=e;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(qt(t))return new Headers(t.headers)}catch{}}function Ja(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Xi(){return"npm"}function Yn(){return!Ja()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Xa(){return typeof window<"u"&&(!Yn()||Ka())}function Ka(){return L.process?.type==="renderer"}const jt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,P=L;let xt=0;function Ki(){return xt>0}function Qa(){xt++,setTimeout(()=>{xt--})}function Za(e,t={}){function n(a){return typeof a=="function"}if(!n(e))return e;try{const a=e.__sentry_wrapped__;if(a)return typeof a=="function"?a:e;if(Vr(e))return e}catch{return e}const r=function(...a){try{const s=a.map(i=>Za(i,t));return e.apply(this,s)}catch(s){throw Qa(),mt(i=>{i.addEventProcessor(c=>(t.mechanism&&(jr(c,void 0),zr(c,t.mechanism)),c.extra={...c.extra,arguments:a},c)),Jr(s)}),s}};try{for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(r[a]=e[a])}catch{}Yr(r,e),rt(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return e.name}})}catch{}return r}function jn(){const e=Wt(),{referrer:t}=P.document||{},{userAgent:n}=P.navigator||{},r={...t&&{Referer:t},...n&&{"User-Agent":n}};return{url:e,headers:r}}const _t=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,S=L,es=(e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good",Le=(e,t,n,r)=>{let a,s;return i=>{t.value>=0&&(i||r)&&(s=t.value-(a??0),(s||a===void 0)&&(a=t.value,t.delta=s,t.rating=es(t.value,n),e(t)))}},He=(e=!0)=>{const t=S.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStartHe()?.activationStart??0;function ne(e,t,n){S.document&&S.addEventListener(e,t,n)}function st(e,t,n){S.document&&S.removeEventListener(e,t,n)}let fe=-1;const zn=new Set,ts=()=>S.document?.visibilityState==="hidden"&&!S.document?.prerendering?0:1/0,Qe=e=>{if(ns(e)&&fe>-1){if(e.type==="visibilitychange"||e.type==="pagehide")for(const t of zn)t();isFinite(fe)||(fe=e.type==="visibilitychange"?e.timeStamp:0,st("prerenderingchange",Qe,!0))}},Me=()=>{if(S.document&&fe<0){const e=Se();fe=(S.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>e)[0]?.startTime)??ts(),ne("visibilitychange",Qe,!0),ne("pagehide",Qe,!0),ne("prerenderingchange",Qe,!0)}return{get firstHiddenTime(){return fe},onHidden(e){zn.add(e)}}};function ns(e){return e.type==="pagehide"||S.document?.visibilityState==="hidden"}const rs=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,xe=(e,t=-1)=>{const n=He();let r="navigate";return n&&(S.document?.prerendering||Se()>0?r="prerender":S.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:rs(),navigationType:r}},Rt=new WeakMap;function zt(e,t){try{return Rt.get(e)||Rt.set(e,new t),Rt.get(e)}catch{return new t}}class it{constructor(){it.prototype.__init.call(this),it.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(t){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]),this._onAfterProcessingUnexpectedShift?.(t)}}const Te=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(a=>{Promise.resolve().then(()=>{t(a.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},Jt=e=>{let t=!1;return()=>{t||(e(),t=!0)}},St=e=>{S.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},as=[1800,3e3],ss=(e,t={})=>{St(()=>{const n=Me(),r=xe("FCP");let a;const i=Te("paint",c=>{for(const o of c)o.name==="first-contentful-paint"&&(i.disconnect(),o.startTime{ss(Jt(()=>{const n=xe("CLS",0);let r;const a=Me(),s=zt(t,it),i=o=>{for(const u of o)s._processEntry(u);s._sessionValue>n.value&&(n.value=s._sessionValue,n.entries=s._sessionEntries,r())},c=Te("layout-shift",i);c&&(r=Le(e,n,is,t.reportAllChanges),a.onHidden(()=>{i(c.takeRecords()),r(!0)}),S?.setTimeout?.(r))}))};let Jn=0,Nt=1/0,qe=0;const cs=e=>{e.forEach(t=>{t.interactionId&&(Nt=Math.min(Nt,t.interactionId),qe=Math.max(qe,t.interactionId),Jn=qe?(qe-Nt)/7+1:0)})};let Ot;const Xn=()=>Ot?Jn:performance.interactionCount||0,us=()=>{"interactionCount"in performance||Ot||(Ot=Te("event",cs,{type:"event",buffered:!0,durationThreshold:0}))},wt=10;let Kn=0;const ds=()=>Xn()-Kn;class ot{constructor(){ot.prototype.__init.call(this),ot.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){Kn=Xn(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const t=Math.min(this._longestInteractionList.length-1,Math.floor(ds()/50));return this._longestInteractionList[t]}_processEntry(t){if(this._onBeforeProcessingEntry?.(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.lengthn._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((a,s)=>s._latency-a._latency),this._longestInteractionList.length>wt){const a=this._longestInteractionList.splice(wt);for(const s of a)this._longestInteractionMap.delete(s.id)}this._onAfterProcessingINPCandidate?.(r)}}}const Qn=e=>{const t=S.requestIdleCallback||S.setTimeout;S.document?.visibilityState==="hidden"?e():(e=Jt(e),ne("visibilitychange",e,{once:!0,capture:!0}),ne("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),st("visibilitychange",e,{capture:!0}),st("pagehide",e,{capture:!0})}))},ps=[200,500],fs=40,ls=(e,t={})=>{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Me();St(()=>{us();const r=xe("INP");let a;const s=zt(t,ot),i=o=>{Qn(()=>{for(const d of o)s._processEntry(d);const u=s._estimateP98LongestInteraction();u&&u._latency!==r.value&&(r.value=u._latency,r.entries=u.entries,a())})},c=Te("event",i,{durationThreshold:t.durationThreshold??fs});a=Le(e,r,ps,t.reportAllChanges),c&&(c.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{i(c.takeRecords()),a(!0)}))})};class ms{_processEntry(t){this._onBeforeProcessingEntry?.(t)}}const gs=[2500,4e3],hs=(e,t={})=>{St(()=>{const n=Me(),r=xe("LCP");let a;const s=zt(t,ms),i=o=>{t.reportAllChanges||(o=o.slice(-1));for(const u of o)s._processEntry(u),u.startTime{i(c.takeRecords()),c.disconnect(),a(!0)}),u=d=>{d.isTrusted&&(Qn(o),st(d.type,u,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])ne(d,u,{capture:!0})}})},_s=[800,1800],Dt=e=>{S.document?.prerendering?St(()=>Dt(e)):S.document?.readyState!=="complete"?addEventListener("load",()=>Dt(e),!0):setTimeout(e)},Ss=(e,t={})=>{const n=xe("TTFB"),r=Le(e,n,_s,t.reportAllChanges);Dt(()=>{const a=He();a&&(n.value=Math.max(a.responseStart-Se(),0),n.entries=[a],r(!0))})},Re={},ct={};let Zn,er,tr,nr;function rr(e,t=!1){return Tt("cls",e,Es,Zn,t)}function ar(e,t=!1){return Tt("lcp",e,bs,er,t)}function Ts(e){return Tt("ttfb",e,Is,tr)}function ys(e){return Tt("inp",e,vs,nr)}function me(e,t){return sr(e,t),ct[e]||(Rs(e),ct[e]=!0),ir(e,t)}function Oe(e,t){const n=Re[e];if(n?.length)for(const r of n)try{r(t)}catch(a){_t&&g.error(`Error while triggering instrumentation handler. Type: ${e} Name: ${vn(r)} Error:`,a)}}function Es(){return os(e=>{Oe("cls",{metric:e}),Zn=e},{reportAllChanges:!0})}function bs(){return hs(e=>{Oe("lcp",{metric:e}),er=e},{reportAllChanges:!0})}function Is(){return Ss(e=>{Oe("ttfb",{metric:e}),tr=e})}function vs(){return ls(e=>{Oe("inp",{metric:e}),nr=e})}function Tt(e,t,n,r,a=!1){sr(e,t);let s;return ct[e]||(s=n(),ct[e]=!0),r&&t({metric:r}),ir(e,t,a?s:void 0)}function Rs(e){const t={};e==="event"&&(t.durationThreshold=0),Te(e,n=>{Oe(e,{entries:n})},t)}function sr(e,t){Re[e]=Re[e]||[],Re[e].push(t)}function ir(e,t,n){return()=>{n&&n();const r=Re[e];if(!r)return;const a=r.indexOf(t);a!==-1&&r.splice(a,1)}}function Ns(e){return"duration"in e}const ws=e=>{const t=n=>{(n.type==="pagehide"||S.document?.visibilityState==="hidden")&&e(n)};ne("visibilitychange",t,{capture:!0,once:!0}),ne("pagehide",t,{capture:!0,once:!0})};function At(e){return typeof e=="number"&&isFinite(e)}function se(e,t,n,{...r}){const a=b(e).start_timestamp;return a&&a>t&&typeof e.updateStartTime=="function"&&e.updateStartTime(t),Vt(e,()=>{const s=_e({startTime:t,...r});return s&&s.end(n),s})}function Xt(e){const t=D();if(!t)return;const{name:n,transaction:r,attributes:a,startTime:s}=e,{release:i,environment:c,sendDefaultPii:o}=t.getOptions(),d=t.getIntegrationByName("Replay")?.getReplayId(),p=w(),m=p.getUser(),l=m!==void 0?m.email||m.id||m.ip_address:void 0;let f;try{f=p.getScopeData().contexts.profile.profile_id}catch{}const h={release:i,environment:c,user:l||void 0,profile_id:f||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":S.navigator?.userAgent,"client.address":o?"{{auto}}":void 0,...a};return _e({name:n,attributes:h,startTime:s,experimental:{standalone:!0}})}function De(){return S.addEventListener&&S.performance}function I(e){return e/1e3}function As(e){let t="unknown",n="unknown",r="";for(const a of e){if(a==="/"){[t,n]=e.split("/");break}if(!isNaN(Number(a))){t=r==="h"?"http":r,n=e.split(r)[1];break}r+=a}return r===e&&(t=r),{name:t,version:n}}function or(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function cr(e,t){let n,r=!1;function a(c){!r&&n&&t(c,n),r=!0}ws(()=>{a("pagehide")});const s=e.on("beforeStartNavigationSpan",(c,o)=>{o?.isRedirect||(a("navigation"),s(),i())}),i=e.on("afterStartPageLoadSpan",c=>{n=c.spanContext().spanId,i()})}function Ps(e){let t=0,n;if(!or("layout-shift"))return;const r=rr(({metric:a})=>{const s=a.entries[a.entries.length-1];s&&(t=a.value,n=s)},!0);cr(e,(a,s)=>{Cs(t,n,s,a),r()})}function Cs(e,t,n,r){_t&&g.log(`Sending CLS span (${e})`);const a=t?I((U()||0)+t.startTime):H(),s=w().getScopeData().transactionName,i=t?X(t.sources[0]?.node):"Layout shift",c={[N]:"auto.http.browser.cls",[re]:"ui.webvital.cls",[lt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t?.sources&&t.sources.forEach((u,d)=>{c[`cls.source.${d+1}`]=X(u.node)});const o=Xt({name:i,transaction:s,attributes:c,startTime:a});o&&(o.addEvent("cls",{[Ce]:"",[ke]:e}),o.end(a))}function ks(e){let t=0,n;if(!or("largest-contentful-paint"))return;const r=ar(({metric:a})=>{const s=a.entries[a.entries.length-1];s&&(t=a.value,n=s)},!0);cr(e,(a,s)=>{Ls(t,n,s,a),r()})}function Ls(e,t,n,r){_t&&g.log(`Sending LCP span (${e})`);const a=I((U()||0)+(t?.startTime||0)),s=w().getScopeData().transactionName,i=t?X(t.element):"Largest contentful paint",c={[N]:"auto.http.browser.lcp",[re]:"ui.webvital.lcp",[lt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(c["lcp.element"]=X(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 o=Xt({name:i,transaction:s,attributes:c,startTime:a});o&&(o.addEvent("lcp",{[Ce]:"millisecond",[ke]:e}),o.end(a))}function F(e){return e&&((U()||performance.timeOrigin)+e)/1e3}function ur(e){const t={};if(e.nextHopProtocol!=null){const{name:n,version:r}=As(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return U()||De()?.timeOrigin?Hs({...t,"http.request.redirect_start":F(e.redirectStart),"http.request.redirect_end":F(e.redirectEnd),"http.request.worker_start":F(e.workerStart),"http.request.fetch_start":F(e.fetchStart),"http.request.domain_lookup_start":F(e.domainLookupStart),"http.request.domain_lookup_end":F(e.domainLookupEnd),"http.request.connect_start":F(e.connectStart),"http.request.secure_connection_start":F(e.secureConnectionStart),"http.request.connection_end":F(e.connectEnd),"http.request.request_start":F(e.requestStart),"http.request.response_start":F(e.responseStart),"http.request.response_end":F(e.responseEnd),"http.request.time_to_first_byte":e.responseStart!=null?e.responseStart/1e3:void 0}):t}function Hs(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!=null))}const Ms=2147483647;let gn=0,q={},x,ut;function xs({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=De();if(r&&U()){r.mark&&S.performance.mark("sentry-tracing-init");const a=t?ks(n):$s(),s=Bs(),i=e?Ps(n):Fs();return()=>{a?.(),s(),i?.()}}return()=>{}}function Os(){me("longtask",({entries:e})=>{const t=M();if(!t)return;const{op:n,start_timestamp:r}=b(t);for(const a of e){const s=I(U()+a.startTime),i=I(a.duration);n==="navigation"&&r&&s{const n=M();if(n)for(const r of t.getEntries()){if(!r.scripts[0])continue;const a=I(U()+r.startTime),{start_timestamp:s,op:i}=b(n);if(i==="navigation"&&s&&a{const t=M();if(t){for(const n of e)if(n.name==="click"){const r=I(U()+n.startTime),a=I(n.duration),s={name:X(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[N]:"auto.ui.browser.metrics"}},i=Xr(n.target);i&&(s.attributes["ui.component_name"]=i),se(t,r,r+a,s)}}})}function Fs(){return rr(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(q.cls={value:e.value,unit:""},ut=t)},!0)}function $s(){return ar(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&(q.lcp={value:e.value,unit:"millisecond"},x=t)},!0)}function Bs(){return Ts(({metric:e})=>{e.entries[e.entries.length-1]&&(q.ttfb={value:e.value,unit:"millisecond"})})}function qs(e,t){const n=De(),r=U();if(!n?.getEntries||!r)return;const a=I(r),s=n.getEntries(),{op:i,start_timestamp:c}=b(e);s.slice(gn).forEach(o=>{const u=I(o.startTime),d=I(Math.max(0,o.duration));if(!(i==="navigation"&&c&&a+u{ga(o,u.value,u.unit)}),e.setAttribute("performance.timeOrigin",a),e.setAttribute("performance.activationStart",Se()),Ks(e,t)),x=void 0,ut=void 0,q={}}function Ws(e){if(e?.entryType==="measure")try{return e.detail.devtools.track==="Components ⚛"}catch{return}}function Gs(e,t,n,r,a,s){if(Ws(t)||["mark","measure"].includes(t.entryType)&&je(t.name,s))return;const i=He(!1),c=I(i?i.requestStart:0),o=a+Math.max(n,c),u=a+n,d=u+r,p={[N]:"auto.resource.browser.metrics"};o!==u&&(p["sentry.browser.measure_happened_before_request"]=!0,p["sentry.browser.measure_start_time"]=o),Vs(p,t),o<=d&&se(e,o,d,{name:t.name,op:t.entryType,attributes:p})}function Vs(e,t){try{const n=t.detail;if(!n)return;if(typeof n=="object"){for(const[r,a]of Object.entries(n))if(a&&nn(a))e[`sentry.browser.measure.detail.${r}`]=a;else if(a!==void 0)try{e[`sentry.browser.measure.detail.${r}`]=JSON.stringify(a)}catch{}return}if(nn(n)){e["sentry.browser.measure.detail"]=n;return}try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function Ys(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{We(e,t,r,n)}),We(e,t,"secureConnection",n,"TLS/SSL"),We(e,t,"fetch",n,"cache"),We(e,t,"domainLookup",n,"DNS"),zs(e,t,n)}function We(e,t,n,r,a=n){const s=js(n),i=t[s],c=t[`${n}Start`];!c||!i||se(e,r+I(c),r+I(i),{op:`browser.${a}`,name:t.name,attributes:{[N]:"auto.ui.browser.metrics",...n==="redirect"&&t.redirectCount!=null?{"http.redirect_count":t.redirectCount}:{}}})}function js(e){return e==="secureConnection"?"connectEnd":e==="fetch"?"domainLookupStart":`${e}End`}function zs(e,t,n){const r=n+I(t.requestStart),a=n+I(t.responseEnd),s=n+I(t.responseStart);t.responseEnd&&(se(e,r,a,{op:"browser.request",name:t.name,attributes:{[N]:"auto.ui.browser.metrics"}}),se(e,s,a,{op:"browser.response",name:t.name,attributes:{[N]:"auto.ui.browser.metrics"}}))}function Js(e,t,n,r,a,s,i){if(t.initiatorType==="xmlhttprequest"||t.initiatorType==="fetch")return;const c=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(i?.includes(c))return;const o={[N]:"auto.resource.browser.metrics"},u=at(n);u.protocol&&(o["url.scheme"]=u.protocol.split(":").pop()),u.host&&(o["server.address"]=u.host),o["url.same_origin"]=n.includes(S.location.origin),Qs(t,o,[["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={...o,...ur(t)},p=s+r,m=p+a;se(e,p,m,{name:n.replace(S.location.origin,""),op:c,attributes:d})}function Xs(e){const t=S.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),At(n.rtt)&&(q["connection.rtt"]={value:n.rtt,unit:"millisecond"})),At(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),At(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}function Ks(e,t){x&&t.recordLcpOnPageloadSpan&&(x.element&&e.setAttribute("lcp.element",X(x.element)),x.id&&e.setAttribute("lcp.id",x.id),x.url&&e.setAttribute("lcp.url",x.url.trim().slice(0,200)),x.loadTime!=null&&e.setAttribute("lcp.loadTime",x.loadTime),x.renderTime!=null&&e.setAttribute("lcp.renderTime",x.renderTime),e.setAttribute("lcp.size",x.size)),ut?.sources&&t.recordClsOnPageloadSpan&&ut.sources.forEach((n,r)=>e.setAttribute(`cls.source.${r+1}`,X(n.node)))}function Qs(e,t,n){n.forEach(([r,a])=>{const s=e[r];s!=null&&(typeof s=="number"&&s{}}const ti=({entries:e})=>{const t=M(),n=t?O(t):void 0,r=n?b(n).description:w().getScopeData().transactionName;e.forEach(a=>{const s=a;if(!s.identifier)return;const i=s.name,c=s.renderTime,o=s.loadTime,[u,d]=o?[I(o),"load-time"]:c?[I(c),"render-time"]:[H(),"entry-emission"],p=i==="image-paint"?I(Math.max(0,(c??0)-(o??0))):0,m={[N]:"auto.ui.browser.elementtiming",[re]:"ui.elementtiming",[$]:"component","sentry.span_start_time_source":d,"sentry.transaction_name":r,"element.id":s.id,"element.type":s.element?.tagName?.toLowerCase()||"unknown","element.size":s.naturalWidth&&s.naturalHeight?`${s.naturalWidth}x${s.naturalHeight}`:void 0,"element.render_time":c,"element.load_time":o,"element.url":s.url||void 0,"element.identifier":s.identifier,"element.paint_type":i};Ea({name:`element[${s.identifier}]`,attributes:m,startTime:u,onlyIfParent:!0},l=>{l.end(u+p)})})};let Ge;function ni(e){const t="history";ge(t,e),he(t,ri)}function ri(){if(S.addEventListener("popstate",()=>{const t=S.location.href,n=Ge;if(Ge=t,n===t)return;J("history",{from:n,to:t})}),!$a())return;function e(t){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const a=Ge,s=ai(String(r));if(Ge=s,a===s)return t.apply(this,n);J("history",{from:a,to:s})}return t.apply(this,n)}}Ht(S.history,"pushState",e),Ht(S.history,"replaceState",e)}function ai(e){try{return new URL(e,S.location.origin).toString()}catch{return e}}const be="__sentry_xhr_v3__";function si(e){const t="xhr";ge(t,e),he(t,ii)}function ii(){if(!S.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const a=new Error,s=H()*1e3,i=ze(r[0])?r[0].toUpperCase():void 0,c=oi(r[1]);if(!i||!c)return t.apply(n,r);n[be]={method:i,url:c,request_headers:{}},i==="POST"&&c.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const o=()=>{const u=n[be];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const d={endTimestamp:H()*1e3,startTimestamp:s,xhr:n,virtualError:a};J("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,d,p){return o(),u.apply(d,p)}}):n.addEventListener("readystatechange",o),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,d,p){const[m,l]=p,f=d[be];return f&&ze(m)&&ze(l)&&(f.request_headers[m.toLowerCase()]=l),u.apply(d,p)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const a=n[be];if(!a)return t.apply(n,r);r[0]!==void 0&&(a.body=r[0]);const s={startTimestamp:H()*1e3,xhr:n};return J("xhr",s),t.apply(n,r)}})}function oi(e){if(ze(e))return e;try{return e.toString()}catch{}}function ci(e){let t;try{t=e.getAllResponseHeaders()}catch(n){return _t&&g.error(n,"Failed to get xhr response headers",e),{}}return t?t.split(`\r `).reduce((n,r)=>{const[a,s]=r.split(": ");return s&&(n[a.toLowerCase()]=s),n},{}):{}}const Pt=[],Ze=new Map,pe=new Map,ui=60;function di(){if(De()&&U()){const t=pi();return()=>{t()}}return()=>{}}const Ut={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 pi(){return ys(fi)}const fi=({metric:e})=>{if(e.value==null)return;const t=I(e.value);if(t>ui)return;const n=e.entries.find(f=>f.duration===e.value&&Ut[f.name]);if(!n)return;const{interactionId:r}=n,a=Ut[n.name],s=I(U()+n.startTime),i=M(),c=i?O(i):void 0,o=r!=null?Ze.get(r):void 0,u=o?.span||c,d=u?b(u).description:w().getScopeData().transactionName,p=o?.elementName||X(n.target),m={[N]:"auto.http.browser.inp",[re]:`ui.interaction.${a}`,[lt]:n.duration},l=Xt({name:p,transaction:d,attributes:m,startTime:s});l&&(l.addEvent("inp",{[Ce]:"millisecond",[ke]:e.value}),l.end(s+t))};function li(){const e=Object.keys(Ut);Xa()&&e.forEach(a=>{S.addEventListener(a,t,{capture:!0,passive:!0})});function t(a){const s=a.target;if(!s)return;const i=X(s),c=Math.round(a.timeStamp);if(pe.set(c,i),pe.size>50){const o=pe.keys().next().value;o!==void 0&&pe.delete(o)}}function n(a){const s=Math.round(a.startTime);let i=pe.get(s);if(!i)for(let c=-5;c<=5;c++){const o=pe.get(s+c);if(o){i=o;break}}return i||""}const r=({entries:a})=>{const s=M(),i=s&&O(s);a.forEach(c=>{if(!Ns(c))return;const o=c.interactionId;if(o==null||Ze.has(o))return;const u=c.target?X(c.target):n(c);if(Pt.length>10){const d=Pt.shift();Ze.delete(d)}Pt.push(o),Ze.set(o,{span:i,elementName:u})})};me("event",r),me("first-input",r)}const Z=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function mi(e){return e.split(",").some(t=>t.trim().startsWith("sentry-"))}function dr(e){try{return new URL(e,P.location.origin).href}catch{return}}function gi(e){return e.entryType==="resource"&&"initiatorType"in e&&typeof e.nextHopProtocol=="string"&&(e.initiatorType==="fetch"||e.initiatorType==="xmlhttprequest")}function pr(e){try{return new Headers(e)}catch{return}}const hn=new WeakMap,Ct=new Map,fr={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function hi(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:a,shouldCreateSpanForRequest:s,enableHTTPTimings:i,tracePropagationTargets:c,onRequestSpanStart:o,onRequestSpanEnd:u}={...fr,...t},d=typeof s=="function"?s:f=>!0,p=f=>_i(f,c),m={},l=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(f=>(f.type==="transaction"&&f.spans&&f.spans.forEach(h=>{if(h.op==="http.client"){const _=Ct.get(h.span_id);_&&(h.timestamp=_/1e3,Ct.delete(h.span_id))}}),f)),a&&Ga(f=>{if(f.response){const h=hn.get(f.response);h&&f.endTimestamp&&Ct.set(h,f.endTimestamp)}}),Wa(f=>{const h=Ma(f,d,p,m,{propagateTraceparent:l,onRequestSpanEnd:u});if(f.response&&f.fetchData.__span&&hn.set(f.response,f.fetchData.__span),h){const _=dr(f.fetchData.url),W=_?at(_).host:void 0;h.setAttributes({"http.url":_?oe(_):void 0,"server.address":W}),i&&_n(h),o?.(h,{headers:f.headers})}})),r&&si(f=>{const h=Si(f,d,p,m,l,u);h&&(i&&_n(h),o?.(h,{headers:pr(f.xhr.__sentry_xhr_v3__?.request_headers)}))})}function _n(e){const{url:t}=b(e).data;if(!t||typeof t!="string")return;const n=me("resource",({entries:r})=>{r.forEach(a=>{gi(a)&&a.name.endsWith(t)&&(e.setAttributes(ur(a)),setTimeout(n))})})}function _i(e,t){const n=Wt();if(n){let r,a;try{r=new URL(e,n),a=new URL(n).origin}catch{return!1}const s=r.origin===a;return t?je(r.toString(),t)||s&&je(r.pathname,t):s}else{const r=!!e.match(/^\/(?!\/)/);return t?je(e,t):r}}function Si(e,t,n,r,a,s){const i=e.xhr,c=i?.[be];if(!i||i.__sentry_own_request__||!c)return;const{url:o,method:u}=c,d=z()&&t(o);if(e.endTimestamp){const W=i.__sentry_xhr_span_id__;if(!W)return;const G=r[W];G&&(d&&c.status_code!==void 0&&(Ln(G,c.status_code),G.end(),s?.(G,{headers:pr(ci(i)),error:e.error})),delete r[W]);return}const p=dr(o),m=at(p||o),l=oe(ka(o)),f=!!M(),h=d&&f?_e({name:`${u} ${l}`,attributes:{url:oe(o),type:"xhr","http.method":u,"http.url":p?oe(p):void 0,"server.address":m?.host,[N]:"auto.http.browser",[re]:"http.client",...m?.search&&{"http.query":m?.search},...m?.hash&&{"http.fragment":m?.hash}}}):new ae;i.__sentry_xhr_span_id__=h.spanContext().spanId,r[i.__sentry_xhr_span_id__]=h,n(o)&&Ti(i,z()&&f?h:void 0,a);const _=D();return _&&_.emit("beforeOutgoingRequestSpan",h,e),h}function Ti(e,t,n){const{"sentry-trace":r,baggage:a,traceparent:s}=Gn({span:t,propagateTraceparent:n});r&&yi(e,r,a,s)}function yi(e,t,n,r){const a=e.__sentry_xhr_v3__?.request_headers;if(!(a?.["sentry-trace"]||!e.setRequestHeader))try{if(e.setRequestHeader("sentry-trace",t),r&&!a?.traceparent&&e.setRequestHeader("traceparent",r),n){const s=a?.baggage;(!s||!mi(s))&&e.setRequestHeader("baggage",n)}}catch{}}function Ei(){P.document?P.document.addEventListener("visibilitychange",()=>{const e=M();if(!e)return;const t=O(e);if(P.document.hidden&&t){const n="cancelled",{op:r,status:a}=b(t);Z&&g.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),a||t.setStatus({code:le,message:n}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Z&&g.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const bi=3600,lr="sentry_previous_trace",Ii="sentry.previous_trace";function vi(e,{linkPreviousTrace:t,consistentTraceSampling:n}){const r=t==="session-storage";let a=r?wi():void 0;e.on("spanStart",i=>{if(O(i)!==i)return;const c=w().getPropagationContext();a=Ri(a,i,c),r&&Ni(a)});let s=!0;n&&e.on("beforeSampling",i=>{if(!a)return;const c=w(),o=c.getPropagationContext();if(s&&o.parentSpanId){s=!1;return}c.setPropagationContext({...o,dsc:{...o.dsc,sample_rate:String(a.sampleRate),sampled:String(Ft(a.spanContext))},sampleRand:a.sampleRand}),i.parentSampled=Ft(a.spanContext),i.parentSampleRate=a.sampleRate,i.spanAttributes={...i.spanAttributes,[Kr]:a.sampleRate}})}function Ri(e,t,n){const r=b(t);function a(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[kn])}catch{return 0}}const s={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:a(),sampleRand:n.sampleRand};if(!e)return s;const i=e.spanContext;return i.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=bi&&(Z&&g.log(`Adding previous_trace \`${JSON.stringify(i)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:i,attributes:{[Qr]:"previous_trace"}}),t.setAttribute(Ii,`${i.traceId}-${i.spanId}-${Ft(i)?1:0}`)),s)}function Ni(e){try{P.sessionStorage.setItem(lr,JSON.stringify(e))}catch(t){Z&&g.warn("Could not store previous trace in sessionStorage",t)}}function wi(){try{const e=P.sessionStorage?.getItem(lr);return JSON.parse(e)}catch{return}}function Ft(e){return e.traceFlags===1}const Ai="BrowserTracing",Pi=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function Ci(){const e=P.navigator;return e?.userAgent?Pi.test(e.userAgent):!1}const ki={...Xe,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,enableElementTiming:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...fr},Qi=(e={})=>{const t={name:void 0,source:void 0},n=P.document,{enableInp:r,enableElementTiming:a,enableLongTask:s,enableLongAnimationFrame:i,_experiments:{enableInteractions:c,enableStandaloneClsSpans:o,enableStandaloneLcpSpans:u},beforeStartSpan:d,idleTimeout:p,finalTimeout:m,childSpanTimeout:l,markBackgroundSpan:f,traceFetch:h,traceXHR:_,trackFetchStreamPerformance:W,shouldCreateSpanForRequest:G,enableHTTPTimings:Ue,ignoreResourceSpans:yt,ignorePerformanceApiSpans:Et,instrumentPageLoad:Fe,instrumentNavigation:T,detectRedirects:A,linkPreviousTrace:ue,consistentTraceSampling:$e,enableReportPageLoaded:V,onRequestSpanStart:ye,onRequestSpanEnd:K}={...ki,...e},C=Ci();let de,ee,Y;function j(y,v,E=!0){const k=v.op==="pageload",te=v.name,B=d?d(v):v,ie=B.attributes||{};if(te!==B.name&&(ie[$]="custom",B.attributes=ie),!E){const Ee=Hn();_e({...B,startTime:Ee}).end(Ee);return}t.name=B.name,t.source=ie[$];const Q=Bn(B,{idleTimeout:p,finalTimeout:m,childSpanTimeout:l,disableAutoFinish:k,beforeSpanEnd:Ee=>{de?.(),qs(Ee,{recordClsOnPageloadSpan:!o,recordLcpOnPageloadSpan:!u,ignoreResourceSpans:yt,ignorePerformanceApiSpans:Et}),yn(y,void 0);const Qt=w(),yr=Qt.getPropagationContext();Qt.setPropagationContext({...yr,traceId:Q.spanContext().traceId,sampled:ft(Q),dsc:ce(Ee)}),k&&(Y=void 0)},trimIdleSpanEndTimestamp:!V});k&&V&&(Y=Q),yn(y,Q);function Kt(){n&&["interactive","complete"].includes(n.readyState)&&y.emit("idleSpanEnableAutoFinish",Q)}k&&!V&&n&&(n.addEventListener("readystatechange",()=>{Kt()}),Kt())}return{name:Ai,setup(y){if(C){Z&&g.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}if(aa(),de=xs({recordClsStandaloneSpans:o||!1,recordLcpStandaloneSpans:u||!1,client:y}),r&&di(),a&&ei(),i&&L.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?Ds():s&&Os(),c&&Us(),A&&n){const E=()=>{ee=H()};addEventListener("click",E,{capture:!0}),addEventListener("keydown",E,{capture:!0,passive:!0})}function v(){const E=Pe(y);E&&!b(E).timestamp&&(Z&&g.log(`[Tracing] Finishing current active span with op: ${b(E).op}`),E.setAttribute(we,"cancelled"),E.end())}y.on("startNavigationSpan",(E,k)=>{if(D()!==y)return;if(k?.isRedirect){Z&&g.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),j(y,{op:"navigation.redirect",...E},!1);return}ee=void 0,v(),Pn().setPropagationContext({traceId:nt(),sampleRand:Math.random(),propagationSpanId:z()?void 0:Ie()});const te=w();te.setPropagationContext({traceId:nt(),sampleRand:Math.random(),propagationSpanId:z()?void 0:Ie()}),te.setSDKProcessingMetadata({normalizedRequest:void 0}),j(y,{op:"navigation",...E,parentSpan:null,forceTransaction:!0})}),y.on("startPageLoadSpan",(E,k={})=>{if(D()!==y)return;v();const te=k.sentryTrace||Sn("sentry-trace")||Tn("sentry-trace"),B=k.baggage||Sn("baggage")||Tn("baggage"),ie=Zr(te,B),Q=w();Q.setPropagationContext(ie),z()||(Q.getPropagationContext().propagationSpanId=Ie()),Q.setSDKProcessingMetadata({normalizedRequest:jn()}),j(y,{op:"pageload",...E})}),y.on("endPageloadSpan",()=>{V&&Y&&(Y.setAttribute(we,"reportPageLoaded"),Y.end())})},afterAllSetup(y){if(C)return;let v=Wt();if(ue!=="off"&&vi(y,{linkPreviousTrace:ue,consistentTraceSampling:$e}),P.location){if(Fe){const E=U();mr(y,{name:P.location.pathname,startTime:E?E/1e3:void 0,attributes:{[$]:"url",[N]:"auto.pageload.browser"}})}T&&ni(({to:E,from:k})=>{if(k===void 0&&v?.indexOf(E)!==-1){v=void 0;return}v=void 0;const te=Wn(E),B=Pe(y),ie=B&&A&&Hi(B,ee);gr(y,{name:te?.pathname||P.location.pathname,attributes:{[$]:"url",[N]:"auto.navigation.browser"}},{url:E,isRedirect:ie})})}f&&Ei(),c&&Li(y,p,m,l,t),r&&li(),hi(y,{traceFetch:h,traceXHR:_,trackFetchStreamPerformance:W,tracePropagationTargets:y.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:G,enableHTTPTimings:Ue,onRequestSpanStart:ye,onRequestSpanEnd:K})}}};function mr(e,t,n){e.emit("startPageLoadSpan",t,n),w().setTransactionName(t.name);const r=Pe(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function gr(e,t,n){const{url:r,isRedirect:a}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:a}),e.emit("startNavigationSpan",t,{isRedirect:a});const s=w();return s.setTransactionName(t.name),r&&!a&&s.setSDKProcessingMetadata({normalizedRequest:{...jn(),url:r}}),Pe(e)}function Sn(e){return P.document?.querySelector(`meta[name=${e}]`)?.getAttribute("content")||void 0}function Tn(e){return P.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===e)?.description}function Li(e,t,n,r,a){const s=P.document;let i;const c=()=>{const o="ui.action.click",u=Pe(e);if(u){const d=b(u).op;if(["navigation","pageload"].includes(d)){Z&&g.warn(`[Tracing] Did not create ${o} span because a pageload or navigation span is in progress.`);return}}if(i&&(i.setAttribute(we,"interactionInterrupted"),i.end(),i=void 0),!a.name){Z&&g.warn(`[Tracing] Did not create ${o} transaction because _latestRouteName is missing.`);return}i=Bn({name:a.name,op:o,attributes:{[$]:a.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r})};s&&addEventListener("click",c,{capture:!0})}const hr="_sentry_idleSpan";function Pe(e){return e[hr]}function yn(e,t){rt(e,hr,t)}const En=1.5;function Hi(e,t){const n=b(e),r=Hn(),a=n.start_timestamp;return!(r-a>En||t&&r-t<=En)}const kt=L;let Lt=null,bn;const et=new Map,tt=new Map;function In(e){const t=e.split("/").filter(Boolean);let n=0;for(const r of t)r.startsWith(":")&&(r.substring(1).endsWith("*")?n+=100:n+=10);return n}function Mi(e){if(et.has(e))return et.get(e)??null;try{const t=new RegExp(e);return et.set(e,t),t}catch(t){return jt&&g.warn("Could not compile regex",{regexString:e,error:t}),null}}function _r(){if(!kt?._sentryRemixRouteManifest||typeof kt._sentryRemixRouteManifest!="string")return null;const e=kt._sentryRemixRouteManifest;if(Lt&&bn===e)return Lt;et.clear(),tt.clear();let t={staticRoutes:[],dynamicRoutes:[]};try{return t=JSON.parse(e),!Array.isArray(t.staticRoutes)||!Array.isArray(t.dynamicRoutes)?null:(Lt=t,bn=e,t)}catch{return jt&&g.warn("Could not extract route manifest"),null}}function xi(e,t,n){const r=[];if(t.some(a=>a.path===e))return r;for(const a of n)a.regex&&Mi(a.regex)?.test(e)&&r.push(a.path);return r}function Oi(){return _r()!==null}const Sr=e=>{const t=_r();if(!t)return;if(tt.has(e))return tt.get(e);const{staticRoutes:n,dynamicRoutes:r}=t,s=xi(e,n,r).sort((i,c)=>In(i)-In(c))[0];return tt.set(e,s),s};let Ne,dt,pt,$t;function Di(){if(P.location)return P.location.pathname}function Tr(e,t){const n=e?Sr(e):void 0;return n?{name:n,source:"route"}:Oi()?{name:e||t,source:"url"}:{name:t,source:"route"}}function Zi(e){const t=Di();if(!t)return;const n=Sr(t),r=n||t,a=n?"route":"url",s={name:r,op:"pageload",attributes:{[N]:"auto.pageload.remix",[$]:a}};mr(e,s)}function Ui(e,t){const n=e[e.length-1],r=D();if(!r||!n)return;const{name:a,source:s}=Tr(t.pathname,n.id),i={name:a,op:"navigation",attributes:{[N]:"auto.navigation.remix",[$]:s}};gr(r,i)}function eo(e,t,n,r,a){return i=>{if(Fi({useEffect:t,useLocation:n,useMatches:r,instrumentNavigation:!0}),!Ne||!dt||!pt)return jt&&!Yn()&&g.warn("Remix SDK was unable to wrap your root because of one or more missing parameters."),Zt.createElement(e,{...i});let c=!1;const o=dt(),u=pt();return Ne(()=>{const d=u?.[u.length-1];if(d){const{name:p,source:m}=Tr(o.pathname,d.id);w().setTransactionName(p);const l=M();if(l){const f=O(l);f&&(f.updateName(p),f.setAttribute($,m))}}c=!0},[]),Ne(()=>{const d=M();if(c){d&&d.end();return}$t&&u?.length&&(d&&d.end(),Ui(u,o))},[o]),c=!1,Zt.createElement(e,{...i})}}function Fi({useEffect:e,useLocation:t,useMatches:n,instrumentNavigation:r}){Ne=e||Ne,dt=t||dt,pt=n||pt,$t=r??$t}export{oe as A,jn as B,Qi as C,_t as D,Zi as E,Fi as F,eo as G,be as S,P as W,ji as a,Ji as b,Gt as c,Wi as d,Gi as e,ia as f,Yi as g,zi as h,Mn as i,ge as j,Xi as k,S as l,he as m,ln as n,si as o,Wa as p,ni as q,qi as r,Vi as s,J as t,at as u,Z as v,Za as w,ea as x,Ki as y,na as z}; //# sourceMappingURL=performance-B_Iye7TF.js.map //# debugId=eb535f1a-786f-5081-ac45-ead2beadfd9a