Socket
Socket
Sign inDemoInstall

@datadog/browser-rum

Package Overview
Dependencies
Maintainers
1
Versions
251
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/browser-rum - npm Package Compare versions

Comparing version 1.25.2 to 1.25.4

2

bundle/datadog-rum.js

@@ -1,1 +0,1 @@

!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){"use strict";n.r(t),n.d(t,"datadogRum",(function(){return Gn})),n.d(t,"makeRumGlobal",(function(){return qn}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function i(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}function o(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r}var a,u,s,c,f=1e3,d=60*f,l=60*d;function p(e,t,n){var r,i=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing,a=!1,u=!1;return{throttled:function(){var n=this;a?u=!0:(i?e.apply(this):u=!0,a=!0,r=window.setTimeout((function(){o&&u&&e.apply(n),a=!1,u=!1}),t))},cancel:function(){window.clearTimeout(r),a=!1,u=!1}}}function E(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,E)}function m(e){return 0!==e&&100*Math.random()<=e}function v(e){return"number"!=typeof e?e:+(1e6*e).toFixed(0)}function T(){}function h(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];g(e)&&(r=[!0,e.toJSON],delete e.toJSON);var i,o,a=[!1,void 0];"object"==typeof e&&g(i=Object.getPrototypeOf(e))&&(a=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(e,void 0,n)}catch(e){o="<error: unable to serialize object>"}finally{r[0]&&(e.toJSON=r[1]),a[0]&&(i.toJSON=a[1])}return o}function g(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function y(e,t){return-1!==e.indexOf(t)}function b(e){return C(e)&&e>=0&&e<=100}function C(e){return"number"==typeof e}function _(e){return Math.floor(R()+e)}function R(){return void 0===c&&(c=performance.timing.navigationStart),c}function O(e){return Object.keys(e).map((function(t){return[t,e[t]]}))}function S(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}function w(e,t){var n=e.match("(?:^|;)\\s*"+t+"\\s*=\\s*([^;]+)");return n?n[1]:void 0}!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.VISIBILITY_CHANGE="visibilitychange",e.DOM_CONTENT_LOADED="DOMContentLoaded"}(a||(a={})),function(e){e.DOCUMENT="document",e.XHR="xhr",e.BEACON="beacon",e.FETCH="fetch",e.CSS="css",e.JS="js",e.IMAGE="image",e.FONT="font",e.MEDIA="media",e.OTHER="other"}(u||(u={})),function(e){e.FETCH="fetch",e.XHR="xhr"}(s||(s={}));var A,I,L=f;function N(e,t,n,r){var i=new Date;i.setTime(i.getTime()+n);var o="expires="+i.toUTCString(),a=r&&r.crossSite?"none":"strict",u=r&&r.domain?";domain="+r.domain:"",s=r&&r.secure?";secure":"";document.cookie=e+"="+t+";"+o+";path=/;samesite="+a+u+s}function D(e){return w(document.cookie,e)}function x(e){return V(e,S(window.location)).href}function M(e,t){return U(e)===U(t)}function U(e){return S(V(e))}function k(e){var t=V(e).pathname;return"/"===t[0]?t:"/"+t}function V(e,t){if(function(){if(void 0!==I)return I;try{var e=new URL("http://test/path");return I="http://test/path"===e.href}catch(e){I=!1}return I}())return void 0!==t?new URL(e,t):new URL(e);if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '"+e+"'");var n=document,r=n.createElement("a");if(void 0!==t){var i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=t,n.head.appendChild(i),n.body.appendChild(r)}return r.href=e,r}var B={allowedTracingOrigins:[],maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,requestErrorResponseLengthLimit:32768,flushTimeout:30*f,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function P(e){var t={};return t.secure=function(e){return!!e.useSecureSessionCookie||!!e.useCrossSiteSessionCookie}(e),t.crossSite=!!e.useCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===A){for(var e="dd_site_test_"+E(),t=window.location.hostname.split("."),n=t.pop();t.length&&!D(e);)n=t.pop()+"."+n,N(e,"test",f,{domain:n});A=n}return A}()),t}function W(e,t,n){var r="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),i=e+"-http-intake.logs."+t.site,o=t.proxyHost?t.proxyHost:i,a=t.proxyHost?"ddhost="+i+"&":"",u=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+a+"ddsource="+(n||"browser")+"&ddtags="+r;return"https://"+o+"/v1/input/"+t.clientToken+"?"+u}function H(e,t){return-1!==k(e).indexOf("/v1/input/")&&(M(e,t.logsEndpoint)||M(e,t.rumEndpoint)||M(e,t.traceEndpoint)||!!t.internalMonitoringEndpoint&&M(e,t.internalMonitoringEndpoint)||!!t.replica&&(M(e,t.replica.logsEndpoint)||M(e,t.replica.rumEndpoint)||M(e,t.replica.internalMonitoringEndpoint)))}function j(e){var t={};return Object.keys(e).forEach((function(n){var r;t[(r=n,r.replace(/[A-Z]/g,(function(e,t){return(0!==t?"_":"")+e.toLowerCase()})).replace(/-/g,"_"))]=function e(t){if(Array.isArray(t))return t.map((function(t){return e(t)}));if("object"==typeof t&&null!==t)return j(t);return t}(e[n])})),t}var F,G=function(e){return Array.isArray(e)},q=function(e){return!Array.isArray(e)&&"object"==typeof e&&null!==e};function z(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o=i[r];null!=o&&(e=Y(e,o,$()))}return e}function K(e){return Y(void 0,e,$())}function $(){if("undefined"!=typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}function Y(e,t,n){if(void 0===t)return e;if(!q(t)&&!G(t))return t;if(!n.hasAlreadyBeenSeen(t)){if(q(t)&&(void 0===e||q(e))){var r=e||{};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=Y(r[i],t[i],n));return r}if(G(t)&&(void 0===e||G(e))){(r=e||[]).length=Math.max(r.length,t.length);for(var o=0;o<t.length;o+=1)r[o]=Y(r[o],t[o],n);return r}return t}}function X(e,t,n){return e&&(void 0!==e.message||t instanceof Error)?{message:e.message||"Empty message",stack:J(e),type:e.name}:{message:n+" "+h(t),stack:"No stack, consider using an instance of Error",type:e&&e.name}}function J(e){var t=(e.name||"Error")+": "+e.message;return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",i=e.line?":"+e.line:"",o=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+i+o})),t}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger",e.CUSTOM="custom"}(F||(F={}));var Q=/[^\u0000-\u007F]/,Z=function(){function e(e,t,n){void 0===n&&(n=!1),this.endpointUrl=e,this.bytesLimit=t,this.withBatchTime=n}return e.prototype.send=function(e,t){var n=this.withBatchTime?function(e){return e+(-1===e.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl;if(navigator.sendBeacon&&t<this.bytesLimit&&navigator.sendBeacon(n,e))return;var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(e)},e}();var ee=function(){function e(e,t,n,r,i,o){void 0===o&&(o=T),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=i,this.beforeUnloadCallback=o,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.flush=function(){if(0!==this.bufferMessageCount){var e=o(this.pushOnlyBuffer,(t=this.upsertBuffer,n=[],Object.keys(t).forEach((function(e){n.push(t[e])})),n));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var t,n},e.prototype.sizeInBytes=function(e){return Q.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},e.prototype.addOrUpdate=function(e,t){var n=this.process(e),r=n.processedMessage,i=n.messageBytesSize;i>=this.maxMessageSize?console.warn("Discarded a message whose size was bigger than the maximum allowed size "+this.maxMessageSize+"KB."):(this.hasMessageFor(t)&&this.remove(t),this.willReachedBytesLimitWith(i)&&this.flush(),this.push(r,i,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=h(e);return{processedMessage:t,messageBytesSize:this.sizeInBytes(t)}},e.prototype.push=function(e,t,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesSize+=t,this.bufferMessageCount+=1},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.sizeInBytes(t);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e.prototype.willReachedBytesLimitWith=function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},e.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},e.prototype.flushPeriodically=function(){var e=this;setTimeout((function(){e.flush(),e.flushPeriodically()}),this.flushTimeout)},e.prototype.flushOnVisibilityHidden=function(){var e=this;navigator.sendBeacon&&(window.addEventListener(a.BEFORE_UNLOAD,le(this.beforeUnloadCallback)),document.addEventListener(a.VISIBILITY_CHANGE,le((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(a.BEFORE_UNLOAD,le((function(){return e.flush()}))))},e}(),te="?",ne=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function re(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ie,oe=function(){var e,t,n,r,i,o,a=[];function u(e,t,n){var r;for(var i in a)if(re(a,i))try{a[i](e,t,n)}catch(e){r=e}if(r)throw r}function s(e,r,i,o,a){if(t)ae.augmentStackTraceWithInitialElement(t,r,i,""+e),f();else if(a)u(ae(a),!0,a);else{var s,c={url:r,column:o,line:i},d=e;if("[object String]"==={}.toString.call(e)){var l=d.match(ne);l&&(s=l[1],d=l[2])}u({name:s,message:d,stack:[c]},!0)}return!!n&&n.apply(this,arguments)}function c(e){var t=e.reason||"Empty reason";u(ae(t),!0,t)}function f(){var n=t,r=e;t=void 0,e=void 0,u(n,!1,r)}function d(n){if(t){if(e===n)return;f()}var r=ae(n);throw t=r,e=n,setTimeout((function(){e===n&&f()}),r.incomplete?2e3:0),n}return d.subscribe=function(e){!function(){if(r)return;n=window.onerror,window.onerror=le(s),r=!0}(),function(){if(o)return;i=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=le(c),o=!0}(),a.push(e)},d.unsubscribe=function(e){for(var t=a.length-1;t>=0;t-=1)a[t]===e&&a.splice(t,1);0===a.length&&(r&&(window.onerror=n,r=!1),o&&(window.onunhandledrejection=i,o=!1))},d.traceKitWindowOnError=s,d}(),ae=function(){var e=!1;function t(e){if(e.stack){for(var t,n,r,i,o=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,s=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=e.stack.split("\n"),d=[],l=0,p=f.length;l<p;l+=1){if(o.exec(f[l])){var E=(r=o.exec(f[l]))[2]&&0===r[2].indexOf("native");t=r[2]&&0===r[2].indexOf("eval"),n=c.exec(r[2]),t&&n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3]),i={args:E?[r[2]]:[],column:r[4]?+r[4]:void 0,func:r[1]||te,line:r[3]?+r[3]:void 0,url:E?void 0:r[2]}}else if(u.exec(f[l]))i={args:[],column:(r=u.exec(f[l]))[4]?+r[4]:void 0,func:r[1]||te,line:+r[3],url:r[2]};else{if(!a.exec(f[l]))continue;t=(r=a.exec(f[l]))[3]&&r[3].indexOf(" > eval")>-1,n=s.exec(r[3]),t&&n?(r[3]=n[1],r[4]=n[2],r[5]=void 0):0!==l||r[5]||void 0===e.columnNumber||(d[0].column=e.columnNumber+1),i={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||te,line:r[4]?+r[4]:void 0,url:r[3]}}!i.func&&i.line&&(i.func=te),d.push(i)}if(d.length)return{stack:d,message:e.message,name:e.name}}}function n(e,t,n,r){var i={url:t,line:n?+n:void 0};if(i.url&&i.line){e.incomplete=!1;var o=e.stack;if(o.length>0&&o[0].url===i.url){if(o[0].line===i.line)return!1;if(!o[0].line&&o[0].func===i.func)return o[0].line=i.line,o[0].context=i.context,!1}return o.unshift(i),e.partial=!0,!0}return e.incomplete=!0,!1}function r(e,t){for(var i,o,a=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,u=[],s={},c=!1,f=r.caller;f&&!c;f=f.caller)f!==ae&&f!==oe&&(o={args:[],column:void 0,func:te,line:void 0,url:void 0},i=a.exec(f.toString()),f.name?o.func=f.name:i&&(o.func=i[1]),void 0===o.func&&(o.func=i?i.input.substring(0,i.input.indexOf("{")):void 0),s[""+f]?c=!0:s[""+f]=!0,u.push(o));t&&u.splice(0,t);var d={stack:u,message:e.message,name:e.name};return n(d,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),d}function i(n,i){var o,a=void 0===i?0:+i;try{if(o=function(e){var t=e.stacktrace;if(t){for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=t.split("\n"),a=[],u=0;u<o.length;u+=2){var s=void 0;r.exec(o[u])?s={args:[],column:void 0,func:(n=r.exec(o[u]))[3],line:+n[1],url:n[2]}:i.exec(o[u])&&(s={args:(n=i.exec(o[u]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),s&&(!s.func&&s.line&&(s.func=te),s.context=[o[u+1]],a.push(s))}if(a.length)return{stack:a,message:e.message,name:e.name}}}(n))return o}catch(t){if(e)throw t}try{if(o=t(n))return o}catch(t){if(e)throw t}try{if(o=function(e){var t=e.message.split("\n");if(!(t.length<4)){var n,r=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,i=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of function script\s*$/i,a=[],u=window&&window.document&&window.document.getElementsByTagName("script"),s=[];for(var c in u)re(u,c)&&!u[c].src&&s.push(u[c]);for(var f=2;f<t.length;f+=2){var d=void 0;if(r.exec(t[f]))d={args:[],column:void 0,func:(n=r.exec(t[f]))[3],line:+n[1],url:n[2]};else if(i.exec(t[f]))d={args:[],column:void 0,func:(n=i.exec(t[f]))[4],line:+n[1],url:n[3]};else if(o.exec(t[f])){n=o.exec(t[f]),d={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}d&&(d.func||(d.func=te),d.context=[t[f+1]],a.push(d))}if(a.length)return{stack:a,message:t[0],name:e.name}}}(n))return o}catch(t){if(e)throw t}try{if(o=r(n,a+1))return o}catch(t){if(e)throw t}return{message:n.message,name:n.name,stack:[]}}return i.augmentStackTraceWithInitialElement=n,i.computeStackTraceFromStackProp=t,i.ofCaller=function(e){var t=1+(void 0===e?0:+e);try{throw new Error}catch(e){return ae(e,t+1)}},i}();!function(e){e.info="info",e.error="error"}(ie||(ie={}));var ue,se,ce,fe={maxMessagesPerPage:0,sentMessageCount:0};function de(e){if(e.internalMonitoringEndpoint){var t=function(e){var t,n=r(e.internalMonitoringEndpoint);void 0!==e.replica&&(t=r(e.replica.internalMonitoringEndpoint));function r(t){return new ee(new Z(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var r=function(e){return z({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==ue?ue():{},e)}(e);n.add(r),t&&t.add(r)}}}(e);!function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))}(fe,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){ue=e}}}function le(e){return function(){try{return e.apply(this,arguments)}catch(e){Te(e);try{Ee(e)}catch(e){Te(e)}}}}function pe(e,t){!function(e){fe.debugMode&&console.log("[MONITORING MESSAGE]",e)}(e),me(r(r({message:e},t),{status:ie.info}))}function Ee(e){me(r(r({},function(e){if(e instanceof Error){var t=ae(e);return{error:{kind:t.name,stack:J(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+h(e)}}(e)),{status:ie.error}))}function me(e){fe.batch&&fe.sentMessageCount<fe.maxMessagesPerPage&&(fe.sentMessageCount+=1,fe.batch.add(e))}function ve(e){fe.debugMode=e}function Te(e){fe.debugMode&&console.warn("[INTERNAL ERROR]",e)}!function(e){e.US="us",e.EU="eu"}(ce||(ce={}));var he,ge=((se={})[ce.EU]="datadoghq.eu",se[ce.US]="datadoghq.com",se);function ye(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,env:e.env,proxyHost:e.proxyHost,sdkVersion:t.sdkVersion,service:e.service,site:e.site||ge[e.datacenter||t.datacenter],version:e.version},i=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],o=r({cookieOptions:P(e),isEnabled:function(e){return y(i,e)},logsEndpoint:W("browser",n),proxyHost:e.proxyHost,rumEndpoint:W("rum",n),service:e.service,traceEndpoint:W("public-trace",n)},B);if(e.internalMonitoringApiKey&&(o.internalMonitoringEndpoint=W("browser",n,"browser-agent-internal-monitoring")),"allowedTracingOrigins"in e&&(o.allowedTracingOrigins=e.allowedTracingOrigins),"sampleRate"in e&&(o.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(o.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(o.trackInteractions=!!e.trackInteractions),n.buildMode===he.E2E_TEST&&(o.internalMonitoringEndpoint="<<< E2E INTERNAL MONITORING ENDPOINT >>>",o.logsEndpoint="<<< E2E LOGS ENDPOINT >>>",o.rumEndpoint="<<< E2E RUM ENDPOINT >>>"),n.buildMode===he.STAGING&&void 0!==e.replica){var a=r(r({},n),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,site:ge[ce.US]});o.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:W("browser",a,"browser-agent-internal-monitoring"),logsEndpoint:W("browser",a),rumEndpoint:W("rum",a)}}return o}(e,t);return{configuration:n,internalMonitoring:de(n)}}function be(e){return!!function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_"+E();return N(t,"test",f,e),"test"===D(t)}catch(e){return console.error(e),!1}}(e)||(console.warn("Cookies are not authorized, we will not send any data."),!1)}function Ce(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(he||(he={}));var _e,Re=1e4,Oe=function(){function e(e){void 0===e&&(e=Re),this.limit=e,this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>this.limit&&this.buffer.splice(0,1)},e.prototype.drain=function(e){this.buffer.forEach((function(t){return e(t)})),this.buffer.length=0},e}();!function(e){e[e.PERFORMANCE_ENTRY_COLLECTED=0]="PERFORMANCE_ENTRY_COLLECTED",e[e.AUTO_ACTION_CREATED=1]="AUTO_ACTION_CREATED",e[e.AUTO_ACTION_COMPLETED=2]="AUTO_ACTION_COMPLETED",e[e.AUTO_ACTION_DISCARDED=3]="AUTO_ACTION_DISCARDED",e[e.VIEW_CREATED=4]="VIEW_CREATED",e[e.VIEW_UPDATED=5]="VIEW_UPDATED",e[e.REQUEST_STARTED=6]="REQUEST_STARTED",e[e.REQUEST_COMPLETED=7]="REQUEST_COMPLETED",e[e.SESSION_RENEWED=8]="SESSION_RENEWED",e[e.DOM_MUTATED=9]="DOM_MUTATED",e[e.BEFORE_UNLOAD=10]="BEFORE_UNLOAD",e[e.RAW_RUM_EVENT_COLLECTED=11]="RAW_RUM_EVENT_COLLECTED",e[e.RAW_RUM_EVENT_V2_COLLECTED=12]="RAW_RUM_EVENT_V2_COLLECTED",e[e.RUM_EVENT_COLLECTED=13]="RUM_EVENT_COLLECTED",e[e.RUM_EVENT_V2_COLLECTED=14]="RUM_EVENT_V2_COLLECTED"}(_e||(_e={}));var Se,we,Ae=function(){function e(){this.callbacks={}}return e.prototype.notify=function(e,t){var n=this.callbacks[e];n&&n.forEach((function(e){return e(t)}))},e.prototype.subscribe=function(e,t){var n=this;return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:function(){n.callbacks[e]=n.callbacks[e].filter((function(e){return t!==e}))}}},e}();function Ie(e,t){void 0===t&&(t=T);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=e.subscribe(_e.RAW_RUM_EVENT_COLLECTED,(function(e){switch(e.rawRumEvent.evt.category){case Se.ERROR:n.errorCount+=1,t(n);break;case Se.USER_ACTION:n.userActionCount+=1,t(n);break;case Se.LONG_TASK:n.longTaskCount+=1,t(n);break;case Se.RESOURCE:n.resourceCount+=1,t(n)}})),i=e.subscribe(_e.RAW_RUM_EVENT_V2_COLLECTED,(function(e){switch(e.rawRumEvent.type){case we.ERROR:n.errorCount+=1,t(n);break;case we.ACTION:n.userActionCount+=1,t(n);break;case we.LONG_TASK:n.longTaskCount+=1,t(n);break;case we.RESOURCE:n.resourceCount+=1,t(n)}}));return{stop:function(){r.unsubscribe(),i.unsubscribe()},eventCounts:n}}!function(e){e.USER_ACTION="user_action",e.ERROR="error",e.LONG_TASK="long_task",e.VIEW="view",e.RESOURCE="resource"}(Se||(Se={})),function(e){e.ACTION="action",e.ERROR="error",e.LONG_TASK="long_task",e.VIEW="view",e.RESOURCE="resource"}(we||(we={}));var Le=function(){function e(){this.observers=[]}return e.prototype.subscribe=function(e){this.observers.push(e)},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}(),Ne=100,De=100,xe=1e4;function Me(e,t){var n=function(e){var t,n=new Le,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(e.subscribe(_e.DOM_MUTATED,(function(){return o()}))),r.push(e.subscribe(_e.PERFORMANCE_ENTRY_COLLECTED,(function(e){"resource"===e.entryType&&o()}))),r.push(e.subscribe(_e.REQUEST_STARTED,(function(e){void 0===t&&(t=e.requestIndex),i+=1,o()}))),r.push(e.subscribe(_e.REQUEST_COMPLETED,(function(e){void 0===t||e.requestIndex<t||(i-=1,o())}))),{observable:n,stop:function(){r.forEach((function(e){return e.unsubscribe()}))}}}(e),r=n.observable,i=n.stop,o=function(e,t,n){var r,i=!1,o=setTimeout(le((function(){return s(!1,0)})),Ne),a=setTimeout(le((function(){return s(!0,performance.now())})),xe);function u(){i=!0,clearTimeout(o),clearTimeout(r),clearTimeout(a),t()}function s(e,t){i||(u(),n(e,t))}return e.subscribe((function(e){var t=e.isBusy;clearTimeout(o),clearTimeout(r);var n=performance.now();t||(r=setTimeout(le((function(){return s(!0,n)})),De))})),{stop:u}}(r,i,t).stop;return{stop:function(){o(),i()}}}function Ue(e){return function(e){var t;if(function(){void 0===Pe&&(Pe="closest"in HTMLElement.prototype);return Pe}())t=e.closest("["+ke+"]");else for(var n=e;n;){if(n.hasAttribute(ke)){t=n;break}n=n.parentElement}if(!t)return;return ze(qe(t.getAttribute(ke).trim()))}(e)||Ge(e,He)||Ge(e,je)||""}var ke="data-dd-action-name";var Ve,Be,Pe,We,He=[function(e){if(function(){void 0===Be&&(Be="labels"in HTMLInputElement.prototype);return Be}()){if("labels"in e&&e.labels&&e.labels.length>0)return Ke(e.labels[0])}else if(e.id){var t=e.ownerDocument&&e.ownerDocument.querySelector('label[for="'+e.id.replace('"','\\"')+'"]');return t&&Ke(t)}},function(e){if("INPUT"===e.nodeName){var t=e,n=t.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return t.value}},function(e){if("BUTTON"===e.nodeName||"LABEL"===e.nodeName||"button"===e.getAttribute("role"))return Ke(e)},function(e){return e.getAttribute("aria-label")},function(e){var t=e.getAttribute("aria-labelledby");if(t)return t.split(/\s+/).map((function(t){return function(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}(e,t)})).filter((function(e){return Boolean(e)})).map(Ke).join(" ")},function(e){return e.getAttribute("alt")},function(e){return e.getAttribute("name")},function(e){return e.getAttribute("title")},function(e){return e.getAttribute("placeholder")},function(e){if("options"in e&&e.options.length>0)return Ke(e.options[0])}],je=[function(e){return Ke(e)}],Fe=10;function Ge(e,t){for(var n=e,r=0;r<=Fe&&n&&"BODY"!==n.nodeName&&"HTML"!==n.nodeName&&"HEAD"!==n.nodeName;){for(var i=0,o=t;i<o.length;i++){var a=(0,o[i])(n);if("string"==typeof a){var u=a.trim();if(u)return ze(qe(u))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function qe(e){return e.replace(/\s+/g," ")}function ze(e){return e.length>100?(n=100,((r=(t=e).charCodeAt(n-1))>=55296&&r<=56319?t.slice(0,n+1):t.slice(0,n))+" [...]"):e;var t,n,r}function Ke(e){if(!e.isContentEditable){if("innerText"in e){var t=e.innerText;if(!function(){if(void 0===Ve){var e=document.createElement("style");e.textContent="*";var t=document.createElement("div");t.appendChild(e),document.body.appendChild(t),Ve=""===t.innerText,document.body.removeChild(t)}return Ve}())for(var n=e.querySelectorAll("script, style"),r=0;r<n.length;r+=1){var i=n[r].innerText;i.trim().length>0&&(t=t.replace(i,""))}return t}return e.textContent}}function $e(e){var t=function(e){var t,n;return{create:function(r,i){if(!t){var o=new Ye(e,r,i);t=o,n=Me(e,(function(e,n){e?o.complete(n):o.discard(),t=void 0}))}},discardCurrent:function(){t&&(n.stop(),t.discard(),t=void 0)}}}(e);function n(e){if(e.target instanceof Element){var n=Ue(e.target);n&&t.create(We.CLICK,n)}}return e.subscribe(_e.VIEW_CREATED,(function(){t.discardCurrent()})),addEventListener(a.CLICK,n,{capture:!0}),{stop:function(){t.discardCurrent(),removeEventListener(a.CLICK,n,{capture:!0})}}}!function(e){e.CLICK="click",e.CUSTOM="custom"}(We||(We={}));var Ye=function(){function e(e,t,n){this.lifeCycle=e,this.type=t,this.name=n,this.id=E(),this.startTime=performance.now(),this.eventCountsSubscription=Ie(e),this.lifeCycle.notify(_e.AUTO_ACTION_CREATED,{id:this.id,startTime:this.startTime})}return e.prototype.complete=function(e){var t=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(_e.AUTO_ACTION_COMPLETED,{counts:{errorCount:t.errorCount,longTaskCount:t.longTaskCount,resourceCount:t.resourceCount},duration:e-this.startTime,id:this.id,name:this.name,startTime:this.startTime,type:this.type}),this.eventCountsSubscription.stop()},e.prototype.discard=function(){this.lifeCycle.notify(_e.AUTO_ACTION_DISCARDED),this.eventCountsSubscription.stop()},e}();function Xe(e){var t,n=function(){var e,t=window;if(t.Zone){var n=t.Zone.__symbol__("MutationObserver");e=t[n]}return e||(e=t.MutationObserver),e}();return n&&(t=new n(le((function(){e.notify(_e.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){t&&t.disconnect()}}}var Je="initial_document",Qe=[[u.DOCUMENT,function(e){return Je===e}],[u.XHR,function(e){return"xmlhttprequest"===e}],[u.FETCH,function(e){return"fetch"===e}],[u.BEACON,function(e){return"beacon"===e}],[u.CSS,function(e,t){return null!==t.match(/\.css$/i)}],[u.JS,function(e,t){return null!==t.match(/\.js$/i)}],[u.IMAGE,function(e,t){return y(["image","img","icon"],e)||null!==t.match(/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i)}],[u.FONT,function(e,t){return null!==t.match(/\.(woff|eot|woff2|ttf)$/i)}],[u.MEDIA,function(e,t){return y(["audio","video"],e)||null!==t.match(/\.(mp3|mp4)$/i)}]];function Ze(e){var t=e.name;if(!function(e){try{return!!V(e)}catch(e){return!1}}(t))return pe('Failed to construct URL for "'+e.name+'"'),u.OTHER;for(var n=k(t),r=0,i=Qe;r<i.length;r++){var o=i[r],a=o[0];if((0,o[1])(e.initiatorType,n))return a}return u.OTHER}function et(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=1;n<e.length;n+=1)if(e[n-1]>e[n])return!1;return!0}function tt(e){var t=e.duration,n=e.startTime,r=e.responseEnd;return v(0===t&&n<r?r-n:t)}function nt(e){var t=rt(e);if(t){var n=t.startTime,r=t.fetchStart,i=t.redirectStart,o=t.redirectEnd,a=t.domainLookupStart,u=t.domainLookupEnd,s=t.connectStart,c=t.secureConnectionStart,f=t.connectEnd,d=t.requestStart,l=t.responseStart,p={download:ot(n,l,t.responseEnd),firstByte:ot(n,d,l)};return f!==r&&(p.connect=ot(n,s,f),et(s,c,f)&&(p.ssl=ot(n,c,f))),u!==r&&(p.dns=ot(n,a,u)),it(e)&&(p.redirect=ot(n,i,o)),p}}function rt(e){if(et(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd)){if(!it(e))return e;var t=e.redirectStart,n=e.redirectEnd;if(t<e.startTime&&(t=e.startTime),n<e.startTime&&(n=e.fetchStart),et(e.startTime,t,n,e.fetchStart))return r(r({},e),{redirectEnd:n,redirectStart:t})}}function it(e){return e.fetchStart!==e.startTime}function ot(e,t,n){return{duration:v(n-t),start:v(t-e)}}function at(e){if(e.startTime<e.responseStart)return e.decodedBodySize}function ut(e,t){return t&&!H(t,e)}var st,ct,ft=2*d;function dt(e){var t=function(e){var t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return lt(t&&t.content,n&&n.content)}(e)||function(e){var t=function(e){for(var t=0;t<e.childNodes.length;t+=1){if(n=pt(e.childNodes[t]))return n}if(e.body)for(t=e.body.childNodes.length-1;t>=0;t-=1){var n,r=e.body.childNodes[t];if(n=pt(r))return n;if(!Et(r))break}}(e);if(!t)return;return lt(w(t,"trace-id"),w(t,"trace-time"))}(e);if(t&&!(t.traceTime<=Date.now()-ft))return t.traceId}function lt(e,t){var n=t&&Number(t);if(e&&n)return{traceId:e,traceTime:n}}function pt(e){if(e&&function(e){return"#comment"===e.nodeName}(e)){var t=e.data.match(/^\s*DATADOG;(.*?)\s*$/);if(t)return t[1]}}function Et(e){return"#text"===e.nodeName}function mt(){return void 0!==window.performance&&"getEntries"in performance}function vt(){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("navigation")}function Tt(e,t){var n;if(n=function(n){bt(e,t,n)},ht("interactive",(function(){var e,t={entryType:"resource",initiatorType:Je,traceId:dt(document)};if(vt()&&performance.getEntriesByType("navigation").length>0){var i=performance.getEntriesByType("navigation")[0];e=r(r({},i.toJSON()),t)}else{var o=gt();e=r(r(r({},o),{decodedBodySize:0,duration:o.responseEnd,name:window.location.href,startTime:0}),t)}n(e)})),mt()&&yt(e,t,performance.getEntries()),window.PerformanceObserver){var i=new PerformanceObserver(le((function(n){return yt(e,t,n.getEntries())}))),o=["resource","navigation","longtask"];"visible"===document.visibilityState&&o.push("paint"),i.observe({entryTypes:o}),mt()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}vt()||function(e){function t(){e(r(r({},gt()),{entryType:"navigation"}))}ht("complete",(function(){setTimeout(le(t))}))}((function(n){bt(e,t,n)}))}function ht(e,t){if(document.readyState===e||"complete"===document.readyState)t();else{var n="complete"===e?a.LOAD:a.DOM_CONTENT_LOADED,r=le((function(){window.removeEventListener(n,r),t()}));window.addEventListener(n,r)}}function gt(){var e={},t=performance.timing;for(var n in t)C(t[n])&&(e[n]=0===t[n]?0:t[n]-R());return e}function yt(e,t,n){n.forEach((function(n){"resource"!==n.entryType&&"navigation"!==n.entryType&&"paint"!==n.entryType&&"longtask"!==n.entryType||bt(e,t,n)}))}function bt(e,t,n){(function(e){return"navigation"===e.entryType&&e.loadEventEnd<=0})(n)||function(e,t){return"resource"===t.entryType&&!ut(e,t.name)}(t,n)||e.notify(_e.PERFORMANCE_ENTRY_COLLECTED,n)}function Ct(e,t,n,r,i,o){n.subscribe(_e.RAW_RUM_EVENT_COLLECTED,(function(a){var u,s=a.startTime,c=a.rawRumEvent,f=a.savedGlobalContext,d=a.customerContext,l=i.findView(s);if(r.isTracked()&&l&&l.sessionId){var p=i.findAction(s),E={applicationId:e,date:(new Date).getTime(),service:t.service,session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?st.USER:st.SYNTHETICS}},m=(u=c,-1!==[Se.ERROR,Se.RESOURCE,Se.LONG_TASK].indexOf(u.evt.category)?z(E,l,p,c):z(E,l,c)),v=z(f||o(),d,j(m));n.notify(_e.RUM_EVENT_COLLECTED,{rumEvent:m,serverRumEvent:v})}}))}function _t(e,t,n,r,i,o){n.subscribe(_e.RAW_RUM_EVENT_V2_COLLECTED,(function(a){var u,s=a.startTime,c=a.rawRumEvent,f=a.savedGlobalContext,d=a.customerContext,l=i.findViewV2(s);if(r.isTracked()&&l&&l.session.id){var p=i.findActionV2(s),E={_dd:{formatVersion:2},application:{id:e},date:(new Date).getTime(),service:t.service,session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?ct.USER:ct.SYNTHETICS}},m=(u=c,-1!==[we.ERROR,we.RESOURCE,we.LONG_TASK].indexOf(u.type)?z(E,l,p,c):z(E,l,c)),v=j(m);v.context=z(f||o(),d),n.notify(_e.RUM_EVENT_V2_COLLECTED,{rumEvent:m,serverRumEvent:v})}}))}!function(e){e.SYNTHETICS="synthetics",e.USER="user"}(st||(st={})),function(e){e.SYNTHETICS="synthetics",e.USER="user"}(ct||(ct={}));var Rt="_dd",Ot="_dd_r",St="_dd_l",wt="rum",At="logs";var It="_dd_s",Lt=15*d,Nt=4*l,Dt=d;function xt(e,t,n){var r=function(e,t){var n,r,i=!1,o=function(){i=!0,window.clearTimeout(n),n=window.setTimeout((function(){i=!1}),L)};return{get:function(){return i?r:(r=D(e),o(),r)},set:function(n,i){N(e,n,i,t),r=n,o()}}}(It,e);!function(e){var t=e.get(),n=D(Rt),r=D(Ot),i=D(St);if(!t){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[At]=i),r&&/^[012]$/.test(r)&&(o[wt]=r),Vt(o,e)}}(r);var i=new Le,o=kt(r).id,u=p((function(){var e=kt(r),a=n(e[t]),u=a.trackingType,s=a.isTracked;e[t]=u,s&&!e.id&&(e.id=E(),e.created=String(Date.now())),Vt(e,r),s&&o!==e.id&&(o=e.id,i.notify())}),L).throttled;return u(),function(e){var t=le(e),n={capture:!0,passive:!0};[a.CLICK,a.TOUCH_START,a.KEY_DOWN,a.SCROLL].forEach((function(e){document.addEventListener(e,t,n),Pt.push((function(){return document.removeEventListener(e,t,n)}))}))}(u),function(e){var t=le((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,Dt);document.addEventListener(a.VISIBILITY_CHANGE,t),Pt.push((function(){clearInterval(n),document.removeEventListener(a.VISIBILITY_CHANGE,t)}))}((function(){Vt(kt(r),r)})),{getId:function(){return kt(r).id},getTrackingType:function(){return kt(r)[t]},renewObservable:i}}var Mt=/^([a-z]+)=([a-z0-9-]+)$/,Ut="&";function kt(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf(Ut)||Mt.test(e))})(t)&&t.split(Ut).forEach((function(e){var t=Mt.exec(e);if(null!==t){var r=t[1],i=t[2];n[r]=i}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<Nt)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(Bt(e),{})}function Vt(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+Lt);var r=O(e).map((function(e){return e[0]+"="+e[1]})).join(Ut);t.set(r,Lt)}else Bt(t)}function Bt(e){e.set("",0)}var Pt=[];var Wt,Ht=Nt,jt=5*d,Ft=d;var Gt,qt,zt,Kt,$t=[],Yt=[];function Xt(){return Wt||(Gt=XMLHttpRequest.prototype.open,qt=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=le((function(e,t){return this._datadog_xhr={method:e,startTime:-1,url:x(t)},Gt.apply(this,arguments)})),XMLHttpRequest.prototype.send=le((function(e){var t=this;if(this._datadog_xhr){this._datadog_xhr.startTime=performance.now();var n=this.onreadystatechange;this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&le(i)(),n&&n.apply(this,arguments)};var r=!1,i=function(){r||(r=!0,t._datadog_xhr.duration=performance.now()-t._datadog_xhr.startTime,t._datadog_xhr.response=t.response,t._datadog_xhr.status=t.status,Yt.forEach((function(e){return e(t._datadog_xhr)})))};this.addEventListener("loadend",le(i)),$t.forEach((function(e){return e(t._datadog_xhr,t)}))}return qt.apply(this,arguments)})),Wt={beforeSend:function(e){$t.push(e)},onRequestComplete:function(e){Yt.push(e)}}),Wt}var Jt=[],Qt=[];function Zt(){return zt||(!function(){if(!window.fetch)return;Kt=window.fetch,window.fetch=le((function(e,t){var n=this,r=t&&t.method||"object"==typeof e&&e.method||"GET",o=x("object"==typeof e&&e.url||e),a={init:t,method:r,startTime:performance.now(),url:o},u=function(e){return t=n,r=void 0,u=function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return a.duration=performance.now()-a.startTime,"stack"in e||e instanceof Error?(a.status=0,a.response=J(ae(e)),Qt.forEach((function(e){return e(a)})),[3,6]):[3,1];case 1:if(!("status"in e))return[3,6];t=void 0,r.label=2;case 2:return r.trys.push([2,4,,5]),[4,e.clone().text()];case 3:return t=r.sent(),[3,5];case 4:return n=r.sent(),t="Unable to retrieve response: "+n,[3,5];case 5:a.response=t,a.responseType=e.type,a.status=e.status,Qt.forEach((function(e){return e(a)})),r.label=6;case 6:return[2]}}))},new((o=void 0)||(o=Promise))((function(e,n){function i(e){try{s(u.next(e))}catch(e){n(e)}}function a(e){try{s(u.throw(e))}catch(e){n(e)}}function s(t){t.done?e(t.value):new o((function(e){e(t.value)})).then(i,a)}s((u=u.apply(t,r||[])).next())}));var t,r,o,u};Jt.forEach((function(e){return e(a)}));var s=Kt.call(this,e,a.init);return s.then(le(u),le(u)),s}))}(),zt={beforeSend:function(e){Jt.push(e)},onRequestComplete:function(e){Qt.push(e)}}),zt}function en(e,t,n){if(void 0!==tn()&&function(e,t){for(var n=U(t),r=0,i=e.allowedTracingOrigins;r<i.length;r++){var o=i[r];if(n===o||o instanceof RegExp&&o.test(n))return!0}return!1}(e,t)){var r=new un,i=new un;return n(function(e,t){return{"x-datadog-origin":"rum","x-datadog-parent-id":t.toDecimalString(),"x-datadog-sampled":"1","x-datadog-sampling-priority":"1","x-datadog-trace-id":e.toDecimalString()}}(r,i)),{traceId:r,spanId:i}}}function tn(){return window.crypto||window.msCrypto}var nn,rn,on,an,un=function(){function e(){this.buffer=new Uint8Array(8),tn().getRandomValues(this.buffer),this.buffer[0]=127&this.buffer[0]}return e.prototype.toString=function(e){for(var t=this.readInt32(0),n=this.readInt32(4),r="";;){var i=t%e*4294967296+n;if(t=Math.floor(t/e),n=Math.floor(i/e),r=(i%e).toString(e)+r,!t&&!n)break}return r},e.prototype.toDecimalString=function(){return this.toString(10)},e.prototype.readInt32=function(e){return 16777216*this.buffer[e]+(this.buffer[e+1]<<16)+(this.buffer[e+2]<<8)+this.buffer[e+3]},e}(),sn=1;function cn(e,t){var n=function(e){return{traceFetch:function(t){return en(e,t.url,(function(e){t.init=r({},t.init);var n=[];t.init.headers instanceof Headers?t.init.headers.forEach((function(e,t){n.push([t,e])})):Array.isArray(t.init.headers)?t.init.headers.forEach((function(e){n.push(e)})):t.init.headers&&Object.keys(t.init.headers).forEach((function(e){n.push([e,t.init.headers[e]])})),t.init.headers=n.concat(O(e))}))},traceXhr:function(t,n){return en(e,t.url,(function(e){Object.keys(e).forEach((function(t){n.setRequestHeader(t,e[t])}))}))}}}(t);!function(e,t,n){var r=Xt();r.beforeSend((function(r,i){if(ut(t,r.url)){var o=n.traceXhr(r,i);o&&(r.traceId=o.traceId,r.spanId=o.spanId),r.requestIndex=fn(),e.notify(_e.REQUEST_STARTED,{requestIndex:r.requestIndex})}})),r.onRequestComplete((function(n){ut(t,n.url)&&e.notify(_e.REQUEST_COMPLETED,{duration:n.duration,method:n.method,requestIndex:n.requestIndex,response:n.response,spanId:n.spanId,startTime:n.startTime,status:n.status,traceId:n.traceId,type:s.XHR,url:n.url})}))}(e,t,n),function(e,t,n){var r=Zt();r.beforeSend((function(r){if(ut(t,r.url)){var i=n.traceFetch(r);i&&(r.traceId=i.traceId,r.spanId=i.spanId),r.requestIndex=fn(),e.notify(_e.REQUEST_STARTED,{requestIndex:r.requestIndex})}})),r.onRequestComplete((function(n){ut(t,n.url)&&e.notify(_e.REQUEST_COMPLETED,{duration:n.duration,method:n.method,requestIndex:n.requestIndex,response:n.response,responseType:n.responseType,spanId:n.spanId,startTime:n.startTime,status:n.status,traceId:n.traceId,type:s.FETCH,url:n.url})}))}(e,t,n)}function fn(){var e=sn;return sn+=1,e}function dn(e,t){return e.subscribe(_e.AUTO_ACTION_COMPLETED,(function(n){t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,pn(n)):e.notify(_e.RAW_RUM_EVENT_COLLECTED,ln(n))})),t.trackInteractions&&$e(e),{addAction:function(n,i){t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,r({savedGlobalContext:i},pn(n))):e.notify(_e.RAW_RUM_EVENT_COLLECTED,r({savedGlobalContext:i},ln(n)))}}}function ln(e){var t=En(e)?{duration:v(e.duration),userAction:{id:e.id,measures:e.counts}}:void 0;return{customerContext:En(e)?void 0:e.context,rawRumEvent:z({date:_(e.startTime),evt:{category:Se.USER_ACTION,name:e.name},userAction:{type:e.type}},t),startTime:e.startTime}}function pn(e){var t=En(e)?{action:{error:{count:e.counts.errorCount},id:e.id,loadingTime:v(e.duration),longTask:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}}}:void 0;return{customerContext:En(e)?void 0:e.context,rawRumEvent:z({action:{target:{name:e.name},type:e.type},date:_(e.startTime),type:we.ACTION},t),startTime:e.startTime}}function En(e){return e.type!==We.CUSTOM}function mn(e){if(!nn){var t=new Le;!function(e,t){function n(n,r){H(r.url,e)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!function(e){return e.status>=500}(r)||t.notify({message:hn(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:F.NETWORK,stack:Tn(r.response,e)||"Failed to load",startTime:r.startTime})}Xt().onRequestComplete((function(e){return n(s.XHR,e)})),Zt().onRequestComplete((function(e){return n(s.FETCH,e)}))}(e,t),function(e){rn=console.error,console.error=le((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];rn.apply(console,o([t],n)),e.notify({message:o(["console error:",t],n).map(vn).join(" "),source:F.CONSOLE,startTime:performance.now()})}))}(t),function(e){on=function(t,n,r){var i=X(t,r,"Uncaught"),o=i.stack,a=i.message,u=i.type;e.notify({message:a,stack:o,type:u,source:F.SOURCE,startTime:performance.now()})},oe.subscribe(on)}(t),nn=function(e,t){var n=0,r=new Le;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,source:F.AGENT,startTime:performance.now()}))})),setInterval((function(){return n=0}),d),r}(e,t)}return nn}function vn(e){return"string"==typeof e?e:e instanceof Error?J(ae(e)):h(e,0,2)}function Tn(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function hn(e){return s.XHR===e?"XHR":"Fetch"}function gn(e,t){return function(e,t,n){return n.subscribe((function(n){t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,bn(n)):e.notify(_e.RAW_RUM_EVENT_COLLECTED,yn(n))})),{addError:function(n,i){var o=n.error,a=n.startTime,u=n.context,s=function(e,t,n){var i=e instanceof Error?ae(e):void 0;return r({startTime:t,source:n},X(i,e,"Provided"))}(o,a,n.source);t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,r({customerContext:u,savedGlobalContext:i},bn(s))):e.notify(_e.RAW_RUM_EVENT_COLLECTED,r({customerContext:u,savedGlobalContext:i},yn(s)))}}}(e,t,mn(t))}function yn(e){return{rawRumEvent:z({date:_(e.startTime),error:{kind:e.type,origin:e.source,stack:e.stack},evt:{category:Se.ERROR},message:e.message},e.resource?{http:{method:e.resource.method,status_code:e.resource.statusCode,url:e.resource.url}}:void 0),startTime:e.startTime}}function bn(e){return{rawRumEvent:{date:_(e.startTime),error:{message:e.message,resource:e.resource,source:e.source,stack:e.stack,type:e.type},type:we.ERROR},startTime:e.startTime}}function Cn(e){if(performance&&"getEntriesByName"in performance){var t,n=performance.getEntriesByName(e.url,"resource").map((function(e){return e.toJSON()})).filter(rt).filter((function(t){return n=t,r=e.startTime,i=_n(e),n.startTime>=r&&_n(n)<=i;var n,r,i}));return 1===n.length?n[0]:2===n.length&&_n((t=n)[0])<=t[1].startTime?n[1]:void 0}}function _n(e){return e.startTime+e.duration}function Rn(e,t,n){e.subscribe(_e.REQUEST_COMPLETED,(function(r){n.isTrackedWithResource()&&(t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,function(e){var t=e.type===s.XHR?u.XHR:u.FETCH,n=Cn(e),r=n?n.startTime:e.startTime,i=n?Sn(n):void 0,o=wn(e),a=z({date:_(r),resource:{type:t,duration:v(e.duration),method:e.method,statusCode:e.status,url:e.url},type:we.RESOURCE},o,i);return{startTime:r,rawRumEvent:a}}(r)):e.notify(_e.RAW_RUM_EVENT_COLLECTED,function(e){var t=e.type===s.XHR?u.XHR:u.FETCH,n=Cn(e),r=n?n.startTime:e.startTime,i=n?On(n):void 0,o=wn(e),a=z({date:_(r),duration:v(e.duration),evt:{category:Se.RESOURCE},http:{method:e.method,statusCode:e.status,url:e.url},resource:{kind:t}},o,i);return{startTime:r,rawRumEvent:a}}(r)))})),e.subscribe(_e.PERFORMANCE_ENTRY_COLLECTED,(function(r){var i;n.isTrackedWithResource()&&"resource"===r.entryType&&("xmlhttprequest"!==(i=r).initiatorType&&"fetch"!==i.initiatorType)&&(t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,function(e){var t=Ze(e),n=Sn(e),r=An(e),i=z({date:_(e.startTime),resource:{type:t,url:e.name},type:we.RESOURCE},r,n);return{startTime:e.startTime,rawRumEvent:i}}(r)):e.notify(_e.RAW_RUM_EVENT_COLLECTED,function(e){var t=Ze(e),n=On(e),r=An(e),i=z({date:_(e.startTime),evt:{category:Se.RESOURCE},http:{url:e.name},resource:{kind:t}},r,n);return{startTime:e.startTime,rawRumEvent:i}}(r)))}))}function On(e){return{duration:tt(e),http:{performance:nt(e)},network:{bytesWritten:at(e)}}}function Sn(e){return{resource:r({duration:tt(e),size:at(e)},nt(e))}}function wn(e){if(e.traceId&&e.spanId)return{_dd:{spanId:e.spanId.toDecimalString(),traceId:e.traceId.toDecimalString()},resource:{id:E()}}}function An(e){return e.traceId?{_dd:{traceId:e.traceId}}:void 0}!function(e){e.INITIAL_LOAD="initial_load",e.ROUTE_CHANGE="route_change"}(an||(an={}));var In=3e3,Ln=5*d;function Nn(e,t){var n,i=Dn(t,e,an.INITIAL_LOAD,document.referrer,0),o=i,u=function(e,t){var n;return{stop:e.subscribe(_e.PERFORMANCE_ENTRY_COLLECTED,(function(e){"navigation"===e.entryType?(n=r(r({},n),{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEventEnd:e.loadEventEnd}),t(n)):"paint"===e.entryType&&"first-contentful-paint"===e.name&&(n=r(r({},n),{firstContentfulPaint:e.startTime}),t(n))})).unsubscribe}}(t,(function(e){i.updateTimings(e),i.scheduleUpdate()})).stop;function s(){o.isDifferentView(e)?(o.triggerUpdate(),o.end(),o=Dn(t,e,an.ROUTE_CHANGE,o.url)):(o.updateLocation(e),o.triggerUpdate())}!function(e){var t=history.pushState;history.pushState=le((function(){t.apply(this,arguments),e()}));var n=history.replaceState;history.replaceState=le((function(){n.apply(this,arguments),e()})),window.addEventListener(a.POP_STATE,le(e))}(s),n=s,window.addEventListener("hashchange",le(n)),t.subscribe(_e.SESSION_RENEWED,(function(){o.end(),o=Dn(t,e,an.ROUTE_CHANGE,o.url)})),t.subscribe(_e.BEFORE_UNLOAD,(function(){o.triggerUpdate(),o.end()}));var c=window.setInterval(le((function(){o.triggerUpdate()})),Ln);return{stop:function(){u(),o.end(),clearInterval(c)}}}function Dn(e,t,n,i,o){void 0===o&&(o=performance.now());var a,u,s=E(),c={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},f={},d=0,l=r({},t);e.notify(_e.VIEW_CREATED,{id:s,startTime:o,location:l,referrer:i});var m=p(le(_),In,{leading:!1}),v=m.throttled,T=m.cancel,h=Ie(e,(function(e){c=e,v()})).stop,g=function(e,t){var n=e===an.INITIAL_LOAD,r=!0,i=[];function o(){!r&&!n&&i.length>0&&t(Math.max.apply(Math,i))}return{setLoadEventEnd:function(e){n&&(n=!1,i.push(e),o())},setActivityLoadingTime:function(e){r&&(r=!1,void 0!==e&&i.push(e),o())}}}(n,(function(e){a=e,v()})),y=g.setActivityLoadingTime,b=g.setLoadEventEnd,C=function(e,t){var n=performance.now();return{stop:Me(e,(function(e,r){t(e?r-n:void 0)})).stop}}(e,y).stop;function _(){d+=1,e.notify(_e.VIEW_UPDATED,{documentVersion:d,eventCounts:c,id:s,loadingTime:a,loadingType:n,location:l,referrer:i,startTime:o,timings:f,duration:(void 0===u?performance.now():u)-o})}return(_(),{scheduleUpdate:v,end:function(){u=performance.now(),h(),C()},isDifferentView:function(e){return l.pathname!==e.pathname||(t=e.hash,n=t.substr(1),!document.getElementById(n)&&e.hash!==l.hash);var t,n},triggerUpdate:function(){T(),_()},updateTimings:function(e){f=e,void 0!==e.loadEventEnd&&b(e.loadEventEnd)},updateLocation:function(e){l=r({},e)},get url(){return l.href}})}function xn(e,t,n){return e.subscribe(_e.VIEW_UPDATED,(function(n){t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,function(e){return{rawRumEvent:{_dd:{documentVersion:e.documentVersion},date:_(e.startTime),type:we.VIEW,view:{action:{count:e.eventCounts.userActionCount},domComplete:v(e.timings.domComplete),domContentLoaded:v(e.timings.domContentLoaded),domInteractive:v(e.timings.domInteractive),error:{count:e.eventCounts.errorCount},firstContentfulPaint:v(e.timings.firstContentfulPaint),loadEventEnd:v(e.timings.loadEventEnd),loadingTime:v(e.loadingTime),loadingType:e.loadingType,longTask:{count:e.eventCounts.longTaskCount},resource:{count:e.eventCounts.resourceCount},timeSpent:v(e.duration)}},startTime:e.startTime}}(n)):e.notify(_e.RAW_RUM_EVENT_COLLECTED,function(e){return{rawRumEvent:{date:_(e.startTime),duration:v(e.duration),evt:{category:Se.VIEW},rum:{documentVersion:e.documentVersion},view:{loadingTime:v(e.loadingTime),loadingType:e.loadingType,measures:r(r({},e.eventCounts),{domComplete:v(e.timings.domComplete),domContentLoaded:v(e.timings.domContentLoaded),domInteractive:v(e.timings.domInteractive),firstContentfulPaint:v(e.timings.firstContentfulPaint),loadEventEnd:v(e.timings.loadEventEnd)})}},startTime:e.startTime}}(n))})),Nn(n,e)}var Mn,Un="rum";function kn(e,t){var n=xt(e.cookieOptions,Un,(function(t){return function(e,t){var n;n=function(e){return e===Mn.NOT_TRACKED||e===Mn.TRACKED_WITH_RESOURCES||e===Mn.TRACKED_WITHOUT_RESOURCES}(t)?t:m(e.sampleRate)?m(e.resourceSampleRate)?Mn.TRACKED_WITH_RESOURCES:Mn.TRACKED_WITHOUT_RESOURCES:Mn.NOT_TRACKED;return{trackingType:n,isTracked:Vn(n)}}(e,t)}));return n.renewObservable.subscribe((function(){t.notify(_e.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&Vn(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===Mn.TRACKED_WITH_RESOURCES}}}function Vn(e){return e===Mn.TRACKED_WITH_RESOURCES||e===Mn.TRACKED_WITHOUT_RESOURCES}function Bn(e,t){var n=function(e,t){var n,r=o(e.rumEndpoint,(function(){return t.notify(_e.BEFORE_UNLOAD)})),i=e.replica;void 0!==i&&(n=o(i.rumEndpoint));function o(t,n){return new ee(new Z(t,e.batchBytesLimit,!0),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,n)}function a(e){return z(e,{application_id:i.applicationId})}var u=!1;return{add:function(e){u||(r.add(e),n&&n.add(a(e)))},stop:function(){u=!0},upsert:function(e,t){u||(r.upsert(e,t),n&&n.upsert(a(e),t))}}}(e,t);return t.subscribe(_e.RUM_EVENT_COLLECTED,(function(e){var t=e.rumEvent,r=e.serverRumEvent;t.evt.category===Se.VIEW?n.upsert(r,t.view.id):n.add(r)})),t.subscribe(_e.RUM_EVENT_V2_COLLECTED,(function(e){var t=e.rumEvent,r=e.serverRumEvent;t.type===we.VIEW?n.upsert(r,t.view.id):n.add(r)})),{stop:function(){n.stop()}}}!function(e){e.NOT_TRACKED="0",e.TRACKED_WITH_RESOURCES="1",e.TRACKED_WITHOUT_RESOURCES="2"}(Mn||(Mn={}));var Pn={buildMode:"release",datacenter:"us",sdkVersion:"1.25.2"};var Wn,Hn,jn,Fn,Gn=qn((function(e,t){var n=new Ae,r=ye(e,Pn),i=r.configuration,o=r.internalMonitoring,a=kn(i,n);o.setExternalContextProvider((function(){return z({application_id:e.applicationId},s.findView(),t())}));var u=function(e,t,n,r,i,o){var a=function(e,t){var n,r,i,o=[],a=[];e.subscribe(_e.VIEW_CREATED,(function(e){n&&o.unshift({context:c(),endTime:e.startTime,startTime:n.startTime}),n=e,i=t.getId()})),e.subscribe(_e.VIEW_UPDATED,(function(e){n.id===e.id&&(n=e)})),e.subscribe(_e.AUTO_ACTION_CREATED,(function(e){r=e})),e.subscribe(_e.AUTO_ACTION_COMPLETED,(function(e){r&&a.unshift({context:f(),endTime:r.startTime+e.duration,startTime:r.startTime}),r=void 0})),e.subscribe(_e.AUTO_ACTION_DISCARDED,(function(){r=void 0})),e.subscribe(_e.SESSION_RENEWED,(function(){o=[],a=[],n=void 0,r=void 0}));var u=window.setInterval(le((function(){s(o,Ht),s(a,jt)})),Ft);function s(e,t){for(var n=performance.now()-t;e.length>0&&e[e.length-1].startTime<n;)e.pop()}function c(){return{sessionId:i,view:{id:n.id,referrer:n.referrer,url:n.location.href}}}function f(){return{userAction:{id:r.id}}}function d(e,t,n,r){if(void 0===r)return n?e():void 0;if(n&&r>=n.startTime)return e();for(var i=0,o=t;i<o.length;i++){var a=o[i];if(r>a.endTime)break;if(r>=a.startTime)return a.context}}var l={findAction:function(e){return d(f,a,r,e)},findActionV2:function(e){var t=l.findAction(e);if(t)return{action:{id:t.userAction.id}}},findView:function(e){return d(c,o,n,e)},findViewV2:function(e){var t=l.findView(e);if(t)return{session:{id:t.sessionId},view:t.view}},stop:function(){window.clearInterval(u)}};return l}(n,i),u=Bn(r,n);Ct(e,r,n,i,a,o),_t(e,r,n,i,a,o),function(e,t){e.subscribe(_e.PERFORMANCE_ENTRY_COLLECTED,(function(n){if("longtask"===n.entryType)if(t.isEnabled("v2_format")){var r={date:_(n.startTime),longTask:{duration:v(n.duration)},type:we.LONG_TASK};e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,{rawRumEvent:r,startTime:n.startTime})}else{r={date:_(n.startTime),duration:v(n.duration),evt:{category:Se.LONG_TASK}};e.notify(_e.RAW_RUM_EVENT_COLLECTED,{rawRumEvent:r,startTime:n.startTime})}}))}(n,r),Rn(n,r,i),xn(n,r,t);var s=gn(n,r).addError;return{addAction:dn(n,r).addAction,addError:s,parentContexts:a,stop:function(){u.stop()}}}(e.applicationId,location,n,i,a,t),s=u.parentContexts,c=u.addError,f=u.addAction;return cn(n,i),Tt(n,i),Xe(n),{addAction:f,addError:c,getInternalContext:function(e,t,n,r){return{get:function(i){if(r.isEnabled("v2_format")){var o=n.findViewV2(i);if(t.isTracked()&&o&&o.session.id)return j(z({application:{id:e}},o,n.findActionV2(i)))}else{o=n.findView(i);if(t.isTracked()&&o&&o.sessionId)return j(z({applicationId:e},o,n.findAction(i)))}}}}(e.applicationId,a,s,i).get}}));function qn(e){var t,n=!1,i=(t={},{get:function(){return t},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},set:function(e){t=e}}),o=function(){},a=new Oe,u=function(e){a.add([e,K(i.get())])},s=new Oe,c=function(e){s.add([e,K(i.get())])},f=function(e){var t=r(r({},e),{onReady:function(e){e()}});return Object.defineProperty(t,"_setDebug",{get:function(){return ve},enumerable:!1}),t}({init:le((function(t){var r;be(P(t))&&Ce()&&function(e){if(n)return e.silentMultipleInit||console.error("DD_RUM is already initialized."),!1;if(!e||!e.clientToken&&!e.publicApiKey)return console.error("Client Token is not configured, we will not send any data."),!1;if(!e.applicationId)return console.error("Application ID is not configured, no RUM data will be collected."),!1;if(void 0!==e.sampleRate&&!b(e.sampleRate))return console.error("Sample Rate should be a number between 0 and 100"),!1;if(void 0!==e.resourceSampleRate&&!b(e.resourceSampleRate))return console.error("Resource Sample Rate should be a number between 0 and 100"),!1;if(Array.isArray(e.allowedTracingOrigins)&&0!==e.allowedTracingOrigins.length&&void 0===e.service)return console.error("Service need to be configured when tracing is enabled"),!1;return!0}(t)&&(t.publicApiKey&&(t.clientToken=t.publicApiKey),r=e(t,i.get),u=r.addAction,c=r.addError,o=r.getInternalContext,a.drain((function(e){var t=e[0],n=e[1];return u(t,n)})),s.drain((function(e){var t=e[0],n=e[1];return c(t,n)})),n=!0)})),addRumGlobalContext:le(i.add),removeRumGlobalContext:le(i.remove),setRumGlobalContext:le(i.set),getInternalContext:le((function(e){return o(e)})),addAction:le((function(e,t){u({name:e,context:K(t),startTime:performance.now(),type:We.CUSTOM})})),addUserAction:function(e,t){f.addAction(e,t)},addError:le((function(e,t,n){var r;void 0===n&&(n=F.CUSTOM),n===F.CUSTOM||n===F.NETWORK||n===F.SOURCE?r=n:(console.error("DD_RUM.addError: Invalid source '"+n+"'"),r=F.CUSTOM),c({error:e,context:K(t),source:r,startTime:performance.now()})}))});return f}Wn=function(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}(),jn=Gn,Fn=Wn[Hn="DD_RUM"],Wn[Hn]=jn,Fn&&Fn.q&&Fn.q.forEach((function(e){return e()}))}]);
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=1)}([,function(e,t,n){"use strict";n.r(t),n.d(t,"datadogRum",(function(){return Gn})),n.d(t,"makeRumGlobal",(function(){return qn}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function i(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}function o(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),i=0;for(t=0;t<n;t++)for(var o=arguments[t],a=0,u=o.length;a<u;a++,i++)r[i]=o[a];return r}var a,u,s,c,f=1e3,d=60*f,l=60*d;function p(e,t,n){var r,i=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing,a=!1,u=!1;return{throttled:function(){var n=this;a?u=!0:(i?e.apply(this):u=!0,a=!0,r=window.setTimeout((function(){o&&u&&e.apply(n),a=!1,u=!1}),t))},cancel:function(){window.clearTimeout(r),a=!1,u=!1}}}function E(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,E)}function m(e){return 0!==e&&100*Math.random()<=e}function v(e){return"number"!=typeof e?e:+(1e6*e).toFixed(0)}function T(){}function h(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];g(e)&&(r=[!0,e.toJSON],delete e.toJSON);var i,o,a=[!1,void 0];"object"==typeof e&&g(i=Object.getPrototypeOf(e))&&(a=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(e,void 0,n)}catch(e){o="<error: unable to serialize object>"}finally{r[0]&&(e.toJSON=r[1]),a[0]&&(i.toJSON=a[1])}return o}function g(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function y(e,t){return-1!==e.indexOf(t)}function b(e){return C(e)&&e>=0&&e<=100}function C(e){return"number"==typeof e}function _(e){return Math.floor(R()+e)}function R(){return void 0===c&&(c=performance.timing.navigationStart),c}function O(e){return Object.keys(e).map((function(t){return[t,e[t]]}))}function S(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}function w(e,t){var n=e.match("(?:^|;)\\s*"+t+"\\s*=\\s*([^;]+)");return n?n[1]:void 0}!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.VISIBILITY_CHANGE="visibilitychange",e.DOM_CONTENT_LOADED="DOMContentLoaded"}(a||(a={})),function(e){e.DOCUMENT="document",e.XHR="xhr",e.BEACON="beacon",e.FETCH="fetch",e.CSS="css",e.JS="js",e.IMAGE="image",e.FONT="font",e.MEDIA="media",e.OTHER="other"}(u||(u={})),function(e){e.FETCH="fetch",e.XHR="xhr"}(s||(s={}));var A,I,L=f;function N(e,t,n,r){var i=new Date;i.setTime(i.getTime()+n);var o="expires="+i.toUTCString(),a=r&&r.crossSite?"none":"strict",u=r&&r.domain?";domain="+r.domain:"",s=r&&r.secure?";secure":"";document.cookie=e+"="+t+";"+o+";path=/;samesite="+a+u+s}function D(e){return w(document.cookie,e)}function x(e){return V(e,S(window.location)).href}function M(e,t){return U(e)===U(t)}function U(e){return S(V(e))}function k(e){var t=V(e).pathname;return"/"===t[0]?t:"/"+t}function V(e,t){if(function(){if(void 0!==I)return I;try{var e=new URL("http://test/path");return I="http://test/path"===e.href}catch(e){I=!1}return I}())return void 0!==t?new URL(e,t):new URL(e);if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '"+e+"'");var n=document,r=n.createElement("a");if(void 0!==t){var i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=t,n.head.appendChild(i),n.body.appendChild(r)}return r.href=e,r}var B={allowedTracingOrigins:[],maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,requestErrorResponseLengthLimit:32768,flushTimeout:30*f,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function P(e){var t={};return t.secure=function(e){return!!e.useSecureSessionCookie||!!e.useCrossSiteSessionCookie}(e),t.crossSite=!!e.useCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===A){for(var e="dd_site_test_"+E(),t=window.location.hostname.split("."),n=t.pop();t.length&&!D(e);)n=t.pop()+"."+n,N(e,"test",f,{domain:n});A=n}return A}()),t}function W(e,t,n){var r="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),i=e+"-http-intake.logs."+t.site,o=t.proxyHost?t.proxyHost:i,a=t.proxyHost?"ddhost="+i+"&":"",u=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+a+"ddsource="+(n||"browser")+"&ddtags="+r;return"https://"+o+"/v1/input/"+t.clientToken+"?"+u}function H(e,t){return-1!==k(e).indexOf("/v1/input/")&&(M(e,t.logsEndpoint)||M(e,t.rumEndpoint)||M(e,t.traceEndpoint)||!!t.internalMonitoringEndpoint&&M(e,t.internalMonitoringEndpoint)||!!t.replica&&(M(e,t.replica.logsEndpoint)||M(e,t.replica.rumEndpoint)||M(e,t.replica.internalMonitoringEndpoint)))}function j(e){var t={};return Object.keys(e).forEach((function(n){var r;t[(r=n,r.replace(/[A-Z]/g,(function(e,t){return(0!==t?"_":"")+e.toLowerCase()})).replace(/-/g,"_"))]=function e(t){if(Array.isArray(t))return t.map((function(t){return e(t)}));if("object"==typeof t&&null!==t)return j(t);return t}(e[n])})),t}var F,G=function(e){return Array.isArray(e)},q=function(e){return!Array.isArray(e)&&"object"==typeof e&&null!==e};function z(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=0,i=t;r<i.length;r++){var o=i[r];null!=o&&(e=Y(e,o,$()))}return e}function K(e){return Y(void 0,e,$())}function $(){if("undefined"!=typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}function Y(e,t,n){if(void 0===t)return e;if(!q(t)&&!G(t))return t;if(!n.hasAlreadyBeenSeen(t)){if(q(t)&&(void 0===e||q(e))){var r=e||{};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=Y(r[i],t[i],n));return r}if(G(t)&&(void 0===e||G(e))){(r=e||[]).length=Math.max(r.length,t.length);for(var o=0;o<t.length;o+=1)r[o]=Y(r[o],t[o],n);return r}return t}}function X(e,t,n){return e&&(void 0!==e.message||t instanceof Error)?{message:e.message||"Empty message",stack:J(e),type:e.name}:{message:n+" "+h(t),stack:"No stack, consider using an instance of Error",type:e&&e.name}}function J(e){var t=(e.name||"Error")+": "+e.message;return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",i=e.line?":"+e.line:"",o=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+i+o})),t}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger",e.CUSTOM="custom"}(F||(F={}));var Q=/[^\u0000-\u007F]/,Z=function(){function e(e,t,n){void 0===n&&(n=!1),this.endpointUrl=e,this.bytesLimit=t,this.withBatchTime=n}return e.prototype.send=function(e,t){var n=this.withBatchTime?function(e){return e+(-1===e.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl;if(navigator.sendBeacon&&t<this.bytesLimit&&navigator.sendBeacon(n,e))return;var r=new XMLHttpRequest;r.open("POST",n,!0),r.send(e)},e}();var ee=function(){function e(e,t,n,r,i,o){void 0===o&&(o=T),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=i,this.beforeUnloadCallback=o,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.flush=function(){if(0!==this.bufferMessageCount){var e=o(this.pushOnlyBuffer,(t=this.upsertBuffer,n=[],Object.keys(t).forEach((function(e){n.push(t[e])})),n));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var t,n},e.prototype.sizeInBytes=function(e){return Q.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},e.prototype.addOrUpdate=function(e,t){var n=this.process(e),r=n.processedMessage,i=n.messageBytesSize;i>=this.maxMessageSize?console.warn("Discarded a message whose size was bigger than the maximum allowed size "+this.maxMessageSize+"KB."):(this.hasMessageFor(t)&&this.remove(t),this.willReachedBytesLimitWith(i)&&this.flush(),this.push(r,i,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=h(e);return{processedMessage:t,messageBytesSize:this.sizeInBytes(t)}},e.prototype.push=function(e,t,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesSize+=t,this.bufferMessageCount+=1},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.sizeInBytes(t);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e.prototype.willReachedBytesLimitWith=function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},e.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},e.prototype.flushPeriodically=function(){var e=this;setTimeout((function(){e.flush(),e.flushPeriodically()}),this.flushTimeout)},e.prototype.flushOnVisibilityHidden=function(){var e=this;navigator.sendBeacon&&(window.addEventListener(a.BEFORE_UNLOAD,le(this.beforeUnloadCallback)),document.addEventListener(a.VISIBILITY_CHANGE,le((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(a.BEFORE_UNLOAD,le((function(){return e.flush()}))))},e}(),te="?",ne=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function re(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var ie,oe=function(){var e,t,n,r,i,o,a=[];function u(e,t,n){var r;for(var i in a)if(re(a,i))try{a[i](e,t,n)}catch(e){r=e}if(r)throw r}function s(e,r,i,o,a){if(t)ae.augmentStackTraceWithInitialElement(t,r,i,""+e),f();else if(a)u(ae(a),!0,a);else{var s,c={url:r,column:o,line:i},d=e;if("[object String]"==={}.toString.call(e)){var l=d.match(ne);l&&(s=l[1],d=l[2])}u({name:s,message:d,stack:[c]},!0)}return!!n&&n.apply(this,arguments)}function c(e){var t=e.reason||"Empty reason";u(ae(t),!0,t)}function f(){var n=t,r=e;t=void 0,e=void 0,u(n,!1,r)}function d(n){if(t){if(e===n)return;f()}var r=ae(n);throw t=r,e=n,setTimeout((function(){e===n&&f()}),r.incomplete?2e3:0),n}return d.subscribe=function(e){!function(){if(r)return;n=window.onerror,window.onerror=le(s),r=!0}(),function(){if(o)return;i=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=le(c),o=!0}(),a.push(e)},d.unsubscribe=function(e){for(var t=a.length-1;t>=0;t-=1)a[t]===e&&a.splice(t,1);0===a.length&&(r&&(window.onerror=n,r=!1),o&&(window.onunhandledrejection=i,o=!1))},d.traceKitWindowOnError=s,d}(),ae=function(){var e=!1;function t(e){if(e.stack){for(var t,n,r,i,o=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,s=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=e.stack.split("\n"),d=[],l=0,p=f.length;l<p;l+=1){if(o.exec(f[l])){var E=(r=o.exec(f[l]))[2]&&0===r[2].indexOf("native");t=r[2]&&0===r[2].indexOf("eval"),n=c.exec(r[2]),t&&n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3]),i={args:E?[r[2]]:[],column:r[4]?+r[4]:void 0,func:r[1]||te,line:r[3]?+r[3]:void 0,url:E?void 0:r[2]}}else if(u.exec(f[l]))i={args:[],column:(r=u.exec(f[l]))[4]?+r[4]:void 0,func:r[1]||te,line:+r[3],url:r[2]};else{if(!a.exec(f[l]))continue;t=(r=a.exec(f[l]))[3]&&r[3].indexOf(" > eval")>-1,n=s.exec(r[3]),t&&n?(r[3]=n[1],r[4]=n[2],r[5]=void 0):0!==l||r[5]||void 0===e.columnNumber||(d[0].column=e.columnNumber+1),i={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||te,line:r[4]?+r[4]:void 0,url:r[3]}}!i.func&&i.line&&(i.func=te),d.push(i)}if(d.length)return{stack:d,message:e.message,name:e.name}}}function n(e,t,n,r){var i={url:t,line:n?+n:void 0};if(i.url&&i.line){e.incomplete=!1;var o=e.stack;if(o.length>0&&o[0].url===i.url){if(o[0].line===i.line)return!1;if(!o[0].line&&o[0].func===i.func)return o[0].line=i.line,o[0].context=i.context,!1}return o.unshift(i),e.partial=!0,!0}return e.incomplete=!0,!1}function r(e,t){for(var i,o,a=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,u=[],s={},c=!1,f=r.caller;f&&!c;f=f.caller)f!==ae&&f!==oe&&(o={args:[],column:void 0,func:te,line:void 0,url:void 0},i=a.exec(f.toString()),f.name?o.func=f.name:i&&(o.func=i[1]),void 0===o.func&&(o.func=i?i.input.substring(0,i.input.indexOf("{")):void 0),s[""+f]?c=!0:s[""+f]=!0,u.push(o));t&&u.splice(0,t);var d={stack:u,message:e.message,name:e.name};return n(d,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),d}function i(n,i){var o,a=void 0===i?0:+i;try{if(o=function(e){var t=e.stacktrace;if(t){for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=t.split("\n"),a=[],u=0;u<o.length;u+=2){var s=void 0;r.exec(o[u])?s={args:[],column:void 0,func:(n=r.exec(o[u]))[3],line:+n[1],url:n[2]}:i.exec(o[u])&&(s={args:(n=i.exec(o[u]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),s&&(!s.func&&s.line&&(s.func=te),s.context=[o[u+1]],a.push(s))}if(a.length)return{stack:a,message:e.message,name:e.name}}}(n))return o}catch(t){if(e)throw t}try{if(o=t(n))return o}catch(t){if(e)throw t}try{if(o=function(e){var t=e.message.split("\n");if(!(t.length<4)){var n,r=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,i=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of function script\s*$/i,a=[],u=window&&window.document&&window.document.getElementsByTagName("script"),s=[];for(var c in u)re(u,c)&&!u[c].src&&s.push(u[c]);for(var f=2;f<t.length;f+=2){var d=void 0;if(r.exec(t[f]))d={args:[],column:void 0,func:(n=r.exec(t[f]))[3],line:+n[1],url:n[2]};else if(i.exec(t[f]))d={args:[],column:void 0,func:(n=i.exec(t[f]))[4],line:+n[1],url:n[3]};else if(o.exec(t[f])){n=o.exec(t[f]),d={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}d&&(d.func||(d.func=te),d.context=[t[f+1]],a.push(d))}if(a.length)return{stack:a,message:t[0],name:e.name}}}(n))return o}catch(t){if(e)throw t}try{if(o=r(n,a+1))return o}catch(t){if(e)throw t}return{message:n.message,name:n.name,stack:[]}}return i.augmentStackTraceWithInitialElement=n,i.computeStackTraceFromStackProp=t,i.ofCaller=function(e){var t=1+(void 0===e?0:+e);try{throw new Error}catch(e){return ae(e,t+1)}},i}();!function(e){e.info="info",e.error="error"}(ie||(ie={}));var ue,se,ce,fe={maxMessagesPerPage:0,sentMessageCount:0};function de(e){if(e.internalMonitoringEndpoint){var t=function(e){var t,n=r(e.internalMonitoringEndpoint);void 0!==e.replica&&(t=r(e.replica.internalMonitoringEndpoint));function r(t){return new ee(new Z(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var r=function(e){return z({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==ue?ue():{},e)}(e);n.add(r),t&&t.add(r)}}}(e);!function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))}(fe,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){ue=e}}}function le(e){return function(){try{return e.apply(this,arguments)}catch(e){Te(e);try{Ee(e)}catch(e){Te(e)}}}}function pe(e,t){!function(e){fe.debugMode&&console.log("[MONITORING MESSAGE]",e)}(e),me(r(r({message:e},t),{status:ie.info}))}function Ee(e){me(r(r({},function(e){if(e instanceof Error){var t=ae(e);return{error:{kind:t.name,stack:J(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+h(e)}}(e)),{status:ie.error}))}function me(e){fe.batch&&fe.sentMessageCount<fe.maxMessagesPerPage&&(fe.sentMessageCount+=1,fe.batch.add(e))}function ve(e){fe.debugMode=e}function Te(e){fe.debugMode&&console.warn("[INTERNAL ERROR]",e)}!function(e){e.US="us",e.EU="eu"}(ce||(ce={}));var he,ge=((se={})[ce.EU]="datadoghq.eu",se[ce.US]="datadoghq.com",se);function ye(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,env:e.env,proxyHost:e.proxyHost,sdkVersion:t.sdkVersion,service:e.service,site:e.site||ge[e.datacenter||t.datacenter],version:e.version},i=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],o=r({cookieOptions:P(e),isEnabled:function(e){return y(i,e)},logsEndpoint:W("browser",n),proxyHost:e.proxyHost,rumEndpoint:W("rum",n),service:e.service,traceEndpoint:W("public-trace",n)},B);if(e.internalMonitoringApiKey&&(o.internalMonitoringEndpoint=W("browser",n,"browser-agent-internal-monitoring")),"allowedTracingOrigins"in e&&(o.allowedTracingOrigins=e.allowedTracingOrigins),"sampleRate"in e&&(o.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(o.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(o.trackInteractions=!!e.trackInteractions),n.buildMode===he.E2E_TEST&&(o.internalMonitoringEndpoint="<<< E2E INTERNAL MONITORING ENDPOINT >>>",o.logsEndpoint="<<< E2E LOGS ENDPOINT >>>",o.rumEndpoint="<<< E2E RUM ENDPOINT >>>"),n.buildMode===he.STAGING&&void 0!==e.replica){var a=r(r({},n),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,site:ge[ce.US]});o.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:W("browser",a,"browser-agent-internal-monitoring"),logsEndpoint:W("browser",a),rumEndpoint:W("rum",a)}}return o}(e,t);return{configuration:n,internalMonitoring:de(n)}}function be(e){return!!function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_"+E();return N(t,"test",f,e),"test"===D(t)}catch(e){return console.error(e),!1}}(e)||(console.warn("Cookies are not authorized, we will not send any data."),!1)}function Ce(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(he||(he={}));var _e,Re=1e4,Oe=function(){function e(e){void 0===e&&(e=Re),this.limit=e,this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>this.limit&&this.buffer.splice(0,1)},e.prototype.drain=function(e){this.buffer.forEach((function(t){return e(t)})),this.buffer.length=0},e}();!function(e){e[e.PERFORMANCE_ENTRY_COLLECTED=0]="PERFORMANCE_ENTRY_COLLECTED",e[e.AUTO_ACTION_CREATED=1]="AUTO_ACTION_CREATED",e[e.AUTO_ACTION_COMPLETED=2]="AUTO_ACTION_COMPLETED",e[e.AUTO_ACTION_DISCARDED=3]="AUTO_ACTION_DISCARDED",e[e.VIEW_CREATED=4]="VIEW_CREATED",e[e.VIEW_UPDATED=5]="VIEW_UPDATED",e[e.REQUEST_STARTED=6]="REQUEST_STARTED",e[e.REQUEST_COMPLETED=7]="REQUEST_COMPLETED",e[e.SESSION_RENEWED=8]="SESSION_RENEWED",e[e.DOM_MUTATED=9]="DOM_MUTATED",e[e.BEFORE_UNLOAD=10]="BEFORE_UNLOAD",e[e.RAW_RUM_EVENT_COLLECTED=11]="RAW_RUM_EVENT_COLLECTED",e[e.RAW_RUM_EVENT_V2_COLLECTED=12]="RAW_RUM_EVENT_V2_COLLECTED",e[e.RUM_EVENT_COLLECTED=13]="RUM_EVENT_COLLECTED",e[e.RUM_EVENT_V2_COLLECTED=14]="RUM_EVENT_V2_COLLECTED"}(_e||(_e={}));var Se,we,Ae=function(){function e(){this.callbacks={}}return e.prototype.notify=function(e,t){var n=this.callbacks[e];n&&n.forEach((function(e){return e(t)}))},e.prototype.subscribe=function(e,t){var n=this;return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:function(){n.callbacks[e]=n.callbacks[e].filter((function(e){return t!==e}))}}},e}();function Ie(e,t){void 0===t&&(t=T);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=e.subscribe(_e.RAW_RUM_EVENT_COLLECTED,(function(e){switch(e.rawRumEvent.evt.category){case Se.ERROR:n.errorCount+=1,t(n);break;case Se.USER_ACTION:n.userActionCount+=1,t(n);break;case Se.LONG_TASK:n.longTaskCount+=1,t(n);break;case Se.RESOURCE:n.resourceCount+=1,t(n)}})),i=e.subscribe(_e.RAW_RUM_EVENT_V2_COLLECTED,(function(e){switch(e.rawRumEvent.type){case we.ERROR:n.errorCount+=1,t(n);break;case we.ACTION:n.userActionCount+=1,t(n);break;case we.LONG_TASK:n.longTaskCount+=1,t(n);break;case we.RESOURCE:n.resourceCount+=1,t(n)}}));return{stop:function(){r.unsubscribe(),i.unsubscribe()},eventCounts:n}}!function(e){e.USER_ACTION="user_action",e.ERROR="error",e.LONG_TASK="long_task",e.VIEW="view",e.RESOURCE="resource"}(Se||(Se={})),function(e){e.ACTION="action",e.ERROR="error",e.LONG_TASK="long_task",e.VIEW="view",e.RESOURCE="resource"}(we||(we={}));var Le=function(){function e(){this.observers=[]}return e.prototype.subscribe=function(e){this.observers.push(e)},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}(),Ne=100,De=100,xe=1e4;function Me(e,t){var n=function(e){var t,n=new Le,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(e.subscribe(_e.DOM_MUTATED,(function(){return o()}))),r.push(e.subscribe(_e.PERFORMANCE_ENTRY_COLLECTED,(function(e){"resource"===e.entryType&&o()}))),r.push(e.subscribe(_e.REQUEST_STARTED,(function(e){void 0===t&&(t=e.requestIndex),i+=1,o()}))),r.push(e.subscribe(_e.REQUEST_COMPLETED,(function(e){void 0===t||e.requestIndex<t||(i-=1,o())}))),{observable:n,stop:function(){r.forEach((function(e){return e.unsubscribe()}))}}}(e),r=n.observable,i=n.stop,o=function(e,t,n){var r,i=!1,o=setTimeout(le((function(){return s(!1,0)})),Ne),a=setTimeout(le((function(){return s(!0,performance.now())})),xe);function u(){i=!0,clearTimeout(o),clearTimeout(r),clearTimeout(a),t()}function s(e,t){i||(u(),n(e,t))}return e.subscribe((function(e){var t=e.isBusy;clearTimeout(o),clearTimeout(r);var n=performance.now();t||(r=setTimeout(le((function(){return s(!0,n)})),De))})),{stop:u}}(r,i,t).stop;return{stop:function(){o(),i()}}}function Ue(e){return function(e){var t;if(function(){void 0===Pe&&(Pe="closest"in HTMLElement.prototype);return Pe}())t=e.closest("["+ke+"]");else for(var n=e;n;){if(n.hasAttribute(ke)){t=n;break}n=n.parentElement}if(!t)return;return ze(qe(t.getAttribute(ke).trim()))}(e)||Ge(e,He)||Ge(e,je)||""}var ke="data-dd-action-name";var Ve,Be,Pe,We,He=[function(e){if(function(){void 0===Be&&(Be="labels"in HTMLInputElement.prototype);return Be}()){if("labels"in e&&e.labels&&e.labels.length>0)return Ke(e.labels[0])}else if(e.id){var t=e.ownerDocument&&e.ownerDocument.querySelector('label[for="'+e.id.replace('"','\\"')+'"]');return t&&Ke(t)}},function(e){if("INPUT"===e.nodeName){var t=e,n=t.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return t.value}},function(e){if("BUTTON"===e.nodeName||"LABEL"===e.nodeName||"button"===e.getAttribute("role"))return Ke(e)},function(e){return e.getAttribute("aria-label")},function(e){var t=e.getAttribute("aria-labelledby");if(t)return t.split(/\s+/).map((function(t){return function(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}(e,t)})).filter((function(e){return Boolean(e)})).map(Ke).join(" ")},function(e){return e.getAttribute("alt")},function(e){return e.getAttribute("name")},function(e){return e.getAttribute("title")},function(e){return e.getAttribute("placeholder")},function(e){if("options"in e&&e.options.length>0)return Ke(e.options[0])}],je=[function(e){return Ke(e)}],Fe=10;function Ge(e,t){for(var n=e,r=0;r<=Fe&&n&&"BODY"!==n.nodeName&&"HTML"!==n.nodeName&&"HEAD"!==n.nodeName;){for(var i=0,o=t;i<o.length;i++){var a=(0,o[i])(n);if("string"==typeof a){var u=a.trim();if(u)return ze(qe(u))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function qe(e){return e.replace(/\s+/g," ")}function ze(e){return e.length>100?(n=100,((r=(t=e).charCodeAt(n-1))>=55296&&r<=56319?t.slice(0,n+1):t.slice(0,n))+" [...]"):e;var t,n,r}function Ke(e){if(!e.isContentEditable){if("innerText"in e){var t=e.innerText;if(!function(){if(void 0===Ve){var e=document.createElement("style");e.textContent="*";var t=document.createElement("div");t.appendChild(e),document.body.appendChild(t),Ve=""===t.innerText,document.body.removeChild(t)}return Ve}())for(var n=e.querySelectorAll("script, style"),r=0;r<n.length;r+=1){var i=n[r].innerText;i.trim().length>0&&(t=t.replace(i,""))}return t}return e.textContent}}function $e(e){var t=function(e){var t,n;return{create:function(r,i){if(!t){var o=new Ye(e,r,i);t=o,n=Me(e,(function(e,n){e?o.complete(n):o.discard(),t=void 0}))}},discardCurrent:function(){t&&(n.stop(),t.discard(),t=void 0)}}}(e);function n(e){if(e.target instanceof Element){var n=Ue(e.target);n&&t.create(We.CLICK,n)}}return e.subscribe(_e.VIEW_CREATED,(function(){t.discardCurrent()})),addEventListener(a.CLICK,n,{capture:!0}),{stop:function(){t.discardCurrent(),removeEventListener(a.CLICK,n,{capture:!0})}}}!function(e){e.CLICK="click",e.CUSTOM="custom"}(We||(We={}));var Ye=function(){function e(e,t,n){this.lifeCycle=e,this.type=t,this.name=n,this.id=E(),this.startTime=performance.now(),this.eventCountsSubscription=Ie(e),this.lifeCycle.notify(_e.AUTO_ACTION_CREATED,{id:this.id,startTime:this.startTime})}return e.prototype.complete=function(e){var t=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(_e.AUTO_ACTION_COMPLETED,{counts:{errorCount:t.errorCount,longTaskCount:t.longTaskCount,resourceCount:t.resourceCount},duration:e-this.startTime,id:this.id,name:this.name,startTime:this.startTime,type:this.type}),this.eventCountsSubscription.stop()},e.prototype.discard=function(){this.lifeCycle.notify(_e.AUTO_ACTION_DISCARDED),this.eventCountsSubscription.stop()},e}();function Xe(e){var t,n=function(){var e,t=window;if(t.Zone){var n=t.Zone.__symbol__("MutationObserver");e=t[n]}return e||(e=t.MutationObserver),e}();return n&&(t=new n(le((function(){e.notify(_e.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){t&&t.disconnect()}}}var Je="initial_document",Qe=[[u.DOCUMENT,function(e){return Je===e}],[u.XHR,function(e){return"xmlhttprequest"===e}],[u.FETCH,function(e){return"fetch"===e}],[u.BEACON,function(e){return"beacon"===e}],[u.CSS,function(e,t){return null!==t.match(/\.css$/i)}],[u.JS,function(e,t){return null!==t.match(/\.js$/i)}],[u.IMAGE,function(e,t){return y(["image","img","icon"],e)||null!==t.match(/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i)}],[u.FONT,function(e,t){return null!==t.match(/\.(woff|eot|woff2|ttf)$/i)}],[u.MEDIA,function(e,t){return y(["audio","video"],e)||null!==t.match(/\.(mp3|mp4)$/i)}]];function Ze(e){var t=e.name;if(!function(e){try{return!!V(e)}catch(e){return!1}}(t))return pe('Failed to construct URL for "'+e.name+'"'),u.OTHER;for(var n=k(t),r=0,i=Qe;r<i.length;r++){var o=i[r],a=o[0];if((0,o[1])(e.initiatorType,n))return a}return u.OTHER}function et(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var n=1;n<e.length;n+=1)if(e[n-1]>e[n])return!1;return!0}function tt(e){var t=e.duration,n=e.startTime,r=e.responseEnd;return v(0===t&&n<r?r-n:t)}function nt(e){var t=rt(e);if(t){var n=t.startTime,r=t.fetchStart,i=t.redirectStart,o=t.redirectEnd,a=t.domainLookupStart,u=t.domainLookupEnd,s=t.connectStart,c=t.secureConnectionStart,f=t.connectEnd,d=t.requestStart,l=t.responseStart,p={download:ot(n,l,t.responseEnd),firstByte:ot(n,d,l)};return f!==r&&(p.connect=ot(n,s,f),et(s,c,f)&&(p.ssl=ot(n,c,f))),u!==r&&(p.dns=ot(n,a,u)),it(e)&&(p.redirect=ot(n,i,o)),p}}function rt(e){if(et(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd)){if(!it(e))return e;var t=e.redirectStart,n=e.redirectEnd;if(t<e.startTime&&(t=e.startTime),n<e.startTime&&(n=e.fetchStart),et(e.startTime,t,n,e.fetchStart))return r(r({},e),{redirectEnd:n,redirectStart:t})}}function it(e){return e.fetchStart!==e.startTime}function ot(e,t,n){return{duration:v(n-t),start:v(t-e)}}function at(e){if(e.startTime<e.responseStart)return e.decodedBodySize}function ut(e,t){return t&&!H(t,e)}var st,ct,ft=2*d;function dt(e){var t=function(e){var t=e.querySelector("meta[name=dd-trace-id]"),n=e.querySelector("meta[name=dd-trace-time]");return lt(t&&t.content,n&&n.content)}(e)||function(e){var t=function(e){for(var t=0;t<e.childNodes.length;t+=1){if(n=pt(e.childNodes[t]))return n}if(e.body)for(t=e.body.childNodes.length-1;t>=0;t-=1){var n,r=e.body.childNodes[t];if(n=pt(r))return n;if(!Et(r))break}}(e);if(!t)return;return lt(w(t,"trace-id"),w(t,"trace-time"))}(e);if(t&&!(t.traceTime<=Date.now()-ft))return t.traceId}function lt(e,t){var n=t&&Number(t);if(e&&n)return{traceId:e,traceTime:n}}function pt(e){if(e&&function(e){return"#comment"===e.nodeName}(e)){var t=e.data.match(/^\s*DATADOG;(.*?)\s*$/);if(t)return t[1]}}function Et(e){return"#text"===e.nodeName}function mt(){return void 0!==window.performance&&"getEntries"in performance}function vt(){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("navigation")}function Tt(e,t){var n;if(n=function(n){bt(e,t,n)},ht("interactive",(function(){var e,t={entryType:"resource",initiatorType:Je,traceId:dt(document)};if(vt()&&performance.getEntriesByType("navigation").length>0){var i=performance.getEntriesByType("navigation")[0];e=r(r({},i.toJSON()),t)}else{var o=gt();e=r(r(r({},o),{decodedBodySize:0,duration:o.responseEnd,name:window.location.href,startTime:0}),t)}n(e)})),mt()&&yt(e,t,performance.getEntries()),window.PerformanceObserver){var i=new PerformanceObserver(le((function(n){return yt(e,t,n.getEntries())}))),o=["resource","navigation","longtask"];"visible"===document.visibilityState&&o.push("paint"),i.observe({entryTypes:o}),mt()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}vt()||function(e){function t(){e(r(r({},gt()),{entryType:"navigation"}))}ht("complete",(function(){setTimeout(le(t))}))}((function(n){bt(e,t,n)}))}function ht(e,t){if(document.readyState===e||"complete"===document.readyState)t();else{var n="complete"===e?a.LOAD:a.DOM_CONTENT_LOADED,r=le((function(){window.removeEventListener(n,r),t()}));window.addEventListener(n,r)}}function gt(){var e={},t=performance.timing;for(var n in t)C(t[n])&&(e[n]=0===t[n]?0:t[n]-R());return e}function yt(e,t,n){n.forEach((function(n){"resource"!==n.entryType&&"navigation"!==n.entryType&&"paint"!==n.entryType&&"longtask"!==n.entryType||bt(e,t,n)}))}function bt(e,t,n){(function(e){return"navigation"===e.entryType&&e.loadEventEnd<=0})(n)||function(e,t){return"resource"===t.entryType&&!ut(e,t.name)}(t,n)||e.notify(_e.PERFORMANCE_ENTRY_COLLECTED,n)}function Ct(e,t,n,r,i,o){n.subscribe(_e.RAW_RUM_EVENT_COLLECTED,(function(a){var u,s=a.startTime,c=a.rawRumEvent,f=a.savedGlobalContext,d=a.customerContext,l=i.findView(s);if(r.isTracked()&&l&&l.sessionId){var p=i.findAction(s),E={applicationId:e,date:(new Date).getTime(),service:t.service,session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?st.USER:st.SYNTHETICS}},m=(u=c,-1!==[Se.ERROR,Se.RESOURCE,Se.LONG_TASK].indexOf(u.evt.category)?z(E,l,p,c):z(E,l,c)),v=z(f||o(),d,j(m));n.notify(_e.RUM_EVENT_COLLECTED,{rumEvent:m,serverRumEvent:v})}}))}function _t(e,t,n,r,i,o){n.subscribe(_e.RAW_RUM_EVENT_V2_COLLECTED,(function(a){var u,s=a.startTime,c=a.rawRumEvent,f=a.savedGlobalContext,d=a.customerContext,l=i.findViewV2(s);if(r.isTracked()&&l&&l.session.id){var p=i.findActionV2(s),E={_dd:{formatVersion:2},application:{id:e},date:(new Date).getTime(),service:t.service,session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?ct.USER:ct.SYNTHETICS}},m=(u=c,-1!==[we.ERROR,we.RESOURCE,we.LONG_TASK].indexOf(u.type)?z(E,l,p,c):z(E,l,c)),v=j(m);v.context=z(f||o(),d),n.notify(_e.RUM_EVENT_V2_COLLECTED,{rumEvent:m,serverRumEvent:v})}}))}!function(e){e.SYNTHETICS="synthetics",e.USER="user"}(st||(st={})),function(e){e.SYNTHETICS="synthetics",e.USER="user"}(ct||(ct={}));var Rt="_dd",Ot="_dd_r",St="_dd_l",wt="rum",At="logs";var It="_dd_s",Lt=15*d,Nt=4*l,Dt=d;function xt(e,t,n){var r=function(e,t){var n,r,i=!1,o=function(){i=!0,window.clearTimeout(n),n=window.setTimeout((function(){i=!1}),L)};return{get:function(){return i?r:(r=D(e),o(),r)},set:function(n,i){N(e,n,i,t),r=n,o()}}}(It,e);!function(e){var t=e.get(),n=D(Rt),r=D(Ot),i=D(St);if(!t){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[At]=i),r&&/^[012]$/.test(r)&&(o[wt]=r),Vt(o,e)}}(r);var i=new Le,o=kt(r).id,u=p((function(){var e=kt(r),a=n(e[t]),u=a.trackingType,s=a.isTracked;e[t]=u,s&&!e.id&&(e.id=E(),e.created=String(Date.now())),Vt(e,r),s&&o!==e.id&&(o=e.id,i.notify())}),L).throttled;return u(),function(e){var t=le(e),n={capture:!0,passive:!0};[a.CLICK,a.TOUCH_START,a.KEY_DOWN,a.SCROLL].forEach((function(e){document.addEventListener(e,t,n),Pt.push((function(){return document.removeEventListener(e,t,n)}))}))}(u),function(e){var t=le((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,Dt);document.addEventListener(a.VISIBILITY_CHANGE,t),Pt.push((function(){clearInterval(n),document.removeEventListener(a.VISIBILITY_CHANGE,t)}))}((function(){Vt(kt(r),r)})),{getId:function(){return kt(r).id},getTrackingType:function(){return kt(r)[t]},renewObservable:i}}var Mt=/^([a-z]+)=([a-z0-9-]+)$/,Ut="&";function kt(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf(Ut)||Mt.test(e))})(t)&&t.split(Ut).forEach((function(e){var t=Mt.exec(e);if(null!==t){var r=t[1],i=t[2];n[r]=i}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<Nt)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(Bt(e),{})}function Vt(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+Lt);var r=O(e).map((function(e){return e[0]+"="+e[1]})).join(Ut);t.set(r,Lt)}else Bt(t)}function Bt(e){e.set("",0)}var Pt=[];var Wt,Ht=Nt,jt=5*d,Ft=d;var Gt,qt,zt,Kt,$t=[],Yt=[];function Xt(){return Wt||(Gt=XMLHttpRequest.prototype.open,qt=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=le((function(e,t){return this._datadog_xhr={method:e,startTime:-1,url:x(t)},Gt.apply(this,arguments)})),XMLHttpRequest.prototype.send=le((function(e){var t=this;if(this._datadog_xhr){this._datadog_xhr.startTime=performance.now();var n=this.onreadystatechange;this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&le(i)(),n&&n.apply(this,arguments)};var r=!1,i=function(){r||(r=!0,t._datadog_xhr.duration=performance.now()-t._datadog_xhr.startTime,t._datadog_xhr.response=t.response,t._datadog_xhr.status=t.status,Yt.forEach((function(e){return e(t._datadog_xhr)})))};this.addEventListener("loadend",le(i)),$t.forEach((function(e){return e(t._datadog_xhr,t)}))}return qt.apply(this,arguments)})),Wt={beforeSend:function(e){$t.push(e)},onRequestComplete:function(e){Yt.push(e)}}),Wt}var Jt=[],Qt=[];function Zt(){return zt||(!function(){if(!window.fetch)return;Kt=window.fetch,window.fetch=le((function(e,t){var n=this,r=t&&t.method||"object"==typeof e&&e.method||"GET",o=x("object"==typeof e&&e.url||e),a={init:t,method:r,startTime:performance.now(),url:o},u=function(e){return t=n,r=void 0,u=function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return a.duration=performance.now()-a.startTime,"stack"in e||e instanceof Error?(a.status=0,a.response=J(ae(e)),Qt.forEach((function(e){return e(a)})),[3,6]):[3,1];case 1:if(!("status"in e))return[3,6];t=void 0,r.label=2;case 2:return r.trys.push([2,4,,5]),[4,e.clone().text()];case 3:return t=r.sent(),[3,5];case 4:return n=r.sent(),t="Unable to retrieve response: "+n,[3,5];case 5:a.response=t,a.responseType=e.type,a.status=e.status,Qt.forEach((function(e){return e(a)})),r.label=6;case 6:return[2]}}))},new((o=void 0)||(o=Promise))((function(e,n){function i(e){try{s(u.next(e))}catch(e){n(e)}}function a(e){try{s(u.throw(e))}catch(e){n(e)}}function s(t){t.done?e(t.value):new o((function(e){e(t.value)})).then(i,a)}s((u=u.apply(t,r||[])).next())}));var t,r,o,u};Jt.forEach((function(e){return e(a)}));var s=Kt.call(this,e,a.init);return s.then(le(u),le(u)),s}))}(),zt={beforeSend:function(e){Jt.push(e)},onRequestComplete:function(e){Qt.push(e)}}),zt}function en(e,t,n){if(void 0!==tn()&&function(e,t){for(var n=U(t),r=0,i=e.allowedTracingOrigins;r<i.length;r++){var o=i[r];if(n===o||o instanceof RegExp&&o.test(n))return!0}return!1}(e,t)){var r=new un,i=new un;return n(function(e,t){return{"x-datadog-origin":"rum","x-datadog-parent-id":t.toDecimalString(),"x-datadog-sampled":"1","x-datadog-sampling-priority":"1","x-datadog-trace-id":e.toDecimalString()}}(r,i)),{traceId:r,spanId:i}}}function tn(){return window.crypto||window.msCrypto}var nn,rn,on,an,un=function(){function e(){this.buffer=new Uint8Array(8),tn().getRandomValues(this.buffer),this.buffer[0]=127&this.buffer[0]}return e.prototype.toString=function(e){for(var t=this.readInt32(0),n=this.readInt32(4),r="";;){var i=t%e*4294967296+n;if(t=Math.floor(t/e),n=Math.floor(i/e),r=(i%e).toString(e)+r,!t&&!n)break}return r},e.prototype.toDecimalString=function(){return this.toString(10)},e.prototype.readInt32=function(e){return 16777216*this.buffer[e]+(this.buffer[e+1]<<16)+(this.buffer[e+2]<<8)+this.buffer[e+3]},e}(),sn=1;function cn(e,t){var n=function(e){return{traceFetch:function(t){return en(e,t.url,(function(e){t.init=r({},t.init);var n=[];t.init.headers instanceof Headers?t.init.headers.forEach((function(e,t){n.push([t,e])})):Array.isArray(t.init.headers)?t.init.headers.forEach((function(e){n.push(e)})):t.init.headers&&Object.keys(t.init.headers).forEach((function(e){n.push([e,t.init.headers[e]])})),t.init.headers=n.concat(O(e))}))},traceXhr:function(t,n){return en(e,t.url,(function(e){Object.keys(e).forEach((function(t){n.setRequestHeader(t,e[t])}))}))}}}(t);!function(e,t,n){var r=Xt();r.beforeSend((function(r,i){if(ut(t,r.url)){var o=n.traceXhr(r,i);o&&(r.traceId=o.traceId,r.spanId=o.spanId),r.requestIndex=fn(),e.notify(_e.REQUEST_STARTED,{requestIndex:r.requestIndex})}})),r.onRequestComplete((function(n){ut(t,n.url)&&e.notify(_e.REQUEST_COMPLETED,{duration:n.duration,method:n.method,requestIndex:n.requestIndex,response:n.response,spanId:n.spanId,startTime:n.startTime,status:n.status,traceId:n.traceId,type:s.XHR,url:n.url})}))}(e,t,n),function(e,t,n){var r=Zt();r.beforeSend((function(r){if(ut(t,r.url)){var i=n.traceFetch(r);i&&(r.traceId=i.traceId,r.spanId=i.spanId),r.requestIndex=fn(),e.notify(_e.REQUEST_STARTED,{requestIndex:r.requestIndex})}})),r.onRequestComplete((function(n){ut(t,n.url)&&e.notify(_e.REQUEST_COMPLETED,{duration:n.duration,method:n.method,requestIndex:n.requestIndex,response:n.response,responseType:n.responseType,spanId:n.spanId,startTime:n.startTime,status:n.status,traceId:n.traceId,type:s.FETCH,url:n.url})}))}(e,t,n)}function fn(){var e=sn;return sn+=1,e}function dn(e,t){return e.subscribe(_e.AUTO_ACTION_COMPLETED,(function(n){t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,pn(n)):e.notify(_e.RAW_RUM_EVENT_COLLECTED,ln(n))})),t.trackInteractions&&$e(e),{addAction:function(n,i){t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,r({savedGlobalContext:i},pn(n))):e.notify(_e.RAW_RUM_EVENT_COLLECTED,r({savedGlobalContext:i},ln(n)))}}}function ln(e){var t=En(e)?{duration:v(e.duration),userAction:{id:e.id,measures:e.counts}}:void 0;return{customerContext:En(e)?void 0:e.context,rawRumEvent:z({date:_(e.startTime),evt:{category:Se.USER_ACTION,name:e.name},userAction:{type:e.type}},t),startTime:e.startTime}}function pn(e){var t=En(e)?{action:{error:{count:e.counts.errorCount},id:e.id,loadingTime:v(e.duration),longTask:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}}}:void 0;return{customerContext:En(e)?void 0:e.context,rawRumEvent:z({action:{target:{name:e.name},type:e.type},date:_(e.startTime),type:we.ACTION},t),startTime:e.startTime}}function En(e){return e.type!==We.CUSTOM}function mn(e){if(!nn){var t=new Le;!function(e,t){function n(n,r){H(r.url,e)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!function(e){return e.status>=500}(r)||t.notify({message:hn(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:F.NETWORK,stack:Tn(r.response,e)||"Failed to load",startTime:r.startTime})}Xt().onRequestComplete((function(e){return n(s.XHR,e)})),Zt().onRequestComplete((function(e){return n(s.FETCH,e)}))}(e,t),function(e){rn=console.error,console.error=le((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];rn.apply(console,o([t],n)),e.notify({message:o(["console error:",t],n).map(vn).join(" "),source:F.CONSOLE,startTime:performance.now()})}))}(t),function(e){on=function(t,n,r){var i=X(t,r,"Uncaught"),o=i.stack,a=i.message,u=i.type;e.notify({message:a,stack:o,type:u,source:F.SOURCE,startTime:performance.now()})},oe.subscribe(on)}(t),nn=function(e,t){var n=0,r=new Le;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,source:F.AGENT,startTime:performance.now()}))})),setInterval((function(){return n=0}),d),r}(e,t)}return nn}function vn(e){return"string"==typeof e?e:e instanceof Error?J(ae(e)):h(e,0,2)}function Tn(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function hn(e){return s.XHR===e?"XHR":"Fetch"}function gn(e,t){return function(e,t,n){return n.subscribe((function(n){t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,bn(n)):e.notify(_e.RAW_RUM_EVENT_COLLECTED,yn(n))})),{addError:function(n,i){var o=n.error,a=n.startTime,u=n.context,s=function(e,t,n){var i=e instanceof Error?ae(e):void 0;return r({startTime:t,source:n},X(i,e,"Provided"))}(o,a,n.source);t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,r({customerContext:u,savedGlobalContext:i},bn(s))):e.notify(_e.RAW_RUM_EVENT_COLLECTED,r({customerContext:u,savedGlobalContext:i},yn(s)))}}}(e,t,mn(t))}function yn(e){return{rawRumEvent:z({date:_(e.startTime),error:{kind:e.type,origin:e.source,stack:e.stack},evt:{category:Se.ERROR},message:e.message},e.resource?{http:{method:e.resource.method,status_code:e.resource.statusCode,url:e.resource.url}}:void 0),startTime:e.startTime}}function bn(e){return{rawRumEvent:{date:_(e.startTime),error:{message:e.message,resource:e.resource,source:e.source,stack:e.stack,type:e.type},type:we.ERROR},startTime:e.startTime}}function Cn(e){if(performance&&"getEntriesByName"in performance){var t,n=performance.getEntriesByName(e.url,"resource").map((function(e){return e.toJSON()})).filter(rt).filter((function(t){return n=t,r=e.startTime,i=_n(e),n.startTime>=r&&_n(n)<=i;var n,r,i}));return 1===n.length?n[0]:2===n.length&&_n((t=n)[0])<=t[1].startTime?n[1]:void 0}}function _n(e){return e.startTime+e.duration}function Rn(e,t,n){e.subscribe(_e.REQUEST_COMPLETED,(function(r){n.isTrackedWithResource()&&(t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,function(e){var t=e.type===s.XHR?u.XHR:u.FETCH,n=Cn(e),r=n?n.startTime:e.startTime,i=n?Sn(n):void 0,o=wn(e),a=z({date:_(r),resource:{type:t,duration:v(e.duration),method:e.method,statusCode:e.status,url:e.url},type:we.RESOURCE},o,i);return{startTime:r,rawRumEvent:a}}(r)):e.notify(_e.RAW_RUM_EVENT_COLLECTED,function(e){var t=e.type===s.XHR?u.XHR:u.FETCH,n=Cn(e),r=n?n.startTime:e.startTime,i=n?On(n):void 0,o=wn(e),a=z({date:_(r),duration:v(e.duration),evt:{category:Se.RESOURCE},http:{method:e.method,statusCode:e.status,url:e.url},resource:{kind:t}},o,i);return{startTime:r,rawRumEvent:a}}(r)))})),e.subscribe(_e.PERFORMANCE_ENTRY_COLLECTED,(function(r){var i;n.isTrackedWithResource()&&"resource"===r.entryType&&("xmlhttprequest"!==(i=r).initiatorType&&"fetch"!==i.initiatorType)&&(t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,function(e){var t=Ze(e),n=Sn(e),r=An(e),i=z({date:_(e.startTime),resource:{type:t,url:e.name},type:we.RESOURCE},r,n);return{startTime:e.startTime,rawRumEvent:i}}(r)):e.notify(_e.RAW_RUM_EVENT_COLLECTED,function(e){var t=Ze(e),n=On(e),r=An(e),i=z({date:_(e.startTime),evt:{category:Se.RESOURCE},http:{url:e.name},resource:{kind:t}},r,n);return{startTime:e.startTime,rawRumEvent:i}}(r)))}))}function On(e){return{duration:tt(e),http:{performance:nt(e)},network:{bytesWritten:at(e)}}}function Sn(e){return{resource:r({duration:tt(e),size:at(e)},nt(e))}}function wn(e){if(e.traceId&&e.spanId)return{_dd:{spanId:e.spanId.toDecimalString(),traceId:e.traceId.toDecimalString()},resource:{id:E()}}}function An(e){return e.traceId?{_dd:{traceId:e.traceId}}:void 0}!function(e){e.INITIAL_LOAD="initial_load",e.ROUTE_CHANGE="route_change"}(an||(an={}));var In=3e3,Ln=5*d;function Nn(e,t){var n,i=Dn(t,e,an.INITIAL_LOAD,document.referrer,0),o=i,u=function(e,t){var n;return{stop:e.subscribe(_e.PERFORMANCE_ENTRY_COLLECTED,(function(e){"navigation"===e.entryType?(n=r(r({},n),{domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEventEnd:e.loadEventEnd}),t(n)):"paint"===e.entryType&&"first-contentful-paint"===e.name&&(n=r(r({},n),{firstContentfulPaint:e.startTime}),t(n))})).unsubscribe}}(t,(function(e){i.updateTimings(e),i.scheduleUpdate()})).stop;function s(){o.isDifferentView(e)?(o.triggerUpdate(),o.end(),o=Dn(t,e,an.ROUTE_CHANGE,o.url)):(o.updateLocation(e),o.triggerUpdate())}!function(e){var t=history.pushState;history.pushState=le((function(){t.apply(this,arguments),e()}));var n=history.replaceState;history.replaceState=le((function(){n.apply(this,arguments),e()})),window.addEventListener(a.POP_STATE,le(e))}(s),n=s,window.addEventListener("hashchange",le(n)),t.subscribe(_e.SESSION_RENEWED,(function(){o.end(),o=Dn(t,e,an.ROUTE_CHANGE,o.url)})),t.subscribe(_e.BEFORE_UNLOAD,(function(){o.triggerUpdate(),o.end()}));var c=window.setInterval(le((function(){o.triggerUpdate()})),Ln);return{stop:function(){u(),o.end(),clearInterval(c)}}}function Dn(e,t,n,i,o){void 0===o&&(o=performance.now());var a,u,s=E(),c={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},f={},d=0,l=r({},t);e.notify(_e.VIEW_CREATED,{id:s,startTime:o,location:l,referrer:i});var m=p(le(_),In,{leading:!1}),v=m.throttled,T=m.cancel,h=Ie(e,(function(e){c=e,v()})).stop,g=function(e,t){var n=e===an.INITIAL_LOAD,r=!0,i=[];function o(){!r&&!n&&i.length>0&&t(Math.max.apply(Math,i))}return{setLoadEventEnd:function(e){n&&(n=!1,i.push(e),o())},setActivityLoadingTime:function(e){r&&(r=!1,void 0!==e&&i.push(e),o())}}}(n,(function(e){a=e,v()})),y=g.setActivityLoadingTime,b=g.setLoadEventEnd,C=function(e,t){var n=performance.now();return{stop:Me(e,(function(e,r){t(e?r-n:void 0)})).stop}}(e,y).stop;function _(){d+=1,e.notify(_e.VIEW_UPDATED,{documentVersion:d,eventCounts:c,id:s,loadingTime:a,loadingType:n,location:l,referrer:i,startTime:o,timings:f,duration:(void 0===u?performance.now():u)-o})}return(_(),{scheduleUpdate:v,end:function(){u=performance.now(),h(),C()},isDifferentView:function(e){return l.pathname!==e.pathname||(t=e.hash,n=t.substr(1),!document.getElementById(n)&&e.hash!==l.hash);var t,n},triggerUpdate:function(){T(),_()},updateTimings:function(e){f=e,void 0!==e.loadEventEnd&&b(e.loadEventEnd)},updateLocation:function(e){l=r({},e)},get url(){return l.href}})}function xn(e,t,n){return e.subscribe(_e.VIEW_UPDATED,(function(n){t.isEnabled("v2_format")?e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,function(e){return{rawRumEvent:{_dd:{documentVersion:e.documentVersion},date:_(e.startTime),type:we.VIEW,view:{action:{count:e.eventCounts.userActionCount},domComplete:v(e.timings.domComplete),domContentLoaded:v(e.timings.domContentLoaded),domInteractive:v(e.timings.domInteractive),error:{count:e.eventCounts.errorCount},firstContentfulPaint:v(e.timings.firstContentfulPaint),loadEventEnd:v(e.timings.loadEventEnd),loadingTime:v(e.loadingTime),loadingType:e.loadingType,longTask:{count:e.eventCounts.longTaskCount},resource:{count:e.eventCounts.resourceCount},timeSpent:v(e.duration)}},startTime:e.startTime}}(n)):e.notify(_e.RAW_RUM_EVENT_COLLECTED,function(e){return{rawRumEvent:{date:_(e.startTime),duration:v(e.duration),evt:{category:Se.VIEW},rum:{documentVersion:e.documentVersion},view:{loadingTime:v(e.loadingTime),loadingType:e.loadingType,measures:r(r({},e.eventCounts),{domComplete:v(e.timings.domComplete),domContentLoaded:v(e.timings.domContentLoaded),domInteractive:v(e.timings.domInteractive),firstContentfulPaint:v(e.timings.firstContentfulPaint),loadEventEnd:v(e.timings.loadEventEnd)})}},startTime:e.startTime}}(n))})),Nn(n,e)}var Mn,Un="rum";function kn(e,t){var n=xt(e.cookieOptions,Un,(function(t){return function(e,t){var n;n=function(e){return e===Mn.NOT_TRACKED||e===Mn.TRACKED_WITH_RESOURCES||e===Mn.TRACKED_WITHOUT_RESOURCES}(t)?t:m(e.sampleRate)?m(e.resourceSampleRate)?Mn.TRACKED_WITH_RESOURCES:Mn.TRACKED_WITHOUT_RESOURCES:Mn.NOT_TRACKED;return{trackingType:n,isTracked:Vn(n)}}(e,t)}));return n.renewObservable.subscribe((function(){t.notify(_e.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&Vn(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===Mn.TRACKED_WITH_RESOURCES}}}function Vn(e){return e===Mn.TRACKED_WITH_RESOURCES||e===Mn.TRACKED_WITHOUT_RESOURCES}function Bn(e,t){var n=function(e,t){var n,r=o(e.rumEndpoint,(function(){return t.notify(_e.BEFORE_UNLOAD)})),i=e.replica;void 0!==i&&(n=o(i.rumEndpoint));function o(t,n){return new ee(new Z(t,e.batchBytesLimit,!0),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,n)}function a(e){return z(e,{application_id:i.applicationId})}var u=!1;return{add:function(e){u||(r.add(e),n&&n.add(a(e)))},stop:function(){u=!0},upsert:function(e,t){u||(r.upsert(e,t),n&&n.upsert(a(e),t))}}}(e,t);return t.subscribe(_e.RUM_EVENT_COLLECTED,(function(e){var t=e.rumEvent,r=e.serverRumEvent;t.evt.category===Se.VIEW?n.upsert(r,t.view.id):n.add(r)})),t.subscribe(_e.RUM_EVENT_V2_COLLECTED,(function(e){var t=e.rumEvent,r=e.serverRumEvent;t.type===we.VIEW?n.upsert(r,t.view.id):n.add(r)})),{stop:function(){n.stop()}}}!function(e){e.NOT_TRACKED="0",e.TRACKED_WITH_RESOURCES="1",e.TRACKED_WITHOUT_RESOURCES="2"}(Mn||(Mn={}));var Pn={buildMode:"release",datacenter:"us",sdkVersion:"1.25.4"};var Wn,Hn,jn,Fn,Gn=qn((function(e,t){var n=new Ae,r=ye(e,Pn),i=r.configuration,o=r.internalMonitoring,a=kn(i,n);o.setExternalContextProvider((function(){return z({application_id:e.applicationId},s.findView(),t())}));var u=function(e,t,n,r,i,o){var a=function(e,t){var n,r,i,o=[],a=[];e.subscribe(_e.VIEW_CREATED,(function(e){n&&o.unshift({context:c(),endTime:e.startTime,startTime:n.startTime}),n=e,i=t.getId()})),e.subscribe(_e.VIEW_UPDATED,(function(e){n.id===e.id&&(n=e)})),e.subscribe(_e.AUTO_ACTION_CREATED,(function(e){r=e})),e.subscribe(_e.AUTO_ACTION_COMPLETED,(function(e){r&&a.unshift({context:f(),endTime:r.startTime+e.duration,startTime:r.startTime}),r=void 0})),e.subscribe(_e.AUTO_ACTION_DISCARDED,(function(){r=void 0})),e.subscribe(_e.SESSION_RENEWED,(function(){o=[],a=[],n=void 0,r=void 0}));var u=window.setInterval(le((function(){s(o,Ht),s(a,jt)})),Ft);function s(e,t){for(var n=performance.now()-t;e.length>0&&e[e.length-1].startTime<n;)e.pop()}function c(){return{sessionId:i,view:{id:n.id,referrer:n.referrer,url:n.location.href}}}function f(){return{userAction:{id:r.id}}}function d(e,t,n,r){if(void 0===r)return n?e():void 0;if(n&&r>=n.startTime)return e();for(var i=0,o=t;i<o.length;i++){var a=o[i];if(r>a.endTime)break;if(r>=a.startTime)return a.context}}var l={findAction:function(e){return d(f,a,r,e)},findActionV2:function(e){var t=l.findAction(e);if(t)return{action:{id:t.userAction.id}}},findView:function(e){return d(c,o,n,e)},findViewV2:function(e){var t=l.findView(e);if(t)return{session:{id:t.sessionId},view:t.view}},stop:function(){window.clearInterval(u)}};return l}(n,i),u=Bn(r,n);Ct(e,r,n,i,a,o),_t(e,r,n,i,a,o),function(e,t){e.subscribe(_e.PERFORMANCE_ENTRY_COLLECTED,(function(n){if("longtask"===n.entryType)if(t.isEnabled("v2_format")){var r={date:_(n.startTime),longTask:{duration:v(n.duration)},type:we.LONG_TASK};e.notify(_e.RAW_RUM_EVENT_V2_COLLECTED,{rawRumEvent:r,startTime:n.startTime})}else{r={date:_(n.startTime),duration:v(n.duration),evt:{category:Se.LONG_TASK}};e.notify(_e.RAW_RUM_EVENT_COLLECTED,{rawRumEvent:r,startTime:n.startTime})}}))}(n,r),Rn(n,r,i),xn(n,r,t);var s=gn(n,r).addError;return{addAction:dn(n,r).addAction,addError:s,parentContexts:a,stop:function(){u.stop()}}}(e.applicationId,location,n,i,a,t),s=u.parentContexts,c=u.addError,f=u.addAction;return cn(n,i),Tt(n,i),Xe(n),{addAction:f,addError:c,getInternalContext:function(e,t,n,r){return{get:function(i){if(r.isEnabled("v2_format")){var o=n.findViewV2(i);if(t.isTracked()&&o&&o.session.id)return j(z({application:{id:e}},o,n.findActionV2(i)))}else{o=n.findView(i);if(t.isTracked()&&o&&o.sessionId)return j(z({applicationId:e},o,n.findAction(i)))}}}}(e.applicationId,a,s,i).get}}));function qn(e){var t,n=!1,i=(t={},{get:function(){return t},add:function(e,n){t[e]=n},remove:function(e){delete t[e]},set:function(e){t=e}}),o=function(){},a=new Oe,u=function(e){a.add([e,K(i.get())])},s=new Oe,c=function(e){s.add([e,K(i.get())])},f=function(e){var t=r(r({},e),{onReady:function(e){e()}});return Object.defineProperty(t,"_setDebug",{get:function(){return ve},enumerable:!1}),t}({init:le((function(t){var r;be(P(t))&&Ce()&&function(e){if(n)return e.silentMultipleInit||console.error("DD_RUM is already initialized."),!1;if(!e||!e.clientToken&&!e.publicApiKey)return console.error("Client Token is not configured, we will not send any data."),!1;if(!e.applicationId)return console.error("Application ID is not configured, no RUM data will be collected."),!1;if(void 0!==e.sampleRate&&!b(e.sampleRate))return console.error("Sample Rate should be a number between 0 and 100"),!1;if(void 0!==e.resourceSampleRate&&!b(e.resourceSampleRate))return console.error("Resource Sample Rate should be a number between 0 and 100"),!1;if(Array.isArray(e.allowedTracingOrigins)&&0!==e.allowedTracingOrigins.length&&void 0===e.service)return console.error("Service need to be configured when tracing is enabled"),!1;return!0}(t)&&(t.publicApiKey&&(t.clientToken=t.publicApiKey),r=e(t,i.get),u=r.addAction,c=r.addError,o=r.getInternalContext,a.drain((function(e){var t=e[0],n=e[1];return u(t,n)})),s.drain((function(e){var t=e[0],n=e[1];return c(t,n)})),n=!0)})),addRumGlobalContext:le(i.add),removeRumGlobalContext:le(i.remove),getRumGlobalContext:le(i.get),setRumGlobalContext:le(i.set),getInternalContext:le((function(e){return o(e)})),addAction:le((function(e,t){u({name:e,context:K(t),startTime:performance.now(),type:We.CUSTOM})})),addUserAction:function(e,t){f.addAction(e,t)},addError:le((function(e,t,n){var r;void 0===n&&(n=F.CUSTOM),n===F.CUSTOM||n===F.NETWORK||n===F.SOURCE?r=n:(console.error("DD_RUM.addError: Invalid source '"+n+"'"),r=F.CUSTOM),c({error:e,context:K(t),source:r,startTime:performance.now()})}))});return f}Wn=function(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}(),jn=Gn,Fn=Wn[Hn="DD_RUM"],Wn[Hn]=jn,Fn&&Fn.q&&Fn.q.forEach((function(e){return e()}))}]);

@@ -6,4 +6,4 @@ "use strict";

datacenter: 'us',
sdkVersion: '1.25.2',
sdkVersion: '1.25.4',
};
//# sourceMappingURL=buildEnv.js.map

@@ -11,2 +11,3 @@ import { Context, ErrorSource, UserConfiguration } from '@datadog/browser-core';

removeRumGlobalContext: (key: string) => void;
getRumGlobalContext: () => Context;
setRumGlobalContext: (newContext: Context) => void;

@@ -25,2 +26,3 @@ getInternalContext: (startTime?: number | undefined) => import("../typesV2").InternalContextV2 | import("..").InternalContext | undefined;

removeRumGlobalContext: (key: string) => void;
getRumGlobalContext: () => Context;
setRumGlobalContext: (newContext: Context) => void;

@@ -27,0 +29,0 @@ getInternalContext: (startTime?: number | undefined) => import("../typesV2").InternalContextV2 | import("..").InternalContext | undefined;

@@ -47,2 +47,3 @@ "use strict";

removeRumGlobalContext: browser_core_1.monitor(globalContextManager.remove),
getRumGlobalContext: browser_core_1.monitor(globalContextManager.get),
setRumGlobalContext: browser_core_1.monitor(globalContextManager.set),

@@ -49,0 +50,0 @@ getInternalContext: browser_core_1.monitor(function (startTime) {

export var buildEnv = {
buildMode: 'release',
datacenter: 'us',
sdkVersion: '1.25.2',
sdkVersion: '1.25.4',
};
//# sourceMappingURL=buildEnv.js.map

@@ -11,2 +11,3 @@ import { Context, ErrorSource, UserConfiguration } from '@datadog/browser-core';

removeRumGlobalContext: (key: string) => void;
getRumGlobalContext: () => Context;
setRumGlobalContext: (newContext: Context) => void;

@@ -25,2 +26,3 @@ getInternalContext: (startTime?: number | undefined) => import("../typesV2").InternalContextV2 | import("..").InternalContext | undefined;

removeRumGlobalContext: (key: string) => void;
getRumGlobalContext: () => Context;
setRumGlobalContext: (newContext: Context) => void;

@@ -27,0 +29,0 @@ getInternalContext: (startTime?: number | undefined) => import("../typesV2").InternalContextV2 | import("..").InternalContext | undefined;

@@ -45,2 +45,3 @@ import { BoundedBuffer, buildCookieOptions, checkCookiesAuthorized, checkIsNotLocalFile, createContextManager, deepClone, defineGlobal, ErrorSource, getGlobalObject, isPercentage, makeGlobal, monitor, } from '@datadog/browser-core';

removeRumGlobalContext: monitor(globalContextManager.remove),
getRumGlobalContext: monitor(globalContextManager.get),
setRumGlobalContext: monitor(globalContextManager.set),

@@ -47,0 +48,0 @@ getInternalContext: monitor(function (startTime) {

{
"name": "@datadog/browser-rum",
"version": "1.25.2",
"version": "1.25.4",
"license": "Apache-2.0",

@@ -16,3 +16,3 @@ "main": "cjs/index.js",

"dependencies": {
"@datadog/browser-core": "1.25.2",
"@datadog/browser-core": "1.25.4",
"tslib": "^1.10.0"

@@ -28,3 +28,3 @@ },

},
"gitHead": "761c01fbdc918772af0e6a2a2c38ba682c24f2ae"
"gitHead": "9000e3b88382ea6f82f9a4ccdadc44a6d5f03567"
}

@@ -21,7 +21,7 @@ # RUM Browser Monitoring

| Installation method | Use case |
| -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| npm (node package manager) | This method is recommended for modern web applications. The RUM SDK gets packaged with the rest of your front-end javascript code. It has no impact on page load performance. However, the SDK might miss errors, resources and user actions triggered before the SDK is initialized. |
| CDN async | This method is recommended for web applications with performance targets. The RUM SDK is loaded from our CDN asynchronously: this method ensures the SDK download does not impact page load performance. However, the SDK might miss errors, resources and user actions triggered before the SDK is initialized. |
| CDN sync | This method is recommended for collecting all RUM events. The RUM SDK is loaded from our CDN synchronously: this method ensures the SDK is loaded first and collects all errors, resources and user actions. This method might impact page load performance. |
| Installation method | Use case |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| npm (node package manager) | This method is recommended for modern web applications. The RUM SDK gets packaged with the rest of your front-end javascript code. It has no impact on page load performance. However, the SDK might miss errors, resources and user actions triggered before the SDK is initialized. **Note:** it is recommended to use a matching version with logs SDK if used. |
| CDN async | This method is recommended for web applications with performance targets. The RUM SDK is loaded from our CDN asynchronously: this method ensures the SDK download does not impact page load performance. However, the SDK might miss errors, resources and user actions triggered before the SDK is initialized. |
| CDN sync | This method is recommended for collecting all RUM events. The RUM SDK is loaded from our CDN synchronously: this method ensures the SDK is loaded first and collects all errors, resources and user actions. This method might impact page load performance. |

@@ -28,0 +28,0 @@ ### npm

@@ -83,2 +83,3 @@ import {

getRumGlobalContext: monitor(globalContextManager.get),
setRumGlobalContext: monitor(globalContextManager.set),

@@ -85,0 +86,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc