webfunny.js 26 KB

1
  1. !function(n){var o={};function r(e){if(o[e])return o[e].exports;var t=o[e]={i:e,l:!1,exports:{}};return n[e].call(t.exports,t,t.exports,r),t.l=!0,t.exports}r.m=n,r.c=o,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,n){e.exports=n(1)},function(e,t,n){var o,w,r,i,a;!function(T){sessionStorage||(T.sessionStorage={}),localStorage||(T.localStorage={}),T.webfunnyRequests||(T.webfunnyRequests=[]);var E=T.localStorage,a="object"==typeof navigator&&"Microsoft Internet Explorer"==navigator.appName&&parseInt(navigator.appVersion.split(";")[1].replace(/[ ]/g,"").replace("MSIE",""))<=9,x=E.WF_CONFIG?JSON.parse(E.WF_CONFIG):{s:!0,ia:[""],wc:40,pv:{s:true,ia:[""]},je:{s:true,ia:[""]},hl:{s:true,ia:[""],uh:!1,rl:2e3,sl:2e3},rl:{s:true,ia:[""]},bl:{s:true},lc:{s:false},sc:{r:100,c:3}},i=T.location.href.split("?")[0],b=T.performance?T.performance.timing:{},N=T.performance&&"function"==typeof T.performance.getEntries?T.performance.getEntries():null,e="3.1.97",t=-1===T.location.href.indexOf("https")?"http://":"https://",s=T.location.href,I=encodeURIComponent(T.location.pathname),n=t+(T.webfunnyDomain||"192.168.0.109:8011"),o="/server/upLog",r="/server/upDLog",c=n+o,f=n+r,_="CUSTOMER_PV",u="STAY_TIME",d="CUS_LEAVE",C="PAGE_LOAD",S="HTTP_LOG",l="JS_ERROR",p="SCREEN_SHOT",O="ELE_BEHAVIOR",M="RESOURCE_LOAD",h="CUSTOMIZE_BEHAVIOR",g="VIDEOS_EVENT",k="LAST_BROWSE_DATE",L="WM_PAGE_ENTRY_TIME",$="WM_VISIT_PAGE_COUNT",D=new function(){this.checkIgnore=function(t,n){if(!n)return!0;try{for(var e=n.replace(/ /g,""),o=x[t].ia||[],r=!0,i=0;i<o.length;i++){var a=o[i].replace(/ /g,"");if(a&&-1!=e.indexOf(a)){r=!1;break}}return r}catch(e){console.error("checkIgnore异常,key: "+t+";str:"+n)}},this.checkHttpReqResLen=function(e,t){var n=x.hl,o=parseInt(n.rl,10)||2e3,r=parseInt(n.sl,10)||2e3,i="req"===t?o:r,a="";if(e&&e.length<i)try{a=e}catch(e){a=""}else a="内容太长";return a},this.getIp=function(e){},this.getUuid=function(){var e=D.formatDate((new Date).getTime(),"yMdhms");return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})+"-"+e},this.getKeyByWebMonitorId=function(e){var t="",n="old",o=this.getUuid(),r=D.getWfCookie("monitorCustomerKeys"),i=(new Date).getTime()+31104e7;if(r){var a=JSON.parse(r);a[e]?t=a[e]:(a[e]=o,D.setWfCookie("monitorCustomerKeys",JSON.stringify(a),i),t=o,n="new")}else{var s={};s[e]=o,D.setWfCookie("monitorCustomerKeys",JSON.stringify(s),i),t=o,n="new"}return{customerKey:t,status:n}},this.setWfCookie=function(e,t,n){var o={data:t,expires:n};if(E.WEBFUNNY_COOKIE){var r=JSON.parse(E.WEBFUNNY_COOKIE);r[e]=o,E.WEBFUNNY_COOKIE=JSON.stringify(r)}else{var i={};i[e]=o,E.WEBFUNNY_COOKIE=JSON.stringify(i)}},this.getWfCookie=function(e){var t=null;if(E.WEBFUNNY_COOKIE){var n=(t=JSON.parse(E.WEBFUNNY_COOKIE))[e];return n?parseInt(n.expires,10)<(new Date).getTime()?(delete t[e],E.WEBFUNNY_COOKIE=JSON.stringify(t),""):n.data:""}return""},this.getCusInfo=function(e){if(!e)return"";var t=(E.wmUserInfo?JSON.parse(E.wmUserInfo):{})[e];return t||""},this.getWebMonitorId=function(){var e="webfunny_20231106_163446_pro",t=sessionStorage.CUSTOMER_WEB_MONITOR_ID||e;if(/^webfunny\d*(_\d{8}_\d{6}(_[a-z]+)?)?$/.test(t)||(t=e),-1!==t.indexOf("_pro")){var n=D.getCusInfo("env");n&&(t=t.replace("_pro","_"+n))}return t},this.isTodayBrowse=function(e){var t=E[e],n=(new Date).getFullYear()+"-"+((new Date).getMonth()+1)+"-"+(new Date).getDate();return t&&n==t?!(!t||n!=t):(E[e]=n,!1)},this.formatDate=function(e,t){var n=new Date(e).getFullYear(),o=new Date(e).getMonth()+1,r=new Date(e).getDate(),i=new Date(e).getHours(),a=new Date(e).getMinutes(),s=new Date(e).getSeconds();return o=9<o?o:"0"+o,r=9<r?r:"0"+r,i=9<i?i:"0"+i,a=9<a?a:"0"+a,s=9<s?s:"0"+s,t.replace("y",n).replace("M",o).replace("d",r).replace("h",i).replace("m",a).replace("s",s)},this.getPageKey=function(){var e=this.getUuid();return E.monitorPageKey&&/^[0-9a-z]{8}(-[0-9a-z]{4}){3}-[0-9a-z]{12}-\d{13}$/.test(E.monitorPageKey)||(E.monitorPageKey=e),E.monitorPageKey},this.setPageKey=function(){E.monitorPageKey=this.getUuid()},this.addLoadEvent=function(e){var t=T.onload;"function"!=typeof T.onload?T.onload=e:T.onload=function(){t(),e()}},this.addOnBeforeUnloadEvent=function(e){var t=T.onbeforeunload;"function"!=typeof T.onbeforeunload?T.onbeforeunload=e:T.onbeforeunload=function(){t(),e()}},this.addOnclickForDocument=function(t){var n=document.onclick;"function"!=typeof document.onclick?document.onclick=t:document.onclick=function(e){n(),t(e)}},this.ajax=function(e,t,n,o,r){try{var i=T.XMLHttpRequest?new XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");i.open(e,t,!0),i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.onreadystatechange=function(){if(4==i.readyState){var t={};try{t=i.responseText?JSON.parse(i.responseText):{}}catch(e){t={}}"function"==typeof o&&o(t)}},i.onerror=function(e){console.warn("【【 "+t+" 上报接口不通,请处理。】】",e),"function"==typeof r&&r()};var a=JSON.stringify(n||{});i.send("data="+a)}catch(e){console.log(e)}},this.upLog=function(e,i){if(e&&"undefined"!=e)if(a){(new Image).src=c+"?logInfo="+e;for(var t=0;t<R.length;t++)E[R[t]]=""}else D.ajax("POST",c,{logInfo:e},function(e){if(e&&e.data&&e.data.d){E.ds="c"==e.data.d?"connected":"disconnect";var t=e.data.c;if(t){E.setItem("WF_CONFIG",e.data.c);var n=JSON.parse(t);if(0==(x=n).s){var o=(new Date).getTime()+6e5;D.setWfCookie("webfunnyStart","p",o)}}}if(!0===i)for(var r=0;r<R.length;r++)E[R[r]]=""},function(){if(!0===i)for(var e=0;e<R.length;e++)E[R[e]]=""})},this.initDebugTool=function(){var a=D.getCusInfo("userId");function t(e){for(var t=[],n=e.length,o=0;o<n;o++)t.push(e[o]);var r={};r.log=t,r.userId=a,r.happenTime=(new Date).getTime();var i="";try{i=D.b64Code(JSON.stringify(r))}catch(e){i="convert fail"}return i}var n=console.log,o=console.warn;console.log=function(){var e=t(arguments);return"connected"===E.ds&&D.ajax("POST",f,{consoleInfo:e},function(){}),n.apply(console,arguments)},console.warn=function(){var e=t(arguments);return"connected"===E.ds&&D.ajax("POST",f,{warnInfo:e},function(){}),o.apply(console,arguments)}},this.uploadLocalInfo=function(){var e=D.getCusInfo("userId"),t={};for(var n in E)"function"==typeof E[n]||-1!=R.indexOf(n)||1e3<E[n].length||(t[n]=E[n]);try{t=D.b64Code(JSON.stringify(t))}catch(e){t=""}var o={};for(var n in sessionStorage)"function"==typeof sessionStorage[n]||-1!=R.indexOf(n)||1e3<sessionStorage[n].length||(o[n]=sessionStorage[n]);try{o=D.b64Code(JSON.stringify(o))}catch(e){o=""}var r=D.b64Code(document.cookie);D.ajax("POST",f,{localInfo:t,sessionInfo:o,cookieInfo:r,userId:e||"userId"},function(e){if((setTimeout(function(){D.uploadLocalInfo()},2e4),e.data)&&1==e.data.clear){var t=E.wmUserInfo;localStorage.clear(),localStorage.wmUserInfo=t,sessionStorage.clear(),E.WEBFUNNY_COOKIE=""}})},this.encryptObj=function(e){if(e instanceof Array){for(var t=[],n=0;n<e.length;++n)t[n]=this.encryptObj(e[n]);return t}if(e instanceof Object){t={};for(var n in e)t[n]=this.encryptObj(e[n]);return t}return 50<(e+="").length&&(e=e.substring(0,10)+"****"+e.substring(e.length-9,e.length)),e},this.getDevice=function(){var e={},t=navigator.userAgent,n=t.match(/(Android);?[\s\/]+([\d.]+)?/),o=t.match(/(iPad).*OS\s([\d_]+)/),r=!o&&t.match(/(iPhone\sOS)\s([\d_]+)/),i=t.match(/Android\s[\S\s]+Build\//),a=T.screen.width,s=T.screen.height;if(e.ios=e.android=e.iphone=e.ipad=e.androidChrome=!1,e.isWeixin=/MicroMessenger/i.test(t),e.os="web",e.deviceName="PC",e.deviceSize=a+"×"+s,n&&(e.os="android",e.osVersion=n[2],e.android=!0,e.androidChrome=0<=t.toLowerCase().indexOf("chrome")),(o||r)&&(e.os="ios",e.ios=!0),r&&(e.osVersion=r[2].replace(/_/g,"."),e.iphone=!0),o&&(e.osVersion=o[2].replace(/_/g,"."),e.ipad=!0),e.ios&&e.osVersion&&0<=t.indexOf("Version/")&&"10"===e.osVersion.split(".")[0]&&(e.osVersion=t.toLowerCase().split("version/")[1].split(" ")[0]),e.iphone){var c="iphone";320===a&&480===s?c="4":320===a&&568===s?c="5/SE":375===a&&667===s?c="6/7/8":414===a&&736===s?c="6/7/8 Plus":375===a&&812===s?c="X/S/Max":414===a&&896===s?c="11/Pro-Max":375===a&&812===s?c="11-Pro/mini":390===a&&844===s?c="12/Pro":428===a&&926===s&&(c="12-Pro-Max"),e.deviceName="iphone "+c}else if(e.ipad)e.deviceName="ipad";else if(i){for(var f=i[0].split(";"),u="",d=0;d<f.length;d++)-1!=f[d].indexOf("Build")&&(u=f[d].replace(/Build\//g,""));""==u&&(u=f[1]),e.deviceName=u.replace(/(^\s*)|(\s*$)/g,"")}if(-1==t.indexOf("Mobile")){var l=navigator.userAgent.toLowerCase();if(e.browserName="其他",0<l.indexOf("msie")){var p=l.match(/msie [\d.]+;/gi)[0];e.browserName="ie",e.browserVersion=p.split("/")[1]}else if(0<l.indexOf("edg")){p=l.match(/edg\/[\d.]+/gi)[0];e.browserName="edge",e.browserVersion=p.split("/")[1]}else if(0<l.indexOf("firefox")){p=l.match(/firefox\/[\d.]+/gi)[0];e.browserName="firefox",e.browserVersion=p.split("/")[1]}else if(0<l.indexOf("safari")&&l.indexOf("chrome")<0){p=l.match(/safari\/[\d.]+/gi)[0];e.browserName="safari",e.browserVersion=p.split("/")[1]}else if(0<l.indexOf("chrome")){p=l.match(/chrome\/[\d.]+/gi)[0];e.browserName="chrome",e.browserVersion=p.split("/")[1],0<l.indexOf("360se")&&(e.browserName="360")}}return e.webView=(r||o)&&t.match(/.*AppleWebKit(?!.*Safari)/i),e},this.loadJs=function(e,t,n){var o=document.createElement("script");o.async=1,o.src=e,o.onload=t,"function"==typeof n&&(o.onerror=n);var r=document.getElementsByTagName("script")[0];return r.parentNode.insertBefore(o,r),r},this.b64Code=function(e){var t=encodeURIComponent(e);try{return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(e){return t}},this.perfSubtract=function(e,t){return 0===e||0===t?0:e-t}},W=(new Date).getTime()+6048e5,v=D.getDevice(),R=[O,l,S,p,_,C,M,h,g],A=[o,r,"/upLogs","/upEvent","/upEvents","/initCf"],V={ACTIVE_TIME:{}},j=[],P=0,J="";function w(){this.handleLogInfo=function(e,t){if(t){var n=E[e]?E[e]:"";switch(e){case O:E[O]=n+JSON.stringify(t)+"$$$";break;case l:E[l]=n+JSON.stringify(t)+"$$$";break;case S:E[S]=n+JSON.stringify(t)+"$$$";break;case p:E[p]=n+JSON.stringify(t)+"$$$";break;case _:E[_]=n+JSON.stringify(t)+"$$$";break;case C:E[C]=n+JSON.stringify(t)+"$$$";break;case M:E[M]=n+JSON.stringify(t)+"$$$";break;case h:E[h]=n+JSON.stringify(t)+"$$$";break;case g:E[g]=n+JSON.stringify(t)+"$$$"}}}}function y(){this.wmVersion=e,this.h=(new Date).getTime(),this.a=D.getWebMonitorId(),this.g=D.b64Code(T.location.href.split("?")[0]),this.f=D.b64Code(T.location.href),this.b=D.getKeyByWebMonitorId(D.getWebMonitorId()).customerKey,this.c=D.getCusInfo("userId"),this.j=D.b64Code(D.getCusInfo("projectVersion")),this.d=D.b64Code(D.getCusInfo("userTag")),this.e=D.b64Code(D.getCusInfo("secondUserParam"))}function U(e,t,n,o,r){y.apply(this),this.i=e,this.k=D.getPageKey(),this.l=v.deviceName,this.deviceSize=v.deviceSize,this.m=v.os+(v.osVersion?" "+v.osVersion:""),this.n=v.browserName,this.o=v.browserVersion,this.p=D.getWfCookie("wf_ip"),this.q="",this.r=D.getWfCookie("wf_prov"),this.s="",this.t=t,this.u=n,this.newStatus=o,this.referrer=(r||"").split("?")[0]}function K(e){this.i=d,this.a=D.getWebMonitorId(),this.leaveType=e,this.h=(new Date).getTime(),this.g=D.b64Code(T.location.href.split("?")[0]),this.b=D.getKeyByWebMonitorId(D.getWebMonitorId()).customerKey}function m(e,t){y.apply(this),this.i=u,this.h=(new Date).getTime(),this.a=D.getWebMonitorId(),this.g=D.b64Code(T.location.href.split("?")[0]),this.b=D.getKeyByWebMonitorId(D.getWebMonitorId()).customerKey,this.stayTime=e,this.activeTime=t}function B(e,t,n,o,r,i,a,s,c,f,u,d,l){y.apply(this),this.i=e,this.t=t,this.firstByte=n,this.w=o,this.pageCompleteLoaded=r,this.dns=i,this.tcp=a,this.ssl=s,this.response=c,this.conTrans=f,this.domAnalysis=u,this.resourceLoaded=d,this.effectiveType=l,this.m=v.os}function F(e,t,n,o,r,i,a){y.apply(this),this.i=e,this.da=t,this.G=D.b64Code(n),this.H=D.b64Code(o),this.I=D.b64Code(r),this.L=i,this.M=D.b64Code(a)}function H(e,t,n,o,r){y.apply(this),this.i=e,this.O=t,this.k=D.getPageKey(),this.l=v.deviceName,this.m=v.os+(v.osVersion?" "+v.osVersion:""),this.n=v.browserName,this.o=v.browserVersion,this.p=D.getWfCookie("wf_ip"),this.q="",this.r=D.getWfCookie("wf_prov"),this.s="",this.simpleErrorMessage=D.b64Code(n),this.P=D.b64Code(o),this.Q=D.b64Code(r),this.R=D.b64Code(navigator.userAgent)}function q(e,t,n,o,r,i,a,s,c,f,u,d){y.apply(this),this.i=e,this.method=t,this.g=D.b64Code(o),this.S=D.b64Code(r),this.T=i,this.U=a,this.V=s,this.headerText=D.b64Code(n),this.W=D.b64Code(c),this.X=D.b64Code(f),this.h=u,this.u=d}function Y(e,t,n,o){y.apply(this),this.i=e,this.Y=D.b64Code(t),this.Z=n,this.aa=o||"jpeg"}function z(e,t,n,o){y.apply(this),this.i=e,this.ba=n,this.ca=D.b64Code(t),this.T=o}function G(e,t,n,o,r){this.c=e,this.a=D.getWebMonitorId(),this.da=t,this.ea=n,this.i=o,this.Y=r,this.h=(new Date).getTime()}function X(){var e=parseInt(E[L],10),t=(new Date).getTime()-e,n=D.getWfCookie("ACTIVE_TIME_INFO")||{},o=n.ACTIVE_TIME?1*n.ACTIVE_TIME[I]:t;0===o&&t<=1e4&&(o=t);var r=JSON.stringify(new m(t,o));navigator&&"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(c,r)}function Z(){V.ACTIVE_TIME[I]=0,D.setWfCookie("ACTIVE_TIME_INFO",V,W);var h=new Date,g=h.getFullYear(),v=h.getMonth(),w=h.getDate();try{var e=x.pv,t=x.je,n=x.hl,o=x.rl,r=x.bl;e.s&&(Q(),D.addLoadEvent(function(){setTimeout(function(){if(N){var e="load";e=N[0]&&"navigate"===N[0].type?"load":"reload";var t=b,n=t.fetchStart,o=D.perfSubtract(t.responseStart,n),r=D.perfSubtract(t.domContentLoadedEventEnd,n),i=D.perfSubtract(t.loadEventStart,n),a=D.perfSubtract(t.domainLookupEnd,t.domainLookupStart),s=D.perfSubtract(t.connectEnd,t.connectStart),c=D.perfSubtract(t.connectEnd,t.secureConnectionStart),f=D.perfSubtract(t.responseStart,t.requestStart),u=D.perfSubtract(t.responseEnd,t.responseStart),d=D.perfSubtract(t.domInteractive,t.responseEnd),l=D.perfSubtract(t.loadEventStart,t.domContentLoadedEventEnd),p=navigator&&navigator.connection&&navigator.connection.effectiveType||"unknown",h=new B(C,e,o,r,i,a,s,c,f,u,d,l,p);h.handleLogInfo(C,h)}},1e3)}),!1===a&&function(){if(T.Event&&"function"==typeof T.Event){function e(e){var t=history[e],n=new Event(e);return function(){var e=t.apply(this,arguments);return n.arguments=arguments,T.dispatchEvent(n),e}}history.pushState=e("pushState"),history.replaceState=e("replaceState")}T.addEventListener("hashchange",function(){Q(1)}),T.addEventListener("popstate",function(){var e=T.location.href.split("?")[0].split("#")[0];i!=e&&(Q(0),i=e)}),T.addEventListener("pushState",function(e){Q(0)}),T.addEventListener("replaceState",function(e){Q(0)})}()),t.s&&function(){if(T.onerror=function(e,t,n,o,r){ee("on_error",e,t,n,o,r?r.stack:null)},!0===a)return;var o=console.error;console.error=function(e){var t=e&&e.message||e,n=e&&e.stack;if(n)ee("on_error",t,s,0,0,n);else{if("object"==typeof t)try{t=JSON.stringify(t)}catch(e){t="错误无法解析"}ee("console_error",t,s,0,0,"CustomizeError: "+t)}return o.apply(console,arguments)},T.onunhandledrejection=function(e){var t="",n="";n="object"==typeof e.reason?(t=e.reason.message,e.reason.stack):(t=e.reason,""),": "===t&&(t=n),ee("on_error",t,s,0,0,"UncaughtInPromiseError: "+n)}}(),n.s&&!1===a&&function(){var i={};function a(e){var t=new CustomEvent(e,{detail:this});T.dispatchEvent(t)}var s=T.XMLHttpRequest;function r(e,t){if(w[e]&&!0!==w[e].uploadFlag){var n=D.checkHttpReqResLen(t,"res"),o=w[e].simpleUrl,r=(new Date).getTime(),i=w[e].event.detail.responseURL,a=w[e].event.detail.status,s=w[e].event.detail.statusText,c=r-w[e].timeStamp;if(i){for(var f=!1,u=0;u<A.length;u++)if(-1!==i.indexOf(A[u])){f=!0;break}if(!0!==f&&D.checkIgnore("hl",i)){var d=w[e].event.detail.wfHttpRecord,l=D.checkHttpReqResLen(d.requestBody,"req"),p=d.method||"",h=JSON.stringify(d.header||{}),g=new q(S,p,"",o,i,a,s,"request","","",w[e].timeStamp,0),v=new q(S,p,h,o,i,a,s,"response",l,n,r,c);j.push(g,v),w[e].uploadFlag=!0}}}}var w=[];T.XMLHttpRequest=function(){var o=new s;o.wfTraceId=D.getUuid(),i[o.wfTraceId]={method:"",url:"",async:"",header:{},requestBody:""};var e=o.onreadystatechange;o.onreadystatechange=e&&"function"==typeof e?function(){return e.apply(o,arguments)}:function(){if(4===this.readyState&&!1===this.wfHttpRecord.async){var e=this.wfHttpRecord.sendTime,t=this.wfHttpRecord.method,n=this.wfHttpRecord.url,o=n.split("?")[0],r=JSON.stringify(this.wfHttpRecord.header||{}),i=D.checkHttpReqResLen(this.wfHttpRecord.requestBody||"","req"),a=D.checkHttpReqResLen(this.responseText||"","res"),s=(new Date).getTime(),c=this.status,f=this.statusText,u=s-e,d=new q(S,t,"",o,n,c,f,"request","","",e,0),l=new q(S,t,r,o,n,c,f,"response",i,a,s,u);j.push(d,l)}};var n=o.setRequestHeader;o.setRequestHeader=function(){if(arguments.length&&o.wfTraceId&&i[o.wfTraceId]){var e=arguments[0],t=arguments[1];i[o.wfTraceId].header[e]=t}return n.apply(o,arguments)};var r=o.open;r&&(o.open=function(){if(arguments.length&&o.wfTraceId&&i[o.wfTraceId]){var e=arguments[0],t=arguments[1],n=arguments[2];i[o.wfTraceId].method=e,i[o.wfTraceId].url=t,i[o.wfTraceId].async=n}return r.apply(o,arguments)});var t=o.send;return t&&(o.send=function(){if(arguments.length&&o.wfTraceId&&i[o.wfTraceId]){var e=arguments[0];i[o.wfTraceId].requestBody=e}return this.wfHttpRecord=i[o.wfTraceId]||{},this.wfHttpRecord&&(this.wfHttpRecord.sendTime=(new Date).getTime()),delete i[o.wfTraceId],t.apply(o,arguments)}),o.addEventListener("loadstart",function(){a.call(this,"ajaxLoadStart")},!1),o.addEventListener("loadend",function(){a.call(this,"ajaxLoadEnd")},!1),o},T.addEventListener("ajaxLoadStart",function(e){var t={timeStamp:(new Date).getTime(),event:e,simpleUrl:T.location.href.split("?")[0],uploadFlag:!1};w.push(t)}),T.addEventListener("ajaxLoadEnd",function(){for(var o=0;o<w.length;o++){if(!0!==w[o].uploadFlag)if(0<w[o].event.detail.status)if("blob"===(w[o].event.detail.responseType+"").toLowerCase())!function(t){var n=new FileReader;n.onload=function(){var e=n.result;r(t,e)};try{n.readAsText(w[o].event.detail.response,"utf-8")}catch(e){r(t,w[o].event.detail.response+"")}}(o);else try{var e=w[o]&&w[o].event&&w[o].event.detail;if(!e)return;var t=e.responseType,n="";""!==t&&"text"!==t||(n=e.responseText),"json"===t&&(n=JSON.stringify(e.response)),r(o,n)}catch(e){}}})}(),o.s&&!1===a&&T.addEventListener("error",function(e){var t=e.target.localName,n="";if("link"===t?n=e.target.href:"script"===t&&(n=e.target.src),n=n?n.split("?")[0]:"",D.checkIgnore("rl",n)&&-1==n.indexOf("pv.sohu.com/cityjson")){var o=new z(M,n,t,"0");o.handleLogInfo(M,o)}},!0),r.s&&!1===a&&D.addOnclickForDocument(function(e){if(e){var t="",n="",o="",r=e.target.tagName,i="";"svg"!=e.target.tagName&&"use"!=e.target.tagName&&(t=e.target.className,n=e.target.placeholder||"",o=e.target.value||"",100<(i=e.target.innerText?e.target.innerText.replace(/\s*/g,""):"").length&&(i=i.substring(0,50)+" ... "+i.substring(i.length-49,i.length-1)),i=i.replace(/\s/g,""));var a=new F(O,"click",t,n,o,r,i);a.handleLogInfo(O,a)}}),D.addOnBeforeUnloadEvent(function(){X()});var y=0,m=R;setInterval(function(){var e=parseInt(x.wc||"40",10);if(e="connected"==E.ds?5:e,0<y&&y%5==0){if(10<=j.length){for(var t="",n=0;n<j.length;n++){var o=j[n];o&&(t+=JSON.stringify(o)+"$$$")}D.upLog(t,!1)}else{var r="";for(n=0;n<j.length;n++){var i=j[n];i&&(r+=JSON.stringify(i)+"$$$")}E[S]+=r,3e4<=E[S].length&&(D.upLog(E[S],!1),E[S]="")}j=[]}if(e<=y){var a="";for(n=0;n<m.length;n++)a+=E[m[n]]||"";0<a.length&&D.upLog(a,!0),y=0;var s=D.getWfCookie("ACTIVE_TIME_INFO")||{},c={};s.ACTIVE_TIME?c=s.ACTIVE_TIME:s.ACTIVE_TIME={};var f=c[I]||0;0<a.length&&(s.ACTIVE_TIME[I]=1*f+200*e),D.setWfCookie("ACTIVE_TIME_INFO",s,W);var u=new Date((new Date).getTime()+1e4),d=u.getFullYear(),l=u.getMonth(),p=u.getDate();(g<d||v<l||w<p)&&(X(),E[L]=(new Date).getTime(),h=new Date,g=h.getFullYear(),v=h.getMonth(),w=h.getDate())}y++},200)}catch(e){console.error("监控代码异常,捕获",e)}}function Q(e){var t=encodeURIComponent(T.location.href.split("?")[0]),n=(new Date).getTime();if(t===J&&n-P<300)P=n;else{P=n,J=t;var o=x.lc;o&&!0===o.s&&D.getIp(),D.setPageKey();var r=D.isTodayBrowse(k);E[L]=n;var i=null,a=D.formatDate(n,"y-M-d"),s=E[$];if(s){var c=s.split("$$$"),f=c[0],u=c[1],d=parseInt(c[2],10);a==u?t!=f&&1==d&&(E[$]=t+"$$$"+a+"$$$2",i=new K(2)):(E[$]=t+"$$$"+a+"$$$1",i=new K(1))}else E[$]=t+"$$$"+a+"$$$1",i=new K(1);var l="";N&&(l=N[0]&&"navigate"===N[0].type?"load":"reload");var p=D.getKeyByWebMonitorId(D.getWebMonitorId()),h=p.customerKey;if("new"===p.status)g="n_uv";else{var g="",v=h?h.match(/\d{14}/g):[];if(v&&0<v.length){var w=v[0].match(/\d{2}/g),y=w[0]+w[1]+"-"+w[2]+"-"+w[3]+" "+w[4]+":"+w[5]+":"+w[6],m=new Date(y).getTime(),b=(new Date).getTime();g=2e3<b-m?0==r?"o_uv":"o":"n_uv"}}var I=document.referrer?document.referrer.split("?")[0]:"",C=D.b64Code(I),S=E.ds;S||!0!==o.s?("connected"===S&&D.initDebugTool(),setTimeout(function(){"connected"===S&&D.uploadLocalInfo()},2e3),O(e)):D.getIp(function(){O()})}function O(n){var e=T.location.href;function t(){var e=new U(_,l,0,g,C),t=JSON.stringify(e)+"$$$";i&&(t+=JSON.stringify(i)+"$$$"),n?e.handleLogInfo(_,e):D.upLog(t,!1)}D.checkIgnore("pv",e)&&(D.getCusInfo("userId")?t():setTimeout(function(){t()},3e3))}}function ee(e,t,n,o,r,i){var a=t||"",s=i||"",c="",f="";if((0!==a.length||0!==s.length)&&(1e3<=a.length&&(a=a.substring(0,999)),3e3<=s.length&&(s=s.substring(0,2999)),80<=a.length?f=a.substring(0,80):0<a.length&&a.length<80&&(f=a),D.checkIgnore("je",a))){if(a)if("string"==typeof s)c=s.split(": ")[0].replace('"',"");else c=JSON.stringify(s).split(": ")[0].replace('"',"");var u=new H(l,e,c+": "+f,c+": "+a,s);u.handleLogInfo(l,u)}}U.prototype=new w,K.prototype=new w,m.prototype=new w,B.prototype=new w,F.prototype=new w,H.prototype=new w,q.prototype=new w,Y.prototype=new w,z.prototype=new w,G.prototype=new w,new w;for(var te=x.ia||[],ne=!1,oe=0;oe<te.length;oe++){var re=te[oe].replace(/ /g,"");if(re&&-1!=(T.location.href+T.location.hash).indexOf(re)){ne=!0;break}}var ie=D.getWfCookie("webfunnyStart")||x.s;if(ie&&"p"!=ie&&!ne){var ae=D.getWfCookie("samplingChoose");if(2===ae)return;if(1===ae)Z();else{var se=x.sc||{r:100,c:3},ce=se.r,fe=1*se.c;if(ce<100){var ue=Math.ceil(100*Math.random()),de=(new Date).getTime()+24*fe*3600*1e3;ue<=ce?(D.setWfCookie("samplingChoose",1,de),Z()):D.setWfCookie("samplingChoose",2,de)}else Z()}}T.webfunny={getCustomerKey:function(){return D.getKeyByWebMonitorId(D.getWebMonitorId()).customerKey},wm_upload_picture:function(e,t,n){var o=new Y(p,t,e,n||"jpeg");o.handleLogInfo(p,o)},wm_upload_extend_log:function(e,t,n,o,r){var i=new G(e,t,n,o,r);i.handleLogInfo(h,i)}},function(){if("function"==typeof T.CustomEvent)return;function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}e.prototype=T.Event.prototype,T.CustomEvent=e}()}(window),window.LZString=(w=String.fromCharCode,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",i={},a={compressToEncodedURIComponent:function(e){return null==e?"":a._compress(e,6,function(e){return r.charAt(e)})},decompressFromEncodedURIComponent:function(t){return null==t?"":""==t?null:(t=t.replace(/ /g,"+"),a._decompress(t.length,32,function(e){return function(e,t){if(!i[e]){i[e]={};for(var n=0;n<e.length;n++)i[e][e.charAt(n)]=n}return i[e][t]}(r,t.charAt(e))}))},_compress:function(e,t,n){if(null==e)return"";var o,r,i,a={},s={},c="",f="",u="",d=2,l=3,p=2,h=[],g=0,v=0;for(i=0;i<e.length;i+=1)if(c=e.charAt(i),Object.prototype.hasOwnProperty.call(a,c)||(a[c]=l++,s[c]=!0),f=u+c,Object.prototype.hasOwnProperty.call(a,f))u=f;else{if(Object.prototype.hasOwnProperty.call(s,u)){if(u.charCodeAt(0)<256){for(o=0;o<p;o++)g<<=1,v==t-1?(v=0,h.push(n(g)),g=0):v++;for(r=u.charCodeAt(0),o=0;o<8;o++)g=g<<1|1&r,v==t-1?(v=0,h.push(n(g)),g=0):v++,r>>=1}else{for(r=1,o=0;o<p;o++)g=g<<1|r,v==t-1?(v=0,h.push(n(g)),g=0):v++,r=0;for(r=u.charCodeAt(0),o=0;o<16;o++)g=g<<1|1&r,v==t-1?(v=0,h.push(n(g)),g=0):v++,r>>=1}0==--d&&(d=Math.pow(2,p),p++),delete s[u]}else for(r=a[u],o=0;o<p;o++)g=g<<1|1&r,v==t-1?(v=0,h.push(n(g)),g=0):v++,r>>=1;0==--d&&(d=Math.pow(2,p),p++),a[f]=l++,u=String(c)}if(""!==u){if(Object.prototype.hasOwnProperty.call(s,u)){if(u.charCodeAt(0)<256){for(o=0;o<p;o++)g<<=1,v==t-1?(v=0,h.push(n(g)),g=0):v++;for(r=u.charCodeAt(0),o=0;o<8;o++)g=g<<1|1&r,v==t-1?(v=0,h.push(n(g)),g=0):v++,r>>=1}else{for(r=1,o=0;o<p;o++)g=g<<1|r,v==t-1?(v=0,h.push(n(g)),g=0):v++,r=0;for(r=u.charCodeAt(0),o=0;o<16;o++)g=g<<1|1&r,v==t-1?(v=0,h.push(n(g)),g=0):v++,r>>=1}0==--d&&(d=Math.pow(2,p),p++),delete s[u]}else for(r=a[u],o=0;o<p;o++)g=g<<1|1&r,v==t-1?(v=0,h.push(n(g)),g=0):v++,r>>=1;0==--d&&(d=Math.pow(2,p),p++)}for(r=2,o=0;o<p;o++)g=g<<1|1&r,v==t-1?(v=0,h.push(n(g)),g=0):v++,r>>=1;for(;;){if(g<<=1,v==t-1){h.push(n(g));break}v++}return h.join("")},_decompress:function(e,t,n){var o,r,i,a,s,c,f,u=[],d=4,l=4,p=3,h="",g=[],v={val:n(0),position:t,index:1};for(o=0;o<3;o+=1)u[o]=o;for(i=0,s=Math.pow(2,2),c=1;c!=s;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=t,v.val=n(v.index++)),i|=(0<a?1:0)*c,c<<=1;switch(i){case 0:for(i=0,s=Math.pow(2,8),c=1;c!=s;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=t,v.val=n(v.index++)),i|=(0<a?1:0)*c,c<<=1;f=w(i);break;case 1:for(i=0,s=Math.pow(2,16),c=1;c!=s;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=t,v.val=n(v.index++)),i|=(0<a?1:0)*c,c<<=1;f=w(i);break;case 2:return""}for(r=u[3]=f,g.push(f);;){if(v.index>e)return"";for(i=0,s=Math.pow(2,p),c=1;c!=s;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=t,v.val=n(v.index++)),i|=(0<a?1:0)*c,c<<=1;switch(f=i){case 0:for(i=0,s=Math.pow(2,8),c=1;c!=s;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=t,v.val=n(v.index++)),i|=(0<a?1:0)*c,c<<=1;u[l++]=w(i),f=l-1,d--;break;case 1:for(i=0,s=Math.pow(2,16),c=1;c!=s;)a=v.val&v.position,v.position>>=1,0==v.position&&(v.position=t,v.val=n(v.index++)),i|=(0<a?1:0)*c,c<<=1;u[l++]=w(i),f=l-1,d--;break;case 2:return g.join("")}if(0==d&&(d=Math.pow(2,p),p++),u[f])h=u[f];else{if(f!==l)return null;h=r+r.charAt(0)}g.push(h),u[l++]=r+h.charAt(0),r=h,0==--d&&(d=Math.pow(2,p),p++)}}}),void 0===(o=function(){return window.LZString}.call(t,n,t,e))||(e.exports=o)}]);