Socket
Socket
Sign inDemoInstall

@elastic/apm-rum

Package Overview
Dependencies
Maintainers
61
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@elastic/apm-rum - npm Package Compare versions

Comparing version 4.7.0 to 4.7.1

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [4.7.1](https://github.com/elastic/apm-agent-rum-js/compare/@elastic/apm-rum@4.7.0...@elastic/apm-rum@4.7.1) (2020-01-30)
**Note:** Version bump only for package @elastic/apm-rum
# [4.7.0](https://github.com/elastic/apm-agent-rum-js/compare/@elastic/apm-rum@4.6.0...@elastic/apm-rum@4.7.0) (2020-01-15)

@@ -8,0 +16,0 @@

2

dist/bundles/elastic-apm-opentracing.umd.min.js
/*! For license information please see elastic-apm-opentracing.umd.min.js.LICENSE */
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){var r;r=function(){"use strict";function t(t){return"function"==typeof t}var e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=0,r=void 0,i=void 0,o=function(t,e){p[n]=t,p[n+1]=e,2===(n+=2)&&(i?i(h):y())},a="undefined"!=typeof window?window:void 0,s=a||{},c=s.MutationObserver||s.WebKitMutationObserver,u="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(h,1)}}var p=new Array(1e3);function h(){for(var t=0;t<n;t+=2)(0,p[t])(p[t+1]),p[t]=void 0,p[t+1]=void 0;n=0}var l,v,g,m,y=void 0;function _(t,e){var n=this,r=new this.constructor(b);void 0===r[w]&&F(r);var i=n._state;if(i){var a=arguments[i-1];o((function(){return R(i,r,a,n._result)}))}else N(n,r,t,e);return r}function S(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(b);return O(e,t),e}u?y=function(){return process.nextTick(h)}:c?(v=0,g=new c(h),m=document.createTextNode(""),g.observe(m,{characterData:!0}),y=function(){m.data=v=++v%2}):f?((l=new MessageChannel).port1.onmessage=h,y=function(){return l.port2.postMessage(0)}):y=void 0===a?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(h)}:d()}catch(t){return d()}}():d();var w=Math.random().toString(36).substring(2);function b(){}var T=void 0,E=1,x=2;function C(e,n,r){n.constructor===e.constructor&&r===_&&n.constructor.resolve===S?function(t,e){e._state===E?I(t,e._result):e._state===x?k(t,e._result):N(e,void 0,(function(e){return O(t,e)}),(function(e){return k(t,e)}))}(e,n):void 0===r?I(e,n):t(r)?function(t,e,n){o((function(t){var r=!1,i=function(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}(n,e,(function(n){r||(r=!0,e!==n?O(t,n):I(t,n))}),(function(e){r||(r=!0,k(t,e))}),t._label);!r&&i&&(r=!0,k(t,i))}),t)}(e,n,r):I(e,n)}function O(t,e){if(t===e)k(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=e),null===r||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void k(t,e)}C(t,e,n)}var r,i}function L(t){t._onerror&&t._onerror(t._result),A(t)}function I(t,e){t._state===T&&(t._result=e,t._state=E,0!==t._subscribers.length&&o(A,t))}function k(t,e){t._state===T&&(t._state=x,t._result=e,o(L,t))}function N(t,e,n,r){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+E]=n,i[a+x]=r,0===a&&t._state&&o(A,t)}function A(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,i=void 0,o=t._result,a=0;a<e.length;a+=3)r=e[a],i=e[a+n],r?R(n,r,i,o):i(o);t._subscribers.length=0}}function R(e,n,r,i){var o=t(r),a=void 0,s=void 0,c=!0;if(o){try{a=r(i)}catch(t){c=!1,s=t}if(n===a)return void k(n,new TypeError("A promises callback cannot return that same promise."))}else a=i;n._state!==T||(o&&c?O(n,a):!1===c?k(n,s):e===E?I(n,a):e===x&&k(n,a))}var j=0;function F(t){t[w]=j++,t._state=void 0,t._result=void 0,t._subscribers=[]}var M=function(){function t(t,n){this._instanceConstructor=t,this.promise=new t(b),this.promise[w]||F(this.promise),e(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&I(this.promise,this._result))):k(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===T&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===S){var i=void 0,o=void 0,a=!1;try{i=t.then}catch(t){a=!0,o=t}if(i===_&&t._state!==T)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===P){var s=new n(b);a?k(s,o):C(s,t,i),this._willSettleAt(s,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===T&&(this._remaining--,t===x?k(r,n):this._result[e]=n),0===this._remaining&&I(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;N(t,void 0,(function(t){return n._settledAt(E,e,t)}),(function(t){return n._settledAt(x,e,t)}))},t}(),P=function(){function e(t){this[w]=j++,this._result=this._state=void 0,this._subscribers=[],b!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){O(t,e)}),(function(e){k(t,e)}))}catch(e){k(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this.constructor;return t(e)?this.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):this.then(e,e)},e}();return P.prototype.then=_,P.all=function(t){return new M(this,t).promise},P.race=function(t){var n=this;return e(t)?new n((function(e,r){for(var i=t.length,o=0;o<i;o++)n.resolve(t[o]).then(e,r)})):new n((function(t,e){return e(new TypeError("You must pass an array to race."))}))},P.resolve=S,P.reject=function(t){var e=new this(b);return k(e,t),e},P._setScheduler=function(t){i=t},P._setAsap=function(t){o=t},P._asap=o,P.polyfill=function(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=P},P.Promise=P,P},t.exports=r()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FORMAT_BINARY="binary",e.FORMAT_TEXT_MAP="text_map",e.FORMAT_HTTP_HEADERS="http_headers",e.REFERENCE_CHILD_OF="child_of",e.REFERENCE_FOLLOWS_FROM="follows_from"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),i=function(){function t(){}return t.prototype.context=function(){return this._context()},t.prototype.tracer=function(){return this._tracer()},t.prototype.setOperationName=function(t){return this._setOperationName(t),this},t.prototype.setBaggageItem=function(t,e){return this._setBaggageItem(t,e),this},t.prototype.getBaggageItem=function(t){return this._getBaggageItem(t)},t.prototype.setTag=function(t,e){return this._addTags(((n={})[t]=e,n)),this;var n},t.prototype.addTags=function(t){return this._addTags(t),this},t.prototype.log=function(t,e){return this._log(t,e),this},t.prototype.logEvent=function(t,e){return this._log({event:t,payload:e})},t.prototype.finish=function(t){this._finish(t)},t.prototype._context=function(){return r.spanContext},t.prototype._tracer=function(){return r.tracer},t.prototype._setOperationName=function(t){},t.prototype._setBaggageItem=function(t,e){},t.prototype._getBaggageItem=function(t){},t.prototype._addTags=function(t){},t.prototype._log=function(t,e){},t.prototype._finish=function(t){},t}();e.Span=i,e.default=i},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var i=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),i=n(5),o=n(2),a=function(){function t(){}return t.prototype.startSpan=function(t,e){if(void 0===e&&(e={}),e.childOf){var n=r.childOf(e.childOf);e.references?e.references.push(n):e.references=[n],delete e.childOf}return this._startSpan(t,e)},t.prototype.inject=function(t,e,n){return t instanceof o.default&&(t=t.context()),this._inject(t,e,n)},t.prototype.extract=function(t,e){return this._extract(t,e)},t.prototype._startSpan=function(t,e){return i.span},t.prototype._inject=function(t,e,n){},t.prototype._extract=function(t,e){return i.spanContext},t}();e.Tracer=a,e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=n(10),o=n(4);e.tracer=null,e.spanContext=null,e.span=null,e.initialize=function(){e.tracer=new o.default,e.span=new r.default,e.spanContext=new i.default}},function(t,e,n){var r,i,o;!function(a,s){"use strict";i=[n(7)],void 0===(o="function"==typeof(r=function(t){var e=/(^|@)\S+\:\d+/,n=/^\s*at .*(\S+\:\d+|\(native\))/m,r=/^(eval@)?(\[native code\])?$/;function i(t,e,n){if("function"==typeof Array.prototype.map)return t.map(e,n);for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=e.call(n,t[i]);return r}function o(t,e,n){if("function"==typeof Array.prototype.filter)return t.filter(e,n);for(var r=[],i=0;i<t.length;i++)e.call(n,t[i])&&r.push(t[i]);return r}return{parse:function(t){if(void 0!==t.stacktrace||void 0!==t["opera#sourceloc"])return this.parseOpera(t);if(t.stack&&t.stack.match(n))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?:\:(\d+))?(?:\:(\d+))?$/.exec(t.replace(/[\(\)]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(e){return i(o(e.stack.split("\n"),(function(t){return!!t.match(n)}),this),(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var n=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),r=this.extractLocation(n.pop()),i=n.join(" ")||void 0,o=function(t,e){if("function"==typeof Array.prototype.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}(["eval","<anonymous>"],r[0])>-1?void 0:r[0];return new t(i,void 0,o,r[1],r[2],e)}),this)},parseFFOrSafari:function(e){return i(o(e.stack.split("\n"),(function(t){return!t.match(r)}),this),(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new t(e);var n=e.split("@"),r=this.extractLocation(n.pop()),i=n.join("@")||void 0;return new t(i,void 0,r[0],r[1],r[2],e)}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],o=2,a=r.length;o<a;o+=2){var s=n.exec(r[o]);s&&i.push(new t(void 0,void 0,s[2],s[1],void 0,r[o]))}return i},parseOpera10:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],o=0,a=r.length;o<a;o+=2){var s=n.exec(r[o]);s&&i.push(new t(s[3]||void 0,void 0,s[2],s[1],void 0,r[o]))}return i},parseOpera11:function(n){return i(o(n.stack.split("\n"),(function(t){return!!t.match(e)&&!t.match(/^Error created at/)}),this),(function(e){var n,r=e.split("@"),i=this.extractLocation(r.pop()),o=r.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(n=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var s=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new t(a,s,i[0],i[1],i[2],e)}),this)}}})?r.apply(e,i):r)||(t.exports=o)}()},function(t,e,n){var r,i,o;!function(n,a){"use strict";i=[],void 0===(o="function"==typeof(r=function(){function t(t){return!isNaN(parseFloat(t))&&isFinite(t)}function e(t,e,n,r,i,o){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==i&&this.setColumnNumber(i),void 0!==o&&this.setSource(o)}return e.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(e){if(!t(e))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(e)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(e){if(!t(e))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(e)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(t(this.getLineNumber())?":"+this.getLineNumber():"")+(t(this.getColumnNumber())?":"+this.getColumnNumber():"")}},e})?r.apply(e,i):r)||(t.exports=o)}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=n(9),o=n(2);e.childOf=function(t){return t instanceof o.default&&(t=t.context()),new i.default(r.REFERENCE_CHILD_OF,t)},e.followsFrom=function(t){return t instanceof o.default&&(t=t.context()),new i.default(r.REFERENCE_FOLLOWS_FROM,t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=function(){function t(t,e){this._type=t,this._referencedContext=e instanceof r.default?e.context():e}return t.prototype.type=function(){return this._type},t.prototype.referencedContext=function(){return this._referencedContext},t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){};e.SpanContext=r,e.default=r},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),o=n(0),a=[].slice;for(var s=[],c=0;c<256;++c)s[c]=(c+256).toString(16).substr(1);function u(t,e){var n=!1;return"string"==typeof e?n=t===e:Array.isArray(e)&&e.forEach((function(e){n||(n=u(t,e))})),n}function f(t){var e,n,r,o;return(e=i()(),r=n||0,[(o=s)[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")).substr(0,t)}function d(){return"undefined"!=typeof window&&"function"==typeof Array.prototype.forEach&&"function"==typeof JSON.stringify&&"function"==typeof Function.bind&&window.performance&&"function"==typeof window.performance.now&&"withCredentials"in new window.XMLHttpRequest}function p(t,e,n){if(n&&t){var r=E(t);return e&&(e=String(e)),n[r]=e,n}}var h=["fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","responseEnd","domLoading","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd"];function l(){return window.performance.timing.fetchStart}function v(){return{page:{referer:document.referrer,url:window.location.href}}}function g(t){return t&&t.split("?")[0]}function m(t){return null!==t&&"object"==typeof t}function y(t,e,n){for(var r=0,i=e.length;r<i;++r){var o=e[r];if(m(o)||"function"==typeof o)for(var a=Object.keys(o),s=0,c=a.length;s<c;s++){var u=a[s],f=o[u];n&&m(f)?(m(t[u])||(t[u]=Array.isArray(f)?[]:{}),y(t[u],[f],!1)):t[u]=f}}return t}function _(){if("undefined"!=typeof document){var t=document.currentScript;return t||function(){if("undefined"!=typeof document)for(var t=document.getElementsByTagName("script"),e=0,n=t.length;e<n;e++){var r=t[e];if(r.src.indexOf("elastic")>0)return r}}()}}function S(t){return y(t,a.call(arguments,1),!1)}function w(t){return y(t,a.call(arguments,1),!0)}function b(t){return void 0===t}function T(){}function E(t){return t.replace(/[.*"]/g,"_")}function x(){var t=function(){var t=window.performance.timing,e=t.fetchStart,n={};return h.forEach((function(r){var i=t[r];i&&i>=e&&(n[r]=i-e)})),n}(),e=function(){var t={},e=window.performance;if("function"==typeof e.getEntriesByType){var n=e.getEntriesByType("paint");if(n.length>0)for(var r=e.timing,i=r.fetchStart-r.navigationStart,o=0;o<n.length;o++){var a=n[o],s=i>=0?a.startTime-i:a.startTime;t[a.name]=s}}return t}(),n={timeToFirstByte:t.responseStart,domInteractive:t.domInteractive,domComplete:t.domComplete};return e["first-contentful-paint"]&&(n.firstContentfulPaint=e["first-contentful-paint"]),{navigationTiming:t,agent:n}}function C(){return window.performance.now()}function O(t){return"number"==typeof t&&t>=0?t:C()}function L(t,e){return b(e)||b(t)?null:parseFloat(e-t)}function I(t){o.Promise.resolve().then(t)}var k={fetchInProgress:!1};function N(t){return"__apm_symbol__"+t}function A(t,e,n){for(var r=t;r&&!r.hasOwnProperty(e);)r=Object.getPrototypeOf(r);!r&&t[e]&&(r=t);var i,o,a,s,c=N(e);if(r&&!(i=r[c])){i=r[c]=r[e];var u=r&&Object.getOwnPropertyDescriptor(r,e);if(!(s=u)||!1!==s.writable&&("function"!=typeof s.get||void 0!==s.set)){var f=n(i,c,e);r[e]=function(){return f(this,arguments)},o=r[e],a=i,o[N("OriginalDelegate")]=a}}return i}var R=N("xhrIgnore"),j=N("xhrSync"),F=N("xhrURL"),M=N("xhrMethod"),P="schedule",q="invoke",H="clear",D="addEventListener",B="removeEventListener",Q=["link","css","script","img","xmlhttprequest","fetch","beacon","iframe"],z=3e5,U="page-load",$="custom",X="Unknown",V=[U,"route-change","http-request",$,"temporary"],J=60,Y="xmlhttprequest",W="fetch",Z="history",G="error",K=1024,tt=N("xhrTask"),et=N("xhrListener"),nt=N("xhrScheduled");function rt(t){var e=XMLHttpRequest.prototype,n=e[D],r=e[B];if(!n){var i=window.XMLHttpRequestEventTarget;if(i){var o=i.prototype;n=o[D],r=o[B]}}var a="readystatechange",s="load";function c(e){e.state=q,t(q,e)}function u(e){XMLHttpRequest[nt]=!1,e.state=P,t(P,e);var i=e.data,o=i.aborted,u=i.target;n||(n=u[D],r=u[B]);var f,d=u[et];d&&(r.call(u,a,d),r.call(u,s,d));var p=u[et]=function(t){var n=t.type;f?f!=n&&function(t){setTimeout(t,0)}((function(){e.state!==q&&c(e)})):u.readyState===u.DONE&&!o&&XMLHttpRequest[nt]&&e.state===P&&(f=n)};n.call(u,a,p),n.call(u,s,p),u[tt]||(u[tt]=e)}var f=A(e,"open",(function(){return function(t,e){return t[R]||(t[M]=e[0],t[F]=e[1],t[j]=!1===e[2]),f.apply(t,e)}})),d=A(e,"send",(function(){return function(t,e){if(t[R])return d.apply(t,e);var n={source:Y,state:"",type:"macroTask",data:{target:t,method:t[M],sync:t[j],url:t[F],aborted:!1}};u(n);var r=d.apply(t,e);return XMLHttpRequest[nt]=!0,t[j]&&c(n),r}})),p=A(e,"abort",(function(){return function(e,n){if(!e[R]){var r=e[tt];if(r&&"string"==typeof r.type){if(r.data&&r.data.aborted)return;!function(e){e.state=H,t(H,e),e.data.aborted=!0}(r)}}return p.apply(e,n)}}))}var it=function(){function t(){this.observers={}}var e=t.prototype;return e.observe=function(t,e){var n=this;if("function"==typeof e)return this.observers[t]||(this.observers[t]=[]),this.observers[t].push(e),function(){var r=n.observers[t].indexOf(e);r>-1&&n.observers[t].splice(r,1)}},e.sendOnly=function(t,e){var n=this.observers[t];n&&n.forEach((function(t){try{t.apply(void 0,e)}catch(t){console.log(t,t.stack)}}))},e.send=function(t,e){this.sendOnly(t+":before",e),this.sendOnly(t,e),this.sendOnly(t+":after",e)},t}(),ot=new it,at=!1;function st(){return at||(at=!0,rt((function(t,e){ot.send(Y,[t,e])})),function(t){if(window.fetch&&window.Request){var e=window.fetch;window.fetch=function(t,i){var a,s,c=this,u=arguments;if("string"==typeof t)a=new Request(t,i),s=t;else{if(!t)return e.apply(c,u);s=(a=t).url}var f={source:W,state:"",type:"macroTask",data:{target:a,method:a.method,sync:!1,url:s,aborted:!1}};return new o.Promise((function(t,i){var o;k.fetchInProgress=!0,n(f);try{o=e.apply(c,[a])}catch(t){return i(t),f.data.error=t,r(f),void(k.fetchInProgress=!1)}o.then((function(e){t(e),I((function(){f.data.response=e,r(f)}))}),(function(t){i(t),I((function(){f.data.error=t,r(f)}))})),k.fetchInProgress=!1}))}}function n(e){e.state=P,t(P,e)}function r(e){e.state=q,t(q,e)}}((function(t,e){ot.send(W,[t,e])})),function(t){if(window.history){var e=history.pushState;"function"==typeof e&&(history.pushState=function(n,r,i){var o={source:Z,data:{state:n,title:r,url:i}};t(q,o),e.apply(this,arguments)})}}((function(t,e){ot.send(Z,[t,e])}))),ot}var ct=!1,ut=!1;var ft=n(6),dt=n.n(ft);function pt(t){var e=t.error,n=t.filename,r=t.lineno,i=t.colno,o=[];if(e)try{o=dt.a.parse(e)}catch(t){}return 0===o.length&&(o=[{fileName:n,lineNumber:r,columnNumber:i}]),o.map((function(t){return t.functionName&&(t.functionName=(e=t.functionName,n=e.split("/"),e=(e=(e=n.length>1?["Object",n[n.length-1]].join("."):n[0]).replace(/.<$/gi,".<anonymous>")).replace(/^Anonymous function$/,"<anonymous>"),e=(n=e.split(".")).length>1?n[n.length-1]:n[0])),t;var e,n})).map((function(t){var e=t.fileName,n=t.lineNumber,r=t.columnNumber,i=t.functionName,o=void 0===i?"<anonymous>":i;if(!e&&!n)return{};if(!r&&!n)return{};var a,s,c=function(t){return void 0===t&&(t=""),"<anonymous>"===t&&(t=""),t}(e),u=(a=c,s=window.location.origin||window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),a.indexOf(s)>-1&&(a=a.replace(s+"/","")),a);return function(t){return!!t&&0===window.location.href.indexOf(t)}(c)&&(u="(inline script)"),{abs_path:e,filename:u,function:o,lineno:n,colno:r}}))}var ht={service:{name:[K,!0],version:!0,agent:{version:[K,!0]},environment:!0}},lt={"*":!0,headers:{"*":!0}},vt={user:{id:!0,email:!0,username:!0},tags:{"*":!0},http:{response:lt},destination:{address:[K],service:{"*":[K,!0]}},response:lt},gt={name:[K,!0],type:[K,!0],id:[K,!0],trace_id:[K,!0],parent_id:[K,!0],transaction_id:[K,!0],subtype:!0,action:!0,context:vt},mt={name:!0,parent_id:!0,type:[K,!0],id:[K,!0],trace_id:[K,!0],span_count:{started:[K,!0]},context:vt},yt={id:[K,!0],trace_id:!0,transaction_id:!0,parent_id:!0,culprit:!0,exception:{type:!0},transaction:{type:!0},context:vt};function _t(t){return null==t||""===t||void 0===t}function St(t,e,n){var r=function(t,e,n,r){return void 0===e&&(e=K),void 0===n&&(n=!1),void 0===r&&(r="N/A"),n&&_t(t)&&(t=r),"string"==typeof t?t.substring(0,e):t}(t[e],n[0],n[1]);_t(r)?delete t[e]:t[e]=r}function wt(t,e,n){void 0===t&&(t={}),void 0===n&&(n=e);for(var r=Object.keys(t),i=[],o=function(o){var a=r[o],s=!0===t[a]?i:t[a];Array.isArray(s)?"*"===a?Object.keys(n).forEach((function(t){return St(n,t,s)})):St(n,a,s):wt(s,e,n[a])},a=0;a<r.length;a++)o(a);return e}var bt=function(){function t(t,e,n){this._apmServer=t,this._configService=e,this._transactionService=n}var e=t.prototype;return e.createErrorDataModel=function(t){var e=function(t){return t.filter((function(t){var e=t.filename,n=t.lineno;return void 0!==e&&void 0!==n}))}(pt(t)),n="(inline script)",r=e[e.length-1];r&&r.filename&&(n=r.filename);var i=t.message,o=t.error,a=i,s="",c={};o&&"object"==typeof o&&(a=a||o.message,s=o.name,c=this._getErrorProperties(o)),s||a&&a.indexOf(":")>-1&&(s=a.split(":")[0]);var u=this._transactionService.getCurrentTransaction(),d=u?u.context:{},p=this._configService.get("context"),h=w({},v(),d,p,c),l={id:f(),culprit:n,exception:{message:a,stacktrace:e,type:s},context:h};return u&&(l=S(l,{trace_id:u.traceId,parent_id:u.id,transaction_id:u.id,transaction:{type:u.type,sampled:u.sampled}})),wt(yt,l)},e.logErrorEvent=function(t,e){if(void 0!==t){var n=this.createErrorDataModel(t);if(void 0!==n.exception.message)return e?this._apmServer.sendErrors([n]):this._apmServer.addError(n)}},e.registerListeners=function(){var t=this;window.addEventListener("error",(function(e){return t.logErrorEvent(e)})),window.addEventListener("unhandledrejection",(function(e){return t.logPromiseEvent(e)}))},e.logPromiseEvent=function(t){var e="Unhandled promise rejection: ",n=t.reason;null==n?this.logError(e+"<no reason specified>"):"string"==typeof n.message?this.logError({message:e+n.message,stack:n.stack?n.stack:null}):"object"!=typeof n&&this.logError(e+n)},e.logError=function(t){var e={};return"string"==typeof t?e.message=t:e.error=t,this.logErrorEvent(e)},e._getErrorProperties=function(t){var e={};return Object.keys(t).forEach((function(n){if("stack"!==n){var r=t[n];if(null!==r){switch(typeof r){case"function":return;case"object":if("function"!=typeof r.toISOString)return;r=r.toISOString()}e[n]=r}}})),e},t}(),Tt={ErrorLogging:bt,registerServices:function(t){t.registerServiceCreator("ErrorLogging",(function(){var e=t.getService("ApmServer"),n=t.getService("ConfigService"),r=t.getService("TransactionService");return new bt(e,n,r)}))}};var Et=[["#","hash"],["?","query"],["/","path"],["@","auth",1],[NaN,"host",void 0,1]],xt=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,Ct=function(){function t(t){var e,n=this.extractProtocol(t||""),r=n.protocol,i=n.address,o=n.slashes,a=!r&&!o,s=this.getLocation(),c=Et.slice();i=i.replace("\\","/"),o||(c[2]=[NaN,"path"]);for(var u=0;u<c.length;u++){var f=c[u],d=f[0],p=f[1];if("string"==typeof d){if(~(e=i.indexOf(d))){var h=f[2];if(h){var l=i.lastIndexOf(d);e=Math.max(e,l),this[p]=i.slice(0,e),i=i.slice(e+h)}else this[p]=i.slice(e),i=i.slice(0,e)}}else this[p]=i,i="";this[p]=this[p]||a&&f[3]&&s[p]||"",f[3]&&(this[p]=this[p].toLowerCase())}if(a&&"/"!==this.path.charAt(0)&&(this.path="/"+this.path),this.relative=a,this.protocol=r||s.protocol,this.hostname=this.host,this.port="",/:\d+$/.test(this.host)){var v=this.host.split(":"),g=v.pop(),m=v.join(":");!function(t,e){switch(e){case"http:":return"80"===t;case"https:":return"443"===t}return!0}(g,this.protocol)?this.port=g:this.host=m,this.hostname=m}this.origin=this.protocol&&this.host&&"file:"!==this.protocol?this.protocol+"//"+this.host:"null",this.href=this.toString()}var e=t.prototype;return e.toString=function(){var t=this.protocol;if(t+="//",this.auth){var e=this.auth.split(":");t+=(e[0]?"[REDACTED]":"")+(e[1]?":[REDACTED]":"")+"@"}return t+=this.host,t+=this.path,t+=this.query,t+=this.hash},e.getLocation=function(){var t={};return"undefined"!=typeof window&&(t=window),t.location},e.extractProtocol=function(t){var e=xt.exec(t);return{protocol:e[1]?e[1].toLowerCase():"",slashes:!!e[2],address:e[3]}},t}(),Ot=function(){function t(t,e,n,r){this._apmServer=t,this._configService=e,this._logginService=n,this._transactionService=r}var e=t.prototype;return e.init=function(t){var e=this;void 0===t&&(t={}),this._configService.events.observe("transaction:end:after",(function(t){var n=e.createTransactionPayload(t);n&&e._apmServer.addTransaction(n)})),t[Z]&&ot.observe(Z,this.getHistorySub()),t[Y]&&ot.observe(Y,this.getXHRSub()),t[W]&&ot.observe(W,this.getFetchSub())},e.getHistorySub=function(){var t=this._transactionService;return function(e,n){n.source===Z&&e===q&&t.startTransaction(n.data.title,"route-change",{managed:!0,canReuse:!0})}},e.getXHRSub=function(){var t=this;return function(e,n){n.source!==Y||k.fetchInProgress||t.processAPICalls(e,n)}},e.getFetchSub=function(){var t=this;return function(e,n){n.source===W&&t.processAPICalls(e,n)}},e.processAPICalls=function(t,e){var n=this._configService,r=this._transactionService;if(t===P&&e.data){var i=e.data,o=new Ct(i.url),a=i.method+" "+(o.relative?o.path:g(o.href));r.getCurrentTransaction()||r.startTransaction(a,"http-request",{managed:!0});var s=r.startSpan(a,"external.http"),c=r.addTask();if(!s)return;var f=n.get("distributedTracing"),d=n.get("distributedTracingOrigins"),p=new Ct(window.location.href),h=u(o.origin,p.origin)||u(o.origin,d),l=i.target;f&&h&&l&&this.injectDtHeader(s,l),s.sync=i.sync,i.span=s,e.id=c}else t===q&&(e.data&&e.data.span&&e.data.span.end(null,e.data),e.id&&r.removeTask(e.id))},e.injectDtHeader=function(t,e){var n,r=this._configService.get("distributedTracingHeaderName"),i=function(t){if(t&&t.traceId&&t.id&&t.parentId){var e=t.sampled?"01":"00",n=t.sampled?t.id:t.parentId;return"00-"+t.traceId+"-"+n+"-"+e}}(t),o=/^[\da-f]{2}-[\da-f]{32}-[\da-f]{16}-[\da-f]{2}$/.test(n=i)&&"00000000000000000000000000000000"!==n.slice(3,35)&&"0000000000000000"!==n.slice(36,52);r&&i&&o&&("function"==typeof e.setRequestHeader?e.setRequestHeader(r,i):e.headers&&"function"==typeof e.headers.append?e.headers.append(r,i):e[r]=i)},e.extractDtHeader=function(t){var e=this._configService.get("distributedTracingHeaderName");if(t)return function(t){var e=/^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})$/.exec(t);if(e){var n="00"!==e[4];return{traceId:e[2],id:e[3],sampled:n}}}(t[e])},e.filterTransaction=function(t){var e=this._configService.get("transactionDurationThreshold"),n=t.duration();if(!n)return!1;if(n>e)return!1;if((t.sampled||t.resetSpans(),t.options.checkBrowserResponsiveness)&&!this.checkBrowserResponsiveness(t,500,3))return!1;return!0},e.prepareTransaction=function(t){t.spans.sort((function(t,e){return t._start-e._start})),this._configService.get("groupSimilarSpans")&&(t.spans=this.groupSmallContinuouslySimilarSpans(t,.05)),t.spans=t.spans.filter((function(e){return e.duration()>0&&e._start>=t._start&&e._end<=t._end}))},e.createTransactionDataModel=function(t){var e=t._start,n=t.spans.map((function(n){var r={id:n.id,transaction_id:t.id,parent_id:n.parentId||t.id,trace_id:t.traceId,name:n.name,type:n.type,subType:n.subType,action:n.action,sync:n.sync,start:n._start-e,duration:n.duration(),context:n.context};return wt(gt,r)})),r={id:t.id,trace_id:t.traceId,name:t.name,type:t.type,duration:t.duration(),spans:n,context:t.context,marks:t.marks,breakdown:t.breakdownTimings,span_count:{started:n.length},sampled:t.sampled};return wt(mt,r)},e.createTransactionPayload=function(t){if(this.prepareTransaction(t),this.filterTransaction(t))return this.createTransactionDataModel(t)},e.convertTransactionsToServerModel=function(t){var e=this;return t.map((function(t){return e.createTransactionDataModel(t)}))},e.groupSmallContinuouslySimilarSpans=function(t,e){var n=t.duration(),r=[],i=1;return t.spans.forEach((function(o,a){if(0===r.length)r.push(o);else{var s=r[r.length-1],c=s.type===o.type&&s.subType===o.subType&&s.action===o.action&&s.name===o.name&&o.duration()/n<e&&(o._start-s._end)/n<e,u=t.spans.length===a+1;c&&(i++,s._end=o._end),i>1&&(!c||u)&&(s.name=i+"x "+s.name,i=1),c||r.push(o)}})),r},e.checkBrowserResponsiveness=function(t,e,n){var r=t.browserResponsivenessCounter,i=t.duration();return r+n>=Math.floor(i/e)},t}(),Lt=function(){function t(t,e,n){void 0===n&&(n={}),t||(t=X),e||(e=$),this.name=t,this.type=e,this.options=n,this.id=n.id||f(16),this.traceId=n.traceId,this.sampled=n.sampled,this.timestamp=n.timestamp,this._start=O(n.startTime),this._end=void 0,this.ended=!1,this.onEnd=n.onEnd}var e=t.prototype;return e.ensureContext=function(){this.context||(this.context={})},e.addTags=function(t){console.warn("addTags deprecated, please use addLabels"),this.addLabels(t)},e.addLabels=function(t){this.ensureContext();var e=this.context;e.tags||(e.tags={}),Object.keys(t).forEach((function(n){return p(n,t[n],e.tags)}))},e.addContext=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];0!==e.length&&(this.ensureContext(),w.apply(void 0,[this.context].concat(e)))},e.end=function(t){this.ended||(this.ended=!0,this._end=O(t),this.callOnEnd())},e.callOnEnd=function(){"function"==typeof this.onEnd&&this.onEnd(this)},e.duration=function(){return L(this._start,this._end)},t}(),It=91,kt=93,Nt="external",At="resource";function Rt(t){var e={transfer_size:t.transferSize,encoded_body_size:t.encodedBodySize,decoded_body_size:t.decodedBodySize},n=function(t){void 0===t&&(t=[]);for(var e=[],n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.duration,a=r.description,s=i;a&&(s+=";desc="+a),o&&(s+=";dur="+o),e.push(s)}return e.join(", ")}(t.serverTiming);return n&&(e.headers={"server-timing":n}),e}function jt(t,e){var n=t.port,r=t.protocol,i=t.hostname,o=t.host,a=function(t,e){return""===t&&(t="http:"===e?"80":"https:"===e?"443":""),t}(n,r),s=i.charCodeAt(0)===It&&i.charCodeAt(i.length-1)===kt,c=i;return s&&(c=i.slice(1,-1)),{service:{name:r+"//"+o,resource:i+":"+a,type:e},address:c,port:Number(a)}}function Ft(t,e){if(e){var n;switch(t.type){case Nt:n=function(t){var e,n=t.url,r=t.method,i=t.target,o=t.response,a=new Ct(n),s=jt(a,Nt),c={http:{method:r,url:a.href},destination:s};return i&&void 0!==i.status?e=i.status:o&&(e=o.status),c.http.status_code=e,c}(e);break;case At:n=function(t){var e=t.entry,n=t.url,r=jt(new Ct(n),At);return{http:{url:n,response:Rt(e)},destination:r}}(e)}t.addContext(n)}}var Mt=function(t){var e,n;function r(e,n,r){var i;if((i=t.call(this,e,n,r)||this).parentId=i.options.parentId,i.subType=void 0,i.action=void 0,-1!==i.type.indexOf(".")){var o=i.type.split(".",3);i.type=o[0],i.subType=o[1],i.action=o[2]}return i.sync=i.options.sync,i}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.end=function(e,n){t.prototype.end.call(this,e),Ft(this,n)},r}(Lt),Pt=[["domainLookupStart","domainLookupEnd","DNS"],["connectStart","connectEnd","TCP"],["requestStart","responseStart","Request"],["responseStart","responseEnd","Response"],["domLoading","domComplete","Processing"],["loadEventStart","loadEventEnd","Load"]];function qt(t){return{value:t}}function Ht(t,e){var n=e.details,r=e.count,i=void 0===r?1:r,o=e.duration;return{transaction:t,span:n,samples:{"span.self_time.count":qt(i),"span.self_time.sum.us":qt(o)}}}var Dt=function(t){var e,n;function r(e,n,r){var i;return(i=t.call(this,e,n,r)||this).traceId=f(),i.marks=void 0,i.spans=[],i._activeSpans={},i.nextAutoTaskId=1,i._scheduledTasks=[],i.captureTimings=!1,i.breakdownTimings=[],i.sampled=Math.random()<=i.options.transactionSampleRate,i.browserResponsivenessCounter=0,i}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var i=r.prototype;return i.addMarks=function(t){this.marks=w(this.marks||{},t)},i.mark=function(t){var e=E(t),n=C()-this._start,r={};r[e]=n,this.addMarks({custom:r})},i.canReuse=function(t){return void 0===t&&(t=5e3),!!this.options.canReuse&&!this.ended&&C()-this._start<t},i.redefine=function(t,e,n){t&&(this.name=t),e&&(this.type=e),n&&(this.options=S(this.options,n))},i.startSpan=function(t,e,n){var r=this;if(!this.ended){var i=S({},n);i.onEnd=function(t){r._onSpanEnd(t)},i.traceId=this.traceId,i.sampled=this.sampled,i.parentId||(i.parentId=this.id);var o=new Mt(t,e,i);return this._activeSpans[o.id]=o,o}},i.isFinished=function(){return 0===this._scheduledTasks.length},i.detectFinish=function(){this.isFinished()&&this.end()},i.end=function(t){if(!this.ended){for(var e in this.ended=!0,this._end=O(t),this._activeSpans){var n=this._activeSpans[e];n.type=n.type+".truncated",n.end(t)}this.callOnEnd()}},i.captureBreakdown=function(){this.breakdownTimings=function(t,e){void 0===e&&(e=window.performance.timing);var n=[],r=t.duration(),i=t.name,o=t.type,a=t.sampled,s={name:i,type:o};if(n.push({transaction:s,samples:{"transaction.duration.count":qt(1),"transaction.duration.sum.us":qt(r),"transaction.breakdown.count":qt(a?1:0)}}),!a)return n;if(o===U&&e)for(var c=0;c<Pt.length;c++){var u=Pt[c],f=L(e[u[0]],e[u[1]]);0!==f&&null!=f&&n.push(Ht(s,{details:{type:u[2]},duration:f}))}else{var d=function(t){var e={},n=function(t){var e=t.spans,n=t._start,r=t._end;if(0===e.length)return t.duration();e.sort((function(t,e){return t._start-e._start}));for(var i=e[0],o=i._end,a=i._start,s=o,c=a-n,u=1;u<e.length;u++)a=(i=e[u])._start,o=i._end,a>s?(c+=a-s,s=o):o>s&&(s=o);return s<r&&(c+=r-s),c}(t);e.app={count:1,duration:n};for(var r=t.spans,i=0;i<r.length;i++){var o=r[i],a=o.duration();if(0!==a&&null!=a){var s=o.type,c=o.subType,u=s;c&&(u+="."+c),e[u]||(e[u]={duration:0,count:0}),e[u].count++,e[u].duration+=a}}return e}(t);Object.keys(d).forEach((function(t){var e=t.split("."),r=e[0],i=e[1],o=d[t],a=o.duration,c=o.count;n.push(Ht(s,{details:{type:r,subtype:i},duration:a,count:c}))}))}return n}(this)},i.addTask=function(t){if(void 0===t&&(t="task"+this.nextAutoTaskId++),-1==this._scheduledTasks.indexOf(t))return this._scheduledTasks.push(t),t},i.removeTask=function(t){var e=this._scheduledTasks.indexOf(t);e>-1&&this._scheduledTasks.splice(e,1),this.detectFinish()},i.resetSpans=function(){this.spans=[]},i._onSpanEnd=function(t){this.spans.push(t),delete this._activeSpans[t.id]},r}(Lt),Bt=[["domainLookupStart","domainLookupEnd","Domain lookup"],["connectStart","connectEnd","Making a connection to the server"],["requestStart","responseEnd","Requesting and receiving the document"],["domLoading","domInteractive","Parsing the document, executing sync. scripts"],["domContentLoadedEventStart","domContentLoadedEventEnd",'Fire "DOMContentLoaded" event'],["loadEventStart","loadEventEnd",'Fire "load" event']];function Qt(t,e,n,r,i){return void 0===i&&(i=0),"number"==typeof t&&"number"==typeof e&&t>=i&&e>t&&t-i>=n&&e-i<=r&&e-t<z&&t-i<z&&e-i<z}function zt(t){var e=t.name,n=t.initiatorType,r=t.startTime,i=t.responseEnd,o="resource";n&&(o+="."+n);var a=g(e),s=new Mt(a,o);return s._start=r,s.end(i,{url:e,entry:t}),s}function Ut(t){if(t.captureTimings){var e=window.performance,n=t._end;if(t.type===U){if(t.marks&&t.marks.custom){var r=t.marks.custom;Object.keys(r).forEach((function(e){r[e]+=t._start}))}t._start=0;var i=e.timing;(function(t,e,n,r){for(var i=[],o=0;o<Bt.length;o++){var a=t[Bt[o][0]],s=t[Bt[o][1]];if(Qt(a,s,n,r,e)){var c=new Mt(Bt[o][2],"hard-navigation.browser-timing");"requestStart"===Bt[o][0]&&(c.pageResponse=!0),c._start=a-e,c.end(s-e),i.push(c)}}return i})(i,i.fetchStart,0,n).forEach((function(e){e.traceId=t.traceId,e.sampled=t.sampled,e.pageResponse&&t.options.pageLoadSpanId&&(e.id=t.options.pageLoadSpanId),t.spans.push(e)})),t.addMarks(x())}if("function"==typeof e.getEntriesByType){var o=t._start;(function(t,e,n,r){for(var i=[],o=0;o<t.length;o++){var a=t[o],s=a.initiatorType,c=a.name,u=a.startTime,f=a.responseEnd;if("xmlhttprequest"!==s&&"fetch"!==s&&c)if(-1!==Q.indexOf(s)){if(!Qt(u,f,n,r))continue;i.push(zt(t[o]))}else{if(null!=s)continue;for(var d=!1,p=0;p<e.length;p++){var h=c.lastIndexOf(e[p]);if(h>-1&&h===c.length-e[p].length){d=!0;break}}!d&&Qt(u,f,n,r)&&i.push(zt(t[o]))}}return i})(e.getEntriesByType("resource"),function(t){for(var e=t.spans,n=[],r=0;r<e.length;r++){var i=e[r];"external"===i.type&&"http"===i.subType||n.push(i.name.split(" ")[1])}return n}(t),o,n).forEach((function(e){return t.spans.push(e)})),function(t,e,n){for(var r=[],i=0;i<t.length;i++){var o=t[i],a=o.name,s=o.startTime,c=o.duration,u=s+c;if(!(c<=J)&&Qt(s,u,e,n)){var f=new Mt(a,"app");f._start=s,f.end(u),r.push(f)}}return r}(e.getEntriesByType("measure"),o,n).forEach((function(e){return t.spans.push(e)}))}}}var $t=function(){function t(t,e){this._config=e,this._logger=t,this.currentTransaction=void 0,this.respIntervalId=void 0}var e=t.prototype;return e.ensureCurrentTransaction=function(t,e,n){var r=this.getCurrentTransaction();return r||(r=new Dt(t,e,n),this.setCurrentTransaction(r),r)},e.getCurrentTransaction=function(){if(this.currentTransaction&&!this.currentTransaction.ended)return this.currentTransaction},e.setCurrentTransaction=function(t){this.currentTransaction=t},e.ensureRespInterval=function(t){var e=this,n=function(){clearInterval(e.respIntervalId),e.respIntervalId=void 0};t?void 0===this.respIntervalId&&(this.respIntervalId=setInterval((function(){var t=e.getCurrentTransaction();t?t.browserResponsivenessCounter++:n()}),500)):void 0!==this.respIntervalId&&n()},e.createOptions=function(t){var e=this._config.config,n=S({transactionSampleRate:e.transactionSampleRate},t);return n.managed&&(n=S({pageLoadTraceId:e.pageLoadTraceId,pageLoadSampled:e.pageLoadSampled,pageLoadSpanId:e.pageLoadSpanId,pageLoadTransactionName:e.pageLoadTransactionName,checkBrowserResponsiveness:e.checkBrowserResponsiveness},n)),n},e.startManagedTransaction=function(t,e,n){var r=this.getCurrentTransaction();if(r)if(r.canReuse()&&n.canReuse){var i;0;var o=V.indexOf(r.type),a=V.indexOf(e);-1!==o&&-1!==a&&a<o&&(i=e),r.redefine(t,i,n)}else r.end(),r=this.ensureCurrentTransaction(t,e,n);else r=this.ensureCurrentTransaction(t,e,n);return r.captureTimings=!0,r.type===U&&(r.options.checkBrowserResponsiveness=!1,n.pageLoadTraceId&&(r.traceId=n.pageLoadTraceId),n.pageLoadSampled&&(r.sampled=n.pageLoadSampled),r.name===X&&n.pageLoadTransactionName&&(r.name=n.pageLoadTransactionName)),this.ensureRespInterval(r.options.checkBrowserResponsiveness),r},e.startTransaction=function(t,e,n){var r,i=this,o=this.createOptions(n);return(r=o.managed?this.startManagedTransaction(t,e,o):new Dt(t,e,o)).onEnd=function(){return i.handleTransactionEnd(r)},this._config.events.send("transaction:start",[r]),r},e.handleTransactionEnd=function(t){var e=this;return o.Promise.resolve().then((function(){var n=t.name,r=t.type;if(!e.shouldIgnoreTransaction(n)&&"temporary"!==r){if(r===U){var i=e._config.get("pageLoadTransactionName");n===X&&i&&(t.name=i)}Ut(t),e.adjustTransactionTime(t),e._config.get("breakdownMetrics")&&t.captureBreakdown();var o=e._config.get("context");!function(t,e){var n=v(),r={};if(t.type===U&&"function"==typeof performance.getEntriesByType){var i=performance.getEntriesByType("navigation");i&&i.length>0&&(r={response:Rt(i[0])})}t.addContext(n,r,e)}(t,o),e._config.events.send("transaction:end",[t])}}),(function(t){0}))},e.adjustTransactionTime=function(t){var e=t.spans,n=function(t){for(var e=t[0],n=1;n<t.length;n++){var r=t[n];e._start>r._start&&(e=r)}return e}(e);n&&n._start<t._start&&(t._start=n._start);var r=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n];-1===String(r.type).indexOf("external")&&(!e||e._end<r._end)&&(e=r)}return e}(e);r&&r._end>t._end&&(t._end=r._end);for(var i=t._end,o=0;o<e.length;o++){var a=e[o];a._end>i&&(a._end=i,a.type+=".truncated"),a._start>i&&(a._start=i)}},e.shouldIgnoreTransaction=function(t){var e=this._config.get("ignoreTransactions");if(e&&e.length)for(var n=0;n<e.length;n++){var r=e[n];if("function"==typeof r.test){if(r.test(t))return!0}else if(r===t)return!0}return!1},e.startSpan=function(t,e,n){var r=this.ensureCurrentTransaction(void 0,"temporary",this.createOptions({canReuse:!0,managed:!0}));if(r)return r.startSpan(t,e,n)},e.addTask=function(t){var e=this.ensureCurrentTransaction(void 0,"temporary",this.createOptions({canReuse:!0,managed:!0}));if(e){t=e.addTask(t);0}return t},e.removeTask=function(t){var e=this.getCurrentTransaction();e&&e.removeTask(t)},t}(),Xt={PerformanceMonitoring:Ot,registerServices:function(t){t.registerServiceCreator("TransactionService",(function(){var e=t.getService("ConfigService"),n=t.getService("LoggingService");return new $t(n,e)})),t.registerServiceCreator("PerformanceMonitoring",(function(){var e=t.getService("ConfigService"),n=t.getService("LoggingService"),r=t.getService("ApmServer"),i=t.getService("TransactionService");return new Ot(r,e,n,i)}))}},Vt=function(){function t(t,e){e||(e={}),this.onFlush=t,this.items=[],this.queueLimit=e.queueLimit||-1,this.flushInterval=e.flushInterval||0,this.timeoutId=void 0}var e=t.prototype;return e._setTimer=function(){var t=this;this.timeoutId=setTimeout((function(){t.flush()}),this.flushInterval)},e.flush=function(){this.onFlush(this.items),this._clear()},e._clear=function(){void 0!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=void 0),this.items=[]},e.add=function(t){this.items.push(t),-1!==this.queueLimit&&this.items.length>=this.queueLimit?this.flush():void 0===this.timeoutId&&this._setTimer()},t}();var Jt=function(t,e,n){var r,i=n.context||this,o=n.limit,a=n.interval,s=n.countFn||function(){},c=0;return function(){var n="function"==typeof s&&s.apply(i,arguments);return"number"!=typeof n&&(n=1),c+=n,void 0===r&&(r=setTimeout((function(){c=0,r=void 0}),a)),c>o?"function"==typeof e?e.apply(i,arguments):void 0:t.apply(i,arguments)}},Yt=function(){function t(){}return t.stringify=function(t){return JSON.stringify(t)+"\n"},t}(),Wt=function(){function t(t,e){this._configService=t,this._loggingService=e,this.errorQueue=void 0,this.transactionQueue=void 0,this.throttleAddError=void 0,this.throttleAddTransaction=void 0,this.initialized=!1}var e=t.prototype;return e.init=function(){this.initialized||(this.initialized=!0,this.initErrorQueue(),this.initTransactionQueue())},e.createMetaData=function(){var t=this._configService,e={service:{name:t.get("serviceName"),version:t.get("serviceVersion"),agent:{name:"js-base",version:t.version},language:{name:"javascript"},environment:t.get("environment")}};return wt(ht,e)},e._postJson=function(t,e){return this._makeHttpRequest("POST",t,{payload:e,headers:{"Content-Type":"application/x-ndjson"}}).then((function(t){return t.responseText}))},e._constructError=function(t){var e=t.url,n=t.status;t.responseText;if(void 0===n)return t;var r=e+" HTTP status: "+n;return new Error(r)},e._makeHttpRequest=function(t,e,n){var r=void 0===n?{timeout:1e4}:n,i=r.timeout,a=r.payload,s=r.headers;return new o.Promise((function(n,r){var o=new window.XMLHttpRequest;if(o[R]=!0,o.open(t,e,!0),o.timeout=i,s)for(var c in s)s.hasOwnProperty(c)&&o.setRequestHeader(c,s[c]);o.onreadystatechange=function(){if(4===o.readyState){var t=o.status,i=o.responseText;0===t||t>399&&t<600?r({url:e,status:t,responseText:i}):n(o)}},o.onerror=function(){var t=o.status,n=o.responseText;r({url:e,status:t,responseText:n})},o.send(a)}))},e._createQueue=function(t){var e=this._configService.get("queueLimit"),n=this._configService.get("flushInterval");return new Vt(t,{queueLimit:e,flushInterval:n})},e.fetchConfig=function(t,e){var n=this,r=this._configService.get("serverUrl")+"/config/v1/rum/agents";if(!t)return o.Promise.reject("serviceName is required for fetching central config.");r+="?service.name="+t,e&&(r+="&service.environment="+e);var i=this._configService.getLocalConfig();return i&&(r+="&ifnonematch="+i.etag),this._makeHttpRequest("GET",r,{timeout:5e3}).then((function(t){var e=t.status,r=t.responseText;if(304===e)return i;var o=JSON.parse(r),a=t.getResponseHeader("etag");return a&&(o.etag=a.replace(/["]/g,""),n._configService.setLocalConfig(o)),o})).catch((function(t){var e=n._constructError(t);return o.Promise.reject(e)}))},e.initErrorQueue=function(){var t=this;this.errorQueue&&this.errorQueue.flush(),this.errorQueue=this._createQueue((function(e){var n=t.sendErrors(e);n&&n.catch((function(e){t._loggingService.warn("Failed sending errors!",t._constructError(e))}))}));var e=this._configService.get("errorThrottleLimit"),n=this._configService.get("errorThrottleInterval");this.throttleAddError=Jt(this.errorQueue.add.bind(this.errorQueue),(function(){return t._loggingService.warn("Dropped error due to throttling!")}),{limit:e,interval:n})},e.initTransactionQueue=function(){var t=this;this.transactionQueue&&this.transactionQueue.flush(),this.transactionQueue=this._createQueue((function(e){var n=t.sendTransactions(e);n&&n.catch((function(e){t._loggingService.warn("Failed sending transactions!",t._constructError(e))}))}));var e=this._configService.get("transactionThrottleLimit"),n=this._configService.get("transactionThrottleInterval");this.throttleAddTransaction=Jt(this.transactionQueue.add.bind(this.transactionQueue),(function(){return t._loggingService.warn("Dropped transaction due to throttling!")}),{limit:e,interval:n})},e.addError=function(t){this.errorQueue||this.initErrorQueue(),this.throttleAddError(t)},e.addTransaction=function(t){this.transactionQueue||this.initTransactionQueue(),this.throttleAddTransaction(t)},e.ndjsonErrors=function(t){return t.map((function(t){return Yt.stringify({error:t})}))},e.ndjsonMetricsets=function(t){return t.map((function(t){return Yt.stringify({metricset:t})})).join("")},e.ndjsonTransactions=function(t){var e=this;return t.map((function(t){var n="";t.spans&&(n=t.spans.map((function(t){return Yt.stringify({span:t})})).join(""),delete t.spans);var r="";return t.breakdown&&(r=e.ndjsonMetricsets(t.breakdown),delete t.breakdown),Yt.stringify({transaction:t})+n+r}))},e._send=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e="transaction"),0!==t.length){var n={service:this.createMetaData().service,data:t},r=this._configService.applyFilters(n);if(r){var i;if("errors"===e)i=this.ndjsonErrors(r.data);else{if("transaction"!==e)return void 0;i=this.ndjsonTransactions(r.data)}i.unshift(Yt.stringify({metadata:{service:r.service}}));var o=i.join(""),a=this._configService.get("serverUrl")+"/intake/v2/rum/events";return this._postJson(a,o)}this._loggingService.warn("Dropped payload due to filtering!")}},e.sendTransactions=function(t){return this._send(t)},e.sendErrors=function(t){return this._send(t,"errors")},t}();var Zt=function(){function t(){this.config={},this.defaults={serviceName:"",serviceVersion:"",environment:"",serverUrl:"http://localhost:8200",active:!0,instrument:!0,disableInstrumentations:[],debug:!1,logLevel:"warn",breakdownMetrics:!1,checkBrowserResponsiveness:!0,groupSimilarSpans:!0,similarSpanThreshold:.05,ignoreTransactions:[],errorThrottleLimit:20,errorThrottleInterval:3e4,transactionThrottleLimit:20,transactionThrottleInterval:3e4,transactionDurationThreshold:6e4,queueLimit:-1,flushInterval:500,distributedTracing:!0,distributedTracingOrigins:[],distributedTracingHeaderName:"elastic-apm-traceparent",pageLoadTraceId:"",pageLoadSpanId:"",pageLoadSampled:!1,pageLoadTransactionName:"",transactionSampleRate:1,centralConfig:!1,context:{}},this.events=new it,this.filters=[],this.version=""}var e=t.prototype;return e.init=function(){var t=function(t){if(!t)return{};for(var e={},n=/^data-([\w-]+)$/,r=t.attributes,i=0;i<r.length;i++){var o=r[i];if(n.test(o.nodeName)){var a=o.nodeName.match(n)[1].split("-").map((function(t,e){return e>0?t.charAt(0).toUpperCase()+t.substring(1):t})).join("");e[a]=o.value||o.nodeValue}}return e}(_());this.setConfig(t)},e.isActive=function(){return this.get("active")},e.setVersion=function(t){this.version=t},e.addFilter=function(t){if("function"!=typeof t)throw new Error("Argument to must be function");this.filters.push(t)},e.applyFilters=function(t){for(var e=0;e<this.filters.length;e++)if(!(t=this.filters[e](t)))return;return t},e.get=function(t){return t.split(".").reduce((function(t,e){return t&&t[e]}),this.config)},e.setUserContext=function(t){void 0===t&&(t={});var e={},n=t,r=n.id,i=n.username,o=n.email;"number"!=typeof r&&"string"!=typeof r||(e.id=r),"string"==typeof i&&(e.username=i),"string"==typeof o&&(e.email=o),this.config.context.user=S(this.config.context.user||{},e)},e.setCustomContext=function(t){void 0===t&&(t={}),this.config.context.custom=S(this.config.context.custom||{},t)},e.addLabels=function(t){var e=this;this.config.context.tags||(this.config.context.tags={}),Object.keys(t).forEach((function(n){return p(n,t[n],e.config.context.tags)}))},e.setConfig=function(t){void 0===t&&(t={}),t.serverUrl&&(t.serverUrl=t.serverUrl.replace(/\/+$/,"")),this.config=w({},this.defaults,this.config,t),this.events.send("config:change",[this.config])},e.validate=function(t){void 0===t&&(t={});var e=["serviceName","serverUrl"],n={missing:[],invalid:[]};Object.keys(t).forEach((function(r){-1===e.indexOf(r)||t[r]||n.missing.push(r)})),t.serviceName&&!/^[a-zA-Z0-9 _-]+$/.test(t.serviceName)&&n.invalid.push({key:"serviceName",value:t.serviceName,allowed:"a-z, A-Z, 0-9, _, -, <space>"});var r=t.transactionSampleRate;return void 0!==r&&("number"!=typeof r||isNaN(r)||r<0||r>1)&&n.invalid.push({key:"transactionSampleRate",value:r,allowed:"Number between 0 and 1"}),n},e.getLocalConfig=function(){var t=sessionStorage.getItem("elastic_apm_config");if(t)return JSON.parse(t)},e.setLocalConfig=function(t){t&&sessionStorage.setItem("elastic_apm_config",JSON.stringify(t))},t}(),Gt=function(){function t(t){void 0===t&&(t={}),this.levels=["trace","debug","info","warn","error"],this.level=t.level||"info",this.prefix=t.prefix||"",this.resetLogMethods()}var e=t.prototype;return e.shouldLog=function(t){return this.levels.indexOf(t)>=this.levels.indexOf(this.level)},e.setLevel=function(t){this.level=t,this.resetLogMethods()},e.resetLogMethods=function(){var t=this;this.levels.forEach((function(e){t[e]=t.shouldLog(e)?function(){var n,r=t.prefix;switch(e){case"trace":case"debug":n="info";break;default:n=e}var i=arguments;r&&(i[0]=r+i[0]);if(console){var o=console[n]||console.log;"function"==typeof o&&o.apply(console,i)}}:T}))},t}(),Kt=function(){function t(){this._serviceCreators={},this._serviceInstances={},this.initialized=!1}var e=t.prototype;return e.registerCoreServices=function(){var t=this;this.registerServiceCreator("ConfigService",(function(){return new Zt})),this.registerServiceCreator("LoggingService",(function(){return new Gt({prefix:"[Elastic APM] "})})),this.registerServiceCreator("ApmServer",(function(){return new Wt(t.getService("ConfigService"),t.getService("LoggingService"))}))},e.init=function(){if(!this.initialized){this.initialized=!0;var t=this.getService("ConfigService");t.init();var e=this.getService("LoggingService");n(e,t),t.events.observe("config:change",(function(){n(e,t)})),this.getService("ApmServer").init()}function n(t,e){var n=e.get("debug"),r=e.get("logLevel");!0===n&&"trace"!==r?t.setLevel("debug"):t.setLevel(r)}},e.registerServiceCreator=function(t,e){this._serviceCreators[t]=e},e.registerServiceInstance=function(t,e){this._serviceInstances[t]=e},e.getService=function(t){if(!this._serviceInstances[t]){if("function"!=typeof this._serviceCreators[t])throw new Error("Can not get service, No creator for: "+t);this._serviceInstances[t]=this._serviceCreators[t](this)}return this._serviceInstances[t]},t}();var te,ee=function(){function t(t,e){this._disable=e,this.serviceFactory=t,this._initialized=!1}var e=t.prototype;return e.init=function(t){var e=this;if(this.isEnabled()&&!this._initialized){this._initialized=!0;var n=this.serviceFactory.getService("ConfigService");n.setVersion("4.7.0"),this.config(t);var r=this.serviceFactory.getService("LoggingService");if(n.isActive()){this.serviceFactory.init();var i=function(t,e){var n,r=((n={})[Y]=!1,n[W]=!1,n[Z]=!1,n[U]=!1,n[G]=!1,n);return t?(Object.keys(r).forEach((function(t){-1===e.indexOf(t)&&(r[t]=!0)})),r):r}(n.get("instrument"),n.get("disableInstrumentations"));if(this.serviceFactory.getService("PerformanceMonitoring").init(i),i[G])this.serviceFactory.getService("ErrorLogging").registerListeners();var o=function(){return i[U]&&e._sendPageLoadMetrics()};n.get("centralConfig")?this.fetchCentralConfig().then(o):o()}else this._disable=!0,r.info("RUM agent is inactive")}return this},e.fetchCentralConfig=function(){var t=this.serviceFactory.getService("ApmServer"),e=this.serviceFactory.getService("LoggingService"),n=this.serviceFactory.getService("ConfigService");return t.fetchConfig(n.get("serviceName"),n.get("environment")).then((function(t){var r=t.transaction_sample_rate;if(r){var i={transactionSampleRate:r=Number(r)},o=n.validate(i).invalid;if(0===o.length)n.setConfig(i);else{var a=o[0],s=a.key,c=a.value,u=a.allowed;e.warn('invalid value "'+c+'" for '+s+". Allowed: "+u+".")}}return t})).catch((function(t){e.warn("failed fetching config:",t)}))},e._sendPageLoadMetrics=function(){var t=this.startTransaction(void 0,U,{managed:!0,canReuse:!0});t&&t.addTask(U);var e=function(){setTimeout((function(){t&&t.removeTask(U)}))};"complete"===document.readyState?e():window.addEventListener("load",e)},e.isEnabled=function(){return!this._disable},e.observe=function(t,e){this.serviceFactory.getService("ConfigService").events.observe(t,e)},e.config=function(t){var e=this.serviceFactory.getService("ConfigService"),n=e.validate(t),r=n.missing,i=n.invalid;if(0===r.length&&0===i.length)e.setConfig(t);else{var o=this.serviceFactory.getService("LoggingService"),a="RUM agent isn't correctly configured. ";r.length>0&&(a+=r.join(", ")+" is missing",i.length>0&&(a+=", ")),i.forEach((function(t,e){var n=t.key,r=t.value,o=t.allowed;a+=n+' "'+r+'" contains invalid characters! (allowed: '+o+")"+(e!==i.length-1?", ":"")})),o.error(a),e.setConfig({active:!1})}},e.setUserContext=function(t){this.serviceFactory.getService("ConfigService").setUserContext(t)},e.setCustomContext=function(t){this.serviceFactory.getService("ConfigService").setCustomContext(t)},e.addTags=function(t){this.serviceFactory.getService("LoggingService").warn("addTags deprecated, please use addLabels"),this.addLabels(t)},e.addLabels=function(t){this.serviceFactory.getService("ConfigService").addLabels(t)},e.setInitialPageLoadName=function(t){this.isEnabled()&&this.serviceFactory.getService("ConfigService").setConfig({pageLoadTransactionName:t})},e.startTransaction=function(t,e,n){if(this.isEnabled())return this.serviceFactory.getService("TransactionService").startTransaction(t,e,n)},e.startSpan=function(t,e){if(this.isEnabled())return this.serviceFactory.getService("TransactionService").startSpan(t,e)},e.getCurrentTransaction=function(){if(this.isEnabled())return this.serviceFactory.getService("TransactionService").getCurrentTransaction()},e.captureError=function(t){if(this.isEnabled())return this.serviceFactory.getService("ErrorLogging").logError(t)},e.addFilter=function(t){this.serviceFactory.getService("ConfigService").addFilter(t)},t}(),ne=ct?ut:(ct=!0,d()?(st(),ut=!0):"undefined"!=typeof window&&console.log("[Elastic APM] platform is not supported!"),ut),re=((te=new Kt).registerCoreServices(),Tt.registerServices(te),Xt.registerServices(te),te),ie=new ee(re,!ne);"undefined"!=typeof window&&(window.elasticApm=ie);var oe=ie.init.bind(ie),ae=n(4),se=n(1),ce=n(2);var ue=function(t){var e,n;function r(e,n){var r;return(r=t.call(this)||this).__tracer=e,r.span=n,r.isTransaction=n instanceof Dt,r.spanContext={id:n.id,traceId:n.traceId,sampled:n.sampled},r}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var i=r.prototype;return i._context=function(){return this.spanContext},i._tracer=function(){return this.__tracer},i._setOperationName=function(t){this.span.name=t},i._addTags=function(t){var e=S({},t);if(e.type&&(this.span.type=e.type,delete e.type),this.isTransaction){var n=e["user.id"],r=e["user.username"],i=e["user.email"];(n||r||i)&&(this.span.addContext({user:{id:n,username:r,email:i}}),delete e["user.id"],delete e["user.username"],delete e["user.email"])}this.span.addLabels(e)},i._log=function(t,e){"error"===t.event&&(t["error.object"]?this.__tracer.errorLogging.logError(t["error.object"]):t.message&&this.__tracer.errorLogging.logError(t.message))},i._finish=function(t){this.span.end(),t&&(this.span._end=t-l())},r}(ce.Span);var fe=function(t){var e,n;function r(e,n,r,i){var o;return(o=t.call(this)||this).performanceMonitoring=e,o.transactionService=n,o.loggingService=r,o.errorLogging=i,o}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var i=r.prototype;return i._startSpan=function(t,e){var n,r={managed:!0};if(e)if(r.timestamp=e.startTime,e.childOf)r.parentId=e.childOf.id;else if(e.references&&e.references.length>0){e.references.length;var i=function(t,e,n){if(null==t)throw new TypeError("array is null or not defined");var r=Object(t),i=r.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var o=0;o<i;){var a=r[o];if(e.call(n,a,o,r))return a;o++}}(e.references,(function(t){return t.type()===se.REFERENCE_CHILD_OF}));i&&(r.parentId=i.referencedContext().id)}if(!(n=this.transactionService.getCurrentTransaction()?this.transactionService.startSpan(t,void 0,r):this.transactionService.startTransaction(t,void 0,r)))return new ce.Span;r.timestamp&&(n._start=r.timestamp-l());var o=new ue(this,n);return e&&e.tags&&o.addTags(e.tags),o},i._inject=function(t,e,n){switch(e){case se.FORMAT_TEXT_MAP:case se.FORMAT_HTTP_HEADERS:this.performanceMonitoring.injectDtHeader(t,n);break;case se.FORMAT_BINARY:0}},i._extract=function(t,e){var n;switch(t){case se.FORMAT_TEXT_MAP:case se.FORMAT_HTTP_HEADERS:n=this.performanceMonitoring.extractDtHeader(e);break;case se.FORMAT_BINARY:0}return n||(n=null),n},r}(ae.Tracer);function de(t){return function(t){var e=t.getService("PerformanceMonitoring"),n=t.getService("TransactionService"),r=t.getService("ErrorLogging"),i=t.getService("LoggingService");return new fe(e,n,i,r)}(t.serviceFactory)}n.d(e,"createTracer",(function(){return de})),n.d(e,"init",(function(){return oe})),n.d(e,"apm",(function(){return ie})),n.d(e,"apmBase",(function(){return ie})),n.d(e,"ApmBase",(function(){return ee})),"undefined"!=typeof window&&window.elasticApm&&(window.elasticApm.createTracer=de.bind(window.elasticApm,window.elasticApm));e.default=de}]);
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(t,e,n){var r;r=function(){"use strict";function t(t){return"function"==typeof t}var e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=0,r=void 0,i=void 0,o=function(t,e){p[n]=t,p[n+1]=e,2===(n+=2)&&(i?i(h):y())},a="undefined"!=typeof window?window:void 0,s=a||{},c=s.MutationObserver||s.WebKitMutationObserver,u="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(h,1)}}var p=new Array(1e3);function h(){for(var t=0;t<n;t+=2)(0,p[t])(p[t+1]),p[t]=void 0,p[t+1]=void 0;n=0}var l,v,g,m,y=void 0;function _(t,e){var n=this,r=new this.constructor(T);void 0===r[w]&&F(r);var i=n._state;if(i){var a=arguments[i-1];o((function(){return R(i,r,a,n._result)}))}else N(n,r,t,e);return r}function S(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(T);return O(e,t),e}u?y=function(){return process.nextTick(h)}:c?(v=0,g=new c(h),m=document.createTextNode(""),g.observe(m,{characterData:!0}),y=function(){m.data=v=++v%2}):f?((l=new MessageChannel).port1.onmessage=h,y=function(){return l.port2.postMessage(0)}):y=void 0===a?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(h)}:d()}catch(t){return d()}}():d();var w=Math.random().toString(36).substring(2);function T(){}var b=void 0,E=1,x=2;function C(e,n,r){n.constructor===e.constructor&&r===_&&n.constructor.resolve===S?function(t,e){e._state===E?I(t,e._result):e._state===x?k(t,e._result):N(e,void 0,(function(e){return O(t,e)}),(function(e){return k(t,e)}))}(e,n):void 0===r?I(e,n):t(r)?function(t,e,n){o((function(t){var r=!1,i=function(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}(n,e,(function(n){r||(r=!0,e!==n?O(t,n):I(t,n))}),(function(e){r||(r=!0,k(t,e))}),t._label);!r&&i&&(r=!0,k(t,i))}),t)}(e,n,r):I(e,n)}function O(t,e){if(t===e)k(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=e),null===r||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void k(t,e)}C(t,e,n)}var r,i}function L(t){t._onerror&&t._onerror(t._result),A(t)}function I(t,e){t._state===b&&(t._result=e,t._state=E,0!==t._subscribers.length&&o(A,t))}function k(t,e){t._state===b&&(t._state=x,t._result=e,o(L,t))}function N(t,e,n,r){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+E]=n,i[a+x]=r,0===a&&t._state&&o(A,t)}function A(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,i=void 0,o=t._result,a=0;a<e.length;a+=3)r=e[a],i=e[a+n],r?R(n,r,i,o):i(o);t._subscribers.length=0}}function R(e,n,r,i){var o=t(r),a=void 0,s=void 0,c=!0;if(o){try{a=r(i)}catch(t){c=!1,s=t}if(n===a)return void k(n,new TypeError("A promises callback cannot return that same promise."))}else a=i;n._state!==b||(o&&c?O(n,a):!1===c?k(n,s):e===E?I(n,a):e===x&&k(n,a))}var j=0;function F(t){t[w]=j++,t._state=void 0,t._result=void 0,t._subscribers=[]}var M=function(){function t(t,n){this._instanceConstructor=t,this.promise=new t(T),this.promise[w]||F(this.promise),e(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&I(this.promise,this._result))):k(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===b&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===S){var i=void 0,o=void 0,a=!1;try{i=t.then}catch(t){a=!0,o=t}if(i===_&&t._state!==b)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===P){var s=new n(T);a?k(s,o):C(s,t,i),this._willSettleAt(s,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===b&&(this._remaining--,t===x?k(r,n):this._result[e]=n),0===this._remaining&&I(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;N(t,void 0,(function(t){return n._settledAt(E,e,t)}),(function(t){return n._settledAt(x,e,t)}))},t}(),P=function(){function e(t){this[w]=j++,this._result=this._state=void 0,this._subscribers=[],T!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){O(t,e)}),(function(e){k(t,e)}))}catch(e){k(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this.constructor;return t(e)?this.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):this.then(e,e)},e}();return P.prototype.then=_,P.all=function(t){return new M(this,t).promise},P.race=function(t){var n=this;return e(t)?new n((function(e,r){for(var i=t.length,o=0;o<i;o++)n.resolve(t[o]).then(e,r)})):new n((function(t,e){return e(new TypeError("You must pass an array to race."))}))},P.resolve=S,P.reject=function(t){var e=new this(T);return k(e,t),e},P._setScheduler=function(t){i=t},P._setAsap=function(t){o=t},P._asap=o,P.polyfill=function(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=P},P.Promise=P,P},t.exports=r()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FORMAT_BINARY="binary",e.FORMAT_TEXT_MAP="text_map",e.FORMAT_HTTP_HEADERS="http_headers",e.REFERENCE_CHILD_OF="child_of",e.REFERENCE_FOLLOWS_FROM="follows_from"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(5),i=function(){function t(){}return t.prototype.context=function(){return this._context()},t.prototype.tracer=function(){return this._tracer()},t.prototype.setOperationName=function(t){return this._setOperationName(t),this},t.prototype.setBaggageItem=function(t,e){return this._setBaggageItem(t,e),this},t.prototype.getBaggageItem=function(t){return this._getBaggageItem(t)},t.prototype.setTag=function(t,e){return this._addTags(((n={})[t]=e,n)),this;var n},t.prototype.addTags=function(t){return this._addTags(t),this},t.prototype.log=function(t,e){return this._log(t,e),this},t.prototype.logEvent=function(t,e){return this._log({event:t,payload:e})},t.prototype.finish=function(t){this._finish(t)},t.prototype._context=function(){return r.spanContext},t.prototype._tracer=function(){return r.tracer},t.prototype._setOperationName=function(t){},t.prototype._setBaggageItem=function(t,e){},t.prototype._getBaggageItem=function(t){},t.prototype._addTags=function(t){},t.prototype._log=function(t,e){},t.prototype._finish=function(t){},t}();e.Span=i,e.default=i},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var i=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),i=n(5),o=n(2),a=function(){function t(){}return t.prototype.startSpan=function(t,e){if(void 0===e&&(e={}),e.childOf){var n=r.childOf(e.childOf);e.references?e.references.push(n):e.references=[n],delete e.childOf}return this._startSpan(t,e)},t.prototype.inject=function(t,e,n){return t instanceof o.default&&(t=t.context()),this._inject(t,e,n)},t.prototype.extract=function(t,e){return this._extract(t,e)},t.prototype._startSpan=function(t,e){return i.span},t.prototype._inject=function(t,e,n){},t.prototype._extract=function(t,e){return i.spanContext},t}();e.Tracer=a,e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=n(10),o=n(4);e.tracer=null,e.spanContext=null,e.span=null,e.initialize=function(){e.tracer=new o.default,e.span=new r.default,e.spanContext=new i.default}},function(t,e,n){var r,i,o;!function(a,s){"use strict";i=[n(7)],void 0===(o="function"==typeof(r=function(t){var e=/(^|@)\S+\:\d+/,n=/^\s*at .*(\S+\:\d+|\(native\))/m,r=/^(eval@)?(\[native code\])?$/;function i(t,e,n){if("function"==typeof Array.prototype.map)return t.map(e,n);for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=e.call(n,t[i]);return r}function o(t,e,n){if("function"==typeof Array.prototype.filter)return t.filter(e,n);for(var r=[],i=0;i<t.length;i++)e.call(n,t[i])&&r.push(t[i]);return r}return{parse:function(t){if(void 0!==t.stacktrace||void 0!==t["opera#sourceloc"])return this.parseOpera(t);if(t.stack&&t.stack.match(n))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?:\:(\d+))?(?:\:(\d+))?$/.exec(t.replace(/[\(\)]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(e){return i(o(e.stack.split("\n"),(function(t){return!!t.match(n)}),this),(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var n=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),r=this.extractLocation(n.pop()),i=n.join(" ")||void 0,o=function(t,e){if("function"==typeof Array.prototype.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}(["eval","<anonymous>"],r[0])>-1?void 0:r[0];return new t(i,void 0,o,r[1],r[2],e)}),this)},parseFFOrSafari:function(e){return i(o(e.stack.split("\n"),(function(t){return!t.match(r)}),this),(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new t(e);var n=e.split("@"),r=this.extractLocation(n.pop()),i=n.join("@")||void 0;return new t(i,void 0,r[0],r[1],r[2],e)}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],o=2,a=r.length;o<a;o+=2){var s=n.exec(r[o]);s&&i.push(new t(void 0,void 0,s[2],s[1],void 0,r[o]))}return i},parseOpera10:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],o=0,a=r.length;o<a;o+=2){var s=n.exec(r[o]);s&&i.push(new t(s[3]||void 0,void 0,s[2],s[1],void 0,r[o]))}return i},parseOpera11:function(n){return i(o(n.stack.split("\n"),(function(t){return!!t.match(e)&&!t.match(/^Error created at/)}),this),(function(e){var n,r=e.split("@"),i=this.extractLocation(r.pop()),o=r.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(n=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var s=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new t(a,s,i[0],i[1],i[2],e)}),this)}}})?r.apply(e,i):r)||(t.exports=o)}()},function(t,e,n){var r,i,o;!function(n,a){"use strict";i=[],void 0===(o="function"==typeof(r=function(){function t(t){return!isNaN(parseFloat(t))&&isFinite(t)}function e(t,e,n,r,i,o){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==i&&this.setColumnNumber(i),void 0!==o&&this.setSource(o)}return e.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(e){if(!t(e))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(e)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(e){if(!t(e))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(e)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(t(this.getLineNumber())?":"+this.getLineNumber():"")+(t(this.getColumnNumber())?":"+this.getColumnNumber():"")}},e})?r.apply(e,i):r)||(t.exports=o)}()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=n(9),o=n(2);e.childOf=function(t){return t instanceof o.default&&(t=t.context()),new i.default(r.REFERENCE_CHILD_OF,t)},e.followsFrom=function(t){return t instanceof o.default&&(t=t.context()),new i.default(r.REFERENCE_FOLLOWS_FROM,t)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=function(){function t(t,e){this._type=t,this._referencedContext=e instanceof r.default?e.context():e}return t.prototype.type=function(){return this._type},t.prototype.referencedContext=function(){return this._referencedContext},t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=function(){};e.SpanContext=r,e.default=r},function(t,e,n){"use strict";n.r(e);var r=n(3),i=n.n(r),o=n(0),a=[].slice;for(var s=[],c=0;c<256;++c)s[c]=(c+256).toString(16).substr(1);function u(t,e){var n=!1;return"string"==typeof e?n=t===e:Array.isArray(e)&&e.forEach((function(e){n||(n=u(t,e))})),n}function f(t){var e,n,r,o;return(e=i()(),r=n||0,[(o=s)[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")).substr(0,t)}function d(){return"undefined"!=typeof window&&"function"==typeof Array.prototype.forEach&&"function"==typeof JSON.stringify&&"function"==typeof Function.bind&&window.performance&&"function"==typeof window.performance.now&&"withCredentials"in new window.XMLHttpRequest}function p(t,e,n){if(n&&t){var r=E(t);return e&&(e=String(e)),n[r]=e,n}}var h=["fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","responseEnd","domLoading","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd"];function l(){return window.performance.timing.fetchStart}function v(){return{page:{referer:document.referrer,url:window.location.href}}}function g(t){return t&&t.split("?")[0]}function m(t){return null!==t&&"object"==typeof t}function y(t,e,n){for(var r=0,i=e.length;r<i;++r){var o=e[r];if(m(o)||"function"==typeof o)for(var a=Object.keys(o),s=0,c=a.length;s<c;s++){var u=a[s],f=o[u];n&&m(f)?(m(t[u])||(t[u]=Array.isArray(f)?[]:{}),y(t[u],[f],!1)):t[u]=f}}return t}function _(){if("undefined"!=typeof document){var t=document.currentScript;return t||function(){if("undefined"!=typeof document)for(var t=document.getElementsByTagName("script"),e=0,n=t.length;e<n;e++){var r=t[e];if(r.src.indexOf("elastic")>0)return r}}()}}function S(t){return y(t,a.call(arguments,1),!1)}function w(t){return y(t,a.call(arguments,1),!0)}function T(t){return void 0===t}function b(){}function E(t){return t.replace(/[.*"]/g,"_")}function x(){var t=function(){var t=window.performance.timing,e=t.fetchStart,n={};return h.forEach((function(r){var i=t[r];i&&i>=e&&(n[r]=i-e)})),n}(),e=function(){var t={},e=window.performance;if("function"==typeof e.getEntriesByType){var n=e.getEntriesByType("paint");if(n.length>0)for(var r=e.timing,i=r.fetchStart-r.navigationStart,o=0;o<n.length;o++){var a=n[o],s=i>=0?a.startTime-i:a.startTime;t[a.name]=s}}return t}(),n={timeToFirstByte:t.responseStart,domInteractive:t.domInteractive,domComplete:t.domComplete};return e["first-contentful-paint"]&&(n.firstContentfulPaint=e["first-contentful-paint"]),{navigationTiming:t,agent:n}}function C(){return window.performance.now()}function O(t){return"number"==typeof t&&t>=0?t:C()}function L(t,e){return T(e)||T(t)?null:parseFloat(e-t)}function I(t){o.Promise.resolve().then(t)}var k={fetchInProgress:!1};function N(t){return"__apm_symbol__"+t}function A(t,e,n){for(var r=t;r&&!r.hasOwnProperty(e);)r=Object.getPrototypeOf(r);!r&&t[e]&&(r=t);var i,o,a,s,c=N(e);if(r&&!(i=r[c])){i=r[c]=r[e];var u=r&&Object.getOwnPropertyDescriptor(r,e);if(!(s=u)||!1!==s.writable&&("function"!=typeof s.get||void 0!==s.set)){var f=n(i,c,e);r[e]=function(){return f(this,arguments)},o=r[e],a=i,o[N("OriginalDelegate")]=a}}return i}var R=N("xhrIgnore"),j=N("xhrSync"),F=N("xhrURL"),M=N("xhrMethod"),P="schedule",q="invoke",H="clear",D="addEventListener",B="removeEventListener",Q=["link","css","script","img","xmlhttprequest","fetch","beacon","iframe"],z=3e5,U="page-load",$="custom",X="Unknown",V=[U,"route-change","http-request",$,"temporary"],J=60,Y="xmlhttprequest",W="fetch",Z="history",G="error",K=1024,tt=N("xhrTask"),et=N("xhrListener"),nt=N("xhrScheduled");function rt(t){var e=XMLHttpRequest.prototype,n=e[D],r=e[B];if(!n){var i=window.XMLHttpRequestEventTarget;if(i){var o=i.prototype;n=o[D],r=o[B]}}var a="readystatechange",s="load";function c(e){e.state=q,t(q,e)}function u(e){XMLHttpRequest[nt]=!1,e.state=P,t(P,e);var i=e.data,o=i.aborted,u=i.target;n||(n=u[D],r=u[B]);var f,d=u[et];d&&(r.call(u,a,d),r.call(u,s,d));var p=u[et]=function(t){var n=t.type;f?f!=n&&function(t){setTimeout(t,0)}((function(){e.state!==q&&c(e)})):u.readyState===u.DONE&&!o&&XMLHttpRequest[nt]&&e.state===P&&(f=n)};n.call(u,a,p),n.call(u,s,p),u[tt]||(u[tt]=e)}var f=A(e,"open",(function(){return function(t,e){return t[R]||(t[M]=e[0],t[F]=e[1],t[j]=!1===e[2]),f.apply(t,e)}})),d=A(e,"send",(function(){return function(t,e){if(t[R])return d.apply(t,e);var n={source:Y,state:"",type:"macroTask",data:{target:t,method:t[M],sync:t[j],url:t[F],aborted:!1}};u(n);var r=d.apply(t,e);return XMLHttpRequest[nt]=!0,t[j]&&c(n),r}})),p=A(e,"abort",(function(){return function(e,n){if(!e[R]){var r=e[tt];if(r&&"string"==typeof r.type){if(r.data&&r.data.aborted)return;!function(e){e.state=H,t(H,e),e.data.aborted=!0}(r)}}return p.apply(e,n)}}))}var it=function(){function t(){this.observers={}}var e=t.prototype;return e.observe=function(t,e){var n=this;if("function"==typeof e)return this.observers[t]||(this.observers[t]=[]),this.observers[t].push(e),function(){var r=n.observers[t].indexOf(e);r>-1&&n.observers[t].splice(r,1)}},e.sendOnly=function(t,e){var n=this.observers[t];n&&n.forEach((function(t){try{t.apply(void 0,e)}catch(t){console.log(t,t.stack)}}))},e.send=function(t,e){this.sendOnly(t+":before",e),this.sendOnly(t,e),this.sendOnly(t+":after",e)},t}(),ot=new it,at=!1;function st(){return at||(at=!0,rt((function(t,e){ot.send(Y,[t,e])})),function(t){if(window.fetch&&window.Request){var e=window.fetch;window.fetch=function(t,i){var a,s,c=this,u=arguments;if("string"==typeof t)a=new Request(t,i),s=t;else{if(!t)return e.apply(c,u);s=(a=t).url}var f={source:W,state:"",type:"macroTask",data:{target:a,method:a.method,sync:!1,url:s,aborted:!1}};return new o.Promise((function(t,i){var o;k.fetchInProgress=!0,n(f);try{o=e.apply(c,[a])}catch(t){return i(t),f.data.error=t,r(f),void(k.fetchInProgress=!1)}o.then((function(e){t(e),I((function(){f.data.response=e,r(f)}))}),(function(t){i(t),I((function(){f.data.error=t,r(f)}))})),k.fetchInProgress=!1}))}}function n(e){e.state=P,t(P,e)}function r(e){e.state=q,t(q,e)}}((function(t,e){ot.send(W,[t,e])})),function(t){if(window.history){var e=history.pushState;"function"==typeof e&&(history.pushState=function(n,r,i){var o={source:Z,data:{state:n,title:r,url:i}};t(q,o),e.apply(this,arguments)})}}((function(t,e){ot.send(Z,[t,e])}))),ot}var ct=!1,ut=!1;var ft=n(6),dt=n.n(ft);function pt(t){var e=t.error,n=t.filename,r=t.lineno,i=t.colno,o=[];if(e)try{o=dt.a.parse(e)}catch(t){}return 0===o.length&&(o=[{fileName:n,lineNumber:r,columnNumber:i}]),o.map((function(t){return t.functionName&&(t.functionName=(e=t.functionName,n=e.split("/"),e=(e=(e=n.length>1?["Object",n[n.length-1]].join("."):n[0]).replace(/.<$/gi,".<anonymous>")).replace(/^Anonymous function$/,"<anonymous>"),e=(n=e.split(".")).length>1?n[n.length-1]:n[0])),t;var e,n})).map((function(t){var e=t.fileName,n=t.lineNumber,r=t.columnNumber,i=t.functionName,o=void 0===i?"<anonymous>":i;if(!e&&!n)return{};if(!r&&!n)return{};var a,s,c=function(t){return void 0===t&&(t=""),"<anonymous>"===t&&(t=""),t}(e),u=(a=c,s=window.location.origin||window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),a.indexOf(s)>-1&&(a=a.replace(s+"/","")),a);return function(t){return!!t&&0===window.location.href.indexOf(t)}(c)&&(u="(inline script)"),{abs_path:e,filename:u,function:o,lineno:n,colno:r}}))}var ht={service:{name:[K,!0],version:!0,agent:{version:[K,!0]},environment:!0}},lt={"*":!0,headers:{"*":!0}},vt={user:{id:!0,email:!0,username:!0},tags:{"*":!0},http:{response:lt},destination:{address:[K],service:{"*":[K,!0]}},response:lt},gt={name:[K,!0],type:[K,!0],id:[K,!0],trace_id:[K,!0],parent_id:[K,!0],transaction_id:[K,!0],subtype:!0,action:!0,context:vt},mt={name:!0,parent_id:!0,type:[K,!0],id:[K,!0],trace_id:[K,!0],span_count:{started:[K,!0]},context:vt},yt={id:[K,!0],trace_id:!0,transaction_id:!0,parent_id:!0,culprit:!0,exception:{type:!0},transaction:{type:!0},context:vt};function _t(t){return null==t||""===t||void 0===t}function St(t,e,n){var r=function(t,e,n,r){return void 0===e&&(e=K),void 0===n&&(n=!1),void 0===r&&(r="N/A"),n&&_t(t)&&(t=r),"string"==typeof t?t.substring(0,e):t}(t[e],n[0],n[1]);_t(r)?delete t[e]:t[e]=r}function wt(t,e,n){void 0===t&&(t={}),void 0===n&&(n=e);for(var r=Object.keys(t),i=[],o=function(o){var a=r[o],s=!0===t[a]?i:t[a];Array.isArray(s)?"*"===a?Object.keys(n).forEach((function(t){return St(n,t,s)})):St(n,a,s):wt(s,e,n[a])},a=0;a<r.length;a++)o(a);return e}var Tt=["stack","message"];var bt=function(){function t(t,e,n){this._apmServer=t,this._configService=e,this._transactionService=n}var e=t.prototype;return e.createErrorDataModel=function(t){var e=function(t){return t.filter((function(t){var e=t.filename,n=t.lineno;return void 0!==e&&void 0!==n}))}(pt(t)),n="(inline script)",r=e[e.length-1];r&&r.filename&&(n=r.filename);var i=t.message,o=t.error,a=i,s="",c={};if(o&&"object"==typeof o){a=a||o.message,s=o.name;var u=function(t){var e=!1,n={};if(Object.keys(t).forEach((function(r){if(!(Tt.indexOf(r)>=0)){var i=t[r];if(null!=i&&"function"!=typeof i){if("object"==typeof i){if("function"!=typeof i.toISOString)return;i=i.toISOString()}n[r]=i,e=!0}}})),e)return n}(o);u&&(c.custom=u)}s||a&&a.indexOf(":")>-1&&(s=a.split(":")[0]);var d=this._transactionService.getCurrentTransaction(),p=d?d.context:{},h=this._configService.get("context"),l=w({},v(),p,h,c),g={id:f(),culprit:n,exception:{message:a,stacktrace:e,type:s},context:l};return d&&(g=S(g,{trace_id:d.traceId,parent_id:d.id,transaction_id:d.id,transaction:{type:d.type,sampled:d.sampled}})),wt(yt,g)},e.logErrorEvent=function(t,e){if(void 0!==t){var n=this.createErrorDataModel(t);if(void 0!==n.exception.message)return e?this._apmServer.sendErrors([n]):this._apmServer.addError(n)}},e.registerListeners=function(){var t=this;window.addEventListener("error",(function(e){return t.logErrorEvent(e)})),window.addEventListener("unhandledrejection",(function(e){return t.logPromiseEvent(e)}))},e.logPromiseEvent=function(t){var e="Unhandled promise rejection: ",n=t.reason;null==n?this.logError(e+"<no reason specified>"):"string"==typeof n.message?this.logError({message:e+n.message,stack:n.stack?n.stack:null}):"object"!=typeof n&&this.logError(e+n)},e.logError=function(t){var e={};return"string"==typeof t?e.message=t:e.error=t,this.logErrorEvent(e)},t}(),Et={ErrorLogging:bt,registerServices:function(t){t.registerServiceCreator("ErrorLogging",(function(){var e=t.getService("ApmServer"),n=t.getService("ConfigService"),r=t.getService("TransactionService");return new bt(e,n,r)}))}};var xt=[["#","hash"],["?","query"],["/","path"],["@","auth",1],[NaN,"host",void 0,1]],Ct=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,Ot=function(){function t(t){var e,n=this.extractProtocol(t||""),r=n.protocol,i=n.address,o=n.slashes,a=!r&&!o,s=this.getLocation(),c=xt.slice();i=i.replace("\\","/"),o||(c[2]=[NaN,"path"]);for(var u=0;u<c.length;u++){var f=c[u],d=f[0],p=f[1];if("string"==typeof d){if(~(e=i.indexOf(d))){var h=f[2];if(h){var l=i.lastIndexOf(d);e=Math.max(e,l),this[p]=i.slice(0,e),i=i.slice(e+h)}else this[p]=i.slice(e),i=i.slice(0,e)}}else this[p]=i,i="";this[p]=this[p]||a&&f[3]&&s[p]||"",f[3]&&(this[p]=this[p].toLowerCase())}if(a&&"/"!==this.path.charAt(0)&&(this.path="/"+this.path),this.relative=a,this.protocol=r||s.protocol,this.hostname=this.host,this.port="",/:\d+$/.test(this.host)){var v=this.host.split(":"),g=v.pop(),m=v.join(":");!function(t,e){switch(e){case"http:":return"80"===t;case"https:":return"443"===t}return!0}(g,this.protocol)?this.port=g:this.host=m,this.hostname=m}this.origin=this.protocol&&this.host&&"file:"!==this.protocol?this.protocol+"//"+this.host:"null",this.href=this.toString()}var e=t.prototype;return e.toString=function(){var t=this.protocol;if(t+="//",this.auth){var e=this.auth.split(":");t+=(e[0]?"[REDACTED]":"")+(e[1]?":[REDACTED]":"")+"@"}return t+=this.host,t+=this.path,t+=this.query,t+=this.hash},e.getLocation=function(){var t={};return"undefined"!=typeof window&&(t=window),t.location},e.extractProtocol=function(t){var e=Ct.exec(t);return{protocol:e[1]?e[1].toLowerCase():"",slashes:!!e[2],address:e[3]}},t}(),Lt=function(){function t(t,e,n,r){this._apmServer=t,this._configService=e,this._logginService=n,this._transactionService=r}var e=t.prototype;return e.init=function(t){var e=this;void 0===t&&(t={}),this._configService.events.observe("transaction:end:after",(function(t){var n=e.createTransactionPayload(t);n&&e._apmServer.addTransaction(n)})),t[Z]&&ot.observe(Z,this.getHistorySub()),t[Y]&&ot.observe(Y,this.getXHRSub()),t[W]&&ot.observe(W,this.getFetchSub())},e.getHistorySub=function(){var t=this._transactionService;return function(e,n){n.source===Z&&e===q&&t.startTransaction(n.data.title,"route-change",{managed:!0,canReuse:!0})}},e.getXHRSub=function(){var t=this;return function(e,n){n.source!==Y||k.fetchInProgress||t.processAPICalls(e,n)}},e.getFetchSub=function(){var t=this;return function(e,n){n.source===W&&t.processAPICalls(e,n)}},e.processAPICalls=function(t,e){var n=this._configService,r=this._transactionService;if(t===P&&e.data){var i=e.data,o=new Ot(i.url),a=i.method+" "+(o.relative?o.path:g(o.href));r.getCurrentTransaction()||r.startTransaction(a,"http-request",{managed:!0});var s=r.startSpan(a,"external.http"),c=r.addTask();if(!s)return;var f=n.get("distributedTracing"),d=n.get("distributedTracingOrigins"),p=new Ot(window.location.href),h=u(o.origin,p.origin)||u(o.origin,d),l=i.target;f&&h&&l&&this.injectDtHeader(s,l),s.sync=i.sync,i.span=s,e.id=c}else t===q&&(e.data&&e.data.span&&e.data.span.end(null,e.data),e.id&&r.removeTask(e.id))},e.injectDtHeader=function(t,e){var n,r=this._configService.get("distributedTracingHeaderName"),i=function(t){if(t&&t.traceId&&t.id&&t.parentId){var e=t.sampled?"01":"00",n=t.sampled?t.id:t.parentId;return"00-"+t.traceId+"-"+n+"-"+e}}(t),o=/^[\da-f]{2}-[\da-f]{32}-[\da-f]{16}-[\da-f]{2}$/.test(n=i)&&"00000000000000000000000000000000"!==n.slice(3,35)&&"0000000000000000"!==n.slice(36,52);r&&i&&o&&("function"==typeof e.setRequestHeader?e.setRequestHeader(r,i):e.headers&&"function"==typeof e.headers.append?e.headers.append(r,i):e[r]=i)},e.extractDtHeader=function(t){var e=this._configService.get("distributedTracingHeaderName");if(t)return function(t){var e=/^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})$/.exec(t);if(e){var n="00"!==e[4];return{traceId:e[2],id:e[3],sampled:n}}}(t[e])},e.filterTransaction=function(t){var e=this._configService.get("transactionDurationThreshold"),n=t.duration();if(!n)return!1;if(n>e)return!1;if((t.sampled||t.resetSpans(),t.options.checkBrowserResponsiveness)&&!this.checkBrowserResponsiveness(t,500,3))return!1;return!0},e.prepareTransaction=function(t){t.spans.sort((function(t,e){return t._start-e._start})),this._configService.get("groupSimilarSpans")&&(t.spans=this.groupSmallContinuouslySimilarSpans(t,.05)),t.spans=t.spans.filter((function(e){return e.duration()>0&&e._start>=t._start&&e._end<=t._end}))},e.createTransactionDataModel=function(t){var e=t._start,n=t.spans.map((function(n){var r={id:n.id,transaction_id:t.id,parent_id:n.parentId||t.id,trace_id:t.traceId,name:n.name,type:n.type,subType:n.subType,action:n.action,sync:n.sync,start:n._start-e,duration:n.duration(),context:n.context};return wt(gt,r)})),r={id:t.id,trace_id:t.traceId,name:t.name,type:t.type,duration:t.duration(),spans:n,context:t.context,marks:t.marks,breakdown:t.breakdownTimings,span_count:{started:n.length},sampled:t.sampled};return wt(mt,r)},e.createTransactionPayload=function(t){if(this.prepareTransaction(t),this.filterTransaction(t))return this.createTransactionDataModel(t)},e.convertTransactionsToServerModel=function(t){var e=this;return t.map((function(t){return e.createTransactionDataModel(t)}))},e.groupSmallContinuouslySimilarSpans=function(t,e){var n=t.duration(),r=[],i=1;return t.spans.forEach((function(o,a){if(0===r.length)r.push(o);else{var s=r[r.length-1],c=s.type===o.type&&s.subType===o.subType&&s.action===o.action&&s.name===o.name&&o.duration()/n<e&&(o._start-s._end)/n<e,u=t.spans.length===a+1;c&&(i++,s._end=o._end),i>1&&(!c||u)&&(s.name=i+"x "+s.name,i=1),c||r.push(o)}})),r},e.checkBrowserResponsiveness=function(t,e,n){var r=t.browserResponsivenessCounter,i=t.duration();return r+n>=Math.floor(i/e)},t}(),It=function(){function t(t,e,n){void 0===n&&(n={}),t||(t=X),e||(e=$),this.name=t,this.type=e,this.options=n,this.id=n.id||f(16),this.traceId=n.traceId,this.sampled=n.sampled,this.timestamp=n.timestamp,this._start=O(n.startTime),this._end=void 0,this.ended=!1,this.onEnd=n.onEnd}var e=t.prototype;return e.ensureContext=function(){this.context||(this.context={})},e.addTags=function(t){console.warn("addTags deprecated, please use addLabels"),this.addLabels(t)},e.addLabels=function(t){this.ensureContext();var e=this.context;e.tags||(e.tags={}),Object.keys(t).forEach((function(n){return p(n,t[n],e.tags)}))},e.addContext=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];0!==e.length&&(this.ensureContext(),w.apply(void 0,[this.context].concat(e)))},e.end=function(t){this.ended||(this.ended=!0,this._end=O(t),this.callOnEnd())},e.callOnEnd=function(){"function"==typeof this.onEnd&&this.onEnd(this)},e.duration=function(){return L(this._start,this._end)},t}(),kt=91,Nt=93,At="external",Rt="resource";function jt(t){var e={transfer_size:t.transferSize,encoded_body_size:t.encodedBodySize,decoded_body_size:t.decodedBodySize},n=function(t){void 0===t&&(t=[]);for(var e=[],n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.duration,a=r.description,s=i;a&&(s+=";desc="+a),o&&(s+=";dur="+o),e.push(s)}return e.join(", ")}(t.serverTiming);return n&&(e.headers={"server-timing":n}),e}function Ft(t,e){var n=t.port,r=t.protocol,i=t.hostname,o=t.host,a=function(t,e){return""===t&&(t="http:"===e?"80":"https:"===e?"443":""),t}(n,r),s=i.charCodeAt(0)===kt&&i.charCodeAt(i.length-1)===Nt,c=i;return s&&(c=i.slice(1,-1)),{service:{name:r+"//"+o,resource:i+":"+a,type:e},address:c,port:Number(a)}}function Mt(t,e){if(e){var n;switch(t.type){case At:n=function(t){var e,n=t.url,r=t.method,i=t.target,o=t.response,a=new Ot(n),s=Ft(a,At),c={http:{method:r,url:a.href},destination:s};return i&&void 0!==i.status?e=i.status:o&&(e=o.status),c.http.status_code=e,c}(e);break;case Rt:n=function(t){var e=t.entry,n=t.url,r=Ft(new Ot(n),Rt);return{http:{url:n,response:jt(e)},destination:r}}(e)}t.addContext(n)}}var Pt=function(t){var e,n;function r(e,n,r){var i;if((i=t.call(this,e,n,r)||this).parentId=i.options.parentId,i.subType=void 0,i.action=void 0,-1!==i.type.indexOf(".")){var o=i.type.split(".",3);i.type=o[0],i.subType=o[1],i.action=o[2]}return i.sync=i.options.sync,i}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.end=function(e,n){t.prototype.end.call(this,e),Mt(this,n)},r}(It),qt=[["domainLookupStart","domainLookupEnd","DNS"],["connectStart","connectEnd","TCP"],["requestStart","responseStart","Request"],["responseStart","responseEnd","Response"],["domLoading","domComplete","Processing"],["loadEventStart","loadEventEnd","Load"]];function Ht(t){return{value:t}}function Dt(t,e){var n=e.details,r=e.count,i=void 0===r?1:r,o=e.duration;return{transaction:t,span:n,samples:{"span.self_time.count":Ht(i),"span.self_time.sum.us":Ht(o)}}}var Bt=function(t){var e,n;function r(e,n,r){var i;return(i=t.call(this,e,n,r)||this).traceId=f(),i.marks=void 0,i.spans=[],i._activeSpans={},i.nextAutoTaskId=1,i._scheduledTasks=[],i.captureTimings=!1,i.breakdownTimings=[],i.sampled=Math.random()<=i.options.transactionSampleRate,i.browserResponsivenessCounter=0,i}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var i=r.prototype;return i.addMarks=function(t){this.marks=w(this.marks||{},t)},i.mark=function(t){var e=E(t),n=C()-this._start,r={};r[e]=n,this.addMarks({custom:r})},i.canReuse=function(t){return void 0===t&&(t=5e3),!!this.options.canReuse&&!this.ended&&C()-this._start<t},i.redefine=function(t,e,n){t&&(this.name=t),e&&(this.type=e),n&&(this.options=S(this.options,n))},i.startSpan=function(t,e,n){var r=this;if(!this.ended){var i=S({},n);i.onEnd=function(t){r._onSpanEnd(t)},i.traceId=this.traceId,i.sampled=this.sampled,i.parentId||(i.parentId=this.id);var o=new Pt(t,e,i);return this._activeSpans[o.id]=o,o}},i.isFinished=function(){return 0===this._scheduledTasks.length},i.detectFinish=function(){this.isFinished()&&this.end()},i.end=function(t){if(!this.ended){for(var e in this.ended=!0,this._end=O(t),this._activeSpans){var n=this._activeSpans[e];n.type=n.type+".truncated",n.end(t)}this.callOnEnd()}},i.captureBreakdown=function(){this.breakdownTimings=function(t,e){void 0===e&&(e=window.performance.timing);var n=[],r=t.duration(),i=t.name,o=t.type,a=t.sampled,s={name:i,type:o};if(n.push({transaction:s,samples:{"transaction.duration.count":Ht(1),"transaction.duration.sum.us":Ht(r),"transaction.breakdown.count":Ht(a?1:0)}}),!a)return n;if(o===U&&e)for(var c=0;c<qt.length;c++){var u=qt[c],f=L(e[u[0]],e[u[1]]);0!==f&&null!=f&&n.push(Dt(s,{details:{type:u[2]},duration:f}))}else{var d=function(t){var e={},n=function(t){var e=t.spans,n=t._start,r=t._end;if(0===e.length)return t.duration();e.sort((function(t,e){return t._start-e._start}));for(var i=e[0],o=i._end,a=i._start,s=o,c=a-n,u=1;u<e.length;u++)a=(i=e[u])._start,o=i._end,a>s?(c+=a-s,s=o):o>s&&(s=o);return s<r&&(c+=r-s),c}(t);e.app={count:1,duration:n};for(var r=t.spans,i=0;i<r.length;i++){var o=r[i],a=o.duration();if(0!==a&&null!=a){var s=o.type,c=o.subType,u=s;c&&(u+="."+c),e[u]||(e[u]={duration:0,count:0}),e[u].count++,e[u].duration+=a}}return e}(t);Object.keys(d).forEach((function(t){var e=t.split("."),r=e[0],i=e[1],o=d[t],a=o.duration,c=o.count;n.push(Dt(s,{details:{type:r,subtype:i},duration:a,count:c}))}))}return n}(this)},i.addTask=function(t){if(void 0===t&&(t="task"+this.nextAutoTaskId++),-1==this._scheduledTasks.indexOf(t))return this._scheduledTasks.push(t),t},i.removeTask=function(t){var e=this._scheduledTasks.indexOf(t);e>-1&&this._scheduledTasks.splice(e,1),this.detectFinish()},i.resetSpans=function(){this.spans=[]},i._onSpanEnd=function(t){this.spans.push(t),delete this._activeSpans[t.id]},r}(It),Qt=[["domainLookupStart","domainLookupEnd","Domain lookup"],["connectStart","connectEnd","Making a connection to the server"],["requestStart","responseEnd","Requesting and receiving the document"],["domLoading","domInteractive","Parsing the document, executing sync. scripts"],["domContentLoadedEventStart","domContentLoadedEventEnd",'Fire "DOMContentLoaded" event'],["loadEventStart","loadEventEnd",'Fire "load" event']];function zt(t,e,n,r,i){return void 0===i&&(i=0),"number"==typeof t&&"number"==typeof e&&t>=i&&e>t&&t-i>=n&&e-i<=r&&e-t<z&&t-i<z&&e-i<z}function Ut(t){var e=t.name,n=t.initiatorType,r=t.startTime,i=t.responseEnd,o="resource";n&&(o+="."+n);var a=g(e),s=new Pt(a,o);return s._start=r,s.end(i,{url:e,entry:t}),s}function $t(t){if(t.captureTimings){var e=window.performance,n=t._end;if(t.type===U){if(t.marks&&t.marks.custom){var r=t.marks.custom;Object.keys(r).forEach((function(e){r[e]+=t._start}))}t._start=0;var i=e.timing;(function(t,e,n,r){for(var i=[],o=0;o<Qt.length;o++){var a=t[Qt[o][0]],s=t[Qt[o][1]];if(zt(a,s,n,r,e)){var c=new Pt(Qt[o][2],"hard-navigation.browser-timing");"requestStart"===Qt[o][0]&&(c.pageResponse=!0),c._start=a-e,c.end(s-e),i.push(c)}}return i})(i,i.fetchStart,0,n).forEach((function(e){e.traceId=t.traceId,e.sampled=t.sampled,e.pageResponse&&t.options.pageLoadSpanId&&(e.id=t.options.pageLoadSpanId),t.spans.push(e)})),t.addMarks(x())}if("function"==typeof e.getEntriesByType){var o=t._start;(function(t,e,n,r){for(var i=[],o=0;o<t.length;o++){var a=t[o],s=a.initiatorType,c=a.name,u=a.startTime,f=a.responseEnd;if("xmlhttprequest"!==s&&"fetch"!==s&&c)if(-1!==Q.indexOf(s)){if(!zt(u,f,n,r))continue;i.push(Ut(t[o]))}else{if(null!=s)continue;for(var d=!1,p=0;p<e.length;p++){var h=c.lastIndexOf(e[p]);if(h>-1&&h===c.length-e[p].length){d=!0;break}}!d&&zt(u,f,n,r)&&i.push(Ut(t[o]))}}return i})(e.getEntriesByType("resource"),function(t){for(var e=t.spans,n=[],r=0;r<e.length;r++){var i=e[r];"external"===i.type&&"http"===i.subType||n.push(i.name.split(" ")[1])}return n}(t),o,n).forEach((function(e){return t.spans.push(e)})),function(t,e,n){for(var r=[],i=0;i<t.length;i++){var o=t[i],a=o.name,s=o.startTime,c=o.duration,u=s+c;if(!(c<=J)&&zt(s,u,e,n)){var f=new Pt(a,"app");f._start=s,f.end(u),r.push(f)}}return r}(e.getEntriesByType("measure"),o,n).forEach((function(e){return t.spans.push(e)}))}}}var Xt=function(){function t(t,e){this._config=e,this._logger=t,this.currentTransaction=void 0,this.respIntervalId=void 0}var e=t.prototype;return e.ensureCurrentTransaction=function(t,e,n){var r=this.getCurrentTransaction();return r||(r=new Bt(t,e,n),this.setCurrentTransaction(r),r)},e.getCurrentTransaction=function(){if(this.currentTransaction&&!this.currentTransaction.ended)return this.currentTransaction},e.setCurrentTransaction=function(t){this.currentTransaction=t},e.ensureRespInterval=function(t){var e=this,n=function(){clearInterval(e.respIntervalId),e.respIntervalId=void 0};t?void 0===this.respIntervalId&&(this.respIntervalId=setInterval((function(){var t=e.getCurrentTransaction();t?t.browserResponsivenessCounter++:n()}),500)):void 0!==this.respIntervalId&&n()},e.createOptions=function(t){var e=this._config.config,n=S({transactionSampleRate:e.transactionSampleRate},t);return n.managed&&(n=S({pageLoadTraceId:e.pageLoadTraceId,pageLoadSampled:e.pageLoadSampled,pageLoadSpanId:e.pageLoadSpanId,pageLoadTransactionName:e.pageLoadTransactionName,checkBrowserResponsiveness:e.checkBrowserResponsiveness},n)),n},e.startManagedTransaction=function(t,e,n){var r=this.getCurrentTransaction();if(r)if(r.canReuse()&&n.canReuse){var i;0;var o=V.indexOf(r.type),a=V.indexOf(e);-1!==o&&-1!==a&&a<o&&(i=e),r.redefine(t,i,n)}else r.end(),r=this.ensureCurrentTransaction(t,e,n);else r=this.ensureCurrentTransaction(t,e,n);return r.type===U&&(r.options.checkBrowserResponsiveness=!1,n.pageLoadTraceId&&(r.traceId=n.pageLoadTraceId),n.pageLoadSampled&&(r.sampled=n.pageLoadSampled),r.name===X&&n.pageLoadTransactionName&&(r.name=n.pageLoadTransactionName)),r.sampled&&(r.captureTimings=!0),this.ensureRespInterval(r.options.checkBrowserResponsiveness),r},e.startTransaction=function(t,e,n){var r,i=this,o=this.createOptions(n),a=!0;o.managed?this.currentTransaction===(r=this.startManagedTransaction(t,e,o))&&(a=!1):r=new Bt(t,e,o);return r.onEnd=function(){return i.handleTransactionEnd(r)},a&&this._config.events.send("transaction:start",[r]),r},e.handleTransactionEnd=function(t){var e=this;return o.Promise.resolve().then((function(){var n=t.name,r=t.type;if(!e.shouldIgnoreTransaction(n)&&"temporary"!==r){if(r===U){var i=e._config.get("pageLoadTransactionName");n===X&&i&&(t.name=i)}$t(t),e.adjustTransactionTime(t),e._config.get("breakdownMetrics")&&t.captureBreakdown();var o=e._config.get("context");!function(t,e){var n=v(),r={};if(t.type===U&&"function"==typeof performance.getEntriesByType){var i=performance.getEntriesByType("navigation");i&&i.length>0&&(r={response:jt(i[0])})}t.addContext(n,r,e)}(t,o),e._config.events.send("transaction:end",[t])}}),(function(t){0}))},e.adjustTransactionTime=function(t){var e=t.spans,n=function(t){for(var e=t[0],n=1;n<t.length;n++){var r=t[n];e._start>r._start&&(e=r)}return e}(e);n&&n._start<t._start&&(t._start=n._start);var r=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n];-1===String(r.type).indexOf("external")&&(!e||e._end<r._end)&&(e=r)}return e}(e);r&&r._end>t._end&&(t._end=r._end);for(var i=t._end,o=0;o<e.length;o++){var a=e[o];a._end>i&&(a._end=i,a.type+=".truncated"),a._start>i&&(a._start=i)}},e.shouldIgnoreTransaction=function(t){var e=this._config.get("ignoreTransactions");if(e&&e.length)for(var n=0;n<e.length;n++){var r=e[n];if("function"==typeof r.test){if(r.test(t))return!0}else if(r===t)return!0}return!1},e.startSpan=function(t,e,n){var r=this.ensureCurrentTransaction(void 0,"temporary",this.createOptions({canReuse:!0,managed:!0}));if(r)return r.startSpan(t,e,n)},e.addTask=function(t){var e=this.ensureCurrentTransaction(void 0,"temporary",this.createOptions({canReuse:!0,managed:!0}));if(e){t=e.addTask(t);0}return t},e.removeTask=function(t){var e=this.getCurrentTransaction();e&&e.removeTask(t)},t}(),Vt={PerformanceMonitoring:Lt,registerServices:function(t){t.registerServiceCreator("TransactionService",(function(){var e=t.getService("ConfigService"),n=t.getService("LoggingService");return new Xt(n,e)})),t.registerServiceCreator("PerformanceMonitoring",(function(){var e=t.getService("ConfigService"),n=t.getService("LoggingService"),r=t.getService("ApmServer"),i=t.getService("TransactionService");return new Lt(r,e,n,i)}))}},Jt=function(){function t(t,e){e||(e={}),this.onFlush=t,this.items=[],this.queueLimit=e.queueLimit||-1,this.flushInterval=e.flushInterval||0,this.timeoutId=void 0}var e=t.prototype;return e._setTimer=function(){var t=this;this.timeoutId=setTimeout((function(){t.flush()}),this.flushInterval)},e.flush=function(){this.onFlush(this.items),this._clear()},e._clear=function(){void 0!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=void 0),this.items=[]},e.add=function(t){this.items.push(t),-1!==this.queueLimit&&this.items.length>=this.queueLimit?this.flush():void 0===this.timeoutId&&this._setTimer()},t}();var Yt=function(t,e,n){var r,i=n.context||this,o=n.limit,a=n.interval,s=n.countFn||function(){},c=0;return function(){var n="function"==typeof s&&s.apply(i,arguments);return"number"!=typeof n&&(n=1),c+=n,void 0===r&&(r=setTimeout((function(){c=0,r=void 0}),a)),c>o?"function"==typeof e?e.apply(i,arguments):void 0:t.apply(i,arguments)}},Wt=function(){function t(){}return t.stringify=function(t){return JSON.stringify(t)+"\n"},t}(),Zt=function(){function t(t,e){this._configService=t,this._loggingService=e,this.errorQueue=void 0,this.transactionQueue=void 0,this.throttleAddError=void 0,this.throttleAddTransaction=void 0,this.initialized=!1}var e=t.prototype;return e.init=function(){this.initialized||(this.initialized=!0,this.initErrorQueue(),this.initTransactionQueue())},e.createMetaData=function(){var t=this._configService,e={service:{name:t.get("serviceName"),version:t.get("serviceVersion"),agent:{name:"js-base",version:t.version},language:{name:"javascript"},environment:t.get("environment")}};return wt(ht,e)},e._postJson=function(t,e){return this._makeHttpRequest("POST",t,{payload:e,headers:{"Content-Type":"application/x-ndjson"}}).then((function(t){return t.responseText}))},e._constructError=function(t){var e=t.url,n=t.status;t.responseText;if(void 0===n)return t;var r=e+" HTTP status: "+n;return new Error(r)},e._makeHttpRequest=function(t,e,n){var r=void 0===n?{timeout:1e4}:n,i=r.timeout,a=r.payload,s=r.headers;return new o.Promise((function(n,r){var o=new window.XMLHttpRequest;if(o[R]=!0,o.open(t,e,!0),o.timeout=i,s)for(var c in s)s.hasOwnProperty(c)&&o.setRequestHeader(c,s[c]);o.onreadystatechange=function(){if(4===o.readyState){var t=o.status,i=o.responseText;0===t||t>399&&t<600?r({url:e,status:t,responseText:i}):n(o)}},o.onerror=function(){var t=o.status,n=o.responseText;r({url:e,status:t,responseText:n})},o.send(a)}))},e._createQueue=function(t){var e=this._configService.get("queueLimit"),n=this._configService.get("flushInterval");return new Jt(t,{queueLimit:e,flushInterval:n})},e.fetchConfig=function(t,e){var n=this,r=this._configService.get("serverUrl")+"/config/v1/rum/agents";if(!t)return o.Promise.reject("serviceName is required for fetching central config.");r+="?service.name="+t,e&&(r+="&service.environment="+e);var i=this._configService.getLocalConfig();return i&&(r+="&ifnonematch="+i.etag),this._makeHttpRequest("GET",r,{timeout:5e3}).then((function(t){var e=t.status,r=t.responseText;if(304===e)return i;var o=JSON.parse(r),a=t.getResponseHeader("etag");return a&&(o.etag=a.replace(/["]/g,""),n._configService.setLocalConfig(o)),o})).catch((function(t){var e=n._constructError(t);return o.Promise.reject(e)}))},e.initErrorQueue=function(){var t=this;this.errorQueue&&this.errorQueue.flush(),this.errorQueue=this._createQueue((function(e){var n=t.sendErrors(e);n&&n.catch((function(e){t._loggingService.warn("Failed sending errors!",t._constructError(e))}))}));var e=this._configService.get("errorThrottleLimit"),n=this._configService.get("errorThrottleInterval");this.throttleAddError=Yt(this.errorQueue.add.bind(this.errorQueue),(function(){return t._loggingService.warn("Dropped error due to throttling!")}),{limit:e,interval:n})},e.initTransactionQueue=function(){var t=this;this.transactionQueue&&this.transactionQueue.flush(),this.transactionQueue=this._createQueue((function(e){var n=t.sendTransactions(e);n&&n.catch((function(e){t._loggingService.warn("Failed sending transactions!",t._constructError(e))}))}));var e=this._configService.get("transactionThrottleLimit"),n=this._configService.get("transactionThrottleInterval");this.throttleAddTransaction=Yt(this.transactionQueue.add.bind(this.transactionQueue),(function(){return t._loggingService.warn("Dropped transaction due to throttling!")}),{limit:e,interval:n})},e.addError=function(t){this.errorQueue||this.initErrorQueue(),this.throttleAddError(t)},e.addTransaction=function(t){this.transactionQueue||this.initTransactionQueue(),this.throttleAddTransaction(t)},e.ndjsonErrors=function(t){return t.map((function(t){return Wt.stringify({error:t})}))},e.ndjsonMetricsets=function(t){return t.map((function(t){return Wt.stringify({metricset:t})})).join("")},e.ndjsonTransactions=function(t){var e=this;return t.map((function(t){var n="";t.spans&&(n=t.spans.map((function(t){return Wt.stringify({span:t})})).join(""),delete t.spans);var r="";return t.breakdown&&(r=e.ndjsonMetricsets(t.breakdown),delete t.breakdown),Wt.stringify({transaction:t})+n+r}))},e._send=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e="transaction"),0!==t.length){var n={service:this.createMetaData().service,data:t},r=this._configService.applyFilters(n);if(r){var i;if("errors"===e)i=this.ndjsonErrors(r.data);else{if("transaction"!==e)return void 0;i=this.ndjsonTransactions(r.data)}i.unshift(Wt.stringify({metadata:{service:r.service}}));var o=i.join(""),a=this._configService.get("serverUrl")+"/intake/v2/rum/events";return this._postJson(a,o)}this._loggingService.warn("Dropped payload due to filtering!")}},e.sendTransactions=function(t){return this._send(t)},e.sendErrors=function(t){return this._send(t,"errors")},t}();var Gt=function(){function t(){this.config={},this.defaults={serviceName:"",serviceVersion:"",environment:"",serverUrl:"http://localhost:8200",active:!0,instrument:!0,disableInstrumentations:[],debug:!1,logLevel:"warn",breakdownMetrics:!1,checkBrowserResponsiveness:!0,groupSimilarSpans:!0,similarSpanThreshold:.05,ignoreTransactions:[],errorThrottleLimit:20,errorThrottleInterval:3e4,transactionThrottleLimit:20,transactionThrottleInterval:3e4,transactionDurationThreshold:6e4,queueLimit:-1,flushInterval:500,distributedTracing:!0,distributedTracingOrigins:[],distributedTracingHeaderName:"elastic-apm-traceparent",pageLoadTraceId:"",pageLoadSpanId:"",pageLoadSampled:!1,pageLoadTransactionName:"",transactionSampleRate:1,centralConfig:!1,context:{}},this.events=new it,this.filters=[],this.version=""}var e=t.prototype;return e.init=function(){var t=function(t){if(!t)return{};for(var e={},n=/^data-([\w-]+)$/,r=t.attributes,i=0;i<r.length;i++){var o=r[i];if(n.test(o.nodeName)){var a=o.nodeName.match(n)[1].split("-").map((function(t,e){return e>0?t.charAt(0).toUpperCase()+t.substring(1):t})).join("");e[a]=o.value||o.nodeValue}}return e}(_());this.setConfig(t)},e.isActive=function(){return this.get("active")},e.setVersion=function(t){this.version=t},e.addFilter=function(t){if("function"!=typeof t)throw new Error("Argument to must be function");this.filters.push(t)},e.applyFilters=function(t){for(var e=0;e<this.filters.length;e++)if(!(t=this.filters[e](t)))return;return t},e.get=function(t){return t.split(".").reduce((function(t,e){return t&&t[e]}),this.config)},e.setUserContext=function(t){void 0===t&&(t={});var e={},n=t,r=n.id,i=n.username,o=n.email;"number"!=typeof r&&"string"!=typeof r||(e.id=r),"string"==typeof i&&(e.username=i),"string"==typeof o&&(e.email=o),this.config.context.user=S(this.config.context.user||{},e)},e.setCustomContext=function(t){void 0===t&&(t={}),this.config.context.custom=S(this.config.context.custom||{},t)},e.addLabels=function(t){var e=this;this.config.context.tags||(this.config.context.tags={}),Object.keys(t).forEach((function(n){return p(n,t[n],e.config.context.tags)}))},e.setConfig=function(t){void 0===t&&(t={}),t.serverUrl&&(t.serverUrl=t.serverUrl.replace(/\/+$/,"")),this.config=w({},this.defaults,this.config,t),this.events.send("config:change",[this.config])},e.validate=function(t){void 0===t&&(t={});var e=["serviceName","serverUrl"],n={missing:[],invalid:[]};Object.keys(t).forEach((function(r){-1===e.indexOf(r)||t[r]||n.missing.push(r)})),t.serviceName&&!/^[a-zA-Z0-9 _-]+$/.test(t.serviceName)&&n.invalid.push({key:"serviceName",value:t.serviceName,allowed:"a-z, A-Z, 0-9, _, -, <space>"});var r=t.transactionSampleRate;return void 0!==r&&("number"!=typeof r||isNaN(r)||r<0||r>1)&&n.invalid.push({key:"transactionSampleRate",value:r,allowed:"Number between 0 and 1"}),n},e.getLocalConfig=function(){var t=sessionStorage.getItem("elastic_apm_config");if(t)return JSON.parse(t)},e.setLocalConfig=function(t){t&&sessionStorage.setItem("elastic_apm_config",JSON.stringify(t))},t}(),Kt=function(){function t(t){void 0===t&&(t={}),this.levels=["trace","debug","info","warn","error"],this.level=t.level||"info",this.prefix=t.prefix||"",this.resetLogMethods()}var e=t.prototype;return e.shouldLog=function(t){return this.levels.indexOf(t)>=this.levels.indexOf(this.level)},e.setLevel=function(t){this.level=t,this.resetLogMethods()},e.resetLogMethods=function(){var t=this;this.levels.forEach((function(e){t[e]=t.shouldLog(e)?function(){var n,r=t.prefix;switch(e){case"trace":case"debug":n="info";break;default:n=e}var i=arguments;r&&(i[0]=r+i[0]);if(console){var o=console[n]||console.log;"function"==typeof o&&o.apply(console,i)}}:b}))},t}(),te=function(){function t(){this._serviceCreators={},this._serviceInstances={},this.initialized=!1}var e=t.prototype;return e.registerCoreServices=function(){var t=this;this.registerServiceCreator("ConfigService",(function(){return new Gt})),this.registerServiceCreator("LoggingService",(function(){return new Kt({prefix:"[Elastic APM] "})})),this.registerServiceCreator("ApmServer",(function(){return new Zt(t.getService("ConfigService"),t.getService("LoggingService"))}))},e.init=function(){if(!this.initialized){this.initialized=!0;var t=this.getService("ConfigService");t.init();var e=this.getService("LoggingService");n(e,t),t.events.observe("config:change",(function(){n(e,t)})),this.getService("ApmServer").init()}function n(t,e){var n=e.get("debug"),r=e.get("logLevel");!0===n&&"trace"!==r?t.setLevel("debug"):t.setLevel(r)}},e.registerServiceCreator=function(t,e){this._serviceCreators[t]=e},e.registerServiceInstance=function(t,e){this._serviceInstances[t]=e},e.getService=function(t){if(!this._serviceInstances[t]){if("function"!=typeof this._serviceCreators[t])throw new Error("Can not get service, No creator for: "+t);this._serviceInstances[t]=this._serviceCreators[t](this)}return this._serviceInstances[t]},t}();var ee,ne=function(){function t(t,e){this._disable=e,this.serviceFactory=t,this._initialized=!1}var e=t.prototype;return e.init=function(t){var e=this;if(this.isEnabled()&&!this._initialized){this._initialized=!0;var n=this.serviceFactory.getService("ConfigService");n.setVersion("4.7.1"),this.config(t);var r=this.serviceFactory.getService("LoggingService");if(n.isActive()){this.serviceFactory.init();var i=function(t,e){var n,r=((n={})[Y]=!1,n[W]=!1,n[Z]=!1,n[U]=!1,n[G]=!1,n);return t?(Object.keys(r).forEach((function(t){-1===e.indexOf(t)&&(r[t]=!0)})),r):r}(n.get("instrument"),n.get("disableInstrumentations"));if(this.serviceFactory.getService("PerformanceMonitoring").init(i),i[G])this.serviceFactory.getService("ErrorLogging").registerListeners();var o=function(){return i[U]&&e._sendPageLoadMetrics()};n.get("centralConfig")?this.fetchCentralConfig().then(o):o()}else this._disable=!0,r.info("RUM agent is inactive")}return this},e.fetchCentralConfig=function(){var t=this.serviceFactory.getService("ApmServer"),e=this.serviceFactory.getService("LoggingService"),n=this.serviceFactory.getService("ConfigService");return t.fetchConfig(n.get("serviceName"),n.get("environment")).then((function(t){var r=t.transaction_sample_rate;if(r){var i={transactionSampleRate:r=Number(r)},o=n.validate(i).invalid;if(0===o.length)n.setConfig(i);else{var a=o[0],s=a.key,c=a.value,u=a.allowed;e.warn('invalid value "'+c+'" for '+s+". Allowed: "+u+".")}}return t})).catch((function(t){e.warn("failed fetching config:",t)}))},e._sendPageLoadMetrics=function(){var t=this.startTransaction(void 0,U,{managed:!0,canReuse:!0});t&&t.addTask(U);var e=function(){setTimeout((function(){t&&t.removeTask(U)}))};"complete"===document.readyState?e():window.addEventListener("load",e)},e.isEnabled=function(){return!this._disable},e.observe=function(t,e){this.serviceFactory.getService("ConfigService").events.observe(t,e)},e.config=function(t){var e=this.serviceFactory.getService("ConfigService"),n=e.validate(t),r=n.missing,i=n.invalid;if(0===r.length&&0===i.length)e.setConfig(t);else{var o=this.serviceFactory.getService("LoggingService"),a="RUM agent isn't correctly configured. ";r.length>0&&(a+=r.join(", ")+" is missing",i.length>0&&(a+=", ")),i.forEach((function(t,e){var n=t.key,r=t.value,o=t.allowed;a+=n+' "'+r+'" contains invalid characters! (allowed: '+o+")"+(e!==i.length-1?", ":"")})),o.error(a),e.setConfig({active:!1})}},e.setUserContext=function(t){this.serviceFactory.getService("ConfigService").setUserContext(t)},e.setCustomContext=function(t){this.serviceFactory.getService("ConfigService").setCustomContext(t)},e.addTags=function(t){this.serviceFactory.getService("LoggingService").warn("addTags deprecated, please use addLabels"),this.addLabels(t)},e.addLabels=function(t){this.serviceFactory.getService("ConfigService").addLabels(t)},e.setInitialPageLoadName=function(t){this.isEnabled()&&this.serviceFactory.getService("ConfigService").setConfig({pageLoadTransactionName:t})},e.startTransaction=function(t,e,n){if(this.isEnabled())return this.serviceFactory.getService("TransactionService").startTransaction(t,e,n)},e.startSpan=function(t,e){if(this.isEnabled())return this.serviceFactory.getService("TransactionService").startSpan(t,e)},e.getCurrentTransaction=function(){if(this.isEnabled())return this.serviceFactory.getService("TransactionService").getCurrentTransaction()},e.captureError=function(t){if(this.isEnabled())return this.serviceFactory.getService("ErrorLogging").logError(t)},e.addFilter=function(t){this.serviceFactory.getService("ConfigService").addFilter(t)},t}(),re=ct?ut:(ct=!0,d()?(st(),ut=!0):"undefined"!=typeof window&&console.log("[Elastic APM] platform is not supported!"),ut),ie=((ee=new te).registerCoreServices(),Et.registerServices(ee),Vt.registerServices(ee),ee),oe=new ne(ie,!re);"undefined"!=typeof window&&(window.elasticApm=oe);var ae=oe.init.bind(oe),se=n(4),ce=n(1),ue=n(2);var fe=function(t){var e,n;function r(e,n){var r;return(r=t.call(this)||this).__tracer=e,r.span=n,r.isTransaction=n instanceof Bt,r.spanContext={id:n.id,traceId:n.traceId,sampled:n.sampled},r}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var i=r.prototype;return i._context=function(){return this.spanContext},i._tracer=function(){return this.__tracer},i._setOperationName=function(t){this.span.name=t},i._addTags=function(t){var e=S({},t);if(e.type&&(this.span.type=e.type,delete e.type),this.isTransaction){var n=e["user.id"],r=e["user.username"],i=e["user.email"];(n||r||i)&&(this.span.addContext({user:{id:n,username:r,email:i}}),delete e["user.id"],delete e["user.username"],delete e["user.email"])}this.span.addLabels(e)},i._log=function(t,e){"error"===t.event&&(t["error.object"]?this.__tracer.errorLogging.logError(t["error.object"]):t.message&&this.__tracer.errorLogging.logError(t.message))},i._finish=function(t){this.span.end(),t&&(this.span._end=t-l())},r}(ue.Span);var de=function(t){var e,n;function r(e,n,r,i){var o;return(o=t.call(this)||this).performanceMonitoring=e,o.transactionService=n,o.loggingService=r,o.errorLogging=i,o}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var i=r.prototype;return i._startSpan=function(t,e){var n,r={managed:!0};if(e)if(r.timestamp=e.startTime,e.childOf)r.parentId=e.childOf.id;else if(e.references&&e.references.length>0){e.references.length;var i=function(t,e,n){if(null==t)throw new TypeError("array is null or not defined");var r=Object(t),i=r.length>>>0;if("function"!=typeof e)throw new TypeError("predicate must be a function");for(var o=0;o<i;){var a=r[o];if(e.call(n,a,o,r))return a;o++}}(e.references,(function(t){return t.type()===ce.REFERENCE_CHILD_OF}));i&&(r.parentId=i.referencedContext().id)}if(!(n=this.transactionService.getCurrentTransaction()?this.transactionService.startSpan(t,void 0,r):this.transactionService.startTransaction(t,void 0,r)))return new ue.Span;r.timestamp&&(n._start=r.timestamp-l());var o=new fe(this,n);return e&&e.tags&&o.addTags(e.tags),o},i._inject=function(t,e,n){switch(e){case ce.FORMAT_TEXT_MAP:case ce.FORMAT_HTTP_HEADERS:this.performanceMonitoring.injectDtHeader(t,n);break;case ce.FORMAT_BINARY:0}},i._extract=function(t,e){var n;switch(t){case ce.FORMAT_TEXT_MAP:case ce.FORMAT_HTTP_HEADERS:n=this.performanceMonitoring.extractDtHeader(e);break;case ce.FORMAT_BINARY:0}return n||(n=null),n},r}(se.Tracer);function pe(t){return function(t){var e=t.getService("PerformanceMonitoring"),n=t.getService("TransactionService"),r=t.getService("ErrorLogging"),i=t.getService("LoggingService");return new de(e,n,i,r)}(t.serviceFactory)}n.d(e,"createTracer",(function(){return pe})),n.d(e,"init",(function(){return ae})),n.d(e,"apm",(function(){return oe})),n.d(e,"apmBase",(function(){return oe})),n.d(e,"ApmBase",(function(){return ne})),"undefined"!=typeof window&&window.elasticApm&&(window.elasticApm.createTracer=pe.bind(window.elasticApm,window.elasticApm));e.default=pe}]);
//# sourceMappingURL=elastic-apm-opentracing.umd.min.js.map
/*! For license information please see elastic-apm-rum.umd.min.js.LICENSE */
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){var r;r=function(){"use strict";function t(t){return"function"==typeof t}var e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=0,r=void 0,i=void 0,o=function(t,e){h[n]=t,h[n+1]=e,2===(n+=2)&&(i?i(v):y())},a="undefined"!=typeof window?window:void 0,s=a||{},c=s.MutationObserver||s.WebKitMutationObserver,u="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(v,1)}}var h=new Array(1e3);function v(){for(var t=0;t<n;t+=2)(0,h[t])(h[t+1]),h[t]=void 0,h[t+1]=void 0;n=0}var l,p,g,m,y=void 0;function _(t,e){var n=this,r=new this.constructor(w);void 0===r[b]&&R(r);var i=n._state;if(i){var a=arguments[i-1];o((function(){return j(i,r,a,n._result)}))}else N(n,r,t,e);return r}function S(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(w);return L(e,t),e}u?y=function(){return process.nextTick(v)}:c?(p=0,g=new c(v),m=document.createTextNode(""),g.observe(m,{characterData:!0}),y=function(){m.data=p=++p%2}):f?((l=new MessageChannel).port1.onmessage=v,y=function(){return l.port2.postMessage(0)}):y=void 0===a?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(v)}:d()}catch(t){return d()}}():d();var b=Math.random().toString(36).substring(2);function w(){}var T=void 0,E=1,C=2;function x(e,n,r){n.constructor===e.constructor&&r===_&&n.constructor.resolve===S?function(t,e){e._state===E?I(t,e._result):e._state===C?O(t,e._result):N(e,void 0,(function(e){return L(t,e)}),(function(e){return O(t,e)}))}(e,n):void 0===r?I(e,n):t(r)?function(t,e,n){o((function(t){var r=!1,i=function(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}(n,e,(function(n){r||(r=!0,e!==n?L(t,n):I(t,n))}),(function(e){r||(r=!0,O(t,e))}),t._label);!r&&i&&(r=!0,O(t,i))}),t)}(e,n,r):I(e,n)}function L(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=e),null===r||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void O(t,e)}x(t,e,n)}var r,i}function k(t){t._onerror&&t._onerror(t._result),A(t)}function I(t,e){t._state===T&&(t._result=e,t._state=E,0!==t._subscribers.length&&o(A,t))}function O(t,e){t._state===T&&(t._state=C,t._result=e,o(k,t))}function N(t,e,n,r){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+E]=n,i[a+C]=r,0===a&&t._state&&o(A,t)}function A(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,i=void 0,o=t._result,a=0;a<e.length;a+=3)r=e[a],i=e[a+n],r?j(n,r,i,o):i(o);t._subscribers.length=0}}function j(e,n,r,i){var o=t(r),a=void 0,s=void 0,c=!0;if(o){try{a=r(i)}catch(t){c=!1,s=t}if(n===a)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else a=i;n._state!==T||(o&&c?L(n,a):!1===c?O(n,s):e===E?I(n,a):e===C&&O(n,a))}var F=0;function R(t){t[b]=F++,t._state=void 0,t._result=void 0,t._subscribers=[]}var M=function(){function t(t,n){this._instanceConstructor=t,this.promise=new t(w),this.promise[b]||R(this.promise),e(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&I(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===T&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===S){var i=void 0,o=void 0,a=!1;try{i=t.then}catch(t){a=!0,o=t}if(i===_&&t._state!==T)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===P){var s=new n(w);a?O(s,o):x(s,t,i),this._willSettleAt(s,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===T&&(this._remaining--,t===C?O(r,n):this._result[e]=n),0===this._remaining&&I(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;N(t,void 0,(function(t){return n._settledAt(E,e,t)}),(function(t){return n._settledAt(C,e,t)}))},t}(),P=function(){function e(t){this[b]=F++,this._result=this._state=void 0,this._subscribers=[],w!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){L(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this.constructor;return t(e)?this.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):this.then(e,e)},e}();return P.prototype.then=_,P.all=function(t){return new M(this,t).promise},P.race=function(t){var n=this;return e(t)?new n((function(e,r){for(var i=t.length,o=0;o<i;o++)n.resolve(t[o]).then(e,r)})):new n((function(t,e){return e(new TypeError("You must pass an array to race."))}))},P.resolve=S,P.reject=function(t){var e=new this(w);return O(e,t),e},P._setScheduler=function(t){i=t},P._setAsap=function(t){o=t},P._asap=o,P.polyfill=function(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=P},P.Promise=P,P},t.exports=r()},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var i=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}},function(t,e,n){var r,i,o;!function(a,s){"use strict";i=[n(4)],void 0===(o="function"==typeof(r=function(t){var e=/(^|@)\S+\:\d+/,n=/^\s*at .*(\S+\:\d+|\(native\))/m,r=/^(eval@)?(\[native code\])?$/;function i(t,e,n){if("function"==typeof Array.prototype.map)return t.map(e,n);for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=e.call(n,t[i]);return r}function o(t,e,n){if("function"==typeof Array.prototype.filter)return t.filter(e,n);for(var r=[],i=0;i<t.length;i++)e.call(n,t[i])&&r.push(t[i]);return r}return{parse:function(t){if(void 0!==t.stacktrace||void 0!==t["opera#sourceloc"])return this.parseOpera(t);if(t.stack&&t.stack.match(n))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?:\:(\d+))?(?:\:(\d+))?$/.exec(t.replace(/[\(\)]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(e){return i(o(e.stack.split("\n"),(function(t){return!!t.match(n)}),this),(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var n=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),r=this.extractLocation(n.pop()),i=n.join(" ")||void 0,o=function(t,e){if("function"==typeof Array.prototype.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}(["eval","<anonymous>"],r[0])>-1?void 0:r[0];return new t(i,void 0,o,r[1],r[2],e)}),this)},parseFFOrSafari:function(e){return i(o(e.stack.split("\n"),(function(t){return!t.match(r)}),this),(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new t(e);var n=e.split("@"),r=this.extractLocation(n.pop()),i=n.join("@")||void 0;return new t(i,void 0,r[0],r[1],r[2],e)}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],o=2,a=r.length;o<a;o+=2){var s=n.exec(r[o]);s&&i.push(new t(void 0,void 0,s[2],s[1],void 0,r[o]))}return i},parseOpera10:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],o=0,a=r.length;o<a;o+=2){var s=n.exec(r[o]);s&&i.push(new t(s[3]||void 0,void 0,s[2],s[1],void 0,r[o]))}return i},parseOpera11:function(n){return i(o(n.stack.split("\n"),(function(t){return!!t.match(e)&&!t.match(/^Error created at/)}),this),(function(e){var n,r=e.split("@"),i=this.extractLocation(r.pop()),o=r.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(n=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var s=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new t(a,s,i[0],i[1],i[2],e)}),this)}}})?r.apply(e,i):r)||(t.exports=o)}()},,function(t,e,n){var r,i,o;!function(n,a){"use strict";i=[],void 0===(o="function"==typeof(r=function(){function t(t){return!isNaN(parseFloat(t))&&isFinite(t)}function e(t,e,n,r,i,o){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==i&&this.setColumnNumber(i),void 0!==o&&this.setSource(o)}return e.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(e){if(!t(e))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(e)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(e){if(!t(e))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(e)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(t(this.getLineNumber())?":"+this.getLineNumber():"")+(t(this.getColumnNumber())?":"+this.getColumnNumber():"")}},e})?r.apply(e,i):r)||(t.exports=o)}()},function(t,e,n){"use strict";n.r(e);var r=n(1),i=n.n(r),o=n(0),a=[].slice;for(var s=[],c=0;c<256;++c)s[c]=(c+256).toString(16).substr(1);function u(t,e){var n=!1;return"string"==typeof e?n=t===e:Array.isArray(e)&&e.forEach((function(e){n||(n=u(t,e))})),n}function f(t){var e,n,r,o;return(e=i()(),r=n||0,[(o=s)[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")).substr(0,t)}function d(){return"undefined"!=typeof window&&"function"==typeof Array.prototype.forEach&&"function"==typeof JSON.stringify&&"function"==typeof Function.bind&&window.performance&&"function"==typeof window.performance.now&&"withCredentials"in new window.XMLHttpRequest}function h(t,e,n){if(n&&t){var r=T(t);return e&&(e=String(e)),n[r]=e,n}}var v=["fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","responseEnd","domLoading","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd"];function l(){return{page:{referer:document.referrer,url:window.location.href}}}function p(t){return t&&t.split("?")[0]}function g(t){return null!==t&&"object"==typeof t}function m(t,e,n){for(var r=0,i=e.length;r<i;++r){var o=e[r];if(g(o)||"function"==typeof o)for(var a=Object.keys(o),s=0,c=a.length;s<c;s++){var u=a[s],f=o[u];n&&g(f)?(g(t[u])||(t[u]=Array.isArray(f)?[]:{}),m(t[u],[f],!1)):t[u]=f}}return t}function y(){if("undefined"!=typeof document){var t=document.currentScript;return t||function(){if("undefined"!=typeof document)for(var t=document.getElementsByTagName("script"),e=0,n=t.length;e<n;e++){var r=t[e];if(r.src.indexOf("elastic")>0)return r}}()}}function _(t){return m(t,a.call(arguments,1),!1)}function S(t){return m(t,a.call(arguments,1),!0)}function b(t){return void 0===t}function w(){}function T(t){return t.replace(/[.*"]/g,"_")}function E(){var t=function(){var t=window.performance.timing,e=t.fetchStart,n={};return v.forEach((function(r){var i=t[r];i&&i>=e&&(n[r]=i-e)})),n}(),e=function(){var t={},e=window.performance;if("function"==typeof e.getEntriesByType){var n=e.getEntriesByType("paint");if(n.length>0)for(var r=e.timing,i=r.fetchStart-r.navigationStart,o=0;o<n.length;o++){var a=n[o],s=i>=0?a.startTime-i:a.startTime;t[a.name]=s}}return t}(),n={timeToFirstByte:t.responseStart,domInteractive:t.domInteractive,domComplete:t.domComplete};return e["first-contentful-paint"]&&(n.firstContentfulPaint=e["first-contentful-paint"]),{navigationTiming:t,agent:n}}function C(){return window.performance.now()}function x(t){return"number"==typeof t&&t>=0?t:C()}function L(t,e){return b(e)||b(t)?null:parseFloat(e-t)}function k(t){o.Promise.resolve().then(t)}var I={fetchInProgress:!1};function O(t){return"__apm_symbol__"+t}function N(t,e,n){for(var r=t;r&&!r.hasOwnProperty(e);)r=Object.getPrototypeOf(r);!r&&t[e]&&(r=t);var i,o,a,s,c=O(e);if(r&&!(i=r[c])){i=r[c]=r[e];var u=r&&Object.getOwnPropertyDescriptor(r,e);if(!(s=u)||!1!==s.writable&&("function"!=typeof s.get||void 0!==s.set)){var f=n(i,c,e);r[e]=function(){return f(this,arguments)},o=r[e],a=i,o[O("OriginalDelegate")]=a}}return i}var A=O("xhrIgnore"),j=O("xhrSync"),F=O("xhrURL"),R=O("xhrMethod"),M="schedule",P="invoke",q="clear",D="addEventListener",H="removeEventListener",B=["link","css","script","img","xmlhttprequest","fetch","beacon","iframe"],Q=3e5,z="page-load",U="custom",$="Unknown",V=[z,"route-change","http-request",U,"temporary"],X=60,J="xmlhttprequest",Y="fetch",Z="history",G="error",K=1024,W=O("xhrTask"),tt=O("xhrListener"),et=O("xhrScheduled");function nt(t){var e=XMLHttpRequest.prototype,n=e[D],r=e[H];if(!n){var i=window.XMLHttpRequestEventTarget;if(i){var o=i.prototype;n=o[D],r=o[H]}}var a="readystatechange",s="load";function c(e){e.state=P,t(P,e)}function u(e){XMLHttpRequest[et]=!1,e.state=M,t(M,e);var i=e.data,o=i.aborted,u=i.target;n||(n=u[D],r=u[H]);var f,d=u[tt];d&&(r.call(u,a,d),r.call(u,s,d));var h=u[tt]=function(t){var n=t.type;f?f!=n&&function(t){setTimeout(t,0)}((function(){e.state!==P&&c(e)})):u.readyState===u.DONE&&!o&&XMLHttpRequest[et]&&e.state===M&&(f=n)};n.call(u,a,h),n.call(u,s,h),u[W]||(u[W]=e)}var f=N(e,"open",(function(){return function(t,e){return t[A]||(t[R]=e[0],t[F]=e[1],t[j]=!1===e[2]),f.apply(t,e)}})),d=N(e,"send",(function(){return function(t,e){if(t[A])return d.apply(t,e);var n={source:J,state:"",type:"macroTask",data:{target:t,method:t[R],sync:t[j],url:t[F],aborted:!1}};u(n);var r=d.apply(t,e);return XMLHttpRequest[et]=!0,t[j]&&c(n),r}})),h=N(e,"abort",(function(){return function(e,n){if(!e[A]){var r=e[W];if(r&&"string"==typeof r.type){if(r.data&&r.data.aborted)return;!function(e){e.state=q,t(q,e),e.data.aborted=!0}(r)}}return h.apply(e,n)}}))}var rt=function(){function t(){this.observers={}}var e=t.prototype;return e.observe=function(t,e){var n=this;if("function"==typeof e)return this.observers[t]||(this.observers[t]=[]),this.observers[t].push(e),function(){var r=n.observers[t].indexOf(e);r>-1&&n.observers[t].splice(r,1)}},e.sendOnly=function(t,e){var n=this.observers[t];n&&n.forEach((function(t){try{t.apply(void 0,e)}catch(t){console.log(t,t.stack)}}))},e.send=function(t,e){this.sendOnly(t+":before",e),this.sendOnly(t,e),this.sendOnly(t+":after",e)},t}(),it=new rt,ot=!1;function at(){return ot||(ot=!0,nt((function(t,e){it.send(J,[t,e])})),function(t){if(window.fetch&&window.Request){var e=window.fetch;window.fetch=function(t,i){var a,s,c=this,u=arguments;if("string"==typeof t)a=new Request(t,i),s=t;else{if(!t)return e.apply(c,u);s=(a=t).url}var f={source:Y,state:"",type:"macroTask",data:{target:a,method:a.method,sync:!1,url:s,aborted:!1}};return new o.Promise((function(t,i){var o;I.fetchInProgress=!0,n(f);try{o=e.apply(c,[a])}catch(t){return i(t),f.data.error=t,r(f),void(I.fetchInProgress=!1)}o.then((function(e){t(e),k((function(){f.data.response=e,r(f)}))}),(function(t){i(t),k((function(){f.data.error=t,r(f)}))})),I.fetchInProgress=!1}))}}function n(e){e.state=M,t(M,e)}function r(e){e.state=P,t(P,e)}}((function(t,e){it.send(Y,[t,e])})),function(t){if(window.history){var e=history.pushState;"function"==typeof e&&(history.pushState=function(n,r,i){var o={source:Z,data:{state:n,title:r,url:i}};t(P,o),e.apply(this,arguments)})}}((function(t,e){it.send(Z,[t,e])}))),it}var st=!1,ct=!1;var ut=n(2),ft=n.n(ut);function dt(t){var e=t.error,n=t.filename,r=t.lineno,i=t.colno,o=[];if(e)try{o=ft.a.parse(e)}catch(t){}return 0===o.length&&(o=[{fileName:n,lineNumber:r,columnNumber:i}]),o.map((function(t){return t.functionName&&(t.functionName=(e=t.functionName,n=e.split("/"),e=(e=(e=n.length>1?["Object",n[n.length-1]].join("."):n[0]).replace(/.<$/gi,".<anonymous>")).replace(/^Anonymous function$/,"<anonymous>"),e=(n=e.split(".")).length>1?n[n.length-1]:n[0])),t;var e,n})).map((function(t){var e=t.fileName,n=t.lineNumber,r=t.columnNumber,i=t.functionName,o=void 0===i?"<anonymous>":i;if(!e&&!n)return{};if(!r&&!n)return{};var a,s,c=function(t){return void 0===t&&(t=""),"<anonymous>"===t&&(t=""),t}(e),u=(a=c,s=window.location.origin||window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),a.indexOf(s)>-1&&(a=a.replace(s+"/","")),a);return function(t){return!!t&&0===window.location.href.indexOf(t)}(c)&&(u="(inline script)"),{abs_path:e,filename:u,function:o,lineno:n,colno:r}}))}var ht={service:{name:[K,!0],version:!0,agent:{version:[K,!0]},environment:!0}},vt={"*":!0,headers:{"*":!0}},lt={user:{id:!0,email:!0,username:!0},tags:{"*":!0},http:{response:vt},destination:{address:[K],service:{"*":[K,!0]}},response:vt},pt={name:[K,!0],type:[K,!0],id:[K,!0],trace_id:[K,!0],parent_id:[K,!0],transaction_id:[K,!0],subtype:!0,action:!0,context:lt},gt={name:!0,parent_id:!0,type:[K,!0],id:[K,!0],trace_id:[K,!0],span_count:{started:[K,!0]},context:lt},mt={id:[K,!0],trace_id:!0,transaction_id:!0,parent_id:!0,culprit:!0,exception:{type:!0},transaction:{type:!0},context:lt};function yt(t){return null==t||""===t||void 0===t}function _t(t,e,n){var r=function(t,e,n,r){return void 0===e&&(e=K),void 0===n&&(n=!1),void 0===r&&(r="N/A"),n&&yt(t)&&(t=r),"string"==typeof t?t.substring(0,e):t}(t[e],n[0],n[1]);yt(r)?delete t[e]:t[e]=r}function St(t,e,n){void 0===t&&(t={}),void 0===n&&(n=e);for(var r=Object.keys(t),i=[],o=function(o){var a=r[o],s=!0===t[a]?i:t[a];Array.isArray(s)?"*"===a?Object.keys(n).forEach((function(t){return _t(n,t,s)})):_t(n,a,s):St(s,e,n[a])},a=0;a<r.length;a++)o(a);return e}var bt=function(){function t(t,e,n){this._apmServer=t,this._configService=e,this._transactionService=n}var e=t.prototype;return e.createErrorDataModel=function(t){var e=function(t){return t.filter((function(t){var e=t.filename,n=t.lineno;return void 0!==e&&void 0!==n}))}(dt(t)),n="(inline script)",r=e[e.length-1];r&&r.filename&&(n=r.filename);var i=t.message,o=t.error,a=i,s="",c={};o&&"object"==typeof o&&(a=a||o.message,s=o.name,c=this._getErrorProperties(o)),s||a&&a.indexOf(":")>-1&&(s=a.split(":")[0]);var u=this._transactionService.getCurrentTransaction(),d=u?u.context:{},h=this._configService.get("context"),v=S({},l(),d,h,c),p={id:f(),culprit:n,exception:{message:a,stacktrace:e,type:s},context:v};return u&&(p=_(p,{trace_id:u.traceId,parent_id:u.id,transaction_id:u.id,transaction:{type:u.type,sampled:u.sampled}})),St(mt,p)},e.logErrorEvent=function(t,e){if(void 0!==t){var n=this.createErrorDataModel(t);if(void 0!==n.exception.message)return e?this._apmServer.sendErrors([n]):this._apmServer.addError(n)}},e.registerListeners=function(){var t=this;window.addEventListener("error",(function(e){return t.logErrorEvent(e)})),window.addEventListener("unhandledrejection",(function(e){return t.logPromiseEvent(e)}))},e.logPromiseEvent=function(t){var e="Unhandled promise rejection: ",n=t.reason;null==n?this.logError(e+"<no reason specified>"):"string"==typeof n.message?this.logError({message:e+n.message,stack:n.stack?n.stack:null}):"object"!=typeof n&&this.logError(e+n)},e.logError=function(t){var e={};return"string"==typeof t?e.message=t:e.error=t,this.logErrorEvent(e)},e._getErrorProperties=function(t){var e={};return Object.keys(t).forEach((function(n){if("stack"!==n){var r=t[n];if(null!==r){switch(typeof r){case"function":return;case"object":if("function"!=typeof r.toISOString)return;r=r.toISOString()}e[n]=r}}})),e},t}(),wt={ErrorLogging:bt,registerServices:function(t){t.registerServiceCreator("ErrorLogging",(function(){var e=t.getService("ApmServer"),n=t.getService("ConfigService"),r=t.getService("TransactionService");return new bt(e,n,r)}))}};var Tt=[["#","hash"],["?","query"],["/","path"],["@","auth",1],[NaN,"host",void 0,1]],Et=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,Ct=function(){function t(t){var e,n=this.extractProtocol(t||""),r=n.protocol,i=n.address,o=n.slashes,a=!r&&!o,s=this.getLocation(),c=Tt.slice();i=i.replace("\\","/"),o||(c[2]=[NaN,"path"]);for(var u=0;u<c.length;u++){var f=c[u],d=f[0],h=f[1];if("string"==typeof d){if(~(e=i.indexOf(d))){var v=f[2];if(v){var l=i.lastIndexOf(d);e=Math.max(e,l),this[h]=i.slice(0,e),i=i.slice(e+v)}else this[h]=i.slice(e),i=i.slice(0,e)}}else this[h]=i,i="";this[h]=this[h]||a&&f[3]&&s[h]||"",f[3]&&(this[h]=this[h].toLowerCase())}if(a&&"/"!==this.path.charAt(0)&&(this.path="/"+this.path),this.relative=a,this.protocol=r||s.protocol,this.hostname=this.host,this.port="",/:\d+$/.test(this.host)){var p=this.host.split(":"),g=p.pop(),m=p.join(":");!function(t,e){switch(e){case"http:":return"80"===t;case"https:":return"443"===t}return!0}(g,this.protocol)?this.port=g:this.host=m,this.hostname=m}this.origin=this.protocol&&this.host&&"file:"!==this.protocol?this.protocol+"//"+this.host:"null",this.href=this.toString()}var e=t.prototype;return e.toString=function(){var t=this.protocol;if(t+="//",this.auth){var e=this.auth.split(":");t+=(e[0]?"[REDACTED]":"")+(e[1]?":[REDACTED]":"")+"@"}return t+=this.host,t+=this.path,t+=this.query,t+=this.hash},e.getLocation=function(){var t={};return"undefined"!=typeof window&&(t=window),t.location},e.extractProtocol=function(t){var e=Et.exec(t);return{protocol:e[1]?e[1].toLowerCase():"",slashes:!!e[2],address:e[3]}},t}(),xt=function(){function t(t,e,n,r){this._apmServer=t,this._configService=e,this._logginService=n,this._transactionService=r}var e=t.prototype;return e.init=function(t){var e=this;void 0===t&&(t={}),this._configService.events.observe("transaction:end:after",(function(t){var n=e.createTransactionPayload(t);n&&e._apmServer.addTransaction(n)})),t[Z]&&it.observe(Z,this.getHistorySub()),t[J]&&it.observe(J,this.getXHRSub()),t[Y]&&it.observe(Y,this.getFetchSub())},e.getHistorySub=function(){var t=this._transactionService;return function(e,n){n.source===Z&&e===P&&t.startTransaction(n.data.title,"route-change",{managed:!0,canReuse:!0})}},e.getXHRSub=function(){var t=this;return function(e,n){n.source!==J||I.fetchInProgress||t.processAPICalls(e,n)}},e.getFetchSub=function(){var t=this;return function(e,n){n.source===Y&&t.processAPICalls(e,n)}},e.processAPICalls=function(t,e){var n=this._configService,r=this._transactionService;if(t===M&&e.data){var i=e.data,o=new Ct(i.url),a=i.method+" "+(o.relative?o.path:p(o.href));r.getCurrentTransaction()||r.startTransaction(a,"http-request",{managed:!0});var s=r.startSpan(a,"external.http"),c=r.addTask();if(!s)return;var f=n.get("distributedTracing"),d=n.get("distributedTracingOrigins"),h=new Ct(window.location.href),v=u(o.origin,h.origin)||u(o.origin,d),l=i.target;f&&v&&l&&this.injectDtHeader(s,l),s.sync=i.sync,i.span=s,e.id=c}else t===P&&(e.data&&e.data.span&&e.data.span.end(null,e.data),e.id&&r.removeTask(e.id))},e.injectDtHeader=function(t,e){var n,r=this._configService.get("distributedTracingHeaderName"),i=function(t){if(t&&t.traceId&&t.id&&t.parentId){var e=t.sampled?"01":"00",n=t.sampled?t.id:t.parentId;return"00-"+t.traceId+"-"+n+"-"+e}}(t),o=/^[\da-f]{2}-[\da-f]{32}-[\da-f]{16}-[\da-f]{2}$/.test(n=i)&&"00000000000000000000000000000000"!==n.slice(3,35)&&"0000000000000000"!==n.slice(36,52);r&&i&&o&&("function"==typeof e.setRequestHeader?e.setRequestHeader(r,i):e.headers&&"function"==typeof e.headers.append?e.headers.append(r,i):e[r]=i)},e.extractDtHeader=function(t){var e=this._configService.get("distributedTracingHeaderName");if(t)return function(t){var e=/^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})$/.exec(t);if(e){var n="00"!==e[4];return{traceId:e[2],id:e[3],sampled:n}}}(t[e])},e.filterTransaction=function(t){var e=this._configService.get("transactionDurationThreshold"),n=t.duration();if(!n)return!1;if(n>e)return!1;if((t.sampled||t.resetSpans(),t.options.checkBrowserResponsiveness)&&!this.checkBrowserResponsiveness(t,500,3))return!1;return!0},e.prepareTransaction=function(t){t.spans.sort((function(t,e){return t._start-e._start})),this._configService.get("groupSimilarSpans")&&(t.spans=this.groupSmallContinuouslySimilarSpans(t,.05)),t.spans=t.spans.filter((function(e){return e.duration()>0&&e._start>=t._start&&e._end<=t._end}))},e.createTransactionDataModel=function(t){var e=t._start,n=t.spans.map((function(n){var r={id:n.id,transaction_id:t.id,parent_id:n.parentId||t.id,trace_id:t.traceId,name:n.name,type:n.type,subType:n.subType,action:n.action,sync:n.sync,start:n._start-e,duration:n.duration(),context:n.context};return St(pt,r)})),r={id:t.id,trace_id:t.traceId,name:t.name,type:t.type,duration:t.duration(),spans:n,context:t.context,marks:t.marks,breakdown:t.breakdownTimings,span_count:{started:n.length},sampled:t.sampled};return St(gt,r)},e.createTransactionPayload=function(t){if(this.prepareTransaction(t),this.filterTransaction(t))return this.createTransactionDataModel(t)},e.convertTransactionsToServerModel=function(t){var e=this;return t.map((function(t){return e.createTransactionDataModel(t)}))},e.groupSmallContinuouslySimilarSpans=function(t,e){var n=t.duration(),r=[],i=1;return t.spans.forEach((function(o,a){if(0===r.length)r.push(o);else{var s=r[r.length-1],c=s.type===o.type&&s.subType===o.subType&&s.action===o.action&&s.name===o.name&&o.duration()/n<e&&(o._start-s._end)/n<e,u=t.spans.length===a+1;c&&(i++,s._end=o._end),i>1&&(!c||u)&&(s.name=i+"x "+s.name,i=1),c||r.push(o)}})),r},e.checkBrowserResponsiveness=function(t,e,n){var r=t.browserResponsivenessCounter,i=t.duration();return r+n>=Math.floor(i/e)},t}(),Lt=function(){function t(t,e,n){void 0===n&&(n={}),t||(t=$),e||(e=U),this.name=t,this.type=e,this.options=n,this.id=n.id||f(16),this.traceId=n.traceId,this.sampled=n.sampled,this.timestamp=n.timestamp,this._start=x(n.startTime),this._end=void 0,this.ended=!1,this.onEnd=n.onEnd}var e=t.prototype;return e.ensureContext=function(){this.context||(this.context={})},e.addTags=function(t){console.warn("addTags deprecated, please use addLabels"),this.addLabels(t)},e.addLabels=function(t){this.ensureContext();var e=this.context;e.tags||(e.tags={}),Object.keys(t).forEach((function(n){return h(n,t[n],e.tags)}))},e.addContext=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];0!==e.length&&(this.ensureContext(),S.apply(void 0,[this.context].concat(e)))},e.end=function(t){this.ended||(this.ended=!0,this._end=x(t),this.callOnEnd())},e.callOnEnd=function(){"function"==typeof this.onEnd&&this.onEnd(this)},e.duration=function(){return L(this._start,this._end)},t}(),kt=91,It=93,Ot="external",Nt="resource";function At(t){var e={transfer_size:t.transferSize,encoded_body_size:t.encodedBodySize,decoded_body_size:t.decodedBodySize},n=function(t){void 0===t&&(t=[]);for(var e=[],n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.duration,a=r.description,s=i;a&&(s+=";desc="+a),o&&(s+=";dur="+o),e.push(s)}return e.join(", ")}(t.serverTiming);return n&&(e.headers={"server-timing":n}),e}function jt(t,e){var n=t.port,r=t.protocol,i=t.hostname,o=t.host,a=function(t,e){return""===t&&(t="http:"===e?"80":"https:"===e?"443":""),t}(n,r),s=i.charCodeAt(0)===kt&&i.charCodeAt(i.length-1)===It,c=i;return s&&(c=i.slice(1,-1)),{service:{name:r+"//"+o,resource:i+":"+a,type:e},address:c,port:Number(a)}}function Ft(t,e){if(e){var n;switch(t.type){case Ot:n=function(t){var e,n=t.url,r=t.method,i=t.target,o=t.response,a=new Ct(n),s=jt(a,Ot),c={http:{method:r,url:a.href},destination:s};return i&&void 0!==i.status?e=i.status:o&&(e=o.status),c.http.status_code=e,c}(e);break;case Nt:n=function(t){var e=t.entry,n=t.url,r=jt(new Ct(n),Nt);return{http:{url:n,response:At(e)},destination:r}}(e)}t.addContext(n)}}var Rt=function(t){var e,n;function r(e,n,r){var i;if((i=t.call(this,e,n,r)||this).parentId=i.options.parentId,i.subType=void 0,i.action=void 0,-1!==i.type.indexOf(".")){var o=i.type.split(".",3);i.type=o[0],i.subType=o[1],i.action=o[2]}return i.sync=i.options.sync,i}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.end=function(e,n){t.prototype.end.call(this,e),Ft(this,n)},r}(Lt),Mt=[["domainLookupStart","domainLookupEnd","DNS"],["connectStart","connectEnd","TCP"],["requestStart","responseStart","Request"],["responseStart","responseEnd","Response"],["domLoading","domComplete","Processing"],["loadEventStart","loadEventEnd","Load"]];function Pt(t){return{value:t}}function qt(t,e){var n=e.details,r=e.count,i=void 0===r?1:r,o=e.duration;return{transaction:t,span:n,samples:{"span.self_time.count":Pt(i),"span.self_time.sum.us":Pt(o)}}}var Dt=function(t){var e,n;function r(e,n,r){var i;return(i=t.call(this,e,n,r)||this).traceId=f(),i.marks=void 0,i.spans=[],i._activeSpans={},i.nextAutoTaskId=1,i._scheduledTasks=[],i.captureTimings=!1,i.breakdownTimings=[],i.sampled=Math.random()<=i.options.transactionSampleRate,i.browserResponsivenessCounter=0,i}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var i=r.prototype;return i.addMarks=function(t){this.marks=S(this.marks||{},t)},i.mark=function(t){var e=T(t),n=C()-this._start,r={};r[e]=n,this.addMarks({custom:r})},i.canReuse=function(t){return void 0===t&&(t=5e3),!!this.options.canReuse&&!this.ended&&C()-this._start<t},i.redefine=function(t,e,n){t&&(this.name=t),e&&(this.type=e),n&&(this.options=_(this.options,n))},i.startSpan=function(t,e,n){var r=this;if(!this.ended){var i=_({},n);i.onEnd=function(t){r._onSpanEnd(t)},i.traceId=this.traceId,i.sampled=this.sampled,i.parentId||(i.parentId=this.id);var o=new Rt(t,e,i);return this._activeSpans[o.id]=o,o}},i.isFinished=function(){return 0===this._scheduledTasks.length},i.detectFinish=function(){this.isFinished()&&this.end()},i.end=function(t){if(!this.ended){for(var e in this.ended=!0,this._end=x(t),this._activeSpans){var n=this._activeSpans[e];n.type=n.type+".truncated",n.end(t)}this.callOnEnd()}},i.captureBreakdown=function(){this.breakdownTimings=function(t,e){void 0===e&&(e=window.performance.timing);var n=[],r=t.duration(),i=t.name,o=t.type,a=t.sampled,s={name:i,type:o};if(n.push({transaction:s,samples:{"transaction.duration.count":Pt(1),"transaction.duration.sum.us":Pt(r),"transaction.breakdown.count":Pt(a?1:0)}}),!a)return n;if(o===z&&e)for(var c=0;c<Mt.length;c++){var u=Mt[c],f=L(e[u[0]],e[u[1]]);0!==f&&null!=f&&n.push(qt(s,{details:{type:u[2]},duration:f}))}else{var d=function(t){var e={},n=function(t){var e=t.spans,n=t._start,r=t._end;if(0===e.length)return t.duration();e.sort((function(t,e){return t._start-e._start}));for(var i=e[0],o=i._end,a=i._start,s=o,c=a-n,u=1;u<e.length;u++)a=(i=e[u])._start,o=i._end,a>s?(c+=a-s,s=o):o>s&&(s=o);return s<r&&(c+=r-s),c}(t);e.app={count:1,duration:n};for(var r=t.spans,i=0;i<r.length;i++){var o=r[i],a=o.duration();if(0!==a&&null!=a){var s=o.type,c=o.subType,u=s;c&&(u+="."+c),e[u]||(e[u]={duration:0,count:0}),e[u].count++,e[u].duration+=a}}return e}(t);Object.keys(d).forEach((function(t){var e=t.split("."),r=e[0],i=e[1],o=d[t],a=o.duration,c=o.count;n.push(qt(s,{details:{type:r,subtype:i},duration:a,count:c}))}))}return n}(this)},i.addTask=function(t){if(void 0===t&&(t="task"+this.nextAutoTaskId++),-1==this._scheduledTasks.indexOf(t))return this._scheduledTasks.push(t),t},i.removeTask=function(t){var e=this._scheduledTasks.indexOf(t);e>-1&&this._scheduledTasks.splice(e,1),this.detectFinish()},i.resetSpans=function(){this.spans=[]},i._onSpanEnd=function(t){this.spans.push(t),delete this._activeSpans[t.id]},r}(Lt),Ht=[["domainLookupStart","domainLookupEnd","Domain lookup"],["connectStart","connectEnd","Making a connection to the server"],["requestStart","responseEnd","Requesting and receiving the document"],["domLoading","domInteractive","Parsing the document, executing sync. scripts"],["domContentLoadedEventStart","domContentLoadedEventEnd",'Fire "DOMContentLoaded" event'],["loadEventStart","loadEventEnd",'Fire "load" event']];function Bt(t,e,n,r,i){return void 0===i&&(i=0),"number"==typeof t&&"number"==typeof e&&t>=i&&e>t&&t-i>=n&&e-i<=r&&e-t<Q&&t-i<Q&&e-i<Q}function Qt(t){var e=t.name,n=t.initiatorType,r=t.startTime,i=t.responseEnd,o="resource";n&&(o+="."+n);var a=p(e),s=new Rt(a,o);return s._start=r,s.end(i,{url:e,entry:t}),s}function zt(t){if(t.captureTimings){var e=window.performance,n=t._end;if(t.type===z){if(t.marks&&t.marks.custom){var r=t.marks.custom;Object.keys(r).forEach((function(e){r[e]+=t._start}))}t._start=0;var i=e.timing;(function(t,e,n,r){for(var i=[],o=0;o<Ht.length;o++){var a=t[Ht[o][0]],s=t[Ht[o][1]];if(Bt(a,s,n,r,e)){var c=new Rt(Ht[o][2],"hard-navigation.browser-timing");"requestStart"===Ht[o][0]&&(c.pageResponse=!0),c._start=a-e,c.end(s-e),i.push(c)}}return i})(i,i.fetchStart,0,n).forEach((function(e){e.traceId=t.traceId,e.sampled=t.sampled,e.pageResponse&&t.options.pageLoadSpanId&&(e.id=t.options.pageLoadSpanId),t.spans.push(e)})),t.addMarks(E())}if("function"==typeof e.getEntriesByType){var o=t._start;(function(t,e,n,r){for(var i=[],o=0;o<t.length;o++){var a=t[o],s=a.initiatorType,c=a.name,u=a.startTime,f=a.responseEnd;if("xmlhttprequest"!==s&&"fetch"!==s&&c)if(-1!==B.indexOf(s)){if(!Bt(u,f,n,r))continue;i.push(Qt(t[o]))}else{if(null!=s)continue;for(var d=!1,h=0;h<e.length;h++){var v=c.lastIndexOf(e[h]);if(v>-1&&v===c.length-e[h].length){d=!0;break}}!d&&Bt(u,f,n,r)&&i.push(Qt(t[o]))}}return i})(e.getEntriesByType("resource"),function(t){for(var e=t.spans,n=[],r=0;r<e.length;r++){var i=e[r];"external"===i.type&&"http"===i.subType||n.push(i.name.split(" ")[1])}return n}(t),o,n).forEach((function(e){return t.spans.push(e)})),function(t,e,n){for(var r=[],i=0;i<t.length;i++){var o=t[i],a=o.name,s=o.startTime,c=o.duration,u=s+c;if(!(c<=X)&&Bt(s,u,e,n)){var f=new Rt(a,"app");f._start=s,f.end(u),r.push(f)}}return r}(e.getEntriesByType("measure"),o,n).forEach((function(e){return t.spans.push(e)}))}}}var Ut=function(){function t(t,e){this._config=e,this._logger=t,this.currentTransaction=void 0,this.respIntervalId=void 0}var e=t.prototype;return e.ensureCurrentTransaction=function(t,e,n){var r=this.getCurrentTransaction();return r||(r=new Dt(t,e,n),this.setCurrentTransaction(r),r)},e.getCurrentTransaction=function(){if(this.currentTransaction&&!this.currentTransaction.ended)return this.currentTransaction},e.setCurrentTransaction=function(t){this.currentTransaction=t},e.ensureRespInterval=function(t){var e=this,n=function(){clearInterval(e.respIntervalId),e.respIntervalId=void 0};t?void 0===this.respIntervalId&&(this.respIntervalId=setInterval((function(){var t=e.getCurrentTransaction();t?t.browserResponsivenessCounter++:n()}),500)):void 0!==this.respIntervalId&&n()},e.createOptions=function(t){var e=this._config.config,n=_({transactionSampleRate:e.transactionSampleRate},t);return n.managed&&(n=_({pageLoadTraceId:e.pageLoadTraceId,pageLoadSampled:e.pageLoadSampled,pageLoadSpanId:e.pageLoadSpanId,pageLoadTransactionName:e.pageLoadTransactionName,checkBrowserResponsiveness:e.checkBrowserResponsiveness},n)),n},e.startManagedTransaction=function(t,e,n){var r=this.getCurrentTransaction();if(r)if(r.canReuse()&&n.canReuse){var i;0;var o=V.indexOf(r.type),a=V.indexOf(e);-1!==o&&-1!==a&&a<o&&(i=e),r.redefine(t,i,n)}else r.end(),r=this.ensureCurrentTransaction(t,e,n);else r=this.ensureCurrentTransaction(t,e,n);return r.captureTimings=!0,r.type===z&&(r.options.checkBrowserResponsiveness=!1,n.pageLoadTraceId&&(r.traceId=n.pageLoadTraceId),n.pageLoadSampled&&(r.sampled=n.pageLoadSampled),r.name===$&&n.pageLoadTransactionName&&(r.name=n.pageLoadTransactionName)),this.ensureRespInterval(r.options.checkBrowserResponsiveness),r},e.startTransaction=function(t,e,n){var r,i=this,o=this.createOptions(n);return(r=o.managed?this.startManagedTransaction(t,e,o):new Dt(t,e,o)).onEnd=function(){return i.handleTransactionEnd(r)},this._config.events.send("transaction:start",[r]),r},e.handleTransactionEnd=function(t){var e=this;return o.Promise.resolve().then((function(){var n=t.name,r=t.type;if(!e.shouldIgnoreTransaction(n)&&"temporary"!==r){if(r===z){var i=e._config.get("pageLoadTransactionName");n===$&&i&&(t.name=i)}zt(t),e.adjustTransactionTime(t),e._config.get("breakdownMetrics")&&t.captureBreakdown();var o=e._config.get("context");!function(t,e){var n=l(),r={};if(t.type===z&&"function"==typeof performance.getEntriesByType){var i=performance.getEntriesByType("navigation");i&&i.length>0&&(r={response:At(i[0])})}t.addContext(n,r,e)}(t,o),e._config.events.send("transaction:end",[t])}}),(function(t){0}))},e.adjustTransactionTime=function(t){var e=t.spans,n=function(t){for(var e=t[0],n=1;n<t.length;n++){var r=t[n];e._start>r._start&&(e=r)}return e}(e);n&&n._start<t._start&&(t._start=n._start);var r=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n];-1===String(r.type).indexOf("external")&&(!e||e._end<r._end)&&(e=r)}return e}(e);r&&r._end>t._end&&(t._end=r._end);for(var i=t._end,o=0;o<e.length;o++){var a=e[o];a._end>i&&(a._end=i,a.type+=".truncated"),a._start>i&&(a._start=i)}},e.shouldIgnoreTransaction=function(t){var e=this._config.get("ignoreTransactions");if(e&&e.length)for(var n=0;n<e.length;n++){var r=e[n];if("function"==typeof r.test){if(r.test(t))return!0}else if(r===t)return!0}return!1},e.startSpan=function(t,e,n){var r=this.ensureCurrentTransaction(void 0,"temporary",this.createOptions({canReuse:!0,managed:!0}));if(r)return r.startSpan(t,e,n)},e.addTask=function(t){var e=this.ensureCurrentTransaction(void 0,"temporary",this.createOptions({canReuse:!0,managed:!0}));if(e){t=e.addTask(t);0}return t},e.removeTask=function(t){var e=this.getCurrentTransaction();e&&e.removeTask(t)},t}(),$t={PerformanceMonitoring:xt,registerServices:function(t){t.registerServiceCreator("TransactionService",(function(){var e=t.getService("ConfigService"),n=t.getService("LoggingService");return new Ut(n,e)})),t.registerServiceCreator("PerformanceMonitoring",(function(){var e=t.getService("ConfigService"),n=t.getService("LoggingService"),r=t.getService("ApmServer"),i=t.getService("TransactionService");return new xt(r,e,n,i)}))}},Vt=function(){function t(t,e){e||(e={}),this.onFlush=t,this.items=[],this.queueLimit=e.queueLimit||-1,this.flushInterval=e.flushInterval||0,this.timeoutId=void 0}var e=t.prototype;return e._setTimer=function(){var t=this;this.timeoutId=setTimeout((function(){t.flush()}),this.flushInterval)},e.flush=function(){this.onFlush(this.items),this._clear()},e._clear=function(){void 0!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=void 0),this.items=[]},e.add=function(t){this.items.push(t),-1!==this.queueLimit&&this.items.length>=this.queueLimit?this.flush():void 0===this.timeoutId&&this._setTimer()},t}();var Xt=function(t,e,n){var r,i=n.context||this,o=n.limit,a=n.interval,s=n.countFn||function(){},c=0;return function(){var n="function"==typeof s&&s.apply(i,arguments);return"number"!=typeof n&&(n=1),c+=n,void 0===r&&(r=setTimeout((function(){c=0,r=void 0}),a)),c>o?"function"==typeof e?e.apply(i,arguments):void 0:t.apply(i,arguments)}},Jt=function(){function t(){}return t.stringify=function(t){return JSON.stringify(t)+"\n"},t}(),Yt=function(){function t(t,e){this._configService=t,this._loggingService=e,this.errorQueue=void 0,this.transactionQueue=void 0,this.throttleAddError=void 0,this.throttleAddTransaction=void 0,this.initialized=!1}var e=t.prototype;return e.init=function(){this.initialized||(this.initialized=!0,this.initErrorQueue(),this.initTransactionQueue())},e.createMetaData=function(){var t=this._configService,e={service:{name:t.get("serviceName"),version:t.get("serviceVersion"),agent:{name:"js-base",version:t.version},language:{name:"javascript"},environment:t.get("environment")}};return St(ht,e)},e._postJson=function(t,e){return this._makeHttpRequest("POST",t,{payload:e,headers:{"Content-Type":"application/x-ndjson"}}).then((function(t){return t.responseText}))},e._constructError=function(t){var e=t.url,n=t.status;t.responseText;if(void 0===n)return t;var r=e+" HTTP status: "+n;return new Error(r)},e._makeHttpRequest=function(t,e,n){var r=void 0===n?{timeout:1e4}:n,i=r.timeout,a=r.payload,s=r.headers;return new o.Promise((function(n,r){var o=new window.XMLHttpRequest;if(o[A]=!0,o.open(t,e,!0),o.timeout=i,s)for(var c in s)s.hasOwnProperty(c)&&o.setRequestHeader(c,s[c]);o.onreadystatechange=function(){if(4===o.readyState){var t=o.status,i=o.responseText;0===t||t>399&&t<600?r({url:e,status:t,responseText:i}):n(o)}},o.onerror=function(){var t=o.status,n=o.responseText;r({url:e,status:t,responseText:n})},o.send(a)}))},e._createQueue=function(t){var e=this._configService.get("queueLimit"),n=this._configService.get("flushInterval");return new Vt(t,{queueLimit:e,flushInterval:n})},e.fetchConfig=function(t,e){var n=this,r=this._configService.get("serverUrl")+"/config/v1/rum/agents";if(!t)return o.Promise.reject("serviceName is required for fetching central config.");r+="?service.name="+t,e&&(r+="&service.environment="+e);var i=this._configService.getLocalConfig();return i&&(r+="&ifnonematch="+i.etag),this._makeHttpRequest("GET",r,{timeout:5e3}).then((function(t){var e=t.status,r=t.responseText;if(304===e)return i;var o=JSON.parse(r),a=t.getResponseHeader("etag");return a&&(o.etag=a.replace(/["]/g,""),n._configService.setLocalConfig(o)),o})).catch((function(t){var e=n._constructError(t);return o.Promise.reject(e)}))},e.initErrorQueue=function(){var t=this;this.errorQueue&&this.errorQueue.flush(),this.errorQueue=this._createQueue((function(e){var n=t.sendErrors(e);n&&n.catch((function(e){t._loggingService.warn("Failed sending errors!",t._constructError(e))}))}));var e=this._configService.get("errorThrottleLimit"),n=this._configService.get("errorThrottleInterval");this.throttleAddError=Xt(this.errorQueue.add.bind(this.errorQueue),(function(){return t._loggingService.warn("Dropped error due to throttling!")}),{limit:e,interval:n})},e.initTransactionQueue=function(){var t=this;this.transactionQueue&&this.transactionQueue.flush(),this.transactionQueue=this._createQueue((function(e){var n=t.sendTransactions(e);n&&n.catch((function(e){t._loggingService.warn("Failed sending transactions!",t._constructError(e))}))}));var e=this._configService.get("transactionThrottleLimit"),n=this._configService.get("transactionThrottleInterval");this.throttleAddTransaction=Xt(this.transactionQueue.add.bind(this.transactionQueue),(function(){return t._loggingService.warn("Dropped transaction due to throttling!")}),{limit:e,interval:n})},e.addError=function(t){this.errorQueue||this.initErrorQueue(),this.throttleAddError(t)},e.addTransaction=function(t){this.transactionQueue||this.initTransactionQueue(),this.throttleAddTransaction(t)},e.ndjsonErrors=function(t){return t.map((function(t){return Jt.stringify({error:t})}))},e.ndjsonMetricsets=function(t){return t.map((function(t){return Jt.stringify({metricset:t})})).join("")},e.ndjsonTransactions=function(t){var e=this;return t.map((function(t){var n="";t.spans&&(n=t.spans.map((function(t){return Jt.stringify({span:t})})).join(""),delete t.spans);var r="";return t.breakdown&&(r=e.ndjsonMetricsets(t.breakdown),delete t.breakdown),Jt.stringify({transaction:t})+n+r}))},e._send=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e="transaction"),0!==t.length){var n={service:this.createMetaData().service,data:t},r=this._configService.applyFilters(n);if(r){var i;if("errors"===e)i=this.ndjsonErrors(r.data);else{if("transaction"!==e)return void 0;i=this.ndjsonTransactions(r.data)}i.unshift(Jt.stringify({metadata:{service:r.service}}));var o=i.join(""),a=this._configService.get("serverUrl")+"/intake/v2/rum/events";return this._postJson(a,o)}this._loggingService.warn("Dropped payload due to filtering!")}},e.sendTransactions=function(t){return this._send(t)},e.sendErrors=function(t){return this._send(t,"errors")},t}();var Zt=function(){function t(){this.config={},this.defaults={serviceName:"",serviceVersion:"",environment:"",serverUrl:"http://localhost:8200",active:!0,instrument:!0,disableInstrumentations:[],debug:!1,logLevel:"warn",breakdownMetrics:!1,checkBrowserResponsiveness:!0,groupSimilarSpans:!0,similarSpanThreshold:.05,ignoreTransactions:[],errorThrottleLimit:20,errorThrottleInterval:3e4,transactionThrottleLimit:20,transactionThrottleInterval:3e4,transactionDurationThreshold:6e4,queueLimit:-1,flushInterval:500,distributedTracing:!0,distributedTracingOrigins:[],distributedTracingHeaderName:"elastic-apm-traceparent",pageLoadTraceId:"",pageLoadSpanId:"",pageLoadSampled:!1,pageLoadTransactionName:"",transactionSampleRate:1,centralConfig:!1,context:{}},this.events=new rt,this.filters=[],this.version=""}var e=t.prototype;return e.init=function(){var t=function(t){if(!t)return{};for(var e={},n=/^data-([\w-]+)$/,r=t.attributes,i=0;i<r.length;i++){var o=r[i];if(n.test(o.nodeName)){var a=o.nodeName.match(n)[1].split("-").map((function(t,e){return e>0?t.charAt(0).toUpperCase()+t.substring(1):t})).join("");e[a]=o.value||o.nodeValue}}return e}(y());this.setConfig(t)},e.isActive=function(){return this.get("active")},e.setVersion=function(t){this.version=t},e.addFilter=function(t){if("function"!=typeof t)throw new Error("Argument to must be function");this.filters.push(t)},e.applyFilters=function(t){for(var e=0;e<this.filters.length;e++)if(!(t=this.filters[e](t)))return;return t},e.get=function(t){return t.split(".").reduce((function(t,e){return t&&t[e]}),this.config)},e.setUserContext=function(t){void 0===t&&(t={});var e={},n=t,r=n.id,i=n.username,o=n.email;"number"!=typeof r&&"string"!=typeof r||(e.id=r),"string"==typeof i&&(e.username=i),"string"==typeof o&&(e.email=o),this.config.context.user=_(this.config.context.user||{},e)},e.setCustomContext=function(t){void 0===t&&(t={}),this.config.context.custom=_(this.config.context.custom||{},t)},e.addLabels=function(t){var e=this;this.config.context.tags||(this.config.context.tags={}),Object.keys(t).forEach((function(n){return h(n,t[n],e.config.context.tags)}))},e.setConfig=function(t){void 0===t&&(t={}),t.serverUrl&&(t.serverUrl=t.serverUrl.replace(/\/+$/,"")),this.config=S({},this.defaults,this.config,t),this.events.send("config:change",[this.config])},e.validate=function(t){void 0===t&&(t={});var e=["serviceName","serverUrl"],n={missing:[],invalid:[]};Object.keys(t).forEach((function(r){-1===e.indexOf(r)||t[r]||n.missing.push(r)})),t.serviceName&&!/^[a-zA-Z0-9 _-]+$/.test(t.serviceName)&&n.invalid.push({key:"serviceName",value:t.serviceName,allowed:"a-z, A-Z, 0-9, _, -, <space>"});var r=t.transactionSampleRate;return void 0!==r&&("number"!=typeof r||isNaN(r)||r<0||r>1)&&n.invalid.push({key:"transactionSampleRate",value:r,allowed:"Number between 0 and 1"}),n},e.getLocalConfig=function(){var t=sessionStorage.getItem("elastic_apm_config");if(t)return JSON.parse(t)},e.setLocalConfig=function(t){t&&sessionStorage.setItem("elastic_apm_config",JSON.stringify(t))},t}(),Gt=function(){function t(t){void 0===t&&(t={}),this.levels=["trace","debug","info","warn","error"],this.level=t.level||"info",this.prefix=t.prefix||"",this.resetLogMethods()}var e=t.prototype;return e.shouldLog=function(t){return this.levels.indexOf(t)>=this.levels.indexOf(this.level)},e.setLevel=function(t){this.level=t,this.resetLogMethods()},e.resetLogMethods=function(){var t=this;this.levels.forEach((function(e){t[e]=t.shouldLog(e)?function(){var n,r=t.prefix;switch(e){case"trace":case"debug":n="info";break;default:n=e}var i=arguments;r&&(i[0]=r+i[0]);if(console){var o=console[n]||console.log;"function"==typeof o&&o.apply(console,i)}}:w}))},t}(),Kt=function(){function t(){this._serviceCreators={},this._serviceInstances={},this.initialized=!1}var e=t.prototype;return e.registerCoreServices=function(){var t=this;this.registerServiceCreator("ConfigService",(function(){return new Zt})),this.registerServiceCreator("LoggingService",(function(){return new Gt({prefix:"[Elastic APM] "})})),this.registerServiceCreator("ApmServer",(function(){return new Yt(t.getService("ConfigService"),t.getService("LoggingService"))}))},e.init=function(){if(!this.initialized){this.initialized=!0;var t=this.getService("ConfigService");t.init();var e=this.getService("LoggingService");n(e,t),t.events.observe("config:change",(function(){n(e,t)})),this.getService("ApmServer").init()}function n(t,e){var n=e.get("debug"),r=e.get("logLevel");!0===n&&"trace"!==r?t.setLevel("debug"):t.setLevel(r)}},e.registerServiceCreator=function(t,e){this._serviceCreators[t]=e},e.registerServiceInstance=function(t,e){this._serviceInstances[t]=e},e.getService=function(t){if(!this._serviceInstances[t]){if("function"!=typeof this._serviceCreators[t])throw new Error("Can not get service, No creator for: "+t);this._serviceInstances[t]=this._serviceCreators[t](this)}return this._serviceInstances[t]},t}();var Wt=function(){function t(t,e){this._disable=e,this.serviceFactory=t,this._initialized=!1}var e=t.prototype;return e.init=function(t){var e=this;if(this.isEnabled()&&!this._initialized){this._initialized=!0;var n=this.serviceFactory.getService("ConfigService");n.setVersion("4.7.0"),this.config(t);var r=this.serviceFactory.getService("LoggingService");if(n.isActive()){this.serviceFactory.init();var i=function(t,e){var n,r=((n={})[J]=!1,n[Y]=!1,n[Z]=!1,n[z]=!1,n[G]=!1,n);return t?(Object.keys(r).forEach((function(t){-1===e.indexOf(t)&&(r[t]=!0)})),r):r}(n.get("instrument"),n.get("disableInstrumentations"));if(this.serviceFactory.getService("PerformanceMonitoring").init(i),i[G])this.serviceFactory.getService("ErrorLogging").registerListeners();var o=function(){return i[z]&&e._sendPageLoadMetrics()};n.get("centralConfig")?this.fetchCentralConfig().then(o):o()}else this._disable=!0,r.info("RUM agent is inactive")}return this},e.fetchCentralConfig=function(){var t=this.serviceFactory.getService("ApmServer"),e=this.serviceFactory.getService("LoggingService"),n=this.serviceFactory.getService("ConfigService");return t.fetchConfig(n.get("serviceName"),n.get("environment")).then((function(t){var r=t.transaction_sample_rate;if(r){var i={transactionSampleRate:r=Number(r)},o=n.validate(i).invalid;if(0===o.length)n.setConfig(i);else{var a=o[0],s=a.key,c=a.value,u=a.allowed;e.warn('invalid value "'+c+'" for '+s+". Allowed: "+u+".")}}return t})).catch((function(t){e.warn("failed fetching config:",t)}))},e._sendPageLoadMetrics=function(){var t=this.startTransaction(void 0,z,{managed:!0,canReuse:!0});t&&t.addTask(z);var e=function(){setTimeout((function(){t&&t.removeTask(z)}))};"complete"===document.readyState?e():window.addEventListener("load",e)},e.isEnabled=function(){return!this._disable},e.observe=function(t,e){this.serviceFactory.getService("ConfigService").events.observe(t,e)},e.config=function(t){var e=this.serviceFactory.getService("ConfigService"),n=e.validate(t),r=n.missing,i=n.invalid;if(0===r.length&&0===i.length)e.setConfig(t);else{var o=this.serviceFactory.getService("LoggingService"),a="RUM agent isn't correctly configured. ";r.length>0&&(a+=r.join(", ")+" is missing",i.length>0&&(a+=", ")),i.forEach((function(t,e){var n=t.key,r=t.value,o=t.allowed;a+=n+' "'+r+'" contains invalid characters! (allowed: '+o+")"+(e!==i.length-1?", ":"")})),o.error(a),e.setConfig({active:!1})}},e.setUserContext=function(t){this.serviceFactory.getService("ConfigService").setUserContext(t)},e.setCustomContext=function(t){this.serviceFactory.getService("ConfigService").setCustomContext(t)},e.addTags=function(t){this.serviceFactory.getService("LoggingService").warn("addTags deprecated, please use addLabels"),this.addLabels(t)},e.addLabels=function(t){this.serviceFactory.getService("ConfigService").addLabels(t)},e.setInitialPageLoadName=function(t){this.isEnabled()&&this.serviceFactory.getService("ConfigService").setConfig({pageLoadTransactionName:t})},e.startTransaction=function(t,e,n){if(this.isEnabled())return this.serviceFactory.getService("TransactionService").startTransaction(t,e,n)},e.startSpan=function(t,e){if(this.isEnabled())return this.serviceFactory.getService("TransactionService").startSpan(t,e)},e.getCurrentTransaction=function(){if(this.isEnabled())return this.serviceFactory.getService("TransactionService").getCurrentTransaction()},e.captureError=function(t){if(this.isEnabled())return this.serviceFactory.getService("ErrorLogging").logError(t)},e.addFilter=function(t){this.serviceFactory.getService("ConfigService").addFilter(t)},t}();n.d(e,"init",(function(){return ie})),n.d(e,"apmBase",(function(){return re})),n.d(e,"apm",(function(){return re})),n.d(e,"ApmBase",(function(){return Wt}));var te,ee=st?ct:(st=!0,d()?(at(),ct=!0):"undefined"!=typeof window&&console.log("[Elastic APM] platform is not supported!"),ct),ne=((te=new Kt).registerCoreServices(),wt.registerServices(te),$t.registerServices(te),te),re=new Wt(ne,!ee);"undefined"!=typeof window&&(window.elasticApm=re);var ie=re.init.bind(re);e.default=ie}]);
!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=5)}([function(t,e,n){var r;r=function(){"use strict";function t(t){return"function"==typeof t}var e=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=0,r=void 0,i=void 0,o=function(t,e){h[n]=t,h[n+1]=e,2===(n+=2)&&(i?i(v):y())},a="undefined"!=typeof window?window:void 0,s=a||{},c=s.MutationObserver||s.WebKitMutationObserver,u="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),f="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function d(){var t=setTimeout;return function(){return t(v,1)}}var h=new Array(1e3);function v(){for(var t=0;t<n;t+=2)(0,h[t])(h[t+1]),h[t]=void 0,h[t+1]=void 0;n=0}var l,p,g,m,y=void 0;function _(t,e){var n=this,r=new this.constructor(w);void 0===r[b]&&R(r);var i=n._state;if(i){var a=arguments[i-1];o((function(){return j(i,r,a,n._result)}))}else N(n,r,t,e);return r}function S(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(w);return L(e,t),e}u?y=function(){return process.nextTick(v)}:c?(p=0,g=new c(v),m=document.createTextNode(""),g.observe(m,{characterData:!0}),y=function(){m.data=p=++p%2}):f?((l=new MessageChannel).port1.onmessage=v,y=function(){return l.port2.postMessage(0)}):y=void 0===a?function(){try{var t=Function("return this")().require("vertx");return void 0!==(r=t.runOnLoop||t.runOnContext)?function(){r(v)}:d()}catch(t){return d()}}():d();var b=Math.random().toString(36).substring(2);function w(){}var T=void 0,E=1,x=2;function C(e,n,r){n.constructor===e.constructor&&r===_&&n.constructor.resolve===S?function(t,e){e._state===E?I(t,e._result):e._state===x?O(t,e._result):N(e,void 0,(function(e){return L(t,e)}),(function(e){return O(t,e)}))}(e,n):void 0===r?I(e,n):t(r)?function(t,e,n){o((function(t){var r=!1,i=function(t,e,n,r){try{t.call(e,n,r)}catch(t){return t}}(n,e,(function(n){r||(r=!0,e!==n?L(t,n):I(t,n))}),(function(e){r||(r=!0,O(t,e))}),t._label);!r&&i&&(r=!0,O(t,i))}),t)}(e,n,r):I(e,n)}function L(t,e){if(t===e)O(t,new TypeError("You cannot resolve a promise with itself"));else if(i=typeof(r=e),null===r||"object"!==i&&"function"!==i)I(t,e);else{var n=void 0;try{n=e.then}catch(e){return void O(t,e)}C(t,e,n)}var r,i}function k(t){t._onerror&&t._onerror(t._result),A(t)}function I(t,e){t._state===T&&(t._result=e,t._state=E,0!==t._subscribers.length&&o(A,t))}function O(t,e){t._state===T&&(t._state=x,t._result=e,o(k,t))}function N(t,e,n,r){var i=t._subscribers,a=i.length;t._onerror=null,i[a]=e,i[a+E]=n,i[a+x]=r,0===a&&t._state&&o(A,t)}function A(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r=void 0,i=void 0,o=t._result,a=0;a<e.length;a+=3)r=e[a],i=e[a+n],r?j(n,r,i,o):i(o);t._subscribers.length=0}}function j(e,n,r,i){var o=t(r),a=void 0,s=void 0,c=!0;if(o){try{a=r(i)}catch(t){c=!1,s=t}if(n===a)return void O(n,new TypeError("A promises callback cannot return that same promise."))}else a=i;n._state!==T||(o&&c?L(n,a):!1===c?O(n,s):e===E?I(n,a):e===x&&O(n,a))}var F=0;function R(t){t[b]=F++,t._state=void 0,t._result=void 0,t._subscribers=[]}var M=function(){function t(t,n){this._instanceConstructor=t,this.promise=new t(w),this.promise[b]||R(this.promise),e(n)?(this.length=n.length,this._remaining=n.length,this._result=new Array(this.length),0===this.length?I(this.promise,this._result):(this.length=this.length||0,this._enumerate(n),0===this._remaining&&I(this.promise,this._result))):O(this.promise,new Error("Array Methods must be provided an Array"))}return t.prototype._enumerate=function(t){for(var e=0;this._state===T&&e<t.length;e++)this._eachEntry(t[e],e)},t.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===S){var i=void 0,o=void 0,a=!1;try{i=t.then}catch(t){a=!0,o=t}if(i===_&&t._state!==T)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===P){var s=new n(w);a?O(s,o):C(s,t,i),this._willSettleAt(s,e)}else this._willSettleAt(new n((function(e){return e(t)})),e)}else this._willSettleAt(r(t),e)},t.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===T&&(this._remaining--,t===x?O(r,n):this._result[e]=n),0===this._remaining&&I(r,this._result)},t.prototype._willSettleAt=function(t,e){var n=this;N(t,void 0,(function(t){return n._settledAt(E,e,t)}),(function(t){return n._settledAt(x,e,t)}))},t}(),P=function(){function e(t){this[b]=F++,this._result=this._state=void 0,this._subscribers=[],w!==t&&("function"!=typeof t&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof e?function(t,e){try{e((function(e){L(t,e)}),(function(e){O(t,e)}))}catch(e){O(t,e)}}(this,t):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}return e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(e){var n=this.constructor;return t(e)?this.then((function(t){return n.resolve(e()).then((function(){return t}))}),(function(t){return n.resolve(e()).then((function(){throw t}))})):this.then(e,e)},e}();return P.prototype.then=_,P.all=function(t){return new M(this,t).promise},P.race=function(t){var n=this;return e(t)?new n((function(e,r){for(var i=t.length,o=0;o<i;o++)n.resolve(t[o]).then(e,r)})):new n((function(t,e){return e(new TypeError("You must pass an array to race."))}))},P.resolve=S,P.reject=function(t){var e=new this(w);return O(e,t),e},P._setScheduler=function(t){i=t},P._setAsap=function(t){o=t},P._asap=o,P.polyfill=function(){var t=void 0;if("undefined"!=typeof global)t=global;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(t){throw new Error("polyfill failed because global object is unavailable in this environment")}var e=t.Promise;if(e){var n=null;try{n=Object.prototype.toString.call(e.resolve())}catch(t){}if("[object Promise]"===n&&!e.cast)return}t.Promise=P},P.Promise=P,P},t.exports=r()},function(t,e){var n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(n){var r=new Uint8Array(16);t.exports=function(){return n(r),r}}else{var i=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),i[e]=t>>>((3&e)<<3)&255;return i}}},function(t,e,n){var r,i,o;!function(a,s){"use strict";i=[n(4)],void 0===(o="function"==typeof(r=function(t){var e=/(^|@)\S+\:\d+/,n=/^\s*at .*(\S+\:\d+|\(native\))/m,r=/^(eval@)?(\[native code\])?$/;function i(t,e,n){if("function"==typeof Array.prototype.map)return t.map(e,n);for(var r=new Array(t.length),i=0;i<t.length;i++)r[i]=e.call(n,t[i]);return r}function o(t,e,n){if("function"==typeof Array.prototype.filter)return t.filter(e,n);for(var r=[],i=0;i<t.length;i++)e.call(n,t[i])&&r.push(t[i]);return r}return{parse:function(t){if(void 0!==t.stacktrace||void 0!==t["opera#sourceloc"])return this.parseOpera(t);if(t.stack&&t.stack.match(n))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")},extractLocation:function(t){if(-1===t.indexOf(":"))return[t];var e=/(.+?)(?:\:(\d+))?(?:\:(\d+))?$/.exec(t.replace(/[\(\)]/g,""));return[e[1],e[2]||void 0,e[3]||void 0]},parseV8OrIE:function(e){return i(o(e.stack.split("\n"),(function(t){return!!t.match(n)}),this),(function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var n=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),r=this.extractLocation(n.pop()),i=n.join(" ")||void 0,o=function(t,e){if("function"==typeof Array.prototype.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}(["eval","<anonymous>"],r[0])>-1?void 0:r[0];return new t(i,void 0,o,r[1],r[2],e)}),this)},parseFFOrSafari:function(e){return i(o(e.stack.split("\n"),(function(t){return!t.match(r)}),this),(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new t(e);var n=e.split("@"),r=this.extractLocation(n.pop()),i=n.join("@")||void 0;return new t(i,void 0,r[0],r[1],r[2],e)}),this)},parseOpera:function(t){return!t.stacktrace||t.message.indexOf("\n")>-1&&t.message.split("\n").length>t.stacktrace.split("\n").length?this.parseOpera9(t):t.stack?this.parseOpera11(t):this.parseOpera10(t)},parseOpera9:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)/i,r=e.message.split("\n"),i=[],o=2,a=r.length;o<a;o+=2){var s=n.exec(r[o]);s&&i.push(new t(void 0,void 0,s[2],s[1],void 0,r[o]))}return i},parseOpera10:function(e){for(var n=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,r=e.stacktrace.split("\n"),i=[],o=0,a=r.length;o<a;o+=2){var s=n.exec(r[o]);s&&i.push(new t(s[3]||void 0,void 0,s[2],s[1],void 0,r[o]))}return i},parseOpera11:function(n){return i(o(n.stack.split("\n"),(function(t){return!!t.match(e)&&!t.match(/^Error created at/)}),this),(function(e){var n,r=e.split("@"),i=this.extractLocation(r.pop()),o=r.shift()||"",a=o.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^\)]*\)/g,"")||void 0;o.match(/\(([^\)]*)\)/)&&(n=o.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var s=void 0===n||"[arguments not available]"===n?void 0:n.split(",");return new t(a,s,i[0],i[1],i[2],e)}),this)}}})?r.apply(e,i):r)||(t.exports=o)}()},,function(t,e,n){var r,i,o;!function(n,a){"use strict";i=[],void 0===(o="function"==typeof(r=function(){function t(t){return!isNaN(parseFloat(t))&&isFinite(t)}function e(t,e,n,r,i,o){void 0!==t&&this.setFunctionName(t),void 0!==e&&this.setArgs(e),void 0!==n&&this.setFileName(n),void 0!==r&&this.setLineNumber(r),void 0!==i&&this.setColumnNumber(i),void 0!==o&&this.setSource(o)}return e.prototype={getFunctionName:function(){return this.functionName},setFunctionName:function(t){this.functionName=String(t)},getArgs:function(){return this.args},setArgs:function(t){if("[object Array]"!==Object.prototype.toString.call(t))throw new TypeError("Args must be an Array");this.args=t},getFileName:function(){return this.fileName},setFileName:function(t){this.fileName=String(t)},getLineNumber:function(){return this.lineNumber},setLineNumber:function(e){if(!t(e))throw new TypeError("Line Number must be a Number");this.lineNumber=Number(e)},getColumnNumber:function(){return this.columnNumber},setColumnNumber:function(e){if(!t(e))throw new TypeError("Column Number must be a Number");this.columnNumber=Number(e)},getSource:function(){return this.source},setSource:function(t){this.source=String(t)},toString:function(){return(this.getFunctionName()||"{anonymous}")+("("+(this.getArgs()||[]).join(",")+")")+(this.getFileName()?"@"+this.getFileName():"")+(t(this.getLineNumber())?":"+this.getLineNumber():"")+(t(this.getColumnNumber())?":"+this.getColumnNumber():"")}},e})?r.apply(e,i):r)||(t.exports=o)}()},function(t,e,n){"use strict";n.r(e);var r=n(1),i=n.n(r),o=n(0),a=[].slice;for(var s=[],c=0;c<256;++c)s[c]=(c+256).toString(16).substr(1);function u(t,e){var n=!1;return"string"==typeof e?n=t===e:Array.isArray(e)&&e.forEach((function(e){n||(n=u(t,e))})),n}function f(t){var e,n,r,o;return(e=i()(),r=n||0,[(o=s)[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]],o[e[r++]]].join("")).substr(0,t)}function d(){return"undefined"!=typeof window&&"function"==typeof Array.prototype.forEach&&"function"==typeof JSON.stringify&&"function"==typeof Function.bind&&window.performance&&"function"==typeof window.performance.now&&"withCredentials"in new window.XMLHttpRequest}function h(t,e,n){if(n&&t){var r=T(t);return e&&(e=String(e)),n[r]=e,n}}var v=["fetchStart","domainLookupStart","domainLookupEnd","connectStart","connectEnd","secureConnectionStart","requestStart","responseStart","responseEnd","domLoading","domInteractive","domContentLoadedEventStart","domContentLoadedEventEnd","domComplete","loadEventStart","loadEventEnd"];function l(){return{page:{referer:document.referrer,url:window.location.href}}}function p(t){return t&&t.split("?")[0]}function g(t){return null!==t&&"object"==typeof t}function m(t,e,n){for(var r=0,i=e.length;r<i;++r){var o=e[r];if(g(o)||"function"==typeof o)for(var a=Object.keys(o),s=0,c=a.length;s<c;s++){var u=a[s],f=o[u];n&&g(f)?(g(t[u])||(t[u]=Array.isArray(f)?[]:{}),m(t[u],[f],!1)):t[u]=f}}return t}function y(){if("undefined"!=typeof document){var t=document.currentScript;return t||function(){if("undefined"!=typeof document)for(var t=document.getElementsByTagName("script"),e=0,n=t.length;e<n;e++){var r=t[e];if(r.src.indexOf("elastic")>0)return r}}()}}function _(t){return m(t,a.call(arguments,1),!1)}function S(t){return m(t,a.call(arguments,1),!0)}function b(t){return void 0===t}function w(){}function T(t){return t.replace(/[.*"]/g,"_")}function E(){var t=function(){var t=window.performance.timing,e=t.fetchStart,n={};return v.forEach((function(r){var i=t[r];i&&i>=e&&(n[r]=i-e)})),n}(),e=function(){var t={},e=window.performance;if("function"==typeof e.getEntriesByType){var n=e.getEntriesByType("paint");if(n.length>0)for(var r=e.timing,i=r.fetchStart-r.navigationStart,o=0;o<n.length;o++){var a=n[o],s=i>=0?a.startTime-i:a.startTime;t[a.name]=s}}return t}(),n={timeToFirstByte:t.responseStart,domInteractive:t.domInteractive,domComplete:t.domComplete};return e["first-contentful-paint"]&&(n.firstContentfulPaint=e["first-contentful-paint"]),{navigationTiming:t,agent:n}}function x(){return window.performance.now()}function C(t){return"number"==typeof t&&t>=0?t:x()}function L(t,e){return b(e)||b(t)?null:parseFloat(e-t)}function k(t){o.Promise.resolve().then(t)}var I={fetchInProgress:!1};function O(t){return"__apm_symbol__"+t}function N(t,e,n){for(var r=t;r&&!r.hasOwnProperty(e);)r=Object.getPrototypeOf(r);!r&&t[e]&&(r=t);var i,o,a,s,c=O(e);if(r&&!(i=r[c])){i=r[c]=r[e];var u=r&&Object.getOwnPropertyDescriptor(r,e);if(!(s=u)||!1!==s.writable&&("function"!=typeof s.get||void 0!==s.set)){var f=n(i,c,e);r[e]=function(){return f(this,arguments)},o=r[e],a=i,o[O("OriginalDelegate")]=a}}return i}var A=O("xhrIgnore"),j=O("xhrSync"),F=O("xhrURL"),R=O("xhrMethod"),M="schedule",P="invoke",q="clear",D="addEventListener",H="removeEventListener",B=["link","css","script","img","xmlhttprequest","fetch","beacon","iframe"],Q=3e5,z="page-load",U="custom",$="Unknown",V=[z,"route-change","http-request",U,"temporary"],X=60,J="xmlhttprequest",Y="fetch",Z="history",G="error",K=1024,W=O("xhrTask"),tt=O("xhrListener"),et=O("xhrScheduled");function nt(t){var e=XMLHttpRequest.prototype,n=e[D],r=e[H];if(!n){var i=window.XMLHttpRequestEventTarget;if(i){var o=i.prototype;n=o[D],r=o[H]}}var a="readystatechange",s="load";function c(e){e.state=P,t(P,e)}function u(e){XMLHttpRequest[et]=!1,e.state=M,t(M,e);var i=e.data,o=i.aborted,u=i.target;n||(n=u[D],r=u[H]);var f,d=u[tt];d&&(r.call(u,a,d),r.call(u,s,d));var h=u[tt]=function(t){var n=t.type;f?f!=n&&function(t){setTimeout(t,0)}((function(){e.state!==P&&c(e)})):u.readyState===u.DONE&&!o&&XMLHttpRequest[et]&&e.state===M&&(f=n)};n.call(u,a,h),n.call(u,s,h),u[W]||(u[W]=e)}var f=N(e,"open",(function(){return function(t,e){return t[A]||(t[R]=e[0],t[F]=e[1],t[j]=!1===e[2]),f.apply(t,e)}})),d=N(e,"send",(function(){return function(t,e){if(t[A])return d.apply(t,e);var n={source:J,state:"",type:"macroTask",data:{target:t,method:t[R],sync:t[j],url:t[F],aborted:!1}};u(n);var r=d.apply(t,e);return XMLHttpRequest[et]=!0,t[j]&&c(n),r}})),h=N(e,"abort",(function(){return function(e,n){if(!e[A]){var r=e[W];if(r&&"string"==typeof r.type){if(r.data&&r.data.aborted)return;!function(e){e.state=q,t(q,e),e.data.aborted=!0}(r)}}return h.apply(e,n)}}))}var rt=function(){function t(){this.observers={}}var e=t.prototype;return e.observe=function(t,e){var n=this;if("function"==typeof e)return this.observers[t]||(this.observers[t]=[]),this.observers[t].push(e),function(){var r=n.observers[t].indexOf(e);r>-1&&n.observers[t].splice(r,1)}},e.sendOnly=function(t,e){var n=this.observers[t];n&&n.forEach((function(t){try{t.apply(void 0,e)}catch(t){console.log(t,t.stack)}}))},e.send=function(t,e){this.sendOnly(t+":before",e),this.sendOnly(t,e),this.sendOnly(t+":after",e)},t}(),it=new rt,ot=!1;function at(){return ot||(ot=!0,nt((function(t,e){it.send(J,[t,e])})),function(t){if(window.fetch&&window.Request){var e=window.fetch;window.fetch=function(t,i){var a,s,c=this,u=arguments;if("string"==typeof t)a=new Request(t,i),s=t;else{if(!t)return e.apply(c,u);s=(a=t).url}var f={source:Y,state:"",type:"macroTask",data:{target:a,method:a.method,sync:!1,url:s,aborted:!1}};return new o.Promise((function(t,i){var o;I.fetchInProgress=!0,n(f);try{o=e.apply(c,[a])}catch(t){return i(t),f.data.error=t,r(f),void(I.fetchInProgress=!1)}o.then((function(e){t(e),k((function(){f.data.response=e,r(f)}))}),(function(t){i(t),k((function(){f.data.error=t,r(f)}))})),I.fetchInProgress=!1}))}}function n(e){e.state=M,t(M,e)}function r(e){e.state=P,t(P,e)}}((function(t,e){it.send(Y,[t,e])})),function(t){if(window.history){var e=history.pushState;"function"==typeof e&&(history.pushState=function(n,r,i){var o={source:Z,data:{state:n,title:r,url:i}};t(P,o),e.apply(this,arguments)})}}((function(t,e){it.send(Z,[t,e])}))),it}var st=!1,ct=!1;var ut=n(2),ft=n.n(ut);function dt(t){var e=t.error,n=t.filename,r=t.lineno,i=t.colno,o=[];if(e)try{o=ft.a.parse(e)}catch(t){}return 0===o.length&&(o=[{fileName:n,lineNumber:r,columnNumber:i}]),o.map((function(t){return t.functionName&&(t.functionName=(e=t.functionName,n=e.split("/"),e=(e=(e=n.length>1?["Object",n[n.length-1]].join("."):n[0]).replace(/.<$/gi,".<anonymous>")).replace(/^Anonymous function$/,"<anonymous>"),e=(n=e.split(".")).length>1?n[n.length-1]:n[0])),t;var e,n})).map((function(t){var e=t.fileName,n=t.lineNumber,r=t.columnNumber,i=t.functionName,o=void 0===i?"<anonymous>":i;if(!e&&!n)return{};if(!r&&!n)return{};var a,s,c=function(t){return void 0===t&&(t=""),"<anonymous>"===t&&(t=""),t}(e),u=(a=c,s=window.location.origin||window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),a.indexOf(s)>-1&&(a=a.replace(s+"/","")),a);return function(t){return!!t&&0===window.location.href.indexOf(t)}(c)&&(u="(inline script)"),{abs_path:e,filename:u,function:o,lineno:n,colno:r}}))}var ht={service:{name:[K,!0],version:!0,agent:{version:[K,!0]},environment:!0}},vt={"*":!0,headers:{"*":!0}},lt={user:{id:!0,email:!0,username:!0},tags:{"*":!0},http:{response:vt},destination:{address:[K],service:{"*":[K,!0]}},response:vt},pt={name:[K,!0],type:[K,!0],id:[K,!0],trace_id:[K,!0],parent_id:[K,!0],transaction_id:[K,!0],subtype:!0,action:!0,context:lt},gt={name:!0,parent_id:!0,type:[K,!0],id:[K,!0],trace_id:[K,!0],span_count:{started:[K,!0]},context:lt},mt={id:[K,!0],trace_id:!0,transaction_id:!0,parent_id:!0,culprit:!0,exception:{type:!0},transaction:{type:!0},context:lt};function yt(t){return null==t||""===t||void 0===t}function _t(t,e,n){var r=function(t,e,n,r){return void 0===e&&(e=K),void 0===n&&(n=!1),void 0===r&&(r="N/A"),n&&yt(t)&&(t=r),"string"==typeof t?t.substring(0,e):t}(t[e],n[0],n[1]);yt(r)?delete t[e]:t[e]=r}function St(t,e,n){void 0===t&&(t={}),void 0===n&&(n=e);for(var r=Object.keys(t),i=[],o=function(o){var a=r[o],s=!0===t[a]?i:t[a];Array.isArray(s)?"*"===a?Object.keys(n).forEach((function(t){return _t(n,t,s)})):_t(n,a,s):St(s,e,n[a])},a=0;a<r.length;a++)o(a);return e}var bt=["stack","message"];var wt=function(){function t(t,e,n){this._apmServer=t,this._configService=e,this._transactionService=n}var e=t.prototype;return e.createErrorDataModel=function(t){var e=function(t){return t.filter((function(t){var e=t.filename,n=t.lineno;return void 0!==e&&void 0!==n}))}(dt(t)),n="(inline script)",r=e[e.length-1];r&&r.filename&&(n=r.filename);var i=t.message,o=t.error,a=i,s="",c={};if(o&&"object"==typeof o){a=a||o.message,s=o.name;var u=function(t){var e=!1,n={};if(Object.keys(t).forEach((function(r){if(!(bt.indexOf(r)>=0)){var i=t[r];if(null!=i&&"function"!=typeof i){if("object"==typeof i){if("function"!=typeof i.toISOString)return;i=i.toISOString()}n[r]=i,e=!0}}})),e)return n}(o);u&&(c.custom=u)}s||a&&a.indexOf(":")>-1&&(s=a.split(":")[0]);var d=this._transactionService.getCurrentTransaction(),h=d?d.context:{},v=this._configService.get("context"),p=S({},l(),h,v,c),g={id:f(),culprit:n,exception:{message:a,stacktrace:e,type:s},context:p};return d&&(g=_(g,{trace_id:d.traceId,parent_id:d.id,transaction_id:d.id,transaction:{type:d.type,sampled:d.sampled}})),St(mt,g)},e.logErrorEvent=function(t,e){if(void 0!==t){var n=this.createErrorDataModel(t);if(void 0!==n.exception.message)return e?this._apmServer.sendErrors([n]):this._apmServer.addError(n)}},e.registerListeners=function(){var t=this;window.addEventListener("error",(function(e){return t.logErrorEvent(e)})),window.addEventListener("unhandledrejection",(function(e){return t.logPromiseEvent(e)}))},e.logPromiseEvent=function(t){var e="Unhandled promise rejection: ",n=t.reason;null==n?this.logError(e+"<no reason specified>"):"string"==typeof n.message?this.logError({message:e+n.message,stack:n.stack?n.stack:null}):"object"!=typeof n&&this.logError(e+n)},e.logError=function(t){var e={};return"string"==typeof t?e.message=t:e.error=t,this.logErrorEvent(e)},t}(),Tt={ErrorLogging:wt,registerServices:function(t){t.registerServiceCreator("ErrorLogging",(function(){var e=t.getService("ApmServer"),n=t.getService("ConfigService"),r=t.getService("TransactionService");return new wt(e,n,r)}))}};var Et=[["#","hash"],["?","query"],["/","path"],["@","auth",1],[NaN,"host",void 0,1]],xt=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,Ct=function(){function t(t){var e,n=this.extractProtocol(t||""),r=n.protocol,i=n.address,o=n.slashes,a=!r&&!o,s=this.getLocation(),c=Et.slice();i=i.replace("\\","/"),o||(c[2]=[NaN,"path"]);for(var u=0;u<c.length;u++){var f=c[u],d=f[0],h=f[1];if("string"==typeof d){if(~(e=i.indexOf(d))){var v=f[2];if(v){var l=i.lastIndexOf(d);e=Math.max(e,l),this[h]=i.slice(0,e),i=i.slice(e+v)}else this[h]=i.slice(e),i=i.slice(0,e)}}else this[h]=i,i="";this[h]=this[h]||a&&f[3]&&s[h]||"",f[3]&&(this[h]=this[h].toLowerCase())}if(a&&"/"!==this.path.charAt(0)&&(this.path="/"+this.path),this.relative=a,this.protocol=r||s.protocol,this.hostname=this.host,this.port="",/:\d+$/.test(this.host)){var p=this.host.split(":"),g=p.pop(),m=p.join(":");!function(t,e){switch(e){case"http:":return"80"===t;case"https:":return"443"===t}return!0}(g,this.protocol)?this.port=g:this.host=m,this.hostname=m}this.origin=this.protocol&&this.host&&"file:"!==this.protocol?this.protocol+"//"+this.host:"null",this.href=this.toString()}var e=t.prototype;return e.toString=function(){var t=this.protocol;if(t+="//",this.auth){var e=this.auth.split(":");t+=(e[0]?"[REDACTED]":"")+(e[1]?":[REDACTED]":"")+"@"}return t+=this.host,t+=this.path,t+=this.query,t+=this.hash},e.getLocation=function(){var t={};return"undefined"!=typeof window&&(t=window),t.location},e.extractProtocol=function(t){var e=xt.exec(t);return{protocol:e[1]?e[1].toLowerCase():"",slashes:!!e[2],address:e[3]}},t}(),Lt=function(){function t(t,e,n,r){this._apmServer=t,this._configService=e,this._logginService=n,this._transactionService=r}var e=t.prototype;return e.init=function(t){var e=this;void 0===t&&(t={}),this._configService.events.observe("transaction:end:after",(function(t){var n=e.createTransactionPayload(t);n&&e._apmServer.addTransaction(n)})),t[Z]&&it.observe(Z,this.getHistorySub()),t[J]&&it.observe(J,this.getXHRSub()),t[Y]&&it.observe(Y,this.getFetchSub())},e.getHistorySub=function(){var t=this._transactionService;return function(e,n){n.source===Z&&e===P&&t.startTransaction(n.data.title,"route-change",{managed:!0,canReuse:!0})}},e.getXHRSub=function(){var t=this;return function(e,n){n.source!==J||I.fetchInProgress||t.processAPICalls(e,n)}},e.getFetchSub=function(){var t=this;return function(e,n){n.source===Y&&t.processAPICalls(e,n)}},e.processAPICalls=function(t,e){var n=this._configService,r=this._transactionService;if(t===M&&e.data){var i=e.data,o=new Ct(i.url),a=i.method+" "+(o.relative?o.path:p(o.href));r.getCurrentTransaction()||r.startTransaction(a,"http-request",{managed:!0});var s=r.startSpan(a,"external.http"),c=r.addTask();if(!s)return;var f=n.get("distributedTracing"),d=n.get("distributedTracingOrigins"),h=new Ct(window.location.href),v=u(o.origin,h.origin)||u(o.origin,d),l=i.target;f&&v&&l&&this.injectDtHeader(s,l),s.sync=i.sync,i.span=s,e.id=c}else t===P&&(e.data&&e.data.span&&e.data.span.end(null,e.data),e.id&&r.removeTask(e.id))},e.injectDtHeader=function(t,e){var n,r=this._configService.get("distributedTracingHeaderName"),i=function(t){if(t&&t.traceId&&t.id&&t.parentId){var e=t.sampled?"01":"00",n=t.sampled?t.id:t.parentId;return"00-"+t.traceId+"-"+n+"-"+e}}(t),o=/^[\da-f]{2}-[\da-f]{32}-[\da-f]{16}-[\da-f]{2}$/.test(n=i)&&"00000000000000000000000000000000"!==n.slice(3,35)&&"0000000000000000"!==n.slice(36,52);r&&i&&o&&("function"==typeof e.setRequestHeader?e.setRequestHeader(r,i):e.headers&&"function"==typeof e.headers.append?e.headers.append(r,i):e[r]=i)},e.extractDtHeader=function(t){var e=this._configService.get("distributedTracingHeaderName");if(t)return function(t){var e=/^([\da-f]{2})-([\da-f]{32})-([\da-f]{16})-([\da-f]{2})$/.exec(t);if(e){var n="00"!==e[4];return{traceId:e[2],id:e[3],sampled:n}}}(t[e])},e.filterTransaction=function(t){var e=this._configService.get("transactionDurationThreshold"),n=t.duration();if(!n)return!1;if(n>e)return!1;if((t.sampled||t.resetSpans(),t.options.checkBrowserResponsiveness)&&!this.checkBrowserResponsiveness(t,500,3))return!1;return!0},e.prepareTransaction=function(t){t.spans.sort((function(t,e){return t._start-e._start})),this._configService.get("groupSimilarSpans")&&(t.spans=this.groupSmallContinuouslySimilarSpans(t,.05)),t.spans=t.spans.filter((function(e){return e.duration()>0&&e._start>=t._start&&e._end<=t._end}))},e.createTransactionDataModel=function(t){var e=t._start,n=t.spans.map((function(n){var r={id:n.id,transaction_id:t.id,parent_id:n.parentId||t.id,trace_id:t.traceId,name:n.name,type:n.type,subType:n.subType,action:n.action,sync:n.sync,start:n._start-e,duration:n.duration(),context:n.context};return St(pt,r)})),r={id:t.id,trace_id:t.traceId,name:t.name,type:t.type,duration:t.duration(),spans:n,context:t.context,marks:t.marks,breakdown:t.breakdownTimings,span_count:{started:n.length},sampled:t.sampled};return St(gt,r)},e.createTransactionPayload=function(t){if(this.prepareTransaction(t),this.filterTransaction(t))return this.createTransactionDataModel(t)},e.convertTransactionsToServerModel=function(t){var e=this;return t.map((function(t){return e.createTransactionDataModel(t)}))},e.groupSmallContinuouslySimilarSpans=function(t,e){var n=t.duration(),r=[],i=1;return t.spans.forEach((function(o,a){if(0===r.length)r.push(o);else{var s=r[r.length-1],c=s.type===o.type&&s.subType===o.subType&&s.action===o.action&&s.name===o.name&&o.duration()/n<e&&(o._start-s._end)/n<e,u=t.spans.length===a+1;c&&(i++,s._end=o._end),i>1&&(!c||u)&&(s.name=i+"x "+s.name,i=1),c||r.push(o)}})),r},e.checkBrowserResponsiveness=function(t,e,n){var r=t.browserResponsivenessCounter,i=t.duration();return r+n>=Math.floor(i/e)},t}(),kt=function(){function t(t,e,n){void 0===n&&(n={}),t||(t=$),e||(e=U),this.name=t,this.type=e,this.options=n,this.id=n.id||f(16),this.traceId=n.traceId,this.sampled=n.sampled,this.timestamp=n.timestamp,this._start=C(n.startTime),this._end=void 0,this.ended=!1,this.onEnd=n.onEnd}var e=t.prototype;return e.ensureContext=function(){this.context||(this.context={})},e.addTags=function(t){console.warn("addTags deprecated, please use addLabels"),this.addLabels(t)},e.addLabels=function(t){this.ensureContext();var e=this.context;e.tags||(e.tags={}),Object.keys(t).forEach((function(n){return h(n,t[n],e.tags)}))},e.addContext=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];0!==e.length&&(this.ensureContext(),S.apply(void 0,[this.context].concat(e)))},e.end=function(t){this.ended||(this.ended=!0,this._end=C(t),this.callOnEnd())},e.callOnEnd=function(){"function"==typeof this.onEnd&&this.onEnd(this)},e.duration=function(){return L(this._start,this._end)},t}(),It=91,Ot=93,Nt="external",At="resource";function jt(t){var e={transfer_size:t.transferSize,encoded_body_size:t.encodedBodySize,decoded_body_size:t.decodedBodySize},n=function(t){void 0===t&&(t=[]);for(var e=[],n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.duration,a=r.description,s=i;a&&(s+=";desc="+a),o&&(s+=";dur="+o),e.push(s)}return e.join(", ")}(t.serverTiming);return n&&(e.headers={"server-timing":n}),e}function Ft(t,e){var n=t.port,r=t.protocol,i=t.hostname,o=t.host,a=function(t,e){return""===t&&(t="http:"===e?"80":"https:"===e?"443":""),t}(n,r),s=i.charCodeAt(0)===It&&i.charCodeAt(i.length-1)===Ot,c=i;return s&&(c=i.slice(1,-1)),{service:{name:r+"//"+o,resource:i+":"+a,type:e},address:c,port:Number(a)}}function Rt(t,e){if(e){var n;switch(t.type){case Nt:n=function(t){var e,n=t.url,r=t.method,i=t.target,o=t.response,a=new Ct(n),s=Ft(a,Nt),c={http:{method:r,url:a.href},destination:s};return i&&void 0!==i.status?e=i.status:o&&(e=o.status),c.http.status_code=e,c}(e);break;case At:n=function(t){var e=t.entry,n=t.url,r=Ft(new Ct(n),At);return{http:{url:n,response:jt(e)},destination:r}}(e)}t.addContext(n)}}var Mt=function(t){var e,n;function r(e,n,r){var i;if((i=t.call(this,e,n,r)||this).parentId=i.options.parentId,i.subType=void 0,i.action=void 0,-1!==i.type.indexOf(".")){var o=i.type.split(".",3);i.type=o[0],i.subType=o[1],i.action=o[2]}return i.sync=i.options.sync,i}return n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n,r.prototype.end=function(e,n){t.prototype.end.call(this,e),Rt(this,n)},r}(kt),Pt=[["domainLookupStart","domainLookupEnd","DNS"],["connectStart","connectEnd","TCP"],["requestStart","responseStart","Request"],["responseStart","responseEnd","Response"],["domLoading","domComplete","Processing"],["loadEventStart","loadEventEnd","Load"]];function qt(t){return{value:t}}function Dt(t,e){var n=e.details,r=e.count,i=void 0===r?1:r,o=e.duration;return{transaction:t,span:n,samples:{"span.self_time.count":qt(i),"span.self_time.sum.us":qt(o)}}}var Ht=function(t){var e,n;function r(e,n,r){var i;return(i=t.call(this,e,n,r)||this).traceId=f(),i.marks=void 0,i.spans=[],i._activeSpans={},i.nextAutoTaskId=1,i._scheduledTasks=[],i.captureTimings=!1,i.breakdownTimings=[],i.sampled=Math.random()<=i.options.transactionSampleRate,i.browserResponsivenessCounter=0,i}n=t,(e=r).prototype=Object.create(n.prototype),e.prototype.constructor=e,e.__proto__=n;var i=r.prototype;return i.addMarks=function(t){this.marks=S(this.marks||{},t)},i.mark=function(t){var e=T(t),n=x()-this._start,r={};r[e]=n,this.addMarks({custom:r})},i.canReuse=function(t){return void 0===t&&(t=5e3),!!this.options.canReuse&&!this.ended&&x()-this._start<t},i.redefine=function(t,e,n){t&&(this.name=t),e&&(this.type=e),n&&(this.options=_(this.options,n))},i.startSpan=function(t,e,n){var r=this;if(!this.ended){var i=_({},n);i.onEnd=function(t){r._onSpanEnd(t)},i.traceId=this.traceId,i.sampled=this.sampled,i.parentId||(i.parentId=this.id);var o=new Mt(t,e,i);return this._activeSpans[o.id]=o,o}},i.isFinished=function(){return 0===this._scheduledTasks.length},i.detectFinish=function(){this.isFinished()&&this.end()},i.end=function(t){if(!this.ended){for(var e in this.ended=!0,this._end=C(t),this._activeSpans){var n=this._activeSpans[e];n.type=n.type+".truncated",n.end(t)}this.callOnEnd()}},i.captureBreakdown=function(){this.breakdownTimings=function(t,e){void 0===e&&(e=window.performance.timing);var n=[],r=t.duration(),i=t.name,o=t.type,a=t.sampled,s={name:i,type:o};if(n.push({transaction:s,samples:{"transaction.duration.count":qt(1),"transaction.duration.sum.us":qt(r),"transaction.breakdown.count":qt(a?1:0)}}),!a)return n;if(o===z&&e)for(var c=0;c<Pt.length;c++){var u=Pt[c],f=L(e[u[0]],e[u[1]]);0!==f&&null!=f&&n.push(Dt(s,{details:{type:u[2]},duration:f}))}else{var d=function(t){var e={},n=function(t){var e=t.spans,n=t._start,r=t._end;if(0===e.length)return t.duration();e.sort((function(t,e){return t._start-e._start}));for(var i=e[0],o=i._end,a=i._start,s=o,c=a-n,u=1;u<e.length;u++)a=(i=e[u])._start,o=i._end,a>s?(c+=a-s,s=o):o>s&&(s=o);return s<r&&(c+=r-s),c}(t);e.app={count:1,duration:n};for(var r=t.spans,i=0;i<r.length;i++){var o=r[i],a=o.duration();if(0!==a&&null!=a){var s=o.type,c=o.subType,u=s;c&&(u+="."+c),e[u]||(e[u]={duration:0,count:0}),e[u].count++,e[u].duration+=a}}return e}(t);Object.keys(d).forEach((function(t){var e=t.split("."),r=e[0],i=e[1],o=d[t],a=o.duration,c=o.count;n.push(Dt(s,{details:{type:r,subtype:i},duration:a,count:c}))}))}return n}(this)},i.addTask=function(t){if(void 0===t&&(t="task"+this.nextAutoTaskId++),-1==this._scheduledTasks.indexOf(t))return this._scheduledTasks.push(t),t},i.removeTask=function(t){var e=this._scheduledTasks.indexOf(t);e>-1&&this._scheduledTasks.splice(e,1),this.detectFinish()},i.resetSpans=function(){this.spans=[]},i._onSpanEnd=function(t){this.spans.push(t),delete this._activeSpans[t.id]},r}(kt),Bt=[["domainLookupStart","domainLookupEnd","Domain lookup"],["connectStart","connectEnd","Making a connection to the server"],["requestStart","responseEnd","Requesting and receiving the document"],["domLoading","domInteractive","Parsing the document, executing sync. scripts"],["domContentLoadedEventStart","domContentLoadedEventEnd",'Fire "DOMContentLoaded" event'],["loadEventStart","loadEventEnd",'Fire "load" event']];function Qt(t,e,n,r,i){return void 0===i&&(i=0),"number"==typeof t&&"number"==typeof e&&t>=i&&e>t&&t-i>=n&&e-i<=r&&e-t<Q&&t-i<Q&&e-i<Q}function zt(t){var e=t.name,n=t.initiatorType,r=t.startTime,i=t.responseEnd,o="resource";n&&(o+="."+n);var a=p(e),s=new Mt(a,o);return s._start=r,s.end(i,{url:e,entry:t}),s}function Ut(t){if(t.captureTimings){var e=window.performance,n=t._end;if(t.type===z){if(t.marks&&t.marks.custom){var r=t.marks.custom;Object.keys(r).forEach((function(e){r[e]+=t._start}))}t._start=0;var i=e.timing;(function(t,e,n,r){for(var i=[],o=0;o<Bt.length;o++){var a=t[Bt[o][0]],s=t[Bt[o][1]];if(Qt(a,s,n,r,e)){var c=new Mt(Bt[o][2],"hard-navigation.browser-timing");"requestStart"===Bt[o][0]&&(c.pageResponse=!0),c._start=a-e,c.end(s-e),i.push(c)}}return i})(i,i.fetchStart,0,n).forEach((function(e){e.traceId=t.traceId,e.sampled=t.sampled,e.pageResponse&&t.options.pageLoadSpanId&&(e.id=t.options.pageLoadSpanId),t.spans.push(e)})),t.addMarks(E())}if("function"==typeof e.getEntriesByType){var o=t._start;(function(t,e,n,r){for(var i=[],o=0;o<t.length;o++){var a=t[o],s=a.initiatorType,c=a.name,u=a.startTime,f=a.responseEnd;if("xmlhttprequest"!==s&&"fetch"!==s&&c)if(-1!==B.indexOf(s)){if(!Qt(u,f,n,r))continue;i.push(zt(t[o]))}else{if(null!=s)continue;for(var d=!1,h=0;h<e.length;h++){var v=c.lastIndexOf(e[h]);if(v>-1&&v===c.length-e[h].length){d=!0;break}}!d&&Qt(u,f,n,r)&&i.push(zt(t[o]))}}return i})(e.getEntriesByType("resource"),function(t){for(var e=t.spans,n=[],r=0;r<e.length;r++){var i=e[r];"external"===i.type&&"http"===i.subType||n.push(i.name.split(" ")[1])}return n}(t),o,n).forEach((function(e){return t.spans.push(e)})),function(t,e,n){for(var r=[],i=0;i<t.length;i++){var o=t[i],a=o.name,s=o.startTime,c=o.duration,u=s+c;if(!(c<=X)&&Qt(s,u,e,n)){var f=new Mt(a,"app");f._start=s,f.end(u),r.push(f)}}return r}(e.getEntriesByType("measure"),o,n).forEach((function(e){return t.spans.push(e)}))}}}var $t=function(){function t(t,e){this._config=e,this._logger=t,this.currentTransaction=void 0,this.respIntervalId=void 0}var e=t.prototype;return e.ensureCurrentTransaction=function(t,e,n){var r=this.getCurrentTransaction();return r||(r=new Ht(t,e,n),this.setCurrentTransaction(r),r)},e.getCurrentTransaction=function(){if(this.currentTransaction&&!this.currentTransaction.ended)return this.currentTransaction},e.setCurrentTransaction=function(t){this.currentTransaction=t},e.ensureRespInterval=function(t){var e=this,n=function(){clearInterval(e.respIntervalId),e.respIntervalId=void 0};t?void 0===this.respIntervalId&&(this.respIntervalId=setInterval((function(){var t=e.getCurrentTransaction();t?t.browserResponsivenessCounter++:n()}),500)):void 0!==this.respIntervalId&&n()},e.createOptions=function(t){var e=this._config.config,n=_({transactionSampleRate:e.transactionSampleRate},t);return n.managed&&(n=_({pageLoadTraceId:e.pageLoadTraceId,pageLoadSampled:e.pageLoadSampled,pageLoadSpanId:e.pageLoadSpanId,pageLoadTransactionName:e.pageLoadTransactionName,checkBrowserResponsiveness:e.checkBrowserResponsiveness},n)),n},e.startManagedTransaction=function(t,e,n){var r=this.getCurrentTransaction();if(r)if(r.canReuse()&&n.canReuse){var i;0;var o=V.indexOf(r.type),a=V.indexOf(e);-1!==o&&-1!==a&&a<o&&(i=e),r.redefine(t,i,n)}else r.end(),r=this.ensureCurrentTransaction(t,e,n);else r=this.ensureCurrentTransaction(t,e,n);return r.type===z&&(r.options.checkBrowserResponsiveness=!1,n.pageLoadTraceId&&(r.traceId=n.pageLoadTraceId),n.pageLoadSampled&&(r.sampled=n.pageLoadSampled),r.name===$&&n.pageLoadTransactionName&&(r.name=n.pageLoadTransactionName)),r.sampled&&(r.captureTimings=!0),this.ensureRespInterval(r.options.checkBrowserResponsiveness),r},e.startTransaction=function(t,e,n){var r,i=this,o=this.createOptions(n),a=!0;o.managed?this.currentTransaction===(r=this.startManagedTransaction(t,e,o))&&(a=!1):r=new Ht(t,e,o);return r.onEnd=function(){return i.handleTransactionEnd(r)},a&&this._config.events.send("transaction:start",[r]),r},e.handleTransactionEnd=function(t){var e=this;return o.Promise.resolve().then((function(){var n=t.name,r=t.type;if(!e.shouldIgnoreTransaction(n)&&"temporary"!==r){if(r===z){var i=e._config.get("pageLoadTransactionName");n===$&&i&&(t.name=i)}Ut(t),e.adjustTransactionTime(t),e._config.get("breakdownMetrics")&&t.captureBreakdown();var o=e._config.get("context");!function(t,e){var n=l(),r={};if(t.type===z&&"function"==typeof performance.getEntriesByType){var i=performance.getEntriesByType("navigation");i&&i.length>0&&(r={response:jt(i[0])})}t.addContext(n,r,e)}(t,o),e._config.events.send("transaction:end",[t])}}),(function(t){0}))},e.adjustTransactionTime=function(t){var e=t.spans,n=function(t){for(var e=t[0],n=1;n<t.length;n++){var r=t[n];e._start>r._start&&(e=r)}return e}(e);n&&n._start<t._start&&(t._start=n._start);var r=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n];-1===String(r.type).indexOf("external")&&(!e||e._end<r._end)&&(e=r)}return e}(e);r&&r._end>t._end&&(t._end=r._end);for(var i=t._end,o=0;o<e.length;o++){var a=e[o];a._end>i&&(a._end=i,a.type+=".truncated"),a._start>i&&(a._start=i)}},e.shouldIgnoreTransaction=function(t){var e=this._config.get("ignoreTransactions");if(e&&e.length)for(var n=0;n<e.length;n++){var r=e[n];if("function"==typeof r.test){if(r.test(t))return!0}else if(r===t)return!0}return!1},e.startSpan=function(t,e,n){var r=this.ensureCurrentTransaction(void 0,"temporary",this.createOptions({canReuse:!0,managed:!0}));if(r)return r.startSpan(t,e,n)},e.addTask=function(t){var e=this.ensureCurrentTransaction(void 0,"temporary",this.createOptions({canReuse:!0,managed:!0}));if(e){t=e.addTask(t);0}return t},e.removeTask=function(t){var e=this.getCurrentTransaction();e&&e.removeTask(t)},t}(),Vt={PerformanceMonitoring:Lt,registerServices:function(t){t.registerServiceCreator("TransactionService",(function(){var e=t.getService("ConfigService"),n=t.getService("LoggingService");return new $t(n,e)})),t.registerServiceCreator("PerformanceMonitoring",(function(){var e=t.getService("ConfigService"),n=t.getService("LoggingService"),r=t.getService("ApmServer"),i=t.getService("TransactionService");return new Lt(r,e,n,i)}))}},Xt=function(){function t(t,e){e||(e={}),this.onFlush=t,this.items=[],this.queueLimit=e.queueLimit||-1,this.flushInterval=e.flushInterval||0,this.timeoutId=void 0}var e=t.prototype;return e._setTimer=function(){var t=this;this.timeoutId=setTimeout((function(){t.flush()}),this.flushInterval)},e.flush=function(){this.onFlush(this.items),this._clear()},e._clear=function(){void 0!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=void 0),this.items=[]},e.add=function(t){this.items.push(t),-1!==this.queueLimit&&this.items.length>=this.queueLimit?this.flush():void 0===this.timeoutId&&this._setTimer()},t}();var Jt=function(t,e,n){var r,i=n.context||this,o=n.limit,a=n.interval,s=n.countFn||function(){},c=0;return function(){var n="function"==typeof s&&s.apply(i,arguments);return"number"!=typeof n&&(n=1),c+=n,void 0===r&&(r=setTimeout((function(){c=0,r=void 0}),a)),c>o?"function"==typeof e?e.apply(i,arguments):void 0:t.apply(i,arguments)}},Yt=function(){function t(){}return t.stringify=function(t){return JSON.stringify(t)+"\n"},t}(),Zt=function(){function t(t,e){this._configService=t,this._loggingService=e,this.errorQueue=void 0,this.transactionQueue=void 0,this.throttleAddError=void 0,this.throttleAddTransaction=void 0,this.initialized=!1}var e=t.prototype;return e.init=function(){this.initialized||(this.initialized=!0,this.initErrorQueue(),this.initTransactionQueue())},e.createMetaData=function(){var t=this._configService,e={service:{name:t.get("serviceName"),version:t.get("serviceVersion"),agent:{name:"js-base",version:t.version},language:{name:"javascript"},environment:t.get("environment")}};return St(ht,e)},e._postJson=function(t,e){return this._makeHttpRequest("POST",t,{payload:e,headers:{"Content-Type":"application/x-ndjson"}}).then((function(t){return t.responseText}))},e._constructError=function(t){var e=t.url,n=t.status;t.responseText;if(void 0===n)return t;var r=e+" HTTP status: "+n;return new Error(r)},e._makeHttpRequest=function(t,e,n){var r=void 0===n?{timeout:1e4}:n,i=r.timeout,a=r.payload,s=r.headers;return new o.Promise((function(n,r){var o=new window.XMLHttpRequest;if(o[A]=!0,o.open(t,e,!0),o.timeout=i,s)for(var c in s)s.hasOwnProperty(c)&&o.setRequestHeader(c,s[c]);o.onreadystatechange=function(){if(4===o.readyState){var t=o.status,i=o.responseText;0===t||t>399&&t<600?r({url:e,status:t,responseText:i}):n(o)}},o.onerror=function(){var t=o.status,n=o.responseText;r({url:e,status:t,responseText:n})},o.send(a)}))},e._createQueue=function(t){var e=this._configService.get("queueLimit"),n=this._configService.get("flushInterval");return new Xt(t,{queueLimit:e,flushInterval:n})},e.fetchConfig=function(t,e){var n=this,r=this._configService.get("serverUrl")+"/config/v1/rum/agents";if(!t)return o.Promise.reject("serviceName is required for fetching central config.");r+="?service.name="+t,e&&(r+="&service.environment="+e);var i=this._configService.getLocalConfig();return i&&(r+="&ifnonematch="+i.etag),this._makeHttpRequest("GET",r,{timeout:5e3}).then((function(t){var e=t.status,r=t.responseText;if(304===e)return i;var o=JSON.parse(r),a=t.getResponseHeader("etag");return a&&(o.etag=a.replace(/["]/g,""),n._configService.setLocalConfig(o)),o})).catch((function(t){var e=n._constructError(t);return o.Promise.reject(e)}))},e.initErrorQueue=function(){var t=this;this.errorQueue&&this.errorQueue.flush(),this.errorQueue=this._createQueue((function(e){var n=t.sendErrors(e);n&&n.catch((function(e){t._loggingService.warn("Failed sending errors!",t._constructError(e))}))}));var e=this._configService.get("errorThrottleLimit"),n=this._configService.get("errorThrottleInterval");this.throttleAddError=Jt(this.errorQueue.add.bind(this.errorQueue),(function(){return t._loggingService.warn("Dropped error due to throttling!")}),{limit:e,interval:n})},e.initTransactionQueue=function(){var t=this;this.transactionQueue&&this.transactionQueue.flush(),this.transactionQueue=this._createQueue((function(e){var n=t.sendTransactions(e);n&&n.catch((function(e){t._loggingService.warn("Failed sending transactions!",t._constructError(e))}))}));var e=this._configService.get("transactionThrottleLimit"),n=this._configService.get("transactionThrottleInterval");this.throttleAddTransaction=Jt(this.transactionQueue.add.bind(this.transactionQueue),(function(){return t._loggingService.warn("Dropped transaction due to throttling!")}),{limit:e,interval:n})},e.addError=function(t){this.errorQueue||this.initErrorQueue(),this.throttleAddError(t)},e.addTransaction=function(t){this.transactionQueue||this.initTransactionQueue(),this.throttleAddTransaction(t)},e.ndjsonErrors=function(t){return t.map((function(t){return Yt.stringify({error:t})}))},e.ndjsonMetricsets=function(t){return t.map((function(t){return Yt.stringify({metricset:t})})).join("")},e.ndjsonTransactions=function(t){var e=this;return t.map((function(t){var n="";t.spans&&(n=t.spans.map((function(t){return Yt.stringify({span:t})})).join(""),delete t.spans);var r="";return t.breakdown&&(r=e.ndjsonMetricsets(t.breakdown),delete t.breakdown),Yt.stringify({transaction:t})+n+r}))},e._send=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e="transaction"),0!==t.length){var n={service:this.createMetaData().service,data:t},r=this._configService.applyFilters(n);if(r){var i;if("errors"===e)i=this.ndjsonErrors(r.data);else{if("transaction"!==e)return void 0;i=this.ndjsonTransactions(r.data)}i.unshift(Yt.stringify({metadata:{service:r.service}}));var o=i.join(""),a=this._configService.get("serverUrl")+"/intake/v2/rum/events";return this._postJson(a,o)}this._loggingService.warn("Dropped payload due to filtering!")}},e.sendTransactions=function(t){return this._send(t)},e.sendErrors=function(t){return this._send(t,"errors")},t}();var Gt=function(){function t(){this.config={},this.defaults={serviceName:"",serviceVersion:"",environment:"",serverUrl:"http://localhost:8200",active:!0,instrument:!0,disableInstrumentations:[],debug:!1,logLevel:"warn",breakdownMetrics:!1,checkBrowserResponsiveness:!0,groupSimilarSpans:!0,similarSpanThreshold:.05,ignoreTransactions:[],errorThrottleLimit:20,errorThrottleInterval:3e4,transactionThrottleLimit:20,transactionThrottleInterval:3e4,transactionDurationThreshold:6e4,queueLimit:-1,flushInterval:500,distributedTracing:!0,distributedTracingOrigins:[],distributedTracingHeaderName:"elastic-apm-traceparent",pageLoadTraceId:"",pageLoadSpanId:"",pageLoadSampled:!1,pageLoadTransactionName:"",transactionSampleRate:1,centralConfig:!1,context:{}},this.events=new rt,this.filters=[],this.version=""}var e=t.prototype;return e.init=function(){var t=function(t){if(!t)return{};for(var e={},n=/^data-([\w-]+)$/,r=t.attributes,i=0;i<r.length;i++){var o=r[i];if(n.test(o.nodeName)){var a=o.nodeName.match(n)[1].split("-").map((function(t,e){return e>0?t.charAt(0).toUpperCase()+t.substring(1):t})).join("");e[a]=o.value||o.nodeValue}}return e}(y());this.setConfig(t)},e.isActive=function(){return this.get("active")},e.setVersion=function(t){this.version=t},e.addFilter=function(t){if("function"!=typeof t)throw new Error("Argument to must be function");this.filters.push(t)},e.applyFilters=function(t){for(var e=0;e<this.filters.length;e++)if(!(t=this.filters[e](t)))return;return t},e.get=function(t){return t.split(".").reduce((function(t,e){return t&&t[e]}),this.config)},e.setUserContext=function(t){void 0===t&&(t={});var e={},n=t,r=n.id,i=n.username,o=n.email;"number"!=typeof r&&"string"!=typeof r||(e.id=r),"string"==typeof i&&(e.username=i),"string"==typeof o&&(e.email=o),this.config.context.user=_(this.config.context.user||{},e)},e.setCustomContext=function(t){void 0===t&&(t={}),this.config.context.custom=_(this.config.context.custom||{},t)},e.addLabels=function(t){var e=this;this.config.context.tags||(this.config.context.tags={}),Object.keys(t).forEach((function(n){return h(n,t[n],e.config.context.tags)}))},e.setConfig=function(t){void 0===t&&(t={}),t.serverUrl&&(t.serverUrl=t.serverUrl.replace(/\/+$/,"")),this.config=S({},this.defaults,this.config,t),this.events.send("config:change",[this.config])},e.validate=function(t){void 0===t&&(t={});var e=["serviceName","serverUrl"],n={missing:[],invalid:[]};Object.keys(t).forEach((function(r){-1===e.indexOf(r)||t[r]||n.missing.push(r)})),t.serviceName&&!/^[a-zA-Z0-9 _-]+$/.test(t.serviceName)&&n.invalid.push({key:"serviceName",value:t.serviceName,allowed:"a-z, A-Z, 0-9, _, -, <space>"});var r=t.transactionSampleRate;return void 0!==r&&("number"!=typeof r||isNaN(r)||r<0||r>1)&&n.invalid.push({key:"transactionSampleRate",value:r,allowed:"Number between 0 and 1"}),n},e.getLocalConfig=function(){var t=sessionStorage.getItem("elastic_apm_config");if(t)return JSON.parse(t)},e.setLocalConfig=function(t){t&&sessionStorage.setItem("elastic_apm_config",JSON.stringify(t))},t}(),Kt=function(){function t(t){void 0===t&&(t={}),this.levels=["trace","debug","info","warn","error"],this.level=t.level||"info",this.prefix=t.prefix||"",this.resetLogMethods()}var e=t.prototype;return e.shouldLog=function(t){return this.levels.indexOf(t)>=this.levels.indexOf(this.level)},e.setLevel=function(t){this.level=t,this.resetLogMethods()},e.resetLogMethods=function(){var t=this;this.levels.forEach((function(e){t[e]=t.shouldLog(e)?function(){var n,r=t.prefix;switch(e){case"trace":case"debug":n="info";break;default:n=e}var i=arguments;r&&(i[0]=r+i[0]);if(console){var o=console[n]||console.log;"function"==typeof o&&o.apply(console,i)}}:w}))},t}(),Wt=function(){function t(){this._serviceCreators={},this._serviceInstances={},this.initialized=!1}var e=t.prototype;return e.registerCoreServices=function(){var t=this;this.registerServiceCreator("ConfigService",(function(){return new Gt})),this.registerServiceCreator("LoggingService",(function(){return new Kt({prefix:"[Elastic APM] "})})),this.registerServiceCreator("ApmServer",(function(){return new Zt(t.getService("ConfigService"),t.getService("LoggingService"))}))},e.init=function(){if(!this.initialized){this.initialized=!0;var t=this.getService("ConfigService");t.init();var e=this.getService("LoggingService");n(e,t),t.events.observe("config:change",(function(){n(e,t)})),this.getService("ApmServer").init()}function n(t,e){var n=e.get("debug"),r=e.get("logLevel");!0===n&&"trace"!==r?t.setLevel("debug"):t.setLevel(r)}},e.registerServiceCreator=function(t,e){this._serviceCreators[t]=e},e.registerServiceInstance=function(t,e){this._serviceInstances[t]=e},e.getService=function(t){if(!this._serviceInstances[t]){if("function"!=typeof this._serviceCreators[t])throw new Error("Can not get service, No creator for: "+t);this._serviceInstances[t]=this._serviceCreators[t](this)}return this._serviceInstances[t]},t}();var te=function(){function t(t,e){this._disable=e,this.serviceFactory=t,this._initialized=!1}var e=t.prototype;return e.init=function(t){var e=this;if(this.isEnabled()&&!this._initialized){this._initialized=!0;var n=this.serviceFactory.getService("ConfigService");n.setVersion("4.7.1"),this.config(t);var r=this.serviceFactory.getService("LoggingService");if(n.isActive()){this.serviceFactory.init();var i=function(t,e){var n,r=((n={})[J]=!1,n[Y]=!1,n[Z]=!1,n[z]=!1,n[G]=!1,n);return t?(Object.keys(r).forEach((function(t){-1===e.indexOf(t)&&(r[t]=!0)})),r):r}(n.get("instrument"),n.get("disableInstrumentations"));if(this.serviceFactory.getService("PerformanceMonitoring").init(i),i[G])this.serviceFactory.getService("ErrorLogging").registerListeners();var o=function(){return i[z]&&e._sendPageLoadMetrics()};n.get("centralConfig")?this.fetchCentralConfig().then(o):o()}else this._disable=!0,r.info("RUM agent is inactive")}return this},e.fetchCentralConfig=function(){var t=this.serviceFactory.getService("ApmServer"),e=this.serviceFactory.getService("LoggingService"),n=this.serviceFactory.getService("ConfigService");return t.fetchConfig(n.get("serviceName"),n.get("environment")).then((function(t){var r=t.transaction_sample_rate;if(r){var i={transactionSampleRate:r=Number(r)},o=n.validate(i).invalid;if(0===o.length)n.setConfig(i);else{var a=o[0],s=a.key,c=a.value,u=a.allowed;e.warn('invalid value "'+c+'" for '+s+". Allowed: "+u+".")}}return t})).catch((function(t){e.warn("failed fetching config:",t)}))},e._sendPageLoadMetrics=function(){var t=this.startTransaction(void 0,z,{managed:!0,canReuse:!0});t&&t.addTask(z);var e=function(){setTimeout((function(){t&&t.removeTask(z)}))};"complete"===document.readyState?e():window.addEventListener("load",e)},e.isEnabled=function(){return!this._disable},e.observe=function(t,e){this.serviceFactory.getService("ConfigService").events.observe(t,e)},e.config=function(t){var e=this.serviceFactory.getService("ConfigService"),n=e.validate(t),r=n.missing,i=n.invalid;if(0===r.length&&0===i.length)e.setConfig(t);else{var o=this.serviceFactory.getService("LoggingService"),a="RUM agent isn't correctly configured. ";r.length>0&&(a+=r.join(", ")+" is missing",i.length>0&&(a+=", ")),i.forEach((function(t,e){var n=t.key,r=t.value,o=t.allowed;a+=n+' "'+r+'" contains invalid characters! (allowed: '+o+")"+(e!==i.length-1?", ":"")})),o.error(a),e.setConfig({active:!1})}},e.setUserContext=function(t){this.serviceFactory.getService("ConfigService").setUserContext(t)},e.setCustomContext=function(t){this.serviceFactory.getService("ConfigService").setCustomContext(t)},e.addTags=function(t){this.serviceFactory.getService("LoggingService").warn("addTags deprecated, please use addLabels"),this.addLabels(t)},e.addLabels=function(t){this.serviceFactory.getService("ConfigService").addLabels(t)},e.setInitialPageLoadName=function(t){this.isEnabled()&&this.serviceFactory.getService("ConfigService").setConfig({pageLoadTransactionName:t})},e.startTransaction=function(t,e,n){if(this.isEnabled())return this.serviceFactory.getService("TransactionService").startTransaction(t,e,n)},e.startSpan=function(t,e){if(this.isEnabled())return this.serviceFactory.getService("TransactionService").startSpan(t,e)},e.getCurrentTransaction=function(){if(this.isEnabled())return this.serviceFactory.getService("TransactionService").getCurrentTransaction()},e.captureError=function(t){if(this.isEnabled())return this.serviceFactory.getService("ErrorLogging").logError(t)},e.addFilter=function(t){this.serviceFactory.getService("ConfigService").addFilter(t)},t}();n.d(e,"init",(function(){return oe})),n.d(e,"apmBase",(function(){return ie})),n.d(e,"apm",(function(){return ie})),n.d(e,"ApmBase",(function(){return te}));var ee,ne=st?ct:(st=!0,d()?(at(),ct=!0):"undefined"!=typeof window&&console.log("[Elastic APM] platform is not supported!"),ct),re=((ee=new Wt).registerCoreServices(),Tt.registerServices(ee),Vt.registerServices(ee),ee),ie=new te(re,!ne);"undefined"!=typeof window&&(window.elasticApm=ie);var oe=ie.init.bind(ie);e.default=oe}]);
//# sourceMappingURL=elastic-apm-rum.umd.min.js.map

@@ -18,3 +18,3 @@ import { getInstrumentationFlags, PAGE_LOAD, ERROR } from '@elastic/apm-rum-core';

var configService = this.serviceFactory.getService('ConfigService');
configService.setVersion('4.7.0');
configService.setVersion('4.7.1');
this.config(config);

@@ -21,0 +21,0 @@ var loggingService = this.serviceFactory.getService('LoggingService');

@@ -23,3 +23,3 @@ "use strict";

var configService = this.serviceFactory.getService('ConfigService');
configService.setVersion('4.7.0');
configService.setVersion('4.7.1');
this.config(config);

@@ -26,0 +26,0 @@ var loggingService = this.serviceFactory.getService('LoggingService');

{
"name": "@elastic/apm-rum",
"version": "4.7.0",
"version": "4.7.1",
"description": "Elastic APM JavaScript agent",

@@ -49,3 +49,3 @@ "main": "dist/lib/index.js",

"dependencies": {
"@elastic/apm-rum-core": "^4.8.0"
"@elastic/apm-rum-core": "^4.8.1"
},

@@ -62,3 +62,3 @@ "bundlesize": [

],
"gitHead": "08b142a7571d7d1c3beec2909bf6170dbb1eef4e"
"gitHead": "e1dc73702055ceabd1b39dc7ab94f6da8df36c87"
}

@@ -46,3 +46,3 @@ /**

*/
configService.setVersion('4.7.0')
configService.setVersion('4.7.1')
this.config(config)

@@ -49,0 +49,0 @@ const loggingService = this.serviceFactory.getService('LoggingService')

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc