@drenso/homey-log 10.6000.0 → 10.6200.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.mjs CHANGED
@@ -1,22 +1,22 @@
1
- import wu from"node:os";import*as $s from"node:os";var g=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var h=globalThis;var G="10.60.0";function D(){return K(h),h}function K(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||G,t[G]=t[G]||{}}function F(e,t,r=h){let n=r.__SENTRY__=r.__SENTRY__||{},o=n[G]=n[G]||{};return o[e]||(o[e]=t())}var pe=["debug","info","warn","error","log","assert","trace"],vi="Sentry Logger ",w={};function b(e){if(!("console"in h))return e();let t=h.console,r={},n=Object.keys(w);n.forEach(o=>{let s=w[o];r[o]=t[o],t[o]=s});try{return e()}finally{n.forEach(o=>{t[o]=r[o]})}}function Ni(){pr().enabled=!0}function Ri(){pr().enabled=!1}function Cn(){return pr().enabled}function Ai(...e){cr("log",...e)}function Ci(...e){cr("warn",...e)}function Oi(...e){cr("error",...e)}function cr(e,...t){g&&Cn()&&b(()=>{h.console[e](`${vi}[${e}]:`,...t)})}function pr(){return g?F("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var l={enable:Ni,disable:Ri,isEnabled:Cn,log:Ai,warn:Ci,error:Oi};var On=/\(error: (.*)\)/,Ln=/captureMessage|captureException/;function yt(...e){let t=e.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0,o=0)=>{let s=[],i=r.split(`
2
- `);for(let a=n;a<i.length;a++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));let p=On.test(c)?c.replace(On,"$1"):c;if(!p.includes("Error: ")){for(let u of t){let f=u(p);if(f){s.push(f);break}}if(s.length>=50+o)break}}return Mn(s.slice(o))}}function fr(e){return Array.isArray(e)?yt(...e):e}function Mn(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(It(t).function||"")&&t.pop(),t.reverse(),Ln.test(It(t).function||"")&&(t.pop(),Ln.test(It(t).function||"")&&t.pop()),t.slice(0,50).map(r=>({...r,filename:r.filename||It(t).filename,function:r.function||"?"}))}function It(e){return e[e.length-1]||{}}var ur="<anonymous>";function Be(e){try{return!e||typeof e!="function"?ur:e.name||ur}catch{return ur}}function kn(e){let t=e?.startsWith("file://")?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var Ge={},Pn={};function lr(e,t){return Ge[e]=Ge[e]||[],Ge[e].push(t),()=>{let r=Ge[e];if(r){let n=r.indexOf(t);n!==-1&&r.splice(n,1)}}}function He(e,t){if(!Pn[e]){Pn[e]=!0;try{t()}catch(r){g&&l.error(`Error while instrumenting ${e}`,r)}}}function Ee(e,t){let r=e&&Ge[e];if(r)for(let n of r)try{n(t)}catch(o){g&&l.error(`Error while triggering instrumentation handler.
1
+ import Gu from"node:os";import*as zs from"node:os";var g=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var h=globalThis;var G="10.62.0";function D(){return K(h),h}function K(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||G,t[G]=t[G]||{}}function F(e,t,r=h){let n=r.__SENTRY__=r.__SENTRY__||{},o=n[G]=n[G]||{};return o[e]||(o[e]=t())}var pe=["debug","info","warn","error","log","assert","trace"],vi="Sentry Logger ",w={};function b(e){if(!("console"in h))return e();let t=h.console,r={},n=Object.keys(w);n.forEach(o=>{let s=w[o];r[o]=t[o],t[o]=s});try{return e()}finally{n.forEach(o=>{t[o]=r[o]})}}function Ni(){pr().enabled=!0}function Ri(){pr().enabled=!1}function On(){return pr().enabled}function Ai(...e){cr("log",...e)}function Ci(...e){cr("warn",...e)}function Oi(...e){cr("error",...e)}function cr(e,...t){g&&On()&&b(()=>{h.console[e](`${vi}[${e}]:`,...t)})}function pr(){return g?F("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var l={enable:Ni,disable:Ri,isEnabled:On,log:Ai,warn:Ci,error:Oi};var Ln=/\(error: (.*)\)/,Mn=/captureMessage|captureException/;function yt(...e){let t=e.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0,o=0)=>{let s=[],i=r.split(`
2
+ `);for(let a=n;a<i.length;a++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));let p=Ln.test(c)?c.replace(Ln,"$1"):c;if(!p.includes("Error: ")){for(let u of t){let f=u(p);if(f){s.push(f);break}}if(s.length>=50+o)break}}return kn(s.slice(o))}}function fr(e){return Array.isArray(e)?yt(...e):e}function kn(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(It(t).function||"")&&t.pop(),t.reverse(),Mn.test(It(t).function||"")&&(t.pop(),Mn.test(It(t).function||"")&&t.pop()),t.slice(0,50).map(r=>({...r,filename:r.filename||It(t).filename,function:r.function||"?"}))}function It(e){return e[e.length-1]||{}}var ur="<anonymous>";function Ge(e){try{return!e||typeof e!="function"?ur:e.name||ur}catch{return ur}}function Pn(e){let t=e?.startsWith("file://")?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var He={},Dn={};function lr(e,t){return He[e]=He[e]||[],He[e].push(t),()=>{let r=He[e];if(r){let n=r.indexOf(t);n!==-1&&r.splice(n,1)}}}function Ye(e,t){if(!Dn[e]){Dn[e]=!0;try{t()}catch(r){g&&l.error(`Error while instrumenting ${e}`,r)}}}function Te(e,t){let r=e&&He[e];if(r)for(let n of r)try{n(t)}catch(o){g&&l.error(`Error while triggering instrumentation handler.
3
3
  Type: ${e}
4
- Name: ${Be(n)}
5
- Error:`,o)}}var Dn=Object.prototype.toString;function Ye(e){switch(Dn.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Te(e,Error)}}function bt(e,t){return Dn.call(e)===`[object ${t}]`}function Un(e){return bt(e,"ErrorEvent")}function We(e){return bt(e,"String")}function Ve(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function X(e){return e===null||Ve(e)||typeof e!="object"&&typeof e!="function"}function ue(e){return bt(e,"Object")}function Fn(e){return typeof Event<"u"&&Te(e,Event)}function wn(e){return bt(e,"RegExp")}function j(e){return!!(e?.then&&typeof e.then=="function")}function Te(e,t){try{return e instanceof t}catch{return!1}}function je(e,t,r){if(!(t in e))return;let n=e[t];if(typeof n!="function")return;let o=r(n);typeof o=="function"&&xt(o,n);try{e[t]=o}catch{g&&l.log(`Failed to replace method "${t}" in object`,e)}}function Ie(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{g&&l.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function xt(e,t){try{let r=t.prototype||{};e.prototype=t.prototype=r,Ie(e,"__sentry_original__",t)}catch{}}function dr(e){return e.__sentry_original__}function vt(e){if(Ye(e))return{message:e.message,name:e.name,stack:e.stack,...Bn(e)};if(Fn(e)){let{type:t,target:r,currentTarget:n,detail:o}=e;return{type:t,target:r,currentTarget:n,...o?{detail:o}:{},...Bn(e)}}return e}function Bn(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function mr(e){let t=Object.keys(vt(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var ye;function be(e){if(ye!==void 0)return ye?ye(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),r=h;return t in r&&typeof r[t]=="function"?(ye=r[t],ye(e)):(ye=null,e())}function U(){return be(()=>Math.random())}function C(){return be(()=>Date.now())}var Li=Symbol.for("sentry.skipNormalization"),Mi=Symbol.for("sentry.overrideNormalizationDepth");function Gn(e){return!!e[Li]}function Hn(e){let t=e[Mi];return typeof t=="number"?t:void 0}var Yn;function B(e,t=100,r=1/0){try{return gr("",e,t,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function _r(e,t=3,r=100*1024){let n=B(e,t);return Di(n)>r?_r(e,t-1,r):n}function gr(e,t,r=1/0,n=1/0,o=Ui()){let[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=Sr(e,t);if(!a.startsWith("[object "))return a;if(Gn(t))return t;let c=Hn(t),p=c!==void 0?c:r;if(p===0)return a.replace("object ","");if(s(t))return"[Circular ~]";let u=t;if(u&&typeof u.toJSON=="function")try{let _=u.toJSON();return gr("",_,p-1,n,o)}catch{}let f=Array.isArray(t)?[]:{},d=0,m=vt(t);for(let _ in m){if(!Object.prototype.hasOwnProperty.call(m,_))continue;if(d>=n){f[_]="[MaxProperties ~]";break}let S=m[_];f[_]=gr(_,S,p-1,n,o),d++}return i(t),f}function Sr(e,t){try{if(Yn){let n=Yn(t);if(n)return n}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${Be(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${ki(t)}]`}catch(r){return`**non-serializable** (${r})`}}function ki(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function Pi(e){return~-encodeURI(e).split(/%..|./).length}function Di(e){return Pi(JSON.stringify(e))}function Ui(){let e=new WeakSet;function t(n){return e.has(n)?!0:(e.add(n),!1)}function r(n){e.delete(n)}return[t,r]}function xe(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function hr(e,t){let r=e,n=r.length;if(n<=150)return r;t>n&&(t=n);let o=Math.max(t-60,0);o<5&&(o=0);let s=Math.min(o+140,n);return s>n-5&&(s=n),s===n&&(o=Math.max(s-140,0)),r=r.slice(o,s),o>0&&(r=`'{snip} ${r}`),s<n&&(r+=" {snip}"),r}function Er(e,t){if(!Array.isArray(e))return"";let r=[];for(let n=0;n<e.length;n++){let o=e[n];X(o)?r.push(String(o)):o instanceof Error?r.push(o.message?`${o.name}: ${o.message}`:o.name):r.push(Sr(void 0,o))}return r.join(t)}function H(e,t,r=!1){return We(e)?wn(t)?t.test(e):We(t)?r?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function q(e,t=[],r=!1){for(let n of t)if(H(e,n,r))return!0;return!1}function Fi(){let e=h;return e.crypto||e.msCrypto}var Tr;function wi(){return U()*16}function y(e=Fi()){try{if(e?.randomUUID)return be(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Tr||(Tr="10000000100040008000"+1e11),Tr.replace(/[018]/g,t=>(t^(wi()&15)>>t/4).toString(16))}function Wn(e){return e.exception?.values?.[0]}function Q(e){let{message:t,event_id:r}=e;if(t)return t;let n=Wn(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function yr(e,t,r){let n=e.exception=e.exception||{},o=n.values=n.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type=r||"Error")}function ve(e,t){let r=Wn(e);if(!r)return;let n={type:"generic",handled:!0},o=r.mechanism;if(r.mechanism={...n,...o,...t},t&&"data"in t){let s={...o?.data,...t.data};r.mechanism.data=s}}var Bi=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function Ir(e){return parseInt(e||"",10)}function br(e){let t=e.match(Bi)||[],r=Ir(t[1]),n=Ir(t[2]),o=Ir(t[3]);return{buildmetadata:t[5],major:isNaN(r)?void 0:r,minor:isNaN(n)?void 0:n,patch:isNaN(o)?void 0:o,prerelease:t[4]}}function Nt(e){if(Vn(e))return!0;try{Ie(e,"__sentry_captured__",!0)}catch{}return!1}function Vn(e){try{return e.__sentry_captured__}catch{}}var $n=1e3;function $(){return C()/$n}function Gi(){let{performance:e}=h;if(!e?.now||!e.timeOrigin)return $;let t=e.timeOrigin;return()=>(t+be(()=>e.now()))/$n}var jn;function Rt(){return(jn??(jn=Gi()))()}function $e(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Rt(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:y()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function ee(e,t,r=2){if(!t||typeof t!="object"||r<=0)return t;if(e&&Object.keys(t).length===0)return e;let n={...e};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=ee(n[o],t[o],r-1));return n}function ze(){return y()}function Ze(){return y().substring(16)}function xr(e){try{let t=h.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function At(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var vr="_sentrySpan";function Je(e,t){t?Ie(e,vr,xr(t)):delete e[vr]}function Ne(e){return At(e[vr])}var Hi=100,O=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:ze(),sampleRand:U()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Je(t,Ne(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&$e(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,r){return this.setTags({[t]:r})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,r){return this.setAttributes({[t]:r})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,r){return this._extra={...this._extra,[t]:r},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,r){return r===null?delete this._contexts[t]:this._contexts[t]=r,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let r=typeof t=="function"?t(this):t,n=r instanceof e?r.getScopeData():ue(r)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:c,level:p,fingerprint:u=[],propagationContext:f,conversationId:d}=n||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),p&&(this._level=p),u.length&&(this._fingerprint=u),f&&(this._propagationContext=f),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Je(this,void 0),this._attachments=[],this.setPropagationContext({traceId:ze(),sampleRand:U()}),this._notifyScopeListeners(),this}addBreadcrumb(t,r){let n=typeof r=="number"?r:Hi;if(n<=0)return this;let o={timestamp:$(),...t,message:t.message?xe(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Ne(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=ee(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,r){let n=r?.event_id||y();if(!this._client)return g&&l.warn("No client configured on scope - will not capture exception!"),n;let o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...r,event_id:n},this),n}captureMessage(t,r,n){let o=n?.event_id||y();if(!this._client)return g&&l.warn("No client configured on scope - will not capture message!"),o;let s=n?.syntheticException??new Error(t);return this._client.captureMessage(t,r,{originalException:t,syntheticException:s,...n,event_id:o},this),o}captureEvent(t,r){let n=t.event_id||r?.event_id||y();return this._client?(this._client.captureEvent(t,{...r,event_id:n},this),n):(g&&l.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function Ke(){return F("defaultCurrentScope",()=>new O)}function Xe(){return F("defaultIsolationScope",()=>new O)}var zn=e=>e instanceof Promise&&!e[Zn],Zn=Symbol("chained PromiseLike"),Jn=(e,t,r)=>{let n=e.then(o=>(t(o),o),o=>{throw r(o),o});return zn(n)&&zn(e)?n:Yi(e,n)},Yi=(e,t)=>{if(!t)return e;let r=!1;for(let n in e){if(n in t)continue;r=!0;let o=e[n];typeof o=="function"?Object.defineProperty(t,n,{value:(...s)=>o.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[n]=o}return r&&Object.assign(t,{[Zn]:!0}),t};var Nr=class{constructor(t,r){let n;t?n=t:n=new O;let o;r?o=r:o=new O,this._stack=[{scope:n}],this._isolationScope=o}withScope(t){let r=this._pushScope(),n;try{n=t(r)}catch(o){throw this._popScope(),o}return j(n)?Jn(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Re(){let e=D(),t=K(e);return t.stack=t.stack||new Nr(Ke(),Xe())}function Wi(e){return Re().withScope(e)}function Vi(e,t){let r=Re();return r.withScope(()=>(r.getStackTop().scope=e,t(e)))}function Kn(e){return Re().withScope(()=>e(Re().getIsolationScope()))}function Xn(){return{withIsolationScope:Kn,withScope:Wi,withSetScope:Vi,withSetIsolationScope:(e,t)=>Kn(t),getCurrentScope:()=>Re().getScope(),getIsolationScope:()=>Re().getIsolationScope()}}function Rr(e){let t=D(),r=K(t);r.acs=e}function te(e){let t=K(e);return t.acs?t.acs:Xn()}function ji(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function $i(e,t){let{value:r,unit:n}=ji(e)?e:{value:e,unit:void 0},o=zi(r),s=n&&typeof n=="string"?{unit:n}:{};if(o)return{...o,...s};if(!t||t==="skip-undefined"&&r===void 0)return;let i="";try{i=JSON.stringify(r)??""}catch{}return{value:i,type:"string",...s}}function Ar(e,t=!1){let r={};for(let[n,o]of Object.entries(e??{})){let s=$i(o,t);s&&(r[n]=s)}return r}function Cr(e){if(!e)return 0;let t=0;for(let[r,n]of Object.entries(e)){t+=r.length*2,t+=n.type.length*2,t+=(n.unit?.length??0)*2;let o=n.value;Array.isArray(o)?t+=qn(o[0])*o.length:X(o)?t+=qn(o):t+=100}return t}function qn(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function zi(e){if(Array.isArray(e))return{value:e,type:"array"};let t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}var Zi;function Qn(){return Zi?.()}function A(){let e=D();return te(e).getCurrentScope()}function L(){let e=D();return te(e).getIsolationScope()}function Ct(){return F("globalScope",()=>new O)}function fe(...e){let t=D(),r=te(t);if(e.length===2){let[n,o]=e;return n?r.withSetScope(n,o):r.withScope(o)}return r.withScope(e[0])}function T(){return A().getClient()}function qe(e){let t=Qn();if(t)return{trace_id:t.traceId,span_id:t.spanId};let r=e.getPropagationContext(),{traceId:n,parentSpanId:o,propagationSpanId:s}=r,i={trace_id:n,span_id:s||Ze()};return o&&(i.parent_span_id=o),i}var Ae="sentry.source",Or="sentry.sample_rate",eo="sentry.previous_trace_sample_rate",Lr="sentry.op",Mr="sentry.origin";var to="sentry.release",ro="sentry.environment",no="sentry.segment.name",oo="sentry.segment.id",so="sentry.sdk.name",io="sentry.sdk.version",ao="sentry.sdk.integrations",co="user.id",po="user.email",Ot="user.ip_address",uo="user.name";var kr="sentry.profile_id",Pr="sentry.exclusive_time";var Ji="_sentryScope",Ki="_sentryIsolationScope";function le(e){let t=e;return{scope:t[Ji],isolationScope:At(t[Ki])}}var fo="sentry-";function Lt(e){let t=Xi(e);if(!t)return;let r=Object.entries(t).reduce((n,[o,s])=>{if(o.startsWith(fo)){let i=o.slice(fo.length);n[i]=s}return n},{});if(Object.keys(r).length>0)return r}function Xi(e){if(!(!e||!We(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,r)=>{let n=lo(r);return Object.entries(n).forEach(([o,s])=>{t[o]=s}),t},{}):lo(e)}function lo(e){return e.split(",").map(t=>{let r=t.indexOf("=");if(r===-1)return[];let n=t.slice(0,r),o=t.slice(r+1);return[n,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[r,n])=>(r&&n&&(t[r]=n),t),{})}var qi=/^o(\d+)\./,Qi=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function ea(e){return e==="http"||e==="https"}function M(e,t=!1){let{host:r,path:n,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${r}${s?`:${s}`:""}/${n&&`${n}/`}${i}`}function ta(e){let t=Qi.exec(e);if(!t){b(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[r,n,o="",s="",i="",a=""]=t.slice(1),c="",p=a,u=p.split("/");if(u.length>1&&(c=u.slice(0,-1).join("/"),p=u.pop()),p){let f=p.match(/^\d+/);f&&(p=f[0])}return mo({host:s,pass:o,path:c,projectId:p,port:i,protocol:r,publicKey:n})}function mo(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function ra(e){if(!g)return!0;let{port:t,projectId:r,protocol:n}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(l.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:r.match(/^\d+$/)?ea(n)?t&&isNaN(parseInt(t,10))?(l.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(l.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(l.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function na(e){return e.match(qi)?.[1]}function go(e){let t=e.getOptions(),{host:r}=e.getDsn()||{},n;return t.orgId?n=String(t.orgId):r&&(n=na(r)),n}function _o(e){let t=typeof e=="string"?ta(e):mo(e);if(!(!t||!ra(t)))return t}function Qe(e){if(typeof e=="boolean")return Number(e);let t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}var So=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function ho(e){if(!e)return;let t=e.match(So);if(!t)return;let r;return t[3]==="1"?r=!0:t[3]==="0"&&(r=!1),{traceId:t[1],parentSampled:r,parentSpanId:t[2]}}function Dr(e,t){let r=ho(e),n=Lt(t);if(!r?.traceId)return{traceId:ze(),sampleRand:U()};let o=oa(r,n);n&&(n.sample_rand=o.toString());let{traceId:s,parentSpanId:i,parentSampled:a}=r;return{traceId:s,parentSpanId:i,sampled:a,dsc:n||{},sampleRand:o}}function oa(e,t){let r=Qe(t?.sample_rand);if(r!==void 0)return r;let n=Qe(t?.sample_rate);return n&&e?.parentSampled!==void 0?e.parentSampled?U()*n:n+U()*(1-n):U()}var Ur=1,Eo=!1;function kt(e){let{spanId:t,traceId:r,isRemote:n}=e.spanContext(),o=n?t:Ce(e).parent_span_id,s=le(e).scope,i=n?s?.getPropagationContext().propagationSpanId||Ze():t;return{parent_span_id:o,span_id:i,trace_id:r}}function aa(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:r,traceFlags:n,...o},attributes:s})=>({span_id:t,trace_id:r,sampled:n===Ur,attributes:s,...o}))}function ca(e){if(e?.length)return e.map(({context:{spanId:t,traceId:r,traceFlags:n},attributes:o})=>({span_id:t,trace_id:r,sampled:n===Ur,attributes:o}))}function Mt(e){return typeof e=="number"?To(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?To(e.getTime()):Rt()}function To(e){return e>9999999999?e/1e3:e}function Ce(e){if(bo(e))return e.getSpanJSON();let{spanId:t,traceId:r}=e.spanContext();if(yo(e)){let{attributes:n,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{span_id:t,trace_id:r,data:n,description:s,parent_span_id:Io(e),start_timestamp:Mt(o),timestamp:Mt(i)||void 0,status:pa(a),op:n[Lr],origin:n[Mr],links:aa(c)}}return{span_id:t,trace_id:r,start_timestamp:0,data:{}}}function Fr(e){if(bo(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:r}=e.spanContext();if(yo(e)){let{attributes:n,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{name:s,span_id:t,trace_id:r,parent_span_id:Io(e),start_timestamp:Mt(o),end_timestamp:Mt(i),is_segment:e===et(e),status:ua(a),attributes:n,links:ca(c)}}return{span_id:t,trace_id:r,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===et(e)}}function Io(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function Pt(e){return{...e,attributes:Ar(e.attributes),links:e.links?.map(t=>({...t,attributes:Ar(t.attributes)}))}}function yo(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function bo(e){return typeof e.getSpanJSON=="function"}function Dt(e){let{traceFlags:t}=e.spanContext();return t===Ur}function pa(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function ua(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var fa="_sentryRootSpan";var tt=et;function et(e){return e[fa]||e}function wr(){let e=D(),t=te(e);return t.getActiveSpan?t.getActiveSpan():Ne(A())}function rt(){Eo||(b(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Eo=!0)}function Br(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||T()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function xo(e){l.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Gr(e,t){if(!t?.length)return!1;for(let r of t){if(da(r)){if(e.description&&H(e.description,r))return g&&xo(e),!0;continue}let n=!!r.attributes&&Object.keys(r.attributes).length>0;if(!r.name&&!r.op&&!n)continue;let o=r.name?e.description&&H(e.description,r.name):!0,s=r.op?e.op&&H(e.op,r.op):!0,i=r.attributes?Object.entries(r.attributes).every(([a,c])=>la(e.attributes?.[a],c)):!0;if(o&&s&&i)return g&&xo(e),!0}return!1}function la(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?H(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((r,n)=>r===t[n]):e===t}function vo(e,t){let r=t.parent_span_id,n=t.span_id;if(r)for(let o of e)o.parent_span_id===n&&(o.parent_span_id=r)}function da(e){return typeof e=="string"||e instanceof RegExp}var ma=Symbol.for("sentry.nonRecordingSpan");function No(e){return!!e&&e[ma]===!0}var re="production";var ga="_frozenDsc";function Ro(e,t){let r=t.getOptions(),{publicKey:n}=t.getDsn()||{},o={environment:r.environment||re,release:r.release,public_key:n,trace_id:e,org_id:go(t)};return t.emit("createDsc",o),o}function nt(e,t){let r=t.getPropagationContext();return r.dsc||Ro(r.traceId,e)}function Oe(e){let t=T();if(!t)return{};let r=tt(e),n=Ce(r),o=n.data,s=r.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[Or]??o[eo];function a(_){return(typeof i=="number"||typeof i=="string")&&(_.sample_rate=`${i}`),_}let c=r[ga];if(c)return a(c);if(No(r)&&!Br(t.getOptions())){let _=le(r).scope;if(_)return a({...nt(t,_)})}let p=s?.get("sentry.dsc"),u=p&&Lt(p);if(u)return a(u);let f=Ro(e.spanContext().traceId,t),d=o[Ae]??o["sentry.span.source"],m=n.description;return d!=="url"&&m&&(f.transaction=m),Br()&&(f.sampled=String(Dt(r)),f.sample_rand=s?.get("sentry.sample_rand")??le(r).scope?.getPropagationContext().sampleRand.toString()),a(f),t.emit("createDsc",f,r),f}function Le(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function v(e,t=[]){return[e,t]}function Ut(e,t){let[r,n]=e;return[r,[...n,t]]}function ot(e,t){let r=e[1];for(let n of r){let o=n[0].type;if(t(n,o))return!0}return!1}function Yr(e,t){return ot(e,(r,n)=>t.includes(n))}function Hr(e){let t=K(h);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function st(e){let[t,r]=e,n=JSON.stringify(t);function o(s){typeof n=="string"?n=typeof s=="string"?n+s:[Hr(n),s]:n.push(typeof s=="string"?Hr(s):s)}for(let s of r){let[i,a]=s;if(o(`
4
+ Name: ${Ge(n)}
5
+ Error:`,o)}}var Un=Object.prototype.toString;function We(e){switch(Un.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Ie(e,Error)}}function bt(e,t){return Un.call(e)===`[object ${t}]`}function Fn(e){return bt(e,"ErrorEvent")}function Ve(e){return bt(e,"String")}function je(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function X(e){return e===null||je(e)||typeof e!="object"&&typeof e!="function"}function ue(e){return bt(e,"Object")}function wn(e){return typeof Event<"u"&&Ie(e,Event)}function Bn(e){return bt(e,"RegExp")}function j(e){return!!(e?.then&&typeof e.then=="function")}function Ie(e,t){try{return e instanceof t}catch{return!1}}function $e(e,t,r){if(!(t in e))return;let n=e[t];if(typeof n!="function")return;let o=r(n);typeof o=="function"&&xt(o,n);try{e[t]=o}catch{g&&l.log(`Failed to replace method "${t}" in object`,e)}}function ye(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{g&&l.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function xt(e,t){try{let r=t.prototype||{};e.prototype=t.prototype=r,ye(e,"__sentry_original__",t)}catch{}}function dr(e){return e.__sentry_original__}function vt(e){if(We(e))return{message:e.message,name:e.name,stack:e.stack,...Gn(e)};if(wn(e)){let{type:t,target:r,currentTarget:n,detail:o}=e;return{type:t,target:r,currentTarget:n,...o?{detail:o}:{},...Gn(e)}}return e}function Gn(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function mr(e){let t=Object.keys(vt(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}function gr(e){try{let t=h.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Nt(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var _r="_sentrySpan";function fe(e,t){t?ye(e,_r,gr(t)):delete e[_r]}function be(e){return Nt(e[_r])}var xe;function ve(e){if(xe!==void 0)return xe?xe(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),r=h;return t in r&&typeof r[t]=="function"?(xe=r[t],xe(e)):(xe=null,e())}function U(){return ve(()=>Math.random())}function C(){return ve(()=>Date.now())}var Li=Symbol.for("sentry.skipNormalization"),Mi=Symbol.for("sentry.overrideNormalizationDepth");function Hn(e){return!!e[Li]}function Yn(e){let t=e[Mi];return typeof t=="number"?t:void 0}var Wn;function B(e,t=100,r=1/0){try{return Sr("",e,t,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function hr(e,t=3,r=100*1024){let n=B(e,t);return Di(n)>r?hr(e,t-1,r):n}function Sr(e,t,r=1/0,n=1/0,o=Ui()){let[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=Er(e,t);if(!a.startsWith("[object "))return a;if(Hn(t))return t;let c=Yn(t),p=c!==void 0?c:r;if(p===0)return a.replace("object ","");if(s(t))return"[Circular ~]";let u=t;if(u&&typeof u.toJSON=="function")try{let _=u.toJSON();return Sr("",_,p-1,n,o)}catch{}let f=Array.isArray(t)?[]:{},d=0,m=vt(t);for(let _ in m){if(!Object.prototype.hasOwnProperty.call(m,_))continue;if(d>=n){f[_]="[MaxProperties ~]";break}let S=m[_];f[_]=Sr(_,S,p-1,n,o),d++}return i(t),f}function Er(e,t){try{if(Wn){let n=Wn(t);if(n)return n}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${Ge(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${ki(t)}]`}catch(r){return`**non-serializable** (${r})`}}function ki(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function Pi(e){return~-encodeURI(e).split(/%..|./).length}function Di(e){return Pi(JSON.stringify(e))}function Ui(){let e=new WeakSet;function t(n){return e.has(n)?!0:(e.add(n),!1)}function r(n){e.delete(n)}return[t,r]}function Ne(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function Tr(e,t){let r=e,n=r.length;if(n<=150)return r;t>n&&(t=n);let o=Math.max(t-60,0);o<5&&(o=0);let s=Math.min(o+140,n);return s>n-5&&(s=n),s===n&&(o=Math.max(s-140,0)),r=r.slice(o,s),o>0&&(r=`'{snip} ${r}`),s<n&&(r+=" {snip}"),r}function Ir(e,t){if(!Array.isArray(e))return"";let r=[];for(let n=0;n<e.length;n++){let o=e[n];X(o)?r.push(String(o)):o instanceof Error?r.push(o.message?`${o.name}: ${o.message}`:o.name):r.push(Er(void 0,o))}return r.join(t)}function H(e,t,r=!1){return Ve(e)?Bn(t)?t.test(e):Ve(t)?r?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function q(e,t=[],r=!1){for(let n of t)if(H(e,n,r))return!0;return!1}function Fi(){let e=h;return e.crypto||e.msCrypto}var yr;function wi(){return U()*16}function y(e=Fi()){try{if(e?.randomUUID)return ve(()=>e.randomUUID()).replace(/-/g,"")}catch{}return yr||(yr="10000000100040008000"+1e11),yr.replace(/[018]/g,t=>(t^(wi()&15)>>t/4).toString(16))}function Vn(e){return e.exception?.values?.[0]}function Q(e){let{message:t,event_id:r}=e;if(t)return t;let n=Vn(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function xr(e,t,r){let n=e.exception=e.exception||{},o=n.values=n.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type=r||"Error")}function Re(e,t){let r=Vn(e);if(!r)return;let n={type:"generic",handled:!0},o=r.mechanism;if(r.mechanism={...n,...o,...t},t&&"data"in t){let s={...o?.data,...t.data};r.mechanism.data=s}}var Bi=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function br(e){return parseInt(e||"",10)}function vr(e){let t=e.match(Bi)||[],r=br(t[1]),n=br(t[2]),o=br(t[3]);return{buildmetadata:t[5],major:isNaN(r)?void 0:r,minor:isNaN(n)?void 0:n,patch:isNaN(o)?void 0:o,prerelease:t[4]}}function Rt(e){if(jn(e))return!0;try{ye(e,"__sentry_captured__",!0)}catch{}return!1}function jn(e){try{return e.__sentry_captured__}catch{}}var zn=1e3;function $(){return C()/zn}function Gi(){let{performance:e}=h;if(!e?.now||!e.timeOrigin)return $;let t=e.timeOrigin;return()=>(t+ve(()=>e.now()))/zn}var $n;function At(){return($n??($n=Gi()))()}function ze(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||At(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:y()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let r=e.timestamp-e.started;e.duration=r>=0?r:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function ee(e,t,r=2){if(!t||typeof t!="object"||r<=0)return t;if(e&&Object.keys(t).length===0)return e;let n={...e};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=ee(n[o],t[o],r-1));return n}function Ze(){return y()}function Je(){return y().substring(16)}var Hi=100,O=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ze(),sampleRand:U()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,fe(t,be(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&ze(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,r){return this.setTags({[t]:r})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,r){return this.setAttributes({[t]:r})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,r){return this._extra={...this._extra,[t]:r},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,r){return r===null?delete this._contexts[t]:this._contexts[t]=r,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let r=typeof t=="function"?t(this):t,n=r instanceof e?r.getScopeData():ue(r)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:c,level:p,fingerprint:u=[],propagationContext:f,conversationId:d}=n||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),p&&(this._level=p),u.length&&(this._fingerprint=u),f&&(this._propagationContext=f),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,fe(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ze(),sampleRand:U()}),this._notifyScopeListeners(),this}addBreadcrumb(t,r){let n=typeof r=="number"?r:Hi;if(n<=0)return this;let o={timestamp:$(),...t,message:t.message?Ne(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:be(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=ee(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,r){let n=r?.event_id||y();if(!this._client)return g&&l.warn("No client configured on scope - will not capture exception!"),n;let o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...r,event_id:n},this),n}captureMessage(t,r,n){let o=n?.event_id||y();if(!this._client)return g&&l.warn("No client configured on scope - will not capture message!"),o;let s=n?.syntheticException??new Error(t);return this._client.captureMessage(t,r,{originalException:t,syntheticException:s,...n,event_id:o},this),o}captureEvent(t,r){let n=t.event_id||r?.event_id||y();return this._client?(this._client.captureEvent(t,{...r,event_id:n},this),n):(g&&l.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function Ke(){return F("defaultCurrentScope",()=>new O)}function Xe(){return F("defaultIsolationScope",()=>new O)}var Zn=e=>e instanceof Promise&&!e[Jn],Jn=Symbol("chained PromiseLike"),Kn=(e,t,r)=>{let n=e.then(o=>(t(o),o),o=>{throw r(o),o});return Zn(n)&&Zn(e)?n:Yi(e,n)},Yi=(e,t)=>{if(!t)return e;let r=!1;for(let n in e){if(n in t)continue;r=!0;let o=e[n];typeof o=="function"?Object.defineProperty(t,n,{value:(...s)=>o.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[n]=o}return r&&Object.assign(t,{[Jn]:!0}),t};var Nr=class{constructor(t,r){let n;t?n=t:n=new O;let o;r?o=r:o=new O,this._stack=[{scope:n}],this._isolationScope=o}withScope(t){let r=this._pushScope(),n;try{n=t(r)}catch(o){throw this._popScope(),o}return j(n)?Kn(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Ae(){let e=D(),t=K(e);return t.stack=t.stack||new Nr(Ke(),Xe())}function Wi(e){return Ae().withScope(e)}function Vi(e,t){let r=Ae();return r.withScope(()=>(r.getStackTop().scope=e,t(e)))}function Xn(e){return Ae().withScope(()=>e(Ae().getIsolationScope()))}function qn(){return{withIsolationScope:Xn,withScope:Wi,withSetScope:Vi,withSetIsolationScope:(e,t)=>Xn(t),getCurrentScope:()=>Ae().getScope(),getIsolationScope:()=>Ae().getIsolationScope()}}function Rr(e){let t=D(),r=K(t);r.acs=e}function te(e){let t=K(e);return t.acs?t.acs:qn()}function Ar(e,t){return{asyncLocalStorage:e,getStoreWithActiveSpan:r=>{let{scope:n,isolationScope:o}=t(),s=n.clone();return fe(s,r),{scope:s,isolationScope:o}}}}function ji(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function $i(e,t){let{value:r,unit:n}=ji(e)?e:{value:e,unit:void 0},o=zi(r),s=n&&typeof n=="string"?{unit:n}:{};if(o)return{...o,...s};if(!t||t==="skip-undefined"&&r===void 0)return;let i="";try{i=JSON.stringify(r)??""}catch{}return{value:i,type:"string",...s}}function Cr(e,t=!1){let r={};for(let[n,o]of Object.entries(e??{})){let s=$i(o,t);s&&(r[n]=s)}return r}function Or(e){if(!e)return 0;let t=0;for(let[r,n]of Object.entries(e)){t+=r.length*2,t+=n.type.length*2,t+=(n.unit?.length??0)*2;let o=n.value;Array.isArray(o)?t+=Qn(o[0])*o.length:X(o)?t+=Qn(o):t+=100}return t}function Qn(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function zi(e){if(Array.isArray(e))return{value:e,type:"array"};let t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}var Zi;function eo(){return Zi?.()}function A(){let e=D();return te(e).getCurrentScope()}function L(){let e=D();return te(e).getIsolationScope()}function Ct(){return F("globalScope",()=>new O)}function le(...e){let t=D(),r=te(t);if(e.length===2){let[n,o]=e;return n?r.withSetScope(n,o):r.withScope(o)}return r.withScope(e[0])}function T(){return A().getClient()}function qe(e){let t=eo();if(t)return{trace_id:t.traceId,span_id:t.spanId};let r=e.getPropagationContext(),{traceId:n,parentSpanId:o,propagationSpanId:s}=r,i={trace_id:n,span_id:s||Je()};return o&&(i.parent_span_id=o),i}var Ce="sentry.source",Lr="sentry.sample_rate",to="sentry.previous_trace_sample_rate",Mr="sentry.op",kr="sentry.origin";var ro="sentry.release",no="sentry.environment",oo="sentry.segment.name",so="sentry.segment.id",io="sentry.sdk.name",ao="sentry.sdk.version",co="sentry.sdk.integrations",po="user.id",uo="user.email",Ot="user.ip_address",fo="user.name";var Pr="sentry.profile_id",Dr="sentry.exclusive_time";var Ji="_sentryScope",Ki="_sentryIsolationScope";function de(e){let t=e;return{scope:t[Ji],isolationScope:Nt(t[Ki])}}var lo="sentry-";function Lt(e){let t=Xi(e);if(!t)return;let r=Object.entries(t).reduce((n,[o,s])=>{if(o.startsWith(lo)){let i=o.slice(lo.length);n[i]=s}return n},{});if(Object.keys(r).length>0)return r}function Xi(e){if(!(!e||!Ve(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,r)=>{let n=mo(r);return Object.entries(n).forEach(([o,s])=>{t[o]=s}),t},{}):mo(e)}function mo(e){return e.split(",").map(t=>{let r=t.indexOf("=");if(r===-1)return[];let n=t.slice(0,r),o=t.slice(r+1);return[n,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[r,n])=>(r&&n&&(t[r]=n),t),{})}var qi=/^o(\d+)\./,Qi=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function ea(e){return e==="http"||e==="https"}function M(e,t=!1){let{host:r,path:n,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${r}${s?`:${s}`:""}/${n&&`${n}/`}${i}`}function ta(e){let t=Qi.exec(e);if(!t){b(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[r,n,o="",s="",i="",a=""]=t.slice(1),c="",p=a,u=p.split("/");if(u.length>1&&(c=u.slice(0,-1).join("/"),p=u.pop()),p){let f=p.match(/^\d+/);f&&(p=f[0])}return go({host:s,pass:o,path:c,projectId:p,port:i,protocol:r,publicKey:n})}function go(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function ra(e){if(!g)return!0;let{port:t,projectId:r,protocol:n}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(l.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:r.match(/^\d+$/)?ea(n)?t&&isNaN(parseInt(t,10))?(l.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(l.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(l.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function na(e){return e.match(qi)?.[1]}function _o(e){let t=e.getOptions(),{host:r}=e.getDsn()||{},n;return t.orgId?n=String(t.orgId):r&&(n=na(r)),n}function So(e){let t=typeof e=="string"?ta(e):go(e);if(!(!t||!ra(t)))return t}function Qe(e){if(typeof e=="boolean")return Number(e);let t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}var ho=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function Eo(e){if(!e)return;let t=e.match(ho);if(!t)return;let r;return t[3]==="1"?r=!0:t[3]==="0"&&(r=!1),{traceId:t[1],parentSampled:r,parentSpanId:t[2]}}function Ur(e,t){let r=Eo(e),n=Lt(t);if(!r?.traceId)return{traceId:Ze(),sampleRand:U()};let o=oa(r,n);n&&(n.sample_rand=o.toString());let{traceId:s,parentSpanId:i,parentSampled:a}=r;return{traceId:s,parentSpanId:i,sampled:a,dsc:n||{},sampleRand:o}}function oa(e,t){let r=Qe(t?.sample_rand);if(r!==void 0)return r;let n=Qe(t?.sample_rate);return n&&e?.parentSampled!==void 0?e.parentSampled?U()*n:n+U()*(1-n):U()}var Fr=1,To=!1;function kt(e){let{spanId:t,traceId:r,isRemote:n}=e.spanContext(),o=n?t:Oe(e).parent_span_id,s=de(e).scope,i=n?s?.getPropagationContext().propagationSpanId||Je():t;return{parent_span_id:o,span_id:i,trace_id:r}}function aa(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:r,traceFlags:n,...o},attributes:s})=>({span_id:t,trace_id:r,sampled:n===Fr,attributes:s,...o}))}function ca(e){if(e?.length)return e.map(({context:{spanId:t,traceId:r,traceFlags:n},attributes:o})=>({span_id:t,trace_id:r,sampled:n===Fr,attributes:o}))}function Mt(e){return typeof e=="number"?Io(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Io(e.getTime()):At()}function Io(e){return e>9999999999?e/1e3:e}function Oe(e){if(xo(e))return e.getSpanJSON();let{spanId:t,traceId:r}=e.spanContext();if(bo(e)){let{attributes:n,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{span_id:t,trace_id:r,data:n,description:s,parent_span_id:yo(e),start_timestamp:Mt(o),timestamp:Mt(i)||void 0,status:pa(a),op:n[Mr],origin:n[kr],links:aa(c)}}return{span_id:t,trace_id:r,start_timestamp:0,data:{}}}function wr(e){if(xo(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:r}=e.spanContext();if(bo(e)){let{attributes:n,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{name:s,span_id:t,trace_id:r,parent_span_id:yo(e),start_timestamp:Mt(o),end_timestamp:Mt(i),is_segment:e===et(e),status:ua(a),attributes:n,links:ca(c)}}return{span_id:t,trace_id:r,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===et(e)}}function yo(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function Pt(e){return{...e,attributes:Cr(e.attributes),links:e.links?.map(t=>({...t,attributes:Cr(t.attributes)}))}}function bo(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function xo(e){return typeof e.getSpanJSON=="function"}function Dt(e){let{traceFlags:t}=e.spanContext();return t===Fr}function pa(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function ua(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var fa="_sentryRootSpan";var tt=et;function et(e){return e[fa]||e}function Br(){let e=D(),t=te(e);return t.getActiveSpan?t.getActiveSpan():be(A())}function rt(){To||(b(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),To=!0)}function Gr(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||T()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function vo(e){l.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Hr(e,t){if(!t?.length)return!1;for(let r of t){if(da(r)){if(e.description&&H(e.description,r))return g&&vo(e),!0;continue}let n=!!r.attributes&&Object.keys(r.attributes).length>0;if(!r.name&&!r.op&&!n)continue;let o=r.name?e.description&&H(e.description,r.name):!0,s=r.op?e.op&&H(e.op,r.op):!0,i=r.attributes?Object.entries(r.attributes).every(([a,c])=>la(e.attributes?.[a],c)):!0;if(o&&s&&i)return g&&vo(e),!0}return!1}function la(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?H(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((r,n)=>r===t[n]):e===t}function No(e,t){let r=t.parent_span_id,n=t.span_id;if(r)for(let o of e)o.parent_span_id===n&&(o.parent_span_id=r)}function da(e){return typeof e=="string"||e instanceof RegExp}var ma=Symbol.for("sentry.nonRecordingSpan");function Ro(e){return!!e&&e[ma]===!0}var re="production";var ga="_frozenDsc";function Ao(e,t){let r=t.getOptions(),{publicKey:n}=t.getDsn()||{},o={environment:r.environment||re,release:r.release,public_key:n,trace_id:e,org_id:_o(t)};return t.emit("createDsc",o),o}function nt(e,t){let r=t.getPropagationContext();return r.dsc||Ao(r.traceId,e)}function Le(e){let t=T();if(!t)return{};let r=tt(e),n=Oe(r),o=n.data,s=r.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[Lr]??o[to];function a(_){return(typeof i=="number"||typeof i=="string")&&(_.sample_rate=`${i}`),_}let c=r[ga];if(c)return a(c);if(Ro(r)&&!Gr(t.getOptions())){let _=de(r).scope;if(_)return a({...nt(t,_)})}let p=s?.get("sentry.dsc"),u=p&&Lt(p);if(u)return a(u);let f=Ao(e.spanContext().traceId,t),d=o[Ce]??o["sentry.span.source"],m=n.description;return d!=="url"&&m&&(f.transaction=m),Gr()&&(f.sampled=String(Dt(r)),f.sample_rand=s?.get("sentry.sample_rand")??de(r).scope?.getPropagationContext().sampleRand.toString()),a(f),t.emit("createDsc",f,r),f}function Me(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function v(e,t=[]){return[e,t]}function Ut(e,t){let[r,n]=e;return[r,[...n,t]]}function ot(e,t){let r=e[1];for(let n of r){let o=n[0].type;if(t(n,o))return!0}return!1}function Wr(e,t){return ot(e,(r,n)=>t.includes(n))}function Yr(e){let t=K(h);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function st(e){let[t,r]=e,n=JSON.stringify(t);function o(s){typeof n=="string"?n=typeof s=="string"?n+s:[Yr(n),s]:n.push(typeof s=="string"?Yr(s):s)}for(let s of r){let[i,a]=s;if(o(`
6
6
  ${JSON.stringify(i)}
7
- `),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(B(a))}o(c)}}return typeof n=="string"?n:_a(n)}function _a(e){let t=e.reduce((o,s)=>o+s.length,0),r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}function Wr(e){let t=typeof e.data=="string"?Hr(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Ao={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 Sa(e){return e in Ao}function Ft(e){return Sa(e)?Ao[e]:e}function Me(e){if(!e?.sdk)return;let{name:t,version:r}=e.sdk;return{name:t,version:r}}function Vr(e,t,r,n){let o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(C()).toISOString(),...t&&{sdk:t},...!!r&&n&&{dsn:M(n)},...o&&{trace:o}}}function Ea(e,t){if(!t)return e;let r=e.sdk||{};return e.sdk={...r,name:r.name||t.name,version:r.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function Co(e,t,r,n){let o=Me(r),s={sent_at:new Date(C()).toISOString(),...o&&{sdk:o},...!!n&&t&&{dsn:M(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return v(s,[i])}function Oo(e,t,r,n){let o=Me(r),s=e.type&&e.type!=="replay_event"?e.type:"event";Ea(e,r?.sdk);let i=Vr(e,o,n,t);return delete e.sdkProcessingMetadata,v(i,[[{type:s},e]])}function wt(e){return e.getOptions().traceLifecycle==="stream"}var it="__SENTRY_SUPPRESS_TRACING__";function Bt(e,t){let r=Lo();return r.withActiveSpan?r.withActiveSpan(e,t):fe(n=>(Je(n,e||void 0),t(n)))}function ke(e){let t=Lo();return t.suppressTracing?t.suppressTracing(e):fe(r=>{r.setSDKProcessingMetadata({[it]:!0});let n=e();return r.setSDKProcessingMetadata({[it]:void 0}),n})}function Lo(){let e=D();return te(e)}function ko(e,t){let{fingerprint:r,span:n,breadcrumbs:o,sdkProcessingMetadata:s}=t;Ta(e,t),n&&ba(e,n),xa(e,r),Ia(e,o),ya(e,s)}function Mo(e,t){let{extra:r,tags:n,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:p,fingerprint:u,eventProcessors:f,attachments:d,propagationContext:m,transactionName:_,span:S}=t;at(e,"extra",r),at(e,"tags",n),at(e,"attributes",o),at(e,"user",s),at(e,"contexts",i),e.sdkProcessingMetadata=ee(e.sdkProcessingMetadata,c,2),a&&(e.level=a),_&&(e.transactionName=_),S&&(e.span=S),p.length&&(e.breadcrumbs=[...e.breadcrumbs,...p]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...m}}function at(e,t,r){e[t]=ee(e[t],r,1)}function Gt(e,t){let r=Ct().getScopeData();return e&&Mo(r,e.getScopeData()),t&&Mo(r,t.getScopeData()),r}function Ta(e,t){let{extra:r,tags:n,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(r).length&&(e.extra={...r,...e.extra}),Object.keys(n).length&&(e.tags={...n,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),i&&(e.level=i),a&&e.type!=="transaction"&&(e.transaction=a)}function Ia(e,t){let r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}function ya(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function ba(e,t){e.contexts={trace:kt(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Oe(t),...e.sdkProcessingMetadata};let r=tt(t),n=Ce(r).description;n&&!e.transaction&&e.type==="transaction"&&(e.transaction=n)}function xa(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function Po(e){let t={},{response:r,profile:n,cloud_resource:o,culture:s,state:i}=e;if(r&&(r.status_code!=null&&(t["http.response.status_code"]=r.status_code),r.body_size!=null&&(t["http.response.body.size"]=r.body_size)),n&&(n.profile_id&&(t["sentry.profile_id"]=n.profile_id),n.profiler_id&&(t["sentry.profiler_id"]=n.profiler_id)),o)for(let[p,u]of Object.entries(o))u!=null&&(t[p]=u);s&&(s.locale&&(t["culture.locale"]=s.locale),s.timezone&&(t["culture.timezone"]=s.timezone)),i?.state&&typeof i.state.type=="string"&&(t["state.type"]=i.state.type);let a=e.angular;if(a){let p=a.version;(typeof p=="string"||typeof p=="number")&&(t["angular.version"]=p)}let c=e.react;if(c){let p=c.version;(typeof p=="string"||typeof p=="number")&&(t["react.version"]=p)}return t}function jr(e,t){let r=Fr(e),n=et(e),o=Fr(n),{isolationScope:s,scope:i}=le(e),a=Gt(s,i);Ra(r,o,t,a);let c=e.kind;t.emit("preprocessSpan",r,{spanKind:c}),r.is_segment&&(va(r,a),Na(r,t),t.emit("processSegmentSpan",r)),t.emit("processSpan",r);let{beforeSendSpan:p}=t.getOptions(),u=p&&Le(p)?Aa(r,p):r,f=u.attributes?.[Ae];return f&&k(u,{"sentry.span.source":f}),{...Pt(u),_segmentSpan:n}}function va(e,t){let r=Po(t.contexts);k(e,r)}function k(e,t){let r=e.attributes??(e.attributes={});Object.entries(t).forEach(([n,o])=>{o!=null&&!(n in r)&&(r[n]=o)})}function Na(e,t){let r=t.getIntegrationNames();r.length&&k(e,{[ao]:r})}function Ra(e,t,r,n){let o=r.getSdkMetadata(),{release:s,environment:i}=r.getOptions();k(e,{[to]:s,[ro]:i||re,[no]:t.name,[oo]:t.span_id,[so]:o?.sdk?.name,[io]:o?.sdk?.version,[co]:n.user?.id,[po]:n.user?.email,[Ot]:n.user?.ip_address,[uo]:n.user?.username,...n.attributes})}function Aa(e,t){let r=t(e);return r||(rt(),e)}var $r=0,Do=1,Uo=2;function z(e){return new Ht(t=>{t(e)})}function Pe(e){return new Ht((t,r)=>{r(e)})}var Ht=class e{constructor(t){this._state=$r,this._handlers=[],this._runExecutor(t)}then(t,r){return new e((n,o)=>{this._handlers.push([!1,s=>{if(!t)n(s);else try{n(t(s))}catch(i){o(i)}},s=>{if(!r)o(s);else try{n(r(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(r=>r,t)}finally(t){return new e((r,n)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){n(o);return}r(o)})})}_executeHandlers(){if(this._state===$r)return;let t=this._handlers.slice();this._handlers=[],t.forEach(r=>{r[0]||(this._state===Do&&r[1](this._value),this._state===Uo&&r[2](this._value),r[0]=!0)})}_runExecutor(t){let r=(s,i)=>{if(this._state===$r){if(j(i)){i.then(n,o);return}this._state=s,this._value=i,this._executeHandlers()}},n=s=>{r(Do,s)},o=s=>{r(Uo,s)};try{t(n,o)}catch(s){o(s)}}};function Fo(e,t,r,n=0){try{let o=zr(t,r,e,n);return j(o)?o:z(o)}catch(o){return Pe(o)}}function zr(e,t,r,n){let o=r[n];if(!e||!o)return e;let s=o({...e},t);return g&&s===null&&l.log(`Event processor "${o.id||"?"}" dropped event`),j(s)?s.then(i=>zr(i,t,r,n+1)):zr(s,t,r,n+1)}var de,wo,Bo,ne;function Go(e){let t=h._sentryDebugIds,r=h._debugIds;if(!t&&!r)return{};let n=t?Object.keys(t):[],o=r?Object.keys(r):[];if(ne&&n.length===wo&&o.length===Bo)return ne;wo=n.length,Bo=o.length,ne={},de||(de={});let s=(i,a)=>{for(let c of i){let p=a[c],u=de?.[c];if(u&&ne&&p)ne[u[0]]=p,de&&(de[c]=[u[0],p]);else if(p){let f=e(c);for(let d=f.length-1;d>=0;d--){let _=f[d]?.filename;if(_&&ne&&de){ne[_]=p,de[c]=[_,p];break}}}}};return t&&s(n,t),r&&s(o,r),ne}function Ho(e,t,r,n,o,s){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||r.event_id||y(),timestamp:t.timestamp||$()},p=r.integrations||e.integrations.map(x=>x.name);Ca(c,e),Ma(c,p),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&Oa(c,e.stackParser);let u=Pa(n,r.captureContext);r.mechanism&&ve(c,r.mechanism);let f=o?o.getEventProcessors():[],d=Gt(s,u),m=[...r.attachments||[],...d.attachments];m.length&&(r.attachments=m),ko(c,d);let _=[...f,...d.eventProcessors];return(r.data&&r.data.__sentry__===!0?z(c):Fo(_,c,r)).then(x=>(x&&La(x),typeof i=="number"&&i>0?ka(x,i,a):x))}function Ca(e,t){let{environment:r,release:n,dist:o,maxValueLength:s}=t;e.environment=e.environment||r||re,!e.release&&n&&(e.release=n),!e.dist&&o&&(e.dist=o);let i=e.request;i?.url&&s&&(i.url=xe(i.url,s)),s&&e.exception?.values?.forEach(a=>{a.value&&(a.value=xe(a.value,s))})}function Oa(e,t){let r=Go(t);e.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=r[o.filename])})})}function La(e){let t={};if(e.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let r=e.debug_meta.images;Object.entries(t).forEach(([n,o])=>{r.push({type:"sourcemap",code_file:n,debug_id:o})})}function Ma(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function ka(e,t,r){if(!e)return null;let n={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:B(o.data,t,r)}}))},...e.user&&{user:B(e.user,t,r)},...e.contexts&&{contexts:B(e.contexts,t,r)},...e.extra&&{extra:B(e.extra,t,r)}};return e.contexts?.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=B(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(o=>({...o,...o.data&&{data:B(o.data,t,r)}}))),e.contexts?.flags&&n.contexts&&(n.contexts.flags=B(e.contexts.flags,3,r)),n}function Pa(e,t){if(!t)return e;let r=e?e.clone():new O;return r.update(t),r}function Yo(e){if(e)return Da(e)?{captureContext:e}:Fa(e)?{captureContext:e}:e}function Da(e){return e instanceof O||typeof e=="function"}var Ua=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Fa(e){return Object.keys(e).some(t=>Ua.includes(t))}function oe(e,t){return A().captureException(e,Yo(t))}function Yt(e,t){let r=typeof t=="string"?t:void 0,n=typeof t!="string"?{captureContext:t}:void 0;return A().captureMessage(e,r,n)}function Wt(e){L().setTags(e)}function Vt(e){L().setUser(e)}var wa="7";function Ba(e){let t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function Ga(e){return`${Ba(e)}${e.projectId}/envelope/`}function Ha(e,t){let r={sentry_version:wa};return e.publicKey&&(r.sentry_key=e.publicKey),t&&(r.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(r).toString()}function Vo(e,t,r){return t||`${Ga(e)}?${Ha(e,r)}`}var Zr=[];function Ya(e){let t={};return e.forEach(r=>{let{name:n}=r,o=t[n];o&&!o.isDefaultInstance&&r.isDefaultInstance||(t[n]=r)}),Object.values(t)}function Jr(e){let t=e.defaultIntegrations||[],r=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let n;if(Array.isArray(r))n=[...t,...r];else if(typeof r=="function"){let o=r(t);n=Array.isArray(o)?o:[o]}else n=t;return Ya(n)}function jo(e,t){let r={};return t.forEach(n=>{n?.beforeSetup&&n.beforeSetup(e)}),t.forEach(n=>{n&&Xr(e,n,r)}),r}function Kr(e,t){for(let r of t)r?.afterAllSetup&&r.afterAllSetup(e)}function Xr(e,t,r){if(r[t.name]){g&&l.log(`Integration skipped because it was already installed: ${t.name}`);return}if(r[t.name]=t,!Zr.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Zr.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>n(o,s,e))}if(typeof t.processEvent=="function"){let n=t.processEvent.bind(t),o=Object.assign((s,i)=>n(s,i,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(n=>{let o=t[n];typeof o=="function"&&e.on(n,s=>o.call(t,s,e))}),g&&l.log(`Integration installed: ${t.name}`)}function $o(e,t){return t?fe(t,()=>{let r=wr(),n=r?kt(r):qe(t);return[r?Oe(r):nt(e,t),n]}):[void 0,void 0]}function zo(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Zo(){return!zo()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function se(){return typeof window<"u"&&(!Zo()||Wa())}function Wa(){return h.process?.type==="renderer"}function Va(e,t){let r=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...se()&&{ingest_settings:{infer_ip:r,infer_user_agent:r}},items:e}]}function Jo(e,t,r,n,o){let s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),r&&n&&(s.dsn=M(n)),v(s,[Va(e,o)])}function De(e,t){let r=t??ja(e)??[];if(r.length===0)return;let n=e.getOptions(),o=Jo(r,n._metadata,n.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);Ko().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function ja(e){return Ko().get(e)}function Ko(){return F("clientToLogBufferMap",()=>new WeakMap)}function $a(e,t){let r=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...se()&&{ingest_settings:{infer_ip:r,infer_user_agent:r}},items:e}]}function Xo(e,t,r,n,o){let s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),r&&n&&(s.dsn=M(n)),v(s,[$a(e,o)])}function qo(e,t){let r=t??za(e)??[];if(r.length===0)return;let n=e.getOptions(),o=Xo(r,n._metadata,n.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);Qo().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function za(e){return Qo().get(e)}function Qo(){return F("clientToMetricBufferMap",()=>new WeakMap)}function es(e){let t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status==="ok"||e.status==="cancelled"?"ok":"error",is_segment:!1,attributes:{...e.data},links:e.links};return Pt(t)}function ts(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||!t.getOptions().streamGenAiSpans||wt(t))return;let r=[],n=[];for(let s of e.spans)s.op?.startsWith("gen_ai.")?r.push(es(s)):n.push(s);if(r.length===0)return;e.spans=n;let o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:r.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...se()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:r}]}function Ue(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var ct=Symbol.for("SentryBufferFullError");function Fe(e=100){let t=new Set;function r(){return t.size<e}function n(i){t.delete(i)}function o(i){if(!r())return Pe(ct);let a=i();return t.add(a),a.then(()=>n(a),()=>n(a)),a}function s(i){if(!t.size)return z(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;let c=[a,new Promise(p=>Ue(setTimeout(()=>p(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:s}}var Za=60*1e3;function Ja(e,t=C()){let r=parseInt(`${e}`,10);if(!isNaN(r))return r*1e3;let n=Date.parse(`${e}`);return isNaN(n)?Za:n-t}function Ka(e,t){return e[t]||e.all||0}function rs(e,t,r=C()){return Ka(e,t)>r}function ns(e,{statusCode:t,headers:r},n=C()){let o={...e},s=r?.["x-sentry-rate-limits"],i=r?.["retry-after"];if(s)for(let a of s.trim().split(",")){let[c,p,,,u]=a.split(":",5),f=parseInt(c,10),d=(isNaN(f)?60:f)*1e3;if(!p)o.all=n+d;else for(let m of p.split(";"))m==="metric_bucket"?(!u||u.split(";").includes("custom"))&&(o[m]=n+d):o[m]=n+d}else i?o.all=n+Ja(i,n):t===429&&(o.all=n+60*1e3);return o}var pt=64;function ut(e,t,r=Fe(e.bufferSize||pt)){let n={},o=i=>r.drain(i);function s(i){let a=[];if(ot(i,(f,d)=>{let m=Ft(d);rs(n,m)?e.recordDroppedEvent("ratelimit_backoff",m):a.push(f)}),a.length===0)return Promise.resolve({});let c=v(i[0],a),p=f=>{if(Yr(c,["client_report"])){g&&l.warn(`Dropping client report. Will not send outcomes (reason: ${f}).`);return}ot(c,(d,m)=>{e.recordDroppedEvent(f,Ft(m))})},u=()=>t({body:st(c)}).then(f=>f.statusCode===413?(g&&l.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),p("send_error"),f):(g&&f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&l.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),n=ns(n,f),f),f=>{throw p("network_error"),g&&l.error("Encountered error running transport request:",f),f});return r.add(u).then(f=>f,f=>{if(f===ct)return g&&l.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw f})}return{send:s,flush:o}}function os(e,t,r){let n=[{type:"client_report"},{timestamp:r||$(),discarded_events:e}];return v(t?{dsn:t}:{},[n])}function jt(e){let t=[];e.message&&t.push(e.message);try{let r=e.exception.values[e.exception.values.length-1];r?.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`))}catch{}return t}function ss(e){let{trace_id:t,parent_span_id:r,span_id:n,status:o,origin:s,data:i,op:a}=e.contexts?.trace??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:r,span_id:n??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i?.[kr],exclusive_time:i?.[Pr],measurements:e.measurements,is_segment:!0}}function is(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[kr]:e.profile_id},...e.exclusive_time&&{[Pr]:e.exclusive_time}}}},measurements:e.measurements}}var me="[Filtered]",ft=["forwarded","-ip","remote-","via","-user"],qr=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"],as=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"];function $t(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:ft},httpHeaders:{request:{deny:ft},response:{deny:ft}},httpBodies:[],queryParams:{deny:ft},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:7}}var Xa={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5};function cs(e){let t=e.dataCollection!=null?Xa:$t(e.sendDefaultPii),r=e.dataCollection??{};return{userInfo:r.userInfo??t.userInfo,cookies:r.cookies??t.cookies,httpHeaders:{request:r.httpHeaders?.request??t.httpHeaders.request,response:r.httpHeaders?.response??t.httpHeaders.response},httpBodies:r.httpBodies??t.httpBodies,queryParams:r.queryParams??t.queryParams,genAI:{inputs:r.genAI?.inputs??t.genAI.inputs,outputs:r.genAI?.outputs??t.genAI.outputs},stackFrameVariables:r.stackFrameVariables??t.stackFrameVariables,frameContextLines:r.frameContextLines??t.frameContextLines}}var ps="Not capturing exception because it's already been captured.",us="Discarded session because of missing or non-string release",_s=Symbol.for("SentryInternalError"),Ss=Symbol.for("SentryDoNotSendEventError"),qa=5e3;function zt(e){return{message:e,[_s]:!0}}function Qr(e){return{message:e,[Ss]:!0}}function fs(e){return!!e&&typeof e=="object"&&_s in e}function ls(e){return!!e&&typeof e=="object"&&Ss in e}function ds(e,t,r,n,o){let s=0,i,a=!1;e.on(r,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,c=>{if(s+=n(c),s>=8e5)o(e);else if(!a){let p=e.getOptions()._flushInterval??qa;p>0&&(a=!0,i=Ue(setTimeout(()=>{o(e)},p)))}}),e.on("flush",()=>{o(e)})}var Zt=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Fe(t.transportOptions?.bufferSize??pt),this._dataCollection=cs(t),t.dsn?this._dsn=_o(t.dsn):g&&l.warn("No DSN provided, client will not send events."),this._dsn){let n=Vo(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:n})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&ds(this,"afterCaptureLog","flushLogs",rc,De),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&ds(this,"afterCaptureMetric","flushMetrics",tc,qo)}captureException(t,r,n){let o=y();if(Nt(t))return g&&l.log(ps),o;let s={event_id:o,...r};return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,n)).then(i=>i),"error"),s.event_id}captureMessage(t,r,n,o){let s={event_id:y(),...n},i=Ve(t)?t:String(t),a=X(t),c=a?this.eventFromMessage(i,r,s):this.eventFromException(t,s);return this._process(()=>c.then(p=>this._captureEvent(p,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,r,n){let o=y();if(r?.originalException&&Nt(r.originalException))return g&&l.log(ps),o;let s={event_id:o,...r},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,p=ms(t.type);return this._process(()=>this._captureEvent(t,s,a||n,c),p),s.event_id}captureSession(t){this.sendSession(t),$e(t,{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(t){let r=this._transport;if(this.emit("flush"),!r)return!0;let n=await this._isClientDoneProcessing(t),o=await r.flush(t);return n&&o}async close(t){De(this);let r=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),r}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(t){let r=this._integrations[t.name];!r&&t.beforeSetup&&t.beforeSetup(this),Xr(this,t,this._integrations),r||Kr(this,[t])}sendEvent(t,r={}){this.emit("beforeSendEvent",t,r);let n=ts(t,this),o=Oo(t,this._dsn,this._options._metadata,this._options.tunnel);for(let s of r.attachments||[])o=Ut(o,Wr(s));n&&(o=Ut(o,n)),this.sendEnvelope(o).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){let{release:r,environment:n=re}=this._options;if("aggregates"in t){let s=t.attrs||{};if(!s.release&&!r){g&&l.warn(us);return}s.release=s.release||r,s.environment=s.environment||n,t.attrs=s}else{if(!t.release&&!r){g&&l.warn(us);return}t.release=t.release||r,t.environment=t.environment||n}this.emit("beforeSendSession",t);let o=Co(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,r,n=1){if(this._options.sendClientReports){let o=`${t}:${r}`;g&&l.log(`Recording outcome: "${o}"${n>1?` (${n} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+n}}on(t,r){let n=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>r(...s);return n.add(o),()=>{n.delete(o)}}emit(t,...r){let n=this._hooks[t];n&&n.forEach(o=>o(...r))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(r){return g&&l.error("Error while sending envelope:",r),{}}return g&&l.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=jo(this,t),Kr(this,t)}_updateSessionFromEvent(t,r){let n=r.level==="fatal",o=!1,s=r.exception?.values;if(s){o=!0,n=!1;for(let c of s)if(c.mechanism?.handled===!1){n=!0;break}}let i=t.status==="ok";(i&&t.errors===0||i&&n)&&($e(t,{...n&&{status:"crashed"},errors:t.errors||Number(o||n)}),this.captureSession(t))}async _isClientDoneProcessing(t){let r=0;for(;!t||r<t;){if(await new Promise(n=>setTimeout(n,1)),!this._numProcessing)return!0;r++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,r,n,o){let s=this.getOptions(),i=this.getIntegrationNames();return!r.integrations&&i.length&&(r.integrations=i),this.emit("preprocessEvent",t,r),t.type||o.setLastEventId(t.event_id||r.event_id),Ho(s,t,r,n,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,r),a.contexts={trace:{...a.contexts?.trace,...qe(n)},...a.contexts};let c=nt(this,n);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(t,r={},n=A(),o=L()){return g&&en(t)&&l.log(`Captured error event \`${jt(t)[0]||"<unknown>"}\``),this._processEvent(t,r,n,o).then(s=>s.event_id,s=>{g&&(ls(s)?l.log(s.message):fs(s)?l.warn(s.message):l.warn(s))})}_processEvent(t,r,n,o){let s=this.getOptions(),{sampleRate:i}=s,a=hs(t),c=en(t),u=`before send for type \`${t.type||"error"}\``,f=typeof i>"u"?void 0:Qe(i);if(c&&typeof f=="number"&&U()>f)return this.recordDroppedEvent("sample_rate","error"),Pe(Qr(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));let d=ms(t.type);return this._prepareEvent(t,r,n,o).then(m=>{if(m===null)throw this.recordDroppedEvent("event_processor",d),Qr("An event processor returned `null`, will not send event.");if(r.data?.__sentry__===!0)return m;let S=ec(this,s,m,r);return Qa(S,u)}).then(m=>{if(m===null){if(this.recordDroppedEvent("before_send",d),a){let x=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",x)}throw Qr(`${u} returned \`null\`, will not send event.`)}let _=n.getSession()||o.getSession();if(c&&_&&this._updateSessionFromEvent(_,m),a){let E=m.sdkProcessingMetadata?.spanCountBeforeProcessing||0,x=m.spans?m.spans.length:0,R=E-x;R>0&&this.recordDroppedEvent("before_send","span",R)}let S=m.transaction_info;if(a&&S&&m.transaction!==t.transaction){let E="custom";m.transaction_info={...S,source:E}}return this.sendEvent(m,r),m}).then(null,m=>{throw ls(m)||fs(m)?m:(this.captureException(m,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:m}),zt(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
8
- Reason: ${m}`))})}_process(t,r){this._numProcessing++,this._promiseBuffer.add(t).then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n===ct&&this.recordDroppedEvent("queue_overflow",r),n))}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.entries(t).map(([r,n])=>{let[o,s]=r.split(":");return{reason:o,category:s,quantity:n}})}_flushOutcomes(){g&&l.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){g&&l.log("No outcomes to send");return}if(!this._dsn){g&&l.log("No dsn provided, will not send outcomes");return}g&&l.log("Sending outcomes:",t);let r=os(t,this._options.tunnel&&M(this._dsn));this.sendEnvelope(r)}};function ms(e){return e==="replay_event"?"replay":e||"error"}function Qa(e,t){let r=`${t} must return \`null\` or a valid event.`;if(j(e))return e.then(n=>{if(!ue(n)&&n!==null)throw zt(r);return n},n=>{throw zt(`${t} rejected with ${n}`)});if(!ue(e)&&e!==null)throw zt(r);return e}function ec(e,t,r,n){let{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!Le(t.beforeSendSpan)&&t.beforeSendSpan,c=r;if(en(c)&&o)return o(c,n);if(hs(c)){if(a||i){let p=ss(c);if(i?.length&&Gr({description:p.description,op:p.op,attributes:p.data},i))return null;if(a){let u=a(p);u?c=ee(r,is(u)):rt()}if(c.spans){let u=[],f=c.spans;for(let m of f){if(i?.length&&Gr({description:m.description,op:m.op,attributes:m.data},i)){vo(f,m);continue}if(a){let _=a(m);_?u.push(_):(rt(),u.push(m))}else u.push(m)}let d=c.spans.length-u.length;d&&e.recordDroppedEvent("before_send","span",d),c.spans=u}}if(s){if(c.spans){let p=c.spans.length;c.sdkProcessingMetadata={...r.sdkProcessingMetadata,spanCountBeforeProcessing:p}}return s(c,n)}}return c}function en(e){return e.type===void 0}function hs(e){return e.type==="transaction"}function tc(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Es(e.attributes)}function rc(e){let t=0;return e.message&&(t+=e.message.length*2),t+Es(e.attributes)}function Es(e){if(!e)return 0;let t=0;return Object.values(e).forEach(r=>{Array.isArray(r)?t+=r.length*gs(r[0]):X(r)?t+=gs(r):t+=100}),t}function gs(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function tn(e,t){return t.some(r=>e.includes(r))}function rn(e,t,r){if(t===!1)return{};let n=r!=null?[...qr,...r]:qr,o={};if(t===!0){for(let i of Object.keys(e))o[i]=tn(i.toLowerCase(),n)?me:e[i];return o}if("deny"in t){let i=t.deny.map(a=>a.toLowerCase());for(let a of Object.keys(e)){let c=a.toLowerCase(),p=tn(c,n)||i.some(u=>c.includes(u));o[a]=p?me:e[a]}return o}let s=t.allow.map(i=>i.toLowerCase());for(let i of Object.keys(e)){let a=i.toLowerCase();if(tn(a,n))o[i]=me;else{let c=s.some(p=>a.includes(p));o[i]=c?e[i]:me}}return o}function Ts(e){let t={},r=0;for(;r<e.length;){let n=e.indexOf("=",r);if(n===-1)break;let o=e.indexOf(";",r);if(o===-1)o=e.length;else if(o<n){r=e.lastIndexOf(";",n-1)+1;continue}let s=e.slice(r,n).trim();if(t[s]===void 0){let i=e.slice(n+1,o).trim();i.charCodeAt(0)===34&&(i=i.slice(1,-1));try{t[s]=i.indexOf("%")!==-1?decodeURIComponent(i):i}catch{t[s]=i}}r=o+1}return t}var nc=new Set(["false","f","n","no","off","0"]),oc=new Set(["true","t","y","yes","on","1"]);function ge(e,t){let r=String(e).toLowerCase();return nc.has(r)?!1:oc.has(r)?!0:t?.strict?null:!!e}function Is(e,t,r,n,o){let s={sent_at:new Date(C()).toISOString()};r?.sdk&&(s.sdk={name:r.sdk.name,version:r.sdk.version}),n&&o&&(s.dsn=M(o)),t&&(s.trace=t);let i=sc(e);return v(s,[i])}function sc(e){return[{type:"check_in"},e]}function lt(e,t,r=[t],n="npm"){let o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=r.map(s=>({name:`${n}:@sentry/${s}`,version:G})),o.version=G)}var Xg=1024*1024;function nn(e,t=!1,r="request"){let n=typeof t=="boolean"?$t(t):t,o=r==="request"?n.httpHeaders.request:n.httpHeaders.response,s=n.cookies,i=`http.${r}.header.`,a={};try{let c={};for(let[p,u]of Object.entries(e)){if(u==null)continue;let f=p.toLowerCase();if(f==="cookie"||f==="set-cookie"){if(s===!1)continue;if(typeof u=="string"&&u!==""){let m=ic(u,f==="set-cookie"),_=rn(m,s,as);for(let[S,E]of Object.entries(_))a[`${i}${Jt(f)}.${Jt(S)}`]=E}else a[`${i}${Jt(f)}`]=me}else{if(o===!1)continue;Array.isArray(u)?c[f]=u.map(m=>m!=null?String(m):m).join(";"):typeof u=="string"&&(c[f]=u)}}if(o!==!1){let p=rn(c,o);for(let[u,f]of Object.entries(p))a[`${i}${Jt(u)}`]=f}}catch{}return a}function Jt(e){return e.replace(/-/g,"_")}function ic(e,t){let r=e.indexOf(";"),n=t&&r!==-1?e.substring(0,r):e,o=t?[n]:n.split("; "),s={};for(let i of o){let a=i.indexOf("="),c=(a!==-1?i.substring(0,a):i).toLowerCase(),p=a!==-1?i.substring(a+1):"";s[c]=p}return s}var ac=100;function on(e,t){let r=T(),n=L();if(!r)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:s=ac}=r.getOptions();if(s<=0)return;let a={timestamp:$(),...e},c=o?b(()=>o(a,t)):a;c!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",c,t),n.addBreadcrumb(c,s))}var ys,cc="FunctionToString",bs=new WeakMap,pc=(()=>({name:cc,setupOnce(){ys=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=dr(this),r=bs.has(T())&&t!==void 0?t:this;return ys.apply(r,e)}}catch{}},setup(e){bs.set(e,!0)}})),dt=pc;var uc=[/^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$/],fc="EventFilters",we=(e={})=>{let t;return{name:fc,setup(r){let n=r.getOptions();t=xs(e,n)},processEvent(r,n,o){if(!t){let s=o.getOptions();t=xs(e,s)}return dc(r,t)?null:r}}},lc=((e={})=>({...we(e),name:"InboundFilters"}));function xs(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:uc],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function dc(e,t){if(e.type){if(e.type==="transaction"&&gc(e,t.ignoreTransactions))return g&&l.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
7
+ `),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(B(a))}o(c)}}return typeof n=="string"?n:_a(n)}function _a(e){let t=e.reduce((o,s)=>o+s.length,0),r=new Uint8Array(t),n=0;for(let o of e)r.set(o,n),n+=o.length;return r}function Vr(e){let t=typeof e.data=="string"?Yr(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Co={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 Sa(e){return e in Co}function Ft(e){return Sa(e)?Co[e]:e}function ke(e){if(!e?.sdk)return;let{name:t,version:r}=e.sdk;return{name:t,version:r}}function jr(e,t,r,n){let o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(C()).toISOString(),...t&&{sdk:t},...!!r&&n&&{dsn:M(n)},...o&&{trace:o}}}function Ea(e,t){if(!t)return e;let r=e.sdk||{};return e.sdk={...r,name:r.name||t.name,version:r.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function Oo(e,t,r,n){let o=ke(r),s={sent_at:new Date(C()).toISOString(),...o&&{sdk:o},...!!n&&t&&{dsn:M(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return v(s,[i])}function Lo(e,t,r,n){let o=ke(r),s=e.type&&e.type!=="replay_event"?e.type:"event";Ea(e,r?.sdk);let i=jr(e,o,n,t);return delete e.sdkProcessingMetadata,v(i,[[{type:s},e]])}function wt(e){return e.getOptions().traceLifecycle==="stream"}var it="__SENTRY_SUPPRESS_TRACING__";function Bt(e,t){let r=Mo();return r.withActiveSpan?r.withActiveSpan(e,t):le(n=>(fe(n,e||void 0),t(n)))}function Pe(e){let t=Mo();return t.suppressTracing?t.suppressTracing(e):le(r=>{r.setSDKProcessingMetadata({[it]:!0});let n=e();return r.setSDKProcessingMetadata({[it]:void 0}),n})}function Mo(){let e=D();return te(e)}function Po(e,t){let{fingerprint:r,span:n,breadcrumbs:o,sdkProcessingMetadata:s}=t;Ta(e,t),n&&ba(e,n),xa(e,r),Ia(e,o),ya(e,s)}function ko(e,t){let{extra:r,tags:n,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:p,fingerprint:u,eventProcessors:f,attachments:d,propagationContext:m,transactionName:_,span:S}=t;at(e,"extra",r),at(e,"tags",n),at(e,"attributes",o),at(e,"user",s),at(e,"contexts",i),e.sdkProcessingMetadata=ee(e.sdkProcessingMetadata,c,2),a&&(e.level=a),_&&(e.transactionName=_),S&&(e.span=S),p.length&&(e.breadcrumbs=[...e.breadcrumbs,...p]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...m}}function at(e,t,r){e[t]=ee(e[t],r,1)}function Gt(e,t){let r=Ct().getScopeData();return e&&ko(r,e.getScopeData()),t&&ko(r,t.getScopeData()),r}function Ta(e,t){let{extra:r,tags:n,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(r).length&&(e.extra={...r,...e.extra}),Object.keys(n).length&&(e.tags={...n,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),i&&(e.level=i),a&&e.type!=="transaction"&&(e.transaction=a)}function Ia(e,t){let r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}function ya(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function ba(e,t){e.contexts={trace:kt(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Le(t),...e.sdkProcessingMetadata};let r=tt(t),n=Oe(r).description;n&&!e.transaction&&e.type==="transaction"&&(e.transaction=n)}function xa(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function Do(e){let t={},{response:r,profile:n,cloud_resource:o,culture:s,state:i}=e;if(r&&(r.status_code!=null&&(t["http.response.status_code"]=r.status_code),r.body_size!=null&&(t["http.response.body.size"]=r.body_size)),n&&(n.profile_id&&(t["sentry.profile_id"]=n.profile_id),n.profiler_id&&(t["sentry.profiler_id"]=n.profiler_id)),o)for(let[p,u]of Object.entries(o))u!=null&&(t[p]=u);s&&(s.locale&&(t["culture.locale"]=s.locale),s.timezone&&(t["culture.timezone"]=s.timezone)),i?.state&&typeof i.state.type=="string"&&(t["state.type"]=i.state.type);let a=e.angular;if(a){let p=a.version;(typeof p=="string"||typeof p=="number")&&(t["angular.version"]=p)}let c=e.react;if(c){let p=c.version;(typeof p=="string"||typeof p=="number")&&(t["react.version"]=p)}return t}function $r(e,t){let r=wr(e),n=et(e),o=wr(n),{isolationScope:s,scope:i}=de(e),a=Gt(s,i);Ra(r,o,t,a);let c=e.kind;t.emit("preprocessSpan",r,{spanKind:c}),r.is_segment&&(va(r,a),Na(r,t),t.emit("processSegmentSpan",r)),t.emit("processSpan",r);let{beforeSendSpan:p}=t.getOptions(),u=p&&Me(p)?Aa(r,p):r,f=u.attributes?.[Ce];return f&&k(u,{"sentry.span.source":f}),{...Pt(u),_segmentSpan:n}}function va(e,t){let r=Do(t.contexts);k(e,r)}function k(e,t){let r=e.attributes??(e.attributes={});Object.entries(t).forEach(([n,o])=>{o!=null&&!(n in r)&&(r[n]=o)})}function Na(e,t){let r=t.getIntegrationNames();r.length&&k(e,{[co]:r})}function Ra(e,t,r,n){let o=r.getSdkMetadata(),{release:s,environment:i}=r.getOptions();k(e,{[ro]:s,[no]:i||re,[oo]:t.name,[so]:t.span_id,[io]:o?.sdk?.name,[ao]:o?.sdk?.version,[po]:n.user?.id,[uo]:n.user?.email,[Ot]:n.user?.ip_address,[fo]:n.user?.username,...n.attributes})}function Aa(e,t){let r=t(e);return r||(rt(),e)}var zr=0,Uo=1,Fo=2;function z(e){return new Ht(t=>{t(e)})}function De(e){return new Ht((t,r)=>{r(e)})}var Ht=class e{constructor(t){this._state=zr,this._handlers=[],this._runExecutor(t)}then(t,r){return new e((n,o)=>{this._handlers.push([!1,s=>{if(!t)n(s);else try{n(t(s))}catch(i){o(i)}},s=>{if(!r)o(s);else try{n(r(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(r=>r,t)}finally(t){return new e((r,n)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){n(o);return}r(o)})})}_executeHandlers(){if(this._state===zr)return;let t=this._handlers.slice();this._handlers=[],t.forEach(r=>{r[0]||(this._state===Uo&&r[1](this._value),this._state===Fo&&r[2](this._value),r[0]=!0)})}_runExecutor(t){let r=(s,i)=>{if(this._state===zr){if(j(i)){i.then(n,o);return}this._state=s,this._value=i,this._executeHandlers()}},n=s=>{r(Uo,s)},o=s=>{r(Fo,s)};try{t(n,o)}catch(s){o(s)}}};function wo(e,t,r,n=0){try{let o=Zr(t,r,e,n);return j(o)?o:z(o)}catch(o){return De(o)}}function Zr(e,t,r,n){let o=r[n];if(!e||!o)return e;let s=o({...e},t);return g&&s===null&&l.log(`Event processor "${o.id||"?"}" dropped event`),j(s)?s.then(i=>Zr(i,t,r,n+1)):Zr(s,t,r,n+1)}var me,Bo,Go,ne;function Ho(e){let t=h._sentryDebugIds,r=h._debugIds;if(!t&&!r)return{};let n=t?Object.keys(t):[],o=r?Object.keys(r):[];if(ne&&n.length===Bo&&o.length===Go)return ne;Bo=n.length,Go=o.length,ne={},me||(me={});let s=(i,a)=>{for(let c of i){let p=a[c],u=me?.[c];if(u&&ne&&p)ne[u[0]]=p,me&&(me[c]=[u[0],p]);else if(p){let f=e(c);for(let d=f.length-1;d>=0;d--){let _=f[d]?.filename;if(_&&ne&&me){ne[_]=p,me[c]=[_,p];break}}}}};return t&&s(n,t),r&&s(o,r),ne}function Yo(e,t,r,n,o,s){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||r.event_id||y(),timestamp:t.timestamp||$()},p=r.integrations||e.integrations.map(x=>x.name);Ca(c,e),Ma(c,p),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&Oa(c,e.stackParser);let u=Pa(n,r.captureContext);r.mechanism&&Re(c,r.mechanism);let f=o?o.getEventProcessors():[],d=Gt(s,u),m=[...r.attachments||[],...d.attachments];m.length&&(r.attachments=m),Po(c,d);let _=[...f,...d.eventProcessors];return(r.data&&r.data.__sentry__===!0?z(c):wo(_,c,r)).then(x=>(x&&La(x),typeof i=="number"&&i>0?ka(x,i,a):x))}function Ca(e,t){let{environment:r,release:n,dist:o,maxValueLength:s}=t;e.environment=e.environment||r||re,!e.release&&n&&(e.release=n),!e.dist&&o&&(e.dist=o);let i=e.request;i?.url&&s&&(i.url=Ne(i.url,s)),s&&e.exception?.values?.forEach(a=>{a.value&&(a.value=Ne(a.value,s))})}function Oa(e,t){let r=Ho(t);e.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=r[o.filename])})})}function La(e){let t={};if(e.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let r=e.debug_meta.images;Object.entries(t).forEach(([n,o])=>{r.push({type:"sourcemap",code_file:n,debug_id:o})})}function Ma(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function ka(e,t,r){if(!e)return null;let n={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:B(o.data,t,r)}}))},...e.user&&{user:B(e.user,t,r)},...e.contexts&&{contexts:B(e.contexts,t,r)},...e.extra&&{extra:B(e.extra,t,r)}};return e.contexts?.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=B(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map(o=>({...o,...o.data&&{data:B(o.data,t,r)}}))),e.contexts?.flags&&n.contexts&&(n.contexts.flags=B(e.contexts.flags,3,r)),n}function Pa(e,t){if(!t)return e;let r=e?e.clone():new O;return r.update(t),r}function Wo(e){if(e)return Da(e)?{captureContext:e}:Fa(e)?{captureContext:e}:e}function Da(e){return e instanceof O||typeof e=="function"}var Ua=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Fa(e){return Object.keys(e).some(t=>Ua.includes(t))}function oe(e,t){return A().captureException(e,Wo(t))}function Yt(e,t){let r=typeof t=="string"?t:void 0,n=typeof t!="string"?{captureContext:t}:void 0;return A().captureMessage(e,r,n)}function Wt(e){L().setTags(e)}function Vt(e){L().setUser(e)}var wa="7";function Ba(e){let t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function Ga(e){return`${Ba(e)}${e.projectId}/envelope/`}function Ha(e,t){let r={sentry_version:wa};return e.publicKey&&(r.sentry_key=e.publicKey),t&&(r.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(r).toString()}function jo(e,t,r){return t||`${Ga(e)}?${Ha(e,r)}`}var Jr=[];function Ya(e){let t={};return e.forEach(r=>{let{name:n}=r,o=t[n];o&&!o.isDefaultInstance&&r.isDefaultInstance||(t[n]=r)}),Object.values(t)}function Kr(e){let t=e.defaultIntegrations||[],r=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let n;if(Array.isArray(r))n=[...t,...r];else if(typeof r=="function"){let o=r(t);n=Array.isArray(o)?o:[o]}else n=t;return Ya(n)}function $o(e,t){let r={};return t.forEach(n=>{n?.beforeSetup&&n.beforeSetup(e)}),t.forEach(n=>{n&&qr(e,n,r)}),r}function Xr(e,t){for(let r of t)r?.afterAllSetup&&r.afterAllSetup(e)}function qr(e,t,r){if(r[t.name]){g&&l.log(`Integration skipped because it was already installed: ${t.name}`);return}if(r[t.name]=t,!Jr.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Jr.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>n(o,s,e))}if(typeof t.processEvent=="function"){let n=t.processEvent.bind(t),o=Object.assign((s,i)=>n(s,i,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(n=>{let o=t[n];typeof o=="function"&&e.on(n,s=>o.call(t,s,e))}),g&&l.log(`Integration installed: ${t.name}`)}function zo(e,t){return t?le(t,()=>{let r=Br(),n=r?kt(r):qe(t);return[r?Le(r):nt(e,t),n]}):[void 0,void 0]}function Zo(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Jo(){return!Zo()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function se(){return typeof window<"u"&&(!Jo()||Wa())}function Wa(){return h.process?.type==="renderer"}function Va(e,t){let r=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...se()&&{ingest_settings:{infer_ip:r,infer_user_agent:r}},items:e}]}function Ko(e,t,r,n,o){let s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),r&&n&&(s.dsn=M(n)),v(s,[Va(e,o)])}function Ue(e,t){let r=t??ja(e)??[];if(r.length===0)return;let n=e.getOptions(),o=Ko(r,n._metadata,n.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);Xo().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function ja(e){return Xo().get(e)}function Xo(){return F("clientToLogBufferMap",()=>new WeakMap)}function $a(e,t){let r=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...se()&&{ingest_settings:{infer_ip:r,infer_user_agent:r}},items:e}]}function qo(e,t,r,n,o){let s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),r&&n&&(s.dsn=M(n)),v(s,[$a(e,o)])}function Qo(e,t){let r=t??za(e)??[];if(r.length===0)return;let n=e.getOptions(),o=qo(r,n._metadata,n.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);es().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function za(e){return es().get(e)}function es(){return F("clientToMetricBufferMap",()=>new WeakMap)}function ts(e){let t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status==="ok"||e.status==="cancelled"?"ok":"error",is_segment:!1,attributes:{...e.data},links:e.links};return Pt(t)}function rs(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||t.getOptions().streamGenAiSpans===!1||wt(t))return;let r=[],n=[];for(let s of e.spans)s.op?.startsWith("gen_ai.")?r.push(ts(s)):n.push(s);if(r.length===0)return;e.spans=n;let o=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:r.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...se()&&{ingest_settings:{infer_ip:o,infer_user_agent:o}},items:r}]}function Fe(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var ct=Symbol.for("SentryBufferFullError");function we(e=100){let t=new Set;function r(){return t.size<e}function n(i){t.delete(i)}function o(i){if(!r())return De(ct);let a=i();return t.add(a),a.then(()=>n(a),()=>n(a)),a}function s(i){if(!t.size)return z(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;let c=[a,new Promise(p=>Fe(setTimeout(()=>p(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:s}}var Za=60*1e3;function Ja(e,t=C()){let r=parseInt(`${e}`,10);if(!isNaN(r))return r*1e3;let n=Date.parse(`${e}`);return isNaN(n)?Za:n-t}function Ka(e,t){return e[t]||e.all||0}function ns(e,t,r=C()){return Ka(e,t)>r}function os(e,{statusCode:t,headers:r},n=C()){let o={...e},s=r?.["x-sentry-rate-limits"],i=r?.["retry-after"];if(s)for(let a of s.trim().split(",")){let[c,p,,,u]=a.split(":",5),f=parseInt(c,10),d=(isNaN(f)?60:f)*1e3;if(!p)o.all=n+d;else for(let m of p.split(";"))m==="metric_bucket"?(!u||u.split(";").includes("custom"))&&(o[m]=n+d):o[m]=n+d}else i?o.all=n+Ja(i,n):t===429&&(o.all=n+60*1e3);return o}var pt=64;function ut(e,t,r=we(e.bufferSize||pt)){let n={},o=i=>r.drain(i);function s(i){let a=[];if(ot(i,(f,d)=>{let m=Ft(d);ns(n,m)?e.recordDroppedEvent("ratelimit_backoff",m):a.push(f)}),a.length===0)return Promise.resolve({});let c=v(i[0],a),p=f=>{if(Wr(c,["client_report"])){g&&l.warn(`Dropping client report. Will not send outcomes (reason: ${f}).`);return}ot(c,(d,m)=>{e.recordDroppedEvent(f,Ft(m))})},u=()=>t({body:st(c)}).then(f=>f.statusCode===413?(g&&l.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),p("send_error"),f):(g&&f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&l.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),n=os(n,f),f),f=>{throw p("network_error"),g&&l.error("Encountered error running transport request:",f),f});return r.add(u).then(f=>f,f=>{if(f===ct)return g&&l.error("Skipped sending event because buffer is full."),p("queue_overflow"),Promise.resolve({});throw f})}return{send:s,flush:o}}function ss(e,t,r){let n=[{type:"client_report"},{timestamp:r||$(),discarded_events:e}];return v(t?{dsn:t}:{},[n])}function jt(e){let t=[];e.message&&t.push(e.message);try{let r=e.exception.values[e.exception.values.length-1];r?.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`))}catch{}return t}function is(e){let{trace_id:t,parent_span_id:r,span_id:n,status:o,origin:s,data:i,op:a}=e.contexts?.trace??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:r,span_id:n??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i?.[Pr],exclusive_time:i?.[Dr],measurements:e.measurements,is_segment:!0}}function as(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[Pr]:e.profile_id},...e.exclusive_time&&{[Dr]:e.exclusive_time}}}},measurements:e.measurements}}var ge="[Filtered]",ft=["forwarded","-ip","remote-","via","-user"],Qr=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"],cs=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"];function $t(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:ft},httpHeaders:{request:{deny:ft},response:{deny:ft}},httpBodies:[],queryParams:{deny:ft},genAI:{inputs:!1,outputs:!1},stackFrameVariables:!0,frameContextLines:7}}var Xa={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],queryParams:!0,genAI:{inputs:!0,outputs:!0},stackFrameVariables:!0,frameContextLines:5};function ps(e){let t=e.dataCollection!=null?Xa:$t(e.sendDefaultPii),r=e.dataCollection??{};return{userInfo:r.userInfo??t.userInfo,cookies:r.cookies??t.cookies,httpHeaders:{request:r.httpHeaders?.request??t.httpHeaders.request,response:r.httpHeaders?.response??t.httpHeaders.response},httpBodies:r.httpBodies??t.httpBodies,queryParams:r.queryParams??t.queryParams,genAI:{inputs:r.genAI?.inputs??t.genAI.inputs,outputs:r.genAI?.outputs??t.genAI.outputs},stackFrameVariables:r.stackFrameVariables??t.stackFrameVariables,frameContextLines:r.frameContextLines??t.frameContextLines}}var us="Not capturing exception because it's already been captured.",fs="Discarded session because of missing or non-string release",Ss=Symbol.for("SentryInternalError"),hs=Symbol.for("SentryDoNotSendEventError"),qa=5e3;function zt(e){return{message:e,[Ss]:!0}}function en(e){return{message:e,[hs]:!0}}function ls(e){return!!e&&typeof e=="object"&&Ss in e}function ds(e){return!!e&&typeof e=="object"&&hs in e}function ms(e,t,r,n,o){let s=0,i,a=!1;e.on(r,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,c=>{if(s+=n(c),s>=8e5)o(e);else if(!a){let p=e.getOptions()._flushInterval??qa;p>0&&(a=!0,i=Fe(setTimeout(()=>{o(e)},p)))}}),e.on("flush",()=>{o(e)})}var Zt=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=we(t.transportOptions?.bufferSize??pt),this._dataCollection=ps(t),t.dsn?this._dsn=So(t.dsn):g&&l.warn("No DSN provided, client will not send events."),this._dsn){let n=jo(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:n})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&ms(this,"afterCaptureLog","flushLogs",rc,Ue),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&ms(this,"afterCaptureMetric","flushMetrics",tc,Qo)}captureException(t,r,n){let o=y();if(Rt(t))return g&&l.log(us),o;let s={event_id:o,...r};return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,n)).then(i=>i),"error"),s.event_id}captureMessage(t,r,n,o){let s={event_id:y(),...n},i=je(t)?t:String(t),a=X(t),c=a?this.eventFromMessage(i,r,s):this.eventFromException(t,s);return this._process(()=>c.then(p=>this._captureEvent(p,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,r,n){let o=y();if(r?.originalException&&Rt(r.originalException))return g&&l.log(us),o;let s={event_id:o,...r},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,p=gs(t.type);return this._process(()=>this._captureEvent(t,s,a||n,c),p),s.event_id}captureSession(t){this.sendSession(t),ze(t,{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(t){let r=this._transport;if(this.emit("flush"),!r)return!0;let n=await this._isClientDoneProcessing(t),o=await r.flush(t);return n&&o}async close(t){Ue(this);let r=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),r}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(t){let r=this._integrations[t.name];!r&&t.beforeSetup&&t.beforeSetup(this),qr(this,t,this._integrations),r||Xr(this,[t])}sendEvent(t,r={}){this.emit("beforeSendEvent",t,r);let n=rs(t,this),o=Lo(t,this._dsn,this._options._metadata,this._options.tunnel);for(let s of r.attachments||[])o=Ut(o,Vr(s));n&&(o=Ut(o,n)),this.sendEnvelope(o).then(s=>this.emit("afterSendEvent",t,s))}sendSession(t){let{release:r,environment:n=re}=this._options;if("aggregates"in t){let s=t.attrs||{};if(!s.release&&!r){g&&l.warn(fs);return}s.release=s.release||r,s.environment=s.environment||n,t.attrs=s}else{if(!t.release&&!r){g&&l.warn(fs);return}t.release=t.release||r,t.environment=t.environment||n}this.emit("beforeSendSession",t);let o=Oo(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,r,n=1){if(this._options.sendClientReports){let o=`${t}:${r}`;g&&l.log(`Recording outcome: "${o}"${n>1?` (${n} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+n}}on(t,r){let n=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>r(...s);return n.add(o),()=>{n.delete(o)}}emit(t,...r){let n=this._hooks[t];n&&n.forEach(o=>o(...r))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(r){return g&&l.error("Error while sending envelope:",r),{}}return g&&l.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=$o(this,t),Xr(this,t)}_updateSessionFromEvent(t,r){let n=r.level==="fatal",o=!1,s=r.exception?.values;if(s){o=!0,n=!1;for(let c of s)if(c.mechanism?.handled===!1){n=!0;break}}let i=t.status==="ok";(i&&t.errors===0||i&&n)&&(ze(t,{...n&&{status:"crashed"},errors:t.errors||Number(o||n)}),this.captureSession(t))}async _isClientDoneProcessing(t){let r=0;for(;!t||r<t;){if(await new Promise(n=>setTimeout(n,1)),!this._numProcessing)return!0;r++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,r,n,o){let s=this.getOptions(),i=this.getIntegrationNames();return!r.integrations&&i.length&&(r.integrations=i),this.emit("preprocessEvent",t,r),t.type||o.setLastEventId(t.event_id||r.event_id),Yo(s,t,r,n,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,r),a.contexts={trace:{...a.contexts?.trace,...qe(n)},...a.contexts};let c=nt(this,n);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(t,r={},n=A(),o=L()){return g&&tn(t)&&l.log(`Captured error event \`${jt(t)[0]||"<unknown>"}\``),this._processEvent(t,r,n,o).then(s=>s.event_id,s=>{g&&(ds(s)?l.log(s.message):ls(s)?l.warn(s.message):l.warn(s))})}_processEvent(t,r,n,o){let s=this.getOptions(),{sampleRate:i}=s,a=Es(t),c=tn(t),u=`before send for type \`${t.type||"error"}\``,f=typeof i>"u"?void 0:Qe(i);if(c&&typeof f=="number"&&U()>f)return this.recordDroppedEvent("sample_rate","error"),De(en(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));let d=gs(t.type);return this._prepareEvent(t,r,n,o).then(m=>{if(m===null)throw this.recordDroppedEvent("event_processor",d),en("An event processor returned `null`, will not send event.");if(r.data?.__sentry__===!0)return m;let S=ec(this,s,m,r);return Qa(S,u)}).then(m=>{if(m===null){if(this.recordDroppedEvent("before_send",d),a){let x=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",x)}throw en(`${u} returned \`null\`, will not send event.`)}let _=n.getSession()||o.getSession();if(c&&_&&this._updateSessionFromEvent(_,m),a){let E=m.sdkProcessingMetadata?.spanCountBeforeProcessing||0,x=m.spans?m.spans.length:0,R=E-x;R>0&&this.recordDroppedEvent("before_send","span",R)}let S=m.transaction_info;if(a&&S&&m.transaction!==t.transaction){let E="custom";m.transaction_info={...S,source:E}}return this.sendEvent(m,r),m}).then(null,m=>{throw ds(m)||ls(m)?m:(this.captureException(m,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:m}),zt(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
8
+ Reason: ${m}`))})}_process(t,r){this._numProcessing++,this._promiseBuffer.add(t).then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n===ct&&this.recordDroppedEvent("queue_overflow",r),n))}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.entries(t).map(([r,n])=>{let[o,s]=r.split(":");return{reason:o,category:s,quantity:n}})}_flushOutcomes(){g&&l.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){g&&l.log("No outcomes to send");return}if(!this._dsn){g&&l.log("No dsn provided, will not send outcomes");return}g&&l.log("Sending outcomes:",t);let r=ss(t,this._options.tunnel&&M(this._dsn));this.sendEnvelope(r)}};function gs(e){return e==="replay_event"?"replay":e||"error"}function Qa(e,t){let r=`${t} must return \`null\` or a valid event.`;if(j(e))return e.then(n=>{if(!ue(n)&&n!==null)throw zt(r);return n},n=>{throw zt(`${t} rejected with ${n}`)});if(!ue(e)&&e!==null)throw zt(r);return e}function ec(e,t,r,n){let{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!Me(t.beforeSendSpan)&&t.beforeSendSpan,c=r;if(tn(c)&&o)return o(c,n);if(Es(c)){if(a||i){let p=is(c);if(i?.length&&Hr({description:p.description,op:p.op,attributes:p.data},i))return null;if(a){let u=a(p);u?c=ee(r,as(u)):rt()}if(c.spans){let u=[],f=c.spans;for(let m of f){if(i?.length&&Hr({description:m.description,op:m.op,attributes:m.data},i)){No(f,m);continue}if(a){let _=a(m);_?u.push(_):(rt(),u.push(m))}else u.push(m)}let d=c.spans.length-u.length;d&&e.recordDroppedEvent("before_send","span",d),c.spans=u}}if(s){if(c.spans){let p=c.spans.length;c.sdkProcessingMetadata={...r.sdkProcessingMetadata,spanCountBeforeProcessing:p}}return s(c,n)}}return c}function tn(e){return e.type===void 0}function Es(e){return e.type==="transaction"}function tc(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+Ts(e.attributes)}function rc(e){let t=0;return e.message&&(t+=e.message.length*2),t+Ts(e.attributes)}function Ts(e){if(!e)return 0;let t=0;return Object.values(e).forEach(r=>{Array.isArray(r)?t+=r.length*_s(r[0]):X(r)?t+=_s(r):t+=100}),t}function _s(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function rn(e,t){return t.some(r=>e.includes(r))}function nn(e,t,r){if(t===!1)return{};let n=r!=null?[...Qr,...r]:Qr,o={};if(t===!0){for(let i of Object.keys(e))o[i]=rn(i.toLowerCase(),n)?ge:e[i];return o}if("deny"in t){let i=t.deny.map(a=>a.toLowerCase());for(let a of Object.keys(e)){let c=a.toLowerCase(),p=rn(c,n)||i.some(u=>c.includes(u));o[a]=p?ge:e[a]}return o}let s=t.allow.map(i=>i.toLowerCase());for(let i of Object.keys(e)){let a=i.toLowerCase();if(rn(a,n))o[i]=ge;else{let c=s.some(p=>a.includes(p));o[i]=c?e[i]:ge}}return o}function Is(e){let t={},r=0;for(;r<e.length;){let n=e.indexOf("=",r);if(n===-1)break;let o=e.indexOf(";",r);if(o===-1)o=e.length;else if(o<n){r=e.lastIndexOf(";",n-1)+1;continue}let s=e.slice(r,n).trim();if(t[s]===void 0){let i=e.slice(n+1,o).trim();i.charCodeAt(0)===34&&(i=i.slice(1,-1));try{t[s]=i.indexOf("%")!==-1?decodeURIComponent(i):i}catch{t[s]=i}}r=o+1}return t}var nc=new Set(["false","f","n","no","off","0"]),oc=new Set(["true","t","y","yes","on","1"]);function _e(e,t){let r=String(e).toLowerCase();return nc.has(r)?!1:oc.has(r)?!0:t?.strict?null:!!e}function ys(e,t,r,n,o){let s={sent_at:new Date(C()).toISOString()};r?.sdk&&(s.sdk={name:r.sdk.name,version:r.sdk.version}),n&&o&&(s.dsn=M(o)),t&&(s.trace=t);let i=sc(e);return v(s,[i])}function sc(e){return[{type:"check_in"},e]}function lt(e,t,r=[t],n="npm"){let o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=r.map(s=>({name:`${n}:@sentry/${s}`,version:G})),o.version=G)}var e_=1024*1024;function on(e,t=!1,r="request"){let n=typeof t=="boolean"?$t(t):t,o=r==="request"?n.httpHeaders.request:n.httpHeaders.response,s=n.cookies,i=`http.${r}.header.`,a={};try{let c={};for(let[p,u]of Object.entries(e)){if(u==null)continue;let f=p.toLowerCase();if(f==="cookie"||f==="set-cookie"){if(s===!1)continue;if(typeof u=="string"&&u!==""){let m=ic(u,f==="set-cookie"),_=nn(m,s,cs);for(let[S,E]of Object.entries(_))a[`${i}${Jt(f)}.${Jt(S)}`]=E}else a[`${i}${Jt(f)}`]=ge}else{if(o===!1)continue;Array.isArray(u)?c[f]=u.map(m=>m!=null?String(m):m).join(";"):typeof u=="string"&&(c[f]=u)}}if(o!==!1){let p=nn(c,o);for(let[u,f]of Object.entries(p))a[`${i}${Jt(u)}`]=f}}catch{}return a}function Jt(e){return e.replace(/-/g,"_")}function ic(e,t){let r=e.indexOf(";"),n=t&&r!==-1?e.substring(0,r):e,o=t?[n]:n.split("; "),s={};for(let i of o){let a=i.indexOf("="),c=(a!==-1?i.substring(0,a):i).toLowerCase(),p=a!==-1?i.substring(a+1):"";s[c]=p}return s}var ac=100;function sn(e,t){let r=T(),n=L();if(!r)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:s=ac}=r.getOptions();if(s<=0)return;let a={timestamp:$(),...e},c=o?b(()=>o(a,t)):a;c!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",c,t),n.addBreadcrumb(c,s))}var bs,cc="FunctionToString",xs=new WeakMap,pc=(()=>({name:cc,setupOnce(){bs=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=dr(this),r=xs.has(T())&&t!==void 0?t:this;return bs.apply(r,e)}}catch{}},setup(e){xs.set(e,!0)}})),dt=pc;var uc=[/^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$/],fc="EventFilters",Be=(e={})=>{let t;return{name:fc,setup(r){let n=r.getOptions();t=vs(e,n)},processEvent(r,n,o){if(!t){let s=o.getOptions();t=vs(e,s)}return dc(r,t)?null:r}}},lc=((e={})=>({...Be(e),name:"InboundFilters"}));function vs(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:uc],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function dc(e,t){if(e.type){if(e.type==="transaction"&&gc(e,t.ignoreTransactions))return g&&l.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
9
9
  Event: ${Q(e)}`),!0}else{if(mc(e,t.ignoreErrors))return g&&l.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
10
10
  Event: ${Q(e)}`),!0;if(Ec(e))return g&&l.warn(`Event dropped due to not having an error message, error type or stacktrace.
11
11
  Event: ${Q(e)}`),!0;if(_c(e,t.denyUrls))return g&&l.warn(`Event dropped due to being matched by \`denyUrls\` option.
12
12
  Event: ${Q(e)}.
13
13
  Url: ${Kt(e)}`),!0;if(!Sc(e,t.allowUrls))return g&&l.warn(`Event dropped due to not being matched by \`allowUrls\` option.
14
14
  Event: ${Q(e)}.
15
- Url: ${Kt(e)}`),!0}return!1}function mc(e,t){return t?.length?jt(e).some(r=>q(r,t)):!1}function gc(e,t){if(!t?.length)return!1;let r=e.transaction;return r?q(r,t):!1}function _c(e,t){if(!t?.length)return!1;let r=Kt(e);return r?q(r,t):!1}function Sc(e,t){if(!t?.length)return!0;let r=Kt(e);return r?q(r,t):!0}function hc(e=[]){for(let t=e.length-1;t>=0;t--){let r=e[t];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function Kt(e){try{let r=[...e.exception?.values??[]].reverse().find(n=>n.mechanism?.parent_id===void 0&&n.stacktrace?.frames?.length)?.stacktrace?.frames;return r?hc(r):null}catch{return g&&l.error(`Cannot extract url for event ${Q(e)}`),null}}function Ec(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function Rs(e,t,r,n,o,s){if(!o.exception?.values||!s||!Te(s.originalException,Error))return;let i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=sn(e,t,n,s.originalException,r,o.exception.values,i,0))}function sn(e,t,r,n,o,s,i,a){if(s.length>=r+1)return s;let c=[...s];if(Te(n[o],Error)){vs(i,a,n);let p=e(t,n[o]),u=c.length;Ns(p,o,u,a),c=sn(e,t,r,n[o],o,[p,...c],p,u)}return As(n)&&n.errors.forEach((p,u)=>{if(Te(p,Error)){vs(i,a,n);let f=e(t,p),d=c.length;Ns(f,`errors[${u}]`,d,a),c=sn(e,t,r,p,o,[f,...c],f,d)}}),c}function As(e){return Array.isArray(e.errors)}function vs(e,t,r){e.mechanism={handled:!0,type:"auto.core.linked_errors",...As(r)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ns(e,t,r,n){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:n}}function Cs(e,t){return e(t.stack||"",1)}function Tc(e){return Ye(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Ic(e){return Tc(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function an(e,t){let r={type:t.name||t.constructor.name,value:Ic(t)},n=Cs(e,t);return n.length&&(r.stacktrace={frames:n}),r}function yc(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(r instanceof Error)return r}}function bc(e){if("name"in e&&typeof e.name=="string"){let n=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(n+=` with message '${e.message}'`),n}else if("message"in e&&typeof e.message=="string")return e.message;let t=mr(e);if(Un(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let r=xc(e);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${t}`}function xc(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function vc(e,t,r,n){if(Ye(r))return[r,void 0];if(t.synthetic=!0,ue(r)){let s=e?.getOptions().normalizeDepth,i={__serialized__:_r(r,s)},a=yc(r);if(a)return[a,i];let c=bc(r),p=n?.syntheticException||new Error(c);return p.message=c,[p,i]}let o=n?.syntheticException||new Error(r);return o.message=`${r}`,[o,void 0]}function Os(e,t,r,n){let s=n?.data&&n.data.mechanism||{handled:!0,type:"generic"},[i,a]=vc(e,s,r,n),c={exception:{values:[an(t,i)]}};return a&&(c.extra=a),yr(c,void 0,void 0),ve(c,s),{...c,event_id:n?.event_id}}function Ls(e,t,r="info",n,o){let s={event_id:n?.event_id,level:r};if(o&&n?.syntheticException){let i=Cs(e,n.syntheticException);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]},ve(s,{synthetic:!0}))}if(Ve(t)){let{__sentry_template_string__:i,__sentry_template_values__:a}=t;return s.logentry={message:i,params:a},s}return s.message=t,s}var Nc="cause",Rc=5,Ac="LinkedErrors",Cc=((e={})=>{let t=e.limit||Rc,r=e.key||Nc;return{name:Ac,preprocessEvent(n,o,s){let i=s.getOptions();Rs(an,i.stackParser,r,t,n,o)}}}),mt=Cc;var cn=["X-Client-IP","X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP","Fastly-Client-Ip","True-Client-Ip","X-Real-IP","X-Cluster-Client-IP","X-Forwarded","Forwarded-For","Forwarded","X-Vercel-Forwarded-For"];function pn(e){let t={};for(let s of Object.keys(e))t[s.toLowerCase()]=e[s];return cn.map(s=>{let i=t[s.toLowerCase()],a=Array.isArray(i)?i.join(";"):i;return s==="Forwarded"?Oc(a):a?.split(",").map(c=>c.trim())}).reduce((s,i)=>i?s.concat(i):s,[]).find(s=>s!==null&&Lc(s))||null}function Oc(e){if(!e)return null;for(let t of e.split(";"))if(t.startsWith("for="))return t.slice(4);return null}function Lc(e){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(e)}var Mc="RequestData",kc=((e={})=>{function t(r){let n=r.getDataCollectionOptions(),o={...n,...e.include?.cookies===!0&&n.cookies===!1&&{cookies:!0},...e.include?.headers===!0&&n.httpHeaders.request===!1&&{httpHeaders:{...n.httpHeaders,request:!0}}};return{dataCollection:o,include:{cookies:o.cookies!==!1,data:!0,headers:o.httpHeaders.request!==!1,ip:o.userInfo,query_string:o.queryParams!==!1,url:!0,...e.include}}}return{name:Mc,processEvent(r,n,o){let{sdkProcessingMetadata:s={}}=r,{normalizedRequest:i,ipAddress:a}=s,{include:c}=t(o);return i&&Pc(r,i,{ipAddress:a},c),r},processSegmentSpan(r,n){let{sdkProcessingMetadata:o={}}=L().getScopeData(),{normalizedRequest:s,ipAddress:i}=o;if(!s)return;let{include:a,dataCollection:c}=t(n);Dc(r,s,i,a,c)}}}),gt=kc;function Pc(e,t,r,n){if(e.request={...e.request,...Ms(t,n)},n.ip){let o=t.headers&&pn(t.headers)||r.ipAddress;o&&(e.user={...e.user,ip_address:o})}}function Dc(e,t,r,n,o){let s=Ms(t,n),i={};if(s.url&&(i["url.full"]=s.url),s.method&&(i["http.request.method"]=s.method),s.query_string&&(i["url.query"]=Uc(s.query_string)),k(e,i),s.cookies&&Object.keys(s.cookies).length>0){let a=Object.entries(s.cookies).map(([p,u])=>`${p}=${u}`).join("; "),c=nn({cookie:a},o,"request");k(e,c)}if(s.headers){let a=nn(s.headers,o,"request");k(e,a)}if(s.data!=null){let a=typeof s.data=="string"?s.data:JSON.stringify(s.data);a&&k(e,{"http.request.body.data":a})}if(n.ip){let a=t.headers&&pn(t.headers)||r||void 0;a&&k(e,{[Ot]:a})}}function Ms(e,t){let r={},n={...e.headers};if(t.headers&&(r.headers=n,t.cookies||delete n.cookie,!t.ip)){let o=new Set(cn.map(s=>s.toLowerCase()));for(let s of Object.keys(n))o.has(s.toLowerCase())&&delete n[s]}if(r.method=e.method,t.url&&(r.url=e.url),t.cookies){let o=e.cookies||(n?.cookie?Ts(n.cookie):void 0);r.cookies=o||{}}return t.query_string&&(r.query_string=e.query_string),t.data&&(r.data=e.data),r}function Uc(e){return typeof e=="string"?e||void 0:(Array.isArray(e)?e:Object.entries(e)).map(([n,o])=>`${n}=${o}`).join("&")||void 0}var Xt=new Set([]);function ks(e){let t="console",r=lr(t,e);return He(t,Fc),r}function Ps(e){for(let t of e)Xt.add(t);return()=>{for(let t of e)Xt.delete(t)}}function Fc(){"console"in h&&pe.forEach(function(e){e in h.console&&je(h.console,e,function(t){return w[e]=t,function(...r){let n=r[0],o=w[e],s=Xt.size&&typeof n=="string"&&q(n,Xt);s||Ee("console",{args:r,level:e}),(!s||g&&l.isEnabled())&&o?.apply(h.console,r)}})})}function Ds(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var wc=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Bc(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,r=wc.exec(t);return r?r.slice(1):[]}function un(e){let t=Bc(e),r=t[0]||"",n=t[1];return!r&&!n?".":(n&&(n=n.slice(0,n.length-1)),r+n)}var Gc="Console",fn=(e={})=>{let t=new Set(e.levels||pe);return{name:Gc,setup(r){let n=ks(({args:o,level:s})=>{T()!==r||!t.has(s)||Hc(s,o)});if(r.registerCleanup(n),e.filter){let o=Ps(e.filter);r.registerCleanup(o)}}}};function Hc(e,t){let r={category:"console",data:{arguments:t,logger:"console"},level:Ds(e),message:Us(t)};if(e==="assert")if(t[0]===!1){let n=t.slice(1);r.message=n.length>0?`Assertion failed: ${Us(n)}`:"Assertion failed",r.data.arguments=n}else return;on(r,{input:t,level:e})}function Us(e){return"util"in h&&typeof h.util.format=="function"?h.util.format(...e):Er(e," ")}function Fs(e,t,r){let n=r.getOptions(),o=r.getDsn(),s=n.tunnel,i=Me(n._metadata),a={sent_at:new Date(C()).toISOString(),...Yc(t)&&{trace:t},...i&&{sdk:i},...!!s&&o&&{dsn:M(o)}},c=r.getDataCollectionOptions().userInfo?"auto":"never",p=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...se()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}];return v(a,[p])}function Yc(e){return!!e.trace_id&&!!e.public_key}function ws(e){let t=156;if(t+=e.name.length*2,t+=Cr(e.attributes),e.links&&e.links.length>0){let n=e.links[0]?.attributes,o=100+(n?Cr(n):0);t+=o*e.links.length}return t}var Bs=1e3,Wc=5e6,qt=class{constructor(t,r){this._traceBuckets=new Map,this._client=t;let{maxSpanLimit:n,flushInterval:o,maxTraceWeightInBytes:s}=r??{};this._maxSpanLimit=n&&n>0&&n<=Bs?n:Bs,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=s&&s>0?s:Wc,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(i=>{clearTimeout(i.timeout)}),this._traceBuckets.clear()})}add(t){let r=t.trace_id,n=this._traceBuckets.get(r);n||(n={spans:new Set,size:0,timeout:Ue(setTimeout(()=>{this.flush(r)},this._flushInterval))},this._traceBuckets.set(r,n)),n.spans.add(t),n.size+=ws(t),(n.spans.size>=this._maxSpanLimit||n.size>=this._maxTraceWeight)&&this.flush(r)}drain(){this._traceBuckets.size&&(g&&l.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((t,r)=>{this.flush(r)}))}flush(t){let r=this._traceBuckets.get(t);if(!r)return;if(!r.spans.size){this._removeTrace(t);return}let n=Array.from(r.spans),o=n[0]?._segmentSpan;if(!o){g&&l.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}let s=Oe(o),i=n.map(c=>{let{_segmentSpan:p,...u}=c;return u}),a=Fs(i,s,this._client);g&&l.log(`Sending span envelope for trace ${t} with ${i.length} spans`),this._client.sendEnvelope(a).then(null,c=>{g&&l.error("Error while sending streamed span envelope:",c)}),this._removeTrace(t)}_removeTrace(t){let r=this._traceBuckets.get(t);r&&clearTimeout(r.timeout),this._traceBuckets.delete(t)}};var Qt=()=>({name:"SpanStreaming",setup(e){let t="SpanStreaming integration requires",r="Falling back to static trace lifecycle.",n=e.getOptions();if(!wt(e)){n.traceLifecycle="static",g&&l.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${r}`);return}let o=n.beforeSendSpan;if(o&&!Le(o)){n.traceLifecycle="static",g&&l.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${r}`);return}let s=new qt(e);e.on("afterSpanEnd",i=>{Dt(i)&&s.add(jr(i,e))})}});var ie=class{constructor(t){this._maxSize=t,this._cache=new Map}get size(){return this._cache.size}get(t){let r=this._cache.get(t);if(r!==void 0)return this._cache.delete(t),this._cache.set(t,r),r}set(t,r){if(this._cache.size>=this._maxSize){let n=this._cache.keys().next().value;this._cache.delete(n)}this._cache.set(t,r)}remove(t){let r=this._cache.get(t);return r&&this._cache.delete(t),r}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let t=[];return this._cache.forEach(r=>t.push(r)),t}};function Gs(e){let t=e._metadata?.sdk,r=t?.name&&t?.version?`${t?.name}/${t?.version}`:void 0;e.transportOptions={...e.transportOptions,headers:{...r&&{"user-agent":r},...e.transportOptions?.headers}}}var _t=class extends Zt{constructor(t){Gs(t),super(t),this._disposeCallbacks=[],this._setUpMetricsProcessing()}eventFromException(t,r){let n=Os(this,this._options.stackParser,t,r);return n.level="error",z(n)}eventFromMessage(t,r="info",n){return z(Ls(this._options.stackParser,t,r,n,this._options.attachStacktrace))}captureException(t,r,n){return Hs(r),super.captureException(t,r,n)}captureEvent(t,r,n){return!t.type&&t.exception?.values&&t.exception.values.length>0&&Hs(r),super.captureEvent(t,r,n)}captureCheckIn(t,r,n){let o="checkInId"in t&&t.checkInId?t.checkInId:y();if(!this._isEnabled())return g&&l.warn("SDK not enabled, will not capture check-in."),o;let s=this.getOptions(),{release:i,environment:a,tunnel:c}=s,p={check_in_id:o,monitor_slug:t.monitorSlug,status:t.status,release:i,environment:a};"duration"in t&&(p.duration=t.duration),r&&(p.monitor_config={schedule:r.schedule,checkin_margin:r.checkinMargin,max_runtime:r.maxRuntime,timezone:r.timezone,failure_issue_threshold:r.failureIssueThreshold,recovery_threshold:r.recoveryThreshold});let[u,f]=$o(this,n);f&&(p.contexts={trace:f});let d=Is(p,u,this.getSdkMetadata(),c,this.getDsn());return g&&l.log("Sending checkin:",t.monitorSlug,t.status),this.sendEnvelope(d),o}registerCleanup(t){this._disposeCallbacks.push(t)}dispose(){g&&l.log("Disposing client...");for(let t of this._disposeCallbacks)try{t()}catch{}this._disposeCallbacks.length=0;for(let t of Object.keys(this._hooks))this._hooks[t]?.clear();this._hooks={},this._eventProcessors.length=0,this._integrations={},this._outcomes={},this._transport=void 0,this._promiseBuffer=Fe(pt)}_prepareEvent(t,r,n,o){return this._options.platform&&(t.platform=t.platform||this._options.platform),this._options.runtime&&(t.contexts={...t.contexts,runtime:t.contexts?.runtime||this._options.runtime}),this._options.serverName&&(t.server_name=t.server_name||this._options.serverName),super._prepareEvent(t,r,n,o)}_setUpMetricsProcessing(){this.on("processMetric",t=>{this._options.serverName&&(t.attributes={"server.address":this._options.serverName,...t.attributes})})}};function Hs(e){let t=L().getScopeData().sdkProcessingMetadata.requestSession;if(t){let r=e?.mechanism?.handled??!0;r&&t.status!=="crashed"?t.status="errored":r||(t.status="crashed")}}function Vs(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes("node_modules/")}function js(e){let t=/^\s*[-]{4,}$/,r=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,n=/at (?:async )?(.+?) \(data:(.*?),/;return o=>{let s=o.match(n);if(s)return{filename:`<data:${s[2]}>`,function:s[1]};let i=o.match(r);if(i){let a,c,p,u,f;if(i[1]){p=i[1];let S=p.lastIndexOf(".");if(p[S-1]==="."&&S--,S>0){a=p.slice(0,S),c=p.slice(S+1);let E=a.indexOf(".Module");E>0&&(p=p.slice(E+1),a=a.slice(0,E))}u=void 0}c&&(u=a,f=c),c==="<anonymous>"&&(f=void 0,p=void 0),p===void 0&&(f=f||"?",p=u?`${u}.${f}`:f);let d=kn(i[2]),m=i[5]==="native";!d&&i[5]&&!m&&(d=i[5]);let _=d?Vc(d):void 0;return{filename:_??d,module:_&&e?.(_),function:p,lineno:Ys(i[3]),colno:Ys(i[4]),in_app:Vs(d||"",m)}}if(o.match(t))return{filename:o}}}function ln(e){return[90,js(e)]}function Ys(e){return parseInt(e||"",10)||void 0}function Vc(e){try{return decodeURI(e)}catch{return}}import{threadId as dp,isMainThread as mp}from"worker_threads";var N=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var gp=6e4,er=class extends _t{constructor(t){let r=t.includeServerName===!1?void 0:t.serverName||global.process.env.SENTRY_NAME||$s.hostname(),n={...t,platform:"node",runtime:{name:"node",version:global.process.version},serverName:r};lt(n,"node-light",["node-core"]),l.log(`Initializing Sentry: process: ${process.pid}, thread: ${mp?"main":`worker-${dp}`}.`),super(n),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{De(this)},r&&this.on("beforeCaptureLog",o=>{o.attributes={...o.attributes,"server.address":r}}),process.on("beforeExit",this._logOnExitFlushListener))}async flush(t){return this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(t)}async close(t){return this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off("beforeExit",this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off("beforeExit",this._logOnExitFlushListener),super.close(t)}startClientReportTracking(){let t=this.getOptions();t.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{N&&l.log("Flushing client reports based on interval."),this._flushOutcomes()},t.clientReportFlushInterval??gp).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}};import{execFile as _p}from"node:child_process";import{readFile as Sp,readdir as hp}from"node:fs";import*as I from"node:os";import{join as Ep}from"node:path";import{promisify as Js}from"node:util";var Tp=Js(Sp),Ip=Js(hp),yp="Context",bp=((e={})=>{let t={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...e},r=t.app?Ap():void 0,n=t.device?Cp(t.device):void 0,o=t.culture?Rp():void 0,s=t.cloudResource?Dp():void 0,i=t.os?Np():void 0,a={"process.runtime.engine.name":"v8","process.runtime.engine.version":process.versions.v8,...zs({app:r,device:n,culture:o,cloud_resource:s})};i&&i.then(u=>Object.assign(a,zs({os:u}))).catch(()=>{});let c=(async()=>{let u={};return i&&(u.os=await i),r&&(u.app=r),n&&(u.device=n),o&&(u.culture=o),s&&(u.cloud_resource=s),u})();async function p(u){let f=xp(await c);return u.contexts={...u.contexts,app:{...f.app,...u.contexts?.app},os:{...f.os,...u.contexts?.os},device:{...f.device,...u.contexts?.device},culture:{...f.culture,...u.contexts?.culture},cloud_resource:{...f.cloud_resource,...u.contexts?.cloud_resource}},u}return{name:yp,processEvent(u){return p(u)},processSegmentSpan(u){k(u,a),k(u,vp(r,n))}}}),dn=bp;function xp(e){if(e.app?.app_memory&&(e.app.app_memory=process.memoryUsage().rss),e.app?.free_memory&&typeof process.availableMemory=="function"){let t=process.availableMemory?.();t!=null&&(e.app.free_memory=t)}return e.device?.free_memory&&(e.device.free_memory=I.freemem()),e}function zs(e){let t={},{app:r,device:n,os:o,culture:s,cloud_resource:i}=e;if(r&&r.app_start_time&&(t["app.start_time"]=r.app_start_time),n&&(n.arch&&(t["device.archs"]=[n.arch]),n.boot_time&&(t["device.boot_time"]=n.boot_time),n.memory_size!=null&&(t["device.memory_size"]=n.memory_size),n.processor_count!=null&&(t["device.processor_count"]=n.processor_count),n.cpu_description&&(t["device.cpu_description"]=n.cpu_description),n.processor_frequency!=null&&(t["device.processor_frequency"]=n.processor_frequency)),o&&(o.name&&(t["os.name"]=o.name),o.version&&(t["os.version"]=o.version),o.kernel_version&&(t["os.kernel_version"]=o.kernel_version),o.build&&(t["os.build"]=o.build)),s&&(s.locale&&(t["culture.locale"]=s.locale),s.timezone&&(t["culture.timezone"]=s.timezone)),i)for(let[a,c]of Object.entries(i))c!=null&&(t[a]=c);return t}function vp(e,t){let r={};if(e&&(r["app.memory"]=process.memoryUsage().rss,typeof process.availableMemory=="function")){let n=process.availableMemory?.();n!=null&&(r["app.free_memory"]=n)}return t?.free_memory!=null&&(r["device.free_memory"]=I.freemem()),r}async function Np(){let e=I.platform();switch(e){case"darwin":return kp();case"linux":return Pp();default:return{name:Op[e]||e,version:I.release()}}}function Rp(){try{if(typeof process.versions.icu!="string")return;let e=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(e)==="enero"){let r=Intl.DateTimeFormat().resolvedOptions();return{locale:r.locale,timezone:r.timeZone}}}catch{}}function Ap(){let e=process.memoryUsage().rss,r={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:e};if(typeof process.availableMemory=="function"){let n=process.availableMemory?.();n!=null&&(r.free_memory=n)}return r}function Cp(e){let t={},r;try{r=I.uptime()}catch{}if(typeof r=="number"&&(t.boot_time=new Date(Date.now()-r*1e3).toISOString()),t.arch=I.arch(),(e===!0||e.memory)&&(t.memory_size=I.totalmem(),t.free_memory=I.freemem()),e===!0||e.cpu){let n=I.cpus(),o=n?.[0];o&&(t.processor_count=n.length,t.cpu_description=o.model,t.processor_frequency=o.speed)}return t}var Op={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows",ohos:"OpenHarmony",android:"Android"},Lp=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],Mp={alpine:e=>e,arch:e=>Y(/distrib_release=(.*)/,e),centos:e=>Y(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>Y(/release (..)/,e),mint:e=>Y(/distrib_release=(.*)/,e),red:e=>Y(/release ([^ ]+)/,e),suse:e=>Y(/VERSION = (.*)\n/,e),ubuntu:e=>Y(/distrib_release=(.*)/,e)};function Y(e,t){let r=e.exec(t);return r?r[1]:void 0}async function kp(){let e={kernel_version:I.release(),name:"Mac OS X",version:`10.${Number(I.release().split(".")[0])-4}`};try{let t=await new Promise((r,n)=>{_p("/usr/bin/sw_vers",(o,s)=>{if(o){n(o);return}r(s)})});e.name=Y(/^ProductName:\s+(.*)$/m,t),e.version=Y(/^ProductVersion:\s+(.*)$/m,t),e.build=Y(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function Zs(e){return e.split(" ")[0].toLowerCase()}async function Pp(){let e={kernel_version:I.release(),name:"Linux"};try{let t=await Ip("/etc"),r=Lp.find(a=>t.includes(a.name));if(!r)return e;let n=Ep("/etc",r.name),o=(await Tp(n,{encoding:"utf-8"})).toLowerCase(),{distros:s}=r;e.name=s.find(a=>o.indexOf(Zs(a))>=0)||s[0];let i=Zs(e.name);e.version=Mp[i]?.(o)}catch{}return e}function Dp(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}import{createReadStream as Up}from"node:fs";import{createInterface as Fp}from"node:readline";var mn=new ie(10),qs=new ie(20),wp=7,Bp="ContextLines",Gp=1e3,Hp=1e4;function Yp(e,t,r){let n=e.get(t);return n===void 0?(e.set(t,r),r):n}function Wp(e){return!!(e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:"))}function Vp(e){return e.lineno!==void 0&&e.lineno>Hp||e.colno!==void 0&&e.colno>Gp}function jp(e,t){let r=mn.get(e);if(r===void 0)return!1;for(let n=t[0];n<=t[1];n++)if(r[n]===void 0)return!1;return!0}function $p(e,t){if(!e.length)return[];let r=0,n=e[0];if(typeof n!="number")return[];let o=Xs(n,t),s=[];for(;;){if(r===e.length-1){s.push(o);break}let i=e[r+1];if(typeof i!="number")break;i<=o[1]?o[1]=i+t:(s.push(o),o=Xs(i,t)),r++}return s}function zp(e,t,r){return new Promise((n,o)=>{let s=Up(e),i=Fp({input:s});function a(){s.destroy(),n()}let c=0,p=0,u=t[p];if(u===void 0){a();return}let f=u[0],d=u[1];function m(_){qs.set(e,1),N&&l.error(`Failed to read file: ${e}. Error: ${_}`),i.close(),i.removeAllListeners(),a()}s.on("error",m),i.on("error",m),i.on("close",a),i.on("line",_=>{if(c++,!(c<f)&&(r[c]=hr(_,0),c>=d)){if(p===t.length-1){i.close(),i.removeAllListeners();return}p++;let S=t[p];if(S===void 0){i.close(),i.removeAllListeners();return}f=S[0],d=S[1]}})})}async function Zp(e,t){let r={};if(t>0&&e.exception?.values){for(let s of e.exception.values)if(s.stacktrace?.frames?.length)for(let i=s.stacktrace.frames.length-1;i>=0;i--){let a=s.stacktrace.frames[i],c=a?.filename;if(!a||typeof c!="string"||typeof a.lineno!="number"||Wp(c)||Vp(a))continue;r[c]||(r[c]=[]),r[c].push(a.lineno)}}let n=Object.keys(r);if(n.length==0)return e;let o=[];for(let s of n){if(qs.get(s))continue;let i=r[s];if(!i)continue;i.sort((p,u)=>p-u);let a=$p(i,t);if(a.every(p=>jp(s,p)))continue;let c=Yp(mn,s,{});o.push(zp(s,a,c))}if(await Promise.all(o).catch(()=>{N&&l.log("Failed to read one or more source files and resolve context lines")}),t>0&&e.exception?.values)for(let s of e.exception.values)s.stacktrace?.frames&&s.stacktrace.frames.length>0&&Jp(s.stacktrace.frames,t,mn);return e}function Jp(e,t,r){for(let n of e)if(n.filename&&n.context_line===void 0&&typeof n.lineno=="number"){let o=r.get(n.filename);if(o===void 0)continue;Kp(n.lineno,n,t,o)}}function Ks(e){delete e.pre_context,delete e.context_line,delete e.post_context}function Kp(e,t,r,n){if(t.lineno===void 0||n===void 0){N&&l.error("Cannot resolve context for frame with no lineno or file contents");return}t.pre_context=[];for(let s=Qs(e,r);s<e;s++){let i=n[s];if(i===void 0){Ks(t),N&&l.error(`Could not find line ${s} in file ${t.filename}`);return}t.pre_context.push(i)}if(n[e]===void 0){Ks(t),N&&l.error(`Could not find line ${e} in file ${t.filename}`);return}t.context_line=n[e];let o=ei(e,r);t.post_context=[];for(let s=e+1;s<=o;s++){let i=n[s];if(i===void 0)break;t.post_context.push(i)}}function Qs(e,t){return Math.max(1,e-t)}function ei(e,t){return e+t}function Xs(e,t){return[Qs(e,t),ei(e,t)]}var Xp=((e={})=>({name:Bp,processEvent(t,r,n){let o=e.frameContextLines??n?.getDataCollectionOptions().frameContextLines??wp;return Zp(t,o)}})),gn=Xp;var tr=br(process.versions.node),ti=tr.major,$h=tr.minor;import{Worker as qp}from"node:worker_threads";var rr;async function nr(){if(rr===void 0)try{rr=!!(await import("node:inspector")).url()}catch{rr=!1}return rr}var St="__SENTRY_ERROR_LOCAL_VARIABLES__";function ni(e,t,r){let n=0,o=5,s=0;return setInterval(()=>{s===0?n>e&&(o*=2,r(o),o>86400&&(o=86400),s=o):(s-=1,s===0&&t()),n=0},1e3).unref(),()=>{n+=1}}function ri(e){return e!==void 0&&(e.length===0||e==="?"||e==="<anonymous>")}function or(e,t){return e===t||`Object.${e}`===t||e===`Object.${t}`||ri(e)&&ri(t)}var Qp="LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjYwLjAgKDQ1NDhhZmMpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=";function oi(...e){l.log("[LocalVariables]",...e)}var si=((e={})=>{function t(s,i){let a=(s.stacktrace?.frames||[]).filter(c=>c.function!=="new Promise");for(let c=0;c<a.length;c++){let p=a.length-c-1,u=i[c],f=a[p];if(!f||!u)break;u.vars===void 0||f.in_app===!1&&e.includeOutOfAppFrames!==!0||!or(f.function,u.function)||(f.vars=u.vars)}}function r(s,i){if(i.originalException&&typeof i.originalException=="object"&&St in i.originalException&&Array.isArray(i.originalException[St])){for(let a of s.exception?.values||[])t(a,i.originalException[St]);i.originalException[St]=void 0}return s}async function n(){let s=await import("node:inspector");s.url()||s.open(0)}function o(s){let i=new qp(new URL(`data:application/javascript;base64,${Qp}`),{workerData:s,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{i.terminate()}),i.once("error",a=>{oi("Worker error",a)}),i.once("exit",a=>{oi("Worker exit",a)}),i.unref()}return{name:"LocalVariablesAsync",async setup(s){if(!s.getOptions().includeLocalVariables)return;if(await nr()){l.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...e,debug:l.isEnabled()};n().then(()=>{try{o(a)}catch(c){l.error("Failed to start worker",c)}},c=>{l.error("Failed to start inspector",c)})},processEvent(s,i){return r(s,i)}}});function ii(e){if(e!==void 0)return e.slice(-10).reduce((t,r)=>`${t},${r.function},${r.lineno},${r.colno}`,"")}function eu(e,t){if(t!==void 0)return ii(e(t,1))}function ai(e){let t=[],r=!1;function n(i){t=[],!r&&(r=!0,e(i))}t.push(n);function o(i){t.push(i)}function s(i){let a=t.pop()||n;try{a(i)}catch{n(i)}}return{add:o,next:s}}var _n=class e{constructor(t){this._session=t}static async create(t){if(t)return t;let r=await import("node:inspector");return new e(new r.Session)}configureAndConnect(t,r){this._session.connect(),this._session.on("Debugger.paused",n=>{t(n,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:r?"all":"uncaught"})}setPauseOnExceptions(t){this._session.post("Debugger.setPauseOnExceptions",{state:t?"all":"uncaught"})}getLocalVariables(t,r){this._getProperties(t,n=>{let{add:o,next:s}=ai(r);for(let i of n)if(i.value?.objectId&&i.value.className==="Array"){let a=i.value.objectId;o(c=>this._unrollArray(a,i.name,c,s))}else if(i.value?.objectId&&i.value.className==="Object"){let a=i.value.objectId;o(c=>this._unrollObject(a,i.name,c,s))}else i.value&&o(a=>this._unrollOther(i,a,s));s({})})}_getProperties(t,r){this._session.post("Runtime.getProperties",{objectId:t,ownProperties:!0},(n,o)=>{r(n?[]:o.result)})}_unrollArray(t,r,n,o){this._getProperties(t,s=>{n[r]=s.filter(i=>i.name!=="length"&&!isNaN(parseInt(i.name,10))).sort((i,a)=>parseInt(i.name,10)-parseInt(a.name,10)).map(i=>i.value?.value),o(n)})}_unrollObject(t,r,n,o){this._getProperties(t,s=>{n[r]=s.map(i=>[i.name,i.value?.value]).reduce((i,[a,c])=>(i[a]=c,i),{}),o(n)})}_unrollOther(t,r,n){t.value&&("value"in t.value?t.value.value===void 0||t.value.value===null?r[t.name]=`<${t.value.value}>`:r[t.name]=t.value.value:"description"in t.value&&t.value.type!=="function"?r[t.name]=`<${t.value.description}>`:t.value.type==="undefined"&&(r[t.name]="<undefined>")),n(r)}},tu="LocalVariables",ru=((e={},t)=>{let r=new ie(20),n,o=!1;function s(p){let u=ii(p.stacktrace?.frames);if(u===void 0)return;let f=r.remove(u);if(f===void 0)return;let d=(p.stacktrace?.frames||[]).filter(m=>m.function!=="new Promise");for(let m=0;m<d.length;m++){let _=d.length-m-1,S=f[m],E=d[_];if(!E||!S)break;S.vars===void 0||E.in_app===!1&&e.includeOutOfAppFrames!==!0||!or(E.function,S.function)||(E.vars=S.vars)}}function i(p){for(let u of p.exception?.values||[])s(u);return p}let a;async function c(){let u=T()?.getOptions();if(!u?.includeLocalVariables)return;if(ti<18){l.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await nr()){l.warn("Local variables capture has been disabled because the debugger was already enabled");return}try{let d=await _n.create(t),m=(S,{params:{reason:E,data:x,callFrames:R}},V)=>{if(E!=="exception"&&E!=="promiseRejection"){V();return}n?.();let _e=eu(S,x.description);if(_e==null){V();return}let{add:Se,next:ce}=ai(P=>{r.set(_e,P),V()});for(let P=0;P<Math.min(R.length,5);P++){let{scopeChain:bi,functionName:vn,this:ar}=R[P],Nn=bi.find(he=>he.type==="local"),Rn=ar.className==="global"||!ar.className?vn:`${ar.className}.${vn}`;if(Nn?.object.objectId===void 0)Se(he=>{he[P]={function:Rn},ce(he)});else{let he=Nn.object.objectId;Se(An=>d.getLocalVariables(he,xi=>{An[P]={function:Rn,vars:xi},ce(An)}))}}ce([])},_=e.captureAllExceptions!==!1;if(d.configureAndConnect((S,E)=>m(u.stackParser,S,E),_),_){let S=e.maxExceptionsPerSecond||50;n=ni(S,()=>{l.log("Local variables rate-limit lifted."),d.setPauseOnExceptions(!0)},E=>{l.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${E} seconds.`),d.setPauseOnExceptions(!1)})}o=!0}catch(d){l.log("The `LocalVariables` integration failed to start.",d)}}return{name:tu,setupOnce(){a=c()},async processEvent(p){return await a,o?i(p):p},_getCachedFramesCount(){return r.size},_getFirstCachedFrame(){return r.values()[0]}}}),ci=ru;var Sn=(e={})=>tr.major<19?ci(e):si(e);function pi(){try{return typeof module<"u"&&typeof module.exports<"u"}catch{return!1}}import{isMainThread as ou}from"worker_threads";var nu=2e3;function ht(e){b(()=>{console.error(e)});let t=T();if(t===void 0){N&&l.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let r=t.getOptions(),n=r?.shutdownTimeout&&r.shutdownTimeout>0?r.shutdownTimeout:nu;t.close(n).then(o=>{o||N&&l.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},o=>{N&&l.error(o)})}var su="OnUncaughtException",hn=(e={})=>{let t={exitEvenIfOtherHandlersAreRegistered:!1,...e};return{name:su,setup(r){ou&&global.process.on("uncaughtException",iu(r,t))}}};function iu(e,t){let n=!1,o=!1,s=!1,i,a=e.getOptions();return Object.assign(c=>{let p=ht;t.onFatalError?p=t.onFatalError:a.onFatalError&&(p=a.onFatalError);let f=global.process.listeners("uncaughtException").filter(m=>m.name!=="domainUncaughtExceptionClear"&&m._errorHandler!==!0).length===0,d=t.exitEvenIfOtherHandlersAreRegistered||f;n?d&&(s?(N&&l.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),ht(c)):o||(o=!0,setTimeout(()=>{s||(s=!0,p(i,c))},2e3))):(i=c,n=!0,T()===e&&oe(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"auto.node.onuncaughtexception"}}),!s&&d&&(s=!0,p(c)))},{_errorHandler:!0})}var au="OnUnhandledRejection",cu=[{name:"AI_NoOutputGeneratedError"},{name:"AbortError"}],pu=((e={})=>{let t={mode:e.mode??"warn",ignore:[...cu,...e.ignore??[]]};return{name:au,setup(r){global.process.on("unhandledRejection",du(r,t))}}}),En=pu;function uu(e){if(typeof e!="object"||e===null)return{name:"",message:String(e??"")};let t=e,r=typeof t.name=="string"?t.name:"",n=typeof t.message=="string"?t.message:String(e);return{name:r,message:n}}function fu(e,t){let r=e.name===void 0||H(t.name,e.name,!0),n=e.message===void 0||H(t.message,e.message);return r&&n}function lu(e,t){let r=uu(t);return e.some(n=>fu(n,r))}function du(e,t){return function(n,o){if(T()!==e||lu(t.ignore??[],n))return;let s=t.mode==="strict"?"fatal":"error",i=n&&typeof n=="object"?n._sentry_active_span:void 0;(i?c=>Bt(i,c):c=>c())(()=>{oe(n,{originalException:n,captureContext:{extra:{unhandledPromiseRejection:!0},level:s},mechanism:{handled:!1,type:"auto.node.onunhandledrejection"}})}),mu(n,t.mode)}}function mu(e,t){let r="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";t==="warn"?b(()=>{console.warn(r),console.error(e&&typeof e=="object"&&"stack"in e?e.stack:e)}):t==="strict"&&(b(()=>{console.warn(r)}),ht(e))}import*as ui from"node:http";var Tn="Spotlight",gu=((e={})=>{let t={sidecarUrl:e.sidecarUrl||"http://localhost:8969/stream"};return{name:Tn,setup(r){try{process.env.NODE_ENV&&process.env.NODE_ENV!=="development"&&l.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?")}catch{}_u(r,t)}}}),fi=gu;function _u(e,t){let r=Su(t.sidecarUrl);if(!r)return;let n=0;e.on("beforeEnvelope",o=>{if(n>3){l.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let s=st(o);ke(()=>{let i=ui.request({method:"POST",path:r.pathname,hostname:r.hostname,port:r.port,headers:{"Content-Type":"application/x-sentry-envelope"}},a=>{a.statusCode&&a.statusCode>=200&&a.statusCode<400&&(n=0),a.on("data",()=>{}),a.on("end",()=>{}),a.setEncoding("utf8")});i.on("error",()=>{n++,l.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),i.write(s),i.end()})})}function Su(e){try{return new URL(`${e}`)}catch{l.warn(`[Spotlight] Invalid sidecar URL: ${e}`);return}}var In=(e={})=>({name:"Console",setup(t){process.env.LAMBDA_TASK_ROOT&&He("console",hu),fn({...e,filter:[...e.filter||[],"[DEP0205] DeprecationWarning"]}).setup?.(t)}});function hu(){let e=h?.console;e&&pe.forEach(t=>{t in e&&Eu(e,t)})}function Eu(e,t){let r=e[t];w[t]=r;let n=r,o,s=!1,i=function(...c){if(s){r.apply(e,c);return}s=!0;try{Ee("console",{args:c,level:t}),n.apply(e,c)}finally{s=!1}};xt(i,r);let a=r.bind(e);w[t]=a;try{let c=i;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return c},set(p){p===i?(o!==void 0&&(n=o,o=void 0),c=i):p===a?(o=n,c=a):typeof p=="function"&&!p.__sentry_original__?(n=p,c=i):c=p}})}catch{je(e,t,function(c){return w[t]=c,function(...p){Ee("console",{args:p,level:t}),w[t]?.apply(this,p)}})}}import{posix as Tu,sep as Iu}from"node:path";function li(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function di(e=process.argv[1]?un(process.argv[1]):process.cwd(),t=Iu==="\\"){let r=t?li(e):e;return n=>{if(!n)return;let o=t?li(n):n,{dir:s,base:i,ext:a}=Tu.parse(o);(a===".js"||a===".mjs"||a===".cjs")&&(i=i.slice(0,a.length*-1));let c=decodeURIComponent(i);s||(s=".");let p=s.lastIndexOf("/node_modules");if(p>-1)return`${s.slice(p+14).replace(/\//g,".")}:${c}`;if(s.startsWith(r)){let u=s.slice(r.length+1).replace(/\//g,".");return u?`${u}:${c}`:c}return c}}function mi(e){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(h.SENTRY_RELEASE?.id)return h.SENTRY_RELEASE.id;let t=process.env.GITHUB_SHA||process.env.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA||process.env.CI_BUILD_REF||process.env.CI_COMMIT_SHA||process.env.BITBUCKET_COMMIT,r=process.env.APPVEYOR_PULL_REQUEST_HEAD_COMMIT||process.env.APPVEYOR_REPO_COMMIT||process.env.CODEBUILD_RESOLVED_SOURCE_VERSION||process.env.AWS_COMMIT_ID||process.env.BUILD_SOURCEVERSION||process.env.GIT_CLONE_COMMIT_HASH||process.env.BUDDY_EXECUTION_REVISION||process.env.BUILDKITE_COMMIT||process.env.CIRCLE_SHA1||process.env.CIRRUS_CHANGE_IN_REPO||process.env.CF_REVISION||process.env.CM_COMMIT||process.env.CF_PAGES_COMMIT_SHA||process.env.DRONE_COMMIT_SHA||process.env.FC_GIT_COMMIT_SHA||process.env.HEROKU_TEST_RUN_COMMIT_VERSION||process.env.HEROKU_BUILD_COMMIT||process.env.HEROKU_SLUG_COMMIT||process.env.RAILWAY_GIT_COMMIT_SHA||process.env.RENDER_GIT_COMMIT||process.env.SEMAPHORE_GIT_SHA||process.env.TRAVIS_PULL_REQUEST_SHA||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA,n=process.env.CI_COMMIT_ID||process.env.SOURCE_COMMIT||process.env.SOURCE_VERSION||process.env.GIT_COMMIT||process.env.COMMIT_REF||process.env.BUILD_VCS_NUMBER||process.env.CI_COMMIT_SHA;return t||r||n||e}var gi=yt(ln(di()));import*as bu from"node:http";import*as xu from"node:https";import{Readable as vu}from"node:stream";import{createGzip as Nu}from"node:zlib";import*as Z from"node:net";import*as bn from"node:tls";import*as yn from"node:http";var _i,W=Symbol("AgentBaseInternalState"),sr=class extends(_i=yn.Agent,_i){constructor(t){super(t),this[W]={}}isSecureEndpoint(t){if(t){if(typeof t.secureEndpoint=="boolean")return t.secureEndpoint;if(typeof t.protocol=="string")return t.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
16
- `).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}createSocket(t,r,n){let o={...r,secureEndpoint:this.isSecureEndpoint(r)};Promise.resolve().then(()=>this.connect(t,o)).then(s=>{if(s instanceof yn.Agent)return s.addRequest(t,o);this[W].currentSocket=s,super.createSocket(t,r,n)},n)}createConnection(){let t=this[W].currentSocket;if(this[W].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[W].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(t){this[W]&&(this[W].defaultPort=t)}get protocol(){return this[W].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[W]&&(this[W].protocol=t)}};function ir(...e){l.log("[https-proxy-agent:parse-proxy-response]",...e)}function Si(e){return new Promise((t,r)=>{let n=0,o=[];function s(){let u=e.read();u?p(u):e.once("readable",s)}function i(){e.removeListener("end",a),e.removeListener("error",c),e.removeListener("readable",s)}function a(){i(),ir("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}function c(u){i(),ir("onerror %o",u),r(u)}function p(u){o.push(u),n+=u.length;let f=Buffer.concat(o,n),d=f.indexOf(`\r
15
+ Url: ${Kt(e)}`),!0}return!1}function mc(e,t){return t?.length?jt(e).some(r=>q(r,t)):!1}function gc(e,t){if(!t?.length)return!1;let r=e.transaction;return r?q(r,t):!1}function _c(e,t){if(!t?.length)return!1;let r=Kt(e);return r?q(r,t):!1}function Sc(e,t){if(!t?.length)return!0;let r=Kt(e);return r?q(r,t):!0}function hc(e=[]){for(let t=e.length-1;t>=0;t--){let r=e[t];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function Kt(e){try{let r=[...e.exception?.values??[]].reverse().find(n=>n.mechanism?.parent_id===void 0&&n.stacktrace?.frames?.length)?.stacktrace?.frames;return r?hc(r):null}catch{return g&&l.error(`Cannot extract url for event ${Q(e)}`),null}}function Ec(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function As(e,t,r,n,o,s){if(!o.exception?.values||!s||!Ie(s.originalException,Error))return;let i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=an(e,t,n,s.originalException,r,o.exception.values,i,0))}function an(e,t,r,n,o,s,i,a){if(s.length>=r+1)return s;let c=[...s];if(Ie(n[o],Error)){Ns(i,a,n);let p=e(t,n[o]),u=c.length;Rs(p,o,u,a),c=an(e,t,r,n[o],o,[p,...c],p,u)}return Cs(n)&&n.errors.forEach((p,u)=>{if(Ie(p,Error)){Ns(i,a,n);let f=e(t,p),d=c.length;Rs(f,`errors[${u}]`,d,a),c=an(e,t,r,p,o,[f,...c],f,d)}}),c}function Cs(e){return Array.isArray(e.errors)}function Ns(e,t,r){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Cs(r)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Rs(e,t,r,n){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:n}}function Os(e,t){return e(t.stack||"",1)}function Tc(e){return We(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Ic(e){return Tc(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function cn(e,t){let r={type:t.name||t.constructor.name,value:Ic(t)},n=Os(e,t);return n.length&&(r.stacktrace={frames:n}),r}function yc(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let r=e[t];if(r instanceof Error)return r}}function bc(e){if("name"in e&&typeof e.name=="string"){let n=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(n+=` with message '${e.message}'`),n}else if("message"in e&&typeof e.message=="string")return e.message;let t=mr(e);if(Fn(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let r=xc(e);return`${r&&r!=="Object"?`'${r}'`:"Object"} captured as exception with keys: ${t}`}function xc(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function vc(e,t,r,n){if(We(r))return[r,void 0];if(t.synthetic=!0,ue(r)){let s=e?.getOptions().normalizeDepth,i={__serialized__:hr(r,s)},a=yc(r);if(a)return[a,i];let c=bc(r),p=n?.syntheticException||new Error(c);return p.message=c,[p,i]}let o=n?.syntheticException||new Error(r);return o.message=`${r}`,[o,void 0]}function Ls(e,t,r,n){let s=n?.data&&n.data.mechanism||{handled:!0,type:"generic"},[i,a]=vc(e,s,r,n),c={exception:{values:[cn(t,i)]}};return a&&(c.extra=a),xr(c,void 0,void 0),Re(c,s),{...c,event_id:n?.event_id}}function Ms(e,t,r="info",n,o){let s={event_id:n?.event_id,level:r};if(o&&n?.syntheticException){let i=Os(e,n.syntheticException);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]},Re(s,{synthetic:!0}))}if(je(t)){let{__sentry_template_string__:i,__sentry_template_values__:a}=t;return s.logentry={message:i,params:a},s}return s.message=t,s}var Nc="cause",Rc=5,Ac="LinkedErrors",Cc=((e={})=>{let t=e.limit||Rc,r=e.key||Nc;return{name:Ac,preprocessEvent(n,o,s){let i=s.getOptions();As(cn,i.stackParser,r,t,n,o)}}}),mt=Cc;var pn=["X-Client-IP","X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP","Fastly-Client-Ip","True-Client-Ip","X-Real-IP","X-Cluster-Client-IP","X-Forwarded","Forwarded-For","Forwarded","X-Vercel-Forwarded-For"];function un(e){let t={};for(let s of Object.keys(e))t[s.toLowerCase()]=e[s];return pn.map(s=>{let i=t[s.toLowerCase()],a=Array.isArray(i)?i.join(";"):i;return s==="Forwarded"?Oc(a):a?.split(",").map(c=>c.trim())}).reduce((s,i)=>i?s.concat(i):s,[]).find(s=>s!==null&&Lc(s))||null}function Oc(e){if(!e)return null;for(let t of e.split(";"))if(t.startsWith("for="))return t.slice(4);return null}function Lc(e){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(e)}var Mc="RequestData",kc=((e={})=>{function t(r){let n=r.getDataCollectionOptions(),o={...n,...e.include?.cookies===!0&&n.cookies===!1&&{cookies:!0},...e.include?.headers===!0&&n.httpHeaders.request===!1&&{httpHeaders:{...n.httpHeaders,request:!0}}};return{dataCollection:o,include:{cookies:o.cookies!==!1,data:!0,headers:o.httpHeaders.request!==!1,ip:o.userInfo,query_string:o.queryParams!==!1,url:!0,...e.include}}}return{name:Mc,processEvent(r,n,o){let{sdkProcessingMetadata:s={}}=r,{normalizedRequest:i,ipAddress:a}=s,{include:c}=t(o);return i&&Pc(r,i,{ipAddress:a},c),r},processSegmentSpan(r,n){let{sdkProcessingMetadata:o={}}=L().getScopeData(),{normalizedRequest:s,ipAddress:i}=o;if(!s)return;let{include:a,dataCollection:c}=t(n);Dc(r,s,i,a,c)}}}),gt=kc;function Pc(e,t,r,n){if(e.request={...e.request,...ks(t,n)},n.ip){let o=t.headers&&un(t.headers)||r.ipAddress;o&&(e.user={...e.user,ip_address:o})}}function Dc(e,t,r,n,o){let s=ks(t,n),i={};if(s.url&&(i["url.full"]=s.url),s.method&&(i["http.request.method"]=s.method),s.query_string&&(i["url.query"]=Uc(s.query_string)),k(e,i),s.cookies&&Object.keys(s.cookies).length>0){let a=Object.entries(s.cookies).map(([p,u])=>`${p}=${u}`).join("; "),c=on({cookie:a},o,"request");k(e,c)}if(s.headers){let a=on(s.headers,o,"request");k(e,a)}if(s.data!=null){let a=typeof s.data=="string"?s.data:JSON.stringify(s.data);a&&k(e,{"http.request.body.data":a})}if(n.ip){let a=t.headers&&un(t.headers)||r||void 0;a&&k(e,{[Ot]:a})}}function ks(e,t){let r={},n={...e.headers};if(t.headers&&(r.headers=n,t.cookies||delete n.cookie,!t.ip)){let o=new Set(pn.map(s=>s.toLowerCase()));for(let s of Object.keys(n))o.has(s.toLowerCase())&&delete n[s]}if(r.method=e.method,t.url&&(r.url=e.url),t.cookies){let o=e.cookies||(n?.cookie?Is(n.cookie):void 0);r.cookies=o||{}}return t.query_string&&(r.query_string=e.query_string),t.data&&(r.data=e.data),r}function Uc(e){return typeof e=="string"?e||void 0:(Array.isArray(e)?e:Object.entries(e)).map(([n,o])=>`${n}=${o}`).join("&")||void 0}var Xt=new Set([]);function Ps(e){let t="console",r=lr(t,e);return Ye(t,Fc),r}function Ds(e){for(let t of e)Xt.add(t);return()=>{for(let t of e)Xt.delete(t)}}function Fc(){"console"in h&&pe.forEach(function(e){e in h.console&&$e(h.console,e,function(t){return w[e]=t,function(...r){let n=r[0],o=w[e],s=Xt.size&&typeof n=="string"&&q(n,Xt);s||Te("console",{args:r,level:e}),(!s||g&&l.isEnabled())&&o?.apply(h.console,r)}})})}function Us(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var wc=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Bc(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,r=wc.exec(t);return r?r.slice(1):[]}function fn(e){let t=Bc(e),r=t[0]||"",n=t[1];return!r&&!n?".":(n&&(n=n.slice(0,n.length-1)),r+n)}var Gc="Console",ln=(e={})=>{let t=new Set(e.levels||pe);return{name:Gc,setup(r){let n=Ps(({args:o,level:s})=>{T()!==r||!t.has(s)||Hc(s,o)});if(r.registerCleanup(n),e.filter){let o=Ds(e.filter);r.registerCleanup(o)}}}};function Hc(e,t){let r={category:"console",data:{arguments:t,logger:"console"},level:Us(e),message:Fs(t)};if(e==="assert")if(t[0]===!1){let n=t.slice(1);r.message=n.length>0?`Assertion failed: ${Fs(n)}`:"Assertion failed",r.data.arguments=n}else return;sn(r,{input:t,level:e})}function Fs(e){return"util"in h&&typeof h.util.format=="function"?h.util.format(...e):Ir(e," ")}function ws(e,t,r){let n=r.getOptions(),o=r.getDsn(),s=n.tunnel,i=ke(n._metadata),a={sent_at:new Date(C()).toISOString(),...Yc(t)&&{trace:t},...i&&{sdk:i},...!!s&&o&&{dsn:M(o)}},c=r.getDataCollectionOptions().userInfo?"auto":"never",p=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...se()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}];return v(a,[p])}function Yc(e){return!!e.trace_id&&!!e.public_key}function Bs(e){let t=156;if(t+=e.name.length*2,t+=Or(e.attributes),e.links&&e.links.length>0){let n=e.links[0]?.attributes,o=100+(n?Or(n):0);t+=o*e.links.length}return t}var Gs=1e3,Wc=5e6,qt=class{constructor(t,r){this._traceBuckets=new Map,this._client=t;let{maxSpanLimit:n,flushInterval:o,maxTraceWeightInBytes:s}=r??{};this._maxSpanLimit=n&&n>0&&n<=Gs?n:Gs,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=s&&s>0?s:Wc,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(i=>{clearTimeout(i.timeout)}),this._traceBuckets.clear()})}add(t){let r=t.trace_id,n=this._traceBuckets.get(r);n||(n={spans:new Set,size:0,timeout:Fe(setTimeout(()=>{this.flush(r)},this._flushInterval))},this._traceBuckets.set(r,n)),n.spans.add(t),n.size+=Bs(t),(n.spans.size>=this._maxSpanLimit||n.size>=this._maxTraceWeight)&&this.flush(r)}drain(){this._traceBuckets.size&&(g&&l.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((t,r)=>{this.flush(r)}))}flush(t){let r=this._traceBuckets.get(t);if(!r)return;if(!r.spans.size){this._removeTrace(t);return}let n=Array.from(r.spans),o=n[0]?._segmentSpan;if(!o){g&&l.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}let s=Le(o),i=n.map(c=>{let{_segmentSpan:p,...u}=c;return u}),a=ws(i,s,this._client);g&&l.log(`Sending span envelope for trace ${t} with ${i.length} spans`),this._client.sendEnvelope(a).then(null,c=>{g&&l.error("Error while sending streamed span envelope:",c)}),this._removeTrace(t)}_removeTrace(t){let r=this._traceBuckets.get(t);r&&clearTimeout(r.timeout),this._traceBuckets.delete(t)}};var Qt=()=>({name:"SpanStreaming",setup(e){let t="SpanStreaming integration requires",r="Falling back to static trace lifecycle.",n=e.getOptions();if(!wt(e)){n.traceLifecycle="static",g&&l.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${r}`);return}let o=n.beforeSendSpan;if(o&&!Me(o)){n.traceLifecycle="static",g&&l.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${r}`);return}let s=new qt(e);e.on("afterSpanEnd",i=>{Dt(i)&&s.add($r(i,e))})}});var ie=class{constructor(t){this._maxSize=t,this._cache=new Map}get size(){return this._cache.size}get(t){let r=this._cache.get(t);if(r!==void 0)return this._cache.delete(t),this._cache.set(t,r),r}set(t,r){if(this._cache.size>=this._maxSize){let n=this._cache.keys().next().value;this._cache.delete(n)}this._cache.set(t,r)}remove(t){let r=this._cache.get(t);return r&&this._cache.delete(t),r}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let t=[];return this._cache.forEach(r=>t.push(r)),t}};function Hs(e){let t=e._metadata?.sdk,r=t?.name&&t?.version?`${t?.name}/${t?.version}`:void 0;e.transportOptions={...e.transportOptions,headers:{...r&&{"user-agent":r},...e.transportOptions?.headers}}}var _t=class extends Zt{constructor(t){Hs(t),super(t),this._disposeCallbacks=[],this._setUpMetricsProcessing()}eventFromException(t,r){let n=Ls(this,this._options.stackParser,t,r);return n.level="error",z(n)}eventFromMessage(t,r="info",n){return z(Ms(this._options.stackParser,t,r,n,this._options.attachStacktrace))}captureException(t,r,n){return Ys(r),super.captureException(t,r,n)}captureEvent(t,r,n){return!t.type&&t.exception?.values&&t.exception.values.length>0&&Ys(r),super.captureEvent(t,r,n)}captureCheckIn(t,r,n){let o="checkInId"in t&&t.checkInId?t.checkInId:y();if(!this._isEnabled())return g&&l.warn("SDK not enabled, will not capture check-in."),o;let s=this.getOptions(),{release:i,environment:a,tunnel:c}=s,p={check_in_id:o,monitor_slug:t.monitorSlug,status:t.status,release:i,environment:a};"duration"in t&&(p.duration=t.duration),r&&(p.monitor_config={schedule:r.schedule,checkin_margin:r.checkinMargin,max_runtime:r.maxRuntime,timezone:r.timezone,failure_issue_threshold:r.failureIssueThreshold,recovery_threshold:r.recoveryThreshold});let[u,f]=zo(this,n);f&&(p.contexts={trace:f});let d=ys(p,u,this.getSdkMetadata(),c,this.getDsn());return g&&l.log("Sending checkin:",t.monitorSlug,t.status),this.sendEnvelope(d),o}registerCleanup(t){this._disposeCallbacks.push(t)}dispose(){g&&l.log("Disposing client...");for(let t of this._disposeCallbacks)try{t()}catch{}this._disposeCallbacks.length=0;for(let t of Object.keys(this._hooks))this._hooks[t]?.clear();this._hooks={},this._eventProcessors.length=0,this._integrations={},this._outcomes={},this._transport=void 0,this._promiseBuffer=we(pt)}_prepareEvent(t,r,n,o){return this._options.platform&&(t.platform=t.platform||this._options.platform),this._options.runtime&&(t.contexts={...t.contexts,runtime:t.contexts?.runtime||this._options.runtime}),this._options.serverName&&(t.server_name=t.server_name||this._options.serverName),super._prepareEvent(t,r,n,o)}_setUpMetricsProcessing(){this.on("processMetric",t=>{this._options.serverName&&(t.attributes={"server.address":this._options.serverName,...t.attributes})})}};function Ys(e){let t=L().getScopeData().sdkProcessingMetadata.requestSession;if(t){let r=e?.mechanism?.handled??!0;r&&t.status!=="crashed"?t.status="errored":r||(t.status="crashed")}}function js(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes("node_modules/")}function $s(e){let t=/^\s*[-]{4,}$/,r=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,n=/at (?:async )?(.+?) \(data:(.*?),/;return o=>{let s=o.match(n);if(s)return{filename:`<data:${s[2]}>`,function:s[1]};let i=o.match(r);if(i){let a,c,p,u,f;if(i[1]){p=i[1];let S=p.lastIndexOf(".");if(p[S-1]==="."&&S--,S>0){a=p.slice(0,S),c=p.slice(S+1);let E=a.indexOf(".Module");E>0&&(p=p.slice(E+1),a=a.slice(0,E))}u=void 0}c&&(u=a,f=c),c==="<anonymous>"&&(f=void 0,p=void 0),p===void 0&&(f=f||"?",p=u?`${u}.${f}`:f);let d=Pn(i[2]),m=i[5]==="native";!d&&i[5]&&!m&&(d=i[5]);let _=d?Vc(d):void 0;return{filename:_??d,module:_&&e?.(_),function:p,lineno:Ws(i[3]),colno:Ws(i[4]),in_app:js(d||"",m)}}if(o.match(t))return{filename:o}}}function dn(e){return[90,$s(e)]}function Ws(e){return parseInt(e||"",10)||void 0}function Vc(e){try{return decodeURI(e)}catch{return}}import{threadId as gp,isMainThread as _p}from"worker_threads";var N=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Sp=6e4,er=class extends _t{constructor(t){let r=t.includeServerName===!1?void 0:t.serverName||global.process.env.SENTRY_NAME||zs.hostname(),n={...t,platform:"node",runtime:{name:"node",version:global.process.version},serverName:r};lt(n,"node-light",["node-core"]),l.log(`Initializing Sentry: process: ${process.pid}, thread: ${_p?"main":`worker-${gp}`}.`),super(n),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{Ue(this)},r&&this.on("beforeCaptureLog",o=>{o.attributes={...o.attributes,"server.address":r}}),process.on("beforeExit",this._logOnExitFlushListener))}async flush(t){return this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(t)}async close(t){return this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off("beforeExit",this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off("beforeExit",this._logOnExitFlushListener),super.close(t)}startClientReportTracking(){let t=this.getOptions();t.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{N&&l.log("Flushing client reports based on interval."),this._flushOutcomes()},t.clientReportFlushInterval??Sp).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}};import{execFile as hp}from"node:child_process";import{readFile as Ep,readdir as Tp}from"node:fs";import*as I from"node:os";import{join as Ip}from"node:path";import{promisify as Ks}from"node:util";var yp=Ks(Ep),bp=Ks(Tp),xp="Context",vp=((e={})=>{let t={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...e},r=t.app?Op():void 0,n=t.device?Lp(t.device):void 0,o=t.culture?Cp():void 0,s=t.cloudResource?Fp():void 0,i=t.os?Ap():void 0,a={"process.runtime.engine.name":"v8","process.runtime.engine.version":process.versions.v8,...Zs({app:r,device:n,culture:o,cloud_resource:s})};i&&i.then(u=>Object.assign(a,Zs({os:u}))).catch(()=>{});let c=(async()=>{let u={};return i&&(u.os=await i),r&&(u.app=r),n&&(u.device=n),o&&(u.culture=o),s&&(u.cloud_resource=s),u})();async function p(u){let f=Np(await c);return u.contexts={...u.contexts,app:{...f.app,...u.contexts?.app},os:{...f.os,...u.contexts?.os},device:{...f.device,...u.contexts?.device},culture:{...f.culture,...u.contexts?.culture},cloud_resource:{...f.cloud_resource,...u.contexts?.cloud_resource}},u}return{name:xp,processEvent(u){return p(u)},processSegmentSpan(u){k(u,a),k(u,Rp(r,n))}}}),mn=vp;function Np(e){if(e.app?.app_memory&&(e.app.app_memory=process.memoryUsage().rss),e.app?.free_memory&&typeof process.availableMemory=="function"){let t=process.availableMemory?.();t!=null&&(e.app.free_memory=t)}return e.device?.free_memory&&(e.device.free_memory=I.freemem()),e}function Zs(e){let t={},{app:r,device:n,os:o,culture:s,cloud_resource:i}=e;if(r&&r.app_start_time&&(t["app.start_time"]=r.app_start_time),n&&(n.arch&&(t["device.archs"]=[n.arch]),n.boot_time&&(t["device.boot_time"]=n.boot_time),n.memory_size!=null&&(t["device.memory_size"]=n.memory_size),n.processor_count!=null&&(t["device.processor_count"]=n.processor_count),n.cpu_description&&(t["device.cpu_description"]=n.cpu_description),n.processor_frequency!=null&&(t["device.processor_frequency"]=n.processor_frequency)),o&&(o.name&&(t["os.name"]=o.name),o.version&&(t["os.version"]=o.version),o.kernel_version&&(t["os.kernel_version"]=o.kernel_version),o.build&&(t["os.build"]=o.build)),s&&(s.locale&&(t["culture.locale"]=s.locale),s.timezone&&(t["culture.timezone"]=s.timezone)),i)for(let[a,c]of Object.entries(i))c!=null&&(t[a]=c);return t}function Rp(e,t){let r={};if(e&&(r["app.memory"]=process.memoryUsage().rss,typeof process.availableMemory=="function")){let n=process.availableMemory?.();n!=null&&(r["app.free_memory"]=n)}return t?.free_memory!=null&&(r["device.free_memory"]=I.freemem()),r}async function Ap(){let e=I.platform();switch(e){case"darwin":return Dp();case"linux":return Up();default:return{name:Mp[e]||e,version:I.release()}}}function Cp(){try{if(typeof process.versions.icu!="string")return;let e=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(e)==="enero"){let r=Intl.DateTimeFormat().resolvedOptions();return{locale:r.locale,timezone:r.timeZone}}}catch{}}function Op(){let e=process.memoryUsage().rss,r={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:e};if(typeof process.availableMemory=="function"){let n=process.availableMemory?.();n!=null&&(r.free_memory=n)}return r}function Lp(e){let t={},r;try{r=I.uptime()}catch{}if(typeof r=="number"&&(t.boot_time=new Date(Date.now()-r*1e3).toISOString()),t.arch=I.arch(),(e===!0||e.memory)&&(t.memory_size=I.totalmem(),t.free_memory=I.freemem()),e===!0||e.cpu){let n=I.cpus(),o=n?.[0];o&&(t.processor_count=n.length,t.cpu_description=o.model,t.processor_frequency=o.speed)}return t}var Mp={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows",ohos:"OpenHarmony",android:"Android"},kp=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],Pp={alpine:e=>e,arch:e=>Y(/distrib_release=(.*)/,e),centos:e=>Y(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>Y(/release (..)/,e),mint:e=>Y(/distrib_release=(.*)/,e),red:e=>Y(/release ([^ ]+)/,e),suse:e=>Y(/VERSION = (.*)\n/,e),ubuntu:e=>Y(/distrib_release=(.*)/,e)};function Y(e,t){let r=e.exec(t);return r?r[1]:void 0}async function Dp(){let e={kernel_version:I.release(),name:"Mac OS X",version:`10.${Number(I.release().split(".")[0])-4}`};try{let t=await new Promise((r,n)=>{hp("/usr/bin/sw_vers",(o,s)=>{if(o){n(o);return}r(s)})});e.name=Y(/^ProductName:\s+(.*)$/m,t),e.version=Y(/^ProductVersion:\s+(.*)$/m,t),e.build=Y(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function Js(e){return e.split(" ")[0].toLowerCase()}async function Up(){let e={kernel_version:I.release(),name:"Linux"};try{let t=await bp("/etc"),r=kp.find(a=>t.includes(a.name));if(!r)return e;let n=Ip("/etc",r.name),o=(await yp(n,{encoding:"utf-8"})).toLowerCase(),{distros:s}=r;e.name=s.find(a=>o.indexOf(Js(a))>=0)||s[0];let i=Js(e.name);e.version=Pp[i]?.(o)}catch{}return e}function Fp(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}import{createReadStream as wp}from"node:fs";import{createInterface as Bp}from"node:readline";var gn=new ie(10),Qs=new ie(20),Gp=7,Hp="ContextLines",Yp=1e3,Wp=1e4;function Vp(e,t,r){let n=e.get(t);return n===void 0?(e.set(t,r),r):n}function jp(e){return!!(e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:"))}function $p(e){return e.lineno!==void 0&&e.lineno>Wp||e.colno!==void 0&&e.colno>Yp}function zp(e,t){let r=gn.get(e);if(r===void 0)return!1;for(let n=t[0];n<=t[1];n++)if(r[n]===void 0)return!1;return!0}function Zp(e,t){if(!e.length)return[];let r=0,n=e[0];if(typeof n!="number")return[];let o=qs(n,t),s=[];for(;;){if(r===e.length-1){s.push(o);break}let i=e[r+1];if(typeof i!="number")break;i<=o[1]?o[1]=i+t:(s.push(o),o=qs(i,t)),r++}return s}function Jp(e,t,r){return new Promise((n,o)=>{let s=wp(e),i=Bp({input:s});function a(){s.destroy(),n()}let c=0,p=0,u=t[p];if(u===void 0){a();return}let f=u[0],d=u[1];function m(_){Qs.set(e,1),N&&l.error(`Failed to read file: ${e}. Error: ${_}`),i.close(),i.removeAllListeners(),a()}s.on("error",m),i.on("error",m),i.on("close",a),i.on("line",_=>{if(c++,!(c<f)&&(r[c]=Tr(_,0),c>=d)){if(p===t.length-1){i.close(),i.removeAllListeners();return}p++;let S=t[p];if(S===void 0){i.close(),i.removeAllListeners();return}f=S[0],d=S[1]}})})}async function Kp(e,t){let r={};if(t>0&&e.exception?.values){for(let s of e.exception.values)if(s.stacktrace?.frames?.length)for(let i=s.stacktrace.frames.length-1;i>=0;i--){let a=s.stacktrace.frames[i],c=a?.filename;if(!a||typeof c!="string"||typeof a.lineno!="number"||jp(c)||$p(a))continue;r[c]||(r[c]=[]),r[c].push(a.lineno)}}let n=Object.keys(r);if(n.length==0)return e;let o=[];for(let s of n){if(Qs.get(s))continue;let i=r[s];if(!i)continue;i.sort((p,u)=>p-u);let a=Zp(i,t);if(a.every(p=>zp(s,p)))continue;let c=Vp(gn,s,{});o.push(Jp(s,a,c))}if(await Promise.all(o).catch(()=>{N&&l.log("Failed to read one or more source files and resolve context lines")}),t>0&&e.exception?.values)for(let s of e.exception.values)s.stacktrace?.frames&&s.stacktrace.frames.length>0&&Xp(s.stacktrace.frames,t,gn);return e}function Xp(e,t,r){for(let n of e)if(n.filename&&n.context_line===void 0&&typeof n.lineno=="number"){let o=r.get(n.filename);if(o===void 0)continue;qp(n.lineno,n,t,o)}}function Xs(e){delete e.pre_context,delete e.context_line,delete e.post_context}function qp(e,t,r,n){if(t.lineno===void 0||n===void 0){N&&l.error("Cannot resolve context for frame with no lineno or file contents");return}t.pre_context=[];for(let s=ei(e,r);s<e;s++){let i=n[s];if(i===void 0){Xs(t),N&&l.error(`Could not find line ${s} in file ${t.filename}`);return}t.pre_context.push(i)}if(n[e]===void 0){Xs(t),N&&l.error(`Could not find line ${e} in file ${t.filename}`);return}t.context_line=n[e];let o=ti(e,r);t.post_context=[];for(let s=e+1;s<=o;s++){let i=n[s];if(i===void 0)break;t.post_context.push(i)}}function ei(e,t){return Math.max(1,e-t)}function ti(e,t){return e+t}function qs(e,t){return[ei(e,t),ti(e,t)]}var Qp=((e={})=>({name:Hp,processEvent(t,r,n){let o=e.frameContextLines??n?.getDataCollectionOptions().frameContextLines??Gp;return Kp(t,o)}})),_n=Qp;var tr=vr(process.versions.node),ri=tr.major,Kh=tr.minor;import{Worker as eu}from"node:worker_threads";var rr;async function nr(){if(rr===void 0)try{rr=!!(await import("node:inspector")).url()}catch{rr=!1}return rr}var St="__SENTRY_ERROR_LOCAL_VARIABLES__";function oi(e,t,r){let n=0,o=5,s=0;return setInterval(()=>{s===0?n>e&&(o*=2,r(o),o>86400&&(o=86400),s=o):(s-=1,s===0&&t()),n=0},1e3).unref(),()=>{n+=1}}function ni(e){return e!==void 0&&(e.length===0||e==="?"||e==="<anonymous>")}function or(e,t){return e===t||`Object.${e}`===t||e===`Object.${t}`||ni(e)&&ni(t)}var tu="LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjYyLjAgKDFmYzUzOWUpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=";function si(...e){l.log("[LocalVariables]",...e)}var ii=((e={})=>{function t(s,i){let a=(s.stacktrace?.frames||[]).filter(c=>c.function!=="new Promise");for(let c=0;c<a.length;c++){let p=a.length-c-1,u=i[c],f=a[p];if(!f||!u)break;u.vars===void 0||f.in_app===!1&&e.includeOutOfAppFrames!==!0||!or(f.function,u.function)||(f.vars=u.vars)}}function r(s,i){if(i.originalException&&typeof i.originalException=="object"&&St in i.originalException&&Array.isArray(i.originalException[St])){for(let a of s.exception?.values||[])t(a,i.originalException[St]);i.originalException[St]=void 0}return s}async function n(){let s=await import("node:inspector");s.url()||s.open(0)}function o(s){let i=new eu(new URL(`data:application/javascript;base64,${tu}`),{workerData:s,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{i.terminate()}),i.once("error",a=>{si("Worker error",a)}),i.once("exit",a=>{si("Worker exit",a)}),i.unref()}return{name:"LocalVariablesAsync",async setup(s){if(!s.getOptions().includeLocalVariables)return;if(await nr()){l.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...e,debug:l.isEnabled()};n().then(()=>{try{o(a)}catch(c){l.error("Failed to start worker",c)}},c=>{l.error("Failed to start inspector",c)})},processEvent(s,i){return r(s,i)}}});function ai(e){if(e!==void 0)return e.slice(-10).reduce((t,r)=>`${t},${r.function},${r.lineno},${r.colno}`,"")}function ru(e,t){if(t!==void 0)return ai(e(t,1))}function ci(e){let t=[],r=!1;function n(i){t=[],!r&&(r=!0,e(i))}t.push(n);function o(i){t.push(i)}function s(i){let a=t.pop()||n;try{a(i)}catch{n(i)}}return{add:o,next:s}}var Sn=class e{constructor(t){this._session=t}static async create(t){if(t)return t;let r=await import("node:inspector");return new e(new r.Session)}configureAndConnect(t,r){this._session.connect(),this._session.on("Debugger.paused",n=>{t(n,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:r?"all":"uncaught"})}setPauseOnExceptions(t){this._session.post("Debugger.setPauseOnExceptions",{state:t?"all":"uncaught"})}getLocalVariables(t,r){this._getProperties(t,n=>{let{add:o,next:s}=ci(r);for(let i of n)if(i.value?.objectId&&i.value.className==="Array"){let a=i.value.objectId;o(c=>this._unrollArray(a,i.name,c,s))}else if(i.value?.objectId&&i.value.className==="Object"){let a=i.value.objectId;o(c=>this._unrollObject(a,i.name,c,s))}else i.value&&o(a=>this._unrollOther(i,a,s));s({})})}_getProperties(t,r){this._session.post("Runtime.getProperties",{objectId:t,ownProperties:!0},(n,o)=>{r(n?[]:o.result)})}_unrollArray(t,r,n,o){this._getProperties(t,s=>{n[r]=s.filter(i=>i.name!=="length"&&!isNaN(parseInt(i.name,10))).sort((i,a)=>parseInt(i.name,10)-parseInt(a.name,10)).map(i=>i.value?.value),o(n)})}_unrollObject(t,r,n,o){this._getProperties(t,s=>{n[r]=s.map(i=>[i.name,i.value?.value]).reduce((i,[a,c])=>(i[a]=c,i),{}),o(n)})}_unrollOther(t,r,n){t.value&&("value"in t.value?t.value.value===void 0||t.value.value===null?r[t.name]=`<${t.value.value}>`:r[t.name]=t.value.value:"description"in t.value&&t.value.type!=="function"?r[t.name]=`<${t.value.description}>`:t.value.type==="undefined"&&(r[t.name]="<undefined>")),n(r)}},nu="LocalVariables",ou=((e={},t)=>{let r=new ie(20),n,o=!1;function s(p){let u=ai(p.stacktrace?.frames);if(u===void 0)return;let f=r.remove(u);if(f===void 0)return;let d=(p.stacktrace?.frames||[]).filter(m=>m.function!=="new Promise");for(let m=0;m<d.length;m++){let _=d.length-m-1,S=f[m],E=d[_];if(!E||!S)break;S.vars===void 0||E.in_app===!1&&e.includeOutOfAppFrames!==!0||!or(E.function,S.function)||(E.vars=S.vars)}}function i(p){for(let u of p.exception?.values||[])s(u);return p}let a;async function c(){let u=T()?.getOptions();if(!u?.includeLocalVariables)return;if(ri<18){l.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await nr()){l.warn("Local variables capture has been disabled because the debugger was already enabled");return}try{let d=await Sn.create(t),m=(S,{params:{reason:E,data:x,callFrames:R}},V)=>{if(E!=="exception"&&E!=="promiseRejection"){V();return}n?.();let Se=ru(S,x.description);if(Se==null){V();return}let{add:he,next:ce}=ci(P=>{r.set(Se,P),V()});for(let P=0;P<Math.min(R.length,5);P++){let{scopeChain:bi,functionName:Nn,this:ar}=R[P],Rn=bi.find(Ee=>Ee.type==="local"),An=ar.className==="global"||!ar.className?Nn:`${ar.className}.${Nn}`;if(Rn?.object.objectId===void 0)he(Ee=>{Ee[P]={function:An},ce(Ee)});else{let Ee=Rn.object.objectId;he(Cn=>d.getLocalVariables(Ee,xi=>{Cn[P]={function:An,vars:xi},ce(Cn)}))}}ce([])},_=e.captureAllExceptions!==!1;if(d.configureAndConnect((S,E)=>m(u.stackParser,S,E),_),_){let S=e.maxExceptionsPerSecond||50;n=oi(S,()=>{l.log("Local variables rate-limit lifted."),d.setPauseOnExceptions(!0)},E=>{l.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${E} seconds.`),d.setPauseOnExceptions(!1)})}o=!0}catch(d){l.log("The `LocalVariables` integration failed to start.",d)}}return{name:nu,setupOnce(){a=c()},async processEvent(p){return await a,o?i(p):p},_getCachedFramesCount(){return r.size},_getFirstCachedFrame(){return r.values()[0]}}}),pi=ou;var hn=(e={})=>tr.major<19?pi(e):ii(e);import{isMainThread as iu}from"worker_threads";var su=2e3;function ht(e){b(()=>{console.error(e)});let t=T();if(t===void 0){N&&l.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let r=t.getOptions(),n=r?.shutdownTimeout&&r.shutdownTimeout>0?r.shutdownTimeout:su;t.close(n).then(o=>{o||N&&l.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},o=>{N&&l.error(o)})}var au="OnUncaughtException",En=(e={})=>{let t={exitEvenIfOtherHandlersAreRegistered:!1,...e};return{name:au,setup(r){iu&&global.process.on("uncaughtException",cu(r,t))}}};function cu(e,t){let n=!1,o=!1,s=!1,i,a=e.getOptions();return Object.assign(c=>{let p=ht;t.onFatalError?p=t.onFatalError:a.onFatalError&&(p=a.onFatalError);let f=global.process.listeners("uncaughtException").filter(m=>m.name!=="domainUncaughtExceptionClear"&&m._errorHandler!==!0).length===0,d=t.exitEvenIfOtherHandlersAreRegistered||f;n?d&&(s?(N&&l.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),ht(c)):o||(o=!0,setTimeout(()=>{s||(s=!0,p(i,c))},2e3))):(i=c,n=!0,T()===e&&oe(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"auto.node.onuncaughtexception"}}),!s&&d&&(s=!0,p(c)))},{_errorHandler:!0})}var pu="OnUnhandledRejection",uu=[{name:"AI_NoOutputGeneratedError"},{name:"AbortError"}],fu=((e={})=>{let t={mode:e.mode??"warn",ignore:[...uu,...e.ignore??[]]};return{name:pu,setup(r){global.process.on("unhandledRejection",gu(r,t))}}}),Tn=fu;function lu(e){if(typeof e!="object"||e===null)return{name:"",message:String(e??"")};let t=e,r=typeof t.name=="string"?t.name:"",n=typeof t.message=="string"?t.message:String(e);return{name:r,message:n}}function du(e,t){let r=e.name===void 0||H(t.name,e.name,!0),n=e.message===void 0||H(t.message,e.message);return r&&n}function mu(e,t){let r=lu(t);return e.some(n=>du(n,r))}function gu(e,t){return function(n,o){if(T()!==e||mu(t.ignore??[],n))return;let s=t.mode==="strict"?"fatal":"error",i=n&&typeof n=="object"?n._sentry_active_span:void 0;(i?c=>Bt(i,c):c=>c())(()=>{oe(n,{originalException:n,captureContext:{extra:{unhandledPromiseRejection:!0},level:s},mechanism:{handled:!1,type:"auto.node.onunhandledrejection"}})}),_u(n,t.mode)}}function _u(e,t){let r="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";t==="warn"?b(()=>{console.warn(r),console.error(e&&typeof e=="object"&&"stack"in e?e.stack:e)}):t==="strict"&&(b(()=>{console.warn(r)}),ht(e))}import*as ui from"node:http";var In="Spotlight",Su=((e={})=>{let t={sidecarUrl:e.sidecarUrl||"http://localhost:8969/stream"};return{name:In,setup(r){try{process.env.NODE_ENV&&process.env.NODE_ENV!=="development"&&l.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?")}catch{}hu(r,t)}}}),fi=Su;function hu(e,t){let r=Eu(t.sidecarUrl);if(!r)return;let n=0;e.on("beforeEnvelope",o=>{if(n>3){l.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let s=st(o);Pe(()=>{let i=ui.request({method:"POST",path:r.pathname,hostname:r.hostname,port:r.port,headers:{"Content-Type":"application/x-sentry-envelope"}},a=>{a.statusCode&&a.statusCode>=200&&a.statusCode<400&&(n=0),a.on("data",()=>{}),a.on("end",()=>{}),a.setEncoding("utf8")});i.on("error",()=>{n++,l.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),i.write(s),i.end()})})}function Eu(e){try{return new URL(`${e}`)}catch{l.warn(`[Spotlight] Invalid sidecar URL: ${e}`);return}}var yn=(e={})=>({name:"Console",setup(t){process.env.LAMBDA_TASK_ROOT&&Ye("console",Tu),ln({...e,filter:[...e.filter||[],"[DEP0205] DeprecationWarning"]}).setup?.(t)}});function Tu(){let e=h?.console;e&&pe.forEach(t=>{t in e&&Iu(e,t)})}function Iu(e,t){let r=e[t];w[t]=r;let n=r,o,s=!1,i=function(...c){if(s){r.apply(e,c);return}s=!0;try{Te("console",{args:c,level:t}),n.apply(e,c)}finally{s=!1}};xt(i,r);let a=r.bind(e);w[t]=a;try{let c=i;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return c},set(p){p===i?(o!==void 0&&(n=o,o=void 0),c=i):p===a?(o=n,c=a):typeof p=="function"&&!p.__sentry_original__?(n=p,c=i):c=p}})}catch{$e(e,t,function(c){return w[t]=c,function(...p){Te("console",{args:p,level:t}),w[t]?.apply(this,p)}})}}import{posix as yu,sep as bu}from"node:path";function li(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function di(e=process.argv[1]?fn(process.argv[1]):process.cwd(),t=bu==="\\"){let r=t?li(e):e;return n=>{if(!n)return;let o=t?li(n):n,{dir:s,base:i,ext:a}=yu.parse(o);(a===".js"||a===".mjs"||a===".cjs")&&(i=i.slice(0,a.length*-1));let c=decodeURIComponent(i);s||(s=".");let p=s.lastIndexOf("/node_modules");if(p>-1)return`${s.slice(p+14).replace(/\//g,".")}:${c}`;if(s.startsWith(r)){let u=s.slice(r.length+1).replace(/\//g,".");return u?`${u}:${c}`:c}return c}}function mi(e){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(h.SENTRY_RELEASE?.id)return h.SENTRY_RELEASE.id;let t=process.env.GITHUB_SHA||process.env.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA||process.env.CI_BUILD_REF||process.env.CI_COMMIT_SHA||process.env.BITBUCKET_COMMIT,r=process.env.APPVEYOR_PULL_REQUEST_HEAD_COMMIT||process.env.APPVEYOR_REPO_COMMIT||process.env.CODEBUILD_RESOLVED_SOURCE_VERSION||process.env.AWS_COMMIT_ID||process.env.BUILD_SOURCEVERSION||process.env.GIT_CLONE_COMMIT_HASH||process.env.BUDDY_EXECUTION_REVISION||process.env.BUILDKITE_COMMIT||process.env.CIRCLE_SHA1||process.env.CIRRUS_CHANGE_IN_REPO||process.env.CF_REVISION||process.env.CM_COMMIT||process.env.CF_PAGES_COMMIT_SHA||process.env.DRONE_COMMIT_SHA||process.env.FC_GIT_COMMIT_SHA||process.env.HEROKU_TEST_RUN_COMMIT_VERSION||process.env.HEROKU_BUILD_COMMIT||process.env.HEROKU_SLUG_COMMIT||process.env.RAILWAY_GIT_COMMIT_SHA||process.env.RENDER_GIT_COMMIT||process.env.SEMAPHORE_GIT_SHA||process.env.TRAVIS_PULL_REQUEST_SHA||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA,n=process.env.CI_COMMIT_ID||process.env.SOURCE_COMMIT||process.env.SOURCE_VERSION||process.env.GIT_COMMIT||process.env.COMMIT_REF||process.env.BUILD_VCS_NUMBER||process.env.CI_COMMIT_SHA;return t||r||n||e}var gi=yt(dn(di()));import*as vu from"node:http";import*as Nu from"node:https";import{Readable as Ru}from"node:stream";import{createGzip as Au}from"node:zlib";import*as Z from"node:net";import*as xn from"node:tls";import*as bn from"node:http";var _i,W=Symbol("AgentBaseInternalState"),sr=class extends(_i=bn.Agent,_i){constructor(t){super(t),this[W]={}}isSecureEndpoint(t){if(t){if(typeof t.secureEndpoint=="boolean")return t.secureEndpoint;if(typeof t.protocol=="string")return t.protocol==="https:"}let{stack:r}=new Error;return typeof r!="string"?!1:r.split(`
16
+ `).some(n=>n.indexOf("(https.js:")!==-1||n.indexOf("node:https:")!==-1)}createSocket(t,r,n){let o={...r,secureEndpoint:this.isSecureEndpoint(r)};Promise.resolve().then(()=>this.connect(t,o)).then(s=>{if(s instanceof bn.Agent)return s.addRequest(t,o);this[W].currentSocket=s,super.createSocket(t,r,n)},n)}createConnection(){let t=this[W].currentSocket;if(this[W].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[W].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(t){this[W]&&(this[W].defaultPort=t)}get protocol(){return this[W].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[W]&&(this[W].protocol=t)}};function ir(...e){l.log("[https-proxy-agent:parse-proxy-response]",...e)}function Si(e){return new Promise((t,r)=>{let n=0,o=[];function s(){let u=e.read();u?p(u):e.once("readable",s)}function i(){e.removeListener("end",a),e.removeListener("error",c),e.removeListener("readable",s)}function a(){i(),ir("onend"),r(new Error("Proxy connection ended before receiving CONNECT response"))}function c(u){i(),ir("onerror %o",u),r(u)}function p(u){o.push(u),n+=u.length;let f=Buffer.concat(o,n),d=f.indexOf(`\r
17
17
  \r
18
18
  `);if(d===-1){ir("have not received end of HTTP headers yet..."),s();return}let m=f.subarray(0,d).toString("ascii").split(`\r
19
- `),_=m.shift();if(!_)return e.destroy(),r(new Error("No header received from proxy CONNECT response"));let S=_.split(" "),E=+(S[1]||0),x=S.slice(2).join(" "),R={};for(let V of m){if(!V)continue;let _e=V.indexOf(":");if(_e===-1)return e.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${V}"`));let Se=V.slice(0,_e).toLowerCase(),ce=V.slice(_e+1).trimStart(),P=R[Se];typeof P=="string"?R[Se]=[P,ce]:Array.isArray(P)?P.push(ce):R[Se]=ce}ir("got proxy server response: %o %o",_,R),i(),t({connect:{statusCode:E,statusText:x,headers:R},buffered:f})}e.on("error",c),e.on("end",a),s()})}function Et(...e){l.log("[https-proxy-agent]",...e)}var Tt=class extends sr{constructor(t,r){super(r),this.options={},this.proxy=typeof t=="string"?new URL(t):t,this.proxyHeaders=r?.headers??{},Et("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?hi(r,"headers"):null,host:n,port:o}}async connect(t,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let o;if(n.protocol==="https:"){Et("Creating `tls.Socket`: %o",this.connectOpts);let d=this.connectOpts.servername||this.connectOpts.host;o=bn.connect({...this.connectOpts,servername:d&&Z.isIP(d)?void 0:d})}else Et("Creating `net.Socket`: %o",this.connectOpts),o=Z.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},i=Z.isIPv6(r.host)?`[${r.host}]`:r.host,a=`CONNECT ${i}:${r.port} HTTP/1.1\r
19
+ `),_=m.shift();if(!_)return e.destroy(),r(new Error("No header received from proxy CONNECT response"));let S=_.split(" "),E=+(S[1]||0),x=S.slice(2).join(" "),R={};for(let V of m){if(!V)continue;let Se=V.indexOf(":");if(Se===-1)return e.destroy(),r(new Error(`Invalid header from proxy CONNECT response: "${V}"`));let he=V.slice(0,Se).toLowerCase(),ce=V.slice(Se+1).trimStart(),P=R[he];typeof P=="string"?R[he]=[P,ce]:Array.isArray(P)?P.push(ce):R[he]=ce}ir("got proxy server response: %o %o",_,R),i(),t({connect:{statusCode:E,statusText:x,headers:R},buffered:f})}e.on("error",c),e.on("end",a),s()})}function Et(...e){l.log("[https-proxy-agent]",...e)}var Tt=class extends sr{constructor(t,r){super(r),this.options={},this.proxy=typeof t=="string"?new URL(t):t,this.proxyHeaders=r?.headers??{},Et("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let n=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...r?hi(r,"headers"):null,host:n,port:o}}async connect(t,r){let{proxy:n}=this;if(!r.host)throw new TypeError('No "host" provided');let o;if(n.protocol==="https:"){Et("Creating `tls.Socket`: %o",this.connectOpts);let d=this.connectOpts.servername||this.connectOpts.host;o=xn.connect({...this.connectOpts,servername:d&&Z.isIP(d)?void 0:d})}else Et("Creating `net.Socket`: %o",this.connectOpts),o=Z.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},i=Z.isIPv6(r.host)?`[${r.host}]`:r.host,a=`CONNECT ${i}:${r.port} HTTP/1.1\r
20
20
  `;if(n.username||n.password){let d=`${decodeURIComponent(n.username)}:${decodeURIComponent(n.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}s.Host=`${i}:${r.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(s))a+=`${d}: ${s[d]}\r
21
21
  `;let c=Si(o);o.write(`${a}\r
22
- `);let{connect:p,buffered:u}=await c;if(t.emit("proxyConnect",p),this.emit("proxyConnect",p,t),p.statusCode===200){if(t.once("socket",yu),r.secureEndpoint){Et("Upgrading socket connection to TLS");let d=r.servername||r.host;return bn.connect({...hi(r,"host","path","port"),socket:o,servername:Z.isIP(d)?void 0:d})}return o}o.destroy();let f=new Z.Socket({writable:!1});return f.readable=!0,t.once("socket",d=>{Et("Replaying proxy buffer for failed request"),d.push(u),d.push(null)}),f}};Tt.protocols=["http","https"];function yu(e){e.resume()}function hi(e,...t){let r={},n;for(n in e)t.includes(n)||(r[n]=e[n]);return r}var Ru=1024*32;function Au(e){return new vu({read(){this.push(e),this.push(null)}})}function Ei(e){let t;try{t=new URL(e.url)}catch{return b(()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")}),ut(e,()=>Promise.resolve({}))}let r=t.protocol==="https:",n=Cu(t,e.proxy||(r?process.env.https_proxy:void 0)||process.env.http_proxy),o=r?xu:bu,s=e.keepAlive===void 0?!1:e.keepAlive,i=n?new Tt(n):new o.Agent({keepAlive:s,maxSockets:30,timeout:2e3}),a=Ou(e,e.httpModule??o,i);return ut(e,a)}function Cu(e,t){let{no_proxy:r}=process.env;if(!r?.split(",").some(o=>e.host.endsWith(o)||e.hostname.endsWith(o)))return t}function Ou(e,t,r){let{hostname:n,pathname:o,port:s,protocol:i,search:a}=new URL(e.url);return function(p){return new Promise((u,f)=>{ke(()=>{let d=Au(p.body),m={...e.headers};p.body.length>Ru&&(m["content-encoding"]="gzip",d=d.pipe(Nu()));let _=n.startsWith("["),S=t.request({method:"POST",agent:r,headers:m,hostname:_?n.slice(1,-1):n,path:`${o}${a}`,port:s,protocol:i,ca:e.caCerts},E=>{E.on("data",()=>{}),E.on("end",()=>{}),E.setEncoding("utf8");let x=E.headers["retry-after"]??null,R=E.headers["x-sentry-rate-limits"]??null;u({statusCode:E.statusCode,headers:{"retry-after":x,"x-sentry-rate-limits":Array.isArray(R)?R[0]||null:R}})});S.on("error",f),d.pipe(S)})})}}function Ti(e){if(e===!1)return!1;if(typeof e=="string")return e;let t=ge(process.env.SENTRY_SPOTLIGHT,{strict:!0}),r=t===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return e===!0?r??!0:t??r}import{AsyncLocalStorage as Lu}from"node:async_hooks";function Ii(){let e=new Lu;function t(){let a=e.getStore();return a||{scope:Ke(),isolationScope:Xe()}}function r(a){let c=t().scope.clone(),p=t().isolationScope;return e.run({scope:c,isolationScope:p},()=>a(c))}function n(a,c){let p=t().isolationScope.clone();return e.run({scope:a,isolationScope:p},()=>c(a))}function o(a){let c=t().scope.clone(),p=t().isolationScope.clone();return e.run({scope:c,isolationScope:p},()=>a(p))}function s(a,c){let p=t().scope.clone();return e.run({scope:p,isolationScope:a},()=>c(a))}function i(a){return r(c=>(c.setSDKProcessingMetadata({[it]:!0}),a()))}Rr({suppressTracing:i,withScope:r,withSetScope:n,withIsolationScope:o,withSetIsolationScope:s,getCurrentScope:()=>t().scope,getIsolationScope:()=>t().isolationScope})}function xn(e={}){return Mu(e,()=>[])}function Mu(e={},t){let r=ku(e,t);r.debug===!0&&(N?l.enable():b(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Ii(),A().update(r.initialScope),r.spotlight&&!r.integrations.some(({name:s})=>s===Tn)&&r.integrations.push(fi({sidecarUrl:typeof r.spotlight=="string"?r.spotlight:void 0})),lt(r,"node-light",["node-core"]);let o=new er(r);return A().setClient(o),o.init(),l.log(`SDK initialized from ${pi()?"CommonJS":"ESM"} (light mode)`),o.startClientReportTracking(),Uu(),process.env.VERCEL&&process.on("SIGTERM",async()=>{await o.flush(200)}),o}function ku(e,t){let r=Pu(e.release),n=Ti(e.spotlight),o=Du(e.tracesSampleRate),s={...e,dsn:e.dsn??process.env.SENTRY_DSN,environment:e.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:e.sendClientReports??!0,transport:e.transport??Ei,stackParser:fr(e.stackParser||gi),release:r,tracesSampleRate:o,spotlight:n,debug:ge(e.debug??process.env.SENTRY_DEBUG)},i=e.integrations,a=e.defaultIntegrations??t(s),c=Jr({defaultIntegrations:a,integrations:i});return s.traceLifecycle==="stream"&&!c.some(p=>p.name==="SpanStreaming")&&c.push(Qt()),{...s,integrations:c}}function Pu(e){if(e!==void 0)return e;let t=mi();if(t!==void 0)return t}function Du(e){if(e!==void 0)return e;let t=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!t)return;let r=parseFloat(t);return isFinite(r)?r:void 0}function Uu(){if(ge(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let e=process.env.SENTRY_TRACE,t=process.env.SENTRY_BAGGAGE,r=Dr(e,t);A().setPropagationContext(r)}}import J from"homey";process.env.HOME||(process.env.HOME=wu.tmpdir());var yi=class e{_capturedMessages=[];_capturedExceptions=[];constructor({homey:t,options:r}){if(typeof t>"u")return e._error("Error: missing `homey` constructor parameter");if(!J.env)return e._error("Error: could not access `Homey.env`");if(typeof J.env.HOMEY_LOG_URL!="string")return e._error("Error: expected `HOMEY_LOG_URL` env variable, homey-log is disabled");let n=process.env.DEBUG==="1"&&!e._isLogForced();n&&e._log("App is running in debug mode, not enabling Sentry logging");let o;typeof J.env.HOMEY_LOG_SENTRY_PROJECT=="string"&&J.env.HOMEY_LOG_SENTRY_PROJECT.length>0&&(o=`${J.env.HOMEY_LOG_SENTRY_PROJECT}@${J.manifest.version}`),this._manifest=J.manifest,this._homeyVersion=t.version,this._managerCloud=t.cloud,this._homeyPlatform=t.platform,this._homeyPlatformVersion=t.platformVersion,this.init(J.env.HOMEY_LOG_URL,{enabled:!n,release:o,...r})}init(t,r){return xn({dsn:t,integrations:[we(),dt(),mt(),gt(),In(),hn(),En(),gn(),Sn(),dn({app:!1,cloudResource:!1})],maxBreadcrumbs:5,enableMetrics:!1,...r}),this.setTags({appId:this._manifest.id,appVersion:this._manifest.version,homeyVersion:this._homeyVersion,homeyPlatform:this._homeyPlatform,homeyPlatformVersion:this._homeyPlatformVersion}),this._managerCloud.getHomeyId().then(n=>this.setTags({homeyId:n})).catch(n=>e._error("Error: could not get `homeyId`",n)),e._log(`App ${this._manifest.id} v${this._manifest.version} logging on Homey v${this._homeyVersion}...`),this}setTags(t){return Wt(t),this}setUser(t){return Vt(t),this}async captureMessage(t){if(e._log("captureMessage:",t),this._capturedMessages.indexOf(t)>-1){e._log("Prevented sending a duplicate message");return}return this._capturedMessages.push(t),new Promise((r,n)=>{try{r(Yt(t))}catch(o){n(o)}})}async captureException(t){if(e._log("captureException:",t),this._capturedExceptions.indexOf(t)>-1){e._log("Prevented sending a duplicate log");return}return this._capturedExceptions.push(t),new Promise((r,n)=>{try{r(oe(t))}catch(o){n(o)}})}static _log(){console.log.bind(null,e._logTime(),"[homey-log]").apply(null,arguments)}static _error(){console.error.bind(null,e._logTime(),"[homey-log]").apply(null,arguments)}static _logTime(){return`\x1B[35m${new Date().toISOString()}\x1B[0m`}static _isLogForced(){switch(J.env.HOMEY_LOG_FORCE){case"1":case"true":return!0;default:return!1}}};export{yi as Log};
22
+ `);let{connect:p,buffered:u}=await c;if(t.emit("proxyConnect",p),this.emit("proxyConnect",p,t),p.statusCode===200){if(t.once("socket",xu),r.secureEndpoint){Et("Upgrading socket connection to TLS");let d=r.servername||r.host;return xn.connect({...hi(r,"host","path","port"),socket:o,servername:Z.isIP(d)?void 0:d})}return o}o.destroy();let f=new Z.Socket({writable:!1});return f.readable=!0,t.once("socket",d=>{Et("Replaying proxy buffer for failed request"),d.push(u),d.push(null)}),f}};Tt.protocols=["http","https"];function xu(e){e.resume()}function hi(e,...t){let r={},n;for(n in e)t.includes(n)||(r[n]=e[n]);return r}var Cu=1024*32;function Ou(e){return new Ru({read(){this.push(e),this.push(null)}})}function Ei(e){let t;try{t=new URL(e.url)}catch{return b(()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")}),ut(e,()=>Promise.resolve({}))}let r=t.protocol==="https:",n=Lu(t,e.proxy||(r?process.env.https_proxy:void 0)||process.env.http_proxy),o=r?Nu:vu,s=e.keepAlive===void 0?!1:e.keepAlive,i=n?new Tt(n):new o.Agent({keepAlive:s,maxSockets:30,timeout:2e3}),a=Mu(e,e.httpModule??o,i);return ut(e,a)}function Lu(e,t){let{no_proxy:r}=process.env;if(!r?.split(",").some(o=>e.host.endsWith(o)||e.hostname.endsWith(o)))return t}function Mu(e,t,r){let{hostname:n,pathname:o,port:s,protocol:i,search:a}=new URL(e.url);return function(p){return new Promise((u,f)=>{Pe(()=>{let d=Ou(p.body),m={...e.headers};p.body.length>Cu&&(m["content-encoding"]="gzip",d=d.pipe(Au()));let _=n.startsWith("["),S=t.request({method:"POST",agent:r,headers:m,hostname:_?n.slice(1,-1):n,path:`${o}${a}`,port:s,protocol:i,ca:e.caCerts},E=>{E.on("data",()=>{}),E.on("end",()=>{}),E.setEncoding("utf8");let x=E.headers["retry-after"]??null,R=E.headers["x-sentry-rate-limits"]??null;u({statusCode:E.statusCode,headers:{"retry-after":x,"x-sentry-rate-limits":Array.isArray(R)?R[0]||null:R}})});S.on("error",f),d.pipe(S)})})}}function Ti(e){if(e===!1)return!1;if(typeof e=="string")return e;let t=_e(process.env.SENTRY_SPOTLIGHT,{strict:!0}),r=t===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return e===!0?r??!0:t??r}import{AsyncLocalStorage as ku}from"node:async_hooks";function Ii(){let e=new ku;function t(){let a=e.getStore();return a||{scope:Ke(),isolationScope:Xe()}}function r(a){let c=t().scope.clone(),p=t().isolationScope;return e.run({scope:c,isolationScope:p},()=>a(c))}function n(a,c){let p=t().isolationScope.clone();return e.run({scope:a,isolationScope:p},()=>c(a))}function o(a){let c=t().scope.clone(),p=t().isolationScope.clone();return e.run({scope:c,isolationScope:p},()=>a(p))}function s(a,c){let p=t().scope.clone();return e.run({scope:p,isolationScope:a},()=>c(a))}function i(a){return r(c=>(c.setSDKProcessingMetadata({[it]:!0}),a()))}Rr({suppressTracing:i,withScope:r,withSetScope:n,withIsolationScope:o,withSetIsolationScope:s,getCurrentScope:()=>t().scope,getIsolationScope:()=>t().isolationScope,getTracingChannelBinding:()=>Ar(e,t)})}function vn(e={}){return Pu(e,()=>[])}function Pu(e={},t){let r=Du(e,t);r.debug===!0&&(N?l.enable():b(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Ii(),A().update(r.initialScope),r.spotlight&&!r.integrations.some(({name:s})=>s===In)&&r.integrations.push(fi({sidecarUrl:typeof r.spotlight=="string"?r.spotlight:void 0})),lt(r,"node-light",["node-core"]);let o=new er(r);return A().setClient(o),o.init(),l.log("SDK initialized from ESM (light mode)"),o.startClientReportTracking(),wu(),process.env.VERCEL&&process.on("SIGTERM",async()=>{await o.flush(200)}),o}function Du(e,t){let r=Uu(e.release),n=Ti(e.spotlight),o=Fu(e.tracesSampleRate),s={...e,dsn:e.dsn??process.env.SENTRY_DSN,environment:e.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:e.sendClientReports??!0,transport:e.transport??Ei,stackParser:fr(e.stackParser||gi),release:r,tracesSampleRate:o,spotlight:n,debug:_e(e.debug??process.env.SENTRY_DEBUG)},i=e.integrations,a=e.defaultIntegrations??t(s),c=Kr({defaultIntegrations:a,integrations:i});return s.traceLifecycle==="stream"&&!c.some(p=>p.name==="SpanStreaming")&&c.push(Qt()),{...s,integrations:c}}function Uu(e){if(e!==void 0)return e;let t=mi();if(t!==void 0)return t}function Fu(e){if(e!==void 0)return e;let t=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!t)return;let r=parseFloat(t);return isFinite(r)?r:void 0}function wu(){if(_e(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let e=process.env.SENTRY_TRACE,t=process.env.SENTRY_BAGGAGE,r=Ur(e,t);A().setPropagationContext(r)}}import J from"homey";process.env.HOME||(process.env.HOME=Gu.tmpdir());var yi=class e{_capturedMessages=[];_capturedExceptions=[];constructor({homey:t,options:r}){if(typeof t>"u")return e._error("Error: missing `homey` constructor parameter");if(!J.env)return e._error("Error: could not access `Homey.env`");if(typeof J.env.HOMEY_LOG_URL!="string")return e._error("Error: expected `HOMEY_LOG_URL` env variable, homey-log is disabled");let n=process.env.DEBUG==="1"&&!e._isLogForced();n&&e._log("App is running in debug mode, not enabling Sentry logging");let o;typeof J.env.HOMEY_LOG_SENTRY_PROJECT=="string"&&J.env.HOMEY_LOG_SENTRY_PROJECT.length>0&&(o=`${J.env.HOMEY_LOG_SENTRY_PROJECT}@${J.manifest.version}`),this._manifest=J.manifest,this._homeyVersion=t.version,this._managerCloud=t.cloud,this._homeyPlatform=t.platform,this._homeyPlatformVersion=t.platformVersion,this.init(J.env.HOMEY_LOG_URL,{enabled:!n,release:o,...r})}init(t,r){return vn({dsn:t,integrations:[Be(),dt(),mt(),gt(),yn(),En(),Tn(),_n(),hn(),mn({app:!1,cloudResource:!1})],maxBreadcrumbs:5,enableMetrics:!1,...r}),this.setTags({appId:this._manifest.id,appVersion:this._manifest.version,homeyVersion:this._homeyVersion,homeyPlatform:this._homeyPlatform,homeyPlatformVersion:this._homeyPlatformVersion}),this._managerCloud.getHomeyId().then(n=>this.setTags({homeyId:n})).catch(n=>e._error("Error: could not get `homeyId`",n)),e._log(`App ${this._manifest.id} v${this._manifest.version} logging on Homey v${this._homeyVersion}...`),this}setTags(t){return Wt(t),this}setUser(t){return Vt(t),this}async captureMessage(t){if(e._log("captureMessage:",t),this._capturedMessages.indexOf(t)>-1){e._log("Prevented sending a duplicate message");return}return this._capturedMessages.push(t),new Promise((r,n)=>{try{r(Yt(t))}catch(o){n(o)}})}async captureException(t){if(e._log("captureException:",t),this._capturedExceptions.indexOf(t)>-1){e._log("Prevented sending a duplicate log");return}return this._capturedExceptions.push(t),new Promise((r,n)=>{try{r(oe(t))}catch(o){n(o)}})}static _log(){console.log.bind(null,e._logTime(),"[homey-log]").apply(null,arguments)}static _error(){console.error.bind(null,e._logTime(),"[homey-log]").apply(null,arguments)}static _logTime(){return`\x1B[35m${new Date().toISOString()}\x1B[0m`}static _isLogForced(){switch(J.env.HOMEY_LOG_FORCE){case"1":case"true":return!0;default:return!1}}};export{yi as Log};