!function(){"use strict";var e=function(){return(e=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]=0;t-=1)d[t]===e&&d.splice(t,1);0===d.length&&(c&&(window.onerror=u,c=!1),l&&(window.onunhandledrejection=f,l=!1))}function v(e,t,n){var r;if(d.forEach((function(o){try{o(e,t,n)}catch(e){r=e}})),r)throw r}function g(e,t,n,r,i){if(s)E(s,t,n),y();else if(i)v(w(i),!0,i);else{var a,c={url:t,column:r,line:n},f=e;if("[object String]"==={}.toString.call(e)){var l=o.exec(f);l&&(a=l[1],f=l[2])}v({name:a,message:"string"==typeof f?f:void 0,stack:[c]},!0,e)}return!!u&&u.apply(this,arguments)}function m(e){var t=e.reason||"Empty reason";v(w(t),!0,t)}function y(){var e=s,t=a;s=void 0,a=void 0,v(e,!1,t)}var b="?";function w(e,t){var n,r=void 0===t?0:+t;try{if(n=function(e){var t=S(e,"stacktrace");if(!t)return;for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,i=t.split("\n"),a=[],s=0;s|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,s=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,f=/\((\S*)(?::(\d+))(?::(\d+))\)/,l=t.split("\n"),d=[],p=0,h=l.length;p eval")>-1,r=c.exec(o[3]),n&&r?(o[3]=r[1],o[4]=r[2],o[5]=void 0):0!==p||o[5]||M(e.columnNumber)||(d[0].column=e.columnNumber+1),i={args:o[2]?o[2].split(","):[],column:o[5]?+o[5]:void 0,func:o[1]||b,line:o[4]?+o[4]:void 0,url:o[3]}}!i.func&&i.line&&(i.func=b),d.push(i)}if(!d.length)return;return{stack:d,message:S(e,"message"),name:S(e,"name")}}(e))return n}catch(e){if(x)throw e}try{if(n=function(e){var t=S(e,"message");if(!t)return;var n=t.split("\n");if(n.length<4)return;var r,o=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,i=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,a=/^\s*Line (\d+) of function script\s*$/i,s=[],u=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var f in u)T(u,f)&&!u[f].src&&c.push(u[f]);for(var l=2;l0&&o[0].url===r.url){if(o[0].line===r.line)return!1;if(!o[0].line&&o[0].func===r.func)return o[0].line=r.line,o[0].context=r.context,!1}return o.unshift(r),e.partial=!0,!0}return e.incomplete=!0,!1}function k(e,t){for(var n,r,o=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,a=[],s={},u=!1,c=k.caller;c&&!u;c=c.caller)c!==w&&c!==i&&(r={args:[],column:void 0,func:b,line:void 0,url:void 0},n=o.exec(c.toString()),c.name?r.func=c.name:n&&(r.func=n[1]),void 0===r.func&&(r.func=n?n.input.substring(0,n.input.indexOf("{")):void 0),s[c.toString()]?u=!0:s[c.toString()]=!0,a.push(r));t&&a.splice(0,t);var f={stack:a,message:S(e,"message"),name:S(e,"name")};return E(f,S(e,"sourceURL")||S(e,"fileName"),S(e,"line")||S(e,"lineNumber")),f}function S(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function M(e){return void 0===e}var R,O="agent",_="console",C="logger",L="network",A="source";function N(e){var t=B(e);return e.stack.forEach((function(e){var n="?"===e.func?"":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",o=e.line?":"+e.line:"",i=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+o+i})),t}function B(e){return(e.name||"Error")+": "+e.message}function I(){var e,t=new Error;if(!t.stack)try{throw t}catch(e){}return K((function(){var n=w(t);n.stack=n.stack.slice(2),e=N(n)})),e}!function(e){e.HANDLED="handled",e.UNHANDLED="unhandled"}(R||(R={}));var D=/[^\u0000-\u007F]/,j=!1,H=function(){function t(e,t,n){void 0===n&&(n=!1),this.endpointUrl=e,this.bytesLimit=t,this.withBatchTime=n}return t.prototype.send=function(t,n){var o=this.withBatchTime?function(e){return e+(-1===e.indexOf("?")?"?":"&")+"batch_time="+(new Date).getTime()}(this.endpointUrl):this.endpointUrl,i=!!navigator.sendBeacon&&n=200&&u.status<300||(j||(j=!0,a="XHR fallback failed",s={on_line:navigator.onLine,size:n,url:o,try_beacon:i,event:{is_trusted:t.isTrusted,total:t.total,loaded:t.loaded},request:{status:u.status,ready_state:u.readyState,response_text:u.responseText.slice(0,64)}},function(e){F.debugMode&&r.log("[MONITORING MESSAGE]",e)}(a),V(e(e({message:a},s),{status:P.info}))))},s=new XMLHttpRequest;s.addEventListener("loadend",$((function(e){return a(e)}))),s.open("POST",o,!0),s.send(t)},t}();var z=!1;var P,U=function(){function e(e,t,n,r,o,i){void 0===i&&(i=re),this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=o,this.beforeUnloadCallback=i,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.flush=function(){if(0!==this.bufferMessageCount){var e=n(this.pushOnlyBuffer,(t=this.upsertBuffer,r=[],Object.keys(t).forEach((function(e){r.push(t[e])})),r));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}var t,r},e.prototype.sizeInBytes=function(e){return D.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},e.prototype.addOrUpdate=function(e,t){var n=this.process(e),o=n.processedMessage,i=n.messageBytesSize;i>=this.maxMessageSize?r.warn("Discarded a message whose size was bigger than the maximum allowed size "+this.maxMessageSize+"KB."):(this.hasMessageFor(t)&&this.remove(t),this.willReachedBytesLimitWith(i)&&this.flush(),this.push(o,i,t),this.isFull()&&this.flush())},e.prototype.process=function(e){var t=oe(e);return{processedMessage:t,messageBytesSize:this.sizeInBytes(t)}},e.prototype.push=function(e,t,n){this.bufferMessageCount>0&&(this.bufferBytesSize+=1),void 0!==n?this.upsertBuffer[n]=e:this.pushOnlyBuffer.push(e),this.bufferBytesSize+=t,this.bufferMessageCount+=1},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.sizeInBytes(t);this.bufferBytesSize-=n,this.bufferMessageCount-=1,this.bufferMessageCount>0&&(this.bufferBytesSize-=1)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e.prototype.willReachedBytesLimitWith=function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},e.prototype.isFull=function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},e.prototype.flushPeriodically=function(){var e=this;setTimeout($((function(){e.flush(),e.flushPeriodically()})),this.flushTimeout)},e.prototype.flushOnVisibilityHidden=function(){var e=this;navigator.sendBeacon&&(se(window,"beforeunload",this.beforeUnloadCallback),se(document,"visibilitychange",(function(){"hidden"===document.visibilityState&&e.flush()})),se(window,"beforeunload",(function(){return e.flush()})))},e}();!function(e){e.info="info",e.error="error"}(P||(P={}));var q,F={maxMessagesPerPage:0,sentMessageCount:0};function G(e){if(e.internalMonitoringEndpoint){var t=function(e){var t,n=r(e.internalMonitoringEndpoint);void 0!==e.replica&&(t=r(e.replica.internalMonitoringEndpoint));function r(t){return new U(new H(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout)}function o(e){return fe({date:(new Date).getTime(),view:{referrer:document.referrer,url:window.location.href}},void 0!==q?q():{},e)}return{add:function(e){var r=o(e);n.add(r),t&&t.add(r)}}}(e);!function(e){for(var t=[],n=1;n>parseInt(e,10)/4).toString(16):"10000000-1000-4000-8000-100000000000".replace(/[018]/g,ne)}function re(){}function oe(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];ie(e)&&(r=[!0,e.toJSON],delete e.toJSON);var o,i,a=[!1,void 0];"object"==typeof e&&ie(o=Object.getPrototypeOf(e))&&(a=[!0,o.toJSON],delete o.toJSON);try{i=JSON.stringify(e,t,n)}catch(e){i=""}finally{r[0]&&(e.toJSON=r[1]),a[0]&&(o.toJSON=a[1])}return i}function ie(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function ae(e,t){return-1!==e.indexOf(t)}function se(e,t,n,r){return ue(e,[t],n,r)}function ue(e,t,n,r){var o=void 0===r?{}:r,i=o.once,a=o.capture,s=o.passive,u=$(i?function(e){f(),n(e)}:n),c=s?{capture:a,passive:s}:a;t.forEach((function(t){return e.addEventListener(t,u,c)}));var f=function(){return t.forEach((function(t){return e.removeEventListener(t,u,c)}))};return{stop:f}}function ce(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>>",a.logsEndpoint="<<< E2E LOGS ENDPOINT >>>",a.rumEndpoint="<<< E2E RUM ENDPOINT >>>",a.sessionReplayEndpoint="<<< E2E SESSION REPLAY ENDPOINT >>>"),r.buildMode===Te.STAGING&&void 0!==t.replica){var s=e(e({},r),{applicationId:t.replica.applicationId,clientToken:t.replica.clientToken,site:we[be]});a.replica={applicationId:t.replica.applicationId,internalMonitoringEndpoint:Se(o,"logs",s,"browser-agent-internal-monitoring"),logsEndpoint:Se(o,"logs",s),rumEndpoint:Se(o,"rum",s)}}return a}function ke(e,t,n){return"classic"===e&&function(e,t){var n=me.classic[e];return n&&n+"-http-intake.logs."+t}(t,n)||function(e,t){var n=me.alternate[e],r=t.split("."),o=r.pop(),i=r.join("-")+"."+o;return n+".browser-intake-"+i}(t,n)}function Se(e,t,n,r){var o="sdk_version:"+n.sdkVersion+(n.env?",env:"+n.env:"")+(n.service?",service:"+n.service:"")+(n.version?",version:"+n.version:""),i=ke(e,t,n.site),a=n.proxyHost?n.proxyHost:i,s=(n.proxyHost?"ddhost="+i+"&":"")+"ddsource="+(r||"browser")+"&ddtags="+encodeURIComponent(o);return"https://"+a+"/v1/input/"+n.clientToken+"?"+s}var Te,Me={allowedTracingOrigins:[],maxErrorsByMinute:3e3,maxInternalMonitoringMessagesPerPage:15,sampleRate:100,replaySampleRate:100,silentMultipleInit:!1,trackInteractions:!1,trackViewsManually:!1,requestErrorResponseLengthLimit:32768,flushTimeout:3e4,maxBatchSize:50,maxMessageSize:262144,batchBytesLimit:16384};function Re(e){var t={};return t.secure=function(e){return!!e.useSecureSessionCookie||!!e.useCrossSiteSessionCookie}(e),t.crossSite=!!e.useCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===le){for(var e="dd_site_test_"+ne(),t=window.location.hostname.split("."),n=t.pop();t.length&&!he(e);)n=t.pop()+"."+n,pe(e,"test",ee,{domain:n});ve(e,{domain:n}),le=n}return le}()),t}function Oe(t,n){var r=function(t,n){var r=Array.isArray(t.enableExperimentalFeatures)?t.enableExperimentalFeatures:[],o=e(e({beforeSend:t.beforeSend&&ge(t.beforeSend,"beforeSend threw an error:"),cookieOptions:Re(t),isEnabled:function(e){return ae(r,e)},service:t.service},Ee(t,n)),Me);return"allowedTracingOrigins"in t&&(o.allowedTracingOrigins=t.allowedTracingOrigins),"sampleRate"in t&&(o.sampleRate=t.sampleRate),"replaySampleRate"in t&&(o.replaySampleRate=t.replaySampleRate),"trackInteractions"in t&&(o.trackInteractions=!!t.trackInteractions),"trackViewsManually"in t&&(o.trackViewsManually=!!t.trackViewsManually),"actionNameAttribute"in t&&(o.actionNameAttribute=t.actionNameAttribute),o}(t,n);return{configuration:r,internalMonitoring:G(r)}}function _e(){var e={};return{get:function(){return e},add:function(t,n){e[t]=n},remove:function(t){delete e[t]},set:function(t){e=t}}}!function(e){e.RELEASE="release",e.STAGING="staging",e.E2E_TEST="e2e-test"}(Te||(Te={}));var Ce,Le,Ae,Ne,Be,Ie=function(){function e(e){void 0===e&&(e=1e4),this.limit=e,this.buffer=[]}return e.prototype.add=function(e){this.buffer.push(e)>this.limit&&this.buffer.splice(0,1)},e.prototype.drain=function(){this.buffer.forEach((function(e){return e()})),this.buffer.length=0},e}(),De={debug:"debug",error:"error",info:"info",warn:"warn"},je=((Ce={})[De.debug]=0,Ce[De.info]=1,Ce[De.warn]=2,Ce[De.error]=3,Ce),He=(Object.keys(De),"console"),ze="http",Pe=function(){function t(e,t,n,r){void 0===t&&(t=ze),void 0===n&&(n=De.debug),void 0===r&&(r={}),this.sendLog=e,this.handlerType=t,this.level=n,this.contextManager=_e(),this.contextManager.set(r)}return t.prototype.log=function(t,n,o){if(void 0===o&&(o=De.info),je[o]>=je[this.level]){var i=Array.isArray(this.handlerType)?this.handlerType:[this.handlerType];ae(i,ze)&&this.sendLog(e({message:t,status:o},fe(this.contextManager.get(),n))),ae(i,He)&&r.log(o+": "+t,fe(this.contextManager.get(),n))}},t.prototype.debug=function(e,t){this.log(e,t,De.debug)},t.prototype.info=function(e,t){this.log(e,t,De.info)},t.prototype.warn=function(e,t){this.log(e,t,De.warn)},t.prototype.error=function(e,t){var n={error:{origin:C}};this.log(e,fe(n,t),De.error)},t.prototype.setContext=function(e){this.contextManager.set(e)},t.prototype.addContext=function(e,t){this.contextManager.add(e,t)},t.prototype.removeContext=function(e){this.contextManager.remove(e)},t.prototype.setHandler=function(e){this.handlerType=e},t.prototype.setLevel=function(e){this.level=e},function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);i>3&&a&&Object.defineProperty(t,n,a)}([X],t.prototype,"log",null),t}(),Ue=function(){function e(){this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t}))}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function qe(){return Date.now()}function Fe(){return performance.now()}function Ge(){return{relative:Fe(),timeStamp:qe()}}function Xe(e,t){return t-e}function $e(e,t){var r=function(e,t){for(var n=0;n=500}(r)||t.notify({message:ht(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:L,stack:pt(r.responseText,e)||"Failed to load",startClocks:r.startClocks})}return(Be||(We=XMLHttpRequest.prototype.open,Ze=XMLHttpRequest.prototype.send,Ye=XMLHttpRequest.prototype.abort,XMLHttpRequest.prototype.open=rt,XMLHttpRequest.prototype.send=ot,XMLHttpRequest.prototype.abort=it,Be={beforeSend:function(e){tt.push(e)},onRequestComplete:function(e){nt.push(e)}}),Be).onRequestComplete((function(e){return n(Q.XHR,e)})),ct().onRequestComplete((function(e){return n(Q.FETCH,e)})),{stop:function(){Be&&(Be=void 0,tt.length=0,nt.length=0,XMLHttpRequest.prototype.open=We,XMLHttpRequest.prototype.send=Ze,XMLHttpRequest.prototype.abort=Ye),Qe&&(Qe=void 0,st.splice(0,st.length),ut.splice(0,ut.length),window.fetch=et)}}}function pt(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function ht(e){return Q.XHR===e?"XHR":"Fetch"}var vt=9e5,gt=144e5;function mt(e,t,n){var r=function(e,t){var n,r,o=!1,i=function(){o=!0,clearTimeout(n),n=setTimeout((function(){o=!1}),1e3)};return{get:function(){return o||(r=he(e),i()),r},set:function(n,o){pe(e,n,o,t),r=n,i()}}}("_dd_s",e);!function(e){var t=e.get(),n=he("_dd"),r=he("_dd_r"),o=he("_dd_l");if(!t){var i={};n&&(i.id=n),o&&/^[01]$/.test(o)&&(i.logs=o),r&&/^[012]$/.test(r)&&(i.rum=r),xt(i,e)}}(r);var o=new Ue,i=wt(r).id,a=function(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=0&&t<=100))||(r.error("Sample Rate should be a number between 0 and 100"),!1):(r.error("Client Token is not configured, we will not send any data."),!1);var t})(e)&&(e.publicApiKey&&(e.clientToken=e.publicApiKey,r.warn("Public API Key is deprecated. Please use Client Token instead.")),s=t(e,c,o.get),u=function(){return ce(void 0,e)},a.drain(),n=!0)})),getLoggerGlobalContext:$(o.get),setLoggerGlobalContext:$(o.set),addLoggerGlobalContext:$(o.add),removeLoggerGlobalContext:$(o.remove),createLogger:$((function(t,n){return void 0===n&&(n={}),i[t]=new Pe(d,n.handler,n.level,e(e({},n.context),{logger:{name:t}})),i[t]})),getLogger:$((function(e){return i[e]})),getInitConfiguration:$((function(){return u()}))},l=e(e({},f),{onReady:function(e){e()}}),Object.defineProperty(l,"_setDebug",{get:function(){return W},enumerable:!1}),l;var f,l;function d(e){s(e,fe({date:Date.now(),view:{referrer:document.referrer,url:window.location.href}},o.get()))}}((function(t,n,o){var i=Oe(t,Rt),a=i.configuration,s=i.internalMonitoring,u=new Ue;return!1!==t.forwardErrorsToLogs&&(!function(t){Le=console.error,console.error=function(){for(var n=[],r=0;r