UNPKG

sa-sdk-javascript

Version:
1 lines 178 kB
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():t()}(0,function(){var e,t={};function r(e){if(!e)return!1;var t=Object.prototype.toString.call(e);return"[object Function]"==t||"[object AsyncFunction]"==t}function n(){return Date.now&&r(Date.now)?Date.now():(new Date).getTime()}t.DEFAULT_SEND_TYPE="image",function(){var e={"function":!0,object:!0},t=e[typeof window]&&window||this,r=t.JSON,n=t.JSON3,i=!1,a=function s(r,n){r||(r=t.Object()),n||(n=t.Object());var i=r.Number||t.Number,a=r.String||t.String,o=r.Object||t.Object,l=r.Date||t.Date,u=r.SyntaxError||t.SyntaxError,c=r.TypeError||t.TypeError,p=r.Math||t.Math,d=r.JSON||t.JSON;if("object"==typeof d&&d)return n.stringify=d.stringify,n.parse=d.parse,n.runInContext=s,n;var f,g=o.prototype,_=g.toString,h=g.hasOwnProperty;function m(e,t){try{e()}catch(r){t&&t()}}var v=new l(-0xc782b5b800cec);function y(e){if(null!=y[e])return y[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=y("json-stringify")&&y("date-serialization")&&y("json-parse");else if("date-serialization"==e){if(t=y("json-stringify")&&v){var r=n.stringify;m(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new l(-864e13))&&'"+275760-09-13T00:00:00.000Z"'==r(new l(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new l(-621987552e5))&&'"1969-12-31T23:59:59.999Z"'==r(new l(-1))})}}else{var s,o='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var u="function"==typeof(r=n.stringify);u&&((s=function(){return 1}).toJSON=s,m(function(){u="0"===r(0)&&"0"===r(new i)&&'""'==r(new a)&&r(_)===f&&r(f)===f&&r()===f&&"1"===r(s)&&"[1]"==r([s])&&"[null]"==r([f])&&"null"==r(null)&&"[null,null,null]"==r([f,_,null])&&r({a:[s,!0,!1,null,"\0\b\n\f\r\t"]})==o&&"1"===r(null,s)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){u=!1})),t=u}if("json-parse"==e){var c,p=n.parse;"function"==typeof p&&m(function(){0!==p("0")||p(!1)||(s=p(o),(c=5==s.a.length&&1===s.a[0])&&(m(function(){c=!p('"\t"')}),c&&m(function(){c=1!==p("01")}),c&&m(function(){c=1!==p("1.")})))},function(){c=!1}),t=c}}return y[e]=!!t}if(m(function(){v=-109252==v.getUTCFullYear()&&0===v.getUTCMonth()&&1===v.getUTCDate()&&10==v.getUTCHours()&&37==v.getUTCMinutes()&&6==v.getUTCSeconds()&&708==v.getUTCMilliseconds()}),y["bug-string-char-index"]=y["date-serialization"]=y.json=y["json-stringify"]=y["json-parse"]=null,!y("json")){var b=y("bug-string-char-index"),w=function(t,r){var n,i,a,s=0;for(a in(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n)h.call(i,a)&&s++;return n=i=null,s?w=function(e,t){var r,n,i="[object Function]"==_.call(e);for(r in e)i&&"prototype"==r||!h.call(e,r)||(n="constructor"===r)||t(r);(n||h.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],w=function(t,r){var n,a,s="[object Function]"==_.call(t),o=!s&&"function"!=typeof t.constructor&&e[typeof t.hasOwnProperty]&&t.hasOwnProperty||h;for(n in t)s&&"prototype"==n||!o.call(t,n)||r(n);for(a=i.length;n=i[--a];)o.call(t,n)&&r(n)}),w(t,r)};if(!y("json-stringify")&&!y("date-serialization")){var S={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},k=function(e,t){return("000000"+(t||0)).slice(-e)},P=function(e){var t,r,n,i,a,s,o,l,u;if(v)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),s=e.getUTCHours(),o=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=p.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],f=function(e,t){return d[t]+365*(e-1970)+c((e-1969+(t=+(t>1)))/4)-c((e-1901+t)/100)+c((e-1601+t)/400)};t=function(e){for(i=c(e/864e5),r=c(i/365.2425)+1970-1;f(r+1,0)<=i;r++);for(n=c((i-f(r,0))/30.42);f(r,n+1)<=i;n++);i=1+i-f(r,n),s=c((a=(e%864e5+864e5)%864e5)/36e5)%24,o=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(P=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+k(6,r<0?-r:r):k(4,r))+"-"+k(2,n+1)+"-"+k(2,i)+"T"+k(2,s)+":"+k(2,o)+":"+k(2,l)+"."+k(3,u)+"Z",r=n=i=s=o=l=u=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function C(e){return P(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=C;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var j=function(e){var t=e.charCodeAt(0);return S[t]||"\\u00"+k(2,t.toString(16))},N=/[\x00-\x1f\x22\x5c]/g,T=function(e){return N.lastIndex=0,'"'+(N.test(e)?e.replace(N,j):e)+'"'},I=function(e,t,r,n,i,a,s){var o,u,p,d,g,h,v,y,b;if(m(function(){o=t[e]}),"object"==typeof o&&o&&(o.getUTCFullYear&&"[object Date]"==_.call(o)&&o.toJSON===l.prototype.toJSON?o=P(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==f)return o===f?o:"null";switch("object"==(u=typeof o)&&(p=_.call(o)),p||u){case"boolean":case"[object Boolean]":return""+o;case"number":case"[object Number]":return o>-1/0&&o<1/0?""+o:"null";case"string":case"[object String]":return T(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw c();if(s.push(o),d=[],y=a,a+=i,"[object Array]"==p){for(h=0,v=o.length;h<v;h++)g=I(h,o,r,n,i,a,s),d.push(g===f?"null":g);b=d.length?i?"[\n"+a+d.join(",\n"+a)+"\n"+y+"]":"["+d.join(",")+"]":"[]"}else w(n||o,function(e){var t=I(e,o,r,n,i,a,s);t!==f&&d.push(T(e)+":"+(i?" ":"")+t)}),b=d.length?i?"{\n"+a+d.join(",\n"+a)+"\n"+y+"}":"{"+d.join(",")+"}":"{}";return s.pop(),b}};n.stringify=function(t,r,n){var i,a,s,o;if(e[typeof r]&&r)if("[object Function]"==(o=_.call(r)))a=r;else if("[object Array]"==o){s={};for(var l,u=0,c=r.length;u<c;)l=r[u++],"[object String]"!=(o=_.call(l))&&"[object Number]"!=o||(s[l]=1)}if(n)if("[object Number]"==(o=_.call(n))){if((n-=n%1)>0)for(n>10&&(n=10),i="";i.length<n;)i+=" "}else"[object String]"==o&&(i=n.length<=10?n:n.slice(0,10));return I("",((l={})[""]=t,l),a,s,i,"",[])}}}if(!y("json-parse")){var A,D,$=a.fromCharCode,x={92:"\\",34:'"',47:"/",98:"\b",116:"\t",110:"\n",102:"\f",114:"\r"},E=function(){throw A=D=null,u()},L=function(){for(var e,t,r,n,i,a=D,s=a.length;A<s;)switch(i=a.charCodeAt(A)){case 9:case 10:case 13:case 32:A++;break;case 123:case 125:case 91:case 93:case 58:case 44:return e=b?a.charAt(A):a[A],A++,e;case 34:for(e="@",A++;A<s;)if((i=a.charCodeAt(A))<32)E();else if(92==i)switch(i=a.charCodeAt(++A)){case 92:case 34:case 47:case 98:case 116:case 110:case 102:case 114:e+=x[i],A++;break;case 117:for(t=++A,r=A+4;A<r;A++)(i=a.charCodeAt(A))>=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||E();e+=$("0x"+a.slice(t,A));break;default:E()}else{if(34==i)break;for(i=a.charCodeAt(A),t=A;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++A);e+=a.slice(t,A)}if(34==a.charCodeAt(A))return A++,e;E();default:if(t=A,45==i&&(n=!0,i=a.charCodeAt(++A)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(A+1))>=48&&i<=57&&E(),n=!1;A<s&&(i=a.charCodeAt(A))>=48&&i<=57;A++);if(46==a.charCodeAt(A)){for(r=++A;r<s&&!((i=a.charCodeAt(r))<48||i>57);r++);r==A&&E(),A=r}if(101==(i=a.charCodeAt(A))||69==i){for(43!=(i=a.charCodeAt(++A))&&45!=i||A++,r=A;r<s&&!((i=a.charCodeAt(r))<48||i>57);r++);r==A&&E(),A=r}return+a.slice(t,A)}n&&E();var o=a.slice(A,A+4);if("true"==o)return A+=4,!0;if("fals"==o&&101==a.charCodeAt(A+4))return A+=5,!1;if("null"==o)return A+=4,null;E()}return"$"},U=function(e){var t,r;if("$"==e&&E(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=L());)r?","==e?"]"==(e=L())&&E():E():r=!0,","==e&&E(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=L());)r?","==e?"}"==(e=L())&&E():E():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==L()||E(),t[e.slice(1)]=U(L());return t}E()}return e},R=function(e,t,r){var n=B(e,t,r);n===f?delete e[t]:e[t]=n},B=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if("[object Array]"==_.call(i))for(n=i.length;n--;)R(_,w,i);else w(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return A=0,D=""+e,r=U(L()),"$"!=L()&&E(),A=D=null,t&&"[object Function]"==_.call(t)?B(((n={})[""]=r,n),"",t):r}}}return n.runInContext=s,n}(t,t.JSON3={noConflict:function(){return i||(i=!0,t.JSON=r,t.JSON3=n,r=n=null),a}});t.JSON?(t.JSON.parse=a.parse,t.JSON.stringify=a.stringify):t.JSON={parse:a.parse,stringify:a.stringify}}.call(window),function(e){if(e.atob)try{e.atob(" ")}catch(a){e.atob=(t=e.atob,(r=function(e){return t(String(e).replace(/[\t\n\f\r ]+/g,""))}).original=t,r)}else{var t,r,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",i=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){for(var t,r,i,a,s="",o=0,l=(e=String(e)).length%3;o<e.length;){if((r=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255||(a=e.charCodeAt(o++))>255)return"";s+=n.charAt((t=r<<16|i<<8|a)>>18&63)+n.charAt(t>>12&63)+n.charAt(t>>6&63)+n.charAt(63&t)}return l?s.slice(0,l-3)+"===".substring(l):s},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!i.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,r,a,s="",o=0;o<e.length;)t=n.indexOf(e.charAt(o++))<<18|n.indexOf(e.charAt(o++))<<12|(r=n.indexOf(e.charAt(o++)))<<6|(a=n.indexOf(e.charAt(o++))),s+=64===r?String.fromCharCode(t>>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return s}}}(window);var i={setup:function(t){e=t},log:function(){(e||console&&console.log||function(){}).apply(null,arguments)}},a={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(a.get(e))||null}catch(r){i.log(r)}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){i.log(r)}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";a.set(t,r),a.get(t)!==r&&(e=!1),a.remove(t)}catch(n){e=!1}return e}};function s(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var l=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function u(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),s(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return l(1e19)/1e19}function c(e){var t=null;try{t=JSON.parse(e)}catch(r){}return t}function p(e,t){this.lockGetPrefix=e||"lock-get-prefix",this.lockSetPrefix=t||"lock-set-prefix"}function d(e){return"function"==typeof e||!(!e||"object"!=typeof e)&&d(e.listener)}function f(){this._events={}}function g(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function _(e){e=e||"";for(var t=function(){function e(){}return"function"!=typeof Object.create?(e.prototype=null,new e):Object.create(null)}(),r=e.substring(1).split("&"),n=0;n<r.length;n++){var i=r[n].indexOf("=");if(-1!==i){var a=r[n].substring(0,i),s=r[n].substring(i+1);a=g(a),s=g(s),"__proto__"!==a&&"constructor"!==a&&"prototype"!==a&&(t[a]=s)}}return t}function h(e){return"[object String]"==Object.prototype.toString.call(e)}function v(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}function y(e){var t=function(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=this._values.QueryString||"";for(var r in e)t=new RegExp(r+"[^&]+").test(t)?t.replace(new RegExp(r+"[^&]+"),r+"="+e[r]):"&"===t.slice(-1)?t+r+"="+e[r]:""===t?r+"="+e[r]:t+"&"+r+"="+e[r];this._values.QueryString=t},t.prototype.getUrl=function(){var e="";return e+=this._values.Origin,e+=this._values.Port?":"+this._values.Port:"",e+=this._values.Path,(e+=this._values.QueryString?"?"+this._values.QueryString:"")+(this._values.Fragment?"#"+this._values.Fragment:"")},t.prototype._parse=function(e){this._initValues();var t=this._regex.exec(e);t||i.log("URLParser::_parse -> Invalid URL");var r=e.split("#"),n=r[0],a=r.slice(1).join("#");for(var s in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[s]]&&(this._values[s]=t[this._fields[s]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=a},new t(e)}function b(e){var t,r={};if("function"==typeof window.URL&&function(){try{return"http://modernizr.com/"===new URL("http://modernizr.com/").href}catch(e){return!1}}())(r=new URL(e)).searchParams||(r.searchParams=(t=_(r.search),{get:function(e){return t[e]}}));else{if(h(e)||(e=String(e)),e=v(e),!1===/^https?:\/\/.+/.test(e))return void i.log("Invalid URL");var n=y(e);r.hash=n._values.Fragment,r.host=n._values.Host?n._values.Host+(n._values.Port?":"+n._values.Port:""):"",r.href=n._values.URL,r.password=n._values.Password,r.pathname=n._values.Path,r.port=n._values.Port,r.search=n._values.QueryString?"?"+n._values.QueryString:"",r.username=n._values.Username,r.hostname=n._values.Hostname,r.protocol=n._values.Protocol?n._values.Protocol+":":"",r.origin=n._values.Origin?n._values.Origin+(n._values.Port?":"+n._values.Port:""):"",r.searchParams=function(){var e=_("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}p.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 s=this.lockGetPrefix+e,o=a.get(s),l=String(u());if(o&&(o=c(o)||{randomNum:0,expireTime:0}).expireTime>n())return i(null);a.set(s,JSON.stringify({randomNum:l,expireTime:n()+t})),setTimeout(function(){(o=c(a.get(s))||{randomNum:0,expireTime:0})&&o.randomNum===l?(i(a.get(e)),a.remove(e),a.remove(s)):i(null)},r)},p.prototype.set=function(e,t,r,i,s){if(!e||!t)throw new Error("key and val is must");r=r||1e4,i=i||1e3,s=s||function(){};var o=this.lockSetPrefix+e,l=a.get(o),p=String(u());if(l&&(l=c(l)||{randomNum:0,expireTime:0}).expireTime>n())return s({status:"fail",reason:"This key is locked"});a.set(o,JSON.stringify({randomNum:p,expireTime:n()+r})),setTimeout(function(){(l=c(a.get(o))||{randomNum:0,expireTime:0}).randomNum===p?a.set(e,t)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},i)},f.prototype.on=function(e,t){if(!e||!t)return!1;if(!d(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},f.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!d(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},f.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},f.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},f.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 n=0,i=r.length;n<i;n++)r[n]&&r[n].listener===t&&r.splice(n,1);return this},f.prototype.emit=function(e,t){var r=this._events[e];if(!r)return!1;for(var n=0;n<r.length;n++){var i=r[n];i&&(i.listener.call(this,t||{}),i.once&&this.off(e,n))}return this},f.prototype.removeAllListeners=function(e){e&&this._events[e]?this._events[e]=[]:this._events={}},f.prototype.listeners=function(e){return e&&"string"==typeof e?this._events[e]:this._events};var w,S=(w=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},function(){var e=String(screen.height*screen.width);return e=e&&/\d{5,}/.test(e)?e.toString(16):String(31242*u()).replace(".","").slice(0,8),w()+"-"+u().toString(16).replace(".","")+"-"+function(){var e,t,r=navigator.userAgent,n=[],i=0;function a(e,t){var r,i=0;for(r=0;r<t.length;r++)i|=n[r]<<8*r;return e^i}for(e=0;e<r.length;e++)t=r.charCodeAt(e),n.unshift(255&t),n.length>=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+e+"-"+w()||(String(u())+String(u())+String(u())).slice(2,15)});function k(e){return!(!e||1!==e.nodeType)}function P(e){return void 0===e}function C(e){return Array.isArray&&r(C)?Array.isArray(e):"[object Array]"===Object.prototype.toString.call(e)}function O(e){return new j(e)}var j=function(e){this.ele=e},N=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};function T(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}i._getPath=function(){return this.path||this.composedPath&&this.composedPath()||O(this.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0},function(e,t,r){if(n===undefined&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var a="on"+t,s=e[a];e[a]=function(e,t,r,n){return function(a){if(!(a=a||i(window.event)))return undefined;a.target=a.srcElement;var s,o,l=!0;return"function"==typeof r&&(s=r(a)),o=t.call(e,a),"beforeunload"!==n?(!1!==s&&!1!==o||(l=!1),l):void 0}}(e,r,s,t)}}.apply(null,arguments)}function I(e){var t="pushState"in window.history?"popstate":"hashchange";T(window,t,e)}function A(e){if(e)return"undefined"!=typeof window.XMLHttpRequest&&"withCredentials"in new XMLHttpRequest?new XMLHttpRequest:"undefined"!=typeof XDomainRequest?new XDomainRequest:null;if("undefined"!=typeof window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){i.log(t)}}}function D(e,t,r){if("object"==typeof e&&"number"==typeof e.length&&e.length>0)if(Array.prototype.forEach&&e.forEach)e.forEach(t,r);else for(var n=0;n<e.length;n++)t.call(r,e[n],n,e);else if("[object Object]"===Object.prototype.toString.call(e))for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(r,e[i],i,e)}function $(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];if("[object Object]"===Object.prototype.toString.call(r))for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&void 0!==r[n]&&(e[n]=r[n])}return e}function x(e){function t(e){if(!e)return"";try{return JSON.parse(e)}catch(t){return{}}}e.timeout=e.timeout||2e4,e.credentials="undefined"==typeof e.credentials||e.credentials;var r=A(e.cors);if(!r)return!1;e.type||(e.type=e.data?"POST":"GET");var n,a=(e=$({success:function(){},error:function(){}},e)).success,o=e.error;e.success=function(e){a(e),n&&(clearTimeout(n),n=null)},e.error=function(e){o(e),n&&(clearTimeout(n),n=null)},n=setTimeout(function(){!function(){try{r&&"object"==typeof r&&r.abort&&r.abort()}catch(t){i.log(t)}n&&(clearTimeout(n),n=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&&(r.status>=200&&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(n){r.onreadystatechange=null,r.onload=null}},r.open(e.type,e.url,!0);try{e.credentials&&(r.withCredentials=!0),s(e.header)&&D(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(l){i.log(l)}r.send(e.data||null)}function E(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(D(e,function(e,n,i){r.push(t(e,n,i))}),r)}function L(e){var t=[];try{t=E(atob(e).split(""),function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})}catch(r){t=[]}try{return decodeURIComponent(t.join(""))}catch(r){return t.join("")}}function U(e){var t="";try{t=btoa(encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,function(e,t){return String.fromCharCode("0x"+t)}))}catch(r){t=e}return t}j.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&&P(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){var e=this.ele.getBoundingClientRect();if(e.width||e.height){var t=this.ele.ownerDocument.documentElement;return{top:e.top+window.pageYOffset-t.clientTop,left:e.left+window.pageXOffset-t.clientLeft}}return{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(t){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){var t=document.createElement(e);return this.ele.parentNode.insertBefore(t,this.ele),t.appendChild(this.ele),O(t)},getCssStyle:function(e){var t=this.ele.style.getPropertyValue(e);if(t)return t;var r=null;if("function"==typeof window.getMatchedCSSRules&&(r=window.getMatchedCSSRules(this.ele)),!r||!C(r))return null;for(var n=r.length-1;n>=0;n--)if(t=r[n].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 N((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return N(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return O(e=e&&11!==e.nodeType?e:null)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return O(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return O(e);return O(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;i<t.children.length;i++){var a=t.children[i];1===a.nodeType&&a.tagName.toLowerCase()===r&&n.push(t.children[i])}return n},getParents:function(){try{var e=this.ele;if(!k(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(r){return[]}}};var R={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];" "==i.charAt(0);)i=i.substring(1,i.length);if(0==i.indexOf(t))return g(i.substring(t.length,i.length))}return null},set:function(e,t,r,n,i,a){var s=a,o="",l="",u="";if(0!==(r=null==r?73e3:r)){var c=new Date;"s"===String(r).slice(-1)?c.setTime(c.getTime()+1e3*Number(String(r).slice(0,-1))):c.setTime(c.getTime()+24*r*60*60*1e3),o="; expires="+c.toGMTString()}function p(e){return!!e&&e.replace(/\r\n/g,"")}n&&""!==n&&(u="; SameSite="+n),i&&(l="; secure");var d="",f="",g="";e&&(d=p(e)),t&&(f=p(t)),s&&(g=p(s)),d&&f&&(document.cookie=d+"="+encodeURIComponent(f)+o+"; path=/"+g+u+l)},remove:function(e,t){this.set(e,"1",-1,t)},isSupport:function(e,t,r,n,i){e=e||"cookie_support_test",t=t||"1";var a=this;return navigator.cookieEnabled&&(a.set(e,t,r,n,i),a.get(e)===t&&(a.remove(e),!0))}};function B(e){return D(Array.prototype.slice.call(arguments,1),function(t){for(var r in t)void 0!==t[r]&&void 0===e[r]&&(e[r]=t[r])}),e}function H(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function J(e){return"[object Date]"==Object.prototype.toString.call(e)}function M(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 q(e){return D(Array.prototype.slice.call(arguments,1),function(t){for(var r in t)void 0!==t[r]&&(s(t[r])&&s(e[r])?$(e[r],t[r]):e[r]=t[r])}),e}function F(e,t,r){var n=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var i=[],a=0;a<e.length;a++)if(n.call(e,a)){var s=e[a];t.call(r,s,a,e)&&i.push(s)}return i}function K(e,t,r){t=t||"domain_test";var n=function(e){return"string"==typeof e&&e.match(/^[a-zA-Z0-9\u4e00-\u9fa5\-\.]+$/)?e:""}(e=e||location.hostname),i=n.split(".");if(C(i)&&i.length>=2&&!/^(\d+\.)+\d+$/.test(n))for(var a="."+i.splice(i.length-1,1);i.length>0;)if(a="."+i.splice(i.length-1,1)+a,R.set(t,"true",0,null,r,"; domain="+a),-1!==document.cookie.indexOf(t+"=true"))return R.set(t,"true","-1s",null,r,"; domain="+a),a;return""}function V(e){if(!h(e))return null;var t,r=e.split(">");return(t=function n(e){var t,a=r.shift();if(!a)return e;try{t=function(e,t){var r;if("body"===(e=v(e)))return document.getElementsByTagName("body")[0];if(0===e.indexOf("#"))e=e.slice(1),r=document.getElementById(e);else if(e.indexOf(":nth-of-type")>-1){var n=e.split(":nth-of-type");if(!n[0]||!n[1])return null;var i=n[0],a=n[1].match(/\(([0-9]+)\)/);if(!a||!a[1])return null;var s=Number(a[1]);if(!(k(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l<o.length;l++)if(k(o[l])&&o[l].tagName.toLowerCase()===i&&0==--s){r=o[l];break}if(s>0)return null}return r||null}(a,e)}catch(o){i.log(o)}return t&&k(t)?n(t):null}())&&k(t)?t:null}function z(e,t){var r="",n="";return e.textContent?r=v(e.textContent):e.innerText&&(r=v(e.innerText)),r&&(r=r.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),n=r||"","input"!==t&&"INPUT"!==t||(n=e.value||""),n}function W(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=b(e).hostname}catch(n){i.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function X(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function Z(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=g(e);var r=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null===r||r&&"string"!=typeof r[1]&&r[1].length?"":g(r[1])}function Y(e){var t={},r=e.split("?")[1]||"";return r&&(t=_("?"+r)),t}function G(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function Q(){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 ee(e){return h(e)?H(e=v(e)):H(location.href)}function te(e){return h(e)?H(e=v(e)):H(location.pathname)}function re(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function ne(e,t){if("string"==typeof t)return re(e,t);if(C(t)){for(var r=!1,n=0;n<t.length;n++)if(re(e,t[n])){r=!0;break}return r}}function ie(e){if("string"!=typeof e)return 0;var t=0;if(0==e.length)return t;for(var r=0;r<e.length;r++)t=(t<<5)-t+e.charCodeAt(r),t&=t;return t}function ae(e){var t=9007199254740992,r=-9007199254740992,n=0;if(e.length>0)for(var i=e.split(""),a=0;a<i.length;a++){var s=i[a].charCodeAt(),o=31*n+s;if(o>t)for(n=r+n;(o=31*n+s)<r;)n=n/2+s;if(o<r)for(n=t+n;(o=31*n+s)>t;)n=n/2+s;n=31*n+s}return n}function se(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n<e.length;n++)if(t===e[n])return n;return-1}var oe=Object.prototype.hasOwnProperty;function le(e){return!(!e||!oe.call(e,"callee"))}function ue(e){return"[object Boolean]"==Object.prototype.toString.call(e)}function ce(e){if(s(e)){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}return!1}function pe(e){return"string"==typeof e&&(!1!==/^https?:\/\/.+/.test(e)||(i.log("Invalid URL"),!1))}function de(){return!!navigator.userAgent.match(/iPhone|iPad|iPod/i)}function fe(e){try{JSON.parse(e)}catch(t){return!1}return!0}function ge(e){return"[object Number]"==Object.prototype.toString.call(e)&&/[\d\.]+/.test(String(e))}function _e(e){if(!s(e)||!h(e.callbackName))return i.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=r(e.success)?e.success:function(){},e.error=r(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),n=document.getElementsByTagName("head")[0],a=null,o=!1;n.appendChild(t),ge(e.timeout)&&(a=setTimeout(function(){if(o)return!1;e.error("timeout"),window[e.callbackName]=function(){i.log("call jsonp error")},a=null,n.removeChild(t),o=!0},Math.min(e.timeout,3e4))),window[e.callbackName]=function(){clearTimeout(a),a=null,e.success.apply(null,arguments),window[e.callbackName]=function(){i.log("call jsonp error")},n.removeChild(t)};var l=encodeURIComponent(e.callbackName),u="";if(e.url.indexOf("?")>-1?e.url+="&callbackName="+l:e.url+="?callbackName="+l,s(e.data)){var c=[];D(e.data,function(e,t){c.push(encodeURIComponent(t)+"="+encodeURIComponent(e))}),(u=c.join("&"))&&(e.url+="&"+u)}t.onerror=function(r){if(o)return!1;window[e.callbackName]=function(){i.log("call jsonp error")},clearTimeout(a),a=null,n.removeChild(t),e.error(r),o=!0},t.src=e.url}function he(e){({visibleHandler:r(e.visible)?e.visible:function(){},hiddenHandler:r(e.hidden)?e.hidden:function(){},visibilityChange:null,hidden:null,isSupport:function(){return"undefined"!=typeof document[this.hidden]},init:function(){"undefined"!=typeof document.hidden?(this.hidden="hidden",this.visibilityChange="visibilitychange"):"undefined"!=typeof document.mozHidden?(this.hidden="mozHidden",this.visibilityChange="mozvisibilitychange"):"undefined"!=typeof document.msHidden?(this.hidden="msHidden",this.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(this.hidden="webkitHidden",this.visibilityChange="webkitvisibilitychange"),this.listen()},listen:function(){if(this.isSupport()){var e=this;T(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else T(window,"focus",this.visibleHandler),T(window,"blur",this.hiddenHandler)}}).init()}function me(e){e=$({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 ve(e,t){t="number"==typeof t?t:13;for(var r=(e=String(e)).split(""),n=0;n<r.length;n++)r[n].charCodeAt(0)<126&&(r[n]=String.fromCharCode((r[n].charCodeAt(0)+t)%126));return r.join("")}function ye(e){return ve(e=String(e),113)}function be(e){s(e)&&D(e,function(t,r){s(t)?be(e[r]):J(t)&&(e[r]=M(t))})}var we={isSupport:function(){var e=!0,t="testIsSupportStorage";try{sessionStorage&&sessionStorage.setItem?(sessionStorage.setItem("__session_storage_support__",t),sessionStorage.removeItem("__session_storage_support__",t),e=!0):e=!1}catch(r){e=!1}return e}};function Se(e){var t=document.createElement("style");t.type="text/css";try{t.appendChild(document.createTextNode(e))}catch(i){t.styleSheet.cssText=e}var r=document.getElementsByTagName("head")[0],n=document.getElementsByTagName("script")[0];r?r.children.length?r.insertBefore(t,r.children[0]):r.appendChild(t):n.parentNode.insertBefore(t,n)}function ke(e){var t=[];return null==e?t:(D(e,function(e){t[t.length]=e}),t)}function Pe(e){for(var t,r=[],n={},i=0;i<e.length;i++)(t=e[i])in n||(n[t]=!0,r.push(t));return r}var Ce={"+":"-","/":"_","=":"."},Oe={"-":"+",_:"/",".":"="};function je(e,t,r){return r=r||0,e.substr(r,t.length)===t}function Ne(e){return"__proto__"!==e&&"constructor"!==e&&"prototype"!==e}var Te={__proto__:null,noPrototypePollution:Ne,ConcurrentStorage:p,EventEmitter:f,URL:b,UUID:S,addEvent:T,addHashEvent:I,ajax:x,base64Decode:L,base64Encode:U,bindReady:function(e,t){t=t||window;var r=!1,n=!0,a=t.document,s=a.documentElement,o=a.addEventListener,l=o?"addEventListener":"attachEvent",u=o?"removeEventListener":"detachEvent",c=o?"":"on",p=function(n){"readystatechange"==n.type&&"complete"!=a.readyState||(("load"==n.type?t:a)[u](c+n.type,p,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{s.doScroll("left")}catch(e){return void setTimeout(d,50)}p("poll")};if("complete"==a.readyState)e.call(t,"lazy");else{if(!o&&s.doScroll){try{n=!t.frameElement}catch(f){i.log(f)}n&&d()}a[l](c+"DOMContentLoaded",p,!1),a[l](c+"readystatechange",p,!1),t[l](c+"load",p,!1)}},cookie:R,coverExtend:B,decodeURI:H,decodeURIComponent:g,dfmapping:function(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i<t.length;i++)n[t.charAt(i)]=t.charAt(r-i);var a="";for(i=0;i<e.length;i++)e.charAt(i)in n?a+=n[e.charAt(i)]:a+=e.charAt(i);return a},each:D,encodeDates:function ia(e){return D(e,function(t,r){J(t)?e[r]=M(t):s(t)&&(e[r]=ia(t))}),e},extend:$,extend2Lev:q,filter:F,formatDate:M,formatJsonString:function(e){try{return JSON.stringify(e,null," ")}catch(t){return JSON.stringify(e)}},getCookieTopLevelDomain:K,getDomBySelector:V,getElementContent:z,getHostname:W,getIOSVersion:X,getQueryParam:Z,getQueryParamsFromUrl:Y,getRandom:u,getRandomBasic:l,getScreenOrientation:function(){var e=screen.msOrientation||screen.mozOrientation||(screen.orientation||{}).type,t="\u672a\u53d6\u5230\u503c";if(e)t=e.indexOf("landscape")>-1?"landscape":"portrait";else if(G()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t},getUA:Q,getURL:ee,getURLPath:te,getURLSearchParams:_,hasAttribute:re,hasAttributes:ne,hashCode:ie,hashCode53:ae,indexOf:se,inherit:function(e,t){return e.prototype=new t,e.prototype.constructor=e,e.superclass=t.prototype,e},isArguments:le,isArray:C,isBoolean:ue,isDate:J,isElement:k,isEmptyObject:ce,isFunction:r,isHttpUrl:pe,isIOS:de,isJSONString:fe,isNumber:ge,isObject:s,isString:h,isSupportBeaconSend:function(){var e=!1;if("object"!=typeof navigator||"function"!=typeof navigator.sendBeacon)return e;var t=Q(),r=navigator.userAgent.toLowerCase();if(/Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent)){var n=(r.match(/os [\d._]*/gi)+"").replace(/[^0-9|_.]/gi,"").replace(/_/gi,".").split(".");"undefined"==typeof t.safari&&(t.safari=n[0]),n[0]&&(t.qqBuildinBrowser||t.qqBrowser)?e=!1:n[0]&&n[0]<13?(t.chrome>41||t.firefox>30||t.opera>25||t.safari>12)&&(e=!0):(t.chrome>41||t.firefox>30||t.opera>25||t.safari>11.3)&&(e=!0)}else(t.chrome>38||t.edge>13||t.firefox>30||t.opera>25||t.safari>11)&&(e=!0);return e},isSupportCors:function(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)},isUndefined:P,jsonp:_e,listenPageState:he,loadScript:me,localStorage:a,logger:i,map:E,mediaQueriesSupported:G,now:n,removeScriptProtocol:function(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e},rot13defs:ye,rot13obfs:ve,ry:O,safeJSONParse:c,searchObjDate:be,sessionStorage:we,setCssStyle:Se,strToUnicode:function(e){if("string"!=typeof e)return i.log("\u8f6c\u6362unicode\u9519\u8bef",e),e;for(var t="",r=0;r<e.length;r++)t+="\\"+e.charCodeAt(r).toString(16);return t},throttle:function(e,t,r){var i,a,s,o=null,l=0;r||(r={});var u=function(){l=!1===r.leading?0:n(),o=null,s=e.apply(i,a),o||(i=a=null)};return function(){var c=n();l||!1!==r.leading||(l=c);var p=t-(c-l);return i=this,a=arguments,p<=0||p>t?(o&&(clearTimeout(o),o=null),l=c,s=e.apply(i,a),o||(i=a=null)):o||!1===r.trailing||(o=setTimeout(u,p)),s}},toArray:function(e){return e?e.toArray?e.toArray():C(e)||le(e)?Array.prototype.slice.call(e):ke(e):[]},trim:v,unique:Pe,urlParse:y,urlSafeBase64:{encode:function(e){return e.replace(/[+\/=]/g,function(e){return Ce[e]})},decode:function(e){return e.replace(/[-_.]/g,function(e){return Oe[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)}},values:ke,xhr:A,startsWith:je},Ie=[],Ae={appendWriter:function(e){Ie.push(e)},msg:function(){var e={module:"",level:"log",brand:"web-sdk",content:null};return e.content=Array.prototype.slice.call(arguments),{module:function(t){return h(t)&&(e.module=t),this},level:function(t){return h(t)&&(e.level=t),this},brand:function(t){return h(t)&&(e.brand=t),this},log:function(){if(e.content&&e.content.length)for(var t=0;t<Ie.length;t++)if("function"==typeof Ie[t])try{Ie[t].call(null,e)}catch(r){}return this}}}};function De(){Ae.msg.apply(Ae,arguments).log()}function $e(){Ae.msg.apply(Ae,arguments).level("warn").log()}function xe(){Ae.msg.apply(Ae,arguments).level("error").log()}var Ee={},Le={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:undefined,url:!0,title:!0},encrypt_cookie:!1,enc_cookie:!1,img_use_crossorigin:!1,name:"sa",max_referrer_string_length:200,max_string_length:1024,max_id_length:255,max_key_length:100,cross_subdomain:!0,show_log:!1,is_debug:!1,source_channel:[],sdk_id:"",auto_init:!0,is_track_single_page:!1,is_single_page:!1,batch_send:!1,custom_server_url:"",source_type:{},callback_timeout:200,datasend_timeout:8e3,is_track_device_id:!1,ignore_oom:!0,app_js_bridge:!1,white_list:{}};Le.white_list[location.host]=b(location.href).hostname;var Ue="utm_source utm_medium utm_campaign utm_content utm_term",Re="1.27.11",Be="sensorsdata_domain_test",He={EMAIL:"$identity_email",MOBILE:"$identity_mobile",LOGIN:"$identity_login_id"};function Je(e){var t=Ee.current_domain;switch(typeof t){case"function":var r=t();return""===r||""===v(r)?"url\u89e3\u6790\u5931\u8d25":-1!==r.indexOf(".")?r:"url\u89e3\u6790\u5931\u8d25";case"string":return""===t||""===v(t)?"url\u89e3\u6790\u5931\u8d25":-1!==t.indexOf(".")?t:"url\u89e3\u6790\u5931\u8d25";default:var n=K(null,Be,Ee.is_secure_cookie);return""===e?"url\u89e3\u6790\u5931\u8d25":""===n?"url\u89e3\u6790\u5931\u8d25":n}}var Me={get:function(e){return R.get(e)},set:function(e,t,r,n){var i="";if(n=P(n)?Ee.cross_subdomain:n){var a=Je(location.href);"url\u89e3\u6790\u5931\u8d25"===a&&(a=""),i=a?"; domain="+a:""}return R.set(e,t,r,Ee.set_cookie_samesite,Ee.is_secure_cookie,i)},remove:function(e,t){return t=P(t)?Ee.cross_subdomain:t,R.remove(e,t)},isSupport:function(e,t){return e=e||"sajssdk_2015_cookie_access_test",t=t||"1",R.isSupport(e,t,0,null,Ee.is_secure_cookie)}};function qe(e,r){var n="";if(!1===Ee.cross_subdomain){try{if(r)n=b(r).hostname;else{var i=location.host;P(t.para.white_list[i])||(n=t.para.white_list[i])}}catch(a){xe(a)}n="string"==typeof n&&""!==n?"sajssdk_2015_"+Ee.sdk_id+e+"_"+n.replace(/\./g,"_"):"sajssdk_2015_root_"+Ee.sdk_id+e}else n="sajssdk_2015_cross_"+Ee.sdk_id+e;return n}function Fe(){return Me.isSupport()?null!==Me.get("sensorsdata_is_new_user")||null!==Me.get(qe("new_user")):null!==Ke.get(Ke.getNewUserFlagMemoryKey("new_user"))}Me.getNewUser=Fe;var Ke={data:{},get:function(e){var t=this.data[e];return t===undefined?null:t._expirationTimestamp_!==undefined?(new Date).getTime()>t._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n=new Date;t={value:t,_expirationTimestamp_:"s"===String(r).slice(-1)?n.getTime()+1e3*Number(String(r).slice(0,-1)):n.getTime()+24*r*60*60*1e3}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+Ee.sdk_id+e}},Ve={checkIsAddSign:function(e){"track"===e.type&&(Fe()?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(){},storeInitCheck:function(){if(t.is_first_visitor){var e=new Date,r={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};Me.isSupport()?Me.set(qe("new_user"),"1",3600*r.h+60*r.m+r.s+"s"):Ke.set(Ke.getNewUserFlagMemoryKey("new_user"),"1",3600*r.h+60*r.m+r.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Fe()||(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 ze(e,t,r){var n=!(!s(Ee.heatmap)||!Ee.heatmap.useCapture);return s(Ee.heatmap)&&P(Ee.heatmap.useCapture)&&"click"===t&&(n=!0),T(e,t,r,n)}var We=function(){this._events=[],this.pendingEvents=[]};function Xe(){var e=document.referrer;if(!e)return!1;try{var t=b(e).hostname;return t&&"baidu.com"===t.substring(t.length-"baidu.com".length)}catch(r){return!1}}We.prototype={emit:function(e){var t=[].slice.call(arguments,1);D(this._events,function(r){r.type===e&&r.callback.apply(r.context,t)}),this.pendingEvents.push({type:e,data:t}),this.pendingEvents.length>20&&this.pendingEvents.shift()},on:function(e,t,n,i){r(t)&&(this._events.push({type:e,callback:t,context:n||this}),i=!1!==i,this.pendingEvents.length>0&&i&&D(this.pendingEvents,function(r){r.type===e&&t.apply(n,r.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Ze={data:{},id:function(){return this.data.id?this.data.id:(this.data.id=Ge(),this.data.id)},type:function(){return this.data.type?this.data.type:(this.data.type=Ye(),this.data.type)}};function Ye(){var e=Y(document.referrer);if(ce(e)||!e.eqid){var t=Y(location.href);return e.ck||t.utm_source?"baidu_sem_keyword_id":"baidu_other_keyword_id"}return"baidu_seo_keyword_id"}function Ge(){var e=Y(document.referrer);return ce(e)||!e.eqid?S().replace(/-/g,""):e.eqid}function Qe(e,t){return h(e=e||document.referrer)?(0!==(e=H(e=v(e))).indexOf("https://www.baidu.com/")||t||(e=e.split("?")[0]),h(e=e.slice(0,Ee.max_referrer_string_length))?e:""):"\u53d6\u503c\u5f02\u5e38_referrer\u5f02\u5e38_"+String(e)}function et(e){if(""===(e=e||document.referrer))return!0;var t=K(null,Be,Ee.is_secure_cookie),r=W(e);return-1===(r="."+r).indexOf(t)&&""!==t}function tt(e,t){e=e||document.referrer;var r=Ee.source_type.keyword;if(document&&h(e)){if(0===e.indexOf("http")){var n=rt(e),i=Y(e);if(ce(i))return Ee.preset_properties.search_keyword_baidu&&Xe()?void 0:"\u672a\u53d6\u5230\u503c";var a=null;for(var o in r)if(n===o&&s(i))if(C(a=r[o]))for(o=0;o<a.length;o++){var l=i[a[o]];if(l)return t?{active:l}:l}else if(i[a])return t?{active:i[a]}:i[a];return Ee.preset_properties.search_keyword_baidu&&Xe()?void 0:"\u672a\u53d6\u5230\u503c"}return""===e?"\u672a\u53d6\u5230\u503c_\u76f4\u63a5\u6253\u5f00":"\u672a\u53d6\u5230\u503c_\u975ehttp\u7684url"}return"\u53d6\u503c\u5f02\u5e38_referrer\u5f02\u5e38_"+String(e)}function rt(e){var t=W(e);if(!t||"hostname\u89e3\u6790\u5f02\u5e38"===t)return"";var r={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(var n in r)for(var i=r[n],a=0,s=i.length;a<s;a++)if(i[a].test(t))return n;return"\u672a\u77e5\u641c\u7d22\u5f15\u64ce"}var nt={distinct_id:function(){},jssdkDebug:function(){},_sendDebug:function(e){},apph5:function(e){var t="app_h5\u6253\u901a\u5931\u8d25-",r={1:t+"use_app_track\u4e3afalse",2:t+"Android\u6216\u8005iOS\uff0c\u6ca1\u6709\u66b4\u9732\u76f8\u5e94\u65b9\u6cd5",3.1:t+"Android\u6821\u9a8cserver_url\u5931\u8d25",3.2:t+"iOS\u6821\u9a8cserver_url\u5931\u8d25",4.1:t+"H5 \u6821\u9a8c iOS server_url \u5931\u8d25",4.2:t+"H5 \u6821\u9a8c Android server_url \u5931\u8d25"},n=e.output,i=e.step,a=e.data||"";"all"!==n&&"console"!==n||De(r[i]),("all"===n||"code"===n)&&s(Ee.is_debug)&&Ee.is_debug.apph5&&(a.type&&"profile"===a.type.slice(0,7)||(a.properties._jssdk_debug_info="apph5-"+String(i)))},defineMode:function(e){var t={1:{title:"\u5f53\u524d\u9875\u9762\u65e0\u6cd5\u8fdb\u884c\u53ef\u89c6\u5316\u5168\u57cb\u70b9",message:"App SDK \u4e0e Web JS SDK \u6ca1\u6709\u8fdb\u884c\u6253\u901a\uff0c\u8bf7\u8054\u7cfb\u8d35\u65b9\u6280\u672f\u4eba\u5458\u4fee\u6b63 App SDK \u7684\u914d\u7f6e\uff0c\u8be6\u7ec6\u4fe1\u606f\u8bf7\u67e5\u770b\u6587\u6863\u3002",link_text:"",link_url:""},2:{title:"\u5f53\u524d\u9875\u9762\u65e0\u6cd5\u8fdb\u884c\u53ef\u89c6\u5316\u5168\u57cb\u70b9",message:"App SDK \u4e0e Web JS SDK \u6ca1\u6709\u8fdb\u884c\u6253\u901a\uff0c\u8bf7\u8054\u7cfb\u8d35\u65b9\u6280\u672f\u4eba\u5458\u4fee\u6b63 Web JS SDK \u7684\u914d\u7f6e\uff0c\u8be6\u7ec6\u4fe1\u606f\u8bf7\u67e5\u770b\u6587\u6863\u3002",link_text:"",link_url:""},3:{title:"\u5f53\u524d\u9875\u9762\u65e0\u6cd5\u8fdb\u884c\u53ef\u89c6\u5316\u5168\u57cb\u70b9",message:"Web JS SDK \u6ca1\u6709\u5f00\u542f\u5168\u57cb\u70b9\u914d\u7f6e\uff0c\u8bf7\u8054\u7cfb\u8d35\u65b9\u5de5\u4f5c\u4eba\u5458\u4fee\u6b63 SDK \u7684\u914d\u7f6e\uff0c\u8be6\u7ec6\u4fe1\u606f\u8bf7\u67e5\u770b\u6587\u6863\u3002",link_text:"",link_url:""},4:{title:"\u5f53\u524d\u9875\u9762\u65e0\u6cd5\u8fdb\u884c\u53ef\u89c6\u5316\u5168\u57cb\u70b9",message:"Web JS SDK \u914d\u7f6e\u7684\u6570\u636e\u6821\u9a8c\u5730\u5740\u4e0e App SDK \u914d\u7f6e\u7684\u6570\u636e\u6821\u9a8c\u5730\u5740\u4e0d\u4e00\u81f4\uff0c\u8bf7\u8054\u7cfb\u8d35\u65b9\u5de5\u4f5c\u4eba\u5458\u4fee\u6b63 SDK \u7684\u914d\u7f6e\uff0c\u8be6\u7ec6\u4fe1\u606f\u8bf7\u67e5\u770b\u6587\u6863\u3002",link_text:"",link_url:""}};return!(!e||!t[e])&&t[e]},protocol:{protocolIsSame:function(e,t){try{if(b(e).protocol!==b(t).protocol)return!1}catch(r){return $e("\u4e0d\u652f\u6301 _.URL \u65b9\u6cd5"),!1}return!0},serverUrl:function(){h(Ee.server_url)&&""!==Ee.server_url&&!this.protocolIsSame(Ee.server_url,location.href)&&$e("SDK \u68c0\u6d4b\u5230\u60a8\u7684\u6570\u636e\u53d1\u9001\u5730\u5740\u548c\u5f53\u524d\u9875\u9762\u5730\u5740\u7684\u534f\u8bae\u4e0d\u4e00\u81f4\uff0c\u5efa\u8bae\u60a8\u4fee\u6539\u6210\u4e00\u81f4\u7684\u534f\u8bae\u3002\n\u56e0\u4e3a\uff1a1\u3001https \u4e0b\u9762\u53d1\u9001 http \u7684\u56fe\u7247\u8bf7\u6c42\u4f1a\u5931\u8d25\u30022\u3001http \u9875\u9762\u4f7f\u7528 https + ajax \u65b9\u5f0f\u53d1\u6570\u636e\uff0c\u5728 ie9 \u53ca\u4ee5\u4e0b\u4f1a\u4e22\u5931\u6570\u636e\u3002")},ajax:function(e){if(e===Ee.server_url)return!1;h(e)&&""!==e&&!this.protocolIsSame(e,location.href)&&$e("SDK \u68c0\u6d4b\u5230\u60a8\u7684\u6570\u636e\u53d1\u9001\u5730\u5740\u548c\u5f53\u524d\u9875\u9762\u5730\u5740\u7684\u534f\u8bae\u4e0d\u4e00\u81f4\uff0c\u5efa\u8bae\u60a8\u4fee\u6539\u6210\u4e00\u81f4\u7684\u534f\u8bae\u3002\u56e0\u4e3a http \u9875\u9762\u4f7f\u7528 https + ajax \u65b9\u5f0f\u53d1\u6570\u636e\uff0c\u5728 ie9 \u53ca\u4ee5\u4e0b\u4f1a\u4e22\u5931\u6570\u636e\u3002")}}},it={initPage:function(){var e=Qe(),t=ee(),r=Je(t);r||nt.jssdkDebug("url_domain\u5f02\u5e38_"+t+"_"+r),this.pageProp={referrer:e,referrer_host:e?W(e):"",url:t,url_host:W(t,"url_host\u53d6\u503c\u5f02\u5e38"),url_domain:r}},pageProp:{},campaignParams:function(){return t.kit.getUtmData()},campaignParamsStandard:function(e,t){e=e||"",t=t||"";var r=it.campaignParams(),n={},i={};return D(r,function(r,a,s){-1!==(" "+Ue+" ").indexOf(" "+a+" ")?n[e+a]=s[a]:i[t+a]=s[a]}),{$utms:n,otherUtms:i}},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:Re}},currentProps:{},register:function(e){$(it.currentProps,e)}};function at(){function e(e,t){for(var r=0;r<e.length;r++)if(-1!==t.split("?")[0].indexOf(e[r]))return!0}var t="("+Ee.source_type.utm.join("|")+")\\=[^&]+",r=Ee.source_type.search,n=Ee.source_type.social,i=document.referrer||"",a=it.pageProp.url;if(a){var s=a.match(new RegExp(t));return s&&s[0]?"\u4ed8\u8d39\u5e7f\u544a\u6d41\u91cf":e(r,i)?"\u81ea\u7136\u641c\u7d22\u6d41\u91cf":e(n,i)?"\u793e\u4ea4\u7f51\u7ad9\u6d41\u91cf":""===i?"\u76f4\u63a5\u6d41\u91cf":"\u5f15\u8350\u6d41\u91cf"}return"\u83b7\u53d6url\u5f02\u5e38"}function st(e){var t=Z(e,"gdt_vid"),r=Z(e,"hash_key"),n=Z(e,"callbacks"),i={click_id:"",hash_key:"",callbacks:""};return h(t)&&t.length&&(i.click_id=16==t.length||18==t.length?t:"\u53c2\u6570\u89e3\u6790\u4e0d\u5408\u6cd5",h(r)&&r.length&&(i.hash_key=r),h(n)&&n.length&&(i.callbacks=n)),i}function ot(e){var t=e.properties,n=JSON.parse(JSON.stringify(e));s(t)&&D(t,function(e,i){if(r(e))try{t[i]=e(n),r(t[i])&&($e("\u60a8\u7684\u5c5e\u6027- "+i