@datadog/browser-logs
Advanced tools
Comparing version 5.19.0 to 5.20.0
@@ -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 S=1024,w=1024*S,C=/[^\u0000-\u007F]/;function E(e){return C.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length}function k(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 _(e,t){return k(b(),"setTimeout")(l(e),t)}function x(e){k(b(),"clearTimeout")(e)}function O(e,t){return k(b(),"setInterval")(l(e),t)}function T(e){k(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=_((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 U=3*S,D=16*S,B=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?U:D,a=r;t.forEach((function(e){a+=e.getBytesCount()})),a>i&&(!function(e){o.warn("Customer data exceeds the recommended ".concat(e/S,"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=q((function(){return r(e.getBytesCount())}));return e},getOrCreateTracker:function(e){return t.has(e)||t.set(e,q(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 q(e){var t=0,n=R((function(n){t=E(A(n)),e()}),B),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 j(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function G(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]=G(o[i],t[i],n);return o}var a="object"===j(e)?e:{};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(a[s]=G(a[s],t[s],n));return a}}function H(e){return G(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=G(e,i))}return e}var V=220*S,z="$",J=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=Y(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=Y(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=Y(c.source[l],c.path,l,i,a))&&(u+=JSON.stringify(d).length+f+l.length+J,f=1),u>t){K(t,"truncated",e);break}c.target[l]=d}}return r(),o(),s}K(t,"discarded",e)}function Y(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 $(){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"===j(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}var Q,ee={GRANTED:"granted",NOT_GRANTED:"not-granted"};function te(e,t,n,r,o){return ne(e,t,[n],r,o)}function ne(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=k(t,"addEventListener");function p(){var e=k(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"}(Q||(Q={}));var re="_dd_c",oe=[];function ie(e,t,n,r){var o=function(e,t){return"".concat(re,"_").concat(e,"_").concat(t)}(n,r);function i(){var e=localStorage.getItem(o);return null!==e?JSON.parse(e):{}}oe.push(te(e,window,Q.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()))}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]*)$/;function be(e){var t=Se(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 Se(e){return"".concat(e.name||"Error",": ").concat(e.message)}var we,Ce="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(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)?be(t):Ce,l=u?_e(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:ke(n)}}function ke(e){return e instanceof Error&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function _e(e,t){for(var n=e,r=[];(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&&be(o)}),n=n.cause}return r.length?r:void 0}!function(e){e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.CUSTOM_VITALS="custom_vitals",e.TOLERANT_RESOURCE_TIMINGS="tolerant_resource_timings"}(we||(we={}));var xe=new Set;function Oe(){return xe}var Te,Re="datad0g.com",Le="dd0g-gov.com",Ae="datadoghq.com",Ie="pci.browser-intake-datadoghq.com",Pe=1e3,Ne=60*Pe,Ue=60*Ne;function De(){return(new Date).getTime()}function Be(){return De()}function Me(){return performance.now()}function qe(){return{relative:Me(),timeStamp:Be()}}function je(e,t){return e+t}function Ge(e){return e-He()}function He(){return void 0===Te&&(Te=performance.timing.navigationStart),Te}function Fe(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function Ve(e){return 0!==e&&100*Math.random()<=e}function ze(e){return function(e){return"number"==typeof e}(e)&&e>=0&&e<=100}function Je(){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}}function We(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var Ye=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){We(this.buffer,e)},e.prototype.drain=function(e){this.buffer.forEach((function(t){return t(e)})),this.buffer.length=0},e}(),Ke={log:"log",configuration:"configuration",usage:"usage"},Ze=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],$e=["ddog-gov.com"],Xe=new Ye,Qe=function(e){Xe.add((function(){return Qe(e)}))};function et(e,t){var n,r,o=new Z,i=new Set,s=!v($e,t.site)&&Ve(t.telemetrySampleRate),u=((n={})[Ke.log]=s,n[Ke.configuration]=s&&Ve(t.telemetryConfigurationSampleRate),n[Ke.usage]=s&&Ve(t.telemetryUsageSampleRate),n),c={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return Qe=function(n){var a=A(n);if(u[n.type]&&i.size<t.maxTelemetryEventsPerPage&&!i.has(a)){var s=function(e,t,n){return F({type:"telemetry",date:Be(),service:e,version:"5.19.0",source:"browser",_dd:{format_version:2},telemetry:F(t,{runtime_env:n,connectivity:Je()}),experimental_features:g(Oe())},void 0!==r?r():{})}(e,n,c);o.notify(s),Fe("telemetry",s),i.add(a)}},a=nt,{setContextProvider:function(e){r=e},observable:o,enabled:s}}function tt(t,n){p(e.debug,t,n),Qe(m({type:Ke.log,message:t,status:"debug"},n))}function nt(e,t){Qe(m({type:Ke.log,status:"error"},function(e){if(e instanceof Error){var t=se(e);return{error:{kind:t.name,stack:be(rt(t))},message:t.message}}return{error:{stack:Ce},message:"".concat("Uncaught"," ").concat(A(e))}}(e),t))}function rt(e){return e.stack=e.stack.filter((function(e){return!e.url||Ze.some((function(t){return y(e.url,t)}))})),e}function ot(e){var t=m({},e);return["id","name","email"].forEach((function(e){e in t&&(t[e]=String(t[e]))})),t}function it(e,t){t.silentMultipleInit||o.error("".concat(e," is already initialized."))}var at={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"},st=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},ut={debug:"debug",error:"error",info:"info",warn:"warn"},ct={console:"console",http:"http",silent:"silent"},ft=Object.keys(ut),lt=function(){function e(e,t,n,r,o,i){void 0===r&&(r=ct.http),void 0===o&&(o=ut.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=ut.info),null!=r){var i=Ee({stackTrace:r instanceof Error?se(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:at.LOGGER,handling:"handled",startClocks:qe()});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,ut.debug,n)},e.prototype.info=function(e,t,n){this.log(e,t,ut.info,n)},e.prototype.warn=function(e,t,n){this.log(e,t,ut.warn,n)},e.prototype.error=function(e,t,n){this.log(e,t,ut.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},st([f],e.prototype,"log",null),e}();function dt(){var e=b().DatadogEventBridge;if(e)return{getCapabilities:function(){var t;return JSON.parse((null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e))||"[]")},getPrivacyLevel:function(){var t;return null===(t=e.getPrivacyLevel)||void 0===t?void 0:t.call(e)},getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n,r){var o=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:o}))}}}function pt(e){var t;void 0===e&&(e=null===(t=b().location)||void 0===t?void 0:t.hostname);var n=dt();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r}))}function vt(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,vt)}var gt,ht,yt,mt=/([\w-]+)\s*=\s*([^;]+)/g;function bt(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)}function St(){return null!=gt?gt:gt=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 wt(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 Ct(e){return function(e,t){for(mt.lastIndex=0;;){var n=mt.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function Et(e){return ht||(ht=function(e){var t=new Map;for(mt.lastIndex=0;;){var n=mt.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),ht.get(e)}function kt(e,t){wt(e,"",0,t)}var _t="_dd_s",xt=4*Ue,Ot=15*Ne,Tt=/^([a-zA-Z]+)=([a-z0-9-]+)$/,Rt="&",Lt="1";function At(){return{isExpired:Lt}}function It(e){return N(e)}function Pt(e){return!It(e)}function Nt(e){return void 0!==e.isExpired||!((void 0===(t=e).created||De()-Number(t.created)<xt)&&(void 0===t.expire||De()<Number(t.expire)));var t}function Ut(e){e.expire=String(De()+Ot)}function Dt(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(Rt);var t}function Bt(e){var t={};return function(e){return!!e&&(-1!==e.indexOf(Rt)||Tt.test(e))}(e)&&e.split(Rt).forEach((function(e){var n=Tt.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}var Mt="_dd",qt="_dd_r",jt="_dd_l",Gt="rum",Ht="logs";function Ft(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===yt){for(var e="dd_site_test_".concat(vt()),t=window.location.hostname.split("."),n=t.pop();t.length&&!Ct(e);)n="".concat(t.pop(),".").concat(n),wt(e,"test",Pe,{domain:n});kt(e,{domain:n}),yt=n}return yt}());return t}(e);return function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_".concat(vt()),n="test";wt(t,n,Ne,e);var r=Ct(t)===n;return kt(t,e),r}catch(e){return o.error(e),!1}}(t)?{type:"Cookie",cookieOptions:t}:void 0}function Vt(e){var t,n={isLockEnabled:1===St(),persistSession:(t=e,function(e){wt(_t,Dt(e),Ot,t)}),retrieveSession:zt,expireSession:function(){return function(e){wt(_t,Dt(At()),xt,e)}(e)}};return function(e){if(!Et(_t)){var t=Et(Mt),n=Et(qt),r=Et(jt),o={};t&&(o.id=t),r&&/^[01]$/.test(r)&&(o[Ht]=r),n&&/^[012]$/.test(n)&&(o[Gt]=n),Pt(o)&&(Ut(o),e.persistSession(o))}}(n),n}function zt(){return Bt(Ct(_t))}var Jt="_dd_test_";function Wt(e){localStorage.setItem(_t,Dt(e))}function Yt(){return Bt(localStorage.getItem(_t))}function Kt(){Wt(At())}var Zt,$t=10,Xt=100,Qt=[];function en(e,t,n){var r;void 0===n&&(n=0);var o=t.isLockEnabled,i=t.persistSession,a=t.expireSession,s=function(e){return i(m({},e,{lock:c}))},u=function(){var e=t.retrieveSession(),n=e.lock;return e.lock&&delete e.lock,{session:e,lock:n}};if(Zt||(Zt=e),e===Zt)if(o&&n>=Xt)nn(t);else{var c,f=u();if(o){if(f.lock)return void tn(e,t,n);if(c=vt(),s(f.session),(f=u()).lock!==c)return void tn(e,t,n)}var l=e.process(f.session);if(o&&(f=u()).lock!==c)tn(e,t,n);else{if(l&&(Nt(l)?a():(Ut(l),o?s(l):i(l))),o&&(!l||!Nt(l))){if((f=u()).lock!==c)return void tn(e,t,n);i(f.session),l=f.session}null===(r=e.after)||void 0===r||r.call(e,l||f.session),nn(t)}}else Qt.push(e)}function tn(e,t,n){_((function(){en(e,t,n+1)}),$t)}function nn(e){Zt=void 0;var t=Qt.shift();t&&en(t,e)}var rn=Pe;function on(e){var t=Ft(e);return!t&&e.allowFallbackToLocalStorage&&(t=function(){try{var e=vt(),t="".concat(Jt).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 an(e,t,n){var r,o=new Z,i=new Z,a="Cookie"===e.type?Vt(e.cookieOptions):{isLockEnabled:!1,persistSession:Wt,retrieveSession:Yt,expireSession:Kt},s=a.expireSession,u=O((function(){en({process:function(e){return Nt(e)?At():void 0},after:d},a)}),rn);p();var c=R((function(){en({process:function(e){if(!It(e)){var r=d(e);return function(e){if(It(e))return!1;var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,delete e.isExpired,i&&!e.id&&(e.id=vt(),e.created=String(De()))}(r),r}},after:function(e){Pt(e)&&!v()&&function(e){r=e,o.notify()}(e),r=e}},a)}),rn),f=c.throttled,l=c.cancel;function d(e){return Nt(e)&&(e=At()),v()&&(!function(e){return r.id!==e.id||r[t]!==e[t]}(e)?r=e:(r=At(),i.notify())),e}function p(){en({process:function(e){if(It(e))return At()},after:function(e){r=e}},a)}function v(){return void 0!==r[t]}return{expandOrRenewSession:f,expandSession:function(){en({process:function(e){return v()?d(e):void 0}},a)},getSession:function(){return r},renewObservable:o,expireObservable:i,restartSession:p,expire:function(){l(),s(),d(At())},stop:function(){T(u)}}}function sn(e){return un(e,location.href).href}function un(e,t){var n=function(){if(void 0===cn)try{var e=new fn("http://test/path");cn="http://test/path"===e.href}catch(e){cn=!1}return cn?fn: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 cn,fn=URL;function ln(e,t,n){var r=function(e,t){var n="/api/v2/".concat(t),r=e.proxy;if("string"==typeof r){var o=sn(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,t){var n=t.site,r=void 0===n?Ae:n,o=t.internalAnalyticsSubdomain;if("logs"===e&&t.usePciIntake&&r===Ae)return Ie;if(o&&r===Ae)return"".concat(o,".").concat(Ae);if(r===Le)return"http-intake.logs.".concat(r);var i=r.split("."),a=i.pop();return"browser-intake-".concat(i.join("-"),".").concat(a)}(t,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.encoding,c=["sdk_version:".concat("5.19.0"),"api:".concat(r)].concat(n);s&&c.push("retry_count:".concat(s.count),"retry_after:".concat(s.lastFailureStatus));var f=["ddsource=browser","ddtags=".concat(encodeURIComponent(c.join(","))),"dd-api-key=".concat(i),"dd-evp-origin-version=".concat(encodeURIComponent("5.19.0")),"dd-evp-origin=browser","dd-request-id=".concat(vt())];u&&f.push("dd-evp-encoding=".concat(u));"rum"===t&&f.push("batch_time=".concat(Be()));a&&f.reverse();return f.join("&")}(e,t,n,o,i);return r(a)},urlPrefix:r(""),trackType:t}}var dn=200;var pn=/[^a-z0-9_:./-]/;function vn(e,t){var n=dn-e.length-1;(t.length>n||pn.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 gn(e){var t=e.site||Ae,n=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(vn("env",t)),n&&i.push(vn("service",n)),r&&i.push(vn("version",r)),o&&i.push(vn("datacenter",o)),i}(e),r=function(e,t){return{logsEndpointBuilder:ln(e,"logs",t),rumEndpointBuilder:ln(e,"rum",t),sessionReplayEndpointBuilder:ln(e,"replay",t)}}(e,n),o=function(e,t){var n=h(e).map((function(e){return e.urlPrefix}));t===Ae&&n.push("https://".concat(Ie,"/"));return n}(r,t),i=function(e,t,n){if(!e.replica)return;var r=m({},e,{site:Ae,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:ln(r,"logs",n),rumEndpointBuilder:ln(r,"rum",n)};return t.push.apply(t,h(o).map((function(e){return e.urlPrefix}))),m({applicationId:e.replica.applicationId},o)}(e,o,n);return m({isIntakeUrl:function(e){return o.some((function(t){return 0===e.indexOf(t)}))},replica:i,site:t},r)}var hn="https://docs.datadoghq.com/getting_started/site/";function yn(e,t){return null==e||"string"==typeof e||(o.error("".concat(t," must be defined as a string")),!1)}function mn(e){var t,n,r,a,s;if(e&&e.clientToken)if(void 0===e.sessionSampleRate||ze(e.sessionSampleRate))if(void 0===e.telemetrySampleRate||ze(e.telemetrySampleRate))if(void 0===e.telemetryConfigurationSampleRate||ze(e.telemetryConfigurationSampleRate))if(void 0===e.telemetryUsageSampleRate||ze(e.telemetryUsageSampleRate)){if(yn(e.version,"Version")&&yn(e.env,"Env")&&yn(e.service,"Service"))if(void 0===e.trackingConsent||P(ee,e.trackingConsent)){var u;if(!e.site||(u=e.site,/(datadog|ddog|datad0g|dd0g)/.test(u)))return Array.isArray(e.enableExperimentalFeatures)&&e.enableExperimentalFeatures.filter((function(e){return P(we,e)})).forEach((function(e){xe.add(e)})),m({beforeSend:e.beforeSend&&i(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:on(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,telemetryUsageSampleRate:null!==(a=e.telemetryUsageSampleRate)&&void 0!==a?a:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:null!==(s=e.trackingConsent)&&void 0!==s?s:ee.GRANTED,batchBytesLimit:16*S,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*Pe,batchMessagesLimit:50,messageBytesLimit:256*S},gn(e));o.error("Site should be a valid Datadog site. Learn more here: ".concat(hn,"."))}else o.error('Tracking Consent should be either "granted" or "not-granted"')}else o.error("Telemetry Usage Sample Rate should be a number between 0 and 100");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 bn={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function Sn(e,t){var n=[];v(t,bn.cspViolation)&&n.push(function(e){return new Z((function(t){return te(e,document,Q.SECURITY_POLICY_VIOLATION,(function(e){t.notify(function(e){var t=bn.cspViolation,n="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return{type:bn.cspViolation,subtype:e.effectiveDirective,message:"".concat(t,": ").concat(n),stack:wn(e.effectiveDirective,e.originalPolicy?"".concat(n,' of the policy "').concat(bt(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber),originalReport:e}}(e))})).stop}))}(e));var r=t.filter((function(e){return e!==bn.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:wn(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 wn(e,t,n,r,o){return n?be({name:e,message:t,stack:[{func:"?",url:n,line:null!=r?r:void 0,column:null!=o?o:void 0}]}):void 0}var Cn=32*S;function En(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 kn(t,n,r){var i,a,s=new Ye,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(pt()&&(t=function(e){return m({},e,{clientToken:"empty"})}(t)),i=t,a)it("DD_LOGS",t);else{var r=function(t){!0===t.usePciIntake&&t.site&&"datadoghq.com"!==t.site&&o.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");var n=mn(t),r=En(t.forwardConsoleLogs,h(e),"Forward Console Logs"),i=En(t.forwardReports,h(bn),"Forward Reports");if(n&&r&&i)return t.forwardErrorsToLogs&&!v(r,e.error)&&r.push(e.error),m({forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:i,requestErrorResponseLengthLimit:Cn,sendLogsAfterSessionExpiration:!!t.sendLogsAfterSessionExpiration},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=Be()),s.add((function(t){return t.handleLog(e,n,r,o)}))}}}var _n="logs";var xn={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};var On="datadog-synthetics-public-id",Tn="datadog-synthetics-result-id",Rn="datadog-synthetics-injects-rum";function Ln(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||Et(Rn))}function An(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||Et(Tn);return"string"==typeof e?e:void 0}var In=1/0,Pn=Ne,Nn=function(){function e(e,t){var n=this;this.expireDelay=e,this.maxEntries=t,this.entries=[],this.clearOldValuesInterval=O((function(){return n.clearOldValues()}),Pn)}return e.prototype.add=function(e,t){var n=this,r={value:e,startTime:t,endTime:In,remove:function(){We(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,t){void 0===e&&(e=In),void 0===t&&(t={returnInactive:!1});for(var n=0,r=this.entries;n<r.length;n++){var o=r[n];if(o.startTime<=e){if(t.returnInactive||e<=o.endTime)return o.value;break}}},e.prototype.closeActive=function(e){var t=this.entries[0];t&&t.endTime===In&&t.close(e)},e.prototype.findAll=function(e,t){void 0===e&&(e=In),void 0===t&&(t=0);var n=je(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}(),Un=Ne,Dn=xt,Bn=[];function Mn(e,t,n,r){var o=new Z,i=new Z,a=an(e.sessionStoreStrategyType,t,n);Bn.push((function(){return a.stop()}));var s=new Nn(Dn);function u(){return{id:a.getSession().id,trackingType:a.getSession()[t]}}return Bn.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=ne(e,window,[Q.CLICK,Q.TOUCH_START,Q.KEY_DOWN,Q.SCROLL],t,{capture:!0,passive:!0}).stop;Bn.push(n)}(e,(function(){r.isGranted()&&a.expandOrRenewSession()})),function(e,t){var n=function(){"visible"===document.visibilityState&&t()},r=te(e,document,Q.VISIBILITY_CHANGE,n).stop;Bn.push(r);var o=O(n,Un);Bn.push((function(){T(o)}))}(e,(function(){return a.expandSession()})),function(e,t){var n=te(e,window,Q.RESUME,t,{capture:!0}).stop;Bn.push(n)}(e,(function(){return a.restartSession()})),{findSession:function(e,t){return s.find(e,t)},renewObservable:o,expireObservable:i,expire:a.expire}}var qn="logs";function jn(e,t){var n=Mn(e,qn,(function(t){return function(e,t){var n=function(e){return"0"===e||"1"===e}(t)?t:Gn(e);return{trackingType:n,isTracked:"1"===n}}(e,t)}),t);return{findTrackedSession:function(e,t){void 0===t&&(t={returnInactive:!1});var r=n.findSession(e,t);return r&&"1"===r.trackingType?{id:r.id}:void 0},expireObservable:n.expireObservable}}function Gn(e){return Ve(e.sessionSampleRate)?"1":"0"}var Hn=!1;function Fn(e){var t,n=window;if(Ln()){var r=o(n.DD_RUM_SYNTHETICS);return r||Hn||(Hn=!0,tt("Logs sent before RUM is injected by the synthetics worker",{testId:(t=window._DATADOG_SYNTHETICS_PUBLIC_ID||Et(On),"string"==typeof t?t:void 0),resultId:An()})),r}return o(n.DD_RUM);function o(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}}function Vn(e,t,n,r,o){var i=ft.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&&_((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:at.AGENT,startClocks:qe()})}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=o.domainContext,v=Ge(u.date),g=e.findTrackedSession(v);if(g||t.sendLogsAfterSessionExpiration&&e.findTrackedSession(v,{returnInactive:!0})){var h=d||r(),y=F({service:t.service,session_id:null==g?void 0:g.id,usr:N(h.user)?void 0:h.user,view:h.view},h.context,Fn(v),u,f);!1===(null===(i=t.beforeSend)||void 0===i?void 0:i.call(t,y,p))||y.origin!==at.AGENT&&(null!==(s=a[y.status])&&void 0!==s?s:a.custom).isLimitReached()||n.notify(1,y)}}))}var zn,Jn={};function Wn(n){var r=n.map((function(n){return Jn[n]||(Jn[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=be(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 Se(se(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?be(se(u)):void 0,i=ke(u),a=u?_e(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)),Jn[n]}));return $.apply(void 0,r)}var Yn,Kn=((zn={})[e.log]=ut.info,zn[e.debug]=ut.debug,zn[e.info]=ut.info,zn[e.warn]=ut.warn,zn[e.error]=ut.error,zn);var Zn,$n=((Yn={})[bn.cspViolation]=ut.error,Yn[bn.intervention]=ut.error,Yn[bn.deprecation]=ut.warn,Yn);function Xn(e,t,n){var r=e[t];if("function"!=typeof r){if(!y(t,"on"))return{stop:L};r=L}var o=function(e,t){return function(){var n,r=g(arguments);d(t,null,[{target:this,parameters:r,onPostCall:function(e){n=e}}]);var o=e.apply(this,r);return n&&d(n,null,[o]),o}}(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 Qn,er=new WeakMap;function tr(e){return Zn||(Zn=function(e){return new Z((function(t){var n=Xn(XMLHttpRequest.prototype,"open",nr).stop,r=Xn(XMLHttpRequest.prototype,"send",(function(n){!function(e,t,n){var r=e.target,o=er.get(r);if(!o)return;var i=o;i.state="start",i.startClocks=qe(),i.isAborted=!1,i.xhr=r;var a=!1,s=Xn(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,Be()-e),t.status=r.status,n.notify(m({},t))}},c=te(t,r,"loadend",u).stop;n.notify(i)}(n,e,t)})).stop,o=Xn(XMLHttpRequest.prototype,"abort",rr).stop;return function(){n(),r(),o()}}))}(e)),Zn}function nr(e){var t=e.target,n=e.parameters,r=n[0],o=n[1];er.set(t,{state:"open",method:String(r).toUpperCase(),url:sn(String(o))})}function rr(e){var t=e.target,n=er.get(t);n&&(n.isAborted=!0)}function or(){return Qn||(Qn=new Z((function(e){if(window.fetch){var t=Xn(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:sn(String(o)),c=qe(),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}}))),Qn}function ir(e){return e>=500}function ar(e,t){if(!e.forwardErrorsToLogs)return{stop:L};var n=tr(e).subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=or().subscribe((function(e){"resolve"===e.state&&o("fetch",e)}));function o(n,r){function o(e){var o={isAborted:r.isAborted};t.notify(0,{rawLogsEvent:{message:"".concat(ur(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:ut.error,origin:at.NETWORK},domainContext:o})}e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!ir(r.status)||("xhr"in r?function(e,t,n){"string"==typeof e.response?n(sr(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(sr(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(sr(be(se(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function sr(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function ur(e){return"xhr"===e?"XHR":"Fetch"}function cr(e){var t,n=function(t,n){var r=Ee({stackTrace:t,originalError:n,startClocks:qe(),nonErrorPrefix:"Uncaught",source:at.SOURCE,handling:"unhandled"});e.notify(r)},r=(t=n,Xn(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 Xn(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 fr,lr=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}(),dr=((fr={})[ut.debug]=0,fr[ut.info]=1,fr[ut.warn]=2,fr[ut.error]=3,fr);function pr(e){return{handleLog:function(r,o,i,a){var s=F(o.getContext(),r.context);vr(r.status,ct.console,o)&&function(e,r){n[e.status].call(t,e.message,r)}(r,s),vr(r.status,ct.http,o)&&e.notify(0,{rawLogsEvent:{date:a||Be(),message:r.message,status:r.status,origin:at.LOGGER},messageContext:s,savedCommonContext:i})}}}function vr(e,t,n){var r=n.getHandler(),o=Array.isArray(r)?r:[r];return dr[e]>=dr[n.getLevel()]&&v(o,t)}var gr=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(xn),n)),o=r?this.request.sendOnExit:this.request.send;if(r&&this.encoder.isAsync){var i=this.encoder.finishSync();i.outputBytesCount&&o(hr(i));var a=[i.pendingData,t].filter(Boolean).join("\n");a&&o({data:a,bytesCount:E(a)})}else t&&this.encoder.write(this.encoder.isEmpty?t:"\n".concat(t)),this.encoder.finish((function(e){o(hr(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 hr(e){return{data:"string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),bytesCount:e.outputBytesCount,encoding:e.encoding}}var yr=80*S,mr=32,br=3*w,Sr=Ne,wr=Pe;function Cr(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?kr(e,t,n,{onSuccess:function(){return _r(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),Er(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function Er(e,t,n,r){2===e.transportStatus&&_((function(){kr(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=wr,_r(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(Sr,2*e.currentBackoffTime),Er(e,t,n,r)}})}),e.currentBackoffTime)}function kr(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||ir(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 _r(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(br/w,"MiB"),source:at.AGENT,startClocks:qe()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=xr();i.size()>0;)Cr(i.dequeue(),t,n,r,o)}function xr(){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>=br}}}function Or(e,t,n,r){var o={transportStatus:0,currentBackoffTime:wr,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=yr&&this.ongoingRequestCount<mr},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:xr(),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);Rr(e,n,r.data,o)})))}else{var s=t.build("xhr",r);Rr(e,s,r.data,o)}}(e,t,n,r,o)};return{send:function(e){Cr(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){Tr||(Tr=!0,nt(e))}(e)}var a=t.build("xhr",r);Rr(e,a,r.data)}(e,t,n,r)}}}var Tr=!1;function Rr(e,t,n,r){var o=new XMLHttpRequest;o.open("POST",t,!0),n instanceof Blob&&o.setRequestHeader("Content-Type",n.type),te(e,o,"loadend",(function(){null==r||r({status:o.status})}),{once:!0}),o.send(n)}function Lr(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(){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=_((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 Ar(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 gr(a,Or(e,n,e.batchBytesLimit,r),Lr({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 Ir(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(n,r){var o=E(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 Pr(e,t,n,r,o){var i=et("browser-logs-sdk",t);i.setContextProvider((function(){var e,t,n,r,i,a;return{application:{id:null===(e=Fn())||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=Fn())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(a=null===(i=Fn())||void 0===i?void 0:i.user_action)||void 0===a?void 0:a.id}}}));var a=[];if(pt()){var s=dt(),u=i.observable.subscribe((function(e){return s.send("internal_telemetry",e)}));a.push((function(){return u.unsubscribe()}))}else{var c=Ar(t,{endpoint:t.rumEndpointBuilder,encoder:Ir()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:Ir()},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===Re}(t))}));a.push((function(){return f.unsubscribe()}))}return Xe.drain(),function(e){Qe({type:Ke.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,telemetry_usage_sample_rate:t.telemetryUsageSampleRate,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,tracking_consent:t.trackingConsent};return m({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports,use_pci_intake:e.usePciIntake,send_logs_after_session_expiration:e.sendLogsAfterSessionExpiration},n)}(e)),{telemetry:i,stop:function(){a.forEach((function(e){return e()}))}}}var Nr,Ur,Dr,Br,Mr=function(e){var t,n,r=M(),i=X(r.getOrCreateTracker(2)),a=X(r.getOrCreateTracker(1)),s={tryToInit:function(e){t||(t=e)},update:function(e){t=e,n.notify()},isGranted:function(){return t===ee.GRANTED},observable:n=new Z};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=kn(u,s,(function(t,n){t.storeContextsAcrossPages&&(ie(n,i,_n,2),ie(n,a,_n,1));var r=e(t,n,u,s);return p=function(e,t){return m({init:function(e){it("DD_LOGS",e)},initConfiguration:e},t)}(t,r),r})),v={},g=new lt((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){var t;s.update(e),t={feature:"set-tracking-consent",tracking_consent:e},Qe({type:Ke.usage,usage:t})})),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 lt((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"===j(e);return t||o.error("Unsupported user:",e),t})(e)&&a.setContext(ot(e))})),getUser:l((function(){return a.getContext()})),setUserProperty:l((function(e,t){var n,r=ot((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.19.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 lr,a=[];i.subscribe(1,(function(e){return Fe("logs",e)}));var s=function(e){return function(t){e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,origin:at.AGENT,status:ut.error}}),tt("Error reported to customer",{"error.message":t.message})}}(i),u=function(e){return new Z((function(t){var n=ne(e,window,[Q.VISIBILITY_CHANGE,Q.FREEZE],(function(e){e.type===Q.VISIBILITY_CHANGE&&"hidden"===document.visibilityState?t.notify({reason:xn.HIDDEN}):e.type===Q.FREEZE&&t.notify({reason:xn.FROZEN})}),{capture:!0}).stop,r=te(e,window,Q.BEFORE_UNLOAD,(function(){t.notify({reason:xn.UNLOADING})})).stop;return function(){n(),r()}}))}(n),c=!n.sessionStoreStrategyType||pt()||Ln()?function(e){var t="1"===Gn(e)?{}:void 0;return{findTrackedSession:function(){return t},expireObservable:new Z}}(n):jn(n,o),f=Pr(t,n,s,u,c).stop;a.push((function(){return f()})),ar(n,i),function(e,t){if(!e.forwardErrorsToLogs)return{stop:L};var n=new Z,r=cr(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:at.SOURCE,status:ut.error}})}))}(n,i),function(t,n){var r=Wn(t.forwardConsoleLogs).subscribe((function(t){n.notify(0,{rawLogsEvent:{date:Be(),message:t.message,origin:at.CONSOLE,error:t.api===e.error?{stack:t.stack,fingerprint:t.fingerprint,causes:t.causes}:void 0,status:Kn[t.api]}})}))}(n,i),function(e,t){var n=Sn(e,e.forwardReports).subscribe((function(e){var n,r=e.message,o=$n[e.type];o===ut.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:Be(),message:r,origin:at.REPORT,error:n,status:o}})}))}(n,i);var l,d=pr(i).handleLog;if(Vn(c,n,i,r,s),pt())!function(e){var t=dt();e.subscribe(1,(function(e){t.send("log",e)}))}(i);else{var p=function(e,t,n,r,o){var i=Ar(e,{endpoint:e.logsEndpointBuilder,encoder:Ir()},e.replica&&{endpoint:e.replica.logsEndpointBuilder,encoder:Ir()},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()}))}}}));Nr=b(),Dr=Mr,Br=Nr[Ur="DD_LOGS"],Nr[Ur]=Dr,Br&&Br.q&&Br.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)},i="https://docs.datadoghq.com";function a(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 s,u=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))},c=!1;function f(e){c=e}function l(e,t,n){var r=n.value;n.value=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return(s?d(r):r).apply(this,e)}}function d(e){return function(){return p(e,this,arguments)}}function p(e,t,n){try{return e.apply(t,n)}catch(e){if(v(e),s)try{s(e)}catch(e){v(e)}}}function v(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];c&&o.error.apply(o,u(["[MONITOR]"],e,!1))}function g(e,t){return-1!==e.indexOf(t)}function h(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 m(e){return Object.keys(e).map((function(t){return e[t]}))}function y(e,t){return e.slice(0,t.length)===t}function b(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 S(){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 w=1024,C=1024*w,E=/[^\u0000-\u007F]/;function k(e){return E.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length}function _(e,t){var n,r=S();return r.Zone&&"function"==typeof r.Zone.__symbol__&&(n=e[r.Zone.__symbol__(t)]),n||(n=e[t]),n}function x(e,t){return _(S(),"setTimeout")(d(e),t)}function O(e){_(S(),"clearTimeout")(e)}function T(e,t){return _(S(),"setInterval")(d(e),t)}function R(e){_(S(),"clearInterval")(e)}function L(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(){O(o),s=!1,r=void 0}}}function A(){}function I(e,t,n){if("object"!=typeof e||null===e)return JSON.stringify(e);var r=P(Object.prototype),o=P(Array.prototype),i=P(Object.getPrototypeOf(e)),a=P(e);try{return JSON.stringify(e,t,n)}catch(e){return"<error: unable to serialize object>"}finally{r(),o(),i(),a()}}function P(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):A}function N(e,t){return Object.keys(e).some((function(n){return e[n]===t}))}function D(e){return 0===Object.keys(e).length}var U=3*w,B=16*w,M=200;function q(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 a=2===e?U:B,s=r;t.forEach((function(e){s+=e.getBytesCount()})),s>a&&(!function(e){o.warn("Customer data exceeds the recommended ".concat(e/w,"KiB threshold. More details: ").concat(i,"/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-threshold-warning"))}(a),n=!0)}}return{createDetachedTracker:function(){var e=j((function(){return r(e.getBytesCount())}));return e},getOrCreateTracker:function(e){return t.has(e)||t.set(e,j(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 j(e){var t=0,n=L((function(n){t=k(I(n)),e()}),M),r=n.throttled,o=n.cancel,i=function(){o(),t=0};return{updateCustomerData:function(e){D(e)?i():r(e)},resetCustomerData:i,getBytesCount:function(){return t},stop:function(){o()}}}function G(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function H(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]=H(o[i],t[i],n);return o}var a="object"===G(e)?e:{};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(a[s]=H(a[s],t[s],n));return a}}function F(e){return H(void 0,e)}function V(){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=H(e,i))}return e}var z=220*w,J="$",W=3;function Y(e,t){var n;void 0===t&&(t=z);var r=P(Object.prototype),o=P(Array.prototype),i=[],a=new WeakMap,s=K(e,J,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=K(c.source[l],c.path,l,i,a))?JSON.stringify(d).length:4,u+=f,f=1,u>t){Z(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=K(c.source[l],c.path,l,i,a))&&(u+=JSON.stringify(d).length+f+l.length+W,f=1),u>t){Z(t,"truncated",e);break}c.target[l]=d}}return r(),o(),s}Z(t,"discarded",e)}function K(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 Z(e,t,n){o.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),n)}var $=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 F(t)},setContext:function(o){"object"===G(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}var ee,te={GRANTED:"granted",NOT_GRANTED:"not-granted"};function ne(e,t,n,r,o){return re(e,t,[n],r,o)}function re(e,t,n,r,o){var i=void 0===o?{}:o,a=i.once,s=i.capture,u=i.passive,c=d((function(t){(t.isTrusted||t.__ddIsTrusted||e.allowUntrustedEvents)&&(a&&p(),r(t))})),f=u?{capture:s,passive:u}:s,l=_(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 l.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"}(ee||(ee={}));var oe="_dd_c",ie=[];function ae(e,t,n,r){var o=function(e,t){return"".concat(oe,"_").concat(e,"_").concat(t)}(n,r);function i(){var e=localStorage.getItem(o);return null!==e?JSON.parse(e):{}}ie.push(ne(e,window,ee.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(V(i(),t.getContext()))}var se="?";function ue(e){var t=[],n=me(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=le.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=de.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]||se,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=pe.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:se,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=ve.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||se,line:+t[3],url:t[2]}}(e)||function(e){var t=ge.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=he.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]||se,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=se),t.push(n))})),{message:me(e,"message"),name:me(e,"name"),stack:t}}var ce="((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet|<anonymous>|\\w+\\.|\\/).*?)",fe="(?::(\\d+))",le=new RegExp("^\\s*at (.*?) ?\\(".concat(ce).concat(fe,"?").concat(fe,"?\\)?\\s*$"),"i"),de=new RegExp("\\((\\S*)".concat(fe).concat(fe,"\\)"));var pe=new RegExp("^\\s*at ?".concat(ce).concat(fe,"?").concat(fe,"??\\s*$"),"i");var ve=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var ge=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,he=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function me(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=be.exec(e))[1],r=t[2]);return{name:n,message:r}}(e);return{name:i.name,message:i.message,stack:o}}var be=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;function Se(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return p((function(){var n=ue(t);n.stack=n.stack.slice(2),e=we(n)})),e}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 Ee,ke="No stack, consider using an instance of Error";function _e(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(I(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):ke,l=u?Oe(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:xe(n)}}function xe(e){return e instanceof Error&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function Oe(e,t){for(var n=e,r=[];(null==n?void 0:n.cause)instanceof Error&&r.length<10;){var o=ue(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}!function(e){e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql",e.CUSTOM_VITALS="custom_vitals",e.TOLERANT_RESOURCE_TIMINGS="tolerant_resource_timings",e.MICRO_FRONTEND="micro_frontend"}(Ee||(Ee={}));var Te=new Set;function Re(){return Te}var Le,Ae="datad0g.com",Ie="dd0g-gov.com",Pe="datadoghq.com",Ne="pci.browser-intake-datadoghq.com",De=1e3,Ue=60*De,Be=60*Ue;function Me(){return(new Date).getTime()}function qe(){return Me()}function je(){return performance.now()}function Ge(){return{relative:je(),timeStamp:qe()}}function He(e,t){return e+t}function Fe(e){return e-Ve()}function Ve(){return void 0===Le&&(Le=performance.timing.navigationStart),Le}function ze(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}function Je(e){return 0!==e&&100*Math.random()<=e}function We(e){return function(e){return"number"==typeof e}(e)&&e>=0&&e<=100}function Ye(){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}}function Ke(e,t){var n=e.indexOf(t);n>=0&&e.splice(n,1)}var Ze=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){Ke(this.buffer,e)},e.prototype.drain=function(e){this.buffer.forEach((function(t){return t(e)})),this.buffer.length=0},e}(),$e={log:"log",configuration:"configuration",usage:"usage"},Xe=["https://www.datadoghq-browser-agent.com","https://www.datad0g-browser-agent.com","https://d3uc069fcn7uxw.cloudfront.net","https://d20xtzwzcl0ceb.cloudfront.net","http://localhost","<anonymous>"],Qe=["ddog-gov.com"],et=new Ze,tt=function(e){et.add((function(){return tt(e)}))};function nt(e,t){var n,r,o=new $,i=new Set,a=!g(Qe,t.site)&&Je(t.telemetrySampleRate),u=((n={})[$e.log]=a,n[$e.configuration]=a&&Je(t.telemetryConfigurationSampleRate),n[$e.usage]=a&&Je(t.telemetryUsageSampleRate),n),c={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return tt=function(n){var a=I(n);if(u[n.type]&&i.size<t.maxTelemetryEventsPerPage&&!i.has(a)){var s=function(e,t,n){return V({type:"telemetry",date:qe(),service:e,version:"5.20.0",source:"browser",_dd:{format_version:2},telemetry:V(t,{runtime_env:n,connectivity:Ye()}),experimental_features:h(Re())},void 0!==r?r():{})}(e,n,c);o.notify(s),ze("telemetry",s),i.add(a)}},s=ot,{setContextProvider:function(e){r=e},observable:o,enabled:a}}function rt(t,n){v(e.debug,t,n),tt(b({type:$e.log,message:t,status:"debug"},n))}function ot(e,t){tt(b({type:$e.log,status:"error"},function(e){if(e instanceof Error){var t=ue(e);return{error:{kind:t.name,stack:we(it(t))},message:t.message}}return{error:{stack:ke},message:"".concat("Uncaught"," ").concat(I(e))}}(e),t))}function it(e){return e.stack=e.stack.filter((function(e){return!e.url||Xe.some((function(t){return y(e.url,t)}))})),e}function at(e){var t=b({},e);return["id","name","email"].forEach((function(e){e in t&&(t[e]=String(t[e]))})),t}function st(e,t){t.silentMultipleInit||o.error("".concat(e," is already initialized."))}var ut={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"},ct=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},ft={debug:"debug",error:"error",info:"info",warn:"warn"},lt={console:"console",http:"http",silent:"silent"},dt=Object.keys(ft),pt=function(){function e(e,t,n,r,o,i){void 0===r&&(r=lt.http),void 0===o&&(o=ft.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=ft.info),null!=r){var i=_e({stackTrace:r instanceof Error?ue(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:ut.LOGGER,handling:"handled",startClocks:Ge()});o={stack:i.stack,kind:i.type,message:i.message,causes:i.causes}}var a=Y(t),s=o?V({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,ft.debug,n)},e.prototype.info=function(e,t,n){this.log(e,t,ft.info,n)},e.prototype.warn=function(e,t,n){this.log(e,t,ft.warn,n)},e.prototype.error=function(e,t,n){this.log(e,t,ft.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},ct([l],e.prototype,"log",null),e}();function vt(){var e=S().DatadogEventBridge;if(e)return{getCapabilities:function(){var t;return JSON.parse((null===(t=e.getCapabilities)||void 0===t?void 0:t.call(e))||"[]")},getPrivacyLevel:function(){var t;return null===(t=e.getPrivacyLevel)||void 0===t?void 0:t.call(e)},getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n,r){var o=r?{id:r}:void 0;e.send(JSON.stringify({eventType:t,event:n,view:o}))}}}function gt(e){var t;void 0===e&&(e=null===(t=S().location)||void 0===t?void 0:t.hostname);var n=vt();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||(n=e,r=".".concat(t),n.slice(-r.length)===r);var n,r}))}function ht(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,ht)}var mt,yt,bt,St=/([\w-]+)\s*=\s*([^;]+)/g;function wt(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)}function Ct(){return null!=mt?mt:mt=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 Et(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 kt(e){return function(e,t){for(St.lastIndex=0;;){var n=St.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function _t(e){return yt||(yt=function(e){var t=new Map;for(St.lastIndex=0;;){var n=St.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),yt.get(e)}function xt(e,t){Et(e,"",0,t)}var Ot="_dd_s",Tt=4*Be,Rt=15*Ue,Lt=/^([a-zA-Z]+)=([a-z0-9-]+)$/,At="&",It="1";function Pt(){return{isExpired:It}}function Nt(e){return D(e)}function Dt(e){return!Nt(e)}function Ut(e){return void 0!==e.isExpired||!((void 0===(t=e).created||Me()-Number(t.created)<Tt)&&(void 0===t.expire||Me()<Number(t.expire)));var t}function Bt(e){e.expire=String(Me()+Rt)}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(At);var t}function qt(e){var t={};return function(e){return!!e&&(-1!==e.indexOf(At)||Lt.test(e))}(e)&&e.split(At).forEach((function(e){var n=Lt.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}var jt="_dd",Gt="_dd_r",Ht="_dd_l",Ft="rum",Vt="logs";function zt(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===bt){for(var e="dd_site_test_".concat(ht()),t=window.location.hostname.split("."),n=t.pop();t.length&&!kt(e);)n="".concat(t.pop(),".").concat(n),Et(e,"test",De,{domain:n});xt(e,{domain:n}),bt=n}return bt}());return t}(e);return function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_".concat(ht()),n="test";Et(t,n,Ue,e);var r=kt(t)===n;return xt(t,e),r}catch(e){return o.error(e),!1}}(t)?{type:"Cookie",cookieOptions:t}:void 0}function Jt(e){var t,n={isLockEnabled:1===Ct(),persistSession:(t=e,function(e){Et(Ot,Mt(e),Rt,t)}),retrieveSession:Wt,expireSession:function(){return function(e){Et(Ot,Mt(Pt()),Tt,e)}(e)}};return function(e){if(!_t(Ot)){var t=_t(jt),n=_t(Gt),r=_t(Ht),o={};t&&(o.id=t),r&&/^[01]$/.test(r)&&(o[Vt]=r),n&&/^[012]$/.test(n)&&(o[Ft]=n),Dt(o)&&(Bt(o),e.persistSession(o))}}(n),n}function Wt(){return qt(kt(Ot))}var Yt="_dd_test_";function Kt(e){localStorage.setItem(Ot,Mt(e))}function Zt(){return qt(localStorage.getItem(Ot))}function $t(){Kt(Pt())}var Xt,Qt=10,en=100,tn=[];function nn(e,t,n){var r;void 0===n&&(n=0);var o=t.isLockEnabled,i=t.persistSession,a=t.expireSession,s=function(e){return i(b({},e,{lock:c}))},u=function(){var e=t.retrieveSession(),n=e.lock;return e.lock&&delete e.lock,{session:e,lock:n}};if(Xt||(Xt=e),e===Xt)if(o&&n>=en)on(t);else{var c,f=u();if(o){if(f.lock)return void rn(e,t,n);if(c=ht(),s(f.session),(f=u()).lock!==c)return void rn(e,t,n)}var l=e.process(f.session);if(o&&(f=u()).lock!==c)rn(e,t,n);else{if(l&&(Ut(l)?a():(Bt(l),o?s(l):i(l))),o&&(!l||!Ut(l))){if((f=u()).lock!==c)return void rn(e,t,n);i(f.session),l=f.session}null===(r=e.after)||void 0===r||r.call(e,l||f.session),on(t)}}else tn.push(e)}function rn(e,t,n){x((function(){nn(e,t,n+1)}),Qt)}function on(e){Xt=void 0;var t=tn.shift();t&&nn(t,e)}var an=De;function sn(e){var t=zt(e);return!t&&e.allowFallbackToLocalStorage&&(t=function(){try{var e=ht(),t="".concat(Yt).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 un(e,t,n){var r,o=new $,i=new $,a="Cookie"===e.type?Jt(e.cookieOptions):{isLockEnabled:!1,persistSession:Kt,retrieveSession:Zt,expireSession:$t},s=a.expireSession,u=T((function(){nn({process:function(e){return Ut(e)?Pt():void 0},after:d},a)}),an);p();var c=L((function(){nn({process:function(e){if(!Nt(e)){var r=d(e);return function(e){if(Nt(e))return!1;var r=n(e[t]),o=r.trackingType,i=r.isTracked;e[t]=o,delete e.isExpired,i&&!e.id&&(e.id=ht(),e.created=String(Me()))}(r),r}},after:function(e){Dt(e)&&!v()&&function(e){r=e,o.notify()}(e),r=e}},a)}),an),f=c.throttled,l=c.cancel;function d(e){return Ut(e)&&(e=Pt()),v()&&(!function(e){return r.id!==e.id||r[t]!==e[t]}(e)?r=e:(r=Pt(),i.notify())),e}function p(){nn({process:function(e){if(Nt(e))return Pt()},after:function(e){r=e}},a)}function v(){return void 0!==r[t]}return{expandOrRenewSession:f,expandSession:function(){nn({process:function(e){return v()?d(e):void 0}},a)},getSession:function(){return r},renewObservable:o,expireObservable:i,restartSession:p,expire:function(){l(),s(),d(Pt())},stop:function(){R(u)}}}function cn(e){return fn(e,location.href).href}function fn(e,t){var n=function(){if(void 0===ln)try{var e=new dn("http://test/path");ln="http://test/path"===e.href}catch(e){ln=!1}return ln?dn: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(I({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 ln,dn=URL;function pn(e,t,n){var r=function(e,t){var n="/api/v2/".concat(t),r=e.proxy;if("string"==typeof r){var o=cn(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,t){var n=t.site,r=void 0===n?Pe:n,o=t.internalAnalyticsSubdomain;if("logs"===e&&t.usePciIntake&&r===Pe)return Ne;if(o&&r===Pe)return"".concat(o,".").concat(Pe);if(r===Ie)return"http-intake.logs.".concat(r);var i=r.split("."),a=i.pop();return"browser-intake-".concat(i.join("-"),".").concat(a)}(t,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.encoding,c=["sdk_version:".concat("5.20.0"),"api:".concat(r)].concat(n);s&&c.push("retry_count:".concat(s.count),"retry_after:".concat(s.lastFailureStatus));var f=["ddsource=browser","ddtags=".concat(encodeURIComponent(c.join(","))),"dd-api-key=".concat(i),"dd-evp-origin-version=".concat(encodeURIComponent("5.20.0")),"dd-evp-origin=browser","dd-request-id=".concat(ht())];u&&f.push("dd-evp-encoding=".concat(u));"rum"===t&&f.push("batch_time=".concat(qe()));a&&f.reverse();return f.join("&")}(e,t,n,o,i);return r(a)},urlPrefix:r(""),trackType:t}}var vn=200;var gn=/[^a-z0-9_:./-]/;function hn(e,t){var n=vn-e.length-1;(t.length>n||gn.test(t))&&o.warn("".concat(e," value doesn't meet tag requirements and will be sanitized. More details: ").concat(i,"/getting_started/tagging/#defining-tags"));var r=t.replace(/,/g,"_");return"".concat(e,":").concat(r)}function mn(e){var t=e.site||Pe,n=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,i=[];return t&&i.push(hn("env",t)),n&&i.push(hn("service",n)),r&&i.push(hn("version",r)),o&&i.push(hn("datacenter",o)),i}(e),r=function(e,t){return{logsEndpointBuilder:pn(e,"logs",t),rumEndpointBuilder:pn(e,"rum",t),sessionReplayEndpointBuilder:pn(e,"replay",t)}}(e,n),o=function(e,t){var n=m(e).map((function(e){return e.urlPrefix}));t===Pe&&n.push("https://".concat(Ne,"/"));return n}(r,t),i=function(e,t,n){if(!e.replica)return;var r=b({},e,{site:Pe,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:pn(r,"logs",n),rumEndpointBuilder:pn(r,"rum",n)};return t.push.apply(t,m(o).map((function(e){return e.urlPrefix}))),b({applicationId:e.replica.applicationId},o)}(e,o,n);return b({isIntakeUrl:function(e){return o.some((function(t){return 0===e.indexOf(t)}))},replica:i,site:t},r)}function yn(e,t){return null==e||"string"==typeof e||(o.error("".concat(t," must be defined as a string")),!1)}function bn(e){var t,n,r,s,u;if(e&&e.clientToken)if(void 0===e.sessionSampleRate||We(e.sessionSampleRate))if(void 0===e.telemetrySampleRate||We(e.telemetrySampleRate))if(void 0===e.telemetryConfigurationSampleRate||We(e.telemetryConfigurationSampleRate))if(void 0===e.telemetryUsageSampleRate||We(e.telemetryUsageSampleRate)){if(yn(e.version,"Version")&&yn(e.env,"Env")&&yn(e.service,"Service"))if(void 0===e.trackingConsent||N(te,e.trackingConsent)){var c;if(!e.site||(c=e.site,/(datadog|ddog|datad0g|dd0g)/.test(c)))return Array.isArray(e.enableExperimentalFeatures)&&e.enableExperimentalFeatures.filter((function(e){return N(Ee,e)})).forEach((function(e){Te.add(e)})),b({beforeSend:e.beforeSend&&a(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:sn(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,telemetryUsageSampleRate:null!==(s=e.telemetryUsageSampleRate)&&void 0!==s?s:5,service:e.service||void 0,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,trackingConsent:null!==(u=e.trackingConsent)&&void 0!==u?u:te.GRANTED,batchBytesLimit:16*w,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*De,batchMessagesLimit:50,messageBytesLimit:256*w},mn(e));o.error("Site should be a valid Datadog site. Learn more here: ".concat(i,"/getting_started/site/."))}else o.error('Tracking Consent should be either "granted" or "not-granted"')}else o.error("Telemetry Usage Sample Rate should be a number between 0 and 100");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 Sn={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function wn(e,t){var n=[];g(t,Sn.cspViolation)&&n.push(function(e){return new $((function(t){return ne(e,document,ee.SECURITY_POLICY_VIOLATION,(function(e){t.notify(function(e){var t=Sn.cspViolation,n="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return{type:Sn.cspViolation,subtype:e.effectiveDirective,message:"".concat(t,": ").concat(n),stack:Cn(e.effectiveDirective,e.originalPolicy?"".concat(n,' of the policy "').concat(wt(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber),originalReport:e}}(e))})).stop}))}(e));var r=t.filter((function(e){return e!==Sn.cspViolation}));return r.length&&n.push(function(e){return new $((function(t){if(window.ReportingObserver){var n=d((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:Cn(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 Cn(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 En=32*w;function kn(e,t,n){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((function(e){return g(t,e)}))?"all"===e?t:(r=e,i=new Set,r.forEach((function(e){return i.add(e)})),h(i)):void o.error("".concat(n,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'));var r,i}function _n(t,n,r){var i,a,s=new Ze,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(gt()&&(t=function(e){return b({},e,{clientToken:"empty"})}(t)),i=t,a)st("DD_LOGS",t);else{var r=function(t){!0===t.usePciIntake&&t.site&&"datadoghq.com"!==t.site&&o.warn("PCI compliance for Logs is only available for Datadog organizations in the US1 site. Default intake will be used.");var n=bn(t),r=kn(t.forwardConsoleLogs,m(e),"Forward Console Logs"),i=kn(t.forwardReports,m(Sn),"Forward Reports");if(n&&r&&i)return t.forwardErrorsToLogs&&!g(r,e.error)&&r.push(e.error),b({forwardErrorsToLogs:!1!==t.forwardErrorsToLogs,forwardConsoleLogs:r,forwardReports:i,requestErrorResponseLengthLimit:En,sendLogsAfterSessionExpiration:!!t.sendLogsAfterSessionExpiration},n)}(t);r&&(a=r,n.tryToInit(r.trackingConsent),c())}else o.error("Missing configuration")},get initConfiguration(){return i},getInternalContext:A,handleLog:function(e,n,r,o){void 0===r&&(r=t()),void 0===o&&(o=qe()),s.add((function(t){return t.handleLog(e,n,r,o)}))}}}var xn="logs";var On={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};var Tn="datadog-synthetics-public-id",Rn="datadog-synthetics-result-id",Ln="datadog-synthetics-injects-rum";function An(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||_t(Ln))}function In(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||_t(Rn);return"string"==typeof e?e:void 0}var Pn=1/0,Nn=Ue,Dn=function(){function e(e,t){var n=this;this.expireDelay=e,this.maxEntries=t,this.entries=[],this.clearOldValuesInterval=T((function(){return n.clearOldValues()}),Nn)}return e.prototype.add=function(e,t){var n=this,r={value:e,startTime:t,endTime:Pn,remove:function(){Ke(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,t){void 0===e&&(e=Pn),void 0===t&&(t={returnInactive:!1});for(var n=0,r=this.entries;n<r.length;n++){var o=r[n];if(o.startTime<=e){if(t.returnInactive||e<=o.endTime)return o.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=He(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(){R(this.clearOldValuesInterval)},e.prototype.clearOldValues=function(){for(var e=je()-this.expireDelay;this.entries.length>0&&this.entries[this.entries.length-1].endTime<e;)this.entries.pop()},e}(),Un=Ue,Bn=Tt,Mn=[];function qn(e,t,n,r){var o=new $,i=new $,a=un(e.sessionStoreStrategyType,t,n);Mn.push((function(){return a.stop()}));var s=new Dn(Bn);function u(){return{id:a.getSession().id,trackingType:a.getSession()[t]}}return Mn.push((function(){return s.stop()})),a.renewObservable.subscribe((function(){s.add(u(),je()),o.notify()})),a.expireObservable.subscribe((function(){i.notify(),s.closeActive(je())})),a.expandOrRenewSession(),s.add(u(),[0,Ve()][0]),r.observable.subscribe((function(){r.isGranted()?a.expandOrRenewSession():a.expire()})),function(e,t){var n=re(e,window,[ee.CLICK,ee.TOUCH_START,ee.KEY_DOWN,ee.SCROLL],t,{capture:!0,passive:!0}).stop;Mn.push(n)}(e,(function(){r.isGranted()&&a.expandOrRenewSession()})),function(e,t){var n=function(){"visible"===document.visibilityState&&t()},r=ne(e,document,ee.VISIBILITY_CHANGE,n).stop;Mn.push(r);var o=T(n,Un);Mn.push((function(){R(o)}))}(e,(function(){return a.expandSession()})),function(e,t){var n=ne(e,window,ee.RESUME,t,{capture:!0}).stop;Mn.push(n)}(e,(function(){return a.restartSession()})),{findSession:function(e,t){return s.find(e,t)},renewObservable:o,expireObservable:i,expire:a.expire}}var jn="logs";function Gn(e,t){var n=qn(e,jn,(function(t){return function(e,t){var n=function(e){return"0"===e||"1"===e}(t)?t:Hn(e);return{trackingType:n,isTracked:"1"===n}}(e,t)}),t);return{findTrackedSession:function(e,t){void 0===t&&(t={returnInactive:!1});var r=n.findSession(e,t);return r&&"1"===r.trackingType?{id:r.id}:void 0},expireObservable:n.expireObservable}}function Hn(e){return Je(e.sessionSampleRate)?"1":"0"}var Fn=!1;function Vn(e){var t,n=window;if(An()){var r=o(n.DD_RUM_SYNTHETICS);return r||Fn||(Fn=!0,rt("Logs sent before RUM is injected by the synthetics worker",{testId:(t=window._DATADOG_SYNTHETICS_PUBLIC_ID||_t(Tn),"string"==typeof t?t:void 0),resultId:In()})),r}return o(n.DD_RUM);function o(t){if(t&&t.getInternalContext)return t.getInternalContext(e)}}function zn(e,t,n,r,o){var i=dt.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}),Ue),(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:ut.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=o.domainContext,v=Fe(u.date),g=e.findTrackedSession(v);if(g||t.sendLogsAfterSessionExpiration&&e.findTrackedSession(v,{returnInactive:!0})){var h=d||r(),m=V({service:t.service,session_id:null==g?void 0:g.id,usr:D(h.user)?void 0:h.user,view:h.view},h.context,Vn(v),u,f);!1===(null===(i=t.beforeSend)||void 0===i?void 0:i.call(t,m,p))||m.origin!==ut.AGENT&&(null!==(s=a[m.status])&&void 0!==s?s:a.custom).isLimitReached()||n.notify(1,m)}}))}var Jn,Wn={};function Yn(n){var r=n.map((function(n){return Wn[n]||(Wn[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=Se();p((function(){r.notify(function(t,n,r){var o,i,a,s=t.map((function(e){return function(e){if("string"==typeof e)return Y(e);if(e instanceof Error)return Ce(ue(e));return I(Y(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?we(ue(u)):void 0,i=xe(u),a=u?Oe(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)),Wn[n]}));return X.apply(void 0,r)}var Kn,Zn=((Jn={})[e.log]=ft.info,Jn[e.debug]=ft.debug,Jn[e.info]=ft.info,Jn[e.warn]=ft.warn,Jn[e.error]=ft.error,Jn);var $n,Xn=((Kn={})[Sn.cspViolation]=ft.error,Kn[Sn.intervention]=ft.error,Kn[Sn.deprecation]=ft.warn,Kn);function Qn(e,t,n,r){var o=(void 0===r?{}:r).computeHandlingStack,i=e[t];if("function"!=typeof i){if(!y(t,"on"))return{stop:A};i=A}var a=!1,s=function(){if(a)return i.apply(this,arguments);var e,t=h(arguments);p(n,null,[{target:this,parameters:t,onPostCall:function(t){e=t},handlingStack:o?Se():void 0}]);var r=i.apply(this,t);return e&&p(e,null,[r]),r};return e[t]=s,{stop:function(){a=!0,e[t]===s&&(e[t]=i)}}}var er,tr=new WeakMap;function nr(e){return $n||($n=function(e){return new $((function(t){var n=Qn(XMLHttpRequest.prototype,"open",rr).stop,r=Qn(XMLHttpRequest.prototype,"send",(function(n){!function(e,t,n){var r=e.target,o=e.handlingStack,i=tr.get(r);if(!i)return;var a=i;a.state="start",a.startClocks=Ge(),a.isAborted=!1,a.xhr=r,a.handlingStack=o;var s=!1,u=Qn(r,"onreadystatechange",(function(){r.readyState===XMLHttpRequest.DONE&&c()})).stop,c=function(){if(f(),u(),!s){s=!0;var e,t=i;t.state="complete",t.duration=(e=a.startClocks.timeStamp,qe()-e),t.status=r.status,n.notify(b({},t))}},f=ne(t,r,"loadend",c).stop;n.notify(a)}(n,e,t)}),{computeHandlingStack:!0}).stop,o=Qn(XMLHttpRequest.prototype,"abort",or).stop;return function(){n(),r(),o()}}))}(e)),$n}function rr(e){var t=e.target,n=e.parameters,r=n[0],o=n[1];tr.set(t,{state:"open",method:String(r).toUpperCase(),url:cn(String(o))})}function or(e){var t=e.target,n=tr.get(t);n&&(n.isAborted=!0)}function ir(){return er||(er=new $((function(e){if(window.fetch){var t=Qn(window,"fetch",(function(t){return function(e,t){var n=e.parameters,r=e.onPostCall,o=e.handlingStack,i=n[0],a=n[1],s=a&&a.method;void 0===s&&i instanceof Request&&(s=i.method);var u=void 0!==s?String(s).toUpperCase():"GET",c=i instanceof Request?i.url:cn(String(i)),f=Ge(),l={state:"start",init:a,input:i,method:u,startClocks:f,url:c,handlingStack:o};t.notify(l),n[0]=l.input,n[1]=l.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(d(r),d(r))}(t,e,l)}))}(t,e)}),{computeHandlingStack:!0}).stop;return t}}))),er}function ar(e){return e>=500}function sr(e,t){if(!e.forwardErrorsToLogs)return{stop:A};var n=nr(e).subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=ir().subscribe((function(e){"resolve"===e.state&&o("fetch",e)}));function o(n,r){function o(e){var o={isAborted:r.isAborted};t.notify(0,{rawLogsEvent:{message:"".concat(cr(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:ft.error,origin:ut.NETWORK},domainContext:o})}e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!ar(r.status)||("xhr"in r?function(e,t,n){"string"==typeof e.response?n(ur(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(A),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(d((function(t){t.done?a():(n.collectStreamBody&&o.push(t.value),(i+=t.value.length)>n.bytesLimit?a():e())})),d((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(d((function(e){return n(ur(e,t))})),d((function(e){return n("Unable to retrieve response: ".concat(e))}))):n()}(r.response,e,o):r.error&&function(e,t,n){n(ur(we(ue(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function ur(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function cr(e){return"xhr"===e?"XHR":"Fetch"}function fr(e){var t,n=function(t,n){var r=_e({stackTrace:t,originalError:n,startClocks:Ge(),nonErrorPrefix:"Uncaught",source:ut.SOURCE,handling:"unhandled"});e.notify(r)},r=(t=n,Qn(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?ue(u):ye(o,i,a,s),t(n,null!=u?u:o)}))).stop,o=function(e){return Qn(window,"onunhandledrejection",(function(t){var n=t.parameters[0].reason||"Empty reason",r=ue(n);e(r,n)}))}(n).stop;return{stop:function(){r(),o()}}}var lr,dr=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}(),pr=((lr={})[ft.debug]=0,lr[ft.info]=1,lr[ft.warn]=2,lr[ft.error]=3,lr);function vr(e){return{handleLog:function(r,o,i,a){var s=V(o.getContext(),r.context);gr(r.status,lt.console,o)&&function(e,r){n[e.status].call(t,e.message,r)}(r,s),gr(r.status,lt.http,o)&&e.notify(0,{rawLogsEvent:{date:a||qe(),message:r.message,status:r.status,origin:ut.LOGGER},messageContext:s,savedCommonContext:i})}}}function gr(e,t,n){var r=n.getHandler(),o=Array.isArray(r)?r:[r];return pr[e]>=pr[n.getLevel()]&&g(o,t)}var hr=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=m(this.upsertBuffer).join("\n");this.upsertBuffer={};var n,r=(n=e.reason,g(m(On),n)),o=r?this.request.sendOnExit:this.request.send;if(r&&this.encoder.isAsync){var i=this.encoder.finishSync();i.outputBytesCount&&o(mr(i));var a=[i.pendingData,t].filter(Boolean).join("\n");a&&o({data:a,bytesCount:k(a)})}else t&&this.encoder.write(this.encoder.isEmpty?t:"\n".concat(t)),this.encoder.finish((function(e){o(mr(e))}))},e.prototype.addOrUpdate=function(e,t){var n=I(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. More details: ").concat(i,"/real_user_monitoring/browser/troubleshooting/#technical-limitations")):(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 mr(e){return{data:"string"==typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),bytesCount:e.outputBytesCount,encoding:e.encoding}}var yr=80*w,br=32,Sr=3*C,wr=Ue,Cr=De;function Er(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?_r(e,t,n,{onSuccess:function(){return xr(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),kr(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function kr(e,t,n,r){2===e.transportStatus&&x((function(){_r(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=Cr,xr(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(wr,2*e.currentBackoffTime),kr(e,t,n,r)}})}),e.currentBackoffTime)}function _r(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||ar(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 xr(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(Sr/C,"MiB"),source:ut.AGENT,startClocks:Ge()}),t.queueFullReported=!0);var i=t.queuedPayloads;for(t.queuedPayloads=Or();i.size()>0;)Er(i.dequeue(),t,n,r,o)}function Or(){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>=Sr}}}function Tr(e,t,n,r){var o={transportStatus:0,currentBackoffTime:Cr,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=yr&&this.ongoingRequestCount<br},add:function(e){this.ongoingRequestCount+=1,this.ongoingByteCount+=e.bytesCount},remove:function(e){this.ongoingRequestCount-=1,this.ongoingByteCount-=e.bytesCount}},queuedPayloads:Or(),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(d((function(e){return null==o?void 0:o({status:e.status,type:e.type})})),d((function(){var n=t.build("xhr",r);Lr(e,n,r.data,o)})))}else{var s=t.build("xhr",r);Lr(e,s,r.data,o)}}(e,t,n,r,o)};return{send:function(e){Er(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){Rr||(Rr=!0,ot(e))}(e)}var a=t.build("xhr",r);Lr(e,a,r.data)}(e,t,n,r)}}}var Rr=!1;function Lr(e,t,n,r){var o=new XMLHttpRequest;o.open("POST",t,!0),n instanceof Blob&&o.setRequestHeader("Content-Type",n.type),ne(e,o,"loadend",(function(){null==r||r({status:o.status})}),{once:!0}),o.send(n)}function Ar(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(){O(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 Ir(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 hr(a,Tr(e,n,e.batchBytesLimit,r),Ar({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 Pr(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(n,r){var o=k(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 Nr(e,t,n,r,o){var i=nt("browser-logs-sdk",t);i.setContextProvider((function(){var e,t,n,r,i,a;return{application:{id:null===(e=Vn())||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=Vn())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(a=null===(i=Vn())||void 0===i?void 0:i.user_action)||void 0===a?void 0:a.id}}}));var a=[];if(gt()){var s=vt(),u=i.observable.subscribe((function(e){return s.send("internal_telemetry",e)}));a.push((function(){return u.unsubscribe()}))}else{var c=Ir(t,{endpoint:t.rumEndpointBuilder,encoder:Pr()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:Pr()},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===Ae}(t))}));a.push((function(){return f.unsubscribe()}))}return et.drain(),function(e){tt({type:$e.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,telemetry_usage_sample_rate:t.telemetryUsageSampleRate,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,tracking_consent:t.trackingConsent};return b({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports,use_pci_intake:e.usePciIntake,send_logs_after_session_expiration:e.sendLogsAfterSessionExpiration},n)}(e)),{telemetry:i,stop:function(){a.forEach((function(e){return e()}))}}}var Dr,Ur,Br,Mr,qr=function(e){var t,n,r=q(),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 t===te.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 c,l,p=_n(u,s,(function(t,n){t.storeContextsAcrossPages&&(ae(n,i,xn,2),ae(n,a,xn,1));var r=e(t,n,u,s);return p=function(e,t){return b({init:function(e){st("DD_LOGS",e)},initConfiguration:e},t)}(t,r),r})),v={},g=new pt((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p.handleLog.apply(p,e)}),r.createDetachedTracker());return c={logger:g,init:d((function(e){return p.init(e)})),setTrackingConsent:d((function(e){var t;s.update(e),t={feature:"set-tracking-consent",tracking_consent:e},tt({type:$e.usage,usage:t})})),getGlobalContext:d((function(){return i.getContext()})),setGlobalContext:d((function(e){return i.setContext(e)})),setGlobalContextProperty:d((function(e,t){return i.setContextProperty(e,t)})),removeGlobalContextProperty:d((function(e){return i.removeContextProperty(e)})),clearGlobalContext:d((function(){return i.clearContext()})),createLogger:d((function(e,t){return void 0===t&&(t={}),v[e]=new pt((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return p.handleLog.apply(p,e)}),r.createDetachedTracker(),Y(e),t.handler,t.level,Y(t.context)),v[e]})),getLogger:d((function(e){return v[e]})),getInitConfiguration:d((function(){return F(p.initConfiguration)})),getInternalContext:d((function(e){return p.getInternalContext(e)})),setUser:d((function(e){(function(e){var t="object"===G(e);return t||o.error("Unsupported user:",e),t})(e)&&a.setContext(at(e))})),getUser:d((function(){return a.getContext()})),setUserProperty:d((function(e,t){var n,r=at((n={},n[e]=t,n))[e];a.setContextProperty(e,r)})),removeUserProperty:d((function(e){return a.removeContextProperty(e)})),clearUser:d((function(){return a.clearContext()}))},l=b({version:"5.20.0",onReady:function(e){e()}},c),Object.defineProperty(l,"_setDebug",{get:function(){return f},enumerable:!1}),l}((function(t,n,r,o){var i=new dr,a=[];i.subscribe(1,(function(e){return ze("logs",e)}));var s=function(e){return function(t){e.notify(0,{rawLogsEvent:{message:t.message,date:t.startClocks.timeStamp,origin:ut.AGENT,status:ft.error}}),rt("Error reported to customer",{"error.message":t.message})}}(i),u=function(e){return new $((function(t){var n=re(e,window,[ee.VISIBILITY_CHANGE,ee.FREEZE],(function(e){e.type===ee.VISIBILITY_CHANGE&&"hidden"===document.visibilityState?t.notify({reason:On.HIDDEN}):e.type===ee.FREEZE&&t.notify({reason:On.FROZEN})}),{capture:!0}).stop,r=ne(e,window,ee.BEFORE_UNLOAD,(function(){t.notify({reason:On.UNLOADING})})).stop;return function(){n(),r()}}))}(n),c=!n.sessionStoreStrategyType||gt()||An()?function(e){var t="1"===Hn(e)?{}:void 0;return{findTrackedSession:function(){return t},expireObservable:new $}}(n):Gn(n,o),f=Nr(t,n,s,u,c).stop;a.push((function(){return f()})),sr(n,i),function(e,t){if(!e.forwardErrorsToLogs)return{stop:A};var n=new $,r=fr(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:ut.SOURCE,status:ft.error}})}))}(n,i),function(t,n){var r=Yn(t.forwardConsoleLogs).subscribe((function(t){n.notify(0,{rawLogsEvent:{date:qe(),message:t.message,origin:ut.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=wn(e,e.forwardReports).subscribe((function(e){var n,r=e.message,o=Xn[e.type];o===ft.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:qe(),message:r,origin:ut.REPORT,error:n,status:o}})}))}(n,i);var l,d=vr(i).handleLog;if(zn(c,n,i,r,s),gt())!function(e){var t=vt();e.subscribe(1,(function(e){t.send("log",e)}))}(i);else{var p=function(e,t,n,r,o){var i=Ir(e,{endpoint:e.logsEndpointBuilder,encoder:Pr()},e.replica&&{endpoint:e.replica.logsEndpointBuilder,encoder:Pr()},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()}))}}}));Dr=S(),Br=qr,(Mr=Dr[Ur="DD_LOGS"])&&!Mr.q&&Mr.version&&o.warn("SDK is loaded more than once. This is unsupported and might have unexpected behavior."),Dr[Ur]=Br,Mr&&Mr.q&&Mr.q.forEach((function(e){return a(e,"onReady callback threw an error:")()}))}(); |
@@ -1,5 +0,6 @@ | ||
import type { Context, TrackingConsent, User } from '@datadog/browser-core'; | ||
import type { Context, TrackingConsent, User, PublicApi } from '@datadog/browser-core'; | ||
import type { LogsInitConfiguration } from '../domain/configuration'; | ||
import type { HandlerType, StatusType } from '../domain/logger'; | ||
import { Logger } from '../domain/logger'; | ||
import type { InternalContext } from '../domain/contexts/internalContext'; | ||
import type { StartLogs, StartLogsResult } from './startLogs'; | ||
@@ -11,11 +12,10 @@ export interface LoggerConfiguration { | ||
} | ||
export type LogsPublicApi = ReturnType<typeof makeLogsPublicApi>; | ||
export interface Strategy { | ||
init: (initConfiguration: LogsInitConfiguration) => void; | ||
initConfiguration: LogsInitConfiguration | undefined; | ||
getInternalContext: StartLogsResult['getInternalContext']; | ||
handleLog: StartLogsResult['handleLog']; | ||
} | ||
export declare function makeLogsPublicApi(startLogsImpl: StartLogs): { | ||
export interface LogsPublicApi extends PublicApi { | ||
logger: Logger; | ||
/** | ||
* Init the Logs browser SDK. | ||
* @param initConfiguration Configuration options of the SDK | ||
* | ||
* See [Browser Log Collection](https://docs.datadoghq.com/logs/log_collection/javascript) for further information. | ||
*/ | ||
init: (initConfiguration: LogsInitConfiguration) => void; | ||
@@ -35,19 +35,99 @@ /** | ||
setTrackingConsent: (trackingConsent: TrackingConsent) => void; | ||
/** | ||
* Get the global Context | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
getGlobalContext: () => Context; | ||
/** | ||
* Set the global context information to all logs, stored in `@context` | ||
* | ||
* @param context Global context | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
setGlobalContext: (context: any) => void; | ||
/** | ||
* Set or update a global context property, stored in `@context.<key>` | ||
* | ||
* @param key Key of the property | ||
* @param property Value of the property | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
setGlobalContextProperty: (key: any, value: any) => void; | ||
/** | ||
* Remove a global context property | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
removeGlobalContextProperty: (key: any) => void; | ||
/** | ||
* Clear the global context | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
clearGlobalContext: () => void; | ||
/** | ||
* The Datadog browser logs SDK contains a default logger `DD_LOGS.logger`, but this API allows to create different ones. | ||
* | ||
* See [Define multiple loggers](https://docs.datadoghq.com/logs/log_collection/javascript/#define-multiple-loggers) for further information. | ||
*/ | ||
createLogger: (name: string, conf?: LoggerConfiguration) => Logger; | ||
/** | ||
* Get a logger | ||
* | ||
* See [Define multiple loggers](https://docs.datadoghq.com/logs/log_collection/javascript/#define-multiple-loggers) for further information. | ||
*/ | ||
getLogger: (name: string) => Logger | undefined; | ||
/** | ||
* Get the init configuration | ||
*/ | ||
getInitConfiguration: () => LogsInitConfiguration | undefined; | ||
getInternalContext: (startTime?: number | undefined) => import("../domain/contexts/internalContext").InternalContext | undefined; | ||
/** | ||
* [Internal API] Get the internal SDK context | ||
* | ||
* See [Access internal context](https://docs.datadoghq.com/logs/log_collection/javascript/#access-internal-context) for further information. | ||
*/ | ||
getInternalContext: (startTime?: number | undefined) => InternalContext | undefined; | ||
/** | ||
* Set user information to all events, stored in `@usr` | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
setUser: (newUser: User) => void; | ||
/** | ||
* Get user information | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
getUser: () => Context; | ||
/** | ||
* Set or update the user property, stored in `@usr.<key>` | ||
* | ||
* @param key Key of the property | ||
* @param property Value of the property | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
setUserProperty: (key: any, property: any) => void; | ||
/** | ||
* Remove a user property | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
removeUserProperty: (key: any) => void; | ||
/** | ||
* Clear all user information | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
clearUser: () => void; | ||
} & { | ||
onReady(callback: () => void): void; | ||
version: string; | ||
}; | ||
} | ||
export interface Strategy { | ||
init: (initConfiguration: LogsInitConfiguration) => void; | ||
initConfiguration: LogsInitConfiguration | undefined; | ||
getInternalContext: StartLogsResult['getInternalContext']; | ||
handleLog: StartLogsResult['handleLog']; | ||
} | ||
export declare function makeLogsPublicApi(startLogsImpl: StartLogs): LogsPublicApi; |
@@ -37,14 +37,2 @@ "use strict"; | ||
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) { | ||
@@ -51,0 +39,0 @@ trackingConsentState.update(trackingConsent); |
@@ -0,1 +1,2 @@ | ||
import type { LogsPublicApi } from '../boot/logsPublicApi'; | ||
export { Logger, LogsMessage, StatusType, HandlerType } from '../domain/logger'; | ||
@@ -5,23 +6,2 @@ export { LoggerConfiguration, LogsPublicApi as LogsGlobal } from '../boot/logsPublicApi'; | ||
export { LogsEvent } from '../logsEvent.types'; | ||
export declare const datadogLogs: { | ||
logger: import("../domain/logger").Logger; | ||
init: (initConfiguration: import("../domain/configuration").LogsInitConfiguration) => void; | ||
setTrackingConsent: (trackingConsent: import("@datadog/browser-core").TrackingConsent) => void; | ||
getGlobalContext: () => import("@datadog/browser-core").Context; | ||
setGlobalContext: (context: any) => void; | ||
setGlobalContextProperty: (key: any, value: any) => void; | ||
removeGlobalContextProperty: (key: any) => void; | ||
clearGlobalContext: () => void; | ||
createLogger: (name: string, conf?: import("../boot/logsPublicApi").LoggerConfiguration) => import("../domain/logger").Logger; | ||
getLogger: (name: string) => import("../domain/logger").Logger | undefined; | ||
getInitConfiguration: () => import("../domain/configuration").LogsInitConfiguration | undefined; | ||
getInternalContext: (startTime?: number | undefined) => import("../domain/contexts/internalContext").InternalContext | undefined; | ||
setUser: (newUser: import("@datadog/browser-core").User) => void; | ||
getUser: () => import("@datadog/browser-core").Context; | ||
setUserProperty: (key: any, property: any) => void; | ||
removeUserProperty: (key: any) => void; | ||
clearUser: () => void; | ||
} & { | ||
onReady(callback: () => void): void; | ||
version: string; | ||
}; | ||
export declare const datadogLogs: LogsPublicApi; |
@@ -1,5 +0,6 @@ | ||
import type { Context, TrackingConsent, User } from '@datadog/browser-core'; | ||
import type { Context, TrackingConsent, User, PublicApi } from '@datadog/browser-core'; | ||
import type { LogsInitConfiguration } from '../domain/configuration'; | ||
import type { HandlerType, StatusType } from '../domain/logger'; | ||
import { Logger } from '../domain/logger'; | ||
import type { InternalContext } from '../domain/contexts/internalContext'; | ||
import type { StartLogs, StartLogsResult } from './startLogs'; | ||
@@ -11,11 +12,10 @@ export interface LoggerConfiguration { | ||
} | ||
export type LogsPublicApi = ReturnType<typeof makeLogsPublicApi>; | ||
export interface Strategy { | ||
init: (initConfiguration: LogsInitConfiguration) => void; | ||
initConfiguration: LogsInitConfiguration | undefined; | ||
getInternalContext: StartLogsResult['getInternalContext']; | ||
handleLog: StartLogsResult['handleLog']; | ||
} | ||
export declare function makeLogsPublicApi(startLogsImpl: StartLogs): { | ||
export interface LogsPublicApi extends PublicApi { | ||
logger: Logger; | ||
/** | ||
* Init the Logs browser SDK. | ||
* @param initConfiguration Configuration options of the SDK | ||
* | ||
* See [Browser Log Collection](https://docs.datadoghq.com/logs/log_collection/javascript) for further information. | ||
*/ | ||
init: (initConfiguration: LogsInitConfiguration) => void; | ||
@@ -35,19 +35,99 @@ /** | ||
setTrackingConsent: (trackingConsent: TrackingConsent) => void; | ||
/** | ||
* Get the global Context | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
getGlobalContext: () => Context; | ||
/** | ||
* Set the global context information to all logs, stored in `@context` | ||
* | ||
* @param context Global context | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
setGlobalContext: (context: any) => void; | ||
/** | ||
* Set or update a global context property, stored in `@context.<key>` | ||
* | ||
* @param key Key of the property | ||
* @param property Value of the property | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
setGlobalContextProperty: (key: any, value: any) => void; | ||
/** | ||
* Remove a global context property | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
removeGlobalContextProperty: (key: any) => void; | ||
/** | ||
* Clear the global context | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
clearGlobalContext: () => void; | ||
/** | ||
* The Datadog browser logs SDK contains a default logger `DD_LOGS.logger`, but this API allows to create different ones. | ||
* | ||
* See [Define multiple loggers](https://docs.datadoghq.com/logs/log_collection/javascript/#define-multiple-loggers) for further information. | ||
*/ | ||
createLogger: (name: string, conf?: LoggerConfiguration) => Logger; | ||
/** | ||
* Get a logger | ||
* | ||
* See [Define multiple loggers](https://docs.datadoghq.com/logs/log_collection/javascript/#define-multiple-loggers) for further information. | ||
*/ | ||
getLogger: (name: string) => Logger | undefined; | ||
/** | ||
* Get the init configuration | ||
*/ | ||
getInitConfiguration: () => LogsInitConfiguration | undefined; | ||
getInternalContext: (startTime?: number | undefined) => import("../domain/contexts/internalContext").InternalContext | undefined; | ||
/** | ||
* [Internal API] Get the internal SDK context | ||
* | ||
* See [Access internal context](https://docs.datadoghq.com/logs/log_collection/javascript/#access-internal-context) for further information. | ||
*/ | ||
getInternalContext: (startTime?: number | undefined) => InternalContext | undefined; | ||
/** | ||
* Set user information to all events, stored in `@usr` | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
setUser: (newUser: User) => void; | ||
/** | ||
* Get user information | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
getUser: () => Context; | ||
/** | ||
* Set or update the user property, stored in `@usr.<key>` | ||
* | ||
* @param key Key of the property | ||
* @param property Value of the property | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
setUserProperty: (key: any, property: any) => void; | ||
/** | ||
* Remove a user property | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
removeUserProperty: (key: any) => void; | ||
/** | ||
* Clear all user information | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
clearUser: () => void; | ||
} & { | ||
onReady(callback: () => void): void; | ||
version: string; | ||
}; | ||
} | ||
export interface Strategy { | ||
init: (initConfiguration: LogsInitConfiguration) => void; | ||
initConfiguration: LogsInitConfiguration | undefined; | ||
getInternalContext: StartLogsResult['getInternalContext']; | ||
handleLog: StartLogsResult['handleLog']; | ||
} | ||
export declare function makeLogsPublicApi(startLogsImpl: StartLogs): LogsPublicApi; |
@@ -34,14 +34,2 @@ import { addTelemetryUsage, assign, createContextManager, makePublicApi, monitor, checkUser, sanitizeUser, sanitize, createCustomerDataTrackerManager, storeContextManager, displayAlreadyInitializedError, deepClone, createTrackingConsentState, } from '@datadog/browser-core'; | ||
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) { | ||
@@ -48,0 +36,0 @@ trackingConsentState.update(trackingConsent); |
@@ -0,1 +1,2 @@ | ||
import type { LogsPublicApi } from '../boot/logsPublicApi'; | ||
export { Logger, LogsMessage, StatusType, HandlerType } from '../domain/logger'; | ||
@@ -5,23 +6,2 @@ export { LoggerConfiguration, LogsPublicApi as LogsGlobal } from '../boot/logsPublicApi'; | ||
export { LogsEvent } from '../logsEvent.types'; | ||
export declare const datadogLogs: { | ||
logger: import("../domain/logger").Logger; | ||
init: (initConfiguration: import("../domain/configuration").LogsInitConfiguration) => void; | ||
setTrackingConsent: (trackingConsent: import("@datadog/browser-core").TrackingConsent) => void; | ||
getGlobalContext: () => import("@datadog/browser-core").Context; | ||
setGlobalContext: (context: any) => void; | ||
setGlobalContextProperty: (key: any, value: any) => void; | ||
removeGlobalContextProperty: (key: any) => void; | ||
clearGlobalContext: () => void; | ||
createLogger: (name: string, conf?: import("../boot/logsPublicApi").LoggerConfiguration) => import("../domain/logger").Logger; | ||
getLogger: (name: string) => import("../domain/logger").Logger | undefined; | ||
getInitConfiguration: () => import("../domain/configuration").LogsInitConfiguration | undefined; | ||
getInternalContext: (startTime?: number | undefined) => import("../domain/contexts/internalContext").InternalContext | undefined; | ||
setUser: (newUser: import("@datadog/browser-core").User) => void; | ||
getUser: () => import("@datadog/browser-core").Context; | ||
setUserProperty: (key: any, property: any) => void; | ||
removeUserProperty: (key: any) => void; | ||
clearUser: () => void; | ||
} & { | ||
onReady(callback: () => void): void; | ||
version: string; | ||
}; | ||
export declare const datadogLogs: LogsPublicApi; |
{ | ||
"name": "@datadog/browser-logs", | ||
"version": "5.19.0", | ||
"version": "5.20.0", | ||
"license": "Apache-2.0", | ||
@@ -16,6 +16,6 @@ "main": "cjs/entries/main.js", | ||
"dependencies": { | ||
"@datadog/browser-core": "5.19.0" | ||
"@datadog/browser-core": "5.20.0" | ||
}, | ||
"peerDependencies": { | ||
"@datadog/browser-rum": "5.19.0" | ||
"@datadog/browser-rum": "5.20.0" | ||
}, | ||
@@ -38,3 +38,3 @@ "peerDependenciesMeta": { | ||
}, | ||
"gitHead": "ce92533465ebb3c3d0142f0c7d83af471572a818" | ||
"gitHead": "1dafdcfbf43a0f0ed8a0cbd5f13d16ba68378074" | ||
} |
@@ -1,2 +0,2 @@ | ||
import type { Context, TrackingConsent, User } from '@datadog/browser-core' | ||
import type { Context, TrackingConsent, User, PublicApi } from '@datadog/browser-core' | ||
import { | ||
@@ -22,2 +22,3 @@ addTelemetryUsage, | ||
import { buildCommonContext } from '../domain/contexts/commonContext' | ||
import type { InternalContext } from '../domain/contexts/internalContext' | ||
import type { StartLogs, StartLogsResult } from './startLogs' | ||
@@ -32,4 +33,132 @@ import { createPreStartStrategy } from './preStartLogs' | ||
export type LogsPublicApi = ReturnType<typeof makeLogsPublicApi> | ||
export interface LogsPublicApi extends PublicApi { | ||
logger: Logger | ||
/** | ||
* Init the Logs browser SDK. | ||
* @param initConfiguration Configuration options of the SDK | ||
* | ||
* See [Browser Log Collection](https://docs.datadoghq.com/logs/log_collection/javascript) for further information. | ||
*/ | ||
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 | ||
/** | ||
* Get the global Context | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
getGlobalContext: () => Context | ||
/** | ||
* Set the global context information to all logs, stored in `@context` | ||
* | ||
* @param context Global context | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
setGlobalContext: (context: any) => void | ||
/** | ||
* Set or update a global context property, stored in `@context.<key>` | ||
* | ||
* @param key Key of the property | ||
* @param property Value of the property | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
setGlobalContextProperty: (key: any, value: any) => void | ||
/** | ||
* Remove a global context property | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
removeGlobalContextProperty: (key: any) => void | ||
/** | ||
* Clear the global context | ||
* | ||
* See [Overwrite context](https://docs.datadoghq.com/logs/log_collection/javascript/#overwrite-context) for further information. | ||
*/ | ||
clearGlobalContext: () => void | ||
/** | ||
* The Datadog browser logs SDK contains a default logger `DD_LOGS.logger`, but this API allows to create different ones. | ||
* | ||
* See [Define multiple loggers](https://docs.datadoghq.com/logs/log_collection/javascript/#define-multiple-loggers) for further information. | ||
*/ | ||
createLogger: (name: string, conf?: LoggerConfiguration) => Logger | ||
/** | ||
* Get a logger | ||
* | ||
* See [Define multiple loggers](https://docs.datadoghq.com/logs/log_collection/javascript/#define-multiple-loggers) for further information. | ||
*/ | ||
getLogger: (name: string) => Logger | undefined | ||
/** | ||
* Get the init configuration | ||
*/ | ||
getInitConfiguration: () => LogsInitConfiguration | undefined | ||
/** | ||
* [Internal API] Get the internal SDK context | ||
* | ||
* See [Access internal context](https://docs.datadoghq.com/logs/log_collection/javascript/#access-internal-context) for further information. | ||
*/ | ||
getInternalContext: (startTime?: number | undefined) => InternalContext | undefined | ||
/** | ||
* Set user information to all events, stored in `@usr` | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
setUser: (newUser: User) => void | ||
/** | ||
* Get user information | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
getUser: () => Context | ||
/** | ||
* Set or update the user property, stored in `@usr.<key>` | ||
* | ||
* @param key Key of the property | ||
* @param property Value of the property | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
setUserProperty: (key: any, property: any) => void | ||
/** | ||
* Remove a user property | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
removeUserProperty: (key: any) => void | ||
/** | ||
* Clear all user information | ||
* | ||
* See [User context](https://docs.datadoghq.com/logs/log_collection/javascript/#user-context) for further information. | ||
*/ | ||
clearUser: () => void | ||
} | ||
const LOGS_STORAGE_KEY = 'logs' | ||
@@ -44,3 +173,3 @@ | ||
export function makeLogsPublicApi(startLogsImpl: StartLogs) { | ||
export function makeLogsPublicApi(startLogsImpl: StartLogs): LogsPublicApi { | ||
const customerDataTrackerManager = createCustomerDataTrackerManager() | ||
@@ -76,20 +205,8 @@ const globalContextManager = createContextManager( | ||
return makePublicApi({ | ||
return makePublicApi<LogsPublicApi>({ | ||
logger: mainLogger, | ||
init: monitor((initConfiguration: LogsInitConfiguration) => strategy.init(initConfiguration)), | ||
init: monitor((initConfiguration) => 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((trackingConsent: TrackingConsent) => { | ||
setTrackingConsent: monitor((trackingConsent) => { | ||
trackingConsentState.update(trackingConsent) | ||
@@ -109,3 +226,3 @@ addTelemetryUsage({ feature: 'set-tracking-consent', tracking_consent: trackingConsent }) | ||
createLogger: monitor((name: string, conf: LoggerConfiguration = {}) => { | ||
createLogger: monitor((name, conf = {}) => { | ||
customLoggers[name] = new Logger( | ||
@@ -123,9 +240,9 @@ (...params) => strategy.handleLog(...params), | ||
getLogger: monitor((name: string) => customLoggers[name]), | ||
getLogger: monitor((name) => customLoggers[name]), | ||
getInitConfiguration: monitor(() => deepClone(strategy.initConfiguration)), | ||
getInternalContext: monitor((startTime?: number | undefined) => strategy.getInternalContext(startTime)), | ||
getInternalContext: monitor((startTime) => strategy.getInternalContext(startTime)), | ||
setUser: monitor((newUser: User) => { | ||
setUser: monitor((newUser) => { | ||
if (checkUser(newUser)) { | ||
@@ -132,0 +249,0 @@ userContextManager.setContext(sanitizeUser(newUser as Context)) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
325566
4425
+ Added@datadog/browser-core@5.20.0(transitive)
+ Added@datadog/browser-rum@5.20.0(transitive)
+ Added@datadog/browser-rum-core@5.20.0(transitive)
- Removed@datadog/browser-core@5.19.0(transitive)
- Removed@datadog/browser-rum@5.19.0(transitive)
- Removed@datadog/browser-rum-core@5.19.0(transitive)
Updated@datadog/browser-core@5.20.0