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
1
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.10-beta.4 to 0.2.10-beta.5

cn/browser.0.2.10-beta.5.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=o(r,e[n]),n++;return r}function o(e,t){var r,n=p({},e);for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&void 0!==t[r]&&(c(e[r])&&c(t[r])?n[r]=o(e[r],t[r]):!c(e[r])&&c(t[r])?n[r]=o({},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 u(e)||c(e)?u(e)?t([],e):o({},e):e})}(e[r],t[r]):n[r]=t[r]);return n}function m(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 g(){if("fetch"in window)try{return new Headers,new Request(""),new Response,1}catch(e){return}}function b(){return!!c(window)}function y(){return b()&&!!c(window.performance)}function S(){return y()&&!!c(window.performance.timing)}function w(){return!!y()&&!!d(window.performance.getEntries)}function P(){return b()&&"function"==typeof window.MutationObserver}function M(){return b()&&"function"==typeof window.PerformanceObserver}function T(){return!!M()&&d(window.PerformanceLongTaskTiming)}function E(){if(!M())return!1;var e=window.PerformanceObserverEntryList;return d(e)&&d(e.prototype.getEntries)}function _(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 k(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()),m(["x-tt-token"],e)};function x(){}function C(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 O(e){var t={},r=k(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=k(e),t=k(t);return e.protocol===t.protocol&&e.host===t.host}function j(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 H(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),b()&&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"},I=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 D=(B.post=function(e,t,r){var n,o=null!==(n=null==r?void 0:r.success)&&void 0!==n?n:x,i=null!==(r=null==r?void 0:r.fail)&&void 0!==r?r:x,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()}},B.get=function(e,t){var r,n=null!==(r=null==t?void 0:t.success)&&void 0!==r?r:x,o=null!==(r=null==t?void 0:t.fail)&&void 0!==r?r:x,i=null!==(r=null==t?void 0:t.getResponse)&&void 0!==r?r:x,s=null!==(t=null==t?void 0:t.getResponseText)&&void 0!==t?t:x,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()}},B.prototype.getCommonParams=function(){return{timestamp:Date.now()}},B);function B(e){var t=this;this.postEvent=function(e){e=p(p({},e),t.getCommonParams());B.post(t.url,e)},this.getEvent=function(e){e=_(p(p({},e),t.getCommonParams())),e=t.url+"?"+e;B.get(e)},this.getURL=function(){return t.url},this.options=e,this.url=this.options.reportURL}function N(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 J(e){return e?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,e):""}var U="x-tt-trace-id",X="x-tt-trace-host",z="x-tt-logid";function Q(e,t,r){void 0===r&&(r="01");t=""+N((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"+J(18);e=22-t.length-4;return""+N(""+t.length,2)+t+J(e)}r=parseInt(t,10)}var r=22-(t=r.toString(16)).length-4;return""+N(""+t.length,2)+t+J(r)}(e)+("string"==typeof t?J(4):N(t.toString(16),4));return"00-"+t+"-"+t.substr(0,16)+"-"+r}function V(){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 K=.1,W=["/log/sentry/"],G=8e3,$=4e3;V(),V();var Y="AjaxMonitor",Z=(ee.prototype.setup=function(e){void 0===e&&(e=x),d(XMLHttpRequest)&&(this.callback=e,this.start())},ee.prototype.updateConfig=function(e){this.props=i({},this.props,e)},ee.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},ee.prototype.hookXMLHttpRequestSetRequestHeader=function(){var r=XMLHttpRequest.prototype.setRequestHeader||x;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)}},ee.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)}},ee.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=Q(t,e),this.setRequestHeader(U,o.traceId))),o.hookXMLHttpRequestOnreadystatechange.call(this,o),this._start=Date.now(),this._data=null==r?void 0:r[0],i.apply(this,r)}},ee.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},ee.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},ee.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(U))&&(t.trace_id=r,t.trace_host=null!==(e=this.getResponseHeader(X))&&void 0!==e?e:void 0,t.log_id=null!==(e=this.getResponseHeader(z))&&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=C(e.responseText);else if(e.response)t=C(e.response);else try{t=C(e.responseText)}catch(e){t=0}return t}(this)),t=p(p({},t),O(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=k(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)}},ee.monitorName=Y,ee);function ee(e){this.name=Y,this.callback=x,this.traceId=null,this.props=e}function te(e){return e instanceof Request}var re="FetchMonitor",ne=(oe.prototype.updateConfig=function(e){this.props=i({},this.props,e)},oe.prototype.setup=function(e){void 0===e&&(e=x),g()&&(this.callback=e,this.start())},oe.prototype.start=function(){g()&&this.hookFetch()},oe.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},oe.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=k(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"]})},oe.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},oe.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;te(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=Q(t,r),o.headers.append(U,a.trace_id)))}catch(e){}return a.ax_type=c.getFetchMethod(n,o),a=p(p({},a),O(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(X)&&(a.trace_host=null!==(t=e.headers.get(X))&&void 0!==t?t:void 0),e.headers.has(U)&&(a.trace_id=null!==(r=e.headers.get(U))&&void 0!==r?r:void 0),e.headers.has(z)&&(a.log_id=null!==(r=e.headers.get(z))&&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)})}},oe.prototype.getFetchUrl=function(e,t){void 0===t&&(t=!1);var r="",r=te(e)?e.url:e;return t||(r=f(r)?r.split("?")[0]:r),r},oe.prototype.getFetchMethod=function(e,t){t=null!==(t=null==t?void 0:t.method)&&void 0!==t?t:"get";return te(e)&&(t=null!==(e=e.method)&&void 0!==e?e:t),t.toLowerCase()},oe.prototype.getFetchBody=function(e,t){return te(e)?e.body:null==t?void 0:t.body},oe.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)},oe.monitorName=re,oe);function oe(e){this.name=re,this.callback=x,this.props=e}var ie="FMPMonitor",se=(ae.prototype.setup=function(e){if(b())return P()?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},ae.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})},ae.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},ae.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},ae.prototype.getTimeGap=function(){return S()?this.startTime-performance.timing.navigationStart:0},ae.prototype.formatEvent=function(e){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:e}}},ae.monitorName=ie,ae);function ae(){var r=this;this.name=ie,this.callback=x,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 ce(){}var ue=!1,le=!1,pe={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=pe.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)},pe.originals.send.apply(this,e)},this.proxies.send=XMLHttpRequest.prototype.send},patchFetch:function(o){var i;g()&&(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=pe.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(P()){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&&(ue=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(le=!1,window.fetch=this.originals.fetch)}},he="TTIMonitor",de=(fe.prototype.setup=function(){},fe.prototype.isEnable=function(){return T()&&!!M()&&d(window.PerformanceResourceTiming)&&E()},fe.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"]})}},fe.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),pe.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=ce,this.proxyConfig.afterCb=ce)},fe.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))},fe.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))},fe.prototype.registerListeners=function(){ue||(pe.patchXMLHTTPRequest(this.proxyConfig),ue=!0),le||(pe.patchFetch(this.proxyConfig),le=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=pe.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},fe.prototype.mutationObserverCallback=function(e){this.rescheduleTimer(performance.now()+5e3)},fe.prototype.beforeJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=performance.now()},fe.prototype.afterJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=void 0},fe.prototype.networkRequestFinishedCallback=function(e){this.networkRequests.push({start:e.fetchStart,end:e.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(fe.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}),fe.prototype.longTaskFinishedCallback=function(e){var t=e.startTime+e.duration;this.longTasks.push({start:e.startTime,end:t}),this.rescheduleTimer(t+5e3)},fe.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)},fe.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var e=performance.timing;return e.domContentLoadedEventEnd-e.navigationStart}return null},fe.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var e=performance.getEntriesByType("paint")[0];return e?e.startTime:0}return 0},fe.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)},fe.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},fe.monitorName=he,fe);function fe(e){var t,r,n,o=this;if(this.name=he,this.longTasks=[],this.callback=ce,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 me(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 ve="FIDMonitor",ge=(be.prototype.setup=function(e){var a=this;if(M()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&E()){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"]})}}},be.monitorName=ve,be);function be(){this.name=ve,this.callback=x}var ye="MPFIDMonitor",Se=(we.prototype.setup=function(){var t,e,r,s=this;if(T()&&E()){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"]})}},we.prototype.getMPFID=function(){var t,e;if(T()&&E()){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))}},we.prototype.formatEvent=function(e){return{name:this.name,mpfid:e}},we.monitorName=ye,we);function we(e){this.name=ye,this.list=[],this.props=e}var Pe=[],Me="ResourcePerformanceMonitor",Te=(Ee.prototype.setup=function(e){this.isEnable()&&(this.callback=null!=e?e:x,this.isAsync&&window.performance.clearResourceTimings(),this.observe&&(this.sendResourcePerformance(performance.getEntriesByType("resource")),this.observePerformance()))},Ee.prototype.isEnable=function(){return w()&&"function"==typeof performance.clearResourceTimings},Ee.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},Ee.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}}},Ee.prototype.sendResourcePerformance=function(e){e=this.buildParams(e);e&&this.callback(e)},Ee.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(e){return!m(Pe,e.initiatorType)})},Ee.prototype.observePerformance=function(){var t=this;M()&&new PerformanceObserver(function(e){e=e.getEntries();e.length&&t.sendResourcePerformance(e)}).observe({entryTypes:["resource"]})},Ee.monitorName=Me,Ee);function Ee(e){var t,r=this;this.name=Me,this.callback=x,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 _e={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:[]},ke="PerformanceMonitor",Re=(xe.prototype.setup=function(e){var t,r=this;S()&&(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({},_e),this.staticPerformanceMonitor=new Te,this.staticPerformanceMonitor.setup(),(new ge).setup(this.hasFID),this.mpfidMonitor=new Se({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),e=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:de,this.ttiMonitor=new e({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),e=this.syncPerfLog.bind(this),H(e))},xe.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)},xe.prototype.getBounced=function(){return!this.hasLoaded},xe.prototype.getPaintTime=function(t){if(w()){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},xe.monitorName=ke,xe);function xe(e){var o=this;this.name=ke,this.callback=x,this.sendParams=p({},_e),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({},_e),o.sendParams.isAsync=1,o.initFlag=!0,o.initStart=o.performanceNow(),o.staticPerformanceMonitor=new Te({isAsync:1}),o.staticPerformanceMonitor.setup(),o.mpfidMonitor=new Se({isAsync:1,preLongTaskObserver:o.props.preLongTaskObserver}),o.mpfidMonitor.setup(),t=null!==(e=o.props.TTIMonitor)&&void 0!==e?e:de,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,x))},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),S()){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(S()){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(!w())return null;var e=window.performance.getEntriesByType("navigation");return u(e)&&0!==e.length?e[0]:null}(),t=S()?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 Ce="StaticErrorMonitor",Le=(Oe.prototype.setup=function(e){b()&&(this.callback=e,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},Oe.prototype.getSrc=function(e){return"link"===e.tagName.toLowerCase()?qe(e,"href"):qe(e,"src")},Oe.prototype.getParams=function(e,t){var r={ev_type:"static",st_type:t},t=k(e);return r.st_src=e,r.st_protocol=t.protocol,r.st_domain=t.hostname,r.st_path=t.pathname,r},Oe.monitorName=Ce,Oe);function Oe(){var i=this;this.name=Ce,this.callback=x,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 je="BreadcrumbMonitor",He=(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?me(e.event.target):me(e.event)}catch(e){t="<unknown>"}0!==t.length&&this.addBreadcrumb({category:"ui."+e.name,message:t})},Ae.monitorName=je,Ae);function Ae(){var r=this;this.name=je,this.breadcrumbs=[],this.getBreadcrumbs=function(){return r.breadcrumbs},this.addBreadcrumb=function(e,t){e=p(p({},e),{timestamp:(new Date).getTime()});return r.breadcrumbs=void 0!==t&&0<=t?a(r.breadcrumbs,[e]).slice(-t):a(r.breadcrumbs,[e]),r},this.debounceDuration=1e3,this.debounceTimer=0,this.breadcrumbs=[]}var Ie=(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 De={enableCatchGlobalJSError:!0},Be="JSExceptionMonitor",Ne=(Je.prototype.setup=function(e){b()&&(this.callback=e,this.options.enableCatchGlobalJSError&&(window.addEventListener("error",this.jsErrorLog),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog)))},Je.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)};return{name:this.name,type:"post",event:t}}},Je.prototype.logError=function(e){e=this.buildEvent(e);e&&this.callback(e)},Je.prototype.getJSError=function(e){e=e.error;if(e)return e},Je.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},Je.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}},Je.monitorName=Be,Je);function Je(e){var t=this;this.name=Be,this.callback=x,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({},De),e)}var Ue,Xe=(e(ze,Ue=Ie),Object.defineProperty(ze.prototype,"ready",{get:function(){return this.isReady},set:function(e){this.isReady=e,this.isReady&&this._uploadQueue()},enumerable:!1,configurable:!0}),ze.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)))},ze.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"}))},ze.prototype._request=function(e){},ze);function ze(e){var t,r=Ue.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 Qe="RANGERS_WEB_ID";function Ve(){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:W,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1,webIDHitStaticResource:!1,sampleHitStaticResource:F(K),slowSessionTime:G,spaSlowSessionTime:$,geckoUrls:[],interval:0,checkPoint:[]},StaticErrorMonitor:{enable:!0,webIDHit:!0,sampleRate:1,ignore:W},ResourcePerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1},BreadcrumbMonitor:{enable:!0}},e.custom={},e.commonParams={aid:0,pid:"",version:"0.2.10-beta.4",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:V(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:A(),network_type:I()},e}function Ke(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,Qe)&&(document.cookie=Qe+"="+e+";max-age=7776000;domain="+location.hostname+";path=/")}var We,Ge,$e,Ye,Ze=(We="/v2/user/webid",Ge="/v2/user/ssid",$e="/v2/event/list",Ye=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(t){[We,Ge,$e].forEach(function(e){Ye.push(t+e)})}),Ye);function et(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=j(a(["/monitor_browser/collect"],Ze)||[]);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=j(t.whitelistUrls||[]);return n&&n.test(r.event.ax_url)?!0:!1}if((n=j(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=j([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=j(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 tt(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 rt(){return"https://tbm.snssdk.com/monitor_browser/collect"}var nt,ot=(e(it,nt=Xe),it.prototype._shouldSend=function(e){return et({sendParams:e,monitorsSetting:this.options.monitorsSetting})},it.prototype._modifyEvent=function(e){return(e=(e={sendParams:e}).sendParams)&&c(e)?e:{}},it.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)))},it.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 tt({sendParams:e,commonParams:this.options.commonParams,custom:this.options.custom,breadcrumbMonitor:r})},it.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},it.prototype.getBatchReportURL=rt,it);function it(e){var o=nt.call(this,e)||this;return o.options={},o.setTransport=function(){o.transport=new D({reportURL:o.getReportURL()}),o.preQueue.forEach(function(e){nt.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?nt.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}st.prototype.getUserIDFromRangers=function(t){window.collectEvent&&d(window.collectEvent)&&window.collectEvent("getToken",function(e){t(e)})},st.prototype.init=function(e){var t=this;this.client=new ot(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()},st.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,D.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)}}))},st.prototype.updateSetting=function(e){this.client.updateConfig(this.getClientOptions(e)),this.client.setTransport()},st.prototype.getClientOptions=function(e){return{monitorsSetting:e.monitors,commonParams:e.commonParams,custom:e.custom}},st.prototype.setMonitors=function(){var e=[],t=this.baseSetting.flags,r=new se;return e.push(r),t.enableCatchJSError&&e.push(new Ne),t.hookXHR&&e.push(new Z({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),t.hookFetch&&e.push(new ne({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.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 He),t.enableResourcePerformance&&e.push(new Te({observe:!0,checkIgnore:function(e){return e.name===rt()||("xmlhttprequest"===e.initiatorType||"fetch"===e.initiatorType||"beacon"===e.initiatorType||"navigation"===e.initiatorType||0===e.decodedBodySize)}})),e},st.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(x):e.setup(null===(e=t.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},st.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},st.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},st.prototype.settingEffect=function(e,t){Ke(e.commonParams.rangers_web_id),t.commonParams.pid!==e.commonParams.pid&&this.sendPageview()},st.prototype.sendPageview=function(){var e;null!==(e=this.client)&&void 0!==e&&e.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},st.prototype.getClientCommonParams=function(r){void 0===r&&(r={});var n={};if(!c(r))return n;var o=["context","pid"];t(r,function(e,t){m(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},st.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){m(n,e)&&(r[e]=t)}),r},st.prototype.getClientCustom=function(e){var t={};return e.beforeSend&&d(e.beforeSend)&&(t.beforeSend=e.beforeSend),t},st.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},Ie=st;function st(){var n=this;this.version="0.2.10-beta.4",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(){H(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=Ve(),this.baseSetting=this.defaultSetting,this.client=void 0,this.serverSetting=void 0,this.userSetting={},this.monitors={}}var at=x;return b()&&(Xe=new Ie,at=Xe.instance,null!==(Ie=window.RangersSiteSDK)&&void 0!==Ie&&Ie.q&&(u(Ie=window.RangersSiteSDK.q)&&Ie.forEach(function(e){at.apply(void 0,a(e))}),delete window.RangersSiteSDK.q),window.RangersSiteSDK=Xe.instance),at}();
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=o(r,e[n]),n++;return r}function o(e,t){var r,n=p({},e);for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&void 0!==t[r]&&(c(e[r])&&c(t[r])?n[r]=o(e[r],t[r]):!c(e[r])&&c(t[r])?n[r]=o({},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 u(e)||c(e)?u(e)?t([],e):o({},e):e})}(e[r],t[r]):n[r]=t[r]);return n}function m(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 g(){if("fetch"in window)try{return new Headers,new Request(""),new Response,1}catch(e){return}}function b(){return!!c(window)}function y(){return b()&&!!c(window.performance)}function S(){return y()&&!!c(window.performance.timing)}function w(){return!!y()&&!!d(window.performance.getEntries)}function P(){return b()&&"function"==typeof window.MutationObserver}function M(){return b()&&"function"==typeof window.PerformanceObserver}function T(){return!!M()&&d(window.PerformanceLongTaskTiming)}function E(){if(!M())return!1;var e=window.PerformanceObserverEntryList;return d(e)&&d(e.prototype.getEntries)}function _(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 k(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()),m(["x-tt-token"],e)};function x(){}function C(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 O(e){var t={},r=k(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=k(e),t=k(t);return e.protocol===t.protocol&&e.host===t.host}function j(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 H(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),b()&&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"},I=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 D=(B.post=function(e,t,r){var n,o=null!==(n=null==r?void 0:r.success)&&void 0!==n?n:x,i=null!==(r=null==r?void 0:r.fail)&&void 0!==r?r:x,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()}},B.get=function(e,t){var r,n=null!==(r=null==t?void 0:t.success)&&void 0!==r?r:x,o=null!==(r=null==t?void 0:t.fail)&&void 0!==r?r:x,i=null!==(r=null==t?void 0:t.getResponse)&&void 0!==r?r:x,s=null!==(t=null==t?void 0:t.getResponseText)&&void 0!==t?t:x,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()}},B.prototype.getCommonParams=function(){return{timestamp:Date.now()}},B);function B(e){var t=this;this.postEvent=function(e){e=p(p({},e),t.getCommonParams());B.post(t.url,e)},this.getEvent=function(e){e=_(p(p({},e),t.getCommonParams())),e=t.url+"?"+e;B.get(e)},this.getURL=function(){return t.url},this.options=e,this.url=this.options.reportURL}function N(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 J(e){return e?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,e):""}var U="x-tt-trace-id",X="x-tt-trace-host",z="x-tt-logid";function Q(e,t,r){void 0===r&&(r="01");t=""+N((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"+J(18);e=22-t.length-4;return""+N(""+t.length,2)+t+J(e)}r=parseInt(t,10)}var r=22-(t=r.toString(16)).length-4;return""+N(""+t.length,2)+t+J(r)}(e)+("string"==typeof t?J(4):N(t.toString(16),4));return"00-"+t+"-"+t.substr(0,16)+"-"+r}function V(){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 K=.1,W=["/log/sentry/"],G=8e3,$=4e3;V(),V();var Y="AjaxMonitor",Z=(ee.prototype.setup=function(e){void 0===e&&(e=x),d(XMLHttpRequest)&&(this.callback=e,this.start())},ee.prototype.updateConfig=function(e){this.props=i({},this.props,e)},ee.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},ee.prototype.hookXMLHttpRequestSetRequestHeader=function(){var r=XMLHttpRequest.prototype.setRequestHeader||x;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)}},ee.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)}},ee.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=Q(t,e),this.setRequestHeader(U,o.traceId))),o.hookXMLHttpRequestOnreadystatechange.call(this,o),this._start=Date.now(),this._data=null==r?void 0:r[0],i.apply(this,r)}},ee.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},ee.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},ee.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(U))&&(t.trace_id=r,t.trace_host=null!==(e=this.getResponseHeader(X))&&void 0!==e?e:void 0,t.log_id=null!==(e=this.getResponseHeader(z))&&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=C(e.responseText);else if(e.response)t=C(e.response);else try{t=C(e.responseText)}catch(e){t=0}return t}(this)),t=p(p({},t),O(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=k(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)}},ee.monitorName=Y,ee);function ee(e){this.name=Y,this.callback=x,this.traceId=null,this.props=e}function te(e){return e instanceof Request}var re="FetchMonitor",ne=(oe.prototype.updateConfig=function(e){this.props=i({},this.props,e)},oe.prototype.setup=function(e){void 0===e&&(e=x),g()&&(this.callback=e,this.start())},oe.prototype.start=function(){g()&&this.hookFetch()},oe.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},oe.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=k(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"]})},oe.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},oe.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;te(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=Q(t,r),o.headers.append(U,a.trace_id)))}catch(e){}return a.ax_type=c.getFetchMethod(n,o),a=p(p({},a),O(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(X)&&(a.trace_host=null!==(t=e.headers.get(X))&&void 0!==t?t:void 0),e.headers.has(U)&&(a.trace_id=null!==(r=e.headers.get(U))&&void 0!==r?r:void 0),e.headers.has(z)&&(a.log_id=null!==(r=e.headers.get(z))&&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)})}},oe.prototype.getFetchUrl=function(e,t){void 0===t&&(t=!1);var r="",r=te(e)?e.url:e;return t||(r=f(r)?r.split("?")[0]:r),r},oe.prototype.getFetchMethod=function(e,t){t=null!==(t=null==t?void 0:t.method)&&void 0!==t?t:"get";return te(e)&&(t=null!==(e=e.method)&&void 0!==e?e:t),t.toLowerCase()},oe.prototype.getFetchBody=function(e,t){return te(e)?e.body:null==t?void 0:t.body},oe.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)},oe.monitorName=re,oe);function oe(e){this.name=re,this.callback=x,this.props=e}var ie="FMPMonitor",se=(ae.prototype.setup=function(e){if(b())return P()?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},ae.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})},ae.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},ae.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},ae.prototype.getTimeGap=function(){return S()?this.startTime-performance.timing.navigationStart:0},ae.prototype.formatEvent=function(e){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:e}}},ae.monitorName=ie,ae);function ae(){var r=this;this.name=ie,this.callback=x,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 ce(){}var ue=!1,le=!1,pe={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=pe.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)},pe.originals.send.apply(this,e)},this.proxies.send=XMLHttpRequest.prototype.send},patchFetch:function(o){var i;g()&&(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=pe.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(P()){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&&(ue=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(le=!1,window.fetch=this.originals.fetch)}},he="TTIMonitor",de=(fe.prototype.setup=function(){},fe.prototype.isEnable=function(){return T()&&!!M()&&d(window.PerformanceResourceTiming)&&E()},fe.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"]})}},fe.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),pe.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=ce,this.proxyConfig.afterCb=ce)},fe.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))},fe.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))},fe.prototype.registerListeners=function(){ue||(pe.patchXMLHTTPRequest(this.proxyConfig),ue=!0),le||(pe.patchFetch(this.proxyConfig),le=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=pe.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},fe.prototype.mutationObserverCallback=function(e){this.rescheduleTimer(performance.now()+5e3)},fe.prototype.beforeJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=performance.now()},fe.prototype.afterJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=void 0},fe.prototype.networkRequestFinishedCallback=function(e){this.networkRequests.push({start:e.fetchStart,end:e.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(fe.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}),fe.prototype.longTaskFinishedCallback=function(e){var t=e.startTime+e.duration;this.longTasks.push({start:e.startTime,end:t}),this.rescheduleTimer(t+5e3)},fe.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)},fe.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var e=performance.timing;return e.domContentLoadedEventEnd-e.navigationStart}return null},fe.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var e=performance.getEntriesByType("paint")[0];return e?e.startTime:0}return 0},fe.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)},fe.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},fe.monitorName=he,fe);function fe(e){var t,r,n,o=this;if(this.name=he,this.longTasks=[],this.callback=ce,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 me(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 ve="FIDMonitor",ge=(be.prototype.setup=function(e){var a=this;if(M()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&E()){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"]})}}},be.monitorName=ve,be);function be(){this.name=ve,this.callback=x}var ye="MPFIDMonitor",Se=(we.prototype.setup=function(){var t,e,r,s=this;if(T()&&E()){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"]})}},we.prototype.getMPFID=function(){var t,e;if(T()&&E()){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))}},we.prototype.formatEvent=function(e){return{name:this.name,mpfid:e}},we.monitorName=ye,we);function we(e){this.name=ye,this.list=[],this.props=e}var Pe=[],Me="ResourcePerformanceMonitor",Te=(Ee.prototype.setup=function(e){this.isEnable()&&(this.callback=null!=e?e:x,this.isAsync&&window.performance.clearResourceTimings(),this.observe&&(this.sendResourcePerformance(performance.getEntriesByType("resource")),this.observePerformance()))},Ee.prototype.isEnable=function(){return w()&&"function"==typeof performance.clearResourceTimings},Ee.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},Ee.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}}},Ee.prototype.sendResourcePerformance=function(e){e=this.buildParams(e);e&&this.callback(e)},Ee.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(e){return!m(Pe,e.initiatorType)})},Ee.prototype.observePerformance=function(){var t=this;M()&&new PerformanceObserver(function(e){e=e.getEntries();e.length&&t.sendResourcePerformance(e)}).observe({entryTypes:["resource"]})},Ee.monitorName=Me,Ee);function Ee(e){var t,r=this;this.name=Me,this.callback=x,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 _e={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:[]},ke="PerformanceMonitor",Re=(xe.prototype.setup=function(e){var t,r=this;S()&&(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({},_e),this.staticPerformanceMonitor=new Te,this.staticPerformanceMonitor.setup(),(new ge).setup(this.hasFID),this.mpfidMonitor=new Se({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),e=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:de,this.ttiMonitor=new e({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),e=this.syncPerfLog.bind(this),H(e))},xe.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)},xe.prototype.getBounced=function(){return!this.hasLoaded},xe.prototype.getPaintTime=function(t){if(w()){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},xe.monitorName=ke,xe);function xe(e){var o=this;this.name=ke,this.callback=x,this.sendParams=p({},_e),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({},_e),o.sendParams.isAsync=1,o.initFlag=!0,o.initStart=o.performanceNow(),o.staticPerformanceMonitor=new Te({isAsync:1}),o.staticPerformanceMonitor.setup(),o.mpfidMonitor=new Se({isAsync:1,preLongTaskObserver:o.props.preLongTaskObserver}),o.mpfidMonitor.setup(),t=null!==(e=o.props.TTIMonitor)&&void 0!==e?e:de,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,x))},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),S()){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(S()){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(!w())return null;var e=window.performance.getEntriesByType("navigation");return u(e)&&0!==e.length?e[0]:null}(),t=S()?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 Ce="StaticErrorMonitor",Le=(Oe.prototype.setup=function(e){b()&&(this.callback=e,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},Oe.prototype.getSrc=function(e){return"link"===e.tagName.toLowerCase()?qe(e,"href"):qe(e,"src")},Oe.prototype.getParams=function(e,t){var r={ev_type:"static",st_type:t},t=k(e);return r.st_src=e,r.st_protocol=t.protocol,r.st_domain=t.hostname,r.st_path=t.pathname,r},Oe.monitorName=Ce,Oe);function Oe(){var i=this;this.name=Ce,this.callback=x,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 je="BreadcrumbMonitor",He=(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?me(e.event.target):me(e.event)}catch(e){t="<unknown>"}0!==t.length&&this.addBreadcrumb({category:"ui."+e.name,message:t})},Ae.monitorName=je,Ae);function Ae(){var r=this;this.name=je,this.breadcrumbs=[],this.getBreadcrumbs=function(){return r.breadcrumbs},this.addBreadcrumb=function(e,t){e=p(p({},e),{timestamp:(new Date).getTime()});return r.breadcrumbs=void 0!==t&&0<=t?a(r.breadcrumbs,[e]).slice(-t):a(r.breadcrumbs,[e]),r},this.debounceDuration=1e3,this.debounceTimer=0,this.breadcrumbs=[]}var Ie=(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 De={enableCatchGlobalJSError:!0},Be="JSExceptionMonitor",Ne=(Je.prototype.setup=function(e){b()&&(this.callback=e,this.options.enableCatchGlobalJSError&&(window.addEventListener("error",this.jsErrorLog),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog)))},Je.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)};return{name:this.name,type:"post",event:t}}},Je.prototype.logError=function(e){e=this.buildEvent(e);e&&this.callback(e)},Je.prototype.getJSError=function(e){e=e.error;if(e)return e},Je.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},Je.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}},Je.monitorName=Be,Je);function Je(e){var t=this;this.name=Be,this.callback=x,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({},De),e)}var Ue,Xe=(e(ze,Ue=Ie),Object.defineProperty(ze.prototype,"ready",{get:function(){return this.isReady},set:function(e){this.isReady=e,this.isReady&&this._uploadQueue()},enumerable:!1,configurable:!0}),ze.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)))},ze.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"}))},ze.prototype._request=function(e){},ze);function ze(e){var t,r=Ue.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 Qe="RANGERS_WEB_ID";function Ve(){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:W,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1,webIDHitStaticResource:!1,sampleHitStaticResource:F(K),slowSessionTime:G,spaSlowSessionTime:$,geckoUrls:[],interval:0,checkPoint:[]},StaticErrorMonitor:{enable:!0,webIDHit:!0,sampleRate:1,ignore:W},ResourcePerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1},BreadcrumbMonitor:{enable:!0}},e.custom={},e.commonParams={aid:0,pid:"",version:"0.2.10-beta.5",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:V(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:A(),network_type:I()},e}function Ke(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,Qe)&&(document.cookie=Qe+"="+e+";max-age=7776000;domain="+location.hostname+";path=/")}var We,Ge,$e,Ye,Ze=(We="/v2/user/webid",Ge="/v2/user/ssid",$e="/v2/event/list",Ye=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(t){[We,Ge,$e].forEach(function(e){Ye.push(t+e)})}),Ye);function et(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=j(a(["/monitor_browser/collect"],Ze)||[]);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=j(t.whitelistUrls||[]);return n&&n.test(r.event.ax_url)?!0:!1}if((n=j(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=j([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=j(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 tt(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 rt(){return"https://tbm.snssdk.com/monitor_browser/collect"}var nt,ot=(e(it,nt=Xe),it.prototype._shouldSend=function(e){return et({sendParams:e,monitorsSetting:this.options.monitorsSetting})},it.prototype._modifyEvent=function(e){return(e=(e={sendParams:e}).sendParams)&&c(e)?e:{}},it.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)))},it.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 tt({sendParams:e,commonParams:this.options.commonParams,custom:this.options.custom,breadcrumbMonitor:r})},it.prototype.getReportURL=function(){return this.reportURL||this.getBatchReportURL()},it.prototype.getBatchReportURL=rt,it);function it(e){var o=nt.call(this,e)||this;return o.options={},o.setTransport=function(){o.transport=new D({reportURL:o.getReportURL()}),o.preQueue.forEach(function(e){nt.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?nt.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}st.prototype.getUserIDFromRangers=function(t){window.collectEvent&&d(window.collectEvent)&&window.collectEvent("getToken",function(e){t(e)})},st.prototype.init=function(e){var t=this;this.client=new ot(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()},st.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,D.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)}}))},st.prototype.updateSetting=function(e){this.client.updateConfig(this.getClientOptions(e)),this.client.setTransport()},st.prototype.getClientOptions=function(e){return{monitorsSetting:e.monitors,commonParams:e.commonParams,custom:e.custom}},st.prototype.setMonitors=function(){var e=[],t=this.baseSetting.flags,r=new se;return e.push(r),t.enableCatchJSError&&e.push(new Ne),t.hookXHR&&e.push(new Z({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),t.hookFetch&&e.push(new ne({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.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 He),t.enableResourcePerformance&&e.push(new Te({observe:!0,checkIgnore:function(e){return e.name===rt()||("xmlhttprequest"===e.initiatorType||"fetch"===e.initiatorType||"beacon"===e.initiatorType||"navigation"===e.initiatorType||0===e.decodedBodySize)}})),e},st.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(x):e.setup(null===(e=t.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},st.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},st.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},st.prototype.settingEffect=function(e,t){Ke(e.commonParams.rangers_web_id),t.commonParams.pid!==e.commonParams.pid&&this.sendPageview()},st.prototype.sendPageview=function(){var e;null!==(e=this.client)&&void 0!==e&&e.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},st.prototype.getClientCommonParams=function(r){void 0===r&&(r={});var n={};if(!c(r))return n;var o=["context","pid"];t(r,function(e,t){m(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},st.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){m(n,e)&&(r[e]=t)}),r},st.prototype.getClientCustom=function(e){var t={};return e.beforeSend&&d(e.beforeSend)&&(t.beforeSend=e.beforeSend),t},st.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},Ie=st;function st(){var n=this;this.version="0.2.10-beta.5",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(){H(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=Ve(),this.baseSetting=this.defaultSetting,this.client=void 0,this.serverSetting=void 0,this.userSetting={},this.monitors={}}var at=x;return b()&&(Xe=new Ie,at=Xe.instance,null!==(Ie=window.RangersSiteSDK)&&void 0!==Ie&&Ie.q&&(u(Ie=window.RangersSiteSDK.q)&&Ie.forEach(function(e){at.apply(void 0,a(e))}),delete window.RangersSiteSDK.q),window.RangersSiteSDK=Xe.instance),at}();

@@ -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=o(r,e[n]),n++;return r}function o(e,t){var r,n=p({},e);for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&void 0!==t[r]&&(c(e[r])&&c(t[r])?n[r]=o(e[r],t[r]):!c(e[r])&&c(t[r])?n[r]=o({},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 u(e)||c(e)?u(e)?t([],e):o({},e):e})}(e[r],t[r]):n[r]=t[r]);return n}function m(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 g(){if("fetch"in window)try{return new Headers,new Request(""),new Response,1}catch(e){return}}function b(){return!!c(window)}function e(){return b()&&!!c(window.performance)}function y(){return e()&&!!c(window.performance.timing)}function S(){return!!e()&&!!d(window.performance.getEntries)}function w(){return b()&&"function"==typeof window.MutationObserver}function M(){return b()&&"function"==typeof window.PerformanceObserver}function P(){return!!M()&&d(window.PerformanceLongTaskTiming)}function E(){if(!M())return!1;var e=window.PerformanceObserverEntryList;return d(e)&&d(e.prototype.getEntries)}function T(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 _(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 k=function(e){if(!f(e))return!1;return d(e.toLowerCase)&&(e=e.toLowerCase()),m(["x-tt-token"],e)};function R(){}function x(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 C(e){if(!e)return"";if(!d(e.forEach))return"";var r=[];return e.forEach(function(e){var t;u(e)&&e[0]&&!k(e[0])&&(t=e[0],e=e[1]||"",r.push(t+": "+e))}),r.join("\r\n")}function L(e){var t={},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 O(e,t){e=_(e),t=_(t);return e.protocol===t.protocol&&e.host===t.host}function j(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 q(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 H=function(e){var t,r;return void 0===e&&(e=window),b()&&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"},I=function(){var e="unknown",t=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return t&&f(t.effectiveType)?t.effectiveType:e};function A(e){return!!e&&Math.random()<Number(e)}var D=(F.post=function(e,t,r){var n,o=null!==(n=null==r?void 0:r.success)&&void 0!==n?n:R,i=null!==(r=null==r?void 0:r.fail)&&void 0!==r?r:R,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()}},F.get=function(e,t){var r,n=null!==(r=null==t?void 0:t.success)&&void 0!==r?r:R,o=null!==(r=null==t?void 0:t.fail)&&void 0!==r?r:R,i=null!==(r=null==t?void 0:t.getResponse)&&void 0!==r?r:R,s=null!==(t=null==t?void 0:t.getResponseText)&&void 0!==t?t:R,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()}},F.prototype.getCommonParams=function(){return{timestamp:Date.now()}},F);function F(e){var t=this;this.postEvent=function(e){e=p(p({},e),t.getCommonParams());F.post(t.url,e)},this.getEvent=function(e){e=T(p(p({},e),t.getCommonParams())),e=t.url+"?"+e;F.get(e)},this.getURL=function(){return t.url},this.options=e,this.url=this.options.reportURL}function B(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 N(e){return e?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,e):""}var J="x-tt-trace-id",U="x-tt-trace-host",X="x-tt-logid";function z(e,t,r){void 0===r&&(r="01");t=""+B((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"+N(18);e=22-t.length-4;return""+B(""+t.length,2)+t+N(e)}r=parseInt(t,10)}var r=22-(t=r.toString(16)).length-4;return""+B(""+t.length,2)+t+N(r)}(e)+("string"==typeof t?N(4):B(t.toString(16),4));return"00-"+t+"-"+t.substr(0,16)+"-"+r}function V(){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 K=.1,G=["/log/sentry/"],W=8e3,Q=4e3;V(),V();var $="AjaxMonitor",Y=(Z.prototype.setup=function(e){void 0===e&&(e=R),d(XMLHttpRequest)&&(this.callback=e,this.start())},Z.prototype.updateConfig=function(e){this.props=i({},this.props,e)},Z.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},Z.prototype.hookXMLHttpRequestSetRequestHeader=function(){var r=XMLHttpRequest.prototype.setRequestHeader||R;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)}},Z.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)}},Z.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=z(t,e),this.setRequestHeader(J,o.traceId))),o.hookXMLHttpRequestOnreadystatechange.call(this,o),this._start=Date.now(),this._data=null==r?void 0:r[0],i.apply(this,r)}},Z.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=O(location.href,e);return r&&n&&t&&e},Z.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},Z.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:C(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]]))}),C(r)}return c(t)?C(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(J))&&(t.trace_id=r,t.trace_host=null!==(e=this.getResponseHeader(U))&&void 0!==e?e:void 0,t.log_id=null!==(e=this.getResponseHeader(X))&&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=x(e.responseText);else if(e.response)t=x(e.response);else try{t=x(e.responseText)}catch(e){t=0}return t}(this)),t=p(p({},t),L(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=_(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)}},Z.monitorName=$,Z);function Z(e){this.name=$,this.callback=R,this.traceId=null,this.props=e}function ee(e){return e instanceof Request}var te="FetchMonitor",re=(ne.prototype.updateConfig=function(e){this.props=i({},this.props,e)},ne.prototype.setup=function(e){void 0===e&&(e=R),g()&&(this.callback=e,this.start())},ne.prototype.start=function(){g()&&this.hookFetch()},ne.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=O(location.href,e);return r&&n&&t&&e},ne.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=_(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"]})},ne.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},ne.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;ee(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=z(t,r),o.headers.append(J,a.trace_id)))}catch(e){}return a.ax_type=c.getFetchMethod(n,o),a=p(p({},a),L(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(U)&&(a.trace_host=null!==(t=e.headers.get(U))&&void 0!==t?t:void 0),e.headers.has(J)&&(a.trace_id=null!==(r=e.headers.get(J))&&void 0!==r?r:void 0),e.headers.has(X)&&(a.log_id=null!==(r=e.headers.get(X))&&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)})}},ne.prototype.getFetchUrl=function(e,t){void 0===t&&(t=!1);var r="",r=ee(e)?e.url:e;return t||(r=f(r)?r.split("?")[0]:r),r},ne.prototype.getFetchMethod=function(e,t){t=null!==(t=null==t?void 0:t.method)&&void 0!==t?t:"get";return ee(e)&&(t=null!==(e=e.method)&&void 0!==e?e:t),t.toLowerCase()},ne.prototype.getFetchBody=function(e,t){return ee(e)?e.body:null==t?void 0:t.body},ne.prototype.getAllHeaders=function(e){if(!e||"function"!=typeof e.forEach)return"";var r=[];return e.forEach(function(e,t){r.push([t,e])}),C(r)},ne.monitorName=te,ne);function ne(e){this.name=te,this.callback=R,this.props=e}var oe="FMPMonitor",ie=(se.prototype.setup=function(e){if(b())return w()?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},se.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})},se.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},se.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},se.prototype.getTimeGap=function(){return y()?this.startTime-performance.timing.navigationStart:0},se.prototype.formatEvent=function(e){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:e}}},se.monitorName=oe,se);function se(){var r=this;this.name=oe,this.callback=R,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 ae(){}var ce=!1,ue=!1,le={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=le.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)},le.originals.send.apply(this,e)},this.proxies.send=XMLHttpRequest.prototype.send},patchFetch:function(o){var i;g()&&(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=le.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(w()){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&&(ce=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(ue=!1,window.fetch=this.originals.fetch)}},pe="TTIMonitor",he=(de.prototype.setup=function(){},de.prototype.isEnable=function(){return P()&&!!M()&&d(window.PerformanceResourceTiming)&&E()},de.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"]})}},de.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),le.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=ae,this.proxyConfig.afterCb=ae)},de.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))},de.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))},de.prototype.registerListeners=function(){ce||(le.patchXMLHTTPRequest(this.proxyConfig),ce=!0),ue||(le.patchFetch(this.proxyConfig),ue=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=le.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},de.prototype.mutationObserverCallback=function(e){this.rescheduleTimer(performance.now()+5e3)},de.prototype.beforeJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=performance.now()},de.prototype.afterJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=void 0},de.prototype.networkRequestFinishedCallback=function(e){this.networkRequests.push({start:e.fetchStart,end:e.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(de.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}),de.prototype.longTaskFinishedCallback=function(e){var t=e.startTime+e.duration;this.longTasks.push({start:e.startTime,end:t}),this.rescheduleTimer(t+5e3)},de.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)},de.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var e=performance.timing;return e.domContentLoadedEventEnd-e.navigationStart}return null},de.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var e=performance.getEntriesByType("paint")[0];return e?e.startTime:0}return 0},de.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)},de.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},de.monitorName=pe,de);function de(e){var t,r,n,o=this;if(this.name=pe,this.longTasks=[],this.callback=ae,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 fe(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 me="FIDMonitor",ve=(ge.prototype.setup=function(e){var a=this;if(M()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&E()){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"]})}}},ge.monitorName=me,ge);function ge(){this.name=me,this.callback=R}var be="MPFIDMonitor",ye=(Se.prototype.setup=function(){var t,e,r,s=this;if(P()&&E()){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"]})}},Se.prototype.getMPFID=function(){var t,e;if(P()&&E()){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))}},Se.prototype.formatEvent=function(e){return{name:this.name,mpfid:e}},Se.monitorName=be,Se);function Se(e){this.name=be,this.list=[],this.props=e}var we=[],Me="ResourcePerformanceMonitor",Pe=(Ee.prototype.setup=function(e){this.isEnable()&&(this.callback=null!=e?e:R,this.isAsync&&window.performance.clearResourceTimings(),this.observe&&(this.sendResourcePerformance(performance.getEntriesByType("resource")),this.observePerformance()))},Ee.prototype.isEnable=function(){return S()&&"function"==typeof performance.clearResourceTimings},Ee.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},Ee.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}}},Ee.prototype.sendResourcePerformance=function(e){e=this.buildParams(e);e&&this.callback(e)},Ee.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(e){return!m(we,e.initiatorType)})},Ee.prototype.observePerformance=function(){var t=this;M()&&new PerformanceObserver(function(e){e=e.getEntries();e.length&&t.sendResourcePerformance(e)}).observe({entryTypes:["resource"]})},Ee.monitorName=Me,Ee);function Ee(e){var t,r=this;this.name=Me,this.callback=R,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 Te={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:[]},_e="PerformanceMonitor",ke=(Re.prototype.setup=function(e){var t,r=this;y()&&(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({},Te),this.staticPerformanceMonitor=new Pe,this.staticPerformanceMonitor.setup(),(new ve).setup(this.hasFID),this.mpfidMonitor=new ye({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),e=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:he,this.ttiMonitor=new e({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),e=this.syncPerfLog.bind(this),q(e))},Re.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)},Re.prototype.getBounced=function(){return!this.hasLoaded},Re.prototype.getPaintTime=function(t){if(S()){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},Re.monitorName=_e,Re);function Re(e){var o=this;this.name=_e,this.callback=R,this.sendParams=p({},Te),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({},Te),o.sendParams.isAsync=1,o.initFlag=!0,o.initStart=o.performanceNow(),o.staticPerformanceMonitor=new Pe({isAsync:1}),o.staticPerformanceMonitor.setup(),o.mpfidMonitor=new ye({isAsync:1,preLongTaskObserver:o.props.preLongTaskObserver}),o.mpfidMonitor.setup(),t=null!==(e=o.props.TTIMonitor)&&void 0!==e?e:he,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,R))},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),y()){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(y()){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(!S())return null;var e=window.performance.getEntriesByType("navigation");return u(e)&&0!==e.length?e[0]:null}(),t=y()?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 xe="StaticErrorMonitor",Ce=(Le.prototype.setup=function(e){b()&&(this.callback=e,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},Le.prototype.getSrc=function(e){return"link"===e.tagName.toLowerCase()?Oe(e,"href"):Oe(e,"src")},Le.prototype.getParams=function(e,t){var r={ev_type:"static",st_type:t},t=_(e);return r.st_src=e,r.st_protocol=t.protocol,r.st_domain=t.hostname,r.st_path=t.pathname,r},Le.monitorName=xe,Le);function Le(){var i=this;this.name=xe,this.callback=R,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 Oe(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 je="BreadcrumbMonitor",qe=(He.prototype.setup=function(){this.instrumentDOM()},He.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))},He.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}))}},He.prototype.triggerHandlers=function(e,t){if(e)try{this.domBreadcrumb(t)}catch(e){}},He.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))}},He.prototype.domBreadcrumb=function(e){var t;try{t=e.event.target?fe(e.event.target):fe(e.event)}catch(e){t="<unknown>"}0!==t.length&&this.addBreadcrumb({category:"ui."+e.name,message:t})},He.monitorName=je,He);function He(){var r=this;this.name=je,this.breadcrumbs=[],this.getBreadcrumbs=function(){return r.breadcrumbs},this.addBreadcrumb=function(e,t){e=p(p({},e),{timestamp:(new Date).getTime()});return r.breadcrumbs=void 0!==t&&0<=t?a(r.breadcrumbs,[e]).slice(-t):a(r.breadcrumbs,[e]),r},this.debounceDuration=1e3,this.debounceTimer=0,this.breadcrumbs=[]}var Ie=(Ae.prototype.sendEvent=function(e){e=this.getEventToBeSent(e);e&&this.idleSendEvent(e)},Ae.prototype.getEventToBeSent=function(e){e=this._modifyEvent(e);if(this._shouldSend(e))return e},Ae.prototype._modifyEvent=function(e){return e},Ae.prototype._shouldSend=function(e){return!0},Ae.prototype._send=function(e){},Ae.prototype.idleSendEvent=function(e){this._send(e)},Ae);function Ae(){}var De={enableCatchGlobalJSError:!0},Fe="JSExceptionMonitor",Be=(Ne.prototype.setup=function(e){b()&&(this.callback=e,this.options.enableCatchGlobalJSError&&(window.addEventListener("error",this.jsErrorLog),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog)))},Ne.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)};return{name:this.name,type:"post",event:t}}},Ne.prototype.logError=function(e){e=this.buildEvent(e);e&&this.callback(e)},Ne.prototype.getJSError=function(e){e=e.error;if(e)return e},Ne.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},Ne.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}},Ne.monitorName=Fe,Ne);function Ne(e){var t=this;this.name=Fe,this.callback=R,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({},De),e)}var Je="RANGERS_WEB_ID";function Ue(){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:A(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:A(1),sampleRate:1,sampleHitTrace:!1,ignore:G,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1,webIDHitStaticResource:!1,sampleHitStaticResource:A(K),slowSessionTime:W,spaSlowSessionTime:Q,geckoUrls:[],interval:0,checkPoint:[]},StaticErrorMonitor:{enable:!0,webIDHit:!0,sampleRate:1,ignore:G},ResourcePerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1},BreadcrumbMonitor:{enable:!0}},e.custom={},e.commonParams={aid:0,pid:"",version:"0.2.10-beta.4",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:V(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:H(),network_type:I()},e}function Xe(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,Je)&&(document.cookie=Je+"="+e+";max-age=7776000;domain="+location.hostname+";path=/")}var ze,Ve,Ke,Ge,We=(ze="/v2/user/webid",Ve="/v2/user/ssid",Ke="/v2/event/list",Ge=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(t){[ze,Ve,Ke].forEach(function(e){Ge.push(t+e)})}),Ge);function Qe(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=j(a(["/monitor_browser/collect"],We)||[]);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||!A(t.sampleRate))return!1;if(u(e=t.whitelistUrls)&&0<e.length){var n=j(t.whitelistUrls||[]);return n&&n.test(r.event.ax_url)?!0:!1}if((n=j(t.ignore||[]))&&n.test(r.event.ax_url))return!1;if((n=t.statusCodeSample)&&l(n,r.event.ax_status))return A(n[r.event.ax_status]);if(t=t.requestUrlSample){var o=!1,i=!1;if(t.forEach(function(e){var t;o||null!=(t=j([e.url]))&&t.test(r.event.ax_url)&&(o=!0,i=A(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&&!!A(n.sampleRate)):"StaticErrorMonitor"===t.name?(n={sendParams:t,staticErrorMonitor:e.StaticErrorMonitor},o=n.sendParams,!(n=n.staticErrorMonitor)||!!n.enable&&(!!n.webIDHit&&(!!A(n.sampleRate)&&(!(n=j(n.ignore||[]))||!n.test(o.event.st_src))))):"JSExceptionMonitor"===t.name?!(o=(o={jsErrorMonitor:e.JSErrorMonitor}).jsErrorMonitor)||!!o.enable&&(!!o.webIDHit&&!!A(o.sampleRate)):"ResourcePerformanceMonitor"!==t.name||(!(e=(e={resourcePerformanceMonitor:e.ResourcePerformanceMonitor}).resourcePerformanceMonitor)||!!e.enable&&(!!e.webIDHit&&!!A(e.sampleRate))))}function $e(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 Ye,Ze,et,tt={cover:R,accumulate:R,reportDirectly:R,average:R},rt=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:tt},nt=(r(Ze=it,et=Ye=Ie),Ze.prototype=null===et?Object.create(et):(ot.prototype=et.prototype,new ot),it.prototype.uploadQueue=function(){},it.prototype._shouldSend=function(e){return Qe({sendParams:e,monitorsSetting:this.options.monitorsSetting})},it.prototype._modifyEvent=function(e){return(e=(e={sendParams:e}).sendParams)&&c(e)?e:{}},it.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 $e({sendParams:e,commonParams:this.options.commonParams,custom:this.options.custom,breadcrumbMonitor:r})},it.prototype._send=function(e){e&&e.event&&e.name&&this.transport&&this.sendByTypes(e)},it.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))},it);function ot(){this.constructor=Ze}function it(e){var o=Ye.call(this)||this;return o.options={},o.setTransport=function(e){o.transport=new rt({transport:e.transport}),o.preQueue.forEach(function(e){Ye.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?Ye.prototype.sendEvent.call(o,e):o.preQueue.push(e)},o.getEventToBeSent=function(e){return null!==(e=Ye.prototype.getEventToBeSent.call(o,e))&&void 0!==e?e:{}},o.options=e,o.preQueue=[],o}var st=(at.prototype.getUserIDFromRangers=function(t){window.collectEvent&&d(window.collectEvent)&&window.collectEvent("getToken",function(e){t(e)})},at.prototype.init=function(e){this.client=new nt(this.getClientOptions(e)),this.client.updateConfig(this.getClientOptions(e)),this.sendPageview();e=this.setMonitors();this.setupMonitors(e),this.setServerSetting()},at.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,D.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)}}))},at.prototype.updateSetting=function(e){this.client.updateConfig(this.getClientOptions(e)),this.client.setTransport({transport:this.userSetting.transport})},at.prototype.getClientOptions=function(e){return{monitorsSetting:e.monitors,commonParams:e.commonParams,custom:e.custom}},at.prototype.setMonitors=function(){var e=[],t=this.baseSetting.flags,r=new ie;return e.push(r),t.enableCatchJSError&&e.push(new Be),t.hookXHR&&e.push(new Y({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),t.hookFetch&&e.push(new re({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),t.enableStaticError&&e.push(new Ce),t.enablePerformance&&(t.enableFMP?e.push(new ke({fmpMonitor:r,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):e.push(new ke({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 qe),t.enableResourcePerformance&&e.push(new Pe({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},at.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(R):e.setup(null===(e=t.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},at.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=A(t.jserr.enable_user_rate),r.JSErrorMonitor.sampleRate=t.jserr.enable_sample_rate),t.performance&&(r.PerformanceMonitor.enable=t.performance.enable,r.PerformanceMonitor.webIDHit=A(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=A(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=A(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},at.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},at.prototype.settingEffect=function(e,t){Xe(e.commonParams.rangers_web_id),t.commonParams.pid!==e.commonParams.pid&&this.sendPageview()},at.prototype.sendPageview=function(){var e;null!==(e=this.client)&&void 0!==e&&e.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},at.prototype.getClientCommonParams=function(r){void 0===r&&(r={});var n={};if(!c(r))return n;var o=["context","pid"];t(r,function(e,t){m(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},at.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){m(n,e)&&(r[e]=t)}),r},at.prototype.getClientCustom=function(e){var t={};return e.beforeSend&&d(e.beforeSend)&&(t.beforeSend=e.beforeSend),t},at.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=A(e.sampleRate)),t;var t},at);function at(){var n=this;this.version="0.2.10-beta.4",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(){q(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=Ue(),this.baseSetting=this.defaultSetting,this.client=void 0,this.serverSetting=void 0,this.userSetting={},this.monitors={}}var ct,ut=R;return b()&&(ct=new st,ut=ct.instance,null!==(st=window.RangersSiteHybridSDK)&&void 0!==st&&st.q&&(u(st=window.RangersSiteHybridSDK.q)&&st.forEach(function(e){ut.apply(void 0,a(e))}),delete window.RangersSiteHybridSDK.q),window.RangersSiteHybridSDK=ct.instance),ut}();
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=o(r,e[n]),n++;return r}function o(e,t){var r,n=p({},e);for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&void 0!==t[r]&&(c(e[r])&&c(t[r])?n[r]=o(e[r],t[r]):!c(e[r])&&c(t[r])?n[r]=o({},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 u(e)||c(e)?u(e)?t([],e):o({},e):e})}(e[r],t[r]):n[r]=t[r]);return n}function m(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 g(){if("fetch"in window)try{return new Headers,new Request(""),new Response,1}catch(e){return}}function b(){return!!c(window)}function e(){return b()&&!!c(window.performance)}function y(){return e()&&!!c(window.performance.timing)}function S(){return!!e()&&!!d(window.performance.getEntries)}function w(){return b()&&"function"==typeof window.MutationObserver}function M(){return b()&&"function"==typeof window.PerformanceObserver}function P(){return!!M()&&d(window.PerformanceLongTaskTiming)}function E(){if(!M())return!1;var e=window.PerformanceObserverEntryList;return d(e)&&d(e.prototype.getEntries)}function T(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 _(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 k=function(e){if(!f(e))return!1;return d(e.toLowerCase)&&(e=e.toLowerCase()),m(["x-tt-token"],e)};function R(){}function x(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 C(e){if(!e)return"";if(!d(e.forEach))return"";var r=[];return e.forEach(function(e){var t;u(e)&&e[0]&&!k(e[0])&&(t=e[0],e=e[1]||"",r.push(t+": "+e))}),r.join("\r\n")}function L(e){var t={},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 O(e,t){e=_(e),t=_(t);return e.protocol===t.protocol&&e.host===t.host}function j(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 q(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 H=function(e){var t,r;return void 0===e&&(e=window),b()&&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"},I=function(){var e="unknown",t=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return t&&f(t.effectiveType)?t.effectiveType:e};function A(e){return!!e&&Math.random()<Number(e)}var D=(F.post=function(e,t,r){var n,o=null!==(n=null==r?void 0:r.success)&&void 0!==n?n:R,i=null!==(r=null==r?void 0:r.fail)&&void 0!==r?r:R,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()}},F.get=function(e,t){var r,n=null!==(r=null==t?void 0:t.success)&&void 0!==r?r:R,o=null!==(r=null==t?void 0:t.fail)&&void 0!==r?r:R,i=null!==(r=null==t?void 0:t.getResponse)&&void 0!==r?r:R,s=null!==(t=null==t?void 0:t.getResponseText)&&void 0!==t?t:R,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()}},F.prototype.getCommonParams=function(){return{timestamp:Date.now()}},F);function F(e){var t=this;this.postEvent=function(e){e=p(p({},e),t.getCommonParams());F.post(t.url,e)},this.getEvent=function(e){e=T(p(p({},e),t.getCommonParams())),e=t.url+"?"+e;F.get(e)},this.getURL=function(){return t.url},this.options=e,this.url=this.options.reportURL}function B(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 N(e){return e?Math.floor(Math.random()*Math.pow(10,12)).toString(16).substr(0,e):""}var J="x-tt-trace-id",U="x-tt-trace-host",X="x-tt-logid";function z(e,t,r){void 0===r&&(r="01");t=""+B((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"+N(18);e=22-t.length-4;return""+B(""+t.length,2)+t+N(e)}r=parseInt(t,10)}var r=22-(t=r.toString(16)).length-4;return""+B(""+t.length,2)+t+N(r)}(e)+("string"==typeof t?N(4):B(t.toString(16),4));return"00-"+t+"-"+t.substr(0,16)+"-"+r}function V(){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 K=.1,G=["/log/sentry/"],W=8e3,Q=4e3;V(),V();var $="AjaxMonitor",Y=(Z.prototype.setup=function(e){void 0===e&&(e=R),d(XMLHttpRequest)&&(this.callback=e,this.start())},Z.prototype.updateConfig=function(e){this.props=i({},this.props,e)},Z.prototype.start=function(){this.hookXMLHttpRequestOpen(),this.hookXMLHttpRequestSend(),this.hookXMLHttpRequestSetRequestHeader()},Z.prototype.hookXMLHttpRequestSetRequestHeader=function(){var r=XMLHttpRequest.prototype.setRequestHeader||R;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)}},Z.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)}},Z.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=z(t,e),this.setRequestHeader(J,o.traceId))),o.hookXMLHttpRequestOnreadystatechange.call(this,o),this._start=Date.now(),this._data=null==r?void 0:r[0],i.apply(this,r)}},Z.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=O(location.href,e);return r&&n&&t&&e},Z.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},Z.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:C(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]]))}),C(r)}return c(t)?C(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(J))&&(t.trace_id=r,t.trace_host=null!==(e=this.getResponseHeader(U))&&void 0!==e?e:void 0,t.log_id=null!==(e=this.getResponseHeader(X))&&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=x(e.responseText);else if(e.response)t=x(e.response);else try{t=x(e.responseText)}catch(e){t=0}return t}(this)),t=p(p({},t),L(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=_(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)}},Z.monitorName=$,Z);function Z(e){this.name=$,this.callback=R,this.traceId=null,this.props=e}function ee(e){return e instanceof Request}var te="FetchMonitor",re=(ne.prototype.updateConfig=function(e){this.props=i({},this.props,e)},ne.prototype.setup=function(e){void 0===e&&(e=R),g()&&(this.callback=e,this.start())},ne.prototype.start=function(){g()&&this.hookFetch()},ne.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=O(location.href,e);return r&&n&&t&&e},ne.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=_(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"]})},ne.prototype.collectErrorRequest=function(){var e;return null!==(e=null===(e=this.props.ajaxMonitorOptions)||void 0===e?void 0:e.errorRequestCollect)&&void 0!==e&&e},ne.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;ee(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=z(t,r),o.headers.append(J,a.trace_id)))}catch(e){}return a.ax_type=c.getFetchMethod(n,o),a=p(p({},a),L(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(U)&&(a.trace_host=null!==(t=e.headers.get(U))&&void 0!==t?t:void 0),e.headers.has(J)&&(a.trace_id=null!==(r=e.headers.get(J))&&void 0!==r?r:void 0),e.headers.has(X)&&(a.log_id=null!==(r=e.headers.get(X))&&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)})}},ne.prototype.getFetchUrl=function(e,t){void 0===t&&(t=!1);var r="",r=ee(e)?e.url:e;return t||(r=f(r)?r.split("?")[0]:r),r},ne.prototype.getFetchMethod=function(e,t){t=null!==(t=null==t?void 0:t.method)&&void 0!==t?t:"get";return ee(e)&&(t=null!==(e=e.method)&&void 0!==e?e:t),t.toLowerCase()},ne.prototype.getFetchBody=function(e,t){return ee(e)?e.body:null==t?void 0:t.body},ne.prototype.getAllHeaders=function(e){if(!e||"function"!=typeof e.forEach)return"";var r=[];return e.forEach(function(e,t){r.push([t,e])}),C(r)},ne.monitorName=te,ne);function ne(e){this.name=te,this.callback=R,this.props=e}var oe="FMPMonitor",ie=(se.prototype.setup=function(e){if(b())return w()?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},se.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})},se.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},se.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},se.prototype.getTimeGap=function(){return y()?this.startTime-performance.timing.navigationStart:0},se.prototype.formatEvent=function(e){return{name:this.name,type:"post",event:{ev_type:"fmp",fmp:e}}},se.monitorName=oe,se);function se(){var r=this;this.name=oe,this.callback=R,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 ae(){}var ce=!1,ue=!1,le={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=le.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)},le.originals.send.apply(this,e)},this.proxies.send=XMLHttpRequest.prototype.send},patchFetch:function(o){var i;g()&&(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=le.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(w()){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&&(ce=!1,XMLHttpRequest.prototype.send=this.originals.send),this.originals.fetch&&fetch===this.proxies.fetch&&(ue=!1,window.fetch=this.originals.fetch)}},pe="TTIMonitor",he=(de.prototype.setup=function(){},de.prototype.isEnable=function(){return P()&&!!M()&&d(window.PerformanceResourceTiming)&&E()},de.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"]})}},de.prototype.unregisterListeners=function(){this.performanceObserver&&this.performanceObserver.disconnect(),this.mutationObserver&&this.mutationObserver.disconnect(),le.resetOriginals(),this.proxyConfig&&(this.proxyConfig.beforeCb=ae,this.proxyConfig.afterCb=ae)},de.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))},de.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))},de.prototype.registerListeners=function(){ce||(le.patchXMLHTTPRequest(this.proxyConfig),ce=!0),ue||(le.patchFetch(this.proxyConfig),ue=!0),this.registerPerformanceObserver(),this.useMutationObserver&&(this.mutationObserver=le.observeResourceFetchingMutations(this.mutationObserverCallback.bind(this)))},de.prototype.mutationObserverCallback=function(e){this.rescheduleTimer(performance.now()+5e3)},de.prototype.beforeJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=performance.now()},de.prototype.afterJSInitiatedRequestCallback=function(e){this.incompleteJSInitiatedRequestStartTimes[e]=void 0},de.prototype.networkRequestFinishedCallback=function(e){this.networkRequests.push({start:e.fetchStart,end:e.responseEnd}),this.rescheduleTimer(this.computeLastKnownNetwork2Busy(this.incompleteRequestStarts,this.networkRequests)+5e3)},Object.defineProperty(de.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}),de.prototype.longTaskFinishedCallback=function(e){var t=e.startTime+e.duration;this.longTasks.push({start:e.startTime,end:t}),this.rescheduleTimer(t+5e3)},de.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)},de.prototype.getMinValue=function(){if(this.minValue)return this.minValue;if(performance.timing.domContentLoadedEventEnd){var e=performance.timing;return e.domContentLoadedEventEnd-e.navigationStart}return null},de.prototype.getFirstPaintTime=function(){if("PerformancePaintTiming"in window){var e=performance.getEntriesByType("paint")[0];return e?e.startTime:0}return 0},de.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)},de.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},de.monitorName=pe,de);function de(e){var t,r,n,o=this;if(this.name=pe,this.longTasks=[],this.callback=ae,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 fe(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 me="FIDMonitor",ve=(ge.prototype.setup=function(e){var a=this;if(M()&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("first-input")&&E()){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"]})}}},ge.monitorName=me,ge);function ge(){this.name=me,this.callback=R}var be="MPFIDMonitor",ye=(Se.prototype.setup=function(){var t,e,r,s=this;if(P()&&E()){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"]})}},Se.prototype.getMPFID=function(){var t,e;if(P()&&E()){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))}},Se.prototype.formatEvent=function(e){return{name:this.name,mpfid:e}},Se.monitorName=be,Se);function Se(e){this.name=be,this.list=[],this.props=e}var we=[],Me="ResourcePerformanceMonitor",Pe=(Ee.prototype.setup=function(e){this.isEnable()&&(this.callback=null!=e?e:R,this.isAsync&&window.performance.clearResourceTimings(),this.observe&&(this.sendResourcePerformance(performance.getEntriesByType("resource")),this.observePerformance()))},Ee.prototype.isEnable=function(){return S()&&"function"==typeof performance.clearResourceTimings},Ee.prototype.getPerformance=function(){return this.isEnable()?this.buildParams(this.getResources()):this.buildParams([])},Ee.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}}},Ee.prototype.sendResourcePerformance=function(e){e=this.buildParams(e);e&&this.callback(e)},Ee.prototype.getResources=function(){return window.performance.getEntriesByType("resource").filter(function(e){return!m(we,e.initiatorType)})},Ee.prototype.observePerformance=function(){var t=this;M()&&new PerformanceObserver(function(e){e=e.getEntries();e.length&&t.sendResourcePerformance(e)}).observe({entryTypes:["resource"]})},Ee.monitorName=Me,Ee);function Ee(e){var t,r=this;this.name=Me,this.callback=R,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 Te={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:[]},_e="PerformanceMonitor",ke=(Re.prototype.setup=function(e){var t,r=this;y()&&(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({},Te),this.staticPerformanceMonitor=new Pe,this.staticPerformanceMonitor.setup(),(new ve).setup(this.hasFID),this.mpfidMonitor=new ye({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.mpfidMonitor.setup(),e=null!==(e=this.props.TTIMonitor)&&void 0!==e?e:he,this.ttiMonitor=new e({isAsync:0,preLongTaskObserver:this.props.preLongTaskObserver}),this.ttiMonitor.setup(),e=this.syncPerfLog.bind(this),q(e))},Re.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)},Re.prototype.getBounced=function(){return!this.hasLoaded},Re.prototype.getPaintTime=function(t){if(S()){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},Re.monitorName=_e,Re);function Re(e){var o=this;this.name=_e,this.callback=R,this.sendParams=p({},Te),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({},Te),o.sendParams.isAsync=1,o.initFlag=!0,o.initStart=o.performanceNow(),o.staticPerformanceMonitor=new Pe({isAsync:1}),o.staticPerformanceMonitor.setup(),o.mpfidMonitor=new ye({isAsync:1,preLongTaskObserver:o.props.preLongTaskObserver}),o.mpfidMonitor.setup(),t=null!==(e=o.props.TTIMonitor)&&void 0!==e?e:he,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,R))},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),y()){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(y()){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(!S())return null;var e=window.performance.getEntriesByType("navigation");return u(e)&&0!==e.length?e[0]:null}(),t=y()?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 xe="StaticErrorMonitor",Ce=(Le.prototype.setup=function(e){b()&&(this.callback=e,window.addEventListener("error",this.staticErrorLog.bind(this),!0))},Le.prototype.getSrc=function(e){return"link"===e.tagName.toLowerCase()?Oe(e,"href"):Oe(e,"src")},Le.prototype.getParams=function(e,t){var r={ev_type:"static",st_type:t},t=_(e);return r.st_src=e,r.st_protocol=t.protocol,r.st_domain=t.hostname,r.st_path=t.pathname,r},Le.monitorName=xe,Le);function Le(){var i=this;this.name=xe,this.callback=R,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 Oe(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 je="BreadcrumbMonitor",qe=(He.prototype.setup=function(){this.instrumentDOM()},He.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))},He.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}))}},He.prototype.triggerHandlers=function(e,t){if(e)try{this.domBreadcrumb(t)}catch(e){}},He.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))}},He.prototype.domBreadcrumb=function(e){var t;try{t=e.event.target?fe(e.event.target):fe(e.event)}catch(e){t="<unknown>"}0!==t.length&&this.addBreadcrumb({category:"ui."+e.name,message:t})},He.monitorName=je,He);function He(){var r=this;this.name=je,this.breadcrumbs=[],this.getBreadcrumbs=function(){return r.breadcrumbs},this.addBreadcrumb=function(e,t){e=p(p({},e),{timestamp:(new Date).getTime()});return r.breadcrumbs=void 0!==t&&0<=t?a(r.breadcrumbs,[e]).slice(-t):a(r.breadcrumbs,[e]),r},this.debounceDuration=1e3,this.debounceTimer=0,this.breadcrumbs=[]}var Ie=(Ae.prototype.sendEvent=function(e){e=this.getEventToBeSent(e);e&&this.idleSendEvent(e)},Ae.prototype.getEventToBeSent=function(e){e=this._modifyEvent(e);if(this._shouldSend(e))return e},Ae.prototype._modifyEvent=function(e){return e},Ae.prototype._shouldSend=function(e){return!0},Ae.prototype._send=function(e){},Ae.prototype.idleSendEvent=function(e){this._send(e)},Ae);function Ae(){}var De={enableCatchGlobalJSError:!0},Fe="JSExceptionMonitor",Be=(Ne.prototype.setup=function(e){b()&&(this.callback=e,this.options.enableCatchGlobalJSError&&(window.addEventListener("error",this.jsErrorLog),window.addEventListener("unhandledrejection",this.jsPromiseRejectionLog)))},Ne.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)};return{name:this.name,type:"post",event:t}}},Ne.prototype.logError=function(e){e=this.buildEvent(e);e&&this.callback(e)},Ne.prototype.getJSError=function(e){e=e.error;if(e)return e},Ne.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},Ne.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}},Ne.monitorName=Fe,Ne);function Ne(e){var t=this;this.name=Fe,this.callback=R,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({},De),e)}var Je="RANGERS_WEB_ID";function Ue(){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:A(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:A(1),sampleRate:1,sampleHitTrace:!1,ignore:G,abort:!1,whitelistUrls:[],statusCodeSample:{},requestUrlSample:[],errorRequestCollect:!1},PerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1,webIDHitStaticResource:!1,sampleHitStaticResource:A(K),slowSessionTime:W,spaSlowSessionTime:Q,geckoUrls:[],interval:0,checkPoint:[]},StaticErrorMonitor:{enable:!0,webIDHit:!0,sampleRate:1,ignore:G},ResourcePerformanceMonitor:{enable:!0,webIDHit:!0,sampleRate:1},BreadcrumbMonitor:{enable:!0}},e.custom={},e.commonParams={aid:0,pid:"",version:"0.2.10-beta.5",hostname:window.location.hostname,protocol:window.location.protocol.slice(0,-1),rangers_web_id:"",rangers_session_id:V(),context:{},url:window.location.href,timestamp:Date.now(),screen_resolution:H(),network_type:I()},e}function Xe(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,Je)&&(document.cookie=Je+"="+e+";max-age=7776000;domain="+location.hostname+";path=/")}var ze,Ve,Ke,Ge,We=(ze="/v2/user/webid",Ve="/v2/user/ssid",Ke="/v2/event/list",Ge=[],["https://mcs.ctobsnssdk.com","https://mcs.itobsnssdk.com","https://mcs.tobsnssdk.com"].forEach(function(t){[ze,Ve,Ke].forEach(function(e){Ge.push(t+e)})}),Ge);function Qe(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=j(a(["/monitor_browser/collect"],We)||[]);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||!A(t.sampleRate))return!1;if(u(e=t.whitelistUrls)&&0<e.length){var n=j(t.whitelistUrls||[]);return n&&n.test(r.event.ax_url)?!0:!1}if((n=j(t.ignore||[]))&&n.test(r.event.ax_url))return!1;if((n=t.statusCodeSample)&&l(n,r.event.ax_status))return A(n[r.event.ax_status]);if(t=t.requestUrlSample){var o=!1,i=!1;if(t.forEach(function(e){var t;o||null!=(t=j([e.url]))&&t.test(r.event.ax_url)&&(o=!0,i=A(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&&!!A(n.sampleRate)):"StaticErrorMonitor"===t.name?(n={sendParams:t,staticErrorMonitor:e.StaticErrorMonitor},o=n.sendParams,!(n=n.staticErrorMonitor)||!!n.enable&&(!!n.webIDHit&&(!!A(n.sampleRate)&&(!(n=j(n.ignore||[]))||!n.test(o.event.st_src))))):"JSExceptionMonitor"===t.name?!(o=(o={jsErrorMonitor:e.JSErrorMonitor}).jsErrorMonitor)||!!o.enable&&(!!o.webIDHit&&!!A(o.sampleRate)):"ResourcePerformanceMonitor"!==t.name||(!(e=(e={resourcePerformanceMonitor:e.ResourcePerformanceMonitor}).resourcePerformanceMonitor)||!!e.enable&&(!!e.webIDHit&&!!A(e.sampleRate))))}function $e(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 Ye,Ze,et,tt={cover:R,accumulate:R,reportDirectly:R,average:R},rt=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:tt},nt=(r(Ze=it,et=Ye=Ie),Ze.prototype=null===et?Object.create(et):(ot.prototype=et.prototype,new ot),it.prototype.uploadQueue=function(){},it.prototype._shouldSend=function(e){return Qe({sendParams:e,monitorsSetting:this.options.monitorsSetting})},it.prototype._modifyEvent=function(e){return(e=(e={sendParams:e}).sendParams)&&c(e)?e:{}},it.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 $e({sendParams:e,commonParams:this.options.commonParams,custom:this.options.custom,breadcrumbMonitor:r})},it.prototype._send=function(e){e&&e.event&&e.name&&this.transport&&this.sendByTypes(e)},it.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))},it);function ot(){this.constructor=Ze}function it(e){var o=Ye.call(this)||this;return o.options={},o.setTransport=function(e){o.transport=new rt({transport:e.transport}),o.preQueue.forEach(function(e){Ye.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?Ye.prototype.sendEvent.call(o,e):o.preQueue.push(e)},o.getEventToBeSent=function(e){return null!==(e=Ye.prototype.getEventToBeSent.call(o,e))&&void 0!==e?e:{}},o.options=e,o.preQueue=[],o}var st=(at.prototype.getUserIDFromRangers=function(t){window.collectEvent&&d(window.collectEvent)&&window.collectEvent("getToken",function(e){t(e)})},at.prototype.init=function(e){this.client=new nt(this.getClientOptions(e)),this.client.updateConfig(this.getClientOptions(e)),this.sendPageview();e=this.setMonitors();this.setupMonitors(e),this.setServerSetting()},at.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,D.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)}}))},at.prototype.updateSetting=function(e){this.client.updateConfig(this.getClientOptions(e)),this.client.setTransport({transport:this.userSetting.transport})},at.prototype.getClientOptions=function(e){return{monitorsSetting:e.monitors,commonParams:e.commonParams,custom:e.custom}},at.prototype.setMonitors=function(){var e=[],t=this.baseSetting.flags,r=new ie;return e.push(r),t.enableCatchJSError&&e.push(new Be),t.hookXHR&&e.push(new Y({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),t.hookFetch&&e.push(new re({commonParams:{bid:this.baseSetting.commonParams.aid+"",web_id:this.baseSetting.commonParams.rangers_web_id},ajaxMonitorOptions:this.baseSetting.monitors.AjaxMonitor})),t.enableStaticError&&e.push(new Ce),t.enablePerformance&&(t.enableFMP?e.push(new ke({fmpMonitor:r,renderType:1,preLongTaskObserver:{precollect:[],observer:void 0}})):e.push(new ke({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 qe),t.enableResourcePerformance&&e.push(new Pe({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},at.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(R):e.setup(null===(e=t.client)||void 0===e?void 0:e.sendEvent)}),this.client.updateConfig({monitors:this.monitors}))},at.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=A(t.jserr.enable_user_rate),r.JSErrorMonitor.sampleRate=t.jserr.enable_sample_rate),t.performance&&(r.PerformanceMonitor.enable=t.performance.enable,r.PerformanceMonitor.webIDHit=A(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=A(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=A(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},at.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},at.prototype.settingEffect=function(e,t){Xe(e.commonParams.rangers_web_id),t.commonParams.pid!==e.commonParams.pid&&this.sendPageview()},at.prototype.sendPageview=function(){var e;null!==(e=this.client)&&void 0!==e&&e.sendEvent({name:"PageViewMonitor",event:{ev_type:"pageview"},type:"post"})},at.prototype.getClientCommonParams=function(r){void 0===r&&(r={});var n={};if(!c(r))return n;var o=["context","pid"];t(r,function(e,t){m(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},at.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){m(n,e)&&(r[e]=t)}),r},at.prototype.getClientCustom=function(e){var t={};return e.beforeSend&&d(e.beforeSend)&&(t.beforeSend=e.beforeSend),t},at.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=A(e.sampleRate)),t;var t},at);function at(){var n=this;this.version="0.2.10-beta.5",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(){q(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=Ue(),this.baseSetting=this.defaultSetting,this.client=void 0,this.serverSetting=void 0,this.userSetting={},this.monitors={}}var ct,ut=R;return b()&&(ct=new st,ut=ct.instance,null!==(st=window.RangersSiteHybridSDK)&&void 0!==st&&st.q&&(u(st=window.RangersSiteHybridSDK.q)&&st.forEach(function(e){ut.apply(void 0,a(e))}),delete window.RangersSiteHybridSDK.q),window.RangersSiteHybridSDK=ct.instance),ut}();
{
"name": "@apm-insight-web/rangers-site-sdk",
"version": "0.2.10-beta.4",
"version": "0.2.10-beta.5",
"main": "cn/index.cjs.js",

@@ -9,3 +9,3 @@ "module": "cn/index.esm.js",

"@slardar/polyfill": "0.1.2",
"@slardar/sdk": "3.6.3-beta.4",
"@slardar/sdk": "3.6.3-beta.5",
"@slardar/sdk-core": "3.6.3-beta.3",

@@ -18,3 +18,3 @@ "@slardar/types": "3.5.4-beta.1"

},
"gitHead": "39366f387249596152566ae0859b0db1f6640f6d"
"gitHead": "69fc2bd8020b69feb822b80121c399dc5d39b552"
}

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

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

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

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