var __INLINE_SCRIPT__ = (function () {
?'use strict';
?function _arrayLikeToArray$2(arr, len) {
? ?if (len == null || len > arr.length) len = arr.length;
? ?for (var i = 0, arr2 = new Array(len); i > 1;
? ? ? ? ?count++;
? ? ? ? ?range.setEndAfter(leaves[mid]);
? ? ? ? ?setNewFrag(el, getFragmentHTML(range.cloneContents()));
? ? ? ? ?return needTextOverflow() ? findLastNode(start, mid) : findLastNode(mid, end);
? ? ? ?};
? ? ? ?var findLastCharIndex = function findLastCharIndex(start, end) {
? ? ? ? ?if (end - start > 1;
? ? ? ? ?count++;
? ? ? ? ?range.setEnd(lastNode, mid);
? ? ? ? ?setNewFrag(el, getFragmentHTML(range.cloneContents()));
? ? ? ? ?return needTextOverflow() ? findLastCharIndex(start, mid) : findLastCharIndex(mid, end);
? ? ? ?};
? ? ? ?var dom = document.createElement('div');
? ? ? ?dom.innerHTML = text;
? ? ? ?var leaves = getLeaf(dom);
? ? ? ?var range = document.createRange();
? ? ? ?range.setStartBefore(leaves[0]);
? ? ? ?var lastNodeIndex = findLastNode(0, leaves.length - 1);
? ? ? ?var lastNode = leaves[lastNodeIndex];
? ? ? ?findLastCharIndex(0, lastNode.textContent.length);
? ? ? ?((_b = binding.value) === null || _b === void 0 ? void 0 : _b.processExtraElement) && binding.value.processExtraElement(el.extraElement, el);
? ? ? ?console.log(count);
? ? ?} catch (error) {
? ? ? ?console.error(error);
? ? ?}
? ?}
?}
?function computeLineNum(el) {
? ?var computyStyle = getComputedStyle(el);
? ?return Math.round(el.offsetHeight / parseFloat(computyStyle.lineHeight));
?}
?function removeAllChild(el) {
? ?var childNodes = Array.from(el.childNodes);
? ?childNodes.forEach(function (child) {
? ? ?el.removeChild(child);
? ?});
?}
?function setNewFrag(el, frag) {
? ?removeAllChild(el);
? ?el.appendChild(frag);
?}
?
?
?var Device = {};
?function detect(ua) {
? ?var MQQBrowser = ua.match(/MQQBrowser\/(\d+\.\d+)/i);
? ?var MQQClient = ua.match(/QQ\/(\d+\.(\d+)\.(\d+)\.(\d+))/i) || ua.match(/V1_AND_SQ_([\d\.]+)/);
? ?var WeChat = ua.match(/MicroMessenger\/((\d+)\.(\d+))\.(\d+)/) || ua.match(/MicroMessenger\/((\d+)\.(\d+))/);
? ?var MacOS = ua.match(/Mac\sOS\sX\s(\d+[\.|_]\d+)/);
? ?var WinOS = ua.match(/Windows(\s+\w+)?\s+?(\d+\.\d+)/);
? ?var Linux = ua.match(/Linux\s/);
? ?var MiuiBrowser = ua.match(/MiuiBrowser\/(\d+\.\d+)/i);
? ?var M1 = ua.match(/MI-ONE/);
? ?var MIPAD = ua.match(/MI PAD/);
? ?var UC = ua.match(/UCBrowser\/(\d+\.\d+(\.\d+\.\d+)?)/) || ua.match(/\sUC\s/);
? ?var IEMobile = ua.match(/IEMobile(\/|\s+)(\d+\.\d+)/) || ua.match(/WPDesktop/);
? ?var ipod = ua.match(/(ipod).*\s([\d_]+)/i);
? ?var ipad = ua.match(/(ipad).*\s([\d_]+)/i);
? ?var iphone = ua.match(/(iphone)\sos\s([\d_]+)/i);
? ?var Chrome = ua.match(/Chrome\/(\d+\.\d+)/);
? ?var AndriodBrowser = ua.match(/Mozilla.*Linux.*Android.*AppleWebKit.*Mobile Safari/);
? ?var android = ua.match(/(android)\s([\d\.]+)/i);
? ?var harmony = ua.match(/(OpenHarmony)\s([\d\.]+)/i);
? ?Device.browser = Device.browser || {}, Device.os = Device.os || {};
? ?if (window.ActiveXObject) {
? ? ?var vie = 6;
? ? ?(window.XMLHttpRequest || ua.indexOf('MSIE 7.0') > -1) && (vie = 7);
? ? ?(window.XDomainRequest || ua.indexOf('Trident/4.0') > -1) && (vie = 8);
? ? ?ua.indexOf('Trident/5.0') > -1 && (vie = 9);
? ? ?ua.indexOf('Trident/6.0') > -1 && (vie = 10);
? ? ?Device.browser.ie = true, Device.browser.version = vie;
? ?} else if (ua.indexOf('Trident/7.0') > -1) {
? ? ?Device.browser.ie = true, Device.browser.version = 11;
? ?}
? ?if (android) {
? ? ?Device.os.android = true;
? ? ?Device.os.version = android[2];
? ?}
? ?if (harmony) {
? ? ?Device.os.harmony = true;
? ? ?Device.os.version = harmony[2];
? ?}
? ?if (ipod) {
? ? ?Device.os.ios = Device.os.ipod = true;
? ? ?Device.os.version = ipod[2].replace(/_/g, '.');
? ?}
? ?if (ipad) {
? ? ?Device.os.ios = Device.os.ipad = true;
? ? ?Device.os.version = ipad[2].replace(/_/g, '.');
? ?}
? ?if (iphone) {
? ? ?Device.os.iphone = Device.os.ios = true;
? ? ?Device.os.version = iphone[2].replace(/_/g, '.');
? ?}
? ?if (WinOS) Device.os.windows = true, Device.os.version = WinOS[2];
? ?if (MacOS) Device.os.Mac = true, Device.os.version = MacOS[1];
? ?if (Linux) Device.os.Linux = true;
? ?if (ua.indexOf('lepad_hls') > 0) Device.os.LePad = true;
? ?if (MIPAD) Device.os.MIPAD = true;
? ?if (MQQBrowser) Device.browser.MQQ = true, Device.browser.version = MQQBrowser[1];
? ?if (MQQClient) Device.browser.MQQClient = true, Device.browser.version = MQQClient[1];
? ?if (WeChat) Device.browser.WeChat = true, Device.browser.mmversion = Device.browser.version = WeChat[1];
? ?if (MiuiBrowser) Device.browser.MIUI = true, Device.browser.version = MiuiBrowser[1];
? ?if (UC) Device.browser.UC = true, Device.browser.version = UC[1] || NaN;
? ?if (IEMobile) Device.browser.IEMobile = true, Device.browser.version = IEMobile[2];
? ?if (AndriodBrowser) {
? ? ?Device.browser.AndriodBrowser = true;
? ?}
? ?if (M1) {
? ? ?Device.browser.M1 = true;
? ?}
? ?if (Chrome) {
? ? ?Device.browser.Chrome = true, Device.browser.version = Chrome[1];
? ?}
? ?if (Device.os.windows) {
? ? ?if (typeof navigator.platform !== "undefined" && navigator.platform.toLowerCase() == "win64") {
? ? ? ?Device.os.win64 = true;
? ? ?} else {
? ? ? ?Device.os.win64 = false;
? ? ?}
? ?}
? ?if (Device.os.Mac || Device.os.windows || Device.os.Linux) {
? ? ?Device.os.pc = true;
? ?}
? ?var osType = {
? ? ?iPad7: 'iPad; CPU OS 7',
? ? ?LePad: 'lepad_hls',
? ? ?XiaoMi: 'MI-ONE',
? ? ?SonyDTV: "SonyDTV",
? ? ?SamSung: 'SAMSUNG',
? ? ?HTC: 'HTC',
? ? ?VIVO: 'vivo'
? ?};
? ?for (var os in osType) {
? ? ?Device.os[os] = ua.indexOf(osType[os]) !== -1;
? ?}
? ?Device.os.phone = Device.os.phone || /windows phone/i.test(ua);
? ?Device.os.getNumVersion = function () {
? ? ?return parseFloat(Device.os.version);
? ?};
? ?Device.os.hasTouch = 'ontouchstart' in window;
? ?if (Device.os.hasTouch && Device.os.ios && Device.os.getNumVersion() = 3.0;
? ?};
? ?Device.browser.isCanOcx = function () {
? ? ?return !!Device.os.windows && (!!Device.browser.ie || Device.browser.isFFCanOcx() || !!Device.browser.webkit);
? ?};
? ?Device.browser.isNotIESupport = function () {
? ? ?return !!Device.os.windows && (!!Device.browser.webkit || Device.browser.isFFCanOcx());
? ?};
? ?Device.userAgent = {};
? ?Device.userAgent.browserVersion = Device.browser.version;
? ?Device.userAgent.osVersion = Device.os.version;
? ?Device.os.unifiedPC = ua.match(/UnifiedPC/);
? ?delete Device.userAgent.version;
?}
?detect(window.navigator.userAgent);
?function canSupportH5Video() {
? ?var ua = window.navigator.userAgent,
? ? ?m = null;
? ?if (!!Device.os.android) {
? ? ?if (Device.browser.MQQ && Device.browser.getNumVersion() >= 4.2) {
? ? ? ?return true;
? ? ?}
? ? ?if (ua.indexOf('MI2') != -1) {
? ? ? ?return true;
? ? ?}
? ? ?if (Device.os.version >= '4' && (m = ua.match(/MicroMessenger\/((\d+)\.(\d+))\.(\d+)/))) {
? ? ? ?if (parseFloat(m[1]) >= 4.2) {
? ? ? ? ?return true;
? ? ? ?}
? ? ?}
? ? ?if (Device.os.version >= '4.1') {
? ? ? ?return true;
? ? ?}
? ?}
? ?return false;
?}
?function canSupportVideoMp4() {
? ?var video = document.createElement('video');
? ?if (typeof video.canPlayType === 'function') {
? ? ?if (video.canPlayType('video/mp4; codecs="mp4v.20.8"') === 'probably') {
? ? ? ?return true;
? ? ?}
? ? ?if (video.canPlayType('video/mp4; codecs="avc1.42E01E"') === 'probably' || video.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"') === 'probably') {
? ? ? ?return true;
? ? ?}
? ?}
? ?return false;
?}
?function canSupportAutoPlay() {
? ?if (Device.os.ios && Device.os.getNumVersion() ?1 && arguments[1] !== undefined ? arguments[1] : 0;
? ?var canEqual = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
? ?var nowVersionStr = Device.os.version;
? ?if (!nowVersionStr) return false;
? ?var versionArr = version.split('.');
? ?var nowVersionArr = nowVersionStr.split('.');
? ?for (var i = 0; i ?0) return vi > nvi;
? ? ?if (cp = o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
?function _unsupportedIterableToArray$1(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray$1(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray$1(o, minLen); }
?function _arrayLikeToArray$1(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i ?b;
? ?}
?};
?function cpVersion(ver, op, canEq, type) {
? ?var mmver = false;
? ?switch (type) {
? ? ?case 'mac':
? ? ? ?mmver = getMac();
? ? ? ?break;
? ? ?case 'windows':
? ? ? ?mmver = getWindowsVersionFormat();
? ? ? ?break;
? ? ?case 'wxwork':
? ? ? ?mmver = getWxWork();
? ? ? ?break;
? ? ?case 'mpapp':
? ? ? ?mmver = getMpApp();
? ? ? ?break;
? ? ?case 'unifiedpc':
? ? ? ?mmver = getUnifiedPcVer();
? ? ? ?break;
? ? ?default:
? ? ? ?mmver = get();
? ? ? ?break;
? ?}
? ?if (!mmver) {
? ? ?return;
? ?}
? ?var mmversion = mmver.split('.');
? ?var version = ver.split('.');
? ?if (!/\d+/g.test(mmversion[mmversion.length - 1])) {
? ? ?mmversion.pop();
? ?}
? ?for (var i = 0, len = Math.max(mmversion.length, version.length); i = 64 && parseInt(v) = 13 && Device.os.getNumVersion() = o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
?function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
?function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i = hMin && h = sMin && s = bMin && b ?0.2) {
? ? ?return true;
? ?}
? ?if ((isHsbInRange(hbsBackgroundColor, 0, 360, 0, 20, 15, 85) || isHsbInRange(hbsBackgroundColor, 0, 360, 20, 100, 15, 100)) && hbsBackgroundColor[3] > 0.2) {
? ? ?return true;
? ?}
? ?return false;
?};
?var textToSpanFn = function textToSpanFn(text, startIdx, endIdx) {
? ?if (!text) {
? ? ?text = '';
? ?}
? ?var span = document.createElement('span');
? ?if (startIdx ?endIdx) return;
? ?var text = textNode.textContent;
? ?var textLen = calAccurateTextLen(text);
? ?if (startIdx > 0) {
? ? ?node.insertBefore(textToSpanFn(text, 0, startIdx - 1), textNode);
? ?}
? ?if (endIdx ?endIdx) break;
? ? ? ?var childNode = node.childNodes[i];
? ? ? ?if (!childNode) break;
? ? ? ?if (childNode.nodeType === Node.ELEMENT_NODE) {
? ? ? ? ?if (filterFn && filterFn(childNode, startIdx, endIdx)) {
? ? ? ? ? ?var textLen = calAccurateTextLen(childNode.innerText);
? ? ? ? ? ?if (startIdx ?1) {
? ? ? ? ? ?newNode = textToSpanFn(childNodeText, 0, _textLen - 1);
? ? ? ? ? ?node.replaceChild(newNode, childNode);
? ? ? ? ? ?childNode = newNode.childNodes[0];
? ? ? ? ?}
? ? ? ? ?if (startIdx >= 0 && endIdx ?_textLen - 1) {
? ? ? ? ? ?var _match = splitTextToSpan(newNode, childNode, startIdx, _textLen - 1);
? ? ? ? ? ?_match && selectedNodes.push(_match);
? ? ? ? ? ?if (startIdx = 0xD800 && str.charCodeAt(i) = 0xD800 && str.charCodeAt(_i) ?-1) {
? ? ? ?return true;
? ? ?}
? ?}
? ?if (opts.ignoreFlexChildren && ele.style.display === 'flex' || opts.ignoreNotWriteableChildren && (ele.getAttribute('contenteditable') === 'false' || ele.childNodes.length === 1 && ele.childNodes[0].getAttribute('contenteditable') === 'false')) {
? ? ?return true;
? ?}
? ?return canNotSplitEleTagName.indexOf(ele.tagName) > -1;
?}
?function isElement(node) {
? ?return node.nodeType === Node.ELEMENT_NODE;
?}
?function getParaListAllNodes(element, opts) {
? ?var childNodes = Array.from(element.childNodes);
? ?if (!childNodes.length) {
? ? ?return [];
? ?}
? ?var child;
? ?var paragraphList = [];
? ?for (var i = 0; i ".concat(jsapiName, " ").concat(opt.action || '', " ").concat(errMsg));
? ? ? ? ? ?typeof callback === 'function' && callback(ret);
? ? ? ? ?} catch (e) {
? ? ? ? ? ?window.WX_BJ_REPORT.BadJs.report('invoke', "callback ".concat(jsapiName, " error:"), {
? ? ? ? ? ? ?mid: 'mmbizwebapp:js_brridge',
? ? ? ? ? ? ?_info: e
? ? ? ? ? ?});
? ? ? ? ? ?console.error("[mpapp jsapi] ".concat(jsapiName, " ").concat(opt.action || ''), e, res);
? ? ? ? ?}
? ? ? ?});
? ? ?} catch (e) {
? ? ? ?window.WX_BJ_REPORT.BadJs.report('invoke', 'callback error:', {
? ? ? ? ?mid: 'mmbizwebapp:js_brridge',
? ? ? ? ?_info: e
? ? ? ?});
? ? ? ?console.error('[mpapp jsapi]', e);
? ? ?}
? ?});
?}
?var doc$1 = {};
?var isAcrossOrigin$1 = false;
?var __moon_report$1 = window.__moon_report || function () {};
?var MOON_JSAPI_KEY_OFFSET = 8;
?try {
? ?doc$1 = top.window.document;
?} catch (e) {
? ?isAcrossOrigin$1 = true;
?}
?if (!window.JSAPIEventCallbackMap) {
? ?window.JSAPIEventCallbackMap = {};
?}
?function ready(onBridgeReady) {
? ?var bridgeReady = function bridgeReady() {
? ? ?try {
? ? ? ?if (onBridgeReady) {
? ? ? ? ?window.onBridgeReadyTime = window.onBridgeReadyTime || Date.now();
? ? ? ? ?onBridgeReady();
? ? ? ?}
? ? ?} catch (e) {
? ? ? ?__moon_report$1([{
? ? ? ? ?offset: MOON_JSAPI_KEY_OFFSET,
? ? ? ? ?log: 'ready',
? ? ? ? ?e: e
? ? ? ?}]);
? ? ? ?throw e;
? ? ?}
? ? ?window.jsapiReadyTime = Date.now();
? ?};
? ?if (!isAcrossOrigin$1 && (typeof top.window.WeixinJSBridge === 'undefined' || !top.window.WeixinJSBridge.invoke)) {
? ? ?if (doc$1.addEventListener) {
? ? ? ?doc$1.addEventListener('WeixinJSBridgeReady', bridgeReady, false);
? ? ?} else if (doc$1.attachEvent) {
? ? ? ?doc$1.attachEvent('WeixinJSBridgeReady', bridgeReady);
? ? ? ?doc$1.attachEvent('onWeixinJSBridgeReady', bridgeReady);
? ? ?}
? ?} else {
? ? ?bridgeReady();
? ?}
?}
?function invoke(methodName, args, callback) {
? ?if (window.__second_open_wait_a8key__ && window.__second_open_wait_a8key_task__) {
? ? ?window.__second_open_wait_a8key_task__.push(function () {
? ? ? ?invoke(methodName, args, callback);
? ? ?});
? ? ?return;
? ?}
? ?ready(function () {
? ? ?if (isAcrossOrigin$1) return false;
? ? ?if (_typeof(top.window.WeixinJSBridge) !== 'object') {
? ? ? ?alert('請(qǐng)?jiān)谖⑿胖写蜷_(kāi)此鏈接');
? ? ? ?return false;
? ? ?}
? ? ?top.window.WeixinJSBridge.invoke(methodName, args, function () {
? ? ? ?try {
? ? ? ? ?for (var _len = arguments.length, rets = new Array(_len), _key = 0; _key ?".concat(ret.err_msg) : '';
? ? ? ? ?console.info('[system]', "[jsapi] invoke->".concat(methodName).concat(errMsg));
? ? ? ? ?if (callback) {
? ? ? ? ? ?callback.apply(window, rets);
? ? ? ? ?}
? ? ? ?} catch (e) {
? ? ? ? ?__moon_report$1([{
? ? ? ? ? ?offset: MOON_JSAPI_KEY_OFFSET,
? ? ? ? ? ?log: "invoke;methodName:".concat(methodName),
? ? ? ? ? ?e: e
? ? ? ? ?}]);
? ? ? ? ?throw e;
? ? ? ?}
? ? ?});
? ?});
?}
?function call(methodName) {
? ?if (window.__second_open_wait_a8key__ && window.__second_open_wait_a8key_task__) {
? ? ?window.__second_open_wait_a8key_task__.push(function () {
? ? ? ?call(methodName);
? ? ?});
? ? ?return;
? ?}
? ?ready(function () {
? ? ?if (isAcrossOrigin$1) return false;
? ? ?if (_typeof(top.window.WeixinJSBridge) !== 'object') {
? ? ? ?return false;
? ? ?}
? ? ?try {
? ? ? ?top.window.WeixinJSBridge.call(methodName);
? ? ?} catch (e) {
? ? ? ?__moon_report$1([{
? ? ? ? ?offset: MOON_JSAPI_KEY_OFFSET,
? ? ? ? ?log: "call;methodName:".concat(methodName),
? ? ? ? ?e: e
? ? ? ?}]);
? ? ? ?throw e;
? ? ?}
? ?});
?}
?function on(eventName, callback) {
? ?if (window.__second_open_wait_a8key__ && window.__second_open_wait_a8key_task__) {
? ? ?window.__second_open_wait_a8key_task__.push(function () {
? ? ? ?on(eventName, callback);
? ? ?});
? ? ?return;
? ?}
? ?ready(function () {
? ? ?if (isAcrossOrigin$1) return false;
? ? ?if (_typeof(top.window.WeixinJSBridge) !== 'object' || !top.window.WeixinJSBridge.on) {
? ? ? ?return false;
? ? ?}
? ? ?if (!window.JSAPIEventCallbackMap[eventName]) {
? ? ? ?window.JSAPIEventCallbackMap[eventName] = [];
? ? ?}
? ? ?window.JSAPIEventCallbackMap[eventName].push(callback);
? ? ?if (window.JSAPIEventCallbackMap[eventName].length > 1) {
? ? ? ?return false;
? ? ?}
? ? ?top.window.WeixinJSBridge.on(eventName, function () {
? ? ? ?try {
? ? ? ? ?for (var _len2 = arguments.length, rets = new Array(_len2), _key2 = 0; _key2 ?".concat(ret.err_msg) : '';
? ? ? ? ?console.info('[system]', "[jsapi] event->".concat(eventName).concat(errMsg));
? ? ? ? ?if (window.JSAPIEventCallbackMap[eventName] && window.JSAPIEventCallbackMap[eventName].length) {
? ? ? ? ? ?var result;
? ? ? ? ? ?for (var i = 0; i = 0; i--) {
? ? ? ?if (window.JSAPIEventCallbackMap[eventName][i] === callback) {
? ? ? ? ?window.JSAPIEventCallbackMap[eventName].splice(i, 1);
? ? ? ? ?result = true;
? ? ? ?}
? ? ?}
? ? ?return result;
? ?});
?}
?var JSAPI = {
? ?ready: ready,
? ?invoke: invoke,
? ?call: call,
? ?on: on,
? ?remove: remove
?};
?
?
?var reportLogs = [];
?var reportExtraLogs = [];
?var sendUrl = '/mp/jsmonitor?#wechat_redirect';
?var monitor = {};
?monitor._reportOptions = {
? ?idkey: {}
?};
?function ObjWithoutProperty(source, exclude) {
? ?if (source === null) return {};
? ?var target = {};
? ?var sourceKeys = Object.keys(source);
? ?for (var i = 0; i = 0) continue;
? ? ?target[key] = source[key];
? ?}
? ?return target;
?}
?function formatDataToString(data) {
? ?var reportData = [];
? ?for (var key in data) {
? ? ?if (Object.prototype.hasOwnProperty.call(data, key)) {
? ? ? ?reportData.push(key + '=' + encodeURIComponent(data[key]));
? ? ?}
? ?}
? ?return reportData.join('&');
?}
?monitor.getReportData = function (opt) {
? ?opt = opt || {};
? ?var idkey = monitor._reportOptions.idkey || {};
? ?var key = null;
? ?var reportData = {};
? ?var nextKey;
? ?try {
? ? ?for (key in idkey) {
? ? ? ?if (Object.prototype.hasOwnProperty.call(idkey, key) && idkey[key]) {
? ? ? ? ?reportLogs.push(key + '_' + idkey[key]);
? ? ? ?}
? ? ?}
? ?} catch (e) {
? ? ?return false;
? ?}
? ?if (reportLogs.length === 0) {
? ? ?return false;
? ?}
? ?if (reportExtraLogs.length) {
? ? ?reportData.lc = reportExtraLogs.length;
? ? ?reportExtraLogs.forEach(function (extraLog, index) {
? ? ? ?reportData["log".concat(index)] = extraLog;
? ? ?});
? ?}
? ?try {
? ? ?var reportOptions = monitor._reportOptions;
? ? ?if (reportOptions !== null && reportOptions !== undefined) {
? ? ? ?for (nextKey in reportOptions) {
? ? ? ? ?if (Object.prototype.hasOwnProperty.call(reportOptions, nextKey)) {
? ? ? ? ? ?reportData[nextKey] = reportOptions[nextKey];
? ? ? ? ?}
? ? ? ?}
? ? ?}
? ?} catch (e) {
? ? ?reportData = {};
? ?}
? ?reportData.idkey = reportLogs.join(';');
? ?reportData.t = Math.random();
? ?if (opt.remove !== false) {
? ? ?reportLogs = [];
? ? ?reportExtraLogs = [];
? ? ?monitor._reportOptions = {
? ? ? ?idkey: {}
? ? ?};
? ?}
? ?return reportData;
?};
?monitor.setLogs = function (opt) {
? ?var id = opt.id;
? ?var key = opt.key;
? ?var value = opt.value;
? ?var extraLog = opt.log;
? ?var others = ObjWithoutProperty(opt, ['id', 'key', 'value', 'log']);
? ?var idkey = monitor._reportOptions.idkey || {};
? ?var param = id + '_' + key;
? ?if (idkey[param]) {
? ? ?idkey[param] += value;
? ?} else {
? ? ?idkey[param] = value;
? ?}
? ?monitor._reportOptions.idkey = idkey;
? ?if (extraLog) {
? ? ?reportExtraLogs.push(extraLog);
? ?}
? ?try {
? ? ?if (others !== null && others !== undefined) {
? ? ? ?for (var otherKey in others) {
? ? ? ? ?if (Object.prototype.hasOwnProperty.call(others, otherKey)) {
? ? ? ? ? ?monitor._reportOptions[otherKey] = others[otherKey];
? ? ? ? ?}
? ? ? ?}
? ? ?}
? ?} catch (e) {
? ? ?console.log(e);
? ?}
? ?return monitor;
?};
?monitor.setAvg = function (id, key, value) {
? ?var idkey = monitor._reportOptions.idkey || {};
? ?var param1 = id + '_' + key;
? ?var param2 = id + '_' + (key - 1);
? ?if (idkey[param1]) {
? ? ?idkey[param1] += value;
? ?} else {
? ? ?idkey[param1] = value;
? ?}
? ?if (idkey[param2]) {
? ? ?idkey[param2] += 1;
? ?} else {
? ? ?idkey[param2] = 1;
? ?}
? ?monitor._reportOptions.idkey = idkey;
? ?return monitor;
?};
?monitor.setSum = function (id, key) {
? ?var value = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
? ?var idkey = monitor._reportOptions.idkey;
? ?var param = id + '_' + key;
? ?if (idkey[param]) {
? ? ?idkey[param] += value;
? ?} else {
? ? ?idkey[param] = value;
? ?}
? ?monitor._reportOptions.idkey = idkey;
? ?return monitor;
?};
?monitor.send = function (async, ajax, origin) {
? ?if (async !== false) {
? ? ?async = true;
? ?}
? ?var data = monitor.getReportData();
? ?origin = origin || '';
? ?if (!data) {
? ? ?return;
? ?}
? ?if (!!ajax && ajax instanceof Function) {
? ? ?ajax({
? ? ? ?url: origin + sendUrl,
? ? ? ?type: 'POST',
? ? ? ?mayAbort: true,
? ? ? ?data: data,
? ? ? ?async: async,
? ? ? ?timeout: 2000
? ? ?});
? ?} else {
? ? ?new Image().src = origin + '/mp/jsmonitor?' + formatDataToString(data) + '#wechat_redirect';
? ?}
?};
?if (typeof window !== 'undefined' && window.__monitor) {
? ?monitor = window.__monitor;
?} else {
? ?typeof window !== 'undefined' && (window.__monitor = monitor);
?}
?var monitor$1 = monitor;
?
?var logList = [];
?var log = function log(msg) {
? ?logList.push(msg);
?};
?var printLog = function printLog() {
? ?for (var i = 0, len = logList.length; i ?0) {
? ? ?query_str += (query_str !== "" ? "&" : "") + args_arr.join("&");
? ?}
? ?return ret.host + (query_str !== "" ? "?".concat(query_str) : "") + (ret.hash !== "" ? "#".concat(ret.hash) : "");
?}
?
?function addParam(url, param, value, forceReplace) {
? ?url = url || location.href;
? ?var firstAndPos = url.indexOf("&");
? ?var len = url.length;
? ?var reverseUrl = url.replace(/^[\w\d]+:[/\\]+/g, "").split("").reverse();
? ?if (!Array.prototype.indexOf) {
? ? ?Array.prototype.indexOf = function (searchElement, fromIndex) {
? ? ? ?var k;
? ? ? ?if (this == null) {
? ? ? ? ?throw new TypeError('"this" is null or not defined');
? ? ? ?}
? ? ? ?var O = Object(this);
? ? ? ?var len = O.length >>> 0;
? ? ? ?if (len === 0) {
? ? ? ? ?return -1;
? ? ? ?}
? ? ? ?var n = fromIndex || 0;
? ? ? ?if (Math.abs(n) === Infinity) {
? ? ? ? ?n = 0;
? ? ? ?}
? ? ? ?if (n >= len) {
? ? ? ? ?return -1;
? ? ? ?}
? ? ? ?k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
? ? ? ?while (k ?lastSlashPos) {
? ? ?url = url.replace("&", "?");
? ?}
? ?var reg = new RegExp("([\\?&]".concat(param, "=)[^]*"));
? ?if (!url.match(reg)) {
? ? ?var urlInfo = parseUrl(url);
? ? ?var hash = urlInfo.hash ? '#' + urlInfo.hash : '';
? ? ?url = url.replace(hash, '');
? ? ?var _pos = url.indexOf("?");
? ? ?if (_pos == -1) {
? ? ? ?return "".concat(url, "?").concat(param, "=").concat(value).concat(hash);
? ? ?}
? ? ?if (_pos == url.length - 1) {
? ? ? ?return "".concat(url + param, "=").concat(value).concat(hash);
? ? ?}
? ? ?return "".concat(url, "&").concat(param, "=").concat(value).concat(hash);
? ?}
? ?if (forceReplace === true) {
? ? ?return url.replace(reg, "$1".concat(value));
? ?}
? ?return url;
?}
?function addWxfrom(src, wxfrom) {
? ?var offset = window.service_type === 1 ? 10000 : 0;
? ?return addParam(src, 'wxfrom', offset + Number(wxfrom), true);
?}
?function removeParam(url, param) {
? ?var _URL = new URL(url),
? ? ?protocol = _URL.protocol,
? ? ?host = _URL.host,
? ? ?pathname = _URL.pathname,
? ? ?search = _URL.search,
? ? ?hash = _URL.hash;
? ?var queryParams = new URLSearchParams(search);
? ?queryParams["delete"](param);
? ?var newSearch = queryParams.toString();
? ?var newUrl = new URL("".concat(protocol, "http://").concat(host).concat(pathname).concat(newSearch ? "?".concat(decodeURIComponent(newSearch)) : "").concat(hash));
? ?return newUrl.toString();
?}
?function getQuery(name, url) {
? ?var u = url || window.location.search;
? ?var reg = new RegExp("(^|&)".concat(name, "=([^&]*)(&|$)"));
? ?var r = u.substring(u.indexOf('?') + 1).match(reg);
? ?return r !== null ? r[2] : '';
?}
?function encodeBase64(value) {
? ?try {
? ? ?return window.btoa(value);
? ?} catch (e) {
? ? ?return '';
? ?}
?}
?function decodeBase64(value) {
? ?try {
? ? ?return window.atob(value);
? ?} catch (e) {
? ? ?return '';
? ?}
?}
?function joinUrl(url) {
? ?var obj = {};
? ?if (typeof window.uin !== 'undefined') {
? ? ?obj.uin = window.uin;
? ?}
? ?if (typeof window.key !== 'undefined') {
? ? ?obj.key = window.key;
? ?}
? ?if (typeof window.pass_ticket !== 'undefined') {
? ? ?obj.pass_ticket = window.pass_ticket;
? ?}
? ?if (typeof window.wxtoken !== 'undefined') {
? ? ?obj.wxtoken = window.wxtoken;
? ?}
? ?if (typeof window.devicetype !== 'undefined') {
? ? ?obj.devicetype = window.devicetype;
? ?}
? ?if (typeof window.clientversion !== 'undefined') {
? ? ?obj.clientversion = window.clientversion || Mmversion.getInner();
? ?}
? ?obj.version = obj.clientversion;
? ?if (window.biz) {
? ? ?obj.__biz = window.biz;
? ?}
? ?if (getQuery('enterid')) {
? ? ?obj.enterid = getQuery('enterid');
? ?}
? ?if (typeof window.appmsg_token !== 'undefined') {
? ? ?obj.appmsg_token = window.appmsg_token;
? ?} else if (url.indexOf('advertisement_report') > -1) {
? ? ?new Image().src = "".concat(location.protocol, "http://mp.weixin.qq.com/mp/jsmonitor?idkey=68064_13_1&r=").concat(Math.random());
? ?}
? ?obj.x5 = navigator.userAgent.indexOf('TBS/') !== -1 ? '1' : '0';
? ?obj.f = 'json';
? ?return join(url, obj);
?}
?function getA8keyQuery(name, url) {
? ?return new Promise(function (resolve) {
? ? ?if (window.__second_open_wait_a8key__ && window.__second_open_wait_a8key_task__) {
? ? ? ?window.__second_open_wait_a8key_task__.push(function () {
? ? ? ? ?resolve(getQuery(name, url));
? ? ? ?});
? ? ?} else {
? ? ? ?resolve(getQuery(name, url));
? ? ?}
? ?});
?}
?var Url = {
? ?parseUrl: parseUrl,
? ?join: join,
? ?addParam: addParam,
? ?addWxfrom: addWxfrom,
? ?getQuery: getQuery,
? ?getA8keyQuery: getA8keyQuery,
? ?encodeBase64: encodeBase64,
? ?decodeBase64: decodeBase64,
? ?joinUrl: joinUrl,
? ?removeParam: removeParam
?};
?
?function _log(level, msg) {
? ?if (level === 'log') {
? ? ?level = 'info';
? ? ?msg = "[WechatFe]".concat(msg);
? ?} else {
? ? ?var prefix = "__wap__".concat(window.__second_open__ ? ' (sec)' : '');
? ? ?msg = "".concat(prefix, " ").concat(msg, " location:[").concat(location.href, "]");
? ?}
? ?msg += new Error().stack;
? ?if (Mmversion.isMpapp) {
? ? ?invoke$1('WNNativeCallbackLog', msg);
? ?} else if (Mmversion.isWechat) {
? ? ?if (Mmversion.isAndroid) {
? ? ? ?console.warn('[system]', "[MicroMsg.JsApiLog][".concat(level, "] jslog : ").concat(msg));
? ? ?} else if (Mmversion.isIOS) {
? ? ? ?JSAPI.invoke('writeLog', {
? ? ? ? ?level: level,
? ? ? ? ?msg: msg
? ? ? ?});
? ? ?} else {
? ? ? ?JSAPI.invoke('log', {
? ? ? ? ?level: level,
? ? ? ? ?msg: msg
? ? ? ?});
? ? ?}
? ?}
?}
?var Log = {
? ?info: function info() {
? ? ?for (var _len = arguments.length, args = new Array(_len), _key = 0; _key ', '<', ''];
? ?
? ?var replaceReverse = ['&', '&', '¥', '¥', '', '>', ' ', '?', '"', '"', '\'', ''', '`', '`'];
? ?var str = _str;
? ?var target;
? ?if (encode) {
? ? ?target = replaceReverse;
? ?} else {
? ? ?target = replace;
? ?}
? ?for (var i = 0; i ', '<', '', '>', '"', '"', '\'', ''', '`', '`'];
? ?var str = _str;
? ?var target;
? ?if (encode) {
? ? ?target = replaceReverse;
? ?} else {
? ? ?target = replace;
? ?}
? ?for (var i = 0; i ?[response ".concat(item.requestType, "]"), item.response, item);
? ?if (((_a = window.vConsole) === null || _a === void 0 ? void 0 : _a.network) && item.id !== '__system_log__') {
? ? ?try {
? ? ? ?return (_c = (_b = window.vConsole.network).update) === null || _c === void 0 ? void 0 : _c.call(_b, item.id, Object.assign({}, item, {
? ? ? ? ?readyState: 4
? ? ? ?}));
? ? ?} catch (err) {}
? ?}
?}
?function reqType(obj, path) {
? ?return obj.url.indexOf(path) > -1 && obj.url.indexOf('action=') === -1 && (!obj.data || !obj.data.action);
?}
?function reportRtError(type, id, key, content) {
? ?var log = '';
? ?var prefix = type === 'rt' ? 'rtCheckError' : 'Ajax Length Limit';
? ?if (content === null || content === void 0 ? void 0 : content.length) {
? ? ?var loglen = 1000;
? ? ?var len = content.length;
? ? ?var lc = Math.ceil(len / loglen);
? ? ?log = ["&lc=".concat(lc)];
? ? ?for (var i = 0; i = '1800282f' || Mmversion.isAndroid && Mmversion.getInner() >= '28002234' || Mmversion.isWindowsWechat && Mmversion.cpVersion('3.9.5', 1, true, 'windows') || Mmversion.isMacWechat && Mmversion.cpVersion('3.8.4', 1, true, 'mac'))) {
? ? ?try {
? ? ? ?return findAjaxScopeByConfig(ajaxUrl, window.__ajaxTransferConfig);
? ? ?} catch (err) {
? ? ? ?
? ? ?}
? ?}
?}
?function setXhrHeader(xhr, type, opt) {
? ?if (opt.contentType) {
? ? ?xhr.setRequestHeader('Content-Type', opt.contentType);
? ?} else if (type === 'POST') {
? ? ?xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
? ?}
? ?if (!opt.noXRequestedWidthHeader) {
? ? ?xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest');
? ?}
?}
?function Ajax(obj) {
? ?if (obj.usePb) {
? ? ?obj.type = 'POST';
? ? ?obj.data = {
? ? ? ?data: JSON.stringify(obj.data)
? ? ?};
? ?}
? ?var ajaxScope = getAjaxScope(obj.url);
? ?var type = (obj.type || 'GET').toUpperCase();
? ?var timer;
? ?var url;
? ?if (obj.notJoinUrl) {
? ? ?url = obj.url;
? ?} else {
? ? ?url = Url.joinUrl(obj.url);
? ?}
? ?if (obj.f === 'html') {
? ? ?url = url.replace('&f=json', '');
? ?}
? ?var data = null;
? ?if (_typeof(obj.data) === 'object') {
? ? ?var d = obj.data;
? ? ?var ds = [];
? ? ?for (var k in d) {
? ? ? ?if (d.hasOwnProperty(k)) {
? ? ? ? ?ds.push("".concat(k, "=").concat(encodeURIComponent(d[k])));
? ? ? ?}
? ? ?}
? ? ?data = ds.join('&');
? ?} else {
? ? ?data = typeof obj.data === 'string' ? obj.data : null;
? ?}
? ?var beginTs;
? ?var beforeReq = function beforeReq() {
? ? ?if (reqType(obj, '/mp/getappmsgext')) {
? ? ? ?window.startGetAppmsgExtTime = Date.now();
? ? ? ?Log.log('start get appmsgext, url: ', obj.url);
? ? ?}
? ? ?if (reqType(obj, '/mp/getappmsgad')) {
? ? ? ?window.startGetAppmsgAdTime = Date.now();
? ? ? ?Log.log('start get appmsgad, url: ', obj.url);
? ? ?}
? ? ?beginTs = Date.now();
? ?};
? ?var beforeResp = function beforeResp(xhr) {
? ? ?if (reqType(obj, '/mp/getappmsgext')) {
? ? ? ?window.receiveGetAppmsgExt = "".concat(xhr.status, "|").concat(Date.now());
? ? ? ?Log.log("receive appmsgext response, status: ".concat(xhr.status));
? ? ?}
? ? ?if (reqType(obj, '/mp/getappmsgad')) {
? ? ? ?window.receiveGetAppmsgAd = "".concat(xhr.status, "|").concat(Date.now());
? ? ? ?Log.log("receive appmsgad response, status: ".concat(xhr.status));
? ? ?}
? ? ?if (Math.random() = 200 && retryStatus ?-1;
? ? ? ? ? ?var respJsonFlag = res.jsapi_resp.resp_json;
? ? ? ? ? ?status = retFlag && respJsonFlag ? 200 : 400;
? ? ? ? ? ?result = res.jsapi_resp.resp_json;
? ? ? ? ?} catch (err) {
? ? ? ? ? ?console.error(err);
? ? ? ? ?}
? ? ? ?} else {
? ? ? ? ?status = res && res.errCode * 1 === 0 && typeof res.result === 'string' && res.result ? 200 : 400;
? ? ? ? ?result = res.result;
? ? ? ?}
? ? ? ?if (status >= 200 && status ?-1 && retryStatus >= 200 && retryStatus = 200 && status ?LENGTH_LIMIT) {
? ? ? ? ?reportAjaxLength(27613, 17, "ajax get limit[length: ".concat(url.length, "]").concat(url.substring(0, 1024)));
? ? ? ?}
? ? ? ?if (data && data.length > LENGTH_LIMIT) {
? ? ? ? ?reportAjaxLength(27613, 18, "ajax post limit[length: ".concat(data.length, "]").concat(data.substring(0, 1024)));
? ? ? ?}
? ? ?} catch (e) {
? ? ?}
? ?} catch (e) {
? ? ?obj.error && obj.error(xhr, {
? ? ? ?type: 3,
? ? ? ?error: e,
? ? ? ?status: 0
? ? ?});
? ?}
? ?beforeReq();
? ?return xhr;
?}
?function AjaxWx(obj) {
? ?obj.url += obj.url.indexOf('?') === -1 ? '?fasttmplajax=1' : '&fasttmplajax=1';
? ?if (getAjaxScope(obj.url)) {
? ? ?Ajax(obj);
? ? ?return;
? ?}
? ?if (obj.usePb) {
? ? ?obj.type = 'POST';
? ? ?obj.data = {
? ? ? ?data: JSON.stringify(obj.data)
? ? ?};
? ?}
? ?if (!/^(http:\/\/|https:\/\/|\/\/)/.test(obj.url)) {
? ? ?obj.url = "https://mp.weixin.qq.com/".concat(obj.url.replace(/^\//, ''));
? ?} else if (/^\/\//.test(obj.url)) {
? ? ?obj.url = "https:".concat(obj.url);
? ?}
? ?if (obj.f !== 'html' && (obj.url.indexOf('?f=json') === -1 || obj.url.indexOf('&f=json') === -1)) {
? ? ?obj.url += '&f=json';
? ?}
? ?if (!obj.notJoinUrl && obj.f !== 'html') {
? ? ?obj.url = Url.joinUrl(obj.url);
? ?}
? ?var data = null;
? ?if (_typeof(obj.data) === 'object') {
? ? ?var d = obj.data;
? ? ?var ds = [];
? ? ?for (var k in d) {
? ? ? ?if (d.hasOwnProperty(k)) {
? ? ? ? ?ds.push("".concat(k, "=").concat(encodeURIComponent(d[k])));
? ? ? ?}
? ? ?}
? ? ?data = ds.join('&');
? ?} else {
? ? ?data = typeof obj.data === 'string' ? obj.data : null;
? ?}
? ?var header = {
? ? ?Cookie: document.cookie,
? ? ?referer: location.href
? ?};
? ?var reqLogItem = networkStartLog({
? ? ?method: obj.type || 'GET',
? ? ?url: obj.url,
? ? ?postData: obj.data || {},
? ? ?requestHeader: header,
? ? ?requestType: 'jsapi'
? ?});
? ?var retryTime = 1;
? ?var jsapiRequest = function jsapiRequest(obj, data) {
? ? ?return JSAPI.invoke('request', {
? ? ? ?url: obj.url,
? ? ? ?method: obj.type,
? ? ? ?data: data,
? ? ? ?header: header
? ? ?}, function (res) {
? ? ? ?var _a;
? ? ? ?if (res.err_msg.indexOf(':ok') > -1) {
? ? ? ? ?if (reqType(obj, '/mp/getappmsgext')) {
? ? ? ? ? ?window.receiveGetAppmsgExt = "".concat(res.statusCode, "|").concat(Date.now());
? ? ? ? ?}
? ? ? ? ?if (reqType(obj, '/mp/getappmsgad')) {
? ? ? ? ? ?window.receiveGetAppmsgAd = "".concat(res.statusCode, "|").concat(Date.now());
? ? ? ? ?}
? ? ? ? ?if (retryTime === 1) {
? ? ? ? ? ?obj.received && obj.received(null);
? ? ? ? ?}
? ? ? ? ?var resData = {};
? ? ? ? ?if (res.data) {
? ? ? ? ? ?try {
? ? ? ? ? ? ?if (obj.dataType === 'json') {
? ? ? ? ? ? ? ?resData = JSON.parse(res.data);
? ? ? ? ? ? ?} else {
? ? ? ? ? ? ? ?resData = res.data;
? ? ? ? ? ? ?}
? ? ? ? ? ? ?if (resData && resData.base_resp && ((_a = resData.base_resp) === null || _a === void 0 ? void 0 : _a.ret) !== 0 && typeof window.WX_BJ_REPORT !== 'undefined' && window.WX_BJ_REPORT.BadJs && Math.random() ?'27000600')) {
? ? ? ? ? ?var _retryTime = retryTime++;
? ? ? ? ? ?JSAPI.invoke('updatePageAuth', {}, function (res) {
? ? ? ? ? ? ?console.log('[skeleton] updatePageAuth', res);
? ? ? ? ? ? ?monitor$1.setSum(112287, 3, 1);
? ? ? ? ? ? ?if (res && res.err_msg && res.err_msg.indexOf(':ok') > -1) {
? ? ? ? ? ? ? ?window.top.pass_ticket = encodeURIComponent(Url.getQuery('pass_ticket', res.fullUrl).html(false).replace(/\s/g, '+'));
? ? ? ? ? ? ? ?if (obj.pass_ticket) {
? ? ? ? ? ? ? ? ?obj.pass_ticket = window.top.pass_ticket;
? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ?console.warn('[skeleton] updatePageAuth resetTopbar');
? ? ? ? ? ? ? ?var supportNewTopBar = Mmversion.isIOS && Mmversion.gtVersion('7.0.10', true);
? ? ? ? ? ? ? ?var showBottomBar = !!window.is_login;
? ? ? ? ? ? ? ?if (window.top.item_show_type === '0' && supportNewTopBar) {
? ? ? ? ? ? ? ? ?var _top = document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop || 0;
? ? ? ? ? ? ? ? ?setCurrentMpInfo(_top > 40 && !showBottomBar);
? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ?try {
? ? ? ? ? ? ? ? ?obj.url = Url.addParam(obj.url, 'retry', _retryTime, true);
? ? ? ? ? ? ? ?} catch (err) {
? ? ? ? ? ? ? ? ?console.error(err);
? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ?jsapiRequest(obj, data);
? ? ? ? ? ? ? ?monitor$1.setSum(112287, 4, 1);
? ? ? ? ? ? ?} else {
? ? ? ? ? ? ? ?obj.success && obj.success(resData);
? ? ? ? ? ? ? ?obj.complete && obj.complete();
? ? ? ? ? ? ? ?if (Mmversion.isIOS) {
? ? ? ? ? ? ? ? ?monitor$1.setSum(112287, 35, 1);
? ? ? ? ? ? ? ?} else {
? ? ? ? ? ? ? ? ?monitor$1.setSum(112287, 36, 1);
? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ?reqLogItem.status = 200;
? ? ? ? ? ? ? ?reqLogItem.endTime = Date.now();
? ? ? ? ? ? ? ?reqLogItem.response = resData;
? ? ? ? ? ? ? ?networkEndLog(reqLogItem);
? ? ? ? ? ? ?}
? ? ? ? ? ?});
? ? ? ? ?} else {
? ? ? ? ? ?obj.success && obj.success(resData);
? ? ? ? ? ?obj.complete && obj.complete();
? ? ? ? ? ?reqLogItem.status = 200;
? ? ? ? ? ?reqLogItem.endTime = Date.now();
? ? ? ? ? ?reqLogItem.response = resData;
? ? ? ? ? ?networkEndLog(reqLogItem);
? ? ? ? ?}
? ? ? ?} else if (res.err_msg.indexOf('no permission') > -1 || !Mmversion.isOnlyWechat) {
? ? ? ? ?Ajax(obj);
? ? ? ? ?if (res.err_msg.indexOf('no permission') > -1) {
? ? ? ? ? ?console.warn('[JSAPI Request] No permission');
? ? ? ? ? ?monitor$1.setSum(112287, 31, 1);
? ? ? ? ?}
? ? ? ? ?reqLogItem.status = 302;
? ? ? ? ?reqLogItem.endTime = Date.now();
? ? ? ? ?reqLogItem.response = res;
? ? ? ? ?networkEndLog(reqLogItem);
? ? ? ?} else {
? ? ? ? ?obj.error && obj.error(null, {
? ? ? ? ? ?type: 3,
? ? ? ? ? ?error: res,
? ? ? ? ? ?status: 0
? ? ? ? ?});
? ? ? ? ?obj.complete && obj.complete();
? ? ? ? ?monitor$1.setSum(112287, 32, 1);
? ? ? ? ?var sample = 0.001;
? ? ? ? ?if (Math.random() ?0) {
? ? ?if (checkBadCase(keyWordsNodeList, keywordsData, 's1s_keywords')) return;
? ? ?keyWordsNodeList.forEach(function (node) {
? ? ? ?node.keywordsData = keywordsData;
? ? ? ?node.classList.add(SearchWordsBoxClassName);
? ? ?});
? ? ?var lastNode = keyWordsNodeList[keyWordsNodeList.length - 1];
? ? ?var i = document.createElement('i');
? ? ?i.className = SearchWordsClassName;
? ? ?lastNode.appendChild(i);
? ?}
? ?return keyWordsNodeList;
?};
?function addKeywordToHtml(html, keywordsData) {
? ?if (!keywordsData) return html;
? ?var div = document.createElement('div');
? ?div.innerHTML = html;
? ?var paraList = getParaListAllNodes(div, {
? ? ?ignorePreloadNode: true,
? ? ?ignoreNotWriteableChildren: true
? ?});
? ?try {
? ? ?wrapTextNodesWithSpan(paraList);
? ? ?var finalParaList = getParaListAllNodes(div, {
? ? ? ?ignorePreloadNode: true,
? ? ? ?ignoreNotWriteableChildren: true
? ? ?});
? ? ?keywordsData.forEach(function (data) {
? ? ? ?renderKeyWord(data, finalParaList);
? ? ?});
? ?} catch (error) {
? ? ?return html;
? ?}
? ?return div.innerHTML;
?}
?function wrapTextNodesWithSpan(paraList) {
? ?paraList.forEach(function (textNode) {
? ? ?if (textNode.nodeType === Node.TEXT_NODE) {
? ? ? ?var span = document.createElement('span');
? ? ? ?span.className = 'text-node-wrapper';
? ? ? ?span.textContent = textNode.nodeValue;
? ? ? ?var parent = textNode.parentNode;
? ? ? ?if (parent) {
? ? ? ? ?parent.replaceChild(span, textNode);
? ? ? ?}
? ? ?}
? ?});
?}
?var isAllowRender = (Mmversion.isAndroid || Mmversion.isIOS || Mmversion.isWindows || Mmversion.isMac && Mmversion.cpVersion("3.8.2", 1, true, "mac")) && Mmversion.isWechat && !Mmversion.isWxWork;
?
?var ltReplaceChar = "lt-".concat(Date.now(), "-").concat(Math.random());
?var gtReplaceChar = "gt-".concat(Date.now(), "-").concat(Math.random());
?var ltReplaceCharReg = new RegExp(ltReplaceChar, 'g');
?var gtReplaceCharReg = new RegExp(gtReplaceChar, 'g');
?function isAudioPage(itemShowType) {
? ?return itemShowType * 1 === 7;
?}
?function isImagePage(itemShowType) {
? ?return itemShowType * 1 === 8;
?}
?function replaceTagChar(str, enableTagReg) {
? ?var strAfterReplace;
? ?while (true) {
? ? ?str = str.replace(enableTagReg, function (match, sub1, sub2, sub3) {
? ? ? ?return "".concat(ltReplaceChar).concat(sub1).concat(gtReplaceChar).concat(sub2).concat(ltReplaceChar).concat(sub3).concat(gtReplaceChar);
? ? ?});
? ? ?if (str !== strAfterReplace) {
? ? ? ?strAfterReplace = str;
? ? ? ?continue;
? ? ?}
? ? ?break;
? ?}
? ?return strAfterReplace;
?}
?var __setDesc = function __setDesc(desc, isNoEncode, itemShowType) {
? ?var extData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
? ?function getAttr(s, a) {
? ? ?var m = s.match(new RegExp(a + '\\s*=\\s*["\']?([^"\'\\s>]+)["\']?'));
? ? ?return m && m[1];
? ?}
? ?function filterContentWithLinkNWeapp(str, enableTagReg, preserveS1SReg) {
? ? ?enableTagReg && (str = replaceTagChar(str, enableTagReg));
? ? ?var s1sMatches = [];
? ? ?if (preserveS1SReg) {
? ? ? ?str = str.replace(preserveS1SReg, function (match) {
? ? ? ? ?s1sMatches.push(match);
? ? ? ? ?return "__S1S_PLACEHOLDER_".concat(s1sMatches.length - 1, "__");
? ? ? ?});
? ? ?}
? ? ?str = str.split(/(
]*>)((?:.|\n)*?)()/);
? ? ?var valid;
? ? ?for (var i = 0; i ".concat(str[i + 1], "");
? ? ? ? ? ? ?str[i + 2] = "";
? ? ? ? ? ? ?i += 3;
? ? ? ? ? ? ?continue;
? ? ? ? ? ?} else if (getAttr(str[i], 'data-cardtype') === '3') {
? ? ? ? ? ? ?var customstyle = getAttr(str[i], 'data-customstyle');
? ? ? ? ? ? ?var customHeight = void 0;
? ? ? ? ? ? ?if (customstyle) {
? ? ? ? ? ? ? ?try {
? ? ? ? ? ? ? ? ?var _JSON$parse = JSON.parse(customstyle.html(false)),
? ? ? ? ? ? ? ? ? ?display = _JSON$parse.display,
? ? ? ? ? ? ? ? ? ?height = _JSON$parse.height;
? ? ? ? ? ? ? ? ?if (display !== 'none') {
? ? ? ? ? ? ? ? ? ?customHeight = parseInt(height, 10);
? ? ? ? ? ? ? ? ?} else {
? ? ? ? ? ? ? ? ? ?customHeight = 0;
? ? ? ? ? ? ? ? ?}
? ? ? ? ? ? ? ?} catch (err) {
? ? ? ? ? ? ? ? ?console.error(err);
? ? ? ? ? ? ? ?}
? ? ? ? ? ? ?} else {
? ? ? ? ? ? ? ?var fontScale = getScaleByDom();
? ? ? ? ? ? ? ?customHeight = 24 + 44 * fontScale;
? ? ? ? ? ? ?}
? ? ? ? ? ? ?str[i] = str[i].replace('
";
? ? ? ? ? ? ?i += 3;
? ? ? ? ? ? ?continue;
? ? ? ? ? ?}
? ? ? ? ?} else if (valid) {
? ? ? ? ? ?r += ' class="js_common_share_desc_link"';
? ? ? ? ? ?var _itemShowType = getAttr(str[i], 'data-itemshowtype');
? ? ? ? ? ?_itemShowType && (r += ' data-itemshowtype="' + _itemShowType + '"');
? ? ? ? ?}
? ? ? ? ?str[i] = valid ? r + '>' : '';
? ? ? ?} else if (i % 4 === 3) {
? ? ? ? ?!valid && (str[i] = '');
? ? ? ?} else {
? ? ? ? ?str[i] = str[i].replace(/<.>/g, '');
? ? ? ?}
? ? ?}
? ? ?str = str.join('');
? ? ?enableTagReg && (str = str.replace(ltReplaceCharReg, ''));
? ? ?if (preserveS1SReg && s1sMatches.length > 0) {
? ? ? ?str = str.replace(/__S1S_PLACEHOLDER_(\d+)__/g, function (_, index) {
? ? ? ? ?return s1sMatches[parseInt(index, 10)];
? ? ? ?});
? ? ?}
? ? ?return str;
? ?}
? ?if (isNoEncode) {
? ? ?if (itemShowType * 1 === 8) {
? ? ? ?desc = desc.html(false);
? ? ? ?if (extData.searchKeywordsData && window.cgiData) {
? ? ? ? ?window.cgiData.search_keywords = extData.searchKeywordsData;
? ? ? ?}
? ? ? ?if (window.cgiData && window.cgiData.search_keywords && isAllowRender) {
? ? ? ? ?desc = addKeywordToHtml(desc, window.cgiData.search_keywords);
? ? ? ?}
? ? ?}
? ? ?var searchKeywordsFilterReg;
? ? ?if (window.cgiData && window.cgiData.search_keywords && isImagePage(itemShowType)) {
? ? ? ?searchKeywordsFilterReg = window.cgiData.search_keywords.length > 0 ? /([\s\S]*?)/g : undefined;
? ? ?}
? ? ?desc = filterContentWithLinkNWeapp(desc, isAudioPage(itemShowType) ? /]+?textstyle[^>]+?)>([\s\S]+?)/g : undefined, searchKeywordsFilterReg);
? ? ?desc = window.__emojiFormat(desc.replace(/\r/g, '').replace(/\n/g, '
'));
? ?} else {
? ? ?desc = desc.replace(/\r/g, '').replace(/\n/g, '
').replace(/\s/g, '?');
? ?}
? ?if (itemShowType * 1 === 8) {
? ? ?var descDom = document.getElementById('js_image_desc');
? ? ?descDom && (descDom.innerHTML = desc);
? ? ?if (location.href.indexOf('immerse_style=1') > -1 && descDom) {
? ? ? ?var r = window.innerHeight - descDom.getBoundingClientRect().y - document.getElementById('wx_expand_bottom').offsetHeight;
? ? ? ?var l = window.getComputedStyle(descDom).lineHeight;
? ? ? ?window.__immersiveFullDesc = desc;
? ? ? ?window.__immersiveOmited = 1;
? ? ? ?textOverflow(descDom, {
? ? ? ? ?value: {
? ? ? ? ? ?lineClamp: Math.floor(r / parseFloat(l)),
? ? ? ? ? ?html: '... 展開(kāi)'
? ? ? ? ?}
? ? ? ?});
? ? ?}
? ?} else if (itemShowType * 1 === 10) {
? ? ?var dom = document.querySelector('.js_share_notice_dom');
? ? ?var _descDom = document.getElementById('js_text_desc');
? ? ?_descDom && (_descDom.innerHTML = desc);
? ? ?if (extData.superVoteId) dom && dom.classList.add('no_min_height');
? ? ?var titleDom = document.getElementById('js_text_title');
? ? ?var titleRect = titleDom ? titleDom.getBoundingClientRect() : undefined;
? ? ?var descRect = _descDom ? _descDom.getBoundingClientRect() : undefined;
? ? ?if (titleRect && titleRect.height > 17 * 1.4 + 2 || descRect && descRect.height > 17 * 1.6 + 2 || extData.superVoteId) {
? ? ? ?dom && dom.classList.add('text_align_left');
? ? ?}
? ?} else if (isAudioPage(itemShowType)) {
? ? ?document.querySelector('#js_audio_desc') && (document.querySelector('#js_audio_desc').innerHTML = desc);
? ?} else {
? ? ?var _descDom2 = document.getElementById('js_common_share_desc');
? ? ?var descDomWrap = document.getElementById('js_common_share_desc_wrap');
? ? ?if (!_descDom2 || !descDomWrap) {
? ? ? ?return;
? ? ?}
? ? ?_descDom2.innerHTML = desc;
? ? ?if (itemShowType * 1 !== 5) {
? ? ? ?setTimeout(function () {
? ? ? ? ?var folderSwitcher = document.getElementById('js_folder_text_switch');
? ? ? ? ?if (_descDom2.offsetHeight - descDomWrap.offsetHeight > 1) {
? ? ? ? ? ?descDomWrap.className += ' weui-ellipsis_multi';
? ? ? ? ? ?folderSwitcher.style.display = 'block';
? ? ? ? ?} else {
? ? ? ? ? ?folderSwitcher.style.display = 'none';
? ? ? ? ?}
? ? ? ?}, 300);
? ? ?}
? ?}
?};
?if (!window.__second_open__) {
? ?var videoContentNoEncode = window.a_value_which_never_exists || '';
? ?var TextContentNoEncode = window.a_value_which_never_exists || '';
? ?var ContentNoEncode = window.a_value_which_never_exists || '';
? ?var itemShowType = window.a_value_which_never_exists || '5';
? ?var content = window.a_value_which_never_exists || '';
? ?var desc = window.a_value_which_never_exists || '';
? ?var superVoteId = window.a_value_which_never_exists || '';
? ?var extData = {
? ? ?superVoteId: superVoteId
? ?};
? ?if (videoContentNoEncode) {
? ? ?__setDesc(videoContentNoEncode, true, itemShowType, extData);
? ?} else if (itemShowType * 1 === 10 && (ContentNoEncode || superVoteId) || isAudioPage(itemShowType) && ContentNoEncode) {
? ? ?__setDesc(ContentNoEncode, true, itemShowType, extData);
? ?} else if (TextContentNoEncode) {
? ? ?__setDesc(TextContentNoEncode, true, itemShowType, extData);
? ?} else if (itemShowType * 1 === 8) {
? ? ?__setDesc(content || desc, true, itemShowType, extData);
? ?} else {
? ? ?__setDesc(desc, false, itemShowType, extData);
? ?}
? ?window.__setDesc = __setDesc;
?}
?return __setDesc;
})(); ? ? ? ?