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.24.1 to 1.25.0

cjs/boot/buildEnv.d.ts

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

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

export { Datacenter } from '@datadog/browser-core';
export { RumUserConfiguration, RumGlobal, datadogRum } from './rum.entry';
export { Datacenter, ErrorSource } from '@datadog/browser-core';
export { RumUserConfiguration, RumGlobal, datadogRum } from './boot/rum.entry';
export { InternalContext, RumEvent, RumEventCategory, RumUserActionEvent, RumViewEvent, RumResourceEvent, } from './types';

@@ -5,3 +5,4 @@ "use strict";

exports.Datacenter = browser_core_1.Datacenter;
var rum_entry_1 = require("./rum.entry");
exports.ErrorSource = browser_core_1.ErrorSource;
var rum_entry_1 = require("./boot/rum.entry");
exports.datadogRum = rum_entry_1.datadogRum;

@@ -8,0 +9,0 @@ var types_1 = require("./types");

import { Context, ErrorContext, HttpContext, ResourceType } from '@datadog/browser-core';
import { PerformanceResourceDetails } from './resourceUtils';
import { ActionType, UserActionMeasures } from './userActionCollection';
import { ViewLoadingType, ViewMeasures } from './viewCollection';
import { ActionCounts, ActionType } from './domain/rumEventsCollection/action/trackActions';
import { PerformanceResourceDetails } from './domain/rumEventsCollection/resource/resourceUtils';
import { Timings, ViewLoadingType } from './domain/rumEventsCollection/view/trackViews';
import { EventCounts } from './domain/trackEventCounts';
export declare enum RumEventCategory {

@@ -24,3 +25,3 @@ USER_ACTION = "user_action",

};
network: {
network?: {
bytesWritten?: number;

@@ -58,3 +59,3 @@ };

loadingType: ViewLoadingType;
measures: ViewMeasures;
measures: EventCounts & Timings;
};

@@ -79,3 +80,3 @@ }

type: ActionType;
measures?: UserActionMeasures;
measures?: ActionCounts;
};

@@ -82,0 +83,0 @@ }

import { Context, ErrorSource, HttpContext, ResourceType } from '@datadog/browser-core';
import { PerformanceResourceDetailsElement } from './resourceUtils';
import { ActionType } from './userActionCollection';
import { ViewLoadingType } from './viewCollection';
import { ActionType } from './domain/rumEventsCollection/action/trackActions';
import { PerformanceResourceDetailsElement } from './domain/rumEventsCollection/resource/resourceUtils';
import { ViewLoadingType } from './domain/rumEventsCollection/view/trackViews';
export declare enum RumEventType {

@@ -27,4 +27,4 @@ ACTION = "action",

ssl?: PerformanceResourceDetailsElement;
firstByte: PerformanceResourceDetailsElement;
download: PerformanceResourceDetailsElement;
firstByte?: PerformanceResourceDetailsElement;
download?: PerformanceResourceDetailsElement;
};

@@ -40,3 +40,3 @@ _dd?: {

error: {
resource: HttpContext;
resource?: HttpContext;
type?: string;

@@ -86,5 +86,5 @@ stack?: string;

loadingTime?: number;
error: Count;
longTask: Count;
resource: Count;
error?: Count;
longTask?: Count;
resource?: Count;
target: {

@@ -91,0 +91,0 @@ name: string;

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

export { Datacenter } from '@datadog/browser-core';
export { RumUserConfiguration, RumGlobal, datadogRum } from './rum.entry';
export { Datacenter, ErrorSource } from '@datadog/browser-core';
export { RumUserConfiguration, RumGlobal, datadogRum } from './boot/rum.entry';
export { InternalContext, RumEvent, RumEventCategory, RumUserActionEvent, RumViewEvent, RumResourceEvent, } from './types';

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

export { Datacenter } from '@datadog/browser-core';
export { datadogRum } from './rum.entry';
export { Datacenter, ErrorSource } from '@datadog/browser-core';
export { datadogRum } from './boot/rum.entry';
export { RumEventCategory, } from './types';
//# sourceMappingURL=index.js.map
import { Context, ErrorContext, HttpContext, ResourceType } from '@datadog/browser-core';
import { PerformanceResourceDetails } from './resourceUtils';
import { ActionType, UserActionMeasures } from './userActionCollection';
import { ViewLoadingType, ViewMeasures } from './viewCollection';
import { ActionCounts, ActionType } from './domain/rumEventsCollection/action/trackActions';
import { PerformanceResourceDetails } from './domain/rumEventsCollection/resource/resourceUtils';
import { Timings, ViewLoadingType } from './domain/rumEventsCollection/view/trackViews';
import { EventCounts } from './domain/trackEventCounts';
export declare enum RumEventCategory {

@@ -24,3 +25,3 @@ USER_ACTION = "user_action",

};
network: {
network?: {
bytesWritten?: number;

@@ -58,3 +59,3 @@ };

loadingType: ViewLoadingType;
measures: ViewMeasures;
measures: EventCounts & Timings;
};

@@ -79,3 +80,3 @@ }

type: ActionType;
measures?: UserActionMeasures;
measures?: ActionCounts;
};

@@ -82,0 +83,0 @@ }

