Socket
Socket
Sign inDemoInstall

@datadog/browser-rum

Package Overview
Dependencies
2
Maintainers
1
Versions
249
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.12.10 to 1.13.0

2

bundle/datadog-rum-us.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 Kt}));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,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)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 u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=(i=u.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}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,a])}}}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],u=0,a=o.length;u<a;u++,i++)r[i]=o[u];return r}var u,a,c=6e4,s=60*c;function f(e,t,n){var r,i=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing,u=!1,a=!1,c=!1;return{throttled:function(){var n=this;c||(u?a=!0:(i?e.apply(this):a=!0,u=!0,r=window.setTimeout((function(){o&&a&&e.apply(n),u=!1,a=!1}),t)))},stop:function(){window.clearTimeout(r),c=!0}}}!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.VISIBILITY_CHANGE="visibilitychange"}(u||(u={})),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"}(a||(a={}));var l,d=function(e){return Array.isArray(e)},p=function(e){return!Array.isArray(e)&&"object"==typeof e};function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(e,t){return d(e)&&d(t)?o(Array(Math.max(e.length,t.length))).map((function(n,r){return m(e[r],t[r])})):p(e)&&p(t)?Object.keys(t).reduce((function(n,i){var o;return r(r({},n),((o={})[i]=m(e[i],t[i]),o))}),e):void 0===t?e:t}),e)}function E(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return m.apply(void 0,o([e],t))}function v(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])}))}function h(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,h)}function T(e){return 0!==e&&100*Math.random()<=e}function g(e){return+(1e6*e).toFixed(0)}function b(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)return b(t);return t}(e[n])})),t}function y(){}function C(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];O(e)&&(r=[!0,e.toJSON],delete e.toJSON);var i,o,u=[!1,void 0];"object"==typeof e&&O(i=Object.getPrototypeOf(e))&&(u=[!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]),u[0]&&(i.toJSON=u[1])}return o}function O(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function R(e,t){return-1!==e.indexOf(t)}function _(e){return w(e)&&e>=0&&e<=100}function w(e){return"number"==typeof e}function S(e){return Math.floor(A()+e)}function A(){return void 0===l&&(l=performance.timing.navigationStart),l}function I(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}var D={isCollectingError:!0,maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function L(e,t,n){var r=t.datacenter===le.US?"com":"eu",i=t.sdkEnv===de.PRODUCTION?"datadoghq."+r:"datad0g."+r,o="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),u=e+"-http-intake.logs."+i,a=t.proxyHost?t.proxyHost:u,c=t.proxyHost?"ddhost="+u+"&":"",s=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+c+"ddsource="+(n||"browser")+"&ddtags="+o;return"https://"+a+"/v1/input/"+t.clientToken+"?"+s}var N=1e3;function x(e,t,n){var r=new Date;r.setTime(r.getTime()+n);var i="expires="+r.toUTCString();document.cookie=e+"="+t+";"+i+";path=/;samesite=strict"}function M(e){var t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():void 0}var U="?",k=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function B(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var P=function(){var e,t,n,r,i,o,u=[];function a(e,t,n){var r;for(var i in u)if(B(u,i))try{u[i](e,t,n)}catch(e){r=e}if(r)throw r}function c(e,r,i,o,u){if(t)H.augmentStackTraceWithInitialElement(t,r,i,""+e),f();else if(u)a(H(u),!0,u);else{var c,s={url:r,column:o,line:i},l=e;if("[object String]"==={}.toString.call(e)){var d=l.match(k);d&&(c=d[1],l=d[2])}a({name:c,message:l,stack:[s]},!0)}return!!n&&n.apply(this,arguments)}function s(e){var t=e.reason||"Empty reason";a(H(t),!0,t)}function f(){var n=t,r=e;t=void 0,e=void 0,a(n,!1,r)}function l(n){if(t){if(e===n)return;f()}var r=H(n);throw t=r,e=n,setTimeout((function(){e===n&&f()}),r.incomplete?2e3:0),n}return l.subscribe=function(e){!function(){if(r)return;n=window.onerror,window.onerror=q(c),r=!0}(),function(){if(o)return;i=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=q(s),o=!0}(),u.push(e)},l.unsubscribe=function(e){for(var t=u.length-1;t>=0;t-=1)u[t]===e&&u.splice(t,1);0===u.length&&(r&&(window.onerror=n,r=!1),o&&(window.onunhandledrejection=i,o=!1))},l.traceKitWindowOnError=c,l}(),H=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,u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,s=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=e.stack.split("\n"),l=[],d=0,p=f.length;d<p;d+=1){if(o.exec(f[d])){var m=(r=o.exec(f[d]))[2]&&0===r[2].indexOf("native");t=r[2]&&0===r[2].indexOf("eval"),n=s.exec(r[2]),t&&n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3]),i={args:m?[r[2]]:[],column:r[4]?+r[4]:void 0,func:r[1]||U,line:r[3]?+r[3]:void 0,url:m?void 0:r[2]}}else if(a.exec(f[d]))i={args:[],column:(r=a.exec(f[d]))[4]?+r[4]:void 0,func:r[1]||U,line:+r[3],url:r[2]};else{if(!u.exec(f[d]))continue;t=(r=u.exec(f[d]))[3]&&r[3].indexOf(" > eval")>-1,n=c.exec(r[3]),t&&n?(r[3]=n[1],r[4]=n[2],r[5]=void 0):0!==d||r[5]||void 0===e.columnNumber||(l[0].column=e.columnNumber+1),i={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||U,line:r[4]?+r[4]:void 0,url:r[3]}}!i.func&&i.line&&(i.func=U),l.push(i)}if(l.length)return{stack:l,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,u=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,a=[],c={},s=!1,f=r.caller;f&&!s;f=f.caller)f!==H&&f!==P&&(o={args:[],column:void 0,func:U,line:void 0,url:void 0},i=u.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),c[""+f]?s=!0:c[""+f]=!0,a.push(o));t&&a.splice(0,t);var l={stack:a,message:e.message,name:e.name};return n(l,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),l}function i(n,i){var o,u=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"),u=[],a=0;a<o.length;a+=2){var c=void 0;r.exec(o[a])?c={args:[],column:void 0,func:(n=r.exec(o[a]))[3],line:+n[1],url:n[2]}:i.exec(o[a])&&(c={args:(n=i.exec(o[a]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),c&&(!c.func&&c.line&&(c.func=U),c.context=[o[a+1]],u.push(c))}if(u.length)return{stack:u,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,u=[],a=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var s in a)B(a,s)&&!a[s].src&&c.push(a[s]);for(var f=2;f<t.length;f+=2){var l=void 0;if(r.exec(t[f]))l={args:[],column:void 0,func:(n=r.exec(t[f]))[3],line:+n[1],url:n[2]};else if(i.exec(t[f]))l={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]),l={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}l&&(l.func||(l.func=U),l.context=[t[f+1]],u.push(l))}if(u.length)return{stack:u,message:t[0],name:e.name}}}(n))return o}catch(t){if(e)throw t}try{if(o=r(n,u+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 H(e,t+1)}},i}();var j=/[^\u0000-\u007F]/,F=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 W,z=function(){function e(e,t,n,r,i,o){void 0===o&&(o=y),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 j.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=C(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(u.BEFORE_UNLOAD,q(this.beforeUnloadCallback)),document.addEventListener(u.VISIBILITY_CHANGE,q((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(u.BEFORE_UNLOAD,q((function(){return e.flush()}))))},e}();!function(e){e.info="info",e.error="error"}(W||(W={}));var G,K={maxMessagesPerPage:0,sentMessageCount:0};function V(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 z(new F(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var r=function(e){return m({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==G?G():{},e)}(e);n.add(r),t&&t.add(r)}}}(e);v(K,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){G=e}}}function q(e){return function(){try{return e.apply(this,arguments)}catch(e){Q(e);try{Y(e)}catch(e){Q(e)}}}}function $(e,t){!function(e){K.debugMode&&console.log("[MONITORING MESSAGE]",e)}(e),X(r(r({message:e},t),{status:W.info}))}function Y(e){X(r(r({},function(e){if(e instanceof Error){var t=H(e);return{error:{kind:t.name,stack:be(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+C(e)}}(e)),{status:W.error}))}function X(e){K.batch&&K.sentMessageCount<K.maxMessagesPerPage&&(K.sentMessageCount+=1,K.batch.add(e))}function J(e){K.debugMode=e}function Q(e){K.debugMode&&console.warn("[INTERNAL ERROR]",e)}var Z,ee,te=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}();function ne(e){return oe(e,I(window.location)).href}function re(e,t){return ie(e)===ie(t)}function ie(e){return I(oe(e))}function oe(e,t){if(function(){if(void 0!==Z)return Z;try{var e=new URL("http://test/path");return Z="http://test/path"===e.href}catch(e){Z=!1}return Z}())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}!function(e){e.FETCH="fetch",e.XHR="xhr"}(ee||(ee={}));var ue,ae,ce,se,fe,le,de,pe,me=1;function Ee(){var e=me;return me+=1,e}function ve(){return ue||(function(e){var t=e[0],n=e[1],r=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=q((function(e,t){return this._datadog_xhr={method:e,url:t},r.apply(this,arguments)}));var i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(e){var r=this,o=performance.now(),u=Ee();t.notify({requestId:u});var a=!1,c=function(){a||(a=!0,n.notify({requestId:u,startTime:o,duration:performance.now()-o,method:r._datadog_xhr.method,response:r.response,status:r.status,traceId:he(),type:ee.XHR,url:ne(r._datadog_xhr.url)}))},s=this.onreadystatechange;return this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&q(c)(),s&&s.apply(this,arguments)},this.addEventListener("loadend",q(c)),i.apply(this,arguments)}}(ue=[new te,new te]),function(e){var t=e[0],n=e[1];if(!window.fetch)return;var r=window.fetch;window.fetch=q((function(e,o){var u=this,a=o&&o.method||"object"==typeof e&&e.method||"GET",c=performance.now(),s=Ee();t.notify({requestId:s});var f=function(t){return r=u,o=void 0,l=function(){var r,o,u,f,l;return i(this,(function(i){switch(i.label){case 0:return r=performance.now()-c,o=ne("object"==typeof e&&e.url||e),"stack"in t||t instanceof Error?(u=H(t),n.notify({duration:r,method:a,requestId:s,startTime:c,url:o,response:be(u),status:0,traceId:he(),type:ee.FETCH}),[3,6]):[3,1];case 1:if(!("status"in t))return[3,6];f=void 0,i.label=2;case 2:return i.trys.push([2,4,,5]),[4,t.clone().text()];case 3:return f=i.sent(),[3,5];case 4:return l=i.sent(),f="Unable to retrieve response: "+l,[3,5];case 5:n.notify({duration:r,method:a,requestId:s,startTime:c,url:o,response:f,responseType:t.type,status:t.status,traceId:he(),type:ee.FETCH}),i.label=6;case 6:return[2]}}))},new((f=void 0)||(f=Promise))((function(e,t){function n(e){try{u(l.next(e))}catch(e){t(e)}}function i(e){try{u(l.throw(e))}catch(e){t(e)}}function u(t){t.done?e(t.value):new f((function(e){e(t.value)})).then(n,i)}u((l=l.apply(r,o||[])).next())}));var r,o,f,l},l=r.call(this,e,o);return l.then(q(f),q(f)),l}))}(ue)),ue}function he(){return"ddtrace"in window&&window.ddtrace.tracer.scope().active()?window.ddtrace.tracer.scope().active().context().toTraceId():void 0}function Te(e){if(!ce){var t=new te;if(e.isCollectingError)!function(e,t,n){n.subscribe((function(n){(function(e){return 0===e.status&&"opaque"!==e.responseType}(n)||function(e){return e.status>=500}(n))&&t.notify({context:{error:{origin:ae.NETWORK,stack:ye(n.response,e)||"Failed to load"},http:{method:n.method,status_code:n.status,url:n.url}},message:Ce(n.type)+" error "+n.method+" "+n.url,startTime:n.startTime})}))}(e,t,ve()[1]),function(e){se=console.error,console.error=q((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];se.apply(console,o([t],n)),e.notify({context:{error:{origin:ae.CONSOLE}},message:o(["console error:",t],n).map(ge).join(" "),startTime:performance.now()})}))}(t),function(e){fe=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=be(e)):(n="Uncaught "+C(t),r="No stack, consider using an instance of Error");return{message:n,context:{error:{stack:r,kind:e.name,origin:ae.SOURCE}},startTime:performance.now()}}(t,r))},P.subscribe(fe)}(t);ce=function(e,t){var n=0,r=new te;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:ae.AGENT}},message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),c),r}(e,t)}return ce}function ge(e){return"string"==typeof e?e:e instanceof Error?be(H(e)):C(e,0,2)}function be(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 ye(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function Ce(e){return ee.XHR===e?"XHR":"Fetch"}function Oe(e){console.warn("'"+e+"' not yet available, please call '.init()' first.")}function Re(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,datacenter:e.datacenter||t.datacenter,env:e.env,proxyHost:e.proxyHost,sdkEnv:t.sdkEnv,sdkVersion:t.sdkVersion,service:e.service,version:e.version},i=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],o=r({isEnabled:function(e){return R(i,e)},logsEndpoint:L("browser",n),rumEndpoint:L("rum",n),traceEndpoint:L("public-trace",n)},D);if(e.internalMonitoringApiKey&&(o.internalMonitoringEndpoint=L("browser",n,"browser-agent-internal-monitoring")),"isCollectingError"in e&&(o.isCollectingError=!!e.isCollectingError),"sampleRate"in e&&(o.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(o.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(o.trackInteractions=!!e.trackInteractions),n.buildMode===pe.E2E_TEST&&(void 0!==e.internalMonitoringEndpoint&&(o.internalMonitoringEndpoint=e.internalMonitoringEndpoint),void 0!==e.logsEndpoint&&(o.logsEndpoint=e.logsEndpoint),void 0!==e.rumEndpoint&&(o.rumEndpoint=e.rumEndpoint)),n.buildMode===pe.STAGING&&void 0!==e.replica){var u=r(r({},n),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,sdkEnv:de.PRODUCTION});o.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:L("browser",u,"browser-agent-internal-monitoring"),logsEndpoint:L("browser",u),rumEndpoint:L("rum",u)}}return o}(e,t),i=V(n);return{configuration:n,errorObservable:Te(n),internalMonitoring:i}}function _e(){return!!function(){if(void 0===document.cookie||null===document.cookie)return!1;try{return x("dd_rum_test","test",1e3),"test"===M("dd_rum_test")}catch(e){return console.error(e),!1}}()||(console.warn("Cookies are not authorized, we will not send any data."),!1)}function we(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger"}(ae||(ae={})),function(e){e.US="us",e.EU="eu"}(le||(le={})),function(e){e.PRODUCTION="production",e.STAGING="staging"}(de||(de={})),function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(pe||(pe={}));var Se,Ae={buildMode:"release",datacenter:"us",sdkEnv:"production",sdkVersion:"1.12.10"};!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"}(Se||(Se={}));var Ie=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 De(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(q((function(){e.notify(Se.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){t&&t.disconnect()}}}var Le="initial_document",Ne=[[a.DOCUMENT,function(e){return Le===e}],[a.XHR,function(e){return"xmlhttprequest"===e}],[a.FETCH,function(e){return"fetch"===e}],[a.BEACON,function(e){return"beacon"===e}],[a.CSS,function(e,t){return null!==t.match(/\.css$/i)}],[a.JS,function(e,t){return null!==t.match(/\.js$/i)}],[a.IMAGE,function(e,t){return R(["image","img","icon"],e)||null!==t.match(/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i)}],[a.FONT,function(e,t){return null!==t.match(/\.(woff|eot|woff2|ttf)$/i)}],[a.MEDIA,function(e,t){return R(["audio","video"],e)||null!==t.match(/\.(mp3|mp4)$/i)}]];function xe(e){var t=e.name;if(!function(e){try{return!!oe(e)}catch(e){return!1}}(t))return $('Failed to construct URL for "'+e.name+'"'),a.OTHER;for(var n=function(e){var t=oe(e).pathname;return"/"===t[0]?t:"/"+t}(t),r=0,i=Ne;r<i.length;r++){var o=i[r],u=o[0];if((0,o[1])(e.initiatorType,n))return u}return a.OTHER}function Me(){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 Ue(e){var t=e.duration,n=e.startTime,r=e.responseEnd;return g(0===t&&n<r?r-n:t)}function ke(e){var t=e.startTime,n=e.fetchStart,r=e.domainLookupStart,i=e.domainLookupEnd,o=e.connectStart,u=e.secureConnectionStart,a=e.connectEnd,c=e.requestStart,s=e.responseStart,f=e.responseEnd,l=e.redirectStart,d=e.redirectEnd;if(Me(t,n,r,i,o,a,c,s,f)){var p=n!==t;if(!p||(l<t&&(l=t),d<t&&(d=n),Me(t,l,d,n))){var m={download:Be(t,s,f),firstByte:Be(t,c,s)};return a!==n&&(m.connect=Be(t,o,a),Me(o,u,a)&&(m.ssl=Be(t,u,a))),i!==n&&(m.dns=Be(t,r,i)),p&&(m.redirect=Be(t,l,d)),m}}}function Be(e,t,n){return{duration:g(n-t),start:g(t-e)}}function Pe(e){if(e.startTime<e.responseStart)return e.decodedBodySize}function He(e,t){return e&&!function(e,t){return re(e,t.logsEndpoint)||re(e,t.rumEndpoint)||re(e,t.traceEndpoint)||t.internalMonitoringEndpoint&&re(e,t.internalMonitoringEndpoint)}(e,t)}function je(){return void 0!==window.performance&&"getEntries"in performance}function Fe(){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("navigation")}function We(e,t){if(function(e){var t;if(Fe()&&performance.getEntriesByType("navigation").length>0){var n=performance.getEntriesByType("navigation")[0];t=r({},n.toJSON())}else t=r(r({},ze()),{name:window.location.href,decodedBodySize:0,startTime:0});t.entryType="resource",t.initiatorType=Le,t.duration=t.responseEnd,e(t)}((function(n){Ge(t,e,[n])})),je()&&Ge(t,e,performance.getEntries()),window.PerformanceObserver){var n=new PerformanceObserver(q((function(n){return Ge(t,e,n.getEntries())}))),i=["resource","navigation","longtask"];"visible"===document.visibilityState&&i.push("paint"),n.observe({entryTypes:i}),je()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}Fe()||function(e){function t(){var t=r(r({},ze()),{entryType:"navigation"});e(t)}if("complete"===document.readyState)t();else{var n=q((function(){window.removeEventListener(u.LOAD,n),setTimeout(q(t))}));window.addEventListener(u.LOAD,n)}}((function(n){Ge(t,e,[n])}))}function ze(){var e={},t=performance.timing;for(var n in t)w(t[n])&&(e[n]=0===t[n]?0:t[n]-A());return e}function Ge(e,t,n){function r(e){t.notify(Se.PERFORMANCE_ENTRY_COLLECTED,e)}e.isTrackedWithResource()&&n.filter((function(e){return"resource"===e.entryType})).forEach(r),n.filter((function(e){return"navigation"===e.entryType})).filter((function(e){return e.loadEventEnd>0})).forEach(r),n.filter((function(e){return"paint"===e.entryType})).forEach(r),n.filter((function(e){return"longtask"===e.entryType})).forEach(r)}function Ke(e){if(performance&&"getEntriesByName"in performance){var t,n=performance.getEntriesByName(e.url,"resource").filter((function(t){return n=t,r=e.startTime,i=Ve(e),n.startTime>=r&&Ve(n)<=i;var n,r,i}));return 1===n.length?n[0]:2===n.length&&Ve((t=n)[0])<=t[1].startTime?n[1]:void 0}}function Ve(e){return e.startTime+e.duration}var qe="_dd",$e="_dd_r",Ye="_dd_l",Xe="rum",Je="logs";var Qe="_dd_s",Ze=15*c,et=4*s,tt=c;function nt(e,t){var n,r,i,o,a,c=(n=Qe,o=!1,a=function(){o=!0,window.clearTimeout(r),r=window.setTimeout((function(){o=!1}),N)},{get:function(){return o?i:(i=M(n),a(),i)},set:function(e,t){x(n,e,t),i=e,a()}});!function(e){var t=e.get(),n=M(qe),r=M($e),i=M(Ye);if(!t){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[Je]=i),r&&/^[012]$/.test(r)&&(o[Xe]=r),ut(o,e)}}(c);var s=new te,l=ot(c).id,d=f((function(){var n=ot(c),r=t(n[e]),i=r.trackingType,o=r.isTracked;n[e]=i,o&&!n.id&&(n.id=h(),n.created=String(Date.now())),ut(n,c),o&&l!==n.id&&(l=n.id,s.notify())}),N).throttled;return d(),function(e){var t=q(e),n={capture:!0,passive:!0};[u.CLICK,u.TOUCH_START,u.KEY_DOWN,u.SCROLL].forEach((function(e){document.addEventListener(e,t,n),ct.push((function(){return document.removeEventListener(e,t,n)}))}))}(d),function(e){var t=q((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,tt);document.addEventListener(u.VISIBILITY_CHANGE,t),ct.push((function(){clearInterval(n),document.removeEventListener(u.VISIBILITY_CHANGE,t)}))}((function(){ut(ot(c),c)})),{getId:function(){return ot(c).id},getTrackingType:function(){return ot(c)[e]},renewObservable:s}}var rt=/^([a-z]+)=([a-z0-9-]+)$/,it="&";function ot(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf(it)||rt.test(e))})(t)&&t.split(it).forEach((function(e){var t=rt.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)<et)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(at(e),{})}function ut(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+Ze);var r=function(e){return Object.keys(e).map((function(t){return[t,e[t]]}))}(e).map((function(e){return e[0]+"="+e[1]})).join(it);t.set(r,Ze)}else at(t)}function at(e){e.set("",0)}var ct=[];var st=et,ft=5*c,lt=c;function dt(e){return function(e){var t;if(function(){void 0===vt&&(vt="closest"in HTMLElement.prototype);return vt}())t=e.closest("["+pt+"]");else for(var n=e;n;){if(n.hasAttribute(pt)){t=n;break}n=n.parentElement}if(!t)return;return Ct(yt(t.getAttribute(pt).trim()))}(e)||bt(e,ht)||bt(e,Tt)||""}var pt="data-dd-action-name";var mt,Et,vt,ht=[function(e){if(function(){void 0===Et&&(Et="labels"in HTMLInputElement.prototype);return Et}()){if("labels"in e&&e.labels&&e.labels.length>0)return Ot(e.labels[0])}else if(e.id){var t=e.ownerDocument&&e.ownerDocument.querySelector('label[for="'+e.id.replace('"','\\"')+'"]');return t&&Ot(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 Ot(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(Ot).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 Ot(e.options[0])}],Tt=[function(e){return Ot(e)}],gt=10;function bt(e,t){for(var n=e,r=0;r<=gt&&n&&"BODY"!==n.nodeName&&"HTML"!==n.nodeName&&"HEAD"!==n.nodeName;){for(var i=0,o=t;i<o.length;i++){var u=(0,o[i])(n);if("string"==typeof u){var a=u.trim();if(a)return Ct(yt(a))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function yt(e){return e.replace(/\s+/g," ")}function Ct(e){return e.length>100?e.slice(0,100)+" [...]":e}function Ot(e){if(!e.isContentEditable){if("innerText"in e){var t=e.innerText;if(!function(){if(void 0===mt){var e=document.createElement("style");e.textContent="*";var t=document.createElement("div");t.appendChild(e),document.body.appendChild(t),mt=""===t.innerText,document.body.removeChild(t)}return mt}())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 Rt(e,t){void 0===t&&(t=y);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=[];return r.push(e.subscribe(Se.ERROR_COLLECTED,(function(){n.errorCount+=1,t(n)}))),r.push(e.subscribe(Se.AUTO_ACTION_COMPLETED,(function(){n.userActionCount+=1,t(n)}))),r.push(e.subscribe(Se.CUSTOM_ACTION_COLLECTED,(function(){n.userActionCount+=1,t(n)}))),r.push(e.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(e){"longtask"===e.entryType&&(n.longTaskCount+=1,t(n))}))),r.push(e.subscribe(Se.RESOURCE_ADDED_TO_BATCH,(function(){n.resourceCount+=1,t(n)}))),{stop:function(){r.forEach((function(e){return e.unsubscribe()}))},eventCounts:n}}var _t,wt=100,St=100,At=1e4;function It(e,t){var n=function(e){var t,n=new te,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(e.subscribe(Se.DOM_MUTATED,(function(){return o()}))),r.push(e.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(e){"resource"===e.entryType&&o()}))),r.push(e.subscribe(Se.REQUEST_STARTED,(function(e){void 0===t&&(t=e.requestId),i+=1,o()}))),r.push(e.subscribe(Se.REQUEST_COMPLETED,(function(e){void 0===t||e.requestId<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(q((function(){return c(!1,0)})),wt),u=setTimeout(q((function(){return c(!0,performance.now())})),At);function a(){i=!0,clearTimeout(o),clearTimeout(r),clearTimeout(u),t()}function c(e,t){i||(a(),n(e,t))}return e.subscribe((function(e){var t=e.isBusy;clearTimeout(o),clearTimeout(r);var n=performance.now();t||(r=setTimeout(q((function(){return c(!0,n)})),St))})),{stop:a}}(r,i,t).stop;return{stop:function(){o(),i()}}}function Dt(e){var t=function(e){var t,n;return{create:function(r,i){if(!t){var o=new Nt(e,r,i);t=o,n=It(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=dt(e.target);n&&t.create(_t.CLICK,n)}}return e.subscribe(Se.VIEW_CREATED,(function(){t.discardCurrent()})),addEventListener(u.CLICK,n,{capture:!0}),{stop:function(){t.discardCurrent(),removeEventListener(u.CLICK,n,{capture:!0})}}}!function(e){e.CLICK="click",e.CUSTOM="custom"}(_t||(_t={}));var Lt,Nt=function(){function e(e,t,n){this.lifeCycle=e,this.type=t,this.name=n,this.id=h(),this.startTime=performance.now(),this.eventCountsSubscription=Rt(e),this.lifeCycle.notify(Se.AUTO_ACTION_CREATED,{id:this.id,startTime:this.startTime})}return e.prototype.complete=function(e){var t=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(Se.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(Se.AUTO_ACTION_DISCARDED),this.eventCountsSubscription.stop()},e}();!function(e){e.INITIAL_LOAD="initial_load",e.ROUTE_CHANGE="route_change"}(Lt||(Lt={}));var xt,Mt,Ut=3e3,kt=5*c;function Bt(e,t){var n=r({},e),i=Pt(t,n,Lt.INITIAL_LOAD,0);!function(e){var t=history.pushState;history.pushState=q((function(){t.apply(this,arguments),e()}));var n=history.replaceState;history.replaceState=q((function(){n.apply(this,arguments),e()})),window.addEventListener(u.POP_STATE,q(e))}((function(){var o;o=e,n.pathname!==o.pathname&&(n=r({},e),i.triggerUpdate(),i.end(),i=Pt(t,n,Lt.ROUTE_CHANGE))})),t.subscribe(Se.SESSION_RENEWED,(function(){i.end(),i=Pt(t,n,Lt.ROUTE_CHANGE)})),t.subscribe(Se.BEFORE_UNLOAD,(function(){i.triggerUpdate(),i.end()}));var o=window.setInterval(q((function(){i.triggerUpdate()})),kt);return{stop:function(){i.end(),clearInterval(o)}}}function Pt(e,t,n,i){void 0===i&&(i=performance.now());var o,u=h(),a={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},c=0;e.notify(Se.VIEW_CREATED,{id:u,startTime:i});var s=f(q(T),Ut,{leading:!1}),l=s.throttled,d=s.stop;function p(e){a=r(r({},a),e),l()}var m=function(e,t){var n={};return{stop:e.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(e){if("navigation"===e.entryType){var i=e;n=r(r({},n),{domComplete:g(i.domComplete),domContentLoaded:g(i.domContentLoadedEventEnd),domInteractive:g(i.domInteractive),loadEventEnd:g(i.loadEventEnd)}),t(n)}else if("paint"===e.entryType&&"first-contentful-paint"===e.name){var o=e;n=r(r({},n),{firstContentfulPaint:g(o.startTime)}),t(n)}})).unsubscribe}}(e,p).stop,E=Rt(e,p).stop;var v=function(e,t,n){var r=1,i=[],o=y;t===Lt.INITIAL_LOAD&&(r+=1,o=function(e,t){return{stop:e.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(e){"navigation"===e.entryType&&t(e.loadEventEnd)})).unsubscribe}}(e,a).stop);var u=function(e,t){var n=performance.now();return{stop:It(e,(function(e,r){t(e?r-n:void 0)})).stop}}(e,a).stop;function a(e){r-=1,e&&i.push(e),0===r&&i.length&&n(Math.max.apply(Math,i))}return{stop:function(){u(),o()}}}(e,n,(function(e){o=e,l()})).stop;function T(){c+=1,e.notify(Se.VIEW_UPDATED,{documentVersion:c,id:u,loadingTime:o,loadingType:n,location:t,measures:a,startTime:i,duration:performance.now()-i})}return T(),{end:function(){m(),E(),v(),d()},triggerUpdate:function(){T()}}}function Ht(e,t,n,i,o,u){var c={},s=function(e,t,n,r){var i,o,u,a=[],c=[];t.subscribe(Se.VIEW_CREATED,(function(e){i&&r&&a.unshift({context:l(),endTime:e.startTime,startTime:i.startTime}),i=e,u=n.getId()})),t.subscribe(Se.AUTO_ACTION_CREATED,(function(e){o=e})),t.subscribe(Se.AUTO_ACTION_COMPLETED,(function(e){o&&r&&c.unshift({context:d(),endTime:o.startTime+e.duration,startTime:o.startTime}),o=void 0})),t.subscribe(Se.AUTO_ACTION_DISCARDED,(function(){o=void 0})),t.subscribe(Se.SESSION_RENEWED,(function(){a=[],c=[],i=void 0,o=void 0}));var s=window.setInterval(q((function(){f(a,st),f(c,ft)})),lt);function f(e,t){for(var n=performance.now()-t;e.length>0&&e[e.length-1].startTime<n;)e.pop()}function l(){return{sessionId:u,view:{id:i.id,url:e.href}}}function d(){return{userAction:{id:o.id}}}function p(e,t,n,i){if(!i)return n?e():void 0;if(n&&i>=n.startTime)return e();if(r)for(var o=0,u=t;o<u.length;o++){var a=u[o];if(i>a.endTime)break;if(i>=a.startTime)return a.context}}return{findAction:function(e){return p(d,c,o,e)},findView:function(e){return p(l,a,i,e)},stop:function(){window.clearInterval(s)}}}(window.location,n,o,i.isEnabled("context-history"));u.setExternalContextProvider((function(){return m({application_id:e},s.findView(),c)}));var f=function(e,t){var n,r=o(e.rumEndpoint),i=e.replica;void 0!==i&&(n=o(i.rumEndpoint));function o(n){return new z(new F(n,e.batchBytesLimit,!0),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,(function(){return t.notify(Se.BEFORE_UNLOAD)}))}function u(e){return m(e,{application_id:i.applicationId})}return{add:function(e){r.add(e),n&&n.add(u(e))},upsert:function(e,t){r.upsert(e,t),n&&n.upsert(u(e),t)}}}(i,n),l=function(e,t,n,r){return function(i,o){return function(u,a,c){var s=e.findView(u);if(t.isTracked()&&s&&s.sessionId){var f=e.findAction(u),l=i(a,{action:f,view:s,rum:n()}),d=m(r(),c,b(l));o(d,l)}}}}(s,o,(function(){return{applicationId:e,date:(new Date).getTime(),session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?Mt.USER:Mt.SYNTHETICS},view:{referrer:document.referrer}}}),(function(){return c}));return function(e,t,n,i,o){var u=function(e,t){var n=t.view;return E(t.rum,n,e)},c=function(e,t){var n=t.view,r=t.action;return E(t.rum,n,r,e)};(function(e,t){e.subscribe(Se.VIEW_UPDATED,(function(e){t(e.startTime,{date:S(e.startTime),duration:g(e.duration),evt:{category:xt.VIEW},rum:{documentVersion:e.documentVersion},view:{loadingTime:e.loadingTime?g(e.loadingTime):void 0,loadingType:e.loadingType,measures:e.measures}})}))})(t,i(u,(function(e,t){return o.upsert(e,t.view.id)}))),function(e,t){e.subscribe(Se.ERROR_COLLECTED,(function(e){var n=e.message,i=e.startTime,o=e.context;t(i,r({message:n,date:S(i),evt:{category:xt.ERROR}},o))}))}(t,i(c,o.add)),function(e,t,n,r){t.subscribe(Se.REQUEST_COMPLETED,(function(i){if(n.isTrackedWithResource()&&He(i.url,e)){var o=Ke(i),u=i.type===ee.XHR?a.XHR:a.FETCH,c=o?o.startTime:i.startTime;r(c,{date:S(c),duration:o?Ue(o):g(i.duration),evt:{category:xt.RESOURCE},http:{method:i.method,performance:o?ke(o):void 0,statusCode:i.status,url:i.url},network:{bytesWritten:o?Pe(o):void 0},resource:{kind:u},traceId:i.traceId}),t.notify(Se.RESOURCE_ADDED_TO_BATCH)}}))}(e,t,n,i(c,o.add)),function(e,t,n){t.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(r){switch(r.entryType){case"resource":!function(e,t,n,r){if(!He(t.name,e))return;var i=xe(t);if(R([a.XHR,a.FETCH],i))return;n(t.startTime,{date:S(t.startTime),duration:Ue(t),evt:{category:xt.RESOURCE},http:{performance:ke(t),url:t.name},network:{bytesWritten:Pe(t)},resource:{kind:i}}),r.notify(Se.RESOURCE_ADDED_TO_BATCH)}(e,r,n,t);break;case"longtask":!function(e,t){t(e.startTime,{date:S(e.startTime),duration:g(e.duration),evt:{category:xt.LONG_TASK}})}(r,n)}}))}(e,t,i(c,o.add)),function(e,t){e.subscribe(Se.CUSTOM_ACTION_COLLECTED,(function(e){t(performance.now(),{evt:{category:xt.USER_ACTION,name:e.name},userAction:{type:e.type}},e.context)}))}(t,i(u,o.add)),function(e,t){e.subscribe(Se.AUTO_ACTION_COMPLETED,(function(e){t(e.startTime,{date:S(e.startTime),duration:g(e.duration),evt:{category:xt.USER_ACTION,name:e.name},userAction:{id:e.id,measures:e.measures,type:e.type}})}))}(t,i(u,o.add))}(i,n,o,l,f),Bt(t,n),{addRumGlobalContext:q((function(e,t){c[e]=t})),addUserAction:q((function(e,t){n.notify(Se.CUSTOM_ACTION_COLLECTED,{context:t,name:e,type:_t.CUSTOM})})),getInternalContext:q((function(t){return b(m({applicationId:e},s.findView(t),s.findAction(t)))})),setRumGlobalContext:q((function(e){c=e}))}}!function(e){e.USER_ACTION="user_action",e.ERROR="error",e.LONG_TASK="long_task",e.VIEW="view",e.RESOURCE="resource"}(xt||(xt={})),function(e){e.SYNTHETICS="synthetics",e.USER="user"}(Mt||(Mt={}));var jt,Ft="rum";function Wt(e,t){var n=nt(Ft,(function(t){return function(e,t){var n;n=function(e){return e===jt.NOT_TRACKED||e===jt.TRACKED_WITH_RESOURCES||e===jt.TRACKED_WITHOUT_RESOURCES}(t)?t:T(e.sampleRate)?T(e.resourceSampleRate)?jt.TRACKED_WITH_RESOURCES:jt.TRACKED_WITHOUT_RESOURCES:jt.NOT_TRACKED;return{trackingType:n,isTracked:zt(n)}}(e,t)}));return n.renewObservable.subscribe((function(){t.notify(Se.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&zt(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===jt.TRACKED_WITH_RESOURCES}}}function zt(e){return e===jt.TRACKED_WITH_RESOURCES||e===jt.TRACKED_WITHOUT_RESOURCES}!function(e){e.NOT_TRACKED="0",e.TRACKED_WITH_RESOURCES="1",e.TRACKED_WITHOUT_RESOURCES="2"}(jt||(jt={}));var Gt,Kt=(Gt=r({},{init:function(e){Oe("core.init")},addRumGlobalContext:function(e,t){Oe("addRumGlobalContext")},setRumGlobalContext:function(e){Oe("setRumGlobalContext")},addUserAction:function(e,t){Oe("addUserAction")},getInternalContext:function(e){Oe("getInternalContext")}}),Object.defineProperty(Gt,"_setDebug",{get:function(){return J},enumerable:!1}),Gt),Vt=!1;Kt.init=q((function(e){if(_e()&&we()&&function(e){if(Vt)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&&!_(e.sampleRate))return console.error("Sample Rate should be a number between 0 and 100"),!1;if(void 0!==e.resourceSampleRate&&!_(e.resourceSampleRate))return console.error("Resource Sample Rate should be a number between 0 and 100"),!1;return!0}(e)){e.publicApiKey&&(e.clientToken=e.publicApiKey);var t=r(r({},e),{isCollectingError:!0}),n=new Ie,i=Re(t,Ae),o=i.errorObservable,u=i.configuration,a=i.internalMonitoring,c=Wt(u,n),s=Ht(t.applicationId,location,n,u,c,a),f=ve(),l=f[0],d=f[1];We(n,c),De(n),u.trackInteractions&&Dt(n),o.subscribe((function(e){return n.notify(Se.ERROR_COLLECTED,e)})),l.subscribe((function(e){return n.notify(Se.REQUEST_STARTED,e)})),d.subscribe((function(e){return n.notify(Se.REQUEST_COMPLETED,e)})),v(Kt,s),Vt=!0}})),(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}()).DD_RUM=Kt}]);
!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 Kt}));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,u={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;u;)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 u.label++,{value:o[1],done:!1};case 5:u.label++,r=o[1],o=[0];continue;case 7:o=u.ops.pop(),u.trys.pop();continue;default:if(!(i=(i=u.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){u=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){u.label=o[1];break}if(6===o[0]&&u.label<i[1]){u.label=i[1],i=o;break}if(i&&u.label<i[2]){u.label=i[2],u.ops.push(o);break}i[2]&&u.ops.pop(),u.trys.pop();continue}o=t.call(e,u)}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,a])}}}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],u=0,a=o.length;u<a;u++,i++)r[i]=o[u];return r}var u,a,c=6e4,s=60*c;function f(e,t,n){var r,i=!n||void 0===n.leading||n.leading,o=!n||void 0===n.trailing||n.trailing,u=!1,a=!1,c=!1;return{throttled:function(){var n=this;c||(u?a=!0:(i?e.apply(this):a=!0,u=!0,r=window.setTimeout((function(){o&&a&&e.apply(n),u=!1,a=!1}),t)))},stop:function(){window.clearTimeout(r),c=!0}}}!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.VISIBILITY_CHANGE="visibilitychange"}(u||(u={})),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"}(a||(a={}));var l,d=function(e){return Array.isArray(e)},p=function(e){return!Array.isArray(e)&&"object"==typeof e};function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(e,t){return d(e)&&d(t)?o(Array(Math.max(e.length,t.length))).map((function(n,r){return m(e[r],t[r])})):p(e)&&p(t)?Object.keys(t).reduce((function(n,i){var o;return r(r({},n),((o={})[i]=m(e[i],t[i]),o))}),e):void 0===t?e:t}),e)}function E(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return m.apply(void 0,o([e],t))}function v(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])}))}function h(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,h)}function T(e){return 0!==e&&100*Math.random()<=e}function g(e){return+(1e6*e).toFixed(0)}function b(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)return b(t);return t}(e[n])})),t}function y(){}function C(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];O(e)&&(r=[!0,e.toJSON],delete e.toJSON);var i,o,u=[!1,void 0];"object"==typeof e&&O(i=Object.getPrototypeOf(e))&&(u=[!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]),u[0]&&(i.toJSON=u[1])}return o}function O(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function R(e,t){return-1!==e.indexOf(t)}function _(e){return w(e)&&e>=0&&e<=100}function w(e){return"number"==typeof e}function S(e){return Math.floor(A()+e)}function A(){return void 0===l&&(l=performance.timing.navigationStart),l}function I(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}var D={isCollectingError:!0,maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,resourceSampleRate:100,sampleRate:100,silentMultipleInit:!1,trackInteractions:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function L(e,t,n){var r=t.datacenter===le.US?"com":"eu",i=t.sdkEnv===de.PRODUCTION?"datadoghq."+r:"datad0g."+r,o="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),u=e+"-http-intake.logs."+i,a=t.proxyHost?t.proxyHost:u,c=t.proxyHost?"ddhost="+u+"&":"",s=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+c+"ddsource="+(n||"browser")+"&ddtags="+o;return"https://"+a+"/v1/input/"+t.clientToken+"?"+s}var N=1e3;function M(e,t,n){var r=new Date;r.setTime(r.getTime()+n);var i="expires="+r.toUTCString();document.cookie=e+"="+t+";"+i+";path=/;samesite=strict"}function x(e){var t=document.cookie.match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)");return t?t.pop():void 0}var U="?",k=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function B(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var P=function(){var e,t,n,r,i,o,u=[];function a(e,t,n){var r;for(var i in u)if(B(u,i))try{u[i](e,t,n)}catch(e){r=e}if(r)throw r}function c(e,r,i,o,u){if(t)H.augmentStackTraceWithInitialElement(t,r,i,""+e),f();else if(u)a(H(u),!0,u);else{var c,s={url:r,column:o,line:i},l=e;if("[object String]"==={}.toString.call(e)){var d=l.match(k);d&&(c=d[1],l=d[2])}a({name:c,message:l,stack:[s]},!0)}return!!n&&n.apply(this,arguments)}function s(e){var t=e.reason||"Empty reason";a(H(t),!0,t)}function f(){var n=t,r=e;t=void 0,e=void 0,a(n,!1,r)}function l(n){if(t){if(e===n)return;f()}var r=H(n);throw t=r,e=n,setTimeout((function(){e===n&&f()}),r.incomplete?2e3:0),n}return l.subscribe=function(e){!function(){if(r)return;n=window.onerror,window.onerror=q(c),r=!0}(),function(){if(o)return;i=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=q(s),o=!0}(),u.push(e)},l.unsubscribe=function(e){for(var t=u.length-1;t>=0;t-=1)u[t]===e&&u.splice(t,1);0===u.length&&(r&&(window.onerror=n,r=!1),o&&(window.onunhandledrejection=i,o=!1))},l.traceKitWindowOnError=c,l}(),H=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,u=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,a=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,s=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=e.stack.split("\n"),l=[],d=0,p=f.length;d<p;d+=1){if(o.exec(f[d])){var m=(r=o.exec(f[d]))[2]&&0===r[2].indexOf("native");t=r[2]&&0===r[2].indexOf("eval"),n=s.exec(r[2]),t&&n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3]),i={args:m?[r[2]]:[],column:r[4]?+r[4]:void 0,func:r[1]||U,line:r[3]?+r[3]:void 0,url:m?void 0:r[2]}}else if(a.exec(f[d]))i={args:[],column:(r=a.exec(f[d]))[4]?+r[4]:void 0,func:r[1]||U,line:+r[3],url:r[2]};else{if(!u.exec(f[d]))continue;t=(r=u.exec(f[d]))[3]&&r[3].indexOf(" > eval")>-1,n=c.exec(r[3]),t&&n?(r[3]=n[1],r[4]=n[2],r[5]=void 0):0!==d||r[5]||void 0===e.columnNumber||(l[0].column=e.columnNumber+1),i={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||U,line:r[4]?+r[4]:void 0,url:r[3]}}!i.func&&i.line&&(i.func=U),l.push(i)}if(l.length)return{stack:l,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,u=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,a=[],c={},s=!1,f=r.caller;f&&!s;f=f.caller)f!==H&&f!==P&&(o={args:[],column:void 0,func:U,line:void 0,url:void 0},i=u.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),c[""+f]?s=!0:c[""+f]=!0,a.push(o));t&&a.splice(0,t);var l={stack:a,message:e.message,name:e.name};return n(l,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),l}function i(n,i){var o,u=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"),u=[],a=0;a<o.length;a+=2){var c=void 0;r.exec(o[a])?c={args:[],column:void 0,func:(n=r.exec(o[a]))[3],line:+n[1],url:n[2]}:i.exec(o[a])&&(c={args:(n=i.exec(o[a]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),c&&(!c.func&&c.line&&(c.func=U),c.context=[o[a+1]],u.push(c))}if(u.length)return{stack:u,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,u=[],a=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var s in a)B(a,s)&&!a[s].src&&c.push(a[s]);for(var f=2;f<t.length;f+=2){var l=void 0;if(r.exec(t[f]))l={args:[],column:void 0,func:(n=r.exec(t[f]))[3],line:+n[1],url:n[2]};else if(i.exec(t[f]))l={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]),l={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}l&&(l.func||(l.func=U),l.context=[t[f+1]],u.push(l))}if(u.length)return{stack:u,message:t[0],name:e.name}}}(n))return o}catch(t){if(e)throw t}try{if(o=r(n,u+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 H(e,t+1)}},i}();var j=/[^\u0000-\u007F]/,F=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 W,z=function(){function e(e,t,n,r,i,o){void 0===o&&(o=y),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 j.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=C(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(u.BEFORE_UNLOAD,q(this.beforeUnloadCallback)),document.addEventListener(u.VISIBILITY_CHANGE,q((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(u.BEFORE_UNLOAD,q((function(){return e.flush()}))))},e}();!function(e){e.info="info",e.error="error"}(W||(W={}));var G,K={maxMessagesPerPage:0,sentMessageCount:0};function V(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 z(new F(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var r=function(e){return m({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==G?G():{},e)}(e);n.add(r),t&&t.add(r)}}}(e);v(K,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){G=e}}}function q(e){return function(){try{return e.apply(this,arguments)}catch(e){Q(e);try{Y(e)}catch(e){Q(e)}}}}function $(e,t){!function(e){K.debugMode&&console.log("[MONITORING MESSAGE]",e)}(e),X(r(r({message:e},t),{status:W.info}))}function Y(e){X(r(r({},function(e){if(e instanceof Error){var t=H(e);return{error:{kind:t.name,stack:be(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+C(e)}}(e)),{status:W.error}))}function X(e){K.batch&&K.sentMessageCount<K.maxMessagesPerPage&&(K.sentMessageCount+=1,K.batch.add(e))}function J(e){K.debugMode=e}function Q(e){K.debugMode&&console.warn("[INTERNAL ERROR]",e)}var Z,ee,te=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}();function ne(e){return oe(e,I(window.location)).href}function re(e,t){return ie(e)===ie(t)}function ie(e){return I(oe(e))}function oe(e,t){if(function(){if(void 0!==Z)return Z;try{var e=new URL("http://test/path");return Z="http://test/path"===e.href}catch(e){Z=!1}return Z}())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}!function(e){e.FETCH="fetch",e.XHR="xhr"}(ee||(ee={}));var ue,ae,ce,se,fe,le,de,pe,me=1;function Ee(){var e=me;return me+=1,e}function ve(){return ue||(function(e){var t=e[0],n=e[1],r=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=q((function(e,t){return this._datadog_xhr={method:e,url:t},r.apply(this,arguments)}));var i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(e){var r=this,o=performance.now(),u=Ee();t.notify({requestId:u});var a=!1,c=function(){a||(a=!0,n.notify({requestId:u,startTime:o,duration:performance.now()-o,method:r._datadog_xhr.method,response:r.response,status:r.status,traceId:he(),type:ee.XHR,url:ne(r._datadog_xhr.url)}))},s=this.onreadystatechange;return this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&q(c)(),s&&s.apply(this,arguments)},this.addEventListener("loadend",q(c)),i.apply(this,arguments)}}(ue=[new te,new te]),function(e){var t=e[0],n=e[1];if(!window.fetch)return;var r=window.fetch;window.fetch=q((function(e,o){var u=this,a=o&&o.method||"object"==typeof e&&e.method||"GET",c=performance.now(),s=Ee();t.notify({requestId:s});var f=function(t){return r=u,o=void 0,l=function(){var r,o,u,f,l;return i(this,(function(i){switch(i.label){case 0:return r=performance.now()-c,o=ne("object"==typeof e&&e.url||e),"stack"in t||t instanceof Error?(u=H(t),n.notify({duration:r,method:a,requestId:s,startTime:c,url:o,response:be(u),status:0,traceId:he(),type:ee.FETCH}),[3,6]):[3,1];case 1:if(!("status"in t))return[3,6];f=void 0,i.label=2;case 2:return i.trys.push([2,4,,5]),[4,t.clone().text()];case 3:return f=i.sent(),[3,5];case 4:return l=i.sent(),f="Unable to retrieve response: "+l,[3,5];case 5:n.notify({duration:r,method:a,requestId:s,startTime:c,url:o,response:f,responseType:t.type,status:t.status,traceId:he(),type:ee.FETCH}),i.label=6;case 6:return[2]}}))},new((f=void 0)||(f=Promise))((function(e,t){function n(e){try{u(l.next(e))}catch(e){t(e)}}function i(e){try{u(l.throw(e))}catch(e){t(e)}}function u(t){t.done?e(t.value):new f((function(e){e(t.value)})).then(n,i)}u((l=l.apply(r,o||[])).next())}));var r,o,f,l},l=r.call(this,e,o);return l.then(q(f),q(f)),l}))}(ue)),ue}function he(){return"ddtrace"in window&&window.ddtrace.tracer.scope().active()?window.ddtrace.tracer.scope().active().context().toTraceId():void 0}function Te(e){if(!ce){var t=new te;if(e.isCollectingError)!function(e,t,n){n.subscribe((function(n){(function(e){return 0===e.status&&"opaque"!==e.responseType}(n)||function(e){return e.status>=500}(n))&&t.notify({context:{error:{origin:ae.NETWORK,stack:ye(n.response,e)||"Failed to load"},http:{method:n.method,status_code:n.status,url:n.url}},message:Ce(n.type)+" error "+n.method+" "+n.url,startTime:n.startTime})}))}(e,t,ve()[1]),function(e){se=console.error,console.error=q((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];se.apply(console,o([t],n)),e.notify({context:{error:{origin:ae.CONSOLE}},message:o(["console error:",t],n).map(ge).join(" "),startTime:performance.now()})}))}(t),function(e){fe=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=be(e)):(n="Uncaught "+C(t),r="No stack, consider using an instance of Error");return{message:n,context:{error:{stack:r,kind:e.name,origin:ae.SOURCE}},startTime:performance.now()}}(t,r))},P.subscribe(fe)}(t);ce=function(e,t){var n=0,r=new te;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:ae.AGENT}},message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),c),r}(e,t)}return ce}function ge(e){return"string"==typeof e?e:e instanceof Error?be(H(e)):C(e,0,2)}function be(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 ye(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function Ce(e){return ee.XHR===e?"XHR":"Fetch"}function Oe(e){console.warn("'"+e+"' not yet available, please call '.init()' first.")}function Re(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,datacenter:e.datacenter||t.datacenter,env:e.env,proxyHost:e.proxyHost,sdkEnv:t.sdkEnv,sdkVersion:t.sdkVersion,service:e.service,version:e.version},i=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],o=r({isEnabled:function(e){return R(i,e)},logsEndpoint:L("browser",n),rumEndpoint:L("rum",n),traceEndpoint:L("public-trace",n)},D);if(e.internalMonitoringApiKey&&(o.internalMonitoringEndpoint=L("browser",n,"browser-agent-internal-monitoring")),"isCollectingError"in e&&(o.isCollectingError=!!e.isCollectingError),"sampleRate"in e&&(o.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(o.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(o.trackInteractions=!!e.trackInteractions),n.buildMode===pe.E2E_TEST&&(void 0!==e.internalMonitoringEndpoint&&(o.internalMonitoringEndpoint=e.internalMonitoringEndpoint),void 0!==e.logsEndpoint&&(o.logsEndpoint=e.logsEndpoint),void 0!==e.rumEndpoint&&(o.rumEndpoint=e.rumEndpoint)),n.buildMode===pe.STAGING&&void 0!==e.replica){var u=r(r({},n),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,sdkEnv:de.PRODUCTION});o.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:L("browser",u,"browser-agent-internal-monitoring"),logsEndpoint:L("browser",u),rumEndpoint:L("rum",u)}}return o}(e,t),i=V(n);return{configuration:n,errorObservable:Te(n),internalMonitoring:i}}function _e(){return!!function(){if(void 0===document.cookie||null===document.cookie)return!1;try{return M("dd_rum_test","test",1e3),"test"===x("dd_rum_test")}catch(e){return console.error(e),!1}}()||(console.warn("Cookies are not authorized, we will not send any data."),!1)}function we(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger"}(ae||(ae={})),function(e){e.US="us",e.EU="eu"}(le||(le={})),function(e){e.PRODUCTION="production",e.STAGING="staging"}(de||(de={})),function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(pe||(pe={}));var Se,Ae={buildMode:"release",datacenter:"us",sdkEnv:"production",sdkVersion:"1.13.0"};!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"}(Se||(Se={}));var Ie=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 De(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(q((function(){e.notify(Se.DOM_MUTATED)})))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){t&&t.disconnect()}}}var Le="initial_document",Ne=[[a.DOCUMENT,function(e){return Le===e}],[a.XHR,function(e){return"xmlhttprequest"===e}],[a.FETCH,function(e){return"fetch"===e}],[a.BEACON,function(e){return"beacon"===e}],[a.CSS,function(e,t){return null!==t.match(/\.css$/i)}],[a.JS,function(e,t){return null!==t.match(/\.js$/i)}],[a.IMAGE,function(e,t){return R(["image","img","icon"],e)||null!==t.match(/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i)}],[a.FONT,function(e,t){return null!==t.match(/\.(woff|eot|woff2|ttf)$/i)}],[a.MEDIA,function(e,t){return R(["audio","video"],e)||null!==t.match(/\.(mp3|mp4)$/i)}]];function Me(e){var t=e.name;if(!function(e){try{return!!oe(e)}catch(e){return!1}}(t))return $('Failed to construct URL for "'+e.name+'"'),a.OTHER;for(var n=function(e){var t=oe(e).pathname;return"/"===t[0]?t:"/"+t}(t),r=0,i=Ne;r<i.length;r++){var o=i[r],u=o[0];if((0,o[1])(e.initiatorType,n))return u}return a.OTHER}function xe(){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 Ue(e){var t=e.duration,n=e.startTime,r=e.responseEnd;return g(0===t&&n<r?r-n:t)}function ke(e){var t=e.startTime,n=e.fetchStart,r=e.domainLookupStart,i=e.domainLookupEnd,o=e.connectStart,u=e.secureConnectionStart,a=e.connectEnd,c=e.requestStart,s=e.responseStart,f=e.responseEnd,l=e.redirectStart,d=e.redirectEnd;if(xe(t,n,r,i,o,a,c,s,f)){var p=n!==t;if(!p||(l<t&&(l=t),d<t&&(d=n),xe(t,l,d,n))){var m={download:Be(t,s,f),firstByte:Be(t,c,s)};return a!==n&&(m.connect=Be(t,o,a),xe(o,u,a)&&(m.ssl=Be(t,u,a))),i!==n&&(m.dns=Be(t,r,i)),p&&(m.redirect=Be(t,l,d)),m}}}function Be(e,t,n){return{duration:g(n-t),start:g(t-e)}}function Pe(e){if(e.startTime<e.responseStart)return e.decodedBodySize}function He(e,t){return e&&!function(e,t){return re(e,t.logsEndpoint)||re(e,t.rumEndpoint)||re(e,t.traceEndpoint)||t.internalMonitoringEndpoint&&re(e,t.internalMonitoringEndpoint)}(e,t)}function je(){return void 0!==window.performance&&"getEntries"in performance}function Fe(){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("navigation")}function We(e,t){if(function(e){var t;if(Fe()&&performance.getEntriesByType("navigation").length>0){var n=performance.getEntriesByType("navigation")[0];t=r({},n.toJSON())}else t=r(r({},ze()),{name:window.location.href,decodedBodySize:0,startTime:0});t.entryType="resource",t.initiatorType=Le,t.duration=t.responseEnd,e(t)}((function(n){Ge(t,e,[n])})),je()&&Ge(t,e,performance.getEntries()),window.PerformanceObserver){var n=new PerformanceObserver(q((function(n){return Ge(t,e,n.getEntries())}))),i=["resource","navigation","longtask"];"visible"===document.visibilityState&&i.push("paint"),n.observe({entryTypes:i}),je()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}Fe()||function(e){function t(){var t=r(r({},ze()),{entryType:"navigation"});e(t)}if("complete"===document.readyState)t();else{var n=q((function(){window.removeEventListener(u.LOAD,n),setTimeout(q(t))}));window.addEventListener(u.LOAD,n)}}((function(n){Ge(t,e,[n])}))}function ze(){var e={},t=performance.timing;for(var n in t)w(t[n])&&(e[n]=0===t[n]?0:t[n]-A());return e}function Ge(e,t,n){function r(e){t.notify(Se.PERFORMANCE_ENTRY_COLLECTED,e)}e.isTrackedWithResource()&&n.filter((function(e){return"resource"===e.entryType})).forEach(r),n.filter((function(e){return"navigation"===e.entryType})).filter((function(e){return e.loadEventEnd>0})).forEach(r),n.filter((function(e){return"paint"===e.entryType})).forEach(r),n.filter((function(e){return"longtask"===e.entryType})).forEach(r)}function Ke(e){if(performance&&"getEntriesByName"in performance){var t,n=performance.getEntriesByName(e.url,"resource").filter((function(t){return n=t,r=e.startTime,i=Ve(e),n.startTime>=r&&Ve(n)<=i;var n,r,i}));return 1===n.length?n[0]:2===n.length&&Ve((t=n)[0])<=t[1].startTime?n[1]:void 0}}function Ve(e){return e.startTime+e.duration}var qe="_dd",$e="_dd_r",Ye="_dd_l",Xe="rum",Je="logs";var Qe="_dd_s",Ze=15*c,et=4*s,tt=c;function nt(e,t){var n,r,i,o,a,c=(n=Qe,o=!1,a=function(){o=!0,window.clearTimeout(r),r=window.setTimeout((function(){o=!1}),N)},{get:function(){return o?i:(i=x(n),a(),i)},set:function(e,t){M(n,e,t),i=e,a()}});!function(e){var t=e.get(),n=x(qe),r=x($e),i=x(Ye);if(!t){var o={};n&&(o.id=n),i&&/^[01]$/.test(i)&&(o[Je]=i),r&&/^[012]$/.test(r)&&(o[Xe]=r),ut(o,e)}}(c);var s=new te,l=ot(c).id,d=f((function(){var n=ot(c),r=t(n[e]),i=r.trackingType,o=r.isTracked;n[e]=i,o&&!n.id&&(n.id=h(),n.created=String(Date.now())),ut(n,c),o&&l!==n.id&&(l=n.id,s.notify())}),N).throttled;return d(),function(e){var t=q(e),n={capture:!0,passive:!0};[u.CLICK,u.TOUCH_START,u.KEY_DOWN,u.SCROLL].forEach((function(e){document.addEventListener(e,t,n),ct.push((function(){return document.removeEventListener(e,t,n)}))}))}(d),function(e){var t=q((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,tt);document.addEventListener(u.VISIBILITY_CHANGE,t),ct.push((function(){clearInterval(n),document.removeEventListener(u.VISIBILITY_CHANGE,t)}))}((function(){ut(ot(c),c)})),{getId:function(){return ot(c).id},getTrackingType:function(){return ot(c)[e]},renewObservable:s}}var rt=/^([a-z]+)=([a-z0-9-]+)$/,it="&";function ot(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf(it)||rt.test(e))})(t)&&t.split(it).forEach((function(e){var t=rt.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)<et)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(at(e),{})}function ut(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+Ze);var r=function(e){return Object.keys(e).map((function(t){return[t,e[t]]}))}(e).map((function(e){return e[0]+"="+e[1]})).join(it);t.set(r,Ze)}else at(t)}function at(e){e.set("",0)}var ct=[];var st=et,ft=5*c,lt=c;function dt(e){return function(e){var t;if(function(){void 0===vt&&(vt="closest"in HTMLElement.prototype);return vt}())t=e.closest("["+pt+"]");else for(var n=e;n;){if(n.hasAttribute(pt)){t=n;break}n=n.parentElement}if(!t)return;return Ct(yt(t.getAttribute(pt).trim()))}(e)||bt(e,ht)||bt(e,Tt)||""}var pt="data-dd-action-name";var mt,Et,vt,ht=[function(e){if(function(){void 0===Et&&(Et="labels"in HTMLInputElement.prototype);return Et}()){if("labels"in e&&e.labels&&e.labels.length>0)return Ot(e.labels[0])}else if(e.id){var t=e.ownerDocument&&e.ownerDocument.querySelector('label[for="'+e.id.replace('"','\\"')+'"]');return t&&Ot(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 Ot(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(Ot).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 Ot(e.options[0])}],Tt=[function(e){return Ot(e)}],gt=10;function bt(e,t){for(var n=e,r=0;r<=gt&&n&&"BODY"!==n.nodeName&&"HTML"!==n.nodeName&&"HEAD"!==n.nodeName;){for(var i=0,o=t;i<o.length;i++){var u=(0,o[i])(n);if("string"==typeof u){var a=u.trim();if(a)return Ct(yt(a))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function yt(e){return e.replace(/\s+/g," ")}function Ct(e){return e.length>100?e.slice(0,100)+" [...]":e}function Ot(e){if(!e.isContentEditable){if("innerText"in e){var t=e.innerText;if(!function(){if(void 0===mt){var e=document.createElement("style");e.textContent="*";var t=document.createElement("div");t.appendChild(e),document.body.appendChild(t),mt=""===t.innerText,document.body.removeChild(t)}return mt}())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 Rt(e,t){void 0===t&&(t=y);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=[];return r.push(e.subscribe(Se.ERROR_COLLECTED,(function(){n.errorCount+=1,t(n)}))),r.push(e.subscribe(Se.AUTO_ACTION_COMPLETED,(function(){n.userActionCount+=1,t(n)}))),r.push(e.subscribe(Se.CUSTOM_ACTION_COLLECTED,(function(){n.userActionCount+=1,t(n)}))),r.push(e.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(e){"longtask"===e.entryType&&(n.longTaskCount+=1,t(n))}))),r.push(e.subscribe(Se.RESOURCE_ADDED_TO_BATCH,(function(){n.resourceCount+=1,t(n)}))),{stop:function(){r.forEach((function(e){return e.unsubscribe()}))},eventCounts:n}}var _t,wt=100,St=100,At=1e4;function It(e,t){var n=function(e){var t,n=new te,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(e.subscribe(Se.DOM_MUTATED,(function(){return o()}))),r.push(e.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(e){"resource"===e.entryType&&o()}))),r.push(e.subscribe(Se.REQUEST_STARTED,(function(e){void 0===t&&(t=e.requestId),i+=1,o()}))),r.push(e.subscribe(Se.REQUEST_COMPLETED,(function(e){void 0===t||e.requestId<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(q((function(){return c(!1,0)})),wt),u=setTimeout(q((function(){return c(!0,performance.now())})),At);function a(){i=!0,clearTimeout(o),clearTimeout(r),clearTimeout(u),t()}function c(e,t){i||(a(),n(e,t))}return e.subscribe((function(e){var t=e.isBusy;clearTimeout(o),clearTimeout(r);var n=performance.now();t||(r=setTimeout(q((function(){return c(!0,n)})),St))})),{stop:a}}(r,i,t).stop;return{stop:function(){o(),i()}}}function Dt(e){var t=function(e){var t,n;return{create:function(r,i){if(!t){var o=new Nt(e,r,i);t=o,n=It(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=dt(e.target);n&&t.create(_t.CLICK,n)}}return e.subscribe(Se.VIEW_CREATED,(function(){t.discardCurrent()})),addEventListener(u.CLICK,n,{capture:!0}),{stop:function(){t.discardCurrent(),removeEventListener(u.CLICK,n,{capture:!0})}}}!function(e){e.CLICK="click",e.CUSTOM="custom"}(_t||(_t={}));var Lt,Nt=function(){function e(e,t,n){this.lifeCycle=e,this.type=t,this.name=n,this.id=h(),this.startTime=performance.now(),this.eventCountsSubscription=Rt(e),this.lifeCycle.notify(Se.AUTO_ACTION_CREATED,{id:this.id,startTime:this.startTime})}return e.prototype.complete=function(e){var t=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(Se.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(Se.AUTO_ACTION_DISCARDED),this.eventCountsSubscription.stop()},e}();!function(e){e.INITIAL_LOAD="initial_load",e.ROUTE_CHANGE="route_change"}(Lt||(Lt={}));var Mt,xt,Ut=3e3,kt=5*c;function Bt(e,t){var n=r({},e),i=Pt(t,n,Lt.INITIAL_LOAD,0);!function(e){var t=history.pushState;history.pushState=q((function(){t.apply(this,arguments),e()}));var n=history.replaceState;history.replaceState=q((function(){n.apply(this,arguments),e()})),window.addEventListener(u.POP_STATE,q(e))}((function(){var o;o=e,n.pathname!==o.pathname&&(n=r({},e),i.triggerUpdate(),i.end(),i=Pt(t,n,Lt.ROUTE_CHANGE))})),t.subscribe(Se.SESSION_RENEWED,(function(){i.end(),i=Pt(t,n,Lt.ROUTE_CHANGE)})),t.subscribe(Se.BEFORE_UNLOAD,(function(){i.triggerUpdate(),i.end()}));var o=window.setInterval(q((function(){i.triggerUpdate()})),kt);return{stop:function(){i.end(),clearInterval(o)}}}function Pt(e,t,n,i){void 0===i&&(i=performance.now());var o,u=h(),a={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},c=0;e.notify(Se.VIEW_CREATED,{id:u,startTime:i});var s=f(q(T),Ut,{leading:!1}),l=s.throttled,d=s.stop;function p(e){a=r(r({},a),e),l()}var m=function(e,t){var n={};return{stop:e.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(e){if("navigation"===e.entryType){var i=e;n=r(r({},n),{domComplete:g(i.domComplete),domContentLoaded:g(i.domContentLoadedEventEnd),domInteractive:g(i.domInteractive),loadEventEnd:g(i.loadEventEnd)}),t(n)}else if("paint"===e.entryType&&"first-contentful-paint"===e.name){var o=e;n=r(r({},n),{firstContentfulPaint:g(o.startTime)}),t(n)}})).unsubscribe}}(e,p).stop,E=Rt(e,p).stop;var v=function(e,t,n){var r=1,i=[],o=y;t===Lt.INITIAL_LOAD&&(r+=1,o=function(e,t){return{stop:e.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(e){"navigation"===e.entryType&&t(e.loadEventEnd)})).unsubscribe}}(e,a).stop);var u=function(e,t){var n=performance.now();return{stop:It(e,(function(e,r){t(e?r-n:void 0)})).stop}}(e,a).stop;function a(e){r-=1,e&&i.push(e),0===r&&i.length&&n(Math.max.apply(Math,i))}return{stop:function(){u(),o()}}}(e,n,(function(e){o=e,l()})).stop;function T(){c+=1,e.notify(Se.VIEW_UPDATED,{documentVersion:c,id:u,loadingTime:o,loadingType:n,location:t,measures:a,startTime:i,duration:performance.now()-i})}return T(),{end:function(){m(),E(),v(),d()},triggerUpdate:function(){T()}}}function Ht(e,t,n,i,o,u){var c={},s=function(e,t,n){var r,i,o,u=[],a=[];t.subscribe(Se.VIEW_CREATED,(function(e){r&&u.unshift({context:f(),endTime:e.startTime,startTime:r.startTime}),r=e,o=n.getId()})),t.subscribe(Se.AUTO_ACTION_CREATED,(function(e){i=e})),t.subscribe(Se.AUTO_ACTION_COMPLETED,(function(e){i&&a.unshift({context:l(),endTime:i.startTime+e.duration,startTime:i.startTime}),i=void 0})),t.subscribe(Se.AUTO_ACTION_DISCARDED,(function(){i=void 0})),t.subscribe(Se.SESSION_RENEWED,(function(){u=[],a=[],r=void 0,i=void 0}));var c=window.setInterval(q((function(){s(u,st),s(a,ft)})),lt);function s(e,t){for(var n=performance.now()-t;e.length>0&&e[e.length-1].startTime<n;)e.pop()}function f(){return{sessionId:o,view:{id:r.id,url:e.href}}}function l(){return{userAction:{id:i.id}}}function d(e,t,n,r){if(!r)return n?e():void 0;if(n&&r>=n.startTime)return e();for(var i=0,o=t;i<o.length;i++){var u=o[i];if(r>u.endTime)break;if(r>=u.startTime)return u.context}}return{findAction:function(e){return d(l,a,i,e)},findView:function(e){return d(f,u,r,e)},stop:function(){window.clearInterval(c)}}}(window.location,n,o);u.setExternalContextProvider((function(){return m({application_id:e},s.findView(),c)}));var f=function(e,t){var n,r=o(e.rumEndpoint),i=e.replica;void 0!==i&&(n=o(i.rumEndpoint));function o(n){return new z(new F(n,e.batchBytesLimit,!0),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,(function(){return t.notify(Se.BEFORE_UNLOAD)}))}function u(e){return m(e,{application_id:i.applicationId})}return{add:function(e){r.add(e),n&&n.add(u(e))},upsert:function(e,t){r.upsert(e,t),n&&n.upsert(u(e),t)}}}(i,n),l=function(e,t,n,r){return function(i,o){return function(u,a,c){var s=e.findView(u);if(t.isTracked()&&s&&s.sessionId){var f=e.findAction(u),l=i(a,{action:f,view:s,rum:n()}),d=m(r(),c,b(l));o(d,l)}}}}(s,o,(function(){return{applicationId:e,date:(new Date).getTime(),session:{type:void 0===window._DATADOG_SYNTHETICS_BROWSER?xt.USER:xt.SYNTHETICS},view:{referrer:document.referrer}}}),(function(){return c}));return function(e,t,n,i,o){var u=function(e,t){var n=t.view;return E(t.rum,n,e)},c=function(e,t){var n=t.view,r=t.action;return E(t.rum,n,r,e)};(function(e,t){e.subscribe(Se.VIEW_UPDATED,(function(e){t(e.startTime,{date:S(e.startTime),duration:g(e.duration),evt:{category:Mt.VIEW},rum:{documentVersion:e.documentVersion},view:{loadingTime:e.loadingTime?g(e.loadingTime):void 0,loadingType:e.loadingType,measures:e.measures}})}))})(t,i(u,(function(e,t){return o.upsert(e,t.view.id)}))),function(e,t){e.subscribe(Se.ERROR_COLLECTED,(function(e){var n=e.message,i=e.startTime,o=e.context;t(i,r({message:n,date:S(i),evt:{category:Mt.ERROR}},o))}))}(t,i(c,o.add)),function(e,t,n,r){t.subscribe(Se.REQUEST_COMPLETED,(function(i){if(n.isTrackedWithResource()&&He(i.url,e)){var o=Ke(i),u=i.type===ee.XHR?a.XHR:a.FETCH,c=o?o.startTime:i.startTime;r(c,{date:S(c),duration:o?Ue(o):g(i.duration),evt:{category:Mt.RESOURCE},http:{method:i.method,performance:o?ke(o):void 0,statusCode:i.status,url:i.url},network:{bytesWritten:o?Pe(o):void 0},resource:{kind:u},traceId:i.traceId}),t.notify(Se.RESOURCE_ADDED_TO_BATCH)}}))}(e,t,n,i(c,o.add)),function(e,t,n){t.subscribe(Se.PERFORMANCE_ENTRY_COLLECTED,(function(r){switch(r.entryType){case"resource":!function(e,t,n,r){if(!He(t.name,e))return;var i=Me(t);if(R([a.XHR,a.FETCH],i))return;n(t.startTime,{date:S(t.startTime),duration:Ue(t),evt:{category:Mt.RESOURCE},http:{performance:ke(t),url:t.name},network:{bytesWritten:Pe(t)},resource:{kind:i}}),r.notify(Se.RESOURCE_ADDED_TO_BATCH)}(e,r,n,t);break;case"longtask":!function(e,t){t(e.startTime,{date:S(e.startTime),duration:g(e.duration),evt:{category:Mt.LONG_TASK}})}(r,n)}}))}(e,t,i(c,o.add)),function(e,t){e.subscribe(Se.CUSTOM_ACTION_COLLECTED,(function(e){t(performance.now(),{evt:{category:Mt.USER_ACTION,name:e.name},userAction:{type:e.type}},e.context)}))}(t,i(u,o.add)),function(e,t){e.subscribe(Se.AUTO_ACTION_COMPLETED,(function(e){t(e.startTime,{date:S(e.startTime),duration:g(e.duration),evt:{category:Mt.USER_ACTION,name:e.name},userAction:{id:e.id,measures:e.measures,type:e.type}})}))}(t,i(u,o.add))}(i,n,o,l,f),Bt(t,n),{addRumGlobalContext:q((function(e,t){c[e]=t})),addUserAction:q((function(e,t){n.notify(Se.CUSTOM_ACTION_COLLECTED,{context:t,name:e,type:_t.CUSTOM})})),getInternalContext:q((function(t){return b(m({applicationId:e},s.findView(t),s.findAction(t)))})),setRumGlobalContext:q((function(e){c=e}))}}!function(e){e.USER_ACTION="user_action",e.ERROR="error",e.LONG_TASK="long_task",e.VIEW="view",e.RESOURCE="resource"}(Mt||(Mt={})),function(e){e.SYNTHETICS="synthetics",e.USER="user"}(xt||(xt={}));var jt,Ft="rum";function Wt(e,t){var n=nt(Ft,(function(t){return function(e,t){var n;n=function(e){return e===jt.NOT_TRACKED||e===jt.TRACKED_WITH_RESOURCES||e===jt.TRACKED_WITHOUT_RESOURCES}(t)?t:T(e.sampleRate)?T(e.resourceSampleRate)?jt.TRACKED_WITH_RESOURCES:jt.TRACKED_WITHOUT_RESOURCES:jt.NOT_TRACKED;return{trackingType:n,isTracked:zt(n)}}(e,t)}));return n.renewObservable.subscribe((function(){t.notify(Se.SESSION_RENEWED)})),{getId:n.getId,isTracked:function(){return void 0!==n.getId()&&zt(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===jt.TRACKED_WITH_RESOURCES}}}function zt(e){return e===jt.TRACKED_WITH_RESOURCES||e===jt.TRACKED_WITHOUT_RESOURCES}!function(e){e.NOT_TRACKED="0",e.TRACKED_WITH_RESOURCES="1",e.TRACKED_WITHOUT_RESOURCES="2"}(jt||(jt={}));var Gt,Kt=(Gt=r({},{init:function(e){Oe("core.init")},addRumGlobalContext:function(e,t){Oe("addRumGlobalContext")},setRumGlobalContext:function(e){Oe("setRumGlobalContext")},addUserAction:function(e,t){Oe("addUserAction")},getInternalContext:function(e){Oe("getInternalContext")}}),Object.defineProperty(Gt,"_setDebug",{get:function(){return J},enumerable:!1}),Gt),Vt=!1;Kt.init=q((function(e){if(_e()&&we()&&function(e){if(Vt)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&&!_(e.sampleRate))return console.error("Sample Rate should be a number between 0 and 100"),!1;if(void 0!==e.resourceSampleRate&&!_(e.resourceSampleRate))return console.error("Resource Sample Rate should be a number between 0 and 100"),!1;return!0}(e)){e.publicApiKey&&(e.clientToken=e.publicApiKey);var t=r(r({},e),{isCollectingError:!0}),n=new Ie,i=Re(t,Ae),o=i.errorObservable,u=i.configuration,a=i.internalMonitoring,c=Wt(u,n),s=Ht(t.applicationId,location,n,u,c,a),f=ve(),l=f[0],d=f[1];We(n,c),De(n),u.trackInteractions&&Dt(n),o.subscribe((function(e){return n.notify(Se.ERROR_COLLECTED,e)})),l.subscribe((function(e){return n.notify(Se.REQUEST_STARTED,e)})),d.subscribe((function(e){return n.notify(Se.REQUEST_COMPLETED,e)})),v(Kt,s),Vt=!0}})),(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}()).DD_RUM=Kt}]);

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

sdkEnv: 'production',
sdkVersion: '1.12.10',
sdkVersion: '1.13.0',
};
//# sourceMappingURL=buildEnv.js.map

@@ -24,2 +24,2 @@ import { Context } from '@datadog/browser-core';

}
export declare function startParentContexts(location: Location, lifeCycle: LifeCycle, session: RumSession, withContextHistory: boolean): ParentContexts;
export declare function startParentContexts(location: Location, lifeCycle: LifeCycle, session: RumSession): ParentContexts;

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

exports.CLEAR_OLD_CONTEXTS_INTERVAL = browser_core_1.ONE_MINUTE;
function startParentContexts(location, lifeCycle, session, withContextHistory) {
function startParentContexts(location, lifeCycle, session) {
var currentView;

@@ -16,3 +16,3 @@ var currentAction;

lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.VIEW_CREATED, function (currentContext) {
if (currentView && withContextHistory) {
if (currentView) {
previousViews.unshift({

@@ -31,3 +31,3 @@ context: buildCurrentViewContext(),

lifeCycle.subscribe(lifeCycle_1.LifeCycleEventType.AUTO_ACTION_COMPLETED, function (userAction) {
if (currentAction && withContextHistory) {
if (currentAction) {
previousActions.unshift({

@@ -73,5 +73,2 @@ context: buildCurrentActionContext(),

}
if (!withContextHistory) {
return undefined;
}
for (var _i = 0, previousContexts_1 = previousContexts; _i < previousContexts_1.length; _i++) {

@@ -78,0 +75,0 @@ var previousContext = previousContexts_1[_i];

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

var globalContext = {};
var parentContexts = parentContexts_1.startParentContexts(window.location, lifeCycle, session, configuration.isEnabled('context-history'));
var parentContexts = parentContexts_1.startParentContexts(window.location, lifeCycle, session);
internalMonitoring.setExternalContextProvider(function () {

@@ -29,0 +29,0 @@ return browser_core_1.deepMerge({

@@ -5,4 +5,4 @@ export var buildEnv = {

sdkEnv: 'production',
sdkVersion: '1.12.10',
sdkVersion: '1.13.0',
};
//# sourceMappingURL=buildEnv.js.map

@@ -24,2 +24,2 @@ import { Context } from '@datadog/browser-core';

}
export declare function startParentContexts(location: Location, lifeCycle: LifeCycle, session: RumSession, withContextHistory: boolean): ParentContexts;
export declare function startParentContexts(location: Location, lifeCycle: LifeCycle, session: RumSession): ParentContexts;

@@ -6,3 +6,3 @@ import { monitor, ONE_MINUTE, SESSION_TIME_OUT_DELAY } from '@datadog/browser-core';

export var CLEAR_OLD_CONTEXTS_INTERVAL = ONE_MINUTE;
export function startParentContexts(location, lifeCycle, session, withContextHistory) {
export function startParentContexts(location, lifeCycle, session) {
var currentView;

@@ -14,3 +14,3 @@ var currentAction;

lifeCycle.subscribe(LifeCycleEventType.VIEW_CREATED, function (currentContext) {
if (currentView && withContextHistory) {
if (currentView) {
previousViews.unshift({

@@ -29,3 +29,3 @@ context: buildCurrentViewContext(),

lifeCycle.subscribe(LifeCycleEventType.AUTO_ACTION_COMPLETED, function (userAction) {
if (currentAction && withContextHistory) {
if (currentAction) {
previousActions.unshift({

@@ -71,5 +71,2 @@ context: buildCurrentActionContext(),

}
if (!withContextHistory) {
return undefined;
}
for (var _i = 0, previousContexts_1 = previousContexts; _i < previousContexts_1.length; _i++) {

@@ -76,0 +73,0 @@ var previousContext = previousContexts_1[_i];

@@ -24,3 +24,3 @@ import { __assign } from "tslib";

var globalContext = {};
var parentContexts = startParentContexts(window.location, lifeCycle, session, configuration.isEnabled('context-history'));
var parentContexts = startParentContexts(window.location, lifeCycle, session);
internalMonitoring.setExternalContextProvider(function () {

@@ -27,0 +27,0 @@ return deepMerge({

{
"name": "@datadog/browser-rum",
"version": "1.12.10",
"version": "1.13.0",
"license": "Apache-2.0",

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

"dependencies": {
"@datadog/browser-core": "1.12.10",
"@datadog/browser-core": "1.13.0",
"tslib": "1.10.0"

@@ -29,3 +29,3 @@ },

},
"gitHead": "166ad44f34a4b9bde9ae63fc69b23a86d9e72ade"
"gitHead": "8f4cafa75386dd9053a3436b57e2409fec15fd5a"
}

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc