Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@datadog/browser-logs

Package Overview
Dependencies
Maintainers
1
Versions
259
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@datadog/browser-logs - npm Package Compare versions

Comparing version 1.18.0 to 1.18.1

2

bundle/datadog-logs.js

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

!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));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,"datadogLogs",(function(){return nt})),n.d(t,"makeLogsGlobal",(function(){return rt}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function i(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}var a,s,u,c=6e4,l=60*c;!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"}(a||(a={})),function(e){e.DOCUMENT="document",e.XHR="xhr",e.BEACON="beacon",e.FETCH="fetch",e.CSS="css",e.JS="js",e.IMAGE="image",e.FONT="font",e.MEDIA="media",e.OTHER="other"}(s||(s={})),function(e){e.FETCH="fetch",e.XHR="xhr"}(u||(u={}));var f,d,p=function(e){return Array.isArray(e)},g=function(e){return!Array.isArray(e)&&"object"==typeof e};function h(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(e,t){return p(e)&&p(t)?i(Array(Math.max(e.length,t.length))).map((function(n,r){return h(e[r],t[r])})):g(e)&&g(t)?Object.keys(t).reduce((function(n,o){var i;return r(r({},n),((i={})[o]=h(e[o],t[o]),i))}),e):void 0===t?e:t}),e)}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 m(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,m)}function y(){}function b(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];w(e)&&(r=[!0,e.toJSON],delete e.toJSON);var o,i,a=[!1,void 0];"object"==typeof e&&w(o=Object.getPrototypeOf(e))&&(a=[!0,o.toJSON],delete o.toJSON);try{i=JSON.stringify(e,void 0,n)}catch(e){i="<error: unable to serialize object>"}finally{r[0]&&(e.toJSON=r[1]),a[0]&&(o.toJSON=a[1])}return i}function w(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function E(){return void 0===f&&(f=performance.timing.navigationStart),f}function x(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}function T(e){return C(e,x(window.location)).href}function O(e,t){return S(e)===S(t)}function S(e){return x(C(e))}function C(e,t){if(function(){if(void 0!==d)return d;try{var e=new URL("http://test/path");return d="http://test/path"===e.href}catch(e){d=!1}return d}())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 o=(n=document.implementation.createHTMLDocument("")).createElement("base");o.href=t,n.head.appendChild(o),n.body.appendChild(r)}return r.href=e,r}var L={allowedTracingOrigins:[],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 _(e,t,n){var r="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),o=e+"-http-intake.logs."+t.site,i=t.proxyHost?t.proxyHost:o,a=t.proxyHost?"ddhost="+o+"&":"",s=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+a+"ddsource="+(n||"browser")+"&ddtags="+r;return"https://"+i+"/v1/input/"+t.clientToken+"?"+s}var M=1e3;function R(e,t,n){var r=new Date;r.setTime(r.getTime()+n);var o="expires="+r.toUTCString();document.cookie=e+"="+t+";"+o+";path=/;samesite=strict"}function k(e){return function(e,t){var n=e.match("(?:^|;)\\s*"+t+"\\s*=\\s*([^;]+)");return n?n[1]:void 0}(document.cookie,e)}function I(){if(void 0===document.cookie||null===document.cookie)return!1;try{return R("dd_rum_test","test",1e3),"test"===k("dd_rum_test")}catch(e){return console.error(e),!1}}var B="?",A=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var N=function(){var e,t,n,r,o,i,a=[];function s(e,t,n){var r;for(var o in a)if(j(a,o))try{a[o](e,t,n)}catch(e){r=e}if(r)throw r}function u(e,r,o,i,a){if(t)D.augmentStackTraceWithInitialElement(t,r,o,""+e),l();else if(a)s(D(a),!0,a);else{var u,c={url:r,column:i,line:o},f=e;if("[object String]"==={}.toString.call(e)){var d=f.match(A);d&&(u=d[1],f=d[2])}s({name:u,message:f,stack:[c]},!0)}return!!n&&n.apply(this,arguments)}function c(e){var t=e.reason||"Empty reason";s(D(t),!0,t)}function l(){var n=t,r=e;t=void 0,e=void 0,s(n,!1,r)}function f(n){if(t){if(e===n)return;l()}var r=D(n);throw t=r,e=n,setTimeout((function(){e===n&&l()}),r.incomplete?2e3:0),n}return f.subscribe=function(e){!function(){if(r)return;n=window.onerror,window.onerror=X(u),r=!0}(),function(){if(i)return;o=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=X(c),i=!0}(),a.push(e)},f.unsubscribe=function(e){for(var t=a.length-1;t>=0;t-=1)a[t]===e&&a.splice(t,1);0===a.length&&(r&&(window.onerror=n,r=!1),i&&(window.onunhandledrejection=o,i=!1))},f.traceKitWindowOnError=u,f}(),D=function(){var e=!1;function t(e){if(e.stack){for(var t,n,r,o,i=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,s=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,u=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=e.stack.split("\n"),f=[],d=0,p=l.length;d<p;d+=1){if(i.exec(l[d])){var g=(r=i.exec(l[d]))[2]&&0===r[2].indexOf("native");t=r[2]&&0===r[2].indexOf("eval"),n=c.exec(r[2]),t&&n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3]),o={args:g?[r[2]]:[],column:r[4]?+r[4]:void 0,func:r[1]||B,line:r[3]?+r[3]:void 0,url:g?void 0:r[2]}}else if(s.exec(l[d]))o={args:[],column:(r=s.exec(l[d]))[4]?+r[4]:void 0,func:r[1]||B,line:+r[3],url:r[2]};else{if(!a.exec(l[d]))continue;t=(r=a.exec(l[d]))[3]&&r[3].indexOf(" > eval")>-1,n=u.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||(f[0].column=e.columnNumber+1),o={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||B,line:r[4]?+r[4]:void 0,url:r[3]}}!o.func&&o.line&&(o.func=B),f.push(o)}if(f.length)return{stack:f,message:e.message,name:e.name}}}function n(e,t,n,r){var o={url:t,line:n?+n:void 0};if(o.url&&o.line){e.incomplete=!1;var i=e.stack;if(i.length>0&&i[0].url===o.url){if(i[0].line===o.line)return!1;if(!i[0].line&&i[0].func===o.func)return i[0].line=o.line,i[0].context=o.context,!1}return i.unshift(o),e.partial=!0,!0}return e.incomplete=!0,!1}function r(e,t){for(var o,i,a=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,s=[],u={},c=!1,l=r.caller;l&&!c;l=l.caller)l!==D&&l!==N&&(i={args:[],column:void 0,func:B,line:void 0,url:void 0},o=a.exec(l.toString()),l.name?i.func=l.name:o&&(i.func=o[1]),void 0===i.func&&(i.func=o?o.input.substring(0,o.input.indexOf("{")):void 0),u[""+l]?c=!0:u[""+l]=!0,s.push(i));t&&s.splice(0,t);var f={stack:s,message:e.message,name:e.name};return n(f,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),f}function o(n,o){var i,a=void 0===o?0:+o;try{if(i=function(e){var t=e.stacktrace;if(t){for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,i=t.split("\n"),a=[],s=0;s<i.length;s+=2){var u=void 0;r.exec(i[s])?u={args:[],column:void 0,func:(n=r.exec(i[s]))[3],line:+n[1],url:n[2]}:o.exec(i[s])&&(u={args:(n=o.exec(i[s]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),u&&(!u.func&&u.line&&(u.func=B),u.context=[i[s+1]],a.push(u))}if(a.length)return{stack:a,message:e.message,name:e.name}}}(n))return i}catch(t){if(e)throw t}try{if(i=t(n))return i}catch(t){if(e)throw t}try{if(i=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,o=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,i=/^\s*Line (\d+) of function script\s*$/i,a=[],s=window&&window.document&&window.document.getElementsByTagName("script"),u=[];for(var c in s)j(s,c)&&!s[c].src&&u.push(s[c]);for(var l=2;l<t.length;l+=2){var f=void 0;if(r.exec(t[l]))f={args:[],column:void 0,func:(n=r.exec(t[l]))[3],line:+n[1],url:n[2]};else if(o.exec(t[l]))f={args:[],column:void 0,func:(n=o.exec(t[l]))[4],line:+n[1],url:n[3]};else if(i.exec(t[l])){n=i.exec(t[l]),f={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}f&&(f.func||(f.func=B),f.context=[t[l+1]],a.push(f))}if(a.length)return{stack:a,message:t[0],name:e.name}}}(n))return i}catch(t){if(e)throw t}try{if(i=r(n,a+1))return i}catch(t){if(e)throw t}return{message:n.message,name:n.name,stack:[]}}return o.augmentStackTraceWithInitialElement=n,o.computeStackTraceFromStackProp=t,o.ofCaller=function(e){var t=1+(void 0===e?0:+e);try{throw new Error}catch(e){return D(e,t+1)}},o}();var P=/[^\u0000-\u007F]/,H=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 z,U=function(){function e(e,t,n,r,o,i){void 0===i&&(i=y),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=o,this.beforeUnloadCallback=i,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=i(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 P.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,o=n.messageBytesSize;o>=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(o)&&this.flush(),this.push(r,o,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=b(e);return{processedMessage:t,messageBytesSize:this.sizeInBytes(t)}},e.prototype.push=function(e,t,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesSize+=t,this.bufferMessageCount+=1},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.sizeInBytes(t);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e.prototype.willReachedBytesLimitWith=function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},e.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},e.prototype.flushPeriodically=function(){var e=this;setTimeout((function(){e.flush(),e.flushPeriodically()}),this.flushTimeout)},e.prototype.flushOnVisibilityHidden=function(){var e=this;navigator.sendBeacon&&(window.addEventListener(a.BEFORE_UNLOAD,X(this.beforeUnloadCallback)),document.addEventListener(a.VISIBILITY_CHANGE,X((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(a.BEFORE_UNLOAD,X((function(){return e.flush()}))))},e}();!function(e){e.info="info",e.error="error"}(z||(z={}));var G,F,K,q={maxMessagesPerPage:0,sentMessageCount:0};function $(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 U(new H(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var r=function(e){return h({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==G?G():{},e)}(e);n.add(r),t&&t.add(r)}}}(e);v(q,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){G=e}}}function V(e,t,n){var r=n.value;n.value=function(){var e=q.batch?X(r):r;return e.apply(this,arguments)}}function X(e){return function(){try{return e.apply(this,arguments)}catch(e){Z(e);try{J(e)}catch(e){Z(e)}}}}function J(e){W(r(r({},function(e){if(e instanceof Error){var t=D(e);return{error:{kind:t.name,stack:me(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+b(e)}}(e)),{status:z.error}))}function W(e){q.batch&&q.sentMessageCount<q.maxMessagesPerPage&&(q.sentMessageCount+=1,q.batch.add(e))}function Y(e){q.debugMode=e}function Z(e){q.debugMode&&console.warn("[INTERNAL ERROR]",e)}var Q=[],ee=[];function te(){return F||(!function(){if(!window.fetch)return;K=window.fetch,window.fetch=X((function(e,t){var n=this,r=t&&t.method||"object"==typeof e&&e.method||"GET",i=T("object"==typeof e&&e.url||e),a={init:t,method:r,startTime:performance.now(),url:i},s=function(e){return t=n,r=void 0,s=function(){var t,n;return o(this,(function(r){switch(r.label){case 0:return a.duration=performance.now()-a.startTime,"stack"in e||e instanceof Error?(a.status=0,a.response=me(D(e)),ee.forEach((function(e){return e(a)})),[3,6]):[3,1];case 1:if(!("status"in e))return[3,6];t=void 0,r.label=2;case 2:return r.trys.push([2,4,,5]),[4,e.clone().text()];case 3:return t=r.sent(),[3,5];case 4:return n=r.sent(),t="Unable to retrieve response: "+n,[3,5];case 5:a.response=t,a.responseType=e.type,a.status=e.status,ee.forEach((function(e){return e(a)})),r.label=6;case 6:return[2]}}))},new((i=void 0)||(i=Promise))((function(e,n){function o(e){try{u(s.next(e))}catch(e){n(e)}}function a(e){try{u(s.throw(e))}catch(e){n(e)}}function u(t){t.done?e(t.value):new i((function(e){e(t.value)})).then(o,a)}u((s=s.apply(t,r||[])).next())}));var t,r,i,s};Q.forEach((function(e){return e(a)}));var u=K.call(this,e,a.init);return u.then(X(s),X(s)),u}))}(),F={beforeSend:function(e){Q.push(e)},onRequestComplete:function(e){ee.push(e)}}),F}var ne,re,oe,ie,ae,se,ue,ce,le,fe=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}(),de=[],pe=[];function ge(){return ne||(re=XMLHttpRequest.prototype.open,oe=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=X((function(e,t){return this._datadog_xhr={method:e,url:T(t)},re.apply(this,arguments)})),XMLHttpRequest.prototype.send=X((function(e){var t=this;if(this._datadog_xhr){this._datadog_xhr.startTime=performance.now();var n=this.onreadystatechange;this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&X(o)(),n&&n.apply(this,arguments)};var r=!1,o=function(){r||(r=!0,t._datadog_xhr.duration=performance.now()-t._datadog_xhr.startTime,t._datadog_xhr.response=t.response,t._datadog_xhr.status=t.status,pe.forEach((function(e){return e(t._datadog_xhr)})))};this.addEventListener("loadend",X(o)),de.forEach((function(e){return e(t._datadog_xhr,t)}))}return oe.apply(this,arguments)})),ne={beforeSend:function(e){de.push(e)},onRequestComplete:function(e){pe.push(e)}}),ne}function he(e){if(!ae){var t=new fe;e.isCollectingError&&(function(e,t){function n(n,r){(function(e,t){return O(e,t.logsEndpoint)||O(e,t.rumEndpoint)||O(e,t.traceEndpoint)||t.internalMonitoringEndpoint&&O(e,t.internalMonitoringEndpoint)||t.proxyHost&&O(e,t.proxyHost)||t.replica&&(O(e,t.replica.logsEndpoint)||O(e,t.replica.rumEndpoint)||O(e,t.replica.internalMonitoringEndpoint))})(r.url,e)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!function(e){return e.status>=500}(r)||t.notify({context:{error:{origin:ie.NETWORK,stack:ye(r.response,e)||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url}},message:be(n)+" error "+r.method+" "+r.url,startTime:r.startTime})}ge().onRequestComplete((function(e){return n(u.XHR,e)})),te().onRequestComplete((function(e){return n(u.FETCH,e)}))}(e,t),function(e){se=console.error,console.error=X((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];se.apply(console,i([t],n)),e.notify({context:{error:{origin:ie.CONSOLE}},message:i(["console error:",t],n).map(ve).join(" "),startTime:performance.now()})}))}(t),function(e){ue=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=me(e)):(n="Uncaught "+b(t),r="No stack, consider using an instance of Error");return{message:n,context:{error:{stack:r,kind:e.name,origin:ie.SOURCE}},startTime:performance.now()}}(t,r))},N.subscribe(ue)}(t)),ae=function(e,t){var n=0,r=new fe;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:ie.AGENT}},message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),c),r}(e,t)}return ae}function ve(e){return"string"==typeof e?e:e instanceof Error?me(D(e)):b(e,0,2)}function me(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(", ")+")":"",o=e.line?":"+e.line:"",i=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+o+i})),t}function ye(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function be(e){return u.XHR===e?"XHR":"Fetch"}function we(e){console.warn("'"+e+"' not yet available, please call '.init()' first.")}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger"}(ie||(ie={})),function(e){e.US="us",e.EU="eu"}(le||(le={}));var Ee,xe=((ce={})[le.EU]="datadoghq.eu",ce[le.US]="datadoghq.com",ce);function Te(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,env:e.env,proxyHost:e.proxyHost,sdkVersion:t.sdkVersion,service:e.service,site:e.site||xe[e.datacenter||t.datacenter],version:e.version},o=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],i=r({isEnabled:function(e){return t=e,-1!==o.indexOf(t);var t},logsEndpoint:_("browser",n),proxyHost:e.proxyHost,rumEndpoint:_("rum",n),traceEndpoint:_("public-trace",n)},L);if(e.internalMonitoringApiKey&&(i.internalMonitoringEndpoint=_("browser",n,"browser-agent-internal-monitoring")),"allowedTracingOrigins"in e&&(i.allowedTracingOrigins=e.allowedTracingOrigins),"isCollectingError"in e&&(i.isCollectingError=!!e.isCollectingError),"sampleRate"in e&&(i.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(i.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(i.trackInteractions=!!e.trackInteractions),n.buildMode===Ee.E2E_TEST&&(void 0!==e.internalMonitoringEndpoint&&(i.internalMonitoringEndpoint=e.internalMonitoringEndpoint),void 0!==e.logsEndpoint&&(i.logsEndpoint=e.logsEndpoint),void 0!==e.rumEndpoint&&(i.rumEndpoint=e.rumEndpoint)),n.buildMode===Ee.STAGING&&void 0!==e.replica){var a=r(r({},n),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,site:xe[le.US]});i.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:_("browser",a,"browser-agent-internal-monitoring"),logsEndpoint:_("browser",a),rumEndpoint:_("rum",a)}}return i}(e,t),o=$(n);return{configuration:n,errorObservable:he(n),internalMonitoring:o}}function Oe(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(Ee||(Ee={}));var Se,Ce,Le={buildMode:"release",datacenter:"us",sdkVersion:"1.18.0"};!function(e){e.debug="debug",e.info="info",e.warn="warn",e.error="error"}(Ce||(Ce={}));var _e,Me,Re=((Se={})[Ce.debug]=0,Se[Ce.info]=1,Se[Ce.warn]=2,Se[Ce.error]=3,Se);Object.keys(Ce);function ke(e,t,n,o){var i,a={};o.setExternalContextProvider((function(){return h({session_id:n.getId()},a,Ae())}));var s=function(e,t,n){var r,o=i(e.logsEndpoint);void 0!==e.replica&&(r=i(e.replica.logsEndpoint));function i(t){return new U(new H(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var i=function(e){return h({date:(new Date).getTime(),session_id:t.getId(),view:{referrer:document.referrer,url:window.location.href}},n(),Ae(),e)}(e);o.add(i),r&&r.add(i)}}}(t,n,(function(){return a})),u=((i={})[_e.console]=function(e){return console.log(e.status+": "+e.message)},i[_e.http]=function(e){return s.add(e)},i[_e.silent]=y,i),c=new Be(n,u);Me={},e.subscribe((function(e){return c.error(e.message,h(r({date:(t=e.startTime,Math.floor(E()+t))},e.context),Ae(e.startTime)));var t}));var l={setLoggerGlobalContext:function(e){a=e},addLoggerGlobalContext:function(e,t){a[e]=t}};return l.createLogger=function(e,t){return function(n,o){return void 0===o&&(o={}),Me[n]=new Be(e,t,o.handler,o.level,r(r({},o.context),{logger:{name:n}})),Me[n]}}(n,u),l.getLogger=Ie,l.logger=c,l}function Ie(e){return Me[e]}!function(e){e.http="http",e.console="console",e.silent="silent"}(_e||(_e={}));var Be=function(){function e(e,t,n,r,o){void 0===n&&(n=_e.http),void 0===r&&(r=Ce.debug),void 0===o&&(o={}),this.session=e,this.handlers=t,this.level=r,this.loggerContext=o,this.handler=this.handlers[n]}return e.prototype.log=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n=Ce.info),this.session.isTracked()&&Re[n]>=Re[this.level]&&this.handler(r({message:e,status:n},h({},this.loggerContext,t)))},e.prototype.debug=function(e,t){void 0===t&&(t={}),this.log(e,t,Ce.debug)},e.prototype.info=function(e,t){void 0===t&&(t={}),this.log(e,t,Ce.info)},e.prototype.warn=function(e,t){void 0===t&&(t={}),this.log(e,t,Ce.warn)},e.prototype.error=function(e,t){void 0===t&&(t={});var n={error:{origin:ie.LOGGER}};this.log(e,h({},n,t),Ce.error)},e.prototype.setContext=function(e){this.loggerContext=e},e.prototype.addContext=function(e,t){this.loggerContext[e]=t},e.prototype.removeContext=function(e){delete this.loggerContext[e]},e.prototype.setHandler=function(e){this.handler=this.handlers[e]},e.prototype.setLevel=function(e){this.level=e},function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);i>3&&a&&Object.defineProperty(t,n,a)}([V],e.prototype,"log",null),e}();function Ae(e){var t=window.DD_RUM;return t&&t.getInternalContext?t.getInternalContext(e):void 0}var je="_dd",Ne="_dd_r",De="_dd_l",Pe="rum",He="logs";var ze="_dd_s",Ue=15*c,Ge=4*l,Fe=c;function Ke(e,t){var n,r,o,i,s,u=(n=ze,i=!1,s=function(){i=!0,window.clearTimeout(r),r=window.setTimeout((function(){i=!1}),M)},{get:function(){return i?o:(o=k(n),s(),o)},set:function(e,t){R(n,e,t),o=e,s()}});!function(e){var t=e.get(),n=k(je),r=k(Ne),o=k(De);if(!t){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i[He]=o),r&&/^[012]$/.test(r)&&(i[Pe]=r),Xe(i,e)}}(u);var c,l,f,d,p,g,h,v,y=new fe,b=Ve(u).id,w=(c=function(){var n=Ve(u),r=t(n[e]),o=r.trackingType,i=r.isTracked;n[e]=o,i&&!n.id&&(n.id=m(),n.created=String(Date.now())),Xe(n,u),i&&b!==n.id&&(b=n.id,y.notify())},l=M,p=!f||void 0===f.leading||f.leading,g=!f||void 0===f.trailing||f.trailing,h=!1,v=!1,{throttled:function(){var e=this;h?v=!0:(p?c.apply(this):v=!0,h=!0,d=window.setTimeout((function(){g&&v&&c.apply(e),h=!1,v=!1}),l))},cancel:function(){window.clearTimeout(d),h=!1,v=!1}}).throttled;return w(),function(e){var t=X(e),n={capture:!0,passive:!0};[a.CLICK,a.TOUCH_START,a.KEY_DOWN,a.SCROLL].forEach((function(e){document.addEventListener(e,t,n),We.push((function(){return document.removeEventListener(e,t,n)}))}))}(w),function(e){var t=X((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,Fe);document.addEventListener(a.VISIBILITY_CHANGE,t),We.push((function(){clearInterval(n),document.removeEventListener(a.VISIBILITY_CHANGE,t)}))}((function(){Xe(Ve(u),u)})),{getId:function(){return Ve(u).id},getTrackingType:function(){return Ve(u)[e]},renewObservable:y}}var qe=/^([a-z]+)=([a-z0-9-]+)$/,$e="&";function Ve(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf($e)||qe.test(e))})(t)&&t.split($e).forEach((function(e){var t=qe.exec(e);if(null!==t){var r=t[1],o=t[2];n[r]=o}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<Ge)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(Je(e),{})}function Xe(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+Ue);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($e);t.set(r,Ue)}else Je(t)}function Je(e){e.set("",0)}var We=[];var Ye,Ze="logs";function Qe(e,t){if(!t){var n=et(e)===Ye.TRACKED;return{getId:function(){},isTracked:function(){return n}}}var r=Ke(Ze,(function(t){return function(e,t){var n=function(e){return e===Ye.NOT_TRACKED||e===Ye.TRACKED}(t)?t:et(e);return{trackingType:n,isTracked:n===Ye.TRACKED}}(e,t)}));return{getId:r.getId,isTracked:function(){return r.getTrackingType()===Ye.TRACKED}}}function et(e){return 0!==(t=e.sampleRate)&&100*Math.random()<=t?Ye.TRACKED:Ye.NOT_TRACKED;var t}!function(e){e.NOT_TRACKED="0",e.TRACKED="1"}(Ye||(Ye={}));var tt={debug:function(e,t){we("logs.logger.debug")},error:function(e,t){we("logs.logger.error")},info:function(e,t){we("logs.logger.info")},log:function(e,t,n){we("logs.logger.log")},warn:function(e,t){we("logs.logger.warn")},setContext:function(e){we("logs.logger.setContext")},addContext:function(e,t){we("logs.logger.addContext")},removeContext:function(e){we("logs.logger.removeContext")},setHandler:function(e){we("logs.logger.setHandler")},setLevel:function(e){we("logs.logger.setLevel")}},nt=rt({logger:tt,init:function(e){we("core.init")},addLoggerGlobalContext:function(e,t){we("addLoggerGlobalContext")},setLoggerGlobalContext:function(e){we("setLoggerGlobalContext")},createLogger:function(e,t){return we("createLogger"),tt},getLogger:function(e){we("getLogger")}});function rt(e){var t=function(e){var t=r({},e);return Object.defineProperty(t,"_setDebug",{get:function(){return Y},enumerable:!1}),t}(e),n=!1;return t.init=X((function(e){if(Oe()&&function(e){if(n)return e.silentMultipleInit||console.error("DD_LOGS is already initialized."),!1;if(!e||!e.publicApiKey&&!e.clientToken)return console.error("Client Token is not configured, we will not send any data."),!1;if(void 0!==e.sampleRate&&(t=e.sampleRate,!(function(e){return"number"==typeof e}(t)&&t>=0&&t<=100)))return console.error("Sample Rate should be a number between 0 and 100"),!1;var t;return!0}(e)){e.publicApiKey&&(e.clientToken=e.publicApiKey,console.warn("Public API Key is deprecated. Please use Client Token instead."));var o=!1!==e.forwardErrorsToLogs,i=Te(r(r({},e),{isCollectingError:o}),Le),a=i.errorObservable,s=i.configuration,u=i.internalMonitoring,c=ke(a,s,Qe(s,I()),u);v(t,c),n=!0}})),t}(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_LOGS=nt}]);
!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.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 o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));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,"datadogLogs",(function(){return nt})),n.d(t,"makeLogsGlobal",(function(){return rt}));var r=function(){return(r=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function o(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function i(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var r=Array(e),o=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,o++)r[o]=i[a];return r}var a,s,u,c=6e4,l=60*c;!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"}(a||(a={})),function(e){e.DOCUMENT="document",e.XHR="xhr",e.BEACON="beacon",e.FETCH="fetch",e.CSS="css",e.JS="js",e.IMAGE="image",e.FONT="font",e.MEDIA="media",e.OTHER="other"}(s||(s={})),function(e){e.FETCH="fetch",e.XHR="xhr"}(u||(u={}));var f,d,p=function(e){return Array.isArray(e)},g=function(e){return!Array.isArray(e)&&"object"==typeof e};function h(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce((function(e,t){return p(e)&&p(t)?i(Array(Math.max(e.length,t.length))).map((function(n,r){return h(e[r],t[r])})):g(e)&&g(t)?Object.keys(t).reduce((function(n,o){var i;return r(r({},n),((i={})[o]=h(e[o],t[o]),i))}),e):void 0===t?e:t}),e)}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 m(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):(1e7+"-1000-4000-8000-100000000000").replace(/[018]/g,m)}function y(){}function b(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];w(e)&&(r=[!0,e.toJSON],delete e.toJSON);var o,i,a=[!1,void 0];"object"==typeof e&&w(o=Object.getPrototypeOf(e))&&(a=[!0,o.toJSON],delete o.toJSON);try{i=JSON.stringify(e,void 0,n)}catch(e){i="<error: unable to serialize object>"}finally{r[0]&&(e.toJSON=r[1]),a[0]&&(o.toJSON=a[1])}return i}function w(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function E(){return void 0===f&&(f=performance.timing.navigationStart),f}function x(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}function T(e){return C(e,x(window.location)).href}function O(e,t){return S(e)===S(t)}function S(e){return x(C(e))}function C(e,t){if(function(){if(void 0!==d)return d;try{var e=new URL("http://test/path");return d="http://test/path"===e.href}catch(e){d=!1}return d}())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 o=(n=document.implementation.createHTMLDocument("")).createElement("base");o.href=t,n.head.appendChild(o),n.body.appendChild(r)}return r.href=e,r}var L={allowedTracingOrigins:[],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 _(e,t,n){var r="sdk_version:"+t.sdkVersion+(t.env?",env:"+t.env:"")+(t.service?",service:"+t.service:"")+(t.version?",version:"+t.version:""),o=e+"-http-intake.logs."+t.site,i=t.proxyHost?t.proxyHost:o,a=t.proxyHost?"ddhost="+o+"&":"",s=""+(t.applicationId?"_dd.application_id="+t.applicationId+"&":"")+a+"ddsource="+(n||"browser")+"&ddtags="+r;return"https://"+i+"/v1/input/"+t.clientToken+"?"+s}var M=1e3;function R(e,t,n){var r=new Date;r.setTime(r.getTime()+n);var o="expires="+r.toUTCString();document.cookie=e+"="+t+";"+o+";path=/;samesite=strict"}function k(e){return function(e,t){var n=e.match("(?:^|;)\\s*"+t+"\\s*=\\s*([^;]+)");return n?n[1]:void 0}(document.cookie,e)}function I(){if(void 0===document.cookie||null===document.cookie)return!1;try{return R("dd_rum_test","test",1e3),"test"===k("dd_rum_test")}catch(e){return console.error(e),!1}}var B="?",A=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function j(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var N=function(){var e,t,n,r,o,i,a=[];function s(e,t,n){var r;for(var o in a)if(j(a,o))try{a[o](e,t,n)}catch(e){r=e}if(r)throw r}function u(e,r,o,i,a){if(t)D.augmentStackTraceWithInitialElement(t,r,o,""+e),l();else if(a)s(D(a),!0,a);else{var u,c={url:r,column:i,line:o},f=e;if("[object String]"==={}.toString.call(e)){var d=f.match(A);d&&(u=d[1],f=d[2])}s({name:u,message:f,stack:[c]},!0)}return!!n&&n.apply(this,arguments)}function c(e){var t=e.reason||"Empty reason";s(D(t),!0,t)}function l(){var n=t,r=e;t=void 0,e=void 0,s(n,!1,r)}function f(n){if(t){if(e===n)return;l()}var r=D(n);throw t=r,e=n,setTimeout((function(){e===n&&l()}),r.incomplete?2e3:0),n}return f.subscribe=function(e){!function(){if(r)return;n=window.onerror,window.onerror=X(u),r=!0}(),function(){if(i)return;o=null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=X(c),i=!0}(),a.push(e)},f.unsubscribe=function(e){for(var t=a.length-1;t>=0;t-=1)a[t]===e&&a.splice(t,1);0===a.length&&(r&&(window.onerror=n,r=!1),i&&(window.onunhandledrejection=o,i=!1))},f.traceKitWindowOnError=u,f}(),D=function(){var e=!1;function t(e){if(e.stack){for(var t,n,r,o,i=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,a=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,s=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,u=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=e.stack.split("\n"),f=[],d=0,p=l.length;d<p;d+=1){if(i.exec(l[d])){var g=(r=i.exec(l[d]))[2]&&0===r[2].indexOf("native");t=r[2]&&0===r[2].indexOf("eval"),n=c.exec(r[2]),t&&n&&(r[2]=n[1],r[3]=n[2],r[4]=n[3]),o={args:g?[r[2]]:[],column:r[4]?+r[4]:void 0,func:r[1]||B,line:r[3]?+r[3]:void 0,url:g?void 0:r[2]}}else if(s.exec(l[d]))o={args:[],column:(r=s.exec(l[d]))[4]?+r[4]:void 0,func:r[1]||B,line:+r[3],url:r[2]};else{if(!a.exec(l[d]))continue;t=(r=a.exec(l[d]))[3]&&r[3].indexOf(" > eval")>-1,n=u.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||(f[0].column=e.columnNumber+1),o={args:r[2]?r[2].split(","):[],column:r[5]?+r[5]:void 0,func:r[1]||B,line:r[4]?+r[4]:void 0,url:r[3]}}!o.func&&o.line&&(o.func=B),f.push(o)}if(f.length)return{stack:f,message:e.message,name:e.name}}}function n(e,t,n,r){var o={url:t,line:n?+n:void 0};if(o.url&&o.line){e.incomplete=!1;var i=e.stack;if(i.length>0&&i[0].url===o.url){if(i[0].line===o.line)return!1;if(!i[0].line&&i[0].func===o.func)return i[0].line=o.line,i[0].context=o.context,!1}return i.unshift(o),e.partial=!0,!0}return e.incomplete=!0,!1}function r(e,t){for(var o,i,a=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,s=[],u={},c=!1,l=r.caller;l&&!c;l=l.caller)l!==D&&l!==N&&(i={args:[],column:void 0,func:B,line:void 0,url:void 0},o=a.exec(l.toString()),l.name?i.func=l.name:o&&(i.func=o[1]),void 0===i.func&&(i.func=o?o.input.substring(0,o.input.indexOf("{")):void 0),u[""+l]?c=!0:u[""+l]=!0,s.push(i));t&&s.splice(0,t);var f={stack:s,message:e.message,name:e.name};return n(f,e.sourceURL||e.fileName,e.line||e.lineNumber,e.message||e.description),f}function o(n,o){var i,a=void 0===o?0:+o;try{if(i=function(e){var t=e.stacktrace;if(t){for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,i=t.split("\n"),a=[],s=0;s<i.length;s+=2){var u=void 0;r.exec(i[s])?u={args:[],column:void 0,func:(n=r.exec(i[s]))[3],line:+n[1],url:n[2]}:o.exec(i[s])&&(u={args:(n=o.exec(i[s]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),u&&(!u.func&&u.line&&(u.func=B),u.context=[i[s+1]],a.push(u))}if(a.length)return{stack:a,message:e.message,name:e.name}}}(n))return i}catch(t){if(e)throw t}try{if(i=t(n))return i}catch(t){if(e)throw t}try{if(i=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,o=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,i=/^\s*Line (\d+) of function script\s*$/i,a=[],s=window&&window.document&&window.document.getElementsByTagName("script"),u=[];for(var c in s)j(s,c)&&!s[c].src&&u.push(s[c]);for(var l=2;l<t.length;l+=2){var f=void 0;if(r.exec(t[l]))f={args:[],column:void 0,func:(n=r.exec(t[l]))[3],line:+n[1],url:n[2]};else if(o.exec(t[l]))f={args:[],column:void 0,func:(n=o.exec(t[l]))[4],line:+n[1],url:n[3]};else if(i.exec(t[l])){n=i.exec(t[l]),f={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+n[1]}}f&&(f.func||(f.func=B),f.context=[t[l+1]],a.push(f))}if(a.length)return{stack:a,message:t[0],name:e.name}}}(n))return i}catch(t){if(e)throw t}try{if(i=r(n,a+1))return i}catch(t){if(e)throw t}return{message:n.message,name:n.name,stack:[]}}return o.augmentStackTraceWithInitialElement=n,o.computeStackTraceFromStackProp=t,o.ofCaller=function(e){var t=1+(void 0===e?0:+e);try{throw new Error}catch(e){return D(e,t+1)}},o}();var P=/[^\u0000-\u007F]/,H=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 z,U=function(){function e(e,t,n,r,o,i){void 0===i&&(i=y),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=o,this.beforeUnloadCallback=i,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=i(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 P.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,o=n.messageBytesSize;o>=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(o)&&this.flush(),this.push(r,o,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=b(e);return{processedMessage:t,messageBytesSize:this.sizeInBytes(t)}},e.prototype.push=function(e,t,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesSize+=t,this.bufferMessageCount+=1},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.sizeInBytes(t);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e.prototype.willReachedBytesLimitWith=function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},e.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},e.prototype.flushPeriodically=function(){var e=this;setTimeout((function(){e.flush(),e.flushPeriodically()}),this.flushTimeout)},e.prototype.flushOnVisibilityHidden=function(){var e=this;navigator.sendBeacon&&(window.addEventListener(a.BEFORE_UNLOAD,X(this.beforeUnloadCallback)),document.addEventListener(a.VISIBILITY_CHANGE,X((function(){"hidden"===document.visibilityState&&e.flush()}))),window.addEventListener(a.BEFORE_UNLOAD,X((function(){return e.flush()}))))},e}();!function(e){e.info="info",e.error="error"}(z||(z={}));var G,F,K,q={maxMessagesPerPage:0,sentMessageCount:0};function $(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 U(new H(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var r=function(e){return h({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==G?G():{},e)}(e);n.add(r),t&&t.add(r)}}}(e);v(q,{batch:t,maxMessagesPerPage:e.maxInternalMonitoringMessagesPerPage,sentMessageCount:0})}return{setExternalContextProvider:function(e){G=e}}}function V(e,t,n){var r=n.value;n.value=function(){var e=q.batch?X(r):r;return e.apply(this,arguments)}}function X(e){return function(){try{return e.apply(this,arguments)}catch(e){Z(e);try{J(e)}catch(e){Z(e)}}}}function J(e){W(r(r({},function(e){if(e instanceof Error){var t=D(e);return{error:{kind:t.name,stack:me(t)},message:t.message}}return{error:{stack:"Not an instance of error"},message:"Uncaught "+b(e)}}(e)),{status:z.error}))}function W(e){q.batch&&q.sentMessageCount<q.maxMessagesPerPage&&(q.sentMessageCount+=1,q.batch.add(e))}function Y(e){q.debugMode=e}function Z(e){q.debugMode&&console.warn("[INTERNAL ERROR]",e)}var Q=[],ee=[];function te(){return F||(!function(){if(!window.fetch)return;K=window.fetch,window.fetch=X((function(e,t){var n=this,r=t&&t.method||"object"==typeof e&&e.method||"GET",i=T("object"==typeof e&&e.url||e),a={init:t,method:r,startTime:performance.now(),url:i},s=function(e){return t=n,r=void 0,s=function(){var t,n;return o(this,(function(r){switch(r.label){case 0:return a.duration=performance.now()-a.startTime,"stack"in e||e instanceof Error?(a.status=0,a.response=me(D(e)),ee.forEach((function(e){return e(a)})),[3,6]):[3,1];case 1:if(!("status"in e))return[3,6];t=void 0,r.label=2;case 2:return r.trys.push([2,4,,5]),[4,e.clone().text()];case 3:return t=r.sent(),[3,5];case 4:return n=r.sent(),t="Unable to retrieve response: "+n,[3,5];case 5:a.response=t,a.responseType=e.type,a.status=e.status,ee.forEach((function(e){return e(a)})),r.label=6;case 6:return[2]}}))},new((i=void 0)||(i=Promise))((function(e,n){function o(e){try{u(s.next(e))}catch(e){n(e)}}function a(e){try{u(s.throw(e))}catch(e){n(e)}}function u(t){t.done?e(t.value):new i((function(e){e(t.value)})).then(o,a)}u((s=s.apply(t,r||[])).next())}));var t,r,i,s};Q.forEach((function(e){return e(a)}));var u=K.call(this,e,a.init);return u.then(X(s),X(s)),u}))}(),F={beforeSend:function(e){Q.push(e)},onRequestComplete:function(e){ee.push(e)}}),F}var ne,re,oe,ie,ae,se,ue,ce,le,fe=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}(),de=[],pe=[];function ge(){return ne||(re=XMLHttpRequest.prototype.open,oe=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.open=X((function(e,t){return this._datadog_xhr={method:e,url:T(t)},re.apply(this,arguments)})),XMLHttpRequest.prototype.send=X((function(e){var t=this;if(this._datadog_xhr){this._datadog_xhr.startTime=performance.now();var n=this.onreadystatechange;this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&X(o)(),n&&n.apply(this,arguments)};var r=!1,o=function(){r||(r=!0,t._datadog_xhr.duration=performance.now()-t._datadog_xhr.startTime,t._datadog_xhr.response=t.response,t._datadog_xhr.status=t.status,pe.forEach((function(e){return e(t._datadog_xhr)})))};this.addEventListener("loadend",X(o)),de.forEach((function(e){return e(t._datadog_xhr,t)}))}return oe.apply(this,arguments)})),ne={beforeSend:function(e){de.push(e)},onRequestComplete:function(e){pe.push(e)}}),ne}function he(e){if(!ae){var t=new fe;e.isCollectingError&&(function(e,t){function n(n,r){(function(e,t){return O(e,t.logsEndpoint)||O(e,t.rumEndpoint)||O(e,t.traceEndpoint)||t.internalMonitoringEndpoint&&O(e,t.internalMonitoringEndpoint)||t.proxyHost&&O(e,t.proxyHost)||t.replica&&(O(e,t.replica.logsEndpoint)||O(e,t.replica.rumEndpoint)||O(e,t.replica.internalMonitoringEndpoint))})(r.url,e)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!function(e){return e.status>=500}(r)||t.notify({context:{error:{origin:ie.NETWORK,stack:ye(r.response,e)||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url}},message:be(n)+" error "+r.method+" "+r.url,startTime:r.startTime})}ge().onRequestComplete((function(e){return n(u.XHR,e)})),te().onRequestComplete((function(e){return n(u.FETCH,e)}))}(e,t),function(e){se=console.error,console.error=X((function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];se.apply(console,i([t],n)),e.notify({context:{error:{origin:ie.CONSOLE}},message:i(["console error:",t],n).map(ve).join(" "),startTime:performance.now()})}))}(t),function(e){ue=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=me(e)):(n="Uncaught "+b(t),r="No stack, consider using an instance of Error");return{message:n,context:{error:{stack:r,kind:e.name,origin:ie.SOURCE}},startTime:performance.now()}}(t,r))},N.subscribe(ue)}(t)),ae=function(e,t){var n=0,r=new fe;return t.subscribe((function(t){n<e.maxErrorsByMinute?(n+=1,r.notify(t)):n===e.maxErrorsByMinute&&(n+=1,r.notify({context:{error:{origin:ie.AGENT}},message:"Reached max number of errors by minute: "+e.maxErrorsByMinute,startTime:performance.now()}))})),setInterval((function(){return n=0}),c),r}(e,t)}return ae}function ve(e){return"string"==typeof e?e:e instanceof Error?me(D(e)):b(e,0,2)}function me(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(", ")+")":"",o=e.line?":"+e.line:"",i=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+o+i})),t}function ye(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function be(e){return u.XHR===e?"XHR":"Fetch"}function we(e){console.warn("'"+e+"' not yet available, please call '.init()' first.")}!function(e){e.AGENT="agent",e.CONSOLE="console",e.NETWORK="network",e.SOURCE="source",e.LOGGER="logger"}(ie||(ie={})),function(e){e.US="us",e.EU="eu"}(le||(le={}));var Ee,xe=((ce={})[le.EU]="datadoghq.eu",ce[le.US]="datadoghq.com",ce);function Te(e,t){var n=function(e,t){var n={applicationId:e.applicationId,buildMode:t.buildMode,clientToken:e.clientToken,env:e.env,proxyHost:e.proxyHost,sdkVersion:t.sdkVersion,service:e.service,site:e.site||xe[e.datacenter||t.datacenter],version:e.version},o=Array.isArray(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],i=r({isEnabled:function(e){return t=e,-1!==o.indexOf(t);var t},logsEndpoint:_("browser",n),proxyHost:e.proxyHost,rumEndpoint:_("rum",n),traceEndpoint:_("public-trace",n)},L);if(e.internalMonitoringApiKey&&(i.internalMonitoringEndpoint=_("browser",n,"browser-agent-internal-monitoring")),"allowedTracingOrigins"in e&&(i.allowedTracingOrigins=e.allowedTracingOrigins),"isCollectingError"in e&&(i.isCollectingError=!!e.isCollectingError),"sampleRate"in e&&(i.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(i.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(i.trackInteractions=!!e.trackInteractions),n.buildMode===Ee.E2E_TEST&&(void 0!==e.internalMonitoringEndpoint&&(i.internalMonitoringEndpoint=e.internalMonitoringEndpoint),void 0!==e.logsEndpoint&&(i.logsEndpoint=e.logsEndpoint),void 0!==e.rumEndpoint&&(i.rumEndpoint=e.rumEndpoint)),n.buildMode===Ee.STAGING&&void 0!==e.replica){var a=r(r({},n),{applicationId:e.replica.applicationId,clientToken:e.replica.clientToken,site:xe[le.US]});i.replica={applicationId:e.replica.applicationId,internalMonitoringEndpoint:_("browser",a,"browser-agent-internal-monitoring"),logsEndpoint:_("browser",a),rumEndpoint:_("rum",a)}}return i}(e,t),o=$(n);return{configuration:n,errorObservable:he(n),internalMonitoring:o}}function Oe(){return"file:"!==window.location.protocol||(console.error("Execution is not allowed in the current context."),!1)}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(Ee||(Ee={}));var Se,Ce,Le={buildMode:"release",datacenter:"us",sdkVersion:"1.18.1"};!function(e){e.debug="debug",e.info="info",e.warn="warn",e.error="error"}(Ce||(Ce={}));var _e,Me,Re=((Se={})[Ce.debug]=0,Se[Ce.info]=1,Se[Ce.warn]=2,Se[Ce.error]=3,Se);Object.keys(Ce);function ke(e,t,n,o){var i,a={};o.setExternalContextProvider((function(){return h({session_id:n.getId()},a,Ae())}));var s=function(e,t,n){var r,o=i(e.logsEndpoint);void 0!==e.replica&&(r=i(e.replica.logsEndpoint));function i(t){return new U(new H(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}return{add:function(e){var i=function(e){return h({date:(new Date).getTime(),session_id:t.getId(),view:{referrer:document.referrer,url:window.location.href}},n(),Ae(),e)}(e);o.add(i),r&&r.add(i)}}}(t,n,(function(){return a})),u=((i={})[_e.console]=function(e){return console.log(e.status+": "+e.message)},i[_e.http]=function(e){return s.add(e)},i[_e.silent]=y,i),c=new Be(n,u);Me={},e.subscribe((function(e){return c.error(e.message,h(r({date:(t=e.startTime,Math.floor(E()+t))},e.context),Ae(e.startTime)));var t}));var l={setLoggerGlobalContext:function(e){a=e},addLoggerGlobalContext:function(e,t){a[e]=t}};return l.createLogger=function(e,t){return function(n,o){return void 0===o&&(o={}),Me[n]=new Be(e,t,o.handler,o.level,r(r({},o.context),{logger:{name:n}})),Me[n]}}(n,u),l.getLogger=Ie,l.logger=c,l}function Ie(e){return Me[e]}!function(e){e.http="http",e.console="console",e.silent="silent"}(_e||(_e={}));var Be=function(){function e(e,t,n,r,o){void 0===n&&(n=_e.http),void 0===r&&(r=Ce.debug),void 0===o&&(o={}),this.session=e,this.handlers=t,this.level=r,this.loggerContext=o,this.handler=this.handlers[n]}return e.prototype.log=function(e,t,n){void 0===t&&(t={}),void 0===n&&(n=Ce.info),this.session.isTracked()&&Re[n]>=Re[this.level]&&this.handler(r({message:e,status:n},h({},this.loggerContext,t)))},e.prototype.debug=function(e,t){void 0===t&&(t={}),this.log(e,t,Ce.debug)},e.prototype.info=function(e,t){void 0===t&&(t={}),this.log(e,t,Ce.info)},e.prototype.warn=function(e,t){void 0===t&&(t={}),this.log(e,t,Ce.warn)},e.prototype.error=function(e,t){void 0===t&&(t={});var n={error:{origin:ie.LOGGER}};this.log(e,h({},n,t),Ce.error)},e.prototype.setContext=function(e){this.loggerContext=e},e.prototype.addContext=function(e,t){this.loggerContext[e]=t},e.prototype.removeContext=function(e){delete this.loggerContext[e]},e.prototype.setHandler=function(e){this.handler=this.handlers[e]},e.prototype.setLevel=function(e){this.level=e},function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);i>3&&a&&Object.defineProperty(t,n,a)}([V],e.prototype,"log",null),e}();function Ae(e){var t=window.DD_RUM;return t&&t.getInternalContext?t.getInternalContext(e):void 0}var je="_dd",Ne="_dd_r",De="_dd_l",Pe="rum",He="logs";var ze="_dd_s",Ue=15*c,Ge=4*l,Fe=c;function Ke(e,t){var n,r,o,i,s,u=(n=ze,i=!1,s=function(){i=!0,window.clearTimeout(r),r=window.setTimeout((function(){i=!1}),M)},{get:function(){return i?o:(o=k(n),s(),o)},set:function(e,t){R(n,e,t),o=e,s()}});!function(e){var t=e.get(),n=k(je),r=k(Ne),o=k(De);if(!t){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i[He]=o),r&&/^[012]$/.test(r)&&(i[Pe]=r),Xe(i,e)}}(u);var c,l,f,d,p,g,h,v,y=new fe,b=Ve(u).id,w=(c=function(){var n=Ve(u),r=t(n[e]),o=r.trackingType,i=r.isTracked;n[e]=o,i&&!n.id&&(n.id=m(),n.created=String(Date.now())),Xe(n,u),i&&b!==n.id&&(b=n.id,y.notify())},l=M,p=!f||void 0===f.leading||f.leading,g=!f||void 0===f.trailing||f.trailing,h=!1,v=!1,{throttled:function(){var e=this;h?v=!0:(p?c.apply(this):v=!0,h=!0,d=window.setTimeout((function(){g&&v&&c.apply(e),h=!1,v=!1}),l))},cancel:function(){window.clearTimeout(d),h=!1,v=!1}}).throttled;return w(),function(e){var t=X(e),n={capture:!0,passive:!0};[a.CLICK,a.TOUCH_START,a.KEY_DOWN,a.SCROLL].forEach((function(e){document.addEventListener(e,t,n),We.push((function(){return document.removeEventListener(e,t,n)}))}))}(w),function(e){var t=X((function(){"visible"===document.visibilityState&&e()})),n=window.setInterval(t,Fe);document.addEventListener(a.VISIBILITY_CHANGE,t),We.push((function(){clearInterval(n),document.removeEventListener(a.VISIBILITY_CHANGE,t)}))}((function(){Xe(Ve(u),u)})),{getId:function(){return Ve(u).id},getTrackingType:function(){return Ve(u)[e]},renewObservable:y}}var qe=/^([a-z]+)=([a-z0-9-]+)$/,$e="&";function Ve(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf($e)||qe.test(e))})(t)&&t.split($e).forEach((function(e){var t=qe.exec(e);if(null!==t){var r=t[1],o=t[2];n[r]=o}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<Ge)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(Je(e),{})}function Xe(e,t){if(n=e,0!==Object.keys(n).length){var n;e.expire=String(Date.now()+Ue);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($e);t.set(r,Ue)}else Je(t)}function Je(e){e.set("",0)}var We=[];var Ye,Ze="logs";function Qe(e,t){if(!t){var n=et(e)===Ye.TRACKED;return{getId:function(){},isTracked:function(){return n}}}var r=Ke(Ze,(function(t){return function(e,t){var n=function(e){return e===Ye.NOT_TRACKED||e===Ye.TRACKED}(t)?t:et(e);return{trackingType:n,isTracked:n===Ye.TRACKED}}(e,t)}));return{getId:r.getId,isTracked:function(){return r.getTrackingType()===Ye.TRACKED}}}function et(e){return 0!==(t=e.sampleRate)&&100*Math.random()<=t?Ye.TRACKED:Ye.NOT_TRACKED;var t}!function(e){e.NOT_TRACKED="0",e.TRACKED="1"}(Ye||(Ye={}));var tt={debug:function(e,t){we("logs.logger.debug")},error:function(e,t){we("logs.logger.error")},info:function(e,t){we("logs.logger.info")},log:function(e,t,n){we("logs.logger.log")},warn:function(e,t){we("logs.logger.warn")},setContext:function(e){we("logs.logger.setContext")},addContext:function(e,t){we("logs.logger.addContext")},removeContext:function(e){we("logs.logger.removeContext")},setHandler:function(e){we("logs.logger.setHandler")},setLevel:function(e){we("logs.logger.setLevel")}},nt=rt({logger:tt,init:function(e){we("core.init")},addLoggerGlobalContext:function(e,t){we("addLoggerGlobalContext")},setLoggerGlobalContext:function(e){we("setLoggerGlobalContext")},createLogger:function(e,t){return we("createLogger"),tt},getLogger:function(e){we("getLogger")}});function rt(e){var t=function(e){var t=r({},e);return Object.defineProperty(t,"_setDebug",{get:function(){return Y},enumerable:!1}),t}(e),n=!1;return t.init=X((function(e){if(Oe()&&function(e){if(n)return e.silentMultipleInit||console.error("DD_LOGS is already initialized."),!1;if(!e||!e.publicApiKey&&!e.clientToken)return console.error("Client Token is not configured, we will not send any data."),!1;if(void 0!==e.sampleRate&&(t=e.sampleRate,!(function(e){return"number"==typeof e}(t)&&t>=0&&t<=100)))return console.error("Sample Rate should be a number between 0 and 100"),!1;var t;return!0}(e)){e.publicApiKey&&(e.clientToken=e.publicApiKey,console.warn("Public API Key is deprecated. Please use Client Token instead."));var o=!1!==e.forwardErrorsToLogs,i=Te(r(r({},e),{isCollectingError:o}),Le),a=i.errorObservable,s=i.configuration,u=i.internalMonitoring,c=ke(a,s,Qe(s,I()),u);v(t,c),n=!0}})),t}(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_LOGS=nt}]);

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

datacenter: 'us',
sdkVersion: '1.18.0',
sdkVersion: '1.18.1',
};
//# sourceMappingURL=buildEnv.js.map
export var buildEnv = {
buildMode: 'release',
datacenter: 'us',
sdkVersion: '1.18.0',
sdkVersion: '1.18.1',
};
//# sourceMappingURL=buildEnv.js.map
{
"name": "@datadog/browser-logs",
"version": "1.18.0",
"version": "1.18.1",
"license": "Apache-2.0",

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

"dependencies": {
"@datadog/browser-core": "1.18.0",
"@datadog/browser-core": "1.18.1",
"tslib": "^1.10.0"

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

},
"gitHead": "3102b6bce54e93f7ef5a581414fc2aee8ba41074"
"gitHead": "bfb9ba782580bd09434d645f651f4fcce9978f72"
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc