hina-cloud-js-sdk 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.eslintrc.js +12 -0
- package/.gitlab-ci.yml +20 -0
- package/.history/build/hotAnalyse.min_20230803204057.js +1 -0
- package/.history/build/hotAnalyse.min_20230803204548.js +338 -0
- package/.history/build/hotAnalyse.min_20230803204555.js +1 -0
- package/.history/build/hotAnalyse.min_20230803204716.js +338 -0
- package/.history/build/hotAnalyse.min_20230803204818.js +1 -0
- package/.history/build/hotAnalyse.min_20230803205007.js +338 -0
- package/.history/build/hotAnalyse.min_20230803205018.js +1 -0
- package/.history/rollup.config_20230803204057.js +57 -0
- package/.history/rollup.config_20230804165355.js +57 -0
- package/babel.config.js +4 -0
- package/build/hina-sa.esm.min.js +1 -0
- package/build/hina-sa.min.js +1 -0
- package/build/hina.esm.min.js +1 -0
- package/build/hina.min.js +1 -0
- package/build/hotAnalyse.min.js +1 -0
- package/package.json +35 -0
- package/report.json +101 -0
- package/rollup.config.js +57 -0
- package/sdk.png +0 -0
- package/sonar-project.properties +3 -0
- package/src/hotAnalyse.js +465 -0
- package/src/monitor/performance-monitor/index.js +103 -0
- package/src/monitor/performance-monitor/web-vitals.js +1 -0
- package/src/pv-sdk/autoTrack.js +648 -0
- package/src/pv-sdk/http.js +425 -0
- package/src/pv-sdk/index.js +405 -0
- package/src/pv-sdk/plugin.js +610 -0
- package/src/pv-sdk/property.js +388 -0
- package/src/pv-sdk/utils.js +1894 -0
@@ -0,0 +1 @@
|
|
1
|
+
function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var logFn,sd={};function isFunction(e){return!!e&&("[object Function]"==(e=Object.prototype.toString.call(e))||"[object AsyncFunction]"==e)}function now(){return Date.now&&isFunction(Date.now)?Date.now():(new Date).getTime()}!function(){var J={function:!0,object:!0},M=J["undefined"==typeof window?"undefined":_typeof(window)]&&window||this;var e=M.JSON,t=M.JSON3,r=!1,i=function A(e,d){e=e||M.Object(),d=d||M.Object();var _,o,m,g,l,v,y,b,c,S,r,i,f,k,n,a,s,t,u,$,p,h,w,P,O,I,C,D,j,U,N=e.Number||M.Number,T=e.String||M.String,R=e.Object||M.Object,L=e.Date||M.Date,B=e.SyntaxError||M.SyntaxError,F=e.TypeError||M.TypeError,H=e.Math||M.Math,e=e.JSON||M.JSON;return"object"==_typeof(e)&&e?(d.stringify=e.stringify,d.parse=e.parse):(e=R.prototype,_=e.toString,o=e.hasOwnProperty,g=new L(-0xc782b5b800cec),x(function(){g=-109252==g.getUTCFullYear()&&0===g.getUTCMonth()&&1===g.getUTCDate()&&10==g.getUTCHours()&&37==g.getUTCMinutes()&&6==g.getUTCSeconds()&&708==g.getUTCMilliseconds()}),E["bug-string-char-index"]=E["date-serialization"]=E.json=E["json-stringify"]=E["json-parse"]=null,E("json")||(l="[object Function]",v="[object Number]",y="[object String]",b="[object Array]",c=E("bug-string-char-index"),S=function(e,t){var r,s,i,n=0;for(i in(r=function(){this.valueOf=0}).prototype.valueOf=0,s=new r)o.call(s,i)&&n++;return s=null,(S=n?function(e,t){var r,i,n=_.call(e)==l;for(r in e)n&&"prototype"==r||!o.call(e,r)||(i="constructor"===r)||t(r);(i||o.call(e,r="constructor"))&&t(r)}:(s=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],function(e,t){var r,i,n=_.call(e)==l,a=!n&&"function"!=typeof e.constructor&&J[_typeof(e.hasOwnProperty)]&&e.hasOwnProperty||o;for(r in e)n&&"prototype"==r||!a.call(e,r)||t(r);for(i=s.length;r=s[--i];)a.call(e,r)&&t(r)}))(e,t)},E("json-stringify")||E("date-serialization")||(r={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},i="000000",f=function(e,t){return(i+(t||0)).slice(-e)},k=function(e){var t,r,i,n,a,s,o,d,c,l,u,p;return p=g?function(e){t=e.getUTCFullYear(),r=e.getUTCMonth(),i=e.getUTCDate(),a=e.getUTCHours(),s=e.getUTCMinutes(),o=e.getUTCSeconds(),d=e.getUTCMilliseconds()}:(c=H.floor,l=[0,31,59,90,120,151,181,212,243,273,304,334],u=function(e,t){return l[t]+365*(e-1970)+c((e-1969+(t=+(1<t)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)},function(e){for(i=c(e/864e5),t=c(i/365.2425)+1970-1;u(t+1,0)<=i;t++);for(r=c((i-u(t,0))/30.42);u(t,r+1)<=i;r++);i=1+i-u(t,r),a=c((n=(e%864e5+864e5)%864e5)/36e5)%24,s=c(n/6e4)%60,o=c(n/1e3)%60,d=n%1e3}),(k=function(e){return-1/0<e&&e<1/0?(p(e),e=(t<=0||1e4<=t?(t<0?"-":"+")+f(6,t<0?-t:t):f(4,t))+"-"+f(2,r+1)+"-"+f(2,i)+"T"+f(2,a)+":"+f(2,s)+":"+f(2,o)+"."+f(3,d)+"Z",t=r=i=a=s=o=d=null):e=null,e})(e)},E("json-stringify")&&!E("date-serialization")?(n=function(e){return k(this)},a=d.stringify,d.stringify=function(e,t,r){var i=L.prototype.toJSON,e=(L.prototype.toJSON=n,a(e,t,r));return L.prototype.toJSON=i,e}):(s="\\u00",t=function(e){var e=e.charCodeAt(0),t=r[e];return t||s+f(2,e.toString(16))},u=/[\x00-\x1f\x22\x5c]/g,$=function(e){return u.lastIndex=0,'"'+(u.test(e)?e.replace(u,t):e)+'"'},p=function r(e,t,i,n,a,s,o){var d,c,l,u,p,g,f,h;if(x(function(){d=t[e]}),"object"==_typeof(d)&&d&&(d.getUTCFullYear&&"[object Date]"==_.call(d)&&d.toJSON===L.prototype.toJSON?d=k(d):"function"==typeof d.toJSON&&(d=d.toJSON(e))),(d=i?i.call(t,e,d):d)==m)return d===m?d:"null";switch((c="object"==(f=_typeof(d))?_.call(d):c)||f){case"boolean":case"[object Boolean]":return""+d;case"number":case v:return-1/0<d&&d<1/0?""+d:"null";case"string":case y:return $(""+d)}if("object"==_typeof(d)){for(g=o.length;g--;)if(o[g]===d)throw F();if(o.push(d),l=[],f=s,s+=a,c==b){for(p=0,g=d.length;p<g;p++)u=r(p,d,i,n,a,s,o),l.push(u===m?"null":u);h=l.length?a?"[\n"+s+l.join(",\n"+s)+"\n"+f+"]":"["+l.join(",")+"]":"[]"}else S(n||d,function(e){var t=r(e,d,i,n,a,s,o);t!==m&&l.push($(e)+":"+(a?" ":"")+t)}),h=l.length?a?"{\n"+s+l.join(",\n"+s)+"\n"+f+"}":"{"+l.join(",")+"}":"{}";return o.pop(),h}},d.stringify=function(e,t,r){var i,n,a;if(J[_typeof(t)]&&t)if((a=_.call(t))==l)n=t;else if(a==b)for(var s,o={},d=0,c=t.length;d<c;)s=t[d++],"[object String]"!=(a=_.call(s))&&"[object Number]"!=a||(o[s]=1);if(r)if((a=_.call(r))==v){if(0<(r-=r%1))for(10<r&&(r=10),i="";i.length<r;)i+=" "}else a==y&&(i=r.length<=10?r:r.slice(0,10));return p("",((s={})[""]=e,s),n,o,i,"",[])})),E("json-parse"))||(h=T.fromCharCode,w={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},I=function(){throw P=O=null,B()},C=function(){for(var e,t,r,i,n,a=O,s=a.length;P<s;)switch(n=a.charCodeAt(P)){case 9:case 10:case 13:case 32:P++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=c?a.charAt(P):a[P],P++,e;case 34:for(e="@",P++;P<s;)if((n=a.charCodeAt(P))<32)I();else if(92==n)switch(n=a.charCodeAt(++P)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=w[n],P++;break;case 117:for(t=++P,r=P+4;P<r;P++)48<=(n=a.charCodeAt(P))&&n<=57||97<=n&&n<=102||65<=n&&n<=70||I();e+=h("0x"+a.slice(t,P));break;default:I()}else{if(34==n)break;for(n=a.charCodeAt(P),t=P;32<=n&&92!=n&&34!=n;)n=a.charCodeAt(++P);e+=a.slice(t,P)}if(34==a.charCodeAt(P))return P++,e;I();default:if(t=P,45==n&&(i=!0,n=a.charCodeAt(++P)),48<=n&&n<=57){for(48==n&&48<=(n=a.charCodeAt(P+1))&&n<=57&&I(),i=!1;P<s&&48<=(n=a.charCodeAt(P))&&n<=57;P++);if(46==a.charCodeAt(P)){for(r=++P;r<s&&!((n=a.charCodeAt(r))<48||57<n);r++);r==P&&I(),P=r}if(101==(n=a.charCodeAt(P))||69==n){for(43!=(n=a.charCodeAt(++P))&&45!=n||P++,r=P;r<s&&!((n=a.charCodeAt(r))<48||57<n);r++);r==P&&I(),P=r}return+a.slice(t,P)}i&&I();var o=a.slice(P,P+4);if("true"==o)return P+=4,!0;if("fals"==o&&101==a.charCodeAt(P+4))return P+=5,!1;if("null"==o)return P+=4,null;I()}return"$"},D=function e(t){var r,i;if("$"==t&&I(),"string"==typeof t){if("@"==(c?t.charAt(0):t[0]))return t.slice(1);if("["==t){for(r=[];"]"!=(t=C());)i?","==t&&"]"!=(t=C())||I():i=!0,","==t&&I(),r.push(e(t));return r}if("{"==t){for(r={};"}"!=(t=C());)i?","==t&&"}"!=(t=C())||I():i=!0,","!=t&&"string"==typeof t&&"@"==(c?t.charAt(0):t[0])&&":"==C()||I(),r[t.slice(1)]=e(C());return r}I()}return t},j=function(e,t,r){(r=U(e,t,r))===m?delete e[t]:e[t]=r},U=function(e,t,r){var i,n=e[t];if("object"==_typeof(n)&&n)if(_.call(n)==b)for(i=n.length;i--;)j(_,S,n);else S(n,function(e){j(n,e,r)});return r.call(e,t,n)},d.parse=function(e,t){var r;return P=0,O=""+e,e=D(C()),"$"!=C()&&I(),P=O=null,t&&_.call(t)==l?U(((r={})[""]=e,r),"",t):e})),d.runInContext=A,d;function x(e,t){try{e()}catch(e){t&&t()}}function E(e){var t,r,i,n,a,s,o;return null!=E[e]?E[e]:("bug-string-char-index"==e?t="a"!="a"[0]:"json"==e?t=E("json-stringify")&&E("date-serialization")&&E("json-parse"):"date-serialization"==e?(t=E("json-stringify")&&g)&&(n=d.stringify,x(function(){t='"-271821-04-20T00:00:00.000Z"'==n(new L(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==n(new L(864e13))&&'"-000001-01-01T00:00:00.000Z"'==n(new L(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==n(new L(-1))})):(i='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}',"json-stringify"==e&&((a="function"==typeof(n=d.stringify))&&((r=function(){return 1}).toJSON=r,x(function(){a="0"===n(0)&&"0"===n(new N)&&'""'==n(new T)&&n(_)===m&&n(m)===m&&n()===m&&"1"===n(r)&&"[1]"==n([r])&&"[null]"==n([m])&&"null"==n(null)&&"[null,null,null]"==n([m,_,null])&&n({a:[r,!0,!1,null,"\0\b\n\f\r\t"]})==i&&"1"===n(null,r)&&"[\n 1,\n 2\n]"==n([1,2],null,1)},function(){a=!1})),t=a),"json-parse"==e&&("function"==typeof(s=d.parse)&&x(function(){0!==s("0")||s(!1)||(r=s(i),(o=5==r.a.length&&1===r.a[0])&&(x(function(){o=!s('"\t"')}),o&&x(function(){o=1!==s("01")}),o)&&x(function(){o=1!==s("1.")}))},function(){o=!1}),t=o)),E[e]=!!t)}}(M,M.JSON3={noConflict:function(){return r||(r=!0,M.JSON=e,M.JSON3=t,e=t=null),i}});M.JSON={parse:i.parse,stringify:i.stringify}}.call(window),function(){var t,r=window;if(r.atob)try{r.atob(" ")}catch(e){r.atob=(t=r.atob,i.original=t,i)}else{var o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;r.btoa=function(e){for(var t,r,i,n="",a=0,s=(e=String(e)).length%3;a<e.length;){if(255<(t=e.charCodeAt(a++))||255<(r=e.charCodeAt(a++))||255<(i=e.charCodeAt(a++)))return"";n+=o.charAt((t=t<<16|r<<8|i)>>18&63)+o.charAt(t>>12&63)+o.charAt(t>>6&63)+o.charAt(63&t)}return s?n.slice(0,s-3)+"===".substring(s):n},r.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!s.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,r,i,n="",a=0;a<e.length;)t=o.indexOf(e.charAt(a++))<<18|o.indexOf(e.charAt(a++))<<12|(r=o.indexOf(e.charAt(a++)))<<6|(i=o.indexOf(e.charAt(a++))),n+=64===r?String.fromCharCode(t>>16&255):64===i?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return n}}function i(e){return t(String(e).replace(/[\t\n\f\r ]+/g,""))}}();var logger={setup:function(e){logFn=e},log:function(){(logFn||console&&console.log||function(){}).apply(null,arguments)}},_localStorage={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(_localStorage.get(e))||null}catch(e){logger.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(e){logger.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var t=!0;try{var e="__local_store_support__",r="testIsSupportStorage";_localStorage.set(e,r),_localStorage.get(e)!==r&&(t=!1),_localStorage.remove(e)}catch(e){t=!1}return t}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var t=(new Date).getTime();return function(e){return Math.ceil((t=(9301*t+49297)%233280)/233280*e)}}();function getRandom(){if("function"==typeof Uint32Array){var e,t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),isObject(t)&&t.getRandomValues)return e=new Uint32Array(1),t.getRandomValues(e)[0]/Math.pow(2,32)}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(e){}return t}function ConcurrentStorage(e,t){this.lockGetPrefix=e||"lock-get-prefix",this.lockSetPrefix=t||"lock-set-prefix"}function isValidListener(e){return"function"==typeof e||!(!e||"object"!==_typeof(e))&&isValidListener(e.listener)}function EventEmitter(){this._events={}}function _decodeURIComponent(t){var r=t;try{r=decodeURIComponent(t)}catch(e){r=t}return r}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),i=0;i<r.length;i++){var n,a=r[i].indexOf("=");-1!==a&&(n=r[i].substring(0,a),a=r[i].substring(a+1),n=_decodeURIComponent(n),a=_decodeURIComponent(a),t[n]=a)}return t}function isString(e){return"[object String]"==Object.prototype.toString.call(e)}function trim(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function urlParse(e){function t(e){this._fields={Username:4,Password:5,Port:7,Protocol:2,Host:6,Path:8,URL:0,QueryString:9,Fragment:10},this._values={},this._regex=/^((\w+):\/\/)?((\w+):?(\w+)?@)?([^\/\?:]+):?(\d+)?(\/?[^\?#]+)?\??([^#]+)?#?(\w*)/,void 0!==e&&this._parse(e)}return t.prototype.setUrl=function(e){this._parse(e)},t.prototype._initValues=function(){for(var e in this._fields)this._values[e]=""},t.prototype.addQueryString=function(e){if("object"!==_typeof(e))return!1;var t,r=this._values.QueryString||"";for(t in e)r=new RegExp(t+"[^&]+").test(r)?r.replace(new RegExp(t+"[^&]+"),t+"="+e[t]):"&"===r.slice(-1)?r+t+"="+e[t]:""===r?t+"="+e[t]:r+"&"+t+"="+e[t];this._values.QueryString=r},t.prototype.getUrl=function(){var e="";return(e+=this._values.Origin)+(this._values.Port?":"+this._values.Port:"")+this._values.Path+(this._values.QueryString?"?"+this._values.QueryString:"")+(this._values.Fragment?"#"+this._values.Fragment:"")},t.prototype._parse=function(e){this._initValues();this._regex.exec(e)||logger.log("URLParser::_parse -> Invalid URL");var t,e=e.split("#"),r=e[0],e=e.slice(1).join("#"),i=this._regex.exec(r);for(t in this._fields)void 0!==i[this._fields[t]]&&(this._values[t]=i[this._fields[t]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=e},new t(e)}function _URL(e){var t,r,i={};if("function"==typeof window.URL&&function(){try{return"https://hicloud.hinadt.com/"===new URL("https://hicloud.hinadt.com/").href}catch(e){return!1}}())(i=new URL(e)).searchParams||(i.searchParams=(r=getURLSearchParams(i.search),{get:function(e){return r[e]}}));else{e=trim(e=isString(e)?e:String(e));if(!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");e=urlParse(e);i.hash=e._values.Fragment,i.host=e._values.Host?e._values.Host+(e._values.Port?":"+e._values.Port:""):"",i.href=e._values.URL,i.password=e._values.Password,i.pathname=e._values.Path,i.port=e._values.Port,i.search=e._values.QueryString?"?"+e._values.QueryString:"",i.username=e._values.Username,i.hostname=e._values.Hostname,i.protocol=e._values.Protocol?e._values.Protocol+":":"",i.origin=e._values.Origin?e._values.Origin+(e._values.Port?":"+e._values.Port:""):"",i.searchParams=(t=getURLSearchParams("?"+e._values.QueryString),{get:function(e){return t[e]}})}return i}ConcurrentStorage.prototype.get=function(e,t,r,i){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,i=i||function(){};var n=this.lockGetPrefix+e,a=_localStorage.get(n),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return i(null);_localStorage.set(n,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(n))||{randomNum:0,expireTime:0})&&a.randomNum===s?(i(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(n)):i(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,i,n){if(!e||!t)throw new Error("key and val is must");r=r||1e4,i=i||1e3,n=n||function(){};var a=this.lockSetPrefix+e,s=_localStorage.get(a),o=String(getRandom());if(s&&(s=safeJSONParse(s)||{randomNum:0,expireTime:0}).expireTime>now())return n({status:"fail",reason:"This key is locked"});_localStorage.set(a,JSON.stringify({randomNum:o,expireTime:now()+r})),setTimeout(function(){(s=safeJSONParse(_localStorage.get(a))||{randomNum:0,expireTime:0}).randomNum===o?_localStorage.set(e,t)&&n({status:"success"}):n({status:"fail",reason:"This key is locked"})},i)},EventEmitter.prototype.on=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"===_typeof(t);return this._events[e].push(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!isValidListener(t))throw new Error("listener must be a function");this._events[e]=this._events[e]||[];var r="object"===_typeof(t);return this._events[e].unshift(r?t:{listener:t,once:!1}),this},EventEmitter.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},EventEmitter.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},EventEmitter.prototype.off=function(e,t){var r=this._events[e];if(!r)return!1;if("number"==typeof t)r.splice(t,1);else if("function"==typeof t)for(var i=0,n=r.length;i<n;i++)r[i]&&r[i].listener===t&&r.splice(i,1);return this},EventEmitter.prototype.emit=function(e,t){var r=this._events[e];if(!r)return!1;for(var i=0;i<r.length;i++){var n=r[i];n&&(n.listener.call(this,t||{}),n.once)&&this.off(e,i)}return this},EventEmitter.prototype.removeAllListeners=function(e){e&&this._events[e]?this._events[e]=[]:this._events={}},EventEmitter.prototype.listeners=function(e){return e&&"string"==typeof e?this._events[e]:this._events};var UUID=function(){function t(){for(var e=+new Date,t=0;e==+new Date;)t++;return e.toString(16)+t.toString(16)}return function(){var e=(e=String(screen.height*screen.width))&&/\d{5,}/.test(e)?e.toString(16):String(31242*getRandom()).replace(".","").slice(0,8),e=t()+"-"+getRandom().toString(16).replace(".","")+"-"+function(){var e,t,r=navigator.userAgent,n=[],i=0;function a(e,t){for(var r=0,i=0;i<t.length;i++)r|=n[i]<<8*i;return e^r}for(e=0;e<r.length;e++)t=r.charCodeAt(e),n.unshift(255&t),4<=n.length&&(i=a(i,n),n=[]);return(i=0<n.length?a(i,n):i).toString(16)}()+"-"+e+"-"+t();return e||(String(getRandom())+String(getRandom())+String(getRandom())).slice(2,15)}}();function isElement(e){return!(!e||1!==e.nodeType)}function isUndefined(e){return void 0===e}function isArray(e){return Array.isArray&&isFunction(isArray)?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function ry(e){return new DomElementInfo(e)}var DomElementInfo=function(e){this.ele=e},_siblings=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};function addEvent(e,t,r,c){function l(e){return e&&(e.preventDefault=l.preventDefault,e.stopPropagation=l.stopPropagation,e._getPath=l._getPath),e}l._getPath=function(){return this.path||this.composedPath&&this.composedPath()||ry(this.target).getParents()},l.preventDefault=function(){this.returnValue=!1},l.stopPropagation=function(){this.cancelBubble=!0};!function(e,t,r){var i,n,a,s,o,d;void 0===c&&"click"===t&&(c=!0),e&&e.addEventListener?e.addEventListener(t,function(e){e._getPath=l._getPath,r.call(this,e)},c):(n=e[i="on"+t],e[i]=(a=e,s=r,o=n,d=t,function(e){var t,r;if(e=e||l(window.event))return e.target=e.srcElement,t=!0,"function"==typeof o&&(r=o(e)),e=s.call(a,e),"beforeunload"!==d?!1!==r&&!1!==e&&t:void 0}))}.apply(null,arguments)}function addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(e){if(e)return void 0!==window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if(void 0!==window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){logger.log(e)}}}DomElementInfo.prototype={addClass:function(e){return-1===(" "+this.ele.className+" ").indexOf(" "+e+" ")&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return-1!==t.indexOf(" "+e+" ")&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){return-1!==(" "+this.ele.className+" ").indexOf(" "+e+" ")},attr:function(e,t){return"string"==typeof e&&isUndefined(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){var e,t=this.ele.getBoundingClientRect();return t.width||t.height?(e=this.ele.ownerDocument.documentElement,{top:t.top+window.pageYOffset-e.clientTop,left:t.left+window.pageXOffset-e.clientLeft}):{top:0,left:0}},getSize:function(){if(!window.getComputedStyle)return{width:this.ele.offsetWidth,height:this.ele.offsetHeight};try{var e=this.ele.getBoundingClientRect();return{width:e.width,height:e.height}}catch(e){return{width:0,height:0}}},getStyle:function(e){return this.ele.currentStyle?this.ele.currentStyle[e]:this.ele.ownerDocument.defaultView.getComputedStyle(this.ele,null).getPropertyValue(e)},wrap:function(e){e=document.createElement(e);return this.ele.parentNode.insertBefore(e,this.ele),e.appendChild(this.ele),ry(e)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if(!(r="function"==typeof window.getMatchedCSSRules?window.getMatchedCSSRules(this.ele):r)||!isArray(r))return null;for(var i=r.length-1;0<=i;i--)if(t=r[i].style.getPropertyValue(e))return t},sibling:function(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e},next:function(){return this.sibling(this.ele,"nextSibling")},prev:function(){return this.sibling(this.ele,"previousSibling")},siblings:function(){return _siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return _siblings(this.ele.firstChild)},parent:function(){var e;return ry(e=(e=this.ele.parentNode)&&11!==e.nodeType?e:null)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return ry(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return ry(e);return ry(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),i=[],n=0;n<t.children.length;n++){var a=t.children[n];1===a.nodeType&&a.tagName.toLowerCase()===r&&i.push(t.children[n])}return i},getParents:function(){try{var e=this.ele;if(!isElement(e))return[];var t=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,t.push(e);return t}catch(e){return[]}}};var nativeForEach=Array.prototype.forEach,hasOwnProperty$2=Object.prototype.hasOwnProperty;function each(e,t,r){if(null==e)return!1;if(nativeForEach&&e.forEach===nativeForEach)e.forEach(t,r);else if(isArray(e))for(var i=0,n=e.length;i<n;i++)i in e&&t.call(r,e[i],i,e);else for(var a in e)hasOwnProperty$2.call(e,a)&&t.call(r,e[a],a,e)}var hasOwnProperty$1=Object.prototype.hasOwnProperty;function extend(r){return each(Array.prototype.slice.call(arguments,1),function(e){for(var t in e)hasOwnProperty$1.call(e,t)&&void 0!==e[t]&&(r[t]=e[t])}),r}function ajax(e){function t(e){if(!e)return"";try{return JSON.parse(e)}catch(e){return{}}}e.timeout=e.timeout||2e4,e.credentials=void 0===e.credentials||e.credentials;var r=xhr(e.cors);if(!r)return!1;e.type||(e.type=e.data?"POST":"GET");var i,n=(e=extend({success:function(){},error:function(){}},e)).success,a=e.error;e.success=function(e){n(e),i&&(clearTimeout(i),i=null)},e.error=function(e){a(e),i&&(clearTimeout(i),i=null)},i=setTimeout(function(){try{r&&"object"===_typeof(r)&&r.abort&&r.abort()}catch(e){logger.log(e)}i&&(clearTimeout(i),i=null,e.error&&e.error(),r.onreadystatechange=null,r.onload=null,r.onerror=null)},e.timeout),"undefined"!=typeof XDomainRequest&&r instanceof XDomainRequest&&(r.onload=function(){e.success&&e.success(t(r.responseText)),r.onreadystatechange=null,r.onload=null,r.onerror=null},r.onerror=function(){e.error&&e.error(t(r.responseText),r.status),r.onreadystatechange=null,r.onerror=null,r.onload=null}),r.onreadystatechange=function(){try{4==r.readyState&&(200<=r.status&&r.status<300||304==r.status?e.success(t(r.responseText)):e.error(t(r.responseText),r.status),r.onreadystatechange=null,r.onload=null)}catch(e){r.onreadystatechange=null,r.onload=null}},r.open(e.type,e.url,!0);try{e.credentials&&(r.withCredentials=!0),isObject(e.header)&&each(e.header,function(e,t){r.setRequestHeader&&r.setRequestHeader(t,e)}),e.data&&(e.cors||r.setRequestHeader&&r.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?r.setRequestHeader&&r.setRequestHeader("Content-type","application/json; charset=UTF-8"):r.setRequestHeader&&r.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(e){logger.log(e)}r.send(e.data||null)}function map(e,i){var n=[];if(null!=e){if(Array.prototype.map&&e.map===Array.prototype.map)return e.map(i);each(e,function(e,t,r){n.push(i(e,t,r))})}return n}function base64Decode(e){var t=[];try{t=map(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(e){t=[]}try{return decodeURIComponent(t.join(""))}catch(e){return t.join("")}}function base64Encode(t){var r="";try{r=btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(e){r=t}return r}function bindReady(t,r){r=r||window;function i(e){"readystatechange"==e.type&&"complete"!=s.readyState||(("load"==e.type?r:s)[l](u+e.type,i,!1),a)||(a=!0,t.call(r,e.type||e))}function n(){try{o.doScroll("left")}catch(e){return void setTimeout(n,50)}i("poll")}var a=!1,e=!0,s=r.document,o=s.documentElement,d=s.addEventListener,c=d?"addEventListener":"attachEvent",l=d?"removeEventListener":"detachEvent",u=d?"":"on";if("complete"==s.readyState)t.call(r,"lazy");else{if(!d&&o.doScroll){try{e=!r.frameElement}catch(e){logger.log(e)}e&&n()}s[c](u+"DOMContentLoaded",i,!1),s[c](u+"readystatechange",i,!1),r[c](u+"load",i,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),i=0;i<r.length;i++){for(var n=r[i];" "==n.charAt(0);)n=n.substring(1,n.length);if(0==n.indexOf(t))return _decodeURIComponent(n.substring(t.length,n.length))}return null},set:function(e,t,r,i,n,a,s){var o="",d="",c="";function l(e){return!!e&&e.replace(/\r\n/g,"")}0!==(r=null==r?73e3:r)&&(u=new Date,"s"===String(r).slice(-1)?u.setTime(u.getTime()+1e3*Number(String(r).slice(0,-1))):u.setTime(u.getTime()+24*r*60*60*1e3),o="; expires="+u.toGMTString()),isString(n)&&""!==n&&(c="; SameSite="+n),a&&(d="; secure");var r="",u="",n="";e&&(r=l(e)),t&&(u=l(t)),s&&(n=l(s)),r&&u&&(document.cookie=r+"="+encodeURIComponent(u)+o+"; path=/"+n+c+d)},remove:function(e,t){this.set(e,"1",-1,t)},isSupport:function(e,t){e=e||"cookie_support_test",t=t||"1";var r=this;return navigator.cookieEnabled&&(r.set(e,t),r.get(e)===t)&&(r.remove(e),!0)}};function coverExtend(r){return each(Array.prototype.slice.call(arguments,1),function(e){for(var t in e)void 0!==e[t]&&void 0===r[t]&&(r[t]=e[t])}),r}function _decodeURI(t){var r=t;try{r=decodeURI(t)}catch(e){r=t}return r}function dfmapping(e){for(var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,i={},n=0,n=0;n<t.length;n++)i[t.charAt(n)]=t.charAt(r-n);var a="";for(n=0;n<e.length;n++)e.charAt(n)in i?a+=i[e.charAt(n)]:a+=e.charAt(n);return a}function isDate(e){return"[object Date]"==Object.prototype.toString.call(e)}function formatDate(e){function t(e){return e<10?"0"+e:e}return e.getFullYear()+"-"+t(e.getMonth()+1)+"-"+t(e.getDate())+" "+t(e.getHours())+":"+t(e.getMinutes())+":"+t(e.getSeconds())+"."+t(e.getMilliseconds())}function encodeDates(r){return each(r,function(e,t){isDate(e)?r[t]=formatDate(e):isObject(e)&&(r[t]=encodeDates(e))}),r}function extend2Lev(r){return each(Array.prototype.slice.call(arguments,1),function(e){for(var t in e)void 0!==e[t]&&(isObject(e[t])&&isObject(r[t])?extend(r[t],e[t]):r[t]=e[t])}),r}function filter(e,t,r){var i=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var n,a=[],s=0;s<e.length;s++)i.call(e,s)&&(n=e[s],t.call(r,n,s,e))&&a.push(n);return a}function formatJsonString(t){try{return JSON.stringify(t,null," ")}catch(e){return JSON.stringify(t)}}function getSafeHostname(e){return"string"==typeof e&&e.match(/^[a-zA-Z0-9\u4e00-\u9fa5\-\.]+$/)?e:""}function getCookieTopLevelDomain(e,t){t=t||"domain_test";var e=getSafeHostname(e=e||location.hostname),r=e.split(".");if(isArray(r)&&2<=r.length&&!/^(\d+\.)+\d+$/.test(e))for(var i="."+r.splice(r.length-1,1);0<r.length;){var n,i="."+r.splice(r.length-1,1)+i;if(document.cookie=t+"=true; path=/; domain="+i,-1!==document.cookie.indexOf(t+"=true"))return(n=new Date).setTime(n.getTime()-1e3),document.cookie=t+"=true; expires="+n.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function getDomBySelector(e){var n;return isString(e)&&(n=e.split(">"),e=null,e=function e(t){var r,i=n.shift();if(!i)return t;try{r=function(e,t){var r;if("body"===(e=trim(e)))return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(-1<e.indexOf(":nth-of-type")){if(!(e=e.split(":nth-of-type"))[0]||!e[1])return null;var i=e[0];if(!(e=e[1].match(/\(([0-9]+)\)/))||!e[1])return null;var n=Number(e[1]);if(!(isElement(t)&&t.children&&0<t.children.length))return null;for(var a=t.children,s=0;s<a.length;s++)if(isElement(a[s])){var o=a[s].tagName.toLowerCase();if(o===i&&0==--n){r=a[s];break}}if(0<n)return null}return r||null}(i,t)}catch(e){logger.log(e)}return r&&isElement(r)?e(r):null}())&&isElement(e)?e:null}function getElementContent(e,t){var r="",i="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(e.innerText)),i=(r=r&&r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255))||"",i="input"!==t&&"INPUT"!==t?i:e.value||""}function getHostname(e,t){t&&"string"==typeof t||(t="hostname解析异常");var r=null;try{r=_URL(e).hostname}catch(e){logger.log("getHostname传入的url参数不合法!")}return r||t}function getIOSVersion(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(e){return""}}function getQueryParamsFromUrl(e){var t={},e=e.split("?")[1]||"";return t=e?getURLSearchParams("?"+e):t}function getQueryParam(e,t){var e=_URL(e),r=e.searchParams.get(t)||"";return r||(e=e.hash)&&(r=getQueryParamsFromUrl(e)[t]||""),r}function mediaQueriesSupported(){return void 0!==window.matchMedia||void 0!==window.msMatchMedia}function getScreenOrientation(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="未取到值";return e?t=-1<e.indexOf("landscape")?"landscape":"portrait":mediaQueriesSupported()&&((e=window.matchMedia||window.msMatchMedia)("(orientation: landscape)").matches?t="landscape":e("(orientation: portrait)").matches&&(t="portrait")),t}function getUA(){var e,t={},r=navigator.userAgent.toLowerCase();return(e=r.match(/ qq\/([\d.]+)/))?t.qqBuildinBrowser=Number(e[1].split(".")[0]):(e=r.match(/mqqbrowser\/([\d.]+)/))?t.qqBrowser=Number(e[1].split(".")[0]):(e=r.match(/opera.([\d.]+)/))?t.opera=Number(e[1].split(".")[0]):(e=r.match(/msie ([\d.]+)/))?t.ie=Number(e[1].split(".")[0]):(e=r.match(/edge.([\d.]+)/))?t.edge=Number(e[1].split(".")[0]):(e=r.match(/firefox\/([\d.]+)/))?t.firefox=Number(e[1].split(".")[0]):(e=r.match(/chrome\/([\d.]+)/))?t.chrome=Number(e[1].split(".")[0]):(e=r.match(/version\/([\d.]+).*safari/))?t.safari=Number(e[1].match(/^\d*.\d*/)):(e=r.match(/trident\/([\d.]+)/))&&(t.ie=11),t}function getURL(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.href)}function getURLPath(e){return isString(e)?_decodeURI(e=trim(e)):_decodeURI(location.pathname)}function hasAttribute(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function hasAttributes(e,t){if("string"==typeof t)return hasAttribute(e,t);if(isArray(t)){for(var r=!1,i=0;i<t.length;i++)if(hasAttribute(e,t[i])){r=!0;break}return r}}function hashCode(e){if("string"!=typeof e)return 0;var t=0;if(0!=e.length)for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t}function hashCode53(e){var t=9007199254740992,r=-9007199254740992,i=0;if(0<e.length)for(var n=e.split(""),a=0;a<n.length;a++){var s=n[a].charCodeAt(),o=31*i+s;if(t<o)for(i=r+i;(o=31*i+s)<r;)i=i/2+s;if(o<r)for(i=t+i;t<(o=31*i+s);)i=i/2+s;i=31*i+s}return i}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var i=0;i<e.length;i++)if(t===e[i])return i;return-1}function inherit(e,t){return e.prototype=new t,(e.prototype.constructor=e).superclass=t.prototype,e}var hasOwnProperty=Object.prototype.hasOwnProperty;function isArguments(e){return!(!e||!hasOwnProperty.call(e,"callee"))}function isBoolean(e){return"[object Boolean]"==Object.prototype.toString.call(e)}function isEmptyObject(e){if(isObject(e)){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}return!1}function isHttpUrl(e){return"string"==typeof e&&(!1!==/^https?:\/\/.+/.test(e)||(logger.log("Invalid URL"),!1))}function isIOS(){return!!navigator.userAgent.match(/iPhone|iPad|iPod/i)}function isJSONString(e){try{JSON.parse(e)}catch(e){return!1}return!0}function isNumber(e){return"[object Number]"==Object.prototype.toString.call(e)&&/[\d\.]+/.test(String(e))}function isSupportBeaconSend(){var e,t,r=!1;return"object"===("undefined"==typeof navigator?"undefined":_typeof(navigator))&&"function"==typeof navigator.sendBeacon&&(e=getUA(),t=navigator.userAgent.toLowerCase(),/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)?(t=(t.match(/os [\d._]*/gi)+"").replace(/[^0-9|_.]/gi,"").replace(/_/gi,".").split("."),void 0===e.safari&&(e.safari=t[0]),t[0]&&(e.qqBuildinBrowser||e.qqBrowser)?r=!1:t[0]&&t[0]<13?(41<e.chrome||30<e.firefox||25<e.opera||12<e.safari)&&(r=!0):(41<e.chrome||30<e.firefox||25<e.opera||11.3<e.safari)&&(r=!0)):(38<e.chrome||13<e.edge||30<e.firefox||25<e.opera||11<e.safari)&&(r=!0)),r}function isSupportCors(){return void 0!==window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(t){if(!isObject(t)||!isString(t.callbackName))return logger.log("JSONP 请求缺少 callbackName"),!1;t.success=isFunction(t.success)?t.success:function(){},t.error=isFunction(t.error)?t.error:function(){},t.data=t.data||"";var r,i=document.createElement("script"),n=document.getElementsByTagName("head")[0],a=null,s=!1;n.appendChild(i),isNumber(t.timeout)&&(a=setTimeout(function(){if(s)return!1;t.error("timeout"),window[t.callbackName]=function(){logger.log("call jsonp error")},a=null,n.removeChild(i),s=!0},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){logger.log("call jsonp error")},n.removeChild(i)},-1<t.url.indexOf("?")?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,isObject(t.data)&&(r=[],each(t.data,function(e,t){r.push(t+"="+e)}),t.data=r.join("&"),t.url+="&"+t.data),i.onerror=function(e){if(s)return!1;window[t.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(a),a=null,n.removeChild(i),t.error(e),s=!0},i.src=t.url}function listenPageState(e){({visibleHandler:isFunction(e.visible)?e.visible:function(){},hiddenHandler:isFunction(e.hidden)?e.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return void 0!==document[this.hidden]},init:function(){void 0!==document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):void 0!==document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):void 0!==document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):void 0!==document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){var e;this.isSupport()?(e=this,addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)):(addEvent(window,"focus",this.visibleHandler),addEvent(window,"blur",this.hiddenHandler))}}).init()}function loadScript(e){e=extend({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&((t=document.createElement("link")).rel="stylesheet",t.href=e.url),"js"===e.type&&((t=document.createElement("script")).async="async",t.setAttribute("charset","UTF-8"),t.src=e.url,t.type="text/javascript"),t.onload=t.onreadystatechange=function(){this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState||(e.success(),t.onload=t.onreadystatechange=null)},t.onerror=function(){e.error(),t.onerror=null},e.appendCall(t)}function removeScriptProtocol(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function rot13obfs(e,t){t="number"==typeof t?t:13;for(var r=(e=String(e)).split(""),i=0,n=r.length;i<n;i++)r[i].charCodeAt(0)<126&&(r[i]=String.fromCharCode((r[i].charCodeAt(0)+t)%126));return r.join("")}function rot13defs(e){return rot13obfs(e=String(e),113)}function searchObjDate(r){(isObject(r)||isArray(r))&&each(r,function(e,t){isObject(e)||isArray(e)?searchObjDate(r[t]):isDate(e)&&(r[t]=formatDate(e))})}var _sessionStorage={isSupport:function(){var t=!0,e="__session_storage_support__",r="testIsSupportStorage";try{t=!(!sessionStorage||!sessionStorage.setItem||(sessionStorage.setItem(e,r),sessionStorage.removeItem(e,r),0))}catch(e){t=!1}return t}};function setCssStyle(t){var r=document.createElement("style");r.type="text/css";try{r.appendChild(document.createTextNode(t))}catch(e){r.styleSheet.cssText=t}var t=document.getElementsByTagName("head")[0],e=document.getElementsByTagName("script")[0];t?t.children.length?t.insertBefore(r,t.children[0]):t.appendChild(r):e.parentNode.insertBefore(r,e)}function strToUnicode(e){if("string"!=typeof e)return logger.log("转换unicode错误",e),e;for(var t="",r=0;r<e.length;r++)t+="\\"+e.charCodeAt(r).toString(16);return t}function throttle(r,i,n){function a(){l=!1===n.leading?0:now(),c=null,d=r.apply(s,o),c||(s=o=null)}var s,o,d,c=null,l=0;n=n||{};return function(){var e=now(),t=(l||!1!==n.leading||(l=e),i-(e-l));return s=this,o=arguments,t<=0||i<t?(c&&(clearTimeout(c),c=null),l=e,d=r.apply(s,o),c||(s=o=null)):c||!1===n.trailing||(c=setTimeout(a,t)),d}}function values(e){var t=[];return null!=e&&each(e,function(e){t[t.length]=e}),t}function toArray(e){return e?e.toArray?e.toArray():isArray(e)||isArguments(e)?Array.prototype.slice.call(e):values(e):[]}function unique(e){for(var t,r=[],i={},n=0;n<e.length;n++)(t=e[n])in i||(i[t]=!0,r.push(t));return r}var ENC={"+":"-","/":"_","=":"."},DEC={"-":"+",_:"/",".":"="},urlSafeBase64={encode:function(e){return e.replace(/[+/=]/g,function(e){return ENC[e]})},decode:function(e){return e.replace(/[-_.]/g,function(e){return DEC[e]})},trim:function(e){return e.replace(/[.=]{1,2}$/,"")},isBase64:function(e){return/^[A-Za-z0-9+/]*[=]{0,2}$/.test(e)},isUrlSafeBase64:function(e){return/^[A-Za-z0-9_-]*[.]{0,2}$/.test(e)}},W={__proto__:null,ConcurrentStorage:ConcurrentStorage,EventEmitter:EventEmitter,URL:_URL,UUID:UUID,addEvent:addEvent,addHashEvent:addHashEvent,ajax:ajax,base64Decode:base64Decode,base64Encode:base64Encode,bindReady:bindReady,cookie:cookie,coverExtend:coverExtend,decodeURI:_decodeURI,decodeURIComponent:_decodeURIComponent,dfmapping:dfmapping,each:each,encodeDates:encodeDates,extend:extend,extend2Lev:extend2Lev,filter:filter,formatDate:formatDate,formatJsonString:formatJsonString,getCookieTopLevelDomain:getCookieTopLevelDomain,getDomBySelector:getDomBySelector,getElementContent:getElementContent,getHostname:getHostname,getIOSVersion:getIOSVersion,getQueryParam:getQueryParam,getQueryParamsFromUrl:getQueryParamsFromUrl,getRandom:getRandom,getRandomBasic:getRandomBasic,getScreenOrientation:getScreenOrientation,getUA:getUA,getURL:getURL,getURLPath:getURLPath,getURLSearchParams:getURLSearchParams,hasAttribute:hasAttribute,hasAttributes:hasAttributes,hashCode:hashCode,hashCode53:hashCode53,indexOf:indexOf,inherit:inherit,isArguments:isArguments,isArray:isArray,isBoolean:isBoolean,isDate:isDate,isElement:isElement,isEmptyObject:isEmptyObject,isFunction:isFunction,isHttpUrl:isHttpUrl,isIOS:isIOS,isJSONString:isJSONString,isNumber:isNumber,isObject:isObject,isString:isString,isSupportBeaconSend:isSupportBeaconSend,isSupportCors:isSupportCors,isUndefined:isUndefined,jsonp:jsonp,listenPageState:listenPageState,loadScript:loadScript,localStorage:_localStorage,logger:logger,map:map,mediaQueriesSupported:mediaQueriesSupported,now:now,removeScriptProtocol:removeScriptProtocol,rot13defs:rot13defs,rot13obfs:rot13obfs,ry:ry,safeJSONParse:safeJSONParse,searchObjDate:searchObjDate,sessionStorage:_sessionStorage,setCssStyle:setCssStyle,strToUnicode:strToUnicode,throttle:throttle,toArray:toArray,trim:trim,unique:unique,urlParse:urlParse,urlSafeBase64:urlSafeBase64,values:values,xhr:xhr},sdPara={},defaultPara={preset_properties:{search_keyword_baidu:!1,latest_utm:!0,latest_traffic_source_type:!0,latest_search_keyword:!0,latest_referrer:!0,latest_referrer_host:!1,latest_landing_page:!1,latest_wx_ad_click_id:void 0,url:!0,title:!0},encrypt_cookie:!1,enc_cookie:!1,img_use_crossorigin:!1,name:"hn",max_referrer_string_length:200,max_string_length:500,max_id_length:255,max_key_length:100,cross_subdomain:!0,showLog:!1,is_debug:!1,source_channel:[],sdk_id:"",vtrack_ignore:{},auto_init:!0,is_track_single_page:!1,isSinglePage:!1,batch_send:!1,source_type:{},callback_timeout:200,datasend_timeout:8e3,is_track_device_id:!1,ignore_oom:!0,app_js_bridge:!1};function sdLog(){if((_sessionStorage.isSupport()&&"true"===sessionStorage.getItem("hinadata_jssdk_debug")||sdPara.showLog)&&(!isObject(arguments[0])||!0!==sdPara.showLog&&"string"!==sdPara.showLog&&!1!==sdPara.showLog||(arguments[0]=formatJsonString(arguments[0])),"object"===("undefined"==typeof console?"undefined":_typeof(console)))&&console.log)try{return console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}function enableLocalLog(){if(_sessionStorage.isSupport())try{sessionStorage.setItem("hinadata_jssdk_debug","true")}catch(e){console.log("enableLocalLog error: "+e.message)}}function disableLocalLog(){_sessionStorage.isSupport()&&sessionStorage.removeItem("hinadata_jssdk_debug")}var source_channel_standard="utm_source utm_medium utm_campaign utm_content utm_term",sdkversion_placeholder="3.1.1",domain_test_key="sensorsdata_domain_test",IDENTITY_KEY={EMAIL:"$identity_email",MOBILE:"$identity_mobile",LOGIN:"$identity_login_id"};function getCurrentDomain(e){var t=sdPara.current_domain;switch(_typeof(t)){case"function":var r=t();return""!==r&&""!==trim(r)&&-1!==r.indexOf(".")?r:"url解析失败";case"string":return""!==t&&""!==trim(t)&&-1!==t.indexOf(".")?t:"url解析失败";default:r=getCookieTopLevelDomain(null,domain_test_key);return""===e||""===r?"url解析失败":r}}var saCookie={get:function(e){return cookie.get(e)},set:function(e,t,r,i){var n,a="";return(i=isUndefined(i)?sdPara.cross_subdomain:i)&&(a=(n="url解析失败"===(n=getCurrentDomain(location.href))?"":n)?"; domain="+n:""),cookie.set(e,t,r,i,sdPara.set_cookie_samesite,sdPara.is_secure_cookie,a)},remove:function(e,t){return t=isUndefined(t)?sdPara.cross_subdomain:t,cookie.remove(e,t)},isSupport:function(e,t){return cookie.isSupport(e=e||"hnjssdk_cookie_access_test",t=t||"1")}};function isBaiduTraffic(){var e=document.referrer,t="baidu.com";if(!e)return!1;try{var r=_URL(e).hostname;return r&&r.substring(r.length-t.length)===t}catch(e){return!1}}var getBaiduKeyword={data:{},id:function(){return this.data.id||(this.data.id=getReferrerEqid(),this.data.id)},type:function(){return this.data.type||(this.data.type=getReferrerEqidType(),this.data.type)}};function getReferrerEqidType(){var e,t=getQueryParamsFromUrl(document.referrer);return isEmptyObject(t)||!t.eqid?(e=getQueryParamsFromUrl(location.href),t.ck||e.utm_source?"baidu_sem_keyword_id":"baidu_other_keyword_id"):"baidu_seo_keyword_id"}function getReferrerEqid(){var e=getQueryParamsFromUrl(document.referrer);return isEmptyObject(e)||!e.eqid?UUID().replace(/-/g,""):e.eqid}function getReferrer(e,t){return isString(e=e||document.referrer)?isString(e=(e=0!==(e=_decodeURI(e=trim(e))).indexOf("https://www.baidu.com/")||t?e:e.split("?")[0]).slice(0,sdPara.max_referrer_string_length))?e:"":"取值异常_referrer异常_"+String(e)}function isReferralTraffic(e){return""===(e=e||document.referrer)||getCookieTopLevelDomain(getHostname(e),domain_test_key)!==getCookieTopLevelDomain(null,domain_test_key)}function getKeywordFromReferrer(e,t){e=e||document.referrer;var r=sdPara.source_type.keyword;if(document&&isString(e)){if(0!==e.indexOf("http"))return""===e?"未取到值_直接打开":"未取到值_非http的url";var i=getReferSearchEngine(e),n=getQueryParamsFromUrl(e);if(!isEmptyObject(n)){var a,s;for(s in r)if(i===s&&isObject(n))if(isArray(a=r[s]))for(s=0;s<a.length;s++){var o=n[a[s]];if(o)return t?{active:o}:o}else if(n[a])return t?{active:n[a]}:n[a]}return sdPara.preset_properties.search_keyword_baidu&&isBaiduTraffic()?void 0:"未取到值"}return"取值异常_referrer异常_"+String(e)}function getReferSearchEngine(e){var t=getHostname(e);if(!t||"hostname解析异常"===t)return"";var r,i={baidu:[/^.*\.baidu\.com$/],bing:[/^.*\.bing\.com$/],google:[/^www\.google\.com$/,/^www\.google\.com\.[a-z]{2}$/,/^www\.google\.[a-z]{2}$/],sm:[/^m\.sm\.cn$/],so:[/^.+\.so\.com$/],sogou:[/^.*\.sogou\.com$/],yahoo:[/^.*\.yahoo\.com$/]};for(r in i)for(var n=i[r],a=0,s=n.length;a<s;a++)if(n[a].test(t))return r;return"未知搜索引擎"}var debug={distinct_id:function(){},jssdkDebug:function(){},_sendDebug:function(e){},apph5:function(e){var t="app_h5打通失败-",r=e.output,i=e.step,e=e.data||"";"all"!==r&&"console"!==r||sdLog({1:t+"use_app_track为false",2:t+"Android或者iOS,没有暴露相应方法",3.1:t+"Android校验server_url失败",3.2:t+"iOS校验server_url失败",4.1:t+"H5 校验 iOS serverUrl 失败",4.2:t+"H5 校验 Android serverUrl 失败"}[i]),"all"!==r&&"code"!==r||!isObject(sdPara.is_debug)||!sdPara.is_debug.apph5||e.type&&"profile"===e.type.slice(0,7)||(e.properties._jssdk_debug_info="apph5-"+String(i))},defineMode:function(e){var t={1:{title:"当前页面无法进行可视化全埋点",message:"App SDK 与 Web JS SDK 没有进行打通,请联系贵方技术人员修正 App SDK 的配置,详细信息请查看文档。",link_text:"配置文档",link_url:"https://himanual.hinadt.com/"},2:{title:"当前页面无法进行可视化全埋点",message:"App SDK 与 Web JS SDK 没有进行打通,请联系贵方技术人员修正 Web JS SDK 的配置,详细信息请查看文档。",link_text:"配置文档",link_url:"https://himanual.hinadt.com/"},3:{title:"当前页面无法进行可视化全埋点",message:"Web JS SDK 没有开启全埋点配置,请联系贵方工作人员修正 SDK 的配置,详细信息请查看文档。",link_text:"配置文档",link_url:"https://himanual.hinadt.com/"},4:{title:"当前页面无法进行可视化全埋点",message:"Web JS SDK 配置的数据校验地址与 App SDK 配置的数据校验地址不一致,请联系贵方工作人员修正 SDK 的配置,详细信息请查看文档。",link_text:"配置文档",link_url:"https://himanual.hinadt.com/"}};return!(!e||!t[e])&&t[e]},protocol:{protocolIsSame:function(e,t){try{if(_URL(e).protocol!==_URL(t).protocol)return!1}catch(e){return sdLog("不支持 _.URL 方法"),!1}return!0},serverUrl:function(){isString(sdPara.serverUrl)&&""!==sdPara.serverUrl&&!this.protocolIsSame(sdPara.serverUrl,location.href)&&sdLog("SDK 检测到您的数据发送地址和当前页面地址的协议不一致,建议您修改成一致的协议。\n因为:1、https 下面发送 http 的图片请求会失败。2、http 页面使用 https + ajax 方式发数据,在 ie9 及以下会丢失数据。")},ajax:function(e){if(e===sdPara.serverUrl)return!1;isString(e)&&""!==e&&!this.protocolIsSame(e,location.href)&&sdLog("SDK 检测到您的数据发送地址和当前页面地址的协议不一致,建议您修改成一致的协议。因为 http 页面使用 https + ajax 方式发数据,在 ie9 及以下会丢失数据。")}}},pageInfo={initPage:function(){var e=getReferrer(),t=getURL(),r=getCurrentDomain(t);r||debug.jssdkDebug("url_domain异常_"+t+"_"+r),this.pageProp={referrer:e,referrer_host:e?getHostname(e):"",url:t,url_host:getHostname(t,"url_host取值异常"),url_domain:r}},pageProp:{},campaignParams:function(){return sd.kit.getUtmData()},campaignParamsStandard:function(i,n){i=i||"",n=n||"";var e=pageInfo.campaignParams(),a={},s={};return each(e,function(e,t,r){-1!==(" "+source_channel_standard+" ").indexOf(" "+t+" ")?a[i+t]=r[t]:s[n+t]=r[t]}),{$utms:a,otherUtms:s}},properties:function(){var e=window.innerHeight||document.documentElement.clientHeight||document.body&&document.body.clientHeight||0,t=window.innerWidth||document.documentElement.clientWidth||document.body&&document.body.clientWidth||0;return{$timezone_offset:(new Date).getTimezoneOffset(),$screen_height:Number(screen.height)||0,$screen_width:Number(screen.width)||0,$viewport_height:e,$viewport_width:t,$lib:"js",$lib_version:sdkversion_placeholder}},currentProps:{},register:function(e){extend(pageInfo.currentProps,e)}};function getNewUserFlagKey(e,t){var r="";if(t=t||location.href,!1===sdPara.cross_subdomain){try{r=_URL(t).hostname}catch(e){sdLog(e)}r="string"==typeof r&&""!==r?"hnjssdk_"+sdPara.sdk_id+e+"_"+r.replace(/\./g,"_"):"hnjssdk_root_"+sdPara.sdk_id+e}else r="hnjssdk_cross_"+sdPara.sdk_id+e;return r}function isNewUser(){var e="new_user";return saCookie.isSupport()?null!==saCookie.get("sensorsdata_is_new_user")||null!==saCookie.get(getNewUserFlagKey(e)):null!==memory.get(memory.getNewUserFlagMemoryKey(e))}saCookie.getNewUser=isNewUser;var memory={data:{},get:function(e){e=this.data[e];return void 0===e?null:void 0!==e._expirationTimestamp_?(new Date).getTime()>e._expirationTimestamp_?null:e.value:e},set:function(e,t,r){var i;r&&(i=new Date,t={value:t,_expirationTimestamp_:"s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3}),this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"hnjssdk_"+sdPara.sdk_id+e}},saNewUser={checkIsAddSign:function(e){"track"===e.type&&(isNewUser()?e.properties.$is_first_day=!0:e.properties.$is_first_day=!1)},is_first_visit_time:!1,is_page_first_visited:!1,checkIsFirstTime:function(e){"track"===e.type&&"$pageview"===e.event&&(this.is_first_visit_time?(e.properties.$is_first_time=!0,this.is_first_visit_time=!1):e.properties.$is_first_time=!1)},setDeviceId:function(e,t){var r=null,i=saCookie.get("hinadatajssdkcross"+sd.para.sdk_id),n={},r=(r=null!=(i=sd.kit.userDecryptIfNeeded(i))&&isJSONString(i)&&(n=JSON.parse(i)).$device_id?n.$device_id:r)||e;!0===sd.para.cross_subdomain?t.set("$device_id",r):(n.$device_id=r,n=JSON.stringify(n),sd.para.encrypt_cookie&&(n=sd.kit.userEncrypt(n)),saCookie.set("hinadatajssdkcross"+sd.para.sdk_id,n,null,!0)),sd.para.is_track_device_id&&(pageInfo.currentProps.$device_id=r)},storeInitCheck:function(){var e,t,r;sd.is_first_visitor?(e=23-(r=new Date).getHours(),t=59-r.getMinutes(),r=59-r.getSeconds(),saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*e+60*t+r+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*e+60*t+r+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0):(isNewUser()||(this.checkIsAddSign=function(e){"track"===e.type&&(e.properties.$is_first_day=!1)}),this.checkIsFirstTime=function(e){"track"===e.type&&"$pageview"===e.event&&(e.properties.$is_first_time=!1)})}};function saAddEvent(e,t,r){var i=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return addEvent(e,t,r,i=isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t?!0:i)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function getSourceFromReferrer(){function e(e,t){for(var r=0;r<e.length;r++)if(-1!==t.split("?")[0].indexOf(e[r]))return 1}var t="("+sdPara.source_type.utm.join("|")+")\\=[^&]+",r=sdPara.source_type.search,i=sdPara.source_type.social,n=document.referrer||"",a=pageInfo.pageProp.url;return a?(a=a.match(new RegExp(t)))&&a[0]?"付费广告流量":e(r,n)?"自然搜索流量":e(i,n)?"社交网站流量":""===n?"直接流量":"引荐流量":"获取url异常"}function getWxAdIdFromUrl(e){var t=getQueryParam(e,"gdt_vid"),r=getQueryParam(e,"hash_key"),e=getQueryParam(e,"callbacks"),i={click_id:"",hash_key:"",callbacks:""};return isString(t)&&t.length&&(i.click_id=16==t.length||18==t.length?t:"参数解析不合法",isString(r)&&r.length&&(i.hash_key=r),isString(e))&&e.length&&(i.callbacks=e),i}function parseSuperProperties(e){var r=e.properties,i=JSON.parse(JSON.stringify(e));isObject(r)&&each(r,function(e,t){if(isFunction(e))try{r[t]=e(i),isFunction(r[t])&&(sdLog("您的属性- "+t+" 格式不满足要求,我们已经将其删除"),delete r[t])}catch(e){delete r[t],sdLog("您的属性- "+t+" 抛出了异常,我们已经将其删除")}})}function searchConfigData(e){var t;return isObject(e)&&e.$option?(t=e.$option,delete e.$option,t):{}}function strip_empty_properties(e){var r={};return each(e,function(e,t){null!=e&&(r[t]=e)}),r}function addReferrerHost(e){var t=!e.type||"profile"!==e.type.slice(0,7);isObject(e.properties)&&t&&("$referrer"in e.properties&&(e.properties.$referrer_host=""===e.properties.$referrer?"":getHostname(e.properties.$referrer,"取值异常")),sdPara.preset_properties.latest_referrer)&&sdPara.preset_properties.latest_referrer_host&&(e.properties.$latest_referrer_host=""===e.properties.$latest_referrer?"":getHostname(e.properties.$latest_referrer,"取值异常"))}function addPropsHook(e){var t=!e.type||"profile"!==e.type.slice(0,7),t=sdPara.preset_properties&&t;t&&sdPara.preset_properties.url&&isUndefined(e.properties.$url)&&(e.properties.$url=getURL()),t&&sdPara.preset_properties.title&&isUndefined(e.properties.$title)&&(e.properties.$title=document.title)}function getEleInfo(e){var t,r;return!!isElement(e.target)&&(t=(e=e.target).tagName.toLowerCase(),(r={}).$element_type=t,r.$element_name=e.getAttribute("name"),r.$element_id=e.getAttribute("id"),r.$element_class_name=isString(e.className)?e.className:null,r.$element_target_url=e.getAttribute("href"),r.$element_content=getElementContent$1(e,t),(r=strip_empty_properties(r)).$url=getURL(),r.$url_path=getURLPath(),r.$title=document.title,r)}function getInputElementValue(e){var t=sdPara.heatmap&&isFunction(sdPara.heatmap.isCollectInput)&&sdPara.heatmap.isCollectInput(e);return("button"===e.type||"submit"===e.type||t)&&e.value||""}function getElementContent$1(e,t){return isString(t)&&"input"===t.toLowerCase()?getInputElementValue(e):getElementContent(e,t)}function ajax$1(e){return debug.protocol.ajax(e.url),ajax(e)}function optimizeServerUrl(e){if("string"==typeof e&&(e=trim(e))&&("://"===e.slice(0,3)?e=location.protocol.slice(0,-1)+e:"//"===e.slice(0,2)?e=location.protocol+e:"http"!==e.slice(0,4)&&(e="")),isArray(e)&&e.length)for(var t=0;t<e.length;t++)/sa\.gif[^\/]*$/.test(e[t])||(e[t]=e[t].replace(/\/sa$/,"/sa.gif").replace(/(\/sa)(\?[^\/]+)$/,"/sa.gif$2"));else/sa\.gif[^\/]*$/.test(e)||"string"!=typeof e||(e=e.replace(/\/sa$/,"/sa.gif").replace(/(\/sa)(\?[^\/]+)$/,"/sa.gif$2"));return e}function encodeTrackData(e){var e=base64Encode(e=isString(e)?e:JSON.stringify(e)),t="crc="+hashCode(e);return"data="+encodeURIComponent(e)+"&ext="+encodeURIComponent(t)}EventEmitterSa.prototype={emit:function(t){var r=[].slice.call(arguments,1);each(this._events,function(e){e.type===t&&e.callback.apply(e.context,r)}),this.pendingEvents.push({type:t,data:r}),20<this.pendingEvents.length&&this.pendingEvents.shift()},on:function(t,r,i,e){isFunction(r)&&(this._events.push({type:t,callback:r,context:i||this}),e=!1!==e,0<this.pendingEvents.length)&&e&&each(this.pendingEvents,function(e){e.type===t&&r.apply(i,e.data)})},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var AjaxSend=function(e){this.callback=e.callback,this.serverUrl=e.serverUrl,this.data=e.data},dataStoragePrefix=(AjaxSend.prototype.start=function(){var e=this;ajax$1({url:this.serverUrl,type:"POST",data:this.data,credentials:!1,timeout:sdPara.datasend_timeout,cors:!0,success:function(){e.end()},error:function(){e.end()}})},AjaxSend.prototype.end=function(){this.callback&&(sdLog("warning: sdk callback is deprecated."),isFunction(this.callback)?this.callback():sdLog("error: sdk callback must be function."))},"sawebjssdk-"),tabStoragePrefix="tab-sawebjssdk-";function BatchSend(){this.sendTimeStamp=0,this.timer=null,this.serverUrl="",this.hasTabStorage=!1}BatchSend.prototype={batchInterval:function(){""===this.serverUrl&&this.getServerUrl(),this.hasTabStorage||(this.generateTabStorage(),this.hasTabStorage=!0);var e=this;e.timer=setTimeout(function(){e.updateExpireTime(),e.recycle(),e.send(),clearTimeout(e.timer),e.batchInterval()},sdPara.batch_send.send_interval)},getServerUrl:function(){if(!(isString(sdPara.serverUrl)&&""!==sdPara.serverUrl||isArray(sdPara.serverUrl)&&sdPara.serverUrl.length))return sd.log("当前 serverUrl 为空或不正确,只在控制台打印日志,network 中不会发数据,请配置正确的 server_url!");this.serverUrl=isArray(sdPara.serverUrl)?sdPara.serverUrl[0]:sdPara.serverUrl},send:function(){if(!(this.sendTimeStamp&&now()-this.sendTimeStamp<sdPara.batch_send.datasend_timeout)&&(e=_localStorage.get(this.tabKey))){this.sendTimeStamp=now();var e,t=unique((e=safeJSONParse(e)||this.generateTabStorageVal()).data);if(t.length){for(var r=[],i=0;i<t.length;i++)r.push(sd.store.readObjectVal(t[i]));this.request(r,e.data)}}},updateExpireTime:function(){var e=_localStorage.get(this.tabKey);e&&((e=safeJSONParse(e)||this.generateTabStorageVal()).expireTime=now()+2*sdPara.batch_send.send_interval,e.serverUrl=this.serverUrl,_localStorage.set(this.tabKey,JSON.stringify(e)))},request:function(e,t){var r=this;ajax$1({url:this.serverUrl,type:"POST",data:"data_list="+encodeURIComponent(base64Encode(JSON.stringify(e))),credentials:!1,timeout:sdPara.batch_send.datasend_timeout,cors:!0,success:function(){r.remove(t),r.sendTimeStamp=0},error:function(){r.sendTimeStamp=0}})},remove:function(e){var t=_localStorage.get(this.tabKey);if(t){for(var r=(safeJSONParse(t)||this.generateTabStorageVal()).data,i=0;i<e.length;i++){var n=indexOf(r,e[i]);-1<n&&r.splice(n,1),_localStorage.remove(e[i])}r=unique(r),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var t=dataStoragePrefix+String(getRandom()),r=_localStorage.get(this.tabKey);(r=null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),this.generateTabStorageVal()):safeJSONParse(r)||this.generateTabStorageVal()).data.push(t),r.expireTime=now()+2*sdPara.batch_send.send_interval,_localStorage.set(this.tabKey,JSON.stringify(r)),sd.store.saveObjectVal(t,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=tabStoragePrefix+String(getRandom()),_localStorage.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return{data:e=e||[],expireTime:now()+2*sdPara.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},t="sajssdk-lock-get-",r=0;r<localStorage.length;r++){var i,n=localStorage.key(r),a=this;if(0===n.indexOf(tabStoragePrefix)){for(var s=safeJSONParse(_localStorage.get(n))||this.generateTabStorageVal(),o=0;o<s.data.length;o++)e[s.data[o]]=!0;n!==a.tabKey&&now()>s.expireTime&&this.serverUrl===s.serverUrl&&new ConcurrentStorage(t).get(n,1e4,1e3,function(e){var t;e&&(null===_localStorage.get(a.tabKey)&&a.generateTabStorage(),e=safeJSONParse(e)||a.generateTabStorageVal(),(t=safeJSONParse(_localStorage.get(a.tabKey))||a.generateTabStorageVal()).data=unique(t.data.concat(e.data)),_localStorage.set(a.tabKey,JSON.stringify(t)))})}else 0===n.indexOf(t)&&(i=safeJSONParse(_localStorage.get(n))||{expireTime:0},1e4<now()-i.expireTime)&&_localStorage.remove(n)}for(var d=0;d<localStorage.length;d++){var c=localStorage.key(d);0!==c.indexOf(dataStoragePrefix)||e[c]||_localStorage.remove(c)}}};var BeaconSend=function(e){this.callback=e.callback,this.serverUrl=e.serverUrl,this.data=e.data},ImageSend=(BeaconSend.prototype.start=function(){var e=this;"object"===("undefined"==typeof navigator?"undefined":_typeof(navigator))&&"function"==typeof navigator.sendBeacon&&navigator.sendBeacon(this.serverUrl,this.data),setTimeout(function(){e.end()},40)},BeaconSend.prototype.end=function(){this.callback&&(sdLog("warning: sdk callback is deprecated."),isFunction(this.callback)?this.callback():sdLog("error: sdk callback must be function."))},function(e){this.callback=e.callback,this.img=document.createElement("img"),this.img.width=1,this.img.height=1,sdPara.img_use_crossorigin&&(this.img.crossOrigin="anonymous"),this.serverUrl=e.data}),business=(ImageSend.prototype.start=function(){var e=this;sdPara.ignore_oom&&(this.img.onload=function(){this.onload=null,this.onerror=null,this.onabort=null,e.end()},this.img.onerror=function(){this.onload=null,this.onerror=null,this.onabort=null,e.end()},this.img.onabort=function(){this.onload=null,this.onerror=null,this.onabort=null,e.end()}),this.img.src=this.serverUrl},ImageSend.prototype.lastClear=function(){void 0!==getUA().ie?this.img.src="about:blank":this.img.src=""},ImageSend.prototype.end=function(){if(this.callback){if(sdLog("warning: sdk callback is deprecated."),!isFunction(this.callback))return void sdLog("error: sdk callback must be function.");this.callback()}var e=this;setTimeout(function(){e.lastClear&&e.lastClear()},sdPara.datasend_timeout-sdPara.callback_timeout)},{__proto__:null,addEvent:saAddEvent,EventEmitterSa:EventEmitterSa,cookie:saCookie,info:pageInfo,getReferrer:getReferrer,getCurrentDomain:getCurrentDomain,isBaiduTraffic:isBaiduTraffic,getReferrerEqid:getReferrerEqid,getReferrerEqidType:getReferrerEqidType,getBaiduKeyword:getBaiduKeyword,isReferralTraffic:isReferralTraffic,getKeywordFromReferrer:getKeywordFromReferrer,getReferSearchEngine:getReferSearchEngine,getSourceFromReferrer:getSourceFromReferrer,getWxAdIdFromUrl:getWxAdIdFromUrl,parseSuperProperties:parseSuperProperties,searchConfigData:searchConfigData,strip_empty_properties:strip_empty_properties,getEleInfo:getEleInfo,getElementContent:getElementContent$1,ajax:ajax$1,optimizeServerUrl:optimizeServerUrl,encodeTrackData:encodeTrackData,AjaxSend:AjaxSend,BatchSend:BatchSend,BeaconSend:BeaconSend,ImageSend:ImageSend}),events=new EventEmitterSa,store={requests:[],_sessionState:{},_state:{distinct_id:"",first_id:"",props:{},identities:{}},getProps:function(){return this._state.props||{}},getSessionProps:function(){return this._sessionState},getOriginDistinctId:function(){return this._state._distinct_id||this._state.distinct_id},getOriginUnionId:function(e){var t={},r=(e=e||this._state)._first_id||e.first_id,e=e._distinct_id||e.distinct_id;return r&&e?(t.login_id=e,t.anonymous_id=r):t.anonymous_id=e,t},getDistinctId:function(){var e=this.getUnionId();return e.login_id||e.anonymous_id},getUnionId:function(e){e=this.getOriginUnionId(e);return e.login_id&&this._state.history_login_id&&this._state.history_login_id.name&&this._state.history_login_id.name!==IDENTITY_KEY.LOGIN&&(e.login_id=this._state.history_login_id.name+"+"+e.login_id),e},getFirstId:function(){return this._state._first_id||this._state.first_id},initSessionState:function(){var e=saCookie.get("hinadatasession"),t=null;null!==(e=sd.kit.userDecryptIfNeeded(e))&&"object"===_typeof(t=safeJSONParse(e))&&(this._sessionState=t||{})},setOnce:function(e,t){e in this._state||this.set(e,t)},set:function(e,t){this._state=this._state||{};var r=this._state.distinct_id;this._state[e]=t,"first_id"===e?delete this._state._first_id:"distinct_id"===e&&delete this._state._distinct_id,this.save(),"distinct_id"===e&&r&&events.tempAdd("changeDistinctId",t)},change:function(e,t){this._state["_"+e]=t},setSessionProps:function(e){sd.log("initSessionState 方法已经弃用,请不要使用该功能,如有需求联系技术顾问");var t=this._sessionState;extend(t,e),this.sessionSave(t)},setSessionPropsOnce:function(e){sd.log("initSessionState 方法已经弃用,请不要使用该功能,如有需求联系技术顾问");var t=this._sessionState;coverExtend(t,e),this.sessionSave(t)},setProps:function(e,t){var r,i={};for(r in i=t?e:extend(this._state.props||{},e))"string"==typeof i[r]&&(i[r]=i[r].slice(0,sd.para.max_referrer_string_length));this.set("props",i)},setPropsOnce:function(e){var t=this._state.props||{};coverExtend(t,e),this.set("props",t)},clearAllProps:function(e){if(this._sessionState={},isArray(e)&&0<e.length)for(t=0;t<e.length;t++)isString(e[t])&&-1===e[t].indexOf("latest_")&&isObject(this._state.props)&&e[t]in this._state.props&&delete this._state.props[e[t]];else if(isObject(this._state.props))for(var t in this._state.props)1!==t.indexOf("latest_")&&delete this._state.props[t];this.sessionSave({}),this.save()},sessionSave:function(e){sd.log("initSessionState 方法已经弃用,请不要使用该功能,如有需求联系技术顾问"),this._sessionState=e;e=JSON.stringify(this._sessionState);sd.para.encrypt_cookie&&(e=sd.kit.userEncrypt(e)),saCookie.set("hinadatasession",e,0)},save:function(){var e=JSON.parse(JSON.stringify(this._state)),e=(delete e._first_id,delete e._distinct_id,e.identities&&(e.identities=base64Encode(JSON.stringify(e.identities))),JSON.stringify(e));sd.para.encrypt_cookie&&(e=sd.kit.userEncrypt(e)),saCookie.set(this.getCookieName(),e,73e3,sd.para.cross_subdomain)},getCookieName:function(){var e="";if(!1===sd.para.cross_subdomain){try{e=_URL(location.href).hostname}catch(e){sd.log(e)}e="string"==typeof e&&""!==e?"hn_jssdk_"+sd.para.sdk_id+e.replace(/\./g,"_"):"hn_jssdk_root"+sd.para.sdk_id}else e="hinadatajssdkcross"+sd.para.sdk_id;return e},init:function(){this.initSessionState();var e,t,r=UUID();saCookie.isSupport()&&(t=saCookie.get(this.getCookieName()),e=safeJSONParse(t=sd.kit.userDecryptIfNeeded(t))),saCookie.isSupport()&&null!==t&&isJSONString(t)&&isObject(e)&&(!isObject(e)||e.distinct_id)?(store._state=extend(function(e){e.identities&&(0===e.identities.indexOf("\n/")?e.identities=safeJSONParse(rot13defs(e.identities)):e.identities=safeJSONParse(base64Decode(e.identities)));var t,r=store.getOriginUnionId(e),i=(e.identities&&isObject(e.identities)&&!isEmptyObject(e.identities)||(e.identities={},e.identities.$identity_cookie_id=UUID()),e.history_login_id=e.history_login_id||{},e.history_login_id.name);if(r.login_id)if(i&&e.identities.hasOwnProperty(i)){if(e.identities[i]!==r.login_id){for(t in e.identities[i]=r.login_id,e.identities)e.identities.hasOwnProperty(t)&&"$identity_cookie_id"!==t&&t!==i&&delete e.identities[t];e.history_login_id.value=r.login_id}}else{var n=i||IDENTITY_KEY.LOGIN;for(t in e.identities[n]=r.login_id,e.identities)e.identities.hasOwnProperty(t)&&"$identity_cookie_id"!==t&&t!==n&&delete e.identities[t];e.history_login_id={name:n,value:r.login_id}}else{if(e.identities.hasOwnProperty("$identity_login_id")||e.identities.hasOwnProperty(i))for(t in e.identities)e.identities.hasOwnProperty(t)&&"$identity_cookie_id"!==t&&"$identity_anonymous_id"!==t&&delete e.identities[t];e.history_login_id={name:"",value:""}}return e}(e)),store.save()):(sd.is_first_visitor=!0,t=r,store.set("distinct_id",t),store.set("identities",{$identity_cookie_id:t}),store.set("history_login_id",{name:"",value:""})),saNewUser.setDeviceId(r,this),saNewUser.storeInitCheck()},saveObjectVal:function(e,t){isString(t)||(t=JSON.stringify(t)),1==sd.para.encrypt_cookie&&(t=sd.kit.userEncrypt(t)),_localStorage.set(e,t)},readObjectVal:function(e){e=_localStorage.get(e);return e?safeJSONParse(sd.kit.userDecryptIfNeeded(e)):null}},checkLog={string:function(e){sdLog(e+" must be string")},emptyString:function(e){sdLog(e+"'s is empty")},regexTest:function(e){sdLog(e+" is invalid")},idLength:function(e){sdLog(e+" length is longer than "+sdPara.max_id_length)},keyLength:function(e){sdLog(e+" length is longer than "+sdPara.max_key_length)},stringLength:function(e){sdLog(e+" length is longer than "+sdPara.max_string_length)},voidZero:function(e){sdLog(e+"'s is undefined")},reservedLoginId:function(e){sdLog(e+" is invalid")},reservedBind:function(e){sdLog(e+" is invalid")},reservedUnbind:function(e){sdLog(e+" is invalid")}},ruleOption={regName:/^((?!^distinct_id$|^original_id$|^time$|^properties$|^id$|^first_id$|^second_id$|^users$|^events$|^event$|^user_id$|^date$|^datetime$|^user_tag.*|^user_group.*)[a-zA-Z_$][a-zA-Z\d_$]*)$/i,loginIDReservedNames:["$identity_anonymous_id","$identity_cookie_id"],bindReservedNames:["$identity_login_id","$identity_anonymous_id","$identity_cookie_id"],unbindReservedNames:["$identity_anonymous_id",IDENTITY_KEY.LOGIN],string:function(e){return!!isString(e)},emptyString:function(e){return!(!isString(e)||0===trim(e).length)},regexTest:function(e){return!(!isString(e)||!this.regName.test(e))},idLength:function(e){return!(!isString(e)||e.length>sdPara.max_id_length)},keyLength:function(e){return!(!isString(e)||e.length>sdPara.max_key_length)},stringLength:function(e){return!(!isString(e)||e.length>sdPara.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(-1<indexOf(this.loginIDReservedNames,e))},reservedUnbind:function(e){return!(-1<indexOf(this.unbindReservedNames,e))},reservedBind:function(e){var t=store._state.history_login_id;return!(t&&t.name&&t.name===e||-1<indexOf(this.bindReservedNames,e))}},checkOption={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Id"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="eventName"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="Property key"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(e,t,r){return e||isFunction(checkLog[r])&&checkLog[r]("Property Value"),!0}},properties:function(e){return isObject(e)?each(e,function(e,i){check({propertyKey:i});check({propertyValue:e},function(e,t,r){return e||(t=i+"'s Value",isFunction(checkLog[r])&&checkLog[r](t)),!0})}):ruleOption.voidZero(e)&&sdLog("properties可以没有,但有的话必须是对象"),!0},propertiesMust:function(e){return void 0!==e&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdLog("properties必须是对象"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_type"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(e,t,r){return e||("emptyString"===r&&(t="item_id"),isFunction(checkLog[r])&&checkLog[r](t)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="login_id_key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Key"),isFunction(checkLog[r])&&checkLog[r](t),"keyLength"===r)||e}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(e,t,r){return!e&&("emptyString"===r&&(t="Value"),isFunction(checkLog[r])&&checkLog[r](t),"idLength"===r)||e}},check:function(e,t,r){var i=this[e];if(isFunction(i))return i.call(this,t);if(!i)return!1;for(var n=0;n<i.rules.length;n++){var a=i.rules[n],s=ruleOption[a](t),a=isFunction(r)?r(s,t,a):i.onComplete(s,t,a);if(!s)return a}return!0}};function check(e,t){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&!checkOption.check(r,e[r],t))return!1;return!0}function strip_sa_properties(n,a){return isObject(n)&&each(n,function(t,r){isArray(t)&&(i=[],each(t,function(e){if(isString(e))i.push(e);else if(isUndefined(e))i.push("null");else try{i.push(JSON.stringify(e))}catch(e){sdLog("您的数据-",r,t,"数组里值有错误,已将其删除")}}),n[r]=i);var i,e=-1<indexOf(a||[],r);if(isObject(t)&&"$option"!==r&&!e)try{n[r]=JSON.stringify(t)}catch(e){delete n[r],sdLog("您的数据-",r,t,"数据值有错误,已将其删除")}else isString(t)||isNumber(t)||isDate(t)||isBoolean(t)||isArray(t)||isFunction(t)||"$option"===r||e||(sdLog("您的数据-",r,t,"-格式不满足要求,我们已经将其删除"),delete n[r])}),n}function formatString(e,t){return isNumber(t)&&e.length>t?(sdLog("字符串长度超过限制,已经做截取--"+e),e.slice(0,t)):e}function filterReservedProperties(r,i){isObject(r)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(e,t){e in r&&(-1<indexOf(i||[],e)||(t<3?(delete r[e],sdLog("您的属性- "+e+"是保留字段,我们已经将其删除")):sdLog("您的属性- "+e+"是保留字段,请避免其作为属性名")))})}function searchObjString(r){var i=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];isObject(r)&&each(r,function(e,t){isObject(e)?searchObjString(r[t]):!isString(e)||-1<indexOf(n,t)||(r[t]=formatString(e,-1<indexOf(i,t)?1024:sdPara.max_string_length))})}function searchZZAppStyle(e){void 0!==e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),void 0!==e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(i){"item_type"in i&&check({item_type:i.item_type},function(e){return e||delete i.item_type,!0}),"item_id"in i&&check({item_id:i.item_id},function(e,t,r){return e||"string"!==r||delete i.item_id,!0})}function formatProperties(n,t){each(n,function(e,i){-1===indexOf(t||[],i)&&check({propertyKey:i},function(e,t,r){return e||"keyLength"===r||delete n[i],!0})})}function formatData(e){var t=e.properties;searchObjDate(e),isObject(t)?(strip_sa_properties(t),filterReservedProperties(t),searchZZAppStyle(e),formatProperties(t),searchObjString(t)):"properties"in e&&(e.properties={}),formatItem(e)}function addFinalData(e,t){t=t.sensors;return e._track_id=Number(String(getRandom()).slice(2,5)+String(getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),t.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={serverUrl:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.serverUrl))return sd.log("----vcollect---server_url必须为有效 URL 字符串"),!1;try{e=_URL(sd.para.serverUrl),r.serverUrl.project=e.searchParams.get("project")||"default",r.serverUrl.host=e.host}catch(e){return sd.log("----vcollect---server_url解析异常",e),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(e){return sd.log("----vcollect---页面地址解析异常",e),!1}return r},isDiv:function(e){if(e.element_path&&"div"!==trim(e.element_path.split(">").pop()).slice(0,3))return!1;return!0},configIsMatchNew:function(e,t){if(isString(e.$element_selector)&&isString(t.element_selector)){if("element_selector"===t.element_field&&"equal"===t.function)return e.$element_selector===t.element_selector;if("element_selector"===t.element_field&&"contain"===t.function)return-1<e.$element_selector.indexOf(t.element_selector)}if(isString(e.$element_path)&&isString(t.element_path)){if("element_path"===t.element_field&&"equal"===t.function)return e.$element_path===t.element_path;if("element_path"===t.element_field&&"contain"===t.function)return-1<e.$element_path.indexOf(t.element_path)}return!1},configIsMatch:function(e,t){return!(t.limit_element_content&&t.element_content!==e.$element_content||t.limit_element_position&&t.element_position!==String(e.$element_position))&&(t.element_field&&t.function?vtrackBase.configIsMatchNew(e,t):vtrackBase.configIsMatchOldVersion(e,t))},configIsMatchOldVersion:function(e,t){if(!t.element_path)return!1;if(void 0!==e.$element_position){if(t.element_path!==e.$element_path)return!1}else if(vtrackBase.isDiv({element_path:t.element_path})){if(e.$element_path.indexOf(t.element_path)<0)return!1}else if(t.element_path!==e.$element_path)return!1;return!0},filterConfig:function(t,e,r){var i=[];if(!r){var n=vtrackBase.initUrl();if(!n)return[];r=n.page_url}return"$WebClick"===t.event&&each(e,function(e){isObject(e)&&("webclick"===e.event_type||"appclick"===e.event_type)&&isObject(e.event)&&e.event.url_host===r.host&&e.event.url_path===r.pathname&&vtrackBase.configIsMatch(t.properties,e.event)&&i.push(e)}),i},getPropElInLi:function(e,t){return!(e&&isElement(e)&&isString(t))||"li"!==e.tagName.toLowerCase()?null:(e=sd.heatmap.getDomSelector(e))?getDomBySelector(e+t)||null:(sd.log("----custom---获取同级属性元素失败,selector信息异常",e,t),null)},getProp:function(t,e){if(!isObject(t))return!1;if(!(isString(t.name)&&0<t.name.length))return sd.log("----vcustom----属性名不合法,属性抛弃",t.name),!1;var r,i,n={};if("content"!==t.method)return sd.log("----vcustom----属性不支持此获取方式",t.name,t.method),!1;if(isString(t.element_selector)&&0<t.element_selector.length)a=getDomBySelector(t.element_selector);else{if(!e||!isString(t.list_selector))return sd.log("----vcustom----属性配置异常,属性抛弃",t.name),!1;var e=getDomBySelector(e.properties.$element_selector);if(!e)return sd.log("----vcustom----点击元素获取异常,属性抛弃",t.name),!1;var e=sd.heatmap.getClosestLi(e),a=vtrackBase.getPropElInLi(e,t.list_selector)}if(!a||!isElement(a))return sd.log("----vcustom----属性元素获取失败,属性抛弃",t.name),!1;if("input"===a.tagName.toLowerCase()?r=a.value||"":"select"===a.tagName.toLowerCase()?isNumber(e=a.selectedIndex)&&isElement(a[e])&&(r=getElementContent$1(a[e],"select")):r=getElementContent$1(a,a.tagName.toLowerCase()),t.regular){try{i=new RegExp(t.regular).exec(r)}catch(e){return sd.log("----vcustom----正则处理失败,属性抛弃",t.name),!1}if(null===i)return sd.log("----vcustom----属性规则处理,未匹配到结果,属性抛弃",t.name),!1;if(!isArray(i)||!isString(i[0]))return sd.log("----vcustom----正则处理异常,属性抛弃",t.name,i),!1;r=i[0]}if("STRING"===t.type)n[t.name]=r;else if("NUMBER"===t.type){if(r.length<1)return sd.log("----vcustom----未获取到数字内容,属性抛弃",t.name,r),!1;if(isNaN(Number(r)))return sd.log("----vcustom----数字类型属性转换失败,属性抛弃",t.name,r),!1;n[t.name]=Number(r)}return n},getAssignConfigs:function(t,e){var r,i=vtrackBase.initUrl();return i&&i.page_url&&isObject(e)&&(r=[],e.events=e.events||e.eventList,isArray(e.events))&&0<e.events.length?(each(e.events,function(e){isObject(e)&&isObject(e.event)&&e.event.url_host===i.page_url.host&&e.event.url_path===i.page_url.pathname&&t(e)&&r.push(e)}),r):[]}},vapph5CustomProp={events:[],getAssignConfigs:vtrackBase.getAssignConfigs,filterConfig:vtrackBase.filterConfig,getProp:vtrackBase.getProp,initUrl:vtrackBase.initUrl,updateEvents:function(e){isArray(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(t){var r={},i=[],n=this;if(!this.events.length)return{};if("$WebClick"===t.event){var e=this.filterConfig(t,this.events);if(!e.length)return{};each(e,function(e){isObject(e)&&(isArray(e.properties)&&0<e.properties.length&&each(e.properties,function(e){isObject(e)&&(!1===e.h5?(isArray(r.sensorsdata_app_visual_properties)||(r.sensorsdata_app_visual_properties=[]),r.sensorsdata_app_visual_properties.push(e)):isObject(e=n.getProp(e,t))&&(r=extend(r,e)))}),isString(e.event_name))&&i.push(e.event_name)}),sd.bridge.hasVisualModeBridge()&&(r.sensorsdata_web_visual_eventName=i)}return r.sensorsdata_app_visual_properties&&(r.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(r.sensorsdata_app_visual_properties))),r},initAppGetPropsBridge:function(){var n=this,a=new sd.SDKJSBridge("getJSVisualProperties");return a.onAppNotify(function(e){var t,r,i={};try{e=JSON.parse(base64Decode(e))}catch(e){sd.log("getJSVisualProperties data parse error!")}return isObject(e)&&(t=e.sensorsdata_js_visual_properties,r=n.initUrl())&&(r=r.page_url,isArray(t))&&0<t.length&&each(t,function(e){isObject(e)&&e.url_host===r.host&&e.url_path===r.pathname&&e.h5&&isObject(e=n.getProp(e))&&(i=extend(i,e))}),"android"===sd.bridge.bridge_info.platform&&a.notifyApp({data:i},e.message_id),i}),a}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){var e;this.initUrl()&&((e=this.getConfigFromApp())&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge())},initAppUpdateConfigBridge:function(){var t=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(e){if(e){try{e=JSON.parse(base64Decode(e))}catch(e){return void sd.log("updateH5VisualConfig result parse error!")}t.updateConfigs(e)}})},getConfigFromApp:function(){var t=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(t)try{t=JSON.parse(base64Decode(t))}catch(e){t=null,sd.log("getAppVisualConfig result parse error!")}return t},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!isObject(e)||!1===e.h5)},e)}},unlimitedDiv={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=vtrackcollect.getAssignConfigs(function(e){return!(!isObject(e)||!0!==e.event.unlimited_div||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=sd.heatmap.getEleDetail(e);if(isObject(t)&&isString(t.$element_path))for(var r=0;r<this.events.length;r++)if(isObject(this.events[r])&&isObject(this.events[r].event)&&vtrackcollect.configIsMatch(t,this.events[r].event))return!0;return!1}},customProp={events:[],configSwitch:!1,collectAble:function(){return this.configSwitch&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config},updateEvents:function(e){this.events=vtrackcollect.getAssignConfigs(function(e){return!!(isObject(e)&&isArray(e.properties)&&0<e.properties.length)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?"$WebClick"===e.event?this.clickCustomPropMaker(e,this.events):t:{}},clickCustomPropMaker:function(t,e,r){var i=this,n=(r=r||this.filterConfig(t,e,vtrackcollect.url_info.page_url),{});return r.length?(each(r,function(e){isArray(e.properties)&&0<e.properties.length&&each(e.properties,function(e){e=i.getProp(e,t);isObject(e)&&extend(n,e)})}),n):{}},getProp:vtrackBase.getProp,getPropElInLi:vtrackBase.getPropElInLi,filterConfig:vtrackBase.filterConfig},vtrackcollect={unlimitedDiv:unlimitedDiv,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:customProp,initUrl:function(){var e,t=vtrackBase.initUrl();if(t){try{(e=new urlParse(sd.para.serverUrl))._values.Path="/config/visualized/Web.conf",t.api_url=e.getUrl()}catch(e){return sd.log("----vtrackcollect---API地址解析异常",e),!1}this.url_info=t}return t},init:function(){var e;return!(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)&&(_localStorage.isSupport()||(this.storageEnable=!1),this.initUrl()?(this.storageEnable&&isObject(e=store.readObjectVal(this.storage_name))&&isObject(e.data)&&this.serverUrlIsSame(e.serverUrl)&&(this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data),isNumber(e=(new Date).getTime()-this.update_time))&&0<e&&e<this.para.session_time?(e=this.para.update_interval-e,this.setNextFetch(e)):this.getConfigFromServer(),void this.pageStateListenner()):(sd.log("----vtrackcustom----初始化失败,url信息解析失败"),!1))},serverUrlIsSame:function(e){return!!isObject(e)&&e.host===this.url_info.serverUrl.host&&e.project===this.url_info.serverUrl.project},getConfigFromServer:function(){var i=this;this.sendRequest(function(e,t){i.update_time=(new Date).getTime();var r={};200===e?t&&isObject(t)&&"Web"===t.os&&i.updateConfig(r=t):205===e?i.updateConfig(r):304===e?r=i.config:(sd.log("----vtrackcustom----数据异常",e),i.updateConfig(r)),i.updateStorage(r),i.setNextFetch()},function(e){i.update_time=(new Date).getTime(),sd.log("----vtrackcustom----配置拉取失败",e),i.setNextFetch()})},setNextFetch:function(e){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),e=e||this.para.update_interval,this.timer=setTimeout(function(){t.getConfigFromServer()},e)},pageStateListenner:function(){var t=this;listenPageState({visible:function(){var e=(new Date).getTime()-t.update_time;isNumber(e)&&0<e&&e<t.para.update_interval?(e=t.para.update_interval-e,t.setNextFetch(e)):t.getConfigFromServer()},hidden:function(){t.timer&&(clearTimeout(t.timer),t.timer=null)}})},updateConfig:function(e){if(!isObject(e))return!1;this.config=e,this.customProp.updateEvents(e),this.unlimitedDiv.init(e)},updateStorage:function(e){if(!this.storageEnable)return!1;if(!isObject(e))return!1;var t;if(this.url_info.serverUrl)t=this.url_info.serverUrl;else{var r=vtrackcollect.initUrl();if(!r)return!1;t=r.serverUrl}r={updateTime:(new Date).getTime(),data:e,serverUrl:t};store.saveObjectVal(this.storage_name,r)},sendRequest:function(r,t){var e={app_id:this.url_info.page_url.host};this.config.version&&(e.v=this.config.version),jsonp({url:this.url_info.api_url,callbackName:"saJSSDKVtrackCollectConfig",data:e,timeout:this.para.timeout,success:function(e,t){r(e,t)},error:function(e){t(e)}})},getAssignConfigs:vtrackBase.getAssignConfigs,configIsMatch:vtrackBase.configIsMatch};function addBasicProps(e,t){var r,t=t.sensors,i={},i=(isObject(e)&&isObject(e.identities)&&!isEmptyObject(e.identities)?extend(i,e.identities):extend(i,store._state.identities),{identities:i,distinct_id:store.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(t.lib_version)},properties:{}});return isObject(e)&&isObject(e.properties)&&!isEmptyObject(e.properties)&&(e.properties.$lib_detail&&(i.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method)&&(i.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method),extend2Lev(i,store.getUnionId(),e),isObject(e.properties)&&!isEmptyObject(e.properties)&&extend(i.properties,e.properties),e.type&&"profile"===e.type.slice(0,7)||(i.properties=extend({},pageInfo.properties(),store.getProps(),store.getSessionProps(),pageInfo.currentProps,i.properties),t.para.preset_properties.latest_referrer&&!isString(i.properties.$latest_referrer)&&(i.properties.$latest_referrer="取值异常"),!t.para.preset_properties.latest_search_keyword||isString(i.properties.$latest_search_keyword)||t.para.preset_properties.search_keyword_baidu&&isString(i.properties.$search_keyword_id)&&isNumber(i.properties.$search_keyword_id_hash)&&isString(i.properties.$search_keyword_id_type)||(i.properties.$latest_search_keyword="取值异常"),t.para.preset_properties.latest_traffic_source_type&&!isString(i.properties.$latest_traffic_source_type)&&(i.properties.$latest_traffic_source_type="取值异常"),t.para.preset_properties.latest_landing_page&&!isString(i.properties.$latest_landing_page)&&(i.properties.$latest_landing_page="取值异常"),"not_collect"===t.para.preset_properties.latest_wx_ad_click_id?(delete i.properties._latest_wx_ad_click_id,delete i.properties._latest_wx_ad_hash_key,delete i.properties._latest_wx_ad_callbacks):t.para.preset_properties.latest_wx_ad_click_id&&!isString(i.properties._latest_wx_ad_click_id)&&(i.properties._latest_wx_ad_click_id="取值异常",i.properties._latest_wx_ad_hash_key="取值异常",i.properties._latest_wx_ad_callbacks="取值异常"),isString(i.properties._latest_wx_ad_click_id)&&(i.properties.$url=getURL())),i.properties.$time&&isDate(i.properties.$time)?(i.time=+i.properties.$time,delete i.properties.$time):i.time=+new Date,e=i,t.bridge&&"success"===t.bridge.bridge_info.verify_success&&isObject(r=vapph5collect.customProp.geth5Props(JSON.parse(JSON.stringify(e))))&&!isEmptyObject(r)&&(e.properties=extend(e.properties,r)),isObject(r=vtrackcollect.customProp.getVtrackProps(JSON.parse(JSON.stringify(e))))&&!isEmptyObject(r)&&(e.properties=extend(e.properties,r)),parseSuperProperties(i),saNewUser.checkIsAddSign(i),saNewUser.checkIsFirstTime(i),addReferrerHost(i),addPropsHook(i),i}var interceptors={basicProps:{priority:0,entry:addBasicProps},formatData:{priority:0,entry:formatData},finalAdjustData:{priority:0,entry:addFinalData}},buildDataStageImpl={stage:null,init:function(e){this.stage=e},interceptor:interceptors};function processBasicProps(e){return buildDataStageImpl.stage.process("basicProps",e)}function processFormatData(e){return buildDataStageImpl.stage.process("formatData",e)}var saEvent={};function trackLinkByCustomTrackFunc(e,i,n,a){var s=null;return(e=e||{}).ele&&(s=e.ele),e.event&&(s=e.target||e.event.target),n=n||{},!(!s||"object"!==_typeof(s))&&(!s.href||/^javascript/.test(s.href)||s.target||s.download||s.onclick?(a(i,n),!1):(e.event&&t(e.event),void(e.ele&&saAddEvent(e.ele,"click",function(e){t(e)}))));function t(e){e.stopPropagation(),e.preventDefault();var t=!1;function r(){t||(t=!0,location.href=s.href)}setTimeout(r,1e3),a(i,n,r)}}saEvent.check=check,saEvent.sendItem=function(e){var t={lib:{$lib:"js",$lib_method:"code",$lib_version:String(sd.lib_version)},time:+new Date};extend(t,e),processFormatData(t),sd.kit.sendData(t)},saEvent.send=function(e,t){e=sd.kit.buildData(e);sd.kit.sendData(e,t)};var viewStageImpl={stage:null,init:function(e){this.stage=e}};function processWebClickEvent(e){return viewStageImpl.stage.process("webClickEvent",e)}function processWebStayEvent(e){return viewStageImpl.stage.process("webStayEvent",e)}var UNLIMITED_TAGS_MAP={label:!1,li:!1,a:!0,button:!0},heatmap={otherTags:[],initUnlimitedTags:function(){each(heatmap.otherTags,function(e){e in UNLIMITED_TAGS_MAP&&(UNLIMITED_TAGS_MAP[e]=!0)})},isUnlimitedTag:function(e){var t;return!(!e||1!==e.nodeType)&&(t=e.nodeName.toLowerCase(),UNLIMITED_TAGS_MAP[t]||hasAttributes(e,sd.para.heatmap.track_attr))},getTargetElement:function(e,t){var r=this,i=e;if("object"!==_typeof(i))return null;if("string"!=typeof i.tagName)return null;var n=i.tagName.toLowerCase();if("body"===n.toLowerCase()||"html"===n.toLowerCase())return null;if(!i||!i.parentNode||!i.parentNode.children)return null;var a=i.parentNode,s=r.otherTags;if("a"===n||"button"===n||"input"===n||"textarea"===n)return i;if(-1<indexOf(s,n))return i;if("area"===n&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===n&&sd.para.heatmap.collectTags.div&&r.isDivLevelValid(i)&&(1<(sd.para.heatmap&&sd.para.heatmap.collectTags&&sd.para.heatmap.collectTags.div&&sd.para.heatmap.collectTags.div.max_level||1)||r.isCollectableDiv(i)))return i;if(r.isStyleTag(n)&&sd.para.heatmap.collectTags.div){s=r.getCollectableParent(i);if(s&&r.isDivLevelValid(s))return s}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var e=heatmap.getElementPath(e,!0,t).split(" > "),r=0;return each(e,function(e){"div"===e&&r++}),r},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collectTags&&sd.para.heatmap.collectTags.div&&sd.para.heatmap.collectTags.div.max_level||1,r=e.getElementsByTagName("div"),i=r.length-1;0<=i;i--)if(heatmap.getDivLevels(r[i],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var i=[];e.parentNode&&isElement(e);){if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){i.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){i.unshift(e.tagName.toLowerCase());break}if(e===document.body){i.unshift("body");break}i.unshift(e.tagName.toLowerCase()),e=e.parentNode}return i.join(" > ")},getClosestLi:function(e){for(var t=e,r="li";t&&t!==document&&1===t.nodeType;t=t.parentNode)if(t.tagName&&isFunction(t.tagName.toLowerCase)&&t.tagName.toLowerCase()===r)return t;return null},getElementPosition:function(e,t,r){var i=sd.heatmap.getClosestLi(e);if(!i||!isElement(e))return null;var n=e.tagName.toLowerCase(),a=i.getElementsByTagName(n),s=a.length,o=[];if(1<s){for(var d=0;d<s;d++)sd.heatmap.getElementPath(a[d],r)===t&&o.push(a[d]);if(1<o.length)return indexOf(o,e)}n=i;if(!n.parentNode)return"";if(1===ry(n).getSameTypeSiblings().length)return 0;for(var c=0,l=n;ry(l).previousElementSibling().ele;l=ry(l).previousElementSibling().ele,c++);return c},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="您SDK没有配置开启点击图,可能没有数据!"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="您的当前页面是https的地址,海纳分析环境也必须是https!")},getDomIndex:function(e){if(e.parentNode)for(var t=0,r=e.tagName,i=e.parentNode.children,n=0;n<i.length;n++)if(i[n].tagName===r){if(e===i[n])return t;t++}return-1},selector:function(e,t){var r=e.parentNode&&9==e.parentNode.nodeType?-1:this.getDomIndex(e);return e.getAttribute&&e.getAttribute("id")&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.getAttribute("id"))&&(!sd.para.heatmap||sd.para.heatmap&&"not_use_id"!==sd.para.heatmap.element_selector)&&!t?"#"+e.getAttribute("id"):e.tagName.toLowerCase()+(~r?":nth-of-type("+(r+1)+")":"")},getDomSelector:function(e,t,r){if(!e||!e.parentNode||!e.parentNode.children)return!1;t=t&&t.join?t:[];var i=e.nodeName.toLowerCase();return e&&"body"!==i&&1==e.nodeType?(t.unshift(this.selector(e,r)),e.getAttribute&&e.getAttribute("id")&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.getAttribute("id"))&&sd.para.heatmap&&"not_use_id"!==sd.para.heatmap.element_selector&&!r?t.join(" > "):this.getDomSelector(e.parentNode,t,r)):(t.unshift("body"),t.join(" > "))},na:function(){var e=document.documentElement.scrollLeft||window.pageXOffset;return parseInt(isNaN(e)?0:e,10)},i:function(){var t=0;try{t=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,t=isNaN(t)?0:t}catch(e){t=0}return parseInt(t,10)},getBrowserWidth:function(){var e=window.innerWidth||document.body.clientWidth;return isNaN(e)?0:parseInt(e,10)},getBrowserHeight:function(){var e=window.innerHeight||document.body.clientHeight;return isNaN(e)?0:parseInt(e,10)},getScrollWidth:function(){var e=parseInt(document.body.scrollWidth,10);return isNaN(e)?0:e},getEleDetail:function(e){var t=this.getDomSelector(e),r=getEleInfo({target:e}),t=(r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector),sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector));return isNumber(t)&&(r.$element_position=t),r},getPointerEventProp:function(e,t){return e?(r=(e=e).pageX||e.clientX+i().scrollLeft||e.offsetX+n(t).targetEleX||0,e=e.pageY||e.clientY+i().scrollTop||e.offsetY+n(t).targetEleY||0,{$page_x:a(r),$page_y:a(e)}):{};var r;function i(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect)return{targetEleX:(e=e.getBoundingClientRect()).left+i().scrollLeft||0,targetEleY:e.top+i().scrollTop||0}}function a(e){return Number(Number(e).toFixed(3))}},start:function(e,t,r,i,n){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collectElement)&&!sd.para.heatmap.collectElement(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,i,n))},getBasicEleInfo:function(e,t,r,i,n){var a,s=isObject(i)?i:{},n=isFunction(n)?n:isFunction(i)?i:void 0,i=this.getEleDetail(t);return sd.para.heatmap&&sd.para.heatmap.addCustomProperty&&isObject(a=sd.para.heatmap.addCustomProperty(t))&&(i=extend(i,a)),{event:e,target:t,props:i=extend(i,this.getPointerEventProp(e,t),s),tagName:r,callback:n}},hasElement:function(e,t){var r,i;if(e.event?i=(r=e.event).path||r._getPath&&r._getPath():e.element&&(i=ry(e.element).getParents()),i&&isArray(i)&&0<i.length)for(var n=0;n<i.length;n++)if("object"===_typeof(i[n])&&1===i[n].nodeType&&t(i[n]))return i[n]},isStyleTag:function(e,t){return!(-1<indexOf(["a","div","input","button","textarea"],e))&&(!t||sd.para.heatmap&&sd.para.heatmap.collectTags&&sd.para.heatmap.collectTags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collectTags)&&isObject(sd.para.heatmap.collectTags.div)&&isArray(sd.para.heatmap.collectTags.div.ignore_tags)&&-1<indexOf(sd.para.heatmap.collectTags.div.ignore_tags,e)):-1<indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e))},isCollectableDiv:function(e,t){try{if(0!==e.children.length)for(var r=0;r<e.children.length;r++)if(1===e.children[r].nodeType){var i=e.children[r].tagName.toLowerCase(),n=sd.para&&sd.para.heatmap&&sd.para.heatmap.collectTags&&sd.para.heatmap.collectTags.div&&sd.para.heatmap.collectTags.div.max_level;if(!("div"===i&&1<n||this.isStyleTag(i,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(e){sd.log(e)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,i=r?r.tagName.toLowerCase():"";if("body"===i)return!1;var n=sd.para&&sd.para.heatmap&&sd.para.heatmap.collectTags&&sd.para.heatmap.collectTags.div&&sd.para.heatmap.collectTags.div.max_level;if(i&&"div"===i&&(1<n||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(i,t))return this.getCollectableParent(r,t)}catch(e){sd.log(e)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||!0!==sd.para.heatmap.stayAutoTrack)return!1;var e,r,t=!0,i=(sd.para.stayAutoTrackConfig&&isFunction(sd.para.stayAutoTrackConfig.isCollectUrl)&&this.listenUrlChange(function(){t=!!sd.para.stayAutoTrackConfig.isCollectUrl()}),(r={}).timeout=(e={timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,i=new Date,n=i-this.current_time;(n>sd.para.heatmap.stayDelayTime&&r-e.$viewport_position!=0||t)&&(e.$url=getURL(),e.$title=document.title,e.$url_path=getURLPath(),e.event_duration=Math.min(sd.para.heatmap.maxStayPageDuration,parseInt(n)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=i}}).timeout||1e3,r.func=e.func,r.hasInit=!1,r.inter=null,r.main=function(e,t){this.func(e,t),this.inter=null},r.go=function(e){var t={};this.inter||(t.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,t.$viewport_position=Math.round(t.$viewport_position)||0,e?r.main(t,!0):this.inter=setTimeout(function(){r.main(t)},this.timeout))},r);i.current_time=new Date,saAddEvent(window,"scroll",function(){if(!t)return!1;i.go()}),saAddEvent(window,"unload",function(){if(!t)return!1;i.go("notime")})},initHeatmap:function(){var n=this,a=!0;if(!isObject(sd.para.heatmap)||!0!==sd.para.heatmap.clickAutoTrack)return!1;isFunction(sd.para.heatmap.isCollectUrl)&&this.listenUrlChange(function(){a=!!sd.para.heatmap.isCollectUrl()}),"all"===sd.para.heatmap.collect_elements?sd.para.heatmap.collect_elements="all":sd.para.heatmap.collect_elements="interact","all"===sd.para.heatmap.collect_elements?saAddEvent(document,"click",function(e){var t,r,i;return!!a&&!!(e=e||window.event)&&"object"===_typeof(t=e.target||e.srcElement)&&"string"==typeof t.tagName&&"body"!==(r=t.tagName.toLowerCase())&&"html"!==r&&!!(t&&t.parentNode&&t.parentNode.children)&&void("a"===(i=t.parentNode.tagName.toLowerCase())||"button"===i?n.start(e,t.parentNode,i):n.start(e,t,r))}):saAddEvent(document,"click",function(e){var t,r;return!!a&&!!(t=e||window.event)&&(r=t.target||t.srcElement,void((e=sd.heatmap.getTargetElement(r,e))?n.start(t,e,e.tagName.toLowerCase()):isElement(r)&&"div"===r.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&0<unlimitedDiv.events.length&&unlimitedDiv.isTargetEle(r)&&n.start(t,r,r.tagName.toLowerCase(),{$lib_method:"vtrack"})))})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),i={};return each(e,function(e,t,r){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+t+" ")?i["$"+t]=r[t]:i[t]=r[t]}),i}function sendFirstProfile(e,t,r){sd.is_first_visitor&&r&&(r={},sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(r.$search_keyword_id=getBaiduKeyword.id(),r.$search_keyword_id_type=getBaiduKeyword.type(),r.$search_keyword_id_hash=hashCode53(r.$search_keyword_id)),t=getReferrer(null,t),e(extend({$first_visit_time:new Date,$first_referrer:t,$first_referrer_host:t?getHostname(t,"取值异常"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"取值异常",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"取值异常",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),r)),sd.is_first_visitor=!1)}var commonWays={autoTrackIsUsed:!1,isReady:function(e){isFunction(e)?e():sd.log("error: isReady callback must be function")},getUtm:function(){return pageInfo.campaignParams()},getStayTime:function(){return(new Date-sd._t)/1e3},setProfileLocal:function(e){if(!_localStorage.isSupport())return sd.userSet(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("hinadata_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],r=!0);r&&(store.saveObjectVal("hinadata_jssdk_profile",t),sd.userSet(e))}else store.saveObjectVal("hinadata_jssdk_profile",e),sd.userSet(e)},setInitReferrer:function(){var e=getReferrer();sd.userSetOnce({_init_referrer:e,_init_referrer_host:pageInfo.pageProp.referrer_host})},setSessionReferrer:function(){var e=getReferrer();store.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:pageInfo.pageProp.referrer_host})},setDefaultAttr:function(){pageInfo.register({_current_url:location.href,_referrer:getReferrer(),_referring_host:pageInfo.pageProp.referrer_host})},trackHeatMap:function(e,t,r){var i,n,a;"object"===_typeof(e)&&e.tagName&&isElement(e.parentNode)&&(i=e.tagName.toLowerCase(),n=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-hinadata-click"],"button"===i||"a"===i||"a"===n||"button"===n||"input"===i||"textarea"===i||hasAttributes(e,a)||heatmap.start(null,e,i,t,r))},trackAllHeatMap:function(e,t,r){var i;"object"===_typeof(e)&&e.tagName&&(i=e.tagName.toLowerCase(),heatmap.start(null,e,i,t,r))},autoTrackSinglePage:function(e,t){var r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer,i=!(e=isObject(e)?e:{}).not_set_profile;function n(e,t){sd.track("$pageview",extend({$referrer:r,$url:getURL(),$url_path:getURLPath(),$title:document.title},e,getClassifiedUtms()),t),r=getURL()}e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,sendFirstProfile(sd.userSetOnce,!1,i)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(t,r){t=isObject(t)?t:{};var i=getClassifiedUtms(),e=!t.not_set_profile,n=(t.not_set_profile&&delete t.not_set_profile,location.href);sd.para.isSinglePage&&addHashEvent(function(){var e=getReferrer(n,!0);sd.track("$pageview",extend({$referrer:e,$url:getURL(),$url_path:getURLPath(),$title:document.title},i,t),r),n=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},i,t),r),sendFirstProfile(sd.userSetOnce,!0,e),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store._state._first_id||store._state.first_id||store._state._distinct_id||store._state.distinct_id},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]||isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sd.log(t+"is not found,please check hinadata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function addSinglePageEvent(e){var t,r=location.href,i=window.history.pushState,n=window.history.replaceState;isFunction(window.history.pushState)&&(window.history.pushState=function(){i.apply(window.history,arguments),e(r),r=location.href}),isFunction(window.history.replaceState)&&(window.history.replaceState=function(){n.apply(window.history,arguments),e(r),r=location.href}),t=!window.document.documentMode&&i?"popstate":"hashchange",addEvent(window,t,function(){e(r),r=location.href})}var spa=new EventEmitter,sdk=new EventEmitter,ee={};function eventEmitterFacade(e,t){"string"==typeof e&&e in ee.EVENT_LIST&&(e=ee.EVENT_LIST[e],ee[e[0]].on(e[1],t))}function loginBody(e,t){var r=e.id,i=e.callback,e=e.name,n=store.getFirstId(),a=store.getOriginDistinctId();return check({distinct_id:r})?r!==store.getOriginDistinctId()||n?!(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&r===store._state.first_id||store._state.history_login_id.name===e&&r===store._state.history_login_id.value||(store._state.identities[e]=r,store.set("history_login_id",{name:e,value:r}),n||store.set("first_id",a),t(r,"$SignUp",{},i),(n={$identity_cookie_id:store._state.identities.$identity_cookie_id})[e]=r,resetIdentities(n),0)):(sdLog("setUserUId id is equal to distinct_id"),!1):(sdLog("setUserUId id is invalid"),!1)}function resetIdentities(e){var t,r={};for(t in e)r[t]=e[t];store._state.identities=r,store.save()}function deleteBindIDData(e,t){var r;return!!check({unbindKey:e,bindValue:t})&&(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t&&((r=store.getUnionId().login_id)&&e+"+"+t===r&&(store._state.distinct_id=store._state.first_id,store._state.first_id="",store.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e)&&(delete store._state.identities[e],store.save()),(r={})[e]=t,r)}function setInitVar(){sd._t=sd._t||+new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),e&&(sdPara.heatmap=e.autoTrackConfig),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var i in sd.para.is_track_latest)r["latest_"+i]=sd.para.is_track_latest[i];for(t in sd.para.preset_properties=extend({},defaultPara.preset_properties,r,sd.para.preset_properties||{}),defaultPara)void 0===sd.para[t]&&(sd.para[t]=defaultPara[t]);"string"!=typeof sd.para.web_url||"://"!==sd.para.web_url.slice(0,3)&&"//"!==sd.para.web_url.slice(0,2)||("://"===sd.para.web_url.slice(0,3)?sd.para.web_url=location.protocol.slice(0,-1)+sd.para.web_url:sd.para.web_url=location.protocol+sd.para.web_url),debug.protocol.serverUrl(),sd.bridge&&sd.bridge.initPara();var e=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],n=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],a=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],s={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"},e=("object"===_typeof(sd.para.source_type)&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(e):e,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(n):n,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(a):a,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(s,sd.para.source_type.keyword):s),["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"]);sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)&&(_.isBoolean(sd.para.heatmap.clickAutoTrack)||(sd.para.heatmap.clickAutoTrack=!0),_.isBoolean(sd.para.heatmap.stayAutoTrack)||(sd.para.heatmap.stayAutoTrack=!0),sd.para.heatmap.stayDelayTime=sd.para.heatmap.stayDelayTime||4e3,sd.para.heatmap.maxStayPageDuration=sd.para.heatmap.maxStayPageDuration||18e3,sd.para.heatmap.renderRefreshTime=sd.para.heatmap.renderRefreshTime||1e3,sd.para.heatmap.loadTimeout=sd.para.heatmap.loadTimeout||1e3,!0!==sd.para.heatmap.get_vtrack_config&&(sd.para.heatmap.get_vtrack_config=!1),(n=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[]).push("data-hinadata-click"),sd.para.heatmap.track_attr=n,isObject(sd.para.heatmap.collectTags)?!0===sd.para.heatmap.collectTags.div?sd.para.heatmap.collectTags.div={ignore_tags:e,max_level:1}:isObject(sd.para.heatmap.collectTags.div)?(sd.para.heatmap.collectTags.div.ignore_tags?isArray(sd.para.heatmap.collectTags.div.ignore_tags)||(sd.log("ignore_tags 参数必须是数组格式"),sd.para.heatmap.collectTags.div.ignore_tags=e):sd.para.heatmap.collectTags.div.ignore_tags=e,sd.para.heatmap.collectTags.div.max_level&&-1===indexOf([1,2,3],sd.para.heatmap.collectTags.div.max_level)&&(sd.para.heatmap.collectTags.div.max_level=1)):sd.para.heatmap.collectTags.div=!1:sd.para.heatmap.collectTags={div:!1}),sd.para.serverUrl=optimizeServerUrl(sd.para.serverUrl),!0===sd.para.noCache?sd.para.noCache="?"+(new Date).getTime():sd.para.noCache="",sd.para.callback_timeout>sd.para.datasend_timeout&&(sd.para.datasend_timeout=sd.para.callback_timeout),sd.para.heatmap&&sd.para.heatmap.collectTags&&isObject(sd.para.heatmap.collectTags)&&each(sd.para.heatmap.collectTags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&!0===sd.para.heatmap.clickAutoTrack&&sd.heatmap.initUnlimitedTags()}ee.spa=spa,ee.sdk=sdk,ee.initSystemEvent=function(){addSinglePageEvent(function(e){spa.emit("switch",e)})},ee.EVENT_LIST={spaSwitch:["spa","switch"],sdkBeforeInit:["sdk","beforeInit"],sdkInitPara:["sdk","initPara"],sdkAfterInitPara:["sdk","afterInitPara"],sdkInitAPI:["sdk","initAPI"],sdkAfterInitAPI:["sdk","afterInitAPI"],sdkAfterInit:["sdk","afterInit"],sdkReady:["sdk","ready"]};var readyState={state:0,historyState:[],stateType:{1:"1-init未开始",2:"2-init开始",3:"3-store完成"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}};function quick(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);if("string"==typeof t&&commonWays[t])return commonWays[t].apply(commonWays,r);"function"==typeof t?t.apply(sd,r):sd.log("quick方法中没有这个功能"+e[0])}var nonameCount=1;function use(e,t){var r,i=sd.log||function(){};return isString(e)||isObject(e)?(isObject(e)&&((r=sd.modules&&sd.modules[e.plugin_name])&&r!==e&&i(e.plugin_name+" plugin_name is conflict with loaded plugin, sdk uses loaded plugin."),r=r||e),isString(e)&&(isObject(sd.modules)&&isObject(sd.modules[e])?r=sd.modules[e]:isObject(window.SensorsDataWebJSSDKPlugin)&&isObject(window.SensorsDataWebJSSDKPlugin[e])?r=window.SensorsDataWebJSSDKPlugin[e]:window.hinaDataStatistic&&window.hinaDataStatistic.modules[e]&&(r=window.hinaDataStatistic.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||i("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&i("warning: plugin version not match SDK version. plugin may not work correctly. "):i("warning: invalid plugin, plugin version required."),r.plugin_is_init||r.init(sd,t),r.plugin_is_init=!0,sd.modules=sd.modules||{},sd.modules[r.plugin_name||"unnamed_"+nonameCount++]=r):(i((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check hinadata official documents."),r)):(i("use's first arguments must be string or object."),!1)}function track(e,t,r){check({event:e,properties:t})&&saEvent.send({type:"track",event:e,properties:t},r)}function bind(e,t){if(!check({bindKey:e,bindValue:t}))return!1;store._state.identities[e]=t,store.save(),saEvent.send({type:"track_id_bind",event:"$BindID",properties:{}})}function unbind(e,t){e=deleteBindIDData(e,t);e&&saEvent.send({identities:e,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function trackLink(e,t,r){"object"===_typeof(e)&&e.tagName?trackLinkByCustomTrackFunc({ele:e},t,r,sd.track):"object"===_typeof(e)&&e.target&&e.event&&trackLinkByCustomTrackFunc(e,t,r,sd.track)}function trackLinks(i,n,a){return a=a||{},!(!i||"object"!==_typeof(i)||!i.href||/^javascript/.test(i.href)||i.target)&&void saAddEvent(i,"click",function(e){e.preventDefault();var t=!1;function r(){t||(t=!0,location.href=i.href)}setTimeout(r,1e3),sd.track(n,a,r)})}function setItem(e,t,r){check({item_type:e,item_id:t,properties:r})&&saEvent.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function deleteItem(e,t){check({item_type:e,item_id:t})&&saEvent.sendItem({type:"item_delete",item_type:e,item_id:t})}function userSet(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function userSetOnce(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function userAppend(r,e){check({propertiesMust:r})&&(each(r,function(e,t){isString(e)?r[t]=[e]:isArray(e)?r[t]=e:(delete r[t],sd.log("appendProfile属性的值必须是字符串或者数组"))}),isEmptyObject(r)||saEvent.send({type:"profile_append",properties:r},e))}function userAdd(e,t){var r=e;isString(e)&&((e={})[r]=1),check({propertiesMust:e})&&(!function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return;return 1}(e)?sd.log("profile_increment的值只能是数字"):saEvent.send({type:"profile_increment",properties:e},t))}function deleteProfile(e){saEvent.send({type:"profile_delete"},e),store.set("distinct_id",UUID()),store.set("first_id","")}function unsetProfile(e,t){var r=e,i={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?i[e]=!0:sd.log("profile_unset给的数组里面的值必须时string,已经过滤掉",e)}),saEvent.send({type:"profile_unset",properties:i},t)):sd.log("profile_unset的参数是数组")}function setDeviceUId(e,t){"number"==typeof e&&(e=String(e));var r,i=store.getFirstId();void 0===e?(r=UUID(),i?store.set("first_id",r):store.set("distinct_id",r)):check({distinct_id:e})&&(!0===t?i?store.set("first_id",e):store.set("distinct_id",e):i?store.change("first_id",e):store.change("distinct_id",e))}function getDeviceUId(){return store.getDistinctId()}function sendSignup(e,t,r,i){var n=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:n,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},i)}function trackSignup(e,t,r,i){check({distinct_id:e="number"==typeof e?String(e):e,event:t,properties:r})&&sendSignup(e,t,r,i)}function registerCommonProperties(e){check({properties:e})?extend(pageInfo.currentProps,e):sd.log("register输入的参数有误")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){if(isArray(e)&&0<e.length)for(t=0;t<e.length;t++)isString(e[t])&&e[t]in pageInfo.currentProps&&delete pageInfo.currentProps[e[t]];else if(!0===e)for(var t in pageInfo.currentProps)delete pageInfo.currentProps[t]}function register(e){check({properties:e})?store.setProps(e):sd.log("register输入的参数有误")}function registerOnce(e){check({properties:e})?store.setPropsOnce(e):sd.log("registerOnce输入的参数有误")}function registerSession(e){sd.log("registerSession 方法已经弃用,有问题联系技术顾问"),check({properties:e})?store.setSessionProps(e):sd.log("registerSession输入的参数有误")}function registerSessionOnce(e){sd.log("registerSessionOnce 方法已经弃用,有问题联系技术顾问"),check({properties:e})?store.setSessionPropsOnce(e):sd.log("registerSessionOnce输入的参数有误")}function setUserUId(e,t){!loginBody({id:e="number"==typeof e?String(e):e,callback:t,name:IDENTITY_KEY.LOGIN},sendSignup)&&isFunction(t)&&t()}function loginWithKey(e,t){return"number"==typeof t&&(t=String(t)),!!check({loginIdKey:e="number"==typeof e?String(e):e})&&(IDENTITY_KEY.LOGIN===e?(setUserUId(t),!1):void loginBody({id:t,callback:null,name:e},sendSignup))}function logout(e){var t=store.getFirstId();t&&(store.set("first_id",""),!0===e?(e=UUID(),store.set("distinct_id",e)):store.set("distinct_id",t)),resetIdentities({$identity_cookie_id:store._state.identities.$identity_cookie_id}),store.set("history_login_id",{name:"",value:""})}function getPresetProperties(){var i,e={$is_first_day:isNewUser(),$is_first_time:saNewUser.is_page_first_visited,$referrer:pageInfo.pageProp.referrer||"",$referrer_host:pageInfo.pageProp.referrer?getHostname(pageInfo.pageProp.referrer):"",$url:getURL(),$url_path:getURLPath(),$title:document.title||"",_distinct_id:store.getDistinctId(),identities:JSON.parse(JSON.stringify(store._state.identities))},t=extend({},pageInfo.properties(),store.getProps(),(t=pageInfo.campaignParams(),i={},each(t,function(e,t,r){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+t+" ")?i["$"+t]=r[t]:i[t]=r[t]}),i),e);return sd.para.preset_properties.latest_referrer&&sd.para.preset_properties.latest_referrer_host&&(t.$latest_referrer_host=""===t.$latest_referrer?"":getHostname(t.$latest_referrer)),t}var functions={__proto__:null,setInitVar:setInitVar,initPara:initPara,quick:quick,use:use,track:track,bind:bind,unbind:unbind,trackLink:trackLink,trackLinks:trackLinks,setItem:setItem,deleteItem:deleteItem,userSet:userSet,userSetOnce:userSetOnce,userAppend:userAppend,userAdd:userAdd,deleteProfile:deleteProfile,unsetProfile:unsetProfile,setDeviceUId:setDeviceUId,getDeviceUId:getDeviceUId,trackSignup:trackSignup,registerCommonProperties:registerCommonProperties,clearAllRegister:clearAllRegister,clearPageRegister:clearPageRegister,register:register,registerOnce:registerOnce,registerSession:registerSession,registerSessionOnce:registerSessionOnce,setUserUId:setUserUId,loginWithKey:loginWithKey,logout:logout,getPresetProperties:getPresetProperties,readyState:readyState,log:sdLog,debug:debug,on:eventEmitterFacade,disableLocalLog:disableLocalLog,enableLocalLog:enableLocalLog},_=(logger.setup(sdLog),extend({},W,business));function iOSWebClickPolyfill(){var t="",r=" { cursor: pointer; -webkit-tap-highlight-color: rgba(0,0,0,0); }";sd.heatmap&&isArray(sd.heatmap.otherTags)&&each(sd.heatmap.otherTags,function(e){t+=e+r}),isIOS()&&getIOSVersion()&&getIOSVersion()<13&&(sd.para.heatmap&&sd.para.heatmap.collectTags&&sd.para.heatmap.collectTags.div&&setCssStyle("div, [data-hinadata-click]"+r),sd.para.heatmap&&sd.para.heatmap.track_attr&&setCssStyle("["+sd.para.heatmap.track_attr.join("], [")+"]"+r),""!==t)&&setCssStyle(t)}var bridge={bridge_info:{touch_app_bridge:!1,verify_success:!1,platform:"",support_two_way_call:!1},is_verify_success:!1,initPara:function(){var e={is_send:!1!==sd.para.use_app_track_is_send&&"only"!==sd.para.use_app_track,white_list:[],is_mui:"mui"===sd.para.use_app_track};"object"===_typeof(sd.para.app_js_bridge)?sd.para.app_js_bridge=extend({},e,sd.para.app_js_bridge):!0!==sd.para.use_app_track&&!0!==sd.para.app_js_bridge&&"only"!==sd.para.use_app_track&&"mui"!==sd.para.use_app_track||(sd.para.app_js_bridge=extend({},e)),!1===sd.para.app_js_bridge.is_send&&sd.log("设置了 is_send:false,如果打通失败,数据将被丢弃!")},app_js_bridge_v1:function(){var r=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(e){isJSONString(r=e)&&(r=JSON.parse(r)),i&&(i(r),r=i=null)},sd.getAppStatus=function(e){var t;if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&((t=document.createElement("iframe")).setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(t),t.parentNode.removeChild(t)),"object"===_typeof(window.SensorsData_APP_JS_Bridge)&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&isJSONString(r=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app())&&(r=JSON.parse(r)),!e)return r;null===r?i=e:(e(r),r=null)}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return isObject(e)&&e[t]&&(!0===e[t]||e[t]())},validateAppUrl:validateAppUrl};function SDKJSBridge(e){var n=this;this.type=e,this.resultCbs={},this.timeoutCbs={},this.timerId=null,this.appCallJsCallback=null,window.sensorsdata_app_call_js||(window.sensorsdata_app_call_js=function(e,t){if(e in window.sensorsdata_app_call_js.modules)return window.sensorsdata_app_call_js.modules[e](t)}),window.sensorsdata_app_call_js.modules=window.sensorsdata_app_call_js.modules||{},window.sensorsdata_app_call_js.modules[this.type]=function(t){try{var e=base64Decode(t)||t;try{e=JSON.parse(e)}catch(e){}var r=e&&e.message_id;if(!r||!n.resultCbs[r])return n.appCallJsCallback&&n.appCallJsCallback.call(null,t);if(t=e,n.timeoutCbs[r]&&n.timeoutCbs[r].isTimeout)n.resultCbs[r].callbacks.length=0;else if(n.resultCbs[r])for(var i in n.resultCbs[r].result=t,clearTimeout(n.timerId),n.timeoutCbs[r].callbacks.length=0,n.resultCbs[r].callbacks)n.resultCbs[r].callbacks[i].call(null,t),n.resultCbs[r].callbacks.splice(i,1)}catch(e){console.log("app 回调 js 异常",t)}}}function handleCommands(e){try{if(sd.bridge.activeBridge&&isFunction(sd.bridge.activeBridge.handleCommand))return sd.bridge.activeBridge.handleCommand(e)}catch(e){sd.log("Error: handle command exception:"+e)}return sd.log("数据发往App失败,App没有暴露bridge,type:"+e.callType),!1}function validateAppUrl(e){function t(e){var t={hostname:"",project:""};try{e=_URL(e),t.hostname=e.hostname,t.project=e.searchParams.get("project")||"default"}catch(e){sd.log(e)}return t}var r=t(e),e=t(sd.para.serverUrl);if(r.hostname===e.hostname&&r.project===e.project)return!0;if(isArray(sd.para.app_js_bridge.white_list))for(var i=0;i<sd.para.app_js_bridge.white_list.length;i++){var n=t(sd.para.app_js_bridge.white_list[i]);if(n.hostname===r.hostname&&n.project===r.project)return!0}return!1}function DeprecatedJSBridge(e){this.bridge=new SDKJSBridge(e.type)}function initLatestProps(){var e,n=pageInfo.pageProp.url_domain,a={},t=(""===n&&(n="url解析失败"),getKeywordFromReferrer(document.referrer,!0));sdPara.preset_properties.search_keyword_baidu?isReferralTraffic(document.referrer)&&(!isBaiduTraffic()||isObject(t)&&t.active?store._state&&store._state.props&&(store._state.props.$search_keyword_id&&delete store._state.props.$search_keyword_id,store._state.props.$search_keyword_id_type&&delete store._state.props.$search_keyword_id_type,store._state.props.$search_keyword_id_hash)&&delete store._state.props.$search_keyword_id_hash:(a.$search_keyword_id=getBaiduKeyword.id(),a.$search_keyword_id_type=getBaiduKeyword.type(),a.$search_keyword_id_hash=hashCode53(a.$search_keyword_id))):store._state&&store._state.props&&(store._state.props.$search_keyword_id&&delete store._state.props.$search_keyword_id,store._state.props.$search_keyword_id_type&&delete store._state.props.$search_keyword_id_type,store._state.props.$search_keyword_id_hash)&&delete store._state.props.$search_keyword_id_hash,store.save(),each(sdPara.preset_properties,function(e,t){if(-1===t.indexOf("latest_"))return!1;if(t=t.slice(7),e){if("wx_ad_click_id"===t&&"not_collect"===e)return!1;if("utm"!==t&&"url解析失败"===n)"wx_ad_click_id"===t?(a._latest_wx_ad_click_id="url的domain解析失败",a._latest_wx_ad_hash_key="url的domain解析失败",a._latest_wx_ad_callbacks="url的domain解析失败"):a["$latest_"+t]="url的domain解析失败";else if(isReferralTraffic(document.referrer))switch(t){case"traffic_source_type":a.$latest_traffic_source_type=getSourceFromReferrer();break;case"referrer":a.$latest_referrer=pageInfo.pageProp.referrer;break;case"search_keyword":getKeywordFromReferrer()?a.$latest_search_keyword=getKeywordFromReferrer():isObject(store._state)&&isObject(store._state.props)&&store._state.props.$latest_search_keyword&&delete store._state.props.$latest_search_keyword;break;case"landing_page":a.$latest_landing_page=getURL();break;case"wx_ad_click_id":var r=getWxAdIdFromUrl(location.href);a._latest_wx_ad_click_id=r.click_id,a._latest_wx_ad_hash_key=r.hash_key,a._latest_wx_ad_callbacks=r.callbacks}}else if("utm"===t&&store._state&&store._state.props)for(var i in store._state.props)(0===i.indexOf("$latest_utm")||0===i.indexOf("_latest_")&&i.indexOf("_latest_wx_ad_")<0)&&delete store._state.props[i];else store._state&&store._state.props&&"$latest_"+t in store._state.props?delete store._state.props["$latest_"+t]:"wx_ad_click_id"==t&&store._state&&store._state.props&&!1===e&&each(["_latest_wx_ad_click_id","_latest_wx_ad_hash_key","_latest_wx_ad_callbacks"],function(e){e in store._state.props&&delete store._state.props[e]})}),sdPara.preset_properties.latest_utm&&(e=(t=pageInfo.campaignParamsStandard("$latest_","_latest_")).$utms,t=t.otherUtms,isEmptyObject(e)||extend(a,e),isEmptyObject(t)||extend(a,t)),register(a)}function getFlagValue(e){var t=null;try{var r=JSON.parse(window.name),t=r[e]?_decodeURIComponent(r[e]):null}catch(e){t=null}return t=null===t?getQueryParam(location.href,e)||null:t}SDKJSBridge.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(getRandom()).replace(".","").slice(1,8),e=(this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},(e=e.data?e:{data:e}).data.message_id=i,extend({callType:this.type},e));return t&&(this.timerId=setTimeout(function(){for(var e in r.timeoutCbs[i].isTimeout=!0,r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),handleCommands(e),{onResult:function(e){return r.resultCbs[i].result?e(r.resultCbs[i].result):r.timeoutCbs[i].isTimeout||r.resultCbs[i].callbacks.push(e),this},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?e():r.resultCbs[i].result||r.timeoutCbs[i].callbacks.push(e),this}}},SDKJSBridge.prototype.onAppNotify=function(e){this.appCallJsCallback=e},SDKJSBridge.prototype.notifyApp=function(e,t){e=extend({callType:this.type},e);return t&&(e.message_id=t),handleCommands(e)},DeprecatedJSBridge.prototype={double:function(){},getAppData:function(){},hasAppBridge:function(){return sd.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(e){isFunction(t.callback)&&t.callback(e)}).onTimeout(function(){isFunction(t.timeout.callback)&&t.timeout.callback()})}};var heatmapMode={isSeachHasKeyword:function(){return""!==getQueryParam(location.href,"sa-request-id")&&("string"==typeof sessionStorage.getItem("sensors-visual-mode")&&sessionStorage.removeItem("sensors-visual-mode"),!0)},hasKeywordHandle:function(){var e=location.href,t=getQueryParam(e,"sa-request-id")||null,r=getQueryParam(e,"sa-request-type")||null,e=getQueryParam(e,"sa-request-url")||null;heatmap.setNotice(e),_sessionStorage.isSupport()&&(null!==e&&sessionStorage.setItem("sensors_heatmap_url",e),sessionStorage.setItem("sensors_heatmap_id",t),null!==r?"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null:r=null!==(e=sessionStorage.getItem("sensors_heatmap_type"))?e:null),this.isReady(t,r)},isReady:function(e,t,r){"undefined"!=typeof sa_jssdk_heatmap_render&&sa_jssdk_heatmap_render(sd,e,t,r)},isStorageHasKeyword:function(){return _sessionStorage.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){heatmap.setNotice(),heatmapMode.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=isString(e["sa-request-page-url"])?_decodeURIComponent(e["sa-request-page-url"]):null;return e["sa-request-id"]&&isString(e["sa-request-id"])&&t===location.href}catch(e){return!1}},windowNameHasKeywordHandle:function(){var t=JSON.parse(window.name);function e(e){e=t[e];return isString(e)?_decodeURIComponent(e):null}var r=e("sa-request-id"),i=e("sa-request-type"),n=e("sa-request-url");heatmap.setNotice(n),_sessionStorage.isSupport()&&(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",r),null!==i?"1"===i||"2"===i||"3"===i?sessionStorage.setItem("sensors_heatmap_type",i):i=null:i=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),heatmapMode.isReady(r,i)}},vtrackMode={isStorageHasKeyword:function(){return _sessionStorage.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(!0===getFlagValue("sa-visual-mode")||"true"===getFlagValue("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){loadScript({success:function(){},error:function(){},type:"js",url:sd.para.vtrack_url||""})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;"v-track-mode"===e.data.type&&(e.data.data&&e.data.data.isVtrack&&(_sessionStorage.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)?(e=isHttpUrl(e=e.data.data.userURL)?removeScriptProtocol(e):(sd.log("可视化模式检测 URL 失败"),!1))&&(window.location.href=e):vtrackMode.loadVtrack()),window.removeEventListener("message",vtrackMode.messageListener,!1))},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",vtrackMode.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",vtrackMode.messageListener,!1),vtrackMode.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:sdkversion_placeholder}},"*")}catch(e){sd.log("浏览器版本过低,不支持 postMessage API")}},notifyUser:function(){window.addEventListener&&window.addEventListener("message",function e(t){if(!t||!t.data||"sa-fe"!==t.data.source)return!1;"v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("当前版本不支持,请升级部署海纳数据治理"),window.removeEventListener("message",e,!1))},!1),vtrackMode.postMessage()}};function defineMode(e){var t,r=sd.bridge.bridge_info;function i(){var e=[];r.touch_app_bridge||e.push(debug.defineMode("1")),isObject(sd.para.app_js_bridge)||(e.push(debug.defineMode("2")),r.verify_success=!1),isObject(sd.para.heatmap)&&1==sd.para.heatmap.clickAutoTrack||e.push(debug.defineMode("3")),"fail"===r.verify_success&&e.push(debug.defineMode("4")),new sd.SDKJSBridge("app_alert").notifyApp({data:e})}sd.bridge.hasVisualModeBridge()&&(isObject(sd.para.heatmap)&&1==sd.para.heatmap.clickAutoTrack&&isObject(sd.para.app_js_bridge)&&"success"===r.verify_success?e?window.sa_jssdk_app_define_mode(sd,e):(t=-1<indexOf(["http:","https:"],t=location.protocol)?t:"https:",loadScript({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(sd,e)},0)},error:function(){},type:"js",url:""})):i())}function listenSinglePage(i){sd.para.is_track_single_page&&spa.on("switch",function(t){function e(e){e=e||{},t!==location.href&&(pageInfo.pageProp.referrer=getURL(t),e=extend({$url:getURL(),$referrer:getURL(t)},e),isFunction(i)?i(e):sd.quick&&sd.quick("autoTrack",e))}var r;"boolean"==typeof sd.para.is_track_single_page?e():"function"==typeof sd.para.is_track_single_page&&(isObject(r=sd.para.is_track_single_page())?e(r):!0===r&&e())})}function enterFullTrack(){sd._q&&isArray(sd._q)&&0<sd._q.length&&each(sd._q,function(e){sd[e[0]].apply(sd,Array.prototype.slice.call(e[1]))}),isObject(sd.para.heatmap)&&(heatmap.initHeatmap(),heatmap.initScrollmap())}function trackMode(){sd.readyState.setState(3),new sd.SDKJSBridge("visualized").onAppNotify(function(){"undefined"!=typeof sa_jssdk_app_define_mode?defineMode(!0):defineMode(!1)}),defineMode(!1),sd.bridge.app_js_bridge_v1(),pageInfo.initPage(),listenSinglePage(),store.init(),initLatestProps(),initVtrack(),sd.readyState.setState(4),enterFullTrack()}function detectMode(){heatmapMode.isSeachHasKeyword()?heatmapMode.hasKeywordHandle():window.parent!==self&&vtrackMode.isSearchHasKeyword()?vtrackMode.verifyVtrackMode():heatmapMode.isWindowNameHasKeyword()?heatmapMode.windowNameHasKeywordHandle():heatmapMode.isStorageHasKeyword()?heatmapMode.storageHasKeywordHandle():window.parent!==self&&vtrackMode.isStorageHasKeyword()?vtrackMode.verifyVtrackMode():(trackMode(),vtrackMode.notifyUser())}function initVtrack(){vtrackcollect.init(),"success"===sd.bridge.bridge_info.verify_success&&vapph5collect.init()}var methods=["setItem","deleteItem","getAppStatus","track","quick","register","registerCommonProperties","registerOnce","trackSignup","userSet","userSetOnce","userAppend","userAdd","deleteProfile","unsetProfile","setDeviceUId","getDeviceUId","setUserUId","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"];function checkState(){each(methods,function(e){var t=sd[e];sd[e]=function(){if(sd.readyState.state<3)return isArray(sd._q)||(sd._q=[]),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);try{console.error("请先初始化海纳JS SDK")}catch(e){sd.log(e)}}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,i){},register:function(e){},registerCommonProperties:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,i){},userSet:function(e,t){},userSetOnce:function(e,t){},userAppend:function(e,t){},userAdd:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},setDeviceUId:function(e,t){},getDeviceUId:function(){},setUserUId:function(e,t){},logout:function(e){},trackLink:function(e,t,r){},deleteItem:function(e,t){},setItem:function(e,t,r){},getAppStatus:function(e){},clearPageRegister:function(e){}};function CancellationToken(e,t){this.cancel=function(){e=!0},this.getCanceled=function(){return e||!1},this.stop=function(){t=!0},this.getStopped=function(){return t||!1}}function InterceptorContext(e,t,r){var i=null;try{i=JSON.parse(JSON.stringify(e||null))}catch(e){}this.getOriginalData=function(){return i},this.getPosition=function(){return t},this.cancellationToken=new CancellationToken,this.sensors=r}function Stage(e){if(!isObject(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}Stage.prototype.process=function(e,t){if(e&&e in this.processDef){var r=this.registeredInterceptors[e];if(r&&isArray(r)&&0<r.length)for(var i={current:0,total:r.length},n=new InterceptorContext(t,i,sd),a=0;a<r.length;a++)try{if(i.current=a+1,t=r[a].call(null,t,n)||t,n.cancellationToken.getCanceled())break;if(n.cancellationToken.getStopped())return}catch(e){sdLog("interceptor error:"+e)}return t=this.processDef[e]&&this.processDef[e]in this.processDef?this.process(this.processDef[e],t):t}sdLog("process ["+e+"] is not supported")},Stage.prototype.registerStageImplementation=function(e){e&&e.init&&isFunction(e.init)&&(e.init(this),e.interceptor)&&this.registerInterceptor(e.interceptor)},Stage.prototype.registerInterceptor=function(e){if(e)for(var t in e){var r=e[t];r&&isObject(r)&&isFunction(r.entry)&&(isNumber(r.priority)||(r.priority=Number.MAX_VALUE),this.registeredInterceptors[t]||(this.registeredInterceptors[t]=[]),t=this.registeredInterceptors[t],r.entry.priority=r.priority,t.push(r.entry),t.sort(function(e,t){return e.priority-t.priority}))}};var processDef={basicProps:"extendProps",extendProps:"formatData",formatData:"finalAdjustData",finalAdjustData:null},buildDataStage=new Stage(processDef),processDef$1={send:null},sendDataStage=new Stage(processDef$1),processDef$2={getUtmData:null,callSchema:null},businessStage=new Stage(processDef$2),processDef$3={webClickEvent:null,webStayEvent:null},viewStage=new Stage(processDef$3);function registerFeature(e){e&&e.buildDataStage&&buildDataStage.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&businessStage.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&sendDataStage.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&viewStage.registerStageImplementation(e.viewStage)}var interceptorRegisters={buildDataStage:function(e){e&&buildDataStage.registerInterceptor(e)},businessStage:function(e){e&&businessStage.registerInterceptor(e)},sendDataStage:function(e){e&&sendDataStage.registerInterceptor(e)},viewStage:function(e){e&&viewStage.registerInterceptor(e)}};function registerInterceptor(e,t){interceptorRegisters[e]&&interceptorRegisters[e](t)}var businessStageImpl={stage:null,init:function(e){this.stage=e}};function processGetUtmData(){return businessStageImpl.stage&&businessStageImpl.stage.process("getUtmData")}var sendDataStageImpl={stage:null,init:function(e){this.stage=e},interceptor:{send:{entry:function(e){return e}}}};function processSend(e){return sendDataStageImpl.stage.process("send",e)}var kit={};function CoreFeature(e){e.kit=kit,e.saEvent=saEvent,this.buildDataStage=buildDataStageImpl,this.sendDataStage=sendDataStageImpl,this.businessStage=businessStageImpl}function HeatCollectFeature(e){e.heatmap=heatmap,this.viewStage=viewStageImpl}kit.buildData=function(e){return processBasicProps(e)},kit.sendData=function(e,t){var r=searchConfigData(e.properties);processSend({serverUrl:sd.para.serverUrl,data:e,config:r||{},callback:t}),sd.log(e)},kit.encodeTrackData=function(e){return encodeTrackData(e)},kit.getUtmData=function(){return processGetUtmData()};var heatCollectInterceptor={webClickEvent:{entry:function(e,t){t=t.sensors;"a"===e.tagName&&t.para.heatmap&&!0===t.para.heatmap.isTrackLink?t.trackLink({event:e.event,target:e.target},"$WebClick",e.props):t.track("$WebClick",e.props,e.callback)}},webStayEvent:{entry:function(e,t){t.sensors.track("$WebStay",e)}}},preCfg=window.sensors_data_pre_config,is_compliance_enabled=!!_.isObject(preCfg)&&preCfg.is_compliance_enabled;function implementCore(e){e&&(sd.events=events,sd.bridge=bridge,sd.SDKJSBridge=SDKJSBridge,sd.JSBridge=DeprecatedJSBridge,sd.store=store,sd.unlimitedDiv=unlimitedDiv,sd.customProp=customProp,sd.vtrackcollect=vtrackcollect,sd.vapph5collect=vapph5collect,sd.detectMode=detectMode,sd.registerFeature=registerFeature,sd.registerInterceptor=registerInterceptor,sd.commonWays=commonWays,registerFeature(new CoreFeature(sd)),registerFeature(new HeatCollectFeature(sd)),registerInterceptor("viewStage",heatCollectInterceptor));var t,r=e?functions:saEmpty;for(t in r)sd[t]=r[t];sd._=_,sd.on=eventEmitterFacade,sd.ee=ee,sd.use=use,sd.lib_version=sdkversion_placeholder}sd.init=function(e){if(ee.sdk.emit("beforeInit"),sd.readyState&&sd.readyState.state&&2<=sd.readyState.state)return!1;is_compliance_enabled&&(implementCore(!0),checkState()),ee.initSystemEvent(),sd.setInitVar(),sd.readyState.setState(2),sd.initPara(e),ee.sdk.emit("initPara"),ee.sdk.emit("afterInitPara"),ee.sdk.emit("initAPI"),ee.sdk.emit("afterInitAPI"),sd.detectMode(),iOSWebClickPolyfill(),ee.sdk.emit("afterInit"),ee.sdk.emit("ready")},is_compliance_enabled?implementCore(!1):(implementCore(!0),checkState());var sdkversion_placeholder$1="3.1.1";function wrapPluginInitFn(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(t){var r=t._.isString,i=t._.rot13defs,n=t._.dfmapping,a="data:enc;",s="dfm-enc-";t.ee.sdk.on("afterInitPara",function(){t.kit.userEncrypt=function(e){return s+n(e)},t.kit.userDecrypt=function(e){return 0===e.indexOf(a)?(e=e.substring(a.length),e=i(e)):0===e.indexOf(s)&&(e=e.substring(s.length),e=n(e)),e},t.kit.userDecryptIfNeeded=function(e){return e=!r(e)||0!==e.indexOf(a)&&0!==e.indexOf(s)?e:t.kit.userDecrypt(e)}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="3.1.1";function wrapPluginInitFn$1(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$1(e,t,r){return wrapPluginInitFn$1(e,t,r),e.plugin_version=sdkversion_placeholder$2,e}var amp={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var e=this.sd._.cookie.get("sensors_amp_id"),t=this.sd.store._state.distinct_id;if(e&&0<e.length){var r="amp-"===e.slice(0,4);if(e!==t){if(!r)return!1;this.sd.store._state.first_id?(this.sd.setDeviceUId(e,!0),this.sd.saEvent.send({original_id:e,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(t)):this.sd.setDeviceUId(e,!0)}}else this.setAmpId(t);this.addListener()},addListener:function(){var t=this;this.sd.events.on("changeDistinctId",function(e){t.setAmpId(e)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},index$1=createPlugin$1(amp,"Amp","sdkReady"),vbridge=window.SensorsData_App_Visual_Bridge,vmode=vbridge&&vbridge.sensorsdata_visualized_mode,valert=vbridge&&vbridge.sensorsdata_visualized_alert_info,vhover=vbridge&&vbridge.sensorsdata_hover_web_nodes;function alertApp(e){return valert&&valert.call(vbridge,JSON.stringify(e))}function hoverNode(e){return vmode.call(vbridge)&&vhover&&vhover.call(vbridge,JSON.stringify(e))}function callBridge(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge,anTrack,anServerUrl,sd$1,_$1,log,vbridge$1={isVerify:function(){return vmode&&(!0===vmode||vmode.call(vbridge))},commands:{app_alert:alertApp,visualized_track:hoverNode,page_info:hoverNode,sensorsdata_get_app_visual_config:callBridge}},sdkversion_placeholder$3="3.1.1";function wrapPluginInitFn$2(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$2(e,t,r){return wrapPluginInitFn$2(e,t,r),e.plugin_version=sdkversion_placeholder$3,e}var AndroidBridge={init:function(e){_$1=(sd$1=e)&&sd$1._,log=sd$1&&sd$1.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){anBridge=window.SensorsData_APP_New_H5_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anServerUrl=anTrack&&anBridge.sensorsdata_get_server_url&&anBridge.sensorsdata_get_server_url(),sd$1&&!sd$1.bridge.activeBridge&&anServerUrl&&(sd$1.bridge.activeBridge=AndroidBridge,sd$1.para.app_js_bridge&&!sd$1.para.app_js_bridge.is_mui&&(sd$1.bridge.is_verify_success=anServerUrl&&sd$1.bridge.validateAppUrl(anServerUrl)),sd$1.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:sd$1.bridge.is_verify_success?"success":"fail",support_two_way_call:!!anBridge.sensorsdata_js_call_app},sd$1.para.app_js_bridge?(sd$1.registerInterceptor("sendDataStage",{send:{priority:60,entry:sendData}}),log("Android bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){var r;return sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type||(r=e.callback,sd$1.bridge.is_verify_success?(anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({serverUrl:sd$1.para.serverUrl},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel()):sd$1.para.app_js_bridge.is_send?sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}):(_$1.isFunction(r)&&r(),t.cancellationToken.cancel())),e}function handleCommand(e){var t=e.callType;if(t in vbridge$1.commands)return vbridge$1.commands[t](e,anBridge);anBridge&&_$1.isFunction(anBridge.sensorsdata_js_call_app)&&anBridge.sensorsdata_js_call_app(JSON.stringify(e))}var index$2=createPlugin$2(AndroidBridge,"AndroidBridge","sdkAfterInitPara"),vbridge$2=window.SensorsData_App_Visual_Bridge,vmode$1=vbridge$2&&vbridge$2.sensorsdata_visualized_mode,valert$1=vbridge$2&&vbridge$2.sensorsdata_visualized_alert_info,vhover$1=vbridge$2&&vbridge$2.sensorsdata_hover_web_nodes;function alertApp$1(e){return valert$1&&valert$1.call(vbridge$2,JSON.stringify(e))}function hoverNode$1(e){return vmode$1.call(vbridge$2)&&vhover$1&&vhover$1.call(vbridge$2,JSON.stringify(e))}function callBridge$1(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}var anBridge$1,anTrack$1,anVerify,anVisualVerify,sd$2,_$2,log$1,vbridge$1$1={isVerify:function(){return vmode$1&&(!0===vmode$1||vmode$1.call(vbridge$2))},commands:{app_alert:alertApp$1,visualized_track:hoverNode$1,page_info:hoverNode$1,sensorsdata_get_app_visual_config:callBridge$1}},sdkversion_placeholder$4="3.1.1";function wrapPluginInitFn$3(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$3(e,t,r){return wrapPluginInitFn$3(e,t,r),e.plugin_version=sdkversion_placeholder$4,e}var AndroidObsoleteBridge={init:function(e){_$2=(sd$2=e)&&sd$2._,log$1=sd$2&&sd$2.log||console&&console.log||function(){},initBridge$1()},handleCommand:handleCommand$1};function initBridge$1(){var e;anBridge$1=window.SensorsData_APP_JS_Bridge,anTrack$1=anBridge$1&&anBridge$1.sensorsdata_track,anVerify=anBridge$1&&anBridge$1.sensorsdata_verify,anVisualVerify=anBridge$1&&anBridge$1.sensorsdata_visual_verify,sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)&&(sd$2.bridge.activeBridge=AndroidObsoleteBridge,e=anVerify||anTrack$1,anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({serverUrl:sd$2.para.serverUrl}))),sd$2.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},sd$2.para.app_js_bridge?(sd$2.registerInterceptor("sendDataStage",{send:{priority:80,entry:sendData$1}}),log$1("Android obsolete bridge inits succeed.")):log$1("app_js_bridge is not configured, data will not be sent by android obsolete bridge."))}function sendData$1(e,t){var r;return sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type||(r=e.callback,anVerify?(!anVerify||!anVerify.call(anBridge$1,JSON.stringify(_$2.extend({serverUrl:sd$2.para.serverUrl},e.data))))&&sd$2.para.app_js_bridge.is_send?sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel()):(anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({serverUrl:sd$2.para.serverUrl},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel())),e}function handleCommand$1(e){var t=e.callType;return t in vbridge$1$1.commands?vbridge$1$1.commands[t](e,anBridge$1):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?anBridge$1.sensorsdata_js_call_app(JSON.stringify(e)):void 0}var _$3,sd$3,store$1,cookie_name,index$3=createPlugin$3(AndroidObsoleteBridge,"AndroidObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$5="3.1.1";function wrapPluginInitFn$4(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var Channel={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){if(sd$3||!e)return!1;cookie_name=(t=t||{}).cookie_name||"hinadatajssdkchannel";t=this;_$3=(sd$3=e)._,store$1=sd$3.store,_$3.localStorage.isSupport()&&(sd$3.para.max_string_length=1024,t.eventList.init(),t.addLatestChannelUrl(),t.addIsChannelCallbackEvent())},addIsChannelCallbackEvent:function(){sd$3.registerCommonProperties({$is_channel_callback_event:function(e){if(_$3.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!Channel.eventList.hasEvent(e.event)&&(Channel.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();"url解析失败"===e?this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url的domain解析失败"}):_$3.isReferralTraffic(document.referrer)?(e=_$3.getQueryParam(location.href,"sat_cf"),_$3.isString(e)&&0<e.length?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})):t?sd$3.registerCommonProperties(t):sd$3.registerCommonProperties({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"取值异常"})},registerAndSave:function(e){sd$3.registerCommonProperties(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name)),e=_$3.safeJSONParse(e);return!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){e=JSON.stringify({prop:e});sd$3.para.encrypt_cookie&&(e=sd$3.kit.userEncrypt(e)),_$3.cookie.set(cookie_name,e)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return e=""===e?"url解析失败":e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)&&0<(t=t-e.latest_event_initial_time)&&t<Channel.max_save_time?(Channel.event_list=e.eventList,Channel.latest_event_initial_time=e.latest_event_initial_time):this.reset()},get:function(){var e={};try{e=store$1.readObjectVal("sawebjssdkchannel")}catch(e){sd$3.log(e)}return e},add:function(e){Channel.event_list.push(e),this.save()},save:function(){var e={latest_event_initial_time:Channel.latest_event_initial_time,eventList:Channel.event_list};store$1.saveObjectVal("sawebjssdkchannel",e)},reset:function(){Channel.event_list=[],Channel.latest_event_initial_time=(new Date).getTime(),this.save()},hasEvent:function(t){var r=!1;return _$3.each(Channel.event_list,function(e){e===t&&(r=!0)}),r}}},index$4=createPlugin$4(Channel,"SensorsChannel","sdkAfterInitAPI"),sdkversion_placeholder$6="3.1.1";function wrapPluginInitFn$5(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$5(e,t,r){return wrapPluginInitFn$5(e,t,r),e.plugin_version=sdkversion_placeholder$6,e}var isWechat=/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),getSupportedProperty=function(){var e={};return void 0!==document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):void 0!==document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):void 0!==document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}var iosServerUrl,iosTracker,sd$4,_$4,log$2,hidden=getSupportedProperty().hidden,OSs={android:/Android/i,iOS:/iPhone|iPad|iPod/i},getOS=function(){for(var e in OSs)if(navigator.userAgent.match(OSs[e]))return e;return""},currentOS=getOS(),isSupportedOS=function(){return OSs.hasOwnProperty(currentOS)},isObject$1=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},parseShortURL=function(e){return e.match(/\/sd\/(\w+)\/(\w+)$/)},parseAPIURL=function(e){e=e._.URL(e.para.serverUrl);return{origin:e.origin,project:e.searchParams.get("project")||"default"}},handleAndroidLinks=function(t,e,r){t.log("尝试唤起 android app");t.log("唤起APP的地址:"+e),window.location=e,t.timer=setTimeout(function(){var e=isPageHidden();if(t.log("hide:"+hidden+":"+document[hidden]),e)return t.log("The page is hidden, stop navigating to download page"),!1;t.log("App可能未安装,跳转到下载地址"),window.location=r},t.timeout)},handleIOSLinks=function(e,t,r){e.log("尝试唤起 iOS app:"+t),window.location.href=t,e.timer=setTimeout(function(){if(isPageHidden())return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App可能未安装,跳转到下载地址"),window.location.href=r},e.timeout),e.log("new timer:"+e.timer)},SADeepLink={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(e){var t;return this.sd?(this.log("deeplink已经初始化"),!1):(this.sd=e,this.log("deeplink init called"),null===this.sd?(this.log("海纳JS SDK未成功引入"),!1):(t={},0<arguments.length&&(1===arguments.length&&isObject$1(e)?t=e:2<=arguments.length&&isObject$1(arguments[1])&&(t=arguments[1])),isSupportedOS()?(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&2500<=t.timeout&&(this.timeout=t.timeout),this.sd.para.serverUrl?(t=parseAPIURL(this.sd),this.apiURL=this.apiURL.replace("{origin}",t.origin).replace("{project}",t.project),(t=this.sd._.getQueryParam(window.location.href,"deeplink"))?(t=window.decodeURIComponent(t),(t=parseShortURL(t))?(this.key=t[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(t[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API报错:"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API查询成功,数据:"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://hinadata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info)&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://hinadata/sd/"+this.data.app_key+"/"+this.key)}.bind(this),error:function(){SADeepLink.log("API查询出错")}}),void this.addListeners()):(this.log("当前页面的deeplink参数无效"),!1)):(this.log("当前页面缺少deeplink参数"),!1)):(this.log("海纳JS SDK配置项server_url未正确配置"),!1)):(this.log("不支持当前系统,目前只支持Android和iOS"),!1)))},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("没有Deep link数据!"),!1;var e;"iOS"===currentOS?(this.log("当前系统是iOS"),e=this.sd&&this.sd._&&9<=this.sd._.getIOSVersion()&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes,this.log("唤起APP的地址:"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)):(this.log("当前系统是 android"),handleAndroidLinks(this,this.data.android_info.url_schemes,this.data.android_info.download_url))},log:function(e){this.sd&&this.sd.log(e)},addListeners:function(){var e=getSupportedProperty().visibilityChange;e&&document.addEventListener(e,function(){clearTimeout(this.timer),this.log("visibilitychange, clear timeout:"+this.timer)}.bind(this),!1),window.addEventListener("pagehide",function(){this.log("page hide, clear timeout:"+this.timer),clearTimeout(this.timer)}.bind(this),!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="3.1.1";function wrapPluginInitFn$6(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$6(e,t,r){return wrapPluginInitFn$6(e,t,r),e.plugin_version=sdkversion_placeholder$7,e}var IOSBridge={init:function(e){_$4=(sd$4=e)&&sd$4._,log$2=sd$4&&sd$4.log||console&&console.log||function(){},initBridge$2()},handleCommand:handleCommand$2};function initBridge$2(){iosServerUrl=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,iosTracker=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},sd$4&&!sd$4.bridge.activeBridge&&iosTracker()&&iosTracker().postMessage&&(sd$4.bridge.activeBridge=IOSBridge,sd$4.para.app_js_bridge&&!sd$4.para.app_js_bridge.is_mui&&(sd$4.bridge.is_verify_success=iosServerUrl&&sd$4.bridge.validateAppUrl(iosServerUrl)),sd$4.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:sd$4.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},sd$4.para.app_js_bridge?(sd$4.registerInterceptor("sendDataStage",{send:{priority:70,entry:sendData$2}}),log$2("IOS bridge inits succeed.")):log$2("app_js_bridge is not configured, data will not be sent by iOS bridge."))}function sendData$2(e,t){var r;return sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type||(r=e.callback,sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({serverUrl:sd$4.para.serverUrl},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel()):sd$4.para.app_js_bridge.is_send?sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}):(_$4.isFunction(r)&&r(),t.cancellationToken.cancel())),e}function handleCommand$2(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||sd$4.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?_$4.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:iosTracker()&&iosTracker().postMessage(JSON.stringify(e)):null}var sd$5,_$5,log$3,index$6=createPlugin$6(IOSBridge,"IOSBridge","sdkAfterInitPara"),sdkversion_placeholder$8="3.1.1";function wrapPluginInitFn$7(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$7(e,t,r){return wrapPluginInitFn$7(e,t,r),e.plugin_version=sdkversion_placeholder$8,e}var IOSObsoleteBridge={init:function(e){_$5=(sd$5=e)&&sd$5._,log$3=sd$5&&sd$5.log||console&&console.log||function(){},initBridge$3()}};function initBridge$3(){sd$5&&!sd$5.bridge.activeBridge&&hasBridge()&&(sd$5.bridge.activeBridge=IOSObsoleteBridge,sd$5.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:verifyIOSObsoleteBridge()?"success":"fail"},sd$5.para.app_js_bridge?(sd$5.registerInterceptor("sendDataStage",{send:{priority:90,entry:sendData$3}}),log$3("IOS obsolete bridge inits succeed.")):log$3("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge."))}function hasBridge(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function verifyIOSObsoleteBridge(){if(/sensors-verify/.test(navigator.userAgent)){if((e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/))&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){var e=e[1].split("?"),t=null,r=null;try{t=_$5.URL(sd$5.para.serverUrl).hostname,r=_$5.URL(sd$5.para.serverUrl).searchParams.get("project")||"default"}catch(e){sd$5.log(e)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function sendData$3(e,t){if(!sd$5.para.app_js_bridge.is_mui&&"item_set"!==e.data.type&&"item_delete"!==e.data.type){var r,i,n=e.callback;if(sd$5.bridge.bridge_info.verify_success)return r=document.createElement("iframe"),i=e.data,i=(i=JSON.stringify(_$5.extend({serverUrl:sd$5.para.serverUrl},i))).replace(/\r\n/g,""),i="sensorsanalytics://trackEvent?event="+(i=encodeURIComponent(i)),r.setAttribute("src",i),document.documentElement.appendChild(r),r.parentNode.removeChild(r),r=null,_$5.isFunction(n)&&n(),t.cancellationToken.cancel(),!0;sd$5.para.app_js_bridge.is_send?sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}):(_$5.isFunction(n)&&n(),t.cancellationToken.cancel())}return e}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="3.1.1";function wrapPluginInitFn$8(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$8(e,t,r){return wrapPluginInitFn$8(e,t,r),e.plugin_version=sdkversion_placeholder$9,e}var page_hidden_status_refresh_time=5e3,MAX_DURATION=432e3;function PageLeave(){this.sd=null,this.start_time=+new Date,this.page_show_status=!0,this.page_hidden_status=!1,this._={},this.timer=null,this.current_page_url=document.referrer,this.url=location.href,this.title=document.title||"",this.option={},this.heartbeat_interval_time=5e3,this.heartbeat_interval_timer=null,this.page_id=null,this.storage_name="sawebjssdkpageleave",this.max_duration=MAX_DURATION}PageLeave.prototype.init=function(e,t){e?(this.sd=e,this._=this.sd._,t&&((e=(this.option=t).heartbeat_interval_time)&&(this._.isNumber(e)||this._.isNumber(+e))&&0<+e&&(this.heartbeat_interval_time=1e3*e),e=t.max_duration)&&(this._.isNumber(e)||this._.isNumber(+e))&&0<+e&&(this.max_duration=e),this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),!0===document.hidden?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave初始化完毕")):this.log("海纳JS SDK未成功引入")},PageLeave.prototype.log=function(e){this.sd&&this.sd.log(e)},PageLeave.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},page_hidden_status_refresh_time)},PageLeave.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},PageLeave.prototype.pageStartHandler=function(){this.start_time=+new Date,!0==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},PageLeave.prototype.pageEndHandler=function(){var e;!0!==this.page_hidden_status&&(e=this.getPageLeaveProperties(),!1===this.page_show_status&&delete e.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",e),this.refreshPageEndTimer(),this.delHeartBeatData())},PageLeave.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},PageLeave.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},PageLeave.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||"string"!=typeof e||""===e||this.option.isCollectUrl(e)},PageLeave.prototype.addSinglePageListener=function(){var t=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(e){e!==location.href&&(t.url=e,t.pageEndHandler(),t.stopHeartBeatInterval(),t.current_page_url=t.url,t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var t=this;this._.each(["pagehide","beforeunload","unload"],function(e){"on"+e in window&&t._.addEvent(window,e,function(){t.pageEndHandler(),t.stopHeartBeatInterval()})})},PageLeave.prototype.addPageSwitchListener=function(){var e=this;this._.listenPageState({visible:function(){e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval()},hidden:function(){e.url=location.href,e.title=document.title,e.pageEndHandler(),e.stopHeartBeatInterval()}})},PageLeave.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},PageLeave.prototype.startHeartBeatInterval=function(){var e=this,t=(this.heartbeat_interval_timer&&this.stopHeartBeatInterval(),!0);this.isCollectUrl(this.url)||(t=!1),this.heartbeat_interval_timer=setInterval(function(){t&&e.saveHeartBeatData()},this.heartbeat_interval_time),t&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},PageLeave.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},PageLeave.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date,e=(t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14),this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t}));try{"success"===this.sd.bridge.bridge_info.verify_success&&(e.properties.$time=+r)}catch(e){this.log(e.message)}e.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,e)},PageLeave.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},PageLeave.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length-1;0<=e;e--){var t,r=window.localStorage.key(e);r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")&&(t=this.sd.store.readObjectVal(r),this._.isObject(t))&&+new Date-t.time>t.heartbeat_interval_time+5e3&&(delete t.heartbeat_interval_time,this.sd.kit.sendData(t),this.delHeartBeatData(r))}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3,t=((isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3)),this._.getReferrer(this.current_page_url)),r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0,r=Math.round(r)||0,t={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:t?this._.getHostname(t):"",$referrer:t,$viewport_position:r};return 0!==e&&(t.event_duration=e),t=this._.extend(t,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="3.1.1";function wrapPluginInitFn$9(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$9(e,t,r){return wrapPluginInitFn$9(e,t,r),e.plugin_version=sdkversion_placeholder$a,e}var eventSent=!1,PageLoad={init:function(d,c){function l(){var e=0,t=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,r={$url:d._.getURL(),$title:document.title,$url_path:d._.getURLPath(),$referrer:d._.getReferrer(null,!0)};if(t){n=t,i=0;var e=(i=d._.isFunction(n.getEntriesByType)?((n.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0:i)||(n=0,(i=t).timing&&(0!==(i=i.timing).fetchStart&&d._.isNumber(i.fetchStart)&&0!==i.domContentLoadedEventEnd&&d._.isNumber(i.domContentLoadedEventEnd)?n=i.domContentLoadedEventEnd-i.fetchStart:d.log("performance 数据获取异常")),n),i=t,n=r;if(i.getEntries&&"function"==typeof i.getEntries){for(var a=i.getEntries(),s=null,o=0;o<a.length;o++)"transferSize"in a[o]&&(s+=a[o].transferSize);d._.isNumber(s)&&0<=s&&s<10737418240&&(n.$page_resource_size=Number((s/1024).toFixed(3)))}}else d.log("浏览器未支持 performance API.");0<e&&(t=d._.isObject(c)&&c.max_duration||1800,e=Number((e/1e3).toFixed(3)),!d._.isNumber(t)||t<=0||e<=t)&&(r.event_duration=e),eventSent||(d.track("$WebPageLoad",r),eventSent=!0),window.removeEventListener?window.removeEventListener("load",l):window.detachEvent&&window.detachEvent("onload",l)}"complete"==document.readyState?l():window.addEventListener?window.addEventListener("load",l):window.attachEvent&&window.attachEvent("onload",l)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){var r,i,n,a,s,o,d;return"track"===e.type&&(a=t.sd,r=a._,i=a.saEvent.check,n=r.extend2Lev({properties:{}},e),a=t.customRegister,s=n.properties,o=n.event,d={},r.each(a,function(e){r.isObject(e)?-1<r.indexOf(e.events,o)&&i({properties:e.properties})&&(d=r.extend(d,e.properties)):r.isFunction(e)&&(e=e({event:o,properties:s,data:n}),r.isObject(e))&&!r.isEmptyObject(e)&&i({properties:e})&&(d=r.extend(d,e))}),e.properties=r.extend(s,d)),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){var t;e?(this.sd=e,this._=e._,this.log=e.log,t=this,e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})):this.log("海纳JS SDK未成功引入")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&0<e.events.length&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register 参数错误"):this.log("海纳JS SDK未成功引入")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister 参数错误"):this.log("海纳JS SDK未成功引入")};var sdkversion_placeholder$b="3.1.1";function wrapPluginInitFn$a(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$a(e,t,r){return wrapPluginInitFn$a(e,t,r),e.plugin_version=sdkversion_placeholder$b,e}RegisterProperties.prototype.plugin_name="RegisterProperties";var instance=new RegisterProperties,index$a=createPlugin$a(instance),sdkversion_placeholder$c="3.1.1";function wrapPluginInitFn$b(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$b(e,t,r){return wrapPluginInitFn$b(e,t,r),e.plugin_version=sdkversion_placeholder$c,e}var _sd,_oldBuildData,_log=window.console&&window.console.log||function(){};function buildData(e){try{var t,r,i;"$pageview"===e.event||e.type&&"profile"===e.type.slice(0,7)||(t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,i={$page_height:Math.max(t,r)||0},e.properties=_sd._.extend(e.properties||{},i))}catch(e){_log("页面高度获取异常。")}return _oldBuildData.call(_sd.kit,e)}var RegisterPropertyPageHeight={init:function(e){_log=(_sd=e)&&_sd.log||_log,e&&e.kit&&e.kit.buildData?(_oldBuildData=_sd.kit.buildData,_sd.kit.buildData=buildData,_log("RegisterPropertyPageHeight 插件初始化完成")):_log("RegisterPropertyPageHeight 插件初始化失败,当前主sdk不支持 RegisterPropertyPageHeight 插件,请升级主sdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="3.1.1";function wrapPluginInitFn$c(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$c(e,t,r){return wrapPluginInitFn$c(e,t,r),e.plugin_version=sdkversion_placeholder$d,e}var sd$6,siteLinker={getPart:function(e){var t=this.option.length;if(t)for(var r=0;r<t;r++)if(-1<e.indexOf(this.option[r].part_url))return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r<t;r++)if(-1<e.indexOf(this.option[r].part_url))return this.option[r].after_hash;return!1},getCurrenId:function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):""),encodeURIComponent(t?"f"+e:"d"+e)},rewriteUrl:function(e,t){var r,i,n,a,s,o=this,d=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),c="";if(d)return r=d[1]||"",i=d[2]||"",d=d[3]||"",n="_sasdk="+this.getCurrenId(),a=function(e){var e=e.split("&"),t=[];return o._.each(e,function(e){-1<e.indexOf("_sasdk=")?t.push(n):t.push(e)}),t.join("&")},c=this.getPartHash(e)?(s=d.indexOf("_sasdk"),-1<d.indexOf("?")?-1<s?r+i+"#"+d.substring(1,s)+a(d.substring(s,d.length)):r+i+d+"&"+n:r+i+"#"+d.substring(1)+"?"+n):(s=i.indexOf("_sasdk"),/^\?(\w)+/.test(i)?-1<s?r+"?"+a(i.substring(1))+d:r+i+"&"+n+d:r+"?"+n+d),t&&(t.href=c),c},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);return this._.isArray(e)&&e[1]?(!(e=decodeURIComponent(e[1]))||"f"!==e.substring(0,1)&&"d"!==e.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(e)?e=e.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(e.substring(1))):this._.rot13defs&&(e=e.substring(0,1)+this._.rot13defs(e.substring(1)))),e):""},setRefferId:function(e){var t,r=this.store.getDistinctId(),i=this.getUrlId();i&&""!==i&&(t="a"===i.substring(0,1)||"d"===i.substring(0,1),(i=i.substring(1))!==r)&&(t?(this.sd.setDeviceUId(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.setUserUId(i))}},index$c=(siteLinker.addListen=function(){function e(e){var t,r=(e=e.target).tagName.toLowerCase(),i=e.parentNode;("a"===r&&e.href||i&&i.tagName&&"a"===i.tagName.toLowerCase()&&i.href)&&(r="a"===r&&e.href?(t=e.href,e):(t=i.href,i),"http:"!==(e=n._.URL(t).protocol)&&"https:"!==e||n.getPart(t)&&n.rewriteUrl(t,r))}var n=this;n._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&0<=window.navigator.maxTouchPoints&&n._.addEvent(document,"pointerdown",e)},siteLinker.init=function(n,e){this.sd=n,this._=n._,this.store=n.store,this.para=n.para,this._.isObject(e)&&this._.isArray(e.linker)&&0<e.linker.length?(this.setRefferId(e),this.addListen(),this.option=e.linker,this.option=function(e){for(var t=e.length,r=[],i=0;i<t;i++)/[A-Za-z0-9]+\./.test(e[i].part_url)&&"[object Boolean]"==Object.prototype.toString.call(e[i].after_hash)?r.push(e[i]):n.log("linker 配置的第 "+(i+1)+" 项格式不正确,请检查参数格式!");return r}(this.option)):n.log("请配置打通域名参数!")},createPlugin$c(siteLinker,"SiteLinker","sdkReady")),source_channel_standard$1="utm_source utm_medium utm_campaign utm_content utm_term",sdkversion_placeholder$e="3.1.1";function wrapPluginInitFn$d(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$d(e,t,r){return wrapPluginInitFn$d(e,t,r),e.plugin_version=sdkversion_placeholder$e,e}var utm={init:function(e){e&&!sd$6&&(sd$6=e).registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){var e=source_channel_standard$1.split(" "),t="",r={};return sd$6._.isArray(sd$6.para.source_channel)&&0<sd$6.para.source_channel.length&&(e=e.concat(sd$6.para.source_channel),e=sd$6._.unique(e)),sd$6._.each(e,function(e){(t=sd$6._.getQueryParam(location.href,e)).length&&(r[e]=t)}),r}}})}},index$d=createPlugin$d(utm,"Utm","sdkAfterInitPara"),sdkversion_placeholder$f="3.1.1";function wrapPluginInitFn$e(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$e(e,t,r){return wrapPluginInitFn$e(e,t,r),e.plugin_version=sdkversion_placeholder$f,e}var isDisabled=!1,sd$7=null,disableSDKPlugin={init:function(e){(sd$7=e).disableSDK=disableSDK,sd$7.enableSDK=enableSDK,sd$7.getDisabled=getDisabled}};function disableSDK(){isDisabled=!0}function enableSDK(){isDisabled=!1}function getDisabled(){return isDisabled}var sd$8,_$6,index$e=createPlugin$e(disableSDKPlugin,"DisableSDK","sdkInitAPI"),sdkversion_placeholder$g="3.1.1";function wrapPluginInitFn$f(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$f(e,t,r){return wrapPluginInitFn$f(e,t,r),e.plugin_version=sdkversion_placeholder$g,e}function debugPath(e){var t=e,r="",r=-1!==sd$8.para.debug_mode_url.indexOf("?")?sd$8.para.debug_mode_url+"&"+sd$8.kit.encodeTrackData(e):sd$8.para.debug_mode_url+"?"+sd$8.kit.encodeTrackData(e);_$6.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(sd$8.para.debug_mode_upload)},success:function(e){!0===_$6.isEmptyObject(e)?alert("debug数据发送成功"+t):alert("debug失败 错误原因"+JSON.stringify(e))}})}function sendData$4(e,t){var r;return!0===sd$8.para.debug_mode&&(r=e.data,e.callback,debugPath(JSON.stringify(r)),t.cancellationToken.stop()),e}function initPara$1(){!0===sd$8.para.debug_mode&&(sd$8.para.debug_mode_upload=sd$8.para.debug_mode_upload||!1,_$6.isString(sd$8.para.debug_mode_url)||(_$6.isString(sd$8.para.serverUrl)?sd$8.para.debug_mode_url=sd$8.para.serverUrl.replace("sa.gif","debug"):_$6.isArray(sd$8.para.serverUrl)&&_$6.isString(sd$8.para.serverUrl[0])?sd$8.para.debug_mode_url=sd$8.para.serverUrl[0].replace("sa.gif","debug"):sd$8.para.debug_mode=!1))}function senderInit(){sd$8.on("sdkInitPara",function(){initPara$1()}),sd$8.on("sdkAfterInitPara",function(){sd$8.registerInterceptor("sendDataStage",{send:{priority:30,entry:sendData$4}})})}var sd$9,_$7,DebugSender={plugin_name:"DebugSender",init:function(e){_$6=(sd$8=e)._,senderInit()}},index$f=createPlugin$f(DebugSender),sdkversion_placeholder$h="3.1.1";function wrapPluginInitFn$g(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){var r;return _$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData&&(delete(r=e).callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()),e}function senderInit$1(){sd$9.on("sdkAfterInitAPI",function(){_$7.isObject(sd$9.commonWays)&&(sd$9.commonWays.setOnlineState=setOnlineState),sd$9.registerInterceptor("sendDataStage",{send:{priority:40,entry:sendData$5}})})}function setOnlineState(e){!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData?(sd$9.para.jsapp.isOnline=!0,e=sd$9.para.jsapp.getData(),_$7.isArray(e)&&0<e.length&&_$7.each(e,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})):sd$9.para.jsapp.isOnline=!1}var sd$a,_$8,JsappSender={plugin_name:"JsappSender",init:function(e){_$7=(sd$9=e)._,senderInit$1()}},index$g=createPlugin$g(JsappSender),sdkversion_placeholder$i="3.1.1";function wrapPluginInitFn$h(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$h(e,t,r){return wrapPluginInitFn$h(e,t,r),e.plugin_version=sdkversion_placeholder$i,e}var batchInstance=null;function sendData$6(e,t){return!sd$a.para.app_js_bridge&&sd$a.para.batch_send&&_$8.localStorage.isSupport()&&localStorage.length<sd$a.para.batch_send.storage_length&&(batchInstance.add(e.data),t.cancellationToken.stop()),e}function initPara$2(){var e={datasend_timeout:6e3,send_interval:6e3,storage_length:200};_$8.localStorage.isSupport()&&_$8.isSupportCors()&&"object"===("undefined"==typeof localStorage?"undefined":_typeof(localStorage))?!0===sd$a.para.batch_send?sd$a.para.batch_send=_$8.extend({},e):"object"===_typeof(sd$a.para.batch_send)&&(sd$a.para.batch_send=_$8.extend({},e,sd$a.para.batch_send)):sd$a.para.batch_send=!1}function senderInit$2(){sd$a.on("sdkInitPara",function(){initPara$2()}),sd$a.on("sdkAfterInitPara",function(){!sd$a.para.app_js_bridge&&sd$a.para.batch_send&&_$8.localStorage.isSupport()&&((batchInstance=batchInstance||new _$8.BatchSend).batchInterval(),sd$a.registerInterceptor("sendDataStage",{send:{priority:100,entry:sendData$6}}))})}var sd$b,_$9,BatchSender={plugin_name:"BatchSender",init:function(e){_$8=(sd$a=e)._,senderInit$2()}},index$h=createPlugin$h(BatchSender),sdkversion_placeholder$j="3.1.1";function wrapPluginInitFn$i(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$i(e,t,r){return wrapPluginInitFn$i(e,t,r),e.plugin_version=sdkversion_placeholder$j,e}function sendData$7(e){new _$9.BeaconSend(e).start()}function sendInterceptor(t,e){var r;return"beacon"===sd$b.para.sendType&&(r=t.serverUrl,t.data=sd$b.kit.encodeTrackData(t.data),_$9.isArray(r)&&r.length?_$9.each(r,function(e){t.callback=null,t.serverUrl=e,sendData$7(t)}):"string"==typeof sd$b.para.serverUrl&&""!==sd$b.para.serverUrl?sendData$7(t):sd$b.log("当前 serverUrl 为空或不正确,只在控制台打印日志,network 中不会发数据,请配置正确的 server_url!"),e.cancellationToken.stop()),t}function initPara$3(){"beacon"!==sd$b.para.sendType||_$9.isSupportBeaconSend()||(sd$b.para.sendType="image")}function senderInit$3(){sd$b.on("sdkInitPara",function(){initPara$3()}),sd$b.on("sdkAfterInitPara",function(){sd$b.registerInterceptor("sendDataStage",{send:{priority:110,entry:sendInterceptor}})})}var sd$c,_$a,BeaconSender={plugin_name:"BeaconSender",init:function(e){_$9=(sd$b=e)._,senderInit$3()}},index$i=createPlugin$i(BeaconSender),sdkversion_placeholder$k="3.1.1";function wrapPluginInitFn$j(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$j(e,t,r){return wrapPluginInitFn$j(e,t,r),e.plugin_version=sdkversion_placeholder$k,e}function sendData$8(e){new _$a.AjaxSend(e).start()}function sendInterceptor$1(t,e){var r;return"ajax"===sd$c.para.sendType&&(r=t.serverUrl,t.data=sd$c.kit.encodeTrackData(t.data),_$a.isArray(r)&&r.length?_$a.each(r,function(e){t.callback=null,t.serverUrl=e,sendData$8(t)}):"string"==typeof sd$c.para.serverUrl&&""!==sd$c.para.serverUrl?sendData$8(t):sd$c.log("当前 serverUrl 为空或不正确,只在控制台打印日志,network 中不会发数据,请配置正确的 server_url!"),e.cancellationToken.stop()),t}function initPara$4(){"ajax"!==sd$c.para.sendType||_$a.isSupportCors()||(sd$c.para.sendType="image")}function senderInit$4(){sd$c.on("sdkInitPara",function(){initPara$4()}),sd$c.on("sdkAfterInitPara",function(){sd$c.registerInterceptor("sendDataStage",{send:{priority:120,entry:sendInterceptor$1}})})}var sd$d,_$b,AjaxSender={plugin_name:"AjaxSender",init:function(e){_$a=(sd$c=e)._,senderInit$4()}},index$j=createPlugin$j(AjaxSender),sdkversion_placeholder$l="3.1.1";function wrapPluginInitFn$k(i,e,n){var a;return e&&(i.plugin_name=e),n&&i.init&&(a=i.init,i.init=function(e,t){if(e.readyState&&3<=e.readyState.state||!e.on)return r();function r(){a.call(i,e,t)}e.on(n,r)}),i}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){t=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+t:e+"?"+t}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(t,e){var r=t.serverUrl;t.data=getSendUrl(r,t.data),_$b.isArray(r)&&r.length?_$b.each(r,function(e){t.callback=null,t.serverUrl=e,sendData$9(t)}):"string"==typeof sd$d.para.serverUrl&&""!==sd$d.para.serverUrl?sendData$9(t):sd$d.log("当前 serverUrl 为空或不正确,只在控制台打印日志,network 中不会发数据,请配置正确的 server_url!"),e.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.sendType&&"ajax"!==sd$d.para.sendType&&"beacon"!==sd$d.para.sendType&&(sd$d.para.sendType="image")}function senderInit$5(){sd$d.on("sdkInitPara",function(){initPara$5()}),sd$d.on("sdkAfterInitPara",function(){sd$d.registerInterceptor("sendDataStage",{send:{priority:130,entry:sendInterceptor$2}})})}for(var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender),builtinPlugins=(sd.modules=sd.modules||{},[index$1,index$2,index$3,index$4,index$5,index$6,index$7,index$8,index$9,index$a,index$b,index$c,index$d,index$e,index$f,index$g,index$h,index$i,index$j,index$k]),autoUsePlugins=[index,index$d,index$e,index$g,index$f,index$2,index$6,index$3,index$7,index$h,index$i,index$j,index$k],i=0;i<builtinPlugins.length;i++){var p=builtinPlugins[i];sd._.isString(p.plugin_name)?sd.modules[p.plugin_name]=p:sd._.isArray(p.plugin_name)&&sd._.each(p.plugin_name,function(e){sd.modules[e]=p})}for(i=0;i<autoUsePlugins.length;i++)sd.use(autoUsePlugins[i]);var _sd$1=sd;try{"string"==typeof window.hinaDataStatistic?(sd.para=window[hinaDataStatistic].para,sd._q=window[hinaDataStatistic]._q,window[hinaDataStatistic]=sd,(window.hinaDataStatistic=sd).init()):void 0===window.hinaDataStatistic?window.hinaDataStatistic=sd:_sd$1=window.hinaDataStatistic}catch(e){if("object"===("undefined"==typeof console?"undefined":_typeof(console))&&console.log)try{console.log(e)}catch(e){sd.log(e)}}var sd$e=_sd$1;export default _sd$1;
|