@cloudcare/browser-rum 2.0.17 → 2.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/README.md +16 -11
  2. package/bundle/dataflux-rum.js +1 -1
  3. package/cjs/boot/buildEnv.js +1 -1
  4. package/cjs/domain/assembly.js +12 -1
  5. package/cjs/domain/rumEventsCollection/error/errorCollection.js +10 -0
  6. package/cjs/domain/rumEventsCollection/resource/resourceCollection.js +2 -2
  7. package/cjs/domain/rumSession.js +21 -6
  8. package/cjs/domain/tracing/ddtraceTracer.js +75 -0
  9. package/cjs/domain/tracing/jaegerTracer.js +58 -0
  10. package/cjs/domain/tracing/skywalkingTracer.js +93 -0
  11. package/cjs/domain/tracing/tracer.js +51 -60
  12. package/cjs/domain/tracing/w3cTraceParentTracer.js +51 -0
  13. package/cjs/domain/tracing/zipkinMultiTracer.js +58 -0
  14. package/cjs/domain/tracing/zipkinSingleTracer.js +51 -0
  15. package/esm/boot/buildEnv.js +1 -1
  16. package/esm/domain/assembly.js +12 -1
  17. package/esm/domain/rumEventsCollection/error/errorCollection.js +11 -1
  18. package/esm/domain/rumEventsCollection/resource/resourceCollection.js +2 -2
  19. package/esm/domain/rumSession.js +21 -6
  20. package/esm/domain/tracing/ddtraceTracer.js +67 -0
  21. package/esm/domain/tracing/jaegerTracer.js +50 -0
  22. package/esm/domain/tracing/skywalkingTracer.js +84 -0
  23. package/esm/domain/tracing/tracer.js +44 -57
  24. package/esm/domain/tracing/w3cTraceParentTracer.js +43 -0
  25. package/esm/domain/tracing/zipkinMultiTracer.js +50 -0
  26. package/esm/domain/tracing/zipkinSingleTracer.js +43 -0
  27. package/package.json +3 -3
  28. package/src/boot/rumPublicApi.js +0 -1
  29. package/src/domain/.DS_Store +0 -0
  30. package/src/domain/assembly.js +12 -3
  31. package/src/domain/rumEventsCollection/error/errorCollection.js +16 -2
  32. package/src/domain/rumEventsCollection/resource/matchRequestTiming.js +1 -0
  33. package/src/domain/rumEventsCollection/resource/resourceCollection.js +3 -4
  34. package/src/domain/rumSession.js +24 -7
  35. package/src/domain/tracing/ddtraceTracer.js +70 -0
  36. package/src/domain/tracing/jaegerTracer.js +47 -0
  37. package/src/domain/tracing/skywalkingTracer.js +80 -0
  38. package/src/domain/tracing/tracer.js +40 -68
  39. package/src/domain/tracing/w3cTraceParentTracer.js +40 -0
  40. package/src/domain/tracing/zipkinMultiTracer.js +46 -0
  41. package/src/domain/tracing/zipkinSingleTracer.js +40 -0