import { Context, ErrorSource, HttpContext, ResourceType } from '@datadog/browser-core';
import { PerformanceResourceDetailsElement } from './resourceUtils';
import { ActionType } from './userActionCollection';
import { ViewLoadingType } from './viewCollection';
import { ActionType } from './domain/rumEventsCollection/action/trackActions';
import { PerformanceResourceDetailsElement } from './domain/rumEventsCollection/resource/resourceUtils';
import { ViewLoadingType } from './domain/rumEventsCollection/view/trackViews';
export declare enum RumEventType {

@@ -27,4 +27,4 @@ ACTION = "action",

ssl?: PerformanceResourceDetailsElement;
firstByte: PerformanceResourceDetailsElement;
download: PerformanceResourceDetailsElement;
firstByte?: PerformanceResourceDetailsElement;
download?: PerformanceResourceDetailsElement;
};

@@ -40,3 +40,3 @@ _dd?: {

error: {
resource: HttpContext;
resource?: HttpContext;
type?: string;

@@ -86,5 +86,5 @@ stack?: string;

loadingTime?: number;
error: Count;
longTask: Count;
resource: Count;
error?: Count;
longTask?: Count;
resource?: Count;
target: {

@@ -91,0 +91,0 @@ name: string;

{
"name": "@datadog/browser-rum",
"version": "1.24.1",
"version": "1.25.0",
"license": "Apache-2.0",

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

"dependencies": {
"@datadog/browser-core": "1.24.1",
"@datadog/browser-core": "1.25.0",
"tslib": "^1.10.0"

@@ -30,3 +30,3 @@ },

},
"gitHead": "0eef20c05fe9654815b7c1599b8357cfeaa10ce5"
"gitHead": "3b66e416efe51c32cc0636fd57aa9cd8c90bf16b"
}

@@ -9,4 +9,2 @@ # RUM Browser Monitoring

### Datadog
To set up Datadog RUM browser monitoring:

@@ -16,3 +14,3 @@

2. Enter a name for your application and click **Generate Client Token**. This generates a `clientToken` and an `applicationId` for your application.
3. Setup the Datadog RUM SDK [NPM](#npm-setup) or the [generated code snippet](#bundle-setup).
3. Setup the Datadog RUM SDK via [npm](#npm) or via one of the hosted versions: [CDN async](#cdn-async) or [CDN sync](#cdn-sync).
4. Deploy the changes to your application. Once your deployment is live, Datadog collects events from user browsers.

@@ -23,4 +21,12 @@ 5. Visualize the [data collected][2] using Datadog [dashboards][3].

### NPM
### Choose the right installation method
| 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. |
### npm
Add [`@datadog/browser-rum`][4] to your `package.json` file, then initialize it with:

@@ -45,4 +51,36 @@

### Bundle
### CDN async
Add the generated code snippet to the head tag of every HTML page you want to monitor in your application.
<!-- prettier-ignore -->
```html
<script>
(function(h,o,u,n,d) {
h=h[d]=h[d]||{q:[],onReady:function(c){h.q.push(c)}}
d=o.createElement(u);d.async=1;d.src=n
n=o.getElementsByTagName(u)[0];n.parentNode.insertBefore(d,n)
})(window,document,'script','https://www.datadoghq-browser-agent.com/datadog-rum.js','DD_RUM')
DD_RUM.onReady(function() {
DD_RUM.init({
clientToken: '<CLIENT_TOKEN>',
applicationId: '<APPLICATION_ID>',
site: '<DATADOG_SITE>',
// service: 'my-web-application',
// env: 'production',
// version: '1.0.0',
sampleRate: 100,
trackInteractions: true,
})
})
</script>
```
**Notes**:
- The `trackInteractions` parameter enables the automatic collection of user clicks in your application. **Sensitive and private data** contained on your pages may be included to identify the elements interacted with.
- Early RUM API calls must be wrapped in the `DD_RUM.onReady()` callback. This ensures the code only gets executed once the SDK is properly loaded.
### CDN sync
Add the generated code snippet to the head tag (in front of any other script tags) of every HTML page you want to monitor in your application. Including the script tag higher and synchronized ensures Datadog RUM can collect all performance data and errors.

@@ -111,7 +149,7 @@

| Parameter | Type | Required | Default | Description |
| ------------------------------ | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `trackSessionAcrossSubdomains` | Boolean | No | `false` | Preserve the session across subdomains for the same site. |
| `useSecureSessionCookie` | Boolean | No | `false` | Use a secure session cookie. This disables RUM events sent on insecure (non-HTTPS) connections. |
| `useCrossSiteSessionCookie` | Boolean | No | `false` | Use a secure cross-site session cookie. This allows the logs SDK to run when the site is loaded from another one (iframe). Implies `useSecureSessionCookie`. |
| Parameter | Type | Required | Default | Description |
| ------------------------------ | ------- | -------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `trackSessionAcrossSubdomains` | Boolean | No | `false` | Preserve the session across subdomains for the same site. |
| `useSecureSessionCookie` | Boolean | No | `false` | Use a secure session cookie. This disables RUM events sent on insecure (non-HTTPS) connections. |
| `useCrossSiteSessionCookie` | Boolean | No | `false` | Use a secure cross-site session cookie. This allows the RUM SDK to run when the site is loaded from another one (iframe). Implies `useSecureSessionCookie`. |

@@ -141,18 +179,2 @@ #### Example

### Name click actions
The RUM library uses various strategies to automatically name click actions. If you want more control, define a `data-dd-action-name` attribute on clickable elements (or any of their parents) to name the action, for example:
```html
<a class="btn btn-default" href="#" role="button" data-dd-action-name="Login button">Login</a>
```
```html
<div class="alert alert-danger" role="alert" data-dd-action-name="Dismiss alert">
<span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
<span class="sr-only">Error:</span>
Enter a valid email address
</div>
```
[1]: https://app.datadoghq.com/rum/list

@@ -159,0 +181,0 @@ [2]: https://docs.datadoghq.com/real_user_monitoring/data_collected/

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

export { Datacenter } from '@datadog/browser-core'
export { RumUserConfiguration, RumGlobal, datadogRum } from './rum.entry'
export { Datacenter, ErrorSource } from '@datadog/browser-core'
export { RumUserConfiguration, RumGlobal, datadogRum } from './boot/rum.entry'
export {

@@ -4,0 +4,0 @@ InternalContext,

@@ -1,5 +0,6 @@

import { Context, ErrorContext, HttpContext, ResourceType } from '@datadog/browser-core'
import { PerformanceResourceDetails } from './resourceUtils'
import { ActionType, UserActionMeasures } from './userActionCollection'
import { ViewLoadingType, ViewMeasures } from './viewCollection'
import { Context, ErrorContext, ErrorSource, HttpContext, ResourceType } from '@datadog/browser-core'
import { ActionCounts, ActionType } from './domain/rumEventsCollection/action/trackActions'
import { PerformanceResourceDetails } from './domain/rumEventsCollection/resource/resourceUtils'
import { Timings, ViewLoadingType } from './domain/rumEventsCollection/view/trackViews'
import { EventCounts } from './domain/trackEventCounts'

@@ -26,3 +27,3 @@ export enum RumEventCategory {

}
network: {
network?: {
bytesWritten?: number

@@ -62,3 +63,3 @@ }

loadingType: ViewLoadingType
measures: ViewMeasures
measures: EventCounts & Timings
}

@@ -85,3 +86,3 @@ }

type: ActionType
measures?: UserActionMeasures
measures?: ActionCounts
}

@@ -88,0 +89,0 @@ }

import { Context, ErrorSource, HttpContext, ResourceType } from '@datadog/browser-core'
import { PerformanceResourceDetailsElement } from './resourceUtils'
import { ActionType } from './userActionCollection'
import { ViewLoadingType } from './viewCollection'
import { ActionType } from './domain/rumEventsCollection/action/trackActions'
import { PerformanceResourceDetailsElement } from './domain/rumEventsCollection/resource/resourceUtils'
import { ViewLoadingType } from './domain/rumEventsCollection/view/trackViews'

@@ -29,4 +29,4 @@ export enum RumEventType {

ssl?: PerformanceResourceDetailsElement
firstByte: PerformanceResourceDetailsElement
download: PerformanceResourceDetailsElement
firstByte?: PerformanceResourceDetailsElement
download?: PerformanceResourceDetailsElement
}

@@ -43,3 +43,3 @@ _dd?: {

error: {
resource: HttpContext
resource?: HttpContext
type?: string

@@ -93,5 +93,5 @@ stack?: string

loadingTime?: number
error: Count
longTask: Count
resource: Count
error?: Count
longTask?: Count
resource?: Count
target: {

@@ -98,0 +98,0 @@ name: string

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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