!function(){"use strict";var y=function(){return(y=Object.assign||function(n){for(var t,e=1,r=arguments.length;e>>((3&e)<<3)&255;return n}();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(n){for(var t=[],e=0;e<256;++e)t[e]=(e+256).toString(16).substr(1);var r=0,o=t;return[o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],"-",o[n[r++]],o[n[r++]],o[n[r++]],o[n[r++]],o[n[+r]],o[n[15]]].join("")}(n)}function q(r,n){var t=[];try{t=n.reduce(function(n,t){try{var e=t(r);"function"==typeof e&&n.push(e)}catch(n){}return n},[])}catch(n){}return function(n){return q(n,t)}}function P(n,r){var o=C(n,1)[0];return function(t,n){var e=o(function(n){return D(r)(n)?t(n):b});n(function(){e()})}}var N=function(n){function t(n){a=R(a,n),f||s()}var e,r,o,i,u,a=[],c=[],f=!1,s=(r=function(){return a.length},o=function(){f=!0,e&&e[0](),c.forEach(function(n){return n()}),c.length=0,e=void 0},-1===(i=n=void(u=0)===n?3e5:n)?b:function(){if(r())return u&&clearTimeout(u),void(u=0);0===u&&(u=setTimeout(o,i))});return{next:function(n){return q(n,a)},complete:function(n){c.push(n)},attach:function(n,t){e=[n,t]},subscribe:function(n){if(f)throw new Error("Observer is closed");return a.push(n),e&&e[1]&&e[1](n),s(),function(){return t(n)}},unsubscribe:t}},B=function(n,t,e){e=N(e);try{n(e.next,e.attach),t&&e.complete(t)}catch(n){}return[e.subscribe,e.unsubscribe]};function H(){function r(n){n.length&&n.forEach(function(n){try{n()}catch(n){}}),n.length=0}function t(n){i[n]&&i[n].forEach(function(n){r(n[1])}),i[n]=void 0}var o=!1,i={};return{set:function(n,t,e){i[n]?i[n].push([t,e]):i[n]=[[t,e]],o&&r(e)},has:function(n){return!!i[n]},remove:t,removeByEvType:function(t){Object.keys(i).forEach(function(n){i[n]&&i[n].forEach(function(n){n[0]===t&&r(n[1])})})},clear:function(){o=!0,Object.keys(i).forEach(function(n){t(n)})}}}var M=function(n,t,e,r){return n.destroyAgent.set(t,e,r)};var U=["init","start","config","beforeDestroy","provide","beforeReport","report","beforeBuild","build","beforeSend","send","beforeConfig"];function z(n){var e,r,t=n.builder,o=n.createSender,i=n.createDefaultConfig,u=n.createConfigManager,a=n.userConfigNormalizer,c=n.initConfigNormalizer,f=n.validateInitConfig,s={};U.forEach(function(n){return s[n]=[]});var l=!1,d=!1,p=!1,v=[],h=[],g=H(),m={getBuilder:function(){return t},getSender:function(){return e},getPreStartQueue:function(){return v},init:function(n){if(l)j("already inited");else{if(!(n&&w(n)&&f(n)))throw new Error("invalid InitConfig, init failed");var t=i(n);if(!t)throw new Error("defaultConfig missing");n=c(n);if((r=u(t)).setConfig(n),r.onChange(function(){y("config")}),!(e=o(r.getConfig())))throw new Error("sender missing");y("init",l=!0)}},set:function(n){l&&n&&w(n)&&(y("beforeConfig",!1,n),null!=r&&r.setConfig(n))},config:function(n){if(l)return n&&w(n)&&(y("beforeConfig",!1,n),null!=r&&r.setConfig(a(n))),null==r?void 0:r.getConfig()},provide:function(n,t){S(h,n)?j("cannot provide "+n+", reserved"):(m[n]=t,y("provide",!1,n))},start:function(){l&&(d||null!=r&&r.onReady(function(){var t,n;y("start",d=!0),(n=(t=m).getPreStartQueue()).forEach(function(n){return t.build(n)}),n.length=0}))},report:function(n){var t,e;n&&(!(e=I(s.beforeReport)(n))||(t=I(s.report)(e))&&(d?this.build(t):(n=m,(e=v).push(t),e.length<500||(e=e.splice(0,50),n.savePreStartDataToDb&&n.savePreStartDataToDb(e)))))},build:function(n){!d||(n=I(s.beforeBuild)(n))&&(!(n=t.build(n))||(n=I(s.build)(n))&&this.send(n))},send:function(n){!d||(n=I(s.beforeSend)(n))&&(e.send(n),y("send",!1,n))},destroy:function(){g.clear(),p=!0,y("beforeDestroy",!(v.length=0))},on:function(n,t){if("init"===n&&l||"start"===n&&d||"beforeDestroy"===n&&p)try{t()}catch(n){}else s[n]&&s[n].push(t)},off:function(n,t){s[n]&&(s[n]=R(s[n],t))},destroyAgent:g},h=Object.keys(m);return m;function y(n,t){void 0===t&&(t=!1);for(var e=[],r=2;r([\\d\\D]*?)<\\/script>[\\d\\D]*","i"),u=e.replace(o,"$1").trim());t=$()?i:void 0}catch(n){return}var u},On=function(n,t,e){var r;if(!(e<=0))try{localStorage.setItem(n,(r=JSON.stringify(y(y({},t),{expires:$()+e})),bn()?btoa(encodeURI(r)):r))}catch(n){}},jn=function(n){var t;if("object"==typeof window&&window.__perfsee__){var e={};return null!==(t=Error.captureStackTrace)&&void 0!==t&&t.call(Error,e,n),e.stack}};function In(){var t=new RegExp("\\/monitor_web\\/collect|\\/monitor_browser\\/collect\\/batch","i");return function(n){return t.test(n)}}function An(r){return function(){for(var n,t=[],e=0;e=400)){c.request.body=u?""+u:undefined;c.response.body=n.response?""+n.response:undefined}}catch(n){}return c}(n,c);setTimeout(function(){u&&(t.response.timing=u),Ln(t,p),i&&i({ev_type:Jn,payload:t}),a()},100)}}))};function Qn(n){return E(n)&&n?n.split("\r\n").reduce(function(n,t){var e;return E(t)&&(t=(e=C(t.split(": "),2))[0],e=e[1],Dn(t,e)||(n[t.toLowerCase()]=e)),n},{}):{}}function Zn(e){return Object.keys(e).reduce(function(n,t){return Dn(t,e[t])||(n[t.toLowerCase()]=e[t]),n},{})}var nt="ajax",tt={autoWrap:!0,setContextAtReq:function(){return x},ignoreUrls:[],collectBodyOnError:!1};var et=function(n,t,d){var e=C(t,2),t=e[0],r=e[1],o=d.setTraceHeader,p=d.ignoreUrls,v=d.setContextAtReq,h=d.extractUrl,g=window.Headers,m=window.Request;m&&g&&n.push(t[0](function(n){var i,n=C(n,2),u=n[0],a=n[1],t=on(u instanceof m?u.url:u);if(!function(n){if(!E(n))return false;var t=C(n.split(":"),2),e=t[0],r;return!t[1]||e==="http"||e==="https"}(t)||O(p,t))return b;o&&o(t,function(n,t){return function(n,t,e,r,o,i){var u;if(rt(e,o))e.headers.set(n,t);else if(r.headers instanceof i)r.headers.set(n,t);else r.headers=y(y({},r.headers),(u={},u[n]=t,u))}(n,t,u,a,m,g)});var c=v(),f=$(),s=void 0,l=r()[0](function(n){(t===n.name||i&&i===n.name)&&!s&&(s=n)});return function(n){i=n&&n.url;var t,e,r=function(r,o,n,i,t,e,u){var a={api:"fetch",request:{method:ot(r,o,i),timestamp:u,url:on(r instanceof i?r.url:r),headers:it(t,r.headers,o.headers)},response:{status:n&&n.status||0,is_custom_error:false,timestamp:$()},duration:$()-u},c=e.collectBodyOnError,f=e.extraExtractor,s=function(){var n;c&&(a.request.body=(n=ut(r,o,i))===null||n===void 0?void 0:n.toString())};if(n)try{var l=it(t,n.headers);a.response.headers=l;try{(l["content-type"]||"").indexOf("application/json")!==-1&&f&&n.clone().json().then(function(n){var t;var e=f(n,a,(t=ut(r,o,i))===null||t===void 0?void 0:t.toString());if(e){a.extra=e;a.response.is_custom_error=true;s()}}).catch(b)}catch(n){}n.status>=400&&s()}catch(n){}else s();return a}(u,a,n,m,g,d,f),o=(e=!(t=function(n){s&&(n.response.timing=s),Ln(n,h),c&&c({ev_type:Jn,payload:n}),l()}),function(n){e||(e=!0,t(n))});setTimeout(function(){o(r)},1e3)}}))},rt=function(n,t){return n instanceof t},ot=function(n,t,e){t=t&&t.method||"get";return(t=rt(n,e)?n.method||t:t).toLowerCase()},it=function(t){for(var n=[],e=1;et.frustrating_threshold?2:r>t.satisfying_threshold||0===e?0:1}function vt(o,i){return function(n,t){var e=n.payload;switch(n.ev_type){case"performance":var r=e.name;e.isSupport&&o(t[Ot],r,e.value);break;case"action":o(t[Ot],"action",e.duration||0);break;case Wn:i(t[St],0);break;case Jn:e.response.is_custom_error||400<=e.response.status?i(t[St],1):(r=e.response.timing)&&o(t[Rt],0,r.duration);break;case"resource_error":i(t[St],2);break;case"blank_screen":i(t[St],3);break;case"resource":o(t[Rt],1,e.duration);break;case"performance_longtask":e.longtasks.forEach(function(n){o(t[Rt],2,n.duration)})}}}function ht(){function n(){o=[0,0,0],i={error_count:[0,0,0,0],duration_count:[0,0,0],perf_apdex:{}}}var o,i;return n(),[function(n,t,e){var r=n&&n[t];!r||e<=0||(n=e<(r[0].threshold||0)?0:e>(r[1].threshold||0)?2:1,o[n]+=r[n].weight,"string"==typeof t?(r=i[Ot][e=t+"_"+n],i[Ot][e]=(r||0)+1):2==n&&(i.duration_count[t]+=1))},function(n,t){n&&(o[2]+=n[t],i.error_count[t]+=1)},function(){return[o,i]},n]}var gt=["name","message","stack","filename","lineno","colno"],mt="jsError",yt=["hidden_3",function(t,n){var e,r,o,i=Z(),u=Q();i&&u&&(r=mn(i,"visibilitychange",e=function(n){t("pagehide"===n.type||lt(i))},!0),o=gn(u,"pagehide",e,!0),n(function(){r(),o()},function(n){n(lt(i))}))}],_t=["unload_0",function(n,t){var e,r,o,i=Q();i&&(e=C(xn(n),1)[0],r=function(){e()},o=[],["unload","beforeunload","pagehide"].forEach(function(n){o.push(gn(i,n,r,!1))}),t(function(){o.forEach(function(n){return n()})}))}],bt=["hash_0",function(n,t){var e,r=Q();r&&(e=gn(r,"hashchange",function(){return n(location.href)},!0),t(function(){e()}))}],xt=["history_0",function(n,t){var e,r,o,i=Q()&&window.history,u=Q();i&&u&&(r=function(){return n(location.href)},(e=[]).push(h(i,"pushState",o=function(e){return function(){for(var n=[],t=0;tt[0];case"gte":return n>=t[0];case"lt":return n=a&&d.call(this),clearTimeout(s),s=setTimeout(d.bind(this),c)},flush:function(){clearTimeout(s),d.call(this)},getBatchData:function(){return f.length?v(f):""},clear:function(){clearTimeout(s),f=[]},fail:function(n){r=n},success:function(n){o=n}});function d(){var t;f.length&&(t=this.getBatchData(),i.post({url:u,data:t,fail:function(n){r&&r(n,t)},success:function(){o&&o(t)}}),f=[])}var p=l.send;return yn(function(){var t,n;e.transport.useBeacon?(t=Pt(),(n=l.getBatchData())&&(t.post(l.getEndpoint(),n),l.clear()),l.send=function(n){t.post(l.getEndpoint(),v([n]))},_n(function(){l.send=p})):l.flush()}),l}var Jt="https://"+(un((null===(Xe=rn())||void 0===Xe?void 0:Xe.getAttribute("src"))||"").domain||"sf16-short-sg.bytedapm.com")+"/slardar/fe/sdk-web/plugins",Xt="1.16.3",Kt="/monitor_web/settings/browser-settings",Vt="/monitor_browser/collect/batch/",Ft="SLARDAR",Yt=["/log/sentry/",Vt,Kt],$t="session",Qt=["blankScreen","action"],Zt={sample_rate:1,include_users:[],sample_granularity:$t,rules:{}},ne=20,te="";function ee(n,t,e){var r,o,i;void 0===e&&(e=ue),r=function(){n.on("init",function(){e(n,t)})},o=Q(),i=Z(),o&&i&&("complete"!==i.readyState?gn(o,"load",function(){setTimeout(function(){r()},0)},!1):r())}function re(o){return function(n,t){var e,r=o.config().pluginBundle;o.destroyAgent.has(n)&&o.destroyAgent.remove(n),void 0!==t&&o.set({plugins:y(y({},o.config().plugins),((e={})[n]=t,e))}),(r&&~r.plugins.indexOf(n)?oe:ie)([n],o)}}var oe=function(n,t,e,r){void 0===r&&(r=ae);var o=t.config(),i=o.plugins,o=o.pluginBundle,u=n.filter(function(n){return i[n]&&!t.destroyAgent.has(n)}),n=function(){return u.forEach(function(n){return ce(t,n,e)})};u.every(function(n){return se(n,e)})?n():r(t,{name:o.name},n)},ie=function(n,t,e,r){void 0===r&&(r=ae);var o=t.config().plugins;n.filter(function(n){return o[n]&&!t.destroyAgent.has(n)}).forEach(function(n){se(n,e)?ce(t,n,e):r(t,{name:n,config:o[n]},function(){return ce(t,n,e)})})};function ue(n,t,e){void 0===e&&(e=ae);var r=n.config().pluginBundle,r=r?r.plugins:[];oe(r,n,t,e),ie(Qt,n,t,e),n.provide("reloadPlugin",re(n))}function ae(n,t,e,r){var o=t.name,t=t.config;(r=void 0===r?wn:r)((n=n,o=o,null!==(t=null==(t=t)?void 0:t.path)&&void 0!==t?t:n.config().pluginPathPrefix+"/"+c(o)+"."+Xt+"."+te+"js"),function(){e()})}function ce(n,t,e){if(e=void 0===e?pn(Q()):e){e=fe(e,t);if(e)try{if(n.destroyAgent.has(t))return;e.apply(n)}catch(n){fn(n),j("[loader].applyPlugin failed",t,n)}else j("[loader].applyPlugin not found",t)}}function fe(n,t){return n.plugins.filter(function(n){return n.name===t&&n.version===Xt})[0]}function se(n,t){return!(!(t=void 0===t?pn(Q()):t)||!t.plugins)&&!!fe(t,n)}function le(n,t,e){(e=void 0===e?pn(Q()):e)&&e.plugins&&(fe(e,n)||e.plugins.push({name:n,version:Xt,apply:t}))}function de(n){var t,e;try{for(var r=function(n){var t="function"==typeof Symbol&&Symbol.iterator,e=t&&n[t],r=0;if(e)return e.call(n);if(n&&"number"==typeof n.length)return{next:function(){return{value:(n=n&&r>=n.length?void 0:n)&&n[r++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(["userId","deviceId","sessionId","env"]),o=r.next();!o.done;o=r.next()){var i=o.value;n[i]||delete n[i]}}catch(n){t={error:n}}finally{try{o&&!o.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}return n}function pe(n){var t,e=n.plugins||{};for(t in e)e[t]&&!w(e[t])&&(e[t]={});return de(y(y({},n),{plugins:e}))}function ve(n){return w(n)&&"bid"in n}function he(n){return de(y({},n))}function ge(r){var o=[];return r.observe=function(n){o.push(n)},r.push=function(){for(var n,t=[],e=0;e