package/README.md CHANGED
@@ -81,17 +81,22 @@ datafluxRum.init({
81
81
 
82
82
  ### 初始化参数
83
83
 
84
- | 参数 | 类型 | 是否必须 | 默认值 | 描述 |
85
- | ------------------------------------------------- | ------- | -------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
86
- | `applicationId` | String | 是 | | 从 dataflux 创建的应用 ID |
87
- | `datakitOrigin` | String | 是 | | datakit 数据上报 Origin 注释: `协议(包括://),域名(或IP地址)[和端口号]` 例如:https://www.datakit.com, http://100.20.34.3:8088 |
88
- | `env` | String | 否 | | web 应用当前环境, 如 prod:线上环境;gray:灰度环境;pre:预发布环境 common:日常环境;local:本地环境; |
89
- | `version` | String | 否 | | web 应用的版本号 |
90
- | `resourceSampleRate` | Number | 否 | `100` | 资源指标数据收集百分比: `100`表示全收集,`0`表示不收集 |
91
- | `sampleRate` | Number | 否 | `100` | 指标数据收集百分比: `100`表示全收集,`0`表示不收集 |
92
- | `trackSessionAcrossSubdomains` | Boolean | 否 | `false` | 同一个域名下面的子域名共享缓存 |
93
- | `allowedDDTracingOrigins` $\color{#FF0000}{新增}$ | Array | 否 | `[]` | 允许注入`ddtrace` 采集器所需header头部的所有请求列表。可以是请求的origin,也可以是是正则,origin: `协议(包括://),域名(或IP地址)[和端口号]` 例如:`["https://api.example.com", /https:\/\/.*\.my-api-domain\.com/]` |
94
- | `trackInteractions` $\color{#FF0000}{新增}$ | Boolean | 否 | `false` | 是否开启用户行为采集 |
84
+ | 参数 | 类型 | 是否必须 | 默认值 | 描述 |
85
+ | ------------------------------------------------- | -------- | -------- | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
86
+ | `applicationId` | String | 是 | | 从 dataflux 创建的应用 ID |
87
+ | `datakitOrigin` | String | 是 | | datakit 数据上报 Origin 注释: `协议(包括://),域名(或IP地址)[和端口号]` 例如:https://www.datakit.com, http://100.20.34.3:8088 |
88
+ | `env` | String | 是 | | web 应用当前环境, 如 prod:线上环境;gray:灰度环境;pre:预发布环境 common:日常环境;local:本地环境; |
89
+ | `version` | String | 是 | | web 应用的版本号 |
90
+ | `resourceSampleRate` | Number | 否 | `100` | 资源指标数据收集百分比: `100`表示全收集,`0`表示不收集 |
91
+ | `sampleRate` | Number | 否 | `100` | 指标数据收集百分比: `100`表示全收集,`0`表示不收集 |
92
+ | `trackSessionAcrossSubdomains` | Boolean | 否 | `false` | 同一个域名下面的子域名共享缓存 |
93
+ | `traceType` $\color{#FF0000}{新增}$ | Enum | 否 | `ddtrace` | 与 APM 采集工具连接的请求header类型,目前兼容的类型包括:`ddtrace`、`zipkin`、`skywalking_v3`、`jaeger`、`zipkin_single_header`、`w3c_traceparent`。*注: opentelemetry 支持 `zipkin_single_header`,`w3c_traceparent`,`zipkin`三种类型* |
94
+ | `traceId128Bit` $\color{#FF0000}{新增}$ | Boolean | 否 | `false` | 是否以128位的方式生成 `traceID`,与`traceType` 对应,目前支持类型 `zipkin`、`jaeger` |
95
+ | `allowedDDTracingOrigins` $\color{#FF0000}{废弃}$ | Array | 否 | `[]` | 允许注入`ddtrace` 采集器所需header头部的所有请求列表。可以是请求的origin,也可以是是正则,origin: `协议(包括://),域名(或IP地址)[和端口号]` 例如:`["https://api.example.com", /https:\/\/.*\.my-api-domain\.com/]` *该参数 旧的配置在新版本中做了兼容, 推荐使用`allowedTracingOrigins`* |
96
+ | `allowedTracingOrigins` $\color{#FF0000}{新增}$ | Array | 否 | `[]` | 允许注入 `trace` 采集器所需header头部的所有请求列表。可以是请求的origin,也可以是是正则,origin: `协议(包括://),域名(或IP地址)[和端口号]` 例如:`["https://api.example.com", /https:\/\/.*\.my-api-domain\.com/]` |
97
+ | `trackInteractions` | Boolean | 否 | `false` | 是否开启用户行为采集 |
98
+ | `isServerError` | Function | 否 | `function(request) {return false}` | 默认情况下,请求如果 `status code`>= 500 则定义为错误请求,会相应的采集为 `error` 指标数据。为满足部分场景可能并非是通过 `status code` 来判断业务请求的错误情况,提供可通过用户自定义的方式来判断请求是否为 error 请求,callback 参数为请求对应的相关返回参数: `{ isAborted: false, method:"get",response: "{...}",status: 200,url: "xxxx" }`, 如果方法返回为true,则该请求相关数据会被采集为 `error` 指标, *该参数 方法返回结果必须为 Boolean 类型, 否则认为是无效参数* |
99
+
95
100
  ## 问题
96
101
 
97
102
  ### 产生 Script error 消息的原因
@@ -1 +1 @@
1
- (()=>{"use strict";var e=Array.prototype,t=Function.prototype,n=Object.prototype,r=e.slice,i=n.toString,o=n.hasOwnProperty,a=(t.bind,e.forEach),s=(e.indexOf,Array.isArray),u=function(e,t,n){if(null===e)return!1;if(a&&e.forEach===a)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&false===t.call(n,e[r],r,e))return!1}else for(var s in e)if(o.call(e,s)&&false===t.call(n,e[s],s,e))return!1},c=function(e){return u(r.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},f=function(e){return u(r.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&(h(t[n])&&h(e[n])?c(e[n],t[n]):e[n]=t[n])})),e},d=s||function(e){return"[object Array]"===i.call(e)},l=function(e){return e?e.toArray?e.toArray():d(e)?r.call(e):(t=e)&&o.call(t,"callee")?r.call(e):p(e):[];var t},p=function(e){var t=[];return null===e||u(e,(function(e){t[t.length]=e})),t},v=function(e,t,n){if(e.filter)return e.filter(t);for(var r=[],i=0;i<e.length;i++)if(o.call(e,i)){var a=e[i];t.call(n,a,i,e)&&r.push(a)}return r},m=function(e,t,n){if(e.map)return e.map(t);for(var r=[],i=0;i<e.length;i++)if(o.call(e,i)){var a=e[i];r.push(t.call(n,a,i,e))}return r},h=function(e){return null!==e&&"[object Object]"===i.call(e)},g=function(e){if(h(e)){for(var t in e)if(o.call(e,t))return!1;return!0}return!1},y=function(e){var t=[];return u(e,(function(e,n){t.push([n,e])})),t},w=function(e){return"[object String]"===i.call(e)},b=function(e){return"[object Boolean]"===i.call(e)},_=function(e){return"[object Number]"===i.call(e)&&/[\d\.]+/.test(String(e))},E=function e(t){var n=t;try{n=e(t)}catch(e){n=t}return n},S=(Date.now,function(e,t,n){var r,i,o,a,s=0;n||(n={});var u=function(){s=!1===n.leading?0:(new Date).getTime(),r=null,a=e.apply(i,o),r||(i=o=null)},c=function(){o=arguments;var c=(new Date).getTime();s||!1!==n.leading||(s=c);var f=t-(c-s);return i=this,f<=0||f>t?(r&&(clearTimeout(r),r=null),s=c,a=e.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,f)),a};return c.cancel=function(){clearTimeout(r),s=0,r=null},c}),x=function(e){function t(e){return e<10?"0"+e:e}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+" "+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+"."+t(e.getMilliseconds())};function O(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-",1e3,"-",4e3,"-",8e3,"-",1e11).replace(/[018]/g,O)}function T(e){return e?e.replace(/\/([^\/]*)\d([^\/]*)/g,"/?"):""}var C=function(e){var t=function(e){this._fields={Username:4,Password:5,Port:7,Protocol:2,Host:6,Path:8,URL:0,QueryString:9,Fragment:10},this._values={},this._regex=null,this._regex=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/,void 0!==e&&this._parse(e)};return t.prototype.setUrl=function(e){this._parse(e)},t.prototype._initValues=function(){for(var e in this._fields)this._values[e]=""},t.prototype.addQueryString=function(e){if("object"!=typeof e)return!1;var t=this._values.QueryString||"";for(var n in e)t=new RegExp(n+"[^&]+").test(t)?t.replace(new RegExp(n+"[^&]+"),n+"="+e[n]):"&"===t.slice(-1)?t+n+"="+e[n]:""===t?n+"="+e[n]:t+"&"+n+"="+e[n];this._values.QueryString=t},t.prototype.getParse=function(){return this._values},t.prototype.getUrl=function(){var e="";return e+=this._values.Origin,e+=this._values.Port?":"+this._values.Port:"",e+=this._values.Path,e+=this._values.QueryString?"?"+this._values.QueryString:""},t.prototype._parse=function(e){this._initValues();var t=this._regex.exec(e);if(!t)throw"DPURLParser::_parse -> Invalid URL";for(var n in this._fields)void 0!==t[this._fields[n]]&&(this._values[n]=t[this._fields[n]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname},new t(e)},k=function(e){var t={},n=e.split("?")[1]||"";return n&&(t=I("?"+n)),t},I=function(e){for(var t=function(e){return E(e)},n={},r=(e=e||"").substring(1).split("&"),i=0;i<r.length;i++){var o=r[i].indexOf("=");if(-1!==o){var a=r[i].substring(0,o),s=r[i].substring(o+1);a=t(a),s=t(s),n[a]=s}}return n};function R(e){return e?String(e).substr(0,1)+String(e).substr(1).replace(/\d*/g,"x"):e}function M(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];$(e)&&(r=[!0,e.toJSON],delete e.toJSON);var i,o,a=[!1,void 0];"object"==typeof e&&$(i=Object.getPrototypeOf(e))&&(a=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(e,void 0,n)}catch(e){o="<error: unable to serialize object>"}finally{r[0]&&(e.toJSON=r[1]),a[0]&&(i.toJSON=a[1])}return o}function $(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function A(){}var B,L=1e3,D=6e4;function W(e){return 0!==e&&100*Math.random()<=e}function N(e,t){return+e.toFixed(t)}function P(e){return"number"!=typeof e?e:N(1e6*e,0)}function U(e){return _(e)?N(1e6*e,0):e}function V(){return q()}function j(e){return Math.floor(J()+e)}function q(){return performance.now()}function F(){return{relative:q(),timeStamp:Q()}}function Q(){return Date.now()}function H(e,t){return t-e}function z(e){return e.relative}function G(e){return j(e.relative)}function X(e){return{relative:e,timeStamp:j(e)}}function J(){return void 0===B&&(B=performance.timing.navigationStart),B}function K(e,t){for(var n=t.split(".");n.length;){var r=n.shift();if(!(e&&r in e&&o.call(e,r)))return;e=e[r]}return e}function Y(e,t,n,r){return Z(e,[t],n,r)}function Z(e,t,n,r){var i=r&&r.once?function(e){o(),n(e)}:n;r=r&&r.passive?{capture:r.capture,passive:r.passive}:r&&r.capture,u(t,(function(t){e.addEventListener(t,i,r)}));var o=function(){u(t,(function(t){e.removeEventListener(t,i,r)}))};return{stop:o}}function ee(e,t){return-1!==e.indexOf(t)}function te(e){return _(e)&&e>=0&&e<=100}function ne(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}function re(e){var t={};return u(e,(function(e,n){var r;t[(r=n,r.replace(/[A-Z]/g,(function(e,t){return(0!==t?"_":"")+e.toLowerCase()})).replace(/-/g,"_"))]=ie(e)})),t}function ie(e){return d(e)?m(e,(function(e){return ie(e)})):"object"==typeof e&&null!==e?re(e):e}function oe(e){if("object"==typeof e&&e)e=M(e);else if(!w(e))return e;return String(e).replace(/[\s=,"]/g,(function(e){return"\\"+e}))}var ae=function(){this.buffer=[]};ae.prototype={add:function(e){this.buffer.push(e)>this.limit&&this.buffer.splice(0,1)},drain:function(e){u(this.buffer,(function(t){e(t)})),this.buffer.length=0}};var se=ae,ue={navigator:void 0!==window.navigator?window.navigator:{},infoMap:{engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","IE 11","IE 10","IE 9","IE 8","IE 7","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","360","360SE","360EE","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat",,"WechatWork","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Windows 2000","Windows XP","Windows Vista","Windows 7","Windows 8","Windows 8.1","Windows Server 2003","Windows ME","Windows 10","Windows 98","Windows 95","Windows NT 4.0","Windows CE","Windows 3.11","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet","iPad"]}},ce={getMatchMap:function(e){return{Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,"IE 11":e.indexOf("Trident")>-1&&e.indexOf("rv:11.0")>-1,"IE 10":e.indexOf("MSIE 10.0")>-1&&e.indexOf("Trident")>-1,"IE 9":e.indexOf("MSIE 9.0")>-1&&e.indexOf("Trident")>-1,"IE 8":e.indexOf("MSIE 9.0")>-1&&e.indexOf("Trident")>-1,"IE 7":e.indexOf("MSIE 7.0")>-1&&e.indexOf("Trident")>-1,Edge:e.indexOf("Edg")>-1||e.indexOf("Edge")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Arora:e.indexOf("Arora")>-1,Lunascape:e.indexOf("Lunascape")>-1,QupZilla:e.indexOf("QupZilla")>-1,"Coc Coc":e.indexOf("coc_coc_browser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,Iceweasel:e.indexOf("Iceweasel")>-1,Konqueror:e.indexOf("Konqueror")>-1,Iceape:e.indexOf("Iceape")>-1,SeaMonkey:e.indexOf("SeaMonkey")>-1,Epiphany:e.indexOf("Epiphany")>-1,360:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1,"360EE":e.indexOf("360EE")>-1,"360SE":e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1||e.indexOf("LieBaoFast")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,WechatWork:e.indexOf("wxwork/")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,"Windows 2000":e.indexOf("Windows NT 5.0")>-1||e.indexOf("Windows 2000")>-1,"Windows XP":e.indexOf("Windows NT 5.1")>-1||e.indexOf("Windows XP")>-1,"Windows Server 2003":e.indexOf("Windows NT 5.2")>-1,"Windows Vista":e.indexOf("Windows NT 6.0")>-1,"Windows 7":e.indexOf("Windows 7")>-1||e.indexOf("Windows NT 6.1")>-1,"Windows 8":e.indexOf("Windows 8")>-1||e.indexOf("Windows NT 6.2")>-1,"Windows 8.1":e.indexOf("Windows 8.1")>-1||e.indexOf("Windows NT 6.3")>-1,"Windows ME":e.indexOf("Win 9x 4.90")>-1||e.indexOf("Windows ME")>-1,"Windows 10":e.indexOf("Windows 10.0")>-1||e.indexOf("Windows NT 10.0")>-1,"Windows 98":e.indexOf("Windows 98")>-1||e.indexOf("Win98")>-1,"Windows 95":e.indexOf("Windows 95")>-1||e.indexOf("Win95")>-1||e.indexOf("Windows_95")>-1,"Windows NT 4.0":e.indexOf("Windows NT 4.0")>-1||e.indexOf("WinNT4.0")>-1||e.indexOf("WinNT")>-1,"Windows CE":e.indexOf("Windows CE")>-1,"Windows 3.11":e.indexOf("Win16")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Nexus 7")>-1,iPad:e.indexOf("iPad")>-1}},matchInfoMap:function(e){var t=ue.navigator.userAgent||{},n=ce.getMatchMap(t);for(var r in ue.infoMap)for(var i=0;i<ue.infoMap[r].length;i++){var o=ue.infoMap[r][i];n[o]&&(e[r]=o)}},getOS:function(){return ce.matchInfoMap(this),this.os||"Unknown"},getOSVersion:function(){var e=this,t=ue.navigator.userAgent||{};e.osVersion="",e.osMajor="";var n={Windows:function(){var e=t.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[e]||e},Android:function(){return t.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return t.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return t.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return t.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return t.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return t.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};return n[e.os]&&(e.osVersion=n[e.os](),e.osVersion==t&&(e.osVersion="")),e.osVersion&&(e.osMajor=e.osVersion.split(".").length&&e.osVersion.split(".")[0]),{version:e.osVersion,osMajor:e.osMajor}},getOrientationStatu:function(){return window.matchMedia("(orientation: portrait)").matches?"竖屏":"横屏"},getDeviceType:function(){var e=this;return e.device="PC",ce.matchInfoMap(e),e.device},getNetwork:function(){return navigator&&navigator.connection&&navigator.connection.effectiveType},getLanguage:function(){var e;return this.language=((e=(ue.navigator.browserLanguage||ue.navigator.language).split("-"))[1]&&(e[1]=e[1].toUpperCase()),e.join("_")),this.language},getBrowserInfo:function(){var e=this;ce.matchInfoMap(e);var t=ue.navigator.userAgent||{},n=function(e,t){var n=ue.navigator.mimeTypes;for(var r in n)if(n[r][e]==t)return!0;return!1},r=ce.getMatchMap(t),i=!1;if(window.chrome){var o=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");o>36&&window.showModalDialog?i=!0:o>45&&(i=n("type","application/vnd.chromium.remoting-viewer"))}if(r.Baidu&&r.Opera&&(r.Baidu=!1),r.Mobile&&(r.Mobile=!(t.indexOf("iPad")>-1)),i&&(n("type","application/gameplugin")||ue.navigator&&void 0===ue.navigator.connection.saveData?r["360SE"]=!0:r["360EE"]=!0),r.IE||r.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:break;case 102:r["360EE"]=!0;break;case 75:case 74:case 105:break;case 104:r["360SE"]=!0}var a={Safari:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return t.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return t.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return t.replace(/^.*Edge\/([\d.]+).*$/,"$1")},Firefox:function(){return t.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return t.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return t.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return t.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return t.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return t.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Arora:function(){return t.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return t.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return t.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return t.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return t.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return t.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return t.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return t.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return t.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return t.replace(/^.*QihooBrowser\/([\d.]+).*$/,"$1")},"360SE":function(){return{63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return t.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return t.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return t.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return t.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return t.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return t.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},LBBROWSER:function(){var e="";t.indexOf("LieBaoFast")>-1&&(e=t.replace(/^.*LieBaoFast\/([\d.]+).*$/,"$1"));var n=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");return e||{57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[n]||""},"2345Explorer":function(){return t.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return t.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return t.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return t.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return t.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return t.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},WechatWork:function(){return t.replace(/^.*wxwork\/([\d.]+).*$/,"$1")},Taobao:function(){return t.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return t.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return t.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return t.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return t.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return t.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};return e.browserVersion="",e.browserMajor="",a[e.browser]&&(e.browserVersion=a[e.browser](),e.browserVersion==t&&(e.browserVersion="")),"Chrome"==e.browser&&t.match(/\S+Browser/)&&(e.browser=t.match(/\S+Browser/)[0],e.version=t.replace(/^.*Browser\/([\d.]+).*$/,"$1")),"Edge"==e.browser&&(e.version>"75"?e.engine="Blink":e.engine="EdgeHTML"),("Chrome"==e.browser&&parseInt(e.browserVersion)>27||r.Chrome&&"WebKit"==e.engine&&parseInt(e.browserVersion)>27||"Opera"==e.browser&&parseInt(e.version)>12||"Yandex"==e.browser)&&(e.engine="Blink"),e.browserVersion&&(e.browserMajor=e.browserVersion.split(".").length&&this.browserVersion.split(".")[0]),{browser:e.browser,browserVersion:e.browserVersion,engine:e.engine,browserMajor:e.browserMajor}},getGeoPostion:function(e){navigator&&navigator.geolocation&&navigator.geolocation.getCurrentPosition((function(t){e(t)}),(function(e){}))}},fe={os:ce.getOS(),osVersion:ce.getOSVersion().version,osVersionMajor:ce.getOSVersion().osMajor,browser:ce.getBrowserInfo().browser,browserVersion:ce.getBrowserInfo().browserVersion,browserVersionMajor:ce.getBrowserInfo().browserMajor,screenSize:window.screen.width+"*"+window.screen.height,networkType:ce.getNetwork(),divice:ce.getDeviceType()},de="beforeunload",le="click",pe="keydown",ve="load",me="popstate",he="scroll",ge="touchstart",ye="visibilitychange",we="DOMContentLoaded",be="pointerdown",_e="pointerup",Ee="pointercancel",Se="hashchange",xe="pagehide",Oe="mousedown",Te="document",Ce="xhr",ke="beacon",Ie="fetch",Re="css",Me="js",$e="image",Ae="font",Be="media",Le="other",De="click",We="custom",Ne={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",LOGGER:"logger"},Pe={FETCH:Ie,XHR:Ce},Ue="agent",Ve="console",je="network",qe="source";function Fe(e){var t=e.name||"Error: "+e.message;return u(e.stack,(function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",i=e.line?":"+e.line:"",o=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+i+o})),t}var Qe=function(){this._events=[],this.pendingEvents=[]};Qe.prototype={emit:function(e){var t=[].slice.call(arguments,1);u(this._events,(function(n){if(n.type!==e)return!1;n.callback.apply(n.context,t)}))},on:function(e,t,n){"function"==typeof t&&this._events.push({type:e,callback:t,context:n||this})}};new Qe;var He="PERFORMANCE_ENTRY_COLLECTED",ze="AUTO_ACTION_CREATED",Ge="AUTO_ACTION_COMPLETED",Xe="AUTO_ACTION_DISCARDED",Je="VIEW_CREATED",Ke="VIEW_UPDATED",Ye="VIEW_ENDED",Ze="SESSION_RENEWED",et="DOM_MUTATED",tt="BEFORE_UNLOAD",nt="REQUEST_STARTED",rt="REQUEST_COMPLETED",it="RAW_RUM_EVENT_COLLECTED",ot="RUM_EVENT_COLLECTED",at="RAW_ERROR_COLLECTED",st="RECORD_STARTED",ut="RECORD_STOPPED";function ct(){this.callbacks=[]}function ft(e,t,n){var r=f({},e),i=n(r);return u(t,(function(t){var n=dt(e,t),i=dt(r,t);"string"==typeof n&&"string"==typeof i&&function(e,t,n){for(var r=e,i=t.split("."),o=0;o<i.length;o+=1){var a=i[o];if(!lt(r,a))return;o!==i.length-1?r=r[a]:r[a]=n}}(e,t,i)})),i}function dt(e,t){var n=e;for(var r of t.split(".")){if(!lt(n,r))return;n=n[r]}return n}function lt(e,t){return"object"==typeof e&&null!==e&&t in e}ct.prototype={notify:function(e,t){var n=this.callbacks[e];n&&u(n,(function(e){e(t)}))},subscribe:function(e,t){this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t);var n=this;return{unsubscribe:function(){n.callbacks[e]=v(n.callbacks[e],(function(e){return e!==t}))}}}};var pt=function(){this.observers=[]};pt.prototype={subscribe:function(e){this.observers.push(e)},notify:function(e){u(this.observers,(function(t){t(e)}))}};var vt,mt=pt;function ht(e){return yt(e,ne(window.location)).href}function gt(e){return ne(yt(e))}function yt(e,t){if(function(){if(void 0!==vt)return vt;try{var e=new URL("http://test/path");return vt="http://test/path"===e.href}catch(e){vt=!1}return vt}())return void 0!==t?new URL(e,t):new URL(e);if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: "+e);var n=document,r=n.createElement("a");if(void 0!==t){var i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=t,n.head.appendChild(i),n.body.appendChild(r)}return r.href=e,r}var wt=navigator.userAgent.toLowerCase(),bt=function(){return/iphone os/.test(wt)},_t=function(){this.bridge=window.FTWebViewJavascriptBridge,this.tagMaps={},window.mapWebViewCallBack={};try{this.initBridge()}catch(e){}};_t.prototype={initBridge:function(){var e=this;if(bt()&&!e.bridge){if(window.WVJBCallbacks)return void window.WVJBCallbacks.push((function(t){e.bridge=t}));window.WVJBCallbacks=[function(t){e.bridge=t}];var t=document.createElement("iframe");t.style.display="none",t.src="wvjbscheme://__BRIDGE_LOADED__",document.documentElement.appendChild(t),setTimeout((function(){document.documentElement.removeChild(t)}),0)}},sendEvent:function(e,t){void 0===e&&(e={});var n=this,r="Unique id:"+(new Date).getTime();if(e.name){n.tagMaps[e.name]=r,window.mapWebViewCallBack[r]=function(e,t){return Promise.resolve(e,t)},e._tag=r;try{bt()?n.bridge.callHandler("sendEvent",JSON.stringify(e),"mapWebViewCallBack"):n.bridge.sendEvent(JSON.stringify(e),"mapWebViewCallBack")}catch(e){}}else t({error:"请传入发送事件的名称!!"})},addEventListener:function(e,t){var n="Unique id:"+(new Date).getTime(),r=this;if(e.name){r.tagMaps[e.name]=n,window.mapWebViewCallBack[n]=function(e,n){t(e,n)},e._tag=n;try{bt()?r.bridge.callHandler("addEventListener",JSON.stringify(e),"mapWebViewCallBack"):r.bridge.addEventListener(JSON.stringify(e),"mapWebViewCallBack")}catch(e){}}else t({error:"请传入监听事件的名称!!"})}};var Et=new _t,St=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function xt(e){if(Tt){if(Ot===e)return;Lt()}var t=Wt(e);throw Tt=t,Ot=e,setTimeout((function(){Ot===e&&Lt()}),t.incomplete?2e3:0),e}var Ot,Tt,Ct,kt,It,Rt=[];function Mt(e){!function(){if(kt)return;Ct=window.onerror,window.onerror=At,kt=!0}(),function(){if(It)return;null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=Bt,It=!0}(),Rt.push(e)}function $t(e,t,n){var r;if(u(Rt,(function(i){try{i(e,t,n)}catch(e){r=e}})),r)throw r}function At(e,t,n,r,i){if(Tt)Pt(Tt,t,n),Lt();else if(i)$t(Wt(i),!0,i);else{var o,a={url:t,column:r,line:n},s=e;if("[object String]"==={}.toString.call(e)){var u=St.exec(s);u&&(o=u[1],s=u[2])}$t({name:o,message:"string"==typeof s?s:void 0,stack:[a]},!0,e)}return!!Ct&&Ct.apply(this,arguments)}function Bt(e){var t=e.reason||"Empty reason";$t(Wt(t),!0,t)}function Lt(){var e=Tt,t=Ot;Tt=void 0,Ot=void 0,$t(e,!1,t)}var Dt="?";function Wt(e,t){var n,r=void 0===t?0:+t;try{if(n=function(e){var t=Vt(e,"stacktrace");if(!t)return;for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=t.split("\n"),a=[],s=0;s<o.length;s+=2){var u;r.exec(o[s])?u={args:[],column:void 0,func:(n=r.exec(o[s]))[3],line:+n[1],url:n[2]}:i.exec(o[s])&&(u={args:(n=i.exec(o[s]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),u&&(!u.func&&u.line&&(u.func=Dt),u.context=[o[s+1]],a.push(u))}if(!a.length)return;return{stack:a,message:Vt(e,"message"),name:Vt(e,"name")}}(e))return n}catch(e){if(Nt)throw e}try{if(n=function(e){var t=Vt(e,"stack");if(!t)return;for(var n,r,i,o,a=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\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+))\)/,d=t.split("\n"),l=[],p=0,v=d.length;p<v;p+=1){if(a.exec(d[p])){var m=(i=a.exec(d[p]))[2]&&0===i[2].indexOf("native");n=i[2]&&0===i[2].indexOf("eval"),r=f.exec(i[2]),n&&r&&(i[2]=r[1],i[3]=r[2],i[4]=r[3]),o={args:m?[i[2]]:[],column:i[4]?+i[4]:void 0,func:i[1]||Dt,line:i[3]?+i[3]:void 0,url:m?void 0:i[2]}}else if(u.exec(d[p]))o={args:[],column:(i=u.exec(d[p]))[4]?+i[4]:void 0,func:i[1]||Dt,line:+i[3],url:i[2]};else{if(!s.exec(d[p]))continue;n=(i=s.exec(d[p]))[3]&&i[3].indexOf(" > eval")>-1,r=c.exec(i[3]),n&&r?(i[3]=r[1],i[4]=r[2],i[5]=void 0):0!==p||i[5]||qt(e.columnNumber)||(l[0].column=e.columnNumber+1),o={args:i[2]?i[2].split(","):[],column:i[5]?+i[5]:void 0,func:i[1]||Dt,line:i[4]?+i[4]:void 0,url:i[3]}}!o.func&&o.line&&(o.func=Dt),l.push(o)}if(!l.length)return;return{stack:l,message:Vt(e,"message"),name:Vt(e,"name")}}(e))return n}catch(e){if(Nt)throw e}try{if(n=function(e){var t=Vt(e,"message");if(!t)return;var n=t.split("\n");if(n.length<4)return;var r,i=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,a=/^\s*Line (\d+) of function script\s*$/i,s=[],u=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var f in u)jt(u,f)&&!u[f].src&&c.push(u[f]);for(var d=2;d<n.length;d+=2){var l;if(i.exec(n[d]))l={args:[],column:void 0,func:(r=i.exec(n[d]))[3],line:+r[1],url:r[2]};else if(o.exec(n[d]))l={args:[],column:void 0,func:(r=o.exec(n[d]))[4],line:+r[1],url:r[3]};else if(a.exec(n[d])){r=a.exec(n[d]),l={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+r[1]}}l&&(l.func||(l.func=Dt),l.context=[n[d+1]],s.push(l))}if(!s.length)return;return{stack:s,message:n[0],name:Vt(e,"name")}}(e))return n}catch(e){if(Nt)throw e}try{if(n=Ut(e,r+1))return n}catch(e){if(Nt)throw e}return{message:Vt(e,"message"),name:Vt(e,"name"),stack:[]}}var Nt=!1;function Pt(e,t,n){var r={url:t,line:n?+n:void 0};if(r.url&&r.line){e.incomplete=!1;var i=e.stack;if(i.length>0&&i[0].url===r.url){if(i[0].line===r.line)return!1;if(!i[0].line&&i[0].func===r.func)return i[0].line=r.line,i[0].context=r.context,!1}return i.unshift(r),e.partial=!0,!0}return e.incomplete=!0,!1}function Ut(e,t){for(var n,r,i=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,o=[],a={},s=!1,u=Ut.caller;u&&!s;u=u.caller)u!==Wt&&u!==xt&&(r={args:[],column:void 0,func:Dt,line:void 0,url:void 0},n=i.exec(u.toString()),u.name?r.func=u.name:n&&(r.func=n[1]),void 0===r.func&&(r.func=n?n.input.substring(0,n.input.indexOf("{")):void 0),a[u.toString()]?s=!0:a[u.toString()]=!0,o.push(r));t&&o.splice(0,t);var c={stack:o,message:Vt(e,"message"),name:Vt(e,"name")};return Pt(c,Vt(e,"sourceURL")||Vt(e,"fileName"),Vt(e,"line")||Vt(e,"lineNumber")),c}function Vt(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function jt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function qt(e){return void 0===e}var Ft;function Qt(e,t){var n,r,i=!1,o=function(){i=!0,window.clearTimeout(n),n=window.setTimeout((function(){i=!1}),1e3)};return{get:function(){return i||(r=zt(e),o()),r},set:function(n,i){Ht(e,n,i,t),r=n,o()}}}function Ht(e,t,n,r){var i=new Date;i.setTime(i.getTime()+n);var o="expires="+i.toUTCString(),a=r&&r.crossSite?"none":"strict",s=r&&r.domain?";domain="+r.domain:"",u=r&&r.secure?";secure":"";document.cookie=e+"="+t+";"+o+";path=/;samesite="+a+s+u}function zt(e){return function(e,t){var n=e.match("(?:^|;)\\s*"+t+"\\s*=\\s*([^;]+)");return n?n[1]:void 0}(document.cookie,e)}var Gt=/^\s+|\s+$/g,Xt={resourceSampleRate:100,sampleRate:100,flushTimeout:3e4,maxErrorsByMinute:3e3,maxBatchSize:50,maxMessageSize:262144,requestErrorResponseLengthLimit:32768,batchBytesLimit:16384,datakitUrl:"",logsEndpoint:"",trackInteractions:!1,allowedDDTracingOrigins:[],beforeSend:function(e){}};function Jt(e){return e.replace(Gt,"")}function Kt(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===Ft){for(var e="dd_site_test_".concat(O()),t=window.location.hostname.split("."),n=t.pop();t.length&&!zt(e);)n=t.pop()+"."+n,Ht(e,"test",L,{domain:n});Ft=n}return Ft}()),t}function Yt(e){return e.lastIndexOf("/")===e.length-1?Jt(e)+"v1/write/logging":Jt(e)+"/v1/write/logging"}function Zt(e,t){return n=e,r=t.datakitUrl,gt(n)===gt(r);var n,r}var en,tn,nn,rn,on,an,sn={sdk_name:"_dd.sdk_name",sdk_version:"_dd.sdk_version",app_id:"application.id",env:"_dd.env",version:"_dd.version",userid:"user.id",user_email:"user.email",user_name:"user.name",session_id:"session.id",session_type:"session.type",is_signin:"user.is_signin",os:"device.os",os_version:"device.os_version",os_version_major:"device.os_version_major",browser:"device.browser",browser_version:"device.browser_version",browser_version_major:"device.browser_version_major",screen_size:"device.screen_size",network_type:"device.network_type",device:"device.device",view_id:"view.id",view_referrer:"view.referrer",view_url:"view.url",view_host:"view.host",view_path:"view.path",view_path_group:"view.path_group",view_url_query:"view.url_query"},un={view:{type:Ne.VIEW,tags:{view_loading_type:"view.loading_type",view_apdex_level:"view.apdex_level",is_active:"view.is_active"},fields:{view_error_count:"view.error.count",view_resource_count:"view.resource.count",view_long_task_count:"view.long_task.count",view_action_count:"view.action.count",first_contentful_paint:"view.first_contentful_paint",largest_contentful_paint:"view.largest_contentful_paint",cumulative_layout_shift:"view.cumulative_layout_shift",first_input_delay:"view.first_input_delay",loading_time:"view.loading_time",dom_interactive:"view.dom_interactive",dom_content_loaded:"view.dom_content_loaded",dom_complete:"view.dom_complete",load_event:"view.load_event",first_input_time:"view.first_input_time",first_meaningful_paint:"view.largest_contentful_paint",first_paint_time:"view.fpt",resource_load_time:"view.resource_load_time",time_to_interactive:"view.tti",dom:"view.dom",dom_ready:"view.dom_ready",time_spent:"view.time_spent"}},resource:{type:Ne.RESOURCE,tags:{trace_id:"_dd.trace_id",span_id:"_dd.span_id",resource_url:"resource.url",resource_url_host:"resource.url_host",resource_url_path:"resource.url_path",resource_url_path_group:"resource.url_path_group",resource_url_query:"resource.url_query",resource_type:"resource.type",resource_status:"resource.status",resource_status_group:"resource.status_group",resource_method:"resource.method"},fields:{resource_size:"resouce.size",duration:"resource.duration",resource_dns:"resource.dns",resource_tcp:"resource.tcp",resource_ssl:"resource.ssl",resource_ttfb:"resource.ttfb",resource_trans:"resource.trans",resource_first_byte:"resource.firstbyte"}},error:{type:Ne.ERROR,tags:{error_source:"error.source",error_type:"error.type",resource_url:"error.resource.url",resource_url_host:"error.resource.url_host",resource_url_path:"error.resource.url_path",resource_url_path_group:"error.resource.url_path_group",resource_status:"error.resource.status",resource_status_group:"error.resource.status_group",resource_method:"error.resource.method"},fields:{error_message:["string","error.message"],error_stack:["string","error.stack"]}},long_task:{type:Ne.LONG_TASK,tags:{},fields:{duration:"long_task.duration"}},action:{type:Ne.ACTION,tags:{action_id:"action.id",action_name:"action.target.name",action_type:"action.type"},fields:{duration:"action.loading_time",action_error_count:"action.error.count",action_resource_count:"action.resource.count",action_long_task_count:"action.long_task.count"}},browser_log:{type:Ne.LOGGER,tags:{error_source:"error.source",error_type:"error.type",error_resource_url:"resource.url",error_resource_url_host:"resource.url_host",error_resource_url_path:"resource.url_path",error_resource_url_path_group:"resource.url_path_group",error_resource_status:"resource.status",error_resource_status_group:"resource.status_group",error_resource_method:"resource.method",action_id:"user_action.id",service:"service",status:"status"},fields:{message:["string","message"]}}},cn=[],fn=[];function dn(){return en||(tn=XMLHttpRequest.prototype.open,nn=XMLHttpRequest.prototype.send,rn=XMLHttpRequest.prototype.abort,XMLHttpRequest.prototype.open=function(e,t){return this._dataflux_xhr={method:e,startTime:-1,url:ht(t)},tn.apply(this,arguments)},XMLHttpRequest.prototype.send=function(e){var t=this;if(this._dataflux_xhr){var n=this._dataflux_xhr;n.startTime=q(),n.startClocks=F(),n.isAborted=!1;var r=this.onreadystatechange;this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&o(),r&&r.apply(this,arguments)};var i=!1,o=function e(){if(t.removeEventListener("loadend",e),!i){i=!0;var r=c({},n,{duration:H(n.startClocks.relative,q()),response:t.response,status:t.status});u(fn,(function(e){e(r,t)}))}};t.addEventListener("loadend",o),u(cn,(function(e){e(n,t)}))}return nn.apply(t,arguments)},XMLHttpRequest.prototype.abort=function(){return this._dataflux_xhr&&(this._dataflux_xhr.isAborted=!0),rn.apply(this,arguments)},en={beforeSend:function(e){cn.push(e)},onRequestComplete:function(e){fn.push(e)}}),en}function ln(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var pn,vn,mn=[],hn=[];function gn(){return on||(!function(){if(!window.fetch)return;an=window.fetch,window.fetch=function(e,t){var n,r=yn.apply(null,[e,t]);return r?(n=an.call(this,r.input,r.init),wn.apply(null,[n,r])):n=an.call(this,e,t),n}}(),on={beforeSend:function(e){mn.push(e)},onRequestComplete:function(e){hn.push(e)}}),on}function yn(e,t){var n=t&&t.method||"object"==typeof e&&e.method||"GET",r=ht("object"==typeof e&&e.url||e),i=F(),o={init:t,input:e,method:n,startTime:q(),startClocks:i,url:r};return u(mn,(function(e){e(o)})),o}function wn(e,t){var n=function(){var e,n=(e=function*(e){if(t.duration=H(t.startClocks.relative,q()),"stack"in e||e instanceof Error)t.status=0,t.response=Fe(Wt(e)),t.headers=e.headers,t.isAborted=e instanceof DOMException&&e.code===DOMException.ABORT_ERR,u(hn,(function(e){e(t)}));else if("status"in e){var n;try{n=yield e.clone().text()}catch(e){n="Unable to retrieve response: "+e}t.response=n,t.responseType=e.type,t.status=e.status,t.headers=e.headers,t.isAborted=!1,u(hn,(function(e){e(t)}))}},function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){ln(o,r,i,a,s,"next",e)}function s(e){ln(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}();e.then(n,n)}function bn(e){return pn||(function(e,t){function n(n,r){Zt(r.url,e)||e.isEnabled("remove-network-errors")&&r.isAborted||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!function(e){return e.status>=500}(r)||t.notify({message:Sn(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:je,stack:En(r.response,e)||"Failed to load",startClocks:r.startClocks})}dn().onRequestComplete((function(e){n(Pe.XHR,e)})),gn().onRequestComplete((function(e){n(Pe.FETCH,e)}))}(e,pn=new mt),function(e){vn=console.error,console.error=function(){vn.apply(console,arguments),e.notify(c({},_n(l(arguments)),{source:Ve,startClocks:F()}))}}(pn),function(e){Mt((function(t,n,r){var i=function(e,t,n){return e&&(void 0!==e.message||t instanceof Error)?{message:e.message||"Empty message",stack:Fe(e),type:e.name}:{message:n+""+JSON.stringify(t),stack:"No stack, consider using an instance of Error",type:e&&e.name}}(t,r,"Uncaught");e.notify({message:i.message,stack:i.stack,type:i.type,source:qe,startClocks:F()})}))}(pn)),pn}function _n(e){var t=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n,e))return r}}(e,(function(e){return e instanceof Error}));return{message:m(["console error:"].concat(e),(function(e){return function(e){if("string"==typeof e)return e;if(e instanceof Error)return((t=Wt(e)).name||"Error")+": "+t.message;var t;return M(e,0,2)}(e)})).join(" "),stack:t?Fe(Wt(t)):void 0}}function En(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function Sn(e){return Pe.XHR===e?"XHR":"Fetch"}function xn(e){return!!function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_".concat(O()),n="test";return Ht(t,n,L,e),zt(t)===n}catch(e){return!1}}(e)}function On(){return"file:"!==window.location.protocol}var Tn=9e5,Cn=144e5;function kn(e,t,n){var r=function(e){var t=Qt("_dataflulx_an_id",e);return t.get()||t.set(O(),5184e6),t}(e),i=Qt("_dataflux_s",e),o=new mt,a=Mn(i).id,s=S((function(){var e=Mn(i),r=n(e[t]);e[t]=r.trackingType,r.isTracked&&!e.id&&(e.id=O(),e.created=String(Date.now())),$n(e,i),r.isTracked&&a!==e.id&&(a=e.id,o.notify())}),1e3);return s(),function(e){var t=Z(window,[le,ge,pe,he],e,{capture:!0,passive:!0});Bn.push(t.stop)}(s),function(e){var t=function(){"visible"===document.visibilityState&&e()},n=Y(document,ye,t);Bn.push(n.stop);var r=window.setInterval(t,6e4);Bn.push((function(){clearInterval(r)}))}((function(){$n(Mn(i),i)})),{getAnonymousID:function(){return r.get()},getId:function(){var e=Mn(i);return e.did||e.id},getTrackingType:function(){return Mn(i)[t]},getDebugSession:function(){var e=Mn(i);return g(e)||!e.did?{}:{id:e.did,created:e.dcreated}},addDebugSession:function(e,t){var n=Mn(i);g(n)||(n.did=e||O,n.dcreated=t||String(Date.now()),$n(n,i))},clearDebugSession:function(){var e=Mn(i),t={};u(y(e),(function(e){"did"!==e[0]&&"dcreated"!==e[0]&&(t[e[0]]=e[1])})),$n(t,i)},renewObservable:o}}var In=/^([a-z]+)=([a-z0-9-]+)$/,Rn="&";function Mn(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf("&")||In.test(e))})(t)&&u(t.split(Rn),(function(e){var t=In.exec(e);if(null!==t){var r=t[1],i=t[2];n[r]=i}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<Cn)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(An(e),{})}function $n(e,t){if(g(e))An(t);else{e.expire=String(Date.now()+Tn);var n=[];u(y(e),(function(e){n.push(e[0]+"="+e[1])}));var r=n.join(Rn);t.set(r,Tn)}}function An(e){e.set("",0)}var Bn=[];var Ln=/[^\u0000-\u007F]/,Dn="custom_keys";var Wn=function(e,t){this.endpointUrl=e,this.bytesLimit=t};Wn.prototype={send:function(e,t){var n=function(e){return e?e+(-1===e.indexOf("?")?"?":"&")+"precision=ms":e}(this.endpointUrl);if(navigator.sendBeacon&&t<this.bytesLimit&&navigator.sendBeacon(n,e))return;var r=new XMLHttpRequest;r.open("POST",n,!0),r.withCredentials=!0,r.send(e)}};var Nn=Wn,Pn=function(e){if(!e||!e.type)return"";var t={tags:{},fields:{}},n=!1,r="";return u(un,(function(i,o){if(i.type===e.type){r+=o+",",t.measurement=o;var a=[],s=c({},sn,i.tags),f=["date","type"];if(u(s,(function(n,r){var i=K(e,n);f.push(r),(i||_(i))&&(t.tags[r]=i,a.push(oe(r)+"="+oe(i)))})),e.tags&&h(e.tags)&&!g(e.tags)){var l=[];u(e.tags,(function(e,n){f.indexOf(n)>-1||(f.push(n),(e||_(e))&&(l.push(n),t.tags[n]=e,a.push(oe(n)+"="+oe(e))))})),l.length&&(t.tags.custom_keys=l,a.push(oe(Dn)+"="+oe(l)))}var p=[];u(i.fields,(function(n,r){if(d(n)&&2===n.length){var i=n[0],o=n[1],a=K(e,o);f.push(r),(a||_(a))&&(t.fields[r]=a,a="string"===i?'"'+a.replace(/[\\]*"/g,'"').replace(/"/g,'\\"')+'"':oe(a),p.push(oe(r)+"="+a))}else if(w(n)){a=K(e,n);f.push(r),(a||_(a))&&(t.fields[r]=a,a=oe(a),p.push(oe(r)+"="+a))}})),e.type===Ne.LOGGER&&u(e,(function(e,t){-1===f.indexOf(t)&&(_(e)||w(e)||b(e))&&a.push(oe(t)+"="+oe(e))})),a.length&&(r+=a.join(",")),p.length&&(r+=" ",r+=p.join(","),n=!0),r=r+" "+e.date,t.time=U(e.date)}})),{rowStr:n?r:"",rowData:n?t:void 0}};function Un(e,t,n,r,i,o){this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=i,this.beforeUnloadCallback=o,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()}Un.prototype={add:function(e){this.addOrUpdate(e)},upsert:function(e,t){this.addOrUpdate(e,t)},flush:function(){if(0!==this.bufferMessageCount){var e=this.pushOnlyBuffer.concat(p(this.upsertBuffer));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}},processSendData:function(e){return Pn(e).rowStr},sizeInBytes:function(e){return Ln.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},addOrUpdate:function(e,t){var n=this.process(e);n.processedMessage&&""!==n.processedMessage&&(n.messageBytesSize>=this.maxMessageSize||(this.hasMessageFor(t)&&this.remove(t),this.willReachedBytesLimitWith(n.messageBytesSize)&&this.flush(),this.push(n.processedMessage,n.messageBytesSize,t),this.isFull()&&this.flush()))},process:function(e){var t="";return{processedMessage:t=this.processSendData(e),messageBytesSize:this.sizeInBytes(t)}},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},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)},hasMessageFor:function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},willReachedBytesLimitWith:function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},isFull:function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},flushPeriodically:function(){var e=this;setTimeout((function(){e.flush(),e.flushPeriodically()}),e.flushTimeout)},flushOnVisibilityHidden:function(){var e=this;navigator.sendBeacon&&(Y(window,de,e.beforeUnloadCallback),Y(document,ye,(function(){"hidden"===document.visibilityState&&e.flush()})),Y(window,de,(function(){e.flush()})))}};var Vn=Un,jn="0",qn="1",Fn="2";function Qn(e,t){var n=kn(e.cookieOptions,"rum",(function(t){return function(e,t){var n;n=function(e){return e===jn||e===qn||e===Fn}(t)?t:W(e.sampleRate)?W(e.resourceSampleRate)?qn:Fn:jn;return{trackingType:n,isTracked:Hn(n)}}(e,t)}));return n.renewObservable.subscribe((function(){t.notify(Ze)})),{getId:n.getId,getAnonymousID:n.getAnonymousID,getDebugSession:n.getDebugSession,addDebugSession:n.addDebugSession,clearDebugSession:n.clearDebugSession,isTracked:function(){return void 0!==n.getId()&&Hn(n.getTrackingType())},isTrackedWithResource:function(){return void 0!==n.getId()&&n.getTrackingType()===qn}}}function Hn(e){return e===qn||e===Fn}var zn={sdkVersion:"2.0.17",sdkName:"df_web_rum_sdk"},Gn="initial_document",Xn=[[Te,function(e){return Gn===e}],[Ce,function(e){return"xmlhttprequest"===e}],[Ie,function(e){return"fetch"===e}],[ke,function(e){return"beacon"===e}],[Re,function(e,t){return null!==t.match(/\.css$/i)}],[Me,function(e,t){return null!==t.match(/\.js$/i)}],[$e,function(e,t){return ee(["image","img","icon"],e)||null!==t.match(/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i)}],[Ae,function(e,t){return null!==t.match(/\.(woff|eot|woff2|ttf)$/i)}],[Be,function(e,t){return ee(["audio","video"],e)||null!==t.match(/\.(mp3|mp4)$/i)}]];function Jn(e){var t=e.name;if(!function(e){try{return!!yt(e)}catch(e){return!1}}(t))return Le;var n=function(e){var t=yt(e).pathname;return"/"===t[0]?t:"/"+t}(t),r=Le;return u(Xn,(function(t){var i=t[0];if((0,t[1])(e.initiatorType,n))return r=i,!1})),r}function Kn(){for(var e=l(arguments),t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function Yn(e){var t=Zn(e);if(t){var n=t.startTime,r=t.fetchStart,i=t.redirectStart,o=t.redirectEnd,a=t.domainLookupStart,s=t.domainLookupEnd,u=t.connectStart,c=t.secureConnectionStart,f=t.connectEnd,d=t.requestStart,l=t.responseStart,p=t.responseEnd,v={firstbyte:tr(n,a,l),trans:tr(n,l,p),ttfb:tr(n,d,l)};return f!==r&&(v.tcp=tr(n,u,f),Kn(u,c,f)&&(v.ssl=tr(n,c,f))),s!==r&&(v.dns=tr(n,a,s)),er(e)&&(v.redirect=tr(n,i,o)),v}}function Zn(e){if(Kn(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd)){if(!er(e))return e;var t=e.redirectStart,n=e.redirectEnd;if(t<e.startTime&&(t=e.startTime),n<e.startTime&&(n=e.fetchStart),Kn(e.startTime,t,n,e.fetchStart))return c({},e,{redirectEnd:n,redirectStart:t})}}function er(e){return e.fetchStart!==e.startTime}function tr(e,t,n){return P(n-t)}function nr(e){if(e.startTime<e.responseStart)return e.decodedBodySize}function rr(e,t){return t&&!Zt(t,e)}function ir(){return void 0!==window.performance&&"getEntries"in performance}function or(e){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&ee(PerformanceObserver.supportedEntryTypes,e)}function ar(e,t){var n;if(n=function(n){fr(e,t,n)},sr("interactive",(function(){var e,t={entryType:"resource",initiatorType:Gn,traceId:""};if(or("navigation")&&performance.getEntriesByType("navigation").length>0){var r=performance.getEntriesByType("navigation")[0];e=c(r.toJSON(),t)}else{var i=ur();e=c(i,{decodedBodySize:0,duration:i.responseEnd,name:window.location.href,startTime:0},t)}n(e)})),ir()&&cr(e,t,performance.getEntries()),window.PerformanceObserver){new PerformanceObserver((function(n){cr(e,t,n.getEntries())})).observe({entryTypes:["resource","navigation","longtask","paint","largest-contentful-paint","first-input","layout-shift"]}),ir()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}or("navigation")||function(e){function t(){e(c(ur(),{entryType:"navigation"}))}sr("complete",(function(){setTimeout(t)}))}((function(n){fr(e,t,n)})),or("first-input")||function(e){var t=Date.now(),n=!1,r=Z(window,[le,Oe,pe,ge,be],(function(e){if(e.cancelable){var t={entryType:"first-input",processingStart:performance.now(),startTime:e.timeStamp};e.type===be?i(t):o(t)}}),{passive:!0,capture:!0}).stop;function i(e){Z(window,[_e,Ee],(function(t){t.type===_e&&o(e)}),{once:!0})}function o(i){if(!n){n=!0,r();var o=i.processingStart-i.startTime;o>=0&&o<Date.now()-t&&e(i)}}}((n=>{fr(e,t,n)}))}function sr(e,t){document.readyState===e||"complete"===document.readyState?t():Y(window,"complete"===e?ve:we,t,{once:!0})}function ur(){var e={},t=performance.timing;for(var n in t)_(t[n])&&(e[n]=0===t[n]?0:t[n]-J());return e}function cr(e,t,n){u(n,(function(n){"resource"!==n.entryType&&"navigation"!==n.entryType&&"paint"!==n.entryType&&"longtask"!==n.entryType&&"largest-contentful-paint"!==n.entryType&&"first-input"!==n.entryType&&"layout-shift"!==n.entryType||fr(e,t,n)}))}function fr(e,t,n){(function(e){return"navigation"===e.entryType&&e.loadEventEnd<=0})(n)||function(e,t){return"resource"===t.entryType&&!rr(e,t.name)}(t,n)||e.notify(He,n)}function dr(e){var t,n=function(){var e,t=window;if(t.Zone){var n=t.Zone.__symbol__("MutationObserver");e=t[n]}return e||(e=t.MutationObserver),e}();return n&&(t=new n((function(){e.notify(et)}))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){t&&t.disconnect()}}}function lr(e,t){void 0===t&&(t=A);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=e.subscribe(it,(function(e){switch(e.rawRumEvent.type){case Ne.ERROR:n.errorCount+=1,t(n);break;case Ne.ACTION:n.userActionCount+=1,t(n);break;case Ne.LONG_TASK:n.longTaskCount+=1,t(n);break;case Ne.RESOURCE:n.resourceCount+=1,t(n)}}));return{stop:function(){r.unsubscribe()},eventCounts:n}}function pr(e,t){var n=function(e){var t,n=new mt,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(e.subscribe(et,(function(){o()}))),r.push(e.subscribe(He,(function(e){"resource"===e.entryType&&o()}))),r.push(e.subscribe(nt,(function(e){void 0===t&&(t=e.requestIndex),i+=1,o()}))),r.push(e.subscribe(rt,(function(e){void 0===t||e.requestIndex<t||(i-=1,o())}))),{observable:n,stop:function(){u(r,(function(e){e.unsubscribe()}))}}}(e),r=n.observable,i=n.stop,o=function(e,t,n){var r,i=!1,o=setTimeout((function(){u({hadActivity:!1})}),100),a=setTimeout((function(){u({hadActivity:!0,endTime:V()})}),1e4);function s(){i=!0,clearTimeout(o),clearTimeout(r),clearTimeout(a),t()}function u(e){i||(s(),n(e))}return e.subscribe((function(e){var t=e.isBusy;clearTimeout(o),clearTimeout(r);var n=V();t||(r=setTimeout((function(){u({hadActivity:!0,endTime:n})}),100))})),{stop:s}}(r,i,t).stop;return{stop:function(){o(),i()}}}function vr(e){return function(e){var t;if(function(){void 0===yr&&(yr="closest"in HTMLElement.prototype);return yr}())t=e.closest("[data-df-action-name]");else for(var n=e;n;){if(n.hasAttribute(mr)){t=n;break}n=n.parentElement}if(!t)return;return Sr(Er(t.getAttribute(mr).trim()))}(e)||_r(e,wr)||_r(e,br)||""}var mr="data-df-action-name";var hr,gr,yr,wr=[function(e){if(function(){void 0===gr&&(gr="labels"in HTMLInputElement.prototype);return gr}()){if("labels"in e&&e.labels&&e.labels.length>0)return xr(e.labels[0])}else if(e.id){var t=e.ownerDocument&&e.ownerDocument.querySelector('label[for="'+e.id.replace('"','\\"')+'"]');return t&&xr(t)}},function(e){if("INPUT"===e.nodeName){var t=e,n=t.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return t.value}},function(e){if("BUTTON"===e.nodeName||"LABEL"===e.nodeName||"button"===e.getAttribute("role"))return xr(e)},function(e){return e.getAttribute("aria-label")},function(e){var t=e.getAttribute("aria-labelledby");if(t)return t=t.split(/\s+/),t=m(t,(function(t){return function(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}(e,t)})),t=v(t,(function(e){return Boolean(e)})),(t=m(t,(function(e){return xr(e)}))).join(" ")},function(e){return e.getAttribute("alt")},function(e){return e.getAttribute("name")},function(e){return e.getAttribute("title")},function(e){return e.getAttribute("placeholder")},function(e){if("options"in e&&e.options.length>0)return xr(e.options[0])}],br=[function(e){return xr(e)}];function _r(e,t){for(var n=e,r=0;r<=10&&n&&"BODY"!==n.nodeName&&"HTML"!==n.nodeName&&"HEAD"!==n.nodeName;){for(var i of t){var o=i(n);if("string"==typeof o){var a=o.trim();if(a)return Sr(Er(a))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function Er(e){return e.replace(/\s+/g," ")}function Sr(e){return e.length>100?(n=100,((r=(t=e).charCodeAt(n-1))>=55296&&r<=56319?t.slice(0,n+1):t.slice(0,n))+" [...]"):e;var t,n,r}function xr(e){if(!e.isContentEditable){if("innerText"in e){var t=e.innerText;if(!function(){if(void 0===hr){var e=document.createElement("style");e.textContent="*";var t=document.createElement("div");t.appendChild(e),document.body.appendChild(t),hr=""===t.innerText,document.body.removeChild(t)}return hr}())for(var n=e.querySelectorAll("script, style"),r=0;r<n.length;r+=1){var i=n[r].innerText;i.trim().length>0&&(t=t.replace(i,""))}return t}return e.textContent}}function Or(e){var t=function(e){var t,n;return{create:function(r,i){if(!t){var o=new Tr(e,r,i);t=o,n=pr(e,(function(e){e.hadActivity?o.complete(e.endTime):o.discard(),t=void 0}))}},discardCurrent:function(){t&&(n.stop(),t.discard(),t=void 0)}}}(e);e.subscribe(Je,(function(){t.discardCurrent()}));var n=Y(window,le,(function(e){if(e.target instanceof Element){var n=vr(e.target);n&&t.create(De,n)}}),{capture:!0}).stop;return{stop:function(){t.discardCurrent(),n()}}}var Tr=function(e,t,n){this.id=O(),this.startClocks=F(),this.name=n,this.type=t,this.lifeCycle=e,this.eventCountsSubscription=lr(e),this.lifeCycle.notify(ze,{id:this.id,startClocks:this.startClocks})};function Cr(e,t){return e.subscribe(Ge,(function(t){e.notify(it,kr(t))})),t.trackInteractions&&Or(e),{addAction:function(t,n){e.notify(it,c({savedCommonContext:n},kr(t)))}}}function kr(e){var t=Ir(e)?{action:{error:{count:e.counts.errorCount},id:e.id,loadingTime:U(e.duration),long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}}}:void 0;return{customerContext:Ir(e)?void 0:e.context,rawRumEvent:f({action:{target:{name:e.name},type:e.type},date:G(e.startClocks),type:Ne.ACTION},t),startTime:e.startClocks.relative}}function Ir(e){return e.type!==We}Tr.prototype={complete:function(e){var t=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(Ge,{counts:{errorCount:t.errorCount,longTaskCount:t.longTaskCount,resourceCount:t.resourceCount},duration:H(z(this.startClocks),e),id:this.id,name:this.name,startClocks:this.startClocks,type:this.type}),this.eventCountsSubscription.stop()},discard:function(){this.lifeCycle.notify(Xe),this.eventCountsSubscription.stop()}};function Rr(e,t){var n=function(e,t){var n=r(e.datakitUrl,(function(){t.notify(tt)}));function r(t,n){return new Vn(new Nn(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,n)}var i=!1;return{add:function(e){i||n.add(e)},stop:function(){i=!0},upsert:function(e,t){i||n.upsert(e,t)}}}(e,t);return t.subscribe(ot,(function(e){Et.bridge?function(e){var t=Pn(e).rowData;t&&Et.sendEvent({name:"rum",data:t})}(e):function(e,t){e.type===Ne.VIEW?t.upsert(e,e.view.id):t.add(e)}(e,n)})),{stop:function(){n.stop()}}}var Mr,$r="synthetics",Ar="user",Br=["view.url","view.referrer","action.target.name","error.message","error.stack","error.resource.url","resource.url"];function Lr(e,t,n,r,i,o){var a=function(e,t){var n=0,r=!1;return{isLimitReached:function(){if(0===n&&setTimeout((function(){n=0}),D),(n+=1)<=e.maxErrorsByMinute||r)return r=!1,!1;if(n===e.maxErrorsByMinute+1){r=!0;try{t({message:"Reached max number of errors by minute: ".concat(e.maxErrorsByMinute),source:Ue,startClocks:F()})}finally{r=!1}}return!0}}}(t,(function(e){n.notify(at,{error:e})}));n.subscribe(it,(function(s){var u,c=s.startTime,d=s.rawRumEvent,l=s.savedGlobalContext,p=s.customerContext,v=i.findView(c),m={device:fe};if(r.isTracked()&&v&&v.session.id===r.getId()){var h=i.findAction(c),y=l||o(),w={_dd:{sdkName:t.sdkName,sdkVersion:t.sdkVersion,env:t.env,version:t.version},terminal:{type:"web"},application:{id:e},device:{},date:Q(),user:{id:r.getAnonymousID(),is_signin:"F"},session:{type:void 0===window._DATAFLUX_SYNTHETICS_BROWSER?Ar:$r}},b=re((u=d,-1!==[Ne.ERROR,Ne.RESOURCE,Ne.LONG_TASK].indexOf(u.type)?f(w,m,v,h,d):f(w,m,v,d))),_=f(y.context,p);g(_)||(b.tags=_),"has_replay"in b.session||(b.session.has_replay=y.hasReplay),g(y.user)||(b.user=f({id:r.getAnonymousID(),is_signin:"T"},y.user)),function(e,t,n){if(t){var r=ft(e,Br,t);if(!1===r&&e.type!==Ne.VIEW)return!1}if(e.type===Ne.ERROR)return!n.isLimitReached();return!0}(b,t.beforeSend,a)&&n.notify(ot,b)}}))}function Dr(e,t){return bn(t).subscribe((function(t){e.notify(at,{error:t})})),function(e){return e.subscribe(at,(function(t){e.notify(it,function(e){var t=e.resource;if(t){var n=C(e.resource.url).getParse();t={method:e.resource.method,status:e.resource.statusCode,statusGroup:R(e.resource.statusCode),url:e.resource.url,urlHost:n.Host,urlPath:n.Path,urlPathGroup:T(n.Path)}}return{rawRumEvent:{date:j(e.startClocks.relative),error:{message:e.message,resource:t,source:e.source,stack:e.stack,type:e.type,starttime:j(e.startClocks.relative)},type:Ne.ERROR},startTime:e.startClocks.relative}}(t.error))})),{addError:function(t,n){var r=computeRawError(t.error,t.startClocks,t.source);e.notify(at,{customerContext:t.context,savedCommonContext:n,error:r})}}}(e)}function Wr(e){if(void 0===e&&(e=window),!Mr)if("hidden"===document.visibilityState)Mr={timeStamp:0};else{Mr={timeStamp:1/0};var t=Y(e,xe,(function(e){Mr.timeStamp=e.timeStamp}),{capture:!0,once:!0});t.stop}return Mr}function Nr(e,t){var n={};function r(e){n=c(n,e),t(n)}var i=function(e,t){return{stop:e.subscribe(He,(function(e){"navigation"===e.entryType&&t({fetchStart:e.fetchStart,responseEnd:e.responseEnd,domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,loadEventEnd:e.loadEventEnd,loadEventStart:e.loadEventStart,domContentLoadedEventEnd:e.domContentLoadedEventEnd,domContentLoadedEventStart:e.domContentLoadedEventStart})})).unsubscribe}}(e,r).stop,o=function(e,t){var n=Wr();return{stop:e.subscribe(He,(function(e){"paint"===e.entryType&&"first-contentful-paint"===e.name&&e.startTime<n.timeStamp&&t(e.startTime)})).unsubscribe}}(e,(function(e){r({firstContentfulPaint:e})})).stop,a=function(e,t,n){var r=Wr(),i=1/0,o=Z(t,[be,pe],(function(e){i=e.timeStamp}),{capture:!0,once:!0}).stop,a=e.subscribe(He,(function(e){"largest-contentful-paint"===e.entryType&&e.startTime<i&&e.startTime<r.timeStamp&&n(e.startTime)})).unsubscribe;return{stop:function(){o(),a()}}}(e,window,(function(e){r({largestContentfulPaint:e})})).stop,s=function(e,t){var n=Wr();return{stop:e.subscribe(He,(function(e){if("first-input"===e.entryType&&e.startTime<n.timeStamp){var r=H(e.startTime,e.processingStart);t({firstInputDelay:r>=0?r:0,firstInputTime:e.startTime})}})).unsubscribe}}(e,(function(e){r({firstInputDelay:e.firstInputDelay,firstInputTime:e.firstInputTime})})).stop;return{stop:function(){i(),o(),a(),s()}}}function Pr(e){var t=function(e){var t=history.pushState;history.pushState=function(){t.apply(this,arguments),e()};var n=history.replaceState;history.replaceState=function(){n.apply(this,arguments),e()};var r=Y(window,me,e).stop;return{stop:function(){r(),history.pushState=t,history.replaceState=n}}}(e),n=Y(window,Se,e),r=t.stop,i=n.stop;return{stop:function(){r(),i()}}}function Ur(e,t){return e.pathname!==t.pathname||(n=t.hash,r=n.substr(1),!document.getElementById(r)&&Vr(t.hash)!==Vr(e.hash));var n,r}function Vr(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}function jr(e,t,n){var r,i={eventCounts:{errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0}},o=lr(e,(function(e){i.eventCounts=e,t()})).stop,a=function(e,t){var n=e===qr.INITIAL_LOAD,r=!0,i=[];function o(){!r&&!n&&i.length>0&&t(Math.max.apply(Math,i))}return{setLoadEvent:function(e){n&&(n=!1,i.push(e),o())},setActivityLoadingTime:function(e){r&&(r=!1,void 0!==e&&i.push(e),o())}}}(n,(function(e){i.loadingTime=e,t()})),s=a.setActivityLoadingTime,u=a.setLoadEvent,c=function(e,t){var n=V();return{stop:pr(e,(function(e){e.hadActivity?t(H(n,e.endTime)):t(void 0)})).stop}}(e,s).stop;if(or("layout-shift")){i.cumulativeLayoutShift=0;var f=function(e,t){return{stop:e.subscribe(He,(function(e){"layout-shift"!==e.entryType||e.hadRecentInput||t(e.value)})).unsubscribe}}(e,(function(e){i.cumulativeLayoutShift=N(i.cumulativeLayoutShift+e,4),t()}));r=f.stop}else r=A;return{stop:function(){o(),c(),r()},setLoadEvent:u,viewMetrics:i}}var qr={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change"};function Fr(e,t){var n,r,i=!1,o=(n=Qr(t,e,i,qr.INITIAL_LOAD,document.referrer,{relative:0,timeStamp:J()}),r=Nr(t,(function(e){n.updateTimings(e),n.scheduleUpdate()})).stop,{initialView:n,stop:r}),a=o.stop,s=o.initialView,u=Pr((function(){if(Ur(s.getLocation(),e))return s.end(),s.triggerUpdate(),void(s=f());s.updateLocation(e),s.triggerUpdate()})).stop;t.subscribe(Ze,(function(){s.end(),s=f()})),t.subscribe(tt,(function(){s.end(),s.triggerUpdate()})),t.subscribe(st,(function(){i=!0,s.updateHasReplay(!0)})),t.subscribe(ut,(function(){i=!1}));var c=window.setInterval((function(){s.triggerUpdate()}),3e5);function f(){return Qr(t,e,i,qr.ROUTE_CHANGE,s.url)}return{addTiming:function(e,t){void 0===t&&(t=F()),s.addTiming(e,t),s.triggerUpdate()},stop:function(){a(),u(),s.end(),clearInterval(c)}}}function Qr(e,t,n,r,i,o,a){void 0===o&&(o=F());var s,u=O(),f={},d={},l=0,p=c({},t),v=n;e.notify(Je,{id:u,startClocks:o,location:p,referrer:i});var m=S(_,3e3,{leading:!1}),h=m.cancel,g=jr(e,m,r),y=g.setLoadEvent,w=g.viewMetrics,b=g.stop;function _(){l+=1,e.notify(Ke,c({},w,{customTimings:d,documentVersion:l,id:u,name:a,loadingType:r,location:p,hasReplay:v,referrer:i,startClocks:o,timings:f,duration:H(z(o),z(void 0===s?F():s)),isActive:void 0===s}))}return _(),{scheduleUpdate:m,end:function(){s=F(),b(),e.notify(Ye,{endClocks:s})},getLocation:function(){return p},triggerUpdate:function(){h(),_()},updateTimings:function(e){f=e,void 0!==e.loadEvent&&y(e.loadEvent)},addTiming:function(e,t){d[function(e){var t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t}(e)]=H(z(o),z(t))},updateLocation:function(e){p=c({},e)},updateHasReplay:function(e){v=e},url:p.href}}function Hr(e,t,n){return e.subscribe(Ke,(function(t){e.notify(it,function(e){var t={_dd:{documentVersion:e.documentVersion},date:G(e.startClocks),type:Ne.VIEW,view:{action:{count:e.eventCounts.userActionCount},cumulativeLayoutShift:e.cumulativeLayoutShift,domComplete:P(e.timings.domComplete),domContentLoaded:P(e.timings.domContentLoaded),domInteractive:P(e.timings.domInteractive),error:{count:e.eventCounts.errorCount},firstContentfulPaint:P(e.timings.firstContentfulPaint),firstInputDelay:P(e.timings.firstInputDelay),firstInputTime:P(e.timings.firstInputTime),largestContentfulPaint:P(e.timings.largestContentfulPaint),loadEventEnd:P(e.timings.loadEventEnd),load_event:P(e.timings.load_event),loadingTime:P(e.loadingTime),loadingType:e.loadingType,isActive:e.isActive,name:e.name,longTask:{count:e.eventCounts.longTaskCount},resource:{count:e.eventCounts.resourceCount},timeSpent:P(e.duration)},session:{hasReplay:e.hasReplay||void 0}};g(e.customTimings)||(t.view.custom_timings=(n=e.customTimings,r=U,i={},u(n,(function(e,t){i[t]=r(e)})),i));var n,r,i;return{rawRumEvent:t=f(t,{view:zr(e.timings)}),startTime:e.startClocks.relative}}(t))})),Fr(n,e)}function zr(e){var t=Zn(e);if(t){var n=t.fetchStart,r=t.responseEnd,i=t.domInteractive,o=t.domContentLoaded,a=t.domComplete,s=t.loadEventEnd,u=t.loadEventStart,c=t.domContentLoadedEventEnd,f={fmp:P(t.largestContentfulPaint)};if(r!==n){f.fpt=P(r-n);var d=parseInt((r-n)/1e3);f.apdexLevel=d>9?9:d}return i!==n&&(f.tti=P(i-n)),o!==n&&(f.domReady=P(o-n)),s!==n&&(f.load=P(s-n)),u!==c&&(f.resourceLoadTime=P(u-c)),a!==i&&(f.dom=P(a-i)),f}}function Gr(e){0===e.status&&(e.traceId=void 0,e.spanId=void 0)}function Xr(e,t,n){var r;void 0!==Jr()&&function(e,t){var n=gt(t),r=!1;return u(e.allowedDDTracingOrigins,(function(e){if(n===e||e instanceof RegExp&&e.test(n))return r=!0,!1})),r}(e,t.url)&&(t.traceId=new Kr,t.spanId=new Kr,n((r=t.traceId,{"x-datadog-origin":"rum","x-datadog-parent-id":t.spanId.toDecimalString(),"x-datadog-sampled":"1","x-datadog-sampling-priority":"1","x-datadog-trace-id":r.toDecimalString()})))}function Jr(){return window.crypto||window.msCrypto}function Kr(){this.buffer=new Uint8Array(8),Jr().getRandomValues(this.buffer),this.buffer[0]=127&this.buffer[0]}Kr.prototype={toString:function(e){for(var t=this.readInt32(0),n=this.readInt32(4),r="";;){var i=t%e*4294967296+n;if(t=Math.floor(t/e),n=Math.floor(i/e),r=(i%e).toString(e)+r,!t&&!n)break}return r},toDecimalString:function(){return this.toString(10)},readInt32:function(e){return 16777216*this.buffer[e]+(this.buffer[e+1]<<16)+(this.buffer[e+2]<<8)+this.buffer[e+3]}};var Yr=1;function Zr(e,t){var n=function(e){return{clearTracingIfCancelled:Gr,traceFetch:function(t){return Xr(e,t,(function(e){t.init=c({},t.init);var n=[];t.init.headers instanceof Headers?u(t.init.headers,(function(e,t){n.push([t,e])})):d(t.init.headers)?u(t.init.headers,(function(e){n.push(e)})):t.init.headers&&u(t.init.headers,(function(e,t){n.push([t,e])})),t.init.headers=n.concat(y(e))}))},traceXhr:function(t,n){return Xr(e,t,(function(e){u(e,(function(e,t){n.setRequestHeader(t,e)}))}))}}}(t);!function(e,t,n){var r=dn();r.beforeSend((function(r,i){rr(t,r.url)&&(n.traceXhr(r,i),r.requestIndex=ei(),e.notify(nt,{requestIndex:r.requestIndex}))})),r.onRequestComplete((function(r,i){rr(t,r.url)&&(n.clearTracingIfCancelled(r),e.notify(rt,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,response:r.response,traceId:r.traceId,startClocks:r.startClocks,spanId:r.spanId,startTime:r.startTime,status:r.status,type:Pe.XHR,url:r.url}))}))}(e,t,n),function(e,t,n){var r=gn();r.beforeSend((function(r){rr(t,r.url)&&(n.traceFetch(r),r.requestIndex=ei(),e.notify(nt,{requestIndex:r.requestIndex}))})),r.onRequestComplete((function(r){rr(t,r.url)&&(n.clearTracingIfCancelled(r),e.notify(rt,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,response:r.response,responseType:r.responseType,startClocks:r.startClocks,spanId:r.spanId,startTime:r.startTime,status:r.status,traceId:r.traceId,type:Pe.FETCH,url:r.url}))}))}(e,t,n)}function ei(){var e=Yr;return Yr+=1,e}function ti(e){if(performance&&"getEntriesByName"in performance){var t=performance.getEntriesByName(e.url,"resource");if(t.length&&"toJSON"in t[0]){var n,r=m(t,(function(e){return e.toJSON()}));return r=v(r,Zn),1===(r=v(r,(function(t){return n=t,r=e.startClocks.relative,i=ni({startTime:e.startClocks.relative,duration:e.duration}),o=1,n.startTime>=r-o&&ni(n)<=i+o;var n,r,i,o}))).length?r[0]:2===r.length&&ni((n=r)[0])<=n[1].startTime?r[1]:void 0}}}function ni(e){return e.startTime+e.duration}function ri(e,t,n){e.subscribe(rt,(function(t){n.isTrackedWithResource()&&e.notify(it,function(e){var t=e.type===Pe.XHR?Ce:Ie,n=ti(e),r=n?X(n.startTime):e.startClocks,i=n?ii(n):void 0,o=function(e){if(!e.traceId||!e.spanId)return;return{_dd:{spanId:e.spanId.toDecimalString(),traceId:e.traceId.toDecimalString()},resource:{id:O()}}}(e),a=C(e.url).getParse(),s=f({date:G(r),resource:{type:t,duration:P(e.duration),method:e.method,status:e.status,statusGroup:R(e.status),url:e.url,urlHost:a.Host,urlPath:a.Path,urlPathGroup:T(a.Path),urlQuery:M(k(e.url))},type:Ne.RESOURCE},o,i);return{startTime:r.relative,rawRumEvent:s}}(t))})),e.subscribe(He,(function(t){var r;n.isTrackedWithResource()&&"resource"===t.entryType&&("xmlhttprequest"!==(r=t).initiatorType&&"fetch"!==r.initiatorType)&&e.notify(it,function(e){var t=Jn(e),n=ii(e),r=function(e){return e.traceId?{_dd:{traceId:e.traceId}}:void 0}(e),i=C(e.name).getParse(),o="";!function(e){return e.encodedBodySize>0&&e.transferSize>0&&e.transferSize<e.encodedBodySize||null}(e)?function(e){return!(e.transferSize>0)&&(e.decodedBodySize>0||e.duration<30)}(e)&&(o=200):o=304;var a=X(e.startTime),s=f({date:G(a),resource:{type:t,url:e.name,urlHost:i.Host,urlPath:i.Path,urlPathGroup:T(i.Path),urlQuery:M(k(e.name)),method:"GET",status:o,statusGroup:R(o)},type:Ne.RESOURCE},r,n);return{startTime:a.relative,rawRumEvent:s}}(t))}))}function ii(e){return{resource:f({},{duration:(t=e,0===t.duration&&t.startTime<t.responseEnd?P(t.responseEnd-t.startTime):P(t.duration)),size:nr(e)},Yn(e))};var t}var oi,ai,si,ui,ci=function(e){var t,n,r,i=!1,o=(t={},{get:function(){return t},add:function(e,n){w(e)&&(t[e]=n)},remove:function(e){delete t[e]},set:function(e){h(e)&&(t=e)}}),a={},s=function(){},u=function(){return{}},d=function(){},l=new se,p=function(e){l.add([e,Q()])},v=new se,m=function(e){v.add([e,F()])},y=new se,b=function(e){y.add([e,S()])},_=new se,E=function(e){_.add([e,S()])};function S(){return f({},{context:o.get(),user:a})}return n={init:function(t){if(xn(Kt(t))&&On()&&function(e){return!i&&(!!e.applicationId&&(!(!e.datakitUrl&&!e.datakitOrigin)&&(!(void 0!==e.sampleRate&&!te(e.sampleRate))&&!(void 0!==e.resourceSampleRate&&!te(e.resourceSampleRate)))))}(t)){var n=e(t,(function(){return{user:a,context:o.get()}}));p=n.session.addDebugSession,b=n.addAction,E=n.addError,m=n.addTiming,u=n.session.getDebugSession,d=n.session.clearDebugSession,s=n.getInternalContext,l.drain((function(e){var t=e[0],n=e[1];p(t,n)})),y.drain((function(e){var t=e[0],n=e[1];b(t,n)})),_.drain((function(e){var t=e[0],n=e[1];E(t,n)})),v.drain((function(e){var t=e[0],n=e[1];m(t,n)})),i=!0}},addRumGlobalContext:o.add,removeRumGlobalContext:o.remove,getRumGlobalContext:o.get,setRumGlobalContext:o.set,getInternalContext:function(e){return s(e)},addDebugSession:function(e){p(e),this.getDebugSession()},clearDebugSession:function(){d()},getDebugSession:function(){var e=u();if(g(e))return e;{const t=x(new Date(+e.created));return e.id,f(e,{format_created:t})}},setUser:function(e){var t=function(e){if("object"==typeof e&&e){var t=f({},e);return"id"in t&&(t.id=String(t.id)),"name"in t&&(t.name=String(t.name)),"email"in t&&(t.email=String(t.email)),t}}(e);t&&(a=t)},removeUser:function(){a={}}},r=c({},n,{onReady:function(e){e()}}),Object.defineProperty(r,"_setDebug",{get:function(){return setDebugMode},enumerable:!1}),r}((function(e,t){var n=new ct,r=function(e,t){var n,r=d(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],i={applicationId:e.applicationId,env:e.env||"",version:e.version||"",sdkVersion:t.sdkVersion,sdkName:t.sdkName,datakitUrl:(n=e.datakitUrl||e.datakitOrigin,n.lastIndexOf("/")===n.length-1?Jt(n)+"v1/write/rum":Jt(n)+"/v1/write/rum"),logsEndpoint:Yt(e.datakitOrigin),isEnabled:function(e){return ee(r,e)},cookieOptions:Kt(e)};return"allowedDDTracingOrigins"in e&&(i.allowedDDTracingOrigins=e.allowedDDTracingOrigins),"sampleRate"in e&&(i.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(i.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(i.trackInteractions=!!e.trackInteractions),f({},Xt,i)}(e,zn),i=Qn(r,n),o=function(e,t,n,r,i,o){var a=function(e,t){var n,r,i,o=[],a=[];e.subscribe(Je,(function(e){n=e,i=t.getId()})),e.subscribe(Ke,(function(e){n&&n.id===e.id&&(n=e)})),e.subscribe(Ye,(function(e){n&&(o.unshift({endTime:e.endClocks.relative,context:f(),startTime:n.startClocks.relative}),n=void 0)})),e.subscribe(ze,(function(e){r=e})),e.subscribe(Ge,(function(e){r&&a.unshift({context:d(),endTime:r.startClocks.relative+e.duration,startTime:r.startClocks.relative}),r=void 0})),e.subscribe(Xe,(function(){r=void 0})),e.subscribe(Ze,(function(){o=[],a=[],n=void 0,r=void 0}));var s=window.setInterval((function(){c(o,144e5),c(a,3e5)}),6e4);function c(e,t){for(var n=q()-t;e.length>0&&e[e.length-1].startTime<n;)e.pop()}function f(){return{session:{id:i},view:{id:n.id,referrer:n.referrer,name:n.name,url:n.location.href,host:n.location.host,path:n.location.pathname,pathGroup:T(n.location.pathname),urlQuery:M(k(n.location.href))}}}function d(){return{userAction:{id:r.id}}}function l(e,t,n,r){if(void 0===r)return n?e():void 0;if(n&&r>=n.startClocks.relative)return e();var i=void 0;return u(t,(function(e){return!(r>e.endTime)&&(r>=e.startTime?(i=e.context,!1):void 0)})),i}return{findAction:function(e){return l(d,a,r,e)},findView:function(e){return l(f,o,n,e)},stop:function(){window.clearInterval(s)}}}(n,i),s=Rr(r,n);Lr(e,r,n,i,a,o),function(e){e.subscribe(He,(function(t){if("longtask"===t.entryType){var n=X(t.startTime),r={date:G(n),long_task:{duration:U(t.duration)},type:Ne.LONG_TASK};e.notify(it,{rawRumEvent:r,startTime:n.relative})}}))}(n),ri(n,0,i);var c=Hr(n,0,t),f=c.addTiming,d=c.stop,l=Dr(n,r);return{addAction:Cr(n,r).addAction,addTiming:f,parentContexts:a,addError:l.addError,stop:function(){d(),s.stop()}}}(e.applicationId,location,n,r,i,t),a=o.parentContexts;Zr(n,r),ar(n,r),dr(n);var s=function(e,t,n){return{get:function(r){var i=n.findView(r);if(t.isTracked()&&i&&i.session.id){const t=n.findAction(r);return{application:{id:e},session:{id:i.session.id},userAction:t?{id:t.userAction.id}:void 0,view:i.view}}}}}(e.applicationId,i,a);return{addAction:o.addAction,addError:o.addError,addTiming:o.addTiming,configuration:r,lifeCycle:n,parentContexts:a,session:i,getInternalContext:s.get}}));oi=function(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}(),si=ci,ui=oi[ai="DATAFLUX_RUM"],oi[ai]=si,ui&&ui.q&&u(ui.q,(function(e){e()}))})();
1
+ (()=>{"use strict";var e=Array.prototype,t=Function.prototype,n=Object.prototype,r=e.slice,i=n.toString,o=n.hasOwnProperty,a=(t.bind,e.forEach),s=(e.indexOf,Array.isArray),u=function(e,t,n){if(null===e)return!1;if(a&&e.forEach===a)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,i=e.length;r<i;r++)if(r in e&&false===t.call(n,e[r],r,e))return!1}else for(var s in e)if(o.call(e,s)&&false===t.call(n,e[s],s,e))return!1},c=function(e){return u(r.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])})),e},d=function(e){return u(r.call(arguments,1),(function(t){for(var n in t)void 0!==t[n]&&(g(t[n])&&g(e[n])?c(e[n],t[n]):e[n]=t[n])})),e},f=s||function(e){return"[object Array]"===i.call(e)},l=function(e){if(!e)return!1;try{return/^\s*\bfunction\b/.test(e)}catch(e){return!1}},p=function(e){return e?e.toArray?e.toArray():f(e)?r.call(e):(t=e)&&o.call(t,"callee")?r.call(e):v(e):[];var t},v=function(e){var t=[];return null===e||u(e,(function(e){t[t.length]=e})),t},h=function(e,t,n){if(e.filter)return e.filter(t);for(var r=[],i=0;i<e.length;i++)if(o.call(e,i)){var a=e[i];t.call(n,a,i,e)&&r.push(a)}return r},m=function(e,t,n){if(e.map)return e.map(t);for(var r=[],i=0;i<e.length;i++)if(o.call(e,i)){var a=e[i];r.push(t.call(n,a,i,e))}return r},g=function(e){return null!==e&&"[object Object]"===i.call(e)},y=function(e){if(g(e)){for(var t in e)if(o.call(e,t))return!1;return!0}return!1},w=function(e){var t=[];return u(e,(function(e,n){t.push([n,e])})),t},b=function(e){return"[object String]"===i.call(e)},_=function(e){return"[object Boolean]"===i.call(e)},S=function(e){return"[object Number]"===i.call(e)&&/[\d\.]+/.test(String(e))},T=function e(t){var n=t;try{n=e(t)}catch(e){n=t}return n},x=(Date.now,function(e,t,n){var r,i,o,a,s=0;n||(n={});var u=function(){s=!1===n.leading?0:(new Date).getTime(),r=null,a=e.apply(i,o),r||(i=o=null)},c=function(){o=arguments;var c=(new Date).getTime();s||!1!==n.leading||(s=c);var d=t-(c-s);return i=this,d<=0||d>t?(r&&(clearTimeout(r),r=null),s=c,a=e.apply(i,o),r||(i=o=null)):r||!1===n.trailing||(r=setTimeout(u,d)),a};return c.cancel=function(){clearTimeout(r),s=0,r=null},c}),E=function(e){function t(e){return e<10?"0"+e:e}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+" "+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+"."+t(e.getMilliseconds())},O=function(e){if("function"==typeof btoa)return btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,(function(e,t){return String.fromCharCode("0x"+t)})));var t,n,r,i,o,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=0,u=0,c="",d=[];if(!(e=String(e)))return e;e=function(e){var t,n,r,i,o="";for(t=n=0,r=(e=(e+"").replace(/\r\n/g,"\n").replace(/\r/g,"\n")).length,i=0;i<r;i++){var a=e.charCodeAt(i),s=null;a<128?n++:s=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),null!==s&&(n>t&&(o+=e.substring(t,n)),o+=s,t=n=i+1)}return n>t&&(o+=e.substring(t,e.length)),o}(e);do{t=(o=e.charCodeAt(s++)<<16|e.charCodeAt(s++)<<8|e.charCodeAt(s++))>>18&63,n=o>>12&63,r=o>>6&63,i=63&o,d[u++]=a.charAt(t)+a.charAt(n)+a.charAt(r)+a.charAt(i)}while(s<e.length);switch(c=d.join(""),e.length%3){case 1:c=c.slice(0,-2)+"==";break;case 2:c=c.slice(0,-1)+"="}return c};function C(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-",1e3,"-",4e3,"-",8e3,"-",1e11).replace(/[018]/g,C)}function I(e){return e?e.replace(/\/([^\/]*)\d([^\/]*)/g,"/?"):""}var k=function(e){var t=function(e){this._fields={Username:4,Password:5,Port:7,Protocol:2,Host:6,Path:8,URL:0,QueryString:9,Fragment:10},this._values={},this._regex=null,this._regex=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/,void 0!==e&&this._parse(e)};return t.prototype.setUrl=function(e){this._parse(e)},t.prototype._initValues=function(){for(var e in this._fields)this._values[e]=""},t.prototype.addQueryString=function(e){if("object"!=typeof e)return!1;var t=this._values.QueryString||"";for(var n in e)t=new RegExp(n+"[^&]+").test(t)?t.replace(new RegExp(n+"[^&]+"),n+"="+e[n]):"&"===t.slice(-1)?t+n+"="+e[n]:""===t?n+"="+e[n]:t+"&"+n+"="+e[n];this._values.QueryString=t},t.prototype.getParse=function(){return this._values},t.prototype.getUrl=function(){var e="";return e+=this._values.Origin,e+=this._values.Port?":"+this._values.Port:"",e+=this._values.Path,e+=this._values.QueryString?"?"+this._values.QueryString:""},t.prototype._parse=function(e){this._initValues();var t=this._regex.exec(e);if(!t)throw"DPURLParser::_parse -> Invalid URL";for(var n in this._fields)void 0!==t[this._fields[n]]&&(this._values[n]=t[this._fields[n]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname},new t(e)},R=function(e){var t={},n=e.split("?")[1]||"";return n&&(t=A("?"+n)),t},A=function(e){for(var t=function(e){return T(e)},n={},r=(e=e||"").substring(1).split("&"),i=0;i<r.length;i++){var o=r[i].indexOf("=");if(-1!==o){var a=r[i].substring(0,o),s=r[i].substring(o+1);a=t(a),s=t(s),n[a]=s}}return n};function M(e){return e?String(e).substr(0,1)+String(e).substr(1).replace(/\d*/g,"x"):e}function B(e,t,n){if(null==e)return JSON.stringify(e);var r=[!1,void 0];L(e)&&(r=[!0,e.toJSON],delete e.toJSON);var i,o,a=[!1,void 0];"object"==typeof e&&L(i=Object.getPrototypeOf(e))&&(a=[!0,i.toJSON],delete i.toJSON);try{o=JSON.stringify(e,void 0,n)}catch(e){o="<error: unable to serialize object>"}finally{r[0]&&(e.toJSON=r[1]),a[0]&&(i.toJSON=a[1])}return o}function L(e){return"object"==typeof e&&null!==e&&e.hasOwnProperty("toJSON")}function $(){}var D,W=1e3,N=6e4;function P(e){return 0!==e&&100*Math.random()<=e}function U(e,t){return+e.toFixed(t)}function V(e){return"number"!=typeof e?e:U(1e6*e,0)}function j(e){return S(e)?U(1e6*e,0):e}function H(){return q()}function F(e){return Math.floor(Y()+e)}function q(){return performance.now()}function Q(){return{relative:q(),timeStamp:z()}}function z(){return Date.now()}function G(e,t){return t-e}function X(e){return e.relative}function K(e){return F(e.relative)}function J(e){return{relative:e,timeStamp:F(e)}}function Y(){return void 0===D&&(D=performance.timing.navigationStart),D}function Z(e,t){for(var n=t.split(".");n.length;){var r=n.shift();if(!(e&&r in e&&o.call(e,r)))return;e=e[r]}return e}function ee(e,t,n,r){return te(e,[t],n,r)}function te(e,t,n,r){var i=r&&r.once?function(e){o(),n(e)}:n;r=r&&r.passive?{capture:r.capture,passive:r.passive}:r&&r.capture,u(t,(function(t){e.addEventListener(t,i,r)}));var o=function(){u(t,(function(t){e.removeEventListener(t,i,r)}))};return{stop:o}}function ne(e,t){return-1!==e.indexOf(t)}function re(e){return S(e)&&e>=0&&e<=100}function ie(e){if(e.origin)return e.origin;var t=e.host.replace(/(:80|:443)$/,"");return e.protocol+"//"+t}function oe(e){var t={};return u(e,(function(e,n){var r;t[(r=n,r.replace(/[A-Z]/g,(function(e,t){return(0!==t?"_":"")+e.toLowerCase()})).replace(/-/g,"_"))]=ae(e)})),t}function ae(e){return f(e)?m(e,(function(e){return ae(e)})):"object"==typeof e&&null!==e?oe(e):e}function se(e){if("object"==typeof e&&e)e=B(e);else if(!b(e))return e;return String(e).replace(/[\s=,"]/g,(function(e){return"\\"+e}))}var ue=function(){this.buffer=[]};ue.prototype={add:function(e){this.buffer.push(e)>this.limit&&this.buffer.splice(0,1)},drain:function(e){u(this.buffer,(function(t){e(t)})),this.buffer.length=0}};var ce=ue,de={navigator:void 0!==window.navigator?window.navigator:{},infoMap:{engine:["WebKit","Trident","Gecko","Presto"],browser:["Safari","Chrome","Edge","IE","IE 11","IE 10","IE 9","IE 8","IE 7","Firefox","Firefox Focus","Chromium","Opera","Vivaldi","Yandex","Arora","Lunascape","QupZilla","Coc Coc","Kindle","Iceweasel","Konqueror","Iceape","SeaMonkey","Epiphany","360","360SE","360EE","UC","QQBrowser","QQ","Baidu","Maxthon","Sogou","LBBROWSER","2345Explorer","TheWorld","XiaoMi","Quark","Qiyu","Wechat",,"WechatWork","Taobao","Alipay","Weibo","Douban","Suning","iQiYi"],os:["Windows","Windows 2000","Windows XP","Windows Vista","Windows 7","Windows 8","Windows 8.1","Windows Server 2003","Windows ME","Windows 10","Windows 98","Windows 95","Windows NT 4.0","Windows CE","Windows 3.11","Linux","Mac OS","Android","Ubuntu","FreeBSD","Debian","iOS","Windows Phone","BlackBerry","MeeGo","Symbian","Chrome OS","WebOS"],device:["Mobile","Tablet","iPad"]}},fe={getMatchMap:function(e){return{Trident:e.indexOf("Trident")>-1||e.indexOf("NET CLR")>-1,Presto:e.indexOf("Presto")>-1,WebKit:e.indexOf("AppleWebKit")>-1,Gecko:e.indexOf("Gecko/")>-1,Safari:e.indexOf("Safari")>-1,Chrome:e.indexOf("Chrome")>-1||e.indexOf("CriOS")>-1,IE:e.indexOf("MSIE")>-1||e.indexOf("Trident")>-1,"IE 11":e.indexOf("Trident")>-1&&e.indexOf("rv:11.0")>-1,"IE 10":e.indexOf("MSIE 10.0")>-1&&e.indexOf("Trident")>-1,"IE 9":e.indexOf("MSIE 9.0")>-1&&e.indexOf("Trident")>-1,"IE 8":e.indexOf("MSIE 9.0")>-1&&e.indexOf("Trident")>-1,"IE 7":e.indexOf("MSIE 7.0")>-1&&e.indexOf("Trident")>-1,Edge:e.indexOf("Edg")>-1||e.indexOf("Edge")>-1,Firefox:e.indexOf("Firefox")>-1||e.indexOf("FxiOS")>-1,"Firefox Focus":e.indexOf("Focus")>-1,Chromium:e.indexOf("Chromium")>-1,Opera:e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,Vivaldi:e.indexOf("Vivaldi")>-1,Yandex:e.indexOf("YaBrowser")>-1,Arora:e.indexOf("Arora")>-1,Lunascape:e.indexOf("Lunascape")>-1,QupZilla:e.indexOf("QupZilla")>-1,"Coc Coc":e.indexOf("coc_coc_browser")>-1,Kindle:e.indexOf("Kindle")>-1||e.indexOf("Silk/")>-1,Iceweasel:e.indexOf("Iceweasel")>-1,Konqueror:e.indexOf("Konqueror")>-1,Iceape:e.indexOf("Iceape")>-1,SeaMonkey:e.indexOf("SeaMonkey")>-1,Epiphany:e.indexOf("Epiphany")>-1,360:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1,"360EE":e.indexOf("360EE")>-1,"360SE":e.indexOf("360SE")>-1,UC:e.indexOf("UC")>-1||e.indexOf(" UBrowser")>-1,QQBrowser:e.indexOf("QQBrowser")>-1,QQ:e.indexOf("QQ/")>-1,Baidu:e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1,Maxthon:e.indexOf("Maxthon")>-1,Sogou:e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1,LBBROWSER:e.indexOf("LBBROWSER")>-1||e.indexOf("LieBaoFast")>-1,"2345Explorer":e.indexOf("2345Explorer")>-1,TheWorld:e.indexOf("TheWorld")>-1,XiaoMi:e.indexOf("MiuiBrowser")>-1,Quark:e.indexOf("Quark")>-1,Qiyu:e.indexOf("Qiyu")>-1,Wechat:e.indexOf("MicroMessenger")>-1,WechatWork:e.indexOf("wxwork/")>-1,Taobao:e.indexOf("AliApp(TB")>-1,Alipay:e.indexOf("AliApp(AP")>-1,Weibo:e.indexOf("Weibo")>-1,Douban:e.indexOf("com.douban.frodo")>-1,Suning:e.indexOf("SNEBUY-APP")>-1,iQiYi:e.indexOf("IqiyiApp")>-1,Windows:e.indexOf("Windows")>-1,"Windows 2000":e.indexOf("Windows NT 5.0")>-1||e.indexOf("Windows 2000")>-1,"Windows XP":e.indexOf("Windows NT 5.1")>-1||e.indexOf("Windows XP")>-1,"Windows Server 2003":e.indexOf("Windows NT 5.2")>-1,"Windows Vista":e.indexOf("Windows NT 6.0")>-1,"Windows 7":e.indexOf("Windows 7")>-1||e.indexOf("Windows NT 6.1")>-1,"Windows 8":e.indexOf("Windows 8")>-1||e.indexOf("Windows NT 6.2")>-1,"Windows 8.1":e.indexOf("Windows 8.1")>-1||e.indexOf("Windows NT 6.3")>-1,"Windows ME":e.indexOf("Win 9x 4.90")>-1||e.indexOf("Windows ME")>-1,"Windows 10":e.indexOf("Windows 10.0")>-1||e.indexOf("Windows NT 10.0")>-1,"Windows 98":e.indexOf("Windows 98")>-1||e.indexOf("Win98")>-1,"Windows 95":e.indexOf("Windows 95")>-1||e.indexOf("Win95")>-1||e.indexOf("Windows_95")>-1,"Windows NT 4.0":e.indexOf("Windows NT 4.0")>-1||e.indexOf("WinNT4.0")>-1||e.indexOf("WinNT")>-1,"Windows CE":e.indexOf("Windows CE")>-1,"Windows 3.11":e.indexOf("Win16")>-1,Linux:e.indexOf("Linux")>-1||e.indexOf("X11")>-1,"Mac OS":e.indexOf("Macintosh")>-1,Android:e.indexOf("Android")>-1||e.indexOf("Adr")>-1,Ubuntu:e.indexOf("Ubuntu")>-1,FreeBSD:e.indexOf("FreeBSD")>-1,Debian:e.indexOf("Debian")>-1,"Windows Phone":e.indexOf("IEMobile")>-1||e.indexOf("Windows Phone")>-1,BlackBerry:e.indexOf("BlackBerry")>-1||e.indexOf("RIM")>-1,MeeGo:e.indexOf("MeeGo")>-1,Symbian:e.indexOf("Symbian")>-1,iOS:e.indexOf("like Mac OS X")>-1,"Chrome OS":e.indexOf("CrOS")>-1,WebOS:e.indexOf("hpwOS")>-1,Mobile:e.indexOf("Mobi")>-1||e.indexOf("iPh")>-1||e.indexOf("480")>-1,Tablet:e.indexOf("Tablet")>-1||e.indexOf("Nexus 7")>-1,iPad:e.indexOf("iPad")>-1}},matchInfoMap:function(e){var t=de.navigator.userAgent||{},n=fe.getMatchMap(t);for(var r in de.infoMap)for(var i=0;i<de.infoMap[r].length;i++){var o=de.infoMap[r][i];n[o]&&(e[r]=o)}},getOS:function(){return fe.matchInfoMap(this),this.os||"Unknown"},getOSVersion:function(){var e=this,t=de.navigator.userAgent||{};e.osVersion="",e.osMajor="";var n={Windows:function(){var e=t.replace(/^.*Windows NT ([\d.]+);.*$/,"$1");return{6.4:"10",6.3:"8.1",6.2:"8",6.1:"7","6.0":"Vista",5.2:"XP",5.1:"XP","5.0":"2000"}[e]||e},Android:function(){return t.replace(/^.*Android ([\d.]+);.*$/,"$1")},iOS:function(){return t.replace(/^.*OS ([\d_]+) like.*$/,"$1").replace(/_/g,".")},Debian:function(){return t.replace(/^.*Debian\/([\d.]+).*$/,"$1")},"Windows Phone":function(){return t.replace(/^.*Windows Phone( OS)? ([\d.]+);.*$/,"$2")},"Mac OS":function(){return t.replace(/^.*Mac OS X ([\d_]+).*$/,"$1").replace(/_/g,".")},WebOS:function(){return t.replace(/^.*hpwOS\/([\d.]+);.*$/,"$1")}};return n[e.os]&&(e.osVersion=n[e.os](),e.osVersion==t&&(e.osVersion="")),e.osVersion&&(e.osMajor=e.osVersion.split(".").length&&e.osVersion.split(".")[0]),{version:e.osVersion,osMajor:e.osMajor}},getOrientationStatu:function(){return window.matchMedia("(orientation: portrait)").matches?"竖屏":"横屏"},getDeviceType:function(){var e=this;return e.device="PC",fe.matchInfoMap(e),e.device},getNetwork:function(){return navigator&&navigator.connection&&navigator.connection.effectiveType},getLanguage:function(){var e;return this.language=((e=(de.navigator.browserLanguage||de.navigator.language).split("-"))[1]&&(e[1]=e[1].toUpperCase()),e.join("_")),this.language},getBrowserInfo:function(){var e=this;fe.matchInfoMap(e);var t=de.navigator.userAgent||{},n=function(e,t){var n=de.navigator.mimeTypes;for(var r in n)if(n[r][e]==t)return!0;return!1},r=fe.getMatchMap(t),i=!1;if(window.chrome){var o=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");o>36&&window.showModalDialog?i=!0:o>45&&(i=n("type","application/vnd.chromium.remoting-viewer"))}if(r.Baidu&&r.Opera&&(r.Baidu=!1),r.Mobile&&(r.Mobile=!(t.indexOf("iPad")>-1)),i&&(n("type","application/gameplugin")||de.navigator&&void 0===de.navigator.connection.saveData?r["360SE"]=!0:r["360EE"]=!0),r.IE||r.Edge)switch(window.screenTop-window.screenY){case 71:case 74:case 99:break;case 102:r["360EE"]=!0;break;case 75:case 74:case 105:break;case 104:r["360SE"]=!0}var a={Safari:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Chrome:function(){return t.replace(/^.*Chrome\/([\d.]+).*$/,"$1").replace(/^.*CriOS\/([\d.]+).*$/,"$1")},IE:function(){return t.replace(/^.*MSIE ([\d.]+).*$/,"$1").replace(/^.*rv:([\d.]+).*$/,"$1")},Edge:function(){return t.replace(/^.*Edge\/([\d.]+).*$/,"$1")},Firefox:function(){return t.replace(/^.*Firefox\/([\d.]+).*$/,"$1").replace(/^.*FxiOS\/([\d.]+).*$/,"$1")},"Firefox Focus":function(){return t.replace(/^.*Focus\/([\d.]+).*$/,"$1")},Chromium:function(){return t.replace(/^.*Chromium\/([\d.]+).*$/,"$1")},Opera:function(){return t.replace(/^.*Opera\/([\d.]+).*$/,"$1").replace(/^.*OPR\/([\d.]+).*$/,"$1")},Vivaldi:function(){return t.replace(/^.*Vivaldi\/([\d.]+).*$/,"$1")},Yandex:function(){return t.replace(/^.*YaBrowser\/([\d.]+).*$/,"$1")},Arora:function(){return t.replace(/^.*Arora\/([\d.]+).*$/,"$1")},Lunascape:function(){return t.replace(/^.*Lunascape[\/\s]([\d.]+).*$/,"$1")},QupZilla:function(){return t.replace(/^.*QupZilla[\/\s]([\d.]+).*$/,"$1")},"Coc Coc":function(){return t.replace(/^.*coc_coc_browser\/([\d.]+).*$/,"$1")},Kindle:function(){return t.replace(/^.*Version\/([\d.]+).*$/,"$1")},Iceweasel:function(){return t.replace(/^.*Iceweasel\/([\d.]+).*$/,"$1")},Konqueror:function(){return t.replace(/^.*Konqueror\/([\d.]+).*$/,"$1")},Iceape:function(){return t.replace(/^.*Iceape\/([\d.]+).*$/,"$1")},SeaMonkey:function(){return t.replace(/^.*SeaMonkey\/([\d.]+).*$/,"$1")},Epiphany:function(){return t.replace(/^.*Epiphany\/([\d.]+).*$/,"$1")},360:function(){return t.replace(/^.*QihooBrowser\/([\d.]+).*$/,"$1")},"360SE":function(){return{63:"10.0",55:"9.1",45:"8.1",42:"8.0",31:"7.0",21:"6.3"}[t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},"360EE":function(){return{69:"11.0",63:"9.5",55:"9.0",50:"8.7",30:"7.5"}[t.replace(/^.*Chrome\/([\d]+).*$/,"$1")]||""},Maxthon:function(){return t.replace(/^.*Maxthon\/([\d.]+).*$/,"$1")},QQBrowser:function(){return t.replace(/^.*QQBrowser\/([\d.]+).*$/,"$1")},QQ:function(){return t.replace(/^.*QQ\/([\d.]+).*$/,"$1")},Baidu:function(){return t.replace(/^.*BIDUBrowser[\s\/]([\d.]+).*$/,"$1")},UC:function(){return t.replace(/^.*UC?Browser\/([\d.]+).*$/,"$1")},Sogou:function(){return t.replace(/^.*SE ([\d.X]+).*$/,"$1").replace(/^.*SogouMobileBrowser\/([\d.]+).*$/,"$1")},LBBROWSER:function(){var e="";t.indexOf("LieBaoFast")>-1&&(e=t.replace(/^.*LieBaoFast\/([\d.]+).*$/,"$1"));var n=t.replace(/^.*Chrome\/([\d]+).*$/,"$1");return e||{57:"6.5",49:"6.0",46:"5.9",42:"5.3",39:"5.2",34:"5.0",29:"4.5",21:"4.0"}[n]||""},"2345Explorer":function(){return t.replace(/^.*2345Explorer\/([\d.]+).*$/,"$1")},TheWorld:function(){return t.replace(/^.*TheWorld ([\d.]+).*$/,"$1")},XiaoMi:function(){return t.replace(/^.*MiuiBrowser\/([\d.]+).*$/,"$1")},Quark:function(){return t.replace(/^.*Quark\/([\d.]+).*$/,"$1")},Qiyu:function(){return t.replace(/^.*Qiyu\/([\d.]+).*$/,"$1")},Wechat:function(){return t.replace(/^.*MicroMessenger\/([\d.]+).*$/,"$1")},WechatWork:function(){return t.replace(/^.*wxwork\/([\d.]+).*$/,"$1")},Taobao:function(){return t.replace(/^.*AliApp\(TB\/([\d.]+).*$/,"$1")},Alipay:function(){return t.replace(/^.*AliApp\(AP\/([\d.]+).*$/,"$1")},Weibo:function(){return t.replace(/^.*weibo__([\d.]+).*$/,"$1")},Douban:function(){return t.replace(/^.*com.douban.frodo\/([\d.]+).*$/,"$1")},Suning:function(){return t.replace(/^.*SNEBUY-APP([\d.]+).*$/,"$1")},iQiYi:function(){return t.replace(/^.*IqiyiVersion\/([\d.]+).*$/,"$1")}};return e.browserVersion="",e.browserMajor="",a[e.browser]&&(e.browserVersion=a[e.browser](),e.browserVersion==t&&(e.browserVersion="")),"Chrome"==e.browser&&t.match(/\S+Browser/)&&(e.browser=t.match(/\S+Browser/)[0],e.version=t.replace(/^.*Browser\/([\d.]+).*$/,"$1")),"Edge"==e.browser&&(e.version>"75"?e.engine="Blink":e.engine="EdgeHTML"),("Chrome"==e.browser&&parseInt(e.browserVersion)>27||r.Chrome&&"WebKit"==e.engine&&parseInt(e.browserVersion)>27||"Opera"==e.browser&&parseInt(e.version)>12||"Yandex"==e.browser)&&(e.engine="Blink"),e.browserVersion&&(e.browserMajor=e.browserVersion.split(".").length&&this.browserVersion.split(".")[0]),{browser:e.browser,browserVersion:e.browserVersion,engine:e.engine,browserMajor:e.browserMajor}},getGeoPostion:function(e){navigator&&navigator.geolocation&&navigator.geolocation.getCurrentPosition((function(t){e(t)}),(function(e){}))}},le={os:fe.getOS(),osVersion:fe.getOSVersion().version,osVersionMajor:fe.getOSVersion().osMajor,browser:fe.getBrowserInfo().browser,browserVersion:fe.getBrowserInfo().browserVersion,browserVersionMajor:fe.getBrowserInfo().browserMajor,screenSize:window.screen.width+"*"+window.screen.height,networkType:fe.getNetwork(),divice:fe.getDeviceType()},pe="beforeunload",ve="click",he="keydown",me="load",ge="popstate",ye="scroll",we="touchstart",be="visibilitychange",_e="DOMContentLoaded",Se="pointerdown",Te="pointerup",xe="pointercancel",Ee="hashchange",Oe="pagehide",Ce="mousedown",Ie="document",ke="xhr",Re="beacon",Ae="fetch",Me="css",Be="js",Le="image",$e="font",De="media",We="other",Ne="click",Pe="custom",Ue={ACTION:"action",ERROR:"error",LONG_TASK:"long_task",VIEW:"view",RESOURCE:"resource",LOGGER:"logger"},Ve={FETCH:Ae,XHR:ke},je={DDTRACE:"ddtrace",ZIPKIN_MULTI_HEADER:"zipkin",ZIPKIN_SINGLE_HEADER:"zipkin_single_header",W3C_TRACEPARENT:"w3c_traceparent",SKYWALKING_V3:"skywalking_v3",JAEGER:"jaeger"},He="handled",Fe="agent",qe="console",Qe="network",ze="source",Ge="custom";function Xe(e,t,n){return e&&(void 0!==e.message||t instanceof Error)?{message:e.message||"Empty message",stack:Ke(e),type:e.name}:{message:n+""+JSON.stringify(t),stack:"No stack, consider using an instance of Error",type:e&&e.name}}function Ke(e){var t=e.name||"Error: "+e.message;return u(e.stack,(function(e){var n="?"===e.func?"<anonymous>":e.func,r=e.args&&e.args.length>0?"("+e.args.join(", ")+")":"",i=e.line?":"+e.line:"",o=e.line&&e.column?":"+e.column:"";t+="\n at "+n+r+" @ "+e.url+i+o})),t}var Je=function(){this._events=[],this.pendingEvents=[]};Je.prototype={emit:function(e){var t=[].slice.call(arguments,1);u(this._events,(function(n){if(n.type!==e)return!1;n.callback.apply(n.context,t)}))},on:function(e,t,n){"function"==typeof t&&this._events.push({type:e,callback:t,context:n||this})}};new Je;var Ye="PERFORMANCE_ENTRY_COLLECTED",Ze="AUTO_ACTION_CREATED",et="AUTO_ACTION_COMPLETED",tt="AUTO_ACTION_DISCARDED",nt="VIEW_CREATED",rt="VIEW_UPDATED",it="VIEW_ENDED",ot="SESSION_RENEWED",at="DOM_MUTATED",st="BEFORE_UNLOAD",ut="REQUEST_STARTED",ct="REQUEST_COMPLETED",dt="RAW_RUM_EVENT_COLLECTED",ft="RUM_EVENT_COLLECTED",lt="RAW_ERROR_COLLECTED",pt="RECORD_STARTED",vt="RECORD_STOPPED";function ht(){this.callbacks=[]}function mt(e,t,n){var r=d({},e),i=n(r);return u(t,(function(t){var n=gt(e,t),i=gt(r,t);"string"==typeof n&&"string"==typeof i&&function(e,t,n){for(var r=e,i=t.split("."),o=0;o<i.length;o+=1){var a=i[o];if(!yt(r,a))return;o!==i.length-1?r=r[a]:r[a]=n}}(e,t,i)})),i}function gt(e,t){var n=e;for(var r of t.split(".")){if(!yt(n,r))return;n=n[r]}return n}function yt(e,t){return"object"==typeof e&&null!==e&&t in e}ht.prototype={notify:function(e,t){var n=this.callbacks[e];n&&u(n,(function(e){e(t)}))},subscribe:function(e,t){this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t);var n=this;return{unsubscribe:function(){n.callbacks[e]=h(n.callbacks[e],(function(e){return e!==t}))}}}};var wt=function(){this.observers=[]};wt.prototype={subscribe:function(e){this.observers.push(e)},notify:function(e){u(this.observers,(function(t){t(e)}))}};var bt,_t=wt;function St(e){return xt(e,ie(window.location)).href}function Tt(e){return ie(xt(e))}function xt(e,t){if(function(){if(void 0!==bt)return bt;try{var e=new URL("http://test/path");return bt="http://test/path"===e.href}catch(e){bt=!1}return bt}())return void 0!==t?new URL(e,t):new URL(e);if(void 0===t&&!/:/.test(e))throw new Error("Invalid URL: "+e);var n=document,r=n.createElement("a");if(void 0!==t){var i=(n=document.implementation.createHTMLDocument("")).createElement("base");i.href=t,n.head.appendChild(i),n.body.appendChild(r)}return r.href=e,r}var Et=navigator.userAgent.toLowerCase(),Ot=function(){return/iphone os/.test(Et)},Ct=function(){this.bridge=window.FTWebViewJavascriptBridge,this.tagMaps={},window.mapWebViewCallBack={};try{this.initBridge()}catch(e){}};Ct.prototype={initBridge:function(){var e=this;if(Ot()&&!e.bridge){if(window.WVJBCallbacks)return void window.WVJBCallbacks.push((function(t){e.bridge=t}));window.WVJBCallbacks=[function(t){e.bridge=t}];var t=document.createElement("iframe");t.style.display="none",t.src="wvjbscheme://__BRIDGE_LOADED__",document.documentElement.appendChild(t),setTimeout((function(){document.documentElement.removeChild(t)}),0)}},sendEvent:function(e,t){void 0===e&&(e={});var n=this,r="Unique id:"+(new Date).getTime();if(e.name){n.tagMaps[e.name]=r,window.mapWebViewCallBack[r]=function(e,t){return Promise.resolve(e,t)},e._tag=r;try{Ot()?n.bridge.callHandler("sendEvent",JSON.stringify(e),"mapWebViewCallBack"):n.bridge.sendEvent(JSON.stringify(e),"mapWebViewCallBack")}catch(e){}}else t({error:"请传入发送事件的名称!!"})},addEventListener:function(e,t){var n="Unique id:"+(new Date).getTime(),r=this;if(e.name){r.tagMaps[e.name]=n,window.mapWebViewCallBack[n]=function(e,n){t(e,n)},e._tag=n;try{Ot()?r.bridge.callHandler("addEventListener",JSON.stringify(e),"mapWebViewCallBack"):r.bridge.addEventListener(JSON.stringify(e),"mapWebViewCallBack")}catch(e){}}else t({error:"请传入监听事件的名称!!"})}};var It=new Ct,kt=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function Rt(e){if(Mt){if(At===e)return;Vt()}var t=Ht(e);throw Mt=t,At=e,setTimeout((function(){At===e&&Vt()}),t.incomplete?2e3:0),e}var At,Mt,Bt,Lt,$t,Dt=[];function Wt(e){!function(){if(Lt)return;Bt=window.onerror,window.onerror=Pt,Lt=!0}(),function(){if($t)return;null!==window.onunhandledrejection?window.onunhandledrejection:void 0,window.onunhandledrejection=Ut,$t=!0}(),Dt.push(e)}function Nt(e,t,n){var r;if(u(Dt,(function(i){try{i(e,t,n)}catch(e){r=e}})),r)throw r}function Pt(e,t,n,r,i){if(Mt)qt(Mt,t,n),Vt();else if(i)Nt(Ht(i),!0,i);else{var o,a={url:t,column:r,line:n},s=e;if("[object String]"==={}.toString.call(e)){var u=kt.exec(s);u&&(o=u[1],s=u[2])}Nt({name:o,message:"string"==typeof s?s:void 0,stack:[a]},!0,e)}return!!Bt&&Bt.apply(this,arguments)}function Ut(e){var t=e.reason||"Empty reason";Nt(Ht(t),!0,t)}function Vt(){var e=Mt,t=At;Mt=void 0,At=void 0,Nt(e,!1,t)}var jt="?";function Ht(e,t){var n,r=void 0===t?0:+t;try{if(n=function(e){var t=zt(e,"stacktrace");if(!t)return;for(var n,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=t.split("\n"),a=[],s=0;s<o.length;s+=2){var u;r.exec(o[s])?u={args:[],column:void 0,func:(n=r.exec(o[s]))[3],line:+n[1],url:n[2]}:i.exec(o[s])&&(u={args:(n=i.exec(o[s]))[5]?n[5].split(","):[],column:+n[2],func:n[3]||n[4],line:+n[1],url:n[6]}),u&&(!u.func&&u.line&&(u.func=jt),u.context=[o[s+1]],a.push(u))}if(!a.length)return;return{stack:a,message:zt(e,"message"),name:zt(e,"name")}}(e))return n}catch(e){if(Ft)throw e}try{if(n=function(e){var t=zt(e,"stack");if(!t)return;for(var n,r,i,o,a=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|\/).*?)(?::(\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,d=/\((\S*)(?::(\d+))(?::(\d+))\)/,f=t.split("\n"),l=[],p=0,v=f.length;p<v;p+=1){if(a.exec(f[p])){var h=(i=a.exec(f[p]))[2]&&0===i[2].indexOf("native");n=i[2]&&0===i[2].indexOf("eval"),r=d.exec(i[2]),n&&r&&(i[2]=r[1],i[3]=r[2],i[4]=r[3]),o={args:h?[i[2]]:[],column:i[4]?+i[4]:void 0,func:i[1]||jt,line:i[3]?+i[3]:void 0,url:h?void 0:i[2]}}else if(u.exec(f[p]))o={args:[],column:(i=u.exec(f[p]))[4]?+i[4]:void 0,func:i[1]||jt,line:+i[3],url:i[2]};else{if(!s.exec(f[p]))continue;n=(i=s.exec(f[p]))[3]&&i[3].indexOf(" > eval")>-1,r=c.exec(i[3]),n&&r?(i[3]=r[1],i[4]=r[2],i[5]=void 0):0!==p||i[5]||Xt(e.columnNumber)||(l[0].column=e.columnNumber+1),o={args:i[2]?i[2].split(","):[],column:i[5]?+i[5]:void 0,func:i[1]||jt,line:i[4]?+i[4]:void 0,url:i[3]}}!o.func&&o.line&&(o.func=jt),l.push(o)}if(!l.length)return;return{stack:l,message:zt(e,"message"),name:zt(e,"name")}}(e))return n}catch(e){if(Ft)throw e}try{if(n=function(e){var t=zt(e,"message");if(!t)return;var n=t.split("\n");if(n.length<4)return;var r,i=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,a=/^\s*Line (\d+) of function script\s*$/i,s=[],u=window&&window.document&&window.document.getElementsByTagName("script"),c=[];for(var d in u)Gt(u,d)&&!u[d].src&&c.push(u[d]);for(var f=2;f<n.length;f+=2){var l;if(i.exec(n[f]))l={args:[],column:void 0,func:(r=i.exec(n[f]))[3],line:+r[1],url:r[2]};else if(o.exec(n[f]))l={args:[],column:void 0,func:(r=o.exec(n[f]))[4],line:+r[1],url:r[3]};else if(a.exec(n[f])){r=a.exec(n[f]),l={url:window.location.href.replace(/#.*$/,""),args:[],column:void 0,func:"",line:+r[1]}}l&&(l.func||(l.func=jt),l.context=[n[f+1]],s.push(l))}if(!s.length)return;return{stack:s,message:n[0],name:zt(e,"name")}}(e))return n}catch(e){if(Ft)throw e}try{if(n=Qt(e,r+1))return n}catch(e){if(Ft)throw e}return{message:zt(e,"message"),name:zt(e,"name"),stack:[]}}var Ft=!1;function qt(e,t,n){var r={url:t,line:n?+n:void 0};if(r.url&&r.line){e.incomplete=!1;var i=e.stack;if(i.length>0&&i[0].url===r.url){if(i[0].line===r.line)return!1;if(!i[0].line&&i[0].func===r.func)return i[0].line=r.line,i[0].context=r.context,!1}return i.unshift(r),e.partial=!0,!0}return e.incomplete=!0,!1}function Qt(e,t){for(var n,r,i=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,o=[],a={},s=!1,u=Qt.caller;u&&!s;u=u.caller)u!==Ht&&u!==Rt&&(r={args:[],column:void 0,func:jt,line:void 0,url:void 0},n=i.exec(u.toString()),u.name?r.func=u.name:n&&(r.func=n[1]),void 0===r.func&&(r.func=n?n.input.substring(0,n.input.indexOf("{")):void 0),a[u.toString()]?s=!0:a[u.toString()]=!0,o.push(r));t&&o.splice(0,t);var c={stack:o,message:zt(e,"message"),name:zt(e,"name")};return qt(c,zt(e,"sourceURL")||zt(e,"fileName"),zt(e,"line")||zt(e,"lineNumber")),c}function zt(e,t){if("object"==typeof e&&e&&t in e){var n=e[t];return"string"==typeof n?n:void 0}}function Gt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Xt(e){return void 0===e}var Kt;function Jt(e,t){var n,r,i=!1,o=function(){i=!0,window.clearTimeout(n),n=window.setTimeout((function(){i=!1}),1e3)};return{get:function(){return i||(r=Zt(e),o()),r},set:function(n,i){Yt(e,n,i,t),r=n,o()},clearCache:function(){window.clearTimeout(n),i=!1}}}function Yt(e,t,n,r){var i=new Date;i.setTime(i.getTime()+n);var o="expires="+i.toUTCString(),a=r&&r.crossSite?"none":"strict",s=r&&r.domain?";domain="+r.domain:"",u=r&&r.secure?";secure":"";document.cookie=e+"="+t+";"+o+";path=/;samesite="+a+s+u}function Zt(e){return function(e,t){var n=e.match("(?:^|;)\\s*"+t+"\\s*=\\s*([^;]+)");return n?n[1]:void 0}(document.cookie,e)}var en=/^\s+|\s+$/g,tn={resourceSampleRate:100,sampleRate:100,flushTimeout:3e4,maxErrorsByMinute:3e3,maxBatchSize:50,maxMessageSize:262144,requestErrorResponseLengthLimit:32768,batchBytesLimit:16384,datakitUrl:"",logsEndpoint:"",traceType:je.DDTRACE,traceId128Bit:!1,trackInteractions:!1,allowedDDTracingOrigins:[],allowedTracingOrigins:[],isServiceSampling:!1,beforeSend:function(e){},isServerError:function(e){return!1}};function nn(e){return e.replace(en,"")}function rn(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===Kt){for(var e="dd_site_test_".concat(C()),t=window.location.hostname.split("."),n=t.pop();t.length&&!Zt(e);)n=t.pop()+"."+n,Yt(e,"test",W,{domain:n});Kt=n}return Kt}()),t}function on(e){return e.lastIndexOf("/")===e.length-1?nn(e)+"v1/write/logging":nn(e)+"/v1/write/logging"}function an(e,t){var n,r,i=f(e.enableExperimentalFeatures)?e.enableExperimentalFeatures:[],o={applicationId:e.applicationId,env:e.env||"",version:e.version||"",sdkVersion:t.sdkVersion,sdkName:t.sdkName,datakitUrl:(n=e.datakitUrl||e.datakitOrigin,n.lastIndexOf("/")===n.length-1?nn(n)+"v1/write/rum":nn(n)+"/v1/write/rum"),logsEndpoint:on(e.datakitOrigin),isEnabled:function(e){return ne(i,e)},cookieOptions:rn(e)};return"allowedDDTracingOrigins"in e&&(o.allowedTracingOrigins=e.allowedDDTracingOrigins),"allowedTracingOrigins"in e&&(o.allowedTracingOrigins=e.allowedTracingOrigins),"sampleRate"in e&&(o.sampleRate=e.sampleRate),"resourceSampleRate"in e&&(o.resourceSampleRate=e.resourceSampleRate),"trackInteractions"in e&&(o.trackInteractions=!!e.trackInteractions),"isServerError"in e&&l(e.isServerError)&&_(e.isServerError())&&(o.isServerError=e.isServerError),"traceId128Bit"in e&&(o.traceId128Bit=!!e.traceId128Bit),"traceType"in e&&((r=e.traceType)&&v(je).indexOf(r)>-1)&&(o.traceType=e.traceType),"isServiceSampling"in e&&_(e.isServiceSampling)&&(o.isServiceSampling=e.isServiceSampling),d({},tn,o)}function sn(e,t){return n=e,r=t.datakitUrl,Tt(n)===Tt(r);var n,r}var un,cn,dn,fn,ln,pn,vn={sdk_name:"_dd.sdk_name",sdk_version:"_dd.sdk_version",app_id:"application.id",env:"_dd.env",version:"_dd.version",userid:"user.id",user_email:"user.email",user_name:"user.name",session_id:"session.id",session_type:"session.type",session_sampling:"session.is_sampling",is_signin:"user.is_signin",os:"device.os",os_version:"device.os_version",os_version_major:"device.os_version_major",browser:"device.browser",browser_version:"device.browser_version",browser_version_major:"device.browser_version_major",screen_size:"device.screen_size",network_type:"device.network_type",device:"device.device",view_id:"view.id",view_referrer:"view.referrer",view_url:"view.url",view_host:"view.host",view_path:"view.path",view_path_group:"view.path_group",view_url_query:"view.url_query"},hn={view:{type:Ue.VIEW,tags:{view_loading_type:"view.loading_type",view_apdex_level:"view.apdex_level",is_active:"view.is_active"},fields:{view_error_count:"view.error.count",view_resource_count:"view.resource.count",view_long_task_count:"view.long_task.count",view_action_count:"view.action.count",first_contentful_paint:"view.first_contentful_paint",largest_contentful_paint:"view.largest_contentful_paint",cumulative_layout_shift:"view.cumulative_layout_shift",first_input_delay:"view.first_input_delay",loading_time:"view.loading_time",dom_interactive:"view.dom_interactive",dom_content_loaded:"view.dom_content_loaded",dom_complete:"view.dom_complete",load_event:"view.load_event",first_input_time:"view.first_input_time",first_meaningful_paint:"view.largest_contentful_paint",first_paint_time:"view.fpt",resource_load_time:"view.resource_load_time",time_to_interactive:"view.tti",dom:"view.dom",dom_ready:"view.dom_ready",time_spent:"view.time_spent"}},resource:{type:Ue.RESOURCE,tags:{trace_id:"_dd.trace_id",span_id:"_dd.span_id",resource_url:"resource.url",resource_url_host:"resource.url_host",resource_url_path:"resource.url_path",resource_url_path_group:"resource.url_path_group",resource_url_query:"resource.url_query",resource_type:"resource.type",resource_status:"resource.status",resource_status_group:"resource.status_group",resource_method:"resource.method"},fields:{resource_size:"resouce.size",duration:"resource.duration",resource_dns:"resource.dns",resource_tcp:"resource.tcp",resource_ssl:"resource.ssl",resource_ttfb:"resource.ttfb",resource_trans:"resource.trans",resource_first_byte:"resource.firstbyte"}},error:{type:Ue.ERROR,tags:{error_source:"error.source",error_type:"error.type",resource_url:"error.resource.url",resource_url_host:"error.resource.url_host",resource_url_path:"error.resource.url_path",resource_url_path_group:"error.resource.url_path_group",resource_status:"error.resource.status",resource_status_group:"error.resource.status_group",resource_method:"error.resource.method"},fields:{error_message:["string","error.message"],error_stack:["string","error.stack"]}},long_task:{type:Ue.LONG_TASK,tags:{},fields:{duration:"long_task.duration"}},action:{type:Ue.ACTION,tags:{action_id:"action.id",action_name:"action.target.name",action_type:"action.type"},fields:{duration:"action.loading_time",action_error_count:"action.error.count",action_resource_count:"action.resource.count",action_long_task_count:"action.long_task.count"}},browser_log:{type:Ue.LOGGER,tags:{error_source:"error.source",error_type:"error.type",error_resource_url:"resource.url",error_resource_url_host:"resource.url_host",error_resource_url_path:"resource.url_path",error_resource_url_path_group:"resource.url_path_group",error_resource_status:"resource.status",error_resource_status_group:"resource.status_group",error_resource_method:"resource.method",action_id:"user_action.id",service:"service",status:"status"},fields:{message:["string","message"]}}},mn=[],gn=[];function yn(){return un||(cn=XMLHttpRequest.prototype.open,dn=XMLHttpRequest.prototype.send,fn=XMLHttpRequest.prototype.abort,XMLHttpRequest.prototype.open=function(e,t){return this._dataflux_xhr={method:e,startTime:-1,url:St(t)},cn.apply(this,arguments)},XMLHttpRequest.prototype.send=function(e){var t=this;if(this._dataflux_xhr){var n=this._dataflux_xhr;n.startTime=q(),n.startClocks=Q(),n.isAborted=!1;var r=this.onreadystatechange;this.onreadystatechange=function(){this.readyState===XMLHttpRequest.DONE&&o(),r&&r.apply(this,arguments)};var i=!1,o=function e(){if(t.removeEventListener("loadend",e),!i){i=!0;var r=c({},n,{duration:G(n.startClocks.relative,q()),response:t.response,status:t.status});u(gn,(function(e){e(r,t)}))}};t.addEventListener("loadend",o),u(mn,(function(e){e(n,t)}))}return dn.apply(t,arguments)},XMLHttpRequest.prototype.abort=function(){return this._dataflux_xhr&&(this._dataflux_xhr.isAborted=!0),fn.apply(this,arguments)},un={beforeSend:function(e){mn.push(e)},onRequestComplete:function(e){gn.push(e)}}),un}function wn(e,t,n,r,i,o,a){try{var s=e[o](a),u=s.value}catch(e){return void n(e)}s.done?t(u):Promise.resolve(u).then(r,i)}var bn,_n,Sn=[],Tn=[];function xn(){return ln||(!function(){if(!window.fetch)return;pn=window.fetch,window.fetch=function(e,t){var n,r=En.apply(null,[e,t]);return r?(n=pn.call(this,r.input,r.init),On.apply(null,[n,r])):n=pn.call(this,e,t),n}}(),ln={beforeSend:function(e){Sn.push(e)},onRequestComplete:function(e){Tn.push(e)}}),ln}function En(e,t){var n=t&&t.method||"object"==typeof e&&e.method||"GET",r=St("object"==typeof e&&e.url||e),i=Q(),o={init:t,input:e,method:n,startTime:q(),startClocks:i,url:r};return u(Sn,(function(e){e(o)})),o}function On(e,t){var n=function(){var e,n=(e=function*(e){if(t.duration=G(t.startClocks.relative,q()),"stack"in e||e instanceof Error)t.status=0,t.response=Ke(Ht(e)),t.headers=e.headers,t.isAborted=e instanceof DOMException&&e.code===DOMException.ABORT_ERR,u(Tn,(function(e){e(t)}));else if("status"in e){var n;try{n=yield e.clone().text()}catch(e){n="Unable to retrieve response: "+e}t.response=n,t.responseType=e.type,t.status=e.status,t.headers=e.headers,t.isAborted=!1,u(Tn,(function(e){e(t)}))}},function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function a(e){wn(o,r,i,a,s,"next",e)}function s(e){wn(o,r,i,a,s,"throw",e)}a(void 0)}))});return function(e){return n.apply(this,arguments)}}();e.then(n,n)}function Cn(e){return bn||(function(e,t){function n(n,r){sn(r.url,e)||r.isAborted||!(function(e){return 0===e.status&&"opaque"!==e.responseType}(r)||function(e){return e.status>=500}(r)||e.isServerError(r))||t.notify({message:Rn(n)+" error "+r.method+" "+r.url,resource:{method:r.method,statusCode:r.status,url:r.url},source:Qe,stack:kn(r.response,e)||"Failed to load",startClocks:r.startClocks})}yn().onRequestComplete((function(e){n(Ve.XHR,e)})),xn().onRequestComplete((function(e){n(Ve.FETCH,e)}))}(e,bn=new _t),function(e){_n=console.error,console.error=function(){_n.apply(console,arguments),e.notify(c({},In(p(arguments)),{source:qe,startClocks:Q()}))}}(bn),function(e){Wt((function(t,n,r){var i=Xe(t,r,"Uncaught");e.notify({message:i.message,stack:i.stack,type:i.type,source:ze,startClocks:Q()})}))}(bn)),bn}function In(e){var t=function(e,t){for(var n=0;n<e.length;n+=1){var r=e[n];if(t(r,n,e))return r}}(e,(function(e){return e instanceof Error}));return{message:m(["console error:"].concat(e),(function(e){return function(e){if("string"==typeof e)return e;if(e instanceof Error)return((t=Ht(e)).name||"Error")+": "+t.message;var t;return B(e,0,2)}(e)})).join(" "),stack:t?Ke(Ht(t)):void 0}}function kn(e,t){return e&&e.length>t.requestErrorResponseLengthLimit?e.substring(0,t.requestErrorResponseLengthLimit)+"...":e}function Rn(e){return Ve.XHR===e?"XHR":"Fetch"}function An(e){return!!function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_".concat(C()),n="test";return Yt(t,n,W,e),Zt(t)===n}catch(e){return!1}}(e)}function Mn(){return"file:"!==window.location.protocol}var Bn=9e5,Ln=144e5;function $n(e,t,n){var r=function(e){var t=Jt("_dataflulx_an_id",e);return t.get()||t.set(C(),5184e6),t}(e),i=Jt("_dataflux_s",e),o=new _t,a=Nn(i).id,s=x((function(){i.clearCache();var e=Nn(i),r=n(e[t]);e[t]=r.trackingType,r.isTracked&&!e.id&&(e.id=C(),e.created=String(Date.now())),Pn(e,i),r.isTracked&&a!==e.id&&(a=e.id,o.notify())}),1e3);return s(),function(e){var t=te(window,[ve,we,he,ye],e,{capture:!0,passive:!0});Vn.push(t.stop)}(s),function(e){var t=function(){"visible"===document.visibilityState&&e()},n=ee(document,be,t);Vn.push(n.stop);var r=window.setInterval(t,6e4);Vn.push((function(){clearInterval(r)}))}((function(){i.clearCache(),Pn(Nn(i),i)})),{getAnonymousID:function(){return r.get()},getId:function(){var e=Nn(i);return e.did||e.id},getTrackingType:function(){return Nn(i)[t]},getDebugSession:function(){var e=Nn(i);return y(e)||!e.did?{}:{id:e.did,created:e.dcreated}},addDebugSession:function(e,t){var n=Nn(i);y(n)||(n.did=e||C,n.dcreated=t||String(Date.now()),Pn(n,i))},clearDebugSession:function(){var e=Nn(i),t={};u(w(e),(function(e){"did"!==e[0]&&"dcreated"!==e[0]&&(t[e[0]]=e[1])})),Pn(t,i)},renewObservable:o}}var Dn=/^([a-z]+)=([a-z0-9-]+)$/,Wn="&";function Nn(e){var t=function(e){var t=e.get(),n={};(function(e){return void 0!==e&&(-1!==e.indexOf("&")||Dn.test(e))})(t)&&u(t.split(Wn),(function(e){var t=Dn.exec(e);if(null!==t){var r=t[1],i=t[2];n[r]=i}}));return n}(e);return function(e){return(void 0===e.created||Date.now()-Number(e.created)<Ln)&&(void 0===e.expire||Date.now()<Number(e.expire))}(t)?t:(Un(e),{})}function Pn(e,t){if(y(e))Un(t);else{e.expire=String(Date.now()+Bn);var n=[];u(w(e),(function(e){n.push(e[0]+"="+e[1])}));var r=n.join(Wn);t.set(r,Bn)}}function Un(e){e.set("",0)}var Vn=[];var jn=/[^\u0000-\u007F]/,Hn="custom_keys";var Fn=function(e,t){this.endpointUrl=e,this.bytesLimit=t};Fn.prototype={send:function(e,t){var n=function(e){return e?e+(-1===e.indexOf("?")?"?":"&")+"precision=ms":e}(this.endpointUrl);if(navigator.sendBeacon&&t<this.bytesLimit&&navigator.sendBeacon(n,e))return;var r=new XMLHttpRequest;r.open("POST",n,!0),r.withCredentials=!0,r.send(e)}};var qn=Fn,Qn=function(e){if(!e||!e.type)return{rowStr:"",rowData:void 0};var t={tags:{},fields:{}},n=!1,r="";return u(hn,(function(i,o){if(i.type===e.type){r+=o+",",t.measurement=o;var a=[],s=c({},vn,i.tags),d=["date","type"];if(u(s,(function(n,r){var i=Z(e,n);d.push(r),(i||S(i))&&(t.tags[r]=i,a.push(se(r)+"="+se(i)))})),e.tags&&g(e.tags)&&!y(e.tags)){var l=[];u(e.tags,(function(e,n){d.indexOf(n)>-1||(d.push(n),(e||S(e))&&(l.push(n),t.tags[n]=e,a.push(se(n)+"="+se(e))))})),l.length&&(t.tags.custom_keys=l,a.push(se(Hn)+"="+se(l)))}var p=[];u(i.fields,(function(n,r){if(f(n)&&2===n.length){var i=n[0],o=n[1],a=Z(e,o);d.push(r),(a||S(a))&&(t.fields[r]=a,a="string"===i?'"'+a.replace(/[\\]*"/g,'"').replace(/"/g,'\\"')+'"':se(a),p.push(se(r)+"="+a))}else if(b(n)){a=Z(e,n);d.push(r),(a||S(a))&&(t.fields[r]=a,a=se(a),p.push(se(r)+"="+a))}})),e.type===Ue.LOGGER&&u(e,(function(e,t){-1===d.indexOf(t)&&(S(e)||b(e)||_(e))&&a.push(se(t)+"="+se(e))})),a.length&&(r+=a.join(",")),p.length&&(r+=" ",r+=p.join(","),n=!0),r=r+" "+e.date,t.time=j(e.date)}})),{rowStr:n?r:"",rowData:n?t:void 0}};function zn(e,t,n,r,i,o){this.request=e,this.maxSize=t,this.bytesLimit=n,this.maxMessageSize=r,this.flushTimeout=i,this.beforeUnloadCallback=o,this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0,this.flushOnVisibilityHidden(),this.flushPeriodically()}zn.prototype={add:function(e){this.addOrUpdate(e)},upsert:function(e,t){this.addOrUpdate(e,t)},flush:function(){if(0!==this.bufferMessageCount){var e=this.pushOnlyBuffer.concat(v(this.upsertBuffer));this.request.send(e.join("\n"),this.bufferBytesSize),this.pushOnlyBuffer=[],this.upsertBuffer={},this.bufferBytesSize=0,this.bufferMessageCount=0}},processSendData:function(e){return Qn(e).rowStr},sizeInBytes:function(e){return jn.test(e)?void 0!==window.TextEncoder?(new TextEncoder).encode(e).length:new Blob([e]).size:e.length},addOrUpdate:function(e,t){var n=this.process(e);n.processedMessage&&""!==n.processedMessage&&(n.messageBytesSize>=this.maxMessageSize||(this.hasMessageFor(t)&&this.remove(t),this.willReachedBytesLimitWith(n.messageBytesSize)&&this.flush(),this.push(n.processedMessage,n.messageBytesSize,t),this.isFull()&&this.flush()))},process:function(e){var t="";return{processedMessage:t=this.processSendData(e),messageBytesSize:this.sizeInBytes(t)}},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},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)},hasMessageFor:function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},willReachedBytesLimitWith:function(e){return this.bufferBytesSize+e+1>=this.bytesLimit},isFull:function(){return this.bufferMessageCount===this.maxSize||this.bufferBytesSize>=this.bytesLimit},flushPeriodically:function(){var e=this;setTimeout((function(){e.flush(),e.flushPeriodically()}),e.flushTimeout)},flushOnVisibilityHidden:function(){var e=this;navigator.sendBeacon&&(ee(window,pe,e.beforeUnloadCallback),ee(document,be,(function(){"hidden"===document.visibilityState&&e.flush()})),ee(window,pe,(function(){e.flush()})))}};var Gn=zn,Xn="0",Kn="1",Jn="2",Yn="3";function Zn(e,t){var n=$n(e.cookieOptions,"rum",(function(t){return function(e,t){var n;n=function(e){return e===Xn||e===Kn||e===Jn||e===Yn}(t)?t:P(e.sampleRate)?P(e.resourceSampleRate)?Kn:e.isServiceSampling?Yn:Jn:e.isServiceSampling?Yn:Xn;return{trackingType:n,isTracked:er(n)}}(e,t)}));return n.renewObservable.subscribe((function(){t.notify(ot)})),{getId:n.getId,getAnonymousID:n.getAnonymousID,getDebugSession:n.getDebugSession,addDebugSession:n.addDebugSession,clearDebugSession:n.clearDebugSession,isTracked:function(){return void 0!==n.getId()&&er(n.getTrackingType())},isTrackedWidthService:function(){return void 0!==n.getId()&&n.getTrackingType()===Yn},isTrackedWithResource:function(){var e=n.getTrackingType();return void 0!==n.getId()&&(e===Kn||e===Yn)}}}function er(e){return e===Kn||e===Jn||e===Yn}var tr={sdkVersion:"2.0.20",sdkName:"df_web_rum_sdk"},nr="initial_document",rr=[[Ie,function(e){return nr===e}],[ke,function(e){return"xmlhttprequest"===e}],[Ae,function(e){return"fetch"===e}],[Re,function(e){return"beacon"===e}],[Me,function(e,t){return null!==t.match(/\.css$/i)}],[Be,function(e,t){return null!==t.match(/\.js$/i)}],[Le,function(e,t){return ne(["image","img","icon"],e)||null!==t.match(/\.(gif|jpg|jpeg|tiff|png|svg|ico)$/i)}],[$e,function(e,t){return null!==t.match(/\.(woff|eot|woff2|ttf)$/i)}],[De,function(e,t){return ne(["audio","video"],e)||null!==t.match(/\.(mp3|mp4)$/i)}]];function ir(e){var t=e.name;if(!function(e){try{return!!xt(e)}catch(e){return!1}}(t))return We;var n=function(e){var t=xt(e).pathname;return"/"===t[0]?t:"/"+t}(t),r=We;return u(rr,(function(t){var i=t[0];if((0,t[1])(e.initiatorType,n))return r=i,!1})),r}function or(){for(var e=p(arguments),t=1;t<e.length;t+=1)if(e[t-1]>e[t])return!1;return!0}function ar(e){var t=sr(e);if(t){var n=t.startTime,r=t.fetchStart,i=t.redirectStart,o=t.redirectEnd,a=t.domainLookupStart,s=t.domainLookupEnd,u=t.connectStart,c=t.secureConnectionStart,d=t.connectEnd,f=t.requestStart,l=t.responseStart,p=t.responseEnd,v={firstbyte:cr(n,a,l),trans:cr(n,l,p),ttfb:cr(n,f,l)};return d!==r&&(v.tcp=cr(n,u,d),or(u,c,d)&&(v.ssl=cr(n,c,d))),s!==r&&(v.dns=cr(n,a,s)),ur(e)&&(v.redirect=cr(n,i,o)),v}}function sr(e){if(or(e.startTime,e.fetchStart,e.domainLookupStart,e.domainLookupEnd,e.connectStart,e.connectEnd,e.requestStart,e.responseStart,e.responseEnd)){if(!ur(e))return e;var t=e.redirectStart,n=e.redirectEnd;if(t<e.startTime&&(t=e.startTime),n<e.startTime&&(n=e.fetchStart),or(e.startTime,t,n,e.fetchStart))return c({},e,{redirectEnd:n,redirectStart:t})}}function ur(e){return e.fetchStart!==e.startTime}function cr(e,t,n){return V(n-t)}function dr(e){if(e.startTime<e.responseStart)return e.decodedBodySize}function fr(e,t){return t&&!sn(t,e)}function lr(){return void 0!==window.performance&&"getEntries"in performance}function pr(e){return window.PerformanceObserver&&void 0!==PerformanceObserver.supportedEntryTypes&&ne(PerformanceObserver.supportedEntryTypes,e)}function vr(e,t){var n;if(n=function(n){yr(e,t,n)},hr("interactive",(function(){var e,t={entryType:"resource",initiatorType:nr,traceId:""};if(pr("navigation")&&performance.getEntriesByType("navigation").length>0){var r=performance.getEntriesByType("navigation")[0];e=c(r.toJSON(),t)}else{var i=mr();e=c(i,{decodedBodySize:0,duration:i.responseEnd,name:window.location.href,startTime:0},t)}n(e)})),lr()&&gr(e,t,performance.getEntries()),window.PerformanceObserver){new PerformanceObserver((function(n){gr(e,t,n.getEntries())})).observe({entryTypes:["resource","navigation","longtask","paint","largest-contentful-paint","first-input","layout-shift"]}),lr()&&"addEventListener"in performance&&performance.addEventListener("resourcetimingbufferfull",(function(){performance.clearResourceTimings()}))}pr("navigation")||function(e){function t(){e(c(mr(),{entryType:"navigation"}))}hr("complete",(function(){setTimeout(t)}))}((function(n){yr(e,t,n)})),pr("first-input")||function(e){var t=Date.now(),n=!1,r=te(window,[ve,Ce,he,we,Se],(function(e){if(e.cancelable){var t={entryType:"first-input",processingStart:performance.now(),startTime:e.timeStamp};e.type===Se?i(t):o(t)}}),{passive:!0,capture:!0}).stop;function i(e){te(window,[Te,xe],(function(t){t.type===Te&&o(e)}),{once:!0})}function o(i){if(!n){n=!0,r();var o=i.processingStart-i.startTime;o>=0&&o<Date.now()-t&&e(i)}}}((n=>{yr(e,t,n)}))}function hr(e,t){document.readyState===e||"complete"===document.readyState?t():ee(window,"complete"===e?me:_e,t,{once:!0})}function mr(){var e={},t=performance.timing;for(var n in t)S(t[n])&&(e[n]=0===t[n]?0:t[n]-Y());return e}function gr(e,t,n){u(n,(function(n){"resource"!==n.entryType&&"navigation"!==n.entryType&&"paint"!==n.entryType&&"longtask"!==n.entryType&&"largest-contentful-paint"!==n.entryType&&"first-input"!==n.entryType&&"layout-shift"!==n.entryType||yr(e,t,n)}))}function yr(e,t,n){(function(e){return"navigation"===e.entryType&&e.loadEventEnd<=0})(n)||function(e,t){return"resource"===t.entryType&&!fr(e,t.name)}(t,n)||e.notify(Ye,n)}function wr(e){var t,n=function(){var e,t=window;if(t.Zone){var n=t.Zone.__symbol__("MutationObserver");e=t[n]}return e||(e=t.MutationObserver),e}();return n&&(t=new n((function(){e.notify(at)}))).observe(document.documentElement,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),{stop:function(){t&&t.disconnect()}}}function br(e,t){void 0===t&&(t=$);var n={errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0},r=e.subscribe(dt,(function(e){switch(e.rawRumEvent.type){case Ue.ERROR:n.errorCount+=1,t(n);break;case Ue.ACTION:n.userActionCount+=1,t(n);break;case Ue.LONG_TASK:n.longTaskCount+=1,t(n);break;case Ue.RESOURCE:n.resourceCount+=1,t(n)}}));return{stop:function(){r.unsubscribe()},eventCounts:n}}function _r(e,t){var n=function(e){var t,n=new _t,r=[],i=0;function o(){n.notify({isBusy:i>0})}return r.push(e.subscribe(at,(function(){o()}))),r.push(e.subscribe(Ye,(function(e){"resource"===e.entryType&&o()}))),r.push(e.subscribe(ut,(function(e){void 0===t&&(t=e.requestIndex),i+=1,o()}))),r.push(e.subscribe(ct,(function(e){void 0===t||e.requestIndex<t||(i-=1,o())}))),{observable:n,stop:function(){u(r,(function(e){e.unsubscribe()}))}}}(e),r=n.observable,i=n.stop,o=function(e,t,n){var r,i=!1,o=setTimeout((function(){u({hadActivity:!1})}),100),a=setTimeout((function(){u({hadActivity:!0,endTime:H()})}),1e4);function s(){i=!0,clearTimeout(o),clearTimeout(r),clearTimeout(a),t()}function u(e){i||(s(),n(e))}return e.subscribe((function(e){var t=e.isBusy;clearTimeout(o),clearTimeout(r);var n=H();t||(r=setTimeout((function(){u({hadActivity:!0,endTime:n})}),100))})),{stop:s}}(r,i,t).stop;return{stop:function(){o(),i()}}}function Sr(e){return function(e){var t;if(function(){void 0===Or&&(Or="closest"in HTMLElement.prototype);return Or}())t=e.closest("[data-df-action-name]");else for(var n=e;n;){if(n.hasAttribute(Tr)){t=n;break}n=n.parentElement}if(!t)return;return Ar(Rr(t.getAttribute(Tr).trim()))}(e)||kr(e,Cr)||kr(e,Ir)||""}var Tr="data-df-action-name";var xr,Er,Or,Cr=[function(e){if(function(){void 0===Er&&(Er="labels"in HTMLInputElement.prototype);return Er}()){if("labels"in e&&e.labels&&e.labels.length>0)return Mr(e.labels[0])}else if(e.id){var t=e.ownerDocument&&e.ownerDocument.querySelector('label[for="'+e.id.replace('"','\\"')+'"]');return t&&Mr(t)}},function(e){if("INPUT"===e.nodeName){var t=e,n=t.getAttribute("type");if("button"===n||"submit"===n||"reset"===n)return t.value}},function(e){if("BUTTON"===e.nodeName||"LABEL"===e.nodeName||"button"===e.getAttribute("role"))return Mr(e)},function(e){return e.getAttribute("aria-label")},function(e){var t=e.getAttribute("aria-labelledby");if(t)return t=t.split(/\s+/),t=m(t,(function(t){return function(e,t){return e.ownerDocument?e.ownerDocument.getElementById(t):null}(e,t)})),t=h(t,(function(e){return Boolean(e)})),(t=m(t,(function(e){return Mr(e)}))).join(" ")},function(e){return e.getAttribute("alt")},function(e){return e.getAttribute("name")},function(e){return e.getAttribute("title")},function(e){return e.getAttribute("placeholder")},function(e){if("options"in e&&e.options.length>0)return Mr(e.options[0])}],Ir=[function(e){return Mr(e)}];function kr(e,t){for(var n=e,r=0;r<=10&&n&&"BODY"!==n.nodeName&&"HTML"!==n.nodeName&&"HEAD"!==n.nodeName;){for(var i of t){var o=i(n);if("string"==typeof o){var a=o.trim();if(a)return Ar(Rr(a))}}if("FORM"===n.nodeName)break;n=n.parentElement,r+=1}}function Rr(e){return e.replace(/\s+/g," ")}function Ar(e){return e.length>100?(n=100,((r=(t=e).charCodeAt(n-1))>=55296&&r<=56319?t.slice(0,n+1):t.slice(0,n))+" [...]"):e;var t,n,r}function Mr(e){if(!e.isContentEditable){if("innerText"in e){var t=e.innerText;if(!function(){if(void 0===xr){var e=document.createElement("style");e.textContent="*";var t=document.createElement("div");t.appendChild(e),document.body.appendChild(t),xr=""===t.innerText,document.body.removeChild(t)}return xr}())for(var n=e.querySelectorAll("script, style"),r=0;r<n.length;r+=1){var i=n[r].innerText;i.trim().length>0&&(t=t.replace(i,""))}return t}return e.textContent}}function Br(e){var t=function(e){var t,n;return{create:function(r,i){if(!t){var o=new Lr(e,r,i);t=o,n=_r(e,(function(e){e.hadActivity?o.complete(e.endTime):o.discard(),t=void 0}))}},discardCurrent:function(){t&&(n.stop(),t.discard(),t=void 0)}}}(e);e.subscribe(nt,(function(){t.discardCurrent()}));var n=ee(window,ve,(function(e){if(e.target instanceof Element){var n=Sr(e.target);n&&t.create(Ne,n)}}),{capture:!0}).stop;return{stop:function(){t.discardCurrent(),n()}}}var Lr=function(e,t,n){this.id=C(),this.startClocks=Q(),this.name=n,this.type=t,this.lifeCycle=e,this.eventCountsSubscription=br(e),this.lifeCycle.notify(Ze,{id:this.id,startClocks:this.startClocks})};function $r(e,t){return e.subscribe(et,(function(t){e.notify(dt,Dr(t))})),t.trackInteractions&&Br(e),{addAction:function(t,n){e.notify(dt,c({savedCommonContext:n},Dr(t)))}}}function Dr(e){var t=Wr(e)?{action:{error:{count:e.counts.errorCount},id:e.id,loadingTime:j(e.duration),long_task:{count:e.counts.longTaskCount},resource:{count:e.counts.resourceCount}}}:void 0;return{customerContext:Wr(e)?void 0:e.context,rawRumEvent:d({action:{target:{name:e.name},type:e.type},date:K(e.startClocks),type:Ue.ACTION},t),startTime:e.startClocks.relative}}function Wr(e){return e.type!==Pe}Lr.prototype={complete:function(e){var t=this.eventCountsSubscription.eventCounts;this.lifeCycle.notify(et,{counts:{errorCount:t.errorCount,longTaskCount:t.longTaskCount,resourceCount:t.resourceCount},duration:G(X(this.startClocks),e),id:this.id,name:this.name,startClocks:this.startClocks,type:this.type}),this.eventCountsSubscription.stop()},discard:function(){this.lifeCycle.notify(tt),this.eventCountsSubscription.stop()}};function Nr(e,t){var n=function(e,t){var n=r(e.datakitUrl,(function(){t.notify(st)}));function r(t,n){return new Gn(new qn(t,e.batchBytesLimit),e.maxBatchSize,e.batchBytesLimit,e.maxMessageSize,e.flushTimeout,n)}var i=!1;return{add:function(e){i||n.add(e)},stop:function(){i=!0},upsert:function(e,t){i||n.upsert(e,t)}}}(e,t);return t.subscribe(ft,(function(e){It.bridge?function(e){var t=Qn(e).rowData;t&&It.sendEvent({name:"rum",data:t})}(e):function(e,t){e.type===Ue.VIEW?t.upsert(e,e.view.id):t.add(e)}(e,n)})),{stop:function(){n.stop()}}}var Pr,Ur="synthetics",Vr="user",jr=["view.url","view.referrer","action.target.name","error.message","error.stack","error.resource.url","resource.url"];function Hr(e,t,n,r,i,o){var a=function(e,t){var n=0,r=!1;return{isLimitReached:function(){if(0===n&&setTimeout((function(){n=0}),N),(n+=1)<=e.maxErrorsByMinute||r)return r=!1,!1;if(n===e.maxErrorsByMinute+1){r=!0;try{t({message:"Reached max number of errors by minute: ".concat(e.maxErrorsByMinute),source:Fe,startClocks:Q()})}finally{r=!1}}return!0}}}(t,(function(e){n.notify(lt,{error:e})}));n.subscribe(dt,(function(s){var u,c=s.startTime,f=s.rawRumEvent,l=s.savedGlobalContext,p=s.customerContext,v=i.findView(c),h={device:le};if(r.isTracked()&&v&&v.session.id===r.getId()){var m=i.findAction(c),g=l||o(),w={_dd:{sdkName:t.sdkName,sdkVersion:t.sdkVersion,env:t.env,version:t.version},terminal:{type:"web"},application:{id:e},device:{},date:z(),user:{id:r.getAnonymousID(),is_signin:"F"},session:{type:void 0===window._DATAFLUX_SYNTHETICS_BROWSER?Vr:Ur}},b={};r.isTrackedWidthService()&&(b={session:{is_sampling:"1"}});var _=oe((u=f,-1!==[Ue.ERROR,Ue.RESOURCE,Ue.LONG_TASK].indexOf(u.type)?d(w,h,b,v,m,f):d(w,h,b,v,f))),S=d(g.context,p);y(S)||(_.tags=S),"has_replay"in _.session||(_.session.has_replay=g.hasReplay),y(g.user)||(_.user=d({id:r.getAnonymousID(),is_signin:"T"},g.user)),function(e,t,n){if(t){var r=mt(e,jr,t);if(!1===r&&e.type!==Ue.VIEW)return!1}if(e.type===Ue.ERROR)return!n.isLimitReached();return!0}(_,t.beforeSend,a)&&n.notify(ft,_)}}))}function Fr(e,t){return Cn(t).subscribe((function(t){e.notify(lt,{error:t})})),function(e){return e.subscribe(lt,(function(t){e.notify(dt,function(e){var t=e.resource;if(t){var n=k(e.resource.url).getParse();t={method:e.resource.method,status:e.resource.statusCode,statusGroup:M(e.resource.statusCode),url:e.resource.url,urlHost:n.Host,urlPath:n.Path,urlPathGroup:I(n.Path)}}return{rawRumEvent:{date:F(e.startClocks.relative),error:{message:e.message,resource:t,source:e.source,stack:e.stack,type:e.type,starttime:F(e.startClocks.relative)},type:Ue.ERROR},startTime:e.startClocks.relative}}(t.error))})),{addError:function(t,n){var r=function(e,t,n){const r=e instanceof Error?Ht(e):void 0;return c({startClocks:n,source:Ge,originalError:e,handling:He},Xe(r,e,"Provided"))}(t.error,t.startClocks,t.source);e.notify(lt,{customerContext:t.context,savedCommonContext:n,error:r})}}}(e)}function qr(e){if(void 0===e&&(e=window),!Pr)if("hidden"===document.visibilityState)Pr={timeStamp:0};else{Pr={timeStamp:1/0};var t=ee(e,Oe,(function(e){Pr.timeStamp=e.timeStamp}),{capture:!0,once:!0});t.stop}return Pr}function Qr(e,t){var n={};function r(e){n=c(n,e),t(n)}var i=function(e,t){return{stop:e.subscribe(Ye,(function(e){"navigation"===e.entryType&&t({fetchStart:e.fetchStart,responseEnd:e.responseEnd,domComplete:e.domComplete,domContentLoaded:e.domContentLoadedEventEnd,domInteractive:e.domInteractive,loadEvent:e.loadEventEnd,loadEventEnd:e.loadEventEnd,loadEventStart:e.loadEventStart,domContentLoadedEventEnd:e.domContentLoadedEventEnd,domContentLoadedEventStart:e.domContentLoadedEventStart})})).unsubscribe}}(e,r).stop,o=function(e,t){var n=qr();return{stop:e.subscribe(Ye,(function(e){"paint"===e.entryType&&"first-contentful-paint"===e.name&&e.startTime<n.timeStamp&&t(e.startTime)})).unsubscribe}}(e,(function(e){r({firstContentfulPaint:e})})).stop,a=function(e,t,n){var r=qr(),i=1/0,o=te(t,[Se,he],(function(e){i=e.timeStamp}),{capture:!0,once:!0}).stop,a=e.subscribe(Ye,(function(e){"largest-contentful-paint"===e.entryType&&e.startTime<i&&e.startTime<r.timeStamp&&n(e.startTime)})).unsubscribe;return{stop:function(){o(),a()}}}(e,window,(function(e){r({largestContentfulPaint:e})})).stop,s=function(e,t){var n=qr();return{stop:e.subscribe(Ye,(function(e){if("first-input"===e.entryType&&e.startTime<n.timeStamp){var r=G(e.startTime,e.processingStart);t({firstInputDelay:r>=0?r:0,firstInputTime:e.startTime})}})).unsubscribe}}(e,(function(e){r({firstInputDelay:e.firstInputDelay,firstInputTime:e.firstInputTime})})).stop;return{stop:function(){i(),o(),a(),s()}}}function zr(e){var t=function(e){var t=history.pushState;history.pushState=function(){t.apply(this,arguments),e()};var n=history.replaceState;history.replaceState=function(){n.apply(this,arguments),e()};var r=ee(window,ge,e).stop;return{stop:function(){r(),history.pushState=t,history.replaceState=n}}}(e),n=ee(window,Ee,e),r=t.stop,i=n.stop;return{stop:function(){r(),i()}}}function Gr(e,t){return e.pathname!==t.pathname||(n=t.hash,r=n.substr(1),!document.getElementById(r)&&Xr(t.hash)!==Xr(e.hash));var n,r}function Xr(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}function Kr(e,t,n){var r,i={eventCounts:{errorCount:0,longTaskCount:0,resourceCount:0,userActionCount:0}},o=br(e,(function(e){i.eventCounts=e,t()})).stop,a=function(e,t){var n=e===Jr.INITIAL_LOAD,r=!0,i=[];function o(){!r&&!n&&i.length>0&&t(Math.max.apply(Math,i))}return{setLoadEvent:function(e){n&&(n=!1,i.push(e),o())},setActivityLoadingTime:function(e){r&&(r=!1,void 0!==e&&i.push(e),o())}}}(n,(function(e){i.loadingTime=e,t()})),s=a.setActivityLoadingTime,u=a.setLoadEvent,c=function(e,t){var n=H();return{stop:_r(e,(function(e){e.hadActivity?t(G(n,e.endTime)):t(void 0)})).stop}}(e,s).stop;if(pr("layout-shift")){i.cumulativeLayoutShift=0;var d=function(e,t){return{stop:e.subscribe(Ye,(function(e){"layout-shift"!==e.entryType||e.hadRecentInput||t(e.value)})).unsubscribe}}(e,(function(e){i.cumulativeLayoutShift=U(i.cumulativeLayoutShift+e,4),t()}));r=d.stop}else r=$;return{stop:function(){o(),c(),r()},setLoadEvent:u,viewMetrics:i}}var Jr={INITIAL_LOAD:"initial_load",ROUTE_CHANGE:"route_change"};function Yr(e,t){var n,r,i=!1,o=(n=Zr(t,e,i,Jr.INITIAL_LOAD,document.referrer,{relative:0,timeStamp:Y()}),r=Qr(t,(function(e){n.updateTimings(e),n.scheduleUpdate()})).stop,{initialView:n,stop:r}),a=o.stop,s=o.initialView,u=zr((function(){if(Gr(s.getLocation(),e))return s.end(),s.triggerUpdate(),void(s=d());s.updateLocation(e),s.triggerUpdate()})).stop;t.subscribe(ot,(function(){s.end(),s=d()})),t.subscribe(st,(function(){s.end(),s.triggerUpdate()})),t.subscribe(pt,(function(){i=!0,s.updateHasReplay(!0)})),t.subscribe(vt,(function(){i=!1}));var c=window.setInterval((function(){s.triggerUpdate()}),3e5);function d(){return Zr(t,e,i,Jr.ROUTE_CHANGE,s.url)}return{addTiming:function(e,t){void 0===t&&(t=Q()),s.addTiming(e,t),s.triggerUpdate()},stop:function(){a(),u(),s.end(),clearInterval(c)}}}function Zr(e,t,n,r,i,o,a){void 0===o&&(o=Q());var s,u=C(),d={},f={},l=0,p=c({},t),v=n;e.notify(nt,{id:u,startClocks:o,location:p,referrer:i});var h=x(_,3e3,{leading:!1}),m=h.cancel,g=Kr(e,h,r),y=g.setLoadEvent,w=g.viewMetrics,b=g.stop;function _(){l+=1,e.notify(rt,c({},w,{customTimings:f,documentVersion:l,id:u,name:a,loadingType:r,location:p,hasReplay:v,referrer:i,startClocks:o,timings:d,duration:G(X(o),X(void 0===s?Q():s)),isActive:void 0===s}))}return _(),{scheduleUpdate:h,end:function(){s=Q(),b(),e.notify(it,{endClocks:s})},getLocation:function(){return p},triggerUpdate:function(){m(),_()},updateTimings:function(e){d=e,void 0!==e.loadEvent&&y(e.loadEvent)},addTiming:function(e,t){f[function(e){var t=e.replace(/[^a-zA-Z0-9-_.@$]/g,"_");return t}(e)]=G(X(o),X(t))},updateLocation:function(e){p=c({},e)},updateHasReplay:function(e){v=e},url:p.href}}function ei(e,t,n){return e.subscribe(rt,(function(t){e.notify(dt,function(e){var t={_dd:{documentVersion:e.documentVersion},date:K(e.startClocks),type:Ue.VIEW,view:{action:{count:e.eventCounts.userActionCount},cumulativeLayoutShift:e.cumulativeLayoutShift,domComplete:V(e.timings.domComplete),domContentLoaded:V(e.timings.domContentLoaded),domInteractive:V(e.timings.domInteractive),error:{count:e.eventCounts.errorCount},firstContentfulPaint:V(e.timings.firstContentfulPaint),firstInputDelay:V(e.timings.firstInputDelay),firstInputTime:V(e.timings.firstInputTime),largestContentfulPaint:V(e.timings.largestContentfulPaint),loadEventEnd:V(e.timings.loadEventEnd),load_event:V(e.timings.load_event),loadingTime:V(e.loadingTime),loadingType:e.loadingType,isActive:e.isActive,name:e.name,longTask:{count:e.eventCounts.longTaskCount},resource:{count:e.eventCounts.resourceCount},timeSpent:V(e.duration)},session:{hasReplay:e.hasReplay||void 0}};y(e.customTimings)||(t.view.custom_timings=(n=e.customTimings,r=j,i={},u(n,(function(e,t){i[t]=r(e)})),i));var n,r,i;return{rawRumEvent:t=d(t,{view:ti(e.timings)}),startTime:e.startClocks.relative}}(t))})),Yr(n,e)}function ti(e){var t=sr(e);if(t){var n=t.fetchStart,r=t.responseEnd,i=t.domInteractive,o=t.domContentLoaded,a=t.domComplete,s=t.loadEventEnd,u=t.loadEventStart,c=t.domContentLoadedEventEnd,d={fmp:V(t.largestContentfulPaint)};if(r!==n){d.fpt=V(r-n);var f=parseInt((r-n)/1e3);d.apdexLevel=f>9?9:f}return i!==n&&(d.tti=V(i-n)),o!==n&&(d.domReady=V(o-n)),s!==n&&(d.load=V(s-n)),u!==c&&(d.resourceLoadTime=V(u-c)),a!==i&&(d.dom=V(a-i)),d}}function ni(){this.buffer=new Uint8Array(8),ri().getRandomValues(this.buffer),this.buffer[0]=127&this.buffer[0]}function ri(){return window.crypto||window.msCrypto}function ii(e){this._spanId=(new ni).toDecimalString(),this._traceId=(new ni).toDecimalString()}function oi(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e=>{const t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function ai(e,t){this._spanId=oi(),this._traceId=oi(),this._applicationId=e.applicationId,this._env=e.env,this._version=e.version,this._urlParse=k(t).getParse()}function si(){let e="";for(let t=0;t<16;t+=1){e+="0123456789abcdef"[Math.floor(16*Math.random())]}return e}function ui(e){const t=si();e.traceId128Bit?this._traceId=si()+t:this._traceId=t,this._spanId=t}function ci(){let e="";for(let t=0;t<16;t+=1){e+="0123456789abcdef"[Math.floor(16*Math.random())]}return e}function di(e){const t=ci();this._traceId=ci()+t,this._spanId=t}function fi(){let e="";for(let t=0;t<16;t+=1){e+="0123456789abcdef"[Math.floor(16*Math.random())]}return e}function li(e){const t=fi();e.traceId128Bit?this._traceId=fi()+t:this._traceId=t,this._spanId=t}function pi(){let e="";for(let t=0;t<16;t+=1){e+="0123456789abcdef"[Math.floor(16*Math.random())]}return e}function vi(e){const t=pi();this._traceId=pi()+t,this._spanId=t}function hi(e){0===e.status&&(e.traceId=void 0,e.spanId=void 0)}function mi(e,t,n){if(function(e,t){var n=Tt(t),r=!1;return u(e.allowedTracingOrigins,(function(e){if(n===e||e instanceof RegExp&&e.test(n))return r=!0,!1})),r}(e,t.url)&&e.traceType){var r;switch(e.traceType){case je.DDTRACE:r=new ii;break;case je.SKYWALKING_V3:r=new ai(e,t.url);break;case je.ZIPKIN_MULTI_HEADER:r=new li(e);break;case je.JAEGER:r=new ui(e);break;case je.W3C_TRACEPARENT:r=new vi(e);break;case je.ZIPKIN_SINGLE_HEADER:r=new di(e)}r&&r.isTracingSupported()&&(t.traceId=r.getTraceId(),t.spanId=r.getSpanId(),n(r.makeTracingHeaders()))}}ni.prototype={toString:function(e){for(var t=this.readInt32(0),n=this.readInt32(4),r="";;){var i=t%e*4294967296+n;if(t=Math.floor(t/e),n=Math.floor(i/e),r=(i%e).toString(e)+r,!t&&!n)break}return r},toDecimalString:function(){return this.toString(10)},readInt32:function(e){return 16777216*this.buffer[e]+(this.buffer[e+1]<<16)+(this.buffer[e+2]<<8)+this.buffer[e+3]}},ii.prototype={isTracingSupported:function(){return void 0!==ri()},getSpanId:function(){return this._spanId},getTraceId:function(){return this._traceId},makeTracingHeaders:function(){return{"x-datadog-origin":"rum","x-datadog-sampled":"1","x-datadog-sampling-priority":"1","x-datadog-trace-id":this.getTraceId()}}},ai.prototype={isTracingSupported:function(){return!!(this._env&&this._version&&this._urlParse)},getSpanId:function(){return this._spanId},getTraceId:function(){return this._traceId},getSkyWalkingSw8:function(){try{var e=String(O(this._traceId)),t=String(O(this._spanId)),n=String(O(this._applicationId+"_rum_"+this.env)),r=String(O(this._version)),i=String(O(window.location.href)),o=String(O(this._urlParse.Host));return"1-"+e+"-"+t+"-0-"+n+"-"+r+"-"+i+"-"+o}catch(e){return""}},makeTracingHeaders:function(){return{sw8:this.getSkyWalkingSw8()}}},ui.prototype={isTracingSupported:function(){return!0},getSpanId:function(){return this._spanId},getTraceId:function(){return this._traceId},getUberTraceId:function(){return this._traceId+":"+this._spanId+":0:1"},makeTracingHeaders:function(){return{"uber-trace-id":this.getUberTraceId()}}},di.prototype={isTracingSupported:function(){return!0},getSpanId:function(){return this._spanId},getTraceId:function(){return this._traceId},getB3Str:function(){return this._traceId+"-"+this._spanId+"-1"},makeTracingHeaders:function(){return{b3:this.getB3Str()}}},li.prototype={isTracingSupported:function(){return!0},getSpanId:function(){return this._spanId},getTraceId:function(){return this._traceId},makeTracingHeaders:function(){return{"X-B3-TraceId":this.getTraceId(),"X-B3-SpanId":this.getSpanId(),"X-B3-Sampled":"1"}}},vi.prototype={isTracingSupported:function(){return!0},getSpanId:function(){return this._spanId},getTraceId:function(){return this._traceId},getTraceParent:function(){return"00-"+this._traceId+"-"+this._spanId+"-01"},makeTracingHeaders:function(){return{traceparent:this.getTraceParent()}}};var gi=1;function yi(e,t){var n=function(e){return{clearTracingIfCancelled:hi,traceFetch:function(t){return mi(e,t,(function(e){t.init=c({},t.init);var n=[];t.init.headers instanceof Headers?u(t.init.headers,(function(e,t){n.push([t,e])})):f(t.init.headers)?u(t.init.headers,(function(e){n.push(e)})):t.init.headers&&u(t.init.headers,(function(e,t){n.push([t,e])})),t.init.headers=n.concat(w(e))}))},traceXhr:function(t,n){return mi(e,t,(function(e){u(e,(function(e,t){n.setRequestHeader(t,e)}))}))}}}(t);!function(e,t,n){var r=yn();r.beforeSend((function(r,i){fr(t,r.url)&&(n.traceXhr(r,i),r.requestIndex=wi(),e.notify(ut,{requestIndex:r.requestIndex}))})),r.onRequestComplete((function(r,i){fr(t,r.url)&&(n.clearTracingIfCancelled(r),e.notify(ct,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,response:r.response,traceId:r.traceId,startClocks:r.startClocks,spanId:r.spanId,startTime:r.startTime,status:r.status,type:Ve.XHR,url:r.url}))}))}(e,t,n),function(e,t,n){var r=xn();r.beforeSend((function(r){fr(t,r.url)&&(n.traceFetch(r),r.requestIndex=wi(),e.notify(ut,{requestIndex:r.requestIndex}))})),r.onRequestComplete((function(r){fr(t,r.url)&&(n.clearTracingIfCancelled(r),e.notify(ct,{duration:r.duration,method:r.method,requestIndex:r.requestIndex,response:r.response,responseType:r.responseType,startClocks:r.startClocks,spanId:r.spanId,startTime:r.startTime,status:r.status,traceId:r.traceId,type:Ve.FETCH,url:r.url}))}))}(e,t,n)}function wi(){var e=gi;return gi+=1,e}function bi(e){if(performance&&"getEntriesByName"in performance){var t=performance.getEntriesByName(e.url,"resource");if(t.length&&"toJSON"in t[0]){var n,r=m(t,(function(e){return e.toJSON()}));return r=h(r,sr),1===(r=h(r,(function(t){return n=t,r=e.startClocks.relative,i=_i({startTime:e.startClocks.relative,duration:e.duration}),o=1,n.startTime>=r-o&&_i(n)<=i+o;var n,r,i,o}))).length?r[0]:2===r.length&&_i((n=r)[0])<=n[1].startTime?r[1]:void 0}}}function _i(e){return e.startTime+e.duration}function Si(e,t,n){e.subscribe(ct,(function(t){n.isTrackedWithResource()&&e.notify(dt,function(e){var t=e.type===Ve.XHR?ke:Ae,n=bi(e),r=n?J(n.startTime):e.startClocks,i=n?Ti(n):void 0,o=function(e){if(!e.traceId||!e.spanId)return;return{_dd:{spanId:e.spanId,traceId:e.traceId},resource:{id:C()}}}(e),a=k(e.url).getParse(),s=d({date:K(r),resource:{type:t,duration:V(e.duration),method:e.method,status:e.status,statusGroup:M(e.status),url:e.url,urlHost:a.Host,urlPath:a.Path,urlPathGroup:I(a.Path),urlQuery:B(R(e.url))},type:Ue.RESOURCE},o,i);return{startTime:r.relative,rawRumEvent:s}}(t))})),e.subscribe(Ye,(function(t){var r;n.isTrackedWithResource()&&"resource"===t.entryType&&("xmlhttprequest"!==(r=t).initiatorType&&"fetch"!==r.initiatorType)&&e.notify(dt,function(e){var t=ir(e),n=Ti(e),r=function(e){return e.traceId?{_dd:{traceId:e.traceId}}:void 0}(e),i=k(e.name).getParse(),o="";!function(e){return e.encodedBodySize>0&&e.transferSize>0&&e.transferSize<e.encodedBodySize||null}(e)?function(e){return!(e.transferSize>0)&&(e.decodedBodySize>0||e.duration<30)}(e)&&(o=200):o=304;var a=J(e.startTime),s=d({date:K(a),resource:{type:t,url:e.name,urlHost:i.Host,urlPath:i.Path,urlPathGroup:I(i.Path),urlQuery:B(R(e.name)),method:"GET",status:o,statusGroup:M(o)},type:Ue.RESOURCE},r,n);return{startTime:a.relative,rawRumEvent:s}}(t))}))}function Ti(e){return{resource:d({},{duration:(t=e,0===t.duration&&t.startTime<t.responseEnd?V(t.responseEnd-t.startTime):V(t.duration)),size:dr(e)},ar(e))};var t}var xi,Ei,Oi,Ci,Ii=function(e){var t,n,r,i=!1,o=(t={},{get:function(){return t},add:function(e,n){b(e)&&(t[e]=n)},remove:function(e){delete t[e]},set:function(e){g(e)&&(t=e)}}),a={},s=function(){},u=function(){return{}},f=function(){},l=new ce,p=function(e){l.add([e,z()])},v=new ce,h=function(e){v.add([e,Q()])},m=new ce,w=function(e){m.add([e,T()])},_=new ce,S=function(e){_.add([e,T()])};function T(){return d({},{context:o.get(),user:a})}return n={init:function(t){if(An(rn(t))&&Mn()&&function(e){return!i&&(!!e.applicationId&&(!(!e.datakitUrl&&!e.datakitOrigin)&&(!(void 0!==e.sampleRate&&!re(e.sampleRate))&&!(void 0!==e.resourceSampleRate&&!re(e.resourceSampleRate)))))}(t)){var n=e(t,(function(){return{user:a,context:o.get()}}));p=n.session.addDebugSession,w=n.addAction,S=n.addError,h=n.addTiming,u=n.session.getDebugSession,f=n.session.clearDebugSession,s=n.getInternalContext,l.drain((function(e){var t=e[0],n=e[1];p(t,n)})),m.drain((function(e){var t=e[0],n=e[1];w(t,n)})),_.drain((function(e){var t=e[0],n=e[1];S(t,n)})),v.drain((function(e){var t=e[0],n=e[1];h(t,n)})),i=!0}},addRumGlobalContext:o.add,removeRumGlobalContext:o.remove,getRumGlobalContext:o.get,setRumGlobalContext:o.set,getInternalContext:function(e){return s(e)},addDebugSession:function(e){p(e),this.getDebugSession()},clearDebugSession:function(){f()},getDebugSession:function(){var e=u();if(y(e))return e;{const t=E(new Date(+e.created));return e.id,d(e,{format_created:t})}},setUser:function(e){var t=function(e){if("object"==typeof e&&e){var t=d({},e);return"id"in t&&(t.id=String(t.id)),"name"in t&&(t.name=String(t.name)),"email"in t&&(t.email=String(t.email)),t}}(e);t&&(a=t)},removeUser:function(){a={}}},r=c({},n,{onReady:function(e){e()}}),Object.defineProperty(r,"_setDebug",{get:function(){return setDebugMode},enumerable:!1}),r}((function(e,t){var n=new ht,r=an(e,tr),i=Zn(r,n),o=function(e,t,n,r,i,o){var a=function(e,t){var n,r,i,o=[],a=[];e.subscribe(nt,(function(e){n=e,i=t.getId()})),e.subscribe(rt,(function(e){n&&n.id===e.id&&(n=e)})),e.subscribe(it,(function(e){n&&(o.unshift({endTime:e.endClocks.relative,context:d(),startTime:n.startClocks.relative}),n=void 0)})),e.subscribe(Ze,(function(e){r=e})),e.subscribe(et,(function(e){r&&a.unshift({context:f(),endTime:r.startClocks.relative+e.duration,startTime:r.startClocks.relative}),r=void 0})),e.subscribe(tt,(function(){r=void 0})),e.subscribe(ot,(function(){o=[],a=[],n=void 0,r=void 0}));var s=window.setInterval((function(){c(o,144e5),c(a,3e5)}),6e4);function c(e,t){for(var n=q()-t;e.length>0&&e[e.length-1].startTime<n;)e.pop()}function d(){return{session:{id:i},view:{id:n.id,referrer:n.referrer,name:n.name,url:n.location.href,host:n.location.host,path:n.location.pathname,pathGroup:I(n.location.pathname),urlQuery:B(R(n.location.href))}}}function f(){return{userAction:{id:r.id}}}function l(e,t,n,r){if(void 0===r)return n?e():void 0;if(n&&r>=n.startClocks.relative)return e();var i=void 0;return u(t,(function(e){return!(r>e.endTime)&&(r>=e.startTime?(i=e.context,!1):void 0)})),i}return{findAction:function(e){return l(f,a,r,e)},findView:function(e){return l(d,o,n,e)},stop:function(){window.clearInterval(s)}}}(n,i),s=Nr(r,n);Hr(e,r,n,i,a,o),function(e){e.subscribe(Ye,(function(t){if("longtask"===t.entryType){var n=J(t.startTime),r={date:K(n),long_task:{duration:j(t.duration)},type:Ue.LONG_TASK};e.notify(dt,{rawRumEvent:r,startTime:n.relative})}}))}(n),Si(n,0,i);var c=ei(n,0,t),d=c.addTiming,f=c.stop,l=Fr(n,r);return{addAction:$r(n,r).addAction,addTiming:d,parentContexts:a,addError:l.addError,stop:function(){f(),s.stop()}}}(e.applicationId,location,n,r,i,t),a=o.parentContexts;yi(n,r),vr(n,r),wr(n);var s=function(e,t,n){return{get:function(r){var i=n.findView(r);if(t.isTracked()&&i&&i.session.id){const t=n.findAction(r);return{application:{id:e},session:{id:i.session.id},userAction:t?{id:t.userAction.id}:void 0,view:i.view}}}}}(e.applicationId,i,a);return{addAction:o.addAction,addError:o.addError,addTiming:o.addTiming,configuration:r,lifeCycle:n,parentContexts:a,session:i,getInternalContext:s.get}}));xi=function(){if("object"==typeof globalThis)return globalThis;Object.defineProperty(Object.prototype,"_dd_temp_",{get:function(){return this},configurable:!0});var e=_dd_temp_;return delete Object.prototype._dd_temp_,"object"!=typeof e&&(e="object"==typeof self?self:"object"==typeof window?window:{}),e}(),Oi=Ii,Ci=xi[Ei="DATAFLUX_RUM"],xi[Ei]=Oi,Ci&&Ci.q&&u(Ci.q,(function(e){e()}))})();
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.buildEnv = void 0;
7
7
  var buildEnv = {
8
- sdkVersion: '2.0.17',
8
+ sdkVersion: '2.0.20',
9
9
  sdkName: 'df_web_rum_sdk'
10
10
  };
11
11
  exports.buildEnv = buildEnv;
@@ -57,7 +57,18 @@ function startRumAssembly(applicationId, configuration, lifeCycle, session, pare
57
57
  type: getSessionType()
58
58
  }
59
59
  };
60
- var rumEvent = needToAssembleWithAction(rawRumEvent) ? (0, _browserCore.extend2Lev)(rumContext, deviceContext, viewContext, actionContext, rawRumEvent) : (0, _browserCore.extend2Lev)(rumContext, deviceContext, viewContext, rawRumEvent);
60
+ var sessionAliasTag = {};
61
+
62
+ if (session.isTrackedWidthService()) {
63
+ // 如果是触发了采样的数据,则加上额外的tag
64
+ sessionAliasTag = {
65
+ session: {
66
+ is_sampling: '1'
67
+ }
68
+ };
69
+ }
70
+
71
+ var rumEvent = needToAssembleWithAction(rawRumEvent) ? (0, _browserCore.extend2Lev)(rumContext, deviceContext, sessionAliasTag, viewContext, actionContext, rawRumEvent) : (0, _browserCore.extend2Lev)(rumContext, deviceContext, sessionAliasTag, viewContext, rawRumEvent);
61
72
  var serverRumEvent = (0, _browserCore.withSnakeCaseKeys)(rumEvent);
62
73
  var context = (0, _browserCore.extend2Lev)(commonContext.context, customerContext);
63
74
 
@@ -33,6 +33,16 @@ function doStartErrorCollection(lifeCycle) {
33
33
  };
34
34
  }
35
35
 
36
+ function computeRawError(error, handlingStack, startClocks) {
37
+ var stackTrace = error instanceof Error ? (0, _browserCore.computeStackTrace)(error) : undefined;
38
+ return (0, _browserCore.extend)({
39
+ startClocks: startClocks,
40
+ source: _browserCore.ErrorSource.CUSTOM,
41
+ originalError: error,
42
+ handling: _browserCore.ErrorHandling.HANDLED
43
+ }, (0, _browserCore.formatUnknownError)(stackTrace, error, 'Provided', handlingStack));
44
+ }
45
+
36
46
  function processError(error) {
37
47
  var resource = error.resource;
38
48
 
@@ -106,8 +106,8 @@ function computeRequestTracingInfo(request) {
106
106
 
107
107
  return {
108
108
  _dd: {
109
- spanId: request.spanId.toDecimalString(),
110
- traceId: request.traceId.toDecimalString()
109
+ spanId: request.spanId,
110
+ traceId: request.traceId
111
111
  },
112
112
  resource: {
113
113
  id: (0, _browserCore.UUID)()
@@ -13,7 +13,9 @@ exports.RUM_SESSION_KEY = RUM_SESSION_KEY;
13
13
  var RumTrackingType = {
14
14
  NOT_TRACKED: '0',
15
15
  TRACKED_WITH_RESOURCES: '1',
16
- TRACKED_WITHOUT_RESOURCES: '2'
16
+ TRACKED_WITHOUT_RESOURCES: '2',
17
+ TRACKED_WITH_SERVICE: '3' // 采样数据添加额外的tag,不舍弃,直接上报到服务端
18
+
17
19
  };
18
20
  exports.RumTrackingType = RumTrackingType;
19
21
 
@@ -33,8 +35,12 @@ function startRumSession(configuration, lifeCycle) {
33
35
  isTracked: function isTracked() {
34
36
  return session.getId() !== undefined && _isTracked(session.getTrackingType());
35
37
  },
38
+ isTrackedWidthService: function isTrackedWidthService() {
39
+ return session.getId() !== undefined && session.getTrackingType() === RumTrackingType.TRACKED_WITH_SERVICE;
40
+ },
36
41
  isTrackedWithResource: function isTrackedWithResource() {
37
- return session.getId() !== undefined && session.getTrackingType() === RumTrackingType.TRACKED_WITH_RESOURCES;
42
+ var trackingType = session.getTrackingType();
43
+ return session.getId() !== undefined && (trackingType === RumTrackingType.TRACKED_WITH_RESOURCES || trackingType === RumTrackingType.TRACKED_WITH_SERVICE);
38
44
  }
39
45
  };
40
46
  }
@@ -45,9 +51,18 @@ function computeSessionState(configuration, rawTrackingType) {
45
51
  if (hasValidRumSession(rawTrackingType)) {
46
52
  trackingType = rawTrackingType;
47
53
  } else if (!(0, _browserCore.performDraw)(configuration.sampleRate)) {
48
- trackingType = RumTrackingType.NOT_TRACKED;
54
+ if (configuration.isServiceSampling) {
55
+ trackingType = RumTrackingType.TRACKED_WITH_SERVICE;
56
+ } else {
57
+ trackingType = RumTrackingType.NOT_TRACKED;
58
+ }
49
59
  } else if (!(0, _browserCore.performDraw)(configuration.resourceSampleRate)) {
50
- trackingType = RumTrackingType.TRACKED_WITHOUT_RESOURCES;
60
+ // trackingType = RumTrackingType.TRACKED_WITHOUT_RESOURCES
61
+ if (configuration.isServiceSampling) {
62
+ trackingType = RumTrackingType.TRACKED_WITH_SERVICE;
63
+ } else {
64
+ trackingType = RumTrackingType.TRACKED_WITHOUT_RESOURCES;
65
+ }
51
66
  } else {
52
67
  trackingType = RumTrackingType.TRACKED_WITH_RESOURCES;
53
68
  }
@@ -59,9 +74,9 @@ function computeSessionState(configuration, rawTrackingType) {
59
74
  }
60
75
 
61
76
  function hasValidRumSession(trackingType) {
62
- return trackingType === RumTrackingType.NOT_TRACKED || trackingType === RumTrackingType.TRACKED_WITH_RESOURCES || trackingType === RumTrackingType.TRACKED_WITHOUT_RESOURCES;
77
+ return trackingType === RumTrackingType.NOT_TRACKED || trackingType === RumTrackingType.TRACKED_WITH_RESOURCES || trackingType === RumTrackingType.TRACKED_WITHOUT_RESOURCES || trackingType === RumTrackingType.TRACKED_WITH_SERVICE;
63
78
  }
64
79
 
65
80
  function _isTracked(rumSessionType) {
66
- return rumSessionType === RumTrackingType.TRACKED_WITH_RESOURCES || rumSessionType === RumTrackingType.TRACKED_WITHOUT_RESOURCES;
81
+ return rumSessionType === RumTrackingType.TRACKED_WITH_RESOURCES || rumSessionType === RumTrackingType.TRACKED_WITHOUT_RESOURCES || rumSessionType === RumTrackingType.TRACKED_WITH_SERVICE;
67
82
  }