@drenso/homey-log 10.5100.0 → 10.5200.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.js +17 -17
- package/build/index.mjs +17 -17
- package/package.json +3 -3
package/build/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
"use strict";var
|
|
2
|
-
`);for(let a=r;a<i.length;a++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));let u=
|
|
1
|
+
"use strict";var Yi=Object.create;var yt=Object.defineProperty;var Wi=Object.getOwnPropertyDescriptor;var $i=Object.getOwnPropertyNames;var Vi=Object.getPrototypeOf,ji=Object.prototype.hasOwnProperty;var zi=(e,t)=>{for(var n in t)yt(e,n,{get:t[n],enumerable:!0})},vr=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $i(t))!ji.call(e,o)&&o!==n&&yt(e,o,{get:()=>t[o],enumerable:!(r=Wi(t,o))||r.enumerable});return e};var U=(e,t,n)=>(n=e!=null?Yi(Vi(e)):{},vr(t||!e||!e.__esModule?yt(n,"default",{value:e,enumerable:!0}):n,e)),Zi=e=>vr(yt({},"__esModule",{value:!0}),e);var nf={};zi(nf,{Log:()=>xr});module.exports=Zi(nf);var Bi=U(require("node:os"),1);var ni=U(require("node:os"),1);var g=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var h=globalThis;var Y="10.52.0";function P(){return te(h),h}function te(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Y,t[Y]=t[Y]||{}}function w(e,t,n=h){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[Y]=r[Y]||{};return o[e]||(o[e]=t())}var fe=["debug","info","warn","error","log","assert","trace"],Ji="Sentry Logger ",F={};function x(e){if(!("console"in h))return e();let t=h.console,n={},r=Object.keys(F);r.forEach(o=>{let s=F[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function Xi(){dn().enabled=!0}function Ki(){dn().enabled=!1}function Or(){return dn().enabled}function qi(...e){fn("log",...e)}function Qi(...e){fn("warn",...e)}function ea(...e){fn("error",...e)}function fn(e,...t){g&&Or()&&x(()=>{h.console[e](`${Ji}[${e}]:`,...t)})}function dn(){return g?w("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var d={enable:Xi,disable:Ki,isEnabled:Or,log:qi,warn:Qi,error:ea};var Lr=/\(error: (.*)\)/,Mr=/captureMessage|captureException/;function xt(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let s=[],i=n.split(`
|
|
2
|
+
`);for(let a=r;a<i.length;a++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));let u=Lr.test(c)?c.replace(Lr,"$1"):c;if(!u.includes("Error: ")){for(let p of t){let f=p(u);if(f){s.push(f);break}}if(s.length>=50+o)break}}return Ur(s.slice(o))}}function mn(e){return Array.isArray(e)?xt(...e):e}function Ur(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(bt(t).function||"")&&t.pop(),t.reverse(),Mr.test(bt(t).function||"")&&(t.pop(),Mr.test(bt(t).function||"")&&t.pop()),t.slice(0,50).map(n=>({...n,filename:n.filename||bt(t).filename,function:n.function||"?"}))}function bt(e){return e[e.length-1]||{}}var ln="<anonymous>";function $e(e){try{return!e||typeof e!="function"?ln:e.name||ln}catch{return ln}}function Nt(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function kr(e){let t=e?.startsWith("file://")?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var Ve={},Pr={};function de(e,t){return Ve[e]=Ve[e]||[],Ve[e].push(t),()=>{let n=Ve[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function J(e,t){if(!Pr[e]){Pr[e]=!0;try{t()}catch(n){g&&d.error(`Error while instrumenting ${e}`,n)}}}function W(e,t){let n=e&&Ve[e];if(n)for(let r of n)try{r(t)}catch(o){g&&d.error(`Error while triggering instrumentation handler.
|
|
3
3
|
Type: ${e}
|
|
4
|
-
Name: ${
|
|
5
|
-
Error:`,o)}}var ln=null;function Cr(e){let t="error";fe(t,e),J(t,Vi)}function Vi(){ln=_.onerror,_.onerror=function(e,t,n,r,o){return Y("error",{column:r,error:o,line:n,msg:e,url:t}),ln?ln.apply(this,arguments):!1},_.onerror.__SENTRY_INSTRUMENTED__=!0}var dn=null;function vr(e){let t="unhandledrejection";fe(t,e),J(t,$i)}function $i(){dn=_.onunhandledrejection,_.onunhandledrejection=function(e){return Y("unhandledrejection",e),dn?dn.apply(this,arguments):!0},_.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var Or=Object.prototype.toString;function $e(e){switch(Or.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return K(e,Error)}}function xt(e,t){return Or.call(e)===`[object ${t}]`}function Lr(e){return xt(e,"ErrorEvent")}function le(e){return xt(e,"String")}function je(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ie(e){return e===null||je(e)||typeof e!="object"&&typeof e!="function"}function ne(e){return xt(e,"Object")}function Mr(e){return typeof Event<"u"&&K(e,Event)}function Pr(e){return typeof Element<"u"&&K(e,Element)}function Ur(e){return xt(e,"RegExp")}function X(e){return!!(e?.then&&typeof e.then=="function")}function kr(e){return ne(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function K(e,t){try{return e instanceof t}catch{return!1}}function Nt(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}var ji=_,zi=80;function Dr(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],s=0,i=0,a=" > ",c=a.length,u,l=Array.isArray(t)?t:t.keyAttrs,f=!Array.isArray(t)&&t.maxStringLength||zi;for(;n&&s++<r&&(u=Zi(n,l),!(u==="html"||s>1&&i+o.length*c+u.length>=f));)o.push(u),i+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function Zi(e,t){let n=e,r=[];if(!n?.tagName)return"";if(ji.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let o=t?.length?t.filter(s=>n.getAttribute(s)).map(s=>[s,n.getAttribute(s)]):null;if(o?.length)o.forEach(s=>{r.push(`[${s[0]}="${s[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let s=n.className;if(s&&le(s)){let i=s.split(/\s+/);for(let a of i)r.push(`.${a}`)}}for(let s of["aria-label","type","name","title","alt"]){let i=n.getAttribute(s);i&&r.push(`[${s}="${i}"]`)}return r.join("")}function ze(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&Rt(o,r);try{e[t]=o}catch{g&&p.log(`Failed to replace method "${t}" in object`,e)}}function ye(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{g&&p.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Rt(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,ye(e,"__sentry_original__",t)}catch{}}function mn(e){return e.__sentry_original__}function At(e){if($e(e))return{message:e.message,name:e.name,stack:e.stack,...wr(e)};if(Mr(e)){let t={type:e.type,target:Fr(e.target),currentTarget:Fr(e.currentTarget),...wr(e)};return typeof CustomEvent<"u"&&K(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Fr(e){try{return Pr(e)?Dr(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function wr(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function gn(e){let t=Object.keys(At(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var be;function xe(e){if(be!==void 0)return be?be(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=_;return t in n&&typeof n[t]=="function"?(be=n[t],be(e)):(be=null,e())}function U(){return xe(()=>Math.random())}function Ne(){return xe(()=>Date.now())}function Re(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function _n(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let s=Math.min(o+140,r);return s>r-5&&(s=r),s===r&&(o=Math.max(s-140,0)),n=n.slice(o,s),o>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function hn(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];try{Nt(o)?n.push(bt(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function W(e,t,n=!1){return le(e)?Ur(t)?t.test(e):le(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function Ae(e,t=[],n=!1){return t.some(r=>W(e,r,n))}function Ji(){let e=_;return e.crypto||e.msCrypto}var Sn;function Xi(){return U()*16}function I(e=Ji()){try{if(e?.randomUUID)return xe(()=>e.randomUUID()).replace(/-/g,"")}catch{}return Sn||(Sn="10000000100040008000"+1e11),Sn.replace(/[018]/g,t=>(t^(Xi()&15)>>t/4).toString(16))}function Br(e){return e.exception?.values?.[0]}function re(e){let{message:t,event_id:n}=e;if(t)return t;let r=Br(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Tn(e,t,n){let r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type=n||"Error")}function Ce(e,t){let n=Br(e);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){let s={...o?.data,...t.data};n.mechanism.data=s}}var Ki=/^(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 En(e){return parseInt(e||"",10)}function In(e){let t=e.match(Ki)||[],n=En(t[1]),r=En(t[2]),o=En(t[3]);return{buildmetadata:t[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(o)?void 0:o,prerelease:t[4]}}function Ct(e){if(Gr(e))return!0;try{ye(e,"__sentry_captured__",!0)}catch{}return!1}function Gr(e){try{return e.__sentry_captured__}catch{}}var Yr=1e3;function q(){return Ne()/Yr}function qi(){let{performance:e}=_;if(!e?.now||!e.timeOrigin)return q;let t=e.timeOrigin;return()=>(t+xe(()=>e.now()))/Yr}var Hr;function vt(){return(Hr??(Hr=qi()))()}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||vt(),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:I()),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 n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function oe(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=oe(r[o],t[o],n-1));return r}function Je(){return I()}function Xe(){return I().substring(16)}var yn="_sentrySpan";function Ke(e,t){t?ye(e,yn,t):delete e[yn]}function ve(e){return e[yn]}var Qi=100,v=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:Je(),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,Ke(t,ve(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,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t=="function"?t(this):t,r=n instanceof e?n.getScopeData():ne(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:c,level:u,fingerprint:l=[],propagationContext:f,conversationId:d}=r||{};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),u&&(this._level=u),l.length&&(this._fingerprint=l),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,Ke(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Je(),sampleRand:U()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:Qi;if(r<=0)return this;let o={timestamp:q(),...t,message:t.message?Re(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),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:ve(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=oe(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||I();if(!this._client)return g&&p.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){let o=r?.event_id||I();if(!this._client)return g&&p.warn("No client configured on scope - will not capture message!"),o;let s=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:o},this),o}captureEvent(t,n){let r=t.event_id||n?.event_id||I();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(g&&p.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function qe(){return D("defaultCurrentScope",()=>new v)}function Qe(){return D("defaultIsolationScope",()=>new v)}var Wr=e=>e instanceof Promise&&!e[Vr],Vr=Symbol("chained PromiseLike"),$r=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return Wr(r)&&Wr(e)?r:ea(e,r)},ea=(e,t)=>{let n=!1;for(let r in e){if(r in t)continue;n=!0;let o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...s)=>o.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[Vr]:!0}),t};var bn=class{constructor(t,n){let r;t?r=t:r=new v;let o;n?o=n:o=new v,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){let n=this._pushScope(),r;try{r=t(n)}catch(o){throw this._popScope(),o}return X(r)?$r(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){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 Oe(){let e=P(),t=te(e);return t.stack=t.stack||new bn(qe(),Qe())}function ta(e){return Oe().withScope(e)}function na(e,t){let n=Oe();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function jr(e){return Oe().withScope(()=>e(Oe().getIsolationScope()))}function zr(){return{withIsolationScope:jr,withScope:ta,withSetScope:na,withSetIsolationScope:(e,t)=>jr(t),getCurrentScope:()=>Oe().getScope(),getIsolationScope:()=>Oe().getIsolationScope()}}function xn(e){let t=P(),n=te(t);n.acs=e}function se(e){let t=te(e);return t.acs?t.acs:zr()}function ra(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function oa(e,t){let{value:n,unit:r}=ra(e)?e:{value:e,unit:void 0},o=sa(n),s=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...s};if(!t||t==="skip-undefined"&&n===void 0)return;let i="";try{i=JSON.stringify(n)??""}catch{}return{value:i,type:"string",...s}}function Nn(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let s=oa(o,t);s&&(n[r]=s)}return n}function Rn(e){if(!e)return 0;let t=0;for(let[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;let o=r.value;Array.isArray(o)?t+=Zr(o[0])*o.length:Ie(o)?t+=Zr(o):t+=100}return t}function Zr(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function sa(e){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 ia;function Jr(){return ia?.()}function C(){let e=P();return se(e).getCurrentScope()}function k(){let e=P();return se(e).getIsolationScope()}function Ot(){return D("globalScope",()=>new v)}function de(...e){let t=P(),n=se(t);if(e.length===2){let[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function T(){return C().getClient()}function et(e){let t=Jr();if(t)return{trace_id:t.traceId,span_id:t.spanId};let n=e.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:s}=n,i={trace_id:r,span_id:s||Xe()};return o&&(i.parent_span_id=o),i}var w="sentry.source",An="sentry.sample_rate",Xr="sentry.previous_trace_sample_rate",B="sentry.op",Cn="sentry.origin";var Kr="sentry.release",qr="sentry.environment",Qr="sentry.segment.name",eo="sentry.segment.id",to="sentry.sdk.name",no="sentry.sdk.version",ro="user.id",oo="user.email",so="user.ip_address",io="user.name",Lt="sentry.custom_span_name",vn="sentry.profile_id",On="sentry.exclusive_time";function ao(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var aa="_sentryScope",ca="_sentryIsolationScope";function Le(e){let t=e;return{scope:t[aa],isolationScope:ao(t[ca])}}var co="sentry-";function Mt(e){let t=ua(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,s])=>{if(o.startsWith(co)){let i=o.slice(co.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function ua(e){if(!(!e||!le(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=uo(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):uo(e)}function uo(e){return e.split(",").map(t=>{let n=t.indexOf("=");if(n===-1)return[];let r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}var pa=/^o(\d+)\./,fa=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function la(e){return e==="http"||e==="https"}function O(e,t=!1){let{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function da(e){let t=fa.exec(e);if(!t){b(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",s="",i="",a=""]=t.slice(1),c="",u=a,l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){let f=u.match(/^\d+/);f&&(u=f[0])}return po({host:s,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function po(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function ma(e){if(!g)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(p.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?la(r)?t&&isNaN(parseInt(t,10))?(p.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(p.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(p.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function ga(e){return e.match(pa)?.[1]}function fo(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=ga(n)),r}function lo(e){let t=typeof e=="string"?da(e):po(e);if(!(!t||!ma(t)))return t}function tt(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 mo=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function go(e){if(!e)return;let t=e.match(mo);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function Ln(e,t){let n=go(e),r=Mt(t);if(!n?.traceId)return{traceId:Je(),sampleRand:U()};let o=_a(n,r);r&&(r.sample_rand=o.toString());let{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function _a(e,t){let n=tt(t?.sample_rand);if(n!==void 0)return n;let r=tt(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?U()*r:r+U()*(1-r):U()}var Mn=1,_o=!1;function Ut(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:Me(e).parent_span_id,s=Le(e).scope,i=r?s?.getPropagationContext().propagationSpanId||Xe():t;return{parent_span_id:o,span_id:i,trace_id:n}}function Ea(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:t,trace_id:n,sampled:r===Mn,attributes:s,...o}))}function Ta(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Mn,attributes:o}))}function Pt(e){return typeof e=="number"?ho(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?ho(e.getTime()):vt()}function ho(e){return e>9999999999?e/1e3:e}function Me(e){if(Io(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(To(e)){let{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:So(e),start_timestamp:Pt(o),timestamp:Pt(i)||void 0,status:Ia(a),op:r[B],origin:r[Cn],links:Ea(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Pn(e){if(Io(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(To(e)){let{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{name:s,span_id:t,trace_id:n,parent_span_id:So(e),start_timestamp:Pt(o),end_timestamp:Pt(i),is_segment:e===nt(e),status:ya(a),attributes:r,links:Ta(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===nt(e)}}function So(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function Eo(e){return{...e,attributes:Nn(e.attributes),links:e.links?.map(t=>({...t,attributes:Nn(t.attributes)}))}}function To(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Io(e){return typeof e.getSpanJSON=="function"}function kt(e){let{traceFlags:t}=e.spanContext();return t===Mn}function Ia(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function ya(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var ba="_sentryRootSpan";var me=nt;function nt(e){return e[ba]||e}function rt(){let e=P(),t=se(e);return t.getActiveSpan?t.getActiveSpan():ve(C())}function ot(){_o||(b(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),_o=!0)}var yo=!1;function bo(){if(yo)return;function e(){let t=rt(),n=t&&me(t);if(n){let r="internal_error";g&&p.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}e.tag="sentry_tracingErrorCallback",yo=!0,Cr(e),vr(e)}function xo(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||T()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function No(e){p.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function Un(e,t){if(!t?.length)return!1;for(let n of t){if(Na(n)){if(e.description&&W(e.description,n))return g&&No(e),!0;continue}let r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;let o=n.name?e.description&&W(e.description,n.name):!0,s=n.op?e.op&&W(e.op,n.op):!0,i=n.attributes?Object.entries(n.attributes).every(([a,c])=>xa(e.attributes?.[a],c)):!0;if(o&&s&&i)return g&&No(e),!0}return!1}function xa(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?W(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function Ro(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function Na(e){return typeof e=="string"||e instanceof RegExp}var Pe="production";var Ra="_frozenDsc";function Ao(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||Pe,release:n.release,public_key:r,trace_id:e,org_id:fo(t)};return t.emit("createDsc",o),o}function Dt(e,t){let n=t.getPropagationContext();return n.dsc||Ao(n.traceId,e)}function Ue(e){let t=T();if(!t)return{};let n=me(e),r=Me(n),o=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[An]??o[Xr];function a(h){return(typeof i=="number"||typeof i=="string")&&(h.sample_rate=`${i}`),h}let c=n[Ra];if(c)return a(c);let u=s?.get("sentry.dsc"),l=u&&Mt(u);if(l)return a(l);let f=Ao(e.spanContext().traceId,t),d=o[w]??o["sentry.span.source"],m=r.description;return d!=="url"&&m&&(f.transaction=m),xo()&&(f.sampled=String(kt(n)),f.sample_rand=s?.get("sentry.sample_rand")??Le(n).scope?.getPropagationContext().sampleRand.toString()),a(f),t.emit("createDsc",f,n),f}function ke(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}var Aa=Symbol.for("sentry.skipNormalization"),Ca=Symbol.for("sentry.overrideNormalizationDepth");function Co(e){return!!e[Aa]}function vo(e){let t=e[Ca];return typeof t=="number"?t:void 0}function G(e,t=100,n=1/0){try{return kn("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Dn(e,t=3,n=100*1024){let r=G(e,t);return Ma(r)>n?Dn(e,t-1,n):r}function kn(e,t,n=1/0,r=1/0,o=Pa()){let[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=va(e,t);if(!a.startsWith("[object "))return a;if(Co(t))return t;let c=vo(t),u=c!==void 0?c:n;if(u===0)return a.replace("object ","");if(s(t))return"[Circular ~]";let l=t;if(l&&typeof l.toJSON=="function")try{let h=l.toJSON();return kn("",h,u-1,r,o)}catch{}let f=Array.isArray(t)?[]:{},d=0,m=At(t);for(let h in m){if(!Object.prototype.hasOwnProperty.call(m,h))continue;if(d>=r){f[h]="[MaxProperties ~]";break}let S=m[h];f[h]=kn(h,S,u-1,r,o),d++}return i(t),f}function va(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Nt(t))return bt(t);if(kr(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${We(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let n=Oa(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Oa(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function La(e){return~-encodeURI(e).split(/%..|./).length}function Ma(e){return La(JSON.stringify(e))}function Pa(){let e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function N(e,t=[]){return[e,t]}function wn(e,t){let[n,r]=e;return[n,[...r,t]]}function st(e,t){let n=e[1];for(let r of n){let o=r[0].type;if(t(r,o))return!0}return!1}function Bn(e,t){return st(e,(n,r)=>t.includes(r))}function Fn(e){let t=te(_);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function it(e){let[t,n]=e,r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[Fn(r),s]:r.push(typeof s=="string"?Fn(s):s)}for(let s of n){let[i,a]=s;if(o(`
|
|
4
|
+
Name: ${$e(r)}
|
|
5
|
+
Error:`,o)}}var gn=null;function Dr(e){let t="error";de(t,e),J(t,ta)}function ta(){gn=h.onerror,h.onerror=function(e,t,n,r,o){return W("error",{column:r,error:o,line:n,msg:e,url:t}),gn?gn.apply(this,arguments):!1},h.onerror.__SENTRY_INSTRUMENTED__=!0}var _n=null;function wr(e){let t="unhandledrejection";de(t,e),J(t,na)}function na(){_n=h.onunhandledrejection,h.onunhandledrejection=function(e){return W("unhandledrejection",e),_n?_n.apply(this,arguments):!0},h.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var Fr=Object.prototype.toString;function je(e){switch(Fr.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return K(e,Error)}}function Rt(e,t){return Fr.call(e)===`[object ${t}]`}function Br(e){return Rt(e,"ErrorEvent")}function le(e){return Rt(e,"String")}function ze(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Ie(e){return e===null||ze(e)||typeof e!="object"&&typeof e!="function"}function ne(e){return Rt(e,"Object")}function Gr(e){return typeof Event<"u"&&K(e,Event)}function Hr(e){return typeof Element<"u"&&K(e,Element)}function Yr(e){return Rt(e,"RegExp")}function X(e){return!!(e?.then&&typeof e.then=="function")}function Wr(e){return ne(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function K(e,t){try{return e instanceof t}catch{return!1}}function At(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}var ra=h,oa=80;function $r(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],s=0,i=0,a=" > ",c=a.length,u,p=Array.isArray(t)?t:t.keyAttrs,f=!Array.isArray(t)&&t.maxStringLength||oa;for(;n&&s++<r&&(u=sa(n,p),!(u==="html"||s>1&&i+o.length*c+u.length>=f));)o.push(u),i+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function sa(e,t){let n=e,r=[];if(!n?.tagName)return"";if(ra.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let o=t?.length?t.filter(s=>n.getAttribute(s)).map(s=>[s,n.getAttribute(s)]):null;if(o?.length)o.forEach(s=>{r.push(`[${s[0]}="${s[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let s=n.className;if(s&&le(s)){let i=s.split(/\s+/);for(let a of i)r.push(`.${a}`)}}for(let s of["aria-label","type","name","title","alt"]){let i=n.getAttribute(s);i&&r.push(`[${s}="${i}"]`)}return r.join("")}function Ze(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&Ct(o,r);try{e[t]=o}catch{g&&d.log(`Failed to replace method "${t}" in object`,e)}}function ye(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{g&&d.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Ct(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,ye(e,"__sentry_original__",t)}catch{}}function hn(e){return e.__sentry_original__}function vt(e){if(je(e))return{message:e.message,name:e.name,stack:e.stack,...jr(e)};if(Gr(e)){let t={type:e.type,target:Vr(e.target),currentTarget:Vr(e.currentTarget),...jr(e)};return typeof CustomEvent<"u"&&K(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Vr(e){try{return Hr(e)?$r(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function jr(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function Sn(e){let t=Object.keys(vt(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var be;function xe(e){if(be!==void 0)return be?be(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=h;return t in n&&typeof n[t]=="function"?(be=n[t],be(e)):(be=null,e())}function D(){return xe(()=>Math.random())}function Ne(){return xe(()=>Date.now())}function Re(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function En(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let s=Math.min(o+140,r);return s>r-5&&(s=r),s===r&&(o=Math.max(s-140,0)),n=n.slice(o,s),o>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function Tn(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];try{At(o)?n.push(Nt(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function $(e,t,n=!1){return le(e)?Yr(t)?t.test(e):le(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function Ae(e,t=[],n=!1){return t.some(r=>$(e,r,n))}function ia(){let e=h;return e.crypto||e.msCrypto}var In;function aa(){return D()*16}function b(e=ia()){try{if(e?.randomUUID)return xe(()=>e.randomUUID()).replace(/-/g,"")}catch{}return In||(In="10000000100040008000"+1e11),In.replace(/[018]/g,t=>(t^(aa()&15)>>t/4).toString(16))}function zr(e){return e.exception?.values?.[0]}function re(e){let{message:t,event_id:n}=e;if(t)return t;let r=zr(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function bn(e,t,n){let r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type=n||"Error")}function Ce(e,t){let n=zr(e);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){let s={...o?.data,...t.data};n.mechanism.data=s}}var ca=/^(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 yn(e){return parseInt(e||"",10)}function xn(e){let t=e.match(ca)||[],n=yn(t[1]),r=yn(t[2]),o=yn(t[3]);return{buildmetadata:t[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(o)?void 0:o,prerelease:t[4]}}function Ot(e){if(Zr(e))return!0;try{ye(e,"__sentry_captured__",!0)}catch{}return!1}function Zr(e){try{return e.__sentry_captured__}catch{}}var Xr=1e3;function q(){return Ne()/Xr}function ua(){let{performance:e}=h;if(!e?.now||!e.timeOrigin)return q;let t=e.timeOrigin;return()=>(t+xe(()=>e.now()))/Xr}var Jr;function Lt(){return(Jr??(Jr=ua()))()}function Je(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||Lt(),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:b()),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 n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function oe(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=oe(r[o],t[o],n-1));return r}function Xe(){return b()}function Ke(){return b().substring(16)}var Nn="_sentrySpan";function qe(e,t){t?ye(e,Nn,t):delete e[Nn]}function ve(e){return e[Nn]}var pa=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:Xe(),sampleRand:D()}}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,qe(t,ve(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&&Je(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t=="function"?t(this):t,r=n instanceof e?n.getScopeData():ne(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:c,level:u,fingerprint:p=[],propagationContext:f,conversationId:l}=r||{};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),u&&(this._level=u),p.length&&(this._fingerprint=p),f&&(this._propagationContext=f),l&&(this._conversationId=l),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,qe(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Xe(),sampleRand:D()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:pa;if(r<=0)return this;let o={timestamp:q(),...t,message:t.message?Re(t.message,2048):t.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),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:ve(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=oe(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||b();if(!this._client)return g&&d.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){let o=r?.event_id||b();if(!this._client)return g&&d.warn("No client configured on scope - will not capture message!"),o;let s=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:o},this),o}captureEvent(t,n){let r=t.event_id||n?.event_id||b();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(g&&d.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function Qe(){return w("defaultCurrentScope",()=>new O)}function et(){return w("defaultIsolationScope",()=>new O)}var Kr=e=>e instanceof Promise&&!e[qr],qr=Symbol("chained PromiseLike"),Qr=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return Kr(r)&&Kr(e)?r:fa(e,r)},fa=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...s)=>o.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[qr]:!0}),t};var Rn=class{constructor(t,n){let r;t?r=t:r=new O;let o;n?o=n:o=new O,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){let n=this._pushScope(),r;try{r=t(n)}catch(o){throw this._popScope(),o}return X(r)?Qr(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){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 Oe(){let e=P(),t=te(e);return t.stack=t.stack||new Rn(Qe(),et())}function da(e){return Oe().withScope(e)}function la(e,t){let n=Oe();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function eo(e){return Oe().withScope(()=>e(Oe().getIsolationScope()))}function to(){return{withIsolationScope:eo,withScope:da,withSetScope:la,withSetIsolationScope:(e,t)=>eo(t),getCurrentScope:()=>Oe().getScope(),getIsolationScope:()=>Oe().getIsolationScope()}}function An(e){let t=P(),n=te(t);n.acs=e}function se(e){let t=te(e);return t.acs?t.acs:to()}function ma(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function ga(e,t){let{value:n,unit:r}=ma(e)?e:{value:e,unit:void 0},o=_a(n),s=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...s};if(!t||t==="skip-undefined"&&n===void 0)return;let i="";try{i=JSON.stringify(n)??""}catch{}return{value:i,type:"string",...s}}function Cn(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let s=ga(o,t);s&&(n[r]=s)}return n}function vn(e){if(!e)return 0;let t=0;for(let[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;let o=r.value;Array.isArray(o)?t+=no(o[0])*o.length:Ie(o)?t+=no(o):t+=100}return t}function no(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function _a(e){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 ha;function ro(){return ha?.()}function v(){let e=P();return se(e).getCurrentScope()}function L(){let e=P();return se(e).getIsolationScope()}function Mt(){return w("globalScope",()=>new O)}function me(...e){let t=P(),n=se(t);if(e.length===2){let[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function T(){return v().getClient()}function tt(e){let t=ro();if(t)return{trace_id:t.traceId,span_id:t.spanId};let n=e.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:s}=n,i={trace_id:r,span_id:s||Ke()};return o&&(i.parent_span_id=o),i}var B="sentry.source",On="sentry.sample_rate",oo="sentry.previous_trace_sample_rate",G="sentry.op",Ln="sentry.origin";var so="sentry.release",io="sentry.environment",ao="sentry.segment.name",co="sentry.segment.id",uo="sentry.sdk.name",po="sentry.sdk.version",fo="user.id",lo="user.email",Ut="user.ip_address",mo="user.name",kt="sentry.custom_span_name",Mn="sentry.profile_id",Un="sentry.exclusive_time";function go(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var Sa="_sentryScope",Ea="_sentryIsolationScope";function Le(e){let t=e;return{scope:t[Sa],isolationScope:go(t[Ea])}}var _o="sentry-";function Pt(e){let t=Ta(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,s])=>{if(o.startsWith(_o)){let i=o.slice(_o.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function Ta(e){if(!(!e||!le(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=ho(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):ho(e)}function ho(e){return e.split(",").map(t=>{let n=t.indexOf("=");if(n===-1)return[];let r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}var Ia=/^o(\d+)\./,ya=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function ba(e){return e==="http"||e==="https"}function M(e,t=!1){let{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function xa(e){let t=ya.exec(e);if(!t){x(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",s="",i="",a=""]=t.slice(1),c="",u=a,p=u.split("/");if(p.length>1&&(c=p.slice(0,-1).join("/"),u=p.pop()),u){let f=u.match(/^\d+/);f&&(u=f[0])}return So({host:s,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function So(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Na(e){if(!g)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(d.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?ba(r)?t&&isNaN(parseInt(t,10))?(d.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(d.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(d.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Ra(e){return e.match(Ia)?.[1]}function Eo(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=Ra(n)),r}function To(e){let t=typeof e=="string"?xa(e):So(e);if(!(!t||!Na(t)))return t}function nt(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 Io=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function yo(e){if(!e)return;let t=e.match(Io);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function kn(e,t){let n=yo(e),r=Pt(t);if(!n?.traceId)return{traceId:Xe(),sampleRand:D()};let o=Aa(n,r);r&&(r.sample_rand=o.toString());let{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function Aa(e,t){let n=nt(t?.sample_rand);if(n!==void 0)return n;let r=nt(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?D()*r:r+D()*(1-r):D()}var Pn=1,bo=!1;function wt(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:Me(e).parent_span_id,s=Le(e).scope,i=r?s?.getPropagationContext().propagationSpanId||Ke():t;return{parent_span_id:o,span_id:i,trace_id:n}}function Oa(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:t,trace_id:n,sampled:r===Pn,attributes:s,...o}))}function La(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Pn,attributes:o}))}function Dt(e){return typeof e=="number"?xo(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?xo(e.getTime()):Lt()}function xo(e){return e>9999999999?e/1e3:e}function Me(e){if(Co(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Ao(e)){let{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:No(e),start_timestamp:Dt(o),timestamp:Dt(i)||void 0,status:Ma(a),op:r[G],origin:r[Ln],links:Oa(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Dn(e){if(Co(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Ao(e)){let{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{name:s,span_id:t,trace_id:n,parent_span_id:No(e),start_timestamp:Dt(o),end_timestamp:Dt(i),is_segment:e===rt(e),status:Ua(a),attributes:r,links:La(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===rt(e)}}function No(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function Ro(e){return{...e,attributes:Cn(e.attributes),links:e.links?.map(t=>({...t,attributes:Cn(t.attributes)}))}}function Ao(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Co(e){return typeof e.getSpanJSON=="function"}function Ft(e){let{traceFlags:t}=e.spanContext();return t===Pn}function Ma(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 ka="_sentryRootSpan";var ge=rt;function rt(e){return e[ka]||e}function ot(){let e=P(),t=se(e);return t.getActiveSpan?t.getActiveSpan():ve(v())}function st(){bo||(x(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),bo=!0)}var vo=!1;function Oo(){if(vo)return;function e(){let t=ot(),n=t&&ge(t);if(n){let r="internal_error";g&&d.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}e.tag="sentry_tracingErrorCallback",vo=!0,Dr(e),wr(e)}function Lo(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||T()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Mo(e){d.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function wn(e,t){if(!t?.length)return!1;for(let n of t){if(Da(n)){if(e.description&&$(e.description,n))return g&&Mo(e),!0;continue}let r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;let o=n.name?e.description&&$(e.description,n.name):!0,s=n.op?e.op&&$(e.op,n.op):!0,i=n.attributes?Object.entries(n.attributes).every(([a,c])=>Pa(e.attributes?.[a],c)):!0;if(o&&s&&i)return g&&Mo(e),!0}return!1}function Pa(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?$(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function Uo(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function Da(e){return typeof e=="string"||e instanceof RegExp}var Ue="production";var wa="_frozenDsc";function ko(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||Ue,release:n.release,public_key:r,trace_id:e,org_id:Eo(t)};return t.emit("createDsc",o),o}function Bt(e,t){let n=t.getPropagationContext();return n.dsc||ko(n.traceId,e)}function ke(e){let t=T();if(!t)return{};let n=ge(e),r=Me(n),o=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[On]??o[oo];function a(_){return(typeof i=="number"||typeof i=="string")&&(_.sample_rate=`${i}`),_}let c=n[wa];if(c)return a(c);let u=s?.get("sentry.dsc"),p=u&&Pt(u);if(p)return a(p);let f=ko(e.spanContext().traceId,t),l=o[B]??o["sentry.span.source"],m=r.description;return l!=="url"&&m&&(f.transaction=m),Lo()&&(f.sampled=String(Ft(n)),f.sample_rand=s?.get("sentry.sample_rand")??Le(n).scope?.getPropagationContext().sampleRand.toString()),a(f),t.emit("createDsc",f,n),f}function Pe(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}var Fa=Symbol.for("sentry.skipNormalization"),Ba=Symbol.for("sentry.overrideNormalizationDepth");function Po(e){return!!e[Fa]}function Do(e){let t=e[Ba];return typeof t=="number"?t:void 0}function H(e,t=100,n=1/0){try{return Fn("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Bn(e,t=3,n=100*1024){let r=H(e,t);return Wa(r)>n?Bn(e,t-1,n):r}function Fn(e,t,n=1/0,r=1/0,o=$a()){let[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=Ga(e,t);if(!a.startsWith("[object "))return a;if(Po(t))return t;let c=Do(t),u=c!==void 0?c:n;if(u===0)return a.replace("object ","");if(s(t))return"[Circular ~]";let p=t;if(p&&typeof p.toJSON=="function")try{let _=p.toJSON();return Fn("",_,u-1,r,o)}catch{}let f=Array.isArray(t)?[]:{},l=0,m=vt(t);for(let _ in m){if(!Object.prototype.hasOwnProperty.call(m,_))continue;if(l>=r){f[_]="[MaxProperties ~]";break}let S=m[_];f[_]=Fn(_,S,u-1,r,o),l++}return i(t),f}function Ga(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(At(t))return Nt(t);if(Wr(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${$e(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let n=Ha(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Ha(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function Ya(e){return~-encodeURI(e).split(/%..|./).length}function Wa(e){return Ya(JSON.stringify(e))}function $a(){let e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function R(e,t=[]){return[e,t]}function Hn(e,t){let[n,r]=e;return[n,[...r,t]]}function it(e,t){let n=e[1];for(let r of n){let o=r[0].type;if(t(r,o))return!0}return!1}function Yn(e,t){return it(e,(n,r)=>t.includes(r))}function Gn(e){let t=te(h);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function at(e){let[t,n]=e,r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[Gn(r),s]:r.push(typeof s=="string"?Gn(s):s)}for(let s of n){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(G(a))}o(c)}}return typeof r=="string"?r:Ua(r)}function Ua(e){let t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function Gn(e){let t=typeof e.data=="string"?Fn(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Oo={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 ka(e){return e in Oo}function Ft(e){return ka(e)?Oo[e]:e}function De(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Hn(e,t,n,r){let o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:O(r)},...o&&{trace:o}}}function Fa(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function Lo(e,t,n,r){let o=De(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:O(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return N(s,[i])}function Mo(e,t,n,r){let o=De(n),s=e.type&&e.type!=="replay_event"?e.type:"event";Fa(e,n?.sdk);let i=Hn(e,o,r,t);return delete e.sdkProcessingMetadata,N(i,[[{type:s},e]])}function Po(e){return e.getOptions().traceLifecycle==="stream"}var Uo="__SENTRY_SUPPRESS_TRACING__";function wt(e,t){let n=ko();return n.withActiveSpan?n.withActiveSpan(e,t):de(r=>(Ke(r,e||void 0),t(r)))}function Fe(e){let t=ko();return t.suppressTracing?t.suppressTracing(e):de(n=>{n.setSDKProcessingMetadata({[Uo]:!0});let r=e();return n.setSDKProcessingMetadata({[Uo]:void 0}),r})}function ko(){let e=P();return se(e)}function Fo(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;wa(e,t),r&&Ha(e,r),Ya(e,n),Ba(e,o),Ga(e,s)}function Do(e,t){let{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:l,eventProcessors:f,attachments:d,propagationContext:m,transactionName:h,span:S}=t;at(e,"extra",n),at(e,"tags",r),at(e,"attributes",o),at(e,"user",s),at(e,"contexts",i),e.sdkProcessingMetadata=oe(e.sdkProcessingMetadata,c,2),a&&(e.level=a),h&&(e.transactionName=h),S&&(e.span=S),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...m}}function at(e,t,n){e[t]=oe(e[t],n,1)}function Bt(e,t){let n=Ot().getScopeData();return e&&Do(n,e.getScopeData()),t&&Do(n,t.getScopeData()),n}function wa(e,t){let{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...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 Ba(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Ga(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Ha(e,t){e.contexts={trace:Ut(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Ue(t),...e.sdkProcessingMetadata};let n=me(t),r=Me(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Ya(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 wo(e,t){let n=Pn(e),r=nt(e),o=Pn(r),{isolationScope:s,scope:i}=Le(e),a=Bt(s,i);Wa(n,o,t,a);let c=e.kind;za(n,c),n.is_segment&&t.emit("processSegmentSpan",n),t.emit("processSpan",n);let{beforeSendSpan:u}=t.getOptions(),l=u&&ke(u)?Va(n,u):n,f=l.attributes?.[w];return f&&V(l,{"sentry.span.source":f}),{...Eo(l),_segmentSpan:r}}function Wa(e,t,n,r){let o=n.getSdkMetadata(),{release:s,environment:i,sendDefaultPii:a}=n.getOptions();V(e,{[Kr]:s,[qr]:i,[Qr]:t.name,[eo]:t.span_id,[to]:o?.sdk?.name,[no]:o?.sdk?.version,...a?{[ro]:r.user?.id,[oo]:r.user?.email,[so]:r.user?.ip_address,[io]:r.user?.username}:{},...r.attributes})}function Va(e,t){let n=t(e);return n||(ot(),e)}function V(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}var $a=1,ja=2;function za(e,t){let n=e.attributes;if(!n)return;let r=n["http.request.method"]||n["http.method"];if(r){Za(e,n,t,r);return}let o=n["db.system.name"]||n["db.system"],s=typeof n[B]=="string"&&`${n[B]}`.startsWith("cache.");if(o&&!s){Ja(e,n);return}if(n["rpc.service"]){V(e,{[B]:"rpc"});return}if(n["messaging.system"]){V(e,{[B]:"message"});return}let i=n["faas.trigger"];i&&V(e,{[B]:`${i}`})}function Za(e,t,n,r){let o=["http"];n===ja?o.push("client"):n===$a&&o.push("server"),t["sentry.http.prefetch"]&&o.push("prefetch"),V(e,{[B]:o.join(".")});let s=t[Lt];if(typeof s=="string"){e.name=s;return}if(t[w]==="custom")return;let i=t["http.route"];typeof i=="string"?(e.name=`${r} ${i}`,V(e,{[w]:"route"})):V(e,{[w]:"url"})}function Ja(e,t){V(e,{[B]:"db"});let n=t[Lt];if(typeof n=="string"){e.name=n;return}if(t[w]==="custom")return;let r=t["db.statement"];r&&(e.name=`${r}`,V(e,{[w]:"task"}))}var Yn=0,Bo=1,Go=2;function Q(e){return new Gt(t=>{t(e)})}function we(e){return new Gt((t,n)=>{n(e)})}var Gt=class e{constructor(t){this._state=Yn,this._handlers=[],this._runExecutor(t)}then(t,n){return new e((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===Yn)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Bo&&n[1](this._value),this._state===Go&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(s,i)=>{if(this._state===Yn){if(X(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(Bo,s)},o=s=>{n(Go,s)};try{t(r,o)}catch(s){o(s)}}};function Ho(e,t,n,r=0){try{let o=Wn(t,n,e,r);return X(o)?o:Q(o)}catch(o){return we(o)}}function Wn(e,t,n,r){let o=n[r];if(!e||!o)return e;let s=o({...e},t);return g&&s===null&&p.log(`Event processor "${o.id||"?"}" dropped event`),X(s)?s.then(i=>Wn(i,t,n,r+1)):Wn(s,t,n,r+1)}var ge,Yo,Wo,ie;function Vo(e){let t=_._sentryDebugIds,n=_._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(ie&&r.length===Yo&&o.length===Wo)return ie;Yo=r.length,Wo=o.length,ie={},ge||(ge={});let s=(i,a)=>{for(let c of i){let u=a[c],l=ge?.[c];if(l&&ie&&u)ie[l[0]]=u,ge&&(ge[c]=[l[0],u]);else if(u){let f=e(c);for(let d=f.length-1;d>=0;d--){let h=f[d]?.filename;if(h&&ie&&ge){ie[h]=u,ge[c]=[h,u];break}}}}};return t&&s(r,t),n&&s(o,n),ie}function $o(e,t,n,r,o,s){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||I(),timestamp:t.timestamp||q()},u=n.integrations||e.integrations.map(x=>x.name);Xa(c,e),Qa(c,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&Ka(c,e.stackParser);let l=tc(r,n.captureContext);n.mechanism&&Ce(c,n.mechanism);let f=o?o.getEventProcessors():[],d=Bt(s,l),m=[...n.attachments||[],...d.attachments];m.length&&(n.attachments=m),Fo(c,d);let h=[...f,...d.eventProcessors];return(n.data&&n.data.__sentry__===!0?Q(c):Ho(h,c,n)).then(x=>(x&&qa(x),typeof i=="number"&&i>0?ec(x,i,a):x))}function Xa(e,t){let{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||Pe,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let i=e.request;i?.url&&s&&(i.url=Re(i.url,s)),s&&e.exception?.values?.forEach(a=>{a.value&&(a.value=Re(a.value,s))})}function Ka(e,t){let n=Vo(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function qa(e){let t={};if(e.exception?.values?.forEach(r=>{r.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 n=e.debug_meta.images;Object.entries(t).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function Qa(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function ec(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:G(o.data,t,n)}}))},...e.user&&{user:G(e.user,t,n)},...e.contexts&&{contexts:G(e.contexts,t,n)},...e.extra&&{extra:G(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=G(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:G(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=G(e.contexts.flags,3,n)),r}function tc(e,t){if(!t)return e;let n=e?e.clone():new v;return n.update(t),n}function jo(e){if(e)return nc(e)?{captureContext:e}:oc(e)?{captureContext:e}:e}function nc(e){return e instanceof v||typeof e=="function"}var rc=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function oc(e){return Object.keys(e).some(t=>rc.includes(t))}function ae(e,t){return C().captureException(e,jo(t))}function Ht(e,t){let n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return C().captureMessage(e,n,r)}function Yt(e){k().setTags(e)}function Wt(e){k().setUser(e)}var sc="7";function ic(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function ac(e){return`${ic(e)}${e.projectId}/envelope/`}function cc(e,t){let n={sentry_version:sc};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Zo(e,t,n){return t||`${ac(e)}?${cc(e,n)}`}var Vn=[];function uc(e){let t={};return e.forEach(n=>{let{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function $n(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){let o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return uc(r)}function Jo(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&zn(e,r,n)}),n}function jn(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function zn(e,t,n){if(n[t.name]){g&&p.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Vn.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Vn.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){let r=t.processEvent.bind(t),o=Object.assign((s,i)=>r(s,i,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{let o=t[r];typeof o=="function"&&e.on(r,s=>o.call(t,s,e))}),g&&p.log(`Integration installed: ${t.name}`)}function Xo(e,t){return t?de(t,()=>{let n=rt(),r=n?Ut(n):et(t);return[n?Ue(n):Dt(e,t),r]}):[void 0,void 0]}function pc(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Ko(e,t,n,r){let o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=O(r)),N(o,[pc(e)])}function Be(e,t){let n=t??fc(e)??[];if(n.length===0)return;let r=e.getOptions(),o=Ko(n,r._metadata,r.tunnel,e.getDsn());qo().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function fc(e){return qo().get(e)}function qo(){return D("clientToLogBufferMap",()=>new WeakMap)}function lc(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function Qo(e,t,n,r){let o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=O(r)),N(o,[lc(e)])}function es(e,t){let n=t??dc(e)??[];if(n.length===0)return;let r=e.getOptions(),o=Qo(n,r._metadata,r.tunnel,e.getDsn());ts().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function dc(e){return ts().get(e)}function ts(){return D("clientToMetricBufferMap",()=>new WeakMap)}function Ge(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var ct=Symbol.for("SentryBufferFullError");function He(e=100){let t=new Set;function n(){return t.size<e}function r(i){t.delete(i)}function o(i){if(!n())return we(ct);let a=i();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!t.size)return Q(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;let c=[a,new Promise(u=>Ge(setTimeout(()=>u(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:s}}var mc=60*1e3;function gc(e,t=Ne()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?mc:r-t}function _c(e,t){return e[t]||e.all||0}function ns(e,t,n=Ne()){return _c(e,t)>n}function rs(e,{statusCode:t,headers:n},r=Ne()){let o={...e},s=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(s)for(let a of s.trim().split(",")){let[c,u,,,l]=a.split(":",5),f=parseInt(c,10),d=(isNaN(f)?60:f)*1e3;if(!u)o.all=r+d;else for(let m of u.split(";"))m==="metric_bucket"?(!l||l.split(";").includes("custom"))&&(o[m]=r+d):o[m]=r+d}else i?o.all=r+gc(i,r):t===429&&(o.all=r+60*1e3);return o}var ut=64;function pt(e,t,n=He(e.bufferSize||ut)){let r={},o=i=>n.drain(i);function s(i){let a=[];if(st(i,(f,d)=>{let m=Ft(d);ns(r,m)?e.recordDroppedEvent("ratelimit_backoff",m):a.push(f)}),a.length===0)return Promise.resolve({});let c=N(i[0],a),u=f=>{if(Bn(c,["client_report"])){g&&p.warn(`Dropping client report. Will not send outcomes (reason: ${f}).`);return}st(c,(d,m)=>{e.recordDroppedEvent(f,Ft(m))})},l=()=>t({body:it(c)}).then(f=>f.statusCode===413?(g&&p.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),f):(g&&f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&p.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),r=rs(r,f),f),f=>{throw u("network_error"),g&&p.error("Encountered error running transport request:",f),f});return n.add(l).then(f=>f,f=>{if(f===ct)return g&&p.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw f})}return{send:s,flush:o}}function os(e,t,n){let r=[{type:"client_report"},{timestamp:n||q(),discarded_events:e}];return N(t?{dsn:t}:{},[r])}function Vt(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function ss(e){let{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=e.contexts?.trace??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i?.[vn],exclusive_time:i?.[On],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&&{[vn]:e.profile_id},...e.exclusive_time&&{[On]:e.exclusive_time}}}},measurements:e.measurements}}var as="Not capturing exception because it's already been captured.",cs="Discarded session because of missing or non-string release",ms=Symbol.for("SentryInternalError"),gs=Symbol.for("SentryDoNotSendEventError"),hc=5e3;function $t(e){return{message:e,[ms]:!0}}function Zn(e){return{message:e,[gs]:!0}}function us(e){return!!e&&typeof e=="object"&&ms in e}function ps(e){return!!e&&typeof e=="object"&&gs in e}function fs(e,t,n,r,o){let s=0,i,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,c=>{s+=r(c),s>=8e5?o(e):a||(a=!0,i=Ge(setTimeout(()=>{o(e)},hc)))}),e.on("flush",()=>{o(e)})}var jt=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=He(t.transportOptions?.bufferSize??ut),t.dsn?this._dsn=lo(t.dsn):g&&p.warn("No DSN provided, client will not send events."),this._dsn){let r=Zo(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:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&fs(this,"afterCaptureLog","flushLogs",Ic,Be),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&fs(this,"afterCaptureMetric","flushMetrics",Tc,es)}captureException(t,n,r){let o=I();if(Ct(t))return g&&p.log(as),o;let s={event_id:o,...n};return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(t,n,r,o){let s={event_id:I(),...r},i=je(t)?t:String(t),a=Ie(t),c=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>c.then(u=>this._captureEvent(u,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){let o=I();if(n?.originalException&&Ct(n.originalException))return g&&p.log(as),o;let s={event_id:o,...n},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,u=ls(t.type);return this._process(()=>this._captureEvent(t,s,a||r,c),u),s.event_id}captureSession(t){this.sendSession(t),Ze(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){let n=this._transport;if(!n)return!0;this.emit("flush");let r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){Be(this);let n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){let n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),zn(this,t,this._integrations),n||jn(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=Mo(t,this._dsn,this._options._metadata,this._options.tunnel);for(let o of n.attachments||[])r=wn(r,Gn(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){let{release:n,environment:r=Pe}=this._options;if("aggregates"in t){let s=t.attrs||{};if(!s.release&&!n){g&&p.warn(cs);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){g&&p.warn(cs);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=Lo(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){let o=`${t}:${n}`;g&&p.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){let r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){let r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return g&&p.error("Error while sending envelope:",n),{}}return g&&p.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=Jo(this,t),jn(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1,s=n.exception?.values;if(s){o=!0,r=!1;for(let c of s)if(c.mechanism?.handled===!1){r=!0;break}}let i=t.status==="ok";(i&&t.errors===0||i&&r)&&(Ze(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){let s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i?.length&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),$o(s,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...et(r)},...a.contexts};let c=Dt(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=C(),o=k()){return g&&Jn(t)&&p.log(`Captured error event \`${Vt(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{g&&(ps(s)?p.log(s.message):us(s)?p.warn(s.message):p.warn(s))})}_processEvent(t,n,r,o){let s=this.getOptions(),{sampleRate:i}=s,a=_s(t),c=Jn(t),l=`before send for type \`${t.type||"error"}\``,f=typeof i>"u"?void 0:tt(i);if(c&&typeof f=="number"&&U()>f)return this.recordDroppedEvent("sample_rate","error"),we(Zn(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));let d=ls(t.type);return this._prepareEvent(t,n,r,o).then(m=>{if(m===null)throw this.recordDroppedEvent("event_processor",d),Zn("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return m;let S=Ec(this,s,m,n);return Sc(S,l)}).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 Zn(`${l} returned \`null\`, will not send event.`)}let h=r.getSession()||o.getSession();if(c&&h&&this._updateSessionFromEvent(h,m),a){let E=m.sdkProcessingMetadata?.spanCountBeforeProcessing||0,x=m.spans?m.spans.length:0,A=E-x;A>0&&this.recordDroppedEvent("before_send","span",A)}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,n),m}).then(null,m=>{throw ps(m)||us(m)?m:(this.captureException(m,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:m}),$t(`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,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===ct&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{let[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){g&&p.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){g&&p.log("No outcomes to send");return}if(!this._dsn){g&&p.log("No dsn provided, will not send outcomes");return}g&&p.log("Sending outcomes:",t);let n=os(t,this._options.tunnel&&O(this._dsn));this.sendEnvelope(n)}};function ls(e){return e==="replay_event"?"replay":e||"error"}function Sc(e,t){let n=`${t} must return \`null\` or a valid event.`;if(X(e))return e.then(r=>{if(!ne(r)&&r!==null)throw $t(n);return r},r=>{throw $t(`${t} rejected with ${r}`)});if(!ne(e)&&e!==null)throw $t(n);return e}function Ec(e,t,n,r){let{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!ke(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(Jn(c)&&o)return o(c,r);if(_s(c)){if(a||i){let u=ss(c);if(i?.length&&Un({description:u.description,op:u.op,attributes:u.data},i))return null;if(a){let l=a(u);l?c=oe(n,is(l)):ot()}if(c.spans){let l=[],f=c.spans;for(let m of f){if(i?.length&&Un({description:m.description,op:m.op,attributes:m.data},i)){Ro(f,m);continue}if(a){let h=a(m);h?l.push(h):(ot(),l.push(m))}else l.push(m)}let d=c.spans.length-l.length;d&&e.recordDroppedEvent("before_send","span",d),c.spans=l}}if(s){if(c.spans){let u=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return s(c,r)}}return c}function Jn(e){return e.type===void 0}function _s(e){return e.type==="transaction"}function Tc(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+hs(e.attributes)}function Ic(e){let t=0;return e.message&&(t+=e.message.length*2),t+hs(e.attributes)}function hs(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*ds(n[0]):Ie(n)?t+=ds(n):t+=100}),t}function ds(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Ss(e,t,n,r,o){let s={sent_at:new Date().toISOString()};n?.sdk&&(s.sdk={name:n.sdk.name,version:n.sdk.version}),r&&o&&(s.dsn=O(o)),t&&(s.trace=t);let i=yc(e);return N(s,[i])}function yc(e){return[{type:"check_in"},e]}function Es(e){let t=e._metadata?.sdk,n=t?.name&&t?.version?`${t?.name}/${t?.version}`:void 0;e.transportOptions={...e.transportOptions,headers:{...n&&{"user-agent":n},...e.transportOptions?.headers}}}function Ts(e,t){return e(t.stack||"",1)}function bc(e){return $e(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function xc(e){return bc(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function Xn(e,t){let n={type:t.name||t.constructor.name,value:xc(t)},r=Ts(e,t);return r.length&&(n.stacktrace={frames:r}),n}function Nc(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}function Rc(e){if("name"in e&&typeof e.name=="string"){let r=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(r+=` with message '${e.message}'`),r}else if("message"in e&&typeof e.message=="string")return e.message;let t=gn(e);if(Lr(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let n=Ac(e);return`${n&&n!=="Object"?`'${n}'`:"Object"} captured as exception with keys: ${t}`}function Ac(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Cc(e,t,n,r){if($e(n))return[n,void 0];if(t.synthetic=!0,ne(n)){let s=e?.getOptions().normalizeDepth,i={__serialized__:Dn(n,s)},a=Nc(n);if(a)return[a,i];let c=Rc(n),u=r?.syntheticException||new Error(c);return u.message=c,[u,i]}let o=r?.syntheticException||new Error(n);return o.message=`${n}`,[o,void 0]}function Is(e,t,n,r){let s=r?.data&&r.data.mechanism||{handled:!0,type:"generic"},[i,a]=Cc(e,s,n,r),c={exception:{values:[Xn(t,i)]}};return a&&(c.extra=a),Tn(c,void 0,void 0),Ce(c,s),{...c,event_id:r?.event_id}}function ys(e,t,n="info",r,o){let s={event_id:r?.event_id,level:n};if(o&&r?.syntheticException){let i=Ts(e,r.syntheticException);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]},Ce(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 ft=class e extends jt{__init(){this._disposeCallbacks=[]}constructor(t){bo(),Es(t),super(t),e.prototype.__init.call(this),this._setUpMetricsProcessing()}eventFromException(t,n){let r=Is(this,this._options.stackParser,t,n);return r.level="error",Q(r)}eventFromMessage(t,n="info",r){return Q(ys(this._options.stackParser,t,n,r,this._options.attachStacktrace))}captureException(t,n,r){return bs(n),super.captureException(t,n,r)}captureEvent(t,n,r){return!t.type&&t.exception?.values&&t.exception.values.length>0&&bs(n),super.captureEvent(t,n,r)}captureCheckIn(t,n,r){let o="checkInId"in t&&t.checkInId?t.checkInId:I();if(!this._isEnabled())return g&&p.warn("SDK not enabled, will not capture check-in."),o;let s=this.getOptions(),{release:i,environment:a,tunnel:c}=s,u={check_in_id:o,monitor_slug:t.monitorSlug,status:t.status,release:i,environment:a};"duration"in t&&(u.duration=t.duration),n&&(u.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone,failure_issue_threshold:n.failureIssueThreshold,recovery_threshold:n.recoveryThreshold});let[l,f]=Xo(this,r);f&&(u.contexts={trace:f});let d=Ss(u,l,this.getSdkMetadata(),c,this.getDsn());return g&&p.log("Sending checkin:",t.monitorSlug,t.status),this.sendEnvelope(d),o}registerCleanup(t){this._disposeCallbacks.push(t)}dispose(){g&&p.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=He(ut)}_prepareEvent(t,n,r,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,n,r,o)}_setUpMetricsProcessing(){this.on("processMetric",t=>{this._options.serverName&&(t.attributes={"server.address":this._options.serverName,...t.attributes})})}};function bs(e){let t=k().getScopeData().sdkProcessingMetadata.requestSession;if(t){let n=e?.mechanism?.handled??!0;n&&t.status!=="crashed"?t.status="errored":n||(t.status="crashed")}}var vc=new Set(["false","f","n","no","off","0"]),Oc=new Set(["true","t","y","yes","on","1"]);function _e(e,t){let n=String(e).toLowerCase();return vc.has(n)?!1:Oc.has(n)?!0:t?.strict?null:!!e}function lt(e,t,n=[t],r="npm"){let o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(s=>({name:`${r}:@sentry/${s}`,version:H})),o.version=H)}var Lc=100;function Kn(e,t){let n=T(),r=k();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:s=Lc}=n.getOptions();if(s<=0)return;let a={timestamp:q(),...e},c=o?b(()=>o(a,t)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),r.addBreadcrumb(c,s))}var xs,Mc="FunctionToString",Ns=new WeakMap,Pc=(()=>({name:Mc,setupOnce(){xs=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=mn(this),n=Ns.has(T())&&t!==void 0?t:this;return xs.apply(n,e)}}catch{}},setup(e){Ns.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$/],kc="EventFilters",Ye=(e={})=>{let t;return{name:kc,setup(n){let r=n.getOptions();t=Rs(e,r)},processEvent(n,r,o){if(!t){let s=o.getOptions();t=Rs(e,s)}return Fc(n,t)?null:n}}},Dc=((e={})=>({...Ye(e),name:"InboundFilters"}));function Rs(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 Fc(e,t){if(e.type){if(e.type==="transaction"&&Bc(e,t.ignoreTransactions))return g&&p.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
9
|
-
Event: ${re(e)}`),!0}else{if(
|
|
10
|
-
Event: ${re(e)}`),!0;if(
|
|
11
|
-
Event: ${re(e)}`),!0;if(
|
|
7
|
+
`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(H(a))}o(c)}}return typeof r=="string"?r:Va(r)}function Va(e){let t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function Wn(e){let t=typeof e.data=="string"?Gn(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var wo={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 ja(e){return e in wo}function Gt(e){return ja(e)?wo[e]:e}function De(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function $n(e,t,n,r){let o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:M(r)},...o&&{trace:o}}}function Za(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function Fo(e,t,n,r){let o=De(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:M(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return R(s,[i])}function Bo(e,t,n,r){let o=De(n),s=e.type&&e.type!=="replay_event"?e.type:"event";Za(e,n?.sdk);let i=$n(e,o,r,t);return delete e.sdkProcessingMetadata,R(i,[[{type:s},e]])}function Go(e){return e.getOptions().traceLifecycle==="stream"}var ct="__SENTRY_SUPPRESS_TRACING__";function Ht(e,t){let n=Ho();return n.withActiveSpan?n.withActiveSpan(e,t):me(r=>(qe(r,e||void 0),t(r)))}function we(e){let t=Ho();return t.suppressTracing?t.suppressTracing(e):me(n=>{n.setSDKProcessingMetadata({[ct]:!0});let r=e();return n.setSDKProcessingMetadata({[ct]:void 0}),r})}function Ho(){let e=P();return se(e)}function Wo(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;Ja(e,t),r&&qa(e,r),Qa(e,n),Xa(e,o),Ka(e,s)}function Yo(e,t){let{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:p,eventProcessors:f,attachments:l,propagationContext:m,transactionName:_,span:S}=t;ut(e,"extra",n),ut(e,"tags",r),ut(e,"attributes",o),ut(e,"user",s),ut(e,"contexts",i),e.sdkProcessingMetadata=oe(e.sdkProcessingMetadata,c,2),a&&(e.level=a),_&&(e.transactionName=_),S&&(e.span=S),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),p.length&&(e.fingerprint=[...e.fingerprint,...p]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),l.length&&(e.attachments=[...e.attachments,...l]),e.propagationContext={...e.propagationContext,...m}}function ut(e,t,n){e[t]=oe(e[t],n,1)}function Yt(e,t){let n=Mt().getScopeData();return e&&Yo(n,e.getScopeData()),t&&Yo(n,t.getScopeData()),n}function Ja(e,t){let{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...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 Xa(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Ka(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function qa(e,t){e.contexts={trace:wt(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:ke(t),...e.sdkProcessingMetadata};let n=ge(t),r=Me(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Qa(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 $o(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Vn(e){return e.split(/[?#]/,1)[0]}function Vo(e){let{protocol:t,host:n,path:r}=e,o=n?.replace(/^.*@/,"[filtered]:[filtered]@").replace(/(:80)$/,"").replace(/(:443)$/,"")||"";return`${t?`${t}://`:""}${o}${r}`}function zn(e,t){let n=Dn(e),r=rt(e),o=Dn(r),{isolationScope:s,scope:i}=Le(e),a=Yt(s,i);ec(n,o,t,a);let c=e.kind;nc(n,c),n.is_segment&&t.emit("processSegmentSpan",n),t.emit("processSpan",n);let{beforeSendSpan:u}=t.getOptions(),p=u&&Pe(u)?tc(n,u):n,f=p.attributes?.[B];return f&&I(p,{"sentry.span.source":f}),{...Ro(p),_segmentSpan:r}}function I(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}function ec(e,t,n,r){let o=n.getSdkMetadata(),{release:s,environment:i,sendDefaultPii:a}=n.getOptions();I(e,{[so]:s,[io]:i,[ao]:t.name,[co]:t.span_id,[uo]:o?.sdk?.name,[po]:o?.sdk?.version,...a?{[fo]:r.user?.id,[lo]:r.user?.email,[Ut]:r.user?.ip_address,[mo]:r.user?.username}:{},...r.attributes})}function tc(e,t){let n=t(e);return n||(st(),e)}var jn=1,jo=2;function nc(e,t){let n=e.attributes;if(!n)return;let r=n["http.request.method"]||n["http.method"];if(r){rc(e,n,t,r);return}let o=n["db.system.name"]||n["db.system"],s=typeof n[G]=="string"&&`${n[G]}`.startsWith("cache.");if(o&&!s){sc(e,n);return}if(n["rpc.service"]){I(e,{[G]:"rpc"});return}if(n["messaging.system"]){I(e,{[G]:"message"});return}let i=n["faas.trigger"];i&&I(e,{[G]:`${i}`})}function rc(e,t,n,r){let o=["http"];n===jo?o.push("client"):n===jn&&o.push("server"),t["sentry.http.prefetch"]&&o.push("prefetch"),I(e,{[G]:o.join(".")});let s=t[kt];if(typeof s=="string"){e.name=s;return}if(t[B]==="custom")return;let i=t["http.route"];if(typeof i=="string")e.name=`${r} ${i}`,I(e,{[B]:"route"});else{if(n===jo||n===jn){let a=oc(t,n);a&&(e.name=`${r} ${a}`)}I(e,{[B]:"url"})}}function oc(e,t){let n=e["http.url"]||e["url.full"],r=e["http.target"],o=typeof n=="string"?$o(n):void 0,s=o?Vo(o):void 0;if(t===jn&&typeof r=="string")return Vn(r);if(s)return s;if(typeof r=="string")return Vn(r)}function sc(e,t){I(e,{[G]:"db"});let n=t[kt];if(typeof n=="string"){e.name=n;return}if(t[B]==="custom")return;let r=t["db.statement"];r&&(e.name=`${r}`,I(e,{[B]:"task"}))}var Zn=0,zo=1,Zo=2;function Q(e){return new Wt(t=>{t(e)})}function Fe(e){return new Wt((t,n)=>{n(e)})}var Wt=class e{constructor(t){this._state=Zn,this._handlers=[],this._runExecutor(t)}then(t,n){return new e((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===Zn)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===zo&&n[1](this._value),this._state===Zo&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(s,i)=>{if(this._state===Zn){if(X(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(zo,s)},o=s=>{n(Zo,s)};try{t(r,o)}catch(s){o(s)}}};function Jo(e,t,n,r=0){try{let o=Jn(t,n,e,r);return X(o)?o:Q(o)}catch(o){return Fe(o)}}function Jn(e,t,n,r){let o=n[r];if(!e||!o)return e;let s=o({...e},t);return g&&s===null&&d.log(`Event processor "${o.id||"?"}" dropped event`),X(s)?s.then(i=>Jn(i,t,n,r+1)):Jn(s,t,n,r+1)}var _e,Xo,Ko,ie;function qo(e){let t=h._sentryDebugIds,n=h._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(ie&&r.length===Xo&&o.length===Ko)return ie;Xo=r.length,Ko=o.length,ie={},_e||(_e={});let s=(i,a)=>{for(let c of i){let u=a[c],p=_e?.[c];if(p&&ie&&u)ie[p[0]]=u,_e&&(_e[c]=[p[0],u]);else if(u){let f=e(c);for(let l=f.length-1;l>=0;l--){let _=f[l]?.filename;if(_&&ie&&_e){ie[_]=u,_e[c]=[_,u];break}}}}};return t&&s(r,t),n&&s(o,n),ie}function Qo(e,t,n,r,o,s){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||b(),timestamp:t.timestamp||q()},u=n.integrations||e.integrations.map(N=>N.name);ic(c,e),uc(c,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&ac(c,e.stackParser);let p=fc(r,n.captureContext);n.mechanism&&Ce(c,n.mechanism);let f=o?o.getEventProcessors():[],l=Yt(s,p),m=[...n.attachments||[],...l.attachments];m.length&&(n.attachments=m),Wo(c,l);let _=[...f,...l.eventProcessors];return(n.data&&n.data.__sentry__===!0?Q(c):Jo(_,c,n)).then(N=>(N&&cc(N),typeof i=="number"&&i>0?pc(N,i,a):N))}function ic(e,t){let{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||Ue,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let i=e.request;i?.url&&s&&(i.url=Re(i.url,s)),s&&e.exception?.values?.forEach(a=>{a.value&&(a.value=Re(a.value,s))})}function ac(e,t){let n=qo(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function cc(e){let t={};if(e.exception?.values?.forEach(r=>{r.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 n=e.debug_meta.images;Object.entries(t).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function uc(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function pc(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:H(o.data,t,n)}}))},...e.user&&{user:H(e.user,t,n)},...e.contexts&&{contexts:H(e.contexts,t,n)},...e.extra&&{extra:H(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=H(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:H(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=H(e.contexts.flags,3,n)),r}function fc(e,t){if(!t)return e;let n=e?e.clone():new O;return n.update(t),n}function es(e){if(e)return dc(e)?{captureContext:e}:mc(e)?{captureContext:e}:e}function dc(e){return e instanceof O||typeof e=="function"}var lc=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function mc(e){return Object.keys(e).some(t=>lc.includes(t))}function ae(e,t){return v().captureException(e,es(t))}function $t(e,t){let n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return v().captureMessage(e,n,r)}function Vt(e){L().setTags(e)}function jt(e){L().setUser(e)}var gc="7";function _c(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function hc(e){return`${_c(e)}${e.projectId}/envelope/`}function Sc(e,t){let n={sentry_version:gc};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function ns(e,t,n){return t||`${hc(e)}?${Sc(e,n)}`}var Xn=[];function Ec(e){let t={};return e.forEach(n=>{let{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function Kn(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){let o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return Ec(r)}function rs(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Qn(e,r,n)}),n}function qn(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Qn(e,t,n){if(n[t.name]){g&&d.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Xn.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Xn.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){let r=t.processEvent.bind(t),o=Object.assign((s,i)=>r(s,i,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{let o=t[r];typeof o=="function"&&e.on(r,s=>o.call(t,s,e))}),g&&d.log(`Integration installed: ${t.name}`)}function os(e,t){return t?me(t,()=>{let n=ot(),r=n?wt(n):tt(t);return[n?ke(n):Bt(e,t),r]}):[void 0,void 0]}function ss(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function is(){return!ss()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Be(){return typeof window<"u"&&(!is()||Tc())}function Tc(){return h.process?.type==="renderer"}function Ic(e,t){let n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...Be()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function as(e,t,n,r,o){let s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=M(r)),R(s,[Ic(e,o)])}function Ge(e,t){let n=t??yc(e)??[];if(n.length===0)return;let r=e.getOptions(),o=as(n,r._metadata,r.tunnel,e.getDsn(),r.sendDefaultPii);cs().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function yc(e){return cs().get(e)}function cs(){return w("clientToLogBufferMap",()=>new WeakMap)}function bc(e,t){let n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...Be()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function us(e,t,n,r,o){let s={};return t?.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=M(r)),R(s,[bc(e,o)])}function ps(e,t){let n=t??xc(e)??[];if(n.length===0)return;let r=e.getOptions(),o=us(n,r._metadata,r.tunnel,e.getDsn(),r.sendDefaultPii);fs().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function xc(e){return fs().get(e)}function fs(){return w("clientToMetricBufferMap",()=>new WeakMap)}function He(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var pt=Symbol.for("SentryBufferFullError");function Ye(e=100){let t=new Set;function n(){return t.size<e}function r(i){t.delete(i)}function o(i){if(!n())return Fe(pt);let a=i();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!t.size)return Q(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;let c=[a,new Promise(u=>He(setTimeout(()=>u(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:s}}var Nc=60*1e3;function Rc(e,t=Ne()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?Nc:r-t}function Ac(e,t){return e[t]||e.all||0}function ds(e,t,n=Ne()){return Ac(e,t)>n}function ls(e,{statusCode:t,headers:n},r=Ne()){let o={...e},s=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(s)for(let a of s.trim().split(",")){let[c,u,,,p]=a.split(":",5),f=parseInt(c,10),l=(isNaN(f)?60:f)*1e3;if(!u)o.all=r+l;else for(let m of u.split(";"))m==="metric_bucket"?(!p||p.split(";").includes("custom"))&&(o[m]=r+l):o[m]=r+l}else i?o.all=r+Rc(i,r):t===429&&(o.all=r+60*1e3);return o}var ft=64;function dt(e,t,n=Ye(e.bufferSize||ft)){let r={},o=i=>n.drain(i);function s(i){let a=[];if(it(i,(f,l)=>{let m=Gt(l);ds(r,m)?e.recordDroppedEvent("ratelimit_backoff",m):a.push(f)}),a.length===0)return Promise.resolve({});let c=R(i[0],a),u=f=>{if(Yn(c,["client_report"])){g&&d.warn(`Dropping client report. Will not send outcomes (reason: ${f}).`);return}it(c,(l,m)=>{e.recordDroppedEvent(f,Gt(m))})},p=()=>t({body:at(c)}).then(f=>f.statusCode===413?(g&&d.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),f):(g&&f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&d.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),r=ls(r,f),f),f=>{throw u("network_error"),g&&d.error("Encountered error running transport request:",f),f});return n.add(p).then(f=>f,f=>{if(f===pt)return g&&d.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw f})}return{send:s,flush:o}}function ms(e,t,n){let r=[{type:"client_report"},{timestamp:n||q(),discarded_events:e}];return R(t?{dsn:t}:{},[r])}function zt(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function gs(e){let{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=e.contexts?.trace??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i?.[Mn],exclusive_time:i?.[Un],measurements:e.measurements,is_segment:!0}}function _s(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&&{[Mn]:e.profile_id},...e.exclusive_time&&{[Un]:e.exclusive_time}}}},measurements:e.measurements}}var hs="Not capturing exception because it's already been captured.",Ss="Discarded session because of missing or non-string release",xs=Symbol.for("SentryInternalError"),Ns=Symbol.for("SentryDoNotSendEventError"),Cc=5e3;function Zt(e){return{message:e,[xs]:!0}}function er(e){return{message:e,[Ns]:!0}}function Es(e){return!!e&&typeof e=="object"&&xs in e}function Ts(e){return!!e&&typeof e=="object"&&Ns in e}function Is(e,t,n,r,o){let s=0,i,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,c=>{s+=r(c),s>=8e5?o(e):a||(a=!0,i=He(setTimeout(()=>{o(e)},Cc)))}),e.on("flush",()=>{o(e)})}var Jt=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Ye(t.transportOptions?.bufferSize??ft),t.dsn?this._dsn=To(t.dsn):g&&d.warn("No DSN provided, client will not send events."),this._dsn){let r=ns(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:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&Is(this,"afterCaptureLog","flushLogs",Mc,Ge),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&Is(this,"afterCaptureMetric","flushMetrics",Lc,ps)}captureException(t,n,r){let o=b();if(Ot(t))return g&&d.log(hs),o;let s={event_id:o,...n};return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(t,n,r,o){let s={event_id:b(),...r},i=ze(t)?t:String(t),a=Ie(t),c=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>c.then(u=>this._captureEvent(u,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){let o=b();if(n?.originalException&&Ot(n.originalException))return g&&d.log(hs),o;let s={event_id:o,...n},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,u=ys(t.type);return this._process(()=>this._captureEvent(t,s,a||r,c),u),s.event_id}captureSession(t){this.sendSession(t),Je(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){let n=this._transport;if(this.emit("flush"),!n)return!0;let r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){Ge(this);let n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){let n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Qn(this,t,this._integrations),n||qn(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=Bo(t,this._dsn,this._options._metadata,this._options.tunnel);for(let o of n.attachments||[])r=Hn(r,Wn(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){let{release:n,environment:r=Ue}=this._options;if("aggregates"in t){let s=t.attrs||{};if(!s.release&&!n){g&&d.warn(Ss);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){g&&d.warn(Ss);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=Fo(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){let o=`${t}:${n}`;g&&d.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){let r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){let r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return g&&d.error("Error while sending envelope:",n),{}}return g&&d.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=rs(this,t),qn(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1,s=n.exception?.values;if(s){o=!0,r=!1;for(let c of s)if(c.mechanism?.handled===!1){r=!0;break}}let i=t.status==="ok";(i&&t.errors===0||i&&r)&&(Je(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,o){let s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i?.length&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),Qo(s,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...tt(r)},...a.contexts};let c=Bt(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=v(),o=L()){return g&&tr(t)&&d.log(`Captured error event \`${zt(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{g&&(Ts(s)?d.log(s.message):Es(s)?d.warn(s.message):d.warn(s))})}_processEvent(t,n,r,o){let s=this.getOptions(),{sampleRate:i}=s,a=Rs(t),c=tr(t),p=`before send for type \`${t.type||"error"}\``,f=typeof i>"u"?void 0:nt(i);if(c&&typeof f=="number"&&D()>f)return this.recordDroppedEvent("sample_rate","error"),Fe(er(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));let l=ys(t.type);return this._prepareEvent(t,n,r,o).then(m=>{if(m===null)throw this.recordDroppedEvent("event_processor",l),er("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return m;let S=Oc(this,s,m,n);return vc(S,p)}).then(m=>{if(m===null){if(this.recordDroppedEvent("before_send",l),a){let N=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",N)}throw er(`${p} returned \`null\`, will not send event.`)}let _=r.getSession()||o.getSession();if(c&&_&&this._updateSessionFromEvent(_,m),a){let E=m.sdkProcessingMetadata?.spanCountBeforeProcessing||0,N=m.spans?m.spans.length:0,C=E-N;C>0&&this.recordDroppedEvent("before_send","span",C)}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,n),m}).then(null,m=>{throw Ts(m)||Es(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,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===pt&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{let[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){g&&d.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){g&&d.log("No outcomes to send");return}if(!this._dsn){g&&d.log("No dsn provided, will not send outcomes");return}g&&d.log("Sending outcomes:",t);let n=ms(t,this._options.tunnel&&M(this._dsn));this.sendEnvelope(n)}};function ys(e){return e==="replay_event"?"replay":e||"error"}function vc(e,t){let n=`${t} must return \`null\` or a valid event.`;if(X(e))return e.then(r=>{if(!ne(r)&&r!==null)throw Zt(n);return r},r=>{throw Zt(`${t} rejected with ${r}`)});if(!ne(e)&&e!==null)throw Zt(n);return e}function Oc(e,t,n,r){let{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!Pe(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(tr(c)&&o)return o(c,r);if(Rs(c)){if(a||i){let u=gs(c);if(i?.length&&wn({description:u.description,op:u.op,attributes:u.data},i))return null;if(a){let p=a(u);p?c=oe(n,_s(p)):st()}if(c.spans){let p=[],f=c.spans;for(let m of f){if(i?.length&&wn({description:m.description,op:m.op,attributes:m.data},i)){Uo(f,m);continue}if(a){let _=a(m);_?p.push(_):(st(),p.push(m))}else p.push(m)}let l=c.spans.length-p.length;l&&e.recordDroppedEvent("before_send","span",l),c.spans=p}}if(s){if(c.spans){let u=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return s(c,r)}}return c}function tr(e){return e.type===void 0}function Rs(e){return e.type==="transaction"}function Lc(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+As(e.attributes)}function Mc(e){let t=0;return e.message&&(t+=e.message.length*2),t+As(e.attributes)}function As(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*bs(n[0]):Ie(n)?t+=bs(n):t+=100}),t}function bs(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function Cs(e,t,n,r,o){let s={sent_at:new Date().toISOString()};n?.sdk&&(s.sdk={name:n.sdk.name,version:n.sdk.version}),r&&o&&(s.dsn=M(o)),t&&(s.trace=t);let i=Uc(e);return R(s,[i])}function Uc(e){return[{type:"check_in"},e]}function vs(e){let t=e._metadata?.sdk,n=t?.name&&t?.version?`${t?.name}/${t?.version}`:void 0;e.transportOptions={...e.transportOptions,headers:{...n&&{"user-agent":n},...e.transportOptions?.headers}}}function Os(e,t){return e(t.stack||"",1)}function kc(e){return je(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function Pc(e){return kc(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function nr(e,t){let n={type:t.name||t.constructor.name,value:Pc(t)},r=Os(e,t);return r.length&&(n.stacktrace={frames:r}),n}function Dc(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}function wc(e){if("name"in e&&typeof e.name=="string"){let r=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(r+=` with message '${e.message}'`),r}else if("message"in e&&typeof e.message=="string")return e.message;let t=Sn(e);if(Br(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let n=Fc(e);return`${n&&n!=="Object"?`'${n}'`:"Object"} captured as exception with keys: ${t}`}function Fc(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Bc(e,t,n,r){if(je(n))return[n,void 0];if(t.synthetic=!0,ne(n)){let s=e?.getOptions().normalizeDepth,i={__serialized__:Bn(n,s)},a=Dc(n);if(a)return[a,i];let c=wc(n),u=r?.syntheticException||new Error(c);return u.message=c,[u,i]}let o=r?.syntheticException||new Error(n);return o.message=`${n}`,[o,void 0]}function Ls(e,t,n,r){let s=r?.data&&r.data.mechanism||{handled:!0,type:"generic"},[i,a]=Bc(e,s,n,r),c={exception:{values:[nr(t,i)]}};return a&&(c.extra=a),bn(c,void 0,void 0),Ce(c,s),{...c,event_id:r?.event_id}}function Ms(e,t,n="info",r,o){let s={event_id:r?.event_id,level:n};if(o&&r?.syntheticException){let i=Os(e,r.syntheticException);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]},Ce(s,{synthetic:!0}))}if(ze(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 lt=class e extends Jt{__init(){this._disposeCallbacks=[]}constructor(t){Oo(),vs(t),super(t),e.prototype.__init.call(this),this._setUpMetricsProcessing()}eventFromException(t,n){let r=Ls(this,this._options.stackParser,t,n);return r.level="error",Q(r)}eventFromMessage(t,n="info",r){return Q(Ms(this._options.stackParser,t,n,r,this._options.attachStacktrace))}captureException(t,n,r){return Us(n),super.captureException(t,n,r)}captureEvent(t,n,r){return!t.type&&t.exception?.values&&t.exception.values.length>0&&Us(n),super.captureEvent(t,n,r)}captureCheckIn(t,n,r){let o="checkInId"in t&&t.checkInId?t.checkInId:b();if(!this._isEnabled())return g&&d.warn("SDK not enabled, will not capture check-in."),o;let s=this.getOptions(),{release:i,environment:a,tunnel:c}=s,u={check_in_id:o,monitor_slug:t.monitorSlug,status:t.status,release:i,environment:a};"duration"in t&&(u.duration=t.duration),n&&(u.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone,failure_issue_threshold:n.failureIssueThreshold,recovery_threshold:n.recoveryThreshold});let[p,f]=os(this,r);f&&(u.contexts={trace:f});let l=Cs(u,p,this.getSdkMetadata(),c,this.getDsn());return g&&d.log("Sending checkin:",t.monitorSlug,t.status),this.sendEnvelope(l),o}registerCleanup(t){this._disposeCallbacks.push(t)}dispose(){g&&d.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=Ye(ft)}_prepareEvent(t,n,r,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,n,r,o)}_setUpMetricsProcessing(){this.on("processMetric",t=>{this._options.serverName&&(t.attributes={"server.address":this._options.serverName,...t.attributes})})}};function Us(e){let t=L().getScopeData().sdkProcessingMetadata.requestSession;if(t){let n=e?.mechanism?.handled??!0;n&&t.status!=="crashed"?t.status="errored":n||(t.status="crashed")}}var Gc=new Set(["false","f","n","no","off","0"]),Hc=new Set(["true","t","y","yes","on","1"]);function he(e,t){let n=String(e).toLowerCase();return Gc.has(n)?!1:Hc.has(n)?!0:t?.strict?null:!!e}function mt(e,t,n=[t],r="npm"){let o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(s=>({name:`${r}:@sentry/${s}`,version:Y})),o.version=Y)}var A_=1024*1024;var ks=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","set-cookie","cookie"],Yc=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"],Wc=["x-forwarded-","-user"];function rr(e,t=!1,n="request"){let r={};try{Object.entries(e).forEach(([o,s])=>{if(s==null)return;let i=o.toLowerCase();if((i==="cookie"||i==="set-cookie")&&typeof s=="string"&&s!==""){let c=i==="set-cookie",u=s.indexOf(";"),p=c&&u!==-1?s.substring(0,u):s,f=c?[p]:p.split("; ");for(let l of f){let m=l.indexOf("="),_=m!==-1?l.substring(0,m):l,S=m!==-1?l.substring(m+1):"",E=_.toLowerCase();Ds({spanAttributes:r,headerKey:i,cookieKey:E,value:S,sendDefaultPii:t,lifecycle:n})}}else Ds({spanAttributes:r,headerKey:i,value:s,sendDefaultPii:t,lifecycle:n})})}catch{}return r}function Ps(e){return e.replace(/-/g,"_")}function Ds({spanAttributes:e,headerKey:t,cookieKey:n,value:r,sendDefaultPii:o,lifecycle:s}){let c=$c(n||t,r,o,!!n);if(c==null)return;let u=`http.${s}.header.${Ps(t)}${n?`.${Ps(n)}`:""}`;e[u]=c}function $c(e,t,n,r=!1){let o=r?[...ks,...Yc]:ks;if(n?o.some(i=>e.includes(i)):[...Wc,...o].some(i=>e.includes(i)))return"[Filtered]";if(Array.isArray(t))return t.map(i=>i!=null?String(i):i).join(";");if(typeof t=="string")return t}var Vc=100;function or(e,t){let n=T(),r=L();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:s=Vc}=n.getOptions();if(s<=0)return;let a={timestamp:q(),...e},c=o?x(()=>o(a,t)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),r.addBreadcrumb(c,s))}var ws,jc="FunctionToString",Fs=new WeakMap,zc=(()=>({name:jc,setupOnce(){ws=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=hn(this),n=Fs.has(T())&&t!==void 0?t:this;return ws.apply(n,e)}}catch{}},setup(e){Fs.set(e,!0)}})),gt=zc;var Zc=[/^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$/],Jc="EventFilters",We=(e={})=>{let t;return{name:Jc,setup(n){let r=n.getOptions();t=Bs(e,r)},processEvent(n,r,o){if(!t){let s=o.getOptions();t=Bs(e,s)}return Kc(n,t)?null:n}}},Xc=((e={})=>({...We(e),name:"InboundFilters"}));function Bs(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:Zc],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function Kc(e,t){if(e.type){if(e.type==="transaction"&&Qc(e,t.ignoreTransactions))return g&&d.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
9
|
+
Event: ${re(e)}`),!0}else{if(qc(e,t.ignoreErrors))return g&&d.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
10
|
+
Event: ${re(e)}`),!0;if(ru(e))return g&&d.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
11
|
+
Event: ${re(e)}`),!0;if(eu(e,t.denyUrls))return g&&d.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
12
12
|
Event: ${re(e)}.
|
|
13
|
-
Url: ${
|
|
13
|
+
Url: ${Xt(e)}`),!0;if(!tu(e,t.allowUrls))return g&&d.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
14
14
|
Event: ${re(e)}.
|
|
15
|
-
Url: ${zt(e)}`),!0}return!1}function wc(e,t){return t?.length?Vt(e).some(n=>Ae(n,t)):!1}function Bc(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Ae(n,t):!1}function Gc(e,t){if(!t?.length)return!1;let n=zt(e);return n?Ae(n,t):!1}function Hc(e,t){if(!t?.length)return!0;let n=zt(e);return n?Ae(n,t):!0}function Yc(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function zt(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?Yc(n):null}catch{return g&&p.error(`Cannot extract url for event ${re(e)}`),null}}function Wc(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function vs(e,t,n,r,o,s){if(!o.exception?.values||!s||!K(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=qn(e,t,r,s.originalException,n,o.exception.values,i,0))}function qn(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(K(r[o],Error)){As(i,a,r);let u=e(t,r[o]),l=c.length;Cs(u,o,l,a),c=qn(e,t,n,r[o],o,[u,...c],u,l)}return Os(r)&&r.errors.forEach((u,l)=>{if(K(u,Error)){As(i,a,r);let f=e(t,u),d=c.length;Cs(f,`errors[${l}]`,d,a),c=qn(e,t,n,u,o,[f,...c],f,d)}}),c}function Os(e){return Array.isArray(e.errors)}function As(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Os(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Cs(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}var Vc="cause",$c=5,jc="LinkedErrors",zc=((e={})=>{let t=e.limit||$c,n=e.key||Vc;return{name:jc,preprocessEvent(r,o,s){let i=s.getOptions();vs(Xn,i.stackParser,n,t,r,o)}}}),mt=zc;function Ls(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf("=",n);if(r===-1)break;let o=e.indexOf(";",n);if(o===-1)o=e.length;else if(o<r){n=e.lastIndexOf(";",r-1)+1;continue}let s=e.slice(n,r).trim();if(t[s]===void 0){let i=e.slice(r+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}}n=o+1}return t}var Qn=["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 Ms(e){let t={};for(let s of Object.keys(e))t[s.toLowerCase()]=e[s];return Qn.map(s=>{let i=t[s.toLowerCase()],a=Array.isArray(i)?i.join(";"):i;return s==="Forwarded"?Zc(a):a?.split(",").map(c=>c.trim())}).reduce((s,i)=>i?s.concat(i):s,[]).find(s=>s!==null&&Jc(s))||null}function Zc(e){if(!e)return null;for(let t of e.split(";"))if(t.startsWith("for="))return t.slice(4);return null}function Jc(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 Xc={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},Kc="RequestData",qc=((e={})=>{let t={...Xc,...e.include};return{name:Kc,processEvent(n,r,o){let{sdkProcessingMetadata:s={}}=n,{normalizedRequest:i,ipAddress:a}=s,c={...t,ip:t.ip??o.getOptions().sendDefaultPii};return i&&Qc(n,i,{ipAddress:a},c),n}}}),gt=qc;function Qc(e,t,n,r){if(e.request={...e.request,...eu(t,r)},r.ip){let o=t.headers&&Ms(t.headers)||n.ipAddress;o&&(e.user={...e.user,ip_address:o})}}function eu(e,t){let n={},r={...e.headers};if(t.headers&&(n.headers=r,t.cookies||delete r.cookie,!t.ip)){let o=new Set(Qn.map(s=>s.toLowerCase()));for(let s of Object.keys(r))o.has(s.toLowerCase())&&delete r[s]}if(n.method=e.method,t.url&&(n.url=e.url),t.cookies){let o=e.cookies||(r?.cookie?Ls(r.cookie):void 0);n.cookies=o||{}}return t.query_string&&(n.query_string=e.query_string),t.data&&(n.data=e.data),n}function Ps(e){let t="console",n=fe(t,e);return J(t,tu),n}function tu(){"console"in _&&pe.forEach(function(e){e in _.console&&ze(_.console,e,function(t){return F[e]=t,function(...n){Y("console",{args:n,level:e}),F[e]?.apply(_.console,n)}})})}function Us(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var nu=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function ru(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=nu.exec(t);return n?n.slice(1):[]}function er(e){let t=ru(e),n=t[0]||"",r=t[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}var ou="Console",tr=(e={})=>{let t=new Set(e.levels||pe);return{name:ou,setup(n){let r=Ps(({args:o,level:s})=>{T()!==n||!t.has(s)||su(s,o)});n.registerCleanup(r)}}};function su(e,t){let n={category:"console",data:{arguments:t,logger:"console"},level:Us(e),message:ks(t)};if(e==="assert")if(t[0]===!1){let r=t.slice(1);n.message=r.length>0?`Assertion failed: ${ks(r)}`:"Assertion failed",n.data.arguments=r}else return;Kn(n,{input:t,level:e})}function ks(e){return"util"in _&&typeof _.util.format=="function"?_.util.format(...e):hn(e," ")}function Ds(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Fs(){return!Ds()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function ws(){return typeof window<"u"&&(!Fs()||iu())}function iu(){return _.process?.type==="renderer"}function Bs(e,t,n){let r=n.getOptions(),o=n.getDsn(),s=r.tunnel,i=De(r._metadata),a={sent_at:new Date().toISOString(),...au(t)&&{trace:t},...i&&{sdk:i},...!!s&&o&&{dsn:O(o)}},c=r.sendDefaultPii?"auto":"never",u=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...ws()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}];return N(a,[u])}function au(e){return!!e.trace_id&&!!e.public_key}function Gs(e){let t=156;if(t+=e.name.length*2,t+=Rn(e.attributes),e.links&&e.links.length>0){let r=e.links[0]?.attributes,o=100+(r?Rn(r):0);t+=o*e.links.length}return t}var Hs=1e3,cu=5e6,Zt=class{constructor(t,n){this._traceBuckets=new Map,this._client=t;let{maxSpanLimit:r,flushInterval:o,maxTraceWeightInBytes:s}=n??{};this._maxSpanLimit=r&&r>0&&r<=Hs?r:Hs,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=s&&s>0?s:cu,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(i=>{clearTimeout(i.timeout)}),this._traceBuckets.clear()})}add(t){let n=t.trace_id,r=this._traceBuckets.get(n);r||(r={spans:new Set,size:0,timeout:Ge(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(t),r.size+=Gs(t),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(g&&p.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((t,n)=>{this.flush(n)}))}flush(t){let n=this._traceBuckets.get(t);if(!n)return;if(!n.spans.size){this._removeTrace(t);return}let r=Array.from(n.spans),o=r[0]?._segmentSpan;if(!o){g&&p.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}let s=Ue(o),i=r.map(c=>{let{_segmentSpan:u,...l}=c;return l}),a=Bs(i,s,this._client);g&&p.log(`Sending span envelope for trace ${t} with ${i.length} spans`),this._client.sendEnvelope(a).then(null,c=>{g&&p.error("Error while sending streamed span envelope:",c)}),this._removeTrace(t)}_removeTrace(t){let n=this._traceBuckets.get(t);n&&clearTimeout(n.timeout),this._traceBuckets.delete(t)}};var Jt=()=>({name:"SpanStreaming",setup(e){let t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=e.getOptions();if(!Po(e)){r.traceLifecycle="static",g&&p.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let o=r.beforeSendSpan;if(o&&!ke(o)){r.traceLifecycle="static",g&&p.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let s=new Zt(e);e.on("afterSpanEnd",i=>{kt(i)&&s.add(wo(i,e))})}});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 $s(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,r=/at (?:async )?(.+?) \(data:(.*?),/;return o=>{let s=o.match(r);if(s)return{filename:`<data:${s[2]}>`,function:s[1]};let i=o.match(n);if(i){let a,c,u,l,f;if(i[1]){u=i[1];let S=u.lastIndexOf(".");if(u[S-1]==="."&&S--,S>0){a=u.slice(0,S),c=u.slice(S+1);let E=a.indexOf(".Module");E>0&&(u=u.slice(E+1),a=a.slice(0,E))}l=void 0}c&&(l=a,f=c),c==="<anonymous>"&&(f=void 0,u=void 0),u===void 0&&(f=f||"?",u=l?`${l}.${f}`:f);let d=Rr(i[2]),m=i[5]==="native";!d&&i[5]&&!m&&(d=i[5]);let h=d?uu(d):void 0;return{filename:h??d,module:h&&e?.(h),function:u,lineno:Ys(i[3]),colno:Ys(i[4]),in_app:Vs(d||"",m)}}if(o.match(t))return{filename:o}}}function nr(e){return[90,$s(e)]}function Ys(e){return parseInt(e||"",10)||void 0}function uu(e){try{return decodeURI(e)}catch{return}}var ce=class{constructor(t){this._maxSize=t,this._cache=new Map}get size(){return this._cache.size}get(t){let n=this._cache.get(t);if(n!==void 0)return this._cache.delete(t),this._cache.set(t,n),n}set(t,n){if(this._cache.size>=this._maxSize){let r=this._cache.keys().next().value;this._cache.delete(r)}this._cache.set(t,n)}remove(t){let n=this._cache.get(t);return n&&this._cache.delete(t),n}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let t=[];return this._cache.forEach(n=>t.push(n)),t}};var Kt=require("worker_threads");var R=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Mu=6e4,Xt=class extends ft{constructor(t){let n=t.includeServerName===!1?void 0:t.serverName||global.process.env.SENTRY_NAME||js.hostname(),r={...t,platform:"node",runtime:{name:"node",version:global.process.version},serverName:n};lt(r,"node-light",["node-core"]),p.log(`Initializing Sentry: process: ${process.pid}, thread: ${Kt.isMainThread?"main":`worker-${Kt.threadId}`}.`),super(r),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{Be(this)},n&&this.on("beforeCaptureLog",o=>{o.attributes={...o.attributes,"server.address":n}}),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(()=>{R&&p.log("Flushing client reports based on interval."),this._flushOutcomes()},t.clientReportFlushInterval??Mu).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}};var Zs=require("node:child_process"),qt=require("node:fs"),y=L(require("node:os"),1),Js=require("node:path"),rr=require("node:util");var Pu=(0,rr.promisify)(qt.readFile),Uu=(0,rr.promisify)(qt.readdir),ku="Context",Du=((e={})=>{let t,n={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...e};async function r(s){t===void 0&&(t=o());let i=Fu(await t);return s.contexts={...s.contexts,app:{...i.app,...s.contexts?.app},os:{...i.os,...s.contexts?.os},device:{...i.device,...s.contexts?.device},culture:{...i.culture,...s.contexts?.culture},cloud_resource:{...i.cloud_resource,...s.contexts?.cloud_resource}},s}async function o(){let s={};if(n.os&&(s.os=await wu()),n.app&&(s.app=Gu()),n.device&&(s.device=Hu(n.device)),n.culture){let i=Bu();i&&(s.culture=i)}return n.cloudResource&&(s.cloud_resource=zu()),s}return{name:ku,processEvent(s){return r(s)}}}),or=Du;function Fu(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=y.freemem()),e}async function wu(){let e=y.platform();switch(e){case"darwin":return $u();case"linux":return ju();default:return{name:Yu[e]||e,version:y.release()}}}function Bu(){try{if(typeof process.versions.icu!="string")return;let e=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(e)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function Gu(){let e=process.memoryUsage().rss,n={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:e};if(typeof process.availableMemory=="function"){let r=process.availableMemory?.();r!=null&&(n.free_memory=r)}return n}function Hu(e){let t={},n;try{n=y.uptime()}catch{}if(typeof n=="number"&&(t.boot_time=new Date(Date.now()-n*1e3).toISOString()),t.arch=y.arch(),(e===!0||e.memory)&&(t.memory_size=y.totalmem(),t.free_memory=y.freemem()),e===!0||e.cpu){let r=y.cpus(),o=r?.[0];o&&(t.processor_count=r.length,t.cpu_description=o.model,t.processor_frequency=o.speed)}return t}var Yu={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows",ohos:"OpenHarmony",android:"Android"},Wu=[{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"]}],Vu={alpine:e=>e,arch:e=>$(/distrib_release=(.*)/,e),centos:e=>$(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>$(/release (..)/,e),mint:e=>$(/distrib_release=(.*)/,e),red:e=>$(/release ([^ ]+)/,e),suse:e=>$(/VERSION = (.*)\n/,e),ubuntu:e=>$(/distrib_release=(.*)/,e)};function $(e,t){let n=e.exec(t);return n?n[1]:void 0}async function $u(){let e={kernel_version:y.release(),name:"Mac OS X",version:`10.${Number(y.release().split(".")[0])-4}`};try{let t=await new Promise((n,r)=>{(0,Zs.execFile)("/usr/bin/sw_vers",(o,s)=>{if(o){r(o);return}n(s)})});e.name=$(/^ProductName:\s+(.*)$/m,t),e.version=$(/^ProductVersion:\s+(.*)$/m,t),e.build=$(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function zs(e){return e.split(" ")[0].toLowerCase()}async function ju(){let e={kernel_version:y.release(),name:"Linux"};try{let t=await Uu("/etc"),n=Wu.find(a=>t.includes(a.name));if(!n)return e;let r=(0,Js.join)("/etc",n.name),o=(await Pu(r,{encoding:"utf-8"})).toLowerCase(),{distros:s}=n;e.name=s.find(a=>o.indexOf(zs(a))>=0)||s[0];let i=zs(e.name);e.version=Vu[i]?.(o)}catch{}return e}function zu(){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}var qs=require("node:fs"),Qs=require("node:readline");var sr=new ce(10),ei=new ce(20),Zu=7,Ju="ContextLines",Xu=1e3,Ku=1e4;function qu(e,t,n){let r=e.get(t);return r===void 0?(e.set(t,n),n):r}function Qu(e){return!!(e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:"))}function ep(e){return e.lineno!==void 0&&e.lineno>Ku||e.colno!==void 0&&e.colno>Xu}function tp(e,t){let n=sr.get(e);if(n===void 0)return!1;for(let r=t[0];r<=t[1];r++)if(n[r]===void 0)return!1;return!0}function np(e,t){if(!e.length)return[];let n=0,r=e[0];if(typeof r!="number")return[];let o=Ks(r,t),s=[];for(;;){if(n===e.length-1){s.push(o);break}let i=e[n+1];if(typeof i!="number")break;i<=o[1]?o[1]=i+t:(s.push(o),o=Ks(i,t)),n++}return s}function rp(e,t,n){return new Promise((r,o)=>{let s=(0,qs.createReadStream)(e),i=(0,Qs.createInterface)({input:s});function a(){s.destroy(),r()}let c=0,u=0,l=t[u];if(l===void 0){a();return}let f=l[0],d=l[1];function m(h){ei.set(e,1),R&&p.error(`Failed to read file: ${e}. Error: ${h}`),i.close(),i.removeAllListeners(),a()}s.on("error",m),i.on("error",m),i.on("close",a),i.on("line",h=>{if(c++,!(c<f)&&(n[c]=_n(h,0),c>=d)){if(u===t.length-1){i.close(),i.removeAllListeners();return}u++;let S=t[u];if(S===void 0){i.close(),i.removeAllListeners();return}f=S[0],d=S[1]}})})}async function op(e,t){let n={};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"||Qu(c)||ep(a))continue;n[c]||(n[c]=[]),n[c].push(a.lineno)}}let r=Object.keys(n);if(r.length==0)return e;let o=[];for(let s of r){if(ei.get(s))continue;let i=n[s];if(!i)continue;i.sort((u,l)=>u-l);let a=np(i,t);if(a.every(u=>tp(s,u)))continue;let c=qu(sr,s,{});o.push(rp(s,a,c))}if(await Promise.all(o).catch(()=>{R&&p.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&&sp(s.stacktrace.frames,t,sr);return e}function sp(e,t,n){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let o=n.get(r.filename);if(o===void 0)continue;ip(r.lineno,r,t,o)}}function Xs(e){delete e.pre_context,delete e.context_line,delete e.post_context}function ip(e,t,n,r){if(t.lineno===void 0||r===void 0){R&&p.error("Cannot resolve context for frame with no lineno or file contents");return}t.pre_context=[];for(let s=ti(e,n);s<e;s++){let i=r[s];if(i===void 0){Xs(t),R&&p.error(`Could not find line ${s} in file ${t.filename}`);return}t.pre_context.push(i)}if(r[e]===void 0){Xs(t),R&&p.error(`Could not find line ${e} in file ${t.filename}`);return}t.context_line=r[e];let o=ni(e,n);t.post_context=[];for(let s=e+1;s<=o;s++){let i=r[s];if(i===void 0)break;t.post_context.push(i)}}function ti(e,t){return Math.max(1,e-t)}function ni(e,t){return e+t}function Ks(e,t){return[ti(e,t),ni(e,t)]}var ap=((e={})=>{let t=e.frameContextLines!==void 0?e.frameContextLines:Zu;return{name:Ju,processEvent(n){return op(n,t)}}}),ir=ap;var Qt=In(process.versions.node),ri=Qt.major,IS=Qt.minor;var ai=require("node:worker_threads");var en;async function tn(){if(en===void 0)try{en=!!(await import("node:inspector")).url()}catch{en=!1}return en}var _t="__SENTRY_ERROR_LOCAL_VARIABLES__";function si(e,t,n){let r=0,o=5,s=0;return setInterval(()=>{s===0?r>e&&(o*=2,n(o),o>86400&&(o=86400),s=o):(s-=1,s===0&&t()),r=0},1e3).unref(),()=>{r+=1}}function oi(e){return e!==void 0&&(e.length===0||e==="?"||e==="<anonymous>")}function nn(e,t){return e===t||`Object.${e}`===t||e===`Object.${t}`||oi(e)&&oi(t)}var cp="LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjUxLjAgKGRjMGI4MzkpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=";function ii(...e){p.log("[LocalVariables]",...e)}var ci=((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 u=a.length-c-1,l=i[c],f=a[u];if(!f||!l)break;l.vars===void 0||f.in_app===!1&&e.includeOutOfAppFrames!==!0||!nn(f.function,l.function)||(f.vars=l.vars)}}function n(s,i){if(i.originalException&&typeof i.originalException=="object"&&_t in i.originalException&&Array.isArray(i.originalException[_t])){for(let a of s.exception?.values||[])t(a,i.originalException[_t]);i.originalException[_t]=void 0}return s}async function r(){let s=await import("node:inspector");s.url()||s.open(0)}function o(s){let i=new ai.Worker(new URL(`data:application/javascript;base64,${cp}`),{workerData:s,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{i.terminate()}),i.once("error",a=>{ii("Worker error",a)}),i.once("exit",a=>{ii("Worker exit",a)}),i.unref()}return{name:"LocalVariablesAsync",async setup(s){if(!s.getOptions().includeLocalVariables)return;if(await tn()){p.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...e,debug:p.isEnabled()};r().then(()=>{try{o(a)}catch(c){p.error("Failed to start worker",c)}},c=>{p.error("Failed to start inspector",c)})},processEvent(s,i){return n(s,i)}}});function ui(e){if(e!==void 0)return e.slice(-10).reduce((t,n)=>`${t},${n.function},${n.lineno},${n.colno}`,"")}function up(e,t){if(t!==void 0)return ui(e(t,1))}function pi(e){let t=[],n=!1;function r(i){t=[],!n&&(n=!0,e(i))}t.push(r);function o(i){t.push(i)}function s(i){let a=t.pop()||r;try{a(i)}catch{r(i)}}return{add:o,next:s}}var ar=class e{constructor(t){this._session=t}static async create(t){if(t)return t;let n=await import("node:inspector");return new e(new n.Session)}configureAndConnect(t,n){this._session.connect(),this._session.on("Debugger.paused",r=>{t(r,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(t){this._session.post("Debugger.setPauseOnExceptions",{state:t?"all":"uncaught"})}getLocalVariables(t,n){this._getProperties(t,r=>{let{add:o,next:s}=pi(n);for(let i of r)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,n){this._session.post("Runtime.getProperties",{objectId:t,ownProperties:!0},(r,o)=>{n(r?[]:o.result)})}_unrollArray(t,n,r,o){this._getProperties(t,s=>{r[n]=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(r)})}_unrollObject(t,n,r,o){this._getProperties(t,s=>{r[n]=s.map(i=>[i.name,i.value?.value]).reduce((i,[a,c])=>(i[a]=c,i),{}),o(r)})}_unrollOther(t,n,r){t.value&&("value"in t.value?t.value.value===void 0||t.value.value===null?n[t.name]=`<${t.value.value}>`:n[t.name]=t.value.value:"description"in t.value&&t.value.type!=="function"?n[t.name]=`<${t.value.description}>`:t.value.type==="undefined"&&(n[t.name]="<undefined>")),r(n)}},pp="LocalVariables",fp=((e={},t)=>{let n=new ce(20),r,o=!1;function s(u){let l=ui(u.stacktrace?.frames);if(l===void 0)return;let f=n.remove(l);if(f===void 0)return;let d=(u.stacktrace?.frames||[]).filter(m=>m.function!=="new Promise");for(let m=0;m<d.length;m++){let h=d.length-m-1,S=f[m],E=d[h];if(!E||!S)break;S.vars===void 0||E.in_app===!1&&e.includeOutOfAppFrames!==!0||!nn(E.function,S.function)||(E.vars=S.vars)}}function i(u){for(let l of u.exception?.values||[])s(l);return u}let a;async function c(){let l=T()?.getOptions();if(!l?.includeLocalVariables)return;if(ri<18){p.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await tn()){p.warn("Local variables capture has been disabled because the debugger was already enabled");return}try{let d=await ar.create(t),m=(S,{params:{reason:E,data:x,callFrames:A}},Z)=>{if(E!=="exception"&&E!=="promiseRejection"){Z();return}r?.();let Se=up(S,x.description);if(Se==null){Z();return}let{add:Ee,next:ue}=pi(M=>{n.set(Se,M),Z()});for(let M=0;M<Math.min(A.length,5);M++){let{scopeChain:vi,functionName:hr,this:an}=A[M],Sr=vi.find(Te=>Te.type==="local"),Er=an.className==="global"||!an.className?hr:`${an.className}.${hr}`;if(Sr?.object.objectId===void 0)Ee(Te=>{Te[M]={function:Er},ue(Te)});else{let Te=Sr.object.objectId;Ee(Tr=>d.getLocalVariables(Te,Oi=>{Tr[M]={function:Er,vars:Oi},ue(Tr)}))}}ue([])},h=e.captureAllExceptions!==!1;if(d.configureAndConnect((S,E)=>m(l.stackParser,S,E),h),h){let S=e.maxExceptionsPerSecond||50;r=si(S,()=>{p.log("Local variables rate-limit lifted."),d.setPauseOnExceptions(!0)},E=>{p.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${E} seconds.`),d.setPauseOnExceptions(!1)})}o=!0}catch(d){p.log("The `LocalVariables` integration failed to start.",d)}}return{name:pp,setupOnce(){a=c()},async processEvent(u){return await a,o?i(u):u},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}}),fi=fp;var cr=(e={})=>Qt.major<19?fi(e):ci(e);function li(){try{return typeof module<"u"&&typeof module.exports<"u"}catch{return!1}}var di=require("worker_threads");var lp=2e3;function ht(e){b(()=>{console.error(e)});let t=T();if(t===void 0){R&&p.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let n=t.getOptions(),r=n?.shutdownTimeout&&n.shutdownTimeout>0?n.shutdownTimeout:lp;t.close(r).then(o=>{o||R&&p.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},o=>{R&&p.error(o)})}var dp="OnUncaughtException",ur=(e={})=>{let t={exitEvenIfOtherHandlersAreRegistered:!1,...e};return{name:dp,setup(n){di.isMainThread&&global.process.on("uncaughtException",mp(n,t))}}};function mp(e,t){let r=!1,o=!1,s=!1,i,a=e.getOptions();return Object.assign(c=>{let u=ht;t.onFatalError?u=t.onFatalError:a.onFatalError&&(u=a.onFatalError);let f=global.process.listeners("uncaughtException").filter(m=>m.name!=="domainUncaughtExceptionClear"&&m.tag!=="sentry_tracingErrorCallback"&&m._errorHandler!==!0).length===0,d=t.exitEvenIfOtherHandlersAreRegistered||f;r?d&&(s?(R&&p.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),ht(c)):o||(o=!0,setTimeout(()=>{s||(s=!0,u(i,c))},2e3))):(i=c,r=!0,T()===e&&ae(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"auto.node.onuncaughtexception"}}),!s&&d&&(s=!0,u(c)))},{_errorHandler:!0})}var gp="OnUnhandledRejection",_p=[{name:"AI_NoOutputGeneratedError"},{name:"AbortError"}],hp=((e={})=>{let t={mode:e.mode??"warn",ignore:[..._p,...e.ignore??[]]};return{name:gp,setup(n){global.process.on("unhandledRejection",Ip(n,t))}}}),pr=hp;function Sp(e){if(typeof e!="object"||e===null)return{name:"",message:String(e??"")};let t=e,n=typeof t.name=="string"?t.name:"",r=typeof t.message=="string"?t.message:String(e);return{name:n,message:r}}function Ep(e,t){let n=e.name===void 0||W(t.name,e.name,!0),r=e.message===void 0||W(t.message,e.message);return n&&r}function Tp(e,t){let n=Sp(t);return e.some(r=>Ep(r,n))}function Ip(e,t){return function(r,o){if(T()!==e||Tp(t.ignore??[],r))return;let s=t.mode==="strict"?"fatal":"error",i=r&&typeof r=="object"?r._sentry_active_span:void 0;(i?c=>wt(i,c):c=>c())(()=>{ae(r,{originalException:r,captureContext:{extra:{unhandledPromiseRejection:!0},level:s},mechanism:{handled:!1,type:"auto.node.onunhandledrejection"}})}),yp(r,t.mode)}}function yp(e,t){let n="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(n),console.error(e&&typeof e=="object"&&"stack"in e?e.stack:e)}):t==="strict"&&(b(()=>{console.warn(n)}),ht(e))}var mi=L(require("node:http"),1);var fr="Spotlight",bp=((e={})=>{let t={sidecarUrl:e.sidecarUrl||"http://localhost:8969/stream"};return{name:fr,setup(n){try{process.env.NODE_ENV&&process.env.NODE_ENV!=="development"&&p.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?")}catch{}xp(n,t)}}}),gi=bp;function xp(e,t){let n=Np(t.sidecarUrl);if(!n)return;let r=0;e.on("beforeEnvelope",o=>{if(r>3){p.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let s=it(o);Fe(()=>{let i=mi.request({method:"POST",path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":"application/x-sentry-envelope"}},a=>{a.statusCode&&a.statusCode>=200&&a.statusCode<400&&(r=0),a.on("data",()=>{}),a.on("end",()=>{}),a.setEncoding("utf8")});i.on("error",()=>{r++,p.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),i.write(s),i.end()})})}function Np(e){try{return new URL(`${e}`)}catch{p.warn(`[Spotlight] Invalid sidecar URL: ${e}`);return}}var lr=(e={})=>({name:"Console",setup(t){process.env.LAMBDA_TASK_ROOT&&J("console",Rp),tr(e).setup?.(t)}});function Rp(){let e=_?.console;e&&pe.forEach(t=>{t in e&&Ap(e,t)})}function Ap(e,t){let n=e[t];F[t]=n;let r=n,o,s=!1,i=function(...c){if(s){n.apply(e,c);return}s=!0;try{Y("console",{args:c,level:t}),r.apply(e,c)}finally{s=!1}};Rt(i,n);let a=n.bind(e);F[t]=a;try{let c=i;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return c},set(u){u===i?(o!==void 0&&(r=o,o=void 0),c=i):u===a?(o=r,c=a):typeof u=="function"&&!u.__sentry_original__?(r=u,c=i):c=u}})}catch{ze(e,t,function(c){return F[t]=c,function(...u){Y("console",{args:u,level:t}),F[t]?.apply(this,u)}})}}var rn=require("node:path");function _i(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function hi(e=process.argv[1]?er(process.argv[1]):process.cwd(),t=rn.sep==="\\"){let n=t?_i(e):e;return r=>{if(!r)return;let o=t?_i(r):r,{dir:s,base:i,ext:a}=rn.posix.parse(o);(a===".js"||a===".mjs"||a===".cjs")&&(i=i.slice(0,a.length*-1));let c=decodeURIComponent(i);s||(s=".");let u=s.lastIndexOf("/node_modules");if(u>-1)return`${s.slice(u+14).replace(/\//g,".")}:${c}`;if(s.startsWith(n)){let l=s.slice(n.length+1).replace(/\//g,".");return l?`${l}:${c}`:c}return c}}function Si(e){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(_.SENTRY_RELEASE?.id)return _.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,n=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,r=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||n||r||e}var Ei=yt(nr(hi()));var vp=L(require("node:http"),1),Op=L(require("node:https"),1),yi=require("node:stream"),bi=require("node:zlib");var ee=L(require("node:net"),1),mr=L(require("node:tls"),1);var dr=L(require("node:http"),1);var j=Symbol("AgentBaseInternalState"),on=class extends dr.Agent{constructor(t){super(t),this[j]={}}isSecureEndpoint(t){if(t){if(typeof t.secureEndpoint=="boolean")return t.secureEndpoint;if(typeof t.protocol=="string")return t.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
|
|
16
|
-
`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}createSocket(t,n,r){let o={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then(()=>this.connect(t,o)).then(s=>{if(s instanceof
|
|
15
|
+
Url: ${Xt(e)}`),!0}return!1}function qc(e,t){return t?.length?zt(e).some(n=>Ae(n,t)):!1}function Qc(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Ae(n,t):!1}function eu(e,t){if(!t?.length)return!1;let n=Xt(e);return n?Ae(n,t):!1}function tu(e,t){if(!t?.length)return!0;let n=Xt(e);return n?Ae(n,t):!0}function nu(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Xt(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?nu(n):null}catch{return g&&d.error(`Cannot extract url for event ${re(e)}`),null}}function ru(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function Ys(e,t,n,r,o,s){if(!o.exception?.values||!s||!K(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=sr(e,t,r,s.originalException,n,o.exception.values,i,0))}function sr(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(K(r[o],Error)){Gs(i,a,r);let u=e(t,r[o]),p=c.length;Hs(u,o,p,a),c=sr(e,t,n,r[o],o,[u,...c],u,p)}return Ws(r)&&r.errors.forEach((u,p)=>{if(K(u,Error)){Gs(i,a,r);let f=e(t,u),l=c.length;Hs(f,`errors[${p}]`,l,a),c=sr(e,t,n,u,o,[f,...c],f,l)}}),c}function Ws(e){return Array.isArray(e.errors)}function Gs(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Ws(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Hs(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}var ou="cause",su=5,iu="LinkedErrors",au=((e={})=>{let t=e.limit||su,n=e.key||ou;return{name:iu,preprocessEvent(r,o,s){let i=s.getOptions();Ys(nr,i.stackParser,n,t,r,o)}}}),_t=au;function $s(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf("=",n);if(r===-1)break;let o=e.indexOf(";",n);if(o===-1)o=e.length;else if(o<r){n=e.lastIndexOf(";",r-1)+1;continue}let s=e.slice(n,r).trim();if(t[s]===void 0){let i=e.slice(r+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}}n=o+1}return t}var ir=["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 ar(e){let t={};for(let s of Object.keys(e))t[s.toLowerCase()]=e[s];return ir.map(s=>{let i=t[s.toLowerCase()],a=Array.isArray(i)?i.join(";"):i;return s==="Forwarded"?cu(a):a?.split(",").map(c=>c.trim())}).reduce((s,i)=>i?s.concat(i):s,[]).find(s=>s!==null&&uu(s))||null}function cu(e){if(!e)return null;for(let t of e.split(";"))if(t.startsWith("for="))return t.slice(4);return null}function uu(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 pu={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},fu="RequestData",du=((e={})=>{let t={...pu,...e.include};return{name:fu,processEvent(n,r,o){let{sdkProcessingMetadata:s={}}=n,{normalizedRequest:i,ipAddress:a}=s,c={...t,ip:t.ip??o.getOptions().sendDefaultPii};return i&&lu(n,i,{ipAddress:a},c),n},processSegmentSpan(n,r){let{sdkProcessingMetadata:o={}}=L().getScopeData(),{normalizedRequest:s,ipAddress:i}=o;if(!s)return;let{sendDefaultPii:a}=r.getOptions(),c={...t,ip:t.ip??a};mu(n,s,i,c,a)}}}),ht=du;function lu(e,t,n,r){if(e.request={...e.request,...Vs(t,r)},r.ip){let o=t.headers&&ar(t.headers)||n.ipAddress;o&&(e.user={...e.user,ip_address:o})}}function mu(e,t,n,r,o){let s=Vs(t,r),i={};if(s.url&&(i["url.full"]=s.url),s.method&&(i["http.request.method"]=s.method),s.query_string&&(i["url.query"]=gu(s.query_string)),I(e,i),s.cookies&&Object.keys(s.cookies).length>0){let a=Object.entries(s.cookies).map(([u,p])=>`${u}=${p}`).join("; "),c=rr({cookie:a},o??!1,"request");I(e,c)}if(s.headers){let a=rr(s.headers,o??!1,"request");I(e,a)}if(s.data!=null){let a=typeof s.data=="string"?s.data:JSON.stringify(s.data);a&&I(e,{"http.request.body.data":a})}if(r.ip){let a=t.headers&&ar(t.headers)||n||void 0;a&&I(e,{[Ut]:a})}}function Vs(e,t){let n={},r={...e.headers};if(t.headers&&(n.headers=r,t.cookies||delete r.cookie,!t.ip)){let o=new Set(ir.map(s=>s.toLowerCase()));for(let s of Object.keys(r))o.has(s.toLowerCase())&&delete r[s]}if(n.method=e.method,t.url&&(n.url=e.url),t.cookies){let o=e.cookies||(r?.cookie?$s(r.cookie):void 0);n.cookies=o||{}}return t.query_string&&(n.query_string=e.query_string),t.data&&(n.data=e.data),n}function gu(e){return typeof e=="string"?e||void 0:(Array.isArray(e)?e:Object.entries(e)).map(([r,o])=>`${r}=${o}`).join("&")||void 0}function js(e){let t="console",n=de(t,e);return J(t,_u),n}function _u(){"console"in h&&fe.forEach(function(e){e in h.console&&Ze(h.console,e,function(t){return F[e]=t,function(...n){W("console",{args:n,level:e}),F[e]?.apply(h.console,n)}})})}function zs(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var hu=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Su(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=hu.exec(t);return n?n.slice(1):[]}function cr(e){let t=Su(e),n=t[0]||"",r=t[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}var Eu="Console",ur=(e={})=>{let t=new Set(e.levels||fe);return{name:Eu,setup(n){let r=js(({args:o,level:s})=>{T()!==n||!t.has(s)||Tu(s,o)});n.registerCleanup(r)}}};function Tu(e,t){let n={category:"console",data:{arguments:t,logger:"console"},level:zs(e),message:Zs(t)};if(e==="assert")if(t[0]===!1){let r=t.slice(1);n.message=r.length>0?`Assertion failed: ${Zs(r)}`:"Assertion failed",n.data.arguments=r}else return;or(n,{input:t,level:e})}function Zs(e){return"util"in h&&typeof h.util.format=="function"?h.util.format(...e):Tn(e," ")}var ce=class{constructor(t){this._maxSize=t,this._cache=new Map}get size(){return this._cache.size}get(t){let n=this._cache.get(t);if(n!==void 0)return this._cache.delete(t),this._cache.set(t,n),n}set(t,n){if(this._cache.size>=this._maxSize){let r=this._cache.keys().next().value;this._cache.delete(r)}this._cache.set(t,n)}remove(t){let n=this._cache.get(t);return n&&this._cache.delete(t),n}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let t=[];return this._cache.forEach(n=>t.push(n)),t}};function Js(e,t,n){let r=n.getOptions(),o=n.getDsn(),s=r.tunnel,i=De(r._metadata),a={sent_at:new Date().toISOString(),...Iu(t)&&{trace:t},...i&&{sdk:i},...!!s&&o&&{dsn:M(o)}},c=r.sendDefaultPii?"auto":"never",u=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...Be()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}];return R(a,[u])}function Iu(e){return!!e.trace_id&&!!e.public_key}function Xs(e){let t=156;if(t+=e.name.length*2,t+=vn(e.attributes),e.links&&e.links.length>0){let r=e.links[0]?.attributes,o=100+(r?vn(r):0);t+=o*e.links.length}return t}var Ks=1e3,yu=5e6,Kt=class{constructor(t,n){this._traceBuckets=new Map,this._client=t;let{maxSpanLimit:r,flushInterval:o,maxTraceWeightInBytes:s}=n??{};this._maxSpanLimit=r&&r>0&&r<=Ks?r:Ks,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=s&&s>0?s:yu,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(i=>{clearTimeout(i.timeout)}),this._traceBuckets.clear()})}add(t){let n=t.trace_id,r=this._traceBuckets.get(n);r||(r={spans:new Set,size:0,timeout:He(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(t),r.size+=Xs(t),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(g&&d.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((t,n)=>{this.flush(n)}))}flush(t){let n=this._traceBuckets.get(t);if(!n)return;if(!n.spans.size){this._removeTrace(t);return}let r=Array.from(n.spans),o=r[0]?._segmentSpan;if(!o){g&&d.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}let s=ke(o),i=r.map(c=>{let{_segmentSpan:u,...p}=c;return p}),a=Js(i,s,this._client);g&&d.log(`Sending span envelope for trace ${t} with ${i.length} spans`),this._client.sendEnvelope(a).then(null,c=>{g&&d.error("Error while sending streamed span envelope:",c)}),this._removeTrace(t)}_removeTrace(t){let n=this._traceBuckets.get(t);n&&clearTimeout(n.timeout),this._traceBuckets.delete(t)}};var qt=()=>({name:"SpanStreaming",setup(e){let t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=e.getOptions();if(!Go(e)){r.traceLifecycle="static",g&&d.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let o=r.beforeSendSpan;if(o&&!Pe(o)){r.traceLifecycle="static",g&&d.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let s=new Kt(e);e.on("afterSpanEnd",i=>{Ft(i)&&s.add(zn(i,e))})}});function ei(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 ti(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,r=/at (?:async )?(.+?) \(data:(.*?),/;return o=>{let s=o.match(r);if(s)return{filename:`<data:${s[2]}>`,function:s[1]};let i=o.match(n);if(i){let a,c,u,p,f;if(i[1]){u=i[1];let S=u.lastIndexOf(".");if(u[S-1]==="."&&S--,S>0){a=u.slice(0,S),c=u.slice(S+1);let E=a.indexOf(".Module");E>0&&(u=u.slice(E+1),a=a.slice(0,E))}p=void 0}c&&(p=a,f=c),c==="<anonymous>"&&(f=void 0,u=void 0),u===void 0&&(f=f||"?",u=p?`${p}.${f}`:f);let l=kr(i[2]),m=i[5]==="native";!l&&i[5]&&!m&&(l=i[5]);let _=l?bu(l):void 0;return{filename:_??l,module:_&&e?.(_),function:u,lineno:qs(i[3]),colno:qs(i[4]),in_app:ei(l||"",m)}}if(o.match(t))return{filename:o}}}function pr(e){return[90,ti(e)]}function qs(e){return parseInt(e||"",10)||void 0}function bu(e){try{return decodeURI(e)}catch{return}}var en=require("worker_threads");var A=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var ju=6e4,Qt=class extends lt{constructor(t){let n=t.includeServerName===!1?void 0:t.serverName||global.process.env.SENTRY_NAME||ni.hostname(),r={...t,platform:"node",runtime:{name:"node",version:global.process.version},serverName:n};mt(r,"node-light",["node-core"]),d.log(`Initializing Sentry: process: ${process.pid}, thread: ${en.isMainThread?"main":`worker-${en.threadId}`}.`),super(r),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{Ge(this)},n&&this.on("beforeCaptureLog",o=>{o.attributes={...o.attributes,"server.address":n}}),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(()=>{A&&d.log("Flushing client reports based on interval."),this._flushOutcomes()},t.clientReportFlushInterval??ju).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}};var si=require("node:child_process"),tn=require("node:fs"),y=U(require("node:os"),1),ii=require("node:path"),fr=require("node:util");var zu=(0,fr.promisify)(tn.readFile),Zu=(0,fr.promisify)(tn.readdir),Ju="Context",Xu=((e={})=>{let t={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...e},n=t.app?tp():void 0,r=t.device?np(t.device):void 0,o=t.culture?ep():void 0,s=t.cloudResource?cp():void 0,i=t.os?Qu():void 0,a={"process.runtime.engine.name":"v8","process.runtime.engine.version":process.versions.v8,...ri({app:n,device:r,culture:o,cloud_resource:s})};i&&i.then(p=>Object.assign(a,ri({os:p}))).catch(()=>{});let c=(async()=>{let p={};return i&&(p.os=await i),n&&(p.app=n),r&&(p.device=r),o&&(p.culture=o),s&&(p.cloud_resource=s),p})();async function u(p){let f=Ku(await c);return p.contexts={...p.contexts,app:{...f.app,...p.contexts?.app},os:{...f.os,...p.contexts?.os},device:{...f.device,...p.contexts?.device},culture:{...f.culture,...p.contexts?.culture},cloud_resource:{...f.cloud_resource,...p.contexts?.cloud_resource}},p}return{name:Ju,processEvent(p){return u(p)},processSegmentSpan(p){I(p,a),I(p,qu(n,r))}}}),dr=Xu;function Ku(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=y.freemem()),e}function ri(e){let t={},{app:n,device:r,os:o,culture:s,cloud_resource:i}=e;if(n&&n.app_start_time&&(t["app.start_time"]=n.app_start_time),r&&(r.arch&&(t["device.archs"]=[r.arch]),r.boot_time&&(t["device.boot_time"]=r.boot_time),r.memory_size!=null&&(t["device.memory_size"]=r.memory_size),r.processor_count!=null&&(t["device.processor_count"]=r.processor_count),r.cpu_description&&(t["device.cpu_description"]=r.cpu_description),r.processor_frequency!=null&&(t["device.processor_frequency"]=r.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 qu(e,t){let n={};if(e&&(n["app.memory"]=process.memoryUsage().rss,typeof process.availableMemory=="function")){let r=process.availableMemory?.();r!=null&&(n["app.free_memory"]=r)}return t?.free_memory!=null&&(n["device.free_memory"]=y.freemem()),n}async function Qu(){let e=y.platform();switch(e){case"darwin":return ip();case"linux":return ap();default:return{name:rp[e]||e,version:y.release()}}}function ep(){try{if(typeof process.versions.icu!="string")return;let e=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(e)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function tp(){let e=process.memoryUsage().rss,n={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:e};if(typeof process.availableMemory=="function"){let r=process.availableMemory?.();r!=null&&(n.free_memory=r)}return n}function np(e){let t={},n;try{n=y.uptime()}catch{}if(typeof n=="number"&&(t.boot_time=new Date(Date.now()-n*1e3).toISOString()),t.arch=y.arch(),(e===!0||e.memory)&&(t.memory_size=y.totalmem(),t.free_memory=y.freemem()),e===!0||e.cpu){let r=y.cpus(),o=r?.[0];o&&(t.processor_count=r.length,t.cpu_description=o.model,t.processor_frequency=o.speed)}return t}var rp={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows",ohos:"OpenHarmony",android:"Android"},op=[{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"]}],sp={alpine:e=>e,arch:e=>V(/distrib_release=(.*)/,e),centos:e=>V(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>V(/release (..)/,e),mint:e=>V(/distrib_release=(.*)/,e),red:e=>V(/release ([^ ]+)/,e),suse:e=>V(/VERSION = (.*)\n/,e),ubuntu:e=>V(/distrib_release=(.*)/,e)};function V(e,t){let n=e.exec(t);return n?n[1]:void 0}async function ip(){let e={kernel_version:y.release(),name:"Mac OS X",version:`10.${Number(y.release().split(".")[0])-4}`};try{let t=await new Promise((n,r)=>{(0,si.execFile)("/usr/bin/sw_vers",(o,s)=>{if(o){r(o);return}n(s)})});e.name=V(/^ProductName:\s+(.*)$/m,t),e.version=V(/^ProductVersion:\s+(.*)$/m,t),e.build=V(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function oi(e){return e.split(" ")[0].toLowerCase()}async function ap(){let e={kernel_version:y.release(),name:"Linux"};try{let t=await Zu("/etc"),n=op.find(a=>t.includes(a.name));if(!n)return e;let r=(0,ii.join)("/etc",n.name),o=(await zu(r,{encoding:"utf-8"})).toLowerCase(),{distros:s}=n;e.name=s.find(a=>o.indexOf(oi(a))>=0)||s[0];let i=oi(e.name);e.version=sp[i]?.(o)}catch{}return e}function cp(){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}var ui=require("node:fs"),pi=require("node:readline");var lr=new ce(10),fi=new ce(20),up=7,pp="ContextLines",fp=1e3,dp=1e4;function lp(e,t,n){let r=e.get(t);return r===void 0?(e.set(t,n),n):r}function mp(e){return!!(e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:"))}function gp(e){return e.lineno!==void 0&&e.lineno>dp||e.colno!==void 0&&e.colno>fp}function _p(e,t){let n=lr.get(e);if(n===void 0)return!1;for(let r=t[0];r<=t[1];r++)if(n[r]===void 0)return!1;return!0}function hp(e,t){if(!e.length)return[];let n=0,r=e[0];if(typeof r!="number")return[];let o=ci(r,t),s=[];for(;;){if(n===e.length-1){s.push(o);break}let i=e[n+1];if(typeof i!="number")break;i<=o[1]?o[1]=i+t:(s.push(o),o=ci(i,t)),n++}return s}function Sp(e,t,n){return new Promise((r,o)=>{let s=(0,ui.createReadStream)(e),i=(0,pi.createInterface)({input:s});function a(){s.destroy(),r()}let c=0,u=0,p=t[u];if(p===void 0){a();return}let f=p[0],l=p[1];function m(_){fi.set(e,1),A&&d.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)&&(n[c]=En(_,0),c>=l)){if(u===t.length-1){i.close(),i.removeAllListeners();return}u++;let S=t[u];if(S===void 0){i.close(),i.removeAllListeners();return}f=S[0],l=S[1]}})})}async function Ep(e,t){let n={};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"||mp(c)||gp(a))continue;n[c]||(n[c]=[]),n[c].push(a.lineno)}}let r=Object.keys(n);if(r.length==0)return e;let o=[];for(let s of r){if(fi.get(s))continue;let i=n[s];if(!i)continue;i.sort((u,p)=>u-p);let a=hp(i,t);if(a.every(u=>_p(s,u)))continue;let c=lp(lr,s,{});o.push(Sp(s,a,c))}if(await Promise.all(o).catch(()=>{A&&d.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&&Tp(s.stacktrace.frames,t,lr);return e}function Tp(e,t,n){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let o=n.get(r.filename);if(o===void 0)continue;Ip(r.lineno,r,t,o)}}function ai(e){delete e.pre_context,delete e.context_line,delete e.post_context}function Ip(e,t,n,r){if(t.lineno===void 0||r===void 0){A&&d.error("Cannot resolve context for frame with no lineno or file contents");return}t.pre_context=[];for(let s=di(e,n);s<e;s++){let i=r[s];if(i===void 0){ai(t),A&&d.error(`Could not find line ${s} in file ${t.filename}`);return}t.pre_context.push(i)}if(r[e]===void 0){ai(t),A&&d.error(`Could not find line ${e} in file ${t.filename}`);return}t.context_line=r[e];let o=li(e,n);t.post_context=[];for(let s=e+1;s<=o;s++){let i=r[s];if(i===void 0)break;t.post_context.push(i)}}function di(e,t){return Math.max(1,e-t)}function li(e,t){return e+t}function ci(e,t){return[di(e,t),li(e,t)]}var yp=((e={})=>{let t=e.frameContextLines!==void 0?e.frameContextLines:up;return{name:pp,processEvent(n){return Ep(n,t)}}}),mr=yp;var nn=xn(process.versions.node),mi=nn.major,ZS=nn.minor;var Si=require("node:worker_threads");var rn;async function on(){if(rn===void 0)try{rn=!!(await import("node:inspector")).url()}catch{rn=!1}return rn}var St="__SENTRY_ERROR_LOCAL_VARIABLES__";function _i(e,t,n){let r=0,o=5,s=0;return setInterval(()=>{s===0?r>e&&(o*=2,n(o),o>86400&&(o=86400),s=o):(s-=1,s===0&&t()),r=0},1e3).unref(),()=>{r+=1}}function gi(e){return e!==void 0&&(e.length===0||e==="?"||e==="<anonymous>")}function sn(e,t){return e===t||`Object.${e}`===t||e===`Object.${t}`||gi(e)&&gi(t)}var bp="LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjUyLjAgKDRiOTExZTApIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=";function hi(...e){d.log("[LocalVariables]",...e)}var Ei=((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 u=a.length-c-1,p=i[c],f=a[u];if(!f||!p)break;p.vars===void 0||f.in_app===!1&&e.includeOutOfAppFrames!==!0||!sn(f.function,p.function)||(f.vars=p.vars)}}function n(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 r(){let s=await import("node:inspector");s.url()||s.open(0)}function o(s){let i=new Si.Worker(new URL(`data:application/javascript;base64,${bp}`),{workerData:s,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{i.terminate()}),i.once("error",a=>{hi("Worker error",a)}),i.once("exit",a=>{hi("Worker exit",a)}),i.unref()}return{name:"LocalVariablesAsync",async setup(s){if(!s.getOptions().includeLocalVariables)return;if(await on()){d.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...e,debug:d.isEnabled()};r().then(()=>{try{o(a)}catch(c){d.error("Failed to start worker",c)}},c=>{d.error("Failed to start inspector",c)})},processEvent(s,i){return n(s,i)}}});function Ti(e){if(e!==void 0)return e.slice(-10).reduce((t,n)=>`${t},${n.function},${n.lineno},${n.colno}`,"")}function xp(e,t){if(t!==void 0)return Ti(e(t,1))}function Ii(e){let t=[],n=!1;function r(i){t=[],!n&&(n=!0,e(i))}t.push(r);function o(i){t.push(i)}function s(i){let a=t.pop()||r;try{a(i)}catch{r(i)}}return{add:o,next:s}}var gr=class e{constructor(t){this._session=t}static async create(t){if(t)return t;let n=await import("node:inspector");return new e(new n.Session)}configureAndConnect(t,n){this._session.connect(),this._session.on("Debugger.paused",r=>{t(r,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(t){this._session.post("Debugger.setPauseOnExceptions",{state:t?"all":"uncaught"})}getLocalVariables(t,n){this._getProperties(t,r=>{let{add:o,next:s}=Ii(n);for(let i of r)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,n){this._session.post("Runtime.getProperties",{objectId:t,ownProperties:!0},(r,o)=>{n(r?[]:o.result)})}_unrollArray(t,n,r,o){this._getProperties(t,s=>{r[n]=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(r)})}_unrollObject(t,n,r,o){this._getProperties(t,s=>{r[n]=s.map(i=>[i.name,i.value?.value]).reduce((i,[a,c])=>(i[a]=c,i),{}),o(r)})}_unrollOther(t,n,r){t.value&&("value"in t.value?t.value.value===void 0||t.value.value===null?n[t.name]=`<${t.value.value}>`:n[t.name]=t.value.value:"description"in t.value&&t.value.type!=="function"?n[t.name]=`<${t.value.description}>`:t.value.type==="undefined"&&(n[t.name]="<undefined>")),r(n)}},Np="LocalVariables",Rp=((e={},t)=>{let n=new ce(20),r,o=!1;function s(u){let p=Ti(u.stacktrace?.frames);if(p===void 0)return;let f=n.remove(p);if(f===void 0)return;let l=(u.stacktrace?.frames||[]).filter(m=>m.function!=="new Promise");for(let m=0;m<l.length;m++){let _=l.length-m-1,S=f[m],E=l[_];if(!E||!S)break;S.vars===void 0||E.in_app===!1&&e.includeOutOfAppFrames!==!0||!sn(E.function,S.function)||(E.vars=S.vars)}}function i(u){for(let p of u.exception?.values||[])s(p);return u}let a;async function c(){let p=T()?.getOptions();if(!p?.includeLocalVariables)return;if(mi<18){d.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await on()){d.warn("Local variables capture has been disabled because the debugger was already enabled");return}try{let l=await gr.create(t),m=(S,{params:{reason:E,data:N,callFrames:C}},Z)=>{if(E!=="exception"&&E!=="promiseRejection"){Z();return}r?.();let Se=xp(S,N.description);if(Se==null){Z();return}let{add:Ee,next:pe}=Ii(k=>{n.set(Se,k),Z()});for(let k=0;k<Math.min(C.length,5);k++){let{scopeChain:Gi,functionName:Nr,this:pn}=C[k],Rr=Gi.find(Te=>Te.type==="local"),Ar=pn.className==="global"||!pn.className?Nr:`${pn.className}.${Nr}`;if(Rr?.object.objectId===void 0)Ee(Te=>{Te[k]={function:Ar},pe(Te)});else{let Te=Rr.object.objectId;Ee(Cr=>l.getLocalVariables(Te,Hi=>{Cr[k]={function:Ar,vars:Hi},pe(Cr)}))}}pe([])},_=e.captureAllExceptions!==!1;if(l.configureAndConnect((S,E)=>m(p.stackParser,S,E),_),_){let S=e.maxExceptionsPerSecond||50;r=_i(S,()=>{d.log("Local variables rate-limit lifted."),l.setPauseOnExceptions(!0)},E=>{d.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${E} seconds.`),l.setPauseOnExceptions(!1)})}o=!0}catch(l){d.log("The `LocalVariables` integration failed to start.",l)}}return{name:Np,setupOnce(){a=c()},async processEvent(u){return await a,o?i(u):u},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}}),yi=Rp;var _r=(e={})=>nn.major<19?yi(e):Ei(e);function bi(){try{return typeof module<"u"&&typeof module.exports<"u"}catch{return!1}}var xi=require("worker_threads");var Ap=2e3;function Et(e){x(()=>{console.error(e)});let t=T();if(t===void 0){A&&d.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let n=t.getOptions(),r=n?.shutdownTimeout&&n.shutdownTimeout>0?n.shutdownTimeout:Ap;t.close(r).then(o=>{o||A&&d.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},o=>{A&&d.error(o)})}var Cp="OnUncaughtException",hr=(e={})=>{let t={exitEvenIfOtherHandlersAreRegistered:!1,...e};return{name:Cp,setup(n){xi.isMainThread&&global.process.on("uncaughtException",vp(n,t))}}};function vp(e,t){let r=!1,o=!1,s=!1,i,a=e.getOptions();return Object.assign(c=>{let u=Et;t.onFatalError?u=t.onFatalError:a.onFatalError&&(u=a.onFatalError);let f=global.process.listeners("uncaughtException").filter(m=>m.name!=="domainUncaughtExceptionClear"&&m.tag!=="sentry_tracingErrorCallback"&&m._errorHandler!==!0).length===0,l=t.exitEvenIfOtherHandlersAreRegistered||f;r?l&&(s?(A&&d.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),Et(c)):o||(o=!0,setTimeout(()=>{s||(s=!0,u(i,c))},2e3))):(i=c,r=!0,T()===e&&ae(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"auto.node.onuncaughtexception"}}),!s&&l&&(s=!0,u(c)))},{_errorHandler:!0})}var Op="OnUnhandledRejection",Lp=[{name:"AI_NoOutputGeneratedError"},{name:"AbortError"}],Mp=((e={})=>{let t={mode:e.mode??"warn",ignore:[...Lp,...e.ignore??[]]};return{name:Op,setup(n){global.process.on("unhandledRejection",Dp(n,t))}}}),Sr=Mp;function Up(e){if(typeof e!="object"||e===null)return{name:"",message:String(e??"")};let t=e,n=typeof t.name=="string"?t.name:"",r=typeof t.message=="string"?t.message:String(e);return{name:n,message:r}}function kp(e,t){let n=e.name===void 0||$(t.name,e.name,!0),r=e.message===void 0||$(t.message,e.message);return n&&r}function Pp(e,t){let n=Up(t);return e.some(r=>kp(r,n))}function Dp(e,t){return function(r,o){if(T()!==e||Pp(t.ignore??[],r))return;let s=t.mode==="strict"?"fatal":"error",i=r&&typeof r=="object"?r._sentry_active_span:void 0;(i?c=>Ht(i,c):c=>c())(()=>{ae(r,{originalException:r,captureContext:{extra:{unhandledPromiseRejection:!0},level:s},mechanism:{handled:!1,type:"auto.node.onunhandledrejection"}})}),wp(r,t.mode)}}function wp(e,t){let n="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"?x(()=>{console.warn(n),console.error(e&&typeof e=="object"&&"stack"in e?e.stack:e)}):t==="strict"&&(x(()=>{console.warn(n)}),Et(e))}var Ni=U(require("node:http"),1);var Er="Spotlight",Fp=((e={})=>{let t={sidecarUrl:e.sidecarUrl||"http://localhost:8969/stream"};return{name:Er,setup(n){try{process.env.NODE_ENV&&process.env.NODE_ENV!=="development"&&d.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?")}catch{}Bp(n,t)}}}),Ri=Fp;function Bp(e,t){let n=Gp(t.sidecarUrl);if(!n)return;let r=0;e.on("beforeEnvelope",o=>{if(r>3){d.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let s=at(o);we(()=>{let i=Ni.request({method:"POST",path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":"application/x-sentry-envelope"}},a=>{a.statusCode&&a.statusCode>=200&&a.statusCode<400&&(r=0),a.on("data",()=>{}),a.on("end",()=>{}),a.setEncoding("utf8")});i.on("error",()=>{r++,d.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),i.write(s),i.end()})})}function Gp(e){try{return new URL(`${e}`)}catch{d.warn(`[Spotlight] Invalid sidecar URL: ${e}`);return}}var Tr=(e={})=>({name:"Console",setup(t){process.env.LAMBDA_TASK_ROOT&&J("console",Hp),ur(e).setup?.(t)}});function Hp(){let e=h?.console;e&&fe.forEach(t=>{t in e&&Yp(e,t)})}function Yp(e,t){let n=e[t];F[t]=n;let r=n,o,s=!1,i=function(...c){if(s){n.apply(e,c);return}s=!0;try{W("console",{args:c,level:t}),r.apply(e,c)}finally{s=!1}};Ct(i,n);let a=n.bind(e);F[t]=a;try{let c=i;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return c},set(u){u===i?(o!==void 0&&(r=o,o=void 0),c=i):u===a?(o=r,c=a):typeof u=="function"&&!u.__sentry_original__?(r=u,c=i):c=u}})}catch{Ze(e,t,function(c){return F[t]=c,function(...u){W("console",{args:u,level:t}),F[t]?.apply(this,u)}})}}var an=require("node:path");function Ai(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function Ci(e=process.argv[1]?cr(process.argv[1]):process.cwd(),t=an.sep==="\\"){let n=t?Ai(e):e;return r=>{if(!r)return;let o=t?Ai(r):r,{dir:s,base:i,ext:a}=an.posix.parse(o);(a===".js"||a===".mjs"||a===".cjs")&&(i=i.slice(0,a.length*-1));let c=decodeURIComponent(i);s||(s=".");let u=s.lastIndexOf("/node_modules");if(u>-1)return`${s.slice(u+14).replace(/\//g,".")}:${c}`;if(s.startsWith(n)){let p=s.slice(n.length+1).replace(/\//g,".");return p?`${p}:${c}`:c}return c}}function vi(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,n=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,r=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||n||r||e}var Oi=xt(pr(Ci()));var $p=U(require("node:http"),1),Vp=U(require("node:https"),1),Ui=require("node:stream"),ki=require("node:zlib");var ee=U(require("node:net"),1),yr=U(require("node:tls"),1);var Ir=U(require("node:http"),1);var j=Symbol("AgentBaseInternalState"),cn=class extends Ir.Agent{constructor(t){super(t),this[j]={}}isSecureEndpoint(t){if(t){if(typeof t.secureEndpoint=="boolean")return t.secureEndpoint;if(typeof t.protocol=="string")return t.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
|
|
16
|
+
`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}createSocket(t,n,r){let o={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then(()=>this.connect(t,o)).then(s=>{if(s instanceof Ir.Agent)return s.addRequest(t,o);this[j].currentSocket=s,super.createSocket(t,n,r)},r)}createConnection(){let t=this[j].currentSocket;if(this[j].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[j].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(t){this[j]&&(this[j].defaultPort=t)}get protocol(){return this[j].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[j]&&(this[j].protocol=t)}};function un(...e){d.log("[https-proxy-agent:parse-proxy-response]",...e)}function Li(e){return new Promise((t,n)=>{let r=0,o=[];function s(){let p=e.read();p?u(p):e.once("readable",s)}function i(){e.removeListener("end",a),e.removeListener("error",c),e.removeListener("readable",s)}function a(){i(),un("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function c(p){i(),un("onerror %o",p),n(p)}function u(p){o.push(p),r+=p.length;let f=Buffer.concat(o,r),l=f.indexOf(`\r
|
|
17
17
|
\r
|
|
18
|
-
`);if(
|
|
19
|
-
`),
|
|
20
|
-
`;if(r.username||r.password){let
|
|
21
|
-
`;let c=
|
|
22
|
-
`);let{connect:u,buffered:
|
|
18
|
+
`);if(l===-1){un("have not received end of HTTP headers yet..."),s();return}let m=f.subarray(0,l).toString("ascii").split(`\r
|
|
19
|
+
`),_=m.shift();if(!_)return e.destroy(),n(new Error("No header received from proxy CONNECT response"));let S=_.split(" "),E=+(S[1]||0),N=S.slice(2).join(" "),C={};for(let Z of m){if(!Z)continue;let Se=Z.indexOf(":");if(Se===-1)return e.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${Z}"`));let Ee=Z.slice(0,Se).toLowerCase(),pe=Z.slice(Se+1).trimStart(),k=C[Ee];typeof k=="string"?C[Ee]=[k,pe]:Array.isArray(k)?k.push(pe):C[Ee]=pe}un("got proxy server response: %o %o",_,C),i(),t({connect:{statusCode:E,statusText:N,headers:C},buffered:f})}e.on("error",c),e.on("end",a),s()})}function Tt(...e){d.log("[https-proxy-agent]",...e)}var It=class extends cn{static __initStatic(){this.protocols=["http","https"]}constructor(t,n){super(n),this.options={},this.proxy=typeof t=="string"?new URL(t):t,this.proxyHeaders=n?.headers??{},Tt("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(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"],...n?Mi(n,"headers"):null,host:r,port:o}}async connect(t,n){let{proxy:r}=this;if(!n.host)throw new TypeError('No "host" provided');let o;if(r.protocol==="https:"){Tt("Creating `tls.Socket`: %o",this.connectOpts);let l=this.connectOpts.servername||this.connectOpts.host;o=yr.connect({...this.connectOpts,servername:l&&ee.isIP(l)?void 0:l})}else Tt("Creating `net.Socket`: %o",this.connectOpts),o=ee.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},i=ee.isIPv6(n.host)?`[${n.host}]`:n.host,a=`CONNECT ${i}:${n.port} HTTP/1.1\r
|
|
20
|
+
`;if(r.username||r.password){let l=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(l).toString("base64")}`}s.Host=`${i}:${n.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let l of Object.keys(s))a+=`${l}: ${s[l]}\r
|
|
21
|
+
`;let c=Li(o);o.write(`${a}\r
|
|
22
|
+
`);let{connect:u,buffered:p}=await c;if(t.emit("proxyConnect",u),this.emit("proxyConnect",u,t),u.statusCode===200){if(t.once("socket",Wp),n.secureEndpoint){Tt("Upgrading socket connection to TLS");let l=n.servername||n.host;return yr.connect({...Mi(n,"host","path","port"),socket:o,servername:ee.isIP(l)?void 0:l})}return o}o.destroy();let f=new ee.Socket({writable:!1});return f.readable=!0,t.once("socket",l=>{Tt("Replaying proxy buffer for failed request"),l.push(p),l.push(null)}),f}};It.__initStatic();function Wp(e){e.resume()}function Mi(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}var jp=1024*32;function zp(e){return new Ui.Readable({read(){this.push(e),this.push(null)}})}function Pi(e){let t;try{t=new URL(e.url)}catch{return x(()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")}),dt(e,()=>Promise.resolve({}))}let n=t.protocol==="https:",r=Zp(t,e.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),o=n?Vp:$p,s=e.keepAlive===void 0?!1:e.keepAlive,i=r?new It(r):new o.Agent({keepAlive:s,maxSockets:30,timeout:2e3}),a=Jp(e,e.httpModule??o,i);return dt(e,a)}function Zp(e,t){let{no_proxy:n}=process.env;if(!n?.split(",").some(o=>e.host.endsWith(o)||e.hostname.endsWith(o)))return t}function Jp(e,t,n){let{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(e.url);return function(u){return new Promise((p,f)=>{we(()=>{let l=zp(u.body),m={...e.headers};u.body.length>jp&&(m["content-encoding"]="gzip",l=l.pipe((0,ki.createGzip)()));let _=r.startsWith("["),S=t.request({method:"POST",agent:n,headers:m,hostname:_?r.slice(1,-1):r,path:`${o}${a}`,port:s,protocol:i,ca:e.caCerts},E=>{E.on("data",()=>{}),E.on("end",()=>{}),E.setEncoding("utf8");let N=E.headers["retry-after"]??null,C=E.headers["x-sentry-rate-limits"]??null;p({statusCode:E.statusCode,headers:{"retry-after":N,"x-sentry-rate-limits":Array.isArray(C)?C[0]||null:C}})});S.on("error",f),l.pipe(S)})})}}function Di(e){if(e===!1)return!1;if(typeof e=="string")return e;let t=he(process.env.SENTRY_SPOTLIGHT,{strict:!0}),n=t===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return e===!0?n??!0:t??n}var wi=require("node:async_hooks");function Fi(){let e=new wi.AsyncLocalStorage;function t(){let a=e.getStore();return a||{scope:Qe(),isolationScope:et()}}function n(a){let c=t().scope.clone(),u=t().isolationScope;return e.run({scope:c,isolationScope:u},()=>a(c))}function r(a,c){let u=t().isolationScope.clone();return e.run({scope:a,isolationScope:u},()=>c(a))}function o(a){let c=t().scope.clone(),u=t().isolationScope.clone();return e.run({scope:c,isolationScope:u},()=>a(u))}function s(a,c){let u=t().scope.clone();return e.run({scope:u,isolationScope:a},()=>c(a))}function i(a){return n(c=>(c.setSDKProcessingMetadata({[ct]:!0}),a()))}An({suppressTracing:i,withScope:n,withSetScope:r,withIsolationScope:o,withSetIsolationScope:s,getCurrentScope:()=>t().scope,getIsolationScope:()=>t().isolationScope})}function br(e={}){return Xp(e,()=>[])}function Xp(e={},t){let n=Kp(e,t);n.debug===!0&&(A?d.enable():x(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),Fi(),v().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:s})=>s===Er)&&n.integrations.push(Ri({sidecarUrl:typeof n.spotlight=="string"?n.spotlight:void 0})),mt(n,"node-light",["node-core"]);let o=new Qt(n);return v().setClient(o),o.init(),d.log(`SDK initialized from ${bi()?"CommonJS":"ESM"} (light mode)`),o.startClientReportTracking(),ef(),process.env.VERCEL&&process.on("SIGTERM",async()=>{await o.flush(200)}),o}function Kp(e,t){let n=qp(e.release),r=Di(e.spotlight),o=Qp(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??Pi,stackParser:mn(e.stackParser||Oi),release:n,tracesSampleRate:o,spotlight:r,debug:he(e.debug??process.env.SENTRY_DEBUG)},i=e.integrations,a=e.defaultIntegrations??t(s),c=Kn({defaultIntegrations:a,integrations:i});return s.traceLifecycle==="stream"&&!c.some(u=>u.name==="SpanStreaming")&&c.push(qt()),{...s,integrations:c}}function qp(e){if(e!==void 0)return e;let t=vi();if(t!==void 0)return t}function Qp(e){if(e!==void 0)return e;let t=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!t)return;let n=parseFloat(t);return isFinite(n)?n:void 0}function ef(){if(he(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let e=process.env.SENTRY_TRACE,t=process.env.SENTRY_BAGGAGE,n=kn(e,t);v().setPropagationContext(n)}}var z=U(require("homey"),1);process.env.HOME||(process.env.HOME=Bi.default.tmpdir());var xr=class e{_capturedMessages=[];_capturedExceptions=[];constructor({homey:t,options:n}){if(typeof t>"u")return e._error("Error: missing `homey` constructor parameter");if(!z.default.env)return e._error("Error: could not access `Homey.env`");if(typeof z.default.env.HOMEY_LOG_URL!="string")return e._error("Error: expected `HOMEY_LOG_URL` env variable, homey-log is disabled");let r=process.env.DEBUG==="1"&&!e._isLogForced();r&&e._log("App is running in debug mode, not enabling Sentry logging");let o;typeof z.default.env.HOMEY_LOG_SENTRY_PROJECT=="string"&&z.default.env.HOMEY_LOG_SENTRY_PROJECT.length>0&&(o=`${z.default.env.HOMEY_LOG_SENTRY_PROJECT}@${z.default.manifest.version}`),this._manifest=z.default.manifest,this._homeyVersion=t.version,this._managerCloud=t.cloud,this._homeyPlatform=t.platform,this._homeyPlatformVersion=t.platformVersion,this.init(z.default.env.HOMEY_LOG_URL,{enabled:!r,release:o,...n})}init(t,n){return br({dsn:t,integrations:[We(),gt(),_t(),ht(),Tr(),hr(),Sr(),mr(),_r(),dr({app:!1,cloudResource:!1})],maxBreadcrumbs:5,enableMetrics:!1,...n}),this.setTags({appId:this._manifest.id,appVersion:this._manifest.version,homeyVersion:this._homeyVersion,homeyPlatform:this._homeyPlatform,homeyPlatformVersion:this._homeyPlatformVersion}),this._managerCloud.getHomeyId().then(r=>this.setTags({homeyId:r})).catch(r=>e._error("Error: could not get `homeyId`",r)),e._log(`App ${this._manifest.id} v${this._manifest.version} logging on Homey v${this._homeyVersion}...`),this}setTags(t){return Vt(t),this}setUser(t){return jt(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((n,r)=>{try{n($t(t))}catch(o){r(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((n,r)=>{try{n(ae(t))}catch(o){r(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(z.default.env.HOMEY_LOG_FORCE){case"1":case"true":return!0;default:return!1}}};0&&(module.exports={Log});
|