!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.lib=e():t.lib=e()}(window,function(){return n=[function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;nt.length)&&(e=t.length);for(var n=0,r=new Array(e);nn&&(c.webPrint.warn("LTS.0003|".concat(u.replace("$1",t).replace("$2",n))),1)):(c.webPrint.warn("LTS.0001|".concat(l.replace("$1",t))),!1)},r.checkPattern=function(t,e,n){return!!n.test(e)||(c.webPrint.warn("LTS.0006|".concat(t," doesn't match pattern.")),!1)},r.checkObjectTypeAndLength=function(t,e,n){return t&&"object"!==a(t)||"boolean"==typeof t?(c.webPrint.warn("LTS.0002|".concat(f.replace("$1",e))),!1):!(Object.keys(t).length>n&&(c.webPrint.warn("LTS.0003|".concat(u.replace("$1",e).replace("$2",n))),1))},r.checkLabels=function(t){var n;return!t||(n=!0,Object.entries(t||{}).forEach(function(t){var t=o(t,2),e=t[0],t=t[1];(0,r.checkLogParamString)("labels key:".concat(e),e,64)||(n=!1),(0,r.checkPattern)("labels key:".concat(e),e,/^[a-zA-Z][A-Za-z0-9_]*$/)||(n=!1),(0,r.checkLogParamString)("labels value",t,256)&&(0,r.excludeObject)(t,"labels value of :".concat(e))||(n=!1)}),n&&(0,r.checkObjectTypeAndLength)(t,"labels",50))};r.checkConfigKey=function(t){var e,n=new Set(["url","region","projectId","groupId","streamId","group","cacheThreshold","timeThreshold","debug","platform","logLevel","timeInterval"]);return!t||(e=!0,Object.keys(t).forEach(function(t){n.has(t)||(e=!1)}),e||c.webPrint.warn("LTS.0007|Invalid configuration parameters."),e)}},function(t,e,n){"use strict";function r(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){var n;if(t)return"string"==typeof t?o(t,e):"Map"===(n="Object"===(n=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:n)||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n=t.cacheThreshold&&this.uploadData(t,e)}},{key:"writeLog",value:function(e,n,t,r){var o=this;t&&(0,u.checkLabels)(r)&&(Array.isArray(t)?t.forEach(function(t){o.addLogToList(e,n,t,r)}):this.addLogToList(e,n,t,r))}},{key:"addLogToList",value:function(t,e,n,r){(0,u.checkObjectTypeAndLength)(n,"content",300)?(r={labels:JSON.stringify(r,this.censor),content:this.formatLogContent(n),sendState:"READY",log_time_ns:(new Date).getTime()},e.push(r),this.logUploadPolicyThreshold(t,e)):(l.webPrint.initLogLevel(t),l.webPrint.warn("LTS.0002|Log content is invalid."))}},{key:"formatLogContent",value:function(t){var e=JSON.stringify(t,this.censor);return 30720<(null==e?void 0:e.length)?{content:e.substring(0,30720)}:t}}])&&o(e.prototype,n),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.default=new n},function(t,e,n){"use strict";n.r(e),n.d(e,"__extends",function(){return o}),n.d(e,"__assign",function(){return i}),n.d(e,"__rest",function(){return a}),n.d(e,"__decorate",function(){return c}),n.d(e,"__param",function(){return u}),n.d(e,"__metadata",function(){return l}),n.d(e,"__awaiter",function(){return f}),n.d(e,"__generator",function(){return s}),n.d(e,"__createBinding",function(){return d}),n.d(e,"__exportStar",function(){return h}),n.d(e,"__values",function(){return p}),n.d(e,"__read",function(){return y}),n.d(e,"__spread",function(){return b}),n.d(e,"__spreadArrays",function(){return g}),n.d(e,"__await",function(){return v}),n.d(e,"__asyncGenerator",function(){return m}),n.d(e,"__asyncDelegator",function(){return w}),n.d(e,"__asyncValues",function(){return S}),n.d(e,"__makeTemplateObject",function(){return L}),n.d(e,"__importStar",function(){return O}),n.d(e,"__importDefault",function(){return j}),n.d(e,"__classPrivateFieldGet",function(){return P}),n.d(e,"__classPrivateFieldSet",function(){return _}); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ var r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){t.__proto__=e}:function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}))(t,e)};function o(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;nc[0]&&e[1]=t.length?void 0:t)&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(void 0===e||0>>=1,n+=n)1&r&&(t=n+t);return t}return[a(e.toString(16),8),a(n.toString(16),4),a((16384|t).toString(16),4),a((128|r).toString(16),2),a(o.toString(16),2),a(i.toString(16),12)].join("")}}])&&i(e.prototype,n),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),t}();e.UUID=new r},function(t){t.exports=JSON.parse('{"name":"@cloud/lts-web-sdk","version":"1.0.15","description":"lts-web-sdk","main":"./websdk.min.js","license":"MIT","scripts":{"debug":"http-serve -p 8080","build":"rimraf dist && cross-env NODE_ENV=development webpack --config webpack.config.js","build:prod":"rimraf dist && tsc -p tsconfig.json && cross-env NODE_ENV=production webpack --config webpack.config.js","lint":"eslint --ext .js src/","jest":"jest --coverage --watch","fix-lint":"eslint --ext .js src/ --fix","build:baidu":"rimraf lib && npx babel src --out-dir dist/src","build:bd":"rimraf dist && tsc -p tsconfig.json && cross-env NODE_ENV=production webpack --config webpack.config.js","build:cdn":"rimraf dist && tsc -p tsconfig.json && cross-env NODE_ENV=production webpack --config webpack-cdn.config.js","tsc":"tsc -p tsconfig.json","test":"mocha --exit","test-report":"tsc -p tsconfig.json && nyc --reporter=html mocha --exit"},"devDependencies":{"@babel/cli":"^7.4.3","@babel/core":"^7.4.3","@babel/preset-env":"^7.4.3","@cloud/eslint-config-cbc":"^1.7.3","babel-eslint":"^10.1.0","babel-loader":"^8.0.5","babel-plugin-syntax-dynamic-import":"^6.18.0","cross-env":"^5.2.1","eslint":"^6.1.0","http-serve":"^1.0.1","jest":"^27.4.5","mocha":"^10.2.0","nyc":"^15.1.0","sinon":"^15.2.0","uglifyjs-webpack-plugin":"^2.1.2","webpack":"^4.29.6","webpack-cli":"^3.3.0"}}')},function(t,e,n){"use strict";function o(t){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){for(var n=0;n>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s>>2]=o[s>>>2];return this.sigBytes+=n,this},clamp:function(){var t=this.words,o=this.sigBytes;t[o>>>2]&=4294967295<<32-o%4*8,t.length=e.ceil(o/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],o=0;o>>2]>>>24-n%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,o=[],r=0;r>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(o,t/2)}},f=d.Latin1={stringify:function(e){for(var t=e.words,o=e.sigBytes,r=[],n=0;n>>2]>>>24-n%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,o=[],r=0;r>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(o,t)}},l=d.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var o,r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=4*a,d=i/s;d=t?e.ceil(d):e.max((0|d)-this._minBufferSize,0);var u=d*a,f=e.min(4*u,i);if(u){for(var l=0;l>>32-i)+t}function r(e,t,o,r,n,i,a){var s=e+(t&r|o&~r)+n+a;return(s<>>32-i)+t}function n(e,t,o,r,n,i,a){var s=e+(t^o^r)+n+a;return(s<>>32-i)+t}function i(e,t,o,r,n,i,a){var s=e+(o^(t|~r))+n+a;return(s<>>32-i)+t}var a=e,s=a.lib,c=s.WordArray,d=s.Hasher,u=a.algo,f=[];!function(){for(var e=0;e<64;e++)f[e]=4294967296*t.abs(t.sin(e+1))|0}();var l=u.MD5=d.extend({_doReset:function(){this._hash=new c.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var a=0;a<16;a++){var s=t+a,c=e[s];e[s]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}var d=this._hash.words,u=e[t+0],l=e[t+1],p=e[t+2],g=e[t+3],h=e[t+4],m=e[t+5],w=e[t+6],_=e[t+7],v=e[t+8],C=e[t+9],x=e[t+10],y=e[t+11],k=e[t+12],S=e[t+13],I=e[t+14],E=e[t+15],O=d[0],b=d[1],T=d[2],L=d[3];O=o(O,b,T,L,u,7,f[0]),L=o(L,O,b,T,l,12,f[1]),T=o(T,L,O,b,p,17,f[2]),b=o(b,T,L,O,g,22,f[3]),O=o(O,b,T,L,h,7,f[4]),L=o(L,O,b,T,m,12,f[5]),T=o(T,L,O,b,w,17,f[6]),b=o(b,T,L,O,_,22,f[7]),O=o(O,b,T,L,v,7,f[8]),L=o(L,O,b,T,C,12,f[9]),T=o(T,L,O,b,x,17,f[10]),b=o(b,T,L,O,y,22,f[11]),O=o(O,b,T,L,k,7,f[12]),L=o(L,O,b,T,S,12,f[13]),T=o(T,L,O,b,I,17,f[14]),b=o(b,T,L,O,E,22,f[15]),O=r(O,b,T,L,l,5,f[16]),L=r(L,O,b,T,w,9,f[17]),T=r(T,L,O,b,y,14,f[18]),b=r(b,T,L,O,u,20,f[19]),O=r(O,b,T,L,m,5,f[20]),L=r(L,O,b,T,x,9,f[21]),T=r(T,L,O,b,E,14,f[22]),b=r(b,T,L,O,h,20,f[23]),O=r(O,b,T,L,C,5,f[24]),L=r(L,O,b,T,I,9,f[25]),T=r(T,L,O,b,g,14,f[26]),b=r(b,T,L,O,v,20,f[27]),O=r(O,b,T,L,S,5,f[28]),L=r(L,O,b,T,p,9,f[29]),T=r(T,L,O,b,_,14,f[30]),b=r(b,T,L,O,k,20,f[31]),O=n(O,b,T,L,m,4,f[32]),L=n(L,O,b,T,v,11,f[33]),T=n(T,L,O,b,y,16,f[34]),b=n(b,T,L,O,I,23,f[35]),O=n(O,b,T,L,l,4,f[36]),L=n(L,O,b,T,h,11,f[37]),T=n(T,L,O,b,_,16,f[38]),b=n(b,T,L,O,x,23,f[39]),O=n(O,b,T,L,S,4,f[40]),L=n(L,O,b,T,u,11,f[41]),T=n(T,L,O,b,g,16,f[42]),b=n(b,T,L,O,w,23,f[43]),O=n(O,b,T,L,C,4,f[44]),L=n(L,O,b,T,k,11,f[45]),T=n(T,L,O,b,E,16,f[46]),b=n(b,T,L,O,p,23,f[47]),O=i(O,b,T,L,u,6,f[48]),L=i(L,O,b,T,_,10,f[49]),T=i(T,L,O,b,I,15,f[50]),b=i(b,T,L,O,m,21,f[51]),O=i(O,b,T,L,k,6,f[52]),L=i(L,O,b,T,g,10,f[53]),T=i(T,L,O,b,x,15,f[54]),b=i(b,T,L,O,l,21,f[55]),O=i(O,b,T,L,v,6,f[56]),L=i(L,O,b,T,E,10,f[57]),T=i(T,L,O,b,w,15,f[58]),b=i(b,T,L,O,S,21,f[59]),O=i(O,b,T,L,h,6,f[60]),L=i(L,O,b,T,y,10,f[61]),T=i(T,L,O,b,p,15,f[62]),b=i(b,T,L,O,C,21,f[63]),d[0]=d[0]+O|0,d[1]=d[1]+b|0,d[2]=d[2]+T|0,d[3]=d[3]+L|0},_doFinalize:function(){var e=this._data,o=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;o[n>>>5]|=128<<24-n%32;var i=t.floor(r/4294967296),a=r;o[15+(n+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),o[14+(n+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),e.sigBytes=4*(o.length+1),this._process();for(var s=this._hash,c=s.words,d=0;d<4;d++){var u=c[d];c[d]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return s},clone:function(){var e=d.clone.call(this);return e._hash=this._hash.clone(),e}});a.MD5=d._createHelper(l),a.HmacMD5=d._createHmacHelper(l)})(Math),e.MD5}(e.csdn.reportCryptoJS)}(window),function(e){var t,o,r,n,i,a,s,c,d,u,f,l,p,g,h;i=[],a=[],t={DELAY:500,DELAY_LTS_VIEW:200,API_VERSION:"0.6.0",SERVER_URL:"https://event.csdn.net/"},l=["utm_source"],t.SERVER_URL,t.SERVER_URL,t.API_VERSION,t.SERVER_URL,t.API_VERSION,t.SERVER_URL,n={SCROLL:"scroll",PV:"pv",VIEW:"view",DELAY_VIEW:"delay_view",CLICK:"click"},c={SKIPPED_AND_VISIBLE:"0",VISIBLE:"1"};var m={region:"cn-north-4",projectId:"06981375190026432f77c01bfca33e32",groupId:"dadde766-b087-42da-8e67-d2499a520ee7",tags:{userAgent:window.navigator.userAgent}},w={region:m.region,projectId:m.projectId,groupId:m.groupId,url:"https://eva2.csdn.net",debug:!1,logLevel:"ERROR",cacheThreshold:30,timeThreshold:2},_={PV:"5da0dae3-481b-478b-92ca-3caa293e4a29",CLICK:"099503df-60e8-4167-9a96-d6fb66f3fd01",VIEW:"ea448b34-0491-4546-87aa-059120b54c53",MOUSE:"a0119567-bf91-4314-ab75-f683ba6c0c0a"},v={PV:Object.assign({},m,{streamId:_.PV}),CLICK:Object.assign({},m,{streamId:_.CLICK}),VIEW:Object.assign({},m,{streamId:_.VIEW}),MOUSE:Object.assign({},m,{streamId:_.MOUSE})},C={PV:new LTS_WEB_SDK(Object.assign({},w,{streamId:_.PV})),CLICK:new LTS_WEB_SDK(Object.assign({},w,{streamId:_.CLICK})),VIEW:new LTS_WEB_SDK(Object.assign({},w,{streamId:_.VIEW})),MOUSE:new LTS_WEB_SDK(Object.assign({},w,{streamId:_.MOUSE}))};if(r={isCSDNApp:function(){var e=!!window.navigator.userAgent.toLowerCase().match(/(csdn)/i),t=r.getCookie("X-App-ID")||"";return e||"CSDN-APP"==t||"CSDN-EDU"==t},isMobile:function(){var e=/(phone|pad|pod|iphone|ipod|ios|ipad|android|mobile|blackberry|iemobile|mqqbrowser|juc|fennec|wosbrowser|browserng|webos|symbian|windows phone|csdn)/i.test(navigator.userAgent);return/(MicroMessenger)/i.test(navigator.userAgent)?!/(WindowsWechat|MacWechat)/i.test(navigator.userAgent):e},guid:function(){return+new Date+"-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)})},setLogIdCookie:function(e){if(-1!==["pv","click","view"].indexOf(e)){var t="log_Id_"+e,o=r.getCookie(t)||0;try{o=parseInt(o),"number"==typeof o&&isNaN(o)||o>=1e8?r.setCookie(t,1,18e5):r.setCookie(t,++o,18e5)}catch(e){void 0}}},getRequest:function(){for(var e=new Object,t=window.location.href.split("?")[1]||"",o=t.split("&"),r=0;r-1&&(r.setCookie("c_page_id","",-1),r.setCookie("c_mod","",-1))},preserveTraceInfo:function(e){e.mod&&r.setCookie("c_mod",e.mod,36e5),e.page_id?r.setCookie("c_page_id",e.page_id,36e5):r.setCookie("c_page_id","default",36e5)},getTimestamp:function(){return Math.round(new Date/1e3)},getXPath:function(e){if(""!==e.id)return'//*[@id="'+e.id+'"]';if(e==document.body)return"/html/"+e.tagName.toLowerCase();if(!e.parentNode)return"";for(var t=1,o=e.parentNode.childNodes,r=0,n=o.length;r0?"csdn.net":this.topDomain(n);document.cookie=e+"="+escape(t)+";expires="+r.toGMTString()+";path=/ ; domain=."+i},setUserSegment:function(){var e=(null!=(_ref1=/(; )?(uuid_tt_dd|_javaeye_cookie_id_)=([^;]+)/.exec(window.document.cookie))?_ref1[3]:void 0)||"",t=e?e.substring(e.length-6)%16:0;r.setCookie("c_segment",t)},setfirstPageInfo:function(){if(r.getCookie("c_first_ref")&&r.getCookie("c_first_ref").indexOf(".csdn.net")>-1)return void r.setCookie("c_first_ref","default");var e=new RegExp(/[a-zA-Z0-9][-a-zA-Z0-9]{0,62}(\.[a-zA-Z0-9][-a-zA-Z0-9]{0,62})+\.?/),t=window.document.referrer?window.document.referrer.match(e)[0]:"default";[".csdn.net","wx.tenpay.com","graph.qq.com","openapi.baidu.com","api.weibo.com","account.dcloud.net.cn/oauth","github.com/login/oauth","passport.gitcode.net"].some(function(e){return e.indexOf("/")>-1?(window.document.referrer||"default").indexOf(e)>-1:t.indexOf(e)>-1})&&(t="default");var o="11_"+(new Date).getTime()+"."+r.randomNum(6);return"default"!=t?(r.setCookie("c_first_ref",t),r.setCookie("c_first_page",window.location.href),void r.setCookie("c_dsid",o,18e5)):r.getCookie("c_first_ref")&&window.document.referrer?void 0:(r.setCookie("c_first_ref","default"),r.setCookie("c_first_page",window.location.href),void r.setCookie("c_dsid",o,18e5))},randomNum:function(e){for(var t=[],o=["0","1","2","3","4","5","6","7","8","9"],r=0;r3?e.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:\/\n]+)/im)[1].split(".").slice(-3).join("."):/\.?([a-z0-9\-]+\.[a-z0-9\-]+)(:\d+)?$/.exec(e)[1]},copyArr:function(e){for(var t=[],o=0;o-1?t:(t.con=t.con+",top_"+e(o).offset().top,t)},urlParamsToObj:function(e){var t={};return e.replace(/([^=&#]+)=([^&#]*)/g,function(){t[arguments[1]]=arguments[2]}),t},objToUrlParams:function(t){var o="";return e.each(t,function(e){o+="&"+e+"="+t[e]}),o.substr(1)},trackOrderSource:function(){var e=document.referrer;if(e){var t=document.createElement("a");t.href=e;var o=["passport","order.csdn.net","wx.tenpay.com","cart.csdn.net"],n=[/(^https:\/\/mall\.csdn\.net(:[0-9]{1,5})?\/cart$)/],i=!1;try{for(var a=0;a-1&&(i=!0);for(var a=0;a-1?(r.setCookie("c_pref",r.getCookie("c_ref")),r.setCookie("c_ref",e)):(r.setCookie("c_pref",r.getCookie("c_ref")),r.setCookie("c_ref",e.split("?")[0]))}}else window.navigator.userAgent.toLowerCase().indexOf("csdn")<0&&(r.setCookie("c_pref","default"),r.setCookie("c_ref","default"))},parseExtra:function(e){if(!Object.prototype.hasOwnProperty.call(e,"extra"))return"";var t=Object.prototype.toString.call(e.extra).slice(8,-1);if("Object"===t)return e.extra;if("String"!==t||!e.extra)return{};try{return JSON.parse(e.extra)}catch(t){void 0}},assignExtra:function(t){if(t&&(t.extra||s.extra)){var o=r.parseExtra(t);return o=e.extend(!0,{},s.extra||{},o||{}),JSON.stringify(o)}},getSortObjectMD5:function(e){var o=JSON.parse(JSON.stringify(e));if("Object"!==Object.prototype.toString.call(o).slice(8,-1))return"";try{o.APIVersion=t.API_VERSION;var r=[];for(var n in o)o.hasOwnProperty(n)&&r.push(n);r=r.sort();var i=r.reduce(function(e,t){return e+="&"+t+"="+o[t]},"").substring(1);return csdn.reportCryptoJS.MD5(i).toString()}catch(e){return void 0,""}},reportScroll:function(t){var o=e.extend(!0,{},s,t);try{var n=r.assignExtra(t||{});n&&(o.extra=n)}catch(e){t&&t.extra&&(o.extra=t.extra),void 0}o.tos=r.tos()+"",o.adb=(r.getCookie("c_adb")||0)+"",o.curl=window.location.href;var i=r.getFuzzyCookie("c_");i&&(o.cCookie=i),o.t=r.getTimestamp()+"",o.screen=r.getScreen(),o.un=r.getCookie("UN")||r.getCookie("UserName"),o.urn=p||r.guid(),o.vType=r.getCookie("p_uid")||"",o.hca=r.getCookie("HMACCOUNT"),Object.prototype.hasOwnProperty.call(o,"eleTop")&&(o.eleTop=o.eleTop+""),delete o.cfg,delete o.dest;var a={__source__:"csdn",__logs__:[o]},c=window.navigator.userAgent,d="PC";c.toLowerCase().indexOf("csdnedu")>-1?d="CSDNEDU":c.toLowerCase().indexOf("csdnapp")>-1?d="CSDNApp":c.toLowerCase().indexOf("mobile")>-1&&(d="mobile"),a.__tags__={useragent:c,platform:d}},windowFocusChange:function(e){"loading"!==document.readyState?g=document.hasFocus():window.addEventListener("DOMContentLoaded",function(){g=document.hasFocus(),e()},!0);var t=function(o){o.target===window&&(g=!0,e()),window.removeEventListener("focus",t,!0)};return window.addEventListener("focus",t,!0),g&&e(),g},throttleTrailing:function(e,t){var o=0,r=null;return function(){var n=Date.now(),i=this,a=arguments;n-o>t?(e.apply(i,a),o=n,r=null):(r&&(clearTimeout(r),r=null),r=setTimeout(function(){var n=Date.now();n-o>t&&(e.apply(i,a),o=n,r=null)},t-(n-o)))}},mousePositionChange:function(){var t={x:0,y:0,ev:"move"},o={x:0,y:0,ev:"click"},i=function(t){var o=e.extend(!0,{},s,t);try{var i=r.assignExtra(t||{});i&&(o.extra=i)}catch(e){t&&t.extra&&(o.extra=t.extra)}o.tos=r.tos(),o.adb=r.getCookie("c_adb")||0,o.curl=window.location.href;var a=r.getFuzzyCookie("c_");a&&(o.cCookie=a),o.t=r.getTimestamp(),o.screen=r.getScreen(),o.un=r.getCookie("UN")||r.getCookie("UserName"),o.urn=p,o.vType=r.getCookie("p_uid")||"",delete o.cfg,delete o.dest,o.log_id=r.getCookie("log_Id_"+n.PV),o.sign=r.getSortObjectMD5(o),o.hca=r.getCookie("HMACCOUNT"),r.analyticsWriteLog("MOUSE",o)};r.isMobile()?e(document).on("touchmove",r.throttleTrailing(function(e){var o=~~e.originalEvent.changedTouches[0].clientX,n=~~e.originalEvent.changedTouches[0].clientY;o===t.x&&n===t.y||(t.x=o,t.y=n,i({extra:JSON.stringify(t)}),r.refreshDcSessionId())},1e4)):e(document).on("mousemove",r.throttleTrailing(function(e){e.clientX===t.x&&e.clientY===t.y||(t.x=e.clientX,t.y=e.clientY,i({extra:JSON.stringify(t)}),r.refreshDcSessionId())},1e4)),e(document).on("click",r.throttleTrailing(function(e){e.clientX===o.x&&e.clientY===o.y||(o.x=e.clientX,o.y=e.clientY,i({extra:JSON.stringify(o)}),r.refreshDcSessionId())},1e4))}},o={timer:0,timerLts:0,checkTimer:0,getFullSpm:function(e){var t=e.split(".").length;if(2===t||3===t){var o=document.querySelector('meta[name="report"]'),r=o&&o.getAttribute("content")||"{}",n=JSON.parse(r);return n.spm?n.spm+"."+e:e}return e},reportUserAction:function(t,o){var n=this;t=t||["1px"],h=!1,r.windowFocusChange(function(){g&&!h&&(r.reportScroll({eleTop:1}),h=!0)}),e(function(){setTimeout(function(){n.reportPercent(function(e){h||(r.reportScroll({eleTop:e}),h=!0)},{scrollBar:!0,range:t,el:o||"",scope:"tenPrecentScrollEvent"})},800)})},reportPercent:function(t,o){o=o||{};for(var n=o.range||[25,50,75,100],i={},a=0;a-1&&(l=+l.replace("px",""),p=a),p>=l){if(f===n.length-1){c=l;break}if(p<("string"==typeof n[f+1]&&n[f+1].indexOf("px")>-1?+n[f+1].replace("px",""):n[f+1])){c=l;break}}}if(c)for(var g=0;g-1?+h.replace("px",""):h;m<=c&&!i[h]&&(i[h]=!0,t&&t(m))}n.every(function(e){return i[e]})&&e(o.el||window).off("scroll",window[o.scope])&&delete window[o.scope]},window[o.scope](),e(o.el||window).on("scroll",window[o.scope])},reportServerLts:function(e,o){r.refreshDcSessionId();var i=this;if(e&&o){if(r.setLogIdCookie(n.VIEW),e===n.VIEW||e===n.DELAY_VIEW){var s=window.navigator.userAgent,c="PC";s.toLowerCase().indexOf("csdnedu")>-1?c="CSDNEDU":s.toLowerCase().indexOf("csdnapp")>-1?c="CSDNApp":s.toLowerCase().indexOf("mobile")>-1&&(c="mobile"),o.platform=c,o.log_id=r.getCookie("log_Id_"+n.VIEW)}var d=function(){if(a.length){for(var e=0;e-1?c="CSDNEDU":s.toLowerCase().indexOf("csdnapp")>-1?c="CSDNApp":s.toLowerCase().indexOf("mobile")>-1&&(c="mobile"),a.__tags__={useragent:s,platform:c,log_id:r.getCookie("log_Id_"+n.VIEW)}}}},reportServerDelay:function(e,o){i.push(o);var r=this;r.timer&&clearTimeout(r.timer),r.timer=setTimeout(function(){r.reportServer(n.DELAY_VIEW)},t.DELAY)},reportView:function(t,o,i){if(!t)return void void 0;t.spm&&(t.spm=this.getFullSpm(t.spm));var a=e.extend(!0,{},s,t);try{var c=r.assignExtra(t);c&&(a.extra=c)}catch(e){t&&t.extra&&(a.extra=t.extra),void 0}var d=r.getFuzzyCookie("c_");a.t=r.getTimestamp()+"",a.eleTop=o?o.offset().top+"":"",delete a.cfg,d&&(a.cCookie=d),a.__time__=r.getTimestamp(),a.curl=window.location.href,a.urn=r.guid(),a.pv_urn=p,a.hca=r.getCookie("HMACCOUNT"),this.reportServerLts(n.VIEW,a),"function"==typeof csdn.afterReportView&&csdn.afterReportView(o,t)},reportClick:function(t,o){r.refreshDcSessionId();var i=e.extend(!0,{},s,t);t.spm||(i.spm="");try{var a=r.assignExtra(t);a&&(i.extra=a)}catch(e){t&&t.extra&&(i.extra=t.extra),void 0}i.spm=this.getFullSpm(i.spm),i.t=r.getTimestamp(),i.elePath=o?r.getXPath(o[0])+"":"",i.eleTop=void 0!==i.eleTop?i.eleTop:o?o.offset().top+"":"",i.trace&&r.preserveTraceInfo(i);var c=r.getFuzzyCookie("c_");c&&(i.cCookie=c),i.curl=window.location.href,delete i.cfg,r.setLogIdCookie(n.CLICK),i.log_id=r.getCookie("log_Id_"+n.CLICK),i.sign=r.getSortObjectMD5(i),i.pv_urn=p,i.hca=r.getCookie("HMACCOUNT"),r.analyticsWriteLog("CLICK",i)},reportPageView:function(t){var o=e.extend(!0,{},s,t),i=this;try{var a=r.assignExtra(t||{});a&&(o.extra=a)}catch(e){t&&t.extra&&(o.extra=t.extra),void 0}d&&d.percent&&(u&&clearTimeout(u),u=setTimeout(function(){i.reportPercent(function(e){i.reportClick({spm:"3001.7333",eleTop:e})})},1e3)),this.reportUserAction(),p=r.guid(),o.tos=r.tos(),o.adb=r.getCookie("c_adb")||0,o.curl=window.location.href;var c=r.getFuzzyCookie("c_");c&&(o.cCookie=c),o.t=r.getTimestamp(),o.screen=r.getScreen(),o.un=r.getCookie("UN")||r.getCookie("UserName"),o.urn=p,o.vType=r.getCookie("p_uid")||"",delete o.cfg,delete o.dest,r.setLogIdCookie(n.PV),o.log_id=r.getCookie("log_Id_"+n.PV),o.sign=r.getSortObjectMD5(o),o.lscreen=r.getPixel(),o.hca=r.getCookie("HMACCOUNT"),r.analyticsWriteLog("PV",o)},viewCheck:function(){var t=this;clearTimeout(t.checkTimer),t.checkTimer=setTimeout(function(){r.refreshDcSessionId(),e("[data-report-view]").each(function(){var o=e(this),n=o.data("reportView"),i=e.extend({},s,n);n.spm||(i.spm=""),i.spm=t.getFullSpm(i.spm),i.curl=window.location.href,r.isView(o.get(0),i.cfg.viewStrategy)&&(csdn.report.reportView(i,o),o.removeData("reportView"),o.removeAttr("data-report-view"))})},200)},isView:function(e){return r.isView(e)},addSpmToHref:function(e){var t=e,o=this,n=t.data("reportQuery")||"",i=t.length&&t[0].hash?t[0].hash.split("#").map(function(e){return e.split("?")[0]}):[],a=i.length&&-1===i[i.length-1].indexOf("/");if(n){var s=t.attr("href"),c=s,d={};-1!==s.indexOf("?")&&(c=s.split("?")[0],d=r.urlParamsToObj(s.split("?")[1])),a&&(c=s.split("#")[0],-1!==c.indexOf("?")&&(d=Object.assign({},d,r.urlParamsToObj(c.split("?")[1])),c=s.split("?")[0]));var u=r.urlParamsToObj(n);if((n.indexOf("spm")>-1||n.indexOf("SPM")>-1)&&(u.spm=u.spm||u.SPM,u.spm=o.getFullSpm(u.spm)),a){var f=i.pop();c+=i.join("#")+"?"+r.objToUrlParams(Object.assign(d,u))+"#"+f}else c+="?"+r.objToUrlParams(Object.assign(d,u));t.attr("href",c)}}},void 0===window.csdn&&(window.csdn={}),csdn.report)return void void 0;r.trackOrderSource(),window.csdn.report=o,s=r.initData(),s.disabled||csdn.report.reportPageView(),r.mousePositionChange(),e(function(){var t=csdn.report;e(document).on("click","[data-report-click]",function(){var o=e(this).data("reportClick");t.reportClick(o,e(this))}),t.viewCheck(e("[data-report-view]")),e(window).on("scroll",function(){t.viewCheck(e("[data-report-view]"))}),e(document).on("contextmenu","a[data-report-query]",function(){t.addSpmToHref(e(this))}),e(document).on("click","a[data-report-query]",function(){t.addSpmToHref(e(this))}),e(document).on("click","a[href]",function(){var o=e(this),r=o.attr("href");if(function(e){return!(!/^https:\/\/|^http:\/\//gi.test(e)||"/"===e||e.indexOf(".csdn.net")>-1||e.indexOf(".iteye.com")>-1)}(r)){var n={mod:"1583921753_001",dest:r};t.reportClick(n,o)}})})}(jQuery);