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

@apm-insight-web/rangers-site-sdk

Package Overview
Dependencies
Maintainers
3
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@apm-insight-web/rangers-site-sdk - npm Package Compare versions

Comparing version 0.2.14 to 0.2.15

cn/browser.0.2.15.cn.js

2

cn/browser.cn.js

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

var RangersSiteSDK=function(){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function e(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function s(e,t){var r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function a(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}function c(e){return"object"==typeof e&&null!==e&&!u(e)}function r(e){return"[object Object]"===(e=e,Object.prototype.toString.call(e))}function d(e){return"function"==typeof e}function f(e){return"[object String]"===Object.prototype.toString.call(e)}function u(e){return"[object Array]"===Object.prototype.toString.call(e)}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function t(e,t){if(c(e))for(var r in e)l(e,r)&&t.call(null,r,e[r])}function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r={},n=0;n<e.length;)r=g(r,e[n]),n++;return r}var o=Object.getPrototypeOf?Object.getPrototypeOf({}):null;function m(e){return Object.getPrototypeOf?Object.getPrototypeOf(e)===o:e.constructor===Object}function g(e,t){var r,n=p({},e);for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&void 0!==t[r]&&(c(t[r])&&m(t[r])?n[r]=g(c(e[r])?e[r]:{},t[r]):u(e[r])||u(t[r])?n[r]=function t(e,r){var e=u(e)?e:[];var r=u(r)?r:[];return Array.prototype.concat.call(e,r).map(function(e){return!(e instanceof RegExp)&&(u(e)||c(e)&&m(e))?u(e)?t([],e):g({},e):e})}(e[r],t[r]):n[r]=t[r]);return n}function b(e,t){if(!u(e))return!1;if(0===e.length)return!1;for(var r=0;r<e.length;){if(e[r]===t)return!0;r++}return!1}function y(){if("fetch"in window)try{return new Headers,new Request(""),new Response,1}catch(e){return}}function S(){return!!c(window)}function w(){return S()&&!!c(window.performance)}function P(){return w()&&!!c(window.performance.timing)}function M(){return!!w()&&!!d(window.performance.getEntries)}function T(){return S()&&"function"==typeof window.MutationObserver}function E(){return S()&&"function"==typeof window.PerformanceObserver}function _(){return!!E()&&d(window.PerformanceLongTaskTiming)}function k(){if(!E())return!1;var e=window.PerformanceObserverEntryList;return d(e)&&d(e.prototype.getEntries)}function R(e){var r,e=function(e){if(!c(e))return{};var r={};return t(e,function(e,t){c(t)||u(t)?r[e]=JSON.stringify(t):r[e]=t}),r}(e),e=(r={},t(e,function(e,t){r[encodeURIComponent(e)]=encodeURIComponent(t)}),r),n=[];return t(e,function(e,t){n.push(e+"="+t)}),n.join("&")}function x(e){var t=document.createElement("a");t.href=e;e=t.pathname||"/";return"/"!==e[0]&&(e="/"+e),{href:t.href,protocol:t.protocol.slice(0,-1),hostname:t.hostname,host:t.host,search:t.search,pathname:e,hash:t.hash}}var C=function(e){if(!f(e))return!1;return d(e.toLowerCase)&&(e=e.toLowerCase()),b(["x-tt-token"],e)};function L(){}function O(e){var t="[object String]"===Object.prototype.toString.call(e);return e?t?e.length:ArrayBuffer&&e instanceof ArrayBuffer?e.byteLength:window.Blob&&e instanceof Blob?e.size:e.length||0:0}function q(e){if(!e)return"";if(!d(e.forEach))return"";var r=[];return e.forEach(function(e){var t;u(e)&&e[0]&&!C(e[0])&&(t=e[0],e=e[1]||"",r.push(t+": "+e))}),r.join("\r\n")}function j(e){var t={},r=x(e);return t.ax_protocol=r.protocol,t.ax_domain=r.hostname,t.ax_path=r.pathname,t.ax_url=(r.href||e).split("?")[0],t}function H(e,t){e=x(e),t=x(t);return e.protocol===t.protocol&&e.host===t.host}function A(e){return u(e)&&e.length?function(e){for(var t=[],r=e.length,n=0;n<r;n++){var o=e[n];f(o)?t.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&t.push(o.source)}return new RegExp(t.join("|"),"i")}(e):null}function I(t,r){d(t)&&(d(window.addEventListener)&&(window.addEventListener("unload",t),window.addEventListener("beforeunload",t),window.addEventListener("pagehide",t)),d(document.addEventListener)&&document.addEventListener("visibilitychange",function(e){d(r)?r(e):"hidden"===document.visibilityState&&t(e)}))}var F=function(e){var t,r;return void 0===e&&(e=window),S()&&null!==(t=e.screen)&&void 0!==t&&t.width&&null!==(r=e.screen)&&void 0!==r&&r.height?e.screen.width+"x"+e.screen.height:"0x0"},B=function(){var e="unknown",t=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return t&&f(t.effectiveType)?t.effectiveType:e};function D(e){return!!e&&Math.random()<Number(e)}var N=(J.post=function(e,t,r){var n,o=null!==(n=null==r?void 0:r.success)&&void 0!==n?n:L,i=null!==(r=null==r?void 0:r.fail)&&void 0!==r?r:L,r=new XMLHttpRequest;r.open("POST",e,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify(t)),r.onload=function(){try{var e;this.responseText?(e=JSON.parse(this.responseText),o(e)):o({})}catch(e){i()}},r.onerror=function(){i()},r.onabort=function(){i()}},J.get=function(e,t){var r,n=null!==(r=null==t?void 0:t.success)&&void 0!==r?r:L,o=null!==(r=null==t?void 0:t.fail)&&void 0!==r?r:L,i=null!==(r=null==t?void 0:t.getResponse)&&void 0!==r?r:L,s=null!==(t=null==t?void 0:t.getResponseText)&&void 0!==t?t:L,t=new XMLHttpRequest;t.open("GET",e),t.send(),t.onload=function(){i(null==this?void 0:this.response),s(this.responseText);try{var e;this.responseText?(e=JSON.parse(this.responseText),n(e)):n({})}catch(e){o()}},t.onerror=function(){o()},t.onabort=function(){o()}},J.prototype.getCommonParams=function(){return{timestamp:Date.now()}},J);function J(e){var t=this;this.postEvent=function(e){e=p(p({},e),t.getCommonParams());J.post(t.url,e)},this.getEvent=function(e){e=R(p(p({},e),t.getCommonParams())),e=t.url+"?"+e;J.get(e)},this.getURL=function(){return t.url},this.options=e,this.url=this.options.reportURL}function U(e,t,r){if(void 0===r&&(r="0"),1<r.length)throw new TypeError("expect the length of pad to be 1, but got "+e.length);return e.length>=t?e:""+Array.from({length:t-e.length}).fill(r).join("")+e}function X(e){return e?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,e):""}var z="x-tt-trace-id",Q="x-tt-trace-host",V="x-tt-logid";function K(e,t,r){void 0===r&&(r="01");t=""+U((Date.now()%4294967295).toString(16),8)+function(e){if("number"==typeof e)r=e;else{var t=e.replace(/-/g,"");if(!/^[0-9]+$/.test(t)){if(18<t.length)return"18"+X(18);e=22-t.length-4;return""+U(""+t.length,2)+t+X(e)}r=parseInt(t,10)}var r=22-(t=r.toString(16)).length-4;return""+U(""+t.length,2)+t+X(r)}(e)+("string"==typeof t?X(4):U(t.toString(16),4));return"00-"+t+"-"+t.substr(0,16)+"-"+r}function W(){var e=function(){for(var e=new Array(16),t=0,r=0;r<16;r++)0==(3&r)&&(t=4294967296*Math.random()),e[r]=t>>>((3&r)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);var n=0;return[t[e[n++]],t[e[n++]],t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],t[e[n++]],t[e[n++]],t[e[+n]],t[e[15]]].join("")}(e)}var G=.1,$=["/log/sentry/"],Y=8e3,Z=4e3;W(),W();var ee="AjaxMonitor",te=(re.prototype.setup=function(e){void 0===e&&(e=L),d(XMLHttpRequest)&&(this.callback=e,this.start())},re.prototype.updateConfig=function(e){this.props=i({},this.props,e)},re.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},re.prototype.hookXMLHttpRequestSetRequestHeader=function(){var r=XMLHttpRequest.prototype.setRequestHeader||L;XMLHttpRequest.prototype.setRequestHeader=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._requestHeaders=this._requestHeaders||[],this._requestHeaders.push(e),r.apply(this,e)}},re.prototype.hookXMLHttpRequestOpen=function(){var o=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=e[1];return this._url=n||"",this._method=(null==r?void 0:r.toLowerCase())||"",o.apply(this,e)}},re.prototype.hookXMLHttpRequestSend=function(){var o=this,i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(){for(var e,t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return o.checkAddTrace(this._url)&&(e=(t=null!==(e=null==o?void 0:o.props.commonParams)&&void 0!==e?e:{}).bid,t=t.web_id,e&&t&&(o.traceId=K(t,e),this.setRequestHeader(z,o.traceId))),o.hookXMLHttpRequestOnreadystatechange.call(this,o),this._start=Date.now(),this._data=null==r?void 0:r[0],i.apply(this,r)}},re.prototype.checkAddTrace=function(e){var t=null!==(n=this.props.commonParams)&&void 0!==n?n:{},r=t.bid,n=t.web_id,t=(null!==(t=this.props.ajaxMonitorOptions)&&void 0!==t?t:{}).sampleHitTrace,e=H(location.href,e);return r&&n&&t&&e},re.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},re.prototype.hookXMLHttpRequestOnreadystatechange=function(i){var s=this.onreadystatechange,a=this;this.onreadystatechange=function(){for(var e,t,r,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(4===this.readyState&&(t={ev_type:"ajax",ax_status:(this.status||0).toString(),ax_type:a._method,ax_request_header:q(a._requestHeaders||[]),ax_domain:"",ax_duration:0,ax_path:"",ax_protocol:"",ax_response_header:"",ax_size:0,ax_url:""},"function"==typeof this.getAllResponseHeaders&&(t.ax_response_header=function(t){if(f(t)){var e=t.split("\r\n"),r=[];return e.forEach(function(e,t){e&&d(e.split)&&(e=e.split(": "),r.push([e[0],e[1]]))}),q(r)}return c(t)?q(Object.keys(t).map(function(e){return[e,t[e]]})):t}(this.getAllResponseHeaders())),!i.checkAddTrace(a._url)||(r=null!==(r=i.traceId)&&void 0!==r?r:this.getResponseHeader(z))&&(t.trace_id=r,t.trace_host=null!==(e=this.getResponseHeader(Q))&&void 0!==e?e:void 0,t.log_id=null!==(e=this.getResponseHeader(V))&&void 0!==e?e:void 0),t.ax_duration=Date.now()-a._start,200===this.status&&(t.ax_size=function(e){var t=0;if(""===e.responseType||"text"===e.responseType)t=O(e.responseText);else if(e.response)t=O(e.response);else try{t=O(e.responseText)}catch(e){t=0}return t}(this)),t=p(p({},t),j(a._url)),i.collectErrorRequest()&&"2"!==t.ax_status[0]&&"3"!==t.ax_status[0]&&(t.ax_request={body:a._data?""+a._data:void 0,search:null===(e=x(a._url))||void 0===e?void 0:e.search,content_type:null===(e=null===(e=a._requestHeaders)||void 0===e?void 0:e.find(function(e){return"content-type"===e[0].toLowerCase()}))||void 0===e?void 0:e[1]}),d(i.callback)&&i.callback({name:i.name,type:"get",event:t})),s)return s.apply(this,n)}},re.monitorName=ee,re);function re(e){this.name=ee,this.callback=L,this.traceId=null,this.props=e}function ne(e){return e instanceof Request}var oe="FetchMonitor",ie=(se.prototype.updateConfig=function(e){this.props=i({},this.props,e)},se.prototype.setup=function(e){void 0===e&&(e=L),y()&&(this.callback=e,this.start())},se.prototype.start=function(){y()&&this.hookFetch()},se.prototype.checkAddTrace=function(e){var t=null!==(n=null===(r=this.props)||void 0===r?void 0:r.commonParams)&&void 0!==n?n:{},r=t.bid,n=t.web_id,t=(null!==(t=null===(t=null==this?void 0:this.props)||void 0===t?void 0:t.ajaxMonitorOptions)&&void 0!==t?t:{}).sampleHitTrace,e=H(location.href,e);return r&&n&&t&&e},se.prototype.updateAxRequest=function(e,t,r){var n,o;this.collectErrorRequest()&&"2"!==e.ax_status[0]&&"3"!==e.ax_status[0]&&(o=this.getFetchUrl(t,!0),e.ax_request={body:null===(t=this.getFetchBody(t,r))||void 0===t?void 0:t.toString(),search:!f(o)||null===(n=x(o))||void 0===n?void 0:n.search,content_type:null===(r=null==r?void 0:r.headers)||void 0===r?void 0:r["Content-Type"]})},se.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},se.prototype.hookFetch=function(){var c=this,u=this,l=window.fetch;window.fetch=function(n,o){void 0===o&&(o={});var i=c.getFetchUrl(n);if(!function(e){if(f(e)){var t=h(e.split(":"),2),e=t[0];return!t[1]||("http"===e||"https"===e)}}(i))return l(n,o);var e=null!==(e=c.props.commonParams)&&void 0!==e?e:{},t=e.bid,r=e.web_id,s=Date.now(),a={ev_type:"ajax"};try{u.checkAddTrace(i)&&(o.headers=new Headers(function(e,t){var r=new Headers;ne(e)&&e.headers&&d(e.headers.forEach)&&e.headers.forEach(function(e,t){r.append(t,e)});t.headers&&new Headers(t.headers).forEach(function(e,t){r.append(t,e)});return r}(n,o)),t&&r&&(a.trace_id=K(t,r),o.headers.append(z,a.trace_id)))}catch(e){}return a.ax_type=c.getFetchMethod(n,o),a=p(p({},a),j(i)),l(n,o).then(function(e){var t,r;return a.ax_status=(e.status||0).toString(),a.ax_duration=Date.now()-s,a.ax_response_header=u.getAllHeaders(e.headers),a.ax_request_header=u.getAllHeaders(o.headers),e.headers&&d(e.headers.has)?(e.headers.has("content-length")?a.ax_size=Number(e.headers.get("content-length"))||0:a.ax_size=0,u.checkAddTrace(i)&&(e.headers.has(Q)&&(a.trace_host=null!==(t=e.headers.get(Q))&&void 0!==t?t:void 0),e.headers.has(z)&&(a.trace_id=null!==(r=e.headers.get(z))&&void 0!==r?r:void 0),e.headers.has(V)&&(a.log_id=null!==(r=e.headers.get(V))&&void 0!==r?r:void 0))):a.ax_size=0,c.updateAxRequest(a,n,o),d(u.callback)&&u.callback({name:u.name,type:"get",event:a}),e},function(e){return a.ax_status="0",a.ax_size=0,a.ax_duration=Date.now()-s,c.updateAxRequest(a,n,o),d(u.callback)&&u.callback({name:u.name,type:"get",event:a}),Promise.reject(e)})}},se.prototype.getFetchUrl=function(e,t){void 0===t&&(t=!1);var r="",r=ne(e)?e.url:e;return t||(r=f(r)?r.split("?")[0]:r),r},se.prototype.getFetchMethod=function(e,t){t=null!==(t=null==t?void 0:t.method)&&void 0!==t?t:"get";return ne(e)&&(t=null!==(e=e.method)&&void 0!==e?e:t),t.toLowerCase()},se.prototype.getFetchBody=function(e,t){return ne(e)?e.body:null==t?void 0:t.body},se.prototype.getAllHeaders=function(e){if(!e||"function"!=typeof e.forEach)return"";var r=[];return e.forEach(function(e,t){r.push([t,e])}),q(r)},se.monitorName=oe,se);function se(e){this.name=oe,this.callback=L,this.props=e}var ae="FMPMonitor",ce=(ue.prototype.setup=function(e){if(S())return T()?void(d(document.querySelector)&&(this.callback=e&&d(e)?e:function(){},this.startTime=Date.now(),this.list=[],d(this.observer.observe)&&this.observer.observe(document,{childList:!0,subtree:!0}))):null},ue.prototype.count=function(){var e=Date.now()-this.startTime,t=document.querySelector("body");t?this.list.push({score:this.score(t,1,!1),time:e}):this.list.push({score:0,time:e})},ue.prototype.score=function(e,t,r){var n=0,o=e.tagName;if("SCRIPT"!==o&&"STYLE"!==o&&"META"!==o&&"HEAD"!==o){o=e.children?e.children.length:0;if(0<o)for(var i=e.children,s=o-1;0<=s;s--)n+=this.score(i[s],t+1,0<n);if(n<=0&&!r){if(!e.getBoundingClientRect||!d(e.getBoundingClientRect))return 0;e=e.getBoundingClientRect();if(!e)return 0;if(e.top>window.innerHeight)return 0;if(e.height<=0)return 0}n+=1+.5*t}return n},ue.prototype.getFmpInternal=function(){if(!this.observer)return 0;if(this.disconnect(),!this.list.length)return 0;for(var e,t={time:this.list[0].time,rate:0},r=1;r<this.list.length;r++)this.list[r].time>=this.list[r-1].time&&(e=this.list[r].score-this.list[r-1].score,t.rate<e&&(t={time:this.list[r].time,rate:e}));return t.time},ue.prototype.getTimeGap=function(){return P()?this.startTime-performance.timing.navigationStart:0},ue.prototype.formatEvent=function(e){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:e}}},ue.monitorName=ae,ue);function ue(){var r=this;this.name=ae,this.callback=L,this.disconnect=function(){var e,t;null!==(t=null===(e=r.observer)||void 0===e?void 0:e.disconnect)&&void 0!==t&&t.call(e)},this.getLoadFmp=function(){var e=r.getFmpInternal(),e=e?r.getTimeGap()+e:0,e=r.formatEvent(e);return r.callback(e),e},this.getFmp=function(){var e=r.getFmpInternal(),e=r.formatEvent(e);return r.callback(e),e},this.startTime=Date.now(),this.list=[],this.observer=new MutationObserver(this.count.bind(this))}function le(){}var pe=!1,he=!1,de={uniqueId:0,originals:{},proxies:{},patchXMLHTTPRequest:function(i){this.originals.send=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.send=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=de.uniqueId++;i.beforeCb(n);var o=this.onreadystatechange;return this.onreadystatechange=function(e){null!=o&&o.call(t,e),4===t.readyState&&i.afterCb(n)},de.originals.send.apply(this,e)},this.proxies.send=XMLHttpRequest.prototype.send},patchFetch:function(o){var i;y()&&(i=window.fetch,this.originals.fetch=i,window.fetch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new Promise(function(t,r){var n=de.uniqueId++;o.beforeCb(n),i.apply(void 0,a(e)).then(function(e){o.afterCb(n),t(e)},function(e){o.afterCb(n,e),r(e)})})},this.proxies.fetch=window.fetch)},observeResourceFetchingMutations:function(s){if(T()){var a=["img","script","iframe","link","audio","video","source"],e=new MutationObserver(function(e){var t,r;try{for(var n=v(e),o=n.next();!o.done;o=n.next()){var i=o.value;("childList"===i.type&&function e(t,r){var n,o;try{for(var i=v(t),s=i.next();!s.done;s=i.next()){var a=s.value;if(r.includes(a.nodeName.toLowerCase())||a.children&&e(a.children,r))return 1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}}(i.addedNodes,a)||"attributes"===i.type&&a.includes(i.target.nodeName.toLowerCase()))&&s(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}});return e.observe(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]}),e}},resetOriginals:function(){this.originals.send&&XMLHttpRequest.prototype.send===this.proxies.send&&(pe=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(he=!1,window.fetch=this.originals.fetch)}},fe="TTIMonitor",me=(ve.prototype.setup=function(){},ve.prototype.isEnable=function(){return _()&&!!E()&&d(window.PerformanceResourceTiming)&&k()},ve.prototype.registerPerformanceObserver=function(){var a=this;this.performanceObserver=new PerformanceObserver(function(e){var t,r,n=e.getEntries();try{for(var o=v(n),i=o.next();!i.done;i=o.next()){var s=i.value;"resource"===s.entryType&&a.networkRequestFinishedCallback(s),"longtask"===s.entryType&&a.longTaskFinishedCallback(s)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}});try{this.performanceObserver.observe({type:"longtask"}),this.performanceObserver.observe({type:"resource",buffered:!0})}catch(e){this.performanceObserver.observe({entryTypes:["longtask","resource"]})}},ve.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),de.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=le,this.proxyConfig.afterCb=le)},ve.prototype.rescheduleTimer=function(e){var t=this;this.scheduleTimerTasks&&(this.timerActivationTime>e||(clearTimeout(this.timerId),this.timerId=window.setTimeout(function(){t.checkTTI()},e-performance.now()),this.timerActivationTime=e))},ve.prototype.startSchedulingTimerTasks=function(){this.scheduleTimerTasks=!0;var e=0<this.longTasks.length?this.longTasks[this.longTasks.length-1].end:0,t=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests);this.rescheduleTimer(Math.max(t+5e3,e))},ve.prototype.registerListeners=function(){pe||(de.patchXMLHTTPRequest(this.proxyConfig),pe=!0),he||(de.patchFetch(this.proxyConfig),he=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=de.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},ve.prototype.mutationObserverCallback=function(e){this.rescheduleTimer(performance.now()+5e3)},ve.prototype.beforeJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=performance.now()},ve.prototype.afterJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=void 0},ve.prototype.networkRequestFinishedCallback=function(e){this.networkRequests.push({start:e.fetchStart,end:e.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(ve.prototype,"incompleteRequestStarts",{get:function(){for(var e=Object.keys(this.incompleteJSInitiatedRequestStartTimes),t=[],r=0;r<e.length;r++){var n=this.incompleteJSInitiatedRequestStartTimes[e[r]];"number"==typeof n&&t.push(n)}return t},enumerable:!1,configurable:!0}),ve.prototype.longTaskFinishedCallback=function(e){var t=e.startTime+e.duration;this.longTasks.push({start:e.startTime,end:t}),this.rescheduleTimer(t+5e3)},ve.prototype.checkTTI=function(){var e=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests),t=this.getFirstPaintTime()||performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,r=this.getMinValue(),n=performance.now();null===r&&this.rescheduleTimer(Math.max(e+5e3,n+1e3));n=this.computeTTI(t,r,e,n,this.longTasks);n?(this.callback&&"function"==typeof this.callback&&this.callback(Math.round(n)),this.disable()):this.rescheduleTimer(performance.now()+1e3)},ve.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var e=performance.timing;return e.domContentLoadedEventEnd-e.navigationStart}return null},ve.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var e=performance.getEntriesByType("paint")[0];return e?e.startTime:0}return 0},ve.prototype.disable=function(){clearTimeout(this.timerId),this.scheduleTimerTasks=!1,this.unregisterListeners(),this.snippetObserver&&this.snippetObserver.disconnect(),this.snippetEntries&&this.snippetEntries.splice(0,this.snippetEntries.length)},ve.prototype.computeLastKnownNetwork2Busy=function(e,t){var r,n,o,i;if(2<e.length)return performance.now();var s=[];try{for(var a=v(t),c=a.next();!c.done;c=a.next()){var u=c.value;s.push({timestamp:u.start,type:"requestStart"}),s.push({timestamp:u.end,type:"requestEnd"})}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}try{for(var l=v(e),p=l.next();!p.done;p=l.next()){var h=p.value;s.push({timestamp:h,type:"requestStart"})}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}s.sort(function(e,t){return e.timestamp-t.timestamp});for(var d=e.length,f=s.length-1;0<=f;f--){var m=s[f];switch(m.type){case"requestStart":d--;break;case"requestEnd":if(2<++d)return m.timestamp;break;default:throw Error("Internal Error: This should never happen")}}return 0},ve.monitorName=fe,ve);function ve(e){var t,r,n,o=this;if(this.name=fe,this.longTasks=[],this.callback=le,this.useMutationObserver=!0,this.minValue=null,this.isAsync=0,this.networkRequests=[],this.incompleteJSInitiatedRequestStartTimes={},this.timerActivationTime=-1/0,this.scheduleTimerTasks=!1,this.proxyConfig={beforeCb:this.beforeJSInitiatedRequestCallback.bind(this),afterCb:this.afterJSInitiatedRequestCallback.bind(this)},this.getTTI=function(e){o.callback=e,o.isEnable()?o.startSchedulingTimerTasks():o.callback&&"function"==typeof o.callback&&o.callback()},this.computeTTI=function(e,t,r,n,o){if(n-r<5e3)return null;o=0===o.length?e:o[o.length-1].end;return n-o<5e3?null:Math.max(o,t)},this.isEnable()){if(this.useMutationObserver=!!e.useMutationObserver,this.minValue=null!==(n=e.minValue)&&void 0!==n?n:null,this.isAsync=null!==(n=e.isAsync)&&void 0!==n?n:0,this.snippetEntries=null===(n=null==e?void 0:e.preLongTaskObserver)||void 0===n?void 0:n.precollect,this.snippetObserver=null===(e=null==e?void 0:e.preLongTaskObserver)||void 0===e?void 0:e.observer,!this.isAsync&&this.snippetEntries&&0<this.snippetEntries.length)try{for(var i=v(this.snippetEntries),s=i.next();!s.done;s=i.next()){var a=s.value;"longtask"===a.entryType?this.longTasks.push({start:a.startTime,end:a.startTime+a.duration}):"resource"===a.entryType&&this.networkRequests.push({start:a.fetchStart,end:a.responseEnd})}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}this.registerListeners()}}function ge(e){try{for(var t,r=e,n=[],o=0,i=0,s=" > ".length;r&&o++<5&&!("html"===(t=function(e){var t,r,n,o,i=e,s=[];if(!i||!i.tagName)return"";s.push(i.tagName.toLowerCase()),i.id&&s.push("#"+i.id);e=i.className;if(e&&f(e))for(t=e.split(/\s+/),o=0;o<t.length;o++)s.push("."+t[o]);var a=["type","name","title","alt"];for(o=0;o<a.length;o++)r=a[o],(n=i.getAttribute(r))&&s.push("["+r+'="'+n+'"]');return s.join("")}(r))||1<o&&80<=i+n.length*s+t.length);)n.push(t),i+=t.length,r=r.parentNode;return n.reverse().join(" > ")}catch(e){return"<unknown>"}}var be="FIDMonitor",ye=(Se.prototype.setup=function(e){var a=this;if(E()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&k()){this.callback=e,this.observer=new PerformanceObserver(function(e,t){var r,n;try{for(var o=v(e.getEntries()),i=o.next();!i.done;i=o.next()){var s=i.value,s=s.processingStart-s.startTime;a.callback({name:a.name,fid:Math.round(s)})}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.disconnect()});try{this.observer.observe({type:"first-input",buffered:!0})}catch(e){this.observer.observe({entryTypes:["first-input"]})}}},Se.monitorName=be,Se);function Se(){this.name=be,this.callback=L}var we="MPFIDMonitor",Pe=(Me.prototype.setup=function(){var t,e,r,s=this;if(_()&&k()){if(!this.props.isAsync){var n=null!==(r=null===(r=this.props.preLongTaskObserver)||void 0===r?void 0:r.precollect)&&void 0!==r?r:[];if(n&&0<n.length)try{for(var o=v(n),i=o.next();!i.done;i=o.next()){var a=i.value;"longtask"===a.entryType&&this.list.push(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}}this.observer=new PerformanceObserver(function(e){var t,r;try{for(var n=v(e.getEntries()),o=n.next();!o.done;o=n.next()){var i=o.value;s.list.push(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}),this.observer.observe({entryTypes:["longtask"]})}},Me.prototype.getMPFID=function(){var t,e;if(_()&&k()){this.observer&&this.observer.disconnect();var r=0;try{for(var n=v(this.list),o=n.next();!o.done;o=n.next()){var i=o.value;r<i.duration&&(r=i.duration)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return this.formatEvent(Math.round(r))}},Me.prototype.formatEvent=function(e){return{name:this.name,mpfid:e}},Me.monitorName=we,Me);function Me(e){this.name=we,this.list=[],this.props=e}var Te=[],Ee="ResourcePerformanceMonitor",_e=(ke.prototype.setup=function(e){this.isEnable()&&(this.callback=null!=e?e:L,this.isAsync&&window.performance.clearResourceTimings(),this.observe&&(this.sendResourcePerformance(performance.getEntriesByType("resource")),this.observePerformance()))},ke.prototype.isEnable=function(){return M()&&"function"==typeof performance.clearResourceTimings},ke.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},ke.prototype.buildParams=function(e){var t=this,r=[];if(e.forEach(function(e){d(t.checkIgnore)&&t.checkIgnore(e)||r.push(e)}),r.length)return{name:this.name,type:"post",event:{ev_type:"resource_performance",resources:r}}},ke.prototype.sendResourcePerformance=function(e){e=this.buildParams(e);e&&this.callback(e)},ke.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(e){return!b(Te,e.initiatorType)})},ke.prototype.observePerformance=function(){var t=this;E()&&new PerformanceObserver(function(e){e=e.getEntries();e.length&&t.sendResourcePerformance(e)}).observe({entryTypes:["resource"]})},ke.monitorName=Ee,ke);function ke(e){var t,r=this;this.name=Ee,this.callback=L,this.getResourcePerformance=function(){var e;return null!==(e=r.getPerformance())&&void 0!==e?e:{}},this.isAsync=null!==(t=null==e?void 0:e.isAsync)&&void 0!==t?t:0,this.observe=null!==(t=null==e?void 0:e.observe)&&void 0!==t&&t,this.checkIgnore=null!==(e=null==e?void 0:e.checkIgnore)&&void 0!==e?e:function(){return!1}}var Re={ev_type:"perf",isAsync:0,dns:0,tcp:0,request:0,response:0,processing:0,blank:0,domready:0,load:0,has_resource:0,domparse:0,resource:0,ttfb:0,redirect:0,tti:0,upload_reason:"sample",network_type:"",timing:{},navigation_timing:{},navigation:{},resources:[]},xe="PerformanceMonitor",Ce=(Le.prototype.setup=function(e){var t,r=this;P()&&(this.callback=e,t=function(){r.hasLoaded=!0,r.performanceAuto&&setTimeout(function(){r.perfLog()},200)},"complete"!==document.readyState?window.addEventListener("load",function(){setTimeout(function(){t()},0)},!1):t(),this.sendParams=p({},Re),this.staticPerformanceMonitor=new _e,this.staticPerformanceMonitor.setup(),(new ye).setup(this.hasFID),this.mpfidMonitor=new Pe({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),e=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:me,this.ttiMonitor=new e({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),e=this.syncPerfLog.bind(this),I(e))},Le.prototype.performanceNow=function(){var e;return null!==performance&&void 0!==performance&&performance.now?performance.now():(Date.now?Date.now():+new Date)-(null!==(e=null===(e=performance.timing)||void 0===e?void 0:e.navigationStart)&&void 0!==e?e:0)},Le.prototype.getBounced=function(){return!this.hasLoaded},Le.prototype.getPaintTime=function(t){if(M()){var e=performance.getEntriesByType("paint");if(u(e)){e=e.filter(function(e){return e.name===t});return e.length&&e[0]&&c(e[0])&&e[0].startTime||0}}return 0},Le.monitorName=xe,Le);function Le(e){var o=this;this.name=xe,this.callback=L,this.sendParams=p({},Re),this.finalSendParams=this.sendParams,this.hasLoaded=!1,this.initStart=0,this.hasSentInitPerf=!1,this.initFlag=!0,this.performanceAuto=!0,this.send=function(){o.initFlag&&o.hasLoaded&&(o.sendParams.isAsync&&(o.sendParams.load=Math.round(o.performanceNow()-o.initStart)),setTimeout(function(){o.perfLog()},200))},this.initAsync=function(){var e,t;o.hasSentInitPerf&&(o.sendParams=p({},Re),o.sendParams.isAsync=1,o.initFlag=!0,o.initStart=o.performanceNow(),o.staticPerformanceMonitor=new _e({isAsync:1}),o.staticPerformanceMonitor.setup(),o.mpfidMonitor=new Pe({isAsync:1,preLongTaskObserver:o.props.preLongTaskObserver}),o.mpfidMonitor.setup(),t=null!==(e=o.props.TTIMonitor)&&void 0!==e?e:me,o.ttiMonitor=new t({minValue:Math.round(o.performanceNow()),isAsync:1,preLongTaskObserver:o.props.preLongTaskObserver}),o.ttiMonitor.setup(),null!==(t=null===(e=o.fmpMonitor)||void 0===e?void 0:e.setup)&&void 0!==t&&t.call(e,L))},this.getPerformance=function(){return o.finalSendParams.tti||("complete"===document.readyState?o.perfLog():o.perfLog(!0)),o.buildParams(o.finalSendParams)},this.buildParams=function(e){return{name:o.name,type:"post",event:e}},this.perfLog=function(e){if(void 0===e&&(e=!1),P()){if(o.initFlag=!1,o.finalSendParams=p({},o.sendParams),!o.sendParams.isAsync){var t=o.getBounced();if(t)return o.finalSendParams.bounced=t,void o.invokeCallback(0,o.buildParams(o.finalSendParams));o.finalSendParams=p(p({},o.finalSendParams),o.getParams())}var r=o.getStaticResources(),n=o.getFMP(),t=o.getMPFID();r&&(o.finalSendParams.resources=r,o.finalSendParams.has_resource=1),n&&(o.finalSendParams.fmp=Math.round(n)),n&&o.finalSendParams.fcp&&o.finalSendParams.fmp<o.finalSendParams.fcp&&(o.finalSendParams.fmp=o.finalSendParams.fcp),t&&(o.finalSendParams.mpfid=t),d(o.callback)&&(!e&&o.ttiMonitor&&d(o.ttiMonitor.getTTI)?o.ttiMonitor.getTTI(function(e){e&&0<e&&(o.finalSendParams.tti=o.finalSendParams.isAsync?Math.round(e-o.initStart):e),o.invokeCallback(o.finalSendParams.isAsync,o.buildParams(o.finalSendParams))}):o.invokeCallback(o.finalSendParams.isAsync,o.buildParams(o.finalSendParams)))}},this.invokeCallback=function(e,t){if(!e){if(o.hasSentInitPerf)return;o.hasSentInitPerf=!0}o.callback(t)},this.getStaticResources=function(){var e;if(o.staticPerformanceMonitor&&d(o.staticPerformanceMonitor.getResourcePerformance)){var t=o.staticPerformanceMonitor.getResourcePerformance();if(null!==(e=null==t?void 0:t.event)&&void 0!==e&&e.resources)return t.event.resources||[]}},this.getFMP=function(){var e,t;return o.fmpMonitor?(o.fmpMonitor.disconnect(),o.sendParams.isAsync?(null===(e=null==(t=o.fmpMonitor.getFmp())?void 0:t.event)||void 0===e?void 0:e.fmp)||0:d(o.fmpMonitor.getLoadFmp)?1!==o.props.renderType?2===o.props.renderType?o.getPaintTime("first-contentful-paint"):0:null!==(t=null===(t=(t=o.fmpMonitor.getLoadFmp()||{}).event)||void 0===t?void 0:t.fmp)&&void 0!==t?t:0:0):0},this.getMPFID=function(){if(o.mpfidMonitor&&d(o.mpfidMonitor.getMPFID)){var e=o.mpfidMonitor.getMPFID();if(e)return e.mpfid}},this.syncPerfLog=function(){var e,t;o.hasSentInitPerf||(o.perfLog(!0),null!==(t=(e=o.props).report)&&void 0!==t&&t.call(e))},this.hasFID=function(e){o.sendParams.fid=e.fid},this.getParams=function(){if(P()){var e={},t=window.performance.timing;e.dns=t.domainLookupEnd-t.domainLookupStart,e.tcp=t.connectEnd-t.connectStart,e.request=t.responseStart-t.requestStart,e.response=t.responseEnd-t.responseStart,e.processing=t.domComplete-t.domLoading,e.blank=t.responseEnd-t.navigationStart,e.domready=t.domInteractive-t.navigationStart,e.load=t.loadEventEnd-t.navigationStart,t.secureConnectionStart&&(e.ssl=t.connectEnd-t.secureConnectionStart),e.domparse=t.domInteractive-t.responseEnd,e.resource=t.loadEventStart-t.domContentLoadedEventEnd,e.ttfb=t.responseStart-t.requestStart,e.redirect=t.redirectEnd-t.redirectStart;var r=o.getPaintTime("first-paint"),t=o.getPaintTime("first-contentful-paint");r&&(e.fp=Math.round(r)),t&&(e.fcp=Math.round(t));r=function(){if(!M())return null;var e=window.performance.getEntriesByType("navigation");return u(e)&&0!==e.length?e[0]:null}(),t=P()?window.performance.timing:null;return(r||t)&&(e.navigation=null!=r?r:t),t&&(e.timing=t),r&&(e.navigation_timing=r),e}},e.fmpMonitor&&(this.fmpMonitor=e.fmpMonitor);var t=e.performanceAuto;this.performanceAuto=void 0===t||t,this.props=null!=e?e:{}}var Oe="StaticErrorMonitor",qe=(je.prototype.setup=function(e){S()&&(this.callback=e,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},je.prototype.getSrc=function(e){return"link"===e.tagName.toLowerCase()?He(e,"href"):He(e,"src")},je.prototype.getParams=function(e,t){var r={ev_type:"static",st_type:t},t=x(e);r.st_src=e,r.st_protocol=t.protocol,r.st_domain=t.hostname,r.st_path=t.pathname;t=function(e){var t,r=null===(t=null===(n=window.performance)||void 0===n?void 0:n.getEntriesByType)||void 0===t?void 0:t.call(n,"resource"),n=null==r?void 0:r.length;if(!n)return;for(var o=n-1;-1<o;o--){var i=r[o];if(i.name===e)return i}}(t.href);return t&&(r.timing=t),r},je.monitorName=Oe,je);function je(){var i=this;this.name=Oe,this.callback=L,this.buildEvent=function(e){var t,r,n=e||window.event||{};try{r=null!==(t=null!==(t=n.target)&&void 0!==t?t:n.srcElement)&&void 0!==t?t:{}}catch(n){return}var o=r.tagName;if(o&&f(o)){o=o.toLowerCase();e=i.getSrc(r);if(e&&e!==window.location.href)return{name:i.name,type:"get",event:i.getParams(e,o)}}},this.staticErrorLog=function(e){e=i.buildEvent(e);e&&i.callback(e)}}function He(e,t){var r;return e.getAttribute&&d(e.getAttribute)?null!==(r=e.getAttribute(t))&&void 0!==r?r:"":null!==(t=e[t])&&void 0!==t?t:""}var Ae="BreadcrumbMonitor",Ie=(Fe.prototype.setup=function(){this.instrumentDOM()},Fe.prototype.instrumentDOM=function(){var e;"document"in window&&(e=this,window.document.addEventListener("click",e.domEventHandler("click",e.triggerHandlers.bind(e,"dom")),!1),window.document.addEventListener("keypress",e.keypressEventHandler(e.triggerHandlers.bind(e,"dom")),!1))},Fe.prototype.domEventHandler=function(t,r,n){var o=this;return void 0===n&&(n=!1),function(e){o.keypressTimeout=void 0,e&&o.lastCapturedEvent!==e&&(o.lastCapturedEvent=e,o.debounceTimer&&clearTimeout(o.debounceTimer),n?o.debounceTimer=setTimeout(function(){r({event:e,name:t})}):r({event:e,name:t}))}},Fe.prototype.triggerHandlers=function(e,t){if(e)try{this.domBreadcrumb(t)}catch(e){}},Fe.prototype.keypressEventHandler=function(n){var o=this;return function(e){var t;try{t=e.target}catch(e){return}var r=t&&t.tagName;r&&("INPUT"===r||"TEXTAREA"===r||t.isContentEditable)&&(o.keypressTimeout||o.domEventHandler("input",n)(e),clearTimeout(o.keypressTimeout),o.keypressTimeout=window.setTimeout(function(){o.keypressTimeout=void 0},o.debounceDuration))}},Fe.prototype.domBreadcrumb=function(e){var t;try{t=e.event.target?ge(e.event.target):ge(e.event)}catch(e){t="<unknown>"}0!==t.length&&this.addBreadcrumb({category:"ui."+e.name,message:t})},Fe.monitorName=Ae,Fe);function Fe(e){var n=this;this.name=Ae,this.breadcrumbs=[],this.getBreadcrumbs=function(){return n.breadcrumbs},this.addBreadcrumb=function(e){var t=p(p({},e),{timestamp:(new Date).getTime()}),r=n.maxBreadcrumbs,e=n.breadcrumbs;return n.breadcrumbs=0<=r?a(e,[t]).slice(-r):a(e,[t]),n},this.debounceDuration=1e3,this.debounceTimer=0,this.breadcrumbs=[],this.maxBreadcrumbs=null!==(e=null==e?void 0:e.maxBreadcrumbs)&&void 0!==e?e:20}var Be=(De.prototype.sendEvent=function(e){e=this.getEventToBeSent(e);e&&this.idleSendEvent(e)},De.prototype.getEventToBeSent=function(e){e=this._modifyEvent(e);if(this._shouldSend(e))return e},De.prototype._modifyEvent=function(e){return e},De.prototype._shouldSend=function(e){return!0},De.prototype._send=function(e){},De.prototype.idleSendEvent=function(e){this._send(e)},De);function De(){}var Ne={enableCatchGlobalJSError:!0},Je="JSExceptionMonitor",Ue=(Xe.prototype.setup=function(e){S()&&(this.callback=e,this.options.enableCatchGlobalJSError&&(window.addEventListener("error",this.jsErrorLog),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog)))},Xe.prototype.buildEvent=function(e){if(!function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return 1;default:return e instanceof Error}}(e)?(r(e)&&(t={message:JSON.stringify(e)}),f(e)&&(t={message:e})):t=e,t){var t={ev_type:"js_exception",exception:this.normalizeError(t),breadcrumbs:null!==(t=null===(t=this.options.breadcrumbMonitor)||void 0===t?void 0:t.getBreadcrumbs())&&void 0!==t?t:[]};return{name:this.name,type:"post",event:t}}},Xe.prototype.logError=function(e){e=this.buildEvent(e);e&&this.callback(e)},Xe.prototype.getJSError=function(e){e=e.error;if(e)return e},Xe.prototype.getJSPromiseRejection=function(e){var t=void 0;try{"reason"in e?t=e.reason:"detail"in e&&"reason"in e.detail&&(t=e.detail.reason)}catch(e){}if(t)return t},Xe.prototype.normalizeError=function(e){return{message:e.message,name:e.name,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,stack:e.stack,stacktrace:e.stacktrace,framesToPop:e.framesToPop}},Xe.monitorName=Je,Xe);function Xe(e){var t=this;this.name=Je,this.callback=L,this.jsErrorLog=function(e){e=t.getJSError(e);e&&t.logError(e)},this.jsPromiseRejectionLog=function(e){e=t.getJSPromiseRejection(e);e&&t.logError(e)},this.options=p(p({},Ne),e)}var ze,Qe=(e(Ve,ze=Be),Object.defineProperty(Ve.prototype,"ready",{get:function(){return this.isReady},set:function(e){this.isReady=e,this.isReady&&this._uploadQueue()},enumerable:!1,configurable:!0}),Ve.prototype._send=function(e){var t=this,e=this.buildParams(e);null!=e&&(this.reportQueue.push(e),this.isReady&&(this.reportQueue.length>=this.batchReportLength&&this._uploadQueue(),this.batchReportTimeout&&clearTimeout(this.batchReportTimeout),this.batchReportTimeout=setTimeout(function(){t._uploadQueue()},this.batchReportWait)))},Ve.prototype._uploadQueue=function(){var e;this.reportQueue.length&&this.ready&&(e={ev_type:"batch",list:this.reportQueue},this.reportQueue=[],this._request({event:e,type:"post"}))},Ve.prototype._request=function(e){},Ve);function Ve(e){var t,r=ze.call(this)||this;return r.reportQueue=[],r.isReady=!0,r.batchReportLength=null!==(t=e.maxBatchReportLength)&&void 0!==t?t:10,r.batchReportWait=null!==(e=e.batchReportWait)&&void 0!==e?e:1e3,r.batchReportTimeout=null,r}var Ke="RANGERS_WEB_ID";function We(){var e={flags:{hookPath:!0,hookXHR:!0,hookFetch:!0,enableSizeStats:!0,enableFMP:!0,enablePerformance:!0,enableResourcePerformance:!0,enableStaticError:!0,enableCatchJSError:!0,enableCatchGlobalJSError:!0,enableCatchJSErrorV2:!1,enableCrash:!0,enableMemoryRecord:!0,enableFPSJankTimesMonitor:!0,enableBreadcrumb:!0,hookConsole:!1}};return e.monitors={BaseMonitor:{appTypeSetting:{type:0,SPA:"",renderType:0},sampleHit:D(1)},JSErrorMonitor:{enable:!0,webIDHit:!0,sampleRate:1,webIDHitBehavior:!1,sampleHitBehavior:!1,ignoreErrors:[],whitelistUrls:[],blacklistUrls:[],download_link:""},AjaxMonitor:{enable:!0,enableError:!1,webIDHit:!0,sampleHit:D(1),sampleRate:1,sampleHitTrace:!1,ignore:$,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1,webIDHitStaticResource:!1,sampleHitStaticResource:D(G),slowSessionTime:Y,spaSlowSessionTime:Z,geckoUrls:[],interval:0,checkPoint:[]},StaticErrorMonitor:{enable:!0,webIDHit:!0,sampleRate:1,ignore:$},ResourcePerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1},BreadcrumbMonitor:{enable:!0}},e.custom={},e.commonParams={aid:0,pid:"",version:"0.2.14",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:W(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:F(),network_type:B()},e}function Ge(e){e!==function(e,t){var r,n;if(!e||!t)return"";var o=e.split(";"),i={};try{for(var s=v(o),a=s.next();!a.done;a=s.next()){var c=a.value.split("="),u=f(c[0])&&c[0].trim();u&&f(c[1])&&(i[u]=c[1].trim())}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i[t]||""}(document.cookie,Ke)&&(document.cookie=Ke+"="+e+";max-age=7776000;domain="+location.hostname+";path=/")}var $e,Ye,Ze,et,tt=($e="/v2/user/webid",Ye="/v2/user/ssid",Ze="/v2/event/list",et=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(t){[$e,Ye,Ze].forEach(function(e){et.push(t+e)})}),et);function rt(e){var t=e.sendParams,r=e.monitorsSetting;if(!t||!c(t)||!t.event)return!1;var n,o,e=r;if("AjaxMonitor"===t.name||"FetchMonitor"===t.name){r=A(a(["/monitor_browser/collect"],tt)||[]);if(r&&r.test(t.event.ax_url))return!1}return!(null==e||!e.BaseMonitor.sampleHit)&&("AjaxMonitor"===t.name||"FetchMonitor"===t.name?function(e){var r=e.sendParams,t=e.ajaxMonitor;if(!t)return!0;if("2"!==r.event.ax_status[0]&&"3"!==r.event.ax_status[0])return t.enableError;if(!t.enable)return!1;if(!t.webIDHit)return!1;if(!t.sampleHit||!D(t.sampleRate))return!1;if(u(e=t.whitelistUrls)&&0<e.length){var n=A(t.whitelistUrls||[]);return n&&n.test(r.event.ax_url)?!0:!1}if((n=A(t.ignore||[]))&&n.test(r.event.ax_url))return!1;if((n=t.statusCodeSample)&&l(n,r.event.ax_status))return D(n[r.event.ax_status]);if(t=t.requestUrlSample){var o=!1,i=!1;if(t.forEach(function(e){var t;o||null!=(t=A([e.url]))&&t.test(r.event.ax_url)&&(o=!0,i=D(e.sampleRate))}),o)return i}return!0}({sendParams:t,ajaxMonitor:e.AjaxMonitor}):"PerformanceMonitor"===t.name?!(n=(n={performanceMonitor:e.PerformanceMonitor}).performanceMonitor)||!!n.enable&&(!!n.webIDHit&&!!D(n.sampleRate)):"StaticErrorMonitor"===t.name?(n={sendParams:t,staticErrorMonitor:e.StaticErrorMonitor},o=n.sendParams,!(n=n.staticErrorMonitor)||!!n.enable&&(!!n.webIDHit&&(!!D(n.sampleRate)&&(!(n=A(n.ignore||[]))||!n.test(o.event.st_src))))):"JSExceptionMonitor"===t.name?!(o=(o={jsErrorMonitor:e.JSErrorMonitor}).jsErrorMonitor)||!!o.enable&&(!!o.webIDHit&&!!D(o.sampleRate)):"ResourcePerformanceMonitor"!==t.name||(!(e=(e={resourcePerformanceMonitor:e.ResourcePerformanceMonitor}).resourcePerformanceMonitor)||!!e.enable&&(!!e.webIDHit&&!!D(e.sampleRate))))}function nt(e){var t=e.sendParams,r=e.commonParams,n=e.custom,e=e.breadcrumbMonitor,e=function(e){var t=e.sendParams,r=e.commonParams,n=e.breadcrumbMonitor;if((e={}).ev_type=t.event.ev_type,e.common=r,"PageViewMonitor"===t.name&&e)return e;if(("AjaxMonitor"===t.name||"FetchMonitor"===t.name)&&e){var o=t.event,o=(o.ev_type,s(o,["ev_type"]));return e.event=o,e}if("PerformanceMonitor"===t.name&&e){t.event.navigation=t.event.navigation_timing;o=t.event,o=(o.ev_type,s(o,["ev_type"]));return e.ev_type="performance",e.event={fp:o.fp,fcp:o.fcp,fmp:o.fmp,tti:o.tti,fid:o.fid,mpfid:o.mpfid,isAsync:o.isAsync,timing:o.timing,navigation:o.navigation_timing,bounced:o.bounced},e}if("StaticErrorMonitor"===t.name&&e){e.ev_type="resource_error";var i=t.event,i=(i.ev_type,s(i,["ev_type"]));return e.event=i,e}if("ResourcePerformanceMonitor"===t.name&&e){e.ev_type="resource";i=t.event,i=(i.ev_type,s(i,["ev_type"]));return e.event=i,e}if("JSExceptionMonitor"===t.name&&e){e.ev_type="js_error";t=t.event,t=(t.ev_type,s(t,["ev_type"]));return e.event=t.exception,e.breadcrumbs=null!==(n=null==n?void 0:n.getBreadcrumbs())&&void 0!==n?n:[],e}return e}({sendParams:t,commonParams:p(p({},null!=r?r:{}),{url:window.location.href}),breadcrumbMonitor:e});return n&&d(n.beforeSend)&&(e=n.beforeSend(e||{})),e}function ot(){return"https://tbm.snssdk.com/monitor_browser/collect"}var it,st=(e(at,it=Qe),at.prototype._shouldSend=function(e){return rt({sendParams:e,monitorsSetting:this.options.monitorsSetting})},at.prototype._modifyEvent=function(e){return(e=(e={sendParams:e}).sendParams)&&c(e)?e:{}},at.prototype._request=function(e){var t,r;e&&e.event&&(t=e.type,r=e.event,"beacon"===this.options.reportType&&navigator&&navigator.sendBeacon?(e=JSON.stringify(r),navigator.sendBeacon(this.getReportURL(),e)):this.transport&&("get"!==t?"post"===t&&this.transport.postEvent(r):this.transport.getEvent(r)))},at.prototype.buildParams=function(e){var t,r=null===(t=null===(t=this.options.monitorsSetting)||void 0===t?void 0:t.BreadcrumbMonitor)||void 0===t||!t.enable||null===(r=this.options.monitors)||void 0===r?void 0:r.BreadcrumbMonitor;return nt({sendParams:e,commonParams:this.options.commonParams,custom:this.options.custom,breadcrumbMonitor:r})},at.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},at.prototype.getBatchReportURL=ot,at);function at(e){var o=it.call(this,e)||this;return o.options={},o.setTransport=function(){o.transport=new N({reportURL:o.getReportURL()}),o.preQueue.forEach(function(e){it.prototype.sendEvent.call(o,e)})},o.updateConfig=function(e){var t,r,n;o.options=(t={previousOptions:o.options,newOptions:e},r=t.previousOptions,n=t.newOptions,(e=p(p({},r),n)).commonParams=i({},null!==(t=r.commonParams)&&void 0!==t?t:{},null!==(t=n.commonParams)&&void 0!==t?t:{}),e.monitorsSetting=i({},null!==(t=r.monitorsSetting)&&void 0!==t?t:{},null!==(t=n.monitorsSetting)&&void 0!==t?t:{}),e.monitors=p(p({},null!==(t=r.monitors)&&void 0!==t?t:{}),null!==(t=n.monitors)&&void 0!==t?t:{}),e.custom=p(p({},null!==(r=r.custom)&&void 0!==r?r:{}),null!==(n=n.custom)&&void 0!==n?n:{}),e)},o.sendEvent=function(e){o.transport?it.prototype.sendEvent.call(o,e):o.preQueue.push(e)},o.uploadQueue=function(){o._uploadQueue()},o.reportURL=null!==(e=null==e?void 0:e.reportURL)&&void 0!==e?e:"",o.preQueue=[],o}ct.prototype.getUserIDFromRangers=function(t){window.collectEvent&&d(window.collectEvent)&&window.collectEvent("getToken",function(e){t(e)})},ct.prototype.init=function(e){var t=this;this.client=new st(this.getClientOptions(e)),this.getUserIDFromRangers(function(e){e=t.normalizeSetting({user_unique_id:e.user_unique_id});t.client.updateConfig(t.getClientOptions(e))}),this.sendPageview();e=this.setMonitors();this.setupMonitors(e),this.setServerSetting()},ct.prototype.setServerSetting=function(){var e,r=this,t=this.serverSetting;t?(e=this.normalizeServerSetting(t),this.updateSetting(e)):(e="https://tbm.snssdk.com/settings/get/web?aid="+this.baseSetting.commonParams.aid,N.get(e,{success:function(e){try{r.serverSetting=e.data;var t=r.normalizeServerSetting(r.serverSetting);r.updateSetting(t)}catch(e){r.updateSetting(r.baseSetting)}},fail:function(){r.updateSetting(r.baseSetting)}}))},ct.prototype.updateSetting=function(e){this.client.updateConfig(this.getClientOptions(e)),this.client.setTransport()},ct.prototype.getClientOptions=function(e){return{monitorsSetting:e.monitors,commonParams:e.commonParams,custom:e.custom}},ct.prototype.setMonitors=function(){var e=[],t=this.baseSetting.flags,r=new ce;return e.push(r),t.enableCatchJSError&&e.push(new Ue),t.hookXHR&&e.push(new te({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),t.hookFetch&&e.push(new ie({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),t.enableStaticError&&e.push(new qe),t.enablePerformance&&(t.enableFMP?e.push(new Ce({fmpMonitor:r,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):e.push(new Ce({renderType:1,preLongTaskObserver:{precollect:(null===(r=window.RangersSiteSDK.lt)||void 0===r?void 0:r.e)||[],observer:null===(r=window.RangersSiteSDK.lt)||void 0===r?void 0:r.o}}))),t.enableBreadcrumb&&e.push(new Ie),t.enableResourcePerformance&&e.push(new _e({observe:!0,checkIgnore:function(e){return e.name===ot()||("xmlhttprequest"===e.initiatorType||"fetch"===e.initiatorType||"beacon"===e.initiatorType||"navigation"===e.initiatorType||0===e.decodedBodySize)}})),e},ct.prototype.setupMonitors=function(e){var t=this;this.client&&this.client.sendEvent&&(e.forEach(function(e){"FMPMonitor"===(t.monitors[e.name]=e).name?e.setup(L):e.setup(null===(e=t.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},ct.prototype.normalizeServerSetting=function(e){var e=(t=e,r=i({JSErrorMonitor:{},AjaxMonitor:{},PerformanceMonitor:{},StaticErrorMonitor:{},BaseMonitor:{},ResourcePerformanceMonitor:{}},r=this.defaultSetting.monitors),(t=t.setting).jserr&&(r.JSErrorMonitor.enable=t.jserr.enable,r.JSErrorMonitor.webIDHit=D(t.jserr.enable_user_rate),r.JSErrorMonitor.sampleRate=t.jserr.enable_sample_rate),t.performance&&(r.PerformanceMonitor.enable=t.performance.enable,r.PerformanceMonitor.webIDHit=D(t.performance.enable_user_rate),r.PerformanceMonitor.sampleRate=t.performance.enable_sample_rate),t.breadcrumb&&(r.BreadcrumbMonitor.enable=t.breadcrumb.enable),t.static_resource_error&&(r.StaticErrorMonitor.enable=t.static_resource_error.enable),t.static_resource&&(r.ResourcePerformanceMonitor.enable=t.static_resource.enable,r.ResourcePerformanceMonitor.webIDHit=D(t.static_resource.enable_user_rate),r.ResourcePerformanceMonitor.sampleRate=t.static_resource.enable_sample_rate),t.request&&(r.AjaxMonitor.enable=t.request.enable,r.AjaxMonitor.enableError=t.request.enableError,r.AjaxMonitor.webIDHit=D(t.request.enable_user_rate),r.AjaxMonitor.sampleRate=t.request.enable_sample_rate),r),t={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(this.userSetting),monitors:e,custom:this.getClientCustom(this.userSetting)},r={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(this.userSetting),monitors:this.getClientMonitorsSetting(this.userSetting),custom:this.getClientCustom(this.userSetting)},e=this.baseSetting;return this.baseSetting=i({},this.baseSetting,t,r),this.baseSetting.commonParams.pid=this.baseSetting.commonParams.pid||location.pathname,this.settingEffect(this.baseSetting,e),this.baseSetting},ct.prototype.normalizeSetting=function(e){var t={commonParams:this.getClientCommonParams(e),flags:this.getClientFlags(e),monitors:this.getClientMonitorsSetting(e),custom:this.getClientCustom(e)},r={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(this.userSetting),monitors:this.getClientMonitorsSetting(this.userSetting),custom:this.getClientCustom(this.userSetting)},e=this.baseSetting;return this.baseSetting=i({},this.baseSetting,t,r),this.baseSetting.commonParams.pid=this.baseSetting.commonParams.pid||location.pathname,this.settingEffect(this.baseSetting,e),this.baseSetting},ct.prototype.settingEffect=function(e,t){Ge(e.commonParams.rangers_web_id),t.commonParams.pid!==e.commonParams.pid&&this.sendPageview()},ct.prototype.sendPageview=function(){var e;null!==(e=this.client)&&void 0!==e&&e.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},ct.prototype.getClientCommonParams=function(r){void 0===r&&(r={});var n={};if(!c(r))return n;var o=["context","pid"];t(r,function(e,t){b(o,e)&&(n[e]=t)});return t({user_unique_id:"rangers_web_id",app_id:"aid"},function(e,t){l(r,e)&&(n[t]=r[e])}),n},ct.prototype.getClientFlags=function(e){void 0===e&&(e={});var r={};if(!c(e))return r;var n=["hookPath","hookXHR","hookFetch","enableSizeStats","enableFMP","enablePerformance","enableStaticError","enableCatchJSError","enableCatchJSErrorV2","enableCatchGlobalJSError","enableResourcePerformance","enableCrash","enableMemoryRecord","enableFPSJankTimesMonitor","enableBreadcrumb","hookConsole"];return t(e,function(e,t){b(n,e)&&(r[e]=t)}),r},ct.prototype.getClientCustom=function(e){var t={};return e.beforeSend&&d(e.beforeSend)&&(t.beforeSend=e.beforeSend),t},ct.prototype.getClientMonitorsSetting=function(e){return e=(t={setting:e}).setting,t=i({JSErrorMonitor:{},AjaxMonitor:{},PerformanceMonitor:{},StaticErrorMonitor:{},ResourcePerformanceMonitor:{},BaseMonitor:{appTypeSetting:{}}},{}),e.ajaxWhitelistUrls&&u(e.ajaxWhitelistUrls)&&(t.AjaxMonitor.whitelistUrls=(t.AjaxMonitor.whitelistUrls||[]).concat(e.ajaxWhitelistUrls)),e.ignoreAjax&&u(e.ignoreAjax)&&(t.AjaxMonitor.ignore=(t.AjaxMonitor.ignore||[]).concat(e.ignoreAjax)),e.ignoreStatic&&u(e.ignoreStatic)&&(t.StaticErrorMonitor.ignore=(t.StaticErrorMonitor.ignore||[]).concat(e.ignoreStatic)),e.ignoreErrors&&u(e.ignoreErrors)&&(t.JSErrorMonitor.ignoreErrors=e.ignoreErrors),e.errorBlacklistUrls&&u(e.errorBlacklistUrls)&&(t.JSErrorMonitor.blacklistUrls=e.errorBlacklistUrls),e.errorWhitelistUrls&&u(e.errorWhitelistUrls)&&(t.JSErrorMonitor.whitelistUrls=e.errorWhitelistUrls),l(e,"sampleRate")&&(t.BaseMonitor.sampleHit=D(e.sampleRate)),t;var t},Be=ct;function ct(){var n=this;this.version="0.2.14",this.instance=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];"config"!==t[0]?n.client&&("report"!==t[0]?n.onClose():null!==(e=n.client)&&void 0!==e&&e.uploadQueue()):c(t[1])&&(e=t[1],n.userSetting=p(p({},n.userSetting||{}),e||{}),e=n.normalizeSetting(e),n.client?n.client.updateConfig(n.getClientOptions(e)):n.init(e))},this.changeReortType=function(e){var t;null!==(t=n.client)&&void 0!==t&&t.updateConfig({reportType:e})},this.onClose=function(){I(n.onCloseReport,n.visibilityChange)},this.visibilityChange=function(){"hidden"===document.visibilityState&&n.onCloseReport(),"visible"===document.visibilityState&&n.changeReortType("xhr")},this.onCloseReport=function(){var e;n.changeReortType("beacon"),null!==(e=n.client)&&void 0!==e&&e.uploadQueue()},this.defaultSetting=We(),this.baseSetting=this.defaultSetting,this.client=void 0,this.serverSetting=void 0,this.userSetting={},this.monitors={}}var ut=L;return S()&&(Qe=new Be,ut=Qe.instance,null!==(Be=window.RangersSiteSDK)&&void 0!==Be&&Be.q&&(u(Be=window.RangersSiteSDK.q)&&Be.forEach(function(e){ut.apply(void 0,a(e))}),delete window.RangersSiteSDK.q),window.RangersSiteSDK=Qe.instance),ut}();
var RangersSiteSDK=function(){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function e(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function s(e,t){var r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function a(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}function c(e){return"object"==typeof e&&null!==e&&!u(e)}function r(e){return"[object Object]"===(e=e,Object.prototype.toString.call(e))}function d(e){return"function"==typeof e}function f(e){return"[object String]"===Object.prototype.toString.call(e)}function u(e){return"[object Array]"===Object.prototype.toString.call(e)}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function t(e,t){if(c(e))for(var r in e)l(e,r)&&t.call(null,r,e[r])}function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r={},n=0;n<e.length;)r=g(r,e[n]),n++;return r}var o=Object.getPrototypeOf?Object.getPrototypeOf({}):null;function m(e){return Object.getPrototypeOf?Object.getPrototypeOf(e)===o:e.constructor===Object}function g(e,t){var r,n=p({},e);for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&void 0!==t[r]&&(c(t[r])&&m(t[r])?n[r]=g(c(e[r])?e[r]:{},t[r]):u(e[r])||u(t[r])?n[r]=function t(e,r){var e=u(e)?e:[];var r=u(r)?r:[];return Array.prototype.concat.call(e,r).map(function(e){return!(e instanceof RegExp)&&(u(e)||c(e)&&m(e))?u(e)?t([],e):g({},e):e})}(e[r],t[r]):n[r]=t[r]);return n}function b(e,t){if(!u(e))return!1;if(0===e.length)return!1;for(var r=0;r<e.length;){if(e[r]===t)return!0;r++}return!1}function y(){if("fetch"in window)try{return new Headers,new Request(""),new Response,1}catch(e){return}}function S(){return!!c(window)}function w(){return S()&&!!c(window.performance)}function P(){return w()&&!!c(window.performance.timing)}function M(){return!!w()&&!!d(window.performance.getEntries)}function T(){return S()&&"function"==typeof window.MutationObserver}function E(){return S()&&"function"==typeof window.PerformanceObserver}function _(){return!!E()&&d(window.PerformanceLongTaskTiming)}function k(){if(!E())return!1;var e=window.PerformanceObserverEntryList;return d(e)&&d(e.prototype.getEntries)}function R(e){var r,e=function(e){if(!c(e))return{};var r={};return t(e,function(e,t){c(t)||u(t)?r[e]=JSON.stringify(t):r[e]=t}),r}(e),e=(r={},t(e,function(e,t){r[encodeURIComponent(e)]=encodeURIComponent(t)}),r),n=[];return t(e,function(e,t){n.push(e+"="+t)}),n.join("&")}function x(e){var t=document.createElement("a");t.href=e;e=t.pathname||"/";return"/"!==e[0]&&(e="/"+e),{href:t.href,protocol:t.protocol.slice(0,-1),hostname:t.hostname,host:t.host,search:t.search,pathname:e,hash:t.hash}}var C=function(e){if(!f(e))return!1;return d(e.toLowerCase)&&(e=e.toLowerCase()),b(["x-tt-token"],e)};function L(){}function O(e){var t="[object String]"===Object.prototype.toString.call(e);return e?t?e.length:ArrayBuffer&&e instanceof ArrayBuffer?e.byteLength:window.Blob&&e instanceof Blob?e.size:e.length||0:0}function q(e){if(!e)return"";if(!d(e.forEach))return"";var r=[];return e.forEach(function(e){var t;u(e)&&e[0]&&!C(e[0])&&(t=e[0],e=e[1]||"",r.push(t+": "+e))}),r.join("\r\n")}function j(e){var t={},r=x(e);return t.ax_protocol=r.protocol,t.ax_domain=r.hostname,t.ax_path=r.pathname,t.ax_url=(r.href||e).split("?")[0],t}function H(e,t){e=x(e),t=x(t);return e.protocol===t.protocol&&e.host===t.host}function A(e){return u(e)&&e.length?function(e){for(var t=[],r=e.length,n=0;n<r;n++){var o=e[n];f(o)?t.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&t.push(o.source)}return new RegExp(t.join("|"),"i")}(e):null}function I(t,r){d(t)&&(d(window.addEventListener)&&(window.addEventListener("unload",t),window.addEventListener("beforeunload",t),window.addEventListener("pagehide",t)),d(document.addEventListener)&&document.addEventListener("visibilitychange",function(e){d(r)?r(e):"hidden"===document.visibilityState&&t(e)}))}var D=function(e){var t,r;return void 0===e&&(e=window),S()&&null!==(t=e.screen)&&void 0!==t&&t.width&&null!==(r=e.screen)&&void 0!==r&&r.height?e.screen.width+"x"+e.screen.height:"0x0"},F=function(){var e="unknown",t=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return t&&f(t.effectiveType)?t.effectiveType:e};function B(e){return!!e&&Math.random()<Number(e)}var N=(J.post=function(e,t,r){var n,o=null!==(n=null==r?void 0:r.success)&&void 0!==n?n:L,i=null!==(r=null==r?void 0:r.fail)&&void 0!==r?r:L,r=new XMLHttpRequest;r.open("POST",e,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify(t)),r.onload=function(){try{var e;this.responseText?(e=JSON.parse(this.responseText),o(e)):o({})}catch(e){i()}},r.onerror=function(){i()},r.onabort=function(){i()}},J.get=function(e,t){var r,n=null!==(r=null==t?void 0:t.success)&&void 0!==r?r:L,o=null!==(r=null==t?void 0:t.fail)&&void 0!==r?r:L,i=null!==(r=null==t?void 0:t.getResponse)&&void 0!==r?r:L,s=null!==(t=null==t?void 0:t.getResponseText)&&void 0!==t?t:L,t=new XMLHttpRequest;t.open("GET",e),t.send(),t.onload=function(){i(null==this?void 0:this.response),s(this.responseText);try{var e;this.responseText?(e=JSON.parse(this.responseText),n(e)):n({})}catch(e){o()}},t.onerror=function(){o()},t.onabort=function(){o()}},J.prototype.getCommonParams=function(){return{timestamp:Date.now()}},J);function J(e){var t=this;this.postEvent=function(e){e=p(p({},e),t.getCommonParams());J.post(t.url,e)},this.getEvent=function(e){e=R(p(p({},e),t.getCommonParams())),e=t.url+"?"+e;J.get(e)},this.getURL=function(){return t.url},this.options=e,this.url=this.options.reportURL}function U(e,t,r){if(void 0===r&&(r="0"),1<r.length)throw new TypeError("expect the length of pad to be 1, but got "+e.length);return e.length>=t?e:""+Array.from({length:t-e.length}).fill(r).join("")+e}function X(e){return e?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,e):""}var z="x-tt-trace-id",Q="x-tt-trace-host",V="x-tt-logid";function K(e,t,r){void 0===r&&(r="01");t=""+U((Date.now()%4294967295).toString(16),8)+function(e){if("number"==typeof e)r=e;else{var t=e.replace(/-/g,"");if(!/^[0-9]+$/.test(t)){if(18<t.length)return"18"+X(18);e=22-t.length-4;return""+U(""+t.length,2)+t+X(e)}r=parseInt(t,10)}var r=22-(t=r.toString(16)).length-4;return""+U(""+t.length,2)+t+X(r)}(e)+("string"==typeof t?X(4):U(t.toString(16),4));return"00-"+t+"-"+t.substr(0,16)+"-"+r}function W(){var e=function(){for(var e=new Array(16),t=0,r=0;r<16;r++)0==(3&r)&&(t=4294967296*Math.random()),e[r]=t>>>((3&r)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);var n=0;return[t[e[n++]],t[e[n++]],t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],t[e[n++]],t[e[n++]],t[e[+n]],t[e[15]]].join("")}(e)}var G=.1,$=["/log/sentry/"],Y=8e3,Z=4e3;W(),W();var ee="AjaxMonitor",te=(re.prototype.setup=function(e){void 0===e&&(e=L),d(XMLHttpRequest)&&(this.callback=e,this.start())},re.prototype.updateConfig=function(e){this.props=i({},this.props,e)},re.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},re.prototype.hookXMLHttpRequestSetRequestHeader=function(){var r=XMLHttpRequest.prototype.setRequestHeader||L;XMLHttpRequest.prototype.setRequestHeader=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._requestHeaders=this._requestHeaders||[],this._requestHeaders.push(e),r.apply(this,e)}},re.prototype.hookXMLHttpRequestOpen=function(){var o=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=e[1];return this._url=n||"",this._method=(null==r?void 0:r.toLowerCase())||"",o.apply(this,e)}},re.prototype.hookXMLHttpRequestSend=function(){var o=this,i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(){for(var e,t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return o.checkAddTrace(this._url)&&(e=(t=null!==(e=null==o?void 0:o.props.commonParams)&&void 0!==e?e:{}).bid,t=t.web_id,e&&t&&(o.traceId=K(t,e),this.setRequestHeader(z,o.traceId))),o.hookXMLHttpRequestOnreadystatechange.call(this,o),this._start=Date.now(),this._data=null==r?void 0:r[0],i.apply(this,r)}},re.prototype.checkAddTrace=function(e){var t=null!==(n=this.props.commonParams)&&void 0!==n?n:{},r=t.bid,n=t.web_id,t=(null!==(t=this.props.ajaxMonitorOptions)&&void 0!==t?t:{}).sampleHitTrace,e=H(location.href,e);return r&&n&&t&&e},re.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},re.prototype.hookXMLHttpRequestOnreadystatechange=function(i){var s=this.onreadystatechange,a=this;this.onreadystatechange=function(){for(var e,t,r,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(4===this.readyState&&(t={ev_type:"ajax",ax_status:(this.status||0).toString(),ax_type:a._method,ax_request_header:q(a._requestHeaders||[]),ax_domain:"",ax_duration:0,ax_path:"",ax_protocol:"",ax_response_header:"",ax_size:0,ax_url:""},"function"==typeof this.getAllResponseHeaders&&(t.ax_response_header=function(t){if(f(t)){var e=t.split("\r\n"),r=[];return e.forEach(function(e,t){e&&d(e.split)&&(e=e.split(": "),r.push([e[0],e[1]]))}),q(r)}return c(t)?q(Object.keys(t).map(function(e){return[e,t[e]]})):t}(this.getAllResponseHeaders())),!i.checkAddTrace(a._url)||(r=null!==(r=i.traceId)&&void 0!==r?r:this.getResponseHeader(z))&&(t.trace_id=r,t.trace_host=null!==(e=this.getResponseHeader(Q))&&void 0!==e?e:void 0,t.log_id=null!==(e=this.getResponseHeader(V))&&void 0!==e?e:void 0),t.ax_duration=Date.now()-a._start,200===this.status&&(t.ax_size=function(e){var t=0;if(""===e.responseType||"text"===e.responseType)t=O(e.responseText);else if(e.response)t=O(e.response);else try{t=O(e.responseText)}catch(e){t=0}return t}(this)),t=p(p({},t),j(a._url)),i.collectErrorRequest()&&"2"!==t.ax_status[0]&&"3"!==t.ax_status[0]&&(t.ax_request={body:a._data?""+a._data:void 0,search:null===(e=x(a._url))||void 0===e?void 0:e.search,content_type:null===(e=null===(e=a._requestHeaders)||void 0===e?void 0:e.find(function(e){return"content-type"===e[0].toLowerCase()}))||void 0===e?void 0:e[1]}),d(i.callback)&&i.callback({name:i.name,type:"get",event:t})),s)return s.apply(this,n)}},re.monitorName=ee,re);function re(e){this.name=ee,this.callback=L,this.traceId=null,this.props=e}function ne(e){return e instanceof Request}var oe="FetchMonitor",ie=(se.prototype.updateConfig=function(e){this.props=i({},this.props,e)},se.prototype.setup=function(e){void 0===e&&(e=L),y()&&(this.callback=e,this.start())},se.prototype.start=function(){y()&&this.hookFetch()},se.prototype.checkAddTrace=function(e){var t=null!==(n=null===(r=this.props)||void 0===r?void 0:r.commonParams)&&void 0!==n?n:{},r=t.bid,n=t.web_id,t=(null!==(t=null===(t=null==this?void 0:this.props)||void 0===t?void 0:t.ajaxMonitorOptions)&&void 0!==t?t:{}).sampleHitTrace,e=H(location.href,e);return r&&n&&t&&e},se.prototype.updateAxRequest=function(e,t,r){var n,o;this.collectErrorRequest()&&"2"!==e.ax_status[0]&&"3"!==e.ax_status[0]&&(o=this.getFetchUrl(t,!0),e.ax_request={body:null===(t=this.getFetchBody(t,r))||void 0===t?void 0:t.toString(),search:!f(o)||null===(n=x(o))||void 0===n?void 0:n.search,content_type:null===(r=null==r?void 0:r.headers)||void 0===r?void 0:r["Content-Type"]})},se.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},se.prototype.hookFetch=function(){var c=this,u=this,l=window.fetch;window.fetch=function(n,o){void 0===o&&(o={});var i=c.getFetchUrl(n);if(!function(e){if(f(e)){var t=h(e.split(":"),2),e=t[0];return!t[1]||("http"===e||"https"===e)}}(i))return l(n,o);var e=null!==(e=c.props.commonParams)&&void 0!==e?e:{},t=e.bid,r=e.web_id,s=Date.now(),a={ev_type:"ajax"};try{u.checkAddTrace(i)&&(o.headers=new Headers(function(e,t){var r=new Headers;ne(e)&&e.headers&&d(e.headers.forEach)&&e.headers.forEach(function(e,t){r.append(t,e)});t.headers&&new Headers(t.headers).forEach(function(e,t){r.append(t,e)});return r}(n,o)),t&&r&&(a.trace_id=K(t,r),o.headers.append(z,a.trace_id)))}catch(e){}return a.ax_type=c.getFetchMethod(n,o),a=p(p({},a),j(i)),l(n,o).then(function(e){var t,r;return a.ax_status=(e.status||0).toString(),a.ax_duration=Date.now()-s,a.ax_response_header=u.getAllHeaders(e.headers),a.ax_request_header=u.getAllHeaders(o.headers),e.headers&&d(e.headers.has)?(e.headers.has("content-length")?a.ax_size=Number(e.headers.get("content-length"))||0:a.ax_size=0,u.checkAddTrace(i)&&(e.headers.has(Q)&&(a.trace_host=null!==(t=e.headers.get(Q))&&void 0!==t?t:void 0),e.headers.has(z)&&(a.trace_id=null!==(r=e.headers.get(z))&&void 0!==r?r:void 0),e.headers.has(V)&&(a.log_id=null!==(r=e.headers.get(V))&&void 0!==r?r:void 0))):a.ax_size=0,c.updateAxRequest(a,n,o),d(u.callback)&&u.callback({name:u.name,type:"get",event:a}),e},function(e){return a.ax_status="0",a.ax_size=0,a.ax_duration=Date.now()-s,c.updateAxRequest(a,n,o),d(u.callback)&&u.callback({name:u.name,type:"get",event:a}),Promise.reject(e)})}},se.prototype.getFetchUrl=function(e,t){void 0===t&&(t=!1);var r="",r=ne(e)?e.url:e;return t||(r=f(r)?r.split("?")[0]:r),r},se.prototype.getFetchMethod=function(e,t){t=null!==(t=null==t?void 0:t.method)&&void 0!==t?t:"get";return ne(e)&&(t=null!==(e=e.method)&&void 0!==e?e:t),t.toLowerCase()},se.prototype.getFetchBody=function(e,t){return ne(e)?e.body:null==t?void 0:t.body},se.prototype.getAllHeaders=function(e){if(!e||"function"!=typeof e.forEach)return"";var r=[];return e.forEach(function(e,t){r.push([t,e])}),q(r)},se.monitorName=oe,se);function se(e){this.name=oe,this.callback=L,this.props=e}var ae="FMPMonitor",ce=(ue.prototype.setup=function(e){if(S())return T()?void(d(document.querySelector)&&(this.callback=e&&d(e)?e:function(){},this.startTime=Date.now(),this.list=[],d(this.observer.observe)&&this.observer.observe(document,{childList:!0,subtree:!0}))):null},ue.prototype.count=function(){var e=Date.now()-this.startTime,t=document.querySelector("body");t?this.list.push({score:this.score(t,1,!1),time:e}):this.list.push({score:0,time:e})},ue.prototype.score=function(e,t,r){var n=0,o=e.tagName;if("SCRIPT"!==o&&"STYLE"!==o&&"META"!==o&&"HEAD"!==o){o=e.children?e.children.length:0;if(0<o)for(var i=e.children,s=o-1;0<=s;s--)n+=this.score(i[s],t+1,0<n);if(n<=0&&!r){if(!e.getBoundingClientRect||!d(e.getBoundingClientRect))return 0;e=e.getBoundingClientRect();if(!e)return 0;if(e.top>window.innerHeight)return 0;if(e.height<=0)return 0}n+=1+.5*t}return n},ue.prototype.getFmpInternal=function(){if(!this.observer)return 0;if(this.disconnect(),!this.list.length)return 0;for(var e,t={time:this.list[0].time,rate:0},r=1;r<this.list.length;r++)this.list[r].time>=this.list[r-1].time&&(e=this.list[r].score-this.list[r-1].score,t.rate<e&&(t={time:this.list[r].time,rate:e}));return t.time},ue.prototype.getTimeGap=function(){return P()?this.startTime-performance.timing.navigationStart:0},ue.prototype.formatEvent=function(e){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:e}}},ue.monitorName=ae,ue);function ue(){var r=this;this.name=ae,this.callback=L,this.disconnect=function(){var e,t;null!==(t=null===(e=r.observer)||void 0===e?void 0:e.disconnect)&&void 0!==t&&t.call(e)},this.getLoadFmp=function(){var e=r.getFmpInternal(),e=e?r.getTimeGap()+e:0,e=r.formatEvent(e);return r.callback(e),e},this.getFmp=function(){var e=r.getFmpInternal(),e=r.formatEvent(e);return r.callback(e),e},this.startTime=Date.now(),this.list=[],this.observer=new MutationObserver(this.count.bind(this))}function le(){}var pe=!1,he=!1,de={uniqueId:0,originals:{},proxies:{},patchXMLHTTPRequest:function(i){this.originals.send=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.send=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=de.uniqueId++;i.beforeCb(n);var o=this.onreadystatechange;return this.onreadystatechange=function(e){null!=o&&o.call(t,e),4===t.readyState&&i.afterCb(n)},de.originals.send.apply(this,e)},this.proxies.send=XMLHttpRequest.prototype.send},patchFetch:function(o){var i;y()&&(i=window.fetch,this.originals.fetch=i,window.fetch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new Promise(function(t,r){var n=de.uniqueId++;o.beforeCb(n),i.apply(void 0,a(e)).then(function(e){o.afterCb(n),t(e)},function(e){o.afterCb(n,e),r(e)})})},this.proxies.fetch=window.fetch)},observeResourceFetchingMutations:function(s){if(T()){var a=["img","script","iframe","link","audio","video","source"],e=new MutationObserver(function(e){var t,r;try{for(var n=v(e),o=n.next();!o.done;o=n.next()){var i=o.value;("childList"===i.type&&function e(t,r){var n,o;try{for(var i=v(t),s=i.next();!s.done;s=i.next()){var a=s.value;if(r.includes(a.nodeName.toLowerCase())||a.children&&e(a.children,r))return 1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}}(i.addedNodes,a)||"attributes"===i.type&&a.includes(i.target.nodeName.toLowerCase()))&&s(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}});return e.observe(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]}),e}},resetOriginals:function(){this.originals.send&&XMLHttpRequest.prototype.send===this.proxies.send&&(pe=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(he=!1,window.fetch=this.originals.fetch)}},fe="TTIMonitor",me=(ve.prototype.setup=function(){},ve.prototype.isEnable=function(){return _()&&!!E()&&d(window.PerformanceResourceTiming)&&k()},ve.prototype.registerPerformanceObserver=function(){var a=this;this.performanceObserver=new PerformanceObserver(function(e){var t,r,n=e.getEntries();try{for(var o=v(n),i=o.next();!i.done;i=o.next()){var s=i.value;"resource"===s.entryType&&a.networkRequestFinishedCallback(s),"longtask"===s.entryType&&a.longTaskFinishedCallback(s)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}});try{this.performanceObserver.observe({type:"longtask"}),this.performanceObserver.observe({type:"resource",buffered:!0})}catch(e){this.performanceObserver.observe({entryTypes:["longtask","resource"]})}},ve.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),de.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=le,this.proxyConfig.afterCb=le)},ve.prototype.rescheduleTimer=function(e){var t=this;this.scheduleTimerTasks&&(this.timerActivationTime>e||(clearTimeout(this.timerId),this.timerId=window.setTimeout(function(){t.checkTTI()},e-performance.now()),this.timerActivationTime=e))},ve.prototype.startSchedulingTimerTasks=function(){this.scheduleTimerTasks=!0;var e=0<this.longTasks.length?this.longTasks[this.longTasks.length-1].end:0,t=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests);this.rescheduleTimer(Math.max(t+5e3,e))},ve.prototype.registerListeners=function(){pe||(de.patchXMLHTTPRequest(this.proxyConfig),pe=!0),he||(de.patchFetch(this.proxyConfig),he=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=de.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},ve.prototype.mutationObserverCallback=function(e){this.rescheduleTimer(performance.now()+5e3)},ve.prototype.beforeJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=performance.now()},ve.prototype.afterJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=void 0},ve.prototype.networkRequestFinishedCallback=function(e){this.networkRequests.push({start:e.fetchStart,end:e.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(ve.prototype,"incompleteRequestStarts",{get:function(){for(var e=Object.keys(this.incompleteJSInitiatedRequestStartTimes),t=[],r=0;r<e.length;r++){var n=this.incompleteJSInitiatedRequestStartTimes[e[r]];"number"==typeof n&&t.push(n)}return t},enumerable:!1,configurable:!0}),ve.prototype.longTaskFinishedCallback=function(e){var t=e.startTime+e.duration;this.longTasks.push({start:e.startTime,end:t}),this.rescheduleTimer(t+5e3)},ve.prototype.checkTTI=function(){var e=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests),t=this.getFirstPaintTime()||performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,r=this.getMinValue(),n=performance.now();null===r&&this.rescheduleTimer(Math.max(e+5e3,n+1e3));n=this.computeTTI(t,r,e,n,this.longTasks);n?(this.callback&&"function"==typeof this.callback&&this.callback(Math.round(n)),this.disable()):this.rescheduleTimer(performance.now()+1e3)},ve.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var e=performance.timing;return e.domContentLoadedEventEnd-e.navigationStart}return null},ve.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var e=performance.getEntriesByType("paint")[0];return e?e.startTime:0}return 0},ve.prototype.disable=function(){clearTimeout(this.timerId),this.scheduleTimerTasks=!1,this.unregisterListeners(),this.snippetObserver&&this.snippetObserver.disconnect(),this.snippetEntries&&this.snippetEntries.splice(0,this.snippetEntries.length)},ve.prototype.computeLastKnownNetwork2Busy=function(e,t){var r,n,o,i;if(2<e.length)return performance.now();var s=[];try{for(var a=v(t),c=a.next();!c.done;c=a.next()){var u=c.value;s.push({timestamp:u.start,type:"requestStart"}),s.push({timestamp:u.end,type:"requestEnd"})}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}try{for(var l=v(e),p=l.next();!p.done;p=l.next()){var h=p.value;s.push({timestamp:h,type:"requestStart"})}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}s.sort(function(e,t){return e.timestamp-t.timestamp});for(var d=e.length,f=s.length-1;0<=f;f--){var m=s[f];switch(m.type){case"requestStart":d--;break;case"requestEnd":if(2<++d)return m.timestamp;break;default:throw Error("Internal Error: This should never happen")}}return 0},ve.monitorName=fe,ve);function ve(e){var t,r,n,o=this;if(this.name=fe,this.longTasks=[],this.callback=le,this.useMutationObserver=!0,this.minValue=null,this.isAsync=0,this.networkRequests=[],this.incompleteJSInitiatedRequestStartTimes={},this.timerActivationTime=-1/0,this.scheduleTimerTasks=!1,this.proxyConfig={beforeCb:this.beforeJSInitiatedRequestCallback.bind(this),afterCb:this.afterJSInitiatedRequestCallback.bind(this)},this.getTTI=function(e){o.callback=e,o.isEnable()?o.startSchedulingTimerTasks():o.callback&&"function"==typeof o.callback&&o.callback()},this.computeTTI=function(e,t,r,n,o){if(n-r<5e3)return null;o=0===o.length?e:o[o.length-1].end;return n-o<5e3?null:Math.max(o,t)},this.isEnable()){if(this.useMutationObserver=!!e.useMutationObserver,this.minValue=null!==(n=e.minValue)&&void 0!==n?n:null,this.isAsync=null!==(n=e.isAsync)&&void 0!==n?n:0,this.snippetEntries=null===(n=null==e?void 0:e.preLongTaskObserver)||void 0===n?void 0:n.precollect,this.snippetObserver=null===(e=null==e?void 0:e.preLongTaskObserver)||void 0===e?void 0:e.observer,!this.isAsync&&this.snippetEntries&&0<this.snippetEntries.length)try{for(var i=v(this.snippetEntries),s=i.next();!s.done;s=i.next()){var a=s.value;"longtask"===a.entryType?this.longTasks.push({start:a.startTime,end:a.startTime+a.duration}):"resource"===a.entryType&&this.networkRequests.push({start:a.fetchStart,end:a.responseEnd})}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}this.registerListeners()}}function ge(e){try{for(var t,r=e,n=[],o=0,i=0,s=" > ".length;r&&o++<5&&!("html"===(t=function(e){var t,r,n,o,i=e,s=[];if(!i||!i.tagName)return"";s.push(i.tagName.toLowerCase()),i.id&&s.push("#"+i.id);e=i.className;if(e&&f(e))for(t=e.split(/\s+/),o=0;o<t.length;o++)s.push("."+t[o]);var a=["type","name","title","alt"];for(o=0;o<a.length;o++)r=a[o],(n=i.getAttribute(r))&&s.push("["+r+'="'+n+'"]');return s.join("")}(r))||1<o&&80<=i+n.length*s+t.length);)n.push(t),i+=t.length,r=r.parentNode;return n.reverse().join(" > ")}catch(e){return"<unknown>"}}var be="FIDMonitor",ye=(Se.prototype.setup=function(e){var a=this;if(E()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&k()){this.callback=e,this.observer=new PerformanceObserver(function(e,t){var r,n;try{for(var o=v(e.getEntries()),i=o.next();!i.done;i=o.next()){var s=i.value,s=s.processingStart-s.startTime;a.callback({name:a.name,fid:Math.round(s)})}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.disconnect()});try{this.observer.observe({type:"first-input",buffered:!0})}catch(e){this.observer.observe({entryTypes:["first-input"]})}}},Se.monitorName=be,Se);function Se(){this.name=be,this.callback=L}var we="MPFIDMonitor",Pe=(Me.prototype.setup=function(){var t,e,r,s=this;if(_()&&k()){if(!this.props.isAsync){var n=null!==(r=null===(r=this.props.preLongTaskObserver)||void 0===r?void 0:r.precollect)&&void 0!==r?r:[];if(n&&0<n.length)try{for(var o=v(n),i=o.next();!i.done;i=o.next()){var a=i.value;"longtask"===a.entryType&&this.list.push(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}}this.observer=new PerformanceObserver(function(e){var t,r;try{for(var n=v(e.getEntries()),o=n.next();!o.done;o=n.next()){var i=o.value;s.list.push(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}),this.observer.observe({entryTypes:["longtask"]})}},Me.prototype.getMPFID=function(){var t,e;if(_()&&k()){this.observer&&this.observer.disconnect();var r=0;try{for(var n=v(this.list),o=n.next();!o.done;o=n.next()){var i=o.value;r<i.duration&&(r=i.duration)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return this.formatEvent(Math.round(r))}},Me.prototype.formatEvent=function(e){return{name:this.name,mpfid:e}},Me.monitorName=we,Me);function Me(e){this.name=we,this.list=[],this.props=e}var Te=[],Ee="ResourcePerformanceMonitor",_e=(ke.prototype.setup=function(e){this.isEnable()&&(this.callback=null!=e?e:L,this.isAsync&&window.performance.clearResourceTimings(),this.observe&&(this.sendResourcePerformance(performance.getEntriesByType("resource")),this.observePerformance()))},ke.prototype.isEnable=function(){return M()&&"function"==typeof performance.clearResourceTimings},ke.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},ke.prototype.buildParams=function(e){var t=this,r=[];if(e.forEach(function(e){d(t.checkIgnore)&&t.checkIgnore(e)||r.push(e)}),r.length)return{name:this.name,type:"post",event:{ev_type:"resource_performance",resources:r}}},ke.prototype.sendResourcePerformance=function(e){e=this.buildParams(e);e&&this.callback(e)},ke.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(e){return!b(Te,e.initiatorType)})},ke.prototype.observePerformance=function(){var t=this;E()&&new PerformanceObserver(function(e){e=e.getEntries();e.length&&t.sendResourcePerformance(e)}).observe({entryTypes:["resource"]})},ke.monitorName=Ee,ke);function ke(e){var t,r=this;this.name=Ee,this.callback=L,this.getResourcePerformance=function(){var e;return null!==(e=r.getPerformance())&&void 0!==e?e:{}},this.isAsync=null!==(t=null==e?void 0:e.isAsync)&&void 0!==t?t:0,this.observe=null!==(t=null==e?void 0:e.observe)&&void 0!==t&&t,this.checkIgnore=null!==(e=null==e?void 0:e.checkIgnore)&&void 0!==e?e:function(){return!1}}var Re={ev_type:"perf",isAsync:0,dns:0,tcp:0,request:0,response:0,processing:0,blank:0,domready:0,load:0,has_resource:0,domparse:0,resource:0,ttfb:0,redirect:0,tti:0,upload_reason:"sample",network_type:"",timing:{},navigation_timing:{},navigation:{},resources:[]},xe="PerformanceMonitor",Ce=(Le.prototype.setup=function(e){var t,r=this;P()&&(this.callback=e,t=function(){r.hasLoaded=!0,r.performanceAuto&&setTimeout(function(){r.perfLog()},200)},"complete"!==document.readyState?window.addEventListener("load",function(){setTimeout(function(){t()},0)},!1):t(),this.sendParams=p({},Re),this.staticPerformanceMonitor=new _e,this.staticPerformanceMonitor.setup(),(new ye).setup(this.hasFID),this.mpfidMonitor=new Pe({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),e=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:me,this.ttiMonitor=new e({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),e=this.syncPerfLog.bind(this),I(e))},Le.prototype.performanceNow=function(){var e;return null!==performance&&void 0!==performance&&performance.now?performance.now():(Date.now?Date.now():+new Date)-(null!==(e=null===(e=performance.timing)||void 0===e?void 0:e.navigationStart)&&void 0!==e?e:0)},Le.prototype.getBounced=function(){return!this.hasLoaded},Le.prototype.getPaintTime=function(t){if(M()){var e=performance.getEntriesByType("paint");if(u(e)){e=e.filter(function(e){return e.name===t});return e.length&&e[0]&&c(e[0])&&e[0].startTime||0}}return 0},Le.monitorName=xe,Le);function Le(e){var o=this;this.name=xe,this.callback=L,this.sendParams=p({},Re),this.finalSendParams=this.sendParams,this.hasLoaded=!1,this.initStart=0,this.hasSentInitPerf=!1,this.initFlag=!0,this.performanceAuto=!0,this.send=function(){o.initFlag&&o.hasLoaded&&(o.sendParams.isAsync&&(o.sendParams.load=Math.round(o.performanceNow()-o.initStart)),setTimeout(function(){o.perfLog()},200))},this.initAsync=function(){var e,t;o.hasSentInitPerf&&(o.sendParams=p({},Re),o.sendParams.isAsync=1,o.initFlag=!0,o.initStart=o.performanceNow(),o.staticPerformanceMonitor=new _e({isAsync:1}),o.staticPerformanceMonitor.setup(),o.mpfidMonitor=new Pe({isAsync:1,preLongTaskObserver:o.props.preLongTaskObserver}),o.mpfidMonitor.setup(),t=null!==(e=o.props.TTIMonitor)&&void 0!==e?e:me,o.ttiMonitor=new t({minValue:Math.round(o.performanceNow()),isAsync:1,preLongTaskObserver:o.props.preLongTaskObserver}),o.ttiMonitor.setup(),null!==(t=null===(e=o.fmpMonitor)||void 0===e?void 0:e.setup)&&void 0!==t&&t.call(e,L))},this.getPerformance=function(){return o.finalSendParams.tti||("complete"===document.readyState?o.perfLog():o.perfLog(!0)),o.buildParams(o.finalSendParams)},this.buildParams=function(e){return{name:o.name,type:"post",event:e}},this.perfLog=function(e){if(void 0===e&&(e=!1),P()){if(o.initFlag=!1,o.finalSendParams=p({},o.sendParams),!o.sendParams.isAsync){var t=o.getBounced();if(t)return o.finalSendParams.bounced=t,void o.invokeCallback(0,o.buildParams(o.finalSendParams));o.finalSendParams=p(p({},o.finalSendParams),o.getParams())}var r=o.getStaticResources(),n=o.getFMP(),t=o.getMPFID();r&&(o.finalSendParams.resources=r,o.finalSendParams.has_resource=1),n&&(o.finalSendParams.fmp=Math.round(n)),n&&o.finalSendParams.fcp&&o.finalSendParams.fmp<o.finalSendParams.fcp&&(o.finalSendParams.fmp=o.finalSendParams.fcp),t&&(o.finalSendParams.mpfid=t),d(o.callback)&&(!e&&o.ttiMonitor&&d(o.ttiMonitor.getTTI)?o.ttiMonitor.getTTI(function(e){e&&0<e&&(o.finalSendParams.tti=o.finalSendParams.isAsync?Math.round(e-o.initStart):e),o.invokeCallback(o.finalSendParams.isAsync,o.buildParams(o.finalSendParams))}):o.invokeCallback(o.finalSendParams.isAsync,o.buildParams(o.finalSendParams)))}},this.invokeCallback=function(e,t){if(!e){if(o.hasSentInitPerf)return;o.hasSentInitPerf=!0}o.callback(t)},this.getStaticResources=function(){var e;if(o.staticPerformanceMonitor&&d(o.staticPerformanceMonitor.getResourcePerformance)){var t=o.staticPerformanceMonitor.getResourcePerformance();if(null!==(e=null==t?void 0:t.event)&&void 0!==e&&e.resources)return t.event.resources||[]}},this.getFMP=function(){var e,t;return o.fmpMonitor?(o.fmpMonitor.disconnect(),o.sendParams.isAsync?(null===(e=null==(t=o.fmpMonitor.getFmp())?void 0:t.event)||void 0===e?void 0:e.fmp)||0:d(o.fmpMonitor.getLoadFmp)?1!==o.props.renderType?2===o.props.renderType?o.getPaintTime("first-contentful-paint"):0:null!==(t=null===(t=(t=o.fmpMonitor.getLoadFmp()||{}).event)||void 0===t?void 0:t.fmp)&&void 0!==t?t:0:0):0},this.getMPFID=function(){if(o.mpfidMonitor&&d(o.mpfidMonitor.getMPFID)){var e=o.mpfidMonitor.getMPFID();if(e)return e.mpfid}},this.syncPerfLog=function(){var e,t;o.hasSentInitPerf||(o.perfLog(!0),null!==(t=(e=o.props).report)&&void 0!==t&&t.call(e))},this.hasFID=function(e){o.sendParams.fid=e.fid},this.getParams=function(){if(P()){var e={},t=window.performance.timing;e.dns=t.domainLookupEnd-t.domainLookupStart,e.tcp=t.connectEnd-t.connectStart,e.request=t.responseStart-t.requestStart,e.response=t.responseEnd-t.responseStart,e.processing=t.domComplete-t.domLoading,e.blank=t.responseEnd-t.navigationStart,e.domready=t.domInteractive-t.navigationStart,e.load=t.loadEventEnd-t.navigationStart,t.secureConnectionStart&&(e.ssl=t.connectEnd-t.secureConnectionStart),e.domparse=t.domInteractive-t.responseEnd,e.resource=t.loadEventStart-t.domContentLoadedEventEnd,e.ttfb=t.responseStart-t.requestStart,e.redirect=t.redirectEnd-t.redirectStart;var r=o.getPaintTime("first-paint"),t=o.getPaintTime("first-contentful-paint");r&&(e.fp=Math.round(r)),t&&(e.fcp=Math.round(t));r=function(){if(!M())return null;var e=window.performance.getEntriesByType("navigation");return u(e)&&0!==e.length?e[0]:null}(),t=P()?window.performance.timing:null;return(r||t)&&(e.navigation=null!=r?r:t),t&&(e.timing=t),r&&(e.navigation_timing=r),e}},e.fmpMonitor&&(this.fmpMonitor=e.fmpMonitor);var t=e.performanceAuto;this.performanceAuto=void 0===t||t,this.props=null!=e?e:{}}var Oe="StaticErrorMonitor",qe=(je.prototype.setup=function(e){S()&&(this.callback=e,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},je.prototype.getSrc=function(e){return"link"===e.tagName.toLowerCase()?He(e,"href"):He(e,"src")},je.prototype.getParams=function(e,t){var r={ev_type:"static",st_type:t},t=x(e);r.st_src=e,r.st_protocol=t.protocol,r.st_domain=t.hostname,r.st_path=t.pathname;t=function(e){var t,r=null===(t=null===(n=window.performance)||void 0===n?void 0:n.getEntriesByType)||void 0===t?void 0:t.call(n,"resource"),n=null==r?void 0:r.length;if(!n)return;for(var o=n-1;-1<o;o--){var i=r[o];if(i.name===e)return i}}(t.href);return t&&(r.timing=t),r},je.monitorName=Oe,je);function je(){var i=this;this.name=Oe,this.callback=L,this.buildEvent=function(e){var t,r,n=e||window.event||{};try{r=null!==(t=null!==(t=n.target)&&void 0!==t?t:n.srcElement)&&void 0!==t?t:{}}catch(n){return}var o=r.tagName;if(o&&f(o)){o=o.toLowerCase();e=i.getSrc(r);if(e&&e!==window.location.href)return{name:i.name,type:"get",event:i.getParams(e,o)}}},this.staticErrorLog=function(e){e=i.buildEvent(e);e&&i.callback(e)}}function He(e,t){var r;return e.getAttribute&&d(e.getAttribute)?null!==(r=e.getAttribute(t))&&void 0!==r?r:"":null!==(t=e[t])&&void 0!==t?t:""}var Ae="BreadcrumbMonitor",Ie=(De.prototype.setup=function(){this.instrumentDOM()},De.prototype.instrumentDOM=function(){var e;"document"in window&&(e=this,window.document.addEventListener("click",e.domEventHandler("click",e.triggerHandlers.bind(e,"dom")),!1),window.document.addEventListener("keypress",e.keypressEventHandler(e.triggerHandlers.bind(e,"dom")),!1))},De.prototype.domEventHandler=function(t,r,n){var o=this;return void 0===n&&(n=!1),function(e){o.keypressTimeout=void 0,e&&o.lastCapturedEvent!==e&&(o.lastCapturedEvent=e,o.debounceTimer&&clearTimeout(o.debounceTimer),n?o.debounceTimer=setTimeout(function(){r({event:e,name:t})}):r({event:e,name:t}))}},De.prototype.triggerHandlers=function(e,t){if(e)try{this.domBreadcrumb(t)}catch(e){}},De.prototype.keypressEventHandler=function(n){var o=this;return function(e){var t;try{t=e.target}catch(e){return}var r=t&&t.tagName;r&&("INPUT"===r||"TEXTAREA"===r||t.isContentEditable)&&(o.keypressTimeout||o.domEventHandler("input",n)(e),clearTimeout(o.keypressTimeout),o.keypressTimeout=window.setTimeout(function(){o.keypressTimeout=void 0},o.debounceDuration))}},De.prototype.domBreadcrumb=function(e){var t;try{t=e.event.target?ge(e.event.target):ge(e.event)}catch(e){t="<unknown>"}0!==t.length&&this.addBreadcrumb({category:"ui."+e.name,message:t})},De.monitorName=Ae,De);function De(e){var n=this;this.name=Ae,this.breadcrumbs=[],this.getBreadcrumbs=function(){return n.breadcrumbs},this.addBreadcrumb=function(e){var t=p(p({},e),{timestamp:(new Date).getTime()}),r=n.maxBreadcrumbs,e=n.breadcrumbs;return n.breadcrumbs=0<=r?a(e,[t]).slice(-r):a(e,[t]),n},this.debounceDuration=1e3,this.debounceTimer=0,this.breadcrumbs=[],this.maxBreadcrumbs=null!==(e=null==e?void 0:e.maxBreadcrumbs)&&void 0!==e?e:20}var Fe=(Be.prototype.sendEvent=function(e){e=this.getEventToBeSent(e);e&&this.idleSendEvent(e)},Be.prototype.getEventToBeSent=function(e){e=this._modifyEvent(e);if(this._shouldSend(e))return e},Be.prototype._modifyEvent=function(e){return e},Be.prototype._shouldSend=function(e){return!0},Be.prototype._send=function(e){},Be.prototype.idleSendEvent=function(e){this._send(e)},Be);function Be(){}var Ne={enableCatchGlobalJSError:!0},Je="JSExceptionMonitor",Ue=(Xe.prototype.setup=function(e){S()&&(this.callback=e,this.options.enableCatchGlobalJSError&&(window.addEventListener("error",this.jsErrorLog),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog)))},Xe.prototype.buildEvent=function(e){if(!function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return 1;default:return e instanceof Error}}(e)?(r(e)&&(t={message:JSON.stringify(e)}),f(e)&&(t={message:e})):t=e,t){var t={ev_type:"js_exception",exception:this.normalizeError(t),breadcrumbs:null!==(t=null===(t=this.options.breadcrumbMonitor)||void 0===t?void 0:t.getBreadcrumbs())&&void 0!==t?t:[]};return{name:this.name,type:"post",event:t}}},Xe.prototype.logError=function(e){e=this.buildEvent(e);e&&this.callback(e)},Xe.prototype.getJSError=function(e){e=e.error;if(e)return e},Xe.prototype.getJSPromiseRejection=function(e){var t=void 0;try{"reason"in e?t=e.reason:"detail"in e&&"reason"in e.detail&&(t=e.detail.reason)}catch(e){}if(t)return t},Xe.prototype.normalizeError=function(e){return{message:e.message,name:e.name,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,stack:e.stack,stacktrace:e.stacktrace,framesToPop:e.framesToPop}},Xe.monitorName=Je,Xe);function Xe(e){var t=this;this.name=Je,this.callback=L,this.jsErrorLog=function(e){e=t.getJSError(e);e&&t.logError(e)},this.jsPromiseRejectionLog=function(e){e=t.getJSPromiseRejection(e);e&&t.logError(e)},this.options=p(p({},Ne),e)}var ze,Qe=(e(Ve,ze=Fe),Object.defineProperty(Ve.prototype,"ready",{get:function(){return this.isReady},set:function(e){this.isReady=e,this.isReady&&this._uploadQueue()},enumerable:!1,configurable:!0}),Ve.prototype._send=function(e){var t=this,e=this.buildParams(e);null!=e&&(this.reportQueue.push(e),this.isReady&&(this.reportQueue.length>=this.batchReportLength&&this._uploadQueue(),this.batchReportTimeout&&clearTimeout(this.batchReportTimeout),this.batchReportTimeout=setTimeout(function(){t._uploadQueue()},this.batchReportWait)))},Ve.prototype._uploadQueue=function(){var e;this.reportQueue.length&&this.ready&&(e={ev_type:"batch",list:this.reportQueue},this.reportQueue=[],this._request({event:e,type:"post"}))},Ve.prototype._request=function(e){},Ve);function Ve(e){var t,r=ze.call(this)||this;return r.reportQueue=[],r.isReady=!0,r.batchReportLength=null!==(t=e.maxBatchReportLength)&&void 0!==t?t:10,r.batchReportWait=null!==(e=e.batchReportWait)&&void 0!==e?e:1e3,r.batchReportTimeout=null,r}var Ke="RANGERS_WEB_ID";function We(){var e={flags:{hookPath:!0,hookXHR:!0,hookFetch:!0,enableSizeStats:!0,enableFMP:!0,enablePerformance:!0,enableResourcePerformance:!0,enableStaticError:!0,enableCatchJSError:!0,enableCatchGlobalJSError:!0,enableCatchJSErrorV2:!1,enableCrash:!0,enableMemoryRecord:!0,enableFPSJankTimesMonitor:!0,enableBreadcrumb:!0,hookConsole:!1}};return e.monitors={BaseMonitor:{appTypeSetting:{type:0,SPA:"",renderType:0},sampleHit:B(1)},JSErrorMonitor:{enable:!0,webIDHit:!0,sampleRate:1,webIDHitBehavior:!1,sampleHitBehavior:!1,ignoreErrors:[],whitelistUrls:[],blacklistUrls:[],download_link:""},AjaxMonitor:{enable:!0,enableError:!1,webIDHit:!0,sampleHit:B(1),sampleRate:1,sampleHitTrace:!1,ignore:$,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1,webIDHitStaticResource:!1,sampleHitStaticResource:B(G),slowSessionTime:Y,spaSlowSessionTime:Z,geckoUrls:[],interval:0,checkPoint:[]},StaticErrorMonitor:{enable:!0,webIDHit:!0,sampleRate:1,ignore:$},ResourcePerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1},BreadcrumbMonitor:{enable:!0}},e.custom={},e.commonParams={aid:0,pid:"",version:"0.2.15",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:W(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:D(),network_type:F()},e}function Ge(e){e!==function(e,t){var r,n;if(!e||!t)return"";var o=e.split(";"),i={};try{for(var s=v(o),a=s.next();!a.done;a=s.next()){var c=a.value.split("="),u=f(c[0])&&c[0].trim();u&&f(c[1])&&(i[u]=c[1].trim())}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i[t]||""}(document.cookie,Ke)&&(document.cookie=Ke+"="+e+";max-age=7776000;domain="+location.hostname+";path=/")}var $e,Ye,Ze,et,tt=($e="/v2/user/webid",Ye="/v2/user/ssid",Ze="/v2/event/list",et=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(t){[$e,Ye,Ze].forEach(function(e){et.push(t+e)})}),et);function rt(e){var t=e.sendParams,r=e.monitorsSetting;if(!t||!c(t)||!t.event)return!1;var n,o,e=r;if("AjaxMonitor"===t.name||"FetchMonitor"===t.name){r=A(a(["/monitor_browser/collect"],tt)||[]);if(r&&r.test(t.event.ax_url))return!1}return!(null==e||!e.BaseMonitor.sampleHit)&&("AjaxMonitor"===t.name||"FetchMonitor"===t.name?function(e){var r=e.sendParams,t=e.ajaxMonitor;if(!t)return!0;if("2"!==r.event.ax_status[0]&&"3"!==r.event.ax_status[0])return t.enableError;if(!t.enable)return!1;if(!t.webIDHit)return!1;if(!t.sampleHit||!B(t.sampleRate))return!1;if(u(e=t.whitelistUrls)&&0<e.length){var n=A(t.whitelistUrls||[]);return n&&n.test(r.event.ax_url)?!0:!1}if((n=A(t.ignore||[]))&&n.test(r.event.ax_url))return!1;if((n=t.statusCodeSample)&&l(n,r.event.ax_status))return B(n[r.event.ax_status]);if(t=t.requestUrlSample){var o=!1,i=!1;if(t.forEach(function(e){var t;o||null!=(t=A([e.url]))&&t.test(r.event.ax_url)&&(o=!0,i=B(e.sampleRate))}),o)return i}return!0}({sendParams:t,ajaxMonitor:e.AjaxMonitor}):"PerformanceMonitor"===t.name?!(n=(n={performanceMonitor:e.PerformanceMonitor}).performanceMonitor)||!!n.enable&&(!!n.webIDHit&&!!B(n.sampleRate)):"StaticErrorMonitor"===t.name?(n={sendParams:t,staticErrorMonitor:e.StaticErrorMonitor},o=n.sendParams,!(n=n.staticErrorMonitor)||!!n.enable&&(!!n.webIDHit&&(!!B(n.sampleRate)&&(!(n=A(n.ignore||[]))||!n.test(o.event.st_src))))):"JSExceptionMonitor"===t.name?!(o=(o={jsErrorMonitor:e.JSErrorMonitor}).jsErrorMonitor)||!!o.enable&&(!!o.webIDHit&&!!B(o.sampleRate)):"ResourcePerformanceMonitor"!==t.name||(!(e=(e={resourcePerformanceMonitor:e.ResourcePerformanceMonitor}).resourcePerformanceMonitor)||!!e.enable&&(!!e.webIDHit&&!!B(e.sampleRate))))}function nt(e){var t=e.sendParams,r=e.commonParams,n=e.custom,e=e.breadcrumbMonitor,e=function(e){var t=e.sendParams,r=e.commonParams,n=e.breadcrumbMonitor;if((e={}).ev_type=t.event.ev_type,e.common=r,"PageViewMonitor"===t.name&&e)return e;if(("AjaxMonitor"===t.name||"FetchMonitor"===t.name)&&e){var o=t.event,o=(o.ev_type,s(o,["ev_type"]));return e.event=o,e}if("PerformanceMonitor"===t.name&&e){t.event.navigation=t.event.navigation_timing;o=t.event,o=(o.ev_type,s(o,["ev_type"]));return e.ev_type="performance",e.event={fp:o.fp,fcp:o.fcp,fmp:o.fmp,tti:o.tti,fid:o.fid,mpfid:o.mpfid,isAsync:o.isAsync,timing:o.timing,navigation:o.navigation_timing,bounced:o.bounced},e}if("StaticErrorMonitor"===t.name&&e){e.ev_type="resource_error";var i=t.event,i=(i.ev_type,s(i,["ev_type"]));return e.event=i,e}if("ResourcePerformanceMonitor"===t.name&&e){e.ev_type="resource";i=t.event,i=(i.ev_type,s(i,["ev_type"]));return e.event=i,e}if("JSExceptionMonitor"===t.name&&e){e.ev_type="js_error";t=t.event,t=(t.ev_type,s(t,["ev_type"]));return e.event=t.exception,e.breadcrumbs=null!==(n=null==n?void 0:n.getBreadcrumbs())&&void 0!==n?n:[],e}return e}({sendParams:t,commonParams:p(p({},null!=r?r:{}),{url:window.location.href}),breadcrumbMonitor:e});return n&&d(n.beforeSend)&&(e=n.beforeSend(e||{})),e}function ot(e){return"https://"+e+"/monitor_browser/collect"}var it,st=(e(at,it=Qe),at.prototype._shouldSend=function(e){return rt({sendParams:e,monitorsSetting:this.options.monitorsSetting})},at.prototype._modifyEvent=function(e){return(e=(e={sendParams:e}).sendParams)&&c(e)?e:{}},at.prototype._request=function(e){var t,r;e&&e.event&&(t=e.type,r=e.event,"beacon"===this.options.reportType&&navigator&&navigator.sendBeacon?(e=JSON.stringify(r),navigator.sendBeacon(this.getReportURL(),e)):this.transport&&("get"!==t?"post"===t&&this.transport.postEvent(r):this.transport.getEvent(r)))},at.prototype.buildParams=function(e){var t,r=null===(t=null===(t=this.options.monitorsSetting)||void 0===t?void 0:t.BreadcrumbMonitor)||void 0===t||!t.enable||null===(r=this.options.monitors)||void 0===r?void 0:r.BreadcrumbMonitor;return nt({sendParams:e,commonParams:this.options.commonParams,custom:this.options.custom,breadcrumbMonitor:r})},at.prototype.getReportURL=function(){return this.reportURL},at);function at(e){var o=it.call(this,e)||this;return o.options={},o.setTransport=function(){o.transport=new N({reportURL:o.getReportURL()}),o.preQueue.forEach(function(e){it.prototype.sendEvent.call(o,e)})},o.updateConfig=function(e){var t,r,n;o.options=(t={previousOptions:o.options,newOptions:e},r=t.previousOptions,n=t.newOptions,(e=p(p({},r),n)).commonParams=i({},null!==(t=r.commonParams)&&void 0!==t?t:{},null!==(t=n.commonParams)&&void 0!==t?t:{}),e.monitorsSetting=i({},null!==(t=r.monitorsSetting)&&void 0!==t?t:{},null!==(t=n.monitorsSetting)&&void 0!==t?t:{}),e.monitors=p(p({},null!==(t=r.monitors)&&void 0!==t?t:{}),null!==(t=n.monitors)&&void 0!==t?t:{}),e.custom=p(p({},null!==(r=r.custom)&&void 0!==r?r:{}),null!==(n=n.custom)&&void 0!==n?n:{}),e)},o.sendEvent=function(e){o.transport?it.prototype.sendEvent.call(o,e):o.preQueue.push(e)},o.uploadQueue=function(){o._uploadQueue()},o.reportURL=null!==(e=null==e?void 0:e.reportURL)&&void 0!==e?e:"",o.preQueue=[],o}ct.prototype.getUserIDFromRangers=function(t){window.collectEvent&&d(window.collectEvent)&&window.collectEvent("getToken",function(e){t(e)})},ct.prototype.init=function(e){var t=this;this.client=new st(this.getClientOptions(e)),this.getUserIDFromRangers(function(e){e=t.normalizeSetting({user_unique_id:e.user_unique_id});t.client.updateConfig(t.getClientOptions(e))}),this.sendPageview();e=this.setMonitors();this.setupMonitors(e),this.setServerSetting()},ct.prototype.setServerSetting=function(){var e,r=this,t=this.serverSetting;t?(e=this.normalizeServerSetting(t),this.updateSetting(e)):(e="https://"+this.serverDomain+"/settings/get/web?aid="+this.baseSetting.commonParams.aid,N.get(e,{success:function(e){try{r.serverSetting=e.data;var t=r.normalizeServerSetting(r.serverSetting);r.updateSetting(t)}catch(e){r.updateSetting(r.baseSetting)}},fail:function(){r.updateSetting(r.baseSetting)}}))},ct.prototype.updateSetting=function(e){this.client.updateConfig(this.getClientOptions(e)),this.client.setTransport()},ct.prototype.getClientOptions=function(e){return{reportURL:ot(this.serverDomain),monitorsSetting:e.monitors,commonParams:e.commonParams,custom:e.custom}},ct.prototype.setMonitors=function(){var t,e=[],r=this.baseSetting.flags,n=new ce;return e.push(n),r.enableCatchJSError&&e.push(new Ue),r.hookXHR&&e.push(new te({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.hookFetch&&e.push(new ie({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.enableStaticError&&e.push(new qe),r.enablePerformance&&(r.enableFMP?e.push(new Ce({fmpMonitor:n,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):e.push(new Ce({renderType:1,preLongTaskObserver:{precollect:(null===(n=window.RangersSiteSDK.lt)||void 0===n?void 0:n.e)||[],observer:null===(n=window.RangersSiteSDK.lt)||void 0===n?void 0:n.o}}))),r.enableBreadcrumb&&e.push(new Ie),r.enableResourcePerformance&&(t=this.serverDomain,e.push(new _e({observe:!0,checkIgnore:function(e){return e.name===ot(t)||("xmlhttprequest"===e.initiatorType||"fetch"===e.initiatorType||"beacon"===e.initiatorType||"navigation"===e.initiatorType||0===e.decodedBodySize)}}))),e},ct.prototype.setupMonitors=function(e){var t=this;this.client&&this.client.sendEvent&&(e.forEach(function(e){"FMPMonitor"===(t.monitors[e.name]=e).name?e.setup(L):e.setup(null===(e=t.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},ct.prototype.normalizeServerSetting=function(e){var e=(t=e,r=i({JSErrorMonitor:{},AjaxMonitor:{},PerformanceMonitor:{},StaticErrorMonitor:{},BaseMonitor:{},ResourcePerformanceMonitor:{}},r=this.defaultSetting.monitors),(t=t.setting).jserr&&(r.JSErrorMonitor.enable=t.jserr.enable,r.JSErrorMonitor.webIDHit=B(t.jserr.enable_user_rate),r.JSErrorMonitor.sampleRate=t.jserr.enable_sample_rate),t.performance&&(r.PerformanceMonitor.enable=t.performance.enable,r.PerformanceMonitor.webIDHit=B(t.performance.enable_user_rate),r.PerformanceMonitor.sampleRate=t.performance.enable_sample_rate),t.breadcrumb&&(r.BreadcrumbMonitor.enable=t.breadcrumb.enable),t.static_resource_error&&(r.StaticErrorMonitor.enable=t.static_resource_error.enable),t.static_resource&&(r.ResourcePerformanceMonitor.enable=t.static_resource.enable,r.ResourcePerformanceMonitor.webIDHit=B(t.static_resource.enable_user_rate),r.ResourcePerformanceMonitor.sampleRate=t.static_resource.enable_sample_rate),t.request&&(r.AjaxMonitor.enable=t.request.enable,r.AjaxMonitor.enableError=t.request.enableError,r.AjaxMonitor.webIDHit=B(t.request.enable_user_rate),r.AjaxMonitor.sampleRate=t.request.enable_sample_rate),r),t={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(this.userSetting),monitors:e,custom:this.getClientCustom(this.userSetting)},r={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(this.userSetting),monitors:this.getClientMonitorsSetting(this.userSetting),custom:this.getClientCustom(this.userSetting)},e=this.baseSetting;return this.baseSetting=i({},this.baseSetting,t,r),this.baseSetting.commonParams.pid=this.baseSetting.commonParams.pid||location.pathname,this.settingEffect(this.baseSetting,e),this.baseSetting},ct.prototype.normalizeSetting=function(e){var t={commonParams:this.getClientCommonParams(e),flags:this.getClientFlags(e),monitors:this.getClientMonitorsSetting(e),custom:this.getClientCustom(e)},r={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(this.userSetting),monitors:this.getClientMonitorsSetting(this.userSetting),custom:this.getClientCustom(this.userSetting)},e=this.baseSetting;return this.baseSetting=i({},this.baseSetting,t,r),this.baseSetting.commonParams.pid=this.baseSetting.commonParams.pid||location.pathname,this.settingEffect(this.baseSetting,e),this.baseSetting},ct.prototype.settingEffect=function(e,t){Ge(e.commonParams.rangers_web_id),t.commonParams.pid!==e.commonParams.pid&&this.sendPageview()},ct.prototype.sendPageview=function(){var e;null!==(e=this.client)&&void 0!==e&&e.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},ct.prototype.getClientCommonParams=function(r){void 0===r&&(r={});var n={};if(!c(r))return n;var o=["context","pid"];t(r,function(e,t){b(o,e)&&(n[e]=t)});return t({user_unique_id:"rangers_web_id",app_id:"aid"},function(e,t){l(r,e)&&(n[t]=r[e])}),n},ct.prototype.getClientFlags=function(e){void 0===e&&(e={});var r={};if(!c(e))return r;var n=["hookPath","hookXHR","hookFetch","enableSizeStats","enableFMP","enablePerformance","enableStaticError","enableCatchJSError","enableCatchJSErrorV2","enableCatchGlobalJSError","enableResourcePerformance","enableCrash","enableMemoryRecord","enableFPSJankTimesMonitor","enableBreadcrumb","hookConsole"];return t(e,function(e,t){b(n,e)&&(r[e]=t)}),r},ct.prototype.getClientCustom=function(e){var t={};return e.beforeSend&&d(e.beforeSend)&&(t.beforeSend=e.beforeSend),t},ct.prototype.getClientMonitorsSetting=function(e){return e=(t={setting:e}).setting,t=i({JSErrorMonitor:{},AjaxMonitor:{},PerformanceMonitor:{},StaticErrorMonitor:{},ResourcePerformanceMonitor:{},BaseMonitor:{appTypeSetting:{}}},{}),e.ajaxWhitelistUrls&&u(e.ajaxWhitelistUrls)&&(t.AjaxMonitor.whitelistUrls=(t.AjaxMonitor.whitelistUrls||[]).concat(e.ajaxWhitelistUrls)),e.ignoreAjax&&u(e.ignoreAjax)&&(t.AjaxMonitor.ignore=(t.AjaxMonitor.ignore||[]).concat(e.ignoreAjax)),e.ignoreStatic&&u(e.ignoreStatic)&&(t.StaticErrorMonitor.ignore=(t.StaticErrorMonitor.ignore||[]).concat(e.ignoreStatic)),e.ignoreErrors&&u(e.ignoreErrors)&&(t.JSErrorMonitor.ignoreErrors=e.ignoreErrors),e.errorBlacklistUrls&&u(e.errorBlacklistUrls)&&(t.JSErrorMonitor.blacklistUrls=e.errorBlacklistUrls),e.errorWhitelistUrls&&u(e.errorWhitelistUrls)&&(t.JSErrorMonitor.whitelistUrls=e.errorWhitelistUrls),l(e,"sampleRate")&&(t.BaseMonitor.sampleHit=B(e.sampleRate)),t;var t},Fe=ct;function ct(){var n=this;this.version="0.2.15",this.serverDomain="tbm.snssdk.com",this.instance=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if("config"!==e[0])n.client&&("report"!==e[0]?n.onClose():null!==(r=n.client)&&void 0!==r&&r.uploadQueue());else if(c(e[1])){var r=e[1];if(n.userSetting=p(p({},n.userSetting||{}),r||{}),!n.serverDomain){if(!n.userSetting.serverDomain)return void console.error('"serverDomain" must be configured');n.serverDomain=n.userSetting.serverDomain}r=n.normalizeSetting(r);n.client?n.client.updateConfig(n.getClientOptions(r)):n.init(r)}},this.changeReortType=function(e){var t;null!==(t=n.client)&&void 0!==t&&t.updateConfig({reportType:e})},this.onClose=function(){I(n.onCloseReport,n.visibilityChange)},this.visibilityChange=function(){"hidden"===document.visibilityState&&n.onCloseReport(),"visible"===document.visibilityState&&n.changeReortType("xhr")},this.onCloseReport=function(){var e;n.changeReortType("beacon"),null!==(e=n.client)&&void 0!==e&&e.uploadQueue()},this.defaultSetting=We(),this.baseSetting=this.defaultSetting,this.client=void 0,this.serverSetting=void 0,this.userSetting={},this.monitors={}}var ut=L;return S()&&(Qe=new Fe,ut=Qe.instance,null!==(Fe=window.RangersSiteSDK)&&void 0!==Fe&&Fe.q&&(u(Fe=window.RangersSiteSDK.q)&&Fe.forEach(function(e){ut.apply(void 0,a(e))}),delete window.RangersSiteSDK.q),window.RangersSiteSDK=Qe.instance),ut}();

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

var RangersSiteHybridSDK=function(){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};var p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function s(e,t){var r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function a(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}function c(e){return"object"==typeof e&&null!==e&&!u(e)}function n(e){return"[object Object]"===(e=e,Object.prototype.toString.call(e))}function d(e){return"function"==typeof e}function f(e){return"[object String]"===Object.prototype.toString.call(e)}function u(e){return"[object Array]"===Object.prototype.toString.call(e)}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function t(e,t){if(c(e))for(var r in e)l(e,r)&&t.call(null,r,e[r])}function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r={},n=0;n<e.length;)r=g(r,e[n]),n++;return r}var o=Object.getPrototypeOf?Object.getPrototypeOf({}):null;function m(e){return Object.getPrototypeOf?Object.getPrototypeOf(e)===o:e.constructor===Object}function g(e,t){var r,n=p({},e);for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&void 0!==t[r]&&(c(t[r])&&m(t[r])?n[r]=g(c(e[r])?e[r]:{},t[r]):u(e[r])||u(t[r])?n[r]=function t(e,r){var e=u(e)?e:[];var r=u(r)?r:[];return Array.prototype.concat.call(e,r).map(function(e){return!(e instanceof RegExp)&&(u(e)||c(e)&&m(e))?u(e)?t([],e):g({},e):e})}(e[r],t[r]):n[r]=t[r]);return n}function b(e,t){if(!u(e))return!1;if(0===e.length)return!1;for(var r=0;r<e.length;){if(e[r]===t)return!0;r++}return!1}function y(){if("fetch"in window)try{return new Headers,new Request(""),new Response,1}catch(e){return}}function S(){return!!c(window)}function e(){return S()&&!!c(window.performance)}function w(){return e()&&!!c(window.performance.timing)}function P(){return!!e()&&!!d(window.performance.getEntries)}function M(){return S()&&"function"==typeof window.MutationObserver}function E(){return S()&&"function"==typeof window.PerformanceObserver}function T(){return!!E()&&d(window.PerformanceLongTaskTiming)}function _(){if(!E())return!1;var e=window.PerformanceObserverEntryList;return d(e)&&d(e.prototype.getEntries)}function k(e){var r,e=function(e){if(!c(e))return{};var r={};return t(e,function(e,t){c(t)||u(t)?r[e]=JSON.stringify(t):r[e]=t}),r}(e),e=(r={},t(e,function(e,t){r[encodeURIComponent(e)]=encodeURIComponent(t)}),r),n=[];return t(e,function(e,t){n.push(e+"="+t)}),n.join("&")}function x(e){var t=document.createElement("a");t.href=e;e=t.pathname||"/";return"/"!==e[0]&&(e="/"+e),{href:t.href,protocol:t.protocol.slice(0,-1),hostname:t.hostname,host:t.host,search:t.search,pathname:e,hash:t.hash}}var R=function(e){if(!f(e))return!1;return d(e.toLowerCase)&&(e=e.toLowerCase()),b(["x-tt-token"],e)};function C(){}function O(e){var t="[object String]"===Object.prototype.toString.call(e);return e?t?e.length:ArrayBuffer&&e instanceof ArrayBuffer?e.byteLength:window.Blob&&e instanceof Blob?e.size:e.length||0:0}function L(e){if(!e)return"";if(!d(e.forEach))return"";var r=[];return e.forEach(function(e){var t;u(e)&&e[0]&&!R(e[0])&&(t=e[0],e=e[1]||"",r.push(t+": "+e))}),r.join("\r\n")}function j(e){var t={},r=x(e);return t.ax_protocol=r.protocol,t.ax_domain=r.hostname,t.ax_path=r.pathname,t.ax_url=(r.href||e).split("?")[0],t}function q(e,t){e=x(e),t=x(t);return e.protocol===t.protocol&&e.host===t.host}function H(e){return u(e)&&e.length?function(e){for(var t=[],r=e.length,n=0;n<r;n++){var o=e[n];f(o)?t.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&t.push(o.source)}return new RegExp(t.join("|"),"i")}(e):null}function I(t,r){d(t)&&(d(window.addEventListener)&&(window.addEventListener("unload",t),window.addEventListener("beforeunload",t),window.addEventListener("pagehide",t)),d(document.addEventListener)&&document.addEventListener("visibilitychange",function(e){d(r)?r(e):"hidden"===document.visibilityState&&t(e)}))}var A=function(e){var t,r;return void 0===e&&(e=window),S()&&null!==(t=e.screen)&&void 0!==t&&t.width&&null!==(r=e.screen)&&void 0!==r&&r.height?e.screen.width+"x"+e.screen.height:"0x0"},D=function(){var e="unknown",t=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return t&&f(t.effectiveType)?t.effectiveType:e};function F(e){return!!e&&Math.random()<Number(e)}var B=(N.post=function(e,t,r){var n,o=null!==(n=null==r?void 0:r.success)&&void 0!==n?n:C,i=null!==(r=null==r?void 0:r.fail)&&void 0!==r?r:C,r=new XMLHttpRequest;r.open("POST",e,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify(t)),r.onload=function(){try{var e;this.responseText?(e=JSON.parse(this.responseText),o(e)):o({})}catch(e){i()}},r.onerror=function(){i()},r.onabort=function(){i()}},N.get=function(e,t){var r,n=null!==(r=null==t?void 0:t.success)&&void 0!==r?r:C,o=null!==(r=null==t?void 0:t.fail)&&void 0!==r?r:C,i=null!==(r=null==t?void 0:t.getResponse)&&void 0!==r?r:C,s=null!==(t=null==t?void 0:t.getResponseText)&&void 0!==t?t:C,t=new XMLHttpRequest;t.open("GET",e),t.send(),t.onload=function(){i(null==this?void 0:this.response),s(this.responseText);try{var e;this.responseText?(e=JSON.parse(this.responseText),n(e)):n({})}catch(e){o()}},t.onerror=function(){o()},t.onabort=function(){o()}},N.prototype.getCommonParams=function(){return{timestamp:Date.now()}},N);function N(e){var t=this;this.postEvent=function(e){e=p(p({},e),t.getCommonParams());N.post(t.url,e)},this.getEvent=function(e){e=k(p(p({},e),t.getCommonParams())),e=t.url+"?"+e;N.get(e)},this.getURL=function(){return t.url},this.options=e,this.url=this.options.reportURL}function J(e,t,r){if(void 0===r&&(r="0"),1<r.length)throw new TypeError("expect the length of pad to be 1, but got "+e.length);return e.length>=t?e:""+Array.from({length:t-e.length}).fill(r).join("")+e}function U(e){return e?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,e):""}var X="x-tt-trace-id",z="x-tt-trace-host",V="x-tt-logid";function K(e,t,r){void 0===r&&(r="01");t=""+J((Date.now()%4294967295).toString(16),8)+function(e){if("number"==typeof e)r=e;else{var t=e.replace(/-/g,"");if(!/^[0-9]+$/.test(t)){if(18<t.length)return"18"+U(18);e=22-t.length-4;return""+J(""+t.length,2)+t+U(e)}r=parseInt(t,10)}var r=22-(t=r.toString(16)).length-4;return""+J(""+t.length,2)+t+U(r)}(e)+("string"==typeof t?U(4):J(t.toString(16),4));return"00-"+t+"-"+t.substr(0,16)+"-"+r}function G(){var e=function(){for(var e=new Array(16),t=0,r=0;r<16;r++)0==(3&r)&&(t=4294967296*Math.random()),e[r]=t>>>((3&r)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);var n=0;return[t[e[n++]],t[e[n++]],t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],t[e[n++]],t[e[n++]],t[e[+n]],t[e[15]]].join("")}(e)}var W=.1,Q=["/log/sentry/"],$=8e3,Y=4e3;G(),G();var Z="AjaxMonitor",ee=(te.prototype.setup=function(e){void 0===e&&(e=C),d(XMLHttpRequest)&&(this.callback=e,this.start())},te.prototype.updateConfig=function(e){this.props=i({},this.props,e)},te.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},te.prototype.hookXMLHttpRequestSetRequestHeader=function(){var r=XMLHttpRequest.prototype.setRequestHeader||C;XMLHttpRequest.prototype.setRequestHeader=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._requestHeaders=this._requestHeaders||[],this._requestHeaders.push(e),r.apply(this,e)}},te.prototype.hookXMLHttpRequestOpen=function(){var o=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=e[1];return this._url=n||"",this._method=(null==r?void 0:r.toLowerCase())||"",o.apply(this,e)}},te.prototype.hookXMLHttpRequestSend=function(){var o=this,i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(){for(var e,t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return o.checkAddTrace(this._url)&&(e=(t=null!==(e=null==o?void 0:o.props.commonParams)&&void 0!==e?e:{}).bid,t=t.web_id,e&&t&&(o.traceId=K(t,e),this.setRequestHeader(X,o.traceId))),o.hookXMLHttpRequestOnreadystatechange.call(this,o),this._start=Date.now(),this._data=null==r?void 0:r[0],i.apply(this,r)}},te.prototype.checkAddTrace=function(e){var t=null!==(n=this.props.commonParams)&&void 0!==n?n:{},r=t.bid,n=t.web_id,t=(null!==(t=this.props.ajaxMonitorOptions)&&void 0!==t?t:{}).sampleHitTrace,e=q(location.href,e);return r&&n&&t&&e},te.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},te.prototype.hookXMLHttpRequestOnreadystatechange=function(i){var s=this.onreadystatechange,a=this;this.onreadystatechange=function(){for(var e,t,r,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(4===this.readyState&&(t={ev_type:"ajax",ax_status:(this.status||0).toString(),ax_type:a._method,ax_request_header:L(a._requestHeaders||[]),ax_domain:"",ax_duration:0,ax_path:"",ax_protocol:"",ax_response_header:"",ax_size:0,ax_url:""},"function"==typeof this.getAllResponseHeaders&&(t.ax_response_header=function(t){if(f(t)){var e=t.split("\r\n"),r=[];return e.forEach(function(e,t){e&&d(e.split)&&(e=e.split(": "),r.push([e[0],e[1]]))}),L(r)}return c(t)?L(Object.keys(t).map(function(e){return[e,t[e]]})):t}(this.getAllResponseHeaders())),!i.checkAddTrace(a._url)||(r=null!==(r=i.traceId)&&void 0!==r?r:this.getResponseHeader(X))&&(t.trace_id=r,t.trace_host=null!==(e=this.getResponseHeader(z))&&void 0!==e?e:void 0,t.log_id=null!==(e=this.getResponseHeader(V))&&void 0!==e?e:void 0),t.ax_duration=Date.now()-a._start,200===this.status&&(t.ax_size=function(e){var t=0;if(""===e.responseType||"text"===e.responseType)t=O(e.responseText);else if(e.response)t=O(e.response);else try{t=O(e.responseText)}catch(e){t=0}return t}(this)),t=p(p({},t),j(a._url)),i.collectErrorRequest()&&"2"!==t.ax_status[0]&&"3"!==t.ax_status[0]&&(t.ax_request={body:a._data?""+a._data:void 0,search:null===(e=x(a._url))||void 0===e?void 0:e.search,content_type:null===(e=null===(e=a._requestHeaders)||void 0===e?void 0:e.find(function(e){return"content-type"===e[0].toLowerCase()}))||void 0===e?void 0:e[1]}),d(i.callback)&&i.callback({name:i.name,type:"get",event:t})),s)return s.apply(this,n)}},te.monitorName=Z,te);function te(e){this.name=Z,this.callback=C,this.traceId=null,this.props=e}function re(e){return e instanceof Request}var ne="FetchMonitor",oe=(ie.prototype.updateConfig=function(e){this.props=i({},this.props,e)},ie.prototype.setup=function(e){void 0===e&&(e=C),y()&&(this.callback=e,this.start())},ie.prototype.start=function(){y()&&this.hookFetch()},ie.prototype.checkAddTrace=function(e){var t=null!==(n=null===(r=this.props)||void 0===r?void 0:r.commonParams)&&void 0!==n?n:{},r=t.bid,n=t.web_id,t=(null!==(t=null===(t=null==this?void 0:this.props)||void 0===t?void 0:t.ajaxMonitorOptions)&&void 0!==t?t:{}).sampleHitTrace,e=q(location.href,e);return r&&n&&t&&e},ie.prototype.updateAxRequest=function(e,t,r){var n,o;this.collectErrorRequest()&&"2"!==e.ax_status[0]&&"3"!==e.ax_status[0]&&(o=this.getFetchUrl(t,!0),e.ax_request={body:null===(t=this.getFetchBody(t,r))||void 0===t?void 0:t.toString(),search:!f(o)||null===(n=x(o))||void 0===n?void 0:n.search,content_type:null===(r=null==r?void 0:r.headers)||void 0===r?void 0:r["Content-Type"]})},ie.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},ie.prototype.hookFetch=function(){var c=this,u=this,l=window.fetch;window.fetch=function(n,o){void 0===o&&(o={});var i=c.getFetchUrl(n);if(!function(e){if(f(e)){var t=h(e.split(":"),2),e=t[0];return!t[1]||("http"===e||"https"===e)}}(i))return l(n,o);var e=null!==(e=c.props.commonParams)&&void 0!==e?e:{},t=e.bid,r=e.web_id,s=Date.now(),a={ev_type:"ajax"};try{u.checkAddTrace(i)&&(o.headers=new Headers(function(e,t){var r=new Headers;re(e)&&e.headers&&d(e.headers.forEach)&&e.headers.forEach(function(e,t){r.append(t,e)});t.headers&&new Headers(t.headers).forEach(function(e,t){r.append(t,e)});return r}(n,o)),t&&r&&(a.trace_id=K(t,r),o.headers.append(X,a.trace_id)))}catch(e){}return a.ax_type=c.getFetchMethod(n,o),a=p(p({},a),j(i)),l(n,o).then(function(e){var t,r;return a.ax_status=(e.status||0).toString(),a.ax_duration=Date.now()-s,a.ax_response_header=u.getAllHeaders(e.headers),a.ax_request_header=u.getAllHeaders(o.headers),e.headers&&d(e.headers.has)?(e.headers.has("content-length")?a.ax_size=Number(e.headers.get("content-length"))||0:a.ax_size=0,u.checkAddTrace(i)&&(e.headers.has(z)&&(a.trace_host=null!==(t=e.headers.get(z))&&void 0!==t?t:void 0),e.headers.has(X)&&(a.trace_id=null!==(r=e.headers.get(X))&&void 0!==r?r:void 0),e.headers.has(V)&&(a.log_id=null!==(r=e.headers.get(V))&&void 0!==r?r:void 0))):a.ax_size=0,c.updateAxRequest(a,n,o),d(u.callback)&&u.callback({name:u.name,type:"get",event:a}),e},function(e){return a.ax_status="0",a.ax_size=0,a.ax_duration=Date.now()-s,c.updateAxRequest(a,n,o),d(u.callback)&&u.callback({name:u.name,type:"get",event:a}),Promise.reject(e)})}},ie.prototype.getFetchUrl=function(e,t){void 0===t&&(t=!1);var r="",r=re(e)?e.url:e;return t||(r=f(r)?r.split("?")[0]:r),r},ie.prototype.getFetchMethod=function(e,t){t=null!==(t=null==t?void 0:t.method)&&void 0!==t?t:"get";return re(e)&&(t=null!==(e=e.method)&&void 0!==e?e:t),t.toLowerCase()},ie.prototype.getFetchBody=function(e,t){return re(e)?e.body:null==t?void 0:t.body},ie.prototype.getAllHeaders=function(e){if(!e||"function"!=typeof e.forEach)return"";var r=[];return e.forEach(function(e,t){r.push([t,e])}),L(r)},ie.monitorName=ne,ie);function ie(e){this.name=ne,this.callback=C,this.props=e}var se="FMPMonitor",ae=(ce.prototype.setup=function(e){if(S())return M()?void(d(document.querySelector)&&(this.callback=e&&d(e)?e:function(){},this.startTime=Date.now(),this.list=[],d(this.observer.observe)&&this.observer.observe(document,{childList:!0,subtree:!0}))):null},ce.prototype.count=function(){var e=Date.now()-this.startTime,t=document.querySelector("body");t?this.list.push({score:this.score(t,1,!1),time:e}):this.list.push({score:0,time:e})},ce.prototype.score=function(e,t,r){var n=0,o=e.tagName;if("SCRIPT"!==o&&"STYLE"!==o&&"META"!==o&&"HEAD"!==o){o=e.children?e.children.length:0;if(0<o)for(var i=e.children,s=o-1;0<=s;s--)n+=this.score(i[s],t+1,0<n);if(n<=0&&!r){if(!e.getBoundingClientRect||!d(e.getBoundingClientRect))return 0;e=e.getBoundingClientRect();if(!e)return 0;if(e.top>window.innerHeight)return 0;if(e.height<=0)return 0}n+=1+.5*t}return n},ce.prototype.getFmpInternal=function(){if(!this.observer)return 0;if(this.disconnect(),!this.list.length)return 0;for(var e,t={time:this.list[0].time,rate:0},r=1;r<this.list.length;r++)this.list[r].time>=this.list[r-1].time&&(e=this.list[r].score-this.list[r-1].score,t.rate<e&&(t={time:this.list[r].time,rate:e}));return t.time},ce.prototype.getTimeGap=function(){return w()?this.startTime-performance.timing.navigationStart:0},ce.prototype.formatEvent=function(e){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:e}}},ce.monitorName=se,ce);function ce(){var r=this;this.name=se,this.callback=C,this.disconnect=function(){var e,t;null!==(t=null===(e=r.observer)||void 0===e?void 0:e.disconnect)&&void 0!==t&&t.call(e)},this.getLoadFmp=function(){var e=r.getFmpInternal(),e=e?r.getTimeGap()+e:0,e=r.formatEvent(e);return r.callback(e),e},this.getFmp=function(){var e=r.getFmpInternal(),e=r.formatEvent(e);return r.callback(e),e},this.startTime=Date.now(),this.list=[],this.observer=new MutationObserver(this.count.bind(this))}function ue(){}var le=!1,pe=!1,he={uniqueId:0,originals:{},proxies:{},patchXMLHTTPRequest:function(i){this.originals.send=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.send=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=he.uniqueId++;i.beforeCb(n);var o=this.onreadystatechange;return this.onreadystatechange=function(e){null!=o&&o.call(t,e),4===t.readyState&&i.afterCb(n)},he.originals.send.apply(this,e)},this.proxies.send=XMLHttpRequest.prototype.send},patchFetch:function(o){var i;y()&&(i=window.fetch,this.originals.fetch=i,window.fetch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new Promise(function(t,r){var n=he.uniqueId++;o.beforeCb(n),i.apply(void 0,a(e)).then(function(e){o.afterCb(n),t(e)},function(e){o.afterCb(n,e),r(e)})})},this.proxies.fetch=window.fetch)},observeResourceFetchingMutations:function(s){if(M()){var a=["img","script","iframe","link","audio","video","source"],e=new MutationObserver(function(e){var t,r;try{for(var n=v(e),o=n.next();!o.done;o=n.next()){var i=o.value;("childList"===i.type&&function e(t,r){var n,o;try{for(var i=v(t),s=i.next();!s.done;s=i.next()){var a=s.value;if(r.includes(a.nodeName.toLowerCase())||a.children&&e(a.children,r))return 1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}}(i.addedNodes,a)||"attributes"===i.type&&a.includes(i.target.nodeName.toLowerCase()))&&s(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}});return e.observe(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]}),e}},resetOriginals:function(){this.originals.send&&XMLHttpRequest.prototype.send===this.proxies.send&&(le=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(pe=!1,window.fetch=this.originals.fetch)}},de="TTIMonitor",fe=(me.prototype.setup=function(){},me.prototype.isEnable=function(){return T()&&!!E()&&d(window.PerformanceResourceTiming)&&_()},me.prototype.registerPerformanceObserver=function(){var a=this;this.performanceObserver=new PerformanceObserver(function(e){var t,r,n=e.getEntries();try{for(var o=v(n),i=o.next();!i.done;i=o.next()){var s=i.value;"resource"===s.entryType&&a.networkRequestFinishedCallback(s),"longtask"===s.entryType&&a.longTaskFinishedCallback(s)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}});try{this.performanceObserver.observe({type:"longtask"}),this.performanceObserver.observe({type:"resource",buffered:!0})}catch(e){this.performanceObserver.observe({entryTypes:["longtask","resource"]})}},me.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),he.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=ue,this.proxyConfig.afterCb=ue)},me.prototype.rescheduleTimer=function(e){var t=this;this.scheduleTimerTasks&&(this.timerActivationTime>e||(clearTimeout(this.timerId),this.timerId=window.setTimeout(function(){t.checkTTI()},e-performance.now()),this.timerActivationTime=e))},me.prototype.startSchedulingTimerTasks=function(){this.scheduleTimerTasks=!0;var e=0<this.longTasks.length?this.longTasks[this.longTasks.length-1].end:0,t=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests);this.rescheduleTimer(Math.max(t+5e3,e))},me.prototype.registerListeners=function(){le||(he.patchXMLHTTPRequest(this.proxyConfig),le=!0),pe||(he.patchFetch(this.proxyConfig),pe=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=he.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},me.prototype.mutationObserverCallback=function(e){this.rescheduleTimer(performance.now()+5e3)},me.prototype.beforeJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=performance.now()},me.prototype.afterJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=void 0},me.prototype.networkRequestFinishedCallback=function(e){this.networkRequests.push({start:e.fetchStart,end:e.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(me.prototype,"incompleteRequestStarts",{get:function(){for(var e=Object.keys(this.incompleteJSInitiatedRequestStartTimes),t=[],r=0;r<e.length;r++){var n=this.incompleteJSInitiatedRequestStartTimes[e[r]];"number"==typeof n&&t.push(n)}return t},enumerable:!1,configurable:!0}),me.prototype.longTaskFinishedCallback=function(e){var t=e.startTime+e.duration;this.longTasks.push({start:e.startTime,end:t}),this.rescheduleTimer(t+5e3)},me.prototype.checkTTI=function(){var e=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests),t=this.getFirstPaintTime()||performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,r=this.getMinValue(),n=performance.now();null===r&&this.rescheduleTimer(Math.max(e+5e3,n+1e3));n=this.computeTTI(t,r,e,n,this.longTasks);n?(this.callback&&"function"==typeof this.callback&&this.callback(Math.round(n)),this.disable()):this.rescheduleTimer(performance.now()+1e3)},me.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var e=performance.timing;return e.domContentLoadedEventEnd-e.navigationStart}return null},me.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var e=performance.getEntriesByType("paint")[0];return e?e.startTime:0}return 0},me.prototype.disable=function(){clearTimeout(this.timerId),this.scheduleTimerTasks=!1,this.unregisterListeners(),this.snippetObserver&&this.snippetObserver.disconnect(),this.snippetEntries&&this.snippetEntries.splice(0,this.snippetEntries.length)},me.prototype.computeLastKnownNetwork2Busy=function(e,t){var r,n,o,i;if(2<e.length)return performance.now();var s=[];try{for(var a=v(t),c=a.next();!c.done;c=a.next()){var u=c.value;s.push({timestamp:u.start,type:"requestStart"}),s.push({timestamp:u.end,type:"requestEnd"})}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}try{for(var l=v(e),p=l.next();!p.done;p=l.next()){var h=p.value;s.push({timestamp:h,type:"requestStart"})}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}s.sort(function(e,t){return e.timestamp-t.timestamp});for(var d=e.length,f=s.length-1;0<=f;f--){var m=s[f];switch(m.type){case"requestStart":d--;break;case"requestEnd":if(2<++d)return m.timestamp;break;default:throw Error("Internal Error: This should never happen")}}return 0},me.monitorName=de,me);function me(e){var t,r,n,o=this;if(this.name=de,this.longTasks=[],this.callback=ue,this.useMutationObserver=!0,this.minValue=null,this.isAsync=0,this.networkRequests=[],this.incompleteJSInitiatedRequestStartTimes={},this.timerActivationTime=-1/0,this.scheduleTimerTasks=!1,this.proxyConfig={beforeCb:this.beforeJSInitiatedRequestCallback.bind(this),afterCb:this.afterJSInitiatedRequestCallback.bind(this)},this.getTTI=function(e){o.callback=e,o.isEnable()?o.startSchedulingTimerTasks():o.callback&&"function"==typeof o.callback&&o.callback()},this.computeTTI=function(e,t,r,n,o){if(n-r<5e3)return null;o=0===o.length?e:o[o.length-1].end;return n-o<5e3?null:Math.max(o,t)},this.isEnable()){if(this.useMutationObserver=!!e.useMutationObserver,this.minValue=null!==(n=e.minValue)&&void 0!==n?n:null,this.isAsync=null!==(n=e.isAsync)&&void 0!==n?n:0,this.snippetEntries=null===(n=null==e?void 0:e.preLongTaskObserver)||void 0===n?void 0:n.precollect,this.snippetObserver=null===(e=null==e?void 0:e.preLongTaskObserver)||void 0===e?void 0:e.observer,!this.isAsync&&this.snippetEntries&&0<this.snippetEntries.length)try{for(var i=v(this.snippetEntries),s=i.next();!s.done;s=i.next()){var a=s.value;"longtask"===a.entryType?this.longTasks.push({start:a.startTime,end:a.startTime+a.duration}):"resource"===a.entryType&&this.networkRequests.push({start:a.fetchStart,end:a.responseEnd})}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}this.registerListeners()}}function ve(e){try{for(var t,r=e,n=[],o=0,i=0,s=" > ".length;r&&o++<5&&!("html"===(t=function(e){var t,r,n,o,i=e,s=[];if(!i||!i.tagName)return"";s.push(i.tagName.toLowerCase()),i.id&&s.push("#"+i.id);e=i.className;if(e&&f(e))for(t=e.split(/\s+/),o=0;o<t.length;o++)s.push("."+t[o]);var a=["type","name","title","alt"];for(o=0;o<a.length;o++)r=a[o],(n=i.getAttribute(r))&&s.push("["+r+'="'+n+'"]');return s.join("")}(r))||1<o&&80<=i+n.length*s+t.length);)n.push(t),i+=t.length,r=r.parentNode;return n.reverse().join(" > ")}catch(e){return"<unknown>"}}var ge="FIDMonitor",be=(ye.prototype.setup=function(e){var a=this;if(E()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&_()){this.callback=e,this.observer=new PerformanceObserver(function(e,t){var r,n;try{for(var o=v(e.getEntries()),i=o.next();!i.done;i=o.next()){var s=i.value,s=s.processingStart-s.startTime;a.callback({name:a.name,fid:Math.round(s)})}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.disconnect()});try{this.observer.observe({type:"first-input",buffered:!0})}catch(e){this.observer.observe({entryTypes:["first-input"]})}}},ye.monitorName=ge,ye);function ye(){this.name=ge,this.callback=C}var Se="MPFIDMonitor",we=(Pe.prototype.setup=function(){var t,e,r,s=this;if(T()&&_()){if(!this.props.isAsync){var n=null!==(r=null===(r=this.props.preLongTaskObserver)||void 0===r?void 0:r.precollect)&&void 0!==r?r:[];if(n&&0<n.length)try{for(var o=v(n),i=o.next();!i.done;i=o.next()){var a=i.value;"longtask"===a.entryType&&this.list.push(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}}this.observer=new PerformanceObserver(function(e){var t,r;try{for(var n=v(e.getEntries()),o=n.next();!o.done;o=n.next()){var i=o.value;s.list.push(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}),this.observer.observe({entryTypes:["longtask"]})}},Pe.prototype.getMPFID=function(){var t,e;if(T()&&_()){this.observer&&this.observer.disconnect();var r=0;try{for(var n=v(this.list),o=n.next();!o.done;o=n.next()){var i=o.value;r<i.duration&&(r=i.duration)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return this.formatEvent(Math.round(r))}},Pe.prototype.formatEvent=function(e){return{name:this.name,mpfid:e}},Pe.monitorName=Se,Pe);function Pe(e){this.name=Se,this.list=[],this.props=e}var Me=[],Ee="ResourcePerformanceMonitor",Te=(_e.prototype.setup=function(e){this.isEnable()&&(this.callback=null!=e?e:C,this.isAsync&&window.performance.clearResourceTimings(),this.observe&&(this.sendResourcePerformance(performance.getEntriesByType("resource")),this.observePerformance()))},_e.prototype.isEnable=function(){return P()&&"function"==typeof performance.clearResourceTimings},_e.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},_e.prototype.buildParams=function(e){var t=this,r=[];if(e.forEach(function(e){d(t.checkIgnore)&&t.checkIgnore(e)||r.push(e)}),r.length)return{name:this.name,type:"post",event:{ev_type:"resource_performance",resources:r}}},_e.prototype.sendResourcePerformance=function(e){e=this.buildParams(e);e&&this.callback(e)},_e.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(e){return!b(Me,e.initiatorType)})},_e.prototype.observePerformance=function(){var t=this;E()&&new PerformanceObserver(function(e){e=e.getEntries();e.length&&t.sendResourcePerformance(e)}).observe({entryTypes:["resource"]})},_e.monitorName=Ee,_e);function _e(e){var t,r=this;this.name=Ee,this.callback=C,this.getResourcePerformance=function(){var e;return null!==(e=r.getPerformance())&&void 0!==e?e:{}},this.isAsync=null!==(t=null==e?void 0:e.isAsync)&&void 0!==t?t:0,this.observe=null!==(t=null==e?void 0:e.observe)&&void 0!==t&&t,this.checkIgnore=null!==(e=null==e?void 0:e.checkIgnore)&&void 0!==e?e:function(){return!1}}var ke={ev_type:"perf",isAsync:0,dns:0,tcp:0,request:0,response:0,processing:0,blank:0,domready:0,load:0,has_resource:0,domparse:0,resource:0,ttfb:0,redirect:0,tti:0,upload_reason:"sample",network_type:"",timing:{},navigation_timing:{},navigation:{},resources:[]},xe="PerformanceMonitor",Re=(Ce.prototype.setup=function(e){var t,r=this;w()&&(this.callback=e,t=function(){r.hasLoaded=!0,r.performanceAuto&&setTimeout(function(){r.perfLog()},200)},"complete"!==document.readyState?window.addEventListener("load",function(){setTimeout(function(){t()},0)},!1):t(),this.sendParams=p({},ke),this.staticPerformanceMonitor=new Te,this.staticPerformanceMonitor.setup(),(new be).setup(this.hasFID),this.mpfidMonitor=new we({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),e=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:fe,this.ttiMonitor=new e({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),e=this.syncPerfLog.bind(this),I(e))},Ce.prototype.performanceNow=function(){var e;return null!==performance&&void 0!==performance&&performance.now?performance.now():(Date.now?Date.now():+new Date)-(null!==(e=null===(e=performance.timing)||void 0===e?void 0:e.navigationStart)&&void 0!==e?e:0)},Ce.prototype.getBounced=function(){return!this.hasLoaded},Ce.prototype.getPaintTime=function(t){if(P()){var e=performance.getEntriesByType("paint");if(u(e)){e=e.filter(function(e){return e.name===t});return e.length&&e[0]&&c(e[0])&&e[0].startTime||0}}return 0},Ce.monitorName=xe,Ce);function Ce(e){var o=this;this.name=xe,this.callback=C,this.sendParams=p({},ke),this.finalSendParams=this.sendParams,this.hasLoaded=!1,this.initStart=0,this.hasSentInitPerf=!1,this.initFlag=!0,this.performanceAuto=!0,this.send=function(){o.initFlag&&o.hasLoaded&&(o.sendParams.isAsync&&(o.sendParams.load=Math.round(o.performanceNow()-o.initStart)),setTimeout(function(){o.perfLog()},200))},this.initAsync=function(){var e,t;o.hasSentInitPerf&&(o.sendParams=p({},ke),o.sendParams.isAsync=1,o.initFlag=!0,o.initStart=o.performanceNow(),o.staticPerformanceMonitor=new Te({isAsync:1}),o.staticPerformanceMonitor.setup(),o.mpfidMonitor=new we({isAsync:1,preLongTaskObserver:o.props.preLongTaskObserver}),o.mpfidMonitor.setup(),t=null!==(e=o.props.TTIMonitor)&&void 0!==e?e:fe,o.ttiMonitor=new t({minValue:Math.round(o.performanceNow()),isAsync:1,preLongTaskObserver:o.props.preLongTaskObserver}),o.ttiMonitor.setup(),null!==(t=null===(e=o.fmpMonitor)||void 0===e?void 0:e.setup)&&void 0!==t&&t.call(e,C))},this.getPerformance=function(){return o.finalSendParams.tti||("complete"===document.readyState?o.perfLog():o.perfLog(!0)),o.buildParams(o.finalSendParams)},this.buildParams=function(e){return{name:o.name,type:"post",event:e}},this.perfLog=function(e){if(void 0===e&&(e=!1),w()){if(o.initFlag=!1,o.finalSendParams=p({},o.sendParams),!o.sendParams.isAsync){var t=o.getBounced();if(t)return o.finalSendParams.bounced=t,void o.invokeCallback(0,o.buildParams(o.finalSendParams));o.finalSendParams=p(p({},o.finalSendParams),o.getParams())}var r=o.getStaticResources(),n=o.getFMP(),t=o.getMPFID();r&&(o.finalSendParams.resources=r,o.finalSendParams.has_resource=1),n&&(o.finalSendParams.fmp=Math.round(n)),n&&o.finalSendParams.fcp&&o.finalSendParams.fmp<o.finalSendParams.fcp&&(o.finalSendParams.fmp=o.finalSendParams.fcp),t&&(o.finalSendParams.mpfid=t),d(o.callback)&&(!e&&o.ttiMonitor&&d(o.ttiMonitor.getTTI)?o.ttiMonitor.getTTI(function(e){e&&0<e&&(o.finalSendParams.tti=o.finalSendParams.isAsync?Math.round(e-o.initStart):e),o.invokeCallback(o.finalSendParams.isAsync,o.buildParams(o.finalSendParams))}):o.invokeCallback(o.finalSendParams.isAsync,o.buildParams(o.finalSendParams)))}},this.invokeCallback=function(e,t){if(!e){if(o.hasSentInitPerf)return;o.hasSentInitPerf=!0}o.callback(t)},this.getStaticResources=function(){var e;if(o.staticPerformanceMonitor&&d(o.staticPerformanceMonitor.getResourcePerformance)){var t=o.staticPerformanceMonitor.getResourcePerformance();if(null!==(e=null==t?void 0:t.event)&&void 0!==e&&e.resources)return t.event.resources||[]}},this.getFMP=function(){var e,t;return o.fmpMonitor?(o.fmpMonitor.disconnect(),o.sendParams.isAsync?(null===(e=null==(t=o.fmpMonitor.getFmp())?void 0:t.event)||void 0===e?void 0:e.fmp)||0:d(o.fmpMonitor.getLoadFmp)?1!==o.props.renderType?2===o.props.renderType?o.getPaintTime("first-contentful-paint"):0:null!==(t=null===(t=(t=o.fmpMonitor.getLoadFmp()||{}).event)||void 0===t?void 0:t.fmp)&&void 0!==t?t:0:0):0},this.getMPFID=function(){if(o.mpfidMonitor&&d(o.mpfidMonitor.getMPFID)){var e=o.mpfidMonitor.getMPFID();if(e)return e.mpfid}},this.syncPerfLog=function(){var e,t;o.hasSentInitPerf||(o.perfLog(!0),null!==(t=(e=o.props).report)&&void 0!==t&&t.call(e))},this.hasFID=function(e){o.sendParams.fid=e.fid},this.getParams=function(){if(w()){var e={},t=window.performance.timing;e.dns=t.domainLookupEnd-t.domainLookupStart,e.tcp=t.connectEnd-t.connectStart,e.request=t.responseStart-t.requestStart,e.response=t.responseEnd-t.responseStart,e.processing=t.domComplete-t.domLoading,e.blank=t.responseEnd-t.navigationStart,e.domready=t.domInteractive-t.navigationStart,e.load=t.loadEventEnd-t.navigationStart,t.secureConnectionStart&&(e.ssl=t.connectEnd-t.secureConnectionStart),e.domparse=t.domInteractive-t.responseEnd,e.resource=t.loadEventStart-t.domContentLoadedEventEnd,e.ttfb=t.responseStart-t.requestStart,e.redirect=t.redirectEnd-t.redirectStart;var r=o.getPaintTime("first-paint"),t=o.getPaintTime("first-contentful-paint");r&&(e.fp=Math.round(r)),t&&(e.fcp=Math.round(t));r=function(){if(!P())return null;var e=window.performance.getEntriesByType("navigation");return u(e)&&0!==e.length?e[0]:null}(),t=w()?window.performance.timing:null;return(r||t)&&(e.navigation=null!=r?r:t),t&&(e.timing=t),r&&(e.navigation_timing=r),e}},e.fmpMonitor&&(this.fmpMonitor=e.fmpMonitor);var t=e.performanceAuto;this.performanceAuto=void 0===t||t,this.props=null!=e?e:{}}var Oe="StaticErrorMonitor",Le=(je.prototype.setup=function(e){S()&&(this.callback=e,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},je.prototype.getSrc=function(e){return"link"===e.tagName.toLowerCase()?qe(e,"href"):qe(e,"src")},je.prototype.getParams=function(e,t){var r={ev_type:"static",st_type:t},t=x(e);r.st_src=e,r.st_protocol=t.protocol,r.st_domain=t.hostname,r.st_path=t.pathname;t=function(e){var t,r=null===(t=null===(n=window.performance)||void 0===n?void 0:n.getEntriesByType)||void 0===t?void 0:t.call(n,"resource"),n=null==r?void 0:r.length;if(!n)return;for(var o=n-1;-1<o;o--){var i=r[o];if(i.name===e)return i}}(t.href);return t&&(r.timing=t),r},je.monitorName=Oe,je);function je(){var i=this;this.name=Oe,this.callback=C,this.buildEvent=function(e){var t,r,n=e||window.event||{};try{r=null!==(t=null!==(t=n.target)&&void 0!==t?t:n.srcElement)&&void 0!==t?t:{}}catch(n){return}var o=r.tagName;if(o&&f(o)){o=o.toLowerCase();e=i.getSrc(r);if(e&&e!==window.location.href)return{name:i.name,type:"get",event:i.getParams(e,o)}}},this.staticErrorLog=function(e){e=i.buildEvent(e);e&&i.callback(e)}}function qe(e,t){var r;return e.getAttribute&&d(e.getAttribute)?null!==(r=e.getAttribute(t))&&void 0!==r?r:"":null!==(t=e[t])&&void 0!==t?t:""}var He="BreadcrumbMonitor",Ie=(Ae.prototype.setup=function(){this.instrumentDOM()},Ae.prototype.instrumentDOM=function(){var e;"document"in window&&(e=this,window.document.addEventListener("click",e.domEventHandler("click",e.triggerHandlers.bind(e,"dom")),!1),window.document.addEventListener("keypress",e.keypressEventHandler(e.triggerHandlers.bind(e,"dom")),!1))},Ae.prototype.domEventHandler=function(t,r,n){var o=this;return void 0===n&&(n=!1),function(e){o.keypressTimeout=void 0,e&&o.lastCapturedEvent!==e&&(o.lastCapturedEvent=e,o.debounceTimer&&clearTimeout(o.debounceTimer),n?o.debounceTimer=setTimeout(function(){r({event:e,name:t})}):r({event:e,name:t}))}},Ae.prototype.triggerHandlers=function(e,t){if(e)try{this.domBreadcrumb(t)}catch(e){}},Ae.prototype.keypressEventHandler=function(n){var o=this;return function(e){var t;try{t=e.target}catch(e){return}var r=t&&t.tagName;r&&("INPUT"===r||"TEXTAREA"===r||t.isContentEditable)&&(o.keypressTimeout||o.domEventHandler("input",n)(e),clearTimeout(o.keypressTimeout),o.keypressTimeout=window.setTimeout(function(){o.keypressTimeout=void 0},o.debounceDuration))}},Ae.prototype.domBreadcrumb=function(e){var t;try{t=e.event.target?ve(e.event.target):ve(e.event)}catch(e){t="<unknown>"}0!==t.length&&this.addBreadcrumb({category:"ui."+e.name,message:t})},Ae.monitorName=He,Ae);function Ae(e){var n=this;this.name=He,this.breadcrumbs=[],this.getBreadcrumbs=function(){return n.breadcrumbs},this.addBreadcrumb=function(e){var t=p(p({},e),{timestamp:(new Date).getTime()}),r=n.maxBreadcrumbs,e=n.breadcrumbs;return n.breadcrumbs=0<=r?a(e,[t]).slice(-r):a(e,[t]),n},this.debounceDuration=1e3,this.debounceTimer=0,this.breadcrumbs=[],this.maxBreadcrumbs=null!==(e=null==e?void 0:e.maxBreadcrumbs)&&void 0!==e?e:20}var De=(Fe.prototype.sendEvent=function(e){e=this.getEventToBeSent(e);e&&this.idleSendEvent(e)},Fe.prototype.getEventToBeSent=function(e){e=this._modifyEvent(e);if(this._shouldSend(e))return e},Fe.prototype._modifyEvent=function(e){return e},Fe.prototype._shouldSend=function(e){return!0},Fe.prototype._send=function(e){},Fe.prototype.idleSendEvent=function(e){this._send(e)},Fe);function Fe(){}var Be={enableCatchGlobalJSError:!0},Ne="JSExceptionMonitor",Je=(Ue.prototype.setup=function(e){S()&&(this.callback=e,this.options.enableCatchGlobalJSError&&(window.addEventListener("error",this.jsErrorLog),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog)))},Ue.prototype.buildEvent=function(e){if(!function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return 1;default:return e instanceof Error}}(e)?(n(e)&&(t={message:JSON.stringify(e)}),f(e)&&(t={message:e})):t=e,t){var t={ev_type:"js_exception",exception:this.normalizeError(t),breadcrumbs:null!==(t=null===(t=this.options.breadcrumbMonitor)||void 0===t?void 0:t.getBreadcrumbs())&&void 0!==t?t:[]};return{name:this.name,type:"post",event:t}}},Ue.prototype.logError=function(e){e=this.buildEvent(e);e&&this.callback(e)},Ue.prototype.getJSError=function(e){e=e.error;if(e)return e},Ue.prototype.getJSPromiseRejection=function(e){var t=void 0;try{"reason"in e?t=e.reason:"detail"in e&&"reason"in e.detail&&(t=e.detail.reason)}catch(e){}if(t)return t},Ue.prototype.normalizeError=function(e){return{message:e.message,name:e.name,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,stack:e.stack,stacktrace:e.stacktrace,framesToPop:e.framesToPop}},Ue.monitorName=Ne,Ue);function Ue(e){var t=this;this.name=Ne,this.callback=C,this.jsErrorLog=function(e){e=t.getJSError(e);e&&t.logError(e)},this.jsPromiseRejectionLog=function(e){e=t.getJSPromiseRejection(e);e&&t.logError(e)},this.options=p(p({},Be),e)}var Xe="RANGERS_WEB_ID";function ze(){var e={flags:{hookPath:!0,hookXHR:!0,hookFetch:!0,enableSizeStats:!0,enableFMP:!0,enablePerformance:!0,enableResourcePerformance:!0,enableStaticError:!0,enableCatchJSError:!0,enableCatchGlobalJSError:!0,enableCatchJSErrorV2:!1,enableCrash:!0,enableMemoryRecord:!0,enableFPSJankTimesMonitor:!0,enableBreadcrumb:!0,hookConsole:!1}};return e.monitors={BaseMonitor:{appTypeSetting:{type:0,SPA:"",renderType:0},sampleHit:F(1)},JSErrorMonitor:{enable:!0,webIDHit:!0,sampleRate:1,webIDHitBehavior:!1,sampleHitBehavior:!1,ignoreErrors:[],whitelistUrls:[],blacklistUrls:[],download_link:""},AjaxMonitor:{enable:!0,enableError:!1,webIDHit:!0,sampleHit:F(1),sampleRate:1,sampleHitTrace:!1,ignore:Q,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1,webIDHitStaticResource:!1,sampleHitStaticResource:F(W),slowSessionTime:$,spaSlowSessionTime:Y,geckoUrls:[],interval:0,checkPoint:[]},StaticErrorMonitor:{enable:!0,webIDHit:!0,sampleRate:1,ignore:Q},ResourcePerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1},BreadcrumbMonitor:{enable:!0}},e.custom={},e.commonParams={aid:0,pid:"",version:"0.2.14",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:G(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:A(),network_type:D()},e}function Ve(e){e!==function(e,t){var r,n;if(!e||!t)return"";var o=e.split(";"),i={};try{for(var s=v(o),a=s.next();!a.done;a=s.next()){var c=a.value.split("="),u=f(c[0])&&c[0].trim();u&&f(c[1])&&(i[u]=c[1].trim())}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i[t]||""}(document.cookie,Xe)&&(document.cookie=Xe+"="+e+";max-age=7776000;domain="+location.hostname+";path=/")}var Ke,Ge,We,Qe,$e=(Ke="/v2/user/webid",Ge="/v2/user/ssid",We="/v2/event/list",Qe=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(t){[Ke,Ge,We].forEach(function(e){Qe.push(t+e)})}),Qe);function Ye(e){var t=e.sendParams,r=e.monitorsSetting;if(!t||!c(t)||!t.event)return!1;var n,o,e=r;if("AjaxMonitor"===t.name||"FetchMonitor"===t.name){r=H(a(["/monitor_browser/collect"],$e)||[]);if(r&&r.test(t.event.ax_url))return!1}return!(null==e||!e.BaseMonitor.sampleHit)&&("AjaxMonitor"===t.name||"FetchMonitor"===t.name?function(e){var r=e.sendParams,t=e.ajaxMonitor;if(!t)return!0;if("2"!==r.event.ax_status[0]&&"3"!==r.event.ax_status[0])return t.enableError;if(!t.enable)return!1;if(!t.webIDHit)return!1;if(!t.sampleHit||!F(t.sampleRate))return!1;if(u(e=t.whitelistUrls)&&0<e.length){var n=H(t.whitelistUrls||[]);return n&&n.test(r.event.ax_url)?!0:!1}if((n=H(t.ignore||[]))&&n.test(r.event.ax_url))return!1;if((n=t.statusCodeSample)&&l(n,r.event.ax_status))return F(n[r.event.ax_status]);if(t=t.requestUrlSample){var o=!1,i=!1;if(t.forEach(function(e){var t;o||null!=(t=H([e.url]))&&t.test(r.event.ax_url)&&(o=!0,i=F(e.sampleRate))}),o)return i}return!0}({sendParams:t,ajaxMonitor:e.AjaxMonitor}):"PerformanceMonitor"===t.name?!(n=(n={performanceMonitor:e.PerformanceMonitor}).performanceMonitor)||!!n.enable&&(!!n.webIDHit&&!!F(n.sampleRate)):"StaticErrorMonitor"===t.name?(n={sendParams:t,staticErrorMonitor:e.StaticErrorMonitor},o=n.sendParams,!(n=n.staticErrorMonitor)||!!n.enable&&(!!n.webIDHit&&(!!F(n.sampleRate)&&(!(n=H(n.ignore||[]))||!n.test(o.event.st_src))))):"JSExceptionMonitor"===t.name?!(o=(o={jsErrorMonitor:e.JSErrorMonitor}).jsErrorMonitor)||!!o.enable&&(!!o.webIDHit&&!!F(o.sampleRate)):"ResourcePerformanceMonitor"!==t.name||(!(e=(e={resourcePerformanceMonitor:e.ResourcePerformanceMonitor}).resourcePerformanceMonitor)||!!e.enable&&(!!e.webIDHit&&!!F(e.sampleRate))))}function Ze(e){var t=e.sendParams,r=e.commonParams,n=e.custom,e=e.breadcrumbMonitor,e=function(e){var t=e.sendParams,r=e.commonParams,n=e.breadcrumbMonitor;if((e={}).ev_type=t.event.ev_type,e.common=r,"PageViewMonitor"===t.name&&e)return e;if(("AjaxMonitor"===t.name||"FetchMonitor"===t.name)&&e){var o=t.event,o=(o.ev_type,s(o,["ev_type"]));return e.event=o,e}if("PerformanceMonitor"===t.name&&e){t.event.navigation=t.event.navigation_timing;o=t.event,o=(o.ev_type,s(o,["ev_type"]));return e.ev_type="performance",e.event={fp:o.fp,fcp:o.fcp,fmp:o.fmp,tti:o.tti,fid:o.fid,mpfid:o.mpfid,isAsync:o.isAsync,timing:o.timing,navigation:o.navigation_timing,bounced:o.bounced},e}if("StaticErrorMonitor"===t.name&&e){e.ev_type="resource_error";var i=t.event,i=(i.ev_type,s(i,["ev_type"]));return e.event=i,e}if("ResourcePerformanceMonitor"===t.name&&e){e.ev_type="resource";i=t.event,i=(i.ev_type,s(i,["ev_type"]));return e.event=i,e}if("JSExceptionMonitor"===t.name&&e){e.ev_type="js_error";t=t.event,t=(t.ev_type,s(t,["ev_type"]));return e.event=t.exception,e.breadcrumbs=null!==(n=null==n?void 0:n.getBreadcrumbs())&&void 0!==n?n:[],e}return e}({sendParams:t,commonParams:p(p({},null!=r?r:{}),{url:window.location.href}),breadcrumbMonitor:e});return n&&d(n.beforeSend)&&(e=n.beforeSend(e||{})),e}var et,tt,rt,nt={cover:C,accumulate:C,reportDirectly:C,average:C},ot=function(e){var r=this;this.cover=function(e,t){r.log.cover(e,t)},this.accumulate=function(e,t){r.log.accumulate(e,t)},this.reportDirectly=function(e,t){r.log.reportDirectly(e,t)},this.average=function(e,t){r.log.average(e,t)},this.log=null!==(e=e.transport)&&void 0!==e?e:nt},it=(r(tt=at,rt=et=De),tt.prototype=null===rt?Object.create(rt):(st.prototype=rt.prototype,new st),at.prototype.uploadQueue=function(){},at.prototype._shouldSend=function(e){return Ye({sendParams:e,monitorsSetting:this.options.monitorsSetting})},at.prototype._modifyEvent=function(e){return(e=(e={sendParams:e}).sendParams)&&c(e)?e:{}},at.prototype.buildParams=function(e){var t,r=null===(t=null===(t=this.options.monitorsSetting)||void 0===t?void 0:t.BreadcrumbMonitor)||void 0===t||!t.enable||null===(r=this.options.monitors)||void 0===r?void 0:r.BreadcrumbMonitor;return Ze({sendParams:e,commonParams:this.options.commonParams,custom:this.options.custom,breadcrumbMonitor:r})},at.prototype._send=function(e){e&&e.event&&e.name&&this.transport&&this.sendByTypes(e)},at.prototype.sendByTypes=function(e){var t;this.transport&&(t={jsBase:null!==(t=this.options.commonParams)&&void 0!==t?t:{},jsInfo:this.buildParams(e)},"PerformanceMonitor"===e.name&&this.transport.cover(t,t.jsInfo.ev_type),"StaticErrorMonitor"===e.name&&this.transport.reportDirectly(t,t.jsInfo.ev_type),"ResourcePerformanceMonitor"===e.name&&this.transport.reportDirectly(t,t.jsInfo.ev_type),"AjaxMonitor"===e.name&&this.transport.reportDirectly(t,t.jsInfo.ev_type),"FetchMonitor"===e.name&&this.transport.reportDirectly(t,t.jsInfo.ev_type),"JSExceptionMonitor"===e.name&&this.transport.reportDirectly(t,t.jsInfo.ev_type),"PageViewMonitor"===e.name&&this.transport.reportDirectly(t,t.jsInfo.ev_type))},at);function st(){this.constructor=tt}function at(e){var o=et.call(this)||this;return o.options={},o.setTransport=function(e){o.transport=new ot({transport:e.transport}),o.preQueue.forEach(function(e){et.prototype.sendEvent.call(o,e)})},o.updateConfig=function(e){var t,r,n;o.options=(t={previousOptions:o.options,newOptions:e},r=t.previousOptions,n=t.newOptions,(e=p(p({},r),n)).commonParams=i({},null!==(t=r.commonParams)&&void 0!==t?t:{},null!==(t=n.commonParams)&&void 0!==t?t:{}),e.monitorsSetting=i({},null!==(t=r.monitorsSetting)&&void 0!==t?t:{},null!==(t=n.monitorsSetting)&&void 0!==t?t:{}),e.monitors=p(p({},null!==(t=r.monitors)&&void 0!==t?t:{}),null!==(t=n.monitors)&&void 0!==t?t:{}),e.custom=p(p({},null!==(r=r.custom)&&void 0!==r?r:{}),null!==(n=n.custom)&&void 0!==n?n:{}),e)},o.sendEvent=function(e){o.transport?et.prototype.sendEvent.call(o,e):o.preQueue.push(e)},o.getEventToBeSent=function(e){return null!==(e=et.prototype.getEventToBeSent.call(o,e))&&void 0!==e?e:{}},o.options=e,o.preQueue=[],o}var ct=(ut.prototype.getUserIDFromRangers=function(t){window.collectEvent&&d(window.collectEvent)&&window.collectEvent("getToken",function(e){t(e)})},ut.prototype.init=function(e){this.client=new it(this.getClientOptions(e)),this.client.updateConfig(this.getClientOptions(e)),this.sendPageview();e=this.setMonitors();this.setupMonitors(e),this.setServerSetting()},ut.prototype.setServerSetting=function(){var e,r=this,t=this.serverSetting;t?(e=this.normalizeServerSetting(t),this.updateSetting(e)):(e="https://tbm.snssdk.com/settings/get/web?aid="+this.baseSetting.commonParams.aid,B.get(e,{success:function(e){try{r.serverSetting=e.data;var t=r.normalizeServerSetting(r.serverSetting);r.updateSetting(t)}catch(e){r.updateSetting(r.baseSetting)}},fail:function(){r.updateSetting(r.baseSetting)}}))},ut.prototype.updateSetting=function(e){this.client.updateConfig(this.getClientOptions(e)),this.client.setTransport({transport:this.userSetting.transport})},ut.prototype.getClientOptions=function(e){return{monitorsSetting:e.monitors,commonParams:e.commonParams,custom:e.custom}},ut.prototype.setMonitors=function(){var e=[],t=this.baseSetting.flags,r=new ae;return e.push(r),t.enableCatchJSError&&e.push(new Je),t.hookXHR&&e.push(new ee({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),t.hookFetch&&e.push(new oe({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),t.enableStaticError&&e.push(new Le),t.enablePerformance&&(t.enableFMP?e.push(new Re({fmpMonitor:r,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):e.push(new Re({renderType:1,preLongTaskObserver:{precollect:(null===(r=window.RangersSiteHybridSDK.lt)||void 0===r?void 0:r.e)||[],observer:null===(r=window.RangersSiteHybridSDK.lt)||void 0===r?void 0:r.o}}))),t.enableBreadcrumb&&e.push(new Ie),t.enableResourcePerformance&&e.push(new Te({observe:!0,checkIgnore:function(e){return"https://tbm.snssdk.com/monitor_browser/collect"===e.name||("xmlhttprequest"===e.initiatorType||"fetch"===e.initiatorType||"beacon"===e.initiatorType||"navigation"===e.initiatorType||0===e.decodedBodySize)}})),e},ut.prototype.setupMonitors=function(e){var t=this;this.client&&this.client.sendEvent&&(e.forEach(function(e){"FMPMonitor"===(t.monitors[e.name]=e).name?e.setup(C):e.setup(null===(e=t.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},ut.prototype.normalizeServerSetting=function(e){var e=(t=e,r=i({JSErrorMonitor:{},AjaxMonitor:{},PerformanceMonitor:{},StaticErrorMonitor:{},BaseMonitor:{},ResourcePerformanceMonitor:{}},r=this.defaultSetting.monitors),(t=t.setting).jserr&&(r.JSErrorMonitor.enable=t.jserr.enable,r.JSErrorMonitor.webIDHit=F(t.jserr.enable_user_rate),r.JSErrorMonitor.sampleRate=t.jserr.enable_sample_rate),t.performance&&(r.PerformanceMonitor.enable=t.performance.enable,r.PerformanceMonitor.webIDHit=F(t.performance.enable_user_rate),r.PerformanceMonitor.sampleRate=t.performance.enable_sample_rate),t.breadcrumb&&(r.BreadcrumbMonitor.enable=t.breadcrumb.enable),t.static_resource_error&&(r.StaticErrorMonitor.enable=t.static_resource_error.enable),t.static_resource&&(r.ResourcePerformanceMonitor.enable=t.static_resource.enable,r.ResourcePerformanceMonitor.webIDHit=F(t.static_resource.enable_user_rate),r.ResourcePerformanceMonitor.sampleRate=t.static_resource.enable_sample_rate),t.request&&(r.AjaxMonitor.enable=t.request.enable,r.AjaxMonitor.enableError=t.request.enableError,r.AjaxMonitor.webIDHit=F(t.request.enable_user_rate),r.AjaxMonitor.sampleRate=t.request.enable_sample_rate),r),t={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(this.userSetting),monitors:e,custom:this.getClientCustom(this.userSetting)},r={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(this.userSetting),monitors:this.getClientMonitorsSetting(this.userSetting),custom:this.getClientCustom(this.userSetting)},e=this.baseSetting;return this.baseSetting=i({},this.baseSetting,t,r),this.baseSetting.commonParams.pid=this.baseSetting.commonParams.pid||location.pathname,this.settingEffect(this.baseSetting,e),this.baseSetting},ut.prototype.normalizeSetting=function(e){var t={commonParams:this.getClientCommonParams(e),flags:this.getClientFlags(e),monitors:this.getClientMonitorsSetting(e),custom:this.getClientCustom(e)},r={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(this.userSetting),monitors:this.getClientMonitorsSetting(this.userSetting),custom:this.getClientCustom(this.userSetting)},e=this.baseSetting;return this.baseSetting=i({},this.baseSetting,t,r),this.baseSetting.commonParams.pid=this.baseSetting.commonParams.pid||location.pathname,this.settingEffect(this.baseSetting,e),this.baseSetting},ut.prototype.settingEffect=function(e,t){Ve(e.commonParams.rangers_web_id),t.commonParams.pid!==e.commonParams.pid&&this.sendPageview()},ut.prototype.sendPageview=function(){var e;null!==(e=this.client)&&void 0!==e&&e.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},ut.prototype.getClientCommonParams=function(r){void 0===r&&(r={});var n={};if(!c(r))return n;var o=["context","pid"];t(r,function(e,t){b(o,e)&&(n[e]=t)});return t({user_unique_id:"rangers_web_id",app_id:"aid"},function(e,t){l(r,e)&&(n[t]=r[e])}),n},ut.prototype.getClientFlags=function(e){void 0===e&&(e={});var r={};if(!c(e))return r;var n=["hookPath","hookXHR","hookFetch","enableSizeStats","enableFMP","enablePerformance","enableStaticError","enableCatchJSError","enableCatchJSErrorV2","enableCatchGlobalJSError","enableResourcePerformance","enableCrash","enableMemoryRecord","enableFPSJankTimesMonitor","enableBreadcrumb","hookConsole"];return t(e,function(e,t){b(n,e)&&(r[e]=t)}),r},ut.prototype.getClientCustom=function(e){var t={};return e.beforeSend&&d(e.beforeSend)&&(t.beforeSend=e.beforeSend),t},ut.prototype.getClientMonitorsSetting=function(e){return e=(t={setting:e}).setting,t=i({JSErrorMonitor:{},AjaxMonitor:{},PerformanceMonitor:{},StaticErrorMonitor:{},ResourcePerformanceMonitor:{},BaseMonitor:{appTypeSetting:{}}},{}),e.ajaxWhitelistUrls&&u(e.ajaxWhitelistUrls)&&(t.AjaxMonitor.whitelistUrls=(t.AjaxMonitor.whitelistUrls||[]).concat(e.ajaxWhitelistUrls)),e.ignoreAjax&&u(e.ignoreAjax)&&(t.AjaxMonitor.ignore=(t.AjaxMonitor.ignore||[]).concat(e.ignoreAjax)),e.ignoreStatic&&u(e.ignoreStatic)&&(t.StaticErrorMonitor.ignore=(t.StaticErrorMonitor.ignore||[]).concat(e.ignoreStatic)),e.ignoreErrors&&u(e.ignoreErrors)&&(t.JSErrorMonitor.ignoreErrors=e.ignoreErrors),e.errorBlacklistUrls&&u(e.errorBlacklistUrls)&&(t.JSErrorMonitor.blacklistUrls=e.errorBlacklistUrls),e.errorWhitelistUrls&&u(e.errorWhitelistUrls)&&(t.JSErrorMonitor.whitelistUrls=e.errorWhitelistUrls),l(e,"sampleRate")&&(t.BaseMonitor.sampleHit=F(e.sampleRate)),t;var t},ut);function ut(){var n=this;this.version="0.2.14",this.instance=function(){for(var e,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];"config"!==t[0]?n.client&&("report"!==t[0]?n.onClose():null!==(e=n.client)&&void 0!==e&&e.uploadQueue()):c(t[1])&&(e=t[1],n.userSetting=p(p({},n.userSetting||{}),e||{}),e=n.normalizeSetting(e),n.client?n.client.updateConfig(n.getClientOptions(e)):n.init(e))},this.changeReortType=function(e){var t;null!==(t=n.client)&&void 0!==t&&t.updateConfig({reportType:e})},this.onClose=function(){I(n.onCloseReport,n.visibilityChange)},this.visibilityChange=function(){"hidden"===document.visibilityState&&n.onCloseReport(),"visible"===document.visibilityState&&n.changeReortType("xhr")},this.onCloseReport=function(){var e;n.changeReortType("beacon"),null!==(e=n.client)&&void 0!==e&&e.uploadQueue()},this.defaultSetting=ze(),this.baseSetting=this.defaultSetting,this.client=void 0,this.serverSetting=void 0,this.userSetting={},this.monitors={}}var lt,pt=C;return S()&&(lt=new ct,pt=lt.instance,null!==(ct=window.RangersSiteHybridSDK)&&void 0!==ct&&ct.q&&(u(ct=window.RangersSiteHybridSDK.q)&&ct.forEach(function(e){pt.apply(void 0,a(e))}),delete window.RangersSiteHybridSDK.q),window.RangersSiteHybridSDK=lt.instance),pt}();
var RangersSiteHybridSDK=function(){"use strict";var r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};var p=function(){return(p=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function s(e,t){var r={};for(o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var n=0,o=Object.getOwnPropertySymbols(e);n<o.length;n++)t.indexOf(o[n])<0&&Object.prototype.propertyIsEnumerable.call(e,o[n])&&(r[o[n]]=e[o[n]]);return r}function v(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function h(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),s=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return s}function a(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(h(arguments[t]));return e}function c(e){return"object"==typeof e&&null!==e&&!u(e)}function n(e){return"[object Object]"===(e=e,Object.prototype.toString.call(e))}function d(e){return"function"==typeof e}function f(e){return"[object String]"===Object.prototype.toString.call(e)}function u(e){return"[object Array]"===Object.prototype.toString.call(e)}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function t(e,t){if(c(e))for(var r in e)l(e,r)&&t.call(null,r,e[r])}function i(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];for(var r={},n=0;n<e.length;)r=g(r,e[n]),n++;return r}var o=Object.getPrototypeOf?Object.getPrototypeOf({}):null;function m(e){return Object.getPrototypeOf?Object.getPrototypeOf(e)===o:e.constructor===Object}function g(e,t){var r,n=p({},e);for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&void 0!==t[r]&&(c(t[r])&&m(t[r])?n[r]=g(c(e[r])?e[r]:{},t[r]):u(e[r])||u(t[r])?n[r]=function t(e,r){var e=u(e)?e:[];var r=u(r)?r:[];return Array.prototype.concat.call(e,r).map(function(e){return!(e instanceof RegExp)&&(u(e)||c(e)&&m(e))?u(e)?t([],e):g({},e):e})}(e[r],t[r]):n[r]=t[r]);return n}function b(e,t){if(!u(e))return!1;if(0===e.length)return!1;for(var r=0;r<e.length;){if(e[r]===t)return!0;r++}return!1}function y(){if("fetch"in window)try{return new Headers,new Request(""),new Response,1}catch(e){return}}function S(){return!!c(window)}function e(){return S()&&!!c(window.performance)}function w(){return e()&&!!c(window.performance.timing)}function P(){return!!e()&&!!d(window.performance.getEntries)}function M(){return S()&&"function"==typeof window.MutationObserver}function E(){return S()&&"function"==typeof window.PerformanceObserver}function T(){return!!E()&&d(window.PerformanceLongTaskTiming)}function _(){if(!E())return!1;var e=window.PerformanceObserverEntryList;return d(e)&&d(e.prototype.getEntries)}function k(e){var r,e=function(e){if(!c(e))return{};var r={};return t(e,function(e,t){c(t)||u(t)?r[e]=JSON.stringify(t):r[e]=t}),r}(e),e=(r={},t(e,function(e,t){r[encodeURIComponent(e)]=encodeURIComponent(t)}),r),n=[];return t(e,function(e,t){n.push(e+"="+t)}),n.join("&")}function R(e){var t=document.createElement("a");t.href=e;e=t.pathname||"/";return"/"!==e[0]&&(e="/"+e),{href:t.href,protocol:t.protocol.slice(0,-1),hostname:t.hostname,host:t.host,search:t.search,pathname:e,hash:t.hash}}var x=function(e){if(!f(e))return!1;return d(e.toLowerCase)&&(e=e.toLowerCase()),b(["x-tt-token"],e)};function C(){}function O(e){var t="[object String]"===Object.prototype.toString.call(e);return e?t?e.length:ArrayBuffer&&e instanceof ArrayBuffer?e.byteLength:window.Blob&&e instanceof Blob?e.size:e.length||0:0}function L(e){if(!e)return"";if(!d(e.forEach))return"";var r=[];return e.forEach(function(e){var t;u(e)&&e[0]&&!x(e[0])&&(t=e[0],e=e[1]||"",r.push(t+": "+e))}),r.join("\r\n")}function j(e){var t={},r=R(e);return t.ax_protocol=r.protocol,t.ax_domain=r.hostname,t.ax_path=r.pathname,t.ax_url=(r.href||e).split("?")[0],t}function q(e,t){e=R(e),t=R(t);return e.protocol===t.protocol&&e.host===t.host}function H(e){return u(e)&&e.length?function(e){for(var t=[],r=e.length,n=0;n<r;n++){var o=e[n];f(o)?t.push(o.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")):o&&o.source&&t.push(o.source)}return new RegExp(t.join("|"),"i")}(e):null}function I(t,r){d(t)&&(d(window.addEventListener)&&(window.addEventListener("unload",t),window.addEventListener("beforeunload",t),window.addEventListener("pagehide",t)),d(document.addEventListener)&&document.addEventListener("visibilitychange",function(e){d(r)?r(e):"hidden"===document.visibilityState&&t(e)}))}var A=function(e){var t,r;return void 0===e&&(e=window),S()&&null!==(t=e.screen)&&void 0!==t&&t.width&&null!==(r=e.screen)&&void 0!==r&&r.height?e.screen.width+"x"+e.screen.height:"0x0"},D=function(){var e="unknown",t=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return t&&f(t.effectiveType)?t.effectiveType:e};function F(e){return!!e&&Math.random()<Number(e)}var B=(N.post=function(e,t,r){var n,o=null!==(n=null==r?void 0:r.success)&&void 0!==n?n:C,i=null!==(r=null==r?void 0:r.fail)&&void 0!==r?r:C,r=new XMLHttpRequest;r.open("POST",e,!0),r.setRequestHeader("Content-Type","application/json"),r.send(JSON.stringify(t)),r.onload=function(){try{var e;this.responseText?(e=JSON.parse(this.responseText),o(e)):o({})}catch(e){i()}},r.onerror=function(){i()},r.onabort=function(){i()}},N.get=function(e,t){var r,n=null!==(r=null==t?void 0:t.success)&&void 0!==r?r:C,o=null!==(r=null==t?void 0:t.fail)&&void 0!==r?r:C,i=null!==(r=null==t?void 0:t.getResponse)&&void 0!==r?r:C,s=null!==(t=null==t?void 0:t.getResponseText)&&void 0!==t?t:C,t=new XMLHttpRequest;t.open("GET",e),t.send(),t.onload=function(){i(null==this?void 0:this.response),s(this.responseText);try{var e;this.responseText?(e=JSON.parse(this.responseText),n(e)):n({})}catch(e){o()}},t.onerror=function(){o()},t.onabort=function(){o()}},N.prototype.getCommonParams=function(){return{timestamp:Date.now()}},N);function N(e){var t=this;this.postEvent=function(e){e=p(p({},e),t.getCommonParams());N.post(t.url,e)},this.getEvent=function(e){e=k(p(p({},e),t.getCommonParams())),e=t.url+"?"+e;N.get(e)},this.getURL=function(){return t.url},this.options=e,this.url=this.options.reportURL}function J(e,t,r){if(void 0===r&&(r="0"),1<r.length)throw new TypeError("expect the length of pad to be 1, but got "+e.length);return e.length>=t?e:""+Array.from({length:t-e.length}).fill(r).join("")+e}function U(e){return e?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,e):""}var X="x-tt-trace-id",z="x-tt-trace-host",V="x-tt-logid";function K(e,t,r){void 0===r&&(r="01");t=""+J((Date.now()%4294967295).toString(16),8)+function(e){if("number"==typeof e)r=e;else{var t=e.replace(/-/g,"");if(!/^[0-9]+$/.test(t)){if(18<t.length)return"18"+U(18);e=22-t.length-4;return""+J(""+t.length,2)+t+U(e)}r=parseInt(t,10)}var r=22-(t=r.toString(16)).length-4;return""+J(""+t.length,2)+t+U(r)}(e)+("string"==typeof t?U(4):J(t.toString(16),4));return"00-"+t+"-"+t.substr(0,16)+"-"+r}function G(){var e=function(){for(var e=new Array(16),t=0,r=0;r<16;r++)0==(3&r)&&(t=4294967296*Math.random()),e[r]=t>>>((3&r)<<3)&255;return e}();return e[6]=15&e[6]|64,e[8]=63&e[8]|128,function(e){for(var t=[],r=0;r<256;++r)t[r]=(r+256).toString(16).substr(1);var n=0;return[t[e[n++]],t[e[n++]],t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],"-",t[e[n++]],t[e[n++]],t[e[n++]],t[e[n++]],t[e[+n]],t[e[15]]].join("")}(e)}var W=.1,Q=["/log/sentry/"],$=8e3,Y=4e3;G(),G();var Z="AjaxMonitor",ee=(te.prototype.setup=function(e){void 0===e&&(e=C),d(XMLHttpRequest)&&(this.callback=e,this.start())},te.prototype.updateConfig=function(e){this.props=i({},this.props,e)},te.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},te.prototype.hookXMLHttpRequestSetRequestHeader=function(){var r=XMLHttpRequest.prototype.setRequestHeader||C;XMLHttpRequest.prototype.setRequestHeader=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return this._requestHeaders=this._requestHeaders||[],this._requestHeaders.push(e),r.apply(this,e)}},te.prototype.hookXMLHttpRequestOpen=function(){var o=XMLHttpRequest.prototype.open;XMLHttpRequest.prototype.open=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=e[0],n=e[1];return this._url=n||"",this._method=(null==r?void 0:r.toLowerCase())||"",o.apply(this,e)}},te.prototype.hookXMLHttpRequestSend=function(){var o=this,i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.send=function(){for(var e,t,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];return o.checkAddTrace(this._url)&&(e=(t=null!==(e=null==o?void 0:o.props.commonParams)&&void 0!==e?e:{}).bid,t=t.web_id,e&&t&&(o.traceId=K(t,e),this.setRequestHeader(X,o.traceId))),o.hookXMLHttpRequestOnreadystatechange.call(this,o),this._start=Date.now(),this._data=null==r?void 0:r[0],i.apply(this,r)}},te.prototype.checkAddTrace=function(e){var t=null!==(n=this.props.commonParams)&&void 0!==n?n:{},r=t.bid,n=t.web_id,t=(null!==(t=this.props.ajaxMonitorOptions)&&void 0!==t?t:{}).sampleHitTrace,e=q(location.href,e);return r&&n&&t&&e},te.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},te.prototype.hookXMLHttpRequestOnreadystatechange=function(i){var s=this.onreadystatechange,a=this;this.onreadystatechange=function(){for(var e,t,r,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];if(4===this.readyState&&(t={ev_type:"ajax",ax_status:(this.status||0).toString(),ax_type:a._method,ax_request_header:L(a._requestHeaders||[]),ax_domain:"",ax_duration:0,ax_path:"",ax_protocol:"",ax_response_header:"",ax_size:0,ax_url:""},"function"==typeof this.getAllResponseHeaders&&(t.ax_response_header=function(t){if(f(t)){var e=t.split("\r\n"),r=[];return e.forEach(function(e,t){e&&d(e.split)&&(e=e.split(": "),r.push([e[0],e[1]]))}),L(r)}return c(t)?L(Object.keys(t).map(function(e){return[e,t[e]]})):t}(this.getAllResponseHeaders())),!i.checkAddTrace(a._url)||(r=null!==(r=i.traceId)&&void 0!==r?r:this.getResponseHeader(X))&&(t.trace_id=r,t.trace_host=null!==(e=this.getResponseHeader(z))&&void 0!==e?e:void 0,t.log_id=null!==(e=this.getResponseHeader(V))&&void 0!==e?e:void 0),t.ax_duration=Date.now()-a._start,200===this.status&&(t.ax_size=function(e){var t=0;if(""===e.responseType||"text"===e.responseType)t=O(e.responseText);else if(e.response)t=O(e.response);else try{t=O(e.responseText)}catch(e){t=0}return t}(this)),t=p(p({},t),j(a._url)),i.collectErrorRequest()&&"2"!==t.ax_status[0]&&"3"!==t.ax_status[0]&&(t.ax_request={body:a._data?""+a._data:void 0,search:null===(e=R(a._url))||void 0===e?void 0:e.search,content_type:null===(e=null===(e=a._requestHeaders)||void 0===e?void 0:e.find(function(e){return"content-type"===e[0].toLowerCase()}))||void 0===e?void 0:e[1]}),d(i.callback)&&i.callback({name:i.name,type:"get",event:t})),s)return s.apply(this,n)}},te.monitorName=Z,te);function te(e){this.name=Z,this.callback=C,this.traceId=null,this.props=e}function re(e){return e instanceof Request}var ne="FetchMonitor",oe=(ie.prototype.updateConfig=function(e){this.props=i({},this.props,e)},ie.prototype.setup=function(e){void 0===e&&(e=C),y()&&(this.callback=e,this.start())},ie.prototype.start=function(){y()&&this.hookFetch()},ie.prototype.checkAddTrace=function(e){var t=null!==(n=null===(r=this.props)||void 0===r?void 0:r.commonParams)&&void 0!==n?n:{},r=t.bid,n=t.web_id,t=(null!==(t=null===(t=null==this?void 0:this.props)||void 0===t?void 0:t.ajaxMonitorOptions)&&void 0!==t?t:{}).sampleHitTrace,e=q(location.href,e);return r&&n&&t&&e},ie.prototype.updateAxRequest=function(e,t,r){var n,o;this.collectErrorRequest()&&"2"!==e.ax_status[0]&&"3"!==e.ax_status[0]&&(o=this.getFetchUrl(t,!0),e.ax_request={body:null===(t=this.getFetchBody(t,r))||void 0===t?void 0:t.toString(),search:!f(o)||null===(n=R(o))||void 0===n?void 0:n.search,content_type:null===(r=null==r?void 0:r.headers)||void 0===r?void 0:r["Content-Type"]})},ie.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},ie.prototype.hookFetch=function(){var c=this,u=this,l=window.fetch;window.fetch=function(n,o){void 0===o&&(o={});var i=c.getFetchUrl(n);if(!function(e){if(f(e)){var t=h(e.split(":"),2),e=t[0];return!t[1]||("http"===e||"https"===e)}}(i))return l(n,o);var e=null!==(e=c.props.commonParams)&&void 0!==e?e:{},t=e.bid,r=e.web_id,s=Date.now(),a={ev_type:"ajax"};try{u.checkAddTrace(i)&&(o.headers=new Headers(function(e,t){var r=new Headers;re(e)&&e.headers&&d(e.headers.forEach)&&e.headers.forEach(function(e,t){r.append(t,e)});t.headers&&new Headers(t.headers).forEach(function(e,t){r.append(t,e)});return r}(n,o)),t&&r&&(a.trace_id=K(t,r),o.headers.append(X,a.trace_id)))}catch(e){}return a.ax_type=c.getFetchMethod(n,o),a=p(p({},a),j(i)),l(n,o).then(function(e){var t,r;return a.ax_status=(e.status||0).toString(),a.ax_duration=Date.now()-s,a.ax_response_header=u.getAllHeaders(e.headers),a.ax_request_header=u.getAllHeaders(o.headers),e.headers&&d(e.headers.has)?(e.headers.has("content-length")?a.ax_size=Number(e.headers.get("content-length"))||0:a.ax_size=0,u.checkAddTrace(i)&&(e.headers.has(z)&&(a.trace_host=null!==(t=e.headers.get(z))&&void 0!==t?t:void 0),e.headers.has(X)&&(a.trace_id=null!==(r=e.headers.get(X))&&void 0!==r?r:void 0),e.headers.has(V)&&(a.log_id=null!==(r=e.headers.get(V))&&void 0!==r?r:void 0))):a.ax_size=0,c.updateAxRequest(a,n,o),d(u.callback)&&u.callback({name:u.name,type:"get",event:a}),e},function(e){return a.ax_status="0",a.ax_size=0,a.ax_duration=Date.now()-s,c.updateAxRequest(a,n,o),d(u.callback)&&u.callback({name:u.name,type:"get",event:a}),Promise.reject(e)})}},ie.prototype.getFetchUrl=function(e,t){void 0===t&&(t=!1);var r="",r=re(e)?e.url:e;return t||(r=f(r)?r.split("?")[0]:r),r},ie.prototype.getFetchMethod=function(e,t){t=null!==(t=null==t?void 0:t.method)&&void 0!==t?t:"get";return re(e)&&(t=null!==(e=e.method)&&void 0!==e?e:t),t.toLowerCase()},ie.prototype.getFetchBody=function(e,t){return re(e)?e.body:null==t?void 0:t.body},ie.prototype.getAllHeaders=function(e){if(!e||"function"!=typeof e.forEach)return"";var r=[];return e.forEach(function(e,t){r.push([t,e])}),L(r)},ie.monitorName=ne,ie);function ie(e){this.name=ne,this.callback=C,this.props=e}var se="FMPMonitor",ae=(ce.prototype.setup=function(e){if(S())return M()?void(d(document.querySelector)&&(this.callback=e&&d(e)?e:function(){},this.startTime=Date.now(),this.list=[],d(this.observer.observe)&&this.observer.observe(document,{childList:!0,subtree:!0}))):null},ce.prototype.count=function(){var e=Date.now()-this.startTime,t=document.querySelector("body");t?this.list.push({score:this.score(t,1,!1),time:e}):this.list.push({score:0,time:e})},ce.prototype.score=function(e,t,r){var n=0,o=e.tagName;if("SCRIPT"!==o&&"STYLE"!==o&&"META"!==o&&"HEAD"!==o){o=e.children?e.children.length:0;if(0<o)for(var i=e.children,s=o-1;0<=s;s--)n+=this.score(i[s],t+1,0<n);if(n<=0&&!r){if(!e.getBoundingClientRect||!d(e.getBoundingClientRect))return 0;e=e.getBoundingClientRect();if(!e)return 0;if(e.top>window.innerHeight)return 0;if(e.height<=0)return 0}n+=1+.5*t}return n},ce.prototype.getFmpInternal=function(){if(!this.observer)return 0;if(this.disconnect(),!this.list.length)return 0;for(var e,t={time:this.list[0].time,rate:0},r=1;r<this.list.length;r++)this.list[r].time>=this.list[r-1].time&&(e=this.list[r].score-this.list[r-1].score,t.rate<e&&(t={time:this.list[r].time,rate:e}));return t.time},ce.prototype.getTimeGap=function(){return w()?this.startTime-performance.timing.navigationStart:0},ce.prototype.formatEvent=function(e){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:e}}},ce.monitorName=se,ce);function ce(){var r=this;this.name=se,this.callback=C,this.disconnect=function(){var e,t;null!==(t=null===(e=r.observer)||void 0===e?void 0:e.disconnect)&&void 0!==t&&t.call(e)},this.getLoadFmp=function(){var e=r.getFmpInternal(),e=e?r.getTimeGap()+e:0,e=r.formatEvent(e);return r.callback(e),e},this.getFmp=function(){var e=r.getFmpInternal(),e=r.formatEvent(e);return r.callback(e),e},this.startTime=Date.now(),this.list=[],this.observer=new MutationObserver(this.count.bind(this))}function ue(){}var le=!1,pe=!1,he={uniqueId:0,originals:{},proxies:{},patchXMLHTTPRequest:function(i){this.originals.send=XMLHttpRequest.prototype.send,XMLHttpRequest.prototype.send=function(){for(var t=this,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var n=he.uniqueId++;i.beforeCb(n);var o=this.onreadystatechange;return this.onreadystatechange=function(e){null!=o&&o.call(t,e),4===t.readyState&&i.afterCb(n)},he.originals.send.apply(this,e)},this.proxies.send=XMLHttpRequest.prototype.send},patchFetch:function(o){var i;y()&&(i=window.fetch,this.originals.fetch=i,window.fetch=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new Promise(function(t,r){var n=he.uniqueId++;o.beforeCb(n),i.apply(void 0,a(e)).then(function(e){o.afterCb(n),t(e)},function(e){o.afterCb(n,e),r(e)})})},this.proxies.fetch=window.fetch)},observeResourceFetchingMutations:function(s){if(M()){var a=["img","script","iframe","link","audio","video","source"],e=new MutationObserver(function(e){var t,r;try{for(var n=v(e),o=n.next();!o.done;o=n.next()){var i=o.value;("childList"===i.type&&function e(t,r){var n,o;try{for(var i=v(t),s=i.next();!s.done;s=i.next()){var a=s.value;if(r.includes(a.nodeName.toLowerCase())||a.children&&e(a.children,r))return 1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}}(i.addedNodes,a)||"attributes"===i.type&&a.includes(i.target.nodeName.toLowerCase()))&&s(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}});return e.observe(document,{attributes:!0,childList:!0,subtree:!0,attributeFilter:["href","src"]}),e}},resetOriginals:function(){this.originals.send&&XMLHttpRequest.prototype.send===this.proxies.send&&(le=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(pe=!1,window.fetch=this.originals.fetch)}},de="TTIMonitor",fe=(me.prototype.setup=function(){},me.prototype.isEnable=function(){return T()&&!!E()&&d(window.PerformanceResourceTiming)&&_()},me.prototype.registerPerformanceObserver=function(){var a=this;this.performanceObserver=new PerformanceObserver(function(e){var t,r,n=e.getEntries();try{for(var o=v(n),i=o.next();!i.done;i=o.next()){var s=i.value;"resource"===s.entryType&&a.networkRequestFinishedCallback(s),"longtask"===s.entryType&&a.longTaskFinishedCallback(s)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}});try{this.performanceObserver.observe({type:"longtask"}),this.performanceObserver.observe({type:"resource",buffered:!0})}catch(e){this.performanceObserver.observe({entryTypes:["longtask","resource"]})}},me.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),he.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=ue,this.proxyConfig.afterCb=ue)},me.prototype.rescheduleTimer=function(e){var t=this;this.scheduleTimerTasks&&(this.timerActivationTime>e||(clearTimeout(this.timerId),this.timerId=window.setTimeout(function(){t.checkTTI()},e-performance.now()),this.timerActivationTime=e))},me.prototype.startSchedulingTimerTasks=function(){this.scheduleTimerTasks=!0;var e=0<this.longTasks.length?this.longTasks[this.longTasks.length-1].end:0,t=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests);this.rescheduleTimer(Math.max(t+5e3,e))},me.prototype.registerListeners=function(){le||(he.patchXMLHTTPRequest(this.proxyConfig),le=!0),pe||(he.patchFetch(this.proxyConfig),pe=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=he.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},me.prototype.mutationObserverCallback=function(e){this.rescheduleTimer(performance.now()+5e3)},me.prototype.beforeJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=performance.now()},me.prototype.afterJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=void 0},me.prototype.networkRequestFinishedCallback=function(e){this.networkRequests.push({start:e.fetchStart,end:e.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(me.prototype,"incompleteRequestStarts",{get:function(){for(var e=Object.keys(this.incompleteJSInitiatedRequestStartTimes),t=[],r=0;r<e.length;r++){var n=this.incompleteJSInitiatedRequestStartTimes[e[r]];"number"==typeof n&&t.push(n)}return t},enumerable:!1,configurable:!0}),me.prototype.longTaskFinishedCallback=function(e){var t=e.startTime+e.duration;this.longTasks.push({start:e.startTime,end:t}),this.rescheduleTimer(t+5e3)},me.prototype.checkTTI=function(){var e=this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests),t=this.getFirstPaintTime()||performance.timing.domContentLoadedEventEnd-performance.timing.navigationStart,r=this.getMinValue(),n=performance.now();null===r&&this.rescheduleTimer(Math.max(e+5e3,n+1e3));n=this.computeTTI(t,r,e,n,this.longTasks);n?(this.callback&&"function"==typeof this.callback&&this.callback(Math.round(n)),this.disable()):this.rescheduleTimer(performance.now()+1e3)},me.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var e=performance.timing;return e.domContentLoadedEventEnd-e.navigationStart}return null},me.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var e=performance.getEntriesByType("paint")[0];return e?e.startTime:0}return 0},me.prototype.disable=function(){clearTimeout(this.timerId),this.scheduleTimerTasks=!1,this.unregisterListeners(),this.snippetObserver&&this.snippetObserver.disconnect(),this.snippetEntries&&this.snippetEntries.splice(0,this.snippetEntries.length)},me.prototype.computeLastKnownNetwork2Busy=function(e,t){var r,n,o,i;if(2<e.length)return performance.now();var s=[];try{for(var a=v(t),c=a.next();!c.done;c=a.next()){var u=c.value;s.push({timestamp:u.start,type:"requestStart"}),s.push({timestamp:u.end,type:"requestEnd"})}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}try{for(var l=v(e),p=l.next();!p.done;p=l.next()){var h=p.value;s.push({timestamp:h,type:"requestStart"})}}catch(e){o={error:e}}finally{try{p&&!p.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}s.sort(function(e,t){return e.timestamp-t.timestamp});for(var d=e.length,f=s.length-1;0<=f;f--){var m=s[f];switch(m.type){case"requestStart":d--;break;case"requestEnd":if(2<++d)return m.timestamp;break;default:throw Error("Internal Error: This should never happen")}}return 0},me.monitorName=de,me);function me(e){var t,r,n,o=this;if(this.name=de,this.longTasks=[],this.callback=ue,this.useMutationObserver=!0,this.minValue=null,this.isAsync=0,this.networkRequests=[],this.incompleteJSInitiatedRequestStartTimes={},this.timerActivationTime=-1/0,this.scheduleTimerTasks=!1,this.proxyConfig={beforeCb:this.beforeJSInitiatedRequestCallback.bind(this),afterCb:this.afterJSInitiatedRequestCallback.bind(this)},this.getTTI=function(e){o.callback=e,o.isEnable()?o.startSchedulingTimerTasks():o.callback&&"function"==typeof o.callback&&o.callback()},this.computeTTI=function(e,t,r,n,o){if(n-r<5e3)return null;o=0===o.length?e:o[o.length-1].end;return n-o<5e3?null:Math.max(o,t)},this.isEnable()){if(this.useMutationObserver=!!e.useMutationObserver,this.minValue=null!==(n=e.minValue)&&void 0!==n?n:null,this.isAsync=null!==(n=e.isAsync)&&void 0!==n?n:0,this.snippetEntries=null===(n=null==e?void 0:e.preLongTaskObserver)||void 0===n?void 0:n.precollect,this.snippetObserver=null===(e=null==e?void 0:e.preLongTaskObserver)||void 0===e?void 0:e.observer,!this.isAsync&&this.snippetEntries&&0<this.snippetEntries.length)try{for(var i=v(this.snippetEntries),s=i.next();!s.done;s=i.next()){var a=s.value;"longtask"===a.entryType?this.longTasks.push({start:a.startTime,end:a.startTime+a.duration}):"resource"===a.entryType&&this.networkRequests.push({start:a.fetchStart,end:a.responseEnd})}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}this.registerListeners()}}function ve(e){try{for(var t,r=e,n=[],o=0,i=0,s=" > ".length;r&&o++<5&&!("html"===(t=function(e){var t,r,n,o,i=e,s=[];if(!i||!i.tagName)return"";s.push(i.tagName.toLowerCase()),i.id&&s.push("#"+i.id);e=i.className;if(e&&f(e))for(t=e.split(/\s+/),o=0;o<t.length;o++)s.push("."+t[o]);var a=["type","name","title","alt"];for(o=0;o<a.length;o++)r=a[o],(n=i.getAttribute(r))&&s.push("["+r+'="'+n+'"]');return s.join("")}(r))||1<o&&80<=i+n.length*s+t.length);)n.push(t),i+=t.length,r=r.parentNode;return n.reverse().join(" > ")}catch(e){return"<unknown>"}}var ge="FIDMonitor",be=(ye.prototype.setup=function(e){var a=this;if(E()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&_()){this.callback=e,this.observer=new PerformanceObserver(function(e,t){var r,n;try{for(var o=v(e.getEntries()),i=o.next();!i.done;i=o.next()){var s=i.value,s=s.processingStart-s.startTime;a.callback({name:a.name,fid:Math.round(s)})}}catch(e){r={error:e}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.disconnect()});try{this.observer.observe({type:"first-input",buffered:!0})}catch(e){this.observer.observe({entryTypes:["first-input"]})}}},ye.monitorName=ge,ye);function ye(){this.name=ge,this.callback=C}var Se="MPFIDMonitor",we=(Pe.prototype.setup=function(){var t,e,r,s=this;if(T()&&_()){if(!this.props.isAsync){var n=null!==(r=null===(r=this.props.preLongTaskObserver)||void 0===r?void 0:r.precollect)&&void 0!==r?r:[];if(n&&0<n.length)try{for(var o=v(n),i=o.next();!i.done;i=o.next()){var a=i.value;"longtask"===a.entryType&&this.list.push(a)}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}}this.observer=new PerformanceObserver(function(e){var t,r;try{for(var n=v(e.getEntries()),o=n.next();!o.done;o=n.next()){var i=o.value;s.list.push(i)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}),this.observer.observe({entryTypes:["longtask"]})}},Pe.prototype.getMPFID=function(){var t,e;if(T()&&_()){this.observer&&this.observer.disconnect();var r=0;try{for(var n=v(this.list),o=n.next();!o.done;o=n.next()){var i=o.value;r<i.duration&&(r=i.duration)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(e=n.return)&&e.call(n)}finally{if(t)throw t.error}}return this.formatEvent(Math.round(r))}},Pe.prototype.formatEvent=function(e){return{name:this.name,mpfid:e}},Pe.monitorName=Se,Pe);function Pe(e){this.name=Se,this.list=[],this.props=e}var Me=[],Ee="ResourcePerformanceMonitor",Te=(_e.prototype.setup=function(e){this.isEnable()&&(this.callback=null!=e?e:C,this.isAsync&&window.performance.clearResourceTimings(),this.observe&&(this.sendResourcePerformance(performance.getEntriesByType("resource")),this.observePerformance()))},_e.prototype.isEnable=function(){return P()&&"function"==typeof performance.clearResourceTimings},_e.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},_e.prototype.buildParams=function(e){var t=this,r=[];if(e.forEach(function(e){d(t.checkIgnore)&&t.checkIgnore(e)||r.push(e)}),r.length)return{name:this.name,type:"post",event:{ev_type:"resource_performance",resources:r}}},_e.prototype.sendResourcePerformance=function(e){e=this.buildParams(e);e&&this.callback(e)},_e.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(e){return!b(Me,e.initiatorType)})},_e.prototype.observePerformance=function(){var t=this;E()&&new PerformanceObserver(function(e){e=e.getEntries();e.length&&t.sendResourcePerformance(e)}).observe({entryTypes:["resource"]})},_e.monitorName=Ee,_e);function _e(e){var t,r=this;this.name=Ee,this.callback=C,this.getResourcePerformance=function(){var e;return null!==(e=r.getPerformance())&&void 0!==e?e:{}},this.isAsync=null!==(t=null==e?void 0:e.isAsync)&&void 0!==t?t:0,this.observe=null!==(t=null==e?void 0:e.observe)&&void 0!==t&&t,this.checkIgnore=null!==(e=null==e?void 0:e.checkIgnore)&&void 0!==e?e:function(){return!1}}var ke={ev_type:"perf",isAsync:0,dns:0,tcp:0,request:0,response:0,processing:0,blank:0,domready:0,load:0,has_resource:0,domparse:0,resource:0,ttfb:0,redirect:0,tti:0,upload_reason:"sample",network_type:"",timing:{},navigation_timing:{},navigation:{},resources:[]},Re="PerformanceMonitor",xe=(Ce.prototype.setup=function(e){var t,r=this;w()&&(this.callback=e,t=function(){r.hasLoaded=!0,r.performanceAuto&&setTimeout(function(){r.perfLog()},200)},"complete"!==document.readyState?window.addEventListener("load",function(){setTimeout(function(){t()},0)},!1):t(),this.sendParams=p({},ke),this.staticPerformanceMonitor=new Te,this.staticPerformanceMonitor.setup(),(new be).setup(this.hasFID),this.mpfidMonitor=new we({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),e=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:fe,this.ttiMonitor=new e({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),e=this.syncPerfLog.bind(this),I(e))},Ce.prototype.performanceNow=function(){var e;return null!==performance&&void 0!==performance&&performance.now?performance.now():(Date.now?Date.now():+new Date)-(null!==(e=null===(e=performance.timing)||void 0===e?void 0:e.navigationStart)&&void 0!==e?e:0)},Ce.prototype.getBounced=function(){return!this.hasLoaded},Ce.prototype.getPaintTime=function(t){if(P()){var e=performance.getEntriesByType("paint");if(u(e)){e=e.filter(function(e){return e.name===t});return e.length&&e[0]&&c(e[0])&&e[0].startTime||0}}return 0},Ce.monitorName=Re,Ce);function Ce(e){var o=this;this.name=Re,this.callback=C,this.sendParams=p({},ke),this.finalSendParams=this.sendParams,this.hasLoaded=!1,this.initStart=0,this.hasSentInitPerf=!1,this.initFlag=!0,this.performanceAuto=!0,this.send=function(){o.initFlag&&o.hasLoaded&&(o.sendParams.isAsync&&(o.sendParams.load=Math.round(o.performanceNow()-o.initStart)),setTimeout(function(){o.perfLog()},200))},this.initAsync=function(){var e,t;o.hasSentInitPerf&&(o.sendParams=p({},ke),o.sendParams.isAsync=1,o.initFlag=!0,o.initStart=o.performanceNow(),o.staticPerformanceMonitor=new Te({isAsync:1}),o.staticPerformanceMonitor.setup(),o.mpfidMonitor=new we({isAsync:1,preLongTaskObserver:o.props.preLongTaskObserver}),o.mpfidMonitor.setup(),t=null!==(e=o.props.TTIMonitor)&&void 0!==e?e:fe,o.ttiMonitor=new t({minValue:Math.round(o.performanceNow()),isAsync:1,preLongTaskObserver:o.props.preLongTaskObserver}),o.ttiMonitor.setup(),null!==(t=null===(e=o.fmpMonitor)||void 0===e?void 0:e.setup)&&void 0!==t&&t.call(e,C))},this.getPerformance=function(){return o.finalSendParams.tti||("complete"===document.readyState?o.perfLog():o.perfLog(!0)),o.buildParams(o.finalSendParams)},this.buildParams=function(e){return{name:o.name,type:"post",event:e}},this.perfLog=function(e){if(void 0===e&&(e=!1),w()){if(o.initFlag=!1,o.finalSendParams=p({},o.sendParams),!o.sendParams.isAsync){var t=o.getBounced();if(t)return o.finalSendParams.bounced=t,void o.invokeCallback(0,o.buildParams(o.finalSendParams));o.finalSendParams=p(p({},o.finalSendParams),o.getParams())}var r=o.getStaticResources(),n=o.getFMP(),t=o.getMPFID();r&&(o.finalSendParams.resources=r,o.finalSendParams.has_resource=1),n&&(o.finalSendParams.fmp=Math.round(n)),n&&o.finalSendParams.fcp&&o.finalSendParams.fmp<o.finalSendParams.fcp&&(o.finalSendParams.fmp=o.finalSendParams.fcp),t&&(o.finalSendParams.mpfid=t),d(o.callback)&&(!e&&o.ttiMonitor&&d(o.ttiMonitor.getTTI)?o.ttiMonitor.getTTI(function(e){e&&0<e&&(o.finalSendParams.tti=o.finalSendParams.isAsync?Math.round(e-o.initStart):e),o.invokeCallback(o.finalSendParams.isAsync,o.buildParams(o.finalSendParams))}):o.invokeCallback(o.finalSendParams.isAsync,o.buildParams(o.finalSendParams)))}},this.invokeCallback=function(e,t){if(!e){if(o.hasSentInitPerf)return;o.hasSentInitPerf=!0}o.callback(t)},this.getStaticResources=function(){var e;if(o.staticPerformanceMonitor&&d(o.staticPerformanceMonitor.getResourcePerformance)){var t=o.staticPerformanceMonitor.getResourcePerformance();if(null!==(e=null==t?void 0:t.event)&&void 0!==e&&e.resources)return t.event.resources||[]}},this.getFMP=function(){var e,t;return o.fmpMonitor?(o.fmpMonitor.disconnect(),o.sendParams.isAsync?(null===(e=null==(t=o.fmpMonitor.getFmp())?void 0:t.event)||void 0===e?void 0:e.fmp)||0:d(o.fmpMonitor.getLoadFmp)?1!==o.props.renderType?2===o.props.renderType?o.getPaintTime("first-contentful-paint"):0:null!==(t=null===(t=(t=o.fmpMonitor.getLoadFmp()||{}).event)||void 0===t?void 0:t.fmp)&&void 0!==t?t:0:0):0},this.getMPFID=function(){if(o.mpfidMonitor&&d(o.mpfidMonitor.getMPFID)){var e=o.mpfidMonitor.getMPFID();if(e)return e.mpfid}},this.syncPerfLog=function(){var e,t;o.hasSentInitPerf||(o.perfLog(!0),null!==(t=(e=o.props).report)&&void 0!==t&&t.call(e))},this.hasFID=function(e){o.sendParams.fid=e.fid},this.getParams=function(){if(w()){var e={},t=window.performance.timing;e.dns=t.domainLookupEnd-t.domainLookupStart,e.tcp=t.connectEnd-t.connectStart,e.request=t.responseStart-t.requestStart,e.response=t.responseEnd-t.responseStart,e.processing=t.domComplete-t.domLoading,e.blank=t.responseEnd-t.navigationStart,e.domready=t.domInteractive-t.navigationStart,e.load=t.loadEventEnd-t.navigationStart,t.secureConnectionStart&&(e.ssl=t.connectEnd-t.secureConnectionStart),e.domparse=t.domInteractive-t.responseEnd,e.resource=t.loadEventStart-t.domContentLoadedEventEnd,e.ttfb=t.responseStart-t.requestStart,e.redirect=t.redirectEnd-t.redirectStart;var r=o.getPaintTime("first-paint"),t=o.getPaintTime("first-contentful-paint");r&&(e.fp=Math.round(r)),t&&(e.fcp=Math.round(t));r=function(){if(!P())return null;var e=window.performance.getEntriesByType("navigation");return u(e)&&0!==e.length?e[0]:null}(),t=w()?window.performance.timing:null;return(r||t)&&(e.navigation=null!=r?r:t),t&&(e.timing=t),r&&(e.navigation_timing=r),e}},e.fmpMonitor&&(this.fmpMonitor=e.fmpMonitor);var t=e.performanceAuto;this.performanceAuto=void 0===t||t,this.props=null!=e?e:{}}var Oe="StaticErrorMonitor",Le=(je.prototype.setup=function(e){S()&&(this.callback=e,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},je.prototype.getSrc=function(e){return"link"===e.tagName.toLowerCase()?qe(e,"href"):qe(e,"src")},je.prototype.getParams=function(e,t){var r={ev_type:"static",st_type:t},t=R(e);r.st_src=e,r.st_protocol=t.protocol,r.st_domain=t.hostname,r.st_path=t.pathname;t=function(e){var t,r=null===(t=null===(n=window.performance)||void 0===n?void 0:n.getEntriesByType)||void 0===t?void 0:t.call(n,"resource"),n=null==r?void 0:r.length;if(!n)return;for(var o=n-1;-1<o;o--){var i=r[o];if(i.name===e)return i}}(t.href);return t&&(r.timing=t),r},je.monitorName=Oe,je);function je(){var i=this;this.name=Oe,this.callback=C,this.buildEvent=function(e){var t,r,n=e||window.event||{};try{r=null!==(t=null!==(t=n.target)&&void 0!==t?t:n.srcElement)&&void 0!==t?t:{}}catch(n){return}var o=r.tagName;if(o&&f(o)){o=o.toLowerCase();e=i.getSrc(r);if(e&&e!==window.location.href)return{name:i.name,type:"get",event:i.getParams(e,o)}}},this.staticErrorLog=function(e){e=i.buildEvent(e);e&&i.callback(e)}}function qe(e,t){var r;return e.getAttribute&&d(e.getAttribute)?null!==(r=e.getAttribute(t))&&void 0!==r?r:"":null!==(t=e[t])&&void 0!==t?t:""}var He="BreadcrumbMonitor",Ie=(Ae.prototype.setup=function(){this.instrumentDOM()},Ae.prototype.instrumentDOM=function(){var e;"document"in window&&(e=this,window.document.addEventListener("click",e.domEventHandler("click",e.triggerHandlers.bind(e,"dom")),!1),window.document.addEventListener("keypress",e.keypressEventHandler(e.triggerHandlers.bind(e,"dom")),!1))},Ae.prototype.domEventHandler=function(t,r,n){var o=this;return void 0===n&&(n=!1),function(e){o.keypressTimeout=void 0,e&&o.lastCapturedEvent!==e&&(o.lastCapturedEvent=e,o.debounceTimer&&clearTimeout(o.debounceTimer),n?o.debounceTimer=setTimeout(function(){r({event:e,name:t})}):r({event:e,name:t}))}},Ae.prototype.triggerHandlers=function(e,t){if(e)try{this.domBreadcrumb(t)}catch(e){}},Ae.prototype.keypressEventHandler=function(n){var o=this;return function(e){var t;try{t=e.target}catch(e){return}var r=t&&t.tagName;r&&("INPUT"===r||"TEXTAREA"===r||t.isContentEditable)&&(o.keypressTimeout||o.domEventHandler("input",n)(e),clearTimeout(o.keypressTimeout),o.keypressTimeout=window.setTimeout(function(){o.keypressTimeout=void 0},o.debounceDuration))}},Ae.prototype.domBreadcrumb=function(e){var t;try{t=e.event.target?ve(e.event.target):ve(e.event)}catch(e){t="<unknown>"}0!==t.length&&this.addBreadcrumb({category:"ui."+e.name,message:t})},Ae.monitorName=He,Ae);function Ae(e){var n=this;this.name=He,this.breadcrumbs=[],this.getBreadcrumbs=function(){return n.breadcrumbs},this.addBreadcrumb=function(e){var t=p(p({},e),{timestamp:(new Date).getTime()}),r=n.maxBreadcrumbs,e=n.breadcrumbs;return n.breadcrumbs=0<=r?a(e,[t]).slice(-r):a(e,[t]),n},this.debounceDuration=1e3,this.debounceTimer=0,this.breadcrumbs=[],this.maxBreadcrumbs=null!==(e=null==e?void 0:e.maxBreadcrumbs)&&void 0!==e?e:20}var De=(Fe.prototype.sendEvent=function(e){e=this.getEventToBeSent(e);e&&this.idleSendEvent(e)},Fe.prototype.getEventToBeSent=function(e){e=this._modifyEvent(e);if(this._shouldSend(e))return e},Fe.prototype._modifyEvent=function(e){return e},Fe.prototype._shouldSend=function(e){return!0},Fe.prototype._send=function(e){},Fe.prototype.idleSendEvent=function(e){this._send(e)},Fe);function Fe(){}var Be={enableCatchGlobalJSError:!0},Ne="JSExceptionMonitor",Je=(Ue.prototype.setup=function(e){S()&&(this.callback=e,this.options.enableCatchGlobalJSError&&(window.addEventListener("error",this.jsErrorLog),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog)))},Ue.prototype.buildEvent=function(e){if(!function(e){switch(Object.prototype.toString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return 1;default:return e instanceof Error}}(e)?(n(e)&&(t={message:JSON.stringify(e)}),f(e)&&(t={message:e})):t=e,t){var t={ev_type:"js_exception",exception:this.normalizeError(t),breadcrumbs:null!==(t=null===(t=this.options.breadcrumbMonitor)||void 0===t?void 0:t.getBreadcrumbs())&&void 0!==t?t:[]};return{name:this.name,type:"post",event:t}}},Ue.prototype.logError=function(e){e=this.buildEvent(e);e&&this.callback(e)},Ue.prototype.getJSError=function(e){e=e.error;if(e)return e},Ue.prototype.getJSPromiseRejection=function(e){var t=void 0;try{"reason"in e?t=e.reason:"detail"in e&&"reason"in e.detail&&(t=e.detail.reason)}catch(e){}if(t)return t},Ue.prototype.normalizeError=function(e){return{message:e.message,name:e.name,fileName:e.fileName,lineNumber:e.lineNumber,columnNumber:e.columnNumber,stack:e.stack,stacktrace:e.stacktrace,framesToPop:e.framesToPop}},Ue.monitorName=Ne,Ue);function Ue(e){var t=this;this.name=Ne,this.callback=C,this.jsErrorLog=function(e){e=t.getJSError(e);e&&t.logError(e)},this.jsPromiseRejectionLog=function(e){e=t.getJSPromiseRejection(e);e&&t.logError(e)},this.options=p(p({},Be),e)}var Xe="RANGERS_WEB_ID";function ze(){var e={flags:{hookPath:!0,hookXHR:!0,hookFetch:!0,enableSizeStats:!0,enableFMP:!0,enablePerformance:!0,enableResourcePerformance:!0,enableStaticError:!0,enableCatchJSError:!0,enableCatchGlobalJSError:!0,enableCatchJSErrorV2:!1,enableCrash:!0,enableMemoryRecord:!0,enableFPSJankTimesMonitor:!0,enableBreadcrumb:!0,hookConsole:!1}};return e.monitors={BaseMonitor:{appTypeSetting:{type:0,SPA:"",renderType:0},sampleHit:F(1)},JSErrorMonitor:{enable:!0,webIDHit:!0,sampleRate:1,webIDHitBehavior:!1,sampleHitBehavior:!1,ignoreErrors:[],whitelistUrls:[],blacklistUrls:[],download_link:""},AjaxMonitor:{enable:!0,enableError:!1,webIDHit:!0,sampleHit:F(1),sampleRate:1,sampleHitTrace:!1,ignore:Q,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1,webIDHitStaticResource:!1,sampleHitStaticResource:F(W),slowSessionTime:$,spaSlowSessionTime:Y,geckoUrls:[],interval:0,checkPoint:[]},StaticErrorMonitor:{enable:!0,webIDHit:!0,sampleRate:1,ignore:Q},ResourcePerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1},BreadcrumbMonitor:{enable:!0}},e.custom={},e.commonParams={aid:0,pid:"",version:"0.2.15",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:G(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:A(),network_type:D()},e}function Ve(e){e!==function(e,t){var r,n;if(!e||!t)return"";var o=e.split(";"),i={};try{for(var s=v(o),a=s.next();!a.done;a=s.next()){var c=a.value.split("="),u=f(c[0])&&c[0].trim();u&&f(c[1])&&(i[u]=c[1].trim())}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return i[t]||""}(document.cookie,Xe)&&(document.cookie=Xe+"="+e+";max-age=7776000;domain="+location.hostname+";path=/")}var Ke,Ge,We,Qe,$e=(Ke="/v2/user/webid",Ge="/v2/user/ssid",We="/v2/event/list",Qe=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(t){[Ke,Ge,We].forEach(function(e){Qe.push(t+e)})}),Qe);function Ye(e){var t=e.sendParams,r=e.monitorsSetting;if(!t||!c(t)||!t.event)return!1;var n,o,e=r;if("AjaxMonitor"===t.name||"FetchMonitor"===t.name){r=H(a(["/monitor_browser/collect"],$e)||[]);if(r&&r.test(t.event.ax_url))return!1}return!(null==e||!e.BaseMonitor.sampleHit)&&("AjaxMonitor"===t.name||"FetchMonitor"===t.name?function(e){var r=e.sendParams,t=e.ajaxMonitor;if(!t)return!0;if("2"!==r.event.ax_status[0]&&"3"!==r.event.ax_status[0])return t.enableError;if(!t.enable)return!1;if(!t.webIDHit)return!1;if(!t.sampleHit||!F(t.sampleRate))return!1;if(u(e=t.whitelistUrls)&&0<e.length){var n=H(t.whitelistUrls||[]);return n&&n.test(r.event.ax_url)?!0:!1}if((n=H(t.ignore||[]))&&n.test(r.event.ax_url))return!1;if((n=t.statusCodeSample)&&l(n,r.event.ax_status))return F(n[r.event.ax_status]);if(t=t.requestUrlSample){var o=!1,i=!1;if(t.forEach(function(e){var t;o||null!=(t=H([e.url]))&&t.test(r.event.ax_url)&&(o=!0,i=F(e.sampleRate))}),o)return i}return!0}({sendParams:t,ajaxMonitor:e.AjaxMonitor}):"PerformanceMonitor"===t.name?!(n=(n={performanceMonitor:e.PerformanceMonitor}).performanceMonitor)||!!n.enable&&(!!n.webIDHit&&!!F(n.sampleRate)):"StaticErrorMonitor"===t.name?(n={sendParams:t,staticErrorMonitor:e.StaticErrorMonitor},o=n.sendParams,!(n=n.staticErrorMonitor)||!!n.enable&&(!!n.webIDHit&&(!!F(n.sampleRate)&&(!(n=H(n.ignore||[]))||!n.test(o.event.st_src))))):"JSExceptionMonitor"===t.name?!(o=(o={jsErrorMonitor:e.JSErrorMonitor}).jsErrorMonitor)||!!o.enable&&(!!o.webIDHit&&!!F(o.sampleRate)):"ResourcePerformanceMonitor"!==t.name||(!(e=(e={resourcePerformanceMonitor:e.ResourcePerformanceMonitor}).resourcePerformanceMonitor)||!!e.enable&&(!!e.webIDHit&&!!F(e.sampleRate))))}function Ze(e){var t=e.sendParams,r=e.commonParams,n=e.custom,e=e.breadcrumbMonitor,e=function(e){var t=e.sendParams,r=e.commonParams,n=e.breadcrumbMonitor;if((e={}).ev_type=t.event.ev_type,e.common=r,"PageViewMonitor"===t.name&&e)return e;if(("AjaxMonitor"===t.name||"FetchMonitor"===t.name)&&e){var o=t.event,o=(o.ev_type,s(o,["ev_type"]));return e.event=o,e}if("PerformanceMonitor"===t.name&&e){t.event.navigation=t.event.navigation_timing;o=t.event,o=(o.ev_type,s(o,["ev_type"]));return e.ev_type="performance",e.event={fp:o.fp,fcp:o.fcp,fmp:o.fmp,tti:o.tti,fid:o.fid,mpfid:o.mpfid,isAsync:o.isAsync,timing:o.timing,navigation:o.navigation_timing,bounced:o.bounced},e}if("StaticErrorMonitor"===t.name&&e){e.ev_type="resource_error";var i=t.event,i=(i.ev_type,s(i,["ev_type"]));return e.event=i,e}if("ResourcePerformanceMonitor"===t.name&&e){e.ev_type="resource";i=t.event,i=(i.ev_type,s(i,["ev_type"]));return e.event=i,e}if("JSExceptionMonitor"===t.name&&e){e.ev_type="js_error";t=t.event,t=(t.ev_type,s(t,["ev_type"]));return e.event=t.exception,e.breadcrumbs=null!==(n=null==n?void 0:n.getBreadcrumbs())&&void 0!==n?n:[],e}return e}({sendParams:t,commonParams:p(p({},null!=r?r:{}),{url:window.location.href}),breadcrumbMonitor:e});return n&&d(n.beforeSend)&&(e=n.beforeSend(e||{})),e}function et(e){return"https://"+e+"/monitor_browser/collect"}var tt,rt,nt,ot={cover:C,accumulate:C,reportDirectly:C,average:C},it=function(e){var r=this;this.cover=function(e,t){r.log.cover(e,t)},this.accumulate=function(e,t){r.log.accumulate(e,t)},this.reportDirectly=function(e,t){r.log.reportDirectly(e,t)},this.average=function(e,t){r.log.average(e,t)},this.log=null!==(e=e.transport)&&void 0!==e?e:ot},st=(r(rt=ct,nt=tt=De),rt.prototype=null===nt?Object.create(nt):(at.prototype=nt.prototype,new at),ct.prototype.uploadQueue=function(){},ct.prototype._shouldSend=function(e){return Ye({sendParams:e,monitorsSetting:this.options.monitorsSetting})},ct.prototype._modifyEvent=function(e){return(e=(e={sendParams:e}).sendParams)&&c(e)?e:{}},ct.prototype.buildParams=function(e){var t,r=null===(t=null===(t=this.options.monitorsSetting)||void 0===t?void 0:t.BreadcrumbMonitor)||void 0===t||!t.enable||null===(r=this.options.monitors)||void 0===r?void 0:r.BreadcrumbMonitor;return Ze({sendParams:e,commonParams:this.options.commonParams,custom:this.options.custom,breadcrumbMonitor:r})},ct.prototype._send=function(e){e&&e.event&&e.name&&this.transport&&this.sendByTypes(e)},ct.prototype.sendByTypes=function(e){var t;this.transport&&(t={jsBase:null!==(t=this.options.commonParams)&&void 0!==t?t:{},jsInfo:this.buildParams(e)},"PerformanceMonitor"===e.name&&this.transport.cover(t,t.jsInfo.ev_type),"StaticErrorMonitor"===e.name&&this.transport.reportDirectly(t,t.jsInfo.ev_type),"ResourcePerformanceMonitor"===e.name&&this.transport.reportDirectly(t,t.jsInfo.ev_type),"AjaxMonitor"===e.name&&this.transport.reportDirectly(t,t.jsInfo.ev_type),"FetchMonitor"===e.name&&this.transport.reportDirectly(t,t.jsInfo.ev_type),"JSExceptionMonitor"===e.name&&this.transport.reportDirectly(t,t.jsInfo.ev_type),"PageViewMonitor"===e.name&&this.transport.reportDirectly(t,t.jsInfo.ev_type))},ct);function at(){this.constructor=rt}function ct(e){var o=tt.call(this)||this;return o.options={},o.setTransport=function(e){o.transport=new it({transport:e.transport}),o.preQueue.forEach(function(e){tt.prototype.sendEvent.call(o,e)})},o.updateConfig=function(e){var t,r,n;o.options=(t={previousOptions:o.options,newOptions:e},r=t.previousOptions,n=t.newOptions,(e=p(p({},r),n)).commonParams=i({},null!==(t=r.commonParams)&&void 0!==t?t:{},null!==(t=n.commonParams)&&void 0!==t?t:{}),e.monitorsSetting=i({},null!==(t=r.monitorsSetting)&&void 0!==t?t:{},null!==(t=n.monitorsSetting)&&void 0!==t?t:{}),e.monitors=p(p({},null!==(t=r.monitors)&&void 0!==t?t:{}),null!==(t=n.monitors)&&void 0!==t?t:{}),e.custom=p(p({},null!==(r=r.custom)&&void 0!==r?r:{}),null!==(n=n.custom)&&void 0!==n?n:{}),e)},o.sendEvent=function(e){o.transport?tt.prototype.sendEvent.call(o,e):o.preQueue.push(e)},o.getEventToBeSent=function(e){return null!==(e=tt.prototype.getEventToBeSent.call(o,e))&&void 0!==e?e:{}},o.options=e,o.preQueue=[],o}var ut=(lt.prototype.getUserIDFromRangers=function(t){window.collectEvent&&d(window.collectEvent)&&window.collectEvent("getToken",function(e){t(e)})},lt.prototype.init=function(e){this.client=new st(this.getClientOptions(e)),this.client.updateConfig(this.getClientOptions(e)),this.sendPageview();e=this.setMonitors();this.setupMonitors(e),this.setServerSetting()},lt.prototype.setServerSetting=function(){var e,r=this,t=this.serverSetting;t?(e=this.normalizeServerSetting(t),this.updateSetting(e)):(e="https://"+this.serverDomain+"/settings/get/web?aid="+this.baseSetting.commonParams.aid,B.get(e,{success:function(e){try{r.serverSetting=e.data;var t=r.normalizeServerSetting(r.serverSetting);r.updateSetting(t)}catch(e){r.updateSetting(r.baseSetting)}},fail:function(){r.updateSetting(r.baseSetting)}}))},lt.prototype.updateSetting=function(e){this.client.updateConfig(this.getClientOptions(e)),this.client.setTransport({transport:this.userSetting.transport})},lt.prototype.getClientOptions=function(e){return{reportURL:et(this.serverDomain),monitorsSetting:e.monitors,commonParams:e.commonParams,custom:e.custom}},lt.prototype.setMonitors=function(){var t,e=[],r=this.baseSetting.flags,n=new ae;return e.push(n),r.enableCatchJSError&&e.push(new Je),r.hookXHR&&e.push(new ee({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.hookFetch&&e.push(new oe({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),r.enableStaticError&&e.push(new Le),r.enablePerformance&&(r.enableFMP?e.push(new xe({fmpMonitor:n,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):e.push(new xe({renderType:1,preLongTaskObserver:{precollect:(null===(n=window.RangersSiteHybridSDK.lt)||void 0===n?void 0:n.e)||[],observer:null===(n=window.RangersSiteHybridSDK.lt)||void 0===n?void 0:n.o}}))),r.enableBreadcrumb&&e.push(new Ie),r.enableResourcePerformance&&(t=this.serverDomain,e.push(new Te({observe:!0,checkIgnore:function(e){return e.name===et(t)||("xmlhttprequest"===e.initiatorType||"fetch"===e.initiatorType||"beacon"===e.initiatorType||"navigation"===e.initiatorType||0===e.decodedBodySize)}}))),e},lt.prototype.setupMonitors=function(e){var t=this;this.client&&this.client.sendEvent&&(e.forEach(function(e){"FMPMonitor"===(t.monitors[e.name]=e).name?e.setup(C):e.setup(null===(e=t.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},lt.prototype.normalizeServerSetting=function(e){var e=(t=e,r=i({JSErrorMonitor:{},AjaxMonitor:{},PerformanceMonitor:{},StaticErrorMonitor:{},BaseMonitor:{},ResourcePerformanceMonitor:{}},r=this.defaultSetting.monitors),(t=t.setting).jserr&&(r.JSErrorMonitor.enable=t.jserr.enable,r.JSErrorMonitor.webIDHit=F(t.jserr.enable_user_rate),r.JSErrorMonitor.sampleRate=t.jserr.enable_sample_rate),t.performance&&(r.PerformanceMonitor.enable=t.performance.enable,r.PerformanceMonitor.webIDHit=F(t.performance.enable_user_rate),r.PerformanceMonitor.sampleRate=t.performance.enable_sample_rate),t.breadcrumb&&(r.BreadcrumbMonitor.enable=t.breadcrumb.enable),t.static_resource_error&&(r.StaticErrorMonitor.enable=t.static_resource_error.enable),t.static_resource&&(r.ResourcePerformanceMonitor.enable=t.static_resource.enable,r.ResourcePerformanceMonitor.webIDHit=F(t.static_resource.enable_user_rate),r.ResourcePerformanceMonitor.sampleRate=t.static_resource.enable_sample_rate),t.request&&(r.AjaxMonitor.enable=t.request.enable,r.AjaxMonitor.enableError=t.request.enableError,r.AjaxMonitor.webIDHit=F(t.request.enable_user_rate),r.AjaxMonitor.sampleRate=t.request.enable_sample_rate),r),t={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(this.userSetting),monitors:e,custom:this.getClientCustom(this.userSetting)},r={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(this.userSetting),monitors:this.getClientMonitorsSetting(this.userSetting),custom:this.getClientCustom(this.userSetting)},e=this.baseSetting;return this.baseSetting=i({},this.baseSetting,t,r),this.baseSetting.commonParams.pid=this.baseSetting.commonParams.pid||location.pathname,this.settingEffect(this.baseSetting,e),this.baseSetting},lt.prototype.normalizeSetting=function(e){var t={commonParams:this.getClientCommonParams(e),flags:this.getClientFlags(e),monitors:this.getClientMonitorsSetting(e),custom:this.getClientCustom(e)},r={commonParams:this.getClientCommonParams(this.userSetting),flags:this.getClientFlags(this.userSetting),monitors:this.getClientMonitorsSetting(this.userSetting),custom:this.getClientCustom(this.userSetting)},e=this.baseSetting;return this.baseSetting=i({},this.baseSetting,t,r),this.baseSetting.commonParams.pid=this.baseSetting.commonParams.pid||location.pathname,this.settingEffect(this.baseSetting,e),this.baseSetting},lt.prototype.settingEffect=function(e,t){Ve(e.commonParams.rangers_web_id),t.commonParams.pid!==e.commonParams.pid&&this.sendPageview()},lt.prototype.sendPageview=function(){var e;null!==(e=this.client)&&void 0!==e&&e.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},lt.prototype.getClientCommonParams=function(r){void 0===r&&(r={});var n={};if(!c(r))return n;var o=["context","pid"];t(r,function(e,t){b(o,e)&&(n[e]=t)});return t({user_unique_id:"rangers_web_id",app_id:"aid"},function(e,t){l(r,e)&&(n[t]=r[e])}),n},lt.prototype.getClientFlags=function(e){void 0===e&&(e={});var r={};if(!c(e))return r;var n=["hookPath","hookXHR","hookFetch","enableSizeStats","enableFMP","enablePerformance","enableStaticError","enableCatchJSError","enableCatchJSErrorV2","enableCatchGlobalJSError","enableResourcePerformance","enableCrash","enableMemoryRecord","enableFPSJankTimesMonitor","enableBreadcrumb","hookConsole"];return t(e,function(e,t){b(n,e)&&(r[e]=t)}),r},lt.prototype.getClientCustom=function(e){var t={};return e.beforeSend&&d(e.beforeSend)&&(t.beforeSend=e.beforeSend),t},lt.prototype.getClientMonitorsSetting=function(e){return e=(t={setting:e}).setting,t=i({JSErrorMonitor:{},AjaxMonitor:{},PerformanceMonitor:{},StaticErrorMonitor:{},ResourcePerformanceMonitor:{},BaseMonitor:{appTypeSetting:{}}},{}),e.ajaxWhitelistUrls&&u(e.ajaxWhitelistUrls)&&(t.AjaxMonitor.whitelistUrls=(t.AjaxMonitor.whitelistUrls||[]).concat(e.ajaxWhitelistUrls)),e.ignoreAjax&&u(e.ignoreAjax)&&(t.AjaxMonitor.ignore=(t.AjaxMonitor.ignore||[]).concat(e.ignoreAjax)),e.ignoreStatic&&u(e.ignoreStatic)&&(t.StaticErrorMonitor.ignore=(t.StaticErrorMonitor.ignore||[]).concat(e.ignoreStatic)),e.ignoreErrors&&u(e.ignoreErrors)&&(t.JSErrorMonitor.ignoreErrors=e.ignoreErrors),e.errorBlacklistUrls&&u(e.errorBlacklistUrls)&&(t.JSErrorMonitor.blacklistUrls=e.errorBlacklistUrls),e.errorWhitelistUrls&&u(e.errorWhitelistUrls)&&(t.JSErrorMonitor.whitelistUrls=e.errorWhitelistUrls),l(e,"sampleRate")&&(t.BaseMonitor.sampleHit=F(e.sampleRate)),t;var t},lt);function lt(){var n=this;this.version="0.2.15",this.serverDomain="tbm.snssdk.com",this.instance=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if("config"!==e[0])n.client&&("report"!==e[0]?n.onClose():null!==(r=n.client)&&void 0!==r&&r.uploadQueue());else if(c(e[1])){var r=e[1];if(n.userSetting=p(p({},n.userSetting||{}),r||{}),!n.serverDomain){if(!n.userSetting.serverDomain)return void console.error('"serverDomain" must be configured');n.serverDomain=n.userSetting.serverDomain}r=n.normalizeSetting(r);n.client?n.client.updateConfig(n.getClientOptions(r)):n.init(r)}},this.changeReortType=function(e){var t;null!==(t=n.client)&&void 0!==t&&t.updateConfig({reportType:e})},this.onClose=function(){I(n.onCloseReport,n.visibilityChange)},this.visibilityChange=function(){"hidden"===document.visibilityState&&n.onCloseReport(),"visible"===document.visibilityState&&n.changeReortType("xhr")},this.onCloseReport=function(){var e;n.changeReortType("beacon"),null!==(e=n.client)&&void 0!==e&&e.uploadQueue()},this.defaultSetting=ze(),this.baseSetting=this.defaultSetting,this.client=void 0,this.serverSetting=void 0,this.userSetting={},this.monitors={}}var pt,ht=C;return S()&&(pt=new ut,ht=pt.instance,null!==(ut=window.RangersSiteHybridSDK)&&void 0!==ut&&ut.q&&(u(ut=window.RangersSiteHybridSDK.q)&&ut.forEach(function(e){ht.apply(void 0,a(e))}),delete window.RangersSiteHybridSDK.q),window.RangersSiteHybridSDK=pt.instance),ht}();
{
"name": "@apm-insight-web/rangers-site-sdk",
"version": "0.2.14",
"version": "0.2.15",
"main": "cn/index.cjs.js",
"module": "cn/index.esm.js",
"license": "MIT",
"files": [
"cn",
"private"
],
"devDependencies": {

@@ -17,3 +21,3 @@ "@slardar/polyfill": "0.1.2",

},
"gitHead": "c810c35a705e89d81bd8d815a5d1f572c44da0db"
"gitHead": "138a491e668849496fdcf20647ba74e21cccc608"
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc