Socket
Socket
Sign inDemoInstall

@datadog/browser-logs

Package Overview
Dependencies
Maintainers
1
Versions
252
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 5.9.0 to 5.10.0

2

bundle/datadog-logs.js

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

!function(){"use strict";var e={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},t=console,n={};Object.keys(e).forEach((function(e){n[e]=t[e]}));var r="Datadog Browser SDK:",o={debug:n.debug.bind(t,r),log:n.log.bind(t,r),info:n.info.bind(t,r),warn:n.warn.bind(t,r),error:n.error.bind(t,r)};function i(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return e.apply(void 0,n)}catch(e){o.error(t,e)}}}var a,s=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},u=!1;function c(e){u=e}function f(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(a?l(r):r).apply(this,e)}}function l(e){return function(){return d(e,this,arguments)}}function d(e,t,n){try{return e.apply(t,n)}catch(e){if(p(e),a)try{a(e)}catch(e){p(e)}}}function p(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];u&&o.error.apply(o,s(["[MONITOR]"],e,!1))}function v(e,t){return-1!==e.indexOf(t)}function g(e){if(Array.from)return Array.from(e);var t=[];if(e instanceof Set)e.forEach((function(e){return t.push(e)}));else for(var n=0;n<e.length;n++)t.push(e[n]);return t}function h(e){return Object.keys(e).map((function(t){return e[t]}))}function y(e,t){return e.slice(0,t.length)===t}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})),e}function b(){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}var E=1024,S=1024*E,w=/[^\u0000-\u007F]/;function C(e){return w.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length}function _(e,t){var n,r=b();return r.Zone&&"function"==typeof r.Zone.__symbol__&&(n=e[r.Zone.__symbol__(t)]),n||(n=e[t]),n}function x(e,t){return _(b(),"setTimeout")(l(e),t)}function k(e){_(b(),"clearTimeout")(e)}function O(e,t){return _(b(),"setInterval")(l(e),t)}function T(e){_(b(),"clearInterval")(e)}function R(e,t,n){var r,o,i=!n||void 0===n.leading||n.leading,a=!n||void 0===n.trailing||n.trailing,s=!1;return{throttled:function(){for(var n=[],u=0;u<arguments.length;u++)n[u]=arguments[u];s?r=n:(i?e.apply(void 0,n):r=n,s=!0,o=x((function(){a&&r&&e.apply(void 0,r),s=!1,r=void 0}),t))},cancel:function(){k(o),s=!1,r=void 0}}}function L(){}function A(e,t,n){if("object"!=typeof e||null===e)return JSON.stringify(e);var r=I(Object.prototype),o=I(Array.prototype),i=I(Object.getPrototypeOf(e)),a=I(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{r(),o(),i(),a()}}function I(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):L}function P(e){return 0===Object.keys(e).length}var B=3*E,D=16*E,N=200;function U(e){void 0===e&&(e=2);var t=new Map,n=!1;function r(r){if(void 0===r&&(r=0),!n&&0!==e){var i=2===e?B:D,a=r;t.forEach((function(e){a+=e.getBytesCount()})),a>i&&(!function(e){o.warn("Customer data exceeds the recommended ".concat(e/E,"KiB threshold. More details: https://docs.datadoghq.com/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-threshold-warning"))}(i),n=!0)}}return{createDetachedTracker:function(){var e=M((function(){return r(e.getBytesCount())}));return e},getOrCreateTracker:function(e){return t.has(e)||t.set(e,M(r)),t.get(e)},setCompressionStatus:function(t){0===e&&(e=t,r())},getCompressionStatus:function(){return e},stop:function(){t.forEach((function(e){return e.stop()})),t.clear()}}}function M(e){var t=0,n=R((function(n){t=C(A(n)),e()}),N),r=n.throttled,o=n.cancel,i=function(){o(),t=0};return{updateCustomerData:function(e){P(e)?i():r(e)},resetCustomerData:i,getBytesCount:function(){return t},stop:function(){o()}}}function q(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function j(e,t,n){if(void 0===n&&(n=function(){if("undefined"!=typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}()),void 0===t)return e;if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],i=0;i<t.length;++i)o[i]=j(o[i],t[i],n);return o}var a="object"===q(e)?e:{};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(a[s]=j(a[s],t[s],n));return a}}function H(e){return j(void 0,e)}function G(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=0,o=t;r<o.length;r++){var i=o[r];null!=i&&(e=j(e,i))}return e}var F=220*E,V="$",z=3;function Y(e,t){var n;void 0===t&&(t=F);var r=I(Object.prototype),o=I(Array.prototype),i=[],a=new WeakMap,s=W(e,V,void 0,i,a),u=(null===(n=JSON.stringify(s))||void 0===n?void 0:n.length)||0;if(!(u>t)){for(;i.length>0&&u<t;){var c=i.shift(),f=0;if(Array.isArray(c.source))for(var l=0;l<c.source.length;l++){if(u+=void 0!==(d=W(c.source[l],c.path,l,i,a))?JSON.stringify(d).length:4,u+=f,f=1,u>t){J(t,"truncated",e);break}c.target[l]=d}else for(var l in c.source)if(Object.prototype.hasOwnProperty.call(c.source,l)){var d;if(void 0!==(d=W(c.source[l],c.path,l,i,a))&&(u+=JSON.stringify(d).length+f+l.length+z,f=1),u>t){J(t,"truncated",e);break}c.target[l]=d}}return r(),o(),s}J(t,"discarded",e)}function W(e,t,n,r,o){var i=function(e){var t=e;if(t&&"function"==typeof t.toJSON)try{return t.toJSON()}catch(e){}return e}(e);if(!i||"object"!=typeof i)return function(e){if("bigint"==typeof e)return"[BigInt] ".concat(e.toString());if("function"==typeof e)return"[Function] ".concat(e.name||"unknown");if("symbol"==typeof e)return"[Symbol] ".concat(e.description||e.toString());return e}(i);var a=function(e){try{if(e instanceof Event)return{isTrusted:e.isTrusted};var t=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(t&&t[1])return"[".concat(t[1],"]")}catch(e){}return"[Unserializable]"}(i);if("[Object]"!==a&&"[Array]"!==a&&"[Error]"!==a)return a;var s=e;if(o.has(s))return"[Reference seen at ".concat(o.get(s),"]");var u=void 0!==n?"".concat(t,".").concat(n):t,c=Array.isArray(i)?[]:{};return o.set(s,u),r.push({source:i,target:c,path:u}),c}function J(e,t,n){o.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),n)}var K,Z=function(){function e(e){this.onFirstSubscribe=e,this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t})),!t.observers.length&&t.onLastUnsubscribe&&t.onLastUnsubscribe()}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function $(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new Z((function(t){var n=e.map((function(e){return e.subscribe((function(e){return t.notify(e)}))}));return function(){return n.forEach((function(e){return e.unsubscribe()}))}}))}function X(e){var t={},n=new Z,r={getContext:function(){return H(t)},setContext:function(o){"object"===q(o)?(t=Y(o),e.updateCustomerData(t)):r.clearContext(),n.notify()},setContextProperty:function(r,o){t[r]=Y(o),e.updateCustomerData(t),n.notify()},removeContextProperty:function(r){delete t[r],e.updateCustomerData(t),n.notify()},clearContext:function(){t={},e.resetCustomerData(),n.notify()},changeObservable:n};return r}function Q(e,t,n,r,o){return ee(e,t,[n],r,o)}function ee(e,t,n,r,o){var i=void 0===o?{}:o,a=i.once,s=i.capture,u=i.passive,c=l((function(t){(t.isTrusted||t.__ddIsTrusted||e.allowUntrustedEvents)&&(a&&p(),r(t))})),f=u?{capture:s,passive:u}:s,d=_(t,"addEventListener");function p(){var e=_(t,"removeEventListener");n.forEach((function(n){return e.call(t,n,c,f)}))}return n.forEach((function(e){return d.call(t,e,c,f)})),{stop:p}}!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.DBL_CLICK="dblclick",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.TOUCH_MOVE="touchmove",e.VISIBILITY_CHANGE="visibilitychange",e.PAGE_SHOW="pageshow",e.FREEZE="freeze",e.RESUME="resume",e.DOM_CONTENT_LOADED="DOMContentLoaded",e.POINTER_DOWN="pointerdown",e.POINTER_UP="pointerup",e.POINTER_CANCEL="pointercancel",e.HASH_CHANGE="hashchange",e.PAGE_HIDE="pagehide",e.MOUSE_DOWN="mousedown",e.MOUSE_UP="mouseup",e.MOUSE_MOVE="mousemove",e.FOCUS="focus",e.BLUR="blur",e.CONTEXT_MENU="contextmenu",e.RESIZE="resize",e.CHANGE="change",e.INPUT="input",e.PLAY="play",e.PAUSE="pause",e.SECURITY_POLICY_VIOLATION="securitypolicyviolation",e.SELECTION_CHANGE="selectionchange",e.STORAGE="storage"}(K||(K={}));var te="_dd_c",ne=[];function re(e,t,n,r){var o=function(e,t){return"".concat(te,"_").concat(e,"_").concat(t)}(n,r);function i(){var e=localStorage.getItem(o);return null!==e?JSON.parse(e):{}}ne.push(Q(e,window,K.STORAGE,(function(e){var n=e.key;o===n&&t.setContext(i())}))),t.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(t.getContext()))})),t.setContext(G(i(),t.getContext()))}function oe(e){var t=m({},e);return["id","name","email"].forEach((function(e){e in t&&(t[e]=String(t[e]))})),t}function ie(e,t){t.silentMultipleInit||o.error("".concat(e," is already initialized."))}var ae="?";function se(e){var t=[],n=he(e,"stack"),r=String(e);return n&&y(n,r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((function(e){var n=function(e){var t=fe.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=le.exec(t[2]);r&&o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]);return{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||ae,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=de.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:ae,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=pe.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||ae,line:+t[3],url:t[2]}}(e)||function(e){var t=ve.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=ge.exec(t[3]);n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0);return{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||ae,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=ae),t.push(n))})),{message:he(e,"message"),name:he(e,"name"),stack:t}}var ue="((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",ce="(?::(\\d+))",fe=new RegExp("^\\s*at (.*?) ?\\(".concat(ue).concat(ce,"?").concat(ce,"?\\)?\\s*$"),"i"),le=new RegExp("\\((\\S*)".concat(ce).concat(ce,"\\)"));var de=new RegExp("^\\s*at ?".concat(ue).concat(ce,"?").concat(ce,"??\\s*$"),"i");var pe=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var ve=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,ge=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function he(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function ye(e,t,n,r){var o=[{url:t,column:r,line:n}],i=function(e){var t,n,r;"[object String]"==={}.toString.call(e)&&(n=(t=me.exec(e))[1],r=t[2]);return{name:n,message:r}}(e);return{name:i.name,message:i.message,stack:o}}var me=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;var be="No stack, consider using an instance of Error";function Ee(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,a=e.source,s=e.handling,u=n instanceof Error,c=function(e,t,n,r){return(null==e?void 0:e.message)&&(null==e?void 0:e.name)?e.message:t?"Empty message":"".concat(n," ").concat(A(Y(r)))}(t,u,i,n),f=function(e,t){if(void 0===t)return!1;if(e)return!0;return t.stack.length>0&&(t.stack.length>1||void 0!==t.stack[0].url)}(u,t)?we(t):be,l=u?function(e,t){var n=e,r=[];for(;(null==n?void 0:n.cause)instanceof Error&&r.length<10;){var o=se(n.cause);r.push({message:n.cause.message,source:t,type:null==o?void 0:o.name,stack:o&&we(o)}),n=n.cause}return r.length?r:void 0}(n,a):void 0;return{startClocks:o,source:a,handling:s,handlingStack:r,originalError:n,type:null==t?void 0:t.name,message:c,stack:f,causes:l,fingerprint:Se(n)}}function Se(e){return e instanceof Error&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function we(e){var t=Ce(e);return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"(".concat(e.args.join(", "),")"):"",o=e.line?":".concat(e.line):"",i=e.line&&e.column?":".concat(e.column):"";t+="\n at ".concat(n).concat(r," @ ").concat(e.url).concat(o).concat(i)})),t}function Ce(e){return"".concat(e.name||"Error",": ").concat(e.message)}var _e,xe={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"},ke=1e3,Oe=60*ke,Te=60*Oe;function Re(){return(new Date).getTime()}function Le(){return Re()}function Ae(){return performance.now()}function Ie(){return{relative:Ae(),timeStamp:Le()}}function Pe(e,t){return e+t}function Be(){return void 0===_e&&(_e=performance.timing.navigationStart),_e}var De=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);return i>3&&a&&Object.defineProperty(t,n,a),a},Ne={debug:"debug",error:"error",info:"info",warn:"warn"},Ue={console:"console",http:"http",silent:"silent"},Me=Object.keys(Ne),qe=function(){function e(e,t,n,r,o,i){void 0===r&&(r=Ue.http),void 0===o&&(o=Ne.debug),void 0===i&&(i={}),this.handleLogStrategy=e,this.handlerType=r,this.level=o,this.contextManager=X(t),this.contextManager.setContext(i),n&&this.contextManager.setContextProperty("logger",{name:n})}return e.prototype.log=function(e,t,n,r){var o;if(void 0===n&&(n=Ne.info),null!=r){var i=Ee({stackTrace:r instanceof Error?se(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:xe.LOGGER,handling:"handled",startClocks:Ie()});o={stack:i.stack,kind:i.type,message:i.message}}var a=Y(t),s=o?G({error:o},a):a;this.handleLogStrategy({message:Y(e),context:s,status:n},this)},e.prototype.debug=function(e,t,n){this.log(e,t,Ne.debug,n)},e.prototype.info=function(e,t,n){this.log(e,t,Ne.info,n)},e.prototype.warn=function(e,t,n){this.log(e,t,Ne.warn,n)},e.prototype.error=function(e,t,n){this.log(e,t,Ne.error,n)},e.prototype.setContext=function(e){this.contextManager.setContext(e)},e.prototype.getContext=function(){return this.contextManager.getContext()},e.prototype.setContextProperty=function(e,t){this.contextManager.setContextProperty(e,t)},e.prototype.removeContextProperty=function(e){this.contextManager.removeContextProperty(e)},e.prototype.clearContext=function(){this.contextManager.clearContext()},e.prototype.setHandler=function(e){this.handlerType=e},e.prototype.getHandler=function(){return this.handlerType},e.prototype.setLevel=function(e){this.level=e},e.prototype.getLevel=function(){return this.level},De([f],e.prototype,"log",null),e}();function je(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var He,Ge=function(){function e(){this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>500&&this.buffer.splice(0,1)},e.prototype.remove=function(e){je(this.buffer,e)},e.prototype.drain=function(e){this.buffer.forEach((function(t){return t(e)})),this.buffer.length=0},e}();function Fe(){var e=b().DatadogEventBridge;if(e)return{getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n){e.send(JSON.stringify({eventType:t,event:n}))}}}function Ve(e){var t;void 0===e&&(e=null===(t=b().location)||void 0===t?void 0:t.hostname);var n=Fe();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r}))}!function(e){e.PAGEHIDE="pagehide",e.FEATURE_FLAGS="feature_flags",e.RESOURCE_PAGE_STATES="resource_page_states",e.COLLECT_FLUSH_REASON="collect_flush_reason",e.ZERO_LCP_TELEMETRY="zero_lcp_telemetry",e.DISABLE_REPLAY_INLINE_CSS="disable_replay_inline_css",e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql"}(He||(He={}));var ze=new Set;function Ye(e){return ze.has(e)}function We(){return ze}function Je(e){return 0!==e&&100*Math.random()<=e}function Ke(e){return function(e){return"number"==typeof e}(e)&&e>=0&&e<=100}function Ze(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,Ze)}var $e=/([\w-]+)\s*=\s*([^;]+)/g;function Xe(e,t,n){void 0===n&&(n="");var r=e.charCodeAt(t-1),o=r>=55296&&r<=56319?t+1:t;return e.length<=o?e:"".concat(e.slice(0,o)).concat(n)}var Qe,et,tt,nt=4*Te,rt=15*Oe;function ot(){return null!=Qe?Qe:Qe=function(e){var t;void 0===e&&(e=window);var n=e.navigator.userAgent;if(e.chrome||/HeadlessChrome/.test(n))return 1;if(0===(null===(t=e.navigator.vendor)||void 0===t?void 0:t.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return 2;if(e.document.documentMode)return 0;return 3}()}function it(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var i="expires=".concat(o.toUTCString()),a=r&&r.crossSite?"none":"strict",s=r&&r.domain?";domain=".concat(r.domain):"",u=r&&r.secure?";secure":"",c=r&&r.partitioned?";partitioned":"";document.cookie="".concat(e,"=").concat(t,";").concat(i,";path=/;samesite=").concat(a).concat(s).concat(u).concat(c)}function at(e){return function(e,t){for($e.lastIndex=0;;){var n=$e.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function st(e){return et||(et=function(e){var t=new Map;for($e.lastIndex=0;;){var n=$e.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),et.get(e)}function ut(e,t){it(e,"",0,t)}var ct="_dd_s",ft=/^([a-z]+)=([a-z0-9-]+)$/,lt="&";function dt(e){return P(e)}function pt(e){e.expire=String(Re()+rt)}function vt(e){return(t=e,Object.keys(t).map((function(e){return[e,t[e]]}))).map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)})).join(lt);var t}function gt(e){var t={};return function(e){return!!e&&(-1!==e.indexOf(lt)||ft.test(e))}(e)&&e.split(lt).forEach((function(e){var n=ft.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}var ht="_dd",yt="_dd_r",mt="_dd_l",bt="rum",Et="logs";function St(e){var t=function(e){var t={};t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===tt){for(var e="dd_site_test_".concat(Ze()),t=window.location.hostname.split("."),n=t.pop();t.length&&!at(e);)n="".concat(t.pop(),".").concat(n),it(e,"test",ke,{domain:n});ut(e,{domain:n}),tt=n}return tt}());return t}(e);return function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_".concat(Ze()),n="test";it(t,n,Oe,e);var r=at(t)===n;return ut(t,e),r}catch(e){return o.error(e),!1}}(t)?{type:"Cookie",cookieOptions:t}:void 0}function wt(e){var t,n={isLockEnabled:1===ot(),persistSession:(t=e,function(e){it(ct,vt(e),rt,t)}),retrieveSession:Ct,clearSession:_t(e)};return function(e){if(!st(ct)){var t=st(ht),n=st(yt),r=st(mt),o={};t&&(o.id=t),r&&/^[01]$/.test(r)&&(o[Et]=r),n&&/^[012]$/.test(n)&&(o[bt]=n),dt(o)||(pt(o),e.persistSession(o))}}(n),n}function Ct(){return gt(at(ct))}function _t(e){return function(){ut(ct,e)}}var xt="_dd_test_";function kt(e){localStorage.setItem(ct,vt(e))}function Ot(){return gt(localStorage.getItem(ct))}function Tt(){localStorage.removeItem(ct)}var Rt,Lt=10,At=100,It=[];function Pt(e,t,n){var r;void 0===n&&(n=0);var o=t.isLockEnabled,i=t.retrieveSession,a=t.persistSession,s=t.clearSession;if(Rt||(Rt=e),e===Rt)if(o&&n>=At)Dt(t);else{var u,c=i();if(o){if(c.lock)return void Bt(e,t,n);if(u=Ze(),c.lock=u,a(c),(c=i()).lock!==u)return void Bt(e,t,n)}var f=e.process(c);if(o&&(c=i()).lock!==u)Bt(e,t,n);else{if(f&&(dt(f)?s():(pt(f),a(f))),o&&(!f||!dt(f))){if((c=i()).lock!==u)return void Bt(e,t,n);delete c.lock,a(c),f=c}null===(r=e.after)||void 0===r||r.call(e,f||c),Dt(t)}}else It.push(e)}function Bt(e,t,n){x((function(){Pt(e,t,n+1)}),Lt)}function Dt(e){Rt=void 0;var t=It.shift();t&&Pt(t,e)}var Nt=ke;function Ut(e){var t=St(e);return!t&&e.allowFallbackToLocalStorage&&(t=function(){try{var e=Ze(),t="".concat(xt).concat(e);localStorage.setItem(t,e);var n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:"LocalStorage"}:void 0}catch(e){return}}()),t}function Mt(e,t,n){var r=new Z,o=new Z,i="Cookie"===e.type?wt(e.cookieOptions):{isLockEnabled:!1,persistSession:kt,retrieveSession:Ot,clearSession:Tt},a=i.clearSession,s=i.retrieveSession,u=O((function(){Pt({process:function(e){return d(e)?void 0:{}},after:f},i)}),Nt),c=function(){var e=s();if(d(e))return e;return{}}();function f(e){return d(e)||(e={}),l()&&(!function(e){return c.id!==e.id||c[t]!==e[t]}(e)?c=e:(c={},o.notify())),e}function l(){return void 0!==c[t]}function d(e){return(void 0===e.created||Re()-Number(e.created)<nt)&&(void 0===e.expire||Re()<Number(e.expire))}return{expandOrRenewSession:R((function(){var e;Pt({process:function(r){var o=f(r);return e=function(e){var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,i&&!e.id&&(e.id=Ze(),e.created=String(Re()));return i}(o),o},after:function(t){e&&!l()&&function(e){c=e,r.notify()}(t),c=t}},i)}),Nt).throttled,expandSession:function(){Pt({process:function(e){return l()?f(e):void 0}},i)},getSession:function(){return c},renewObservable:r,expireObservable:o,expire:function(){a(),f({})},stop:function(){T(u)}}}function qt(e){return jt(e,location.href).href}function jt(e,t){var n=function(){if(void 0===Ht)try{var e=new Gt("http://test/path");Ht="http://test/path"===e.href}catch(e){Ht=!1}return Ht?Gt:void 0}();if(n)try{return void 0!==t?new n(e,t):new n(e)}catch(n){throw new Error("Failed to construct URL: ".concat(String(n)," ").concat(A({url:e,base:t})))}if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '".concat(e,"'"));var r=document,o=r.createElement("a");if(void 0!==t){var i=(r=document.implementation.createHTMLDocument("")).createElement("base");i.href=t,r.head.appendChild(i),r.body.appendChild(o)}return o.href=e,o}var Ht,Gt=URL;var Ft="datad0g.com",Vt="dd0g-gov.com",zt="datadoghq.com";function Yt(e,t,n){var r=function(e,t){var n="/api/v2/".concat(t),r=e.proxy;if("string"==typeof r){var o=qt(r);return function(e){return"".concat(o,"?ddforward=").concat(encodeURIComponent("".concat(n,"?").concat(e)))}}if("function"==typeof r)return function(e){return r({path:n,parameters:e})};var i=function(e){var t=e.site,n=void 0===t?zt:t,r=e.internalAnalyticsSubdomain;if(r&&n===zt)return"".concat(r,".").concat(zt);if(n===Vt)return"http-intake.logs.".concat(n);var o=n.split("."),i=o.pop();return"browser-intake-".concat(o.join("-"),".").concat(i)}(e);return function(e){return"https://".concat(i).concat(n,"?").concat(e)}}(e,t);return{build:function(o,i){var a=function(e,t,n,r,o){var i=e.clientToken,a=e.internalAnalyticsSubdomain,s=o.retry,u=o.flushReason,c=o.encoding,f=["sdk_version:".concat("5.9.0"),"api:".concat(r)].concat(n);u&&Ye(He.COLLECT_FLUSH_REASON)&&f.push("flush_reason:".concat(u));s&&f.push("retry_count:".concat(s.count),"retry_after:".concat(s.lastFailureStatus));var l=["ddsource=browser","ddtags=".concat(encodeURIComponent(f.join(","))),"dd-api-key=".concat(i),"dd-evp-origin-version=".concat(encodeURIComponent("5.9.0")),"dd-evp-origin=browser","dd-request-id=".concat(Ze())];c&&l.push("dd-evp-encoding=".concat(c));"rum"===t&&l.push("batch_time=".concat(Le()));a&&l.reverse();return l.join("&")}(e,t,n,o,i);return r(a)},urlPrefix:r(""),trackType:t}}var Wt=200;var Jt=/[^a-z0-9_:./-]/;function Kt(e,t){var n=Wt-e.length-1;(t.length>n||Jt.test(t))&&o.warn("".concat(e," value doesn't meet tag requirements and will be sanitized"));var r=t.replace(/,/g,"_");return"".concat(e,":").concat(r)}function Zt(e){var t=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(Kt("env",t)),n&&i.push(Kt("service",n)),r&&i.push(Kt("version",r)),o&&i.push(Kt("datacenter",o)),i}(e),n=function(e,t){return{logsEndpointBuilder:Yt(e,"logs",t),rumEndpointBuilder:Yt(e,"rum",t),sessionReplayEndpointBuilder:Yt(e,"replay",t)}}(e,t),r=h(n).map((function(e){return e.urlPrefix})),o=function(e,t,n){if(!e.replica)return;var r=m({},e,{site:zt,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:Yt(r,"logs",n),rumEndpointBuilder:Yt(r,"rum",n)};return t.push.apply(t,h(o).map((function(e){return e.urlPrefix}))),m({applicationId:e.replica.applicationId},o)}(e,r,t);return m({isIntakeUrl:function(e){return r.some((function(t){return 0===e.indexOf(t)}))},replica:o,site:e.site||zt},n)}function $t(e){var t,n,r;if(e&&e.clientToken)if(void 0===e.sessionSampleRate||Ke(e.sessionSampleRate))if(void 0===e.telemetrySampleRate||Ke(e.telemetrySampleRate)){if(void 0===e.telemetryConfigurationSampleRate||Ke(e.telemetryConfigurationSampleRate))return Array.isArray(e.enableExperimentalFeatures)&&e.enableExperimentalFeatures.filter((function(e){return t=He,n=e,Object.keys(t).some((function(e){return t[e]===n}));var t,n})).forEach((function(e){ze.add(e)})),m({beforeSend:e.beforeSend&&i(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:Ut(e),sessionSampleRate:null!==(t=e.sessionSampleRate)&&void 0!==t?t:100,telemetrySampleRate:null!==(n=e.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=e.telemetryConfigurationSampleRate)&&void 0!==r?r:5,service:e.service,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,batchBytesLimit:16*E,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*ke,batchMessagesLimit:50,messageBytesLimit:256*E},Zt(e));o.error("Telemetry Configuration Sample Rate should be a number between 0 and 100")}else o.error("Telemetry Sample Rate should be a number between 0 and 100");else o.error("Session Sample Rate should be a number between 0 and 100");else o.error("Client Token is not configured, we will not send any data.")}var Xt={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Qt(e,t){var n=[];v(t,Xt.cspViolation)&&n.push(function(e){return new Z((function(t){return Q(e,document,K.SECURITY_POLICY_VIOLATION,(function(e){t.notify(function(e){var t=Xt.cspViolation,n="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return{type:Xt.cspViolation,subtype:e.effectiveDirective,message:"".concat(t,": ").concat(n),stack:en(e.effectiveDirective,e.originalPolicy?"".concat(n,' of the policy "').concat(Xe(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber),originalReport:e}}(e))})).stop}))}(e));var r=t.filter((function(e){return e!==Xt.cspViolation}));return r.length&&n.push(function(e){return new Z((function(t){if(window.ReportingObserver){var n=l((function(e,n){return e.forEach((function(e){t.notify(function(e){var t=e.type,n=e.body;return{type:t,subtype:n.id,message:"".concat(t,": ").concat(n.message),originalReport:e,stack:en(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)}}(e))}))})),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),function(){r.disconnect()}}}))}(r)),$.apply(void 0,n)}function en(e,t,n,r,o){return n?we({name:e,message:t,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}var tn=32*E;function nn(e,t,n){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((function(e){return v(t,e)}))?"all"===e?t:(r=e,i=new Set,r.forEach((function(e){return i.add(e)})),g(i)):void o.error("".concat(n,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'));var r,i}function rn(t,n){var r,i,a=new Ge;return{init:function(t){if(t)if(Ve()&&(t=function(e){return m({},e,{clientToken:"empty"})}(t)),r=t,i)ie("DD_LOGS",t);else{var s=function(t){var n=$t(t),r=nn(t.forwardConsoleLogs,h(e),"Forward Console Logs"),o=nn(t.forwardReports,h(Xt),"Forward Reports");if(n&&r&&o)return t.forwardErrorsToLogs&&!v(r,e.error)&&r.push(e.error),m({forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:o,requestErrorResponseLengthLimit:tn},n)}(t);s&&(i=s,function(){if(i&&r){var e=n(r,i);a.drain(e)}}())}else o.error("Missing configuration")},get initConfiguration(){return r},getInternalContext:L,handleLog:function(e,n,r,o){void 0===r&&(r=t()),void 0===o&&(o=Le()),a.add((function(t){return t.handleLog(e,n,r,o)}))}}}var on="logs";function an(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}var sn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};var un="datadog-synthetics-public-id",cn="datadog-synthetics-result-id",fn="datadog-synthetics-injects-rum";function ln(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||st(fn))}function dn(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||st(cn);return"string"==typeof e?e:void 0}var pn=1/0,vn=Oe,gn=function(){function e(e,t){var n=this;this.expireDelay=e,this.maxEntries=t,this.entries=[],this.clearOldValuesInterval=O((function(){return n.clearOldValues()}),vn)}return e.prototype.add=function(e,t){var n=this,r={value:e,startTime:t,endTime:pn,remove:function(){je(n.entries,r)},close:function(e){r.endTime=e}};return this.maxEntries&&this.entries.length>=this.maxEntries&&this.entries.pop(),this.entries.unshift(r),r},e.prototype.find=function(e){void 0===e&&(e=pn);for(var t=0,n=this.entries;t<n.length;t++){var r=n[t];if(r.startTime<=e){if(e<=r.endTime)return r.value;break}}},e.prototype.closeActive=function(e){var t=this.entries[0];t&&t.endTime===pn&&t.close(e)},e.prototype.findAll=function(e,t){void 0===e&&(e=pn),void 0===t&&(t=0);var n=Pe(e,t);return this.entries.filter((function(t){return t.startTime<=n&&e<=t.endTime})).map((function(e){return e.value}))},e.prototype.reset=function(){this.entries=[]},e.prototype.stop=function(){T(this.clearOldValuesInterval)},e.prototype.clearOldValues=function(){for(var e=Ae()-this.expireDelay;this.entries.length>0&&this.entries[this.entries.length-1].endTime<e;)this.entries.pop()},e}(),hn=Oe,yn=nt,mn=[];function bn(e,t,n){var r=Mt(e.sessionStoreStrategyType,t,n);mn.push((function(){return r.stop()}));var o=new gn(yn);function i(){return{id:r.getSession().id,trackingType:r.getSession()[t]}}return mn.push((function(){return o.stop()})),r.renewObservable.subscribe((function(){o.add(i(),Ae())})),r.expireObservable.subscribe((function(){o.closeActive(Ae())})),r.expandOrRenewSession(),o.add(i(),[0,Be()][0]),function(e,t){var n=ee(e,window,[K.CLICK,K.TOUCH_START,K.KEY_DOWN,K.SCROLL],t,{capture:!0,passive:!0}).stop;mn.push(n)}(e,(function(){return r.expandOrRenewSession()})),function(e,t){var n=function(){"visible"===document.visibilityState&&t()},r=Q(e,document,K.VISIBILITY_CHANGE,n).stop;mn.push(r);var o=O(n,hn);mn.push((function(){T(o)}))}(e,(function(){return r.expandSession()})),{findActiveSession:function(e){return o.find(e)},renewObservable:r.renewObservable,expireObservable:r.expireObservable,expire:r.expire}}var En="logs";function Sn(e){var t=bn(e,En,(function(t){return function(e,t){var n=function(e){return"0"===e||"1"===e}(t)?t:wn(e);return{trackingType:n,isTracked:"1"===n}}(e,t)}));return{findTrackedSession:function(e){var n=t.findActiveSession(e);return n&&"1"===n.trackingType?{id:n.id}:void 0},expireObservable:t.expireObservable}}function wn(e){return Je(e.sessionSampleRate)?"1":"0"}function Cn(){var e,t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:null===(e=t.connection)||void 0===e?void 0:e.effectiveType}}var _n,xn={log:"log",configuration:"configuration"},kn=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],On=["ddog-gov.com"],Tn={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1,telemetryConfigurationEnabled:!1};function Rn(e,t){var n,r=new Z;Tn.telemetryEnabled=!v(On,t.site)&&Je(t.telemetrySampleRate),Tn.telemetryConfigurationEnabled=Tn.telemetryEnabled&&Je(t.telemetryConfigurationSampleRate);var o={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return _n=function(t){if(Tn.telemetryEnabled){var i=function(e,t,r){return G({type:"telemetry",date:Le(),service:e,version:"5.9.0",source:"browser",_dd:{format_version:2},telemetry:G(t,{runtime_env:r,connectivity:Cn()}),experimental_features:g(We())},void 0!==n?n():{})}(e,t,o);r.notify(i),an("telemetry",i)}},a=An,m(Tn,{maxEventsPerPage:t.maxTelemetryEventsPerPage,sentEventCount:0}),{setContextProvider:function(e){n=e},observable:r,enabled:Tn.telemetryEnabled}}function Ln(t,n){p(e.debug,t,n),In(m({type:xn.log,message:t,status:"debug"},n))}function An(e,t){In(m({type:xn.log,status:"error"},function(e){if(e instanceof Error){var t=se(e);return{error:{kind:t.name,stack:we(Pn(t))},message:t.message}}return{error:{stack:be},message:"".concat("Uncaught"," ").concat(A(e))}}(e),t))}function In(e){_n&&Tn.sentEventCount<Tn.maxEventsPerPage&&(Tn.sentEventCount+=1,_n(e))}function Pn(e){return e.stack=e.stack.filter((function(e){return!e.url||kn.some((function(t){return y(e.url,t)}))})),e}var Bn=!1;function Dn(e){var t,n=window;if(ln()){var r=o(n.DD_RUM_SYNTHETICS);return r||Bn||(Bn=!0,Ln("Logs sent before RUM is injected by the synthetics worker",{testId:(t=window._DATADOG_SYNTHETICS_PUBLIC_ID||st(un),"string"==typeof t?t:void 0),resultId:dn()})),r}return o(n.DD_RUM);function o(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}}function Nn(e,t,n,r,o){var i=Me.concat(["custom"]),a={};i.forEach((function(e){var n,r,i,s,u;a[e]=(n=e,r=t.eventRateLimiterThreshold,i=o,s=0,u=!1,{isLimitReached:function(){if(0===s&&x((function(){s=0}),Oe),(s+=1)<=r||u)return u=!1,!1;if(s===r+1){u=!0;try{i({message:"Reached max number of ".concat(n,"s by minute: ").concat(r),source:xe.AGENT,startClocks:Ie()})}finally{u=!1}}return!0}})})),n.subscribe(0,(function(o){var i,s,u=o.rawLogsEvent,c=o.messageContext,f=void 0===c?void 0:c,l=o.savedCommonContext,d=void 0===l?void 0:l,p=u.date-Be(),v=e.findTrackedSession(p);if(v){var g=d||r(),h=G({service:t.service,session_id:v.id,usr:P(g.user)?void 0:g.user,view:g.view},g.context,Dn(p),u,f);!1===(null===(i=t.beforeSend)||void 0===i?void 0:i.call(t,h))||h.origin!==xe.AGENT&&(null!==(s=a[h.status])&&void 0!==s?s:a.custom).isLimitReached()||n.notify(1,h)}}))}var Un,Mn={};function qn(n){var r=n.map((function(n){return Mn[n]||(Mn[n]=function(n){return new Z((function(r){var o=t[n];return t[n]=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];o.apply(console,t);var a=function(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return d((function(){var n=se(t);n.stack=n.stack.slice(2),e=we(n)})),e}();d((function(){r.notify(function(t,n,r){var o,i,a=t.map((function(e){return function(e){if("string"==typeof e)return Y(e);if(e instanceof Error)return Ce(se(e));return A(Y(e),void 0,2)}(e)})).join(" ");if(n===e.error){var s=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n))return r}}(t,(function(e){return e instanceof Error}));o=s?we(se(s)):void 0,i=Se(s)}return{api:n,message:a,stack:o,handlingStack:r,fingerprint:i}}(t,n,a))}))},function(){t[n]=o}}))}(n)),Mn[n]}));return $.apply(void 0,r)}var jn,Hn=((Un={})[e.log]=Ne.info,Un[e.debug]=Ne.debug,Un[e.info]=Ne.info,Un[e.warn]=Ne.warn,Un[e.error]=Ne.error,Un);var Gn,Fn=((jn={})[Xt.cspViolation]=Ne.error,jn[Xt.intervention]=Ne.error,jn[Xt.deprecation]=Ne.warn,jn);function Vn(e,t,n){var r=e[t],o=function(e,t){return function(){var n,r,o=arguments;return d(t,null,[{target:this,parameters:o,onPostCall:function(e){r=e}}]),"function"==typeof e&&(n=e.apply(this,o)),r&&d(r,null,[n]),n}}(r,n),i=function(){if("function"==typeof o)return o.apply(this,arguments)};return e[t]=i,{stop:function(){e[t]===i?e[t]=r:o=r}}}var zn,Yn=new WeakMap;function Wn(e){return Gn||(Gn=function(e){return new Z((function(t){var n=Vn(XMLHttpRequest.prototype,"open",Jn).stop,r=Vn(XMLHttpRequest.prototype,"send",(function(n){!function(e,t,n){var r=e.target,o=Yn.get(r);if(!o)return;var i=o;i.state="start",i.startClocks=Ie(),i.isAborted=!1,i.xhr=r;var a=!1,s=Vn(r,"onreadystatechange",(function(){r.readyState===XMLHttpRequest.DONE&&u()})).stop,u=function(){if(c(),s(),!a){a=!0;var e,t=o;t.state="complete",t.duration=(e=i.startClocks.timeStamp,Le()-e),t.status=r.status,n.notify(m({},t))}},c=Q(t,r,"loadend",u).stop;n.notify(i)}(n,e,t)})).stop,o=Vn(XMLHttpRequest.prototype,"abort",Kn).stop;return function(){n(),r(),o()}}))}(e)),Gn}function Jn(e){var t=e.target,n=e.parameters,r=n[0],o=n[1];Yn.set(t,{state:"open",method:String(r).toUpperCase(),url:qt(String(o))})}function Kn(e){var t=e.target,n=Yn.get(t);n&&(n.isAborted=!0)}function Zn(){return zn||(zn=new Z((function(e){if(window.fetch){var t=Vn(window,"fetch",(function(t){return function(e,t){var n=e.parameters,r=e.onPostCall,o=n[0],i=n[1],a=i&&i.method;void 0===a&&o instanceof Request&&(a=o.method);var s=void 0!==a?String(a).toUpperCase():"GET",u=o instanceof Request?o.url:qt(String(o)),c=Ie(),f={state:"start",init:i,input:o,method:s,startClocks:c,url:u};t.notify(f),n[0]=f.input,n[1]=f.init,r((function(e){return function(e,t,n){var r=function(t){var r=n;r.state="resolve","stack"in t||t instanceof Error?(r.status=0,r.isAborted=t instanceof DOMException&&t.code===DOMException.ABORT_ERR,r.error=t):"status"in t&&(r.response=t,r.responseType=t.type,r.status=t.status,r.isAborted=!1),e.notify(r)};t.then(l(r),l(r))}(t,e,f)}))}(t,e)})).stop;return t}}))),zn}function $n(e){return e>=500}function Xn(e,t){if(!e.forwardErrorsToLogs)return{stop:L};var n=Wn(e).subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=Zn().subscribe((function(e){"resolve"===e.state&&o("fetch",e)}));function o(n,r){function o(e){t.notify(0,{rawLogsEvent:{message:"".concat(er(n)," error ").concat(r.method," ").concat(r.url),date:r.startClocks.timeStamp,error:{stack:e||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url},status:Ne.error,origin:xe.NETWORK}})}e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!$n(r.status)||("xhr"in r?function(e,t,n){"string"==typeof e.response?n(Qn(e.response,t)):n(e.response)}(r.xhr,e,o):r.response?function(e,t,n){var r=function(e){try{return e.clone()}catch(e){return}}(e);r&&r.body?window.TextDecoder?function(e,t,n){!function(e,t,n){var r=e.getReader(),o=[],i=0;function a(){var e,a;if(r.cancel().catch(L),n.collectStreamBody){var s;if(1===o.length)s=o[0];else{s=new Uint8Array(i);var u=0;o.forEach((function(e){s.set(e,u),u+=e.length}))}e=s.slice(0,n.bytesLimit),a=s.length>n.bytesLimit}t(void 0,e,a)}!function e(){r.read().then(l((function(t){t.done?a():(n.collectStreamBody&&o.push(t.value),(i+=t.value.length)>n.bytesLimit?a():e())})),l((function(e){return t(e)})))}()}(e,(function(e,t,r){if(e)n(e);else{var o=(new TextDecoder).decode(t);r&&(o+="..."),n(void 0,o)}}),{bytesLimit:t,collectStreamBody:!0})}(r.body,t.requestErrorResponseLengthLimit,(function(e,t){n(e?"Unable to retrieve response: ".concat(e):t)})):r.text().then(l((function(e){return n(Qn(e,t))})),l((function(e){return n("Unable to retrieve response: ".concat(e))}))):n()}(r.response,e,o):r.error&&function(e,t,n){n(Qn(we(se(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function Qn(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function er(e){return"xhr"===e?"XHR":"Fetch"}function tr(e){var t,n=function(t,n){var r=Ee({stackTrace:t,originalError:n,startClocks:Ie(),nonErrorPrefix:"Uncaught",source:xe.SOURCE,handling:"unhandled"});e.notify(r)},r=(t=n,Vn(window,"onerror",(function(e){var n,r=e.parameters,o=r[0],i=r[1],a=r[2],s=r[3],u=r[4];n=u instanceof Error?se(u):ye(o,i,a,s),t(n,null!=u?u:o)}))).stop,o=function(e){return Vn(window,"onunhandledrejection",(function(t){var n=t.parameters[0].reason||"Empty reason",r=se(n);e(r,n)}))}(n).stop;return{stop:function(){r(),o()}}}var nr,rr=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}(),or=((nr={})[Ne.debug]=0,nr[Ne.info]=1,nr[Ne.warn]=2,nr[Ne.error]=3,nr);function ir(e){return{handleLog:function(r,o,i,a){var s=G(o.getContext(),r.context);ar(r.status,Ue.console,o)&&function(e,r){n[e.status].call(t,e.message,r)}(r,s),ar(r.status,Ue.http,o)&&e.notify(0,{rawLogsEvent:{date:a||Le(),message:r.message,status:r.status,origin:xe.LOGGER},messageContext:s,savedCommonContext:i})}}}function ar(e,t,n){var r=n.getHandler(),o=Array.isArray(r)?r:[r];return or[e]>=or[n.getLevel()]&&v(o,t)}var sr=function(){function e(e,t,n,r){var o=this;this.encoder=e,this.request=t,this.flushController=n,this.messageBytesLimit=r,this.upsertBuffer={},this.flushSubscription=this.flushController.flushObservable.subscribe((function(e){return o.flush(e)}))}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.stop=function(){this.flushSubscription.unsubscribe()},e.prototype.flush=function(e){var t=h(this.upsertBuffer).join("\n");this.upsertBuffer={};var n,r=(n=e.reason,v(h(sn),n)),o=r?this.request.sendOnExit:this.request.send;if(r&&this.encoder.isAsync){var i=this.encoder.finishSync();i.outputBytesCount&&o(ur(i,e));var a=[i.pendingData,t].filter(Boolean).join("\n");a&&o({data:a,bytesCount:C(a),flushReason:e.reason})}else t&&this.encoder.write(this.encoder.isEmpty?t:"\n".concat(t)),this.encoder.finish((function(t){o(ur(t,e))}))},e.prototype.addOrUpdate=function(e,t){var n=A(e),r=this.encoder.estimateEncodedBytesCount(n);r>=this.messageBytesLimit?o.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit,"KB.")):(this.hasMessageFor(t)&&this.remove(t),this.push(n,r,t))},e.prototype.push=function(e,t,n){var r=this;this.flushController.notifyBeforeAddMessage(t),void 0!==n?(this.upsertBuffer[n]=e,this.flushController.notifyAfterAddMessage()):this.encoder.write(this.encoder.isEmpty?e:"\n".concat(e),(function(e){r.flushController.notifyAfterAddMessage(e-t)}))},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.encoder.estimateEncodedBytesCount(t);this.flushController.notifyAfterRemoveMessage(n)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e}();function ur(e,t){return{data:"string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),bytesCount:e.outputBytesCount,encoding:e.encoding,flushReason:t.reason}}var cr=80*E,fr=32,lr=3*S,dr=Oe,pr=ke;function vr(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?hr(e,t,n,{onSuccess:function(){return yr(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),gr(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function gr(e,t,n,r){2===e.transportStatus&&x((function(){hr(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=pr,yr(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(dr,2*e.currentBackoffTime),gr(e,t,n,r)}})}),e.currentBackoffTime)}function hr(e,t,n,r){var o=r.onSuccess,i=r.onFailure;t.bandwidthMonitor.add(e),n(e,(function(n){t.bandwidthMonitor.remove(e),!function(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||$n(e.status))}(n)?(t.transportStatus=0,o()):(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:n.status},i())}))}function yr(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(lr/S,"MiB"),source:xe.AGENT,startClocks:Ie()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=mr();i.size()>0;)vr(i.dequeue(),t,n,r,o)}function mr(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=lr}}}function br(e,t,n,r){var o={transportStatus:0,currentBackoffTime:pr,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=cr&&this.ongoingRequestCount<fr},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:mr(),queueFullReported:!1},i=function(r,o){return function(e,t,n,r,o){var i=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}}()&&r.bytesCount<n;if(i){var a=t.build("fetch",r);fetch(a,{method:"POST",body:r.data,keepalive:!0,mode:"cors"}).then(l((function(e){return null==o?void 0:o({status:e.status,type:e.type})})),l((function(){var n=t.build("xhr",r);Sr(e,n,r.data,o)})))}else{var s=t.build("xhr",r);Sr(e,s,r.data,o)}}(e,t,n,r,o)};return{send:function(e){vr(e,o,i,t.trackType,r)},sendOnExit:function(r){!function(e,t,n,r){var o=!!navigator.sendBeacon&&r.bytesCount<n;if(o)try{var i=t.build("beacon",r);if(navigator.sendBeacon(i,r.data))return}catch(e){!function(e){Er||(Er=!0,An(e))}(e)}var a=t.build("xhr",r);Sr(e,a,r.data)}(e,t,n,r)}}}var Er=!1;function Sr(e,t,n,r){var o=new XMLHttpRequest;o.open("POST",t,!0),n instanceof Blob&&o.setRequestHeader("Content-Type",n.type),Q(e,o,"loadend",(function(){null==r||r({status:o.status})}),{once:!0}),o.send(n)}function wr(e){var t,n=e.messagesLimit,r=e.bytesLimit,o=e.durationLimit,i=e.pageExitObservable,a=e.sessionExpireObservable,s=i.subscribe((function(e){return d(e.reason)})),u=a.subscribe((function(){return d("session_expire")})),c=new Z((function(){return function(){s.unsubscribe(),u.unsubscribe()}})),f=0,l=0;function d(e){if(0!==l){var t=l,n=f;l=0,f=0,p(),c.notify({reason:e,messagesCount:t,bytesCount:n})}}function p(){k(t),t=void 0}return{flushObservable:c,get messagesCount(){return l},notifyBeforeAddMessage:function(e){f+e>=r&&d("bytes_limit"),l+=1,f+=e,void 0===t&&(t=x((function(){d("duration_limit")}),o))},notifyAfterAddMessage:function(e){void 0===e&&(e=0),f+=e,l>=n?d("messages_limit"):f>=r&&d("bytes_limit")},notifyAfterRemoveMessage:function(e){f-=e,0===(l-=1)&&p()}}}function Cr(e,t,n,r,o,i){var a=u(e,t),s=n&&u(e,n);function u(e,t){var n=t.endpoint,a=t.encoder;return new sr(a,br(e,n,e.batchBytesLimit,r),wr({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageExitObservable:o,sessionExpireObservable:i}),e.messageBytesLimit)}return{flushObservable:a.flushController.flushObservable,add:function(e,t){void 0===t&&(t=!0),a.add(e),s&&t&&s.add(n.transformMessage?n.transformMessage(e):e)},upsert:function(e,t){a.upsert(e,t),s&&s.upsert(n.transformMessage?n.transformMessage(e):e,t)},stop:function(){a.stop(),null==s||s.stop()}}}function _r(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(n,r){var o=C(n);t+=o,e+=n,r&&r(o)},finish:function(e){e(this.finishSync())},finishSync:function(){var n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount:function(e){return e.length}}}function xr(e,t,n,r,o){var i=Rn("browser-logs-sdk",t);i.setContextProvider((function(){var e,t,n,r,i,a;return{application:{id:null===(e=Dn())||void 0===e?void 0:e.application_id},session:{id:null===(t=o.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(r=null===(n=Dn())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(a=null===(i=Dn())||void 0===i?void 0:i.user_action)||void 0===a?void 0:a.id}}}));var a=[];if(Ve()){var s=Fe(),u=i.observable.subscribe((function(e){return s.send("internal_telemetry",e)}));a.push((function(){return u.unsubscribe()}))}else{var c=Cr(t,{endpoint:t.rumEndpointBuilder,encoder:_r()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:_r()},n,r,o.expireObservable);a.push((function(){return c.stop()}));var f=i.observable.subscribe((function(e){return c.add(e,function(e){return e.site===Ft}(t))}));a.push((function(){return f.unsubscribe()}))}return function(e){Tn.telemetryConfigurationEnabled&&In({type:xn.configuration,configuration:e})}(function(e){var t,n={session_sample_rate:(t=e).sessionSampleRate,telemetry_sample_rate:t.telemetrySampleRate,telemetry_configuration_sample_rate:t.telemetryConfigurationSampleRate,use_before_send:!!t.beforeSend,use_cross_site_session_cookie:t.useCrossSiteSessionCookie,use_partitioned_cross_site_session_cookie:t.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:t.useSecureSessionCookie,use_proxy:!!t.proxy,silent_multiple_init:t.silentMultipleInit,track_session_across_subdomains:t.trackSessionAcrossSubdomains,allow_fallback_to_local_storage:!!t.allowFallbackToLocalStorage,store_contexts_across_pages:!!t.storeContextsAcrossPages,allow_untrusted_events:!!t.allowUntrustedEvents};return m({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports},n)}(e)),{telemetry:i,stop:function(){a.forEach((function(e){return e()}))}}}var kr,Or,Tr,Rr,Lr=function(e){var t=U(),n=X(t.getOrCreateTracker(2)),r=X(t.getOrCreateTracker(1));function i(){return function(e,t){return{view:{referrer:document.referrer,url:window.location.href},context:e.getContext(),user:t.getContext()}}(n,r)}var a,s,u=rn(i,(function(t,o){t.storeContextsAcrossPages&&(re(o,n,on,2),re(o,r,on,1));var a=e(t,o,i);return u=function(e,t){return m({init:function(e){ie("DD_LOGS",e)},initConfiguration:e},t)}(t,a),a})),f={},d=new qe((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return u.handleLog.apply(u,e)}),t.createDetachedTracker());return a={logger:d,init:l((function(e){return u.init(e)})),getGlobalContext:l((function(){return n.getContext()})),setGlobalContext:l((function(e){return n.setContext(e)})),setGlobalContextProperty:l((function(e,t){return n.setContextProperty(e,t)})),removeGlobalContextProperty:l((function(e){return n.removeContextProperty(e)})),clearGlobalContext:l((function(){return n.clearContext()})),createLogger:l((function(e,n){return void 0===n&&(n={}),f[e]=new qe((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return u.handleLog.apply(u,e)}),t.createDetachedTracker(),Y(e),n.handler,n.level,Y(n.context)),f[e]})),getLogger:l((function(e){return f[e]})),getInitConfiguration:l((function(){return H(u.initConfiguration)})),getInternalContext:l((function(e){return u.getInternalContext(e)})),setUser:l((function(e){(function(e){var t="object"===q(e);return t||o.error("Unsupported user:",e),t})(e)&&r.setContext(oe(e))})),getUser:l((function(){return r.getContext()})),setUserProperty:l((function(e,t){var n,o=oe((n={},n[e]=t,n))[e];r.setContextProperty(e,o)})),removeUserProperty:l((function(e){return r.removeContextProperty(e)})),clearUser:l((function(){return r.clearContext()}))},s=m({version:"5.9.0",onReady:function(e){e()}},a),Object.defineProperty(s,"_setDebug",{get:function(){return c},enumerable:!1}),s}((function(t,n,r){var o=new rr,i=[];o.subscribe(1,(function(e){return an("logs",e)}));var a=function(e){return function(t){e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,origin:xe.AGENT,status:Ne.error}}),Ln("Error reported to customer",{"error.message":t.message})}}(o),s=function(e){return new Z((function(t){var n=Ye(He.PAGEHIDE),r=ee(e,window,[K.VISIBILITY_CHANGE,K.FREEZE,K.PAGE_HIDE],(function(e){e.type===K.PAGE_HIDE&&n?t.notify({reason:sn.PAGEHIDE}):e.type===K.VISIBILITY_CHANGE&&"hidden"===document.visibilityState?t.notify({reason:sn.HIDDEN}):e.type===K.FREEZE&&t.notify({reason:sn.FROZEN})}),{capture:!0}).stop,o=L;return n||(o=Q(e,window,K.BEFORE_UNLOAD,(function(){t.notify({reason:sn.UNLOADING})})).stop),function(){r(),o()}}))}(n),u=!n.sessionStoreStrategyType||Ve()||ln()?function(e){var t="1"===wn(e)?{}:void 0;return{findTrackedSession:function(){return t},expireObservable:new Z}}(n):Sn(n),c=xr(t,n,a,s,u).stop;i.push((function(){return c()})),Xn(n,o),function(e,t){if(!e.forwardErrorsToLogs)return{stop:L};var n=new Z,r=tr(n).stop,o=n.subscribe((function(e){t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{kind:e.type,stack:e.stack},origin:xe.SOURCE,status:Ne.error}})}))}(n,o),function(t,n){var r=qn(t.forwardConsoleLogs).subscribe((function(t){n.notify(0,{rawLogsEvent:{date:Le(),message:t.message,origin:xe.CONSOLE,error:t.api===e.error?{stack:t.stack,fingerprint:t.fingerprint}:void 0,status:Hn[t.api]}})}))}(n,o),function(e,t){var n=Qt(e,e.forwardReports).subscribe((function(e){var n,r=e.message,o=Fn[e.type];o===Ne.error?n={kind:e.subtype,stack:e.stack}:e.stack&&(r+=" Found in ".concat(function(e){var t;return null===(t=/@ (.+)/.exec(e))||void 0===t?void 0:t[1]}(e.stack))),t.notify(0,{rawLogsEvent:{date:Le(),message:r,origin:xe.REPORT,error:n,status:o}})}))}(n,o);var f,l=ir(o).handleLog;if(Nn(u,n,o,r,a),Ve())!function(e){var t=Fe();e.subscribe(1,(function(e){t.send("log",e)}))}(o);else{var d=function(e,t,n,r,o){var i=Cr(e,{endpoint:e.logsEndpointBuilder,encoder:_r()},e.replica&&{endpoint:e.replica.logsEndpointBuilder,encoder:_r()},n,r,o.expireObservable);return t.subscribe(1,(function(e){i.add(e)})),i}(n,o,a,s,u).stop;i.push((function(){return d()}))}return{handleLog:l,getInternalContext:(f=u,{get:function(e){var t=f.findTrackedSession(e);if(t)return{session_id:t.id}}}).get,stop:function(){i.forEach((function(e){return e()}))}}}));kr=b(),Tr=Lr,Rr=kr[Or="DD_LOGS"],kr[Or]=Tr,Rr&&Rr.q&&Rr.q.forEach((function(e){return i(e,"onReady callback threw an error:")()}))}();
!function(){"use strict";var e={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},t=console,n={};Object.keys(e).forEach((function(e){n[e]=t[e]}));var r="Datadog Browser SDK:",o={debug:n.debug.bind(t,r),log:n.log.bind(t,r),info:n.info.bind(t,r),warn:n.warn.bind(t,r),error:n.error.bind(t,r)};function i(e,t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];try{return e.apply(void 0,n)}catch(e){o.error(t,e)}}}var a,s=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},u=!1;function c(e){u=e}function f(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(a?l(r):r).apply(this,e)}}function l(e){return function(){return d(e,this,arguments)}}function d(e,t,n){try{return e.apply(t,n)}catch(e){if(p(e),a)try{a(e)}catch(e){p(e)}}}function p(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];u&&o.error.apply(o,s(["[MONITOR]"],e,!1))}function v(e,t){return-1!==e.indexOf(t)}function g(e){if(Array.from)return Array.from(e);var t=[];if(e instanceof Set)e.forEach((function(e){return t.push(e)}));else for(var n=0;n<e.length;n++)t.push(e[n]);return t}function h(e){return Object.keys(e).map((function(t){return e[t]}))}function y(e,t){return e.slice(0,t.length)===t}function m(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.forEach((function(t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})),e}function b(){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}var E=1024,S=1024*E,C=/[^\u0000-\u007F]/;function w(e){return C.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length}function _(e,t){var n,r=b();return r.Zone&&"function"==typeof r.Zone.__symbol__&&(n=e[r.Zone.__symbol__(t)]),n||(n=e[t]),n}function k(e,t){return _(b(),"setTimeout")(l(e),t)}function x(e){_(b(),"clearTimeout")(e)}function O(e,t){return _(b(),"setInterval")(l(e),t)}function T(e){_(b(),"clearInterval")(e)}function R(e,t,n){var r,o,i=!n||void 0===n.leading||n.leading,a=!n||void 0===n.trailing||n.trailing,s=!1;return{throttled:function(){for(var n=[],u=0;u<arguments.length;u++)n[u]=arguments[u];s?r=n:(i?e.apply(void 0,n):r=n,s=!0,o=k((function(){a&&r&&e.apply(void 0,r),s=!1,r=void 0}),t))},cancel:function(){x(o),s=!1,r=void 0}}}function L(){}function A(e,t,n){if("object"!=typeof e||null===e)return JSON.stringify(e);var r=I(Object.prototype),o=I(Array.prototype),i=I(Object.getPrototypeOf(e)),a=I(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{r(),o(),i(),a()}}function I(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):L}function P(e,t){return Object.keys(e).some((function(n){return e[n]===t}))}function N(e){return 0===Object.keys(e).length}var D=3*E,B=16*E,U=200;function M(e){void 0===e&&(e=2);var t=new Map,n=!1;function r(r){if(void 0===r&&(r=0),!n&&0!==e){var i=2===e?D:B,a=r;t.forEach((function(e){a+=e.getBytesCount()})),a>i&&(!function(e){o.warn("Customer data exceeds the recommended ".concat(e/E,"KiB threshold. More details: https://docs.datadoghq.com/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-threshold-warning"))}(i),n=!0)}}return{createDetachedTracker:function(){var e=G((function(){return r(e.getBytesCount())}));return e},getOrCreateTracker:function(e){return t.has(e)||t.set(e,G(r)),t.get(e)},setCompressionStatus:function(t){0===e&&(e=t,r())},getCompressionStatus:function(){return e},stop:function(){t.forEach((function(e){return e.stop()})),t.clear()}}}function G(e){var t=0,n=R((function(n){t=w(A(n)),e()}),U),r=n.throttled,o=n.cancel,i=function(){o(),t=0};return{updateCustomerData:function(e){N(e)?i():r(e)},resetCustomerData:i,getBytesCount:function(){return t},stop:function(){o()}}}function q(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function j(e,t,n){if(void 0===n&&(n=function(){if("undefined"!=typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}()),void 0===t)return e;if("object"!=typeof t||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],i=0;i<t.length;++i)o[i]=j(o[i],t[i],n);return o}var a="object"===q(e)?e:{};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(a[s]=j(a[s],t[s],n));return a}}function H(e){return j(void 0,e)}function F(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var r=0,o=t;r<o.length;r++){var i=o[r];null!=i&&(e=j(e,i))}return e}var V=220*E,z="$",Y=3;function W(e,t){var n;void 0===t&&(t=V);var r=I(Object.prototype),o=I(Array.prototype),i=[],a=new WeakMap,s=J(e,z,void 0,i,a),u=(null===(n=JSON.stringify(s))||void 0===n?void 0:n.length)||0;if(!(u>t)){for(;i.length>0&&u<t;){var c=i.shift(),f=0;if(Array.isArray(c.source))for(var l=0;l<c.source.length;l++){if(u+=void 0!==(d=J(c.source[l],c.path,l,i,a))?JSON.stringify(d).length:4,u+=f,f=1,u>t){K(t,"truncated",e);break}c.target[l]=d}else for(var l in c.source)if(Object.prototype.hasOwnProperty.call(c.source,l)){var d;if(void 0!==(d=J(c.source[l],c.path,l,i,a))&&(u+=JSON.stringify(d).length+f+l.length+Y,f=1),u>t){K(t,"truncated",e);break}c.target[l]=d}}return r(),o(),s}K(t,"discarded",e)}function J(e,t,n,r,o){var i=function(e){var t=e;if(t&&"function"==typeof t.toJSON)try{return t.toJSON()}catch(e){}return e}(e);if(!i||"object"!=typeof i)return function(e){if("bigint"==typeof e)return"[BigInt] ".concat(e.toString());if("function"==typeof e)return"[Function] ".concat(e.name||"unknown");if("symbol"==typeof e)return"[Symbol] ".concat(e.description||e.toString());return e}(i);var a=function(e){try{if(e instanceof Event)return{isTrusted:e.isTrusted};var t=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(t&&t[1])return"[".concat(t[1],"]")}catch(e){}return"[Unserializable]"}(i);if("[Object]"!==a&&"[Array]"!==a&&"[Error]"!==a)return a;var s=e;if(o.has(s))return"[Reference seen at ".concat(o.get(s),"]");var u=void 0!==n?"".concat(t,".").concat(n):t,c=Array.isArray(i)?[]:{};return o.set(s,u),r.push({source:i,target:c,path:u}),c}function K(e,t,n){o.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),n)}var Z,$=function(){function e(e){this.onFirstSubscribe=e,this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t})),!t.observers.length&&t.onLastUnsubscribe&&t.onLastUnsubscribe()}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function X(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new $((function(t){var n=e.map((function(e){return e.subscribe((function(e){return t.notify(e)}))}));return function(){return n.forEach((function(e){return e.unsubscribe()}))}}))}function Q(e){var t={},n=new $,r={getContext:function(){return H(t)},setContext:function(o){"object"===q(o)?(t=W(o),e.updateCustomerData(t)):r.clearContext(),n.notify()},setContextProperty:function(r,o){t[r]=W(o),e.updateCustomerData(t),n.notify()},removeContextProperty:function(r){delete t[r],e.updateCustomerData(t),n.notify()},clearContext:function(){t={},e.resetCustomerData(),n.notify()},changeObservable:n};return r}!function(e){e.PAGEHIDE="pagehide",e.FEATURE_FLAGS="feature_flags",e.RESOURCE_PAGE_STATES="resource_page_states",e.COLLECT_FLUSH_REASON="collect_flush_reason",e.ZERO_LCP_TELEMETRY="zero_lcp_telemetry",e.DISABLE_REPLAY_INLINE_CSS="disable_replay_inline_css",e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.TRACKING_CONSENT="tracking_consent",e.CUSTOM_VITALS="custom_vitals"}(Z||(Z={}));var ee=new Set;function te(e){return ee.has(e)}function ne(){return ee}var re,oe={GRANTED:"granted",NOT_GRANTED:"not-granted"};function ie(e,t,n,r,o){return ae(e,t,[n],r,o)}function ae(e,t,n,r,o){var i=void 0===o?{}:o,a=i.once,s=i.capture,u=i.passive,c=l((function(t){(t.isTrusted||t.__ddIsTrusted||e.allowUntrustedEvents)&&(a&&p(),r(t))})),f=u?{capture:s,passive:u}:s,d=_(t,"addEventListener");function p(){var e=_(t,"removeEventListener");n.forEach((function(n){return e.call(t,n,c,f)}))}return n.forEach((function(e){return d.call(t,e,c,f)})),{stop:p}}!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.DBL_CLICK="dblclick",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.TOUCH_MOVE="touchmove",e.VISIBILITY_CHANGE="visibilitychange",e.PAGE_SHOW="pageshow",e.FREEZE="freeze",e.RESUME="resume",e.DOM_CONTENT_LOADED="DOMContentLoaded",e.POINTER_DOWN="pointerdown",e.POINTER_UP="pointerup",e.POINTER_CANCEL="pointercancel",e.HASH_CHANGE="hashchange",e.PAGE_HIDE="pagehide",e.MOUSE_DOWN="mousedown",e.MOUSE_UP="mouseup",e.MOUSE_MOVE="mousemove",e.FOCUS="focus",e.BLUR="blur",e.CONTEXT_MENU="contextmenu",e.RESIZE="resize",e.CHANGE="change",e.INPUT="input",e.PLAY="play",e.PAUSE="pause",e.SECURITY_POLICY_VIOLATION="securitypolicyviolation",e.SELECTION_CHANGE="selectionchange",e.STORAGE="storage"}(re||(re={}));var se="_dd_c",ue=[];function ce(e,t,n,r){var o=function(e,t){return"".concat(se,"_").concat(e,"_").concat(t)}(n,r);function i(){var e=localStorage.getItem(o);return null!==e?JSON.parse(e):{}}ue.push(ie(e,window,re.STORAGE,(function(e){var n=e.key;o===n&&t.setContext(i())}))),t.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(t.getContext()))})),t.setContext(F(i(),t.getContext()))}function fe(e){var t=m({},e);return["id","name","email"].forEach((function(e){e in t&&(t[e]=String(t[e]))})),t}function le(e,t){t.silentMultipleInit||o.error("".concat(e," is already initialized."))}var de="?";function pe(e){var t=[],n=Ce(e,"stack"),r=String(e);return n&&y(n,r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((function(e){var n=function(e){var t=he.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=ye.exec(t[2]);r&&o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]);return{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||de,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=me.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:de,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=be.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||de,line:+t[3],url:t[2]}}(e)||function(e){var t=Ee.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=Se.exec(t[3]);n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0);return{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||de,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=de),t.push(n))})),{message:Ce(e,"message"),name:Ce(e,"name"),stack:t}}var ve="((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",ge="(?::(\\d+))",he=new RegExp("^\\s*at (.*?) ?\\(".concat(ve).concat(ge,"?").concat(ge,"?\\)?\\s*$"),"i"),ye=new RegExp("\\((\\S*)".concat(ge).concat(ge,"\\)"));var me=new RegExp("^\\s*at ?".concat(ve).concat(ge,"?").concat(ge,"??\\s*$"),"i");var be=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var Ee=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,Se=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function Ce(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function we(e,t,n,r){var o=[{url:t,column:r,line:n}],i=function(e){var t,n,r;"[object String]"==={}.toString.call(e)&&(n=(t=_e.exec(e))[1],r=t[2]);return{name:n,message:r}}(e);return{name:i.name,message:i.message,stack:o}}var _e=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;var ke="No stack, consider using an instance of Error";function xe(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,i=e.nonErrorPrefix,a=e.source,s=e.handling,u=n instanceof Error,c=function(e,t,n,r){return(null==e?void 0:e.message)&&(null==e?void 0:e.name)?e.message:t?"Empty message":"".concat(n," ").concat(A(W(r)))}(t,u,i,n),f=function(e,t){if(void 0===t)return!1;if(e)return!0;return t.stack.length>0&&(t.stack.length>1||void 0!==t.stack[0].url)}(u,t)?Te(t):ke,l=u?Le(n,a):void 0;return{startClocks:o,source:a,handling:s,handlingStack:r,originalError:n,type:null==t?void 0:t.name,message:c,stack:f,causes:l,fingerprint:Oe(n)}}function Oe(e){return e instanceof Error&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function Te(e){var t=Re(e);return e.stack.forEach((function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"(".concat(e.args.join(", "),")"):"",o=e.line?":".concat(e.line):"",i=e.line&&e.column?":".concat(e.column):"";t+="\n at ".concat(n).concat(r," @ ").concat(e.url).concat(o).concat(i)})),t}function Re(e){return"".concat(e.name||"Error",": ").concat(e.message)}function Le(e,t){for(var n=e,r=[];(null==n?void 0:n.cause)instanceof Error&&r.length<10;){var o=pe(n.cause);r.push({message:n.cause.message,source:t,type:null==o?void 0:o.name,stack:o&&Te(o)}),n=n.cause}return r.length?r:void 0}var Ae,Ie={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"},Pe=1e3,Ne=60*Pe,De=60*Ne;function Be(){return(new Date).getTime()}function Ue(){return Be()}function Me(){return performance.now()}function Ge(){return{relative:Me(),timeStamp:Ue()}}function qe(e,t){return e+t}function je(e){return e-He()}function He(){return void 0===Ae&&(Ae=performance.timing.navigationStart),Ae}var Fe=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);return i>3&&a&&Object.defineProperty(t,n,a),a},Ve={debug:"debug",error:"error",info:"info",warn:"warn"},ze={console:"console",http:"http",silent:"silent"},Ye=Object.keys(Ve),We=function(){function e(e,t,n,r,o,i){void 0===r&&(r=ze.http),void 0===o&&(o=Ve.debug),void 0===i&&(i={}),this.handleLogStrategy=e,this.handlerType=r,this.level=o,this.contextManager=Q(t),this.contextManager.setContext(i),n&&this.contextManager.setContextProperty("logger",{name:n})}return e.prototype.log=function(e,t,n,r){var o;if(void 0===n&&(n=Ve.info),null!=r){var i=xe({stackTrace:r instanceof Error?pe(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:Ie.LOGGER,handling:"handled",startClocks:Ge()});o={stack:i.stack,kind:i.type,message:i.message,causes:i.causes}}var a=W(t),s=o?F({error:o},a):a;this.handleLogStrategy({message:W(e),context:s,status:n},this)},e.prototype.debug=function(e,t,n){this.log(e,t,Ve.debug,n)},e.prototype.info=function(e,t,n){this.log(e,t,Ve.info,n)},e.prototype.warn=function(e,t,n){this.log(e,t,Ve.warn,n)},e.prototype.error=function(e,t,n){this.log(e,t,Ve.error,n)},e.prototype.setContext=function(e){this.contextManager.setContext(e)},e.prototype.getContext=function(){return this.contextManager.getContext()},e.prototype.setContextProperty=function(e,t){this.contextManager.setContextProperty(e,t)},e.prototype.removeContextProperty=function(e){this.contextManager.removeContextProperty(e)},e.prototype.clearContext=function(){this.contextManager.clearContext()},e.prototype.setHandler=function(e){this.handlerType=e},e.prototype.getHandler=function(){return this.handlerType},e.prototype.setLevel=function(e){this.level=e},e.prototype.getLevel=function(){return this.level},Fe([f],e.prototype,"log",null),e}();function Je(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var Ke=function(){function e(){this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>500&&this.buffer.splice(0,1)},e.prototype.remove=function(e){Je(this.buffer,e)},e.prototype.drain=function(e){this.buffer.forEach((function(t){return t(e)})),this.buffer.length=0},e}();function Ze(){var e=b().DatadogEventBridge;if(e)return{getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n){e.send(JSON.stringify({eventType:t,event:n}))}}}function $e(e){var t;void 0===e&&(e=null===(t=b().location)||void 0===t?void 0:t.hostname);var n=Ze();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r}))}function Xe(e){return 0!==e&&100*Math.random()<=e}function Qe(e){return function(e){return"number"==typeof e}(e)&&e>=0&&e<=100}function et(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,et)}var tt=/([\w-]+)\s*=\s*([^;]+)/g;function nt(e,t,n){void 0===n&&(n="");var r=e.charCodeAt(t-1),o=r>=55296&&r<=56319?t+1:t;return e.length<=o?e:"".concat(e.slice(0,o)).concat(n)}var rt,ot,it,at=4*De,st=15*Ne;function ut(){return null!=rt?rt:rt=function(e){var t;void 0===e&&(e=window);var n=e.navigator.userAgent;if(e.chrome||/HeadlessChrome/.test(n))return 1;if(0===(null===(t=e.navigator.vendor)||void 0===t?void 0:t.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return 2;if(e.document.documentMode)return 0;return 3}()}function ct(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var i="expires=".concat(o.toUTCString()),a=r&&r.crossSite?"none":"strict",s=r&&r.domain?";domain=".concat(r.domain):"",u=r&&r.secure?";secure":"",c=r&&r.partitioned?";partitioned":"";document.cookie="".concat(e,"=").concat(t,";").concat(i,";path=/;samesite=").concat(a).concat(s).concat(u).concat(c)}function ft(e){return function(e,t){for(tt.lastIndex=0;;){var n=tt.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function lt(e){return ot||(ot=function(e){var t=new Map;for(tt.lastIndex=0;;){var n=tt.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),ot.get(e)}function dt(e,t){ct(e,"",0,t)}var pt="_dd_s",vt=/^([a-z]+)=([a-z0-9-]+)$/,gt="&";function ht(e){return N(e)}function yt(e){e.expire=String(Be()+st)}function mt(e){return(t=e,Object.keys(t).map((function(e){return[e,t[e]]}))).map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)})).join(gt);var t}function bt(e){var t={};return function(e){return!!e&&(-1!==e.indexOf(gt)||vt.test(e))}(e)&&e.split(gt).forEach((function(e){var n=vt.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}var Et="_dd",St="_dd_r",Ct="_dd_l",wt="rum",_t="logs";function kt(e){var t=function(e){var t={};t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===it){for(var e="dd_site_test_".concat(et()),t=window.location.hostname.split("."),n=t.pop();t.length&&!ft(e);)n="".concat(t.pop(),".").concat(n),ct(e,"test",Pe,{domain:n});dt(e,{domain:n}),it=n}return it}());return t}(e);return function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_".concat(et()),n="test";ct(t,n,Ne,e);var r=ft(t)===n;return dt(t,e),r}catch(e){return o.error(e),!1}}(t)?{type:"Cookie",cookieOptions:t}:void 0}function xt(e){var t,n={isLockEnabled:1===ut(),persistSession:(t=e,function(e){ct(pt,mt(e),st,t)}),retrieveSession:Ot,clearSession:Tt(e)};return function(e){if(!lt(pt)){var t=lt(Et),n=lt(St),r=lt(Ct),o={};t&&(o.id=t),r&&/^[01]$/.test(r)&&(o[_t]=r),n&&/^[012]$/.test(n)&&(o[wt]=n),ht(o)||(yt(o),e.persistSession(o))}}(n),n}function Ot(){return bt(ft(pt))}function Tt(e){return function(){dt(pt,e)}}var Rt="_dd_test_";function Lt(e){localStorage.setItem(pt,mt(e))}function At(){return bt(localStorage.getItem(pt))}function It(){localStorage.removeItem(pt)}var Pt,Nt=10,Dt=100,Bt=[];function Ut(e,t,n){var r;void 0===n&&(n=0);var o=t.isLockEnabled,i=t.retrieveSession,a=t.persistSession,s=t.clearSession;if(Pt||(Pt=e),e===Pt)if(o&&n>=Dt)Gt(t);else{var u,c=i();if(o){if(c.lock)return void Mt(e,t,n);if(u=et(),c.lock=u,a(c),(c=i()).lock!==u)return void Mt(e,t,n)}var f=e.process(c);if(o&&(c=i()).lock!==u)Mt(e,t,n);else{if(f&&(ht(f)?s():(yt(f),a(f))),o&&(!f||!ht(f))){if((c=i()).lock!==u)return void Mt(e,t,n);delete c.lock,a(c),f=c}null===(r=e.after)||void 0===r||r.call(e,f||c),Gt(t)}}else Bt.push(e)}function Mt(e,t,n){k((function(){Ut(e,t,n+1)}),Nt)}function Gt(e){Pt=void 0;var t=Bt.shift();t&&Ut(t,e)}var qt=Pe;function jt(e){var t=kt(e);return!t&&e.allowFallbackToLocalStorage&&(t=function(){try{var e=et(),t="".concat(Rt).concat(e);localStorage.setItem(t,e);var n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:"LocalStorage"}:void 0}catch(e){return}}()),t}function Ht(e,t,n){var r=new $,o=new $,i="Cookie"===e.type?xt(e.cookieOptions):{isLockEnabled:!1,persistSession:Lt,retrieveSession:At,clearSession:It},a=i.clearSession,s=i.retrieveSession,u=O((function(){Ut({process:function(e){return d(e)?void 0:{}},after:f},i)}),qt),c=function(){var e=s();if(d(e))return e;return{}}();function f(e){return d(e)||(e={}),l()&&(!function(e){return c.id!==e.id||c[t]!==e[t]}(e)?c=e:(c={},o.notify())),e}function l(){return void 0!==c[t]}function d(e){return(void 0===e.created||Be()-Number(e.created)<at)&&(void 0===e.expire||Be()<Number(e.expire))}return{expandOrRenewSession:R((function(){var e;Ut({process:function(r){var o=f(r);return e=function(e){var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,i&&!e.id&&(e.id=et(),e.created=String(Be()));return i}(o),o},after:function(t){e&&!l()&&function(e){c=e,r.notify()}(t),c=t}},i)}),qt).throttled,expandSession:function(){Ut({process:function(e){return l()?f(e):void 0}},i)},getSession:function(){return c},renewObservable:r,expireObservable:o,expire:function(){a(),f({})},stop:function(){T(u)}}}function Ft(e){return Vt(e,location.href).href}function Vt(e,t){var n=function(){if(void 0===zt)try{var e=new Yt("http://test/path");zt="http://test/path"===e.href}catch(e){zt=!1}return zt?Yt:void 0}();if(n)try{return void 0!==t?new n(e,t):new n(e)}catch(n){throw new Error("Failed to construct URL: ".concat(String(n)," ").concat(A({url:e,base:t})))}if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: '".concat(e,"'"));var r=document,o=r.createElement("a");if(void 0!==t){var i=(r=document.implementation.createHTMLDocument("")).createElement("base");i.href=t,r.head.appendChild(i),r.body.appendChild(o)}return o.href=e,o}var zt,Yt=URL;var Wt="datad0g.com",Jt="dd0g-gov.com",Kt="datadoghq.com";function Zt(e,t,n){var r=function(e,t){var n="/api/v2/".concat(t),r=e.proxy;if("string"==typeof r){var o=Ft(r);return function(e){return"".concat(o,"?ddforward=").concat(encodeURIComponent("".concat(n,"?").concat(e)))}}if("function"==typeof r)return function(e){return r({path:n,parameters:e})};var i=function(e){var t=e.site,n=void 0===t?Kt:t,r=e.internalAnalyticsSubdomain;if(r&&n===Kt)return"".concat(r,".").concat(Kt);if(n===Jt)return"http-intake.logs.".concat(n);var o=n.split("."),i=o.pop();return"browser-intake-".concat(o.join("-"),".").concat(i)}(e);return function(e){return"https://".concat(i).concat(n,"?").concat(e)}}(e,t);return{build:function(o,i){var a=function(e,t,n,r,o){var i=e.clientToken,a=e.internalAnalyticsSubdomain,s=o.retry,u=o.flushReason,c=o.encoding,f=["sdk_version:".concat("5.10.0"),"api:".concat(r)].concat(n);u&&te(Z.COLLECT_FLUSH_REASON)&&f.push("flush_reason:".concat(u));s&&f.push("retry_count:".concat(s.count),"retry_after:".concat(s.lastFailureStatus));var l=["ddsource=browser","ddtags=".concat(encodeURIComponent(f.join(","))),"dd-api-key=".concat(i),"dd-evp-origin-version=".concat(encodeURIComponent("5.10.0")),"dd-evp-origin=browser","dd-request-id=".concat(et())];c&&l.push("dd-evp-encoding=".concat(c));"rum"===t&&l.push("batch_time=".concat(Ue()));a&&l.reverse();return l.join("&")}(e,t,n,o,i);return r(a)},urlPrefix:r(""),trackType:t}}var $t=200;var Xt=/[^a-z0-9_:./-]/;function Qt(e,t){var n=$t-e.length-1;(t.length>n||Xt.test(t))&&o.warn("".concat(e," value doesn't meet tag requirements and will be sanitized"));var r=t.replace(/,/g,"_");return"".concat(e,":").concat(r)}function en(e){var t=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(Qt("env",t)),n&&i.push(Qt("service",n)),r&&i.push(Qt("version",r)),o&&i.push(Qt("datacenter",o)),i}(e),n=function(e,t){return{logsEndpointBuilder:Zt(e,"logs",t),rumEndpointBuilder:Zt(e,"rum",t),sessionReplayEndpointBuilder:Zt(e,"replay",t)}}(e,t),r=h(n).map((function(e){return e.urlPrefix})),o=function(e,t,n){if(!e.replica)return;var r=m({},e,{site:Kt,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:Zt(r,"logs",n),rumEndpointBuilder:Zt(r,"rum",n)};return t.push.apply(t,h(o).map((function(e){return e.urlPrefix}))),m({applicationId:e.replica.applicationId},o)}(e,r,t);return m({isIntakeUrl:function(e){return r.some((function(t){return 0===e.indexOf(t)}))},replica:o,site:e.site||Kt},n)}function tn(e){var t,n,r,a;if(e&&e.clientToken)if(void 0===e.sessionSampleRate||Qe(e.sessionSampleRate))if(void 0===e.telemetrySampleRate||Qe(e.telemetrySampleRate))if(void 0===e.telemetryConfigurationSampleRate||Qe(e.telemetryConfigurationSampleRate)){if(void 0===e.trackingConsent||P(oe,e.trackingConsent))return Array.isArray(e.enableExperimentalFeatures)&&e.enableExperimentalFeatures.filter((function(e){return P(Z,e)})).forEach((function(e){ee.add(e)})),m({beforeSend:e.beforeSend&&i(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:jt(e),sessionSampleRate:null!==(t=e.sessionSampleRate)&&void 0!==t?t:100,telemetrySampleRate:null!==(n=e.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=e.telemetryConfigurationSampleRate)&&void 0!==r?r:5,service:e.service,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:null!==(a=e.trackingConsent)&&void 0!==a?a:oe.GRANTED,batchBytesLimit:16*E,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*Pe,batchMessagesLimit:50,messageBytesLimit:256*E},en(e));o.error('Tracking Consent should be either "granted" or "not-granted"')}else o.error("Telemetry Configuration Sample Rate should be a number between 0 and 100");else o.error("Telemetry Sample Rate should be a number between 0 and 100");else o.error("Session Sample Rate should be a number between 0 and 100");else o.error("Client Token is not configured, we will not send any data.")}var nn={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function rn(e,t){var n=[];v(t,nn.cspViolation)&&n.push(function(e){return new $((function(t){return ie(e,document,re.SECURITY_POLICY_VIOLATION,(function(e){t.notify(function(e){var t=nn.cspViolation,n="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return{type:nn.cspViolation,subtype:e.effectiveDirective,message:"".concat(t,": ").concat(n),stack:on(e.effectiveDirective,e.originalPolicy?"".concat(n,' of the policy "').concat(nt(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber),originalReport:e}}(e))})).stop}))}(e));var r=t.filter((function(e){return e!==nn.cspViolation}));return r.length&&n.push(function(e){return new $((function(t){if(window.ReportingObserver){var n=l((function(e,n){return e.forEach((function(e){t.notify(function(e){var t=e.type,n=e.body;return{type:t,subtype:n.id,message:"".concat(t,": ").concat(n.message),originalReport:e,stack:on(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)}}(e))}))})),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),function(){r.disconnect()}}}))}(r)),X.apply(void 0,n)}function on(e,t,n,r,o){return n?Te({name:e,message:t,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}var an=32*E;function sn(e,t,n){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((function(e){return v(t,e)}))?"all"===e?t:(r=e,i=new Set,r.forEach((function(e){return i.add(e)})),g(i)):void o.error("".concat(n,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'));var r,i}function un(t,n,r){var i,a,s=new Ke,u=n.observable.subscribe(c);function c(){if(a&&i&&n.isGranted()){u.unsubscribe();var e=r(i,a);s.drain(e)}}return{init:function(t){if(t)if($e()&&(t=function(e){return m({},e,{clientToken:"empty"})}(t)),i=t,a)le("DD_LOGS",t);else{var r=function(t){var n=tn(t),r=sn(t.forwardConsoleLogs,h(e),"Forward Console Logs"),o=sn(t.forwardReports,h(nn),"Forward Reports");if(n&&r&&o)return t.forwardErrorsToLogs&&!v(r,e.error)&&r.push(e.error),m({forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:o,requestErrorResponseLengthLimit:an},n)}(t);r&&(a=r,n.tryToInit(r.trackingConsent),c())}else o.error("Missing configuration")},get initConfiguration(){return i},getInternalContext:L,handleLog:function(e,n,r,o){void 0===r&&(r=t()),void 0===o&&(o=Ue()),s.add((function(t){return t.handleLog(e,n,r,o)}))}}}var cn="logs";function fn(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}var ln={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};var dn="datadog-synthetics-public-id",pn="datadog-synthetics-result-id",vn="datadog-synthetics-injects-rum";function gn(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||lt(vn))}function hn(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||lt(pn);return"string"==typeof e?e:void 0}var yn=1/0,mn=Ne,bn=function(){function e(e,t){var n=this;this.expireDelay=e,this.maxEntries=t,this.entries=[],this.clearOldValuesInterval=O((function(){return n.clearOldValues()}),mn)}return e.prototype.add=function(e,t){var n=this,r={value:e,startTime:t,endTime:yn,remove:function(){Je(n.entries,r)},close:function(e){r.endTime=e}};return this.maxEntries&&this.entries.length>=this.maxEntries&&this.entries.pop(),this.entries.unshift(r),r},e.prototype.find=function(e){void 0===e&&(e=yn);for(var t=0,n=this.entries;t<n.length;t++){var r=n[t];if(r.startTime<=e){if(e<=r.endTime)return r.value;break}}},e.prototype.closeActive=function(e){var t=this.entries[0];t&&t.endTime===yn&&t.close(e)},e.prototype.findAll=function(e,t){void 0===e&&(e=yn),void 0===t&&(t=0);var n=qe(e,t);return this.entries.filter((function(t){return t.startTime<=n&&e<=t.endTime})).map((function(e){return e.value}))},e.prototype.reset=function(){this.entries=[]},e.prototype.stop=function(){T(this.clearOldValuesInterval)},e.prototype.clearOldValues=function(){for(var e=Me()-this.expireDelay;this.entries.length>0&&this.entries[this.entries.length-1].endTime<e;)this.entries.pop()},e}(),En=Ne,Sn=at,Cn=[];function wn(e,t,n,r){var o=new $,i=new $,a=Ht(e.sessionStoreStrategyType,t,n);Cn.push((function(){return a.stop()}));var s=new bn(Sn);function u(){return{id:a.getSession().id,trackingType:a.getSession()[t]}}return Cn.push((function(){return s.stop()})),a.renewObservable.subscribe((function(){s.add(u(),Me()),o.notify()})),a.expireObservable.subscribe((function(){i.notify(),s.closeActive(Me())})),a.expandOrRenewSession(),s.add(u(),[0,He()][0]),r.observable.subscribe((function(){r.isGranted()?a.expandOrRenewSession():a.expire()})),function(e,t){var n=ae(e,window,[re.CLICK,re.TOUCH_START,re.KEY_DOWN,re.SCROLL],t,{capture:!0,passive:!0}).stop;Cn.push(n)}(e,(function(){r.isGranted()&&a.expandOrRenewSession()})),function(e,t){var n=function(){"visible"===document.visibilityState&&t()},r=ie(e,document,re.VISIBILITY_CHANGE,n).stop;Cn.push(r);var o=O(n,En);Cn.push((function(){T(o)}))}(e,(function(){return a.expandSession()})),{findActiveSession:function(e){return s.find(e)},renewObservable:o,expireObservable:i,expire:a.expire}}var _n="logs";function kn(e,t){var n=wn(e,_n,(function(t){return function(e,t){var n=function(e){return"0"===e||"1"===e}(t)?t:xn(e);return{trackingType:n,isTracked:"1"===n}}(e,t)}),t);return{findTrackedSession:function(e){var t=n.findActiveSession(e);return t&&"1"===t.trackingType?{id:t.id}:void 0},expireObservable:n.expireObservable}}function xn(e){return Xe(e.sessionSampleRate)?"1":"0"}function On(){var e,t=window.navigator;return{status:t.onLine?"connected":"not_connected",interfaces:t.connection&&t.connection.type?[t.connection.type]:void 0,effective_type:null===(e=t.connection)||void 0===e?void 0:e.effectiveType}}var Tn,Rn={log:"log",configuration:"configuration"},Ln=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],An=["ddog-gov.com"],In={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1,telemetryConfigurationEnabled:!1};function Pn(e,t){var n,r=new $;In.telemetryEnabled=!v(An,t.site)&&Xe(t.telemetrySampleRate),In.telemetryConfigurationEnabled=In.telemetryEnabled&&Xe(t.telemetryConfigurationSampleRate);var o={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return Tn=function(t){if(In.telemetryEnabled){var i=function(e,t,r){return F({type:"telemetry",date:Ue(),service:e,version:"5.10.0",source:"browser",_dd:{format_version:2},telemetry:F(t,{runtime_env:r,connectivity:On()}),experimental_features:g(ne())},void 0!==n?n():{})}(e,t,o);r.notify(i),fn("telemetry",i)}},a=Dn,m(In,{maxEventsPerPage:t.maxTelemetryEventsPerPage,sentEventCount:0}),{setContextProvider:function(e){n=e},observable:r,enabled:In.telemetryEnabled}}function Nn(t,n){p(e.debug,t,n),Bn(m({type:Rn.log,message:t,status:"debug"},n))}function Dn(e,t){Bn(m({type:Rn.log,status:"error"},function(e){if(e instanceof Error){var t=pe(e);return{error:{kind:t.name,stack:Te(Un(t))},message:t.message}}return{error:{stack:ke},message:"".concat("Uncaught"," ").concat(A(e))}}(e),t))}function Bn(e){Tn&&In.sentEventCount<In.maxEventsPerPage&&(In.sentEventCount+=1,Tn(e))}function Un(e){return e.stack=e.stack.filter((function(e){return!e.url||Ln.some((function(t){return y(e.url,t)}))})),e}var Mn=!1;function Gn(e){var t,n=window;if(gn()){var r=o(n.DD_RUM_SYNTHETICS);return r||Mn||(Mn=!0,Nn("Logs sent before RUM is injected by the synthetics worker",{testId:(t=window._DATADOG_SYNTHETICS_PUBLIC_ID||lt(dn),"string"==typeof t?t:void 0),resultId:hn()})),r}return o(n.DD_RUM);function o(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}}function qn(e,t,n,r,o){var i=Ye.concat(["custom"]),a={};i.forEach((function(e){var n,r,i,s,u;a[e]=(n=e,r=t.eventRateLimiterThreshold,i=o,s=0,u=!1,{isLimitReached:function(){if(0===s&&k((function(){s=0}),Ne),(s+=1)<=r||u)return u=!1,!1;if(s===r+1){u=!0;try{i({message:"Reached max number of ".concat(n,"s by minute: ").concat(r),source:Ie.AGENT,startClocks:Ge()})}finally{u=!1}}return!0}})})),n.subscribe(0,(function(o){var i,s,u=o.rawLogsEvent,c=o.messageContext,f=void 0===c?void 0:c,l=o.savedCommonContext,d=void 0===l?void 0:l,p=je(u.date),v=e.findTrackedSession(p);if(v){var g=d||r(),h=F({service:t.service,session_id:v.id,usr:N(g.user)?void 0:g.user,view:g.view},g.context,Gn(p),u,f);!1===(null===(i=t.beforeSend)||void 0===i?void 0:i.call(t,h))||h.origin!==Ie.AGENT&&(null!==(s=a[h.status])&&void 0!==s?s:a.custom).isLimitReached()||n.notify(1,h)}}))}var jn,Hn={};function Fn(n){var r=n.map((function(n){return Hn[n]||(Hn[n]=function(n){return new $((function(r){var o=t[n];return t[n]=function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];o.apply(console,t);var a=function(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return d((function(){var n=pe(t);n.stack=n.stack.slice(2),e=Te(n)})),e}();d((function(){r.notify(function(t,n,r){var o,i,a,s=t.map((function(e){return function(e){if("string"==typeof e)return W(e);if(e instanceof Error)return Re(pe(e));return A(W(e),void 0,2)}(e)})).join(" ");if(n===e.error){var u=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n))return r}}(t,(function(e){return e instanceof Error}));o=u?Te(pe(u)):void 0,i=Oe(u),a=u?Le(u,"console"):void 0}return{api:n,message:s,stack:o,handlingStack:r,fingerprint:i,causes:a}}(t,n,a))}))},function(){t[n]=o}}))}(n)),Hn[n]}));return X.apply(void 0,r)}var Vn,zn=((jn={})[e.log]=Ve.info,jn[e.debug]=Ve.debug,jn[e.info]=Ve.info,jn[e.warn]=Ve.warn,jn[e.error]=Ve.error,jn);var Yn,Wn=((Vn={})[nn.cspViolation]=Ve.error,Vn[nn.intervention]=Ve.error,Vn[nn.deprecation]=Ve.warn,Vn);function Jn(e,t,n){var r=e[t],o=function(e,t){return function(){var n,r,o=arguments;return d(t,null,[{target:this,parameters:o,onPostCall:function(e){r=e}}]),"function"==typeof e&&(n=e.apply(this,o)),r&&d(r,null,[n]),n}}(r,n),i=function(){if("function"==typeof o)return o.apply(this,arguments)};return e[t]=i,{stop:function(){e[t]===i?e[t]=r:o=r}}}var Kn,Zn=new WeakMap;function $n(e){return Yn||(Yn=function(e){return new $((function(t){var n=Jn(XMLHttpRequest.prototype,"open",Xn).stop,r=Jn(XMLHttpRequest.prototype,"send",(function(n){!function(e,t,n){var r=e.target,o=Zn.get(r);if(!o)return;var i=o;i.state="start",i.startClocks=Ge(),i.isAborted=!1,i.xhr=r;var a=!1,s=Jn(r,"onreadystatechange",(function(){r.readyState===XMLHttpRequest.DONE&&u()})).stop,u=function(){if(c(),s(),!a){a=!0;var e,t=o;t.state="complete",t.duration=(e=i.startClocks.timeStamp,Ue()-e),t.status=r.status,n.notify(m({},t))}},c=ie(t,r,"loadend",u).stop;n.notify(i)}(n,e,t)})).stop,o=Jn(XMLHttpRequest.prototype,"abort",Qn).stop;return function(){n(),r(),o()}}))}(e)),Yn}function Xn(e){var t=e.target,n=e.parameters,r=n[0],o=n[1];Zn.set(t,{state:"open",method:String(r).toUpperCase(),url:Ft(String(o))})}function Qn(e){var t=e.target,n=Zn.get(t);n&&(n.isAborted=!0)}function er(){return Kn||(Kn=new $((function(e){if(window.fetch){var t=Jn(window,"fetch",(function(t){return function(e,t){var n=e.parameters,r=e.onPostCall,o=n[0],i=n[1],a=i&&i.method;void 0===a&&o instanceof Request&&(a=o.method);var s=void 0!==a?String(a).toUpperCase():"GET",u=o instanceof Request?o.url:Ft(String(o)),c=Ge(),f={state:"start",init:i,input:o,method:s,startClocks:c,url:u};t.notify(f),n[0]=f.input,n[1]=f.init,r((function(e){return function(e,t,n){var r=function(t){var r=n;r.state="resolve","stack"in t||t instanceof Error?(r.status=0,r.isAborted=t instanceof DOMException&&t.code===DOMException.ABORT_ERR,r.error=t):"status"in t&&(r.response=t,r.responseType=t.type,r.status=t.status,r.isAborted=!1),e.notify(r)};t.then(l(r),l(r))}(t,e,f)}))}(t,e)})).stop;return t}}))),Kn}function tr(e){return e>=500}function nr(e,t){if(!e.forwardErrorsToLogs)return{stop:L};var n=$n(e).subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=er().subscribe((function(e){"resolve"===e.state&&o("fetch",e)}));function o(n,r){function o(e){t.notify(0,{rawLogsEvent:{message:"".concat(or(n)," error ").concat(r.method," ").concat(r.url),date:r.startClocks.timeStamp,error:{stack:e||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url},status:Ve.error,origin:Ie.NETWORK}})}e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!tr(r.status)||("xhr"in r?function(e,t,n){"string"==typeof e.response?n(rr(e.response,t)):n(e.response)}(r.xhr,e,o):r.response?function(e,t,n){var r=function(e){try{return e.clone()}catch(e){return}}(e);r&&r.body?window.TextDecoder?function(e,t,n){!function(e,t,n){var r=e.getReader(),o=[],i=0;function a(){var e,a;if(r.cancel().catch(L),n.collectStreamBody){var s;if(1===o.length)s=o[0];else{s=new Uint8Array(i);var u=0;o.forEach((function(e){s.set(e,u),u+=e.length}))}e=s.slice(0,n.bytesLimit),a=s.length>n.bytesLimit}t(void 0,e,a)}!function e(){r.read().then(l((function(t){t.done?a():(n.collectStreamBody&&o.push(t.value),(i+=t.value.length)>n.bytesLimit?a():e())})),l((function(e){return t(e)})))}()}(e,(function(e,t,r){if(e)n(e);else{var o=(new TextDecoder).decode(t);r&&(o+="..."),n(void 0,o)}}),{bytesLimit:t,collectStreamBody:!0})}(r.body,t.requestErrorResponseLengthLimit,(function(e,t){n(e?"Unable to retrieve response: ".concat(e):t)})):r.text().then(l((function(e){return n(rr(e,t))})),l((function(e){return n("Unable to retrieve response: ".concat(e))}))):n()}(r.response,e,o):r.error&&function(e,t,n){n(rr(Te(pe(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function rr(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function or(e){return"xhr"===e?"XHR":"Fetch"}function ir(e){var t,n=function(t,n){var r=xe({stackTrace:t,originalError:n,startClocks:Ge(),nonErrorPrefix:"Uncaught",source:Ie.SOURCE,handling:"unhandled"});e.notify(r)},r=(t=n,Jn(window,"onerror",(function(e){var n,r=e.parameters,o=r[0],i=r[1],a=r[2],s=r[3],u=r[4];n=u instanceof Error?pe(u):we(o,i,a,s),t(n,null!=u?u:o)}))).stop,o=function(e){return Jn(window,"onunhandledrejection",(function(t){var n=t.parameters[0].reason||"Empty reason",r=pe(n);e(r,n)}))}(n).stop;return{stop:function(){r(),o()}}}var ar,sr=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}(),ur=((ar={})[Ve.debug]=0,ar[Ve.info]=1,ar[Ve.warn]=2,ar[Ve.error]=3,ar);function cr(e){return{handleLog:function(r,o,i,a){var s=F(o.getContext(),r.context);fr(r.status,ze.console,o)&&function(e,r){n[e.status].call(t,e.message,r)}(r,s),fr(r.status,ze.http,o)&&e.notify(0,{rawLogsEvent:{date:a||Ue(),message:r.message,status:r.status,origin:Ie.LOGGER},messageContext:s,savedCommonContext:i})}}}function fr(e,t,n){var r=n.getHandler(),o=Array.isArray(r)?r:[r];return ur[e]>=ur[n.getLevel()]&&v(o,t)}var lr=function(){function e(e,t,n,r){var o=this;this.encoder=e,this.request=t,this.flushController=n,this.messageBytesLimit=r,this.upsertBuffer={},this.flushSubscription=this.flushController.flushObservable.subscribe((function(e){return o.flush(e)}))}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.stop=function(){this.flushSubscription.unsubscribe()},e.prototype.flush=function(e){var t=h(this.upsertBuffer).join("\n");this.upsertBuffer={};var n,r=(n=e.reason,v(h(ln),n)),o=r?this.request.sendOnExit:this.request.send;if(r&&this.encoder.isAsync){var i=this.encoder.finishSync();i.outputBytesCount&&o(dr(i,e));var a=[i.pendingData,t].filter(Boolean).join("\n");a&&o({data:a,bytesCount:w(a),flushReason:e.reason})}else t&&this.encoder.write(this.encoder.isEmpty?t:"\n".concat(t)),this.encoder.finish((function(t){o(dr(t,e))}))},e.prototype.addOrUpdate=function(e,t){var n=A(e),r=this.encoder.estimateEncodedBytesCount(n);r>=this.messageBytesLimit?o.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit,"KB.")):(this.hasMessageFor(t)&&this.remove(t),this.push(n,r,t))},e.prototype.push=function(e,t,n){var r=this;this.flushController.notifyBeforeAddMessage(t),void 0!==n?(this.upsertBuffer[n]=e,this.flushController.notifyAfterAddMessage()):this.encoder.write(this.encoder.isEmpty?e:"\n".concat(e),(function(e){r.flushController.notifyAfterAddMessage(e-t)}))},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.encoder.estimateEncodedBytesCount(t);this.flushController.notifyAfterRemoveMessage(n)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e}();function dr(e,t){return{data:"string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),bytesCount:e.outputBytesCount,encoding:e.encoding,flushReason:t.reason}}var pr=80*E,vr=32,gr=3*S,hr=Ne,yr=Pe;function mr(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?Er(e,t,n,{onSuccess:function(){return Sr(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),br(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function br(e,t,n,r){2===e.transportStatus&&k((function(){Er(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=yr,Sr(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(hr,2*e.currentBackoffTime),br(e,t,n,r)}})}),e.currentBackoffTime)}function Er(e,t,n,r){var o=r.onSuccess,i=r.onFailure;t.bandwidthMonitor.add(e),n(e,(function(n){t.bandwidthMonitor.remove(e),!function(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||tr(e.status))}(n)?(t.transportStatus=0,o()):(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:n.status},i())}))}function Sr(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(gr/S,"MiB"),source:Ie.AGENT,startClocks:Ge()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=Cr();i.size()>0;)mr(i.dequeue(),t,n,r,o)}function Cr(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=gr}}}function wr(e,t,n,r){var o={transportStatus:0,currentBackoffTime:yr,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=pr&&this.ongoingRequestCount<vr},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:Cr(),queueFullReported:!1},i=function(r,o){return function(e,t,n,r,o){var i=function(){try{return window.Request&&"keepalive"in new Request("http://a")}catch(e){return!1}}()&&r.bytesCount<n;if(i){var a=t.build("fetch",r);fetch(a,{method:"POST",body:r.data,keepalive:!0,mode:"cors"}).then(l((function(e){return null==o?void 0:o({status:e.status,type:e.type})})),l((function(){var n=t.build("xhr",r);kr(e,n,r.data,o)})))}else{var s=t.build("xhr",r);kr(e,s,r.data,o)}}(e,t,n,r,o)};return{send:function(e){mr(e,o,i,t.trackType,r)},sendOnExit:function(r){!function(e,t,n,r){var o=!!navigator.sendBeacon&&r.bytesCount<n;if(o)try{var i=t.build("beacon",r);if(navigator.sendBeacon(i,r.data))return}catch(e){!function(e){_r||(_r=!0,Dn(e))}(e)}var a=t.build("xhr",r);kr(e,a,r.data)}(e,t,n,r)}}}var _r=!1;function kr(e,t,n,r){var o=new XMLHttpRequest;o.open("POST",t,!0),n instanceof Blob&&o.setRequestHeader("Content-Type",n.type),ie(e,o,"loadend",(function(){null==r||r({status:o.status})}),{once:!0}),o.send(n)}function xr(e){var t,n=e.messagesLimit,r=e.bytesLimit,o=e.durationLimit,i=e.pageExitObservable,a=e.sessionExpireObservable,s=i.subscribe((function(e){return d(e.reason)})),u=a.subscribe((function(){return d("session_expire")})),c=new $((function(){return function(){s.unsubscribe(),u.unsubscribe()}})),f=0,l=0;function d(e){if(0!==l){var t=l,n=f;l=0,f=0,p(),c.notify({reason:e,messagesCount:t,bytesCount:n})}}function p(){x(t),t=void 0}return{flushObservable:c,get messagesCount(){return l},notifyBeforeAddMessage:function(e){f+e>=r&&d("bytes_limit"),l+=1,f+=e,void 0===t&&(t=k((function(){d("duration_limit")}),o))},notifyAfterAddMessage:function(e){void 0===e&&(e=0),f+=e,l>=n?d("messages_limit"):f>=r&&d("bytes_limit")},notifyAfterRemoveMessage:function(e){f-=e,0===(l-=1)&&p()}}}function Or(e,t,n,r,o,i){var a=u(e,t),s=n&&u(e,n);function u(e,t){var n=t.endpoint,a=t.encoder;return new lr(a,wr(e,n,e.batchBytesLimit,r),xr({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageExitObservable:o,sessionExpireObservable:i}),e.messageBytesLimit)}return{flushObservable:a.flushController.flushObservable,add:function(e,t){void 0===t&&(t=!0),a.add(e),s&&t&&s.add(n.transformMessage?n.transformMessage(e):e)},upsert:function(e,t){a.upsert(e,t),s&&s.upsert(n.transformMessage?n.transformMessage(e):e,t)},stop:function(){a.stop(),null==s||s.stop()}}}function Tr(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(n,r){var o=w(n);t+=o,e+=n,r&&r(o)},finish:function(e){e(this.finishSync())},finishSync:function(){var n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount:function(e){return e.length}}}function Rr(e,t,n,r,o){var i=Pn("browser-logs-sdk",t);i.setContextProvider((function(){var e,t,n,r,i,a;return{application:{id:null===(e=Gn())||void 0===e?void 0:e.application_id},session:{id:null===(t=o.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(r=null===(n=Gn())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(a=null===(i=Gn())||void 0===i?void 0:i.user_action)||void 0===a?void 0:a.id}}}));var a=[];if($e()){var s=Ze(),u=i.observable.subscribe((function(e){return s.send("internal_telemetry",e)}));a.push((function(){return u.unsubscribe()}))}else{var c=Or(t,{endpoint:t.rumEndpointBuilder,encoder:Tr()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:Tr()},n,r,o.expireObservable);a.push((function(){return c.stop()}));var f=i.observable.subscribe((function(e){return c.add(e,function(e){return e.site===Wt}(t))}));a.push((function(){return f.unsubscribe()}))}return function(e){In.telemetryConfigurationEnabled&&Bn({type:Rn.configuration,configuration:e})}(function(e){var t,n={session_sample_rate:(t=e).sessionSampleRate,telemetry_sample_rate:t.telemetrySampleRate,telemetry_configuration_sample_rate:t.telemetryConfigurationSampleRate,use_before_send:!!t.beforeSend,use_cross_site_session_cookie:t.useCrossSiteSessionCookie,use_partitioned_cross_site_session_cookie:t.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:t.useSecureSessionCookie,use_proxy:!!t.proxy,silent_multiple_init:t.silentMultipleInit,track_session_across_subdomains:t.trackSessionAcrossSubdomains,allow_fallback_to_local_storage:!!t.allowFallbackToLocalStorage,store_contexts_across_pages:!!t.storeContextsAcrossPages,allow_untrusted_events:!!t.allowUntrustedEvents};return m({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports},n)}(e)),{telemetry:i,stop:function(){a.forEach((function(e){return e()}))}}}var Lr,Ar,Ir,Pr,Nr=function(e){var t,n,r=M(),i=Q(r.getOrCreateTracker(2)),a=Q(r.getOrCreateTracker(1)),s={tryToInit:function(e){t||(t=e)},update:function(e){t=e,n.notify()},isGranted:function(){return!te(Z.TRACKING_CONSENT)||t===oe.GRANTED},observable:n=new $};function u(){return function(e,t){return{view:{referrer:document.referrer,url:window.location.href},context:e.getContext(),user:t.getContext()}}(i,a)}var f,d,p=un(u,s,(function(t,n){t.storeContextsAcrossPages&&(ce(n,i,cn,2),ce(n,a,cn,1));var r=e(t,n,u,s);return p=function(e,t){return m({init:function(e){le("DD_LOGS",e)},initConfiguration:e},t)}(t,r),r})),v={},g=new We((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p.handleLog.apply(p,e)}),r.createDetachedTracker());return f={logger:g,init:l((function(e){return p.init(e)})),setTrackingConsent:l((function(e){return s.update(e)})),getGlobalContext:l((function(){return i.getContext()})),setGlobalContext:l((function(e){return i.setContext(e)})),setGlobalContextProperty:l((function(e,t){return i.setContextProperty(e,t)})),removeGlobalContextProperty:l((function(e){return i.removeContextProperty(e)})),clearGlobalContext:l((function(){return i.clearContext()})),createLogger:l((function(e,t){return void 0===t&&(t={}),v[e]=new We((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p.handleLog.apply(p,e)}),r.createDetachedTracker(),W(e),t.handler,t.level,W(t.context)),v[e]})),getLogger:l((function(e){return v[e]})),getInitConfiguration:l((function(){return H(p.initConfiguration)})),getInternalContext:l((function(e){return p.getInternalContext(e)})),setUser:l((function(e){(function(e){var t="object"===q(e);return t||o.error("Unsupported user:",e),t})(e)&&a.setContext(fe(e))})),getUser:l((function(){return a.getContext()})),setUserProperty:l((function(e,t){var n,r=fe((n={},n[e]=t,n))[e];a.setContextProperty(e,r)})),removeUserProperty:l((function(e){return a.removeContextProperty(e)})),clearUser:l((function(){return a.clearContext()}))},d=m({version:"5.10.0",onReady:function(e){e()}},f),Object.defineProperty(d,"_setDebug",{get:function(){return c},enumerable:!1}),d}((function(t,n,r,o){var i=new sr,a=[];i.subscribe(1,(function(e){return fn("logs",e)}));var s=function(e){return function(t){e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,origin:Ie.AGENT,status:Ve.error}}),Nn("Error reported to customer",{"error.message":t.message})}}(i),u=function(e){return new $((function(t){var n=te(Z.PAGEHIDE),r=ae(e,window,[re.VISIBILITY_CHANGE,re.FREEZE,re.PAGE_HIDE],(function(e){e.type===re.PAGE_HIDE&&n?t.notify({reason:ln.PAGEHIDE}):e.type===re.VISIBILITY_CHANGE&&"hidden"===document.visibilityState?t.notify({reason:ln.HIDDEN}):e.type===re.FREEZE&&t.notify({reason:ln.FROZEN})}),{capture:!0}).stop,o=L;return n||(o=ie(e,window,re.BEFORE_UNLOAD,(function(){t.notify({reason:ln.UNLOADING})})).stop),function(){r(),o()}}))}(n),c=!n.sessionStoreStrategyType||$e()||gn()?function(e){var t="1"===xn(e)?{}:void 0;return{findTrackedSession:function(){return t},expireObservable:new $}}(n):kn(n,o),f=Rr(t,n,s,u,c).stop;a.push((function(){return f()})),nr(n,i),function(e,t){if(!e.forwardErrorsToLogs)return{stop:L};var n=new $,r=ir(n).stop,o=n.subscribe((function(e){t.notify(0,{rawLogsEvent:{message:e.message,date:e.startClocks.timeStamp,error:{kind:e.type,stack:e.stack,causes:e.causes},origin:Ie.SOURCE,status:Ve.error}})}))}(n,i),function(t,n){var r=Fn(t.forwardConsoleLogs).subscribe((function(t){n.notify(0,{rawLogsEvent:{date:Ue(),message:t.message,origin:Ie.CONSOLE,error:t.api===e.error?{stack:t.stack,fingerprint:t.fingerprint,causes:t.causes}:void 0,status:zn[t.api]}})}))}(n,i),function(e,t){var n=rn(e,e.forwardReports).subscribe((function(e){var n,r=e.message,o=Wn[e.type];o===Ve.error?n={kind:e.subtype,stack:e.stack}:e.stack&&(r+=" Found in ".concat(function(e){var t;return null===(t=/@ (.+)/.exec(e))||void 0===t?void 0:t[1]}(e.stack))),t.notify(0,{rawLogsEvent:{date:Ue(),message:r,origin:Ie.REPORT,error:n,status:o}})}))}(n,i);var l,d=cr(i).handleLog;if(qn(c,n,i,r,s),$e())!function(e){var t=Ze();e.subscribe(1,(function(e){t.send("log",e)}))}(i);else{var p=function(e,t,n,r,o){var i=Or(e,{endpoint:e.logsEndpointBuilder,encoder:Tr()},e.replica&&{endpoint:e.replica.logsEndpointBuilder,encoder:Tr()},n,r,o.expireObservable);return t.subscribe(1,(function(e){i.add(e)})),i}(n,i,s,u,c).stop;a.push((function(){return p()}))}return{handleLog:d,getInternalContext:(l=c,{get:function(e){var t=l.findTrackedSession(e);if(t)return{session_id:t.id}}}).get,stop:function(){a.forEach((function(e){return e()}))}}}));Lr=b(),Ir=Nr,Pr=Lr[Ar="DD_LOGS"],Lr[Ar]=Ir,Pr&&Pr.q&&Pr.q.forEach((function(e){return i(e,"onReady callback threw an error:")()}))}();

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

import type { Context, User } from '@datadog/browser-core';
import type { Context, TrackingConsent, User } from '@datadog/browser-core';
import type { LogsInitConfiguration } from '../domain/configuration';

@@ -21,2 +21,15 @@ import type { HandlerType, StatusType } from '../domain/logger';

init: (initConfiguration: LogsInitConfiguration) => void;
/**
* Set the tracking consent of the current user.
*
* @param {"granted" | "not-granted"} trackingConsent The user tracking consent
*
* Logs will be sent only if it is set to "granted". This value won't be stored by the library
* across page loads: you will need to call this method or set the appropriate `trackingConsent`
* field in the init() method at each page load.
*
* If this method is called before the init() method, the provided value will take precedence
* over the one provided as initialization parameter.
*/
setTrackingConsent: (trackingConsent: TrackingConsent) => void;
getGlobalContext: () => Context;

@@ -23,0 +36,0 @@ setGlobalContext: (context: any) => void;

@@ -13,6 +13,7 @@ "use strict";

var userContextManager = (0, browser_core_1.createContextManager)(customerDataTrackerManager.getOrCreateTracker(1 /* CustomerDataType.User */));
var trackingConsentState = (0, browser_core_1.createTrackingConsentState)();
function getCommonContext() {
return (0, commonContext_1.buildCommonContext)(globalContextManager, userContextManager);
}
var strategy = (0, preStartLogs_1.createPreStartStrategy)(getCommonContext, function (initConfiguration, configuration) {
var strategy = (0, preStartLogs_1.createPreStartStrategy)(getCommonContext, trackingConsentState, function (initConfiguration, configuration) {
if (initConfiguration.storeContextsAcrossPages) {

@@ -22,3 +23,3 @@ (0, browser_core_1.storeContextManager)(configuration, globalContextManager, LOGS_STORAGE_KEY, 2 /* CustomerDataType.GlobalContext */);

}
var startLogsResult = startLogsImpl(initConfiguration, configuration, getCommonContext);
var startLogsResult = startLogsImpl(initConfiguration, configuration, getCommonContext, trackingConsentState);
strategy = createPostStartStrategy(initConfiguration, startLogsResult);

@@ -38,2 +39,15 @@ return startLogsResult;

init: (0, browser_core_1.monitor)(function (initConfiguration) { return strategy.init(initConfiguration); }),
/**
* Set the tracking consent of the current user.
*
* @param {"granted" | "not-granted"} trackingConsent The user tracking consent
*
* Logs will be sent only if it is set to "granted". This value won't be stored by the library
* across page loads: you will need to call this method or set the appropriate `trackingConsent`
* field in the init() method at each page load.
*
* If this method is called before the init() method, the provided value will take precedence
* over the one provided as initialization parameter.
*/
setTrackingConsent: (0, browser_core_1.monitor)(function (trackingConsent) { return trackingConsentState.update(trackingConsent); }),
getGlobalContext: (0, browser_core_1.monitor)(function () { return globalContextManager.getContext(); }),

@@ -40,0 +54,0 @@ setGlobalContext: (0, browser_core_1.monitor)(function (context) { return globalContextManager.setContext(context); }),

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

import type { TrackingConsentState } from '@datadog/browser-core';
import { type LogsConfiguration, type LogsInitConfiguration } from '../domain/configuration';

@@ -5,2 +6,2 @@ import type { CommonContext } from '../rawLogsEvent.types';

import type { StartLogsResult } from './startLogs';
export declare function createPreStartStrategy(getCommonContext: () => CommonContext, doStartLogs: (initConfiguration: LogsInitConfiguration, configuration: LogsConfiguration) => StartLogsResult): Strategy;
export declare function createPreStartStrategy(getCommonContext: () => CommonContext, trackingConsentState: TrackingConsentState, doStartLogs: (initConfiguration: LogsInitConfiguration, configuration: LogsConfiguration) => StartLogsResult): Strategy;

@@ -6,10 +6,12 @@ "use strict";

var configuration_1 = require("../domain/configuration");
function createPreStartStrategy(getCommonContext, doStartLogs) {
function createPreStartStrategy(getCommonContext, trackingConsentState, doStartLogs) {
var bufferApiCalls = new browser_core_1.BoundedBuffer();
var cachedInitConfiguration;
var cachedConfiguration;
var trackingConsentStateSubscription = trackingConsentState.observable.subscribe(tryStartLogs);
function tryStartLogs() {
if (!cachedConfiguration || !cachedInitConfiguration) {
if (!cachedConfiguration || !cachedInitConfiguration || !trackingConsentState.isGranted()) {
return;
}
trackingConsentStateSubscription.unsubscribe();
var startLogsResult = doStartLogs(cachedInitConfiguration, cachedConfiguration);

@@ -38,2 +40,3 @@ bufferApiCalls.drain(startLogsResult);

cachedConfiguration = configuration;
trackingConsentState.tryToInit(configuration.trackingConsent);
tryStartLogs();

@@ -40,0 +43,0 @@ },

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

import type { TrackingConsentState } from '@datadog/browser-core';
import type { LogsConfiguration, LogsInitConfiguration } from '../domain/configuration';

@@ -5,3 +6,3 @@ import type { CommonContext } from '../rawLogsEvent.types';

export type StartLogsResult = ReturnType<StartLogs>;
export declare function startLogs(initConfiguration: LogsInitConfiguration, configuration: LogsConfiguration, getCommonContext: () => CommonContext): {
export declare function startLogs(initConfiguration: LogsInitConfiguration, configuration: LogsConfiguration, getCommonContext: () => CommonContext, trackingConsentState: TrackingConsentState): {
handleLog: (logsMessage: import("../domain/logger").LogsMessage, logger: import("../domain/logger").Logger, savedCommonContext?: CommonContext | undefined, savedDate?: import("@datadog/browser-core").TimeStamp | undefined) => void;

@@ -8,0 +9,0 @@ getInternalContext: (startTime?: number | undefined) => import("../domain/contexts/internalContext").InternalContext | undefined;

@@ -18,3 +18,7 @@ "use strict";

var logsTelemetry_1 = require("../domain/logsTelemetry");
function startLogs(initConfiguration, configuration, getCommonContext) {
function startLogs(initConfiguration, configuration, getCommonContext,
// `startLogs` and its subcomponents assume tracking consent is granted initially and starts
// collecting logs unconditionally. As such, `startLogs` should be called with a
// `trackingConsentState` set to "granted".
trackingConsentState) {
var lifeCycle = new lifeCycle_1.LifeCycle();

@@ -26,3 +30,3 @@ var cleanupTasks = [];

var session = configuration.sessionStoreStrategyType && !(0, browser_core_1.canUseEventBridge)() && !(0, browser_core_1.willSyntheticsInjectRum)()
? (0, logsSessionManager_1.startLogsSessionManager)(configuration)
? (0, logsSessionManager_1.startLogsSessionManager)(configuration, trackingConsentState)
: (0, logsSessionManager_1.startLogsSessionManagerStub)(configuration);

@@ -29,0 +33,0 @@ var stopLogsTelemetry = (0, logsTelemetry_1.startLogsTelemetry)(initConfiguration, configuration, reportError, pageExitObservable, session).stop;

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

fingerprint: log.fingerprint,
causes: log.causes,
}

@@ -27,0 +28,0 @@ : undefined,

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

message: rawError.message,
causes: rawError.causes,
};

@@ -56,0 +57,0 @@ }

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

import type { RelativeTime } from '@datadog/browser-core';
import type { RelativeTime, TrackingConsentState } from '@datadog/browser-core';
import { Observable } from '@datadog/browser-core';

@@ -16,3 +16,3 @@ import type { LogsConfiguration } from './configuration';

}
export declare function startLogsSessionManager(configuration: LogsConfiguration): LogsSessionManager;
export declare function startLogsSessionManager(configuration: LogsConfiguration, trackingConsentState: TrackingConsentState): LogsSessionManager;
export declare function startLogsSessionManagerStub(configuration: LogsConfiguration): LogsSessionManager;

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

exports.LOGS_SESSION_KEY = 'logs';
function startLogsSessionManager(configuration) {
var sessionManager = (0, browser_core_1.startSessionManager)(configuration, exports.LOGS_SESSION_KEY, function (rawTrackingType) {
return computeSessionState(configuration, rawTrackingType);
});
function startLogsSessionManager(configuration, trackingConsentState) {
var sessionManager = (0, browser_core_1.startSessionManager)(configuration, exports.LOGS_SESSION_KEY, function (rawTrackingType) { return computeSessionState(configuration, rawTrackingType); }, trackingConsentState);
return {

@@ -12,0 +10,0 @@ findTrackedSession: function (startTime) {

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

stack: rawError.stack,
causes: rawError.causes,
},

@@ -22,0 +23,0 @@ origin: browser_core_1.ErrorSource.SOURCE,

@@ -8,2 +8,3 @@ export { Logger, LogsMessage, StatusType, HandlerType } from '../domain/logger';

init: (initConfiguration: import("../domain/configuration").LogsInitConfiguration) => void;
setTrackingConsent: (trackingConsent: import("@datadog/browser-core").TrackingConsent) => void;
getGlobalContext: () => import("@datadog/browser-core").Context;

@@ -10,0 +11,0 @@ setGlobalContext: (context: any) => void;

@@ -70,2 +70,19 @@ export interface LogsEvent {

stack?: string;
/**
* Fingerprint of the error
*/
fingerprint?: string;
/**
* Message of the error
*/
message?: string;
/**
* Flattened causes of the error
*/
causes?: Array<{
message: string;
source: string;
type?: string;
stack?: string;
}>;
[k: string]: unknown;

@@ -72,0 +89,0 @@ };

@@ -1,9 +0,10 @@

import type { Context, ErrorSource, TimeStamp, User } from '@datadog/browser-core';
import type { Context, ErrorSource, RawErrorCause, TimeStamp, User } from '@datadog/browser-core';
import type { StatusType } from './domain/logger';
export type RawLogsEvent = RawConsoleLogsEvent | RawNetworkLogsEvent | RawLoggerLogsEvent | RawAgentLogsEvent | RawReportLogsEvent | RawRuntimeLogsEvent;
type Error = {
message?: string;
kind?: string;
stack?: string;
fingerprint?: string;
[k: string]: unknown;
causes?: RawErrorCause[];
};

@@ -10,0 +11,0 @@ interface CommonRawLogsEvent {

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

import type { Context, User } from '@datadog/browser-core';
import type { Context, TrackingConsent, User } from '@datadog/browser-core';
import type { LogsInitConfiguration } from '../domain/configuration';

@@ -21,2 +21,15 @@ import type { HandlerType, StatusType } from '../domain/logger';

init: (initConfiguration: LogsInitConfiguration) => void;
/**
* Set the tracking consent of the current user.
*
* @param {"granted" | "not-granted"} trackingConsent The user tracking consent
*
* Logs will be sent only if it is set to "granted". This value won't be stored by the library
* across page loads: you will need to call this method or set the appropriate `trackingConsent`
* field in the init() method at each page load.
*
* If this method is called before the init() method, the provided value will take precedence
* over the one provided as initialization parameter.
*/
setTrackingConsent: (trackingConsent: TrackingConsent) => void;
getGlobalContext: () => Context;

@@ -23,0 +36,0 @@ setGlobalContext: (context: any) => void;

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

import { assign, createContextManager, makePublicApi, monitor, checkUser, sanitizeUser, sanitize, createCustomerDataTrackerManager, storeContextManager, displayAlreadyInitializedError, deepClone, } from '@datadog/browser-core';
import { assign, createContextManager, makePublicApi, monitor, checkUser, sanitizeUser, sanitize, createCustomerDataTrackerManager, storeContextManager, displayAlreadyInitializedError, deepClone, createTrackingConsentState, } from '@datadog/browser-core';
import { Logger } from '../domain/logger';

@@ -10,6 +10,7 @@ import { buildCommonContext } from '../domain/contexts/commonContext';

var userContextManager = createContextManager(customerDataTrackerManager.getOrCreateTracker(1 /* CustomerDataType.User */));
var trackingConsentState = createTrackingConsentState();
function getCommonContext() {
return buildCommonContext(globalContextManager, userContextManager);
}
var strategy = createPreStartStrategy(getCommonContext, function (initConfiguration, configuration) {
var strategy = createPreStartStrategy(getCommonContext, trackingConsentState, function (initConfiguration, configuration) {
if (initConfiguration.storeContextsAcrossPages) {

@@ -19,3 +20,3 @@ storeContextManager(configuration, globalContextManager, LOGS_STORAGE_KEY, 2 /* CustomerDataType.GlobalContext */);

}
var startLogsResult = startLogsImpl(initConfiguration, configuration, getCommonContext);
var startLogsResult = startLogsImpl(initConfiguration, configuration, getCommonContext, trackingConsentState);
strategy = createPostStartStrategy(initConfiguration, startLogsResult);

@@ -35,2 +36,15 @@ return startLogsResult;

init: monitor(function (initConfiguration) { return strategy.init(initConfiguration); }),
/**
* Set the tracking consent of the current user.
*
* @param {"granted" | "not-granted"} trackingConsent The user tracking consent
*
* Logs will be sent only if it is set to "granted". This value won't be stored by the library
* across page loads: you will need to call this method or set the appropriate `trackingConsent`
* field in the init() method at each page load.
*
* If this method is called before the init() method, the provided value will take precedence
* over the one provided as initialization parameter.
*/
setTrackingConsent: monitor(function (trackingConsent) { return trackingConsentState.update(trackingConsent); }),
getGlobalContext: monitor(function () { return globalContextManager.getContext(); }),

@@ -37,0 +51,0 @@ setGlobalContext: monitor(function (context) { return globalContextManager.setContext(context); }),

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

import type { TrackingConsentState } from '@datadog/browser-core';
import { type LogsConfiguration, type LogsInitConfiguration } from '../domain/configuration';

@@ -5,2 +6,2 @@ import type { CommonContext } from '../rawLogsEvent.types';

import type { StartLogsResult } from './startLogs';
export declare function createPreStartStrategy(getCommonContext: () => CommonContext, doStartLogs: (initConfiguration: LogsInitConfiguration, configuration: LogsConfiguration) => StartLogsResult): Strategy;
export declare function createPreStartStrategy(getCommonContext: () => CommonContext, trackingConsentState: TrackingConsentState, doStartLogs: (initConfiguration: LogsInitConfiguration, configuration: LogsConfiguration) => StartLogsResult): Strategy;
import { BoundedBuffer, assign, canUseEventBridge, display, displayAlreadyInitializedError, noop, timeStampNow, } from '@datadog/browser-core';
import { validateAndBuildLogsConfiguration, } from '../domain/configuration';
export function createPreStartStrategy(getCommonContext, doStartLogs) {
export function createPreStartStrategy(getCommonContext, trackingConsentState, doStartLogs) {
var bufferApiCalls = new BoundedBuffer();
var cachedInitConfiguration;
var cachedConfiguration;
var trackingConsentStateSubscription = trackingConsentState.observable.subscribe(tryStartLogs);
function tryStartLogs() {
if (!cachedConfiguration || !cachedInitConfiguration) {
if (!cachedConfiguration || !cachedInitConfiguration || !trackingConsentState.isGranted()) {
return;
}
trackingConsentStateSubscription.unsubscribe();
var startLogsResult = doStartLogs(cachedInitConfiguration, cachedConfiguration);

@@ -34,2 +36,3 @@ bufferApiCalls.drain(startLogsResult);

cachedConfiguration = configuration;
trackingConsentState.tryToInit(configuration.trackingConsent);
tryStartLogs();

@@ -36,0 +39,0 @@ },

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

import type { TrackingConsentState } from '@datadog/browser-core';
import type { LogsConfiguration, LogsInitConfiguration } from '../domain/configuration';

@@ -5,3 +6,3 @@ import type { CommonContext } from '../rawLogsEvent.types';

export type StartLogsResult = ReturnType<StartLogs>;
export declare function startLogs(initConfiguration: LogsInitConfiguration, configuration: LogsConfiguration, getCommonContext: () => CommonContext): {
export declare function startLogs(initConfiguration: LogsInitConfiguration, configuration: LogsConfiguration, getCommonContext: () => CommonContext, trackingConsentState: TrackingConsentState): {
handleLog: (logsMessage: import("../domain/logger").LogsMessage, logger: import("../domain/logger").Logger, savedCommonContext?: CommonContext | undefined, savedDate?: import("@datadog/browser-core").TimeStamp | undefined) => void;

@@ -8,0 +9,0 @@ getInternalContext: (startTime?: number | undefined) => import("../domain/contexts/internalContext").InternalContext | undefined;

@@ -15,3 +15,7 @@ import { sendToExtension, createPageExitObservable, willSyntheticsInjectRum, canUseEventBridge, } from '@datadog/browser-core';

import { startLogsTelemetry } from '../domain/logsTelemetry';
export function startLogs(initConfiguration, configuration, getCommonContext) {
export function startLogs(initConfiguration, configuration, getCommonContext,
// `startLogs` and its subcomponents assume tracking consent is granted initially and starts
// collecting logs unconditionally. As such, `startLogs` should be called with a
// `trackingConsentState` set to "granted".
trackingConsentState) {
var lifeCycle = new LifeCycle();

@@ -23,3 +27,3 @@ var cleanupTasks = [];

var session = configuration.sessionStoreStrategyType && !canUseEventBridge() && !willSyntheticsInjectRum()
? startLogsSessionManager(configuration)
? startLogsSessionManager(configuration, trackingConsentState)
: startLogsSessionManagerStub(configuration);

@@ -26,0 +30,0 @@ var stopLogsTelemetry = startLogsTelemetry(initConfiguration, configuration, reportError, pageExitObservable, session).stop;

@@ -22,2 +22,3 @@ var _a;

fingerprint: log.fingerprint,
causes: log.causes,
}

@@ -24,0 +25,0 @@ : undefined,

@@ -51,2 +51,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

message: rawError.message,
causes: rawError.causes,
};

@@ -53,0 +54,0 @@ }

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

import type { RelativeTime } from '@datadog/browser-core';
import type { RelativeTime, TrackingConsentState } from '@datadog/browser-core';
import { Observable } from '@datadog/browser-core';

@@ -16,3 +16,3 @@ import type { LogsConfiguration } from './configuration';

}
export declare function startLogsSessionManager(configuration: LogsConfiguration): LogsSessionManager;
export declare function startLogsSessionManager(configuration: LogsConfiguration, trackingConsentState: TrackingConsentState): LogsSessionManager;
export declare function startLogsSessionManagerStub(configuration: LogsConfiguration): LogsSessionManager;
import { Observable, performDraw, startSessionManager } from '@datadog/browser-core';
export var LOGS_SESSION_KEY = 'logs';
export function startLogsSessionManager(configuration) {
var sessionManager = startSessionManager(configuration, LOGS_SESSION_KEY, function (rawTrackingType) {
return computeSessionState(configuration, rawTrackingType);
});
export function startLogsSessionManager(configuration, trackingConsentState) {
var sessionManager = startSessionManager(configuration, LOGS_SESSION_KEY, function (rawTrackingType) { return computeSessionState(configuration, rawTrackingType); }, trackingConsentState);
return {

@@ -8,0 +6,0 @@ findTrackedSession: function (startTime) {

@@ -17,2 +17,3 @@ import { noop, ErrorSource, trackRuntimeError, Observable } from '@datadog/browser-core';

stack: rawError.stack,
causes: rawError.causes,
},

@@ -19,0 +20,0 @@ origin: ErrorSource.SOURCE,

@@ -8,2 +8,3 @@ export { Logger, LogsMessage, StatusType, HandlerType } from '../domain/logger';

init: (initConfiguration: import("../domain/configuration").LogsInitConfiguration) => void;
setTrackingConsent: (trackingConsent: import("@datadog/browser-core").TrackingConsent) => void;
getGlobalContext: () => import("@datadog/browser-core").Context;

@@ -10,0 +11,0 @@ setGlobalContext: (context: any) => void;

@@ -70,2 +70,19 @@ export interface LogsEvent {

stack?: string;
/**
* Fingerprint of the error
*/
fingerprint?: string;
/**
* Message of the error
*/
message?: string;
/**
* Flattened causes of the error
*/
causes?: Array<{
message: string;
source: string;
type?: string;
stack?: string;
}>;
[k: string]: unknown;

@@ -72,0 +89,0 @@ };

@@ -1,9 +0,10 @@

import type { Context, ErrorSource, TimeStamp, User } from '@datadog/browser-core';
import type { Context, ErrorSource, RawErrorCause, TimeStamp, User } from '@datadog/browser-core';
import type { StatusType } from './domain/logger';
export type RawLogsEvent = RawConsoleLogsEvent | RawNetworkLogsEvent | RawLoggerLogsEvent | RawAgentLogsEvent | RawReportLogsEvent | RawRuntimeLogsEvent;
type Error = {
message?: string;
kind?: string;
stack?: string;
fingerprint?: string;
[k: string]: unknown;
causes?: RawErrorCause[];
};

@@ -10,0 +11,0 @@ interface CommonRawLogsEvent {

{
"name": "@datadog/browser-logs",
"version": "5.9.0",
"version": "5.10.0",
"license": "Apache-2.0",

@@ -16,6 +16,6 @@ "main": "cjs/entries/main.js",

"dependencies": {
"@datadog/browser-core": "5.9.0"
"@datadog/browser-core": "5.10.0"
},
"peerDependencies": {
"@datadog/browser-rum": "5.9.0"
"@datadog/browser-rum": "5.10.0"
},

@@ -38,3 +38,3 @@ "peerDependenciesMeta": {

},
"gitHead": "465eecbc937d9ee15e2f0c03c5c574fe3e909aed"
"gitHead": "406566926cdbe6d4534be5a9774b973cb210d5e9"
}

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

import type { Context, User } from '@datadog/browser-core'
import type { Context, TrackingConsent, User } from '@datadog/browser-core'
import {

@@ -15,2 +15,3 @@ CustomerDataType,

deepClone,
createTrackingConsentState,
} from '@datadog/browser-core'

@@ -47,2 +48,3 @@ import type { LogsInitConfiguration } from '../domain/configuration'

const userContextManager = createContextManager(customerDataTrackerManager.getOrCreateTracker(CustomerDataType.User))
const trackingConsentState = createTrackingConsentState()

@@ -53,3 +55,3 @@ function getCommonContext() {

let strategy = createPreStartStrategy(getCommonContext, (initConfiguration, configuration) => {
let strategy = createPreStartStrategy(getCommonContext, trackingConsentState, (initConfiguration, configuration) => {
if (initConfiguration.storeContextsAcrossPages) {

@@ -60,3 +62,3 @@ storeContextManager(configuration, globalContextManager, LOGS_STORAGE_KEY, CustomerDataType.GlobalContext)

const startLogsResult = startLogsImpl(initConfiguration, configuration, getCommonContext)
const startLogsResult = startLogsImpl(initConfiguration, configuration, getCommonContext, trackingConsentState)

@@ -79,2 +81,16 @@ strategy = createPostStartStrategy(initConfiguration, startLogsResult)

/**
* Set the tracking consent of the current user.
*
* @param {"granted" | "not-granted"} trackingConsent The user tracking consent
*
* Logs will be sent only if it is set to "granted". This value won't be stored by the library
* across page loads: you will need to call this method or set the appropriate `trackingConsent`
* field in the init() method at each page load.
*
* If this method is called before the init() method, the provided value will take precedence
* over the one provided as initialization parameter.
*/
setTrackingConsent: monitor((trackingConsent: TrackingConsent) => trackingConsentState.update(trackingConsent)),
getGlobalContext: monitor(() => globalContextManager.getContext()),

@@ -81,0 +97,0 @@

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

import type { TrackingConsentState } from '@datadog/browser-core'
import {

@@ -21,2 +22,3 @@ BoundedBuffer,

getCommonContext: () => CommonContext,
trackingConsentState: TrackingConsentState,
doStartLogs: (initConfiguration: LogsInitConfiguration, configuration: LogsConfiguration) => StartLogsResult

@@ -27,8 +29,10 @@ ): Strategy {

let cachedConfiguration: LogsConfiguration | undefined
const trackingConsentStateSubscription = trackingConsentState.observable.subscribe(tryStartLogs)
function tryStartLogs() {
if (!cachedConfiguration || !cachedInitConfiguration) {
if (!cachedConfiguration || !cachedInitConfiguration || !trackingConsentState.isGranted()) {
return
}
trackingConsentStateSubscription.unsubscribe()
const startLogsResult = doStartLogs(cachedInitConfiguration, cachedConfiguration)

@@ -64,2 +68,3 @@

cachedConfiguration = configuration
trackingConsentState.tryToInit(configuration.trackingConsent)
tryStartLogs()

@@ -66,0 +71,0 @@ },

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

import type { TrackingConsentState } from '@datadog/browser-core'
import {

@@ -29,3 +30,8 @@ sendToExtension,

configuration: LogsConfiguration,
getCommonContext: () => CommonContext
getCommonContext: () => CommonContext,
// `startLogs` and its subcomponents assume tracking consent is granted initially and starts
// collecting logs unconditionally. As such, `startLogs` should be called with a
// `trackingConsentState` set to "granted".
trackingConsentState: TrackingConsentState
) {

@@ -42,3 +48,3 @@ const lifeCycle = new LifeCycle()

configuration.sessionStoreStrategyType && !canUseEventBridge() && !willSyntheticsInjectRum()
? startLogsSessionManager(configuration)
? startLogsSessionManager(configuration, trackingConsentState)
: startLogsSessionManagerStub(configuration)

@@ -45,0 +51,0 @@

@@ -34,2 +34,3 @@ import type { Context, ClocksState, ConsoleLog } from '@datadog/browser-core'

fingerprint: log.fingerprint,
causes: log.causes,
}

@@ -36,0 +37,0 @@ : undefined,

@@ -15,3 +15,3 @@ import type { Context, ContextManager, CustomerDataTracker } from '@datadog/browser-core'

import type { LogsEvent } from '../logsEvent.types'
import type { RawLoggerLogsEvent } from '../rawLogsEvent.types'

@@ -62,3 +62,3 @@ export interface LogsMessage {

log(message: string, messageContext?: object, status: StatusType = StatusType.info, error?: Error) {
let errorContext: LogsEvent['error']
let errorContext: RawLoggerLogsEvent['error']

@@ -80,2 +80,3 @@ if (error !== undefined && error !== null) {

message: rawError.message,
causes: rawError.causes,
}

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

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

import type { RelativeTime } from '@datadog/browser-core'
import type { RelativeTime, TrackingConsentState } from '@datadog/browser-core'
import { Observable, performDraw, startSessionManager } from '@datadog/browser-core'

@@ -21,5 +21,11 @@ import type { LogsConfiguration } from './configuration'

export function startLogsSessionManager(configuration: LogsConfiguration): LogsSessionManager {
const sessionManager = startSessionManager(configuration, LOGS_SESSION_KEY, (rawTrackingType) =>
computeSessionState(configuration, rawTrackingType)
export function startLogsSessionManager(
configuration: LogsConfiguration,
trackingConsentState: TrackingConsentState
): LogsSessionManager {
const sessionManager = startSessionManager(
configuration,
LOGS_SESSION_KEY,
(rawTrackingType) => computeSessionState(configuration, rawTrackingType),
trackingConsentState
)

@@ -26,0 +32,0 @@ return {

@@ -32,2 +32,3 @@ import type { Context, RawError, ClocksState } from '@datadog/browser-core'

stack: rawError.stack,
causes: rawError.causes,
},

@@ -34,0 +35,0 @@ origin: ErrorSource.SOURCE,

@@ -72,2 +72,19 @@ export interface LogsEvent {

stack?: string
/**
* Fingerprint of the error
*/
fingerprint?: string
/**
* Message of the error
*/
message?: string
/**
* Flattened causes of the error
*/
causes?: Array<{
message: string
source: string
type?: string
stack?: string
}>

@@ -74,0 +91,0 @@ [k: string]: unknown

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

import type { Context, ErrorSource, TimeStamp, User } from '@datadog/browser-core'
import type { Context, ErrorSource, RawErrorCause, TimeStamp, User } from '@datadog/browser-core'
import type { StatusType } from './domain/logger'

@@ -13,6 +13,7 @@

type Error = {
message?: string
kind?: string
stack?: string
fingerprint?: string
[k: string]: unknown
causes?: RawErrorCause[]
}

@@ -19,0 +20,0 @@

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc