aegis-web-sdk.js 98 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613
  1. import {
  2. __commonJS
  3. } from "./chunk-Y2F7D3TJ.js";
  4. // E:/Project/2023/问诊平台/his_user_app/node_modules/aegis-web-sdk/lib/aegis.min.js
  5. var require_aegis_min = __commonJS({
  6. "E:/Project/2023/问诊平台/his_user_app/node_modules/aegis-web-sdk/lib/aegis.min.js"(exports, module) {
  7. !function(e, t) {
  8. "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();
  9. }(exports, function() {
  10. "use strict";
  11. var _, j;
  12. function H(e2) {
  13. this.name = "__st" + (1e9 * Math.random() >>> 0) + _ + "__", null != e2 && e2.forEach(this.add, this), _ += 1;
  14. }
  15. Array.prototype.find || Object.defineProperty(Array.prototype, "find", { configurable: true, writable: true, value: function(e2) {
  16. if (null === this)
  17. throw new TypeError('"this" is null or not defined');
  18. var t2 = Object(this), n2 = t2.length >>> 0;
  19. if ("function" != typeof e2)
  20. throw new TypeError("predicate must be a function");
  21. for (var o2 = arguments[1], i2 = 0; i2 < n2; ) {
  22. var r2 = t2[i2];
  23. if (e2.call(o2, r2, i2, t2))
  24. return r2;
  25. i2 += 1;
  26. }
  27. } }), window.WeakSet || (_ = Date.now() % 1e9, H.prototype.add = function(e2) {
  28. var t2 = this.name;
  29. return e2[t2] || Object.defineProperty(e2, t2, { value: true, writable: true }), this;
  30. }, H.prototype.delete = function(e2) {
  31. return !!e2[this.name] && !(e2[this.name] = void 0);
  32. }, H.prototype.has = function(e2) {
  33. return !!e2[this.name];
  34. }, j = H, Object.defineProperty(window, "WeakSet", { value: function(e2) {
  35. return new j(e2);
  36. } })), Object.assign || Object.defineProperty(Object, "assign", { enumerable: false, configurable: true, writable: true, value: function(e2) {
  37. if (null == e2)
  38. throw new TypeError("Cannot convert first argument to object");
  39. for (var t2 = Object(e2), n2 = 1; n2 < arguments.length; n2++)
  40. if (null != (o2 = arguments[n2]))
  41. for (var o2 = Object(o2), i2 = Object.keys(Object(o2)), r2 = 0, a2 = i2.length; r2 < a2; r2++) {
  42. var s2 = i2[r2], c2 = Object.getOwnPropertyDescriptor(o2, s2);
  43. null != c2 && c2.enumerable && (t2[s2] = o2[s2]);
  44. }
  45. return t2;
  46. } });
  47. var B = function(e2, t2) {
  48. return (B = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array ? function(e3, t3) {
  49. e3.__proto__ = t3;
  50. } : function(e3, t3) {
  51. for (var n2 in t3)
  52. Object.prototype.hasOwnProperty.call(t3, n2) && (e3[n2] = t3[n2]);
  53. }))(e2, t2);
  54. }, E = function() {
  55. return (E = Object.assign || function(e2) {
  56. for (var t2, n2 = 1, o2 = arguments.length; n2 < o2; n2++)
  57. for (var i2 in t2 = arguments[n2])
  58. Object.prototype.hasOwnProperty.call(t2, i2) && (e2[i2] = t2[i2]);
  59. return e2;
  60. }).apply(this, arguments);
  61. };
  62. function u() {
  63. for (var e2 = 0, t2 = 0, n2 = arguments.length; t2 < n2; t2++)
  64. e2 += arguments[t2].length;
  65. for (var o2 = Array(e2), i2 = 0, t2 = 0; t2 < n2; t2++)
  66. for (var r2 = arguments[t2], a2 = 0, s2 = r2.length; a2 < s2; a2++, i2++)
  67. o2[i2] = r2[a2];
  68. return o2;
  69. }
  70. function D(t2) {
  71. try {
  72. return encodeURIComponent(decodeURIComponent(t2));
  73. } catch (e2) {
  74. return t2;
  75. }
  76. }
  77. var n, F = /_?t(\d)?(imestamp)?=\d+&?/g, M = ["aegis.qq.com", "tamaegis.com", "/aegis-sdk", "rumt-", "/flog.core.min.js", "pingfore.qq.com", "pingfore.tencent.com", "zhiyan.tencent-cloud.net", "h.trace.qq.com", "btrace.qq.com", "beacon.qq.com", "dmplog.qq.com", "qq.com/report", "svibeacon.onezapp.com", "cube.weixinbridge.com", "doubleclick.net", "pcmgrmonitor.3g.qq.com", "report.qqweb.qq.com", "tpstelemetry.tencent.com", "insight.cloud.tencent.com", "facebook.com", "facebook.net", "google", "yahoo.com", "twitter.com", "ga-audiences", "report.idqqimg.com", "arms-retcode.aliyuncs.com", "px.effirst.com", "sentry", "hot-update.json", "u.c.b.r.o.w.s.e.r", "report.url.cn", "sockjs-node", "m3u8"], W = ["ResizeObserver loop limit exceeded", "Failed to execute 'transaction'", "window.indexedDB.deleteDatabase is not a function"], V = ["ext1", "ext2", "ext3", "level", "trace", "tag", "seq", "code"], X = ["static", "fetch"], G = (e.prototype.indexOf = function(e2, t2) {
  78. for (var n2 = 0; n2 < e2.length; n2++)
  79. if (e2[n2].callback === t2)
  80. return n2;
  81. return -1;
  82. }, e.prototype.on = function(e2, t2, n2) {
  83. var o2;
  84. if (void 0 === n2 && (n2 = 0), this)
  85. return (o2 = this.eventsList[e2]) || (this.eventsList[e2] = [], o2 = this.eventsList[e2]), -1 === this.indexOf(o2, t2) && o2.push({ name: e2, type: n2 || 0, callback: t2 }), this;
  86. }, e.prototype.one = function(e2, t2) {
  87. this.on(e2, t2, 1);
  88. }, e.prototype.remove = function(e2, t2) {
  89. if (this) {
  90. var n2 = this.eventsList[e2];
  91. if (n2) {
  92. if (t2)
  93. return n2.length && (t2 = this.indexOf(n2, t2), n2.splice(t2, 1)), this;
  94. try {
  95. delete this.eventsList[e2];
  96. } catch (e3) {
  97. }
  98. }
  99. return null;
  100. }
  101. }, e.prototype.clear = function() {
  102. this.eventsList = {};
  103. }, e), J = function(e2) {
  104. if (!e2 || 0 === e2.length)
  105. return "{}";
  106. e2 = Array.isArray(e2) ? e2 : [e2];
  107. var t2 = Object.keys(e2[0]), n2 = {};
  108. return t2.forEach(function(t3) {
  109. n2[t3] = e2.map(function(e3) {
  110. return e3[t3];
  111. });
  112. }), n2.count = e2.length, fe(n2);
  113. };
  114. function e() {
  115. var a2 = this;
  116. this.emit = function(e2, t2) {
  117. if (a2) {
  118. var n2;
  119. if (null != (o2 = a2.eventsList[e2]) && o2.length)
  120. for (var o2 = o2.slice(), i2 = 0; i2 < o2.length; i2++) {
  121. n2 = o2[i2];
  122. try {
  123. var r2 = n2.callback.apply(a2, [t2]);
  124. if (1 === n2.type && a2.remove(e2, n2.callback), false === r2)
  125. break;
  126. } catch (e3) {
  127. throw e3;
  128. }
  129. }
  130. return a2;
  131. }
  132. }, this.eventsList = {};
  133. }
  134. (o = n = n || {})[o.number = -1] = "number", o.string = "";
  135. function $(e2, t2) {
  136. return "number" == typeof e2 || "string" == typeof e2 ? e2 : t2 ? n.string : n.number;
  137. }
  138. function P(e2, t2) {
  139. return "string" == typeof e2 ? e2.split("?")[t2 ? 1 : 0] || "" : e2;
  140. }
  141. function K(e2, t2) {
  142. return void 0 === t2 && (t2 = 2048), String(e2).replace(F, "").slice(0, t2);
  143. }
  144. function Q(e2) {
  145. return "string" == typeof e2 && /^\//.test(e2) ? "https:" === (null === location || void 0 === location ? void 0 : location.protocol) : /^https/.test(e2);
  146. }
  147. function Y(e2, t2, n2) {
  148. var o2, i2;
  149. try {
  150. if ("function" == typeof (null == t2 ? void 0 : t2.retCodeHandler))
  151. return { code: void 0 === (r2 = (i2 = t2.retCodeHandler(e2, null == n2 ? void 0 : n2.url, null == n2 ? void 0 : n2.ctx, null == n2 ? void 0 : n2.payload) || {}).code) ? "unknown" : r2, isErr: i2.isErr };
  152. if (!(e2 = "string" == typeof e2 ? JSON.parse(e2) : e2))
  153. return { code: "unknown", isErr: false };
  154. "function" == typeof (null == (o2 = null == t2 ? void 0 : t2.ret) ? void 0 : o2.join) && (ue = [].concat(t2.ret.map(function(e3) {
  155. return e3.toLowerCase();
  156. })));
  157. var r2, a2 = Object.getOwnPropertyNames(e2).filter(function(e3) {
  158. return -1 !== ue.indexOf(e3.toLowerCase());
  159. });
  160. return a2.length ? { code: "" + (r2 = "未知" !== (r2 = e2[a2[0]]) && "" !== r2 ? r2 : "unknown"), isErr: 0 !== r2 && "0" !== r2 && "unknown" !== r2 } : { code: "unknown", isErr: false };
  161. } catch (e3) {
  162. return { code: "unknown", isErr: false };
  163. }
  164. }
  165. function x(e2, t2, n2) {
  166. try {
  167. var o2 = "function" == typeof t2 ? t2(e2, null == n2 ? void 0 : n2.url) || "" : e2;
  168. return de(o2).slice(0, 102400);
  169. } catch (e3) {
  170. return "";
  171. }
  172. }
  173. function z() {
  174. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e2) {
  175. var t2 = 16 * Math.random() | 0;
  176. return ("x" === e2 ? t2 : 3 & t2 | 8).toString(16);
  177. });
  178. }
  179. function l(t2, e2) {
  180. return "string" != typeof t2 || !t2 || e2 && -1 < t2.indexOf(e2) || ge.test(t2) || M.some(function(e3) {
  181. return -1 < t2.indexOf(e3);
  182. });
  183. }
  184. function Z(n2, o2) {
  185. var i2, r2 = [], a2 = n2.config;
  186. return n2.lifeCycle.on("destroy", function() {
  187. r2.length = 0;
  188. }), function(e2, t2) {
  189. Array.isArray(e2) ? r2 = r2.concat(e2) : r2.push(e2), o2 && r2.length >= o2 || n2.sendNow && 0 < r2.length ? (r2 = me(r2), t2(r2.splice(0, r2.length)), i2 && clearTimeout(i2)) : (i2 && clearTimeout(i2), i2 = setTimeout(function() {
  190. i2 = null, 0 < (r2 = me(r2)).length && t2(r2.splice(0, r2.length));
  191. }, a2.delay));
  192. };
  193. }
  194. function ee(e2, t2) {
  195. return Array.isArray(e2) ? t2(e2.map(function(e3) {
  196. return t3 = E(E({}, e3), { msg: "string" == typeof e3.msg ? e3.msg : [].concat(e3.msg).map(O).join(" ") }), V.forEach(function(e4) {
  197. t3[e4] || delete t3[e4];
  198. }), t3;
  199. var t3;
  200. })) : t2([E(E({}, e2), { msg: "string" == typeof e2.msg ? e2.msg : O(e2.msg) })]);
  201. }
  202. function te(c2, u2) {
  203. return function(e2, t2) {
  204. var n2, o2, i2, r2 = Array.isArray(e2), a2 = r2 ? e2 : [e2], s2 = (c2.lifeCycle.emit("beforeRequest", e2), c2.config.beforeRequest);
  205. (a2 = "function" == typeof s2 ? a2.map(function(t3) {
  206. try {
  207. var e3 = s2({ logs: t3, logType: u2 });
  208. return (null == e3 ? void 0 : e3.logType) === u2 && null != e3 && e3.logs ? e3.logs : false !== e3 && t3;
  209. } catch (e4) {
  210. return t3;
  211. }
  212. }).filter(function(e3) {
  213. return false !== e3;
  214. }) : a2).length && (n2 = a2, e2 = V, !Array.isArray(n2) || n2.length <= 1 || (o2 = [], i2 = [], !(i2 = "string" == typeof e2 ? [e2] : e2)) || i2.length <= 0 || (i2.forEach(function(t3) {
  215. n2.forEach(function(e3) {
  216. null != e3 && e3[t3] && o2.push(t3);
  217. });
  218. }), 0 < o2.length && (n2 = n2.map(function(e3) {
  219. var t3 = {};
  220. return o2.forEach(function(e4) {
  221. t3[e4] = "";
  222. }), E(E({}, t3), e3);
  223. }))), a2 = n2, t2(r2 ? a2 : a2[0]));
  224. };
  225. }
  226. function ne(i2) {
  227. return function(e2, t2) {
  228. i2.lifeCycle.emit("modifyRequest", e2);
  229. var n2 = i2.config.modifyRequest;
  230. if ("function" == typeof n2)
  231. try {
  232. var o2 = n2(e2);
  233. "object" == typeof o2 && "url" in o2 && (e2 = o2);
  234. } catch (e3) {
  235. console.error(e3);
  236. }
  237. t2(e2);
  238. };
  239. }
  240. function oe(o2) {
  241. return function(e2, t2) {
  242. null != (n2 = o2.lifeCycle) && n2.emit("afterRequest", e2);
  243. var n2 = (o2.config || {}).afterRequest;
  244. "function" == typeof n2 && false === n2(e2) || t2(e2);
  245. };
  246. }
  247. function m(n2) {
  248. if (n2 && n2.reduce && n2.length)
  249. return 1 === n2.length ? function(e2, t2) {
  250. n2[0](e2, t2 || Ee);
  251. } : n2.reduce(function(n3, o2) {
  252. return function(e2, t2) {
  253. return void 0 === t2 && (t2 = Ee), n3(e2, function(e3) {
  254. return null == o2 ? void 0 : o2(e3, t2);
  255. });
  256. };
  257. });
  258. throw new TypeError("createPipeline need at least one function param");
  259. }
  260. function ie(t2, n2) {
  261. Object.getOwnPropertyNames(t2).forEach(function(e2) {
  262. "function" == typeof t2[e2] && "constructor" !== e2 && (n2 ? n2[e2] = "sendPipeline" === e2 ? function() {
  263. return function() {
  264. };
  265. } : function() {
  266. } : t2[e2] = function() {
  267. });
  268. });
  269. }
  270. function re() {
  271. return void 0 !== window.performance && "function" == typeof performance.clearResourceTimings && "function" == typeof performance.getEntriesByType && "function" == typeof performance.now;
  272. }
  273. function ae(t2, n2) {
  274. function o2(e2) {
  275. "pagehide" !== e2.type && "hidden" !== document.visibilityState || (t2(e2), n2 && (removeEventListener("visibilitychange", o2, true), removeEventListener("pagehide", o2, true)));
  276. }
  277. addEventListener("visibilitychange", o2, true), addEventListener("pagehide", o2, true);
  278. }
  279. function t(e2) {
  280. return -1 !== Pe.indexOf(e2);
  281. }
  282. var L, R, f, se = ["application/xhtml+xml", "application/xml", "application/pdf", "application/pkcs12", "application/javascript", "application/x-javascript", "application/ecmascript", "application/vnd.mspowerpoint", "application/vnd.apple.mpegurl", "application/ogg", "text/css", "text/javascript", "image", "audio", "video", "video/mp2t"], ce = /\.(json|js|css|jpg|jpeg|png|svg|apng|webp|gif|bmp|mp4|mp3|ts|mpeg|wav|webm|ogg|flv|m3u8|ttf|woff2|otf|eot|woff|html|htm|shtml|shtm|)$/gi, ue = ["ret", "retcode", "code", "errcode"], le = function() {
  283. var n2 = /* @__PURE__ */ new WeakSet();
  284. return function(e2, t2) {
  285. if (t2 instanceof Error)
  286. return "Error.message: " + t2.message + " \n Error.stack: " + t2.stack;
  287. if ("object" == typeof t2 && null !== t2) {
  288. if (n2.has(t2))
  289. return "[Circular " + (e2 || "root") + "]";
  290. n2.add(t2);
  291. }
  292. return t2;
  293. };
  294. }, O = function(e2) {
  295. if ("string" == typeof e2)
  296. return e2;
  297. try {
  298. return e2 instanceof Error ? (JSON.stringify(e2, le(), 4) || "undefined").replace(/"/gim, "") : JSON.stringify(e2, le(), 4) || "undefined";
  299. } catch (e3) {
  300. return "error happen when aegis stringify: \n " + e3.message + " \n " + e3.stack;
  301. }
  302. }, fe = function(e2) {
  303. if ("string" == typeof e2)
  304. return e2;
  305. try {
  306. return JSON.stringify(e2, le()) || "undefined";
  307. } catch (e3) {
  308. return "error happen when aegis stringify: \n " + e3.message + " \n " + e3.stack;
  309. }
  310. }, de = function(n2, o2) {
  311. void 0 === o2 && (o2 = 3);
  312. var i2, r2, a2, s2 = "";
  313. return Array.isArray(n2) ? (s2 += "[", i2 = n2.length, n2.forEach(function(e2, t2) {
  314. s2 = (s2 += "object" == typeof e2 && 1 < o2 ? de(e2, o2 - 1) : he(e2)) + (t2 === i2 - 1 ? "" : ",");
  315. }), s2 += "]") : n2 instanceof Object ? (s2 = "{", r2 = Object.keys(n2), a2 = r2.length, r2.forEach(function(e2, t2) {
  316. "object" == typeof n2[e2] && 1 < o2 ? s2 += '"' + e2 + '":' + de(n2[e2], o2 - 1) : s2 += pe(e2, n2[e2]), s2 += t2 === a2 - 1 || t2 < a2 - 1 && void 0 === n2[r2[t2 + 1]] ? "" : ",";
  317. }), s2 += "}") : s2 += n2, s2;
  318. }, pe = function(e2, t2) {
  319. var n2 = typeof t2, o2 = "";
  320. return "string" == n2 || "object" == n2 ? o2 += '"' + e2 + '":"' + t2 + '"' : "function" == typeof t2 ? o2 += '"' + e2 + '":"function ' + t2.name + '"' : "symbol" == typeof t2 ? o2 += '"' + e2 + '":"symbol"' : "number" != typeof t2 && "boolean" != n2 || (o2 += '"' + e2 + '": ' + t2), o2;
  321. }, he = function(e2) {
  322. var t2 = typeof e2;
  323. return "" + ("undefined" == t2 || "symbol" == t2 || "function" == t2 ? "null" : "string" == t2 || "object" == t2 ? '"' + e2 + '"' : e2);
  324. }, ge = /data:(image|text|application|font)\/.*;base64/, me = ((o = L = L || {}).INFO_ALL = "-1", o.API_RESPONSE = "1", o.INFO = "2", o.ERROR = "4", o.PROMISE_ERROR = "8", o.AJAX_ERROR = "16", o.SCRIPT_ERROR = "32", o.IMAGE_ERROR = "64", o.CSS_ERROR = "128", o.CONSOLE_ERROR = "256", o.MEDIA_ERROR = "512", o.RET_ERROR = "1024", o.REPORT = "2048", o.PV = "4096", o.EVENT = "8192", o.PAGE_NOT_FOUND_ERROR = "16384", o.WEBSOCKET_ERROR = "32768", o.BRIDGE_ERROR = "65536", o.LAZY_LOAD_ERROR = "131072", (o = R = R || {}).LOG = "log", o.SPEED = "speed", o.PERFORMANCE = "performance", o.OFFLINE = "offline", o.WHITE_LIST = "whiteList", o.VITALS = "vitals", o.PV = "pv", o.CUSTOM_PV = "customPV", o.EVENT = "event", o.CUSTOM = "custom", o.SDK_ERROR = "sdkError", o.SET_DATA = "setData", o.LOAD_PACKAGE = "loadPackage", (o = f = f || {}).production = "production", o.development = "development", o.gray = "gray", o.pre = "pre", o.daily = "daily", o.local = "local", o.test = "test", o.others = "others", function(e2) {
  325. return e2.filter(function(n2, o2) {
  326. return "static" !== n2.type || !e2.find(function(e3, t2) {
  327. return n2.url === e3.url && 200 === n2.status && o2 < t2;
  328. });
  329. });
  330. }), ve = function(e2) {
  331. e2.level === L.INFO_ALL && (e2.level = L.INFO);
  332. }, v = {}, y = {}, ye = function(e2) {
  333. return v[e2] || (v[e2] = setTimeout(function() {
  334. y[e2] = {}, v[e2] = null;
  335. }, 6e4)), v[e2];
  336. }, we = function(e2) {
  337. return (Array.isArray(e2) ? e2 : [e2]).map(function(n2) {
  338. return Object.getOwnPropertyNames(n2).reduce(function(e3, t2) {
  339. return "ctx" !== t2 && (e3[t2] = n2[t2]), e3;
  340. }, { level: L.INFO, msg: "" });
  341. });
  342. }, be = function(o2) {
  343. return function(e2) {
  344. return o2.sendPipeline([function(e3, n2) {
  345. return n2({ url: o2.config.url || "", data: J(we(e3)), method: "post", contentType: "application/json", type: R.LOG, log: e3, requestConfig: { timeout: 5e3 }, success: function() {
  346. var t2 = o2.config.onReport;
  347. "function" == typeof t2 && e3.forEach(function(e4) {
  348. t2(e4);
  349. }), "function" == typeof n2 && n2([]);
  350. } });
  351. }], R.LOG)(e2);
  352. };
  353. }, Ee = function() {
  354. }, o = (Object.defineProperty(w.prototype, "__version__", { get: function() {
  355. return console.warn("__version__ has discard, please use version"), "1.37.5";
  356. }, enumerable: false, configurable: true }), Object.defineProperty(w.prototype, "LogType", { get: function() {
  357. return console.warn("LogType has discard, please use logType"), L;
  358. }, enumerable: false, configurable: true }), w.prototype.init = function(e2) {
  359. this.setConfig(e2);
  360. for (var t2 = 0; t2 < w.installedPlugins.length; t2++)
  361. try {
  362. w.installedPlugins[t2].patch(this);
  363. } catch (e3) {
  364. this.sendSDKError(e3);
  365. }
  366. this.lifeCycle.emit("onInited");
  367. }, w.prototype.setConfig = function(e2) {
  368. Object.assign(this.config, e2);
  369. var e2 = this.config, t2 = e2.id, n2 = e2.uin, o2 = e2.version, i2 = e2.ext1, r2 = e2.ext2, a2 = e2.ext3, s2 = e2.aid, c2 = e2.env, u2 = void 0 === c2 ? "production" : c2, c2 = e2.pageUrl, e2 = this.bean.id !== t2 || this.bean.uin !== n2 || this.bean.aid !== s2;
  370. return this.bean.id = t2 || "", this.bean.uin = n2 || "", this.bean.version = o2 || "1.37.5", this.bean.aid = s2 || "", this.bean.env = function() {
  371. switch (u2) {
  372. case f.production:
  373. case f.development:
  374. case f.gray:
  375. case f.pre:
  376. case f.daily:
  377. case f.local:
  378. case f.test:
  379. case f.others:
  380. return 1;
  381. default:
  382. return;
  383. }
  384. }() ? u2 : f.others, c2 && this.extendBean("from", encodeURIComponent(c2.slice(0, 2048))), i2 && this.extendBean("ext1", encodeURIComponent(i2)), r2 && this.extendBean("ext2", encodeURIComponent(r2)), a2 && this.extendBean("ext3", encodeURIComponent(a2)), e2 && this.lifeCycle.emit("onConfigChange", this.config), this.config;
  385. }, w.use = function(e2) {
  386. -1 === w.installedPlugins.indexOf(e2) && e2.aegisPlugin && w.installedPlugins.push(e2);
  387. }, w.unuse = function(e2) {
  388. e2 = w.installedPlugins.indexOf(e2);
  389. -1 !== e2 && w.installedPlugins.splice(e2, 1);
  390. }, w.prototype.info = function() {
  391. for (var e2 = [], t2 = 0; t2 < arguments.length; t2++)
  392. e2[t2] = arguments[t2];
  393. var n2 = { level: L.INFO, msg: e2 };
  394. 1 === e2.length && e2[0].msg && Object.assign(n2, E({}, e2[0]), { level: L.INFO }), this.normalLogPipeline(n2);
  395. }, w.prototype.infoAll = function() {
  396. for (var e2 = [], t2 = 0; t2 < arguments.length; t2++)
  397. e2[t2] = arguments[t2];
  398. var n2 = { level: L.INFO_ALL, msg: e2 };
  399. 1 === e2.length && e2[0].msg && Object.assign(n2, E({}, e2[0]), { level: L.INFO_ALL }), this.normalLogPipeline(n2);
  400. }, w.prototype.report = function() {
  401. for (var e2 = [], t2 = 0; t2 < arguments.length; t2++)
  402. e2[t2] = arguments[t2];
  403. var n2 = { level: L.REPORT, msg: e2 };
  404. 1 === e2.length && e2[0].msg && Object.assign(n2, E({}, e2[0])), this.normalLogPipeline(n2);
  405. }, w.prototype.error = function() {
  406. for (var e2 = [], t2 = 0; t2 < arguments.length; t2++)
  407. e2[t2] = arguments[t2];
  408. var n2 = { level: L.ERROR, msg: e2 };
  409. 1 === e2.length && e2[0].msg && Object.assign(n2, E({}, e2[0]), { level: L.ERROR }), this.normalLogPipeline(n2);
  410. }, w.prototype.speedLogPipeline = function(e2) {
  411. throw new Error('You need to override "speedLogPipeline" method');
  412. }, w.prototype.reportPv = function(n2) {
  413. var o2, i2 = this;
  414. n2 && (console.warn("reportPv is deprecated, please use reportEvent"), o2 = "" + Object.getOwnPropertyNames(this.bean).filter(function(e2) {
  415. return "id" !== e2;
  416. }).map(function(e2) {
  417. return e2 + "=" + i2.bean[e2];
  418. }).join("&"), this.sendPipeline([function(e2, t2) {
  419. t2({ url: i2.config.url + "/" + n2 + "?" + o2, addBean: false, type: R.CUSTOM_PV });
  420. }], R.CUSTOM_PV)(null));
  421. }, w.prototype.reportEvent = function(e2) {
  422. e2 && ((e2 = "string" == typeof e2 ? { name: e2, ext1: this.config.ext1 || "", ext2: this.config.ext2 || "", ext3: this.config.ext3 || "" } : e2).name ? ("string" != typeof e2.name && (console.warn("reportEvent params name must be string"), e2.name = String(e2.name)), this.eventPipeline(e2)) : console.warn("reportEvent params error"));
  423. }, w.prototype.reportTime = function(e2, t2) {
  424. if ("object" == typeof e2)
  425. return this.reportT(e2);
  426. "string" == typeof e2 ? "number" == typeof t2 ? t2 < 0 || 6e4 < t2 ? console.warn("reportTime: duration must between 0 and 60000") : this.submitCustomTime(e2, t2) : console.warn("reportTime: second param must be number") : console.warn("reportTime: first param must be a string");
  427. }, w.prototype.reportT = function(e2) {
  428. var t2 = e2.name, n2 = e2.duration, o2 = e2.ext1, o2 = void 0 === o2 ? "" : o2, i2 = e2.ext2, i2 = void 0 === i2 ? "" : i2, r2 = e2.ext3, r2 = void 0 === r2 ? "" : r2, e2 = e2.from;
  429. if ("string" == typeof t2 && "number" == typeof n2 && "string" == typeof o2 && "string" == typeof i2 && "string" == typeof r2) {
  430. if (!(n2 < 0 || 6e4 < n2))
  431. return this.submitCustomTime(t2, n2, o2, i2, r2, void 0 === e2 ? "" : e2);
  432. console.warn("reportTime: duration must between 0 and 60000");
  433. } else
  434. console.warn("reportTime: params error");
  435. }, w.prototype.time = function(e2) {
  436. "string" == typeof e2 ? this.timeMap[e2] ? console.warn("Timer " + e2 + " already exists") : this.timeMap[e2] = Date.now() : console.warn("time: first param must be a string");
  437. }, w.prototype.timeEnd = function(e2) {
  438. "string" == typeof e2 ? this.timeMap[e2] ? (this.submitCustomTime(e2, Date.now() - this.timeMap[e2]), delete this.timeMap[e2]) : console.warn("Timer " + e2 + " does not exist") : console.warn("timeEnd: first param must be a string");
  439. }, w.prototype.submitCustomTime = function(e2, t2, n2, o2, i2, r2) {
  440. this.customTimePipeline({ name: e2, duration: t2, ext1: n2 || this.config.ext1, ext2: o2 || this.config.ext2, ext3: i2 || this.config.ext3, from: r2 || void 0 });
  441. }, w.prototype.extendBean = function(e2, t2) {
  442. this.bean[e2] = t2;
  443. }, w.prototype.sendPipeline = function(e2, t2) {
  444. var n2, r2 = this;
  445. return m(u([function(e3, t3) {
  446. if ("number" != typeof n2.config.random && (console.warn("random must in [0, 1], default is 1."), n2.config.random = 1), !n2.isHidden || !n2.isGetSample)
  447. if (n2.isGetSample)
  448. n2.isHidden || t3(e3);
  449. else {
  450. if (n2.isGetSample = true, Math.random() < n2.config.random)
  451. return n2.isHidden = false, t3(e3);
  452. n2.isHidden = true;
  453. }
  454. }, te(n2 = this, t2)], e2, [ne(this), function(o2, i2) {
  455. r2.request(o2, function() {
  456. for (var e3, t3 = [], n3 = 0; n3 < arguments.length; n3++)
  457. t3[n3] = arguments[n3];
  458. r2.failRequestCount = 0, i2({ isErr: false, result: t3, logType: null == o2 ? void 0 : o2.type, logs: null == o2 ? void 0 : o2.log }), null != (e3 = null == o2 ? void 0 : o2.success) && e3.call.apply(e3, u([o2], t3));
  459. }, function() {
  460. for (var e3, t3 = [], n3 = 0; n3 < arguments.length; n3++)
  461. t3[n3] = arguments[n3];
  462. 60 <= ++r2.failRequestCount && r2.destroy(), -1 < ("" + t3[0]).indexOf("403 forbidden") && r2.destroy(), i2({ isErr: true, result: t3, logType: null == o2 ? void 0 : o2.type, logs: null == o2 ? void 0 : o2.log }), null != (e3 = null == o2 ? void 0 : o2.fail) && e3.call.apply(e3, u([o2], t3));
  463. });
  464. }, oe(this)]));
  465. }, w.prototype.send = function(e2, i2, r2) {
  466. var t2 = this;
  467. return m([ne(this), function(n2, o2) {
  468. t2.request(n2, function() {
  469. for (var e3 = [], t3 = 0; t3 < arguments.length; t3++)
  470. e3[t3] = arguments[t3];
  471. o2({ isErr: false, result: e3, logType: n2.type, logs: n2.log }), null != i2 && i2.apply(void 0, e3);
  472. }, function() {
  473. for (var e3 = [], t3 = 0; t3 < arguments.length; t3++)
  474. e3[t3] = arguments[t3];
  475. o2({ isErr: true, result: e3, logType: n2.type, logs: n2.log }), null != r2 && r2.apply(void 0, e3);
  476. });
  477. }, oe(this)])(e2);
  478. }, w.prototype.ready = function(e2, t2, n2) {
  479. throw new Error('You need to override "ready" method');
  480. }, w.prototype.request = function(e2, t2, n2) {
  481. throw new Error('You need to override "request" method');
  482. }, w.prototype.sendSDKError = function(e2) {
  483. var n2 = this;
  484. this.sendPipeline([function(e3, t2) {
  485. t2({ url: n2.config.url + "?id=1085&msg[0]=" + encodeURIComponent(O(e3)) + "&level[0]=2&from=" + n2.config.id + "&count=1&version=" + n2.config.id + "(1.37.5)", addBean: false, method: "get", type: R.SDK_ERROR, log: e3 });
  486. }], R.SDK_ERROR)(e2);
  487. }, w.prototype.destroy = function(e2) {
  488. void 0 === e2 && (e2 = false);
  489. var t2, n2, o2 = w.instances.indexOf(this);
  490. -1 !== o2 && w.instances.splice(o2, 1);
  491. for (var i2 = w.installedPlugins.length - 1; 0 <= i2; i2--)
  492. try {
  493. w.installedPlugins[i2].unpatch(this);
  494. } catch (e3) {
  495. this.sendSDKError(e3);
  496. }
  497. if (this.lifeCycle.emit("destroy"), this.lifeCycle.clear(), e2)
  498. t2 = this, n2 = Object.getOwnPropertyDescriptors(t2), Object.keys(n2).forEach(function(e3) {
  499. n2[e3].writable && (t2[e3] = null);
  500. }), Object.setPrototypeOf(this, null);
  501. else {
  502. for (var r2 = this; r2.constructor !== Object && ie(r2, this), r2 = Object.getPrototypeOf(r2); )
  503. ;
  504. 0 === w.instances.length && (o2 = Object.getPrototypeOf(this).constructor, ie(o2), ie(w));
  505. }
  506. }, w.version = "1.37.5", w.instances = [], w.logType = L, w.environment = f, w.installedPlugins = [], w), i = (a.prototype.patch = function(e2) {
  507. this.canUse(e2) && this.exist(e2) && (this.instances.push(e2), this.triggerInit(e2), this.triggerOnNewAegis(e2));
  508. }, a.prototype.unpatch = function(e2) {
  509. var t2 = this.instances.indexOf(e2);
  510. -1 !== t2 && (this.instances.splice(t2, 1), 0 === this.instances.length) && this.uninstall(e2);
  511. }, a.prototype.countInstance = function() {
  512. return this.instances.length;
  513. }, a.prototype.uninstall = function(e2) {
  514. var t2;
  515. null != (t2 = null == (t2 = this.option) ? void 0 : t2.destroy) && t2.apply(this, [e2]);
  516. }, a.prototype.walk = function(n2) {
  517. var o2 = this;
  518. this.instances.forEach(function(e2) {
  519. var t2 = o2.canUse(e2);
  520. t2 && n2(e2, t2);
  521. });
  522. }, a.prototype.canUse = function(e2) {
  523. e2 = this.getConfig(e2);
  524. return !(!e2 || "object" != typeof e2) || !!e2;
  525. }, a.prototype.getConfig = function(e2) {
  526. return null == (e2 = e2.config) ? void 0 : e2[this.name];
  527. }, a.prototype.exist = function(e2) {
  528. return -1 === this.instances.indexOf(e2);
  529. }, a.prototype.triggerInit = function(e2) {
  530. var t2;
  531. this.inited || (this.inited = true, null == (t2 = null == (t2 = this.option) ? void 0 : t2.init)) || t2.call(this.option, this.getConfig(e2));
  532. }, a.prototype.triggerOnNewAegis = function(e2) {
  533. var t2;
  534. null != (t2 = null == (t2 = this.option) ? void 0 : t2.onNewAegis) && t2.call(this.option, e2, this.getConfig(e2));
  535. }, a), Re = new i({ name: "aid", aid: "", init: function(e2) {
  536. try {
  537. var t2 = true !== e2 && e2 || window.localStorage.getItem("AEGIS_ID");
  538. t2 || (t2 = z(), window.localStorage.setItem("AEGIS_ID", t2)), this.aid = t2;
  539. } catch (e3) {
  540. }
  541. }, onNewAegis: function(e2) {
  542. e2.bean.aid = this.aid, e2.config.aid = this.aid;
  543. } }), Oe = function(t2) {
  544. var n2;
  545. return t2.payload ? (n2 = {}, Object.keys(t2).forEach(function(e2) {
  546. "payload" !== e2 && (n2[e2] = t2[e2]);
  547. }), n2) : t2;
  548. }, Se = new i({ name: "reportAssetSpeed" }), Te = Se = new i({ name: "reportAssetSpeed", collectCur: 0, collectEntryType: "resource", ASSETS_INITIATOR_TYPE: ["img", "css", "script", "link", "audio", "video"], onNewAegis: function(e2) {
  549. var t2 = this;
  550. re() && (this.collectSuccessLog(e2), this.collectFailLog(e2), performance.onresourcetimingbufferfull = function() {
  551. t2.collectCur = 0, performance.clearResourceTimings();
  552. });
  553. }, publish: function(t2, n2) {
  554. this.$walk(function(e2) {
  555. e2 === n2 && e2.speedLogPipeline(t2);
  556. });
  557. }, publishMany: function(e2, t2) {
  558. for (var n2 = t2.config, o2 = 0, i2 = e2.length; o2 < i2; o2++) {
  559. var r2 = e2[o2];
  560. -1 === this.ASSETS_INITIATOR_TYPE.indexOf(r2.initiatorType) || l(r2.name, n2.hostUrl) || this.publish(this.generateLog(r2, n2), t2);
  561. }
  562. }, collectSuccessLog: function(n2) {
  563. var e2, t2, o2 = this;
  564. "function" == typeof window.PerformanceObserver ? (this.publishMany(performance.getEntriesByType(this.collectEntryType), n2), (e2 = new window.PerformanceObserver(function(e3) {
  565. o2.publishMany(e3.getEntries(), n2);
  566. })).observe({ entryTypes: [this.collectEntryType] }), n2.lifeCycle.on("destroy", function() {
  567. 0 === Se.countInstance() && e2.disconnect();
  568. })) : (t2 = setInterval(function() {
  569. var e3 = performance.getEntriesByType(o2.collectEntryType), t3 = e3.slice(o2.collectCur);
  570. o2.collectCur = e3.length, o2.publishMany(t3, n2);
  571. }, 3e3), n2.lifeCycle.on("destroy", function() {
  572. 0 === Se.countInstance() && clearInterval(t2);
  573. }));
  574. }, collectFailLog: function(o2) {
  575. function e2(e3) {
  576. var t2, n2;
  577. e3 && (e3 = e3.target || e3.srcElement, !(t2 = (null == e3 ? void 0 : e3.src) || (null == e3 ? void 0 : e3.href)) || "string" != typeof t2 || -1 < window.location.href.indexOf(t2) || (e3 = "function" == typeof (null == (e3 = r2.api) ? void 0 : e3.resourceTypeHandler) ? null == (e3 = r2.api) ? void 0 : e3.resourceTypeHandler(t2) : "", n2 = performance.getEntriesByType(i2.collectEntryType).find(function(e4) {
  578. return e4.name === t2;
  579. }), l(t2, r2.hostUrl)) || (n2 = { url: K(t2), status: 400, duration: Number(((null == n2 ? void 0 : n2.duration) || 0).toFixed(2)), method: "get", type: e3 || "static", isHttps: Q(t2), urlQuery: P(t2, true), nextHopProtocol: "", domainLookup: 0, connectTime: 0 }, i2.publish(n2, o2)));
  580. }
  581. var i2 = this, r2 = o2.config;
  582. window.document.addEventListener("error", e2, true), o2.lifeCycle.on("destroy", function() {
  583. 0 === Se.countInstance() && window.document.removeEventListener("error", e2, true);
  584. });
  585. }, generateLog: function(e2, t2) {
  586. var t2 = "function" == typeof (null == (n2 = t2.api) ? void 0 : n2.resourceTypeHandler) ? null == (n2 = t2.api) ? void 0 : n2.resourceTypeHandler(e2.name) : "", n2 = e2.transferSize;
  587. return { url: K(e2.name), method: "get", duration: Number(e2.duration.toFixed(2)), status: 200, type: t2 || "static", isHttps: Q(e2.name), nextHopProtocol: e2.nextHopProtocol || "", urlQuery: P(e2.name, true), domainLookup: $(e2.domainLookupEnd - e2.domainLookupStart), connectTime: $(e2.connectEnd - e2.connectStart), transferSize: 0 < n2 ? n2 : -1 };
  588. }, collectNotReportedLog: function(e2) {
  589. var t2, n2;
  590. re() && (t2 = (n2 = performance.getEntriesByType(this.collectEntryType)).length, "function" != typeof window.PerformanceObserver) && this.collectCur !== t2 && (n2 = n2.slice(this.collectCur), this.collectCur = t2, this.publishMany(n2, e2, true));
  591. }, destroy: function() {
  592. this.option.publish = function() {
  593. };
  594. } }), Pe = window.navigator.userAgent.toLowerCase(), r = {};
  595. function a(e2) {
  596. this.aegisPlugin = true, this.name = "", this.instances = [], this.inited = false, e2.$walk = this.walk.bind(this), e2.$getConfig = this.getConfig.bind(this), this.option = e2, this.name = e2.name;
  597. }
  598. function w(e2) {
  599. var n2, t2, o2, i2, a2, r2, s2, c2, u2, l2, f2, d2, p2, h2, g2 = this;
  600. this.isGetSample = false, this.isHidden = false, this.config = { version: 0, delay: 1e3, onError: true, repeat: 60, random: 1, aid: true, device: true, pagePerformance: true, webVitals: true, speedSample: true, onClose: true, reportLoadPackageSpeed: true, hostUrl: "https://aegis.qq.com", env: "production", url: "", offlineUrl: "", whiteListUrl: "", pvUrl: "", speedUrl: "", customTimeUrl: "", performanceUrl: "", webVitalsUrl: "", eventUrl: "", setDataReportUrl: "", reportImmediately: true }, this.isWhiteList = false, this.lifeCycle = new G(), this.bean = {}, this.normalLogPipeline = m([Z(this, 5), ee, function(e3, t3) {
  601. var o3 = n2.config;
  602. t3(e3 = e3.map(function(e4) {
  603. var t4, n3 = o3.maxLength || 102400;
  604. try {
  605. if (!e4.msg || e4.msg.length <= n3)
  606. return e4;
  607. e4.msg = null == (t4 = e4.msg) ? void 0 : t4.substring(0, n3);
  608. } catch (t5) {
  609. e4.msg = O(e4.msg).substring(0, o3.maxLength);
  610. }
  611. return e4;
  612. }));
  613. }, (h2 = (n2 = this).config, function(e3, t3) {
  614. var n3 = "number" == typeof h2.repeat ? h2.repeat : 60;
  615. if (n3 <= 0)
  616. return t3(e3);
  617. var o3 = (null == h2 ? void 0 : h2.id) + "_error", i3 = y[o3] || {};
  618. t3(e3.filter(function(e4) {
  619. if (e4.level === L.ERROR || e4.level === L.PROMISE_ERROR || e4.level === L.AJAX_ERROR || e4.level === L.SCRIPT_ERROR || e4.level === L.IMAGE_ERROR || e4.level === L.CSS_ERROR || e4.level === L.MEDIA_ERROR || e4.level === L.RET_ERROR || e4.level === L.BRIDGE_ERROR || e4.level === L.PAGE_NOT_FOUND_ERROR || e4.level === L.WEBSOCKET_ERROR || e4.level === L.LAZY_LOAD_ERROR) {
  620. e4 = e4.msg.slice(0, 200);
  621. if (i3[e4] > n3)
  622. return v[o3] || ye(o3), false;
  623. i3[e4] = 1 + ~~i3[e4], y[o3] = i3;
  624. }
  625. return true;
  626. }));
  627. }), (d2 = this.lifeCycle.emit, p2 = this.config, function(e3, t3) {
  628. var n3, o3 = p2.logCreated;
  629. return "function" == typeof o3 ? (n3 = e3.filter(function(e4) {
  630. return false !== o3(e4);
  631. }), d2("beforeWrite", n3), t3(n3)) : (d2("beforeWrite", e3), t3(e3));
  632. }), (f2 = this, setTimeout(function() {
  633. var e3 = f2.config, t3 = e3.pvUrl, n3 = void 0 === t3 ? "" : t3, t3 = e3.spa, e3 = -1 < ["web-sdk", "mp-sdk"].indexOf("web-sdk");
  634. n3 && (e3 && !t3 || !e3) && f2.sendPipeline([function(e4, t4) {
  635. t4({ url: n3, type: R.PV });
  636. }], R.PV)(null);
  637. }, 100), function(e3, t3) {
  638. t3(e3);
  639. }), (u2 = c2 = s2 = false, l2 = [], (a2 = this).lifeCycle.on("onConfigChange", function() {
  640. r2 && clearTimeout(r2), r2 = setTimeout(function() {
  641. var e3, n3;
  642. !u2 && a2.config && (u2 = true, e3 = a2.config.whiteListUrl, (n3 = void 0 === e3 ? "" : e3) && a2.sendPipeline([function(e4, t3) {
  643. t3({ url: n3, type: R.WHITE_LIST, success: function(e5) {
  644. c2 = true;
  645. try {
  646. var t4 = e5.data || JSON.parse(e5), n4 = t4.retcode, o3 = t4.result, i3 = void 0 === o3 ? {} : o3, r3 = (0 === n4 && (s2 = i3.is_in_white_list, a2.isWhiteList = s2, 0 <= i3.rate) && i3.rate <= 1 && (a2.config.random = i3.rate, a2.isGetSample = false), a2.isWhiteList && l2.length ? be(a2)(l2.splice(0), function() {
  647. }) : !a2.isWhiteList && l2.length && (l2.length = 0), a2.config.onWhitelist);
  648. "function" == typeof r3 && r3(s2);
  649. } catch (e6) {
  650. }
  651. }, fail: function() {
  652. c2 = true;
  653. } });
  654. }], R.WHITE_LIST)(null), u2 = false);
  655. }, a2.config.uin ? 50 : 500);
  656. }), a2.lifeCycle.on("destroy", function() {
  657. l2.length = 0;
  658. }), function(e3, t3) {
  659. var n3;
  660. s2 || null != (n3 = null == (n3 = a2.config) ? void 0 : n3.api) && n3.reportRequest ? t3(e3.concat(l2.splice(0)).map(function(e4) {
  661. return ve(e4), e4;
  662. })) : (n3 = e3.filter(function(e4) {
  663. return e4.level !== L.INFO && e4.level !== L.API_RESPONSE ? (ve(e4), true) : (c2 || (l2.push(e4), 200 <= l2.length && (l2.length = 200)), false);
  664. })).length && t3(n3);
  665. }), function(e3, t3) {
  666. try {
  667. var n3 = JSON.parse(JSON.stringify(e3)), o3 = (g2.lifeCycle.emit("beforeReport", n3), g2.config.beforeReport);
  668. (e3 = "function" == typeof o3 ? e3.filter(function(e4) {
  669. return false !== o3(e4);
  670. }) : e3).length && t3(e3);
  671. } catch (e4) {
  672. }
  673. }, be(this)]), this.eventPipeline = m([Z(this, 10), (i2 = this, function(e3) {
  674. i2.sendPipeline([function(e4, t3) {
  675. var n3 = e4.map(function(e5) {
  676. return { name: e5.name, ext1: e5.ext1 || i2.config.ext1 || "", ext2: e5.ext2 || i2.config.ext2 || "", ext3: e5.ext3 || i2.config.ext3 || "" };
  677. });
  678. t3({ url: i2.config.eventUrl + "?payload=" + encodeURIComponent(JSON.stringify(n3)), type: R.EVENT, log: e4 });
  679. }], R.EVENT)(e3);
  680. })]), this.timeMap = {}, this.failRequestCount = 0, this.customTimePipeline = m([Z(this, 10), (o2 = this, function(e3) {
  681. return o2.sendPipeline([function(e4, t3) {
  682. t3({ url: o2.config.customTimeUrl + "?payload=" + encodeURIComponent(JSON.stringify({ custom: e4 })), type: R.CUSTOM, log: e4 });
  683. }], R.CUSTOM)(e3);
  684. })]), this.config = (t2 = this.config, void 0 === (e2 = e2.hostUrl) && (e2 = "https://aegis.qq.com"), t2.url = t2.url || e2 + "/collect", t2.offlineUrl = t2.offlineUrl || e2 + "/offline", t2.whiteListUrl = t2.whiteListUrl || e2 + "/collect/whitelist", t2.pvUrl = t2.pvUrl || e2 + "/collect/pv", t2.eventUrl = t2.eventUrl || e2 + "/collect/events", t2.speedUrl = t2.speedUrl || e2 + "/speed", t2.customTimeUrl = t2.customTimeUrl || e2 + "/speed/custom", t2.performanceUrl = t2.performanceUrl || e2 + "/speed/performance", t2.webVitalsUrl = t2.webVitalsUrl || e2 + "/speed/webvitals", t2.setDataReportUrl = t2.SetDataReportUrl || e2 + "/speed/miniProgramData", t2), w.instances.push(this);
  685. }
  686. function xe() {
  687. return ("10000000100040008000" + 1e11).replace(/[018]/g, function(e2) {
  688. return (e2 ^ (16 * Math.random() & 15) >> e2 / 4).toString(16);
  689. });
  690. }
  691. r.macos = function() {
  692. return t("mac");
  693. }, r.ios = function() {
  694. return r.iphone() || r.ipod() || r.ipad();
  695. }, r.iphone = function() {
  696. return !r.windows() && t("iphone");
  697. }, r.ipod = function() {
  698. return t("ipod");
  699. }, r.ipad = function() {
  700. var e2 = "MacIntel" === navigator.platform && 1 < navigator.maxTouchPoints;
  701. return t("ipad") || e2;
  702. }, r.android = function() {
  703. return !r.windows() && t("android");
  704. }, r.androidPhone = function() {
  705. return r.android() && t("mobile");
  706. }, r.androidTablet = function() {
  707. return r.android() && !t("mobile");
  708. }, r.blackberry = function() {
  709. return t("blackberry") || t("bb10");
  710. }, r.blackberryPhone = function() {
  711. return r.blackberry() && !t("tablet");
  712. }, r.blackberryTablet = function() {
  713. return r.blackberry() && t("tablet");
  714. }, r.windows = function() {
  715. return t("windows");
  716. }, r.windowsPhone = function() {
  717. return r.windows() && t("phone");
  718. }, r.windowsTablet = function() {
  719. return r.windows() && t("touch") && !r.windowsPhone();
  720. }, r.fxos = function() {
  721. return (t("(mobile") || t("(tablet")) && t(" rv:");
  722. }, r.fxosPhone = function() {
  723. return r.fxos() && t("mobile");
  724. }, r.fxosTablet = function() {
  725. return r.fxos() && t("tablet");
  726. }, r.meego = function() {
  727. return t("meego");
  728. }, r.cordova = function() {
  729. return window.cordova && "file:" === location.protocol;
  730. }, r.nodeWebkit = function() {
  731. return "object" == typeof window.process;
  732. }, r.mobile = function() {
  733. return r.androidPhone() || r.iphone() || r.ipod() || r.windowsPhone() || r.blackberryPhone() || r.fxosPhone() || r.meego();
  734. }, r.tablet = function() {
  735. return r.ipad() || r.androidTablet() || r.blackberryTablet() || r.windowsTablet() || r.fxosTablet();
  736. }, r.desktop = function() {
  737. return !r.tablet() && !r.mobile();
  738. }, r.isIE = function() {
  739. return "ActiveXObject" in window;
  740. };
  741. var Le = { generateTraceId: Ce(16), generateSpanId: Ce(8) }, ke = Array(32);
  742. function Ce(t2) {
  743. return function() {
  744. for (var e2 = 0; e2 < 2 * t2; e2++)
  745. ke[e2] = Math.floor(16 * Math.random()) + 48, 58 <= ke[e2] && (ke[e2] += 39);
  746. return String.fromCharCode.apply(null, ke.slice(0, 2 * t2));
  747. };
  748. }
  749. function Ie(e2) {
  750. var t2, n2 = "";
  751. return n2 = "object" == typeof e2 && (t2 = (e2 = function(e3, t3) {
  752. for (var n3 = 0; n3 < t3.length; n3++) {
  753. var o2 = t3[n3], i2 = e3[o2] || "function" == typeof e3.get && e3.get(o2);
  754. if (i2)
  755. return [o2, i2];
  756. }
  757. return ["", ""];
  758. }(e2, Object.keys(He)))[0], e2 = e2[1], t2) ? He[t2](e2) : n2;
  759. }
  760. function k(o2, e2, i2) {
  761. return null != e2 && e2.length && "object" == typeof o2 ? e2.reduce(function(e3, t2) {
  762. var n2 = o2 instanceof Headers ? o2.get(t2) : o2[t2];
  763. return n2 ? e3 + ("" === e3 ? "\n" : "\n\n") + i2 + " header " + t2 + ": " + n2 : e3;
  764. }, "") : "";
  765. }
  766. var Ae, Ne, qe, Ue, s, _e, je, He = { sw8: function(e2) {
  767. e2 = e2.split("-")[1];
  768. return e2 ? atob(e2) : "";
  769. }, traceparent: function(e2) {
  770. return e2.split("-")[1];
  771. }, b3: function(e2) {
  772. return e2.split("-")[0];
  773. }, "sentry-trace": function(e2) {
  774. return e2.split("-")[0];
  775. } }, Be = (p.prototype.generate = function(e2, t2) {
  776. if (void 0 === t2 && (t2 = {}), this.url = e2, !this.isUrlIgnored() && this.isUrlInTraceUrls() && this.traceType) {
  777. switch (this.traceType) {
  778. case "traceparent":
  779. this.traceId = this.createTraceparent();
  780. break;
  781. case "b3":
  782. this.traceId = this.createB3();
  783. break;
  784. case "sw8":
  785. this.traceId = this.createSw8();
  786. break;
  787. case "sentry-trace":
  788. this.traceId = this.createSentryTrace();
  789. break;
  790. default:
  791. return console.warn("this trace key " + this.traceType + " is not supported"), void (this.traceId = "");
  792. }
  793. return t2[this.traceType] && (this.traceId = t2[this.traceType]), { name: this.traceType, value: this.traceId };
  794. }
  795. }, p.prototype.createTraceparent = function() {
  796. var e2 = Le.generateSpanId();
  797. return "00-" + Le.generateTraceId() + "-" + e2 + "-0" + Number(1).toString(16);
  798. }, p.prototype.createB3 = function() {
  799. var e2 = Le.generateSpanId();
  800. return Le.generateTraceId() + "-" + e2 + "-1";
  801. }, p.prototype.createSw8 = function() {
  802. var e2 = new URL(location.href), t2 = z(), n2 = z();
  803. return "1-" + String(btoa(n2)) + "-" + String(btoa(t2)) + "-1-" + String(btoa("aegis")) + "-" + String(btoa("1.37.5")) + "-" + String(btoa(encodeURI(location.pathname))) + "-" + String(btoa(e2.host));
  804. }, p.prototype.createSentryTrace = function() {
  805. var e2 = xe().substring(16);
  806. return xe() + "-" + e2 + "-1";
  807. }, p.prototype.isUrlIgnored = function() {
  808. if (Array.isArray(this.ignoreUrls) && 0 !== this.ignoreUrls.length)
  809. for (var e2 = 0, t2 = this.ignoreUrls; e2 < t2.length; e2++) {
  810. var n2 = t2[e2];
  811. if (this.urlMatches(this.url, n2))
  812. return true;
  813. }
  814. return false;
  815. }, p.prototype.isUrlInTraceUrls = function() {
  816. if (!this.urls)
  817. return true;
  818. if (Array.isArray(this.urls)) {
  819. if (0 === this.urls.length)
  820. return false;
  821. for (var e2 = 0, t2 = this.urls; e2 < t2.length; e2++) {
  822. var n2 = t2[e2];
  823. if (this.urlMatches(this.url, n2))
  824. return true;
  825. }
  826. }
  827. return false;
  828. }, p.prototype.urlMatches = function(e2, t2) {
  829. return "string" == typeof t2 ? e2 === t2 : !!e2.match(t2);
  830. }, p), De = false, c = [], Fe = /^\/[^/]/, Me = false, d = [], We = (new i({ name: "reportApiSpeed" }), new i({ name: "reportApiSpeed", override: false, onNewAegis: function(e2) {
  831. var t2, n2;
  832. this.override || (null != (n2 = e2.config.api) && n2.injectTraceHeader && (this.traceRequestHeader = new Be(n2.injectTraceHeader, null != (t2 = null == n2 ? void 0 : n2.injectTraceIgnoreUrls) ? t2 : [], null == n2 ? void 0 : n2.injectTraceUrls)), this.override = true, this.overrideFetch(e2.config, e2), this.overrideXhr(e2.config, e2));
  833. }, getRequestType: function(e2, t2, n2) {
  834. void 0 === t2 && (t2 = "");
  835. var o2, i2, e2 = "function" == typeof (null == (i2 = e2.api) ? void 0 : i2.resourceTypeHandler) ? null == (i2 = e2.api) ? void 0 : i2.resourceTypeHandler(n2) : "";
  836. return -1 === X.indexOf(e2) && (o2 = void 0 === t2 ? "" : t2, i2 = (void 0 === n2 ? "" : n2).split("?")[0], e2 = ce.test(i2) || se.some(function(e3) {
  837. return -1 !== String(o2).indexOf(e3);
  838. }) ? "static" : "fetch"), e2;
  839. }, overrideFetch: function(m2, v2) {
  840. var y2 = this, e2 = m2.api, e2 = { name: this.name, traceRequestHeader: null != e2 && e2.injectTraceHeader ? this.traceRequestHeader : null, then: function(f2, d2, p2, h2) {
  841. var e3, g2;
  842. l(p2, m2.hostUrl) || (e3 = f2.headers ? f2.headers.get("content-type") : "", "fetch" === (g2 = y2.getRequestType(m2, e3, p2)) ? f2.clone().text().then(function(n2) {
  843. var e4, o2 = f2.status <= 0 || 400 <= f2.status, t2 = (null == (t2 = m2.api) ? void 0 : t2.reqHeaders) || [], i2 = k(null == h2 ? void 0 : h2.headers, t2, "req"), t2 = (null == (t2 = m2.api) ? void 0 : t2.resHeaders) || [], r2 = k(f2.headers, t2, "res"), a2 = Ie(null == h2 ? void 0 : h2.headers), t2 = Y(n2, m2.api, { url: p2, ctx: f2, payload: null == h2 ? void 0 : h2.body }), s2 = t2.code, c2 = t2.isErr, t2 = null == (t2 = m2.api) ? void 0 : t2.apiDetail, u3 = t2 ? x(null == h2 ? void 0 : h2.body, null == (e4 = m2.api) ? void 0 : e4.reqParamHandler, { url: p2 }) : "", l2 = t2 ? x(n2, null == (e4 = m2.api) ? void 0 : e4.resBodyHandler, { url: p2, ctx: f2 }) : "";
  844. setTimeout(function() {
  845. var e5 = y2.getPerformanceEntryByUrl(m2, { url: p2, duration: d2, type: g2, status: f2.status || 0, method: (null == h2 ? void 0 : h2.method) || "get" }), t3 = (o2 ? "FETCH_ERROR: " + n2 + " \n\n" : "") + "fetch req url: " + p2 + " \n \nres status: " + (f2.status || 0) + " \n \nres duration: " + e5.duration + "ms \n \nreq method: " + ((null == h2 ? void 0 : h2.method) || "get") + " \n \nres retcode: " + s2 + "\n \nreq param: " + u3 + "\n \nres data: " + l2 + "\n " + i2 + "\n " + r2;
  846. e5.payload = null == h2 ? void 0 : h2.body, e5.ret = s2, e5.isErr = +c2, y2.publishNormalLog({ msg: t3, level: o2 ? L.AJAX_ERROR : c2 ? L.RET_ERROR : L.API_RESPONSE, code: s2, trace: a2 }, v2), y2.publishSpeed(e5, v2);
  847. }, 0);
  848. }) : setTimeout(function() {
  849. var e4 = y2.getPerformanceEntryByUrl(m2, { url: p2, duration: d2, type: g2, status: f2.status || 0, method: (null == h2 ? void 0 : h2.method) || "get" });
  850. e4.type = "static", e4.urlQuery = P(p2, true), y2.publishSpeed(e4, v2);
  851. }, 0));
  852. }, catch: function(t2, n2, o2, i2) {
  853. var r2, e3, a2, s2, c2;
  854. throw l(o2, m2.hostUrl) || (r2 = y2.getRequestType(m2, "", o2), e3 = (null == (e3 = m2.api) ? void 0 : e3.reqHeaders) || [], a2 = k(null == i2 ? void 0 : i2.headers, e3, "req"), s2 = Ie(null == i2 ? void 0 : i2.headers), c2 = null != (e3 = m2.api) && e3.apiDetail ? x(null == i2 ? void 0 : i2.body, null == (e3 = m2.api) ? void 0 : e3.reqParamHandler, { url: o2 }) : "", setTimeout(function() {
  855. var e4 = y2.getPerformanceEntryByUrl(m2, { url: o2, duration: n2, type: r2, status: 0, method: (null == i2 ? void 0 : i2.method) || "get" }), e4 = (y2.publishSpeed(e4, v2), "AJAX_ERROR: " + t2 + "\n \nreq url: " + o2 + "\n \nres status: 0\n \nres duration: " + e4.duration + "ms\n \nreq method: " + ((null == i2 ? void 0 : i2.method) || "get") + "\n \nreq param: " + c2 + "\n " + a2);
  856. y2.publishNormalLog({ msg: e4, level: L.AJAX_ERROR, code: -400, trace: s2 }, v2);
  857. }, 0)), t2;
  858. } }, u2 = (this.hackFetchOptions = e2, this.hackFetchOptions);
  859. if (d.find(function(e3) {
  860. return e3.name === u2.name;
  861. }))
  862. throw new Error("name '" + u2.name + "' is already in hackFetch option list");
  863. d.push(u2), !Me && window.fetch && (Me = true, Ue = window.fetch, window.fetch = function(e3, i2) {
  864. void 0 === i2 && (i2 = {});
  865. var t2, n2, r2 = "string" == typeof e3 ? e3 : null == e3 ? void 0 : e3.url, o2 = (Fe.test(r2) && (r2 = "" + location.origin + r2), (u2 || {}).traceRequestHeader);
  866. o2 && (n2 = (i2 || {}).headers, t2 = (n2 = o2.generate(r2, o2 = void 0 === n2 ? {} : n2) || {}).name, n2 = n2.value) && t2 && (i2.headers = Object.assign(o2, ((o2 = {})[t2] = n2, o2)));
  867. for (var a2 = 0; a2 < d.length; a2++) {
  868. var s2 = d[a2];
  869. try {
  870. "function" == typeof s2.beforeFetch && s2.beforeFetch(r2, i2);
  871. } catch (e4) {
  872. }
  873. }
  874. var c2 = Date.now();
  875. return Ue(e3, i2).then(function(e4) {
  876. for (var t3 = e4.clone(), n3 = 0; n3 < d.length; n3++) {
  877. var o3 = d[n3];
  878. try {
  879. "function" == typeof o3.then && o3.then(t3, Date.now() - c2, r2, i2);
  880. } catch (e5) {
  881. }
  882. }
  883. return t3;
  884. }).catch(function(e4) {
  885. for (var t3 = 0; t3 < d.length; t3++) {
  886. var n3 = d[t3];
  887. try {
  888. "function" == typeof n3.catch && n3.catch(e4, Date.now() - c2, r2, i2);
  889. } catch (e5) {
  890. }
  891. }
  892. throw e4;
  893. });
  894. });
  895. }, overrideXhr: function(O2, S2) {
  896. var t2, T2 = this, e2 = { name: this.name, send: function(E2, R2) {
  897. var e3, t3, n2 = Date.now();
  898. ((null == O2 ? void 0 : O2.api) || {}).injectTraceHeader && (e3 = (t3 = T2.traceRequestHeader.generate(E2.aegisUrl) || {}).name, t3 = t3.value, e3) && t3 && E2.setRequestHeader(e3, t3), E2.addEventListener("loadend", function() {
  899. var v2, y2, e4, w2, b2 = E2.aegisUrl || "";
  900. l(b2, O2.hostUrl) || "abort" === E2.failType || (v2 = "", (E2.failType || !E2.status || 400 <= E2.status) && (v2 = E2.failType || "failed"), y2 = Date.now() - n2, e4 = E2.getResponseHeader("content-type"), w2 = T2.getRequestType(O2, e4, b2), setTimeout(function() {
  901. var o2 = T2.getPerformanceEntryByUrl(O2, { url: b2, duration: y2, type: w2, status: E2.status, method: E2.aegisMethod || "get" });
  902. if ("fetch" === w2) {
  903. var e5 = (null == (e5 = O2.api) ? void 0 : e5.reqHeaders) || [], i2 = k(E2.aegisXhrReqHeader, e5, "req"), e5 = (null == (e5 = O2.api) ? void 0 : e5.resHeaders) || [], t4 = E2.getAllResponseHeaders().split("\r\n").reduce(function(e6, t5) {
  904. t5 = t5.split(": ");
  905. return t5[0] && t5[1] && (e6[t5[0]] = t5[1]), e6;
  906. }, {}), r2 = k(t4, e5, "res"), a2 = Ie(E2.aegisXhrReqHeader), e5 = null == (t4 = O2.api) ? void 0 : t4.apiDetail, s2 = e5 ? x(R2, null == (t4 = O2.api) ? void 0 : t4.reqParamHandler, { url: b2 }) : "", c2 = e5 ? x(E2.response, null == (t4 = O2.api) ? void 0 : t4.resBodyHandler, { url: b2 }) : "";
  907. try {
  908. var n3, u2, l2, f2, d2 = E2.response, p2 = O2.api, h2 = { url: b2, ctx: E2, payload: R2 }, g2 = function(e6) {
  909. var t5 = e6.code, e6 = e6.isErr, n4 = (v2 ? "AJAX_ERROR: request " + v2 + " \n\n" : "") + "fetch req url: " + b2 + " \n \nres status: " + o2.status + "\n \nres duration: " + o2.duration + "ms\n \nreq method: " + o2.method + "\n \nres retcode: " + t5 + "\n \nreq param: " + s2 + "\n \nres data: " + c2 + "\n " + i2 + "\n " + r2;
  910. o2.ret = t5, o2.isErr = +e6, o2.payload = R2, T2.publishNormalLog({ msg: n4, level: v2 ? L.AJAX_ERROR : e6 ? L.RET_ERROR : L.API_RESPONSE, code: t5, trace: a2 }, S2), T2.publishSpeed(o2, S2);
  911. };
  912. try {
  913. if ("function" == typeof (null == p2 ? void 0 : p2.retCodeHandlerAsync))
  914. return void p2.retCodeHandlerAsync(d2, null == h2 ? void 0 : h2.url, null == h2 ? void 0 : h2.ctx, function(e6) {
  915. var t5 = e6.code, e6 = e6.isErr;
  916. null != g2 && g2({ code: void 0 === t5 ? "unknown" : t5, isErr: e6 });
  917. });
  918. if ("function" == typeof (null == p2 ? void 0 : p2.retCodeHandler))
  919. return void (l2 = (u2 = p2.retCodeHandler(d2, null == h2 ? void 0 : h2.url, null == h2 ? void 0 : h2.ctx, null == h2 ? void 0 : h2.payload) || {}).code, f2 = u2.isErr, null != g2 && g2({ code: void 0 === l2 ? "unknown" : l2, isErr: f2 }));
  920. if (!(d2 = "string" == typeof d2 ? JSON.parse(d2) : d2))
  921. return void (null != g2 && g2({ code: "unknown", isErr: false }));
  922. "function" == typeof (null == (n3 = null == p2 ? void 0 : p2.ret) ? void 0 : n3.join) && (ue = [].concat(p2.ret.map(function(e6) {
  923. return e6.toLowerCase();
  924. })));
  925. var m2 = Object.getOwnPropertyNames(d2).filter(function(e6) {
  926. return -1 !== ue.indexOf(e6.toLowerCase());
  927. });
  928. if (m2.length)
  929. return void ("未知" !== (l2 = d2[m2[0]]) && "" !== l2 || (l2 = "unknown"), null != g2 && g2({ code: "" + l2, isErr: 0 !== l2 && "0" !== l2 && "unknown" !== l2 }));
  930. null != g2 && g2({ code: "unknown", isErr: false });
  931. } catch (d3) {
  932. null != g2 && g2({ code: "unknown", isErr: false });
  933. }
  934. } catch (e6) {
  935. o2.ret = "unknown", T2.publishSpeed(o2, S2);
  936. }
  937. } else
  938. o2.type = "static", o2.urlQuery = P(b2, true), T2.publishSpeed(o2, S2);
  939. }, 0));
  940. }), ["abort", "error", "timeout"].map(function(e4) {
  941. E2.addEventListener(e4, function() {
  942. E2.failType = e4;
  943. });
  944. });
  945. } };
  946. this.hackXHROptions = e2, t2 = this.hackXHROptions, c.find(function(e3) {
  947. return e3.name === t2.name;
  948. }) || (c.push(t2), !De && window.XMLHttpRequest && (Ae = window.XMLHttpRequest.prototype.send, Ne = window.XMLHttpRequest.prototype.open, qe = window.XMLHttpRequest.prototype.setRequestHeader, De = true, window.XMLHttpRequest.prototype.open = function() {
  949. this.aegisMethod = arguments[0];
  950. var e3 = arguments[1];
  951. if (Fe.test(e3) && (e3 = "" + location.origin + e3), this.aegisUrl = e3, this.aegisXhrStartTime = Date.now(), this.sendByAegis)
  952. r.isIE() || (this.timeout = 5e3);
  953. else
  954. for (var t3 = 0; t3 < c.length; t3++) {
  955. var n2 = c[t3];
  956. try {
  957. "function" == typeof n2.open && n2.open(this);
  958. } catch (e4) {
  959. }
  960. }
  961. return Ne.apply(this, arguments);
  962. }, window.XMLHttpRequest.prototype.setRequestHeader = function() {
  963. var e3, t3 = arguments[0], n2 = arguments[1];
  964. if (this.aegisXhrReqHeader = null != (e3 = this.aegisXhrReqHeader) ? e3 : {}, !(-1 < ["traceparent", "b3", "sw8", "sentry-trace"].indexOf(t3) && (this.aegisXhrReqHeader[t3] || (arguments[1] = n2), this.aegisXhrReqHeader[t3])))
  965. return this.aegisXhrReqHeader[t3] = arguments[1], qe.apply(this, arguments);
  966. }, window.XMLHttpRequest.prototype.send = function() {
  967. if (!this.sendByAegis)
  968. for (var e3 = 0; e3 < c.length; e3++) {
  969. var t3 = c[e3];
  970. try {
  971. "function" == typeof t3.send && t3.send(this, arguments[0]);
  972. } catch (e4) {
  973. }
  974. }
  975. return Ae.apply(this, arguments);
  976. }));
  977. }, getPerformanceEntryByUrl: function(e2, t2) {
  978. if (null != (e2 = e2.api) && e2.usePerformanceTiming && "string" == typeof t2.url) {
  979. e2 = null == (e2 = performance.getEntriesByName(t2.url)) ? void 0 : e2.pop();
  980. if (e2)
  981. return { url: t2.url, isHttps: Q(t2.url), method: t2.method, type: t2.type, status: t2.status, duration: Number(e2.duration.toFixed(2)), nextHopProtocol: e2.nextHopProtocol || "", domainLookup: $(e2.domainLookupEnd - e2.domainLookupStart), connectTime: $(e2.connectEnd - e2.connectStart) };
  982. }
  983. return { url: t2.url, isHttps: Q(t2.url), method: t2.method, type: t2.type, status: t2.status, duration: Number(t2.duration.toFixed(2)), nextHopProtocol: "", domainLookup: n.number, connectTime: n.number };
  984. }, publishSpeed: function(n2) {
  985. var o2 = this;
  986. this.$walk(function(e2) {
  987. var t2 = o2.$getConfig(e2);
  988. "fetch" === n2.type && t2 && "function" == typeof t2.urlHandler ? e2.speedLogPipeline(E(E({}, n2), { url: P(t2.urlHandler(n2.url, n2.payload)) })) : (n2.url = P(n2.url), e2.speedLogPipeline(n2));
  989. });
  990. }, publishNormalLog: function(t2) {
  991. this.$walk(function(e2) {
  992. e2.normalLogPipeline(t2);
  993. });
  994. }, destroy: function() {
  995. var t2, n2, e2;
  996. this.option.publishSpeed = function() {
  997. }, this.option.publishNormalLog = function() {
  998. }, this.option.hackXHROptions && (t2 = this.option.hackXHROptions, -1 !== (e2 = c.findIndex(function(e3) {
  999. return e3.name === t2.name;
  1000. }))) && c.splice(e2, 1), this.option.hackFetchOptions && (n2 = this.option.hackFetchOptions, -1 !== (e2 = d.findIndex(function(e3) {
  1001. return e3.name === n2.name;
  1002. }))) && d.splice(e2, 1), this.option.override = false;
  1003. } })), Ve = {}, Xe = new i({ name: "reportBridgeSpeed", override: false, onNewAegis: function(e2) {
  1004. this.override || (this.override = true, this.overrideBridge(e2));
  1005. }, publishSpeed: function(t2, n2) {
  1006. this.$walk(function(e2) {
  1007. e2 === n2 && e2.speedLogPipeline(t2);
  1008. });
  1009. }, overrideBridge: function(c2) {
  1010. var u2 = this, l2 = c2.config;
  1011. l2.reportBridgeSpeed && l2.h5Bridge && l2.h5BridgeFunc.length && l2.h5BridgeFunc.forEach(function(e2) {
  1012. var s2 = l2.h5Bridge[e2];
  1013. Ve[e2] = s2, l2.h5Bridge[e2] = function() {
  1014. for (var e3 = [], t2 = 0; t2 < arguments.length; t2++)
  1015. e3[t2] = arguments[t2];
  1016. var o2 = e3[0], i2 = e3[1], n2 = e3[2], r2 = e3[3], a2 = Date.now();
  1017. s2(o2, i2, n2, function(e4) {
  1018. var t3 = Y(e4, l2.api), n3 = t3.code, t3 = t3.isErr, n3 = { url: o2 + "-" + i2, name: o2 + "-" + i2, duration: Date.now() - a2, type: "bridge", ret: n3, isErr: +t3 };
  1019. u2.publishSpeed(n3, c2), r2(e4);
  1020. });
  1021. };
  1022. });
  1023. }, unHackBridge: function(t2) {
  1024. Object.keys(Ve).forEach(function(e2) {
  1025. Ve[e2] && (t2.config.h5Bridge[e2] = Ve[e2]);
  1026. }), Ve = {};
  1027. }, destroy: function(e2) {
  1028. this.option.publishSpeed = function() {
  1029. }, this.option.unHackBridge(e2), this.option.override = false;
  1030. } });
  1031. function p(e2, t2, n2) {
  1032. void 0 === n2 && (n2 = null), this.traceType = e2, this.ignoreUrls = t2, this.urls = n2;
  1033. }
  1034. (T = s = s || {})[T.unknown = 100] = "unknown", T[T.wifi = 1] = "wifi", T[T.net2g = 2] = "net2g", T[T.net3g = 3] = "net3g", T[T.net4g = 4] = "net4g", T[T.net5g = 5] = "net5g", T[T.net6g = 6] = "net6g", (T = _e = _e || {})[T.android = 1] = "android", T[T.ios = 2] = "ios", T[T.windows = 3] = "windows", T[T.macos = 4] = "macos", T[T.linux = 5] = "linux", T[T.other = 100] = "other", (T = je = je || {})[T.unknown = 100] = "unknown", T[T.normal = 0] = "normal", T[T.weak = 1] = "weak", T[T.disconnected = 2] = "disconnected";
  1035. function h(e2, t2, n2, o2) {
  1036. return void 0 === n2 && (n2 = 15e3), void 0 === o2 && (o2 = 0), (t2 = void 0 === t2 ? 0 : t2) <= e2 && e2 <= n2 ? e2 : o2;
  1037. }
  1038. var g, b, Ge, Je, $e, S, Ke, Qe, Ye, T = new i({ name: "device", onNewAegis: function(e2) {
  1039. e2.extendBean("platform", this.getPlatform()), e2.extendBean("netType", s.unknown), this.getDpi(e2), this.refreshNetworkTypeToBean(e2), this.refreshNetworkStatusToBean(e2);
  1040. }, getDpi: function(e2) {
  1041. e2.extendBean("vp", Math.round(window.innerWidth) + " * " + Math.round(window.innerHeight)), window.screen && e2.extendBean("sr", Math.round(window.screen.width) + " * " + Math.round(window.screen.height));
  1042. }, getPlatform: function() {
  1043. var t2 = { android: /\bAndroid\s*([^;]+)/, ios: /\b(iPad|iPhone|iPod)\b.*? OS ([\d_]+)/, windows: /\b(Windows NT)/, macos: /\b(Mac OS)/, linux: /\b(Linux)/i }, e2 = Object.keys(t2).find(function(e3) {
  1044. return t2[e3].test(navigator.userAgent);
  1045. });
  1046. return e2 ? _e[e2] : _e.other;
  1047. }, refreshNetworkTypeToBean: function(t2) {
  1048. var n2 = this, e2 = t2.config;
  1049. e2 && ("function" == typeof e2.getNetworkType ? e2.getNetworkType : ze)(function(e3) {
  1050. s[e3] || (e3 = s.unknown), t2.extendBean("netType", e3), n2.NetworkRefreshTimer = setTimeout(function() {
  1051. n2.refreshNetworkTypeToBean(t2), clearTimeout(n2.NetworkRefreshTimer);
  1052. }, 1e4);
  1053. });
  1054. }, refreshNetworkStatusToBean: function(t2) {
  1055. var e2, n2 = this, o2 = t2.config;
  1056. o2 && null != (e2 = "function" == typeof o2.getNetworkStatus ? o2.getNetworkStatus : e2) && e2(function(e3) {
  1057. void 0 === je[e3] && (e3 = je.unknown), t2.extendBean("netStatus", e3), n2.NetworkStatusRefreshTimer = setTimeout(function() {
  1058. n2.refreshNetworkStatusToBean(t2), clearTimeout(n2.NetworkStatusRefreshTimer);
  1059. }, 1e4);
  1060. });
  1061. } }), ze = function(e2) {
  1062. var t2 = "", n2 = navigator.userAgent.match(/NetType\/(\w+)/);
  1063. n2 ? t2 = n2[1] : navigator.connection && (t2 = navigator.connection.effectiveType || navigator.connection.type), e2((n2 = t2 = t2 || "unknown", 0 <= (n2 = String(n2).toLowerCase()).indexOf("4g") ? s.net4g : 0 <= n2.indexOf("wifi") ? s.wifi : 0 <= n2.indexOf("5g") ? s.net5g : 0 <= n2.indexOf("6g") ? s.net6g : 0 <= n2.indexOf("3g") ? s.net3g : 0 <= n2.indexOf("2g") ? s.net2g : s.unknown));
  1064. }, Ze = window.WebSocket, C = [], et = { construct: function(e2, t2) {
  1065. var a2 = new e2(t2[0], t2[1]);
  1066. return a2.originSend = a2.send, a2.addEventListener("error", function(e3) {
  1067. var e3 = (null == e3 ? void 0 : e3.currentTarget) || {}, t3 = e3.url, n2 = e3.readyState;
  1068. null != C && C.forEach(function(e4) {
  1069. e4 = e4.onErr;
  1070. null != e4 && e4({ msg: "无法获知具体错误信息,需在浏览器控制台查看!", readyState: n2, connectUrl: t3 });
  1071. });
  1072. }), Object.defineProperty(a2, "send", { get: function() {
  1073. return function(e3) {
  1074. null != (t3 = a2.originSend) && t3.call(a2, e3);
  1075. var t3 = a2.readyState, e3 = WebSocket.OPEN, n2 = WebSocket.CLOSED, o2 = WebSocket.CONNECTING, i2 = WebSocket.CLOSING;
  1076. if (t3 !== e3) {
  1077. var r2 = { readyState: t3, connectUrl: a2.url };
  1078. switch (t3) {
  1079. case n2:
  1080. C.forEach(function(e4) {
  1081. e4 = e4.sendErr;
  1082. null != e4 && e4(E({ msg: "消息发送失败,连接已关闭!" }, r2));
  1083. });
  1084. break;
  1085. case o2:
  1086. C.forEach(function(e4) {
  1087. (0, e4.sendErr)(E({ msg: "消息发送失败,正在连接中!" }, r2));
  1088. });
  1089. break;
  1090. case i2:
  1091. C.forEach(function(e4) {
  1092. (0, e4.sendErr)(E({ msg: "消息发送失败,连接正在关闭!" }, r2));
  1093. });
  1094. }
  1095. }
  1096. };
  1097. } }), a2;
  1098. } }, tt = new i({ name: "onError" }), nt = tt = new i({ name: "onError", onNewAegis: function(e2) {
  1099. this.startListen(e2);
  1100. }, startListen: function(i2) {
  1101. function e2(e3) {
  1102. (e3 = e3 && O(e3.reason)) && s2.publishErrorLog({ msg: "PROMISE_ERROR: " + e3, level: L.PROMISE_ERROR }, i2);
  1103. }
  1104. function t2(e3) {
  1105. var t3;
  1106. if (e3 = (null == e3 ? void 0 : e3.target) || (null == e3 ? void 0 : e3.srcElement)) {
  1107. var n3 = e3.src || e3.href || "", e3 = e3.tagName, e3 = void 0 === e3 ? "script" : e3;
  1108. if (!(l(t3 = n3, i2.config.hostUrl) || -1 < window.location.href.indexOf(t3))) {
  1109. var o3 = { msg: e3 + " load fail: " + n3, level: L.INFO };
  1110. if (/\.js$/.test(n3))
  1111. o3.level = L.SCRIPT_ERROR;
  1112. else if (/\.css$/.test(n3))
  1113. o3.level = L.CSS_ERROR;
  1114. else
  1115. switch (e3.toLowerCase()) {
  1116. case "script":
  1117. o3.level = L.SCRIPT_ERROR;
  1118. break;
  1119. case "link":
  1120. o3.level = L.CSS_ERROR;
  1121. break;
  1122. case "img":
  1123. o3.level = L.IMAGE_ERROR;
  1124. break;
  1125. case "audio":
  1126. case "video":
  1127. o3.level = L.MEDIA_ERROR;
  1128. break;
  1129. default:
  1130. return;
  1131. }
  1132. s2.publishErrorLog(o3, i2);
  1133. }
  1134. }
  1135. }
  1136. var n2, o2, r2, a2, s2 = this, c2 = window.onerror;
  1137. window.onerror = function() {
  1138. for (var e3 = [], t3 = 0; t3 < arguments.length; t3++)
  1139. e3[t3] = arguments[t3];
  1140. var n3, o3 = O(e3[0]);
  1141. "string" != typeof (n3 = o3) || !n3 || W.some(function(e4) {
  1142. return -1 < n3.indexOf(e4);
  1143. }) || M.some(function(e4) {
  1144. return -1 < n3.indexOf(e4);
  1145. }) || s2.publishErrorLog({ msg: (o3 || "") + " @ (" + (O(e3[1]) || "") + ":" + (e3[2] || 0) + ":" + (e3[3] || 0) + ")\n \n" + O(e3[4] || ""), level: L.ERROR }, i2), null != c2 && c2.call.apply(c2, u([window], e3));
  1146. }, window.addEventListener("unhandledrejection", e2);
  1147. window.document.addEventListener("error", t2, true), i2.lifeCycle.on("destroy", function() {
  1148. 0 === tt.countInstance() && (window.document.removeEventListener("unhandledrejection", e2), window.document.removeEventListener("error", t2, true));
  1149. }), i2.config.websocketHack && (n2 = { key: i2.config.id + "-" + this.name, onErr: function(e3) {
  1150. var t3;
  1151. null != (t3 = s2.publishWsErrorLog) && t3.call(s2, e3, i2);
  1152. }, sendErr: function(e3) {
  1153. var t3;
  1154. null != (t3 = s2.publishWsErrorLog) && t3.call(s2, e3, i2);
  1155. } }, this.hackWebsocketConfig = n2, n2 = this.hackWebsocketConfig, window.Proxy) && window.WebSocket && (o2 = window.WebSocket, window && !o2.isHack && (r2 = new Proxy(WebSocket, et), o2.isHack = true, window.WebSocket = r2), a2 = n2, C.find(function(e3) {
  1156. return e3.key === a2.key;
  1157. }) || a2 && C.push(a2));
  1158. }, publishErrorLog: function(t2, n2) {
  1159. this.$walk(function(e2) {
  1160. e2 === n2 && e2.normalLogPipeline(t2);
  1161. });
  1162. }, publishWsErrorLog: function(e2, t2) {
  1163. var n2 = e2.connectUrl, o2 = e2.msg, e2 = e2.readyState;
  1164. this.publishErrorLog({ msg: "WEBSOCKET_ERROR: \n connect: " + n2 + "\n readyState: " + e2 + "\n msg: " + o2, level: L.WEBSOCKET_ERROR }, t2);
  1165. }, destroy: function() {
  1166. var t2, e2;
  1167. this.option.publishErrorLog = function() {
  1168. }, this.option.hackWebsocketConfig && (t2 = this.option.hackWebsocketConfig, window.WebSocket = Ze, -1 !== (e2 = C.findIndex(function(e3) {
  1169. return e3.key === t2.key;
  1170. }))) && C.splice(e2, 1);
  1171. } }), ot = (new i({ name: "pagePerformance" }), 3), it = new i({ name: "pagePerformance", onNewAegis: function(e2) {
  1172. re() && (g ? this.publish(g, e2) : this.startCalcPerformance(e2));
  1173. }, publish: function(e2, t2) {
  1174. var s2 = this;
  1175. this.$walk(function(a2) {
  1176. a2 === t2 && a2.sendPipeline([function(e3, t3) {
  1177. var n2, o2 = [];
  1178. for (n2 in e3)
  1179. o2.push(n2 + "=" + e3[n2]);
  1180. var i2, r2 = s2.$getConfig(a2);
  1181. if (r2)
  1182. return i2 = -1 === (null == (i2 = a2.config.performanceUrl) ? void 0 : i2.indexOf("?")) ? "?" : "&", "function" == typeof r2.urlHandler ? t3({ url: a2.config.performanceUrl + i2 + o2.join("&") + "&from=" + (encodeURIComponent(r2.urlHandler()) || window.location.href), beanFilter: ["from"], type: R.PERFORMANCE, log: e3 }) : t3({ url: a2.config.performanceUrl + i2 + o2.join("&"), type: R.PERFORMANCE, log: e3 });
  1183. }], R.PERFORMANCE)(e2);
  1184. });
  1185. }, startCalcPerformance: function(n2) {
  1186. var o2 = this;
  1187. try {
  1188. this.getFirstScreenTiming(n2, function(e2) {
  1189. var t2 = performance.timing;
  1190. t2 && (g = { dnsLookup: h(t2.domainLookupEnd - t2.domainLookupStart), tcp: h(t2.connectEnd - t2.connectStart), ssl: h(0 === t2.secureConnectionStart ? 0 : t2.requestStart - t2.secureConnectionStart), ttfb: h(t2.responseStart - t2.requestStart), contentDownload: h(t2.responseEnd - t2.responseStart), domParse: h(t2.domInteractive - t2.domLoading, 0, 15e3, 1070), resourceDownload: h(t2.loadEventStart - t2.domInteractive, 0, 15e3, 1070), firstScreenTiming: h(Math.floor(e2), 0, 15e3, 15e3) }, (t2 = n2.config).extraPerformanceData && "{}" !== JSON.stringify(t2.extraPerformanceData) && (t2 = (e2 = t2.extraPerformanceData).engineInit, e2 = e2.bundleLoad, g = E(E({}, g), { engineInit: h(t2, 0, 1e4), bundleLoad: h(e2, 0, 1e4) })), o2.publish(g, n2));
  1191. });
  1192. } catch (n3) {
  1193. }
  1194. }, getFirstScreenTiming: function(s2, c2) {
  1195. s2.lifeCycle.on("destroy", function() {
  1196. h2 && clearTimeout(h2);
  1197. });
  1198. var u2 = this, n2 = ["script", "style", "link", "br"], l2 = [], f2 = {}, d2 = new MutationObserver(function(e2) {
  1199. var t2 = { roots: [], rootsDomNum: [], time: performance.now() };
  1200. e2.forEach(function(e3) {
  1201. e3 && e3.addedNodes && e3.addedNodes.forEach && e3.addedNodes.forEach(function(e4) {
  1202. 1 === e4.nodeType && e4.hasAttribute("AEGIS-FIRST-SCREEN-TIMING") ? (Object.prototype.hasOwnProperty.apply(f2, [t2.time]) || (f2[t2.time] = []), f2[t2.time].push(e4)) : 1 !== e4.nodeType || -1 !== n2.indexOf(e4.nodeName.toLocaleLowerCase()) || u2.isEleInArray(e4, t2.roots) || e4.hasAttribute("AEGIS-IGNORE-FIRST-SCREEN-TIMING") || (t2.roots.push(e4), t2.rootsDomNum.push(u2.walkAndCount(e4) || 0));
  1203. });
  1204. }), t2.roots.length && l2.push(t2);
  1205. }), p2 = (d2.observe(document, { childList: true, subtree: true }), function(o2) {
  1206. (o2 = void 0 === o2 ? 0 : o2) || (i2 = 0, (e2 = Object.keys(f2)).length ? (o2 = Math.max.apply(null, e2), ("object" != typeof (null == (e2 = s2.config) ? void 0 : e2.pagePerformance) || null != (e2 = s2.config.pagePerformance) && e2.firstScreenInfo) && (s2.firstScreenInfo = { element: null == (e2 = f2[o2]) ? void 0 : e2[0], timing: o2, markDoms: f2 })) : l2.forEach(function(e3) {
  1207. for (var t3, n4 = 0; n4 < e3.roots.length; n4++)
  1208. e3.rootsDomNum[n4] > i2 && u2.isInFirstScreen(e3.roots[n4]) && (i2 = e3.rootsDomNum[n4], o2 = e3.time, "object" != typeof (null == (t3 = s2.config) ? void 0 : t3.pagePerformance) || null != (t3 = s2.config.pagePerformance) && t3.firstScreenInfo) && (s2.firstScreenInfo = { element: e3.roots[n4], timing: o2 });
  1209. }), l2.length = 0, Object.keys(f2).forEach(function(e3) {
  1210. f2[e3] = f2[e3].map(function(e4) {
  1211. var t3 = { tagName: e4.tagName }, n4 = e4.attributes;
  1212. if (!n4)
  1213. return e4;
  1214. for (var o3 = 0; o3 < n4.length; o3++) {
  1215. var i3 = n4[o3];
  1216. i3.name && (t3[i3.name] = e4.getAttribute(i3.name));
  1217. }
  1218. return t3;
  1219. });
  1220. }));
  1221. var i2, e2 = performance.timing, t2 = e2.domInteractive - e2.domLoading, e2 = e2.loadEventStart - e2.domInteractive, n3 = o2;
  1222. h2 = null;
  1223. for (var r2 = 0, a2 = [t2, e2, n3]; r2 < a2.length; r2++)
  1224. if (a2[r2] <= 0 && 0 < ot) {
  1225. h2 = setTimeout(function() {
  1226. return p2(n3);
  1227. }, 3e3);
  1228. break;
  1229. }
  1230. h2 ? --ot : (d2.disconnect(), null != c2 && c2(o2));
  1231. }), h2 = setTimeout(function() {
  1232. return p2();
  1233. }, 3e3);
  1234. }, isEleInArray: function(e2, t2) {
  1235. return !(!e2 || e2 === document.documentElement) && (-1 !== t2.indexOf(e2) || this.isEleInArray(e2.parentElement, t2));
  1236. }, isInFirstScreen: function(e2) {
  1237. var t2, n2;
  1238. return !(!e2 || "function" != typeof e2.getBoundingClientRect) && (e2 = e2.getBoundingClientRect(), t2 = window.innerHeight, n2 = window.innerWidth, 0 <= e2.left) && e2.left < n2 && 0 <= e2.top && e2.top < t2 && 0 < e2.width && 0 < e2.height;
  1239. }, walkAndCount: function(e2) {
  1240. var t2 = 0;
  1241. if (e2 && 1 === e2.nodeType) {
  1242. t2 += 1;
  1243. var n2 = e2.children;
  1244. if (null != n2 && n2.length)
  1245. for (var o2 = 0; o2 < n2.length; o2++)
  1246. t2 += this.walkAndCount(n2[o2]);
  1247. }
  1248. return t2;
  1249. } });
  1250. function rt() {
  1251. $e = [], Ge = -1, b = null, ct(addEventListener);
  1252. }
  1253. function at(e2, t2) {
  1254. b || (b = t2, Ge = e2, Je = /* @__PURE__ */ new Date(), ct(removeEventListener), st());
  1255. }
  1256. function st() {
  1257. var t2;
  1258. 0 <= Ge && Ge < Je - Ke && (t2 = { entryType: "first-input", name: b.type, target: b.target, cancelable: b.cancelable, startTime: b.timeStamp, processingStart: b.timeStamp + Ge }, $e.forEach(function(e2) {
  1259. e2(t2);
  1260. }), $e = []);
  1261. }
  1262. function ct(t2) {
  1263. ["mousedown", "keydown", "touchstart", "pointerdown"].forEach(function(e2) {
  1264. return t2(e2, Qe, S);
  1265. });
  1266. }
  1267. S = { passive: true, capture: true }, Ke = /* @__PURE__ */ new Date(), Qe = function(e2) {
  1268. var t2, n2, o2, i2;
  1269. function r2() {
  1270. at(n2, o2), i2();
  1271. }
  1272. function a2() {
  1273. i2();
  1274. }
  1275. e2.cancelable && (t2 = (1e12 < e2.timeStamp ? /* @__PURE__ */ new Date() : performance.now()) - e2.timeStamp, "pointerdown" == e2.type ? (n2 = t2, o2 = e2, i2 = function() {
  1276. removeEventListener("pointerup", r2, S), removeEventListener("pointercancel", a2, S);
  1277. }, addEventListener("pointerup", r2, S), addEventListener("pointercancel", a2, S)) : at(t2, e2));
  1278. }, Ye = "hidden" === document.visibilityState ? 0 : 1 / 0, addEventListener("visibilitychange", function e2(t2) {
  1279. "hidden" === document.visibilityState && (Ye = t2.timeStamp, removeEventListener("visibilitychange", e2, true));
  1280. }, true), rt(), self.webVitals = { firstInputPolyfill: function(e2) {
  1281. $e.push(e2), st();
  1282. }, resetFirstInputPolyfill: rt, get firstHiddenTime() {
  1283. return Ye;
  1284. } };
  1285. function I(e2, t2) {
  1286. return { name: e2, value: void 0 === t2 ? -1 : t2, delta: 0, entries: [], id: "v1-".concat(Date.now(), "-").concat(Math.floor(8999999999999 * Math.random()) + 1e12) };
  1287. }
  1288. function ut(e2, t2) {
  1289. try {
  1290. var n2;
  1291. if (PerformanceObserver.supportedEntryTypes.includes(e2)) {
  1292. if ("first-input" !== e2 || "PerformanceEventTiming" in self)
  1293. return (n2 = new PerformanceObserver(function(e3) {
  1294. return e3.getEntries().map(t2);
  1295. })).observe({ type: e2, buffered: true }), n2;
  1296. }
  1297. } catch (e3) {
  1298. }
  1299. }
  1300. function lt(t2) {
  1301. addEventListener("pageshow", function(e2) {
  1302. e2.persisted && t2(e2);
  1303. }, true);
  1304. }
  1305. function A(e2, t2, n2) {
  1306. var o2;
  1307. return function() {
  1308. 0 <= t2.value && (n2 || N.has(t2) || "hidden" === document.visibilityState) && (t2.delta = t2.value - (o2 || 0), t2.delta || void 0 === o2) && (o2 = t2.value, e2(t2));
  1309. };
  1310. }
  1311. function ft() {
  1312. vt(function(e2) {
  1313. e2 = e2.timeStamp;
  1314. yt = e2;
  1315. }, true);
  1316. }
  1317. function dt() {
  1318. return yt < 0 && ((yt = self.webVitals.firstHiddenTime) === 1 / 0 && ft(), lt(function() {
  1319. setTimeout(function() {
  1320. yt = "hidden" === document.visibilityState ? 0 : 1 / 0, ft();
  1321. }, 0);
  1322. })), { get timeStamp() {
  1323. return yt;
  1324. } };
  1325. }
  1326. function pt(e2) {
  1327. var t2 = e2.name;
  1328. 0 < (e2 = e2.value) && (wt[t2] = e2);
  1329. }
  1330. function ht(e2, h2) {
  1331. function g2(e3) {
  1332. b2 = e3;
  1333. }
  1334. function m2(e3) {
  1335. y2 = y2.concat(e3);
  1336. }
  1337. function v2(e3, t2) {
  1338. w2 = { conds: e3 = void 0 === e3 ? {} : e3, params: t2 = void 0 === t2 ? {} : t2 };
  1339. }
  1340. var y2 = [], w2 = null, b2 = null;
  1341. q.useAsyncPlugin(e2, { exportsConstructor: "Flog", onAegisInit: function(e3) {
  1342. e3.lifeCycle.on("beforeWrite", m2), e3.lifeCycle.on("uploadLogs", v2), e3.lifeCycle.on("onConfigChange", g2);
  1343. }, onAegisInitAndPluginLoaded: function(o2, e3) {
  1344. var t2, n2, i2, r2, a2, s2, c2 = h2.dbConfig, c2 = void 0 === c2 ? {} : c2, u2 = h2.url, u2 = void 0 === u2 ? q.urls.aegisCollect : u2, l2 = h2.offlineLogExp, l2 = void 0 === l2 ? 3 : l2, f2 = h2.id, d2 = h2.uin, u2 = (null != (t2 = o2.lifeCycle) && t2.remove("beforeWrite", m2), null != (t2 = o2.lifeCycle) && t2.remove("uploadLogs", v2), null != (t2 = o2.lifeCycle) && t2.remove("onConfigChange", g2), Object.assign({ lookupUrl: u2 + "/offlineAuto?id=" + f2, preservedDay: l2, id: f2, uin: d2, aid: (null == (t2 = o2.bean) ? void 0 : t2.aid) || "", beforeRequest: o2.config.beforeRequest, afterRequest: o2.config.afterRequest }, c2, { sessionId: q.sessionID }));
  1345. try {
  1346. var p2 = new e3(u2);
  1347. y2.forEach(function(e4) {
  1348. p2.add(E(E({}, e4), { level: e4.level === L.INFO_ALL ? L.INFO : e4.level }));
  1349. }), null != (n2 = o2.lifeCycle) && n2.on("beforeWrite", function(e4) {
  1350. (e4 = void 0 === e4 ? [] : e4).forEach(function(e5) {
  1351. p2.add(E(E({}, e5), { level: e5.level === L.INFO_ALL ? L.INFO : e5.level }));
  1352. });
  1353. }), null != (i2 = o2.lifeCycle) && i2.on("uploadLogs", function(e4, t3) {
  1354. var n3;
  1355. void 0 === e4 && (e4 = {}), void 0 === t3 && (t3 = {}), p2.uploadLogs(Object.assign({ id: h2.id, uin: h2.uin, aid: null == (n3 = o2.bean) ? void 0 : n3.aid }, e4), t3);
  1356. }), null != (r2 = o2.lifeCycle) && r2.on("onConfigChange", function(e4) {
  1357. p2.setConfig(e4);
  1358. }), null != (a2 = o2.lifeCycle) && a2.on("destroy", function() {
  1359. 0 === Rt.countInstance() && (y2.length = 0, "function" == typeof ((w2 = null) == p2 ? void 0 : p2.destroy)) && p2.destroy();
  1360. }), p2.on("PERREVENT", function(e4) {
  1361. o2.sendPipeline([function(e5, t3) {
  1362. n3 = { msg: O(e5), level: L.INFO };
  1363. var n3 = (n3 = Array.isArray(n3) ? n3 : [n3]).map(function(t4, n4) {
  1364. return Object.getOwnPropertyNames(t4).map(function(e6) {
  1365. return D(e6) + "[" + n4 + "]=" + (void 0 === t4[e6] ? "" : D(t4[e6]));
  1366. }).join("&");
  1367. }).join("&") + (n3.length ? "&count=" + n3.length : "");
  1368. t3({ type: R.OFFLINE, data: n3, contentType: "application/x-www-form-urlencoded", method: "post", addBean: false, url: h2.url + "?id=893&sessionId=" + q.sessionID + "&uin=" + h2.uin + "&from=" + h2.id + "&count=1&version=1.37.5", log: e5 });
  1369. }], R.OFFLINE)(e4);
  1370. }), b2 && (p2.setConfig(b2), b2 = null), w2 && (null != (s2 = o2.lifeCycle) && s2.emit("uploadLogs", w2.conds, w2.params), w2 = null), o2.flog = p2;
  1371. } catch (o3) {
  1372. console.log(o3);
  1373. }
  1374. } });
  1375. }
  1376. var gt, mt, vt = function(t2, n2) {
  1377. function o2(e2) {
  1378. "pagehide" !== e2.type && "hidden" !== document.visibilityState || (t2(e2), n2 && (removeEventListener("visibilitychange", o2, true), removeEventListener("pagehide", o2, true)));
  1379. }
  1380. addEventListener("visibilitychange", o2, true), addEventListener("pagehide", o2, true);
  1381. }, N = new ("function" == typeof WeakSet ? WeakSet : Set)(), yt = -1, wt = (new i({ name: "webVitals" }), { FCP: -1, LCP: -1, FID: -1, CLS: -1 }), bt = new i({ name: "webVitals", onNewAegis: function(e2) {
  1382. if (re() && "function" == typeof window.PerformanceObserver && "function" == typeof performance.getEntriesByName)
  1383. try {
  1384. v2 = pt, w2 = dt(), b2 = I("FCP"), E2 = performance.getEntriesByName("first-contentful-paint")[0], R2 = E2 ? null : ut("paint", T2), (E2 || R2) && (y2 = A(v2, b2, void 0), E2 && T2(E2), lt(function(e3) {
  1385. b2 = I("FCP"), y2 = A(v2, b2, void 0), requestAnimationFrame(function() {
  1386. requestAnimationFrame(function() {
  1387. b2.value = performance.now() - e3.timeStamp, N.add(b2), y2();
  1388. });
  1389. });
  1390. })), f2 = pt, h2 = dt(), g2 = I("LCP"), (m2 = ut("largest-contentful-paint", S2)) && (d2 = A(f2, g2, void 0), p2 = function() {
  1391. N.has(g2) || (m2.takeRecords().map(S2), m2.disconnect(), N.add(g2), d2());
  1392. }, ["keydown", "click"].forEach(function(e3) {
  1393. addEventListener(e3, p2, { once: true, capture: true });
  1394. }), vt(p2, true), lt(function(e3) {
  1395. g2 = I("LCP"), d2 = A(f2, g2, void 0), requestAnimationFrame(function() {
  1396. requestAnimationFrame(function() {
  1397. g2.value = performance.now() - e3.timeStamp, N.add(g2), d2();
  1398. });
  1399. });
  1400. })), a2 = pt, s2 = dt(), c2 = I("FID"), u2 = ut("first-input", O2), l2 = A(a2, c2, void 0), u2 && vt(function() {
  1401. u2.takeRecords().map(O2), u2.disconnect();
  1402. }, true), u2 || window.webVitals.firstInputPolyfill(O2), lt(function() {
  1403. c2 = I("FID"), l2 = A(a2, c2, void 0), window.webVitals.resetFirstInputPolyfill(), window.webVitals.firstInputPolyfill(O2);
  1404. }), n2 = pt, i2 = I("CLS", 0), (r2 = ut("layout-shift", t2)) && (o2 = A(n2, i2, void 0), vt(function() {
  1405. r2.takeRecords().map(t2), o2();
  1406. }), lt(function() {
  1407. i2 = I("CLS", 0), o2 = A(n2, i2, void 0);
  1408. })), ae(this.publish.bind(this, e2), true);
  1409. } catch (e3) {
  1410. }
  1411. function t2(e3) {
  1412. e3.hadRecentInput || (i2.value += e3.value, i2.entries.push(e3), o2());
  1413. }
  1414. var n2, o2, i2, r2, a2, s2, c2, u2, l2, f2, d2, p2, h2, g2, m2, v2, y2, w2, b2, E2, R2;
  1415. function O2(e3) {
  1416. e3.startTime < s2.timeStamp && (c2.value = e3.processingStart - e3.startTime, c2.entries.push(e3), N.add(c2), l2());
  1417. }
  1418. function S2(e3) {
  1419. var t3 = e3.startTime;
  1420. t3 < h2.timeStamp && (g2.value = t3, g2.entries.push(e3)), d2();
  1421. }
  1422. function T2(e3) {
  1423. "first-contentful-paint" === e3.name && (R2 && R2.disconnect(), e3.startTime < w2.timeStamp) && (b2.value = e3.startTime, b2.entries.push(e3), N.add(b2), y2());
  1424. }
  1425. }, publish: function(t2) {
  1426. this.$walk(function(r2) {
  1427. var e2;
  1428. r2 === t2 && null != (e2 = r2.sendPipeline) && e2.call(r2, [function(e3, t3) {
  1429. var n2, o2 = [];
  1430. for (n2 in e3)
  1431. o2.push(n2 + "=" + e3[n2]);
  1432. var i2 = -1 === (null == (i2 = null == (i2 = r2.config) ? void 0 : i2.performanceUrl) ? void 0 : i2.indexOf("?")) ? "?" : "&";
  1433. t3({ url: r2.config.webVitalsUrl + i2 + o2.join("&"), type: R.VITALS, log: e3, sendBeacon: true });
  1434. }], R.VITALS)(wt);
  1435. });
  1436. }, destroy: function() {
  1437. this.option.publish = function() {
  1438. };
  1439. } }), Et = 0, q = (B(mt = U, o = gt = o), mt.prototype = null === o ? Object.create(o) : (Tt.prototype = o.prototype, new Tt()), U.prototype.getBean = function(t2) {
  1440. var n2 = this;
  1441. return void 0 === t2 && (t2 = []), "" + Object.getOwnPropertyNames(this.bean).filter(function(e2) {
  1442. return -1 === t2.indexOf(e2);
  1443. }).map(function(e2) {
  1444. return "from" === e2 ? "from=" + n2.getCurrentPageUrl() : e2 + "=" + n2.bean[e2];
  1445. }).join("&");
  1446. }, U.prototype.getCurrentPageUrl = function() {
  1447. var e2 = this.config.pageUrl || location.href, e2 = (e2 = "function" == typeof this.config.urlHandler ? this.config.urlHandler() : e2).slice(0, 2048);
  1448. return encodeURIComponent(e2);
  1449. }, U.prototype.ready = function() {
  1450. function r2() {
  1451. var e2, n2, o2, i2;
  1452. t2.reportRequestQueue.length && (e2 = t2.reportRequestQueue.splice(0, 1)[0], n2 = e2.options, o2 = e2.success, i2 = e2.fail, t2.$request(n2, function() {
  1453. for (var e3 = [], t3 = 0; t3 < arguments.length; t3++)
  1454. e3[t3] = arguments[t3];
  1455. try {
  1456. return null == o2 ? void 0 : o2.apply(n2, e3);
  1457. } finally {
  1458. r2();
  1459. }
  1460. }, function() {
  1461. for (var e3 = [], t3 = 0; t3 < arguments.length; t3++)
  1462. e3[t3] = arguments[t3];
  1463. try {
  1464. return null == i2 ? void 0 : i2.apply(n2, e3);
  1465. } finally {
  1466. r2();
  1467. }
  1468. }));
  1469. }
  1470. var t2 = this;
  1471. r2(), this.isReportReady = true;
  1472. }, U.prototype.request = function(e2, t2, n2) {
  1473. this.config.reportImmediately || this.isReportReady ? this.$request(e2, t2, n2) : this.reportRequestQueue.push({ options: e2, success: t2, fail: n2 });
  1474. }, U.prototype.$request = function(e2, t2, n2) {
  1475. var o2, i2, r2, a2;
  1476. if (e2 && "string" == typeof e2.url && "" !== e2.url && this.bean.id)
  1477. return a2 = e2.url, false !== e2.addBean && (a2 = a2 + (-1 === a2.indexOf("?") ? "?" : "&") + this.getBean(e2.beanFilter)), e2.url = a2, a2 = e2.method || "get", (e2 = (i2 = this.config.onBeforeRequest) ? i2(e2, this) : e2) ? e2.url ? void ((null != e2 && e2.sendBeacon || this.sendNow) && "function" == typeof (null === navigator || void 0 === navigator ? void 0 : navigator.sendBeacon) ? navigator.sendBeacon(e2.url, e2.data) : ((o2 = new XMLHttpRequest()).sendByAegis = true, o2.addEventListener("readystatechange", function() {
  1478. 4 === o2.readyState && (400 <= o2.status || 0 === o2.status ? null != n2 && n2(o2.response) : null != t2 && t2(o2.response));
  1479. }), "get" === a2.toLocaleLowerCase() ? (o2.open("get", (i2 = e2.url, r2 = e2.data, "string" != typeof i2 ? "" : "object" == typeof r2 && r2 ? (a2 = Object.getOwnPropertyNames(r2).map(function(e3) {
  1480. var t3 = r2[e3];
  1481. return e3 + "=" + ("string" == typeof t3 ? encodeURIComponent(t3) : encodeURIComponent(JSON.stringify(t3)));
  1482. }).join("&").replace(/eval/gi, "evaI"), i2 + (-1 === i2.indexOf("?") ? "?" : "&") + a2) : i2)), o2.send()) : (o2.open("post", e2.url), e2.contentType && o2.setRequestHeader("Content-Type", e2.contentType), "string" == typeof e2.data && (e2.data = e2.data.replace(/eval/gi, "evaI")), o2.send(e2.data)))) : console.warn("Please handle the parameters reasonably, options.url is necessary") : console.warn("Sending request blocked");
  1483. }, U.useAsyncPlugin = function(a2, e2) {
  1484. var t2 = (e2 = void 0 === e2 ? {} : e2).exportsConstructor, s2 = void 0 === t2 ? "aegis-plugin-" + Et : t2, t2 = e2.onAegisInit, c2 = void 0 === t2 ? function() {
  1485. } : t2, t2 = e2.onAegisInitAndPluginLoaded, u2 = void 0 === t2 ? function() {
  1486. } : t2;
  1487. if (Et += 1, "string" != typeof a2)
  1488. throw new TypeError("useAsyncPlugin first param must be string");
  1489. if ("function" != typeof c2 || "function" != typeof u2)
  1490. throw new TypeError("onAegisInit and onAegisInitAndPluginLoaded must be function");
  1491. this.use(new i({ name: "asyncPlugin", onNewAegis: function(t3) {
  1492. try {
  1493. c2(t3), U.asyncPlugin[a2] ? u2(t3, window[U.asyncPlugin[a2]]) : (e3 = a2, n2 = s2, o2 = function(e4) {
  1494. e4 || (U.asyncPlugin[a2] = s2, e4 = window[s2], u2(t3, e4));
  1495. }, i2 = document.createElement("script"), r2 = document.head, "function" == typeof n2 && (o2 = n2, n2 = ""), i2.src = e3, i2.setAttribute("name", n2), i2.name = n2, i2.setAttribute("crossorigin", "anonymous"), i2.crossorigin = "anonymous", i2.defer = true, i2.hasLoaded = false, i2.onreadystatechange = function() {
  1496. i2.hasLoaded || i2.readyState && "loaded" !== i2.readyState && "complete" !== i2.readyState || (i2.hasLoaded = true, "function" == typeof o2 && o2(false), setTimeout(function() {
  1497. r2.contains(i2) && r2.removeChild(i2);
  1498. }));
  1499. }, i2.onload = i2.onreadystatechange, i2.onerror = function() {
  1500. "function" == typeof o2 && o2(true), setTimeout(function() {
  1501. r2.contains(i2) && r2.removeChild(i2);
  1502. });
  1503. }, "complete" === document.readyState ? r2.appendChild(i2) : window.addEventListener("load", function() {
  1504. r2.appendChild(i2);
  1505. }));
  1506. } catch (e4) {
  1507. console.log("error on below is caused by " + a2 + " "), console.error(e4);
  1508. }
  1509. var e3, n2, o2, i2, r2;
  1510. } }));
  1511. }, U.prototype.publishPluginsLogs = function() {
  1512. var e2 = U.installedPlugins.find(function(e3) {
  1513. return "reportAssetSpeed" === e3.name;
  1514. });
  1515. null != e2 && e2.option.collectNotReportedLog(this);
  1516. }, U.prototype.uploadLogs = function(e2, t2) {
  1517. var n2;
  1518. void 0 === e2 && (e2 = {}), void 0 === t2 && (t2 = {}), null != (n2 = this.lifeCycle) && n2.emit("uploadLogs", e2, t2);
  1519. }, U.sessionID = "session-" + Date.now(), U.asyncPlugin = {}, U.urls = { aegisCollect: "https://aegis.qq.com/collect", flog: "https://cdn-go.cn/vasdev/web_webpersistance_v2/v1.8.2/flog.core.min.js" }, U), Rt = new i({ name: "offlineLog" }), o = Rt = new i({ name: "offlineLog", onNewAegis: function(e2) {
  1520. ht(q.urls.flog, e2.config);
  1521. } }), Ot = (new i({ name: "spa" }), ["replaceState", "pushState", "popstate", "hashchange"]), St = new i({ name: "spa", originFireUrl: "", onNewAegis: function(t2) {
  1522. var n2 = this;
  1523. history.pushState = this.wr("pushState") || history.pushState, history.replaceState = this.wr("replaceState") || history.replaceState, this.sendPv = this.sendPv.bind(this), t2.config.spa && this.sendPv(t2), Ot.forEach(function(e2) {
  1524. return window.addEventListener(e2, function() {
  1525. return n2.sendPv.call(n2, t2);
  1526. });
  1527. });
  1528. }, wr: function(n2) {
  1529. var o2 = history[n2], e2 = "__" + n2 + "__hasWrittenByTamSpa";
  1530. return "function" == typeof o2 && !history[e2] && (Object.defineProperty(history, e2, { value: true, enumerable: false }), function() {
  1531. var e3 = o2.apply(this, arguments), t2 = null;
  1532. return "function" == typeof Event ? t2 = new Event(n2) : (t2 = document.createEvent("HTMLEvents")).initEvent(n2, false, true), window.dispatchEvent(t2), e3;
  1533. });
  1534. }, sendPv: function(i2) {
  1535. var r2 = this;
  1536. setTimeout(function() {
  1537. var o2 = location.href, t2 = location.pathname + location.hash + i2.config.id;
  1538. r2.$walk(function(e2) {
  1539. var n2;
  1540. e2 === i2 && (n2 = e2.config.pvUrl) && t2 && t2 !== r2.originFireUrl && (e2.sendPipeline([function(e3, t3) {
  1541. t3({ url: n2 + "?from=" + encodeURIComponent(o2), beanFilter: ["from"], type: R.PV });
  1542. }], R.PV)(null), r2.originFireUrl = t2);
  1543. });
  1544. }, 0);
  1545. }, destroy: function() {
  1546. this.option.sendPv = function() {
  1547. };
  1548. } });
  1549. function U(e2) {
  1550. var t2, n2, o2, a2, s2 = gt.call(this, e2) || this;
  1551. s2.sendNow = false, s2.isReportReady = false, s2.reportRequestQueue = [], s2.speedLogPipeline = m([Z(s2), (a2 = s2.config, function(e3, t3) {
  1552. var n3, o3, i2, r2 = "number" == typeof a2.repeat ? a2.repeat : 60;
  1553. !a2.speedSample || r2 <= 0 ? t3(e3) : (n3 = (null == a2 ? void 0 : a2.id) || "0", o3 = y[n3] || {}, Array.isArray(e3) ? (i2 = e3.filter(function(e4) {
  1554. var t4 = !o3[e4.url] || o3[e4.url] < r2;
  1555. return t4 ? (o3[e4.url] = 1 + ~~o3[e4.url], y[n3] = o3) : v[n3] || ye(n3), t4;
  1556. })).length && t3(i2) : !o3[e3.url] || o3[e3.url] < r2 ? (o3[e3.url] = 1 + ~~o3[e3.url], y[n3] = o3, t3(e3)) : v[n3] || ye(n3));
  1557. }), (o2 = s2, function(t3, n3) {
  1558. ze(function(e3) {
  1559. o2.extendBean("netType", e3), n3(t3);
  1560. });
  1561. }), function(e3, t3) {
  1562. null != (n3 = s2.lifeCycle) && n3.emit("beforeReportSpeed", e3);
  1563. var n3, o3 = s2.config.beforeReportSpeed;
  1564. if ((e3 = "function" == typeof o3 ? e3.filter(function(e4) {
  1565. return false !== o3(e4);
  1566. }) : e3).length)
  1567. return t3(e3);
  1568. }, function(e3, t3) {
  1569. t3(e3.map(function(e4) {
  1570. return void 0 !== e4.payload && delete e4.payload, e4;
  1571. }));
  1572. }, function(e3) {
  1573. return s2.sendPipeline([function(e4, t3) {
  1574. var n3, o3, i2, r2;
  1575. t3({ type: R.SPEED, url: "" + s2.config.speedUrl, method: "post", data: (t3 = e4, n3 = E(E({}, s2.bean), { from: s2.getCurrentPageUrl() }), i2 = { fetch: [], static: [], bridge: [] }, r2 = new FormData(), Array.isArray(t3) ? t3.forEach(function(e5) {
  1576. var t4 = Oe(e5);
  1577. i2[e5.type].push(t4);
  1578. }) : (o3 = Oe(t3), i2[t3.type].push(o3)), r2.append("payload", fe(E({ duration: i2 }, n3))), r2), log: e4 });
  1579. }], R.SPEED)(e3);
  1580. }]), e2.asyncPlugin = true;
  1581. try {
  1582. "undefined" != typeof document && (e2.uin = e2.uin || (null != (t2 = document.cookie.match(/\buin=\D+(\d*)/)) ? t2 : [])[1] || (null != (n2 = document.cookie.match(/\bilive_uin=\D*(\d+)/)) ? n2 : [])[1] || ""), s2.init(e2), s2.extendBean("sessionId", U.sessionID), s2.extendBean("from", s2.getCurrentPageUrl()), "undefined" != typeof document && s2.extendBean("referer", encodeURIComponent(document.referrer || "")), e2.ext1 && s2.extendBean("ext1", encodeURIComponent(e2.ext1)), e2.ext2 && s2.extendBean("ext2", encodeURIComponent(e2.ext2)), e2.ext3 && s2.extendBean("ext3", encodeURIComponent(e2.ext3));
  1583. } catch (e3) {
  1584. console.warn(e3), console.log("%cThe above error occurred in the process of initializing Aegis, which will affect your normal use of Aegis.\nIt is recommended that you contact us for feedback and thank you for your support.", "color: red"), s2.sendSDKError(e3);
  1585. }
  1586. return s2;
  1587. }
  1588. function Tt() {
  1589. this.constructor = mt;
  1590. }
  1591. new i({ name: "ie" }), new i({ name: "onClose" });
  1592. var Pt = new i({ name: "onClose", onNewAegis: function(n2) {
  1593. var o2, i2 = this;
  1594. r.desktop() ? (o2 = window.onunload, window.onunload = function() {
  1595. for (var e2 = [], t2 = 0; t2 < arguments.length; t2++)
  1596. e2[t2] = arguments[t2];
  1597. i2.publishNotReportedLog(n2), null != o2 && o2.call.apply(o2, u([window], e2));
  1598. }) : ae(this.publishNotReportedLog.bind(this, n2), true);
  1599. }, publishNotReportedLog: function(t2) {
  1600. var n2 = this;
  1601. this.$walk(function(e2) {
  1602. e2 === t2 && (e2.sendNow = true, e2.publishPluginsLogs(), n2.publishThrottlePipeLogs(e2));
  1603. });
  1604. }, publishThrottlePipeLogs: function(e2) {
  1605. null != e2 && e2.speedLogPipeline([]), null != e2 && e2.eventPipeline([]), null != e2 && e2.customTimePipeline([]), null != e2 && e2.normalLogPipeline([]);
  1606. } });
  1607. return new i({ name: "aid" }), q.use(nt), q.use(We), q.use(Te), q.use(it), q.use(bt), q.use(Re), q.use(T), q.use(o), q.use(St), q.use(Pt), q.use(Xe), q;
  1608. });
  1609. }
  1610. });
  1611. export default require_aegis_min();
  1612. //# sourceMappingURL=aegis-web-sdk.js.map