(("undefined"!=typeof self?self:this).wpChessCom_thpS=("undefined"!=typeof self?self:this).wpChessCom_thpS||[]).push([[440],{8440:function(e,t,n){"use strict";n.r(t);n.d(t,{BrowserClient:function(){return eh},Hub:function(){return T},Integrations:function(){return eH},SDK_NAME:function(){return eT},SDK_VERSION:function(){return O},Scope:function(){return m},Session:function(){return w},Severity:function(){return r},Transports:function(){return d},addBreadcrumb:function(){return addBreadcrumb},addGlobalEventProcessor:function(){return addGlobalEventProcessor},captureEvent:function(){return captureEvent},captureException:function(){return captureException},captureMessage:function(){return captureMessage},close:function(){return sdk_close},configureScope:function(){return configureScope},defaultIntegrations:function(){return ek},eventFromException:function(){return eventFromException},eventFromMessage:function(){return eventFromMessage},flush:function(){return flush},forceLoad:function(){return forceLoad},getCurrentHub:function(){return getCurrentHub},getHubFromCarrier:function(){return getHubFromCarrier},init:function(){return init},injectReportDialog:function(){return injectReportDialog},lastEventId:function(){return lastEventId},makeMain:function(){return makeMain},onLoad:function(){return onLoad},setContext:function(){return setContext},setExtra:function(){return setExtra},setExtras:function(){return setExtras},setTag:function(){return setTag},setTags:function(){return setTags},setUser:function(){return setUser},showReportDialog:function(){return showReportDialog},startTransaction:function(){return startTransaction},withScope:function(){return withScope},wrap:function(){return sdk_wrap}});var r,i,o,s,a,u,c,p={};n.r(p);n.d(p,{FunctionToString:function(){return eg},InboundFilters:function(){return ev}});var l={};n.r(l);n.d(l,{Breadcrumbs:function(){return ef},Dedupe:function(){return eS},GlobalHandlers:function(){return eb},LinkedErrors:function(){return eE},TryCatch:function(){return ey},UserAgent:function(){return ew}});var d={};n.r(d);n.d(d,{BaseTransport:function(){return et},FetchTransport:function(){return en},XHRTransport:function(){return er},makeNewFetchTransport:function(){return makeNewFetchTransport},makeNewXHRTransport:function(){return makeNewXHRTransport}});/*! ***************************************************************************** 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. ***************************************************************************** */var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");extendStatics(e,t);function __(){this.constructor=e}e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}var __assign=function(){return(__assign=Object.assign||function __assign(e){for(var t,n=1,r=arguments.length;n=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function tslib_es6_read(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function tslib_es6_spread(){for(var e=[],t=0;t0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors(tslib_es6_spread(getGlobalEventProcessors(),this._eventProcessors),e,t)},Scope.prototype.setSDKProcessingMetadata=function(e){return this._sdkProcessingMetadata=__assign(__assign({},this._sdkProcessingMetadata),e),this},Scope.prototype._notifyEventProcessors=function(e,t,n,r){var i=this;return void 0===r&&(r=0),new _(function(o,s){var a=e[r];if(null===t||"function"!=typeof a)o(t);else{var u=a(__assign({},t),n);isThenable(u)?u.then(function(t){return i._notifyEventProcessors(e,t,n,r+1).then(o)}).then(null,s):i._notifyEventProcessors(e,u,n,r+1).then(o).then(null,s)}})},Scope.prototype._notifyScopeListeners=function(){var e=this;if(!this._notifyingListeners){this._notifyingListeners=!0;this._scopeListeners.forEach(function(t){t(e)});this._notifyingListeners=!1}},Scope.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[];this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint));e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},Scope}();function getGlobalEventProcessors(){return(0,v.B)("globalEventProcessors",function(){return[]})}function addGlobalEventProcessor(e){getGlobalEventProcessors().push(e)}function htmlTreeAsString(e,t){try{for(var n=e,r=[],i=0,o=0,s=" > ",a=s.length,u=void 0;n&&i++<5;){u=_htmlElementAsString(n,t);if("html"===u||i>1&&o+r.length*a+u.length>=80)break;r.push(u);o+=u.length;n=n.parentNode}return r.reverse().join(s)}catch(e){return""}}function _htmlElementAsString(e,t){var n,r,i,o,s,a=e,u=[];if(!a||!a.tagName)return"";u.push(a.tagName.toLowerCase());var c=t&&t.length?t.filter(function(e){return a.getAttribute(e)}).map(function(e){return[e,a.getAttribute(e)]}):null;if(c&&c.length)c.forEach(function(e){u.push("["+e[0]+'="'+e[1]+'"]')});else{a.id&&u.push("#"+a.id);n=a.className;if(n&&isString(n)){r=n.split(/\s+/);for(s=0;s"}}function getOwnProperties(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}function extractExceptionKeysForMessage(e,t){void 0===t&&(t=40);var n=Object.keys(convertToPlainObject(e));n.sort();if(!n.length)return"[object has no keys]";if(n[0].length>=t)return truncate(n[0],t);for(var r=n.length;r>0;r--){var i=n.slice(0,r).join(", ");if(!(i.length>t)){if(r===n.length)return i;return truncate(i,t)}}return""}function dropUndefinedKeys(e){var t,n;if(isPlainObject(e)){var r={};try{for(var i=__values(Object.keys(e)),o=i.next();!o.done;o=i.next()){var s=o.value;void 0!==e[s]&&(r[s]=dropUndefinedKeys(e[s]))}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}return Array.isArray(e)?e.map(dropUndefinedKeys):e}function uuid4(){var e=(0,v.V)(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n);n[3]=4095&n[3]|16384;n[4]=16383&n[4]|32768;var pad=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return pad(n[0])+pad(n[1])+pad(n[2])+pad(n[3])+pad(n[4])+pad(n[5])+pad(n[6])+pad(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function parseUrl(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function getFirstException(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function getEventDescription(e){var t=e.message,n=e.event_id;if(t)return t;var r=getFirstException(e);return r?r.type&&r.value?r.type+": "+r.value:r.type||r.value||n||"":n||""}function addExceptionTypeValue(e,t,n){var r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||"");o.type||(o.type=n||"Error")}function addExceptionMechanism(e,t){var n=getFirstException(e);if(n){var r=n.mechanism;n.mechanism=__assign(__assign(__assign({},{type:"generic",handled:!0}),r),t);if(t&&"data"in t){var i=__assign(__assign({},r&&r.data),t.data);n.mechanism.data=i}}}function checkOrSetAlreadyCaught(e){if(e&&e.__sentry_captured__)return!0;try{addNonEnumerableProperty(e,"__sentry_captured__",!0)}catch(e){}return!1}var y="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,b=(0,v.V)(),E=["debug","info","warn","error","log","assert"];function consoleSandbox(e){var t=(0,v.V)();if(!("console"in t))return e();var n=t.console,r={};E.forEach(function(e){var i=n[e]&&n[e].__sentry_original__;if(e in t.console&&i){r[e]=n[e];n[e]=i}});try{return e()}finally{Object.keys(r).forEach(function(e){n[e]=r[e]})}}function makeLogger(){var e=!1,t={enable:function(){e=!0},disable:function(){e=!1}};return y?E.forEach(function(n){t[n]=function(){for(var t=[],r=0;r=0?t:0}e.release&&(this.release=e.release);e.environment&&(this.environment=e.environment);!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress);!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent);"number"==typeof e.errors&&(this.errors=e.errors);e.status&&(this.status=e.status)},Session.prototype.close=function(e){e?this.update({status:e}):"ok"===this.status?this.update({status:"exited"}):this.update()},Session.prototype.toJSON=function(){return dropUndefinedKeys({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*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:{release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent}})},Session}(),k=4,T=function(){function Hub(e,t,n){void 0===t&&(t=new m);void 0===n&&(n=k);this._version=n;this._stack=[{}];this.getStackTop().scope=t;e&&this.bindClient(e)}return Hub.prototype.isOlderThan=function(e){return this._version1){c=l.slice(0,-1).join("/");p=l.pop()}if(p){var d=p.match(/^\d+/);d&&(p=d[0])}return dsnFromComponents({host:s,pass:void 0===o?"":o,path:c,projectId:p,port:void 0===a?"":a,protocol:r,publicKey:i})}function dsnFromComponents(e){return"user"in e&&!("publicKey"in e)&&(e.publicKey=e.user),{user:e.publicKey||"",protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function validateDsn(e){if(y){var t=e.port,n=e.projectId,r=e.protocol;["protocol","publicKey","host","projectId"].forEach(function(t){if(!e[t])throw new H("Invalid Sentry Dsn: "+t+" missing")});if(!n.match(/^\d+$/))throw new H("Invalid Sentry Dsn: Invalid projectId "+n);if(!isValidProtocol(r))throw new H("Invalid Sentry Dsn: Invalid protocol "+r);if(t&&isNaN(parseInt(t,10)))throw new H("Invalid Sentry Dsn: Invalid port "+t);return!0}}function makeDsn(e){var t="string"==typeof e?dsnFromString(e):dsnFromComponents(e);return validateDsn(t),t}function memoBuilder(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function memoize(n){if(e)return!!t.has(n)||(t.add(n),!1);for(var r=0;rn?normalizeToSize(e,t-1,n):r}function visit(e,t,n,r,i){void 0===n&&(n=Infinity);void 0===r&&(r=Infinity);void 0===i&&(i=memoBuilder());var o=tslib_es6_read(i,2),s=o[0],a=o[1],u=t;if(u&&"function"==typeof u.toJSON)try{return u.toJSON()}catch(e){}if(null===t||["number","boolean","string"].includes(typeof t)&&!is_isNaN(t))return t;var c=stringifyValue(e,t);if(!c.startsWith("[object "))return c;if(0===n)return c.replace("object ","");if(s(t))return"[Circular ~]";var p=Array.isArray(t)?[]:{},l=0,d=isError(t)||isEvent(t)?convertToPlainObject(t):t;for(var f in d)if(Object.prototype.hasOwnProperty.call(d,f)){if(l>=r){p[f]="[MaxProperties ~]";break}var h=d[f];p[f]=visit(f,h,n-1,r,i);l+=1}return a(t),p}function stringifyValue(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if(void 0!==n.g&&t===n.g)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(isSyntheticEvent(t))return"[SyntheticEvent]";if("number"==typeof t&&t!=t)return"[NaN]";if(void 0===t)return"[undefined]";if("function"==typeof t)return"[Function: "+getFunctionName(t)+"]";if("symbol"==typeof t)return"["+String(t)+"]";if("bigint"==typeof t)return"[BigInt: "+String(t)+"]";return"[object "+Object.getPrototypeOf(t).constructor.name+"]"}catch(e){return"**non-serializable** ("+e+")"}}function utf8Length(e){return~-encodeURI(e).split(/%..|./).length}function jsonSize(e){return utf8Length(JSON.stringify(e))}var P="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,B=[];function filterDuplicates(e){return e.reduce(function(e,t){return e.every(function(e){return t.name!==e.name})&&e.push(t),e},[])}function getIntegrationsToSetup(e){var t=e.defaultIntegrations&&tslib_es6_spread(e.defaultIntegrations)||[],n=e.integrations,r=tslib_es6_spread(filterDuplicates(t));Array.isArray(n)?r=tslib_es6_spread(r.filter(function(e){return n.every(function(t){return t.name!==e.name})}),filterDuplicates(n)):"function"==typeof n&&(r=Array.isArray(r=n(r))?r:[r]);var i=r.map(function(e){return e.name}),o="Debug";return -1!==i.indexOf(o)&&r.push.apply(r,tslib_es6_spread(r.splice(i.indexOf(o),1))),r}function setupIntegration(e){if(-1===B.indexOf(e.name)){e.setupOnce(addGlobalEventProcessor,getCurrentHub);B.push(e.name);P&&i.log("Integration installed: "+e.name)}}function setupIntegrations(e){var t={};return getIntegrationsToSetup(e).forEach(function(e){t[e.name]=e;setupIntegration(e)}),addNonEnumerableProperty(t,"initialized",!0),t}var I="Not capturing exception because it's already been captured.",D=function(){function BaseClient(e,t){this._integrations={};this._numProcessing=0;this._backend=new e(t);this._options=t;t.dsn&&(this._dsn=makeDsn(t.dsn))}return BaseClient.prototype.captureException=function(e,t,n){var r=this;if(checkOrSetAlreadyCaught(e)){P&&i.log(I);return}var o=t&&t.event_id;return this._process(this._getBackend().eventFromException(e,t).then(function(e){return r._captureEvent(e,t,n)}).then(function(e){o=e})),o},BaseClient.prototype.captureMessage=function(e,t,n,r){var i=this,o=n&&n.event_id,s=is_isPrimitive(e)?this._getBackend().eventFromMessage(String(e),t,n):this._getBackend().eventFromException(e,n);return this._process(s.then(function(e){return i._captureEvent(e,n,r)}).then(function(e){o=e})),o},BaseClient.prototype.captureEvent=function(e,t,n){if(t&&t.originalException&&checkOrSetAlreadyCaught(t.originalException)){P&&i.log(I);return}var r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then(function(e){r=e})),r},BaseClient.prototype.captureSession=function(e){if(!this._isEnabled()){P&&i.warn("SDK not enabled, will not capture session.");return}if("string"!=typeof e.release)P&&i.warn("Discarded session because of missing or non-string release");else{this._sendSession(e);e.update({init:!1})}},BaseClient.prototype.getDsn=function(){return this._dsn},BaseClient.prototype.getOptions=function(){return this._options},BaseClient.prototype.getTransport=function(){return this._getBackend().getTransport()},BaseClient.prototype.flush=function(e){var t=this;return this._isClientDoneProcessing(e).then(function(n){return t.getTransport().close(e).then(function(e){return n&&e})})},BaseClient.prototype.close=function(e){var t=this;return this.flush(e).then(function(e){return t.getOptions().enabled=!1,e})},BaseClient.prototype.setupIntegrations=function(){this._isEnabled()&&!this._integrations.initialized&&(this._integrations=setupIntegrations(this._options))},BaseClient.prototype.getIntegration=function(e){try{return this._integrations[e.id]||null}catch(t){P&&i.warn("Cannot retrieve integration "+e.id+" from the current Client");return null}},BaseClient.prototype._updateSessionFromEvent=function(e,t){var n,r,i=!1,o=!1,s=t.exception&&t.exception.values;if(s){o=!0;try{for(var a=__values(s),u=a.next();!u.done;u=a.next()){var c=u.value.mechanism;if(c&&!1===c.handled){i=!0;break}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}var p="ok"===e.status,l=p&&0===e.errors||p&&i;if(l){e.update(__assign(__assign({},i&&{status:"crashed"}),{errors:e.errors||Number(o||i)}));this.captureSession(e)}},BaseClient.prototype._sendSession=function(e){this._getBackend().sendSession(e)},BaseClient.prototype._isClientDoneProcessing=function(e){var t=this;return new _(function(n){var r=0,i=setInterval(function(){if(0==t._numProcessing){clearInterval(i);n(!0)}else{r+=1;if(e&&r>=e){clearInterval(i);n(!1)}}},1)})},BaseClient.prototype._getBackend=function(){return this._backend},BaseClient.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},BaseClient.prototype._prepareEvent=function(e,t,n){var r=this,i=this.getOptions(),o=i.normalizeDepth,s=void 0===o?3:o,a=i.normalizeMaxBreadth,u=void 0===a?1e3:a,c=__assign(__assign({},e),{event_id:e.event_id||(n&&n.event_id?n.event_id:uuid4()),timestamp:e.timestamp||(0,h.lu)()});this._applyClientOptions(c);this._applyIntegrationsMetadata(c);var p=t;n&&n.captureContext&&(p=m.clone(p).update(n.captureContext));var l=resolvedSyncPromise(c);return p&&(l=p.applyToEvent(c,n)),l.then(function(e){return(e&&(e.sdkProcessingMetadata=__assign(__assign({},e.sdkProcessingMetadata),{normalizeDepth:normalize(s)+" ("+typeof s+")"})),"number"==typeof s&&s>0)?r._normalizeEvent(e,s,u):e})},BaseClient.prototype._normalizeEvent=function(e,t,n){if(!e)return null;var r=__assign(__assign(__assign(__assign(__assign({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(function(e){return __assign(__assign({},e),e.data&&{data:normalize(e.data,t,n)})})}),e.user&&{user:normalize(e.user,t,n)}),e.contexts&&{contexts:normalize(e.contexts,t,n)}),e.extra&&{extra:normalize(e.extra,t,n)});return e.contexts&&e.contexts.trace&&(r.contexts.trace=e.contexts.trace),r.sdkProcessingMetadata=__assign(__assign({},r.sdkProcessingMetadata),{baseClientNormalized:!0}),r},BaseClient.prototype._applyClientOptions=function(e){var t=this.getOptions(),n=t.environment,r=t.release,i=t.dist,o=t.maxValueLength,s=void 0===o?250:o;"environment"in e||(e.environment="environment"in t?n:"production");void 0===e.release&&void 0!==r&&(e.release=r);void 0===e.dist&&void 0!==i&&(e.dist=i);e.message&&(e.message=truncate(e.message,s));var a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=truncate(a.value,s));var u=e.request;u&&u.url&&(u.url=truncate(u.url,s))},BaseClient.prototype._applyIntegrationsMetadata=function(e){var t=Object.keys(this._integrations);if(t.length>0){e.sdk=e.sdk||{};e.sdk.integrations=tslib_es6_spread(e.sdk.integrations||[],t)}},BaseClient.prototype._sendEvent=function(e){this._getBackend().sendEvent(e)},BaseClient.prototype._captureEvent=function(e,t,n){return this._processEvent(e,t,n).then(function(e){return e.event_id},function(e){P&&i.error(e)})},BaseClient.prototype._processEvent=function(e,t,n){var r=this,i=this.getOptions(),o=i.beforeSend,s=i.sampleRate,a=this.getTransport();function recordLostEvent(e,t){a.recordLostEvent&&a.recordLostEvent(e,t)}if(!this._isEnabled())return rejectedSyncPromise(new H("SDK not enabled, will not capture event."));var u="transaction"===e.type;return!u&&"number"==typeof s&&Math.random()>s?(recordLostEvent("sample_rate","event"),rejectedSyncPromise(new H("Discarding event because it's not included in the random sample (sampling rate = "+s+")"))):this._prepareEvent(e,n,t).then(function(n){if(null===n){recordLostEvent("event_processor",e.type||"event");throw new H("An event processor returned null, will not send event.")}return t&&t.data&&!0===t.data.__sentry__||u||!o?n:_ensureBeforeSendRv(o(n,t))}).then(function(t){if(null===t){recordLostEvent("before_send",e.type||"event");throw new H("`beforeSend` returned `null`, will not send event.")}var i=n&&n.getSession&&n.getSession();return!u&&i&&r._updateSessionFromEvent(i,t),r._sendEvent(t),t}).then(null,function(e){if(e instanceof H)throw e;r.captureException(e,{data:{__sentry__:!0},originalException:e});throw new H("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+e)})},BaseClient.prototype._process=function(e){var t=this;this._numProcessing+=1;e.then(function(e){return t._numProcessing-=1,e},function(e){return t._numProcessing-=1,e})},BaseClient}();function _ensureBeforeSendRv(e){var t="`beforeSend` method has to return `null` or a valid event.";if(isThenable(e))return e.then(function(e){if(!(isPlainObject(e)||null===e))throw new H(t);return e},function(e){throw new H("beforeSend rejected with "+e)});if(!(isPlainObject(e)||null===e))throw new H(t);return e}!function(){function API(e,t,n){void 0===t&&(t={});this.dsn=e;this._dsnObject=makeDsn(e);this.metadata=t;this._tunnel=n}API.prototype.getDsn=function(){return this._dsnObject};API.prototype.forceEnvelope=function(){return!!this._tunnel};API.prototype.getBaseApiEndpoint=function(){return getBaseApiEndpoint(this._dsnObject)};API.prototype.getStoreEndpoint=function(){return getStoreEndpoint(this._dsnObject)};API.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return getStoreEndpointWithUrlEncodedAuth(this._dsnObject)};API.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return getEnvelopeEndpointWithUrlEncodedAuth(this._dsnObject,this._tunnel)}}();function initAPIDetails(e,t,n){return{initDsn:e,metadata:t||{},dsn:makeDsn(e),tunnel:n}}function getBaseApiEndpoint(e){var t=e.protocol?e.protocol+":":"",n=e.port?":"+e.port:"";return t+"//"+e.host+n+(e.path?"/"+e.path:"")+"/api/"}function _getIngestEndpoint(e,t){return""+getBaseApiEndpoint(e)+e.projectId+"/"+t+"/"}function _encodedAuth(e){return urlEncode({sentry_key:e.publicKey,sentry_version:"7"})}function getStoreEndpoint(e){return _getIngestEndpoint(e,"store")}function getStoreEndpointWithUrlEncodedAuth(e){return getStoreEndpoint(e)+"?"+_encodedAuth(e)}function _getEnvelopeEndpoint(e){return _getIngestEndpoint(e,"envelope")}function getEnvelopeEndpointWithUrlEncodedAuth(e,t){return t||_getEnvelopeEndpoint(e)+"?"+_encodedAuth(e)}function getReportDialogEndpoint(e,t){var n=makeDsn(e),r=getBaseApiEndpoint(n)+"embed/error-page/",i="dsn="+dsnToString(n);for(var o in t)if("dsn"!==o){if("user"===o){if(!t.user)continue;t.user.name&&(i+="&name="+encodeURIComponent(t.user.name));t.user.email&&(i+="&email="+encodeURIComponent(t.user.email))}else i+="&"+encodeURIComponent(o)+"="+encodeURIComponent(t[o])}return r+"?"+i}function createEnvelope(e,t){return void 0===t&&(t=[]),[e,t]}function getEnvelopeType(e){var t=tslib_es6_read(e,2),n=tslib_es6_read(t[1],1);return tslib_es6_read(n[0],1)[0].type}function serializeEnvelope(e){var t=tslib_es6_read(e,2),n=t[0],r=t[1],i=JSON.stringify(n);return r.reduce(function(e,t){var n=tslib_es6_read(t,2),r=n[0],i=n[1],o=is_isPrimitive(i)?String(i):JSON.stringify(i);return e+"\n"+JSON.stringify(r)+"\n"+o},i)}function getSdkMetadataForEnvelopeHeader(e){if(e.metadata&&e.metadata.sdk){var t=e.metadata.sdk;return{name:t.name,version:t.version}}}function enhanceEventWithSdkInfo(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=tslib_es6_spread(e.sdk.integrations||[],t.integrations||[]),e.sdk.packages=tslib_es6_spread(e.sdk.packages||[],t.packages||[])),e}function createSessionEnvelope(e,t){var n=getSdkMetadataForEnvelopeHeader(t),r=__assign(__assign({sent_at:new Date().toISOString()},n&&{sdk:n}),!!t.tunnel&&{dsn:dsnToString(t.dsn)}),i="aggregates"in e?"sessions":"session";return[createEnvelope(r,[[{type:i},e]]),i]}function sessionToSentryRequest(e,t){var n=tslib_es6_read(createSessionEnvelope(e,t),2),r=n[0],i=n[1];return{body:serializeEnvelope(r),type:i,url:getEnvelopeEndpointWithUrlEncodedAuth(t.dsn,t.tunnel)}}function createEventEnvelope(e,t){var n=getSdkMetadataForEnvelopeHeader(t),r=e.type||"event",i=(e.sdkProcessingMetadata||{}).transactionSampling||{},o=i.method,s=i.rate;enhanceEventWithSdkInfo(e,t.metadata.sdk);e.tags=e.tags||{};e.extra=e.extra||{};if(!(e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baseClientNormalized)){e.tags.skippedNormalization=!0;e.extra.normalizeDepth=e.sdkProcessingMetadata?e.sdkProcessingMetadata.normalizeDepth:"unset"}return delete e.sdkProcessingMetadata,createEnvelope(__assign(__assign({event_id:e.event_id,sent_at:new Date().toISOString()},n&&{sdk:n}),!!t.tunnel&&{dsn:dsnToString(t.dsn)}),[[{type:r,sample_rates:[{id:o,rate:s}]},e]])}function eventToSentryRequest(e,t){var n,r=getSdkMetadataForEnvelopeHeader(t),i=e.type||"event",o="transaction"===i||!!t.tunnel,s=(e.sdkProcessingMetadata||{}).transactionSampling||{},a=s.method,u=s.rate;enhanceEventWithSdkInfo(e,t.metadata.sdk);e.tags=e.tags||{};e.extra=e.extra||{};if(!(e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baseClientNormalized)){e.tags.skippedNormalization=!0;e.extra.normalizeDepth=e.sdkProcessingMetadata?e.sdkProcessingMetadata.normalizeDepth:"unset"}delete e.sdkProcessingMetadata;try{n=JSON.stringify(e)}catch(t){e.tags.JSONStringifyError=!0;e.extra.JSONStringifyError=t;try{n=JSON.stringify(normalize(e))}catch(e){var c=e;n=JSON.stringify({message:"JSON.stringify error after renormalization",extra:{message:c.message,stack:c.stack}})}}var p={body:n,type:i,url:o?getEnvelopeEndpointWithUrlEncodedAuth(t.dsn,t.tunnel):getStoreEndpointWithUrlEncodedAuth(t.dsn)};if(o){var l=createEnvelope(__assign(__assign({event_id:e.event_id,sent_at:new Date().toISOString()},r&&{sdk:r}),!!t.tunnel&&{dsn:dsnToString(t.dsn)}),[[{type:i,sample_rates:[{id:a,rate:u}]},p.body]]);p.body=serializeEnvelope(l)}return p}var N=function(){function NoopTransport(){}return NoopTransport.prototype.sendEvent=function(e){return resolvedSyncPromise({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:"skipped"})},NoopTransport.prototype.close=function(e){return resolvedSyncPromise(!0)},NoopTransport}(),j=function(){function BaseBackend(e){this._options=e;!this._options.dsn&&P&&i.warn("No DSN provided, backend will not do anything.");this._transport=this._setupTransport()}return BaseBackend.prototype.eventFromException=function(e,t){throw new H("Backend has to implement `eventFromException` method")},BaseBackend.prototype.eventFromMessage=function(e,t,n){throw new H("Backend has to implement `eventFromMessage` method")},BaseBackend.prototype.sendEvent=function(e){if(this._newTransport&&this._options.dsn&&this._options._experiments&&this._options._experiments.newTransport){var t=createEventEnvelope(e,initAPIDetails(this._options.dsn,this._options._metadata,this._options.tunnel));this._newTransport.send(t).then(null,function(e){P&&i.error("Error while sending event:",e)})}else this._transport.sendEvent(e).then(null,function(e){P&&i.error("Error while sending event:",e)})},BaseBackend.prototype.sendSession=function(e){if(!this._transport.sendSession){P&&i.warn("Dropping session because custom transport doesn't implement sendSession");return}if(this._newTransport&&this._options.dsn&&this._options._experiments&&this._options._experiments.newTransport){var t=tslib_es6_read(createSessionEnvelope(e,initAPIDetails(this._options.dsn,this._options._metadata,this._options.tunnel)),1)[0];this._newTransport.send(t).then(null,function(e){P&&i.error("Error while sending session:",e)})}else this._transport.sendSession(e).then(null,function(e){P&&i.error("Error while sending session:",e)})},BaseBackend.prototype.getTransport=function(){return this._transport},BaseBackend.prototype._setupTransport=function(){return new N},BaseBackend}();function supportsFetch(){if(!("fetch"in(0,v.V)()))return!1;try{new Headers;new Request("");new Response;return!0}catch(e){return!1}}function isNativeFetch(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function supportsNativeFetch(){if(!supportsFetch())return!1;var e=(0,v.V)();if(isNativeFetch(e.fetch))return!0;var t=!1,n=e.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&&(t=isNativeFetch(r.contentWindow.fetch));n.head.removeChild(r)}catch(e){y&&i.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}function supportsReferrerPolicy(){if(!supportsFetch())return!1;try{new Request("_",{referrerPolicy:"origin"});return!0}catch(e){return!1}}function supportsHistory(){var e=(0,v.V)(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!n&&r}var A="?";function createFrame(e,t,n,r){var i={filename:e,function:t,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}var L=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack||[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,M=/\((\S*)(?::(\d+))(?::(\d+))\)/,U=[30,function(e){var t=L.exec(e);if(t){var n=t[2]&&0===t[2].indexOf("eval");if(n){var r=M.exec(t[2]);if(r){t[2]=r[1];t[3]=r[2];t[4]=r[3]}}var i=tslib_es6_read(extractSafariExtensionDetails(t[1]||A,t[2]),2),o=i[0];return createFrame(i[1],o,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],q=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,z=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,W=[50,function(e){var t,n=q.exec(e);if(n){var r=n[3]&&n[3].indexOf(" > eval")>-1;if(r){var i=z.exec(n[3]);if(i){n[1]=n[1]||"eval";n[3]=i[1];n[4]=i[2];n[5]=""}}var o=n[3],s=n[1]||A;return s=(t=tslib_es6_read(extractSafariExtensionDetails(s,o),2))[0],createFrame(o=t[1],s,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}}],V=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,G=[40,function(e){var t=V.exec(e);return t?createFrame(t[2],t[1]||A,+t[3],t[4]?+t[4]:void 0):void 0}],X=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,K=[10,function(e){var t=X.exec(e);return t?createFrame(t[2],t[3]||A,+t[1]):void 0}],Y=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,J=[20,function(e){var t=Y.exec(e);return t?createFrame(t[5],t[3]||t[4]||A,+t[1],+t[2]):void 0}],extractSafariExtensionDetails=function(e,t){var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:A,n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};function exceptionFromError(e){var t=parseStackFrames(e),n={type:e&&e.name,value:extractMessage(e)};return t.length&&(n.stacktrace={frames:t}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function eventFromPlainObject(e,t,n){var r={exception:{values:[{type:isEvent(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+extractExceptionKeysForMessage(e)}]},extra:{__serialized__:normalizeToSize(e)}};if(t){var i=parseStackFrames(t);i.length&&(r.stacktrace={frames:i})}return r}function eventFromError(e){return{exception:{values:[exceptionFromError(e)]}}}function parseStackFrames(e){var t=e.stacktrace||e.stack||"",n=getPopSize(e);try{return createStackParser(K,J,U,G,W)(t,n)}catch(e){}return[]}var $=/Minified React error #\d+;/i;function getPopSize(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if($.test(e.message))return 1}return 0}function extractMessage(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function eventFromException(e,t,n){var i=eventFromUnknownInput(e,t&&t.syntheticException||void 0,n);return addExceptionMechanism(i),i.level=r.Error,t&&t.event_id&&(i.event_id=t.event_id),resolvedSyncPromise(i)}function eventFromMessage(e,t,n,i){void 0===t&&(t=r.Info);var o=eventFromString(e,n&&n.syntheticException||void 0,i);return o.level=t,n&&n.event_id&&(o.event_id=n.event_id),resolvedSyncPromise(o)}function eventFromUnknownInput(e,t,n,r){var i;if(isErrorEvent(e)&&e.error)return eventFromError(e.error);if(isDOMError(e)||isDOMException(e)){var o=e;if("stack"in e)i=eventFromError(e);else{var s=o.name||(isDOMError(o)?"DOMError":"DOMException"),a=o.message?s+": "+o.message:s;addExceptionTypeValue(i=eventFromString(a,t,n),a)}return"code"in o&&(i.tags=__assign(__assign({},i.tags),{"DOMException.code":""+o.code})),i}return isError(e)?eventFromError(e):(isPlainObject(e)||isEvent(e)?addExceptionMechanism(i=eventFromPlainObject(e,t,r),{synthetic:!0}):(addExceptionTypeValue(i=eventFromString(e,t,n),""+e,void 0),addExceptionMechanism(i,{synthetic:!0})),i)}function eventFromString(e,t,n){var r={message:e};if(n&&t){var i=parseStackFrames(t);i.length&&(r.stacktrace={frames:i})}return r}function makePromiseBuffer(e){var t=[];function isReady(){return void 0===e||t.length0&&n(!1)},e);t.forEach(function(e){resolvedSyncPromise(e).then(function(){if(!--i){clearTimeout(o);n(!0)}},r)})})}return{$:t,add:add,drain:drain}}function parseRetryAfterHeader(e,t){void 0===t&&(t=Date.now());var n=parseInt(""+e,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+e);return isNaN(r)?6e4:r-t}function disabledUntil(e,t){return e[t]||e.all||0}function isRateLimited(e,t,n){return void 0===n&&(n=Date.now()),disabledUntil(e,t)>n}function updateRateLimits(e,t,n){void 0===n&&(n=Date.now());var r,i,o,s,a=__assign({},e),u=t["x-sentry-rate-limits"],c=t["retry-after"];if(u)try{for(var p=__values(u.trim().split(",")),l=p.next();!l.done;l=p.next()){var d=l.value.split(":",2),f=parseInt(d[0],10),h=(isNaN(f)?60:f)*1e3;if(d[1])try{for(var _=(o=void 0,__values(d[1].split(";"))),v=_.next();!v.done;v=_.next())a[v.value]=n+h}catch(e){o={error:e}}finally{try{v&&!v.done&&(s=_.return)&&s.call(_)}finally{if(o)throw o.error}}else a.all=n+h}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=p.return)&&i.call(p)}finally{if(r)throw r.error}}else c&&(a.all=n+parseRetryAfterHeader(c,n));return a}function eventStatusFromHttpCode(e){return e>=200&&e<300?"success":429===e?"rate_limit":e>=400&&e<500?"invalid":e>=500?"failed":"unknown"}function createTransport(e,t,n){void 0===n&&(n=makePromiseBuffer(e.bufferSize||30));var r={};return{send:function send(e){var i=getEnvelopeType(e),o="event"===i?"error":i,s={category:o,body:serializeEnvelope(e)};return isRateLimited(r,o)?rejectedSyncPromise({status:"rate_limit",reason:getRateLimitReason(r,o)}):n.add(function(){return t(s).then(function(e){var t=e.body,n=e.headers,i=e.reason,s=eventStatusFromHttpCode(e.statusCode);return(n&&(r=updateRateLimits(r,n)),"success"===s)?resolvedSyncPromise({status:s,reason:i}):rejectedSyncPromise({status:s,reason:i||t||("rate_limit"===s?getRateLimitReason(r,o):"Unknown transport error")})})})},flush:function(e){return n.drain(e)}}}function getRateLimitReason(e,t){return"Too many "+t+" requests, backing off until: "+new Date(disabledUntil(e,t)).toISOString()}function forget(e){e.then(null,function(e){console.error(e)})}var Q="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Z=(0,v.V)();function getNativeFetchImplementation(){if(o)return o;if(isNativeFetch(Z.fetch))return o=Z.fetch.bind(Z);var e=Z.document,t=Z.fetch;if(e&&"function"==typeof e.createElement)try{var n=e.createElement("iframe");n.hidden=!0;e.head.appendChild(n);var r=n.contentWindow;r&&r.fetch&&(t=r.fetch);e.head.removeChild(n)}catch(e){Q&&i.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return o=t.bind(Z)}function sendReport(e,t){return"[object Navigator]"===Object.prototype.toString.call(Z&&Z.navigator)&&"function"==typeof Z.navigator.sendBeacon?Z.navigator.sendBeacon.bind(Z.navigator)(e,t):supportsFetch()?forget(getNativeFetchImplementation()(e,{body:t,method:"POST",credentials:"omit",keepalive:!0})):void 0}function makeNewFetchTransport(e,t){void 0===t&&(t=getNativeFetchImplementation());function makeRequest(n){var r=__assign({body:n.body,method:"POST",referrerPolicy:"origin"},e.requestOptions);return t(e.url,r).then(function(e){return e.text().then(function(t){return{body:t,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")},reason:e.statusText,statusCode:e.status}})})}return createTransport({bufferSize:e.bufferSize},makeRequest)}function createClientReportEnvelope(e,t,n){return createEnvelope(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:n||(0,h.lu)(),discarded_events:e}]])}function requestTypeToCategory(e){var t=e;return"event"===t?"error":t}var ee=(0,v.V)(),et=function(){function BaseTransport(e){var t=this;this.options=e;this._buffer=makePromiseBuffer(30);this._rateLimits={};this._outcomes={};this._api=initAPIDetails(e.dsn,e._metadata,e.tunnel);this.url=getStoreEndpointWithUrlEncodedAuth(this._api.dsn);this.options.sendClientReports&&ee.document&&ee.document.addEventListener("visibilitychange",function(){"hidden"===ee.document.visibilityState&&t._flushOutcomes()})}return BaseTransport.prototype.sendEvent=function(e){return this._sendRequest(eventToSentryRequest(e,this._api),e)},BaseTransport.prototype.sendSession=function(e){return this._sendRequest(sessionToSentryRequest(e,this._api),e)},BaseTransport.prototype.close=function(e){return this._buffer.drain(e)},BaseTransport.prototype.recordLostEvent=function(e,t){if(this.options.sendClientReports){var n,r=requestTypeToCategory(t)+":"+e;Q&&i.log("Adding outcome: "+r);this._outcomes[r]=(null!=(n=this._outcomes[r])?n:0)+1}},BaseTransport.prototype._flushOutcomes=function(){if(this.options.sendClientReports){var e=this._outcomes;this._outcomes={};if(!Object.keys(e).length){Q&&i.log("No outcomes to flush");return}Q&&i.log("Flushing outcomes:\n"+JSON.stringify(e,null,2));var t=getEnvelopeEndpointWithUrlEncodedAuth(this._api.dsn,this._api.tunnel),n=createClientReportEnvelope(Object.keys(e).map(function(t){var n=tslib_es6_read(t.split(":"),2),r=n[0];return{reason:n[1],category:r,quantity:e[t]}}),this._api.tunnel&&dsnToString(this._api.dsn));try{sendReport(t,serializeEnvelope(n))}catch(e){Q&&i.error(e)}}},BaseTransport.prototype._handleResponse=function(e){var t=e.requestType,n=e.response,r=e.headers,o=e.resolve,s=e.reject,a=eventStatusFromHttpCode(n.status);this._rateLimits=updateRateLimits(this._rateLimits,r);this._isRateLimited(t)&&Q&&i.warn("Too many "+t+" requests, backing off until: "+this._disabledUntil(t));if("success"===a){o({status:a});return}s(n)},BaseTransport.prototype._disabledUntil=function(e){var t=requestTypeToCategory(e);return new Date(disabledUntil(this._rateLimits,t))},BaseTransport.prototype._isRateLimited=function(e){var t=requestTypeToCategory(e);return isRateLimited(this._rateLimits,t)},BaseTransport}(),en=function(e){__extends(FetchTransport,e);function FetchTransport(t,n){void 0===n&&(n=getNativeFetchImplementation());var r=e.call(this,t)||this;return r._fetch=n,r}return FetchTransport.prototype._sendRequest=function(e,t){var n=this;if(this._isRateLimited(e.type))return this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429});var r={body:e.body,method:"POST",referrerPolicy:supportsReferrerPolicy()?"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(function(){return new _(function(t,i){n._fetch(e.url,r).then(function(r){var o={"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:e.type,response:r,headers:o,resolve:t,reject:i})}).catch(i)})}).then(void 0,function(t){t instanceof H?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type);throw t})},FetchTransport}(et);function makeNewXHRTransport(e){function makeRequest(t){return new _(function(n,r){var i=new XMLHttpRequest;i.onreadystatechange=function(){4===i.readyState&&n({body:i.response,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")},reason:i.statusText,statusCode:i.status})};i.open("POST",e.url);for(var o in e.headers)Object.prototype.hasOwnProperty.call(e.headers,o)&&i.setRequestHeader(o,e.headers[o]);i.send(t.body)})}return createTransport({bufferSize:e.bufferSize},makeRequest)}var er=function(e){__extends(XHRTransport,e);function XHRTransport(){return null!==e&&e.apply(this,arguments)||this}return XHRTransport.prototype._sendRequest=function(e,t){var n=this;return this._isRateLimited(e.type)?(this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429})):this._buffer.add(function(){return new _(function(t,r){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){var o={"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")};n._handleResponse({requestType:e.type,response:i,headers:o,resolve:t,reject:r})}};i.open("POST",e.url);for(var o in n.options.headers)Object.prototype.hasOwnProperty.call(n.options.headers,o)&&i.setRequestHeader(o,n.options.headers[o]);i.send(e.body)})}).then(void 0,function(t){t instanceof H?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type);throw t})},XHRTransport}(et),ei=function(e){__extends(BrowserBackend,e);function BrowserBackend(){return null!==e&&e.apply(this,arguments)||this}return BrowserBackend.prototype.eventFromException=function(e,t){return eventFromException(e,t,this._options.attachStacktrace)},BrowserBackend.prototype.eventFromMessage=function(e,t,n){return void 0===t&&(t=r.Info),eventFromMessage(e,t,n,this._options.attachStacktrace)},BrowserBackend.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=__assign(__assign({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,sendClientReports:this._options.sendClientReports,_metadata:this._options._metadata}),n=initAPIDetails(t.dsn,t._metadata,t.tunnel),r=getEnvelopeEndpointWithUrlEncodedAuth(n.dsn,n.tunnel);if(this._options.transport)return new this._options.transport(t);if(supportsFetch()){var i=__assign({},t.fetchParameters);return this._newTransport=makeNewFetchTransport({requestOptions:i,url:r}),new en(t)}return this._newTransport=makeNewXHRTransport({url:r,headers:t.headers}),new er(t)},BrowserBackend}(j),eo=(0,v.V)(),es=0;function shouldIgnoreOnError(){return es>0}function ignoreNextOnError(){es+=1;setTimeout(function(){es-=1})}function wrap(e,t,n){void 0===t&&(t={});if("function"!=typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if(getOriginalFunction(e))return e}catch(t){return e}var sentryWrapped=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var i=r.map(function(e){return wrap(e,t)});return e.apply(this,i)}catch(e){ignoreNextOnError();withScope(function(n){n.addEventProcessor(function(e){if(t.mechanism){addExceptionTypeValue(e,void 0,void 0);addExceptionMechanism(e,t.mechanism)}return e.extra=__assign(__assign({},e.extra),{arguments:r}),e});captureException(e)});throw e}};try{for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(sentryWrapped[i]=e[i])}catch(e){}markFunctionWrapped(sentryWrapped,e);addNonEnumerableProperty(e,"__sentry_wrapped__",sentryWrapped);try{Object.getOwnPropertyDescriptor(sentryWrapped,"name").configurable&&Object.defineProperty(sentryWrapped,"name",{get:function(){return e.name}})}catch(e){}return sentryWrapped}function injectReportDialog(e){void 0===e&&(e={});if(eo.document){if(!e.eventId){Q&&i.error("Missing eventId option in showReportDialog call");return}if(!e.dsn){Q&&i.error("Missing dsn option in showReportDialog call");return}var t=eo.document.createElement("script");t.async=!0;t.src=getReportDialogEndpoint(e.dsn,e);e.onLoad&&(t.onload=e.onLoad);var n=eo.document.head||eo.document.body;n&&n.appendChild(t)}}var ea=(0,v.V)(),eu={},ec={};function instrument(e){if(!ec[e]){ec[e]=!0;switch(e){case"console":instrumentConsole();break;case"dom":instrumentDOM();break;case"xhr":instrumentXHR();break;case"fetch":instrumentFetch();break;case"history":instrumentHistory();break;case"error":instrumentError();break;case"unhandledrejection":instrumentUnhandledRejection();break;default:y&&i.warn("unknown instrumentation type:",e);return}}}function addInstrumentationHandler(e,t){eu[e]=eu[e]||[];eu[e].push(t);instrument(e)}function triggerHandlers(e,t){var n,r;if(e&&eu[e])try{for(var o=__values(eu[e]||[]),s=o.next();!s.done;s=o.next()){var a=s.value;try{a(t)}catch(t){y&&i.error("Error while triggering instrumentation handler.\nType: "+e+"\nName: "+getFunctionName(a)+"\nError:",t)}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}function instrumentConsole(){"console"in ea&&E.forEach(function(e){e in ea.console&&fill(ea.console,e,function(t){return function(){for(var n=[],r=0;r2?t[2]:void 0;if(r){var i=s,o=String(r);s=o;triggerHandlers("history",{from:i,to:o})}return e.apply(this,t)}}}function shouldShortcircuitPreviousDebounce(e,t){if(!e||e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}function shouldSkipDOMEvent(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}function makeDOMEventHandler(e,t){return void 0===t&&(t=!1),function(n){if(!(!n||u===n||shouldSkipDOMEvent(n))){var r="keypress"===n.type?"input":n.type;if(void 0===a){e({event:n,name:r,global:t});u=n}else if(shouldShortcircuitPreviousDebounce(u,n)){e({event:n,name:r,global:t});u=n}clearTimeout(a);a=ea.setTimeout(function(){a=void 0},1e3)}}}function instrumentDOM(){if("document"in ea){var e=triggerHandlers.bind(null,"dom"),t=makeDOMEventHandler(e,!0);ea.document.addEventListener("click",t,!1);ea.document.addEventListener("keypress",t,!1);["EventTarget","Node"].forEach(function(t){var n=ea[t]&&ea[t].prototype;if(n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")){fill(n,"addEventListener",function(t){return function(n,r,i){if("click"===n||"keypress"==n)try{var o=this,s=o.__sentry_instrumentation_handlers__=o.__sentry_instrumentation_handlers__||{},a=s[n]=s[n]||{refCount:0};if(!a.handler){var u=makeDOMEventHandler(e);a.handler=u;t.call(this,n,u,i)}a.refCount+=1}catch(e){}return t.call(this,n,r,i)}});fill(n,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{var i=this,o=i.__sentry_instrumentation_handlers__||{},s=o[t];if(s){s.refCount-=1;if(s.refCount<=0){e.call(this,t,s.handler,r);s.handler=void 0;delete o[t]}0===Object.keys(o).length&&delete i.__sentry_instrumentation_handlers__}}catch(e){}return e.call(this,t,n,r)}})}})}}var ep=null;function instrumentError(){ep=ea.onerror;ea.onerror=function(e,t,n,r,i){return triggerHandlers("error",{column:r,error:i,line:n,msg:e,url:t}),!!ep&&ep.apply(this,arguments)}}var el=null;function instrumentUnhandledRejection(){el=ea.onunhandledrejection;ea.onunhandledrejection=function(e){return triggerHandlers("unhandledrejection",e),!el||el.apply(this,arguments)}}var ed=["fatal","error","warning","log","info","debug","critical"];function isSupportedSeverity(e){return -1!==ed.indexOf(e)}function severityFromString(e){return"warn"===e?r.Warning:isSupportedSeverity(e)?e:r.Log}var ef=function(){function Breadcrumbs(e){this.name=Breadcrumbs.id;this._options=__assign({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},e)}return Breadcrumbs.prototype.addSentryBreadcrumb=function(e){this._options.sentry&&getCurrentHub().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:getEventDescription(e)},{event:e})},Breadcrumbs.prototype.setupOnce=function(){this._options.console&&addInstrumentationHandler("console",_consoleBreadcrumb);this._options.dom&&addInstrumentationHandler("dom",_domBreadcrumb(this._options.dom));this._options.xhr&&addInstrumentationHandler("xhr",_xhrBreadcrumb);this._options.fetch&&addInstrumentationHandler("fetch",_fetchBreadcrumb);this._options.history&&addInstrumentationHandler("history",_historyBreadcrumb)},Breadcrumbs.id="Breadcrumbs",Breadcrumbs}();function _domBreadcrumb(e){return function _innerDomBreadcrumb(t){var n,r="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof r&&(r=[r]);try{n=t.event.target?htmlTreeAsString(t.event.target,r):htmlTreeAsString(t.event,r)}catch(e){n=""}0!==n.length&&getCurrentHub().addBreadcrumb({category:"ui."+t.name,message:n},{event:t.event,name:t.name,global:t.global})}}function _consoleBreadcrumb(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:severityFromString(e.level),message:safeJoin(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message="Assertion failed: "+(safeJoin(e.args.slice(1)," ")||"console.assert");t.data.arguments=e.args.slice(1)}getCurrentHub().addBreadcrumb(t,{input:e.args,level:e.level})}function _xhrBreadcrumb(e){if(e.endTimestamp&&!e.xhr.__sentry_own_request__){var t=e.xhr.__sentry_xhr__||{},n=t.method,r=t.url,i=t.status_code,o=t.body;getCurrentHub().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:i},type:"http"},{xhr:e.xhr,input:o});return}}function _fetchBreadcrumb(e){!e.endTimestamp||e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?getCurrentHub().addBreadcrumb({category:"fetch",data:e.fetchData,level:r.Error,type:"http"},{data:e.error,input:e.args}):getCurrentHub().addBreadcrumb({category:"fetch",data:__assign(__assign({},e.fetchData),{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response}))}function _historyBreadcrumb(e){var t=(0,v.V)(),n=e.from,r=e.to,i=parseUrl(t.location.href),o=parseUrl(n),s=parseUrl(r);o.path||(o=i);i.protocol===s.protocol&&i.host===s.host&&(r=s.relative);i.protocol===o.protocol&&i.host===o.host&&(n=o.relative);getCurrentHub().addBreadcrumb({category:"navigation",data:{from:n,to:r}})}var eh=function(e){__extends(BrowserClient,e);function BrowserClient(t){return void 0===t&&(t={}),t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:O}],version:O},e.call(this,ei,t)||this}return BrowserClient.prototype.showReportDialog=function(e){void 0===e&&(e={});var t=(0,v.V)().document;if(t){if(!this._isEnabled()){Q&&i.error("Trying to call showReportDialog with Sentry Client disabled");return}injectReportDialog(__assign(__assign({},e),{dsn:e.dsn||this.getDsn()}))}},BrowserClient.prototype._prepareEvent=function(t,n,r){return t.platform=t.platform||"javascript",e.prototype._prepareEvent.call(this,t,n,r)},BrowserClient.prototype._sendEvent=function(t){var n=this.getIntegration(ef);n&&n.addSentryBreadcrumb(t);e.prototype._sendEvent.call(this,t)},BrowserClient}(D),e_=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],ev=function(){function InboundFilters(e){void 0===e&&(e={});this._options=e;this.name=InboundFilters.id}return InboundFilters.prototype.setupOnce=function(e,t){e(function(e){var n=t();if(n){var r=n.getIntegration(InboundFilters);if(r){var i=n.getClient(),o=i?i.getOptions():{};return _shouldDropEvent(e,_mergeOptions(r._options,o))?null:e}}return e})},InboundFilters.id="InboundFilters",InboundFilters}();function _mergeOptions(e,t){return void 0===e&&(e={}),void 0===t&&(t={}),{allowUrls:tslib_es6_spread(e.whitelistUrls||[],e.allowUrls||[],t.whitelistUrls||[],t.allowUrls||[]),denyUrls:tslib_es6_spread(e.blacklistUrls||[],e.denyUrls||[],t.blacklistUrls||[],t.denyUrls||[]),ignoreErrors:tslib_es6_spread(e.ignoreErrors||[],t.ignoreErrors||[],e_),ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}function _shouldDropEvent(e,t){return t.ignoreInternal&&_isSentryError(e)?(P&&i.warn("Event dropped due to being internal Sentry Error.\nEvent: "+getEventDescription(e)),!0):_isIgnoredError(e,t.ignoreErrors)?(P&&i.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+getEventDescription(e)),!0):_isDeniedUrl(e,t.denyUrls)?(P&&i.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+getEventDescription(e)+".\nUrl: "+_getEventFilterUrl(e)),!0):!_isAllowedUrl(e,t.allowUrls)&&(P&&i.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+getEventDescription(e)+".\nUrl: "+_getEventFilterUrl(e)),!0)}function _isIgnoredError(e,t){return!!t&&!!t.length&&_getPossibleEventMessages(e).some(function(e){return t.some(function(t){return isMatchingPattern(e,t)})})}function _isDeniedUrl(e,t){if(!t||!t.length)return!1;var n=_getEventFilterUrl(e);return!!n&&t.some(function(e){return isMatchingPattern(n,e)})}function _isAllowedUrl(e,t){if(!t||!t.length)return!0;var n=_getEventFilterUrl(e);return!n||t.some(function(e){return isMatchingPattern(n,e)})}function _getPossibleEventMessages(e){if(e.message)return[e.message];if(e.exception)try{var t=e.exception.values&&e.exception.values[0]||{},n=t.type,r=t.value,o=void 0===r?"":r;return[""+o,(void 0===n?"":n)+": "+o]}catch(t){P&&i.error("Cannot extract message for event "+getEventDescription(e))}return[]}function _isSentryError(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}function _getLastValidUrl(e){void 0===e&&(e=[]);for(var t=e.length-1;t>=0;t--){var n=e[t];if(n&&""!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}function _getEventFilterUrl(e){try{var t;if(e.stacktrace)return _getLastValidUrl(e.stacktrace.frames);try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?_getLastValidUrl(t):null}catch(t){P&&i.error("Cannot extract url for event "+getEventDescription(e));return null}}var eg=function(){function FunctionToString(){this.name=FunctionToString.id}return FunctionToString.prototype.setupOnce=function(){c=Function.prototype.toString;Function.prototype.toString=function(){for(var e=[],t=0;t0?t:getLocationHref();return 0===u.length&&u.push({colno:c,filename:l,function:"?",in_app:!0,lineno:p}),e}function globalHandlerLog(e){Q&&i.log("Global Handler attached: "+e)}function addMechanismAndCapture(e,t,n,r){addExceptionMechanism(n,{handled:!1,type:r});e.captureEvent(n,{originalException:t})}function getHubAndAttachStacktrace(){var e=getCurrentHub(),t=e.getClient();return[e,t&&t.getOptions().attachStacktrace]}var eE=function(){function LinkedErrors(e){void 0===e&&(e={});this.name=LinkedErrors.id;this._key=e.key||"cause";this._limit=e.limit||5}return LinkedErrors.prototype.setupOnce=function(){addGlobalEventProcessor(function(e,t){var n=getCurrentHub().getIntegration(LinkedErrors);return n?_handler(n._key,n._limit,e,t):e})},LinkedErrors.id="LinkedErrors",LinkedErrors}();function _handler(e,t,n,r){if(!n.exception||!n.exception.values||!r||!isInstanceOf(r.originalException,Error))return n;var i=_walkErrorTree(t,r.originalException,e);return n.exception.values=tslib_es6_spread(i,n.exception.values),n}function _walkErrorTree(e,t,n,r){void 0===r&&(r=[]);if(!isInstanceOf(t[n],Error)||r.length+1>=e)return r;var i=exceptionFromError(t[n]);return _walkErrorTree(e,t[n],n,tslib_es6_spread([i],r))}var eS=function(){function Dedupe(){this.name=Dedupe.id}return Dedupe.prototype.setupOnce=function(e,t){e(function(e){var n=t().getIntegration(Dedupe);if(n){try{if(dedupe_shouldDropEvent(e,n._previousEvent)){Q&&i.warn("Event dropped due to being a duplicate of previously captured event.");return null}}catch(e){}return n._previousEvent=e}return e})},Dedupe.id="Dedupe",Dedupe}();function dedupe_shouldDropEvent(e,t){return!!t&&!!(_isSameMessageEvent(e,t)||_isSameExceptionEvent(e,t))}function _isSameMessageEvent(e,t){var n=e.message,r=t.message;return!!((n||r)&&(!n||r)&&(n||!r)&&n===r&&_isSameFingerprint(e,t)&&_isSameStacktrace(e,t))}function _isSameExceptionEvent(e,t){var n=_getExceptionFromEvent(t),r=_getExceptionFromEvent(e);return!!(n&&r&&n.type===r.type&&n.value===r.value&&_isSameFingerprint(e,t)&&_isSameStacktrace(e,t))}function _isSameStacktrace(e,t){var n=_getFramesFromEvent(e),r=_getFramesFromEvent(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||r.length!==n.length)return!1;for(var i=0;i1)for(var n=1;n