- dev/betrieb/deploy.sh: Deploy nur per Tag, mit --seed (Seeder im Wartungsmodus) und --initial (Vorschau/Live einmalig an Ort und Stelle auf Git umstellen) - dev/betrieb/vorschau-auffrischen.sh: Live-DB und Live-Medien in die Vorschau (Generalprobe) - InteriorReleaseSeeder: alle Inhaltsschritte des Relaunchs in einem Lauf, idempotent; Displays, Playlists und Mediathek bleiben unberührt - DisplayInteriorBrandingSeeder überschreibt keinen inzwischen gepflegten Claim mehr - Monitoring: GlitchTip (Server + Browser), /health mit Token, Scheduler-Herzschlag, Alarme per Mail und ntfy, Version in about und /health - public/build versioniert; .gitignore: macOS-Muster Icon traf resources/views/flux/icon/ - Runbook: dev/betrieb/README.md Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
15 lines
91 KiB
JavaScript
15 lines
91 KiB
JavaScript
const m=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,_=globalThis,W="11.6.0";function rt(){return gt(_),_}function gt(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||W,e[W]=e[W]||{}}function st(t,e,n=_){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[W]=r[W]||{};return s[t]||(s[t]=e())}const Nn=["debug","info","warn","error","log","assert","trace"],Mr="Sentry Logger ",Ot={};function j(t){if(!("console"in _))return t();const e=_.console,n={},r=Object.keys(Ot);r.forEach(s=>{const o=Ot[s];n[s]=e[s],e[s]=o});try{return t()}finally{r.forEach(s=>{e[s]=n[s]})}}function $r(){me().enabled=!0}function Fr(){me().enabled=!1}function Cn(){return me().enabled}function jr(...t){he("log",...t)}function Br(...t){he("warn",...t)}function Ur(...t){he("error",...t)}function he(t,...e){m&&Cn()&&j(()=>{_.console[t](`${Mr}[${t}]:`,...e)})}function me(){return m?st("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const h={enable:$r,disable:Fr,isEnabled:Cn,log:jr,warn:Br,error:Ur},An=50,q="?",Re=/\(error: (.*)\)/,Oe=/captureMessage|captureException/;function xn(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const o=[],i=n.split(`
|
|
`);for(let a=r;a<i.length;a++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));const u=Re.test(c)?c.replace(Re,"$1"):c;if(!u.includes("Error: ")){for(const f of e){const l=f(u);if(l){o.push(l);break}}if(o.length>=An+s)break}}return Wr(o.slice(s))}}function Hr(t){return Array.isArray(t)?xn(...t):t}function Wr(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(vt(e).function||"")&&e.pop(),e.reverse(),Oe.test(vt(e).function||"")&&(e.pop(),Oe.test(vt(e).function||"")&&e.pop()),e.slice(0,An).map(n=>({...n,filename:n.filename||vt(e).filename,function:n.function||q}))}function vt(t){return t[t.length-1]||{}}const jt="<anonymous>";function $(t){try{return!t||typeof t!="function"?jt:t.name||jt}catch{return jt}}function Ne(t){const e=t.exception;if(e){const n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}const ft={},Ce={};function z(t,e){return ft[t]=ft[t]||[],ft[t].push(e),()=>{const n=ft[t];if(n){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}}function Y(t,e){if(!Ce[t]){Ce[t]=!0;try{e()}catch(n){m&&h.error(`Error while instrumenting ${t}`,n)}}}function w(t,e){const n=t&&ft[t];if(n)for(const r of n)try{r(e)}catch(s){m&&h.error(`Error while triggering instrumentation handler.
|
|
Type: ${t}
|
|
Name: ${$(r)}
|
|
Error:`,s)}}let Bt=null;function qr(t){const e="error";z(e,t),Y(e,Gr)}function Gr(){Bt=_.onerror,_.onerror=function(t,e,n,r,s){return w("error",{column:r,error:s,line:n,msg:t,url:e}),Bt?Bt.apply(this,arguments):!1},_.onerror.__SENTRY_INSTRUMENTED__=!0}let Ut=null;function zr(t){const e="unhandledrejection";z(e,t),Y(e,Yr)}function Yr(){Ut=_.onunhandledrejection,_.onunhandledrejection=function(t){return w("unhandledrejection",t),Ut?Ut.apply(this,arguments):!0},_.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const Dn=Object.prototype.toString;function D(t){switch(Dn.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return _e(t,Error)}}function ot(t,e){return Dn.call(t)===`[object ${e}]`}function Ln(t){return ot(t,"ErrorEvent")}function Ae(t){return ot(t,"DOMError")}function Kr(t){return ot(t,"DOMException")}function x(t){return ot(t,"String")}function ge(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function it(t){return t===null||ge(t)||typeof t!="object"&&typeof t!="function"}function Nt(t){return ot(t,"Object")}function xt(t){return typeof t=="object"&&t!==null}function Dt(t){return typeof Event<"u"&&_e(t,Event)}function Vr(t){return ot(t,"RegExp")}function at(t){return!!(t!=null&&t.then&&typeof t.then=="function")}function _e(t,e){try{return t instanceof e}catch{return!1}}function Pn(t){return typeof Request<"u"&&_e(t,Request)}function T(t,e,n){if(!(e in t))return;const r=t[e];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&Mn(s,r);try{t[e]=s}catch{m&&h.log(`Failed to replace method "${e}" in object`,t)}}function F(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{m&&h.log(`Failed to add non-enumerable property "${String(e)}" to object`,t)}}function Mn(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,F(t,"__sentry_original__",e)}catch{}}function ye(t){return t.__sentry_original__}function $n(t){if(D(t))return{message:t.message,name:t.name,stack:t.stack,...xe(t)};if(Dt(t)){const{type:e,target:n,currentTarget:r,detail:s}=t;return{type:e,target:n,currentTarget:r,...s?{detail:s}:{},...xe(t)}}return t}function xe(t){return xt(t)?Object.fromEntries(Object.entries(t)):{}}function Xr(t){const e=Object.keys($n(t));return e.sort(),e[0]?e.join(", "):"[object has no keys]"}let J;function pt(t){if(J!==void 0)return J?J(t):t();const e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=_;return e in n&&typeof n[e]=="function"?(J=n[e],J(t)):(J=null,t())}function Ee(){return pt(()=>Math.random())}function K(){return pt(()=>Date.now())}const Jr=Symbol.for("sentry.skipNormalization"),Qr=Symbol.for("sentry.overrideNormalizationDepth");function Zr(t){return!!t[Jr]}function ts(t){const e=t[Qr];return typeof e=="number"?e:void 0}let Kt;function es(t){Kt=t}function A(t,e=100,n=1/0){try{return Vt("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Fn(t,e=3,n=100*1024){const r=A(t,e);return ss(r)>n?Fn(t,e-1,n):r}function Vt(t,e,n=1/0,r=1/0,s=os()){const[o,i]=s;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const a=jn(t,e);if(!a.startsWith("[object "))return a;if(Zr(e))return e;const c=ts(e),u=c!==void 0?c:n;if(u===0)return a.replace("object ","");if(o(e))return"[Circular ~]";const f=e;if(f&&typeof f.toJSON=="function")try{const p=f.toJSON();return Vt("",p,u-1,r,s)}catch{}const l=Array.isArray(e)?[]:{};let d=0;const g=$n(e);for(const p in g){if(!Object.prototype.hasOwnProperty.call(g,p))continue;if(d>=r){l[p]="[MaxProperties ~]";break}const I=g[p];l[p]=Vt(p,I,u-1,r,s),d++}return i(e),l}function jn(t,e){try{if(Kt){const r=Kt(e);if(r)return r}return typeof global<"u"&&e===global?"[Global]":typeof e=="number"&&!Number.isFinite(e)?`[${e}]`:typeof e=="function"?`[Function: ${$(e)}]`:typeof e=="symbol"?`[${String(e)}]`:typeof e=="bigint"?`[BigInt: ${String(e)}]`:`[object ${ns(e)}]`}catch(n){return`**non-serializable** (${n})`}}function ns(t){const e=Object.getPrototypeOf(t);return e!=null&&e.constructor?e.constructor.name:"null prototype"}function rs(t){return~-encodeURI(t).split(/%..|./).length}function ss(t){return rs(JSON.stringify(t))}function os(){const t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function Xt(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function is(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const s=t[r];it(s)?n.push(String(s)):s instanceof Error?n.push(s.message?`${s.name}: ${s.message}`:s.name):n.push(jn(void 0,s))}return n.join(e)}function dt(t,e,n=!1){return x(t)?Vr(e)?e.test(t):x(e)?n?t===e:t.includes(e):typeof e=="function"?e(t):!1:!1}function _t(t,e=[],n=!1){for(const r of e)if(dt(t,r,n))return!0;return!1}function as(){const t=_;return t.crypto||t.msCrypto}let Ht;function cs(){return Ee()*16}function k(t=as()){try{if(t!=null&&t.randomUUID)return pt(()=>t.randomUUID()).replace(/-/g,"")}catch{}return Ht||(Ht="10000000100040008000"+1e11),Ht.replace(/[018]/g,e=>(e^(cs()&15)>>e/4).toString(16))}function Bn(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)==null?void 0:n[0]}function H(t){const{message:e,event_id:n}=t;if(e)return e;const r=Bn(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Jt(t,e,n){const r=t.exception=t.exception||{},s=r.values=r.values||[],o=s[0]=s[0]||{};o.value||(o.value=e||""),o.type||(o.type="Error")}function Z(t,e){const n=Bn(t);n&&Un(n,e)}function us(t,e){var s;const n=(s=t.exception)==null?void 0:s.values,r=(n==null?void 0:n.find(o=>{var i;return((i=o.mechanism)==null?void 0:i.exception_id)===0}))??(n==null?void 0:n[0]);r&&Un(r,e)}function Un(t,e){const n={type:"generic",handled:!0},r=t.mechanism;t.mechanism={...n,...r,...e},e&&"data"in e&&(t.mechanism.data={...r==null?void 0:r.data,...e.data})}function De(t){if(fs(t))return!0;try{F(t,"__sentry_captured__",!0)}catch{}return!1}function fs(t){try{return t.__sentry_captured__}catch{}}const Hn=1e3,ls=1e3,ds=100;function yt(){return K()/Hn}let Q=[];function ps(){const{performance:t}=_;if(!(t!=null&&t.now)||!t.timeOrigin)return t!=null&&t.now&&(Q=[{from:0,origin:K()-pt(()=>t.now())}]),yt;let e=t.timeOrigin;Q=[{from:0,origin:e}];let n=!0,r=0;return()=>pt(()=>{const s=t.now(),o=Date.now();return Math.abs(e+s-o)>ls&&(e=o-s,n?Q=[{from:0,origin:e}]:(Q.push({from:r,origin:e}),Q.length>ds&&Q.splice(1,1))),n=!1,r=s,(e+s)/Hn})}let Le;function R(){return(Le??(Le=ps()))()}function hs(t){const e=R(),n={sid:k(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>gs(n)};return t&&tt(n,t),n}function tt(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||R(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:k()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function ms(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),tt(t,n)}function gs(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function Et(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;const r={...t};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=Et(r[s],e[s],n-1));return r}function _s(){return k()}function Wn(){return k().substring(16)}const ys=100;class O{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},F(this,"refs",{}),this._propagationContext={traceId:_s(),sampleRand:Ee()}}clone(){const e=new O;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,e.refs={...this.refs},e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&tt(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this.setTags({[e]:n})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,n){return this.setAttributes({[e]:n})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e,r=n instanceof O?n.getScopeData():Nt(n)?e:void 0,{tags:s,attributes:o,extra:i,user:a,contexts:c,level:u,fingerprint:f=[],propagationContext:l,conversationId:d}=r||{};return this._tags={...this._tags,...s},this._attributes={...this._attributes,...o},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),f.length&&(this._fingerprint=f),l&&(this._propagationContext=l),d&&(this._conversationId=d),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:ys;if(r<=0)return this;const s={timestamp:yt(),...e,message:e.message?Xt(e.message,2048):e.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=Et(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=(n==null?void 0:n.event_id)||k();if(!this._client)return m&&h.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:s,...n,event_id:r},this),r}captureMessage(e,n,r){const s=(r==null?void 0:r.event_id)||k();if(!this._client)return m&&h.warn("No client configured on scope - will not capture message!"),s;const o=(r==null?void 0:r.syntheticException)??new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:o,...r,event_id:s},this),s}captureEvent(e,n){const r=e.event_id||(n==null?void 0:n.event_id)||k();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(m&&h.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function Es(){return st("defaultCurrentScope",()=>new O)}function Ss(){return st("defaultIsolationScope",()=>new O)}const Pe="__SENTRY_SUPPRESS_TRACING__",Me=t=>t instanceof Promise&&!t[qn],qn=Symbol("chained PromiseLike"),bs=(t,e,n)=>{const r=t.then(s=>(e(s),s),s=>{throw n(s),s});return Me(r)&&Me(t)?r:vs(t,r)},vs=(t,e)=>{if(!e)return t;let n=!1;for(const r in t){if(r in e)continue;n=!0;const s=t[r];typeof s=="function"?Object.defineProperty(e,r,{value:(...o)=>s.apply(t,o),enumerable:!0,configurable:!0,writable:!0}):e[r]=s}return n&&Object.assign(e,{[qn]:!0}),e};class Is{constructor(e,n){let r;e?r=e:r=new O;let s;n?s=n:s=new O,this._stack=[{scope:r}],this._isolationScope=s}withScope(e){const n=this._pushScope();let r;try{r=e(n)}catch(s){throw this._popScope(),s}return at(r)?bs(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function et(){const t=rt(),e=gt(t);return e.stack=e.stack||new Is(Es(),Ss())}function Gn(t){return et().withScope(t)}function Ts(t,e){const n=et();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function $e(t){return et().withScope(()=>t(et().getIsolationScope()))}function ks(){return{suppressTracing:ws,withIsolationScope:$e,withScope:Gn,withSetScope:Ts,withSetIsolationScope:(t,e)=>$e(e),getCurrentScope:()=>et().getScope(),getIsolationScope:()=>et().getIsolationScope()}}function ws(t){return Gn(e=>{e.setSDKProcessingMetadata({[Pe]:!0});const n=t();return e.setSDKProcessingMetadata({[Pe]:void 0}),n})}function Lt(t){const e=gt(t);return e.acs?e.acs:ks()}function Rs(t){return typeof t=="object"&&t!=null&&!Array.isArray(t)&&Object.keys(t).includes("value")}function Os(t,e){const{value:n,unit:r}=Rs(t)?t:{value:t,unit:void 0},s=Ns(n),o=r&&typeof r=="string"?{unit:r}:{};if(s)return{...s,...o};if(!e||e==="skip-undefined"&&n===void 0)return;let i="";try{i=JSON.stringify(n)??""}catch{}return{value:i,type:"string",...o}}function Fe(t,e=!1){const n={};for(const[r,s]of Object.entries(t??{})){const o=Os(s,e);o&&(n[r]=o)}return n}function Ns(t){if(Array.isArray(t))return{value:t,type:"array"};const e=typeof t=="string"?"string":typeof t=="boolean"?"boolean":typeof t=="number"&&!Number.isNaN(t)?Number.isInteger(t)?"integer":"double":null;if(e)return{value:t,type:e}}function zn(){var t,e;return(e=(t=gt(rt())).externalPropagationContextProvider)==null?void 0:e.call(t)}function N(){const t=rt();return Lt(t).getCurrentScope()}function L(){const t=rt();return Lt(t).getIsolationScope()}function Cs(){return st("globalScope",()=>new O)}function As(...t){const e=rt(),n=Lt(e);if(t.length===2){const[r,s]=t;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(t[0])}function S(){return N().getClient()}function Yn(t){const e=zn();if(e)return{trace_id:e.traceId,span_id:e.spanId};const n=t.getPropagationContext(),{traceId:r,parentSpanId:s,propagationSpanId:o}=n,i={trace_id:r,span_id:o||Wn()};return s&&(i.parent_span_id=s),i}const xs="gen_ai.conversation.id",Ds="http.request.header",Kn="sentry.exclusive_time",Ls="sentry.is_localhost",Vn="sentry.op",Ps="sentry.origin",Xn="sentry.profile_id",Ms="sentry.segment.name.source",$s="url.full",Fs="user_agent.original",js="sentry.sample_rate",Bs="sentry.previous_trace_sample_rate",Us=["ok","deadline_exceeded","unauthenticated","permission_denied","not_found","resource_exhausted","invalid_argument","unimplemented","unavailable","internal_error","unknown_error","cancelled","already_exists","failed_precondition","aborted","out_of_range","data_loss"],Hs=0,Ws=1;function qs(t){return t!=="ok"&&Us.includes(t)}function Jn(t){if(t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch{return}return t}}const Gs="_sentryScope",zs="_sentryIsolationScope";function Qt(t){const e=t;return{scope:e[Gs],isolationScope:Jn(e[zs])}}const je="sentry-";function Ys(t){const e=Ks(t);if(!e)return;const n=Object.entries(e).reduce((r,[s,o])=>{if(s.startsWith(je)){const i=s.slice(je.length);r[i]=o}return r},{});if(Object.keys(n).length>0)return n}function Ks(t){if(!(!t||!x(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{const r=Be(n);return Object.entries(r).forEach(([s,o])=>{e[s]=o}),e},{}):Be(t)}function Be(t){return t.split(",").map(e=>{const n=e.indexOf("=");if(n===-1)return[];const r=e.slice(0,n),s=e.slice(n+1);return[r,s].map(o=>{try{return decodeURIComponent(o.trim())}catch{return}})}).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}const Vs=/^o(\d+)\./,Xs=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Js(t){return t==="http"||t==="https"}function St(t,e=!1){const{host:n,path:r,pass:s,port:o,projectId:i,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${i}`}function Qs(t){const e=Xs.exec(t);if(!e){j(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,s="",o="",i="",a=""]=e.slice(1);let c="",u=a;const f=u.split("/");if(f.length>1&&(c=f.slice(0,-1).join("/"),u=f.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return Qn({host:o,pass:s,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function Qn(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Zs(t){if(!m)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(i=>t[i]?!1:(h.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?Js(r)?e&&isNaN(parseInt(e,10))?(h.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(h.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(h.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function to(t){const e=t.match(Vs);return e==null?void 0:e[1]}function eo(t){const e=t.getOptions(),{host:n}=t.getDsn()||{};let r;return e.orgId?r=String(e.orgId):n&&(r=to(n)),r}function no(t){const e=typeof t=="string"?Qs(t):Qn(t);if(!(!e||!Zs(e)))return e}function ro(t){if(typeof t=="boolean")return Number(t);const e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}const so="span";function oo(t){return Jn(t.refs[so])}const Zn=1;function io(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext(),s=r?e:Pt(t).parent_span_id,o=Qt(t).scope,i=r?(o==null?void 0:o.getPropagationContext().propagationSpanId)||Wn():e;return{parent_span_id:s,span_id:i,trace_id:n}}function ao(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...s},attributes:o})=>({span_id:e,trace_id:n,sampled:r===Zn,attributes:o,...s}))}function Ue(t){return typeof t=="number"?He(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?He(t.getTime()):R()}function He(t){return t>9999999999?t/1e3:t}function Pt(t){if(lo(t))return t.getStaticSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if(fo(t)){const{attributes:r,startTime:s,name:o,endTime:i,status:a,links:c}=t;return{span_id:e,trace_id:n,data:r,description:o,parent_span_id:co(t),start_timestamp:Ue(s),timestamp:Ue(i)||void 0,status:ho(a),op:r[Vn],origin:r[Ps],links:ao(c)}}return{span_id:e,trace_id:n,start_timestamp:0,status:"ok",data:{}}}function co(t){var e;return"parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?(e=t.parentSpanContext)==null?void 0:e.spanId:void 0}function uo(t){var e;return{...t,end_timestamp:t.end_timestamp??t.start_timestamp,attributes:Fe(t.attributes),links:(e=t.links)==null?void 0:e.map(n=>({...n,attributes:Fe(n.attributes)}))}}function fo(t){const e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function lo(t){return typeof t.getSpanJSON=="function"}function po(t){const{traceFlags:e}=t.spanContext();return e===Zn}function ho(t){return!t||t.code===Hs||t.code===Ws?"ok":t.message&&qs(t.message)?t.message:"internal_error"}const mo="_sentryRootSpan",tr=go;function go(t){return t[mo]||t}function _o(t){const e=rt(),n=Lt(e);return n.getActiveSpan?n.getActiveSpan(t):oo(t||N())}function We(t){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=t||((n=S())==null?void 0:n.getOptions());return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}function qe(t){h.log(`Ignoring span ${t.op} - ${t.description} because it matches \`ignoreSpans\`.`)}function Ge(t,e){if(!(e!=null&&e.length))return!1;for(const n of e){if(So(n)){if(t.description&&dt(t.description,n))return m&&qe(t),!0;continue}const r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;const s=n.name?t.description&&dt(t.description,n.name):!0,o=n.op?t.op&&dt(t.op,n.op):!0,i=n.attributes?Object.entries(n.attributes).every(([a,c])=>{var u;return yo((u=t.attributes)==null?void 0:u[a],c)}):!0;if(s&&o&&i)return m&&qe(t),!0}return!1}function yo(t,e){return typeof t=="string"&&(typeof e=="string"||e instanceof RegExp)?dt(t,e):Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t===e}function Eo(t,e){const n=e.parent_span_id,r=e.span_id;if(n)for(const s of t)s.parent_span_id===r&&(s.parent_span_id=n)}function So(t){return typeof t=="string"||t instanceof RegExp}const ze=[];function bo(t){const e={};return t.forEach(n=>{const{name:r}=n,s=e[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function vo(t){const e=t.defaultIntegrations||[],n=t.integrations;e.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){const s=n(e);r=Array.isArray(s)?s:[s]}else r=e;return bo(r)}function Io(t,e){const n={};return e.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(t)}),e.forEach(r=>{r&&er(t,r,n)}),n}function Ye(t,e){for(const n of e)n!=null&&n.afterAllSetup&&n.afterAllSetup(t)}function er(t,e,n){if(n[e.name]){m&&h.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,!ze.includes(e.name)&&typeof e.setupOnce=="function"&&(e.setupOnce(),ze.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(s,o)=>r(s,o,t))}if(typeof e.processEvent=="function"){const r=e.processEvent.bind(e),s=Object.assign((o,i)=>r(o,i,t),{id:e.name});t.addEventProcessor(s)}["processSpan","processSegmentSpan"].forEach(r=>{const s=e[r];typeof s=="function"&&t.on(r,o=>s.call(e,o,t))}),m&&h.log(`Integration installed: ${e.name}`)}const Se="production",To=Symbol.for("sentry.nonRecordingSpan");function ko(t){return!!t&&t[To]===!0}const wo="_frozenDsc";function nr(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},s={environment:n.environment||Se,release:n.release,public_key:r,trace_id:t,org_id:eo(e)};return e.emit("createDsc",s),s}function rr(t,e){if(zn())return;const n=e.getPropagationContext();return n.dsc||nr(n.traceId,t)}function Ro(t){var V;const e=S();if(!e)return{};const n=tr(t),r=Pt(n),s=r.data,o=n.spanContext().traceState,i=(o==null?void 0:o.get("sentry.sample_rate"))??s[js]??s[Bs];function a(b){return(typeof i=="number"||typeof i=="string")&&(b.sample_rate=`${i}`),b}const c=n[wo];if(c)return a(c);const u=ko(n),f=u&&n.dropReason==="ignored";if(u&&(!We(e.getOptions())||f)){const b=Qt(n).scope,B=b&&rr(e,b);if(B){const X={...B};return f&&(X.sampled="false"),a(X)}}const l=o==null?void 0:o.get("sentry.dsc"),d=l&&Ys(l);if(d)return a(d);const g=nr(t.spanContext().traceId,e),p=s[Ms],I=r.description;return p!=="url"&&I&&(g.transaction=I),We()&&(g.sampled=String(po(n)),g.sample_rand=(o==null?void 0:o.get("sentry.sample_rand"))??((V=Qt(n).scope)==null?void 0:V.getPropagationContext().sampleRand.toString())),a(g),e.emit("createDsc",g,n),g}function Oo(t,e){const{fingerprint:n,breadcrumbs:r,sdkProcessingMetadata:s}=e;No(t,e),Do(t,n),Co(t,r),Ao(t,s)}function Ke(t,e){const{extra:n,tags:r,attributes:s,user:o,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:f,eventProcessors:l,attachments:d,propagationContext:g,transactionName:p}=e;ut(t,"extra",n),ut(t,"tags",r),ut(t,"attributes",s),ut(t,"user",o),ut(t,"contexts",i),t.sdkProcessingMetadata=Et(t.sdkProcessingMetadata,c,2),a&&(t.level=a),p&&(t.transactionName=p),u.length&&(t.breadcrumbs=[...t.breadcrumbs,...u]),f.length&&(t.fingerprint=[...t.fingerprint,...f]),l.length&&(t.eventProcessors=[...t.eventProcessors,...l]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,...g}}function ut(t,e,n){t[e]=Et(t[e],n,1)}function sr(t,e){const n=Cs().getScopeData();return t&&Ke(n,t.getScopeData()),e&&Ke(n,e.getScopeData()),n}function No(t,e){const{extra:n,tags:r,user:s,contexts:o,level:i,transactionName:a}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(s).length&&(t.user={...s,...t.user}),Object.keys(o).length&&(t.contexts={...o,...t.contexts}),i&&(t.level=i),a&&t.type!=="transaction"&&(t.transaction=a)}function Co(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function Ao(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function xo(t,e){t.contexts={trace:io(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Ro(e),...t.sdkProcessingMetadata};const n=tr(e),r=Pt(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function Do(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}function ht(t,e,n){let r;try{r=e()}catch(s){return Ve(t,s,n)}return at(r)?r.then(void 0,s=>Ve(t,s,n)):r}function Ve(t,e,n){return m&&h.error(t,e),n(e)}function or(t){return!!t&&typeof t=="function"&&"_static"in t&&!!t._static}function Xe(t,e){return ht(m?"The `beforeSendSpan` callback threw an error, sending the span unmodified:":"",()=>e(t),()=>t)||t}function Lo(t){const e={trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,name:t.description||"",start_timestamp:t.start_timestamp,end_timestamp:t.timestamp,status:!t.status||t.status==="ok"||t.status==="cancelled"?"ok":"error",is_segment:!1,attributes:{...t.data},links:t.links};return uo(e)}function ir(t,e){const n=t.attributes??(t.attributes={});Object.entries(e).forEach(([r,s])=>{s!=null&&!(r in n)&&(n[r]=s)})}function Po(t){return t.getOptions().traceLifecycle==="stream"}function ar(t){return typeof t=="object"&&typeof t.unref=="function"&&t.unref(),t}function ct(t,e=[]){return[t,e]}function Je(t,e){const[n,r]=t;return[n,[...r,e]]}function Zt(t,e){const n=t[1];for(const r of n){const s=r[0].type;if(e(r,s))return!0}return!1}function Mo(t,e){return Zt(t,(n,r)=>e.includes(r))}function te(t){const e=gt(_);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function $o(t){const[e,n]=t;let r=JSON.stringify(e);function s(o){typeof r=="string"?r=typeof o=="string"?r+o:[te(r),o]:r.push(typeof o=="string"?te(o):o)}for(const o of n){const[i,a]=o;if(s(`
|
|
${JSON.stringify(i)}
|
|
`),typeof a=="string"||a instanceof Uint8Array)s(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(A(a))}s(c)}}return typeof r=="string"?r:Fo(r)}function Fo(t){const e=t.reduce((s,o)=>s+o.length,0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}function jo(t){const e=typeof t.data=="string"?te(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}const cr={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 Bo(t){return t in cr}function Qe(t){return Bo(t)?cr[t]:t}function ur(t){if(!(t!=null&&t.sdk))return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function Uo(t,e,n,r){var o;const s=(o=t.sdkProcessingMetadata)==null?void 0:o.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date(K()).toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:St(r)},...s&&{trace:s}}}function ee(t){return t==="replay_event"?"replay":t||"error"}function Ho(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Wo(){/*! __SENTRY_SDK_SOURCE__ */return"npm"}function qo(){return!Ho()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Mt(){return typeof window<"u"&&(!qo()||Go())}function Go(){const t=_.process;return(t==null?void 0:t.type)==="renderer"}function zo(t,e){const n=e.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:t.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,ingest_settings:Mt()?{infer_ip:n,infer_user_agent:n}:void 0,items:t}]}const Yo=new WeakMap;function Ko(t){return it(t)?void 0:t}function Vo(t,e,n){var a;const r=Ko(e.originalException),s=r&&Yo.get(r);if(!s)return;const o=(a=t.contexts)==null?void 0:a.trace;((o==null?void 0:o.trace_id)??(n&&Yn(n).trace_id))===s.trace_id&&(t.contexts={...t.contexts,trace:{...o,...s}})}function Xo(t,e){var r,s,o,i;if(!e)return t;const n=t.sdk||{};return t.sdk={...n,name:n.name||e.name,version:n.version||e.version,integrations:[...((r=t.sdk)==null?void 0:r.integrations)||[],...e.integrations||[]],packages:[...((s=t.sdk)==null?void 0:s.packages)||[],...e.packages||[]],settings:(o=t.sdk)!=null&&o.settings||e.settings?{...(i=t.sdk)==null?void 0:i.settings,...e.settings}:void 0},t}function Jo(t,e,n,r){const s=ur(n),o={sent_at:new Date(K()).toISOString(),...s&&{sdk:s},...!!r&&e&&{dsn:St(e)}},i="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return ct(o,[i])}function Qo(t,e,n,r){const s=ur(n),o=t.type&&t.type!=="replay_event"?t.type:"event";Xo(t,n==null?void 0:n.sdk);const i=Uo(t,s,r,e);return delete t.sdkProcessingMetadata,ct(i,[[{type:o},t]])}const Wt=0,Ze=1,tn=2;function bt(t){return new mt(e=>{e(t)})}function fr(t){return new mt((e,n)=>{n(t)})}class mt{constructor(e){this._state=Wt,this._handlers=[],this._runExecutor(e)}then(e,n){return new mt((r,s)=>{this._handlers.push([!1,o=>{if(!e)r(o);else try{r(e(o))}catch(i){s(i)}},o=>{if(!n)s(o);else try{r(n(o))}catch(i){s(i)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new mt((n,r)=>{let s,o;return this.then(i=>{o=!1,s=i,e&&e()},i=>{o=!0,s=i,e&&e()}).then(()=>{if(o){r(s);return}n(s)})})}_executeHandlers(){if(this._state===Wt)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Ze&&n[1](this._value),this._state===tn&&n[2](this._value),n[0]=!0)})}_runExecutor(e){const n=(o,i)=>{if(this._state===Wt){if(at(i)){i.then(r,s);return}this._state=o,this._value=i,this._executeHandlers()}},r=o=>{n(Ze,o)},s=o=>{n(tn,o)};try{e(r,s)}catch(o){s(o)}}}function Zo(t,e,n,r=0,s){try{const o=ne(e,n,t,r,s);return at(o)?o:bt(o)}catch(o){return fr(o)}}function ne(t,e,n,r,s){const o=n[r];if(!t||!o)return t;const i=`Event processor "${o.id||"?"}"`;let a=!1;const c=ht(m?`${i} threw an error, dropping event:`:"",()=>o({...t},e),()=>(a=!0,null));return m&&c===null&&h.log(`${i} dropped event`),at(c)?c.then(u=>u?ne(u,e,n,r+1,s):(s==null||s(a?"callback_error":"event_processor"),null)):c?ne(c,e,n,r+1,s):(s==null||s(a?"callback_error":"event_processor"),null)}let C,en,nn,P;function ti(t){const e=_._sentryDebugIds,n=_._debugIds;if(!e&&!n)return{};const r=e?Object.keys(e):[],s=n?Object.keys(n):[];if(P&&r.length===en&&s.length===nn)return P;en=r.length,nn=s.length,P={},C||(C={});const o=(i,a)=>{for(const c of i){const u=a[c],f=C==null?void 0:C[c];if(f&&P&&u)P[f[0]]=u,C&&(C[c]=[f[0],u]);else if(u){const l=t(c);for(let d=l.length-1;d>=0;d--){const g=l[d],p=g==null?void 0:g.filename;if(p&&P&&C){P[p]=u,C[c]=[p,u];break}}}}};return e&&o(r,e),n&&o(s,n),P}function re(t){var e;return((e=t.data)==null?void 0:e.__sentry__)===!0}function lr(t){const e=[];t.message&&e.push(t.message);try{const n=t.exception.values[t.exception.values.length-1];n!=null&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch{}return e}function ei(t,e,n,r,s,o){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=t,c={...e,event_id:e.event_id||n.event_id||k(),timestamp:e.timestamp||yt()},u=n.integrations||t.integrations.map(b=>b.name);ni(c,t),oi(c,u),s&&s.emit("applyFrameMetadata",e),e.type===void 0&&ri(c,t.stackParser);const f=ai(r,n.captureContext);n.mechanism&&us(c,n.mechanism);const l=s?s.getEventProcessors():[],d=sr(o,f),g=[...n.attachments||[],...d.attachments];g.length&&(n.attachments=g),Oo(c,d);const p=_o(f);p&&xo(c,p),Vo(c,n,f);const I=[...l,...d.eventProcessors];return(re(n)?bt(c):Zo(I,c,n,0,b=>{s&&(s.recordDroppedEvent(b,ee(e.type)),e.type==="transaction"&&s.recordDroppedEvent(b,"span",1+(e.spans||[]).length))})).then(b=>b?(si(b),typeof i=="number"&&i>0?ii(b,i,a):b):null)}function ni(t,e){var a,c;const{environment:n,release:r,dist:s,maxValueLength:o}=e;t.environment=t.environment||n||Se,!t.release&&r&&(t.release=r),!t.dist&&s&&(t.dist=s);const i=t.request;i!=null&&i.url&&o&&(i.url=Xt(i.url,o)),o&&((c=(a=t.exception)==null?void 0:a.values)==null||c.forEach(u=>{u.value&&(u.value=Xt(u.value,o))}))}function ri(t,e){var r,s;const n=ti(e);(s=(r=t.exception)==null?void 0:r.values)==null||s.forEach(o=>{var i,a;(a=(i=o.stacktrace)==null?void 0:i.frames)==null||a.forEach(c=>{c.filename&&(c.debug_id=n[c.filename])})})}function si(t){var r,s;const e={};if((s=(r=t.exception)==null?void 0:r.values)==null||s.forEach(o=>{var i,a;(a=(i=o.stacktrace)==null?void 0:i.frames)==null||a.forEach(c=>{c.debug_id&&(c.abs_path?e[c.abs_path]=c.debug_id:c.filename&&(e[c.filename]=c.debug_id),delete c.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.entries(e).forEach(([o,i])=>{n.push({type:"sourcemap",code_file:o,debug_id:i})})}function oi(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function ii(t,e,n){var s,o;if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(i=>({...i,...i.data&&{data:A(i.data,e,n)}}))},...t.user&&{user:A(t.user,e,n)},...t.contexts&&{contexts:A(t.contexts,e,n)},...t.extra&&{extra:A(t.extra,e,n)}};return(s=t.contexts)!=null&&s.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=A(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(i=>({...i,...i.data&&{data:A(i.data,e,n)}}))),(o=t.contexts)!=null&&o.flags&&r.contexts&&(r.contexts.flags=A(t.contexts.flags,3,n)),r}function ai(t,e){if(!e)return t;const n=t?t.clone():new O;return n.update(e),n}function ci(t){if(t)return ui(t)?{captureContext:t}:li(t)?{captureContext:t}:t}function ui(t){return t instanceof O||typeof t=="function"}const fi=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function li(t){return Object.keys(t).some(e=>fi.includes(e))}function di(t,e){return N().captureException(t,ci(e))}function dr(t,e){return N().captureEvent(t,e)}function Du(t,e){L().setTag(t,e)}function Lu(t){L().setUser(t)}function rn(t){const e=L(),{user:n}=sr(e,N()),{userAgent:r}=_.navigator||{},s=hs({user:n,...r&&{userAgent:r},...t}),o=e.getSession();return(o==null?void 0:o.status)==="ok"&&tt(o,{status:"exited"}),pr(),e.setSession(s),s}function pr(){const t=L(),n=N().getSession()||t.getSession();n&&ms(n),hr(),t.setSession()}function hr(){const t=L(),e=S(),n=t.getSession();n&&e&&e.captureSession(n)}function qt(t=!1){if(t){pr();return}hr()}const pi="7";function hi(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function mi(t){return`${hi(t)}${t.projectId}/envelope/`}function gi(t,e){const n={sentry_version:pi};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function _i(t,e,n){return e||`${mi(t)}?${gi(t,n)}`}function yi(t,e){const n=e?"auto":"never";return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...Mt()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function Ei(t,e,n,r,s){const o={};return e!=null&&e.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(o.dsn=St(r)),ct(o,[yi(t,s)])}function Si(t,e){const n=e??bi(t)??[];if(n.length===0)return;const r=t.getOptions(),s=Ei(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);mr().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(s)}function bi(t){return mr().get(t)}function mr(){return st("clientToLogBufferMap",()=>new WeakMap)}function vi(t,e){const n=e?"auto":"never";return[{type:"trace_metric",item_count:t.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...Mt()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function Ii(t,e,n,r,s){const o={};return e!=null&&e.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(o.dsn=St(r)),ct(o,[vi(t,s)])}function Ti(t,e){const n=e??ki(t)??[];if(n.length===0)return;const r=t.getOptions(),s=Ii(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);gr().set(t,[]),t.emit("flushMetrics"),t.sendEnvelope(s)}function ki(t){return gr().get(t)}function gr(){return st("clientToMetricBufferMap",()=>new WeakMap)}function wi(t,e){var s,o,i;if(t.type!=="transaction"||!((s=t.spans)!=null&&s.length)||!((o=t.sdkProcessingMetadata)!=null&&o.hasGenAiSpans)||Po(e))return;const n=[],r=[];for(const a of t.spans)(i=a.op)!=null&&i.startsWith("gen_ai.")?n.push(Lo(a)):r.push(a);if(n.length!==0)return t.spans=r,zo(n,e)}const be=Symbol.for("SentryBufferFullError");function ve(t=100){const e=new Set;function n(){return e.size<t}function r(i){e.delete(i)}function s(i){if(!n())return fr(be);const a=i();return e.add(a),a.then(()=>r(a),()=>r(a)),a}function o(i){if(!e.size)return bt(!0);const a=Promise.allSettled(Array.from(e)).then(()=>!0);if(!i)return a;const c=[a,new Promise(u=>ar(setTimeout(()=>u(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(e)},add:s,drain:o}}const Ri=60*1e3;function Oi(t,e=K()){const n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${t}`);return isNaN(r)?Ri:r-e}function Ni(t,e){return t[e]||t.all||0}function Ci(t,e,n=K()){return Ni(t,e)>n}function Ai(t,{statusCode:e,headers:n},r=K()){const s={...t},o=n==null?void 0:n["x-sentry-rate-limits"],i=n==null?void 0:n["retry-after"];if(o)for(const a of o.trim().split(",")){const[c,u,,,f]=a.split(":",5),l=parseInt(c,10),d=(isNaN(l)?60:l)*1e3;if(!u)s.all=r+d;else for(const g of u.split(";"))g==="metric_bucket"?(!f||f.split(";").includes("custom"))&&(s[g]=r+d):s[g]=r+d}else i?s.all=r+Oi(i,r):e===429&&(s.all=r+60*1e3);return s}const _r=64;function xi(t,e,n=ve(t.bufferSize||_r)){let r={};const s=i=>n.drain(i);function o(i){const a=[];if(Zt(i,(l,d)=>{const g=Qe(d);Ci(r,g)?t.recordDroppedEvent("ratelimit_backoff",g):a.push(l)}),a.length===0)return Promise.resolve({});const c=ct(i[0],a),u=l=>{if(Mo(c,["client_report"])){m&&h.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}Zt(c,(d,g)=>{t.recordDroppedEvent(l,Qe(g))})},f=()=>e({body:$o(c)}).then(l=>l.statusCode===413?(m&&h.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),l):(m&&l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&h.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Ai(r,l),l),l=>{throw u("network_error"),m&&h.error("Encountered error running transport request:",l),l});return n.add(f).then(l=>l,l=>{if(l===be)return m&&h.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:o,flush:s}}function Di(t,e,n){const r=[{type:"client_report"},{timestamp:yt(),discarded_events:t}];return ct(e?{dsn:e}:{},[r])}function Li(t){var c;const{trace_id:e,parent_span_id:n,span_id:r,status:s,origin:o,data:i,op:a}=((c=t.contexts)==null?void 0:c.trace)??{};return{data:i??{},description:t.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:s??"ok",timestamp:t.timestamp,trace_id:e??"",origin:o,profile_id:i==null?void 0:i[Xn],exclusive_time:i==null?void 0:i[Kn],measurements:t.measurements,is_segment:!0}}function Pi(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:{...t.data,...t.profile_id&&{[Xn]:t.profile_id},...t.exclusive_time&&{[Kn]:t.exclusive_time}}}},measurements:t.measurements}}function Mi(t){var e;t.traceLifecycle!=="stream"||!(t.beforeSendTransaction||(e=t.ignoreTransactions)!=null&&e.length)||j(()=>{console.warn("[Sentry] `beforeSendTransaction` and `ignoreTransactions` are ignored with `traceLifecycle: 'stream'` (enabled by default). Use `beforeSendSpan` and `ignoreSpans` instead, or set `traceLifecycle: 'static'`.")})}const v={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,queues:!0,stackFrameVariables:!0,frameContextLines:5};function $i(t){return typeof t=="boolean"||"allow"in t||"deny"in t}function Fi(t){return t===void 0?{...v.httpHeaders}:$i(t)?{request:t,response:t}:{request:t.request??v.httpHeaders.request,response:t.response??v.httpHeaders.response}}function ji(t){var n,r,s,o;const e=t.dataCollection??{};return{userInfo:e.userInfo??v.userInfo,cookies:e.cookies??v.cookies,httpHeaders:Fi(e.httpHeaders),httpBodies:e.httpBodies??v.httpBodies,urlQueryParams:e.urlQueryParams??v.urlQueryParams,graphQL:{document:((n=e.graphQL)==null?void 0:n.document)??v.graphQL.document,variables:((r=e.graphQL)==null?void 0:r.variables)??v.graphQL.variables},genAI:{inputs:((s=e.genAI)==null?void 0:s.inputs)??v.genAI.inputs,outputs:((o=e.genAI)==null?void 0:o.outputs)??v.genAI.outputs},databaseQueryData:e.databaseQueryData??v.databaseQueryData,queues:e.queues??v.queues,stackFrameVariables:e.stackFrameVariables??v.stackFrameVariables,frameContextLines:e.frameContextLines??v.frameContextLines}}const sn="Not capturing exception because it's already been captured.",on="Discarded session because of missing or non-string release",yr=Symbol.for("SentryInternalError"),Er=Symbol.for("SentryDoNotSendEventError"),Bi=5e3,Sr=Symbol.for("SentryClosedClient");function Ui(t){return Sr in t}function kt(t){return{message:t,[yr]:!0}}function Gt(t){return{message:t,[Er]:!0}}function an(t){return xt(t)&&yr in t}function cn(t){return xt(t)&&Er in t}function un(t,e,n,r,s){let o=0,i,a=!1;t.on(n,()=>{o=0,clearTimeout(i),a=!1}),t.on(e,c=>{if(o+=r(c),o>=8e5)s(t);else if(!a){const u=t.getOptions()._flushInterval??Bi;u>0&&(a=!0,i=ar(setTimeout(()=>{s(t)},u)))}}),t.on("flush",()=>{s(t)})}class Hi{constructor(e){var s;this._options={attachStacktrace:!0,...e,traceLifecycle:e.traceLifecycle==="static"?"static":"stream"},this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=ve(((s=e.transportOptions)==null?void 0:s.bufferSize)??_r),this._dataCollection=ji(e),this._unhandledSessionStatus="crashed",e.dsn?this._dsn=no(e.dsn):m&&h.warn("No DSN provided, client will not send events.");const{beforeSendSpan:n,traceLifecycle:r}=this._options;if(m&&n&&or(n)!==(r==="static")&&j(()=>{console.warn(`Ignoring \`beforeSendSpan\`: ${r==="static"?"wrap it with":"remove"} \`Sentry.withStaticSpan\` to use it with \`traceLifecycle: "${r}"\`.`)}),this._dsn){const o=_i(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:o})}un(this,"afterCaptureLog","flushLogs",zi,Si),un(this,"afterCaptureMetric","flushMetrics",Gi,Ti)}captureException(e,n,r){const s=k();if(De(e))return m&&h.log(sn),s;const o={event_id:s,...n};return this._process(()=>this.eventFromException(e,o).then(i=>this._captureEvent(i,o,r)).then(i=>i),"error"),o.event_id}captureMessage(e,n,r,s){const o={event_id:k(),...r},i=ge(e)?e:String(e),a=it(e),c=a?this.eventFromMessage(i,n,o):this.eventFromException(e,o);return this._process(()=>c.then(u=>this._captureEvent(u,o,s)),a?"unknown":"error"),o.event_id}captureEvent(e,n,r){const s=k();if(n!=null&&n.originalException&&De(n.originalException))return m&&h.log(sn),s;const o={event_id:s,...n},i=e.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,u=ee(e.type);return this._process(()=>this._captureEvent(e,o,a||r,c),u),o.event_id}captureSession(e){this.sendSession(e),tt(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const n=this._transport;if(this.emit("flush"),!n)return!0;const r=await this._isClientDoneProcessing(e),s=await n.flush(e);return r&&s}async close(e){Object.defineProperty(this,Sr,{value:!0});const n=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&(this._setupIntegrations(),Mi(this._options))}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){const n=this._integrations[e.name];!n&&e.beforeSetup&&e.beforeSetup(this),er(this,e,this._integrations),n||Ye(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);const r=wi(e,this);let s=Qo(e,this._dsn,this._options._metadata,this._options.tunnel);if(!re(n))for(const o of n.attachments||[])s=Je(s,jo(o));r&&(s=Je(s,r)),this.sendEnvelope(s).then(o=>this.emit("afterSendEvent",e,o))}sendSession(e){const{release:n,environment:r=Se}=this._options;if("aggregates"in e){const o=e.attrs||{};if(!o.release&&!n){m&&h.warn(on);return}o.release=o.release||n,o.environment=o.environment||r,e.attrs=o}else{if(!e.release&&!n){m&&h.warn(on);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);const s=Jo(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){const s=`${e}:${n}`;m&&h.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(e,n){const r=this._hooks[e]=this._hooks[e]||new Set,s=(...o)=>n(...o);return r.add(s),()=>{r.delete(s)}}emit(e,...n){const r=this._hooks[e];r&&r.forEach(s=>s(...n))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{const n=await this._transport.send(e);return this.emit("afterEnvelope",e),n}catch(n){return m&&h.error("Error while sending envelope:",n),{}}return m&&h.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=Io(this,e),Ye(this,e)}_updateSessionFromEvent(e,n){var c,u;let r=n.level==="fatal",s=!1;const o=(c=n.exception)==null?void 0:c.values;if(o){s=!0,r=!1;for(const f of o)if(((u=f.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const i=e.status==="ok";(i&&e.errors===0||i&&r)&&(tt(e,{...r&&{status:this._unhandledSessionStatus},errors:e.errors||Number(s||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let n=0;for(;!e||n<e;){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(e,n,r,s){const o=this.getOptions(),i=this.getIntegrationNames();return!n.integrations&&i.length&&(n.integrations=i),this.emit("preprocessEvent",e,n),e.type||s.setLastEventId(e.event_id||n.event_id),ei(o,e,n,r,this,s).then(a=>{var u;if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...(u=a.contexts)==null?void 0:u.trace,...Yn(r)},...a.contexts};const c=rr(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(e,n={},r=N(),s=L()){return m&&se(e)&&h.log(`Captured error event \`${lr(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,s).then(o=>o.event_id,o=>{m&&(cn(o)?h.log(o.message):an(o)?h.warn(o.message):h.warn(o))})}_processEvent(e,n,r,s){const o=this.getOptions(),{sampleRate:i}=o,a=br(e),c=se(e),f=`before send for type \`${e.type||"error"}\``;let l="before_send";const d=typeof i>"u"?void 0:ro(i),g=ee(e.type);return this._prepareEvent(e,n,r,s).then(p=>{if(p===null)throw Gt("An event processor returned `null`, will not send event.");if(re(n))return p;const I=qi(this,o,p,n,()=>{l="callback_error"});return Wi(I,f)}).then(p=>{var b;if(p===null){if(this.recordDroppedEvent(l,g),a){const X=e.spans||[];this.recordDroppedEvent(l,"span",1+X.length)}throw Gt(`${f} ${l==="callback_error"?"threw an error":"returned `null`"}, will not send event.`)}const I=r.getSession()||s.getSession();if(c&&I&&this._updateSessionFromEvent(I,p),c&&typeof d=="number"&&Ee()>d)throw this.recordDroppedEvent("sample_rate","error"),Gt(`Discarding event because it's not included in the random sample (sampling rate = ${i})`);if(a){const B=((b=p.sdkProcessingMetadata)==null?void 0:b.spanCountBeforeProcessing)||0,X=p.spans?p.spans.length:0,we=B-X;we>0&&this.recordDroppedEvent("before_send","span",we)}const V=p.transaction_info;if(a&&V&&p.transaction!==e.transaction){const B="custom";p.transaction_info={...V,source:B}}return this.sendEvent(p,n),p}).then(null,p=>{throw cn(p)||an(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),kt(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
Reason: ${p}`))})}_process(e,n){this._numProcessing++,this._promiseBuffer.add(e).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===be&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{const[s,o]=n.split(":");return{reason:s,category:o,quantity:r}})}_flushOutcomes(){m&&h.log("Flushing outcomes...");const e=this._clearOutcomes();if(e.length===0){m&&h.log("No outcomes to send");return}if(!this._dsn){m&&h.log("No dsn provided, will not send outcomes");return}m&&h.log("Sending outcomes:",e);const n=Di(e,this._options.tunnel&&St(this._dsn));this.sendEnvelope(n)}}function Wi(t,e){const n=`${e} must return \`null\` or a valid event.`;if(at(t))return t.then(r=>{if(!Nt(r)&&r!==null)throw kt(n);return r},r=>{throw kt(`${e} rejected with ${r}`)});if(!Nt(t)&&t!==null)throw kt(n);return t}function qi(t,e,n,r,s){const{beforeSend:o,ignoreSpans:i,beforeSendTransaction:a}=e,c=or(e.beforeSendSpan)&&e.beforeSendSpan;let u=n;if(se(u)&&o){const f=u;return ht(m?"The `beforeSend` callback threw an error, dropping the event:":"",()=>o(f,r),()=>(s(),null))}if(br(u)){if(c||i){const f=Li(u);if(i!=null&&i.length&&Ge({description:f.description,op:f.op,attributes:f.data},i))return null;if(c){const l=Xe(f,c);u=Et(n,Pi(l))}if(u.spans){const l=[],d=u.spans;for(const p of d){if(i!=null&&i.length&&Ge({description:p.description,op:p.op,attributes:p.data},i)){Eo(d,p);continue}c?l.push(Xe(p,c)):l.push(p)}const g=u.spans.length-l.length;g&&t.recordDroppedEvent("before_send","span",g),u.spans=l}}if(a){if(u.spans){const f=u.spans.length;u.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:f}}return ht(m?"The `beforeSendTransaction` callback threw an error, dropping the event:":"",()=>a(u,r),()=>(s(),null))}}return u}function se(t){return t.type===void 0}function br(t){return t.type==="transaction"}function Gi(t){let e=0;return t.name&&(e+=t.name.length*2),e+=8,e+vr(t.attributes)}function zi(t){let e=0;return t.message&&(e+=t.message.length*2),e+vr(t.attributes)}function vr(t){if(!t)return 0;let e=0;return Object.values(t).forEach(n=>{Array.isArray(n)?e+=n.length*fn(n[0]):it(n)?e+=fn(n):e+=100}),e}function fn(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}function Yi(t,e){e.debug===!0&&(m?h.enable():j(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Vi(),N().update(e.initialScope);const r=new t(e);return Xi(r),r.init(),r}function Ki(){const t=S();return t&&!Ui(t)?t:void 0}function Vi(){Ki()&&j(()=>{console.warn("[Sentry] `Sentry.init()` was called more than once. The new client replaces the active client, but the active client is not closed, so state from both can mix. Call `Sentry.init()` only once, or call `await Sentry.close()` before you call it again.")})}function Xi(t){N().setClient(t)}const Ir="[Filtered]",Ji=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"];function Qi(t,e){return e.some(n=>t.includes(n))}function Tr(t,e,n){if(e===!1)return!0;const r=t.toLowerCase();if(Qi(r,Ji))return!0;if(e===!0)return!1;const i=("deny"in e?e.deny:e.allow).some(a=>r.includes(a.toLowerCase()));return"deny"in e?i:!i}function ln(t,e,n){if(e===!1)return{};const r={};for(const s of Object.keys(t))r[s]=Tr(s,e)?Ir:t[s];return r}function Zi(t,e){if(!(!t||e===!1))return t.split("&").map(n=>{const r=n.indexOf("="),s=r===-1?n:n.slice(0,r),o=new URLSearchParams(`${s}=`).keys().next().value;return o!==void 0&&Tr(o,e)?`${s}=${Ir}`:n}).join("&")}function ta(t,e){const n=t.indexOf("#"),r=n===-1?t.length:n,s=t.indexOf("?");if(s===-1||s>r)return t;const o=t.slice(0,s),i=t.slice(s+1,r),a=t.slice(r),c=Zi(i,e);return c?`${o}?${c}${a}`:`${o}${a}`}function ea(t){var e;return((e=t??S())==null?void 0:e.getDataCollectionOptions().urlQueryParams)??!0}function na(t,e){return t===void 0?void 0:ta(t,ea(e))}function zt(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function ra(t,e=!0){if(t.startsWith("data:")){const n=t.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=t.includes(";base64,"),o=t.indexOf(",");let i="";if(e&&o!==-1){const a=t.slice(o+1);i=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${s?",base64":""}${i?`,${i}`:""}`}return t}function sa(t){var e;"aggregates"in t?((e=t.attrs)==null?void 0:e.ip_address)===void 0&&(t.attrs={...t.attrs,ip_address:"{{auto}}"}):t.ipAddress===void 0&&(t.ipAddress="{{auto}}")}function oa(t,e,n=[e],r="npm"){const s=(t._metadata=t._metadata||{}).sdk=t._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${e}`,s.packages=n.map(o=>({name:`${r}:@sentry/${o}`,version:W})),s.version=W)}const ia=100;function G(t,e){const n=S(),r=L();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=ia}=n.getOptions();if(o<=0)return;const a={timestamp:yt(),...t},c=s?ht(m?"The `beforeBreadcrumb` callback threw an error, dropping the breadcrumb:":"",()=>j(()=>s(a,e)),()=>null):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,e),r.addBreadcrumb(c,o))}const aa="FunctionToString",dn=new WeakMap,ca=()=>({name:aa,setupOnce(){const t=Function.prototype.toString;try{Function.prototype.toString=function(...e){const n=ye(this);let r;try{dn.has(S())&&n!==void 0&&(r=n)}catch{}return t.apply(r??this,e)}}catch{}},setup(t){dn.set(t,!0)}}),ua=ca,fa=[/^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$/,/Java object is gone$/],la="EventFilters",da=(t={})=>{let e;return{name:la,setup(n){const r=n.getOptions();e=pn(t,r)},processEvent(n,r,s){if(!e){const o=s.getOptions();e=pn(t,o)}return pa(n,e)?null:n}}};function pn(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:fa],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function pa(t,e){if(t.type){if(t.type==="transaction"&&ma(t,e.ignoreTransactions))return m&&h.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
Event: ${H(t)}`),!0}else{if(ha(t,e.ignoreErrors))return m&&h.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
Event: ${H(t)}`),!0;if(Ea(t))return m&&h.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
Event: ${H(t)}`),!0;if(ga(t,e.denyUrls))return m&&h.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
Event: ${H(t)}.
|
|
Url: ${Ct(t)}`),!0;if(!_a(t,e.allowUrls))return m&&h.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
Event: ${H(t)}.
|
|
Url: ${Ct(t)}`),!0}return!1}function ha(t,e){return e!=null&&e.length?lr(t).some(n=>_t(n,e)):!1}function ma(t,e){if(!(e!=null&&e.length))return!1;const n=t.transaction;return n?_t(n,e):!1}function ga(t,e){if(!(e!=null&&e.length))return!1;const n=Ct(t);return n?_t(n,e):!1}function _a(t,e){if(!(e!=null&&e.length))return!0;const n=Ct(t);return n?_t(n,e):!0}function ya(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Ct(t){var e,n;try{const r=[...((e=t.exception)==null?void 0:e.values)??[]].reverse().find(o=>{var i,a,c;return((i=o.mechanism)==null?void 0:i.parent_id)===void 0&&((c=(a=o.stacktrace)==null?void 0:a.frames)==null?void 0:c.length)}),s=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return s?ya(s):null}catch{return m&&h.error(`Cannot extract url for event ${H(t)}`),null}}function Ea(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)!=null&&n.length?!t.message&&!t.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function Sa(t,e,n,r,s,o){var a;if(!((a=s.exception)!=null&&a.values)||!o||!D(o.originalException))return;const i=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;i&&(s.exception.values=oe(t,e,r,o.originalException,n,s.exception.values,i,0))}function oe(t,e,n,r,s,o,i,a){if(o.length>=n+1)return o;let c=[...o];if(D(r[s])){hn(i,a,r);const u=t(e,r[s]),f=c.length;mn(u,s,f,a),c=oe(t,e,n,r[s],s,[u,...c],u,f)}return kr(r)&&r.errors.forEach((u,f)=>{if(D(u)){hn(i,a,r);const l=t(e,u),d=c.length;mn(l,`errors[${f}]`,d,a),c=oe(t,e,n,u,s,[l,...c],l,d)}}),c}function kr(t){return Array.isArray(t.errors)}function hn(t,e,n){t.mechanism={handled:!0,type:"auto.core.linked_errors",...kr(n)&&{is_exception_group:!0},...t.mechanism,exception_id:e}}function mn(t,e,n,r){t.mechanism={handled:!0,...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function ba(t){return D(t)&&"__sentry_fetch_url_host__"in t&&typeof t.__sentry_fetch_url_host__=="string"}function gn(t){return ba(t)?`${t.message} (${t.__sentry_fetch_url_host__})`:t.message}const At=new Set([]);function va(t){const e="console",n=z(e,t);return Y(e,Ta),n}function Ia(t){for(const e of t)At.add(e);return()=>{for(const e of t)At.delete(e)}}const _n=new Set;function Ta(){"console"in _&&Nn.forEach(function(t){_n.has(t)||!(t in _.console)||(_n.add(t),T(_.console,t,function(e){return Ot[t]=e,function(...n){const r=n[0],s=Ot[t],o=At.size&&typeof r=="string"&&_t(r,At);o||w("console",{args:n,level:t}),(!o||m&&h.isEnabled())&&(s==null||s.apply(_.console,n))}}))})}function ka(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}const wa="Dedupe",Ra=()=>{let t;return{name:wa,processEvent(e){if(e.type)return e;try{if(Na(e,t))return m&&h.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Oa=Ra;function Na(t,e){return e?!!(Ca(t,e)||Aa(t,e)):!1}function Ca(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Rr(t,e)||!wr(t,e))}function Aa(t,e){const n=yn(e),r=yn(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Rr(t,e)||!wr(t,e))}function wr(t,e){const n=Ne(t),r=Ne(e);if(!n||!r)return!n&&!r;if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++){const o=r[s],i=n[s];if(o.filename!==i.filename||o.lineno!==i.lineno||o.colno!==i.colno||o.function!==i.function)return!1}return!0}function Rr(t,e){const n=t.fingerprint,r=e.fingerprint;if(!n||!r)return!n&&!r;try{return n.join("")===r.join("")}catch{return!1}}function yn(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)==null?void 0:n[0]}const xa="Console",Da=(t={})=>{const e=new Set(t.levels||Nn);return{name:xa,setup(n){const r=va(({args:s,level:o})=>{S()!==n||!e.has(o)||La(o,s)});if(n.registerCleanup(r),t.filter){const s=Ia(t.filter);n.registerCleanup(s)}}}};function La(t,e){const n={category:"console",data:{arguments:e,logger:"console"},level:ka(t),message:En(e)};if(t==="assert")if(e[0]===!1){const r=e.slice(1);n.message=r.length>0?`Assertion failed: ${En(r)}`:"Assertion failed",n.data.arguments=r}else return;G(n,{input:e,level:t})}function En(t){return"util"in _&&typeof _.util.format=="function"?_.util.format(...t):is(t," ")}const Pa="ConversationId",Ma=()=>({name:Pa,setup(t){t.on("spanStart",e=>{const n=N().getScopeData(),r=L().getScopeData(),s=n.conversationId||r.conversationId;if(s){const{op:o,data:i,description:a}=Pt(e);if(!(o!=null&&o.startsWith("gen_ai."))&&!i["ai.operationId"]&&!(a!=null&&a.startsWith("ai.")))return;e.setAttribute(xs,s)}})}}),$a=Ma,ie=_;function Fa(){if(!("fetch"in ie))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function ae(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function ja(){var n;if(typeof EdgeRuntime=="string")return!0;if(!Fa())return!1;if(ae(ie.fetch))return!0;let t=!1;const e=ie.document;if(e&&typeof e.createElement=="function")try{const r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(t=ae(r.contentWindow.fetch)),e.head.removeChild(r)}catch(r){m&&h.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return t}function Ba(t){const e="fetch",n=z(e,t);return Y(e,()=>Ua()),n}function Ua(t){Mt()&&!ja()||T(_,"fetch",function(e){return new Proxy(e,{apply(n,r,s){const o=new Error,{method:i,url:a}=Ha(s),c={args:s,fetchData:{method:i,url:a},startTimestamp:R()*1e3,virtualError:o,headers:Wa(s)};return w("fetch",{...c}),Reflect.apply(n,_,s).then(async u=>(w("fetch",{...c,endTimestamp:R()*1e3,response:u}),u),u=>{w("fetch",{...c,endTimestamp:R()*1e3,error:u}),D(u)&&u.stack===void 0&&(u.stack=o.stack,F(u,"framesToPop",1));const f=S(),l=(f==null?void 0:f.getOptions().enhanceFetchErrorMessages)??"always";if(l!==!1&&D(u)&&u.name==="TypeError"&&(u.message==="Failed to fetch"||u.message==="Load failed"||u.message==="NetworkError when attempting to fetch resource."))try{const p=new URL(c.fetchData.url).host;l==="always"?u.message=`${u.message} (${p})`:F(u,"__sentry_fetch_url_host__",p)}catch{}throw u})}})})}function wt(t,e){return xt(t)&&!!t[e]}function Sn(t){return typeof t=="string"?t:t?wt(t,"url")?t.url:t.toString?t.toString():"":""}function Ha(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:Sn(n),method:wt(r,"method")?String(r.method).toUpperCase():Pn(n)&&wt(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:Sn(e),method:wt(e,"method")?String(e.method).toUpperCase():"GET"}}function Wa(t){const[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Pn(e))return new Headers(e.headers)}catch{}}function Or(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}const ce=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,E=_,qa=80,U={};try{typeof Node<"u"&&(U.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),typeof Element<"u"&&(U.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,U.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,U.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,U.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<"u"&&(U.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function M(t,e,n){const r=U[e];if(r)try{return r.call(t,n)}catch{}const s=t[e];return typeof s=="function"?s.call(t,n):s}function Nr(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,s=[];let o=0,i=0;const a=" > ",c=a.length;let u;const f=Array.isArray(e)?e:e.keyAttrs,l=!Array.isArray(e)&&e.maxStringLength||qa;for(;n&&o++<r&&(u=Ga(n,f),!(u==="html"||o>1&&i+s.length*c+u.length>=l));)s.push(u),i+=u.length,n=M(n,"parentNode");return s.reverse().join(a)}catch{return"<unknown>"}}function Ga(t,e){const n=[],r=M(t,"tagName");if(!r)return"";if(typeof HTMLElement<"u"&&t instanceof HTMLElement){const o=M(t,"dataset");if(o){if(o.sentryComponent)return o.sentryComponent;if(o.sentryElement)return o.sentryElement}}n.push(r.toLowerCase());const s=e!=null&&e.length?e.filter(o=>M(t,"getAttribute",o)).map(o=>[o,M(t,"getAttribute",o)]):null;if(s!=null&&s.length)s.forEach(o=>{n.push(`[${o[0]}="${o[1]}"]`)});else{const o=M(t,"id");o&&n.push(`#${o}`);const i=M(t,"className");if(i&&x(i)){const a=i.split(/\s+/);for(const c of a)n.push(`.${c}`)}}for(const o of["aria-label","type","name","title","alt"]){const i=M(t,"getAttribute",o);i&&n.push(`[${o}="${i}"]`)}return n.join("")}function za(t,e,n){E.document&&E.addEventListener(t,e,n)}function Ya(t,e,n){E.document&&E.removeEventListener(t,e,n)}const Ka=t=>{var n;const e=E.requestIdleCallback||E.setTimeout;if(((n=E.document)==null?void 0:n.visibilityState)==="hidden")t();else{let r=!1;const s=()=>{r||(t(),r=!0)};za("visibilitychange",s,{once:!0,capture:!0}),e(()=>{s(),Ya("visibilitychange",s,{capture:!0})})}};function Va(t,e=5){if(!_.HTMLElement)return null;let n=t;for(let r=0;r<e;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}function Ie(){var t;try{return((t=E.document)==null?void 0:t.location.href)??""}catch{return""}}const Cr=new WeakMap;function Xa(t,e=S()){if(!e){ce&&h.warn("Cannot set a route provider without a client.");return}ce&&Ja(e)&&h.warn("A route provider is already registered for this client and will be replaced. Routes only the previous provider knows about will no longer resolve."),Cr.set(e,t)}function Ja(t=S()){return t&&Cr.get(t)}const Qa=1e3;let bn,ue,fe;function vn(t){return typeof t=="boolean"?t:!!(t!=null&&t.capture)}function Za(t){const e="dom";z(e,t),Y(e,tc)}function tc(){if(!E.document)return;const t=w.bind(null,"dom"),e=In(t,!0);E.document.addEventListener("click",e,!1),E.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{var o,i;const s=(o=E[n])==null?void 0:o.prototype;(i=s==null?void 0:s.hasOwnProperty)!=null&&i.call(s,"addEventListener")&&(T(s,"addEventListener",function(a){return function(c,u,f){if((c==="click"||c=="keypress")&&u)try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=l[c]=l[c]||{captureListeners:new WeakSet,bubbleListeners:new WeakSet,listenerCount:0},g=vn(f);if(!d.handler){const I=In(t);d.handler=I,d.capture=g,a.call(this,c,I,d.capture)}const p=d[g?"captureListeners":"bubbleListeners"];p.has(u)||(typeof f=="object"&&(f!=null&&f.once||f!=null&&f.signal)?d.sticky=!0:(p.add(u),d.listenerCount++))}catch{}return a.call(this,c,u,f)}}),T(s,"removeEventListener",function(a){return function(c,u,f){if((c==="click"||c=="keypress")&&u)try{const l=this.__sentry_instrumentation_handlers__||{},d=l[c];d!=null&&d[vn(f)?"captureListeners":"bubbleListeners"].delete(u)&&(!--d.listenerCount&&!d.sticky&&(a.call(this,c,d.handler,d.capture),d.handler=void 0,delete l[c]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,c,u,f)}}))})}function ec(t){if(t.type!==ue)return!1;try{if(!t.target||t.target._sentryId!==fe)return!1}catch{}return!0}function nc(t,e){return t!=="keypress"?!1:e!=null&&e.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function In(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=rc(n);if(nc(n.type,r))return;F(n,"_sentryCaptured",!0),r&&!r._sentryId&&F(r,"_sentryId",k());const s=n.type==="keypress"?"input":n.type;ec(n)||(t({event:n,name:s,global:e}),ue=n.type,fe=r?r._sentryId:void 0),clearTimeout(bn),bn=E.setTimeout(()=>{fe=void 0,ue=void 0},Qa)}}function rc(t){try{return t.target}catch{return null}}let It;function sc(){return"history"in E&&!!E.history}function Ar(t){const e="history";z(e,t),Y(e,oc)}function oc(){if(E.addEventListener("popstate",()=>{const e=E.location.href,n=It;if(It=e,n===e)return;w("history",{from:n,to:e})}),!sc())return;function t(e){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=It,o=ic(String(r));if(It=o,s===o)return e.apply(this,n);w("history",{from:s,to:o})}return e.apply(this,n)}}T(E.history,"pushState",t),T(E.history,"replaceState",t)}function ic(t){try{return new URL(t,E.location.origin).toString()}catch{return t}}const Rt={};function ac(t){const e=Rt[t];if(e)return e;let n=E[t];if(ae(n))return Rt[t]=n.bind(E);const r=E.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const o=s.contentWindow;o!=null&&o[t]&&(n=o[t]),r.head.removeChild(s)}catch(s){ce&&h.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,s)}return n&&(Rt[t]=n.bind(E))}function cc(t){Rt[t]=void 0}const lt="__sentry_xhr_v3__";function uc(t){const e="xhr";z(e,t),Y(e,fc)}function fc(){if(!E.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){let s=new Error;const o=R()*1e3,i=x(r[0])?r[0].toUpperCase():void 0,a=lc(r[1]);if(!i||!a)return e.apply(n,r);n[lt]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const u=n[lt];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const f={endTimestamp:R()*1e3,startTimestamp:o,xhr:n,virtualError:s};w("xhr",f),s=void 0,n.removeEventListener("readystatechange",c)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,f,l){return c(),u.apply(f,l)}}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,f,l){const[d,g]=l,p=f[lt];return p&&x(d)&&x(g)&&(p.request_headers[d.toLowerCase()]=g),u.apply(f,l)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const s=n[lt];if(!s)return e.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const o={startTimestamp:R()*1e3,xhr:n};return w("xhr",o),e.apply(n,r)}})}function lc(t){if(x(t))return t;try{return t.toString()}catch{}}function dc(t){if(typeof Element>"u")return!1;try{return t instanceof Element}catch{return!1}}const y=_;let le=0;const Tn=[];function xr(t){if(le>0)return!0;const e=t?Tn.findIndex(n=>pc(n,t)):-1;return e===-1?!1:(Tn.splice(e,1),!0)}function pc(t,e){return t.msg===e.msg&&t.url===e.url&&t.line===e.line&&t.column===e.column}function hc(){le++,setTimeout(()=>{le--})}function nt(t,e={}){function n(s){return typeof s=="function"}if(!n(t))return t;try{if(Object.prototype.hasOwnProperty.call(t,"__sentry_wrapped__")){const o=t.__sentry_wrapped__;return typeof o=="function"?o:t}if(ye(t))return t}catch{return t}const r=function(...s){_._sentryWrappedDepth=(_._sentryWrappedDepth||0)+1;try{const o=s.map(i=>nt(i,e));return t.apply(this,o)}catch(o){throw hc(),As(i=>{i.addEventProcessor(a=>(e.mechanism&&(Jt(a,void 0),Z(a,e.mechanism)),a.extra={...a.extra,arguments:s},a)),di(o)}),o}finally{_._sentryWrappedDepth=(_._sentryWrappedDepth||0)-1}};try{for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])}catch{}Mn(r,t),F(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}function kn(){const t=Ie(),{referrer:e}=y.document||{},{userAgent:n}=y.navigator||{},r={...e&&{Referer:e},...n&&{"User-Agent":n}};return{url:t,headers:r}}function Te(t,e){const n=$t(t,e),r={type:Ec(e),value:Sc(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function mc(t,e,n,r){const s=S(),o=s==null?void 0:s.getOptions().normalizeDepth,i=kc(e),a={__serialized__:Fn(e,o)};if(i)return{exception:{values:[Te(t,i)]},extra:a};const u={exception:{values:[{type:Dt(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:Ic(e,{isUnhandledRejection:r})}]},extra:a};if(n){const f=$t(t,n);f.length&&(u.exception.values[0].stacktrace={frames:f})}return u}function Yt(t,e){return{exception:{values:[Te(t,e)]}}}function $t(t,e){const n=e.stacktrace||e.stack||"",r=_c(e),s=yc(e);try{return t(n,r,s)}catch{}return[]}const gc=/Minified React error #\d+;/i;function _c(t){return t&&gc.test(t.message)?1:0}function yc(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Dr(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function Ec(t){const e=t==null?void 0:t.name;return!e&&Dr(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function Sc(t){const e=t==null?void 0:t.message;return Dr(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?gn(e.error):gn(t):"No error message"}function bc(t,e,n,r){const s=(n==null?void 0:n.syntheticException)||void 0,o=ke(t,e,s,r);return Z(o),o.level="error",n!=null&&n.event_id&&(o.event_id=n.event_id),bt(o)}function vc(t,e,n="info",r,s){const o=(r==null?void 0:r.syntheticException)||void 0,i=de(t,e,o,s);return i.level=n,r!=null&&r.event_id&&(i.event_id=r.event_id),bt(i)}function ke(t,e,n,r,s){var a,c;let o;if(Ln(e)&&e.error)return Yt(t,e.error);if(Ae(e)||Kr(e)){const u=e;if("stack"in e){o=Yt(t,e);const f=(c=(a=o.exception)==null?void 0:a.values)==null?void 0:c[0];if(r&&n&&f&&!f.stacktrace){const l=$t(t,n);l.length&&(f.stacktrace={frames:l},Z(o,{synthetic:!0}))}}else{const f=u.name||(Ae(u)?"DOMError":"DOMException"),l=u.message?`${f}: ${u.message}`:f;o=de(t,l,n,r),Jt(o,l)}return o}if(D(e))return Yt(t,e);if(Nt(e)||Dt(e))return o=mc(t,e,n,s),Z(o,{synthetic:!0}),o;const i=String(e);return o=de(t,i,n,r),Jt(o,i),Z(o,{synthetic:!0}),o}function de(t,e,n,r){const s={};if(r&&n){const o=$t(t,n);o.length&&(s.exception={values:[{value:e,stacktrace:{frames:o}}]}),Z(s,{synthetic:!0})}if(ge(e)){const{__sentry_template_string__:o,__sentry_template_values__:i}=e;return s.logentry={message:o,params:i},s}return s.message=e,s}function Ic(t,{isUnhandledRejection:e}){const n=Xr(t),r=e?"promise rejection":"exception";return Ln(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:Dt(t)?`Event \`${Tc(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Tc(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function kc(t){return Object.values(t).find(D)}class wc extends Hi{constructor(e){var c;const n=Rc(e),r=y.SENTRY_SDK_SOURCE||Wo();oa(n,"browser",["browser"],r),super(n),n.routeProvider&&Xa(n.routeProvider,this),this._unhandledSessionStatus="unhandled";const{userInfo:s}=this.getDataCollectionOptions();(c=n._metadata)!=null&&c.sdk&&(n._metadata.sdk.settings={infer_ip:s?"auto":"never",...n._metadata.sdk.settings});const{sendClientReports:o}=this._options,i=()=>{R()},a=[[y.document,"visibilitychange",()=>{i(),y.document.visibilityState==="hidden"&&(o&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}],[y.document,"freeze",i],[y.document,"resume",i],[y,"pagehide",i],[y,"pageshow",i]];a.forEach(([u,f,l])=>{var d;return(d=u==null?void 0:u.addEventListener)==null?void 0:d.call(u,f,l)}),this.on("close",()=>a.forEach(([u,f,l])=>{var d;return(d=u==null?void 0:u.removeEventListener)==null?void 0:d.call(u,f,l)})),s&&this.on("beforeSendSession",sa)}eventFromException(e,n){return bc(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return vc(this._options.stackParser,e,n,r,this._options.attachStacktrace)}_prepareEvent(e,n,r,s){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r,s)}}function Rc(t){var e;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(e=y.SENTRY_RELEASE)==null?void 0:e.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...t}}const Oc=40;function Nc(t,e=ac("fetch")){let n=0,r=0;async function s(o){const i=o.body.length;n+=i,r++;const a={body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{const c=await e(t.url,a);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw cc("fetch"),c}finally{n-=i,r--}}return xi(t,s,ve(t.bufferSize||Oc))}const Ft=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Cc=30,Ac=50;function pe(t,e,n,r){const s={filename:t,function:e==="<anonymous>"?q:e,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const xc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Dc=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Lc=/\((\S*)(?::(\d+))(?::(\d+))\)/,Pc=/at (.+?) ?\(data:(.+?),/,Mc=t=>{var s;const e=t.match(Pc);if(e)return{filename:`<data:${e[2]}>`,function:e[1]};const n=xc.exec(t);if(n){const[,o,i,a]=n;return pe(o,q,+i,+a)}const r=Dc.exec(t);if(r){if(((s=r[2])==null?void 0:s.indexOf("eval"))===0){const c=Lc.exec(r[2]);c&&(r[2]=c[1],r[3]=c[2],r[4]=c[3])}const[i,a]=Lr(r[1]||q,r[2]);return pe(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},$c=[Cc,Mc],Fc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,jc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Bc=t=>{const e=Fc.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const o=jc.exec(e[3]);o&&(e[1]=e[1]||"eval",e[3]=o[1],e[4]=o[2],e[5]="")}let r=e[3],s=e[1]||q;return[s,r]=Lr(s,r),pe(r,s,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Uc=[Ac,Bc],Hc=[$c,Uc],Wc=xn(...Hc),Lr=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:q,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},Tt=1024,qc="Breadcrumbs",Gc=(t={})=>{const e={dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:qc,setup(n){e.dom&&Za(Kc(n,e.dom)),e.xhr&&uc(Vc(n)),e.fetch&&Ba(Xc(n)),e.history&&Ar(Jc(n)),e.sentry&&n.on("beforeSendEvent",Yc(n))}}},zc=Gc;function Yc(t){return function(n){S()===t&&G({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:H(n)},{event:n})}}function Kc(t,e){return function(r){if(S()!==t)return;let s,o,i=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>Tt&&(Ft&&h.warn(`\`dom.maxStringLength\` cannot exceed ${Tt}, but a value of ${a} was configured. Sentry will use ${Tt} instead.`),a=Tt),typeof i=="string"&&(i=[i]);try{const u=r.event,f=Qc(u)?u.target:u;s=Nr(f,{keyAttrs:i,maxStringLength:a}),o=Va(f)}catch{s="<unknown>"}if(s.length===0)return;const c={category:`ui.${r.name}`,message:s};o&&(c.data={"ui.component_name":o}),G(c,{event:r.event,name:r.name,global:r.global})}}function Vc(t){return function(n){if(S()!==t)return;const{startTimestamp:r,endTimestamp:s}=n,o=n.xhr[lt];if(!r||!s||!o)return;const{method:i,url:a,status_code:c,body:u}=o,f={method:i,url:a,status_code:c},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:s},d={category:"xhr",data:f,type:"http",level:Or(c)};t.emit("beforeOutgoingRequestBreadcrumb",d,l),G(d,l)}}function Xc(t){return function(n){if(S()!==t)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},i={category:"fetch",data:n.fetchData,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",i,o),G(i,o)}else{const o=n.response,i={...n.fetchData,status_code:o==null?void 0:o.status},a={input:n.args,response:o,startTimestamp:r,endTimestamp:s},c={category:"fetch",data:i,type:"http",level:Or(i.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",c,a),G(c,a)}}}function Jc(t){return function(n){if(S()!==t)return;let r=n.from,s=n.to;const o=zt(y.location.href);let i=r?zt(r):void 0;const a=zt(s);i!=null&&i.path||(i=o),o.protocol===a.protocol&&o.host===a.host&&(s=a.relative),o.protocol===i.protocol&&o.host===i.host&&(r=i.relative),G({category:"navigation",data:{from:r,to:s}})}}function Qc(t){return!!t&&!!t.target}const Zc="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(","),tu="BrowserApiErrors",eu=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...t};return{name:tu,setupOnce(){e.setTimeout&&T(y,"setTimeout",wn),e.setInterval&&T(y,"setInterval",wn),e.requestAnimationFrame&&T(y,"requestAnimationFrame",ru),e.XMLHttpRequest&&"XMLHttpRequest"in y&&T(XMLHttpRequest.prototype,"send",su);const n=e.eventTarget;n&&(Array.isArray(n)?n:Zc).forEach(s=>ou(s,e))}}},nu=eu;function wn(t){return function(...e){const n=e[0];return e[0]=nt(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${$(t)}`}}),t.apply(this,e)}}function ru(t){return function(e){return t.apply(this,[nt(e,{mechanism:{data:{handler:$(t)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function su(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&T(n,s,function(o){const i={mechanism:{data:{handler:$(o)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},a=ye(o);return a&&(i.mechanism.data.handler=$(a)),nt(o,i)})}),t.apply(this,e)}}function ou(t,e){var s,o;const r=(s=y[t])==null?void 0:s.prototype;(o=r==null?void 0:r.hasOwnProperty)!=null&&o.call(r,"addEventListener")&&(T(r,"addEventListener",function(i){return function(a,c,u){try{iu(c)&&(c.handleEvent=nt(c.handleEvent,{mechanism:{data:{handler:$(c),target:t},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return e.unregisterOriginalCallbacks&&au(this,a,c),i.apply(this,[a,nt(c,{mechanism:{data:{handler:$(c),target:t},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),T(r,"removeEventListener",function(i){return function(a,c,u){try{if(Object.prototype.hasOwnProperty.call(c,"__sentry_wrapped__")){const f=c.__sentry_wrapped__;f&&i.call(this,a,f,u)}}catch{}return i.call(this,a,c,u)}}))}function iu(t){return typeof t.handleEvent=="function"}function au(t,e,n){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,n)}const cu=(t={})=>{const e=t.lifecycle??"page";return{name:"BrowserSession",setupOnce(){if(typeof y.document>"u"){Ft&&h.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}rn({ignoreDuration:!0});let n=!1;Ka(()=>{n||(qt(),n=!0)});const r=L();let s=r.getUser();r.addScopeListener(o=>{const i=o.getUser();((s==null?void 0:s.id)!==(i==null?void 0:i.id)||(s==null?void 0:s.ip_address)!==(i==null?void 0:i.ip_address))&&(s=i,n&&qt())}),e==="route"&&Ar(({from:o,to:i})=>{o!==i&&(rn({ignoreDuration:!0}),qt(),n=!0)})}}},uu="CultureContext",fu=()=>({name:uu,preprocessEvent(t){var n;const e=Rn();e&&(t.contexts={...t.contexts,culture:{...e,...(n=t.contexts)==null?void 0:n.culture}})},processSegmentSpan(t){const e=Rn();e&&ir(t,{"culture.locale":e.locale,"culture.timezone":e.timezone,"culture.calendar":e.calendar})}}),lu=fu;function Rn(){try{const t=y.Intl;if(!t)return;const e=t.DateTimeFormat().resolvedOptions();return{locale:e.locale,timezone:e.timeZone,calendar:e.calendar}}catch{return}}const du="GlobalHandlers",pu=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:du,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(mu(n),On("onerror")),e.onunhandledrejection&&(gu(n),On("onunhandledrejection"))}}},hu=pu;function mu(t){qr(e=>{const{stackParser:n,attachStacktrace:r}=Pr();if(S()!==t||xr(e))return;const{msg:s,url:o,line:i,column:a,error:c}=e,u=Eu(ke(n,c||s,void 0,r,!1),o,i,a);u.level="error",dr(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function gu(t){zr(e=>{const{stackParser:n,attachStacktrace:r}=Pr();if(S()!==t||xr())return;const s=_u(e),o=it(s)?yu(s):ke(n,s,void 0,r,!0);o.level="error",dr(o,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function _u(t){if(it(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function yu(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function Eu(t,e,n,r){const s=t.exception=t.exception||{},o=s.values=s.values||[],i=o[0]=o[0]||{},a=i.stacktrace=i.stacktrace||{},c=a.frames=a.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:Su(e)??Ie(),function:q,in_app:!0}),t}function On(t){Ft&&h.log(`Global Handler attached: ${t}`)}function Pr(){const t=S();return(t==null?void 0:t.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function Su(t){if(!(!x(t)||t.length===0))return t.startsWith("data:")?`<${ra(t,!1)}>`:t}const bu=()=>({name:"HttpContext",preprocessEvent(t,e,n){var c;if(!y.navigator&&!y.location&&!y.document)return;const{url:r,headers:s}=kn(),o=n.getDataCollectionOptions().httpHeaders.request,i=Object.entries(((c=t.request)==null?void 0:c.headers)??{}).filter(([u])=>!(u in s)),a={...ln(s,o),...Object.fromEntries(i)};t.request={url:r,...t.request,...Object.keys(a).length>0?{headers:a}:{headers:void 0}}},processSpan(t,e){var a;if(!y.navigator&&!y.location&&!y.document)return;const n=kn(),r=ln(n.headers,e.getDataCollectionOptions().httpHeaders.request),s=r.Referer,{hostname:o,protocol:i}=y.location||{};ir(t,{[Fs]:r["User-Agent"],[Ls]:i==="file:"||o==="localhost"||o==="127.0.0.1"||o==="[::1]"||!!(o!=null&&o.endsWith(".localhost")),...t.is_segment&&{[$s]:((a=t.attributes)==null?void 0:a[Vn])!=="http.client"?na(n.url):void 0,[`${Ds}.referer`]:s?[s]:void 0}})}}),vu="cause",Iu=5,Tu="LinkedErrors",ku=(t={})=>{const e=t.limit||Iu,n=t.key||vu;return{name:Tu,preprocessEvent(r,s,o){const i=o.getOptions();Sa(Te,i.stackParser,n,e,r,s)}}},wu=ku,Ru=/^HTML(\w*)Element$/;function Ou(t){if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(dc(t)){const e=Nu(t);if(Ru.test(e))return`[HTMLElement: ${Nr(t)}]`}}function Nu(t){const e=Object.getPrototypeOf(t);return e!=null&&e.constructor?e.constructor.name:"null prototype"}function Cu(){return Au()?(Ft&&j(()=>{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 Au(){var s;if(typeof y.window>"u")return!1;const t=y;if(t.nw)return!1;const e=t.chrome||t.browser;if(!((s=e==null?void 0:e.runtime)!=null&&s.id))return!1;const n=Ie();return!(y===y.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function xu(t){return[da(),ua(),$a(),nu(),zc(),Da(),hu(),wu(),Oa(),bu(),lu(),cu()]}function Pu(t={}){const e=!t.skipBrowserExtensionCheck&&Cu();let n=t.defaultIntegrations==null?xu():t.defaultIntegrations;const r=vo({integrations:t.integrations,defaultIntegrations:n}),s={...t,enabled:e?!1:t.enabled,stackParser:Hr(t.stackParser||Wc),integrations:r,transport:t.transport||Nc};return es(Ou),Yi(wc,s)}export{di as captureException,Pu as init,Du as setTag,Lu as setUser};
|