module.exports = (function() { var __MODS__ = {}; var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; __DEFINE__(1704883497559, function(require, module, exports) { /** * ================================================================ * aegis-mp-sdk@1.36.7 (c) 2023 TencentCloud Real User Monitoring. * Author pumpkincai. * Last Release Time Tue Feb 21 2023 18:54:30 GMT+0800 (中国标准时间). * Released under the MIT License. * Thanks for supporting RUM & Aegis! * ================================================================ **/ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Aegis=t()}(this,function(){var j=function(e,t){return(j=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)};function e(e,t){function n(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var f=function(){return(f=Object.assign||function(e){for(var t,n=1,i=arguments.length;ns[0]&&t[1]=i||n.sendNow&&0n.maxCount||0===e||(n.count=n.count+1,(e=n.taskQueue.shift())&&n.sendRequest(e.options,null==e?void 0:e.success,null==e?void 0:e.fail))},this.complete=function(){1l){for(var t=e.split("\n"),n="",i=t.length-1;0<=i&&!(t[i]&&(n=t[i]+"\n"+n).length>l);i--);a.writeFile({filePath:s,data:n,success:r})}else a.appendFile({data:o,filePath:s,encoding:"utf8",success:r,fail:function(e){console.error(e)}})}})},Oe),pe=new o({name:"device",onNewAegis:function(t){return e=this,l=function(){return H(this,function(e){return this.setSystemInfo(t),this.refreshNetwork(t),this.setNetworkChange(t),[2]})},new(s=(s=a=void 0)||Promise)(function(n,t){function i(e){try{r(l.next(e))}catch(e){t(e)}}function o(e){try{r(l.throw(e))}catch(e){t(e)}}function r(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(i,o)}r((l=l.apply(e,a||[])).next())});var e,a,s,l},setSystemInfo:function(a){var s=this;try{l("getSystemInfo")&&w.getSystemInfo({success:function(e){var t=e.platform,n=e.model,i=e.windowHeight,o=e.windowWidth,r=e.screenWidth,r=void 0===r?0:r,e=e.screenHeight,e=void 0===e?0:e;a.extendBean("platform",s.getPlatFormType(t)),a.extendBean("model",n),a.extendBean("vp",Math.round(o)+" * "+Math.round(i)),a.extendBean("sr",Math.round(r)+" * "+Math.round(e))}})}catch(a){}},getPlatFormType:function(e){for(var t,n={android:/android/i,ios:/ios/i,windows:/windows/i,macos:/mac/i,devtools:/devtools/i},i=g.other,o=0;on))}))}),(p=this.lifeCycle.emit,d=this.config,function(e,t){var n,i=d.logCreated;return"function"==typeof i?(n=e.filter(function(e){return!1!==i(e)}),p("beforeWrite",n),t(n)):(p("beforeWrite",e),t(e))}),(f=this,setTimeout(function(){var e=f.config.pvUrl,n=void 0===e?"":e,e="undefined"!=typeof location?(null===location||void 0===location?void 0:location.pathname)+(null===location||void 0===location?void 0:location.hash):void 0;n&&e!==f.originFireUrl&&(f.sendPipeline([function(e,t){t({url:n,type:O.PV})}],O.PV)(null),e)&&location&&(f.originFireUrl=e)},100),function(e,t){t(e)}),(u=l=s=!1,c=[],(a=this).lifeCycle.on("onConfigChange",function(){r&&clearTimeout(r),r=setTimeout(function(){var e,n;!u&&a.config&&(u=!0,e=a.config.whiteListUrl,(n=void 0===e?"":e)&&a.sendPipeline([function(e,t){t({url:n,type:O.WHITE_LIST,success:function(e){l=!0;try{var t=e.data||JSON.parse(e),n=t.retcode,i=t.result,o=void 0===i?{}:i,r=(0===n&&(s=o.is_in_white_list,a.isWhiteList=s,0<=o.rate)&&o.rate<=1&&(a.config.random=o.rate,a.isGetSample=!1),a.isWhiteList&&c.length?se(a)(c.splice(0),function(){}):!a.isWhiteList&&c.length&&(c.length=0),a.config.onWhitelist);"function"==typeof r&&r(s)}catch(e){}},fail:function(){l=!0}})}],O.WHITE_LIST)(null),u=!1)},a.config.uin?50:500)}),a.lifeCycle.on("destroy",function(){c.length=0}),function(e,t){var n;s||null!=(n=null==(n=a.config)?void 0:n.api)&&n.reportRequest?t(e.concat(c.splice(0)).map(function(e){return re(e),e})):(n=e.filter(function(e){return e.level!==b.INFO&&e.level!==b.API_RESPONSE?(re(e),!0):(l||(c.push(e),200<=c.length&&(c.length=200)),!1)})).length&&t(n)}),function(e,t){try{var n=JSON.parse(JSON.stringify(e)),i=(m.lifeCycle.emit("beforeReport",n),m.config.beforeReport);(e="function"==typeof i?e.filter(function(e){return!1!==i(e)}):e).length&&t(e)}catch(e){}},se(this)]),this.eventPipeline=v([y(this,10),(o=this,function(e){o.sendPipeline([function(e,t){var n=e.map(function(e){return{name:e.name,ext1:e.ext1||o.config.ext1||"",ext2:e.ext2||o.config.ext2||"",ext3:e.ext3||o.config.ext3||""}});t({url:o.config.eventUrl+"?payload="+encodeURIComponent(JSON.stringify(n)),type:O.EVENT,log:e})}],O.EVENT)(e)})]),this.timeMap={},this.failRequestCount=0,this.customTimePipeline=v([y(this,10),(i=this,function(e){return i.sendPipeline([function(e,t){t({url:i.config.customTimeUrl+"?payload="+encodeURIComponent(JSON.stringify({custom:e})),type:O.CUSTOM,log:e})}],O.CUSTOM)(e)})]),this.config=(t=this.config,void 0===(e=e.hostUrl)&&(e="https://aegis.qq.com"),t.url=t.url||e+"/collect",t.offlineUrl=t.offlineUrl||e+"/offline",t.whiteListUrl=t.whiteListUrl||e+"/collect/whitelist",t.pvUrl=t.pvUrl||e+"/collect/pv",t.eventUrl=t.eventUrl||e+"/collect/events",t.speedUrl=t.speedUrl||e+"/speed",t.customTimeUrl=t.customTimeUrl||e+"/speed/custom",t.performanceUrl=t.performanceUrl||e+"/speed/performance",t.webVitalsUrl=t.webVitalsUrl||e+"/speed/webvitals",t.setDataReportUrl=t.SetDataReportUrl||e+"/speed/miniProgramData",t),A.instances.push(this)}function Ee(){return null!==Y&&Y.apply(this,arguments)||this}e(Ee,Y=r),Ee.prototype.defineApiProperty=function(){var e=this;Object.defineProperty(ve,"request",{get:function(){return e.hackHandler.bind(e)}})};function q(i,e,o){return null!=e&&e.length&&"object"==typeof i?e.reduce(function(e,t){var n=i[t];return n?e+(""===e?"\n":"\n\n")+o+" header "+t+": "+n:e},""):""}var U,Re,we=new o({name:"reportApiSpeed",override:!(Ee.prototype.hackHandler=function(e){var t=this,n=this.prefixHandler(e);return be(f(f({},n),{success:function(e){t.successHandler(e,n)},fail:function(e){t.failHandler(e,n)},complete:function(e){t.completeHandler(e,n)}}))}),onNewAegis:function(e){this.override||(this.override=!0,this.hackRequest(e.config),this.overrideCallFunction(e.config),this.overrideCallContainer(e.config))},hackRequest:function(u){var c=this;$({apiName:"request",success:function(e,t){var n,i,o,r,a,s,l;u.hostUrl&&-1