Undefined hub.startSession on v6 upgrade
- [x] Review the documentation: https://docs.sentry.io/
- [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues
- [x] Use the latest release: https://github.com/getsentry/sentry-javascript/releases
- [ ] Provide a link to the affected event from your Sentry account
Package + Version
- [x] other:
@sentry/react
Version:
6.0.4
Description
I'm getting an error when bumping @sentry/react to v6.0.4:
Uncaught TypeError: hub.startSession is not a function
at startSessionTracking (sdk.ts:221)
at init (sdk.ts:106)
at Module.init (sdk.ts:18)
at Module.<anonymous> (index.tsx:22)
at Module../src/index.tsx (index.tsx:64)
at __webpack_require__ (bootstrap:856)
at fn (bootstrap:150)
at Object.1 (wdyr.js:11)
at __webpack_require__ (bootstrap:856)
at checkDeferredModules (bootstrap:45)
at Array.webpackJsonpCallback [as push] (bootstrap:32)
at main.chunk.js:1
Debugging this line, hub indeed does not seem to have a startSession function on its prototype.
Disabling autoSessionTracking fixes the issue, but is this expected?
Debugging this line, hub indeed does not seem to have a startSession function on its prototype.
https://github.com/getsentry/sentry-javascript/blob/6.0.4/packages/hub/src/hub.ts#L363-L379
Can you verify that all @sentry/react dependencies also get updated to the v6? It looks like something is out of sync here.
Can you verify that all
@sentry/reactdependencies also get updated to the v6? It looks like something is out of sync here.
Yeah, we use a few other packages with indirect @sentry/minimal dependencies, but I tried to mitigate this via Yarn resolutions:
{
"resolutions": {
"@sentry/hub": "^6.0.4",
"@sentry/minimal": "^6.0.4",
"@sentry/types": "^6.0.4"
}
}
Here's the output of npm-ls for all @sentry/* packages
├─┬ @sentry/[email protected] │ ├─┬ @sentry/[email protected] │ │ ├─┬ @sentry/[email protected] │ │ │ ├── @sentry/[email protected] deduped │ │ │ ├── @sentry/[email protected] deduped │ │ │ ├── @sentry/[email protected] deduped │ │ │ ├── @sentry/[email protected] deduped │ │ │ └── [email protected] │ │ ├── @sentry/[email protected] deduped │ │ ├── @sentry/[email protected] deduped │ │ └── [email protected] │ ├─┬ @sentry/[email protected] │ │ ├── @sentry/[email protected] deduped │ │ ├── @sentry/[email protected] deduped │ │ └── [email protected] │ ├── @sentry/[email protected] │ ├─┬ @sentry/[email protected] │ │ ├── @sentry/[email protected] deduped │ │ └── [email protected] │ ├── [email protected] deduped │ └── [email protected] ├─┬ @sentry/[email protected] │ ├─┬ @sentry/[email protected] │ │ ├── @sentry/[email protected] deduped │ │ ├── @sentry/[email protected] deduped │ │ └── [email protected] │ ├── @sentry/[email protected] deduped │ ├── @sentry/[email protected] deduped │ ├── @sentry/[email protected] deduped │ └── [email protected] ├─┬ [email protected] │ ├── UNMET DEPENDENCY @sentry/minimal@^5.15.5 │ ├── UNMET DEPENDENCY @sentry/types@^5.15.4 │ ├── [email protected] deduped │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ └── [email protected] ├─┬ [email protected] │ ├─┬ @babel/[email protected] │ │ └── [email protected] deduped │ ├── @filestack/[email protected] │ ├── UNMET DEPENDENCY @sentry/minimal@^5.12.0 │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] deduped │ ├── [email protected] │ ├── [email protected] │ ├── [email protected] │ ├─┬ [email protected] │ │ └── [email protected] │ ├── [email protected] │ └── [email protected] deduped
The method startSession exists since pre-v6 and the functionality (startSessionTracking) has been enabled by default in v6. I don't see any way that this could possibly happen as your package manager ranges are restricted to major versions so they should always resolve to v6. Is there a chance you could provide a minimal repro case?
Is there a chance you could provide a minimal repro case?
Yeah, I'll try to put something together over the next week or so that approaches the state of my project, and hopefully we can figure it out.
Thanks for trying to help, @kamilogorek and @iker-barriocanal!
@namoscato It's a long shot, but any chance you're running into this? https://github.com/getsentry/sentry-javascript/issues/3207#issuecomment-769044879
@lobsterkatie, that's a good thought but not the case.
I spent some more time with this and isolated the issue to a conflicting filestack-js dependency. Here's a simple sandbox that illustrates the issue. I haven't looked into their implementation yet and am happy to reach out to them about it, but do any of you have any thoughts / recommendations?
It's worth noting this issue seems to prevent a bunch of context from making its way to Sentry as well.
I'm guessing this scope configuration is at least causing the missing context issue? As mentioned here:
it is discouraged to interfere with the event context. If for some reason your library needs to inject context information, beware that this might override the user's context values
Heh. Yeah - https://github.com/filestack/filestack-js/blob/a11ebc0e61d73b31e7d63e488e81c4d90d3e69ad/package.json#L45. Good find.
I mean, yes, by far the simplest short-term fix is if you can convince them to upgrade to at least 5.27.0, as that was the release which introduced Hub.startSession. That doesn't fix the long-term issue, though.
This quarter we're working on the next major version of the SDK, and as part of that, we're going to re-examine the way we deal with situations like this, where there are competing Sentry instances on a page. I've added this (version conflicts) to our list of specific things to solve for in that process.
If you don't mind poking them to upgrade as a first step, let's start there and see if we can at least get you going again.
I've added this (version conflicts) to our list of specific things to solve for in that process.
That's fantastic, @lobsterkatie – thanks!
If you don't mind poking them to upgrade as a first step, let's start there and see if we can at least get you going again.
I think https://github.com/filestack/filestack-js/issues/416 summarizes the issue(s), but let me know if I'm misinterpreting anything.
I have exactly the same problem here (on using the combination Sentry + FileStack) It has been a week, any update so far?
Since the work is now in the filestack end of things, I'm going to close this. Please let me know if problems persist after they upgrade.
Cool, thanks for the help and attention, @lobsterkatie!
I just had this issue without using any react or other fancy stuff. Only happened when serving the script from aws but not when serving from localhost (checked the md5sum, was same script).
I already spent too much time on debugging this so I won't bother trying to reproduce, I just removed sentry from that script.
I encountered the issue again and it seems to happen every time when there are 2 sentry installations in the same DOM and one of them is react-sentry
2 sentry installations in the same DOM and one of them is react-sentry
@danieltroger, what's the other installation?
@namoscato I don't really know, but the issue occures on two sites that both use react and have sentry, so I assumed it would be the same @sentry/react that this issue was talking about.
Here is how you can reproduce the error:
go to https://houdinisportswear.com/sv-se or go to https://www.paulbrunngard.com/se
and copy and paste the code block below into the dev console.
(You will have to first replace INSERT_DSN_HERE with a valid dsn or sentry will complain)
You will see that it throws the error Uncaught TypeError: t.startSession is not a function.
When you paste it into another site, like this github issue site you're currently on, it does not happen.
!function(){var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{};function e(t,e,n){Object.defineProperty(t,e,{get:n,enumerable:!0})}var n={},r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
******************************************************************************/function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};function s(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)s.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return s}function u(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(a(arguments[e]));return t}var c,p,l,f,h,d,v={};(p=c||(c={})).Ok="ok",p.Exited="exited",p.Crashed="crashed",p.Abnormal="abnormal",(f=l||(l={})).Fatal="fatal",f.Error="error",f.Warning="warning",f.Log="log",f.Info="info",f.Debug="debug",f.Critical="critical",function(t){t.fromString=function(e){switch(e){case"debug":return t.Debug;case"info":return t.Info;case"warn":case"warning":return t.Warning;case"error":return t.Error;case"fatal":return t.Fatal;case"critical":return t.Critical;case"log":default:return t.Log}}}(l||(l={})),(d=h||(h={})).Unknown="unknown",d.Skipped="skipped",d.Success="success",d.RateLimit="rate_limit",d.Invalid="invalid",d.Failed="failed",function(t){t.fromHttpCode=function(e){return e>=200&&e<300?t.Success:429===e?t.RateLimit:e>=400&&e<500?t.Invalid:e>=500?t.Failed:t.Unknown}}(h||(h={}));var _={};function y(t){switch(Object.prototype.toString.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return R(t,Error)}}function g(t){return"[object ErrorEvent]"===Object.prototype.toString.call(t)}function m(t){return"[object DOMError]"===Object.prototype.toString.call(t)}function b(t){return"[object DOMException]"===Object.prototype.toString.call(t)}function E(t){return"[object String]"===Object.prototype.toString.call(t)}function x(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function S(t){return"[object Object]"===Object.prototype.toString.call(t)}function w(t){return"undefined"!=typeof Event&&R(t,Event)}function k(t){return"undefined"!=typeof Element&&R(t,Element)}function T(t){return"[object RegExp]"===Object.prototype.toString.call(t)}function O(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function j(t){return S(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function R(t,e){try{return t instanceof e}catch(t){return!1}}function I(t){try{for(var e=t,n=[],r=0,o=0,i=" > ".length,s=void 0;e&&r++<5&&!("html"===(s=N(e))||r>1&&o+n.length*i+s.length>=80);)n.push(s),o+=s.length,e=e.parentNode;return n.reverse().join(" > ")}catch(t){return"<unknown>"}}function N(t){var e,n,r,o,i,s=t,a=[];if(!s||!s.tagName)return"";if(a.push(s.tagName.toLowerCase()),s.id&&a.push("#"+s.id),(e=s.className)&&E(e))for(n=e.split(/\s+/),i=0;i<n.length;i++)a.push("."+n[i]);var u=["type","name","title","alt"];for(i=0;i<u.length;i++)r=u[i],(o=s.getAttribute(r))&&a.push("["+r+'="'+o+'"]');return a.join("")}e(_,"isError",(function(){return y})),e(_,"isErrorEvent",(function(){return g})),e(_,"isDOMError",(function(){return m})),e(_,"isDOMException",(function(){return b})),e(_,"isString",(function(){return E})),e(_,"isPrimitive",(function(){return x})),e(_,"isPlainObject",(function(){return S})),e(_,"isEvent",(function(){return w})),e(_,"isElement",(function(){return k})),e(_,"isRegExp",(function(){return T})),e(_,"isThenable",(function(){return O})),e(_,"isSyntheticEvent",(function(){return j})),e(_,"isInstanceOf",(function(){return R})),e({},"htmlTreeAsString",(function(){return I}));var D=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){return t.__proto__=e,t}:function(t,e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n]);return t});var L=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return r.message=e,r.name=n.prototype.constructor.name,D(r,n.prototype),r}return o(e,t),e}(Error);e({},"SentryError",(function(){return L}));var C=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/,U="Invalid Dsn",P=function(){function t(t){"string"==typeof t?this._fromString(t):this._fromComponents(t),this._validate()}return t.prototype.toString=function(t){void 0===t&&(t=!1);var e=this,n=e.host,r=e.path,o=e.pass,i=e.port,s=e.projectId;return e.protocol+"://"+e.publicKey+(t&&o?":"+o:"")+"@"+n+(i?":"+i:"")+"/"+(r?r+"/":r)+s},t.prototype._fromString=function(t){var e=C.exec(t);if(!e)throw new L(U);var n=a(e.slice(1),6),r=n[0],o=n[1],i=n[2],s=void 0===i?"":i,u=n[3],c=n[4],p=void 0===c?"":c,l="",f=n[5],h=f.split("/");if(h.length>1&&(l=h.slice(0,-1).join("/"),f=h.pop()),f){var d=f.match(/^\d+/);d&&(f=d[0])}this._fromComponents({host:u,pass:s,path:l,projectId:f,port:p,protocol:r,publicKey:o})},t.prototype._fromComponents=function(t){"user"in t&&!("publicKey"in t)&&(t.publicKey=t.user),this.user=t.publicKey||"",this.protocol=t.protocol,this.publicKey=t.publicKey||"",this.pass=t.pass||"",this.host=t.host,this.port=t.port||"",this.path=t.path||"",this.projectId=t.projectId},t.prototype._validate=function(){var t=this;if(["protocol","publicKey","host","projectId"].forEach((function(e){if(!t[e])throw new L("Invalid Dsn: "+e+" missing")})),!this.projectId.match(/^\d+$/))throw new L("Invalid Dsn: Invalid projectId "+this.projectId);if("http"!==this.protocol&&"https"!==this.protocol)throw new L("Invalid Dsn: Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new L("Invalid Dsn: Invalid port "+this.port)},t}();e({},"Dsn",(function(){return P}));var A,M,F,H={},B={},q=A={};function W(){throw new Error("setTimeout has not been defined")}function Y(){throw new Error("clearTimeout has not been defined")}function G(t){if(M===setTimeout)return setTimeout(t,0);if((M===W||!M)&&setTimeout)return M=setTimeout,setTimeout(t,0);try{return M(t,0)}catch(e){try{return M.call(null,t,0)}catch(e){return M.call(this,t,0)}}}!function(){try{M="function"==typeof setTimeout?setTimeout:W}catch(t){M=W}try{F="function"==typeof clearTimeout?clearTimeout:Y}catch(t){F=Y}}();var J,X=[],K=!1,z=-1;function $(){K&&J&&(K=!1,J.length?X=J.concat(X):z=-1,X.length&&V())}function V(){if(!K){var t=G($);K=!0;for(var e=X.length;e;){for(J=X,X=[];++z<e;)J&&J[z].run();z=-1,e=X.length}J=null,K=!1,function(t){if(F===clearTimeout)return clearTimeout(t);if((F===Y||!F)&&clearTimeout)return F=clearTimeout,clearTimeout(t);try{F(t)}catch(e){try{return F.call(null,t)}catch(e){return F.call(this,t)}}}(t)}}function Q(t,e){this.fun=t,this.array=e}function Z(){}q.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];X.push(new Q(t,e)),1!==X.length||K||G(V)},Q.prototype.run=function(){this.fun.apply(null,this.array)},q.title="browser",q.browser=!0,q.env={},q.argv=[],q.version="",q.versions={},q.on=Z,q.addListener=Z,q.once=Z,q.off=Z,q.removeListener=Z,q.removeAllListeners=Z,q.emit=Z,q.prependListener=Z,q.prependOnceListener=Z,q.listeners=function(t){return[]},q.binding=function(t){throw new Error("process.binding is not supported")},q.cwd=function(){return"/"},q.chdir=function(t){throw new Error("process.chdir is not supported")},q.umask=function(){return 0};var tt=A;function et(){return"[object process]"===Object.prototype.toString.call(void 0!==tt?tt:0)}function nt(t,e){return t.require(e)}e(B,"isNodeEnv",(function(){return et})),e(B,"dynamicRequire",(function(){return nt}));var rt={};function ot(t,e){return void 0===e&&(e=0),"string"!=typeof t||0===e||t.length<=e?t:t.substr(0,e)+"..."}function it(t,e){var n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);var o=Math.max(e-60,0);o<5&&(o=0);var i=Math.min(o+140,r);return i>r-5&&(i=r),i===r&&(o=Math.max(i-140,0)),n=n.slice(o,i),o>0&&(n="'{snip} "+n),i<r&&(n+=" {snip}"),n}function st(t,e){if(!Array.isArray(t))return"";for(var n=[],r=0;r<t.length;r++){var o=t[r];try{n.push(String(o))}catch(t){n.push("[value cannot be serialized]")}}return n.join(e)}function at(t,e){return!!E(t)&&(T(e)?e.test(t):"string"==typeof e&&-1!==t.indexOf(e))}e(rt,"truncate",(function(){return ot})),e(rt,"snipLine",(function(){return it})),e(rt,"safeJoin",(function(){return st})),e(rt,"isMatchingPattern",(function(){return at}));var ut={};function ct(){return et()?t:"undefined"!=typeof window?window:"undefined"!=typeof self?self:ut}function pt(){var t=ct(),e=t.crypto||t.msCrypto;if(void 0!==e&&e.getRandomValues){var n=new Uint16Array(8);e.getRandomValues(n),n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(t){for(var e=t.toString(16);e.length<4;)e="0"+e;return e};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function lt(t){if(!t)return{};var e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};var n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],relative:e[5]+n+r}}function ft(t){if(t.message)return t.message;if(t.exception&&t.exception.values&&t.exception.values[0]){var e=t.exception.values[0];return e.type&&e.value?e.type+": "+e.value:e.type||e.value||t.event_id||"<unknown>"}return t.event_id||"<unknown>"}function ht(t){var e=ct();if(!("console"in e))return t();var n=e.console,r={};["debug","info","warn","error","log","assert"].forEach((function(t){t in e.console&&n[t].__sentry_original__&&(r[t]=n[t],n[t]=n[t].__sentry_original__)}));var o=t();return Object.keys(r).forEach((function(t){n[t]=r[t]})),o}function dt(t,e,n){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].value=t.exception.values[0].value||e||"",t.exception.values[0].type=t.exception.values[0].type||n||"Error"}function vt(t,e){void 0===e&&(e={});try{t.exception.values[0].mechanism=t.exception.values[0].mechanism||{},Object.keys(e).forEach((function(n){t.exception.values[0].mechanism[n]=e[n]}))}catch(t){}}function _t(){try{return document.location.href}catch(t){return""}}e(H,"getGlobalObject",(function(){return ct})),e(H,"uuid4",(function(){return pt})),e(H,"parseUrl",(function(){return lt})),e(H,"getEventDescription",(function(){return ft})),e(H,"consoleSandbox",(function(){return ht})),e(H,"addExceptionTypeValue",(function(){return dt})),e(H,"addExceptionMechanism",(function(){return vt})),e(H,"getLocationHref",(function(){return _t}));function yt(t,e){if(!e)return 6e4;var n=parseInt(""+e,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+e);return isNaN(r)?6e4:r-t}e(H,"parseRetryAfterHeader",(function(){return yt}));var gt=ct(),mt=function(){function t(){this._enabled=!1}return t.prototype.disable=function(){this._enabled=!1},t.prototype.enable=function(){this._enabled=!0},t.prototype.log=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&ht((function(){gt.console.log("Sentry Logger [Log]: "+t.join(" "))}))},t.prototype.warn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&ht((function(){gt.console.warn("Sentry Logger [Warn]: "+t.join(" "))}))},t.prototype.error=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this._enabled&&ht((function(){gt.console.error("Sentry Logger [Error]: "+t.join(" "))}))},t}();gt.__SENTRY__=gt.__SENTRY__||{};var bt=gt.__SENTRY__.logger||(gt.__SENTRY__.logger=new mt);e({},"logger",(function(){return bt}));var Et={},xt=function(){function t(){this._hasWeakSet="function"==typeof WeakSet,this._inner=this._hasWeakSet?new WeakSet:[]}return t.prototype.memoize=function(t){if(this._hasWeakSet)return!!this._inner.has(t)||(this._inner.add(t),!1);for(var e=0;e<this._inner.length;e++){if(this._inner[e]===t)return!0}return this._inner.push(t),!1},t.prototype.unmemoize=function(t){if(this._hasWeakSet)this._inner.delete(t);else for(var e=0;e<this._inner.length;e++)if(this._inner[e]===t){this._inner.splice(e,1);break}},t}();e({},"Memo",(function(){return xt}));var St="<anonymous>";function wt(t){try{return t&&"function"==typeof t&&t.name||St}catch(t){return St}}function kt(t,e,n){if(e in t){var r=t[e],o=n(r);if("function"==typeof o)try{o.prototype=o.prototype||{},Object.defineProperties(o,{__sentry_original__:{enumerable:!1,value:r}})}catch(t){}t[e]=o}}function Tt(t){return Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&")}function Ot(t){if(y(t)){var e=t,n={message:e.message,name:e.name,stack:e.stack};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}if(w(t)){var o=t,i={};i.type=o.type;try{i.target=k(o.target)?I(o.target):Object.prototype.toString.call(o.target)}catch(t){i.target="<unknown>"}try{i.currentTarget=k(o.currentTarget)?I(o.currentTarget):Object.prototype.toString.call(o.currentTarget)}catch(t){i.currentTarget="<unknown>"}for(var r in"undefined"!=typeof CustomEvent&&R(t,CustomEvent)&&(i.detail=o.detail),o)Object.prototype.hasOwnProperty.call(o,r)&&(i[r]=o);return i}return t}function jt(t){return function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(t))}function Rt(t,e,n){void 0===e&&(e=3),void 0===n&&(n=102400);var r=Dt(t,e);return jt(r)>n?Rt(t,e-1,n):r}function It(e,n){return"domain"===n&&e&&"object"==typeof e&&e._events?"[Domain]":"domainEmitter"===n?"[DomainEmitter]":void 0!==t&&e===t?"[Global]":"undefined"!=typeof window&&e===window?"[Window]":"undefined"!=typeof document&&e===document?"[Document]":j(e)?"[SyntheticEvent]":"number"==typeof e&&e!=e?"[NaN]":void 0===e?"[undefined]":"function"==typeof e?"[Function: "+wt(e)+"]":"symbol"==typeof e?"["+String(e)+"]":"bigint"==typeof e?"[BigInt: "+String(e)+"]":e}function Nt(t,e,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=new xt),0===n)return function(t){var e=Object.prototype.toString.call(t);if("string"==typeof t)return t;if("[object Object]"===e)return"[Object]";if("[object Array]"===e)return"[Array]";var n=It(t);return x(n)?n:e}(e);if(null!=e&&"function"==typeof e.toJSON)return e.toJSON();var o=It(e,t);if(x(o))return o;var i=Ot(e),s=Array.isArray(e)?[]:{};if(r.memoize(e))return"[Circular ~]";for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&(s[a]=Nt(a,i[a],n-1,r));return r.unmemoize(e),s}function Dt(t,e){try{return JSON.parse(JSON.stringify(t,(function(t,n){return Nt(t,n,e)})))}catch(t){return"**non-serializable**"}}function Lt(t,e){void 0===e&&(e=40);var n=Object.keys(Ot(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return ot(n[0],e);for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(!(o.length>e))return r===n.length?o:ot(o,e)}return""}function Ct(t){var e,n;if(S(t)){var r=t,o={};try{for(var i=s(Object.keys(r)),a=i.next();!a.done;a=i.next()){var u=a.value;void 0!==r[u]&&(o[u]=Ct(r[u]))}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return o}return Array.isArray(t)?t.map(Ct):t}e({},"getFunctionName",(function(){return wt})),e(Et,"fill",(function(){return kt})),e(Et,"urlEncode",(function(){return Tt})),e(Et,"normalizeToSize",(function(){return Rt})),e(Et,"normalize",(function(){return Dt})),e(Et,"extractExceptionKeysForMessage",(function(){return Lt})),e(Et,"dropUndefinedKeys",(function(){return Ct}));var Ut={};function Pt(){if(!("fetch"in ct()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}function At(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Mt(){if(!Pt())return!1;var t=ct();if(At(t.fetch))return!0;var e=!1,n=t.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(e=At(r.contentWindow.fetch)),n.head.removeChild(r)}catch(t){bt.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return e}function Ft(){if(!Pt())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(t){return!1}}function Ht(){var t=ct(),e=t.chrome,n=e&&e.app&&e.app.runtime,r="history"in t&&!!t.history.pushState&&!!t.history.replaceState;return!n&&r}e(Ut,"supportsFetch",(function(){return Pt})),e(Ut,"supportsNativeFetch",(function(){return Mt})),e(Ut,"supportsReferrerPolicy",(function(){return Ft})),e(Ut,"supportsHistory",(function(){return Ht}));var Bt,qt=ct(),Wt={},Yt={};function Gt(t){if(!Yt[t])switch(Yt[t]=!0,t){case"console":!function(){if(!("console"in qt))return;["debug","info","warn","error","log","assert"].forEach((function(t){t in qt.console&&kt(qt.console,t,(function(e){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];Xt("console",{args:n,level:t}),e&&Function.prototype.apply.call(e,qt.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in qt))return;var t=Xt.bind(null,"dom"),e=Qt(t,!0);qt.document.addEventListener("click",e,!1),qt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((function(e){var n=qt[e]&&qt[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(kt(n,"addEventListener",(function(e){return function(n,r,o){if("click"===n||"keypress"==n)try{var i=this,s=i.__sentry_instrumentation_handlers__=i.__sentry_instrumentation_handlers__||{},a=s[n]=s[n]||{refCount:0};if(!a.handler){var u=Qt(t);a.handler=u,e.call(this,n,u,o)}a.refCount+=1}catch(t){}return e.call(this,n,r,o)}})),kt(n,"removeEventListener",(function(t){return function(e,n,r){if("click"===e||"keypress"==e)try{var o=this,i=o.__sentry_instrumentation_handlers__||{},s=i[e];s&&(s.refCount-=1,s.refCount<=0&&(t.call(this,e,s.handler,r),s.handler=void 0,delete i[e]),0===Object.keys(i).length&&delete o.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,e,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in qt))return;var t=[],e=[],n=XMLHttpRequest.prototype;kt(n,"open",(function(n){return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];var i=this,s=r[1];i.__sentry_xhr__={method:E(r[0])?r[0].toUpperCase():r[0],url:r[1]},E(s)&&"POST"===i.__sentry_xhr__.method&&s.match(/sentry_key/)&&(i.__sentry_own_request__=!0);var a=function(){if(4===i.readyState){try{i.__sentry_xhr__&&(i.__sentry_xhr__.status_code=i.status)}catch(t){}try{var n=t.indexOf(i);if(-1!==n){t.splice(n);var o=e.splice(n)[0];i.__sentry_xhr__&&void 0!==o[0]&&(i.__sentry_xhr__.body=o[0])}}catch(t){}Xt("xhr",{args:r,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:i})}};return"onreadystatechange"in i&&"function"==typeof i.onreadystatechange?kt(i,"onreadystatechange",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return a(),t.apply(i,e)}})):i.addEventListener("readystatechange",a),n.apply(i,r)}})),kt(n,"send",(function(n){return function(){for(var r=[],o=0;o<arguments.length;o++)r[o]=arguments[o];return t.push(this),e.push(r),Xt("xhr",{args:r,startTimestamp:Date.now(),xhr:this}),n.apply(this,r)}}))}();break;case"fetch":!function(){if(!Mt())return;kt(qt,"fetch",(function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r={args:e,fetchData:{method:Kt(e),url:zt(e)},startTimestamp:Date.now()};return Xt("fetch",i({},r)),t.apply(qt,e).then((function(t){return Xt("fetch",i(i({},r),{endTimestamp:Date.now(),response:t})),t}),(function(t){throw Xt("fetch",i(i({},r),{endTimestamp:Date.now(),error:t})),t}))}}))}();break;case"history":!function(){if(!Ht())return;var t=qt.onpopstate;function e(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e.length>2?e[2]:void 0;if(r){var o=Bt,i=String(r);Bt=i,Xt("history",{from:o,to:i})}return t.apply(this,e)}}qt.onpopstate=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=qt.location.href,o=Bt;if(Bt=r,Xt("history",{from:o,to:r}),t)return t.apply(this,e)},kt(qt.history,"pushState",e),kt(qt.history,"replaceState",e)}();break;case"error":Zt=qt.onerror,qt.onerror=function(t,e,n,r,o){return Xt("error",{column:r,error:o,line:n,msg:t,url:e}),!!Zt&&Zt.apply(this,arguments)};break;case"unhandledrejection":te=qt.onunhandledrejection,qt.onunhandledrejection=function(t){return Xt("unhandledrejection",t),!te||te.apply(this,arguments)};break;default:bt.warn("unknown instrumentation type:",t)}}function Jt(t){t&&"string"==typeof t.type&&"function"==typeof t.callback&&(Wt[t.type]=Wt[t.type]||[],Wt[t.type].push(t.callback),Gt(t.type))}function Xt(t,e){var n,r;if(t&&Wt[t])try{for(var o=s(Wt[t]||[]),i=o.next();!i.done;i=o.next()){var a=i.value;try{a(e)}catch(e){bt.error("Error while triggering instrumentation handler.\nType: "+t+"\nName: "+wt(a)+"\nError: "+e)}}}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function Kt(t){return void 0===t&&(t=[]),"Request"in qt&&R(t[0],Request)&&t[0].method?String(t[0].method).toUpperCase():t[1]&&t[1].method?String(t[1].method).toUpperCase():"GET"}function zt(t){return void 0===t&&(t=[]),"string"==typeof t[0]?t[0]:"Request"in qt&&R(t[0],Request)?t[0].url:String(t[0])}e({},"addInstrumentationHandler",(function(){return Jt}));var $t,Vt;function Qt(t,e){return void 0===e&&(e=!1),function(n){if(n&&Vt!==n&&!function(t){if("keypress"!==t.type)return!1;try{var e=t.target;if(!e||!e.tagName)return!0;if("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)return!1}catch(t){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===$t||function(t,e){if(!t)return!0;if(t.type!==e.type)return!0;try{if(t.target!==e.target)return!0}catch(t){}return!1}(Vt,n))&&(t({event:n,name:r,global:e}),Vt=n),clearTimeout($t),$t=qt.setTimeout((function(){$t=void 0}),1e3)}}}var Zt=null;var te=null;var ee,ne;(ne=ee||(ee={})).PENDING="PENDING",ne.RESOLVED="RESOLVED",ne.REJECTED="REJECTED";var re=function(){function t(t){var e=this;this._state=ee.PENDING,this._handlers=[],this._resolve=function(t){e._setResult(ee.RESOLVED,t)},this._reject=function(t){e._setResult(ee.REJECTED,t)},this._setResult=function(t,n){e._state===ee.PENDING&&(O(n)?n.then(e._resolve,e._reject):(e._state=t,e._value=n,e._executeHandlers()))},this._attachHandler=function(t){e._handlers=e._handlers.concat(t),e._executeHandlers()},this._executeHandlers=function(){if(e._state!==ee.PENDING){var t=e._handlers.slice();e._handlers=[],t.forEach((function(t){t.done||(e._state===ee.RESOLVED&&t.onfulfilled&&t.onfulfilled(e._value),e._state===ee.REJECTED&&t.onrejected&&t.onrejected(e._value),t.done=!0)}))}};try{t(this._resolve,this._reject)}catch(t){this._reject(t)}}return t.resolve=function(e){return new t((function(t){t(e)}))},t.reject=function(e){return new t((function(t,n){n(e)}))},t.all=function(e){return new t((function(n,r){if(Array.isArray(e))if(0!==e.length){var o=e.length,i=[];e.forEach((function(e,s){t.resolve(e).then((function(t){i[s]=t,0===(o-=1)&&n(i)})).then(null,r)}))}else n([]);else r(new TypeError("Promise.all requires an array as input."))}))},t.prototype.then=function(e,n){var r=this;return new t((function(t,o){r._attachHandler({done:!1,onfulfilled:function(n){if(e)try{return void t(e(n))}catch(t){return void o(t)}else t(n)},onrejected:function(e){if(n)try{return void t(n(e))}catch(t){return void o(t)}else o(e)}})}))},t.prototype.catch=function(t){return this.then((function(t){return t}),t)},t.prototype.finally=function(e){var n=this;return new t((function(t,r){var o,i;return n.then((function(t){i=!1,o=t,e&&e()}),(function(t){i=!0,o=t,e&&e()})).then((function(){i?r(o):t(o)}))}))},t.prototype.toString=function(){return"[object SyncPromise]"},t}();e({},"SyncPromise",(function(){return re}));var oe=function(){function t(t){this._limit=t,this._buffer=[]}return t.prototype.isReady=function(){return void 0===this._limit||this.length()<this._limit},t.prototype.add=function(t){var e=this;return this.isReady()?(-1===this._buffer.indexOf(t)&&this._buffer.push(t),t.then((function(){return e.remove(t)})).then(null,(function(){return e.remove(t).then(null,(function(){}))})),t):re.reject(new L("Not adding Promise due to buffer limit reached."))},t.prototype.remove=function(t){return this._buffer.splice(this._buffer.indexOf(t),1)[0]},t.prototype.length=function(){return this._buffer.length},t.prototype.drain=function(t){var e=this;return new re((function(n){var r=setTimeout((function(){t&&t>0&&n(!1)}),t);re.all(e._buffer).then((function(){clearTimeout(r),n(!0)})).then(null,(function(){n(!0)}))}))},t}();e({},"PromiseBuffer",(function(){return oe}));var ie=function(){var t=this,n={exports:this};t.__esModule=!0;var r={nowSeconds:function(){return Date.now()/1e3}};var o=et()?function(){try{return nt(n,"perf_hooks").performance}catch(t){return}}():function(){var t=ct().performance;if(t&&t.now)return{now:function(){return t.now()},timeOrigin:Date.now()-t.now()}}(),i=void 0===o?r:{nowSeconds:function(){return(o.timeOrigin+o.now())/1e3}},s=r.nowSeconds.bind(r);e(t,"dateTimestampInSeconds",(function(){return s}));var a=i.nowSeconds.bind(i);e(t,"timestampInSeconds",(function(){return a}));var u=a;e(t,"timestampWithMs",(function(){return u}));var c=void 0!==o;e(t,"usingPerformanceAPI",(function(){return c}));var p=function(){var t=ct().performance;if(t)return t.timeOrigin?t.timeOrigin:t.timing&&t.timing.navigationStart||Date.now()}();return e(t,"browserPerformanceTimeOrigin",(function(){return p})),n.exports}.call({}),se=function(){function t(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return t.clone=function(e){var n=new t;return e&&(n._breadcrumbs=u(e._breadcrumbs),n._tags=i({},e._tags),n._extra=i({},e._extra),n._contexts=i({},e._contexts),n._user=e._user,n._level=e._level,n._span=e._span,n._session=e._session,n._transactionName=e._transactionName,n._fingerprint=e._fingerprint,n._eventProcessors=u(e._eventProcessors)),n},t.prototype.addScopeListener=function(t){this._scopeListeners.push(t)},t.prototype.addEventProcessor=function(t){return this._eventProcessors.push(t),this},t.prototype.setUser=function(t){return this._user=t||{},this._session&&this._session.update({user:t}),this._notifyScopeListeners(),this},t.prototype.getUser=function(){return this._user},t.prototype.setTags=function(t){return this._tags=i(i({},this._tags),t),this._notifyScopeListeners(),this},t.prototype.setTag=function(t,e){var n;return this._tags=i(i({},this._tags),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setExtras=function(t){return this._extra=i(i({},this._extra),t),this._notifyScopeListeners(),this},t.prototype.setExtra=function(t,e){var n;return this._extra=i(i({},this._extra),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setFingerprint=function(t){return this._fingerprint=t,this._notifyScopeListeners(),this},t.prototype.setLevel=function(t){return this._level=t,this._notifyScopeListeners(),this},t.prototype.setTransactionName=function(t){return this._transactionName=t,this._notifyScopeListeners(),this},t.prototype.setTransaction=function(t){return this.setTransactionName(t)},t.prototype.setContext=function(t,e){var n;return null===e?delete this._contexts[t]:this._contexts=i(i({},this._contexts),((n={})[t]=e,n)),this._notifyScopeListeners(),this},t.prototype.setSpan=function(t){return this._span=t,this._notifyScopeListeners(),this},t.prototype.getSpan=function(){return this._span},t.prototype.getTransaction=function(){var t,e,n,r,o=this.getSpan();return(null===(t=o)||void 0===t?void 0:t.transaction)?null===(e=o)||void 0===e?void 0:e.transaction:(null===(r=null===(n=o)||void 0===n?void 0:n.spanRecorder)||void 0===r?void 0:r.spans[0])?o.spanRecorder.spans[0]:void 0},t.prototype.setSession=function(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this},t.prototype.getSession=function(){return this._session},t.prototype.update=function(e){if(!e)return this;if("function"==typeof e){var n=e(this);return n instanceof t?n:this}return e instanceof t?(this._tags=i(i({},this._tags),e._tags),this._extra=i(i({},this._extra),e._extra),this._contexts=i(i({},this._contexts),e._contexts),e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint)):S(e)&&(e=e,this._tags=i(i({},this._tags),e.tags),this._extra=i(i({},this._extra),e.extra),this._contexts=i(i({},this._contexts),e.contexts),e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint)),this},t.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},t.prototype.addBreadcrumb=function(t,e){var n=i({timestamp:ie.dateTimestampInSeconds()},t);return this._breadcrumbs=void 0!==e&&e>=0?u(this._breadcrumbs,[n]).slice(-e):u(this._breadcrumbs,[n]),this._notifyScopeListeners(),this},t.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},t.prototype.applyToEvent=function(t,e){var n;if(this._extra&&Object.keys(this._extra).length&&(t.extra=i(i({},this._extra),t.extra)),this._tags&&Object.keys(this._tags).length&&(t.tags=i(i({},this._tags),t.tags)),this._user&&Object.keys(this._user).length&&(t.user=i(i({},this._user),t.user)),this._contexts&&Object.keys(this._contexts).length&&(t.contexts=i(i({},this._contexts),t.contexts)),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts=i({trace:this._span.getTraceContext()},t.contexts);var r=null===(n=this._span.transaction)||void 0===n?void 0:n.name;r&&(t.tags=i({transaction:r},t.tags))}return this._applyFingerprint(t),t.breadcrumbs=u(t.breadcrumbs||[],this._breadcrumbs),t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,this._notifyEventProcessors(u(ae(),this._eventProcessors),t,e)},t.prototype._notifyEventProcessors=function(t,e,n,r){var o=this;return void 0===r&&(r=0),new re((function(s,a){var u=t[r];if(null===e||"function"!=typeof u)s(e);else{var c=u(i({},e),n);O(c)?c.then((function(e){return o._notifyEventProcessors(t,e,n,r+1).then(s)})).then(null,a):o._notifyEventProcessors(t,c,n,r+1).then(s).then(null,a)}}))},t.prototype._notifyScopeListeners=function(){var t=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(e){e(t)})),this._notifyingListeners=!1)},t.prototype._applyFingerprint=function(t){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint},t}();function ae(){var t=ct();return t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.globalEventProcessors=t.__SENTRY__.globalEventProcessors||[],t.__SENTRY__.globalEventProcessors}function ue(t){ae().push(t)}var ce=function(){function t(t){this.errors=0,this.sid=pt(),this.timestamp=Date.now(),this.started=Date.now(),this.duration=0,this.status=c.Ok,this.init=!0,t&&this.update(t)}return t.prototype.update=function(t){void 0===t&&(t={}),t.user&&(t.user.ip_address&&(this.ipAddress=t.user.ip_address),t.did||(this.did=t.user.id||t.user.email||t.user.username)),this.timestamp=t.timestamp||Date.now(),t.sid&&(this.sid=32===t.sid.length?t.sid:pt()),void 0!==t.init&&(this.init=t.init),t.did&&(this.did=""+t.did),"number"==typeof t.started&&(this.started=t.started),"number"==typeof t.duration?this.duration=t.duration:this.duration=this.timestamp-this.started,t.release&&(this.release=t.release),t.environment&&(this.environment=t.environment),t.ipAddress&&(this.ipAddress=t.ipAddress),t.userAgent&&(this.userAgent=t.userAgent),"number"==typeof t.errors&&(this.errors=t.errors),t.status&&(this.status=t.status)},t.prototype.close=function(t){t?this.update({status:t}):this.status===c.Ok?this.update({status:c.Exited}):this.update()},t.prototype.toJSON=function(){return Ct({sid:""+this.sid,init:this.init,started:new Date(this.started).toISOString(),timestamp:new Date(this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:Ct({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},t}(),pe=function(){function t(t,e,n){void 0===e&&(e=new se),void 0===n&&(n=3),this._version=n,this._stack=[{}],this.getStackTop().scope=e,this.bindClient(t)}return t.prototype.isOlderThan=function(t){return this._version<t},t.prototype.bindClient=function(t){this.getStackTop().client=t,t&&t.setupIntegrations&&t.setupIntegrations()},t.prototype.pushScope=function(){var t=se.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t},t.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},t.prototype.withScope=function(t){var e=this.pushScope();try{t(e)}finally{this.popScope()}},t.prototype.getClient=function(){return this.getStackTop().client},t.prototype.getScope=function(){return this.getStackTop().scope},t.prototype.getStack=function(){return this._stack},t.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},t.prototype.captureException=function(t,e){var n=this._lastEventId=pt(),r=e;if(!e){var o=void 0;try{throw new Error("Sentry syntheticException")}catch(t){o=t}r={originalException:t,syntheticException:o}}return this._invokeClient("captureException",t,i(i({},r),{event_id:n})),n},t.prototype.captureMessage=function(t,e,n){var r=this._lastEventId=pt(),o=n;if(!n){var s=void 0;try{throw new Error(t)}catch(t){s=t}o={originalException:t,syntheticException:s}}return this._invokeClient("captureMessage",t,e,i(i({},o),{event_id:r})),r},t.prototype.captureEvent=function(t,e){var n=this._lastEventId=pt();return this._invokeClient("captureEvent",t,i(i({},e),{event_id:n})),n},t.prototype.lastEventId=function(){return this._lastEventId},t.prototype.addBreadcrumb=function(t,e){var n=this.getStackTop(),r=n.scope,o=n.client;if(r&&o){var s=o.getOptions&&o.getOptions()||{},a=s.beforeBreadcrumb,u=void 0===a?null:a,c=s.maxBreadcrumbs,p=void 0===c?100:c;if(!(p<=0)){var l=ie.dateTimestampInSeconds(),f=i({timestamp:l},t),h=u?ht((function(){return u(f,e)})):f;null!==h&&r.addBreadcrumb(h,Math.min(p,100))}}},t.prototype.setUser=function(t){var e=this.getScope();e&&e.setUser(t)},t.prototype.setTags=function(t){var e=this.getScope();e&&e.setTags(t)},t.prototype.setExtras=function(t){var e=this.getScope();e&&e.setExtras(t)},t.prototype.setTag=function(t,e){var n=this.getScope();n&&n.setTag(t,e)},t.prototype.setExtra=function(t,e){var n=this.getScope();n&&n.setExtra(t,e)},t.prototype.setContext=function(t,e){var n=this.getScope();n&&n.setContext(t,e)},t.prototype.configureScope=function(t){var e=this.getStackTop(),n=e.scope,r=e.client;n&&r&&t(n)},t.prototype.run=function(t){var e=fe(this);try{t(this)}finally{fe(e)}},t.prototype.getIntegration=function(t){var e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(e){return bt.warn("Cannot retrieve integration "+t.id+" from the current Hub"),null}},t.prototype.startSpan=function(t){return this._callExtensionMethod("startSpan",t)},t.prototype.startTransaction=function(t,e){return this._callExtensionMethod("startTransaction",t,e)},t.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},t.prototype.captureSession=function(t){if(void 0===t&&(t=!1),t)return this.endSession();this._sendSessionUpdate()},t.prototype.endSession=function(){var t,e,n,r,o;null===(n=null===(e=null===(t=this.getStackTop())||void 0===t?void 0:t.scope)||void 0===e?void 0:e.getSession())||void 0===n||n.close(),this._sendSessionUpdate(),null===(o=null===(r=this.getStackTop())||void 0===r?void 0:r.scope)||void 0===o||o.setSession()},t.prototype.startSession=function(t){var e=this.getStackTop(),n=e.scope,r=e.client,o=r&&r.getOptions()||{},s=o.release,a=o.environment,u=new ce(i(i({release:s,environment:a},n&&{user:n.getUser()}),t));if(n){var p=n.getSession&&n.getSession();p&&p.status===c.Ok&&p.update({status:c.Exited}),this.endSession(),n.setSession(u)}return u},t.prototype._sendSessionUpdate=function(){var t=this.getStackTop(),e=t.scope,n=t.client;if(e){var r=e.getSession&&e.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},t.prototype._invokeClient=function(t){for(var e,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.getStackTop(),i=o.scope,s=o.client;s&&s[t]&&(e=s)[t].apply(e,u(n,[i]))},t.prototype._callExtensionMethod=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=le(),o=r.__SENTRY__;if(o&&o.extensions&&"function"==typeof o.extensions[t])return o.extensions[t].apply(this,e);bt.warn("Extension method "+t+" couldn't be found, doing nothing.")},t}();function le(){var t=ct();return t.__SENTRY__=t.__SENTRY__||{extensions:{},hub:void 0},t}function fe(t){var e=le(),n=ve(e);return _e(e,t),n}function he(){var t=le();return de(t)&&!ve(t).isOlderThan(3)||_e(t,new pe),et()?function(t){var e,n,r;try{var o=null===(r=null===(n=null===(e=le().__SENTRY__)||void 0===e?void 0:e.extensions)||void 0===n?void 0:n.domain)||void 0===r?void 0:r.active;if(!o)return ve(t);if(!de(o)||ve(o).isOlderThan(3)){var i=ve(t).getStackTop();_e(o,new pe(i.client,se.clone(i.scope)))}return ve(o)}catch(e){return ve(t)}}(t):ve(t)}function de(t){return!!(t&&t.__SENTRY__&&t.__SENTRY__.hub)}function ve(t){return t&&t.__SENTRY__&&t.__SENTRY__.hub||(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=new pe),t.__SENTRY__.hub}function _e(t,e){return!!t&&(t.__SENTRY__=t.__SENTRY__||{},t.__SENTRY__.hub=e,!0)}function ye(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=he();if(r&&r[t])return r[t].apply(r,u(e));throw new Error("No hub defined or "+t+" was not found on the hub, please open a bug report.")}function ge(t,e){var n;try{throw new Error("Sentry syntheticException")}catch(t){n=t}return ye("captureException",t,{captureContext:e,originalException:t,syntheticException:n})}function me(t,e){var n;try{throw new Error(t)}catch(t){n=t}return ye("captureMessage",t,"string"==typeof e?e:void 0,i({originalException:t,syntheticException:n},"string"!=typeof e?{captureContext:e}:void 0))}function be(t){return ye("captureEvent",t)}function Ee(t){ye("configureScope",t)}function xe(t){ye("addBreadcrumb",t)}function Se(t,e){ye("setContext",t,e)}function we(t){ye("setExtras",t)}function ke(t){ye("setTags",t)}function Te(t,e){ye("setExtra",t,e)}function Oe(t,e){ye("setTag",t,e)}function je(t){ye("setUser",t)}function Re(t){ye("withScope",t)}function Ie(t,e){return ye("startTransaction",i({},t),e)}var Ne=function(){function t(t,e){void 0===e&&(e={}),this.dsn=t,this._dsnObject=new P(t),this.metadata=e}return t.prototype.getDsn=function(){return this._dsnObject},t.prototype.getBaseApiEndpoint=function(){var t=this._dsnObject,e=t.protocol?t.protocol+":":"",n=t.port?":"+t.port:"";return e+"//"+t.host+n+(t.path?"/"+t.path:"")+"/api/"},t.prototype.getStoreEndpoint=function(){return this._getIngestEndpoint("store")},t.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return this.getStoreEndpoint()+"?"+this._encodedAuth()},t.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return this._getEnvelopeEndpoint()+"?"+this._encodedAuth()},t.prototype.getStoreEndpointPath=function(){var t=this._dsnObject;return(t.path?"/"+t.path:"")+"/api/"+t.projectId+"/store/"},t.prototype.getRequestHeaders=function(t,e){var n=this._dsnObject,r=["Sentry sentry_version=7"];return r.push("sentry_client="+t+"/"+e),r.push("sentry_key="+n.publicKey),n.pass&&r.push("sentry_secret="+n.pass),{"Content-Type":"application/json","X-Sentry-Auth":r.join(", ")}},t.prototype.getReportDialogEndpoint=function(t){void 0===t&&(t={});var e=this._dsnObject,n=this.getBaseApiEndpoint()+"embed/error-page/",r=[];for(var o in r.push("dsn="+e.toString()),t)if("dsn"!==o)if("user"===o){if(!t.user)continue;t.user.name&&r.push("name="+encodeURIComponent(t.user.name)),t.user.email&&r.push("email="+encodeURIComponent(t.user.email))}else r.push(encodeURIComponent(o)+"="+encodeURIComponent(t[o]));return r.length?n+"?"+r.join("&"):n},t.prototype._getEnvelopeEndpoint=function(){return this._getIngestEndpoint("envelope")},t.prototype._getIngestEndpoint=function(t){return""+this.getBaseApiEndpoint()+this._dsnObject.projectId+"/"+t+"/"},t.prototype._encodedAuth=function(){return Tt({sentry_key:this._dsnObject.publicKey,sentry_version:"7"})},t}(),De=[];function Le(t){var e={};return function(t){var e=t.defaultIntegrations&&u(t.defaultIntegrations)||[],n=t.integrations,r=[];if(Array.isArray(n)){var o=n.map((function(t){return t.name})),i=[];e.forEach((function(t){-1===o.indexOf(t.name)&&-1===i.indexOf(t.name)&&(r.push(t),i.push(t.name))})),n.forEach((function(t){-1===i.indexOf(t.name)&&(r.push(t),i.push(t.name))}))}else"function"==typeof n?(r=n(e),r=Array.isArray(r)?r:[r]):r=u(e);var s=r.map((function(t){return t.name})),a="Debug";return-1!==s.indexOf(a)&&r.push.apply(r,u(r.splice(s.indexOf(a),1))),r}(t).forEach((function(t){e[t.name]=t,function(t){-1===De.indexOf(t.name)&&(t.setupOnce(ue,he),De.push(t.name),bt.log("Integration installed: "+t.name))}(t)})),e}var Ce=function(){function t(t,e){this._integrations={},this._processing=0,this._backend=new t(e),this._options=e,e.dsn&&(this._dsn=new P(e.dsn))}return t.prototype.captureException=function(t,e,n){var r=this,o=e&&e.event_id;return this._process(this._getBackend().eventFromException(t,e).then((function(t){return r._captureEvent(t,e,n)})).then((function(t){o=t}))),o},t.prototype.captureMessage=function(t,e,n,r){var o=this,i=n&&n.event_id,s=x(t)?this._getBackend().eventFromMessage(String(t),e,n):this._getBackend().eventFromException(t,n);return this._process(s.then((function(t){return o._captureEvent(t,n,r)})).then((function(t){i=t}))),i},t.prototype.captureEvent=function(t,e,n){var r=e&&e.event_id;return this._process(this._captureEvent(t,e,n).then((function(t){r=t}))),r},t.prototype.captureSession=function(t){t.release?(this._sendSession(t),t.update({init:!1})):bt.warn("Discarded session because of missing release")},t.prototype.getDsn=function(){return this._dsn},t.prototype.getOptions=function(){return this._options},t.prototype.flush=function(t){var e=this;return this._isClientProcessing(t).then((function(n){return e._getBackend().getTransport().close(t).then((function(t){return n&&t}))}))},t.prototype.close=function(t){var e=this;return this.flush(t).then((function(t){return e.getOptions().enabled=!1,t}))},t.prototype.setupIntegrations=function(){this._isEnabled()&&(this._integrations=Le(this._options))},t.prototype.getIntegration=function(t){try{return this._integrations[t.id]||null}catch(e){return bt.warn("Cannot retrieve integration "+t.id+" from the current Client"),null}},t.prototype._updateSessionFromEvent=function(t,e){var n,r,o,a=!1,u=!1,p=e.exception&&e.exception.values;if(p){u=!0;try{for(var l=s(p),f=l.next();!f.done;f=l.next()){var h=f.value.mechanism;if(h&&!1===h.handled){a=!0;break}}}catch(t){n={error:t}}finally{try{f&&!f.done&&(r=l.return)&&r.call(l)}finally{if(n)throw n.error}}}var d=e.user;if(!t.userAgent){var v=e.request?e.request.headers:{};for(var _ in v)if("user-agent"===_.toLowerCase()){o=v[_];break}}t.update(i(i({},a&&{status:c.Crashed}),{user:d,userAgent:o,errors:t.errors+Number(u||a)})),this.captureSession(t)},t.prototype._sendSession=function(t){this._getBackend().sendSession(t)},t.prototype._isClientProcessing=function(t){var e=this;return new re((function(n){var r=0,o=setInterval((function(){0==e._processing?(clearInterval(o),n(!0)):(r+=1,t&&r>=t&&(clearInterval(o),n(!1)))}),1)}))},t.prototype._getBackend=function(){return this._backend},t.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},t.prototype._prepareEvent=function(t,e,n){var r=this,o=this.getOptions().normalizeDepth,s=void 0===o?3:o,a=i(i({},t),{event_id:t.event_id||(n&&n.event_id?n.event_id:pt()),timestamp:t.timestamp||ie.dateTimestampInSeconds()});this._applyClientOptions(a),this._applyIntegrationsMetadata(a);var u=e;n&&n.captureContext&&(u=se.clone(u).update(n.captureContext));var c=re.resolve(a);return u&&(c=u.applyToEvent(a,n)),c.then((function(t){return"number"==typeof s&&s>0?r._normalizeEvent(t,s):t}))},t.prototype._normalizeEvent=function(t,e){if(!t)return null;var n=i(i(i(i(i({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map((function(t){return i(i({},t),t.data&&{data:Dt(t.data,e)})}))}),t.user&&{user:Dt(t.user,e)}),t.contexts&&{contexts:Dt(t.contexts,e)}),t.extra&&{extra:Dt(t.extra,e)});return t.contexts&&t.contexts.trace&&(n.contexts.trace=t.contexts.trace),n},t.prototype._applyClientOptions=function(t){var e=this.getOptions(),n=e.environment,r=e.release,o=e.dist,i=e.maxValueLength,s=void 0===i?250:i;"environment"in t||(t.environment="environment"in e?n:"production"),void 0===t.release&&void 0!==r&&(t.release=r),void 0===t.dist&&void 0!==o&&(t.dist=o),t.message&&(t.message=ot(t.message,s));var a=t.exception&&t.exception.values&&t.exception.values[0];a&&a.value&&(a.value=ot(a.value,s));var u=t.request;u&&u.url&&(u.url=ot(u.url,s))},t.prototype._applyIntegrationsMetadata=function(t){var e=t.sdk,n=Object.keys(this._integrations);e&&n.length>0&&(e.integrations=n)},t.prototype._sendEvent=function(t){this._getBackend().sendEvent(t)},t.prototype._captureEvent=function(t,e,n){return this._processEvent(t,e,n).then((function(t){return t.event_id}),(function(t){bt.error(t)}))},t.prototype._processEvent=function(t,e,n){var r=this,o=this.getOptions(),i=o.beforeSend,s=o.sampleRate;if(!this._isEnabled())return re.reject(new L("SDK not enabled, will not send event."));var a="transaction"===t.type;return!a&&"number"==typeof s&&Math.random()>s?re.reject(new L("Discarding event because it's not included in the random sample (sampling rate = "+s+")")):this._prepareEvent(t,n,e).then((function(t){if(null===t)throw new L("An event processor returned null, will not send event.");if(e&&e.data&&!0===e.data.__sentry__||a||!i)return t;var n=i(t,e);if(void 0===n)throw new L("`beforeSend` method has to return `null` or a valid event.");return O(n)?n.then((function(t){return t}),(function(t){throw new L("beforeSend rejected with "+t)})):n})).then((function(t){if(null===t)throw new L("`beforeSend` returned `null`, will not send event.");var e=n&&n.getSession&&n.getSession();return!a&&e&&r._updateSessionFromEvent(e,t),r._sendEvent(t),t})).then(null,(function(t){if(t instanceof L)throw t;throw r.captureException(t,{data:{__sentry__:!0},originalException:t}),new L("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+t)}))},t.prototype._process=function(t){var e=this;this._processing+=1,t.then((function(t){return e._processing-=1,t}),(function(t){return e._processing-=1,t}))},t}(),Ue=function(){function t(){}return t.prototype.sendEvent=function(t){return re.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:h.Skipped})},t.prototype.close=function(t){return re.resolve(!0)},t}(),Pe=function(){function t(t){this._options=t,this._options.dsn||bt.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return t.prototype.eventFromException=function(t,e){throw new L("Backend has to implement `eventFromException` method")},t.prototype.eventFromMessage=function(t,e,n){throw new L("Backend has to implement `eventFromMessage` method")},t.prototype.sendEvent=function(t){this._transport.sendEvent(t).then(null,(function(t){bt.error("Error while sending event: "+t)}))},t.prototype.sendSession=function(t){this._transport.sendSession?this._transport.sendSession(t).then(null,(function(t){bt.error("Error while sending session: "+t)})):bt.warn("Dropping session because custom transport doesn't implement sendSession")},t.prototype.getTransport=function(){return this._transport},t.prototype._setupTransport=function(){return new Ue},t}();function Ae(t){if(t.metadata&&t.metadata.sdk){var e=t.metadata.sdk;return{name:e.name,version:e.version}}}function Me(t,e){return e?(t.sdk=t.sdk||{name:e.name,version:e.version},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=u(t.sdk.integrations||[],e.integrations||[]),t.sdk.packages=u(t.sdk.packages||[],e.packages||[]),t):t}function Fe(t,e){var n=Ae(e);return{body:JSON.stringify(i({sent_at:(new Date).toISOString()},n&&{sdk:n}))+"\n"+JSON.stringify({type:"session"})+"\n"+JSON.stringify(t),type:"session",url:e.getEnvelopeEndpointWithUrlEncodedAuth()}}function He(t,e){var n=Ae(e),r=t.type||"event",o="transaction"===r,s=t.debug_meta||{},a=s.transactionSampling,u=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n}(s,["transactionSampling"]),c=a||{},p=c.method,l=c.rate;0===Object.keys(u).length?delete t.debug_meta:t.debug_meta=u;var f={body:JSON.stringify(n?Me(t,e.metadata.sdk):t),type:r,url:o?e.getEnvelopeEndpointWithUrlEncodedAuth():e.getStoreEndpointWithUrlEncodedAuth()};if(o){var h=JSON.stringify(i({event_id:t.event_id,sent_at:(new Date).toISOString()},n&&{sdk:n}))+"\n"+JSON.stringify({type:t.type,sample_rates:[{id:p,rate:l}]})+"\n"+f.body;f.body=h}return f}var Be,qe="6.1.0",We={},Ye=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){Be=Function.prototype.toString,Function.prototype.toString=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=this.__sentry_original__||this;return Be.apply(n,t)}},t.id="FunctionToString",t}(),Ge=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],Je=function(){function t(e){void 0===e&&(e={}),this._options=e,this.name=t.id}return t.prototype.setupOnce=function(){ue((function(e){var n=he();if(!n)return e;var r=n.getIntegration(t);if(r){var o=n.getClient(),i=o?o.getOptions():{},s=r._mergeOptions(i);if(r._shouldDropEvent(e,s))return null}return e}))},t.prototype._shouldDropEvent=function(t,e){return this._isSentryError(t,e)?(bt.warn("Event dropped due to being internal Sentry Error.\nEvent: "+ft(t)),!0):this._isIgnoredError(t,e)?(bt.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+ft(t)),!0):this._isDeniedUrl(t,e)?(bt.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+ft(t)+".\nUrl: "+this._getEventFilterUrl(t)),!0):!this._isAllowedUrl(t,e)&&(bt.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+ft(t)+".\nUrl: "+this._getEventFilterUrl(t)),!0)},t.prototype._isSentryError=function(t,e){if(!e.ignoreInternal)return!1;try{return t&&t.exception&&t.exception.values&&t.exception.values[0]&&"SentryError"===t.exception.values[0].type||!1}catch(t){return!1}},t.prototype._isIgnoredError=function(t,e){return!(!e.ignoreErrors||!e.ignoreErrors.length)&&this._getPossibleEventMessages(t).some((function(t){return e.ignoreErrors.some((function(e){return at(t,e)}))}))},t.prototype._isDeniedUrl=function(t,e){if(!e.denyUrls||!e.denyUrls.length)return!1;var n=this._getEventFilterUrl(t);return!!n&&e.denyUrls.some((function(t){return at(n,t)}))},t.prototype._isAllowedUrl=function(t,e){if(!e.allowUrls||!e.allowUrls.length)return!0;var n=this._getEventFilterUrl(t);return!n||e.allowUrls.some((function(t){return at(n,t)}))},t.prototype._mergeOptions=function(t){return void 0===t&&(t={}),{allowUrls:u(this._options.whitelistUrls||[],this._options.allowUrls||[],t.whitelistUrls||[],t.allowUrls||[]),denyUrls:u(this._options.blacklistUrls||[],this._options.denyUrls||[],t.blacklistUrls||[],t.denyUrls||[]),ignoreErrors:u(this._options.ignoreErrors||[],t.ignoreErrors||[],Ge),ignoreInternal:void 0===this._options.ignoreInternal||this._options.ignoreInternal}},t.prototype._getPossibleEventMessages=function(t){if(t.message)return[t.message];if(t.exception)try{var e=t.exception.values&&t.exception.values[0]||{},n=e.type,r=void 0===n?"":n,o=e.value,i=void 0===o?"":o;return[""+i,r+": "+i]}catch(e){return bt.error("Cannot extract message for event "+ft(t)),[]}return[]},t.prototype._getEventFilterUrl=function(t){try{if(t.stacktrace){var e=t.stacktrace.frames;return e&&e[e.length-1].filename||null}if(t.exception){var n=t.exception.values&&t.exception.values[0].stacktrace&&t.exception.values[0].stacktrace.frames;return n&&n[n.length-1].filename||null}return null}catch(e){return bt.error("Cannot extract url for event "+ft(t)),null}},t.id="InboundFilters",t}();e(We,"FunctionToString",(function(){return Ye})),e(We,"InboundFilters",(function(){return Je}));var Xe="?",Ke=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,ze=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$e=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Ve=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Qe=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ze=/Minified React error #\d+;/i;function tn(t){var e=null,n=0;t&&("number"==typeof t.framesToPop?n=t.framesToPop:Ze.test(t.message)&&(n=1));try{if(e=function(t){if(!t||!t.stacktrace)return null;for(var e,n=t.stacktrace,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,i=n.split("\n"),s=[],a=0;a<i.length;a+=2){var u=null;(e=r.exec(i[a]))?u={url:e[2],func:e[3],args:[],line:+e[1],column:null}:(e=o.exec(i[a]))&&(u={url:e[6],func:e[3]||e[4],args:e[5]?e[5].split(","):[],line:+e[1],column:+e[2]}),u&&(!u.func&&u.line&&(u.func=Xe),s.push(u))}if(!s.length)return null;return{message:nn(t),name:t.name,stack:s}}(t))return en(e,n)}catch(t){}try{if(e=function(t){if(!t||!t.stack)return null;for(var e,n,r,o=[],i=t.stack.split("\n"),s=0;s<i.length;++s){if(n=Ke.exec(i[s])){var a=n[2]&&0===n[2].indexOf("native");n[2]&&0===n[2].indexOf("eval")&&(e=Qe.exec(n[2]))&&(n[2]=e[1],n[3]=e[2],n[4]=e[3]),r={url:n[2]&&0===n[2].indexOf("address at ")?n[2].substr("address at ".length):n[2],func:n[1]||Xe,args:a?[n[2]]:[],line:n[3]?+n[3]:null,column:n[4]?+n[4]:null}}else if(n=$e.exec(i[s]))r={url:n[2],func:n[1]||Xe,args:[],line:+n[3],column:n[4]?+n[4]:null};else{if(!(n=ze.exec(i[s])))continue;n[3]&&n[3].indexOf(" > eval")>-1&&(e=Ve.exec(n[3]))?(n[1]=n[1]||"eval",n[3]=e[1],n[4]=e[2],n[5]=""):0!==s||n[5]||void 0===t.columnNumber||(o[0].column=t.columnNumber+1),r={url:n[3],func:n[1]||Xe,args:n[2]?n[2].split(","):[],line:n[4]?+n[4]:null,column:n[5]?+n[5]:null}}!r.func&&r.line&&(r.func=Xe),o.push(r)}if(!o.length)return null;return{message:nn(t),name:t.name,stack:o}}(t))return en(e,n)}catch(t){}return{message:nn(t),name:t&&t.name,stack:[],failed:!0}}function en(t,e){try{return i(i({},t),{stack:t.stack.slice(e)})}catch(e){return t}}function nn(t){var e=t&&t.message;return e?e.error&&"string"==typeof e.error.message?e.error.message:e:"No error message"}function rn(t){var e=sn(t.stack),n={type:t.name,value:t.message};return e&&e.length&&(n.stacktrace={frames:e}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function on(t){return{exception:{values:[rn(t)]}}}function sn(t){if(!t||!t.length)return[];var e=t,n=e[0].func||"",r=e[e.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(e=e.slice(1)),-1!==r.indexOf("sentryWrapped")&&(e=e.slice(0,-1)),e.slice(0,50).map((function(t){return{colno:null===t.column?void 0:t.column,filename:t.url||e[0].url,function:t.func||"?",in_app:!0,lineno:null===t.line?void 0:t.line}})).reverse()}function an(t,e,n){var r=cn(e,n&&n.syntheticException||void 0,{attachStacktrace:t.attachStacktrace});return vt(r,{handled:!0,type:"generic"}),r.level=l.Error,n&&n.event_id&&(r.event_id=n.event_id),re.resolve(r)}function un(t,e,n,r){void 0===n&&(n=l.Info);var o=pn(e,r&&r.syntheticException||void 0,{attachStacktrace:t.attachStacktrace});return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),re.resolve(o)}function cn(t,e,n){var r;if(void 0===n&&(n={}),g(t)&&t.error)return r=on(tn(t=t.error));if(m(t)||b(t)){var o=t,s=o.name||(m(o)?"DOMError":"DOMException"),a=o.message?s+": "+o.message:s;return dt(r=pn(a,e,n),a),"code"in o&&(r.tags=i(i({},r.tags),{"DOMException.code":""+o.code})),r}return y(t)?r=on(tn(t)):S(t)||w(t)?(vt(r=function(t,e,n){var r={exception:{values:[{type:w(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+Lt(t)}]},extra:{__serialized__:Rt(t)}};if(e){var o=sn(tn(e).stack);r.stacktrace={frames:o}}return r}(t,e,n.rejection),{synthetic:!0}),r):(dt(r=pn(t,e,n),""+t,void 0),vt(r,{synthetic:!0}),r)}function pn(t,e,n){void 0===n&&(n={});var r={message:t};if(n.attachStacktrace&&e){var o=sn(tn(e).stack);r.stacktrace={frames:o}}return r}var ln={},fn=function(){function t(t){this.options=t,this._buffer=new oe(30),this._rateLimits={},this._api=new Ne(t.dsn,t._metadata),this.url=this._api.getStoreEndpointWithUrlEncodedAuth()}return t.prototype.sendEvent=function(t){throw new L("Transport Class has to implement `sendEvent` method")},t.prototype.close=function(t){return this._buffer.drain(t)},t.prototype._handleResponse=function(t){var e=t.requestType,n=t.response,r=t.headers,o=t.resolve,i=t.reject,s=h.fromHttpCode(n.status);this._handleRateLimit(r)&&bt.warn("Too many requests, backing off until: "+this._disabledUntil(e)),s!==h.Success?i(n):o({status:s})},t.prototype._disabledUntil=function(t){return this._rateLimits[t]||this._rateLimits.all},t.prototype._isRateLimited=function(t){return this._disabledUntil(t)>new Date(Date.now())},t.prototype._handleRateLimit=function(t){var e,n,r,o,i=Date.now(),a=t["x-sentry-rate-limits"],u=t["retry-after"];if(a){try{for(var c=s(a.trim().split(",")),p=c.next();!p.done;p=c.next()){var l=p.value.split(":",2),f=parseInt(l[0],10),h=1e3*(isNaN(f)?60:f);try{for(var d=(r=void 0,s(l[1].split(";"))),v=d.next();!v.done;v=d.next()){var _=v.value;this._rateLimits[_||"all"]=new Date(i+h)}}catch(t){r={error:t}}finally{try{v&&!v.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}}}catch(t){e={error:t}}finally{try{p&&!p.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}return!0}return!!u&&(this._rateLimits.all=new Date(i+yt(i,u)),!0)},t}(),hn=ct(),dn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.sendEvent=function(t){return this._sendRequest(He(t,this._api),t)},e.prototype.sendSession=function(t){return this._sendRequest(Fe(t,this._api),t)},e.prototype._sendRequest=function(t,e){var n=this;if(this._isRateLimited(t.type))return Promise.reject({event:e,type:t.type,reason:"Transport locked till "+this._disabledUntil(t.type)+" due to too many requests.",status:429});var r={body:t.body,method:"POST",referrerPolicy:Ft()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add(new re((function(e,o){hn.fetch(t.url,r).then((function(r){var i={"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:t.type,response:r,headers:i,resolve:e,reject:o})})).catch(o)})))},e}(fn),vn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.sendEvent=function(t){return this._sendRequest(He(t,this._api),t)},e.prototype.sendSession=function(t){return this._sendRequest(Fe(t,this._api),t)},e.prototype._sendRequest=function(t,e){var n=this;return this._isRateLimited(t.type)?Promise.reject({event:e,type:t.type,reason:"Transport locked till "+this._disabledUntil(t.type)+" due to too many requests.",status:429}):this._buffer.add(new re((function(e,r){var o=new XMLHttpRequest;for(var i in o.onreadystatechange=function(){if(4===o.readyState){var i={"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")};n._handleResponse({requestType:t.type,response:o,headers:i,resolve:e,reject:r})}},o.open("POST",t.url),n.options.headers)n.options.headers.hasOwnProperty(i)&&o.setRequestHeader(i,n.options.headers[i]);o.send(t.body)})))},e}(fn);e(ln,"BaseTransport",(function(){return fn})),e(ln,"FetchTransport",(function(){return dn})),e(ln,"XHRTransport",(function(){return vn}));var _n=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.eventFromException=function(t,e){return an(this._options,t,e)},e.prototype.eventFromMessage=function(t,e,n){return void 0===e&&(e=l.Info),un(this._options,t,e,n)},e.prototype._setupTransport=function(){if(!this._options.dsn)return t.prototype._setupTransport.call(this);var e=i(i({},this._options.transportOptions),{dsn:this._options.dsn,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(e):Pt()?new dn(e):new vn(e)},e}(Pe),yn=0;function gn(){return yn>0}function mn(){yn+=1,setTimeout((function(){yn-=1}))}function bn(t,e,n){if(void 0===e&&(e={}),"function"!=typeof t)return t;try{if(t.__sentry__)return t;if(t.__sentry_wrapped__)return t.__sentry_wrapped__}catch(e){return t}var r=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var o=r.map((function(t){return bn(t,e)}));return t.handleEvent?t.handleEvent.apply(this,o):t.apply(this,o)}catch(t){throw mn(),Re((function(n){n.addEventProcessor((function(t){var n=i({},t);return e.mechanism&&(dt(n,void 0,void 0),vt(n,e.mechanism)),n.extra=i(i({},n.extra),{arguments:r}),n})),ge(t)})),t}};try{for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}catch(t){}t.prototype=t.prototype||{},r.prototype=t.prototype,Object.defineProperty(t,"__sentry_wrapped__",{enumerable:!1,value:r}),Object.defineProperties(r,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:t}});try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:function(){return t.name}})}catch(t){}return r}function En(t){if(void 0===t&&(t={}),t.eventId)if(t.dsn){var e=document.createElement("script");e.async=!0,e.src=new Ne(t.dsn).getReportDialogEndpoint(t),t.onLoad&&(e.onload=t.onLoad),(document.head||document.body).appendChild(e)}else bt.error("Missing dsn option in showReportDialog call");else bt.error("Missing eventId option in showReportDialog call")}var xn={},Sn=function(){function t(e){this.name=t.id,this._onErrorHandlerInstalled=!1,this._onUnhandledRejectionHandlerInstalled=!1,this._options=i({onerror:!0,onunhandledrejection:!0},e)}return t.prototype.setupOnce=function(){Error.stackTraceLimit=50,this._options.onerror&&(bt.log("Global Handler attached: onerror"),this._installGlobalOnErrorHandler()),this._options.onunhandledrejection&&(bt.log("Global Handler attached: onunhandledrejection"),this._installGlobalOnUnhandledRejectionHandler())},t.prototype._installGlobalOnErrorHandler=function(){var e=this;this._onErrorHandlerInstalled||(Jt({callback:function(n){var r=n.error,o=he(),i=o.getIntegration(t),s=r&&!0===r.__sentry_own_request__;if(i&&!gn()&&!s){var a=o.getClient(),u=x(r)?e._eventFromIncompleteOnError(n.msg,n.url,n.line,n.column):e._enhanceEventWithInitialFrame(cn(r,void 0,{attachStacktrace:a&&a.getOptions().attachStacktrace,rejection:!1}),n.url,n.line,n.column);vt(u,{handled:!1,type:"onerror"}),o.captureEvent(u,{originalException:r})}},type:"error"}),this._onErrorHandlerInstalled=!0)},t.prototype._installGlobalOnUnhandledRejectionHandler=function(){var e=this;this._onUnhandledRejectionHandlerInstalled||(Jt({callback:function(n){var r=n;try{"reason"in n?r=n.reason:"detail"in n&&"reason"in n.detail&&(r=n.detail.reason)}catch(t){}var o=he(),i=o.getIntegration(t),s=r&&!0===r.__sentry_own_request__;if(!i||gn()||s)return!0;var a=o.getClient(),u=x(r)?e._eventFromRejectionWithPrimitive(r):cn(r,void 0,{attachStacktrace:a&&a.getOptions().attachStacktrace,rejection:!0});u.level=l.Error,vt(u,{handled:!1,type:"onunhandledrejection"}),o.captureEvent(u,{originalException:r})},type:"unhandledrejection"}),this._onUnhandledRejectionHandlerInstalled=!0)},t.prototype._eventFromIncompleteOnError=function(t,e,n,r){var o,i=g(t)?t.message:t;if(E(i)){var s=i.match(/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i);s&&(o=s[1],i=s[2])}var a={exception:{values:[{type:o||"Error",value:i}]}};return this._enhanceEventWithInitialFrame(a,e,n,r)},t.prototype._eventFromRejectionWithPrimitive=function(t){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(t)}]}}},t.prototype._enhanceEventWithInitialFrame=function(t,e,n,r){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].stacktrace=t.exception.values[0].stacktrace||{},t.exception.values[0].stacktrace.frames=t.exception.values[0].stacktrace.frames||[];var o=isNaN(parseInt(r,10))?void 0:r,i=isNaN(parseInt(n,10))?void 0:n,s=E(e)&&e.length>0?e:_t();return 0===t.exception.values[0].stacktrace.frames.length&&t.exception.values[0].stacktrace.frames.push({colno:o,filename:s,function:"?",in_app:!0,lineno:i}),t},t.id="GlobalHandlers",t}(),wn=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],kn=function(){function t(e){this.name=t.id,this._options=i({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},e)}return t.prototype.setupOnce=function(){var t=ct();(this._options.setTimeout&&kt(t,"setTimeout",this._wrapTimeFunction.bind(this)),this._options.setInterval&&kt(t,"setInterval",this._wrapTimeFunction.bind(this)),this._options.requestAnimationFrame&&kt(t,"requestAnimationFrame",this._wrapRAF.bind(this)),this._options.XMLHttpRequest&&"XMLHttpRequest"in t&&kt(XMLHttpRequest.prototype,"send",this._wrapXHR.bind(this)),this._options.eventTarget)&&(Array.isArray(this._options.eventTarget)?this._options.eventTarget:wn).forEach(this._wrapEventTarget.bind(this))},t.prototype._wrapTimeFunction=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=e[0];return e[0]=bn(r,{mechanism:{data:{function:wt(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}},t.prototype._wrapRAF=function(t){return function(e){return t.call(this,bn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:wt(t)},handled:!0,type:"instrument"}}))}},t.prototype._wrapEventTarget=function(t){var e=ct(),n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(kt(n,"addEventListener",(function(e){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=bn(r.handleEvent.bind(r),{mechanism:{data:{function:"handleEvent",handler:wt(r),target:t},handled:!0,type:"instrument"}}))}catch(t){}return e.call(this,n,bn(r,{mechanism:{data:{function:"addEventListener",handler:wt(r),target:t},handled:!0,type:"instrument"}}),o)}})),kt(n,"removeEventListener",(function(t){return function(e,n,r){var o,i=n;try{var s=null===(o=i)||void 0===o?void 0:o.__sentry_wrapped__;s&&t.call(this,e,s,r)}catch(t){}return t.call(this,e,i,r)}})))},t.prototype._wrapXHR=function(t){return function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];var r=this,o=["onload","onerror","onprogress","onreadystatechange"];return o.forEach((function(t){t in r&&"function"==typeof r[t]&&kt(r,t,(function(e){var n={mechanism:{data:{function:t,handler:wt(e)},handled:!0,type:"instrument"}};return e.__sentry_original__&&(n.mechanism.data.handler=wt(e.__sentry_original__)),bn(e,n)}))})),t.apply(this,e)}},t.id="TryCatch",t}(),Tn=function(){function t(e){this.name=t.id,this._options=i({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}return t.prototype.addSentryBreadcrumb=function(t){this._options.sentry&&he().addBreadcrumb({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:ft(t)},{event:t})},t.prototype.setupOnce=function(){var t=this;this._options.console&&Jt({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._consoleBreadcrumb.apply(t,u(e))},type:"console"}),this._options.dom&&Jt({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._domBreadcrumb.apply(t,u(e))},type:"dom"}),this._options.xhr&&Jt({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._xhrBreadcrumb.apply(t,u(e))},type:"xhr"}),this._options.fetch&&Jt({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._fetchBreadcrumb.apply(t,u(e))},type:"fetch"}),this._options.history&&Jt({callback:function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];t._historyBreadcrumb.apply(t,u(e))},type:"history"})},t.prototype._consoleBreadcrumb=function(t){var e={category:"console",data:{arguments:t.args,logger:"console"},level:l.fromString(t.level),message:st(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;e.message="Assertion failed: "+(st(t.args.slice(1)," ")||"console.assert"),e.data.arguments=t.args.slice(1)}he().addBreadcrumb(e,{input:t.args,level:t.level})},t.prototype._domBreadcrumb=function(t){var e;try{e=t.event.target?I(t.event.target):I(t.event)}catch(t){e="<unknown>"}0!==e.length&&he().addBreadcrumb({category:"ui."+t.name,message:e},{event:t.event,name:t.name,global:t.global})},t.prototype._xhrBreadcrumb=function(t){if(t.endTimestamp){if(t.xhr.__sentry_own_request__)return;var e=t.xhr.__sentry_xhr__||{},n=e.method,r=e.url,o=e.status_code,i=e.body;he().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:o},type:"http"},{xhr:t.xhr,input:i})}else;},t.prototype._fetchBreadcrumb=function(t){t.endTimestamp&&(t.fetchData.url.match(/sentry_key/)&&"POST"===t.fetchData.method||(t.error?he().addBreadcrumb({category:"fetch",data:t.fetchData,level:l.Error,type:"http"},{data:t.error,input:t.args}):he().addBreadcrumb({category:"fetch",data:i(i({},t.fetchData),{status_code:t.response.status}),type:"http"},{input:t.args,response:t.response})))},t.prototype._historyBreadcrumb=function(t){var e=ct(),n=t.from,r=t.to,o=lt(e.location.href),i=lt(n),s=lt(r);i.path||(i=o),o.protocol===s.protocol&&o.host===s.host&&(r=s.relative),o.protocol===i.protocol&&o.host===i.host&&(n=i.relative),he().addBreadcrumb({category:"navigation",data:{from:n,to:r}})},t.id="Breadcrumbs",t}(),On=function(){function t(e){void 0===e&&(e={}),this.name=t.id,this._key=e.key||"cause",this._limit=e.limit||5}return t.prototype.setupOnce=function(){ue((function(e,n){var r=he().getIntegration(t);return r?r._handler(e,n):e}))},t.prototype._handler=function(t,e){if(!(t.exception&&t.exception.values&&e&&R(e.originalException,Error)))return t;var n=this._walkErrorTree(e.originalException,this._key);return t.exception.values=u(n,t.exception.values),t},t.prototype._walkErrorTree=function(t,e,n){if(void 0===n&&(n=[]),!R(t[e],Error)||n.length+1>=this._limit)return n;var r=rn(tn(t[e]));return this._walkErrorTree(t[e],e,u([r],n))},t.id="LinkedErrors",t}(),jn=ct(),Rn=function(){function t(){this.name=t.id}return t.prototype.setupOnce=function(){ue((function(e){var n,r,o;if(he().getIntegration(t)){if(!jn.navigator&&!jn.location&&!jn.document)return e;var s=(null===(n=e.request)||void 0===n?void 0:n.url)||(null===(r=jn.location)||void 0===r?void 0:r.href),a=(jn.document||{}).referrer,u=(jn.navigator||{}).userAgent,c=i(i(i({},null===(o=e.request)||void 0===o?void 0:o.headers),a&&{Referer:a}),u&&{"User-Agent":u}),p=i(i({},s&&{url:s}),{headers:c});return i(i({},e),{request:p})}return e}))},t.id="UserAgent",t}();e(xn,"GlobalHandlers",(function(){return Sn})),e(xn,"TryCatch",(function(){return kn})),e(xn,"Breadcrumbs",(function(){return Tn})),e(xn,"LinkedErrors",(function(){return On})),e(xn,"UserAgent",(function(){return Rn}));var In=function(t){function e(e){return void 0===e&&(e={}),t.call(this,_n,e)||this}return o(e,t),e.prototype.showReportDialog=function(t){void 0===t&&(t={}),ct().document&&(this._isEnabled()?En(i(i({},t),{dsn:t.dsn||this.getDsn()})):bt.error("Trying to call showReportDialog with Sentry Client disabled"))},e.prototype._prepareEvent=function(e,n,r){return e.platform=e.platform||"javascript",t.prototype._prepareEvent.call(this,e,n,r)},e.prototype._sendEvent=function(e){var n=this.getIntegration(Tn);n&&n.addSentryBreadcrumb(e),t.prototype._sendEvent.call(this,e)},e}(Ce),Nn=[new We.InboundFilters,new We.FunctionToString,new kn,new Tn,new Sn,new On,new Rn];function Dn(t){if(void 0===t&&(t={}),void 0===t.defaultIntegrations&&(t.defaultIntegrations=Nn),void 0===t.release){var e=ct();e.SENTRY_RELEASE&&e.SENTRY_RELEASE.id&&(t.release=e.SENTRY_RELEASE.id)}void 0===t.autoSessionTracking&&(t.autoSessionTracking=!0),t._metadata=t._metadata||{},t._metadata.sdk={name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:qe}],version:qe},function(t,e){!0===e.debug&&bt.enable();var n=he(),r=new t(e);n.bindClient(r)}(In,t),t.autoSessionTracking&&function(){if(void 0===ct().document)return void bt.warn("Session tracking in non-browser environment with @sentry/browser is not supported.");var t=he();t.startSession(),t.captureSession(),Jt({callback:function(){t.startSession(),t.captureSession()},type:"history"})}()}function Ln(t){void 0===t&&(t={}),t.eventId||(t.eventId=he().lastEventId());var e=he().getClient();e&&e.showReportDialog(t)}function Cn(){return he().lastEventId()}function Un(){}function Pn(t){t()}function An(t){var e=he().getClient();return e?e.flush(t):re.reject(!1)}function Mn(t){var e=he().getClient();return e?e.close(t):re.reject(!1)}function Fn(t){return bn(t)()}var Hn,Bn;e(v,"Status",(function(){return h})),e(v,"Severity",(function(){return l})),e(v,"withScope",(function(){return Re})),e(v,"setUser",(function(){return je})),e(v,"setTags",(function(){return ke})),e(v,"setTag",(function(){return Oe})),e(v,"setExtras",(function(){return we})),e(v,"setExtra",(function(){return Te})),e(v,"setContext",(function(){return Se})),e(v,"SDK_VERSION",(function(){return qe})),e(v,"startTransaction",(function(){return Ie})),e(v,"Scope",(function(){return se})),e(v,"makeMain",(function(){return fe})),e(v,"Hub",(function(){return pe})),e(v,"getCurrentHub",(function(){return he})),e(v,"getHubFromCarrier",(function(){return ve})),e(v,"configureScope",(function(){return Ee})),e(v,"captureMessage",(function(){return me})),e(v,"captureEvent",(function(){return be})),e(v,"captureException",(function(){return ge})),e(v,"addBreadcrumb",(function(){return xe})),e(v,"addGlobalEventProcessor",(function(){return ue})),e(v,"BrowserClient",(function(){return In})),e(v,"injectReportDialog",(function(){return En})),e(v,"eventFromMessage",(function(){return un})),e(v,"eventFromException",(function(){return an})),e(v,"wrap",(function(){return Fn})),e(v,"close",(function(){return Mn})),e(v,"flush",(function(){return An})),e(v,"showReportDialog",(function(){return Ln})),e(v,"onLoad",(function(){return Pn})),e(v,"lastEventId",(function(){return Cn})),e(v,"init",(function(){return Dn})),e(v,"forceLoad",(function(){return Un})),e(v,"defaultIntegrations",(function(){return Nn})),e(v,"SDK_NAME",(function(){return"sentry.javascript.browser"})),Hn=n,Bn=v,Object.keys(Bn).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(Hn,t,{enumerable:!0,get:function(){return Bn[t]}})}));var qn={},Wn=ct();Wn.Sentry&&Wn.Sentry.Integrations&&(qn=Wn.Sentry.Integrations);var Yn=i(i(i({},qn),We),xn);e(n,"Transports",(function(){return ln})),e(n,"Integrations",(function(){return Yn}));var Gn=(Dn({dsn:"INSERT_DSN_HERE",release:"e4a8b4c8c31264eece74c0a7c714d1c616c22d7f",environment:"test_environment",integrations:[new Yn.GlobalHandlers({onerror:!1,onunhandledrejection:!1})]}),n);window.failing_sentry=Gn;try{(void 0).is.invalid()}catch(t){Gn.captureException(t)}}();
Same here I get this error hub.captureSession is not a function after updating to v6.2.0.
I am using a single Sentry installation on a react project and I don't have FileStack.
edit: I can provide a sentry issue link, I hope this can help https://sentry.io/organizations/mineko-gmbh/issues/2225137133/
@fredicious great to hear I'm not alone!
BTW @lobsterkatie a pro tip: wrap sentry's exported functions into try/catch so that a sentry error doesn't bring all your customer's apps down.
I can also confirm that autoSessionTracking: false fixes the issue in v6.2.0
and that with v5.30.0 and autoSessionTracking: true the issue does not exist.
2 sentry installations in the same DOM and one of them is react-sentry
@danieltroger Yes, that would do it, if the first one initialized was < 5.27.0 and then the second one was 6.x. It should't matter whether one of them is @sentry/react or not - they both rely on the same @sentry/hub package.
(Indeed, I just checked https://houdinisportswear.com/sv-se and it's running @sentry/browser 5.5.0. The codeblock you included above is @sentry/browser 6.1.0, and since it's initialized second, you get the problem.)
I'll second a version of @namoscato 's question, though - on that site, one has to manually add the second copy of the SDK to trigger the error. Is there an example case you could share where, as far as you know, you're only including Sentry once but you're ending up with two installations with different versions?
(And you're right - we weren't accounting for the case of a rogue, version-mismatched second Sentry instance, and therefore considered calling hub.startSession in @sentry/browser safe (i.e., we didn't stick it in a try/catch) - as we do calling all sorts of other methods which originate in other @sentry/* packages. That's a whole lot of method calls, and if nothing else, given many people's long-standing concern about about bundle size, wrapping every such call in try/catch isn't feasible. If this error truly brought your app down, then I apologize. I'm not sure how it would do that, though, and I'd be curious to hear how it did if so.)