diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e383321..c8323331 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,15 @@ +## 1.26.9(2024-3-29) +1. 优化 + - 给测试 cookie 加上了可用 secure 的标记。 + - 去除可视化属性功能中用到的提示,包括带有 sensorsdata.cn 的帮助文档链接。 + - 去除了 cookie 中的 device_id ,减少了 cookie 的大小。 + - 去除了发布的源码文件 + ## 1.26.8(2024-3-25) 1. 修复 - 可视化 iframe 存在的 javascript: 导致的 xss 问题。 2. 优化 - ID3 废弃 loginWithKey,内外层匿名 ID 保持一致,identify 默认是加 true 的效果。 - - 去除可视化属性功能中用到的提示,包括带有 sensorsdata.cn 的帮助文档链接 ## 1.26.7(2024-3-8) 1. 修复 diff --git a/core/sensorsdata.amd.min.js b/core/sensorsdata.amd.min.js index cbfe1c01..9c2c1704 100644 --- a/core/sensorsdata.amd.min.js +++ b/core/sensorsdata.amd.min.js @@ -1,6 +1,6 @@ -!function(e,t){"function"==typeof define&&"object"==typeof define.amd&&define.amd&&define(t)}(this,function(){function e(e){if(!e)return!1;var t=Object.prototype.toString.call(e);return"[object Function]"==t||"[object AsyncFunction]"==t}function t(){return Date.now&&e(Date.now)?Date.now():(new Date).getTime()}function r(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}function n(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),r(e)&&e.getRandomValues){var t=new Uint32Array(1),n=e.getRandomValues(t)[0],i=Math.pow(2,32);return n/i}}return Zi(1e19)/1e19}function i(e){var t=null;try{t=JSON.parse(e)}catch(r){}return t}function a(e,t){this.lockGetPrefix=e||"lock-get-prefix",this.lockSetPrefix=t||"lock-set-prefix"}function s(e){return"function"==typeof e||!(!e||"object"!=typeof e)&&s(e.listener)}function l(){this._events={}}function u(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function c(e){e=e||"";for(var t={},r=e.substring(1),n=r.split("&"),i=0;i Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("https://www.sensorsdata.cn/"),"https://www.sensorsdata.cn/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{d(e)||(e=String(e)),e=p(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void zi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new Qi(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement||a.target;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(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){zi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(ea&&e.forEach===ea)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText),i.status):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){zi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(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 j(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}function I(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(p){zi.log(p)}n&&d()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function T(e){return k(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 A(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function D(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,document.cookie.indexOf(t+"=true")!==-1){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function J(e){function t(e,t){e=p(e);var r;if("body"===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 o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){zi.log(o)}return i&&_(i)?r(i):null}if(!d(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=p(e.textContent):e.innerText&&(r=p(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 q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){zi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function V(e,t){var r=g(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i){var a=F(i);n=a[t]||""}}return n}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){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(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){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 Z(e){return d(e)?(e=p(e),A(e)):A(location.href)}function G(e){return d(e)?(e=p(e),A(e)):A(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function pe(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!d(t.callbackName))return zi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(n.defer="defer",i.appendChild(n),ce(t.timeout)){var s=Math.min(t.timeout,3e5);a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){zi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},s)}if(window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){zi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var l=[];k(t.data,function(e,t){l.push(t+"="+e)}),t.data=l.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){zi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=encodeURI(t.url)}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.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;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.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 he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,d)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else d(i)||ce(i)||$(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function it(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function at(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function ot(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))ot(e[a]);else if(d(i)){if(re(n,a)>-1)return;e[a]=it(i,re(t,a)>-1?1024:pa.max_string_length)}})}function st(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function lt(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};rt({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};rt({item_id:n},i)}}function ut(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&rt({propertyKey:n},i)})}function ct(e){var t=e.properties;ye(e),r(t)?(nt(t),at(t),st(e),ut(t),ot(t)):"properties"in e&&(e.properties={}),lt(e)}function dt(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function pt(e,t){try{var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,xa.getIdentities());var a={identities:i,distinct_id:xa.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,xa.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),"$UnbindID"===a.event&&(a.login_id&&delete a.login_id,a.anonymous_id&&delete a.anonymous_id),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},wa.properties(),xa.getProps(),xa.getSessionProps(),wa.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!d(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!d(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&d(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&d(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!d(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!d(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!d(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),d(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&$(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ha.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=qa.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),ka.checkIsAddSign(a),ka.checkIsFirstTime(a),Fe(a),Ve(a),a}catch(o){return{_debug_web_msg:String(o)}}}function ft(e){return Fa.stage.process("basicProps",e)}function gt(e){return Fa.stage.process("formatData",e)}function _t(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&Be(e.ele,"click",function(e){i(e)}))))}function ht(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function mt(e){return Wa.stage.process("webClickEvent",e)}function vt(e){return Wa.stage.process("webStayEvent",e)}function yt(){var e=wa.campaignParams(),t={};return k(e,function(e,r,n){(" "+Vi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function bt(e,t,r){if(Vi.is_first_visitor&&r){var n={};Vi.para.preset_properties.search_keyword_baidu&&xe(document.referrer)&&Te()&&(n.$search_keyword_id=ya.id(),n.$search_keyword_id_type=ya.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=$e(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:d(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:d(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:He(),$first_search_keyword:Ee()},yt(),n)),Vi.is_first_visitor=!1}}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=xa.getFirstId(),s=xa.getOriginDistinctId();if(!rt({distinct_id:n}))return je("login id is invalid"),!1;if(n===xa.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"), -!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(a)&&n===xa._state.first_id)return!1;var l=xa._state.history_login_id.name!==a||n!==xa._state.history_login_id.value;if(l){xa._state.identities[a]=n,xa.set("history_login_id",{name:a,value:n}),o||xa.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:xa._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];xa._state.identities=t,xa.save()}function kt(e,t){if(!rt({unbindKey:e,bindValue:t}))return!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(e)&&xa._state.identities[e]===t){var n=xa.getUnionId().login_id;n&&e+"+"+t===n&&(xa._state.distinct_id=xa._state.first_id,xa._state.first_id="",xa.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete xa._state.identities[e],xa.save())}var i={};return i[e]=t,i}function Pt(){Vi._t=Vi._t||1*new Date,Vi.is_first_visitor=!1,Vi.source_channel_standard=ga}function Ct(e){P(pa,e||Vi.para||{}),Vi.para=pa;var t={};if(r(Vi.para.is_track_latest))for(var n in Vi.para.is_track_latest)t["latest_"+n]=Vi.para.is_track_latest[n];Vi.para.preset_properties=P({},fa.preset_properties,t,Vi.para.preset_properties||{});var i;for(i in fa)void 0===Vi.para[i]&&(Vi.para[i]=fa[i]);"string"!=typeof Vi.para.web_url||"://"!==Vi.para.web_url.slice(0,3)&&"//"!==Vi.para.web_url.slice(0,2)||("://"===Vi.para.web_url.slice(0,3)?Vi.para.web_url=location.protocol.slice(0,-1)+Vi.para.web_url:Vi.para.web_url=location.protocol+Vi.para.web_url),ba.protocol.serverUrl(),Vi.bridge&&Vi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Vi.para.source_type&&(Vi.para.source_type.utm=v(Vi.para.source_type.utm)?Vi.para.source_type.utm.concat(a):a,Vi.para.source_type.search=v(Vi.para.source_type.search)?Vi.para.source_type.search.concat(o):o,Vi.para.source_type.social=v(Vi.para.source_type.social)?Vi.para.source_type.social.concat(s):s,Vi.para.source_type.keyword=r(Vi.para.source_type.keyword)?P(l,Vi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Vi.para.heatmap&&!r(Vi.para.heatmap)&&(Vi.para.heatmap={}),r(Vi.para.heatmap)){Vi.para.heatmap.clickmap=Vi.para.heatmap.clickmap||"default",Vi.para.heatmap.scroll_notice_map=Vi.para.heatmap.scroll_notice_map||"default",Vi.para.heatmap.scroll_delay_time=Vi.para.heatmap.scroll_delay_time||4e3,Vi.para.heatmap.scroll_event_duration=Vi.para.heatmap.scroll_event_duration||18e3,Vi.para.heatmap.renderRefreshTime=Vi.para.heatmap.renderRefreshTime||1e3,Vi.para.heatmap.loadTimeout=Vi.para.heatmap.loadTimeout||1e3,Vi.para.heatmap.get_vtrack_config!==!0&&(Vi.para.heatmap.get_vtrack_config=!1);var d=v(Vi.para.heatmap.track_attr)?U(Vi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),Vi.para.heatmap.track_attr=d,r(Vi.para.heatmap.collect_tags))if(Vi.para.heatmap.collect_tags.div===!0)Vi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Vi.para.heatmap.collect_tags.div)){if(Vi.para.heatmap.collect_tags.div.ignore_tags?v(Vi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Vi.para.heatmap.collect_tags.div.ignore_tags=c):Vi.para.heatmap.collect_tags.div.ignore_tags=c,Vi.para.heatmap.collect_tags.div.max_level){var p=[1,2,3];re(p,Vi.para.heatmap.collect_tags.div.max_level)===-1&&(Vi.para.heatmap.collect_tags.div.max_level=1)}}else Vi.para.heatmap.collect_tags.div=!1;else Vi.para.heatmap.collect_tags=u}Vi.para.server_url=Ge(Vi.para.server_url),Vi.para.noCache===!0?Vi.para.noCache="?"+(new Date).getTime():Vi.para.noCache="",Vi.para.callback_timeout>Vi.para.datasend_timeout&&(Vi.para.datasend_timeout=Vi.para.callback_timeout),Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&r(Vi.para.heatmap.collect_tags)&&k(Vi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Vi.heatmap.otherTags.push(t)}),Vi.para.heatmap&&"default"===Vi.para.heatmap.clickmap&&Vi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Za[t]?Za[t].apply(Za,r):void("function"==typeof t?t.apply(Vi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Vi,n),a.plugin_is_init=!0,Vi.modules=Vi.modules||{},Vi.modules[a.plugin_name||"unnamed_"+Qa++]=a,a}if(!d(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Vi.modules&&Vi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return d(t)&&(r(Vi.modules)&&r(Vi.modules[t])?a=Vi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Vi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){rt({event:e,properties:t})&&Va.send({type:"track",event:e,properties:t},r)}function It(e,t){return!!rt({bindKey:e,bindValue:t})&&(xa._state.identities[e]=t,xa.save(),void Va.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function Tt(e,t){var r=kt(e,t);r&&Va.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function At(e,t,r){"object"==typeof e&&e.tagName?_t({ele:e},t,r,Vi.track):"object"==typeof e&&e.target&&e.event&&_t(e,t,r,Vi.track)}function Dt(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&!(!e.href||/^javascript/.test(e.href)||e.target)&&void Be(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Vi.track(t,r,i)})}function $t(e,t,r){rt({item_type:e,item_id:t,properties:r})&&Va.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){rt({item_type:e,item_id:t})&&Va.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set",properties:e},t)}function Lt(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){rt({propertiesMust:e})&&(k(e,function(t,r){d(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Va.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;d(e)&&(e={},e[n]=1),rt({propertiesMust:e})&&(r(e)?Va.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Bt(e){Va.send({type:"profile_delete"},e),xa.set("distinct_id",Gi()),xa.set("first_id","")}function Ht(e,t){var r=e,n={};d(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){d(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Va.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e){"number"==typeof e&&(e=String(e));var t=xa.getFirstId();if("undefined"==typeof e){var r=Gi();t?xa.set("first_id",r):xa.set("distinct_id",r)}else rt({distinct_id:e})&&(t?xa.set("first_id",e):xa.set("distinct_id",e))}function Mt(e){var t=xa.getFirstId();if(t)return je("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),"undefined"==typeof e){var r=Gi();xa._state.identities.$identity_cookie_id=r,xa.set("distinct_id",r)}else rt({distinct_id:e})&&(xa._state.identities.$identity_cookie_id=e,xa.set("distinct_id",e))}function qt(e,t,r,n){var i=xa.getFirstId()||xa.getDistinctId();xa.set("distinct_id",e),Va.send({original_id:i,distinct_id:xa.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function Kt(e,t,r,n){"number"==typeof e&&(e=String(e)),rt({distinct_id:e,event:t,properties:r})&&qt(e,t,r,n)}function Ft(e){rt({properties:e})?P(wa.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Vt(e){xa.clearAllProps(e)}function Wt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Vi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vapph5define.min.js"})}else t();else t()}function cr(t){Vi.para.is_track_single_page&&Oa.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){wa.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Vi.quick&&Vi.quick("autoTrack",i)}};if("boolean"==typeof Vi.para.is_track_single_page)i();else if("function"==typeof Vi.para.is_track_single_page){var a=Vi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function dr(){Vi._q&&v(Vi._q)&&Vi._q.length>0&&k(Vi._q,function(e){Vi[e[0]].apply(Vi,Array.prototype.slice.call(e[1]))}),r(Vi.para.heatmap)&&(Xa.initHeatmap(),Xa.initScrollmap())}function pr(){Vi.readyState.setState(3),new Vi.SDKJSBridge("visualized").onAppNotify(function(){ur("undefined"!=typeof sa_jssdk_app_define_mode)}),ur(!1),Vi.bridge.app_js_bridge_v1(),wa.initPage(),cr(),xa.init(),sr(),gr(),Vi.readyState.setState(4),dr()}function fr(){ro.isSeachHasKeyword()?ro.hasKeywordHandle():window.parent!==self&&no.isSearchHasKeyword()?no.verifyVtrackMode():ro.isWindowNameHasKeyword()?ro.windowNameHasKeywordHandle():ro.isStorageHasKeyword()?ro.storageHasKeywordHandle():window.parent!==self&&no.isStorageHasKeyword()?no.verifyVtrackMode():(pr(),no.notifyUser())}function gr(){qa.init(),"success"===Vi.bridge.bridge_info.verify_success&&Ha.init()}function _r(){k(io,function(t){var r=Vi[t];Vi[t]=function(){return Vi.readyState.state<3?(v(Vi._q)||(Vi._q=[]),Ne("calling sdk api before init is deprecated."),Vi._q.push([t,arguments]),!1):e(Vi.getDisabled)&&Vi.getDisabled()?void 0:Vi.readyState.getState()?r.apply(Vi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function hr(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 mr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new hr,this.sensors=r}function vr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function yr(e){e&&e.buildDataStage&&so.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&po.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&uo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&go.registerStageImplementation(e.viewStage)}function br(e,t){_o[e]&&_o[e](t)}function wr(){return ho.stage&&ho.stage.process("getUtmData")}function Sr(e){return mo.stage.process("send",e)}function kr(e){e.kit=vo,e.saEvent=Va,this.buildDataStage=Fa,this.sendDataStage=mo,this.businessStage=ho}function Pr(e){e.heatmap=Xa,this.viewStage=Wa}function Cr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};br("buildDataStage",r)}function Or(e){e&&(Vi.events=$a,Vi.bridge=to,Vi.SDKJSBridge=nr,Vi.JSBridge=or,Vi.store=xa,Vi.unlimitedDiv=Ja,Vi.customProp=Ma,Vi.vtrackcollect=qa,Vi.vapph5collect=Ha,Vi.detectMode=fr,Vi.registerFeature=yr,Vi.registerInterceptor=br,Vi.commonWays=Za,yr(new kr(Vi)),yr(new Pr(Vi)),br("viewStage",yo));var t=e?Ya:ao;for(var r in t)Vi[r]=t[r];Vi.logger=da,Vi.log=Oe,Vi._=eo,Vi.on=et,Vi.ee=Ca,Vi.use=Nt,Vi.lib_version=_a,Vi.registerPropertyPlugin=Cr}function Nr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ir(e,t,r){return Nr(e,t,r),e.plugin_version=Ho,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ar(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ar(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dr(e,t,r){return Tr(e,t,r),e.plugin_version=qo,e}function $r(e){return zo&&zo.call(Vo,JSON.stringify(e))}function xr(e){return Wo.call(Vo)&&Xo&&Xo.call(Vo,JSON.stringify(e))}function Er(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Lr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ur(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ur(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rr(e,t,r){return Lr(e,t,r),e.plugin_version=Go,e}function Br(){if(So=window.SensorsData_APP_New_H5_Bridge,ko=So&&So.sensorsdata_track,Po=ko&&So.sensorsdata_get_server_url&&So.sensorsdata_get_server_url(),No("---test---fail---",!Co,Co.bridge.activeBridge,!Po),Co&&!Co.bridge.activeBridge&&Po)return Co.bridge.activeBridge=Qo,Co.para.app_js_bridge&&!Co.para.app_js_bridge.is_mui&&(Co.bridge.is_verify_success=Po&&Co.bridge.validateAppUrl(Po),No("---test---bridge-verify-",Co.bridge.is_verify_success)),Co.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:Co.bridge.is_verify_success?"success":"fail",support_two_way_call:!!So.sensorsdata_js_call_app},Co.para.app_js_bridge?void Co.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}):void No("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function Hr(e,t){if(No("---test---datasend-",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return Co.bridge.is_verify_success?(No("---test---bridge-verify-success---",e.data),ko&&ko.call(So,JSON.stringify(Oo.extend({server_url:Co.para.server_url},e.data))),Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(No("---test---bridge-verify-fail-----",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_send?(Co.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e))}function Jr(e){var t=e.callType;return t in Zo.commands?Zo.commands[t](e,So):void(So&&Oo.isFunction(So.sensorsdata_js_call_app)&&So.sensorsdata_js_call_app(JSON.stringify(e)))}function Mr(e){return rs&&rs.call(es,JSON.stringify(e))}function qr(e){return ts.call(es)&&ns&&ns.call(es,JSON.stringify(e))}function Kr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Fr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wr(e,t,r){return Fr(e,t,r),e.plugin_version=as,e}function zr(){if(xo("ObsoleteBridge---test---init---"),jo=window.SensorsData_APP_JS_Bridge,Io=jo&&jo.sensorsdata_track,To=jo&&jo.sensorsdata_verify,Ao=jo&&jo.sensorsdata_visual_verify,xo("ObsoleteBridge-",Do.bridge.activeBridge,To,Io,Ao),Do&&!Do.bridge.activeBridge&&(To||Io||Ao)){Do.bridge.activeBridge=os;var e=To||Io;if(Ao&&(e=!!Ao.call(jo,JSON.stringify({server_url:Do.para.server_url})),xo("ObsoleteBridge---called-return",e)),Do.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Do.para.app_js_bridge)return void xo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Do.registerInterceptor("sendDataStage",{send:{priority:80,entry:Xr}}),xo("Android obsolete bridge inits succeed.")}}function Xr(e,t){if(xo("ObsoleteBridge---senddata"),Do.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(To){var n=To&&To.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data)));return xo("ObsoleteBridge---anVerify-success",n),n?($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Do.para.app_js_bridge.is_send?(Do.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return xo("ObsoleteBridge---is-send-old-way",Do.para.app_js_bridge.is_send),Io&&Io.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data))),$o.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Zr(e){xo("ObsoleteBridge---handleCommadn");var t=e.callType;return t in is.commands?(xo("ObsoleteBridge---",t,is.commands),is.commands[t](e,jo)):jo&&$o.isFunction(jo.sensorsdata_js_call_app)?(xo("ObsoleteBridge---handleCommadn-abridge"),jo.sensorsdata_js_call_app(JSON.stringify(e))):void 0}function Gr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Qr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Qr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Yr(e,t,r){return Gr(e,t,r),e.plugin_version=ls,e}function en(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return tn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function tn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function rn(e,t,r){return en(e,t,r),e.plugin_version=ds,e}function nn(){return"undefined"!=typeof Bo&&document[Bo]}function an(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return on(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function on(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function sn(e,t,r){return an(e,t,r),e.plugin_version=Ds,e}function ln(){if(fs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,gs=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},_s&&!_s.bridge.activeBridge&&gs()&&gs().postMessage){if(_s.bridge.activeBridge=$s,_s.para.app_js_bridge&&!_s.para.app_js_bridge.is_mui&&(_s.bridge.is_verify_success=fs&&_s.bridge.validateAppUrl(fs)),_s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_s.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!_s.para.app_js_bridge)return void ms("app_js_bridge is not configured, data will not be sent by iOS bridge.");_s.registerInterceptor("sendDataStage",{send:{priority:70,entry:un}}),ms("IOS bridge inits succeed.")}}function un(e,t){if(_s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return _s.bridge.is_verify_success?(gs()&&gs().postMessage(JSON.stringify({callType:"app_h5_track",data:hs.extend({server_url:_s.para.server_url},e.data)})),hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e):_s.para.app_js_bridge.is_send?(_s.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function cn(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||_s.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?hs.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:gs()&&gs().postMessage(JSON.stringify(e)):null}function dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fn(e,t,r){return dn(e,t,r),e.plugin_version=Es,e}function gn(){if(vs&&!vs.bridge.activeBridge&&_n()){if(vs.bridge.activeBridge=Ls,vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:hn()?"success":"fail"},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:90,entry:mn}}),bs("IOS obsolete bridge inits succeed.")}}function _n(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function hn(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=ys.URL(vs.para.server_url).hostname,r=ys.URL(vs.para.server_url).searchParams.get("project")||"default"}catch(n){vs.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function mn(e,t){function r(e){var t=JSON.stringify(ys.extend({server_url:vs.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(vs.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,ys.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(ys.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bn(e,t,r){return vn(e,t,r),e.plugin_version=Rs,e}function wn(){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=Hs}function Sn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return kn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o); -}}return e}function kn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Pn(e,t,r){return Sn(e,t,r),e.plugin_version=qs,e}function Cn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function On(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function In(e,t,r){return Nn(e,t,r),e.plugin_version=Ws,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return An(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function An(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dn(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function $n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function xn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return En(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function En(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ln(e,t,r){return xn(e,t,r),e.plugin_version=rl,e}function Un(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Rn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Rn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Bn(e,t,r){return Un(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Mn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function qn(){kl=!0}function Kn(){kl=!1}function Fn(){return kl}function Vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zn(e,t,r){return Vn(e,t,r),e.plugin_version=Nl,e}function Xn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Zn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback,Xn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Gn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Qn(){al.on("sdkInitPara",function(){Gn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Zn}})})}function Yn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ei(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ei(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ti(e,t,r){return Yn(e,t,r),e.plugin_version=Tl,e}function ri(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ni(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ii),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ri}})})}function ii(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function si(e,t,r){return ai(e,t,r),e.plugin_version=$l,e}function li(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fi(e,t,r){return di(e,t,r),e.plugin_version=Ul,e}function gi(e){var t=new pl.BeaconSend(e);t.start()}function _i(e,t){var r=null,n=null;pl.isObject(e.config)&&(r=e.config.send_type,n=pl.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===dl.para.send_type;if(i&&pl.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=dl.kit.encodeTrackData(e.data),pl.isArray(a)&&a.length?pl.each(a,function(t){e.callback=null,e.server_url=t,gi(e)}):"string"==typeof a&&""!==a?gi(e):dl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function hi(){"beacon"!==dl.para.send_type||pl.isSupportBeaconSend()||(dl.para.send_type="image")}function mi(){dl.on("sdkInitPara",function(){hi()}),dl.on("sdkAfterInitPara",function(){dl.registerInterceptor("sendDataStage",{send:{priority:110,entry:_i}})})}function vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bi(e,t,r){return vi(e,t,r),e.plugin_version=Hl,e}function wi(e){var t=new gl.AjaxSend(e);t.start()}function Si(e,t){var r=null,n=null;gl.isObject(e.config)&&(r=e.config.send_type,n=gl.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===fl.para.send_type;if(i&&gl.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=fl.kit.encodeTrackData(e.data),gl.isArray(a)&&a.length?gl.each(a,function(t){e.callback=null,e.server_url=t,wi(e)}):"string"==typeof a&&""!==a?wi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function ki(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function Pi(){fl.on("sdkInitPara",function(){ki()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:Si}})})}function Ci(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ni(e,t,r){return Ci(e,t,r),e.plugin_version=ql,e}function ji(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function Ii(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=null;hl.isObject(e.config)&&(r=hl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,hl.isArray(n)&&n.length?hl.each(n,function(t){t&&(e.data=ji(t,i),e.callback=null,e.server_url=t,Ii(e))}):"string"==typeof n&&""!==n?(e.data=ji(n,i),Ii(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ai(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function Di(){_l.on("sdkInitPara",function(){Ai()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function $i(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ei(e,t,r){return $i(e,t,r),e.plugin_version=_a,e}function Li(e){return null===zl?void Ui(e):void zl.push(e)}function Ui(e){try{if("log"===e.level&&Ri())return void Ji(e);if("warn"===e.level&&Bi())return void Ji(e);if("error"===e.level&&Hi())return void Ji(e)}catch(t){}}function Ri(){return!!Fi()||Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level}function Bi(){return!!Fi()||Ri()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level}function Hi(){return!!Fi()||!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level}function Ji(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Mi(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Mi(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function Ki(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Fi(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Vi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new d((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new d((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new d((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var p,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),p=5==n.a.length&&1===n.a[0],p&&(a(function(){p=!f('"\t"')}),p&&a(function(){p=1!==f("01")}),p&&a(function(){p=1!==f("1.")})))},function(){p=!1}),t=p}}return o[e]=!!t}function s(e){return D(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,d=n.Date||r.Date,p=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new d((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T="000000",A=function(e,t){return(T+(t||0)).slice(-e)},D=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],p=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;p(r+1,0)<=i;r++);for(n=c((i-p(r,0))/30.42);p(r,n+1)<=i;n++);i=1+i-p(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(D=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+A(6,r<0?-r:r):A(4,r))+"-"+A(2,n+1)+"-"+A(2,i)+"T"+A(2,o)+":"+A(2,s)+":"+A(2,l)+"."+A(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var $=i.stringify;i.stringify=function(e,t,r){var n=d.prototype.toJSON;d.prototype.toJSON=s;var i=$(e,t,r);return d.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=I[t];return r?r:x+A(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,p,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===d.prototype.toJSON?l=D(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),p=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,B));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++B);e+=a.slice(t,B)}if(34==a.charCodeAt(B))return B++,e;q();default:if(t=B,45==i&&(n=!0,i=a.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(B+1),i>=48&&i<=57)&&q(),n=!1;B=48&&i<=57);B++);if(46==a.charCodeAt(B)){for(r=++B;r57));r++);r==B&&q(),B=r}if(i=a.charCodeAt(B),101==i||69==i){for(i=a.charCodeAt(++B),43!=i&&45!=i||B++,r=B;r57));r++);r==B&&q(),B=r}return+a.slice(t,B)}n&&q();var s=a.slice(B,B+4);if("true"==s)return B+=4,!0;if("fals"==s&&101==a.charCodeAt(B+4))return B+=5,!1;if("null"==s)return B+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return B=0,H=""+e,r=F(K()),"$"!=K()&&q(),B=H=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Wi,zi={setup:function(e){Wi=e},log:function(){(Wi||console&&console.log||function(){}).apply(null,arguments)}},Xi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Xi.get(e))||null}catch(r){zi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){zi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Xi.set(t,r),Xi.get(t)!==r&&(e=!1),Xi.remove(t)}catch(n){e=!1}return e}},Zi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Xi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Xi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Xi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Xi.get(e)),Xi.remove(e),Xi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Xi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Xi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Xi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Xi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.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=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Qi=function(e){this.ele=e},Yi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Qi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){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),y(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||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=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 Yi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Yi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},ka={checkIsAddSign:function(e){"track"===e.type&&(Re()?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,n=va.get("sensorsdata2015jssdkcross"+Vi.para.sdk_id);n=Vi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Vi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Vi.para.encrypt_cookie&&(i=Vi.kit.userEncrypt(i)),va.set("sensorsdata2015jssdkcross"+Vi.para.sdk_id,i,null,!0)),Vi.para.is_track_device_id&&(wa.currentProps.$device_id=r)},storeInitCheck:function(){if(Vi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};va.isSupport()?va.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):Sa.set(Sa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(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)}}},Pa=function(){this._events=[],this.pendingEvents=[]};Pa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(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():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Ca={},Oa=new l;Ca.spa=Oa,Ca.sdk=new l,Ca.data=new l,Ca.initSystemEvent=function(){Ye(function(e){Oa.emit("switch",e)})},Ca.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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var Na=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};Na.prototype.start=function(){var e=this,t=new Date;Ze({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(r,n){Ca.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){Ca.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},Na.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var ja="sawebjssdk-",Ia="tab-sawebjssdk-";tt.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()},pa.batch_send.send_interval)},getServerUrl:function(){return d(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),Xi.remove(e[n])}r=Ce(r),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=ja+String(n()),a=Xi.get(this.tabKey);null===a?(this.tabKey=Ia+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,Xi.set(this.tabKey,JSON.stringify(a)),Vi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Ia+String(n()),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var d=new a(n);d.get(s,r,1e3,function(e){if(e){null===Xi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Xi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Xi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var p=i(Xi.get(s))||{expireTime:0};t()-p.expireTime>r&&Xi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!d(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!d(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=xa._state.history_login_id;return!(t&&t.name&&t.name===e||re(this.bindReservedNames,e)>-1)}},Ua={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ea[n])&&Ea[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ea[n])&&Ea[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ea[n])&&Ea[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){rt({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ea[i])&&Ea[i](n)),!0};rt({propertyValue:t},n)}):La.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ea[n])&&Ea[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ea[n])&&Ea[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=p(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ra.configIsMatchNew=function(e,t){if(d(e.$element_selector)&&d(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 e.$element_selector.indexOf(t.element_selector)>-1}if(d(e.$element_path)&&d(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 e.$element_path.indexOf(t.element_path)>-1}return!1},Ra.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"]?Ra.configIsMatchNew(e,t):Ra.configIsMatchOldVersion(e,t))},Ra.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(Ra.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},Ra.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ra.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ra.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ra.getPropElInLi=function(e,t){if(!(e&&_(e)&&d(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Vi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ra.getProp=function(e,t){if(!r(e))return!1;if(!(d(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(d(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!d(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Vi.heatmap.getClosestLi(s);o=Ra.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!d(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ra.getAssignConfigs=function(e,t){var n=Ra.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ba={events:[],getAssignConfigs:Ra.getAssignConfigs,filterConfig:Ra.filterConfig,getProp:Ra.getProp,initUrl:Ra.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),d(a.event_name)&&n.push(a.event_name))}),Vi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Vi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Vi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ha={events:[],customProp:Ba,getAssignConfigs:Ra.getAssignConfigs,initUrl:Ra.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Vi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Vi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ja={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=qa.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Vi.heatmap.getEleDetail(e);if(!r(t)||!d(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,qa.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ra.getProp,getPropElInLi:Ra.getPropElInLi,filterConfig:Ra.filterConfig},qa={unlimitedDiv:Ja,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ma,initUrl:function(){var e=Ra.initUrl();if(e){var t;try{t=new f(Vi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Vi.para.heatmap)||!Vi.para.heatmap.get_vtrack_config)return!1;if(Xi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=xa.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Vi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Vi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Xa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Xa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(!d(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){var t=function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&d(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null};return t(e,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Vi.heatmap.getClosestLi(e);if(!i||!_(e)||!d(e.tagName))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Vi.is_heatmap_render_mode=!0,Vi.para.heatmap||(Vi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Vi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Vi.para.heatmap_url||(Vi.para.heatmap_url=ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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=We({target:e});r.$element_selector=t?t:"",r.$element_path=Vi.heatmap.getElementPath(e,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);var n=Vi.heatmap.getElementPosition(e,r.$element_path,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Vi.para.heatmap)&&e(Vi.para.heatmap.collect_element)&&!Vi.para.heatmap.collect_element(n))return!1;var s=Xa.getBasicEleInfo(t,n,i,a,o);mt(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Vi.para.heatmap&&Vi.para.heatmap.custom_property){var c=Vi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div?!!(r(Vi.para.heatmap)&&r(Vi.para.heatmap.collect_tags)&&r(Vi.para.heatmap.collect_tags.div)&&v(Vi.para.heatmap.collect_tags.div.ignore_tags)&&re(Vi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Vi.para&&Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Vi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.scroll_notice_map)return!1;var t=!0;Vi.para.scrollmap&&e(Vi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Vi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Vi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Vi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,vt(e)),this.current_time=n}});i.current_time=new Date,Be(window,"scroll",function(){return!!t&&void i.go()}),Be(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.clickmap)&&(e(Vi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Vi.para.heatmap.collect_url()}),"all"===Vi.para.heatmap.collect_elements?Vi.para.heatmap.collect_elements="all":Vi.para.heatmap.collect_elements="interact",void("all"===Vi.para.heatmap.collect_elements?Be(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=d(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):Be(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Vi.heatmap.getTargetElement(a,e);return!(!_(o)&&!d(a.tagName))&&void(_(o)&&d(o.tagName)?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Vi.para.heatmap)&&Vi.para.heatmap.get_vtrack_config&&Ja.events.length>0&&Ja.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"}))})))}},Za={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Vi.log("error: isReady callback must be function")},getUtm:function(){return wa.campaignParams()},getStayTime:function(){return(new Date-Vi._t)/1e3},setProfileLocal:function(e){if(!Xi.isSupport())return Vi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=xa.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(xa.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Vi.setProfile(e))}else xa.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Vi.setProfile(e)},setInitReferrer:function(){var e=$e();Vi.setOnceProfile({_init_referrer:e,_init_referrer_host:wa.pageProp.referrer_host})},setSessionReferrer:function(){var e=$e();xa.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:wa.pageProp.referrer_host})},setDefaultAttr:function(){wa.register({_current_url:location.href,_referrer:$e(),_referring_host:wa.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Vi.para.heatmap&&Vi.para.heatmap.track_attr?Vi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Xa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Xa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Vi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,yt()),t),i=Z()}var i;i=this.autoTrackIsUsed?wa.pageProp.url:wa.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,bt(Vi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=yt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Vi.para.is_single_page&&w(function(){var r=$e(a,!0);Vi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Vi.track("$pageview",P({$referrer:$e(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),bt(Vi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(xa._state)?"SDK is not initialized.":xa.getAnonymousId()},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Vi.modules)&&Vi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Vi.use.apply(Vi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:It,unbind:Tt,trackLink:At,trackLinks:Dt,setItem:$t,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Bt,unsetProfile:Ht,identify:Jt,resetAnonymousIdentity:Mt,trackSignup:Kt,registerPage:Ft,clearAllRegister:Vt,clearPageRegister:Wt,register:zt,registerOnce:Xt,registerSession:Zt,registerSessionOnce:Gt,login:Qt,loginWithKey:Yt,logout:er,getPresetProperties:tr,readyState:Ga,debug:ba,on:et,log:Oe};zi.setup(Oe);var eo=P({},ua,Da),to={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:Vi.para.use_app_track_is_send!==!1&&"only"!==Vi.para.use_app_track,white_list:[],is_mui:"mui"===Vi.para.use_app_track};"object"==typeof Vi.para.app_js_bridge?Vi.para.app_js_bridge=P({},e,Vi.para.app_js_bridge):Vi.para.use_app_track!==!0&&Vi.para.app_js_bridge!==!0&&"only"!==Vi.para.use_app_track&&"mui"!==Vi.para.use_app_track||(Vi.para.app_js_bridge=P({},e)),Vi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Vi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ar};nr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),ir(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},nr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},nr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),ir(r)},or.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Vi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==V(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=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Xa.setNotice(n),aa.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Vi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Vi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Vi.heatmap_version&&Vi.heatmap_version===Vi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Vi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Xa.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=d(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&d(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return d(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Xa.setNotice(i),aa.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(lr("sa-visual-mode")===!0||"true"===lr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Vi.para.vtrack_url?Vi.para.vtrack_url:ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vtrack.min.js"})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(aa.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var t=e.data.data.userURL;d(t)&&(window.location.href=encodeURI(t.replace(/javascript:/i,"")))}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:_a}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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){}};vr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new mr(t,n,Vi),a=0;a=2)&&(wo&&(Or(!0),_r()),Ca.initSystemEvent(),Vi.setInitVar(),Vi.readyState.setState(2),Vi.initPara(e),Ca.sdk.emit("initPara"),Ca.sdk.emit("afterInitPara"),Ca.sdk.emit("initAPI"),Ca.sdk.emit("afterInitAPI"),Vi.detectMode(),rr(),Ca.sdk.emit("afterInit"),void Ca.sdk.emit("ready"))},wo?Or(!1):(Or(!0),_r());var So,ko,Po,Co,Oo,No,jo,Io,To,Ao,Do,$o,xo,Eo,Lo,Uo,Ro,Bo,Ho="1.26.8",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=Ir(Jo),qo="1.26.8",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=Dr(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:$r,visualized_track:xr,page_info:xr,sensorsdata_get_app_visual_config:Er}},Go="1.26.8",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Br()},handleCommand:Jr},Yo=Rr(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Mr,visualized_track:qr,page_info:qr,sensorsdata_get_app_visual_config:Kr}},as="1.26.8",os={init:function(e){Do=e,$o=Do&&Do._,xo=Do&&Do.log||console&&console.log||function(){},zr()},handleCommand:Zr},ss=Wr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.26.8",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Ts.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Ts.data=e,Ts.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Ts.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Is(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(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=ps().visibilityChange,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},As=rn(Ts,"Deeplink","sdkReady"),Ds="1.26.8",$s={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},ln()},handleCommand:cn},xs=sn($s,"IOSBridge","sdkAfterInitPara"),Es="1.26.8",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},gn()}},Us=fn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.26.8",Bs=5e3,Hs=432e3;wn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},wn.prototype.log=function(e){this.sd&&this.sd.log(e)},wn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Bs)},wn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},wn.prototype.pageStartHandler=function(){this.start_time=+new Date,1==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},wn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&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()}},wn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},wn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},wn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||"string"!=typeof e||""===e||this.option.isCollectUrl(e)},wn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},wn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},wn.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()}})},wn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},wn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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()},wn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},wn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},wn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},wn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},wn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new wn,Ms=bn(Js,"PageLeave","sdkReady"),qs="1.26.8",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=Pn(Fs,"PageLoad","sdkReady");On.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Cn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.26.8";On.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new On,Gs=In(Zs),Qs="1.26.8",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=$n,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=Dn(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.26.8",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var p=u.indexOf("?");a=p>-1?o>-1?s+l+"#"+u.substring(1,o)+d(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+d(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,dl,pl,fl,gl,_l,hl,ml=Ln(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.26.8",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Bn(bl,"Utm","sdkAfterInitPara"),Sl="1.26.8",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=qn,Pl.enableSDK=Kn,Pl.getDisabled=Fn}},Ol=Mn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.26.8",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Qn()}},Il=zn(jl),Tl="1.26.8",Al={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ni()}},Dl=ti(Al),$l="1.26.8",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ci()}},Ll=si(El),Ul="1.26.8",Rl={plugin_name:"BeaconSender",init:function(e){dl=e,pl=dl._,mi()}},Bl=fi(Rl),Hl="1.26.8",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,Pi()}},Ml=bi(Jl),ql="1.26.8",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,Di()}},Fl=Ni(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Li),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("http://modernizr.com/"),"http://modernizr.com/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{d(e)||(e=String(e)),e=p(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void zi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new Qi(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(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){zi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(ea&&e.forEach===ea)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){zi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(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 j(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}function I(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(p){zi.log(p)}n&&d()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function T(e){return k(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 A(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function D(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=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,na.set(t,"true",0,null,r,"; domain="+a),document.cookie.indexOf(t+"=true")!==-1)return na.set(t,"true","-1s",null,r,"; domain="+a),a;return""}function J(e){function t(e,t){e=p(e);var r;if("body"===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 o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){zi.log(o)}return i&&_(i)?r(i):null}if(!d(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=p(e.textContent):e.innerText&&(r=p(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 q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){zi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=u(e);var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);return null===i||i&&"string"!=typeof i[1]&&i[1].length?"":u(i[1])}function V(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){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(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){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 Z(e){return d(e)?(e=p(e),A(e)):A(location.href)}function G(e){return d(e)?(e=p(e),A(e)):A(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function pe(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!d(t.callbackName))return zi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(i.appendChild(n),ce(t.timeout)&&(a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){zi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){zi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var s=[];k(t.data,function(e,t){s.push(t+"="+e)}),t.data=s.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){zi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=t.url}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.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;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.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 he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,d)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else d(i)||ce(i)||$(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function it(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function at(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function ot(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))ot(e[a]);else if(d(i)){if(re(n,a)>-1)return;e[a]=it(i,re(t,a)>-1?1024:pa.max_string_length)}})}function st(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function lt(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};rt({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};rt({item_id:n},i)}}function ut(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&rt({propertyKey:n},i)})}function ct(e){var t=e.properties;ye(e),r(t)?(nt(t),at(t),st(e),ut(t),ot(t)):"properties"in e&&(e.properties={}),lt(e)}function dt(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function pt(e,t){try{var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,xa.getIdentities());var a={identities:i,distinct_id:xa.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,xa.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),"$UnbindID"===a.event&&(a.login_id&&delete a.login_id,a.anonymous_id&&delete a.anonymous_id),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},Pa.properties(),xa.getProps(),xa.getSessionProps(),Pa.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!d(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!d(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&d(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&d(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!d(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!d(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!d(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),d(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&$(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ha.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=qa.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),ba.checkIsAddSign(a),ba.checkIsFirstTime(a),Fe(a),Ve(a),a}catch(o){return{_debug_web_msg:String(o)}}}function ft(e){return Fa.stage.process("basicProps",e)}function gt(e){return Fa.stage.process("formatData",e)}function _t(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&De(e.ele,"click",function(e){i(e)}))))}function ht(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function mt(e){return Wa.stage.process("webClickEvent",e)}function vt(e){return Wa.stage.process("webStayEvent",e)}function yt(){var e=Pa.campaignParams(),t={};return k(e,function(e,r,n){(" "+Vi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function bt(e,t,r){if(Vi.is_first_visitor&&r){var n={};Vi.para.preset_properties.search_keyword_baidu&&Ue(document.referrer)&&$e()&&(n.$search_keyword_id=Sa.id(),n.$search_keyword_id_type=Sa.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=Le(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:d(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:d(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:He(),$first_search_keyword:Re()},yt(),n)),Vi.is_first_visitor=!1}}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=xa.getFirstId(),s=xa.getOriginDistinctId();if(!rt({distinct_id:n}))return je("login id is invalid"),!1;if(n===xa.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"),!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(a)&&n===xa._state.first_id)return!1; +var l=xa._state.history_login_id.name!==a||n!==xa._state.history_login_id.value;if(l){xa._state.identities[a]=n,xa.set("history_login_id",{name:a,value:n}),o||xa.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:xa._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];xa._state.identities=t,xa.save()}function kt(e,t){if(!rt({unbindKey:e,bindValue:t}))return!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(e)&&xa._state.identities[e]===t){var n=xa.getUnionId().login_id;n&&e+"+"+t===n&&(xa._state.distinct_id=xa._state.first_id,xa._state.first_id="",xa.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete xa._state.identities[e],xa.save())}var i={};return i[e]=t,i}function Pt(){Vi._t=Vi._t||1*new Date,Vi.is_first_visitor=!1,Vi.source_channel_standard=ga}function Ct(e){P(pa,e||Vi.para||{}),Vi.para=pa;var t={};if(r(Vi.para.is_track_latest))for(var n in Vi.para.is_track_latest)t["latest_"+n]=Vi.para.is_track_latest[n];Vi.para.preset_properties=P({},fa.preset_properties,t,Vi.para.preset_properties||{});var i;for(i in fa)void 0===Vi.para[i]&&(Vi.para[i]=fa[i]);"string"!=typeof Vi.para.web_url||"://"!==Vi.para.web_url.slice(0,3)&&"//"!==Vi.para.web_url.slice(0,2)||("://"===Vi.para.web_url.slice(0,3)?Vi.para.web_url=location.protocol.slice(0,-1)+Vi.para.web_url:Vi.para.web_url=location.protocol+Vi.para.web_url),ka.protocol.serverUrl(),Vi.bridge&&Vi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Vi.para.source_type&&(Vi.para.source_type.utm=v(Vi.para.source_type.utm)?Vi.para.source_type.utm.concat(a):a,Vi.para.source_type.search=v(Vi.para.source_type.search)?Vi.para.source_type.search.concat(o):o,Vi.para.source_type.social=v(Vi.para.source_type.social)?Vi.para.source_type.social.concat(s):s,Vi.para.source_type.keyword=r(Vi.para.source_type.keyword)?P(l,Vi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Vi.para.heatmap&&!r(Vi.para.heatmap)&&(Vi.para.heatmap={}),r(Vi.para.heatmap)){Vi.para.heatmap.clickmap=Vi.para.heatmap.clickmap||"default",Vi.para.heatmap.scroll_notice_map=Vi.para.heatmap.scroll_notice_map||"default",Vi.para.heatmap.scroll_delay_time=Vi.para.heatmap.scroll_delay_time||4e3,Vi.para.heatmap.scroll_event_duration=Vi.para.heatmap.scroll_event_duration||18e3,Vi.para.heatmap.renderRefreshTime=Vi.para.heatmap.renderRefreshTime||1e3,Vi.para.heatmap.loadTimeout=Vi.para.heatmap.loadTimeout||1e3,Vi.para.heatmap.get_vtrack_config!==!0&&(Vi.para.heatmap.get_vtrack_config=!1);var d=v(Vi.para.heatmap.track_attr)?U(Vi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),Vi.para.heatmap.track_attr=d,r(Vi.para.heatmap.collect_tags))if(Vi.para.heatmap.collect_tags.div===!0)Vi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Vi.para.heatmap.collect_tags.div)){if(Vi.para.heatmap.collect_tags.div.ignore_tags?v(Vi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Vi.para.heatmap.collect_tags.div.ignore_tags=c):Vi.para.heatmap.collect_tags.div.ignore_tags=c,Vi.para.heatmap.collect_tags.div.max_level){var p=[1,2,3];re(p,Vi.para.heatmap.collect_tags.div.max_level)===-1&&(Vi.para.heatmap.collect_tags.div.max_level=1)}}else Vi.para.heatmap.collect_tags.div=!1;else Vi.para.heatmap.collect_tags=u}Vi.para.server_url=Ge(Vi.para.server_url),Vi.para.noCache===!0?Vi.para.noCache="?"+(new Date).getTime():Vi.para.noCache="",Vi.para.callback_timeout>Vi.para.datasend_timeout&&(Vi.para.datasend_timeout=Vi.para.callback_timeout),Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&r(Vi.para.heatmap.collect_tags)&&k(Vi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Vi.heatmap.otherTags.push(t)}),Vi.para.heatmap&&"default"===Vi.para.heatmap.clickmap&&Vi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Za[t]?Za[t].apply(Za,r):void("function"==typeof t?t.apply(Vi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Vi,n),a.plugin_is_init=!0,Vi.modules=Vi.modules||{},Vi.modules[a.plugin_name||"unnamed_"+Qa++]=a,a}if(!d(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Vi.modules&&Vi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return d(t)&&(r(Vi.modules)&&r(Vi.modules[t])?a=Vi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Vi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){rt({event:e,properties:t})&&Va.send({type:"track",event:e,properties:t},r)}function It(e,t){return!!rt({bindKey:e,bindValue:t})&&(xa._state.identities[e]=t,xa.save(),void Va.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function Tt(e,t){var r=kt(e,t);r&&Va.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function At(e,t,r){"object"==typeof e&&e.tagName?_t({ele:e},t,r,Vi.track):"object"==typeof e&&e.target&&e.event&&_t(e,t,r,Vi.track)}function Dt(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&!(!e.href||/^javascript/.test(e.href)||e.target)&&void De(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Vi.track(t,r,i)})}function $t(e,t,r){rt({item_type:e,item_id:t,properties:r})&&Va.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){rt({item_type:e,item_id:t})&&Va.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set",properties:e},t)}function Lt(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){rt({propertiesMust:e})&&(k(e,function(t,r){d(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Va.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;d(e)&&(e={},e[n]=1),rt({propertiesMust:e})&&(r(e)?Va.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Bt(e){Va.send({type:"profile_delete"},e),xa.set("distinct_id",Gi()),xa.set("first_id","")}function Ht(e,t){var r=e,n={};d(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){d(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Va.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e){"number"==typeof e&&(e=String(e));var t=xa.getFirstId();if("undefined"==typeof e){var r=Gi();t?xa.set("first_id",r):xa.set("distinct_id",r)}else rt({distinct_id:e})&&(t?xa.set("first_id",e):xa.set("distinct_id",e))}function Mt(e){var t=xa.getFirstId();if(t)return je("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),"undefined"==typeof e){var r=Gi();xa._state.identities.$identity_cookie_id=r,xa.set("distinct_id",r)}else rt({distinct_id:e})&&(xa._state.identities.$identity_cookie_id=e,xa.set("distinct_id",e))}function qt(e,t,r,n){var i=xa.getFirstId()||xa.getDistinctId();xa.set("distinct_id",e),Va.send({original_id:i,distinct_id:xa.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function Kt(e,t,r,n){"number"==typeof e&&(e=String(e)),rt({distinct_id:e,event:t,properties:r})&&qt(e,t,r,n)}function Ft(e){rt({properties:e})?P(Pa.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Vt(e){xa.clearAllProps(e)}function Wt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Vi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vapph5define.min.js"})}else t();else t()}function cr(t){Vi.para.is_track_single_page&&Oa.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){Pa.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Vi.quick&&Vi.quick("autoTrack",i)}};if("boolean"==typeof Vi.para.is_track_single_page)i();else if("function"==typeof Vi.para.is_track_single_page){var a=Vi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function dr(){Vi._q&&v(Vi._q)&&Vi._q.length>0&&k(Vi._q,function(e){Vi[e[0]].apply(Vi,Array.prototype.slice.call(e[1]))}),r(Vi.para.heatmap)&&(Xa.initHeatmap(),Xa.initScrollmap())}function pr(){Vi.readyState.setState(3),new Vi.SDKJSBridge("visualized").onAppNotify(function(){ur("undefined"!=typeof sa_jssdk_app_define_mode)}),ur(!1),Vi.bridge.app_js_bridge_v1(),Pa.initPage(),cr(),xa.init(),sr(),gr(),Vi.readyState.setState(4),dr()}function fr(){ro.isSeachHasKeyword()?ro.hasKeywordHandle():window.parent!==self&&no.isSearchHasKeyword()?no.verifyVtrackMode():ro.isWindowNameHasKeyword()?ro.windowNameHasKeywordHandle():ro.isStorageHasKeyword()?ro.storageHasKeywordHandle():window.parent!==self&&no.isStorageHasKeyword()?no.verifyVtrackMode():(pr(),no.notifyUser())}function gr(){qa.init(),"success"===Vi.bridge.bridge_info.verify_success&&Ha.init()}function _r(){k(io,function(t){var r=Vi[t];Vi[t]=function(){return Vi.readyState.state<3?(v(Vi._q)||(Vi._q=[]),Ne("calling sdk api before init is deprecated."),Vi._q.push([t,arguments]),!1):e(Vi.getDisabled)&&Vi.getDisabled()?void 0:Vi.readyState.getState()?r.apply(Vi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function hr(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 mr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new hr,this.sensors=r}function vr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function yr(e){e&&e.buildDataStage&&so.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&po.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&uo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&go.registerStageImplementation(e.viewStage)}function br(e,t){_o[e]&&_o[e](t)}function wr(){return ho.stage&&ho.stage.process("getUtmData")}function Sr(e){return mo.stage.process("send",e)}function kr(e){e.kit=vo,e.saEvent=Va,this.buildDataStage=Fa,this.sendDataStage=mo,this.businessStage=ho}function Pr(e){e.heatmap=Xa,this.viewStage=Wa}function Cr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};br("buildDataStage",r)}function Or(e){e&&(Vi.events=$a,Vi.bridge=to,Vi.SDKJSBridge=nr,Vi.JSBridge=or,Vi.store=xa,Vi.unlimitedDiv=Ja,Vi.customProp=Ma,Vi.vtrackcollect=qa,Vi.vapph5collect=Ha,Vi.detectMode=fr,Vi.registerFeature=yr,Vi.registerInterceptor=br,Vi.commonWays=Za,yr(new kr(Vi)),yr(new Pr(Vi)),br("viewStage",yo));var t=e?Ya:ao;for(var r in t)Vi[r]=t[r];Vi.logger=da,Vi.log=Oe,Vi._=eo,Vi.on=et,Vi.ee=Ca,Vi.use=Nt,Vi.lib_version=_a,Vi.registerPropertyPlugin=Cr}function Nr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ir(e,t,r){return Nr(e,t,r),e.plugin_version=Ho,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ar(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ar(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dr(e,t,r){return Tr(e,t,r),e.plugin_version=qo,e}function $r(e){return zo&&zo.call(Vo,JSON.stringify(e))}function xr(e){return Wo.call(Vo)&&Xo&&Xo.call(Vo,JSON.stringify(e))}function Er(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Lr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ur(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ur(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rr(e,t,r){return Lr(e,t,r),e.plugin_version=Go,e}function Br(){if(So=window.SensorsData_APP_New_H5_Bridge,ko=So&&So.sensorsdata_track,Po=ko&&So.sensorsdata_get_server_url&&So.sensorsdata_get_server_url(),No("---test---fail---",!Co,Co.bridge.activeBridge,!Po),Co&&!Co.bridge.activeBridge&&Po)return Co.bridge.activeBridge=Qo,Co.para.app_js_bridge&&!Co.para.app_js_bridge.is_mui&&(Co.bridge.is_verify_success=Po&&Co.bridge.validateAppUrl(Po),No("---test---bridge-verify-",Co.bridge.is_verify_success)),Co.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:Co.bridge.is_verify_success?"success":"fail",support_two_way_call:!!So.sensorsdata_js_call_app},Co.para.app_js_bridge?void Co.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}):void No("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function Hr(e,t){if(No("---test---datasend-",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return Co.bridge.is_verify_success?(No("---test---bridge-verify-success---",e.data),ko&&ko.call(So,JSON.stringify(Oo.extend({server_url:Co.para.server_url},e.data))),Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(No("---test---bridge-verify-fail-----",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_send?(Co.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e))}function Jr(e){var t=e.callType;return t in Zo.commands?Zo.commands[t](e,So):void(So&&Oo.isFunction(So.sensorsdata_js_call_app)&&So.sensorsdata_js_call_app(JSON.stringify(e)))}function Mr(e){return rs&&rs.call(es,JSON.stringify(e))}function qr(e){return ts.call(es)&&ns&&ns.call(es,JSON.stringify(e))}function Kr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Fr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wr(e,t,r){return Fr(e,t,r),e.plugin_version=as,e}function zr(){if(xo("ObsoleteBridge---test---init---"),jo=window.SensorsData_APP_JS_Bridge,Io=jo&&jo.sensorsdata_track,To=jo&&jo.sensorsdata_verify,Ao=jo&&jo.sensorsdata_visual_verify,xo("ObsoleteBridge-",Do.bridge.activeBridge,To,Io,Ao),Do&&!Do.bridge.activeBridge&&(To||Io||Ao)){Do.bridge.activeBridge=os;var e=To||Io;if(Ao&&(e=!!Ao.call(jo,JSON.stringify({server_url:Do.para.server_url})),xo("ObsoleteBridge---called-return",e)),Do.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Do.para.app_js_bridge)return void xo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Do.registerInterceptor("sendDataStage",{send:{priority:80,entry:Xr}}),xo("Android obsolete bridge inits succeed.")}}function Xr(e,t){if(xo("ObsoleteBridge---senddata"),Do.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(To){var n=To&&To.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data)));return xo("ObsoleteBridge---anVerify-success",n),n?($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Do.para.app_js_bridge.is_send?(Do.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return xo("ObsoleteBridge---is-send-old-way",Do.para.app_js_bridge.is_send),Io&&Io.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data))),$o.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Zr(e){xo("ObsoleteBridge---handleCommadn");var t=e.callType;return t in is.commands?(xo("ObsoleteBridge---",t,is.commands),is.commands[t](e,jo)):jo&&$o.isFunction(jo.sensorsdata_js_call_app)?(xo("ObsoleteBridge---handleCommadn-abridge"),jo.sensorsdata_js_call_app(JSON.stringify(e))):void 0}function Gr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Qr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Qr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Yr(e,t,r){return Gr(e,t,r),e.plugin_version=ls,e}function en(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return tn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function tn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function rn(e,t,r){return en(e,t,r),e.plugin_version=ds,e}function nn(){return"undefined"!=typeof Bo&&document[Bo]}function an(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return on(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function on(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function sn(e,t,r){return an(e,t,r),e.plugin_version=Ds,e}function ln(){if(fs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,gs=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},_s&&!_s.bridge.activeBridge&&gs()&&gs().postMessage){if(_s.bridge.activeBridge=$s,_s.para.app_js_bridge&&!_s.para.app_js_bridge.is_mui&&(_s.bridge.is_verify_success=fs&&_s.bridge.validateAppUrl(fs)),_s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_s.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!_s.para.app_js_bridge)return void ms("app_js_bridge is not configured, data will not be sent by iOS bridge.");_s.registerInterceptor("sendDataStage",{send:{priority:70,entry:un}}),ms("IOS bridge inits succeed.")}}function un(e,t){if(_s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return _s.bridge.is_verify_success?(gs()&&gs().postMessage(JSON.stringify({callType:"app_h5_track",data:hs.extend({server_url:_s.para.server_url},e.data)})),hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e):_s.para.app_js_bridge.is_send?(_s.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function cn(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||_s.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?hs.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:gs()&&gs().postMessage(JSON.stringify(e)):null}function dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fn(e,t,r){return dn(e,t,r),e.plugin_version=Es,e}function gn(){if(vs&&!vs.bridge.activeBridge&&_n()){if(vs.bridge.activeBridge=Ls,vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:hn()?"success":"fail"},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:90,entry:mn}}),bs("IOS obsolete bridge inits succeed.")}}function _n(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function hn(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=ys.URL(vs.para.server_url).hostname,r=ys.URL(vs.para.server_url).searchParams.get("project")||"default"}catch(n){vs.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function mn(e,t){function r(e){var t=JSON.stringify(ys.extend({server_url:vs.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(vs.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,ys.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(ys.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bn(e,t,r){return vn(e,t,r),e.plugin_version=Rs,e}function wn(){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=Hs}function Sn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return kn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function kn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n); +}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Pn(e,t,r){return Sn(e,t,r),e.plugin_version=qs,e}function Cn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function On(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function In(e,t,r){return Nn(e,t,r),e.plugin_version=Ws,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return An(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function An(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dn(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function $n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function xn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return En(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function En(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ln(e,t,r){return xn(e,t,r),e.plugin_version=rl,e}function Un(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Rn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Rn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Bn(e,t,r){return Un(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Mn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function qn(){kl=!0}function Kn(){kl=!1}function Fn(){return kl}function Vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zn(e,t,r){return Vn(e,t,r),e.plugin_version=Nl,e}function Xn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Zn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback,Xn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Gn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Qn(){al.on("sdkInitPara",function(){Gn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Zn}})})}function Yn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ei(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ei(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ti(e,t,r){return Yn(e,t,r),e.plugin_version=Tl,e}function ri(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ni(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ii),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ri}})})}function ii(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function si(e,t,r){return ai(e,t,r),e.plugin_version=$l,e}function li(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fi(e,t,r){return di(e,t,r),e.plugin_version=Ul,e}function gi(e){var t=new pl.BeaconSend(e);t.start()}function _i(e,t){var r=null,n=null;pl.isObject(e.config)&&(r=e.config.send_type,n=pl.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===dl.para.send_type;if(i&&pl.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=dl.kit.encodeTrackData(e.data),pl.isArray(a)&&a.length?pl.each(a,function(t){e.callback=null,e.server_url=t,gi(e)}):"string"==typeof a&&""!==a?gi(e):dl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function hi(){"beacon"!==dl.para.send_type||pl.isSupportBeaconSend()||(dl.para.send_type="image")}function mi(){dl.on("sdkInitPara",function(){hi()}),dl.on("sdkAfterInitPara",function(){dl.registerInterceptor("sendDataStage",{send:{priority:110,entry:_i}})})}function vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bi(e,t,r){return vi(e,t,r),e.plugin_version=Hl,e}function wi(e){var t=new gl.AjaxSend(e);t.start()}function Si(e,t){var r=null,n=null;gl.isObject(e.config)&&(r=e.config.send_type,n=gl.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===fl.para.send_type;if(i&&gl.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=fl.kit.encodeTrackData(e.data),gl.isArray(a)&&a.length?gl.each(a,function(t){e.callback=null,e.server_url=t,wi(e)}):"string"==typeof a&&""!==a?wi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function ki(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function Pi(){fl.on("sdkInitPara",function(){ki()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:Si}})})}function Ci(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ni(e,t,r){return Ci(e,t,r),e.plugin_version=ql,e}function ji(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function Ii(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=null;hl.isObject(e.config)&&(r=hl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,hl.isArray(n)&&n.length?hl.each(n,function(t){t&&(e.data=ji(t,i),e.callback=null,e.server_url=t,Ii(e))}):"string"==typeof n&&""!==n?(e.data=ji(n,i),Ii(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ai(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function Di(){_l.on("sdkInitPara",function(){Ai()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function $i(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ei(e,t,r){return $i(e,t,r),e.plugin_version=_a,e}function Li(e){return null===zl?void Ui(e):void zl.push(e)}function Ui(e){try{if("log"===e.level&&Ri())return void Ji(e);if("warn"===e.level&&Bi())return void Ji(e);if("error"===e.level&&Hi())return void Ji(e)}catch(t){}}function Ri(){return!!Fi()||Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level}function Bi(){return!!Fi()||Ri()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level}function Hi(){return!!Fi()||!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level}function Ji(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Mi(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Mi(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function Ki(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Fi(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Vi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new d((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new d((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new d((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var p,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),p=5==n.a.length&&1===n.a[0],p&&(a(function(){p=!f('"\t"')}),p&&a(function(){p=1!==f("01")}),p&&a(function(){p=1!==f("1.")})))},function(){p=!1}),t=p}}return o[e]=!!t}function s(e){return D(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,d=n.Date||r.Date,p=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new d((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T="000000",A=function(e,t){return(T+(t||0)).slice(-e)},D=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],p=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;p(r+1,0)<=i;r++);for(n=c((i-p(r,0))/30.42);p(r,n+1)<=i;n++);i=1+i-p(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(D=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+A(6,r<0?-r:r):A(4,r))+"-"+A(2,n+1)+"-"+A(2,i)+"T"+A(2,o)+":"+A(2,s)+":"+A(2,l)+"."+A(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var $=i.stringify;i.stringify=function(e,t,r){var n=d.prototype.toJSON;d.prototype.toJSON=s;var i=$(e,t,r);return d.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=I[t];return r?r:x+A(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,p,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===d.prototype.toJSON?l=D(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),p=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,B));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++B);e+=a.slice(t,B)}if(34==a.charCodeAt(B))return B++,e;q();default:if(t=B,45==i&&(n=!0,i=a.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(B+1),i>=48&&i<=57)&&q(),n=!1;B=48&&i<=57);B++);if(46==a.charCodeAt(B)){for(r=++B;r57));r++);r==B&&q(),B=r}if(i=a.charCodeAt(B),101==i||69==i){for(i=a.charCodeAt(++B),43!=i&&45!=i||B++,r=B;r57));r++);r==B&&q(),B=r}return+a.slice(t,B)}n&&q();var s=a.slice(B,B+4);if("true"==s)return B+=4,!0;if("fals"==s&&101==a.charCodeAt(B+4))return B+=5,!1;if("null"==s)return B+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return B=0,H=""+e,r=F(K()),"$"!=K()&&q(),B=H=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Wi,zi={setup:function(e){Wi=e},log:function(){(Wi||console&&console.log||function(){}).apply(null,arguments)}},Xi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Xi.get(e))||null}catch(r){zi.log(r)}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){zi.log(r)}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Xi.set(t,r),Xi.get(t)!==r&&(e=!1),Xi.remove(t)}catch(n){e=!1}return e}},Zi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Xi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Xi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Xi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Xi.get(e)),Xi.remove(e),Xi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Xi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Xi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Xi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Xi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.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=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Qi=function(e){this.ele=e},Yi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Qi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(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,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.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),y(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||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=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 Yi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Yi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},ba={checkIsAddSign:function(e){"track"===e.type&&(Ae()?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(Vi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};va.isSupport()?va.set(Te("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):ya.set(ya.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Ae()||(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)}}},wa=function(){this._events=[],this.pendingEvents=[]};wa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(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():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Sa={data:{},id:function(){return this.data.id?this.data.id:(this.data.id=Ee(),this.data.id)},type:function(){return this.data.type?this.data.type:(this.data.type=xe(),this.data.type)}},ka={distinct_id:function(){},jssdkDebug:function(){},_sendDebug:function(e){},apph5:function(e){var t="app_h5\u6253\u901a\u5931\u8d25-",n={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"},i=e.output,a=e.step,o=e.data||"";"all"!==i&&"console"!==i||Oe(n[a]),("all"===i||"code"===i)&&r(pa.is_debug)&&pa.is_debug.apph5&&(o.type&&"profile"===o.type.slice(0,7)||(o.properties._jssdk_debug_info="apph5-"+String(a)))},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(g(e).protocol!==g(t).protocol)return!1}catch(r){return Ne("\u4e0d\u652f\u6301 _.URL \u65b9\u6cd5"),!1}return!0},serverUrl:function(){d(pa.server_url)&&""!==pa.server_url&&!this.protocolIsSame(pa.server_url,location.href)&&Ne("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){return e!==pa.server_url&&void(d(e)&&""!==e&&!this.protocolIsSame(e,location.href)&&Ne("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"))}}},Pa={initPage:function(){var e=Le(),t=Z(),r=Ie(t);r||ka.jssdkDebug("url_domain\u5f02\u5e38_"+t+"_"+r),this.pageProp={referrer:e,referrer_host:e?q(e):"",url:t,url_host:q(t,"url_host\u53d6\u503c\u5f02\u5e38"),url_domain:r}},pageProp:{},campaignParams:function(){return Vi.kit.getUtmData()},campaignParamsStandard:function(e,t){e=e||"",t=t||"";var r=Pa.campaignParams(),n={},i={};return k(r,function(r,a,o){(" "+ga+" ").indexOf(" "+a+" ")!==-1?n[e+a]=o[a]:i[t+a]=o[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,r={$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:_a};return r},currentProps:{},register:function(e){P(Pa.currentProps,e)}},Ca={},Oa=new l;Ca.spa=Oa,Ca.sdk=new l,Ca.data=new l,Ca.initSystemEvent=function(){Ye(function(e){Oa.emit("switch",e)})},Ca.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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var Na=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};Na.prototype.start=function(){var e=this,t=new Date;Ze({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(r,n){Ca.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){Ca.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},Na.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var ja="sawebjssdk-",Ia="tab-sawebjssdk-";tt.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()},pa.batch_send.send_interval)},getServerUrl:function(){return d(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),Xi.remove(e[n])}r=Ce(r),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=ja+String(n()),a=Xi.get(this.tabKey);null===a?(this.tabKey=Ia+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,Xi.set(this.tabKey,JSON.stringify(a)),Vi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Ia+String(n()),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var d=new a(n);d.get(s,r,1e3,function(e){if(e){null===Xi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Xi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Xi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var p=i(Xi.get(s))||{expireTime:0};t()-p.expireTime>r&&Xi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!d(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!d(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=xa._state.history_login_id;return!(t&&t.name&&t.name===e||re(this.bindReservedNames,e)>-1)}},Ua={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ea[n])&&Ea[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ea[n])&&Ea[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ea[n])&&Ea[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){rt({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ea[i])&&Ea[i](n)),!0};rt({propertyValue:t},n)}):La.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ea[n])&&Ea[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ea[n])&&Ea[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=p(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ra.configIsMatchNew=function(e,t){if(d(e.$element_selector)&&d(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 e.$element_selector.indexOf(t.element_selector)>-1}if(d(e.$element_path)&&d(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 e.$element_path.indexOf(t.element_path)>-1}return!1},Ra.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"]?Ra.configIsMatchNew(e,t):Ra.configIsMatchOldVersion(e,t))},Ra.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(Ra.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},Ra.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ra.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ra.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ra.getPropElInLi=function(e,t){if(!(e&&_(e)&&d(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Vi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ra.getProp=function(e,t){if(!r(e))return!1;if(!(d(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(d(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!d(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Vi.heatmap.getClosestLi(s);o=Ra.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!d(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ra.getAssignConfigs=function(e,t){var n=Ra.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ba={events:[],getAssignConfigs:Ra.getAssignConfigs,filterConfig:Ra.filterConfig,getProp:Ra.getProp,initUrl:Ra.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),d(a.event_name)&&n.push(a.event_name))}),Vi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Vi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Vi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ha={events:[],customProp:Ba,getAssignConfigs:Ra.getAssignConfigs,initUrl:Ra.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Vi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Vi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ja={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=qa.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Vi.heatmap.getEleDetail(e);if(!r(t)||!d(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,qa.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ra.getProp,getPropElInLi:Ra.getPropElInLi,filterConfig:Ra.filterConfig},qa={unlimitedDiv:Ja,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ma,initUrl:function(){var e=Ra.initUrl();if(e){var t;try{t=new f(Vi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Vi.para.heatmap)||!Vi.para.heatmap.get_vtrack_config)return!1;if(Xi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=xa.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Vi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Vi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Xa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Xa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(!d(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){var t=function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&d(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null};return t(e,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Vi.heatmap.getClosestLi(e);if(!i||!_(e)||!d(e.tagName))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Vi.is_heatmap_render_mode=!0,Vi.para.heatmap||(Vi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Vi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Vi.para.heatmap_url||(Vi.para.heatmap_url=ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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=We({target:e});r.$element_selector=t?t:"",r.$element_path=Vi.heatmap.getElementPath(e,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);var n=Vi.heatmap.getElementPosition(e,r.$element_path,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Vi.para.heatmap)&&e(Vi.para.heatmap.collect_element)&&!Vi.para.heatmap.collect_element(n))return!1;var s=Xa.getBasicEleInfo(t,n,i,a,o);mt(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Vi.para.heatmap&&Vi.para.heatmap.custom_property){var c=Vi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div?!!(r(Vi.para.heatmap)&&r(Vi.para.heatmap.collect_tags)&&r(Vi.para.heatmap.collect_tags.div)&&v(Vi.para.heatmap.collect_tags.div.ignore_tags)&&re(Vi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Vi.para&&Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Vi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.scroll_notice_map)return!1;var t=!0;Vi.para.scrollmap&&e(Vi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Vi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Vi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Vi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,vt(e)),this.current_time=n}});i.current_time=new Date,De(window,"scroll",function(){return!!t&&void i.go()}),De(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.clickmap)&&(e(Vi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Vi.para.heatmap.collect_url()}),"all"===Vi.para.heatmap.collect_elements?Vi.para.heatmap.collect_elements="all":Vi.para.heatmap.collect_elements="interact",void("all"===Vi.para.heatmap.collect_elements?De(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=d(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):De(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Vi.heatmap.getTargetElement(a,e);return!(!_(o)&&!d(a.tagName))&&void(_(o)&&d(o.tagName)?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Vi.para.heatmap)&&Vi.para.heatmap.get_vtrack_config&&Ja.events.length>0&&Ja.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"}))})))}},Za={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Vi.log("error: isReady callback must be function")},getUtm:function(){return Pa.campaignParams()},getStayTime:function(){return(new Date-Vi._t)/1e3},setProfileLocal:function(e){if(!Xi.isSupport())return Vi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=xa.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(xa.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Vi.setProfile(e))}else xa.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Vi.setProfile(e)},setInitReferrer:function(){var e=Le();Vi.setOnceProfile({_init_referrer:e,_init_referrer_host:Pa.pageProp.referrer_host})},setSessionReferrer:function(){var e=Le();xa.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:Pa.pageProp.referrer_host})},setDefaultAttr:function(){Pa.register({_current_url:location.href,_referrer:Le(),_referring_host:Pa.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Vi.para.heatmap&&Vi.para.heatmap.track_attr?Vi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Xa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Xa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Vi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,yt()),t),i=Z()}var i;i=this.autoTrackIsUsed?Pa.pageProp.url:Pa.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,bt(Vi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=yt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Vi.para.is_single_page&&w(function(){var r=Le(a,!0);Vi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Vi.track("$pageview",P({$referrer:Le(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),bt(Vi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(xa._state)?"SDK is not initialized.":xa.getAnonymousId()},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Vi.modules)&&Vi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Vi.use.apply(Vi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:It,unbind:Tt,trackLink:At,trackLinks:Dt,setItem:$t,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Bt,unsetProfile:Ht,identify:Jt,resetAnonymousIdentity:Mt,trackSignup:Kt,registerPage:Ft,clearAllRegister:Vt,clearPageRegister:Wt,register:zt,registerOnce:Xt,registerSession:Zt,registerSessionOnce:Gt,login:Qt,loginWithKey:Yt,logout:er,getPresetProperties:tr,readyState:Ga,debug:ka,on:et,log:Oe};zi.setup(Oe);var eo=P({},ua,Da),to={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:Vi.para.use_app_track_is_send!==!1&&"only"!==Vi.para.use_app_track,white_list:[],is_mui:"mui"===Vi.para.use_app_track};"object"==typeof Vi.para.app_js_bridge?Vi.para.app_js_bridge=P({},e,Vi.para.app_js_bridge):Vi.para.use_app_track!==!0&&Vi.para.app_js_bridge!==!0&&"only"!==Vi.para.use_app_track&&"mui"!==Vi.para.use_app_track||(Vi.para.app_js_bridge=P({},e)),Vi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Vi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ar};nr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),ir(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},nr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},nr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),ir(r)},or.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Vi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==F(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=F(e,"sa-request-id")||null,r=F(e,"sa-request-type")||null,n=F(e,"sa-request-url")||null;if(Xa.setNotice(n),aa.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Vi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Vi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Vi.heatmap_version&&Vi.heatmap_version===Vi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Vi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Xa.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=d(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&d(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return d(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Xa.setNotice(i),aa.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(lr("sa-visual-mode")===!0||"true"===lr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Vi.para.vtrack_url?Vi.para.vtrack_url:ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vtrack.min.js"})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(aa.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var t=e.data.data.userURL;d(t)&&(window.location.href=encodeURI(t.replace(/javascript:/i,"")))}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:_a}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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){}};vr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new mr(t,n,Vi),a=0;a=2)&&(wo&&(Or(!0),_r()),Ca.initSystemEvent(),Vi.setInitVar(),Vi.readyState.setState(2),Vi.initPara(e),Ca.sdk.emit("initPara"),Ca.sdk.emit("afterInitPara"),Ca.sdk.emit("initAPI"),Ca.sdk.emit("afterInitAPI"),Vi.detectMode(),rr(),Ca.sdk.emit("afterInit"),void Ca.sdk.emit("ready"))},wo?Or(!1):(Or(!0),_r());var So,ko,Po,Co,Oo,No,jo,Io,To,Ao,Do,$o,xo,Eo,Lo,Uo,Ro,Bo,Ho="1.26.9",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=Ir(Jo),qo="1.26.9",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=Dr(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:$r,visualized_track:xr,page_info:xr,sensorsdata_get_app_visual_config:Er}},Go="1.26.9",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Br()},handleCommand:Jr},Yo=Rr(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Mr,visualized_track:qr,page_info:qr,sensorsdata_get_app_visual_config:Kr}},as="1.26.9",os={init:function(e){Do=e,$o=Do&&Do._,xo=Do&&Do.log||console&&console.log||function(){},zr()},handleCommand:Zr},ss=Wr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.26.9",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"), +!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Ts.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Ts.data=e,Ts.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Ts.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Is(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(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=ps().visibilityChange,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},As=rn(Ts,"Deeplink","sdkReady"),Ds="1.26.9",$s={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},ln()},handleCommand:cn},xs=sn($s,"IOSBridge","sdkAfterInitPara"),Es="1.26.9",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},gn()}},Us=fn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.26.9",Bs=5e3,Hs=432e3;wn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},wn.prototype.log=function(e){this.sd&&this.sd.log(e)},wn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Bs)},wn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},wn.prototype.pageStartHandler=function(){this.start_time=+new Date,1==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},wn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&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()}},wn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},wn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},wn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||"string"!=typeof e||""===e||this.option.isCollectUrl(e)},wn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},wn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},wn.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()}})},wn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},wn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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()},wn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},wn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},wn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},wn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},wn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new wn,Ms=bn(Js,"PageLeave","sdkReady"),qs="1.26.9",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=Pn(Fs,"PageLoad","sdkReady");On.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Cn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.26.9";On.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new On,Gs=In(Zs),Qs="1.26.9",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=$n,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=Dn(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.26.9",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var p=u.indexOf("?");a=p>-1?o>-1?s+l+"#"+u.substring(1,o)+d(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+d(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,dl,pl,fl,gl,_l,hl,ml=Ln(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.26.9",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Bn(bl,"Utm","sdkAfterInitPara"),Sl="1.26.9",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=qn,Pl.enableSDK=Kn,Pl.getDisabled=Fn}},Ol=Mn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.26.9",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Qn()}},Il=zn(jl),Tl="1.26.9",Al={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ni()}},Dl=ti(Al),$l="1.26.9",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ci()}},Ll=si(El),Ul="1.26.9",Rl={plugin_name:"BeaconSender",init:function(e){dl=e,pl=dl._,mi()}},Bl=fi(Rl),Hl="1.26.9",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,Pi()}},Ml=bi(Jl),ql="1.26.9",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,Di()}},Fl=Ni(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Li),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e1)))/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;g(r+1,0)<=i;r++);for(n=c((i-g(r,0))/30.42);g(r,n+1)<=i;n++);i=1+i-g(r,n),s=c((a=(e%864e5+864e5)%864e5)/36e5)%24,o=c(a/6e4)%60,l=c(a/1e3)%60,d=a%1e3}}return(k=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+w(6,r<0?-r:r):w(4,r))+"-"+w(2,n+1)+"-"+w(2,i)+"T"+w(2,s)+":"+w(2,o)+":"+w(2,l)+"."+w(3,d)+"Z",r=n=i=s=o=l=d=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function P(e){return k(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=P;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var I=function(e){var t=e.charCodeAt(0);return $[t]||"\\u00"+w(2,t.toString(16))},j=/[\x00-\x1f\x22\x5c]/g,C=function(e){return j.lastIndex=0,'"'+(j.test(e)?e.replace(j,I):e)+'"'},L=function(e,t,r,n,i,a,s){var o,d,u,p,f,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=k(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==g)return o===g?o:"null";switch("object"==(d=typeof o)&&(u=_.call(o)),u||d){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 C(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw c();if(s.push(o),p=[],y=a,a+=i,"[object Array]"==u){for(h=0,v=o.length;h0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||N();e+=x("0x"+a.slice(t,D));break;default:N()}else{if(34==i)break;for(i=a.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++D);e+=a.slice(t,D)}if(34==a.charCodeAt(D))return D++,e;N();default:if(t=D,45==i&&(n=!0,i=a.charCodeAt(++D)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(D+1))>=48&&i<=57&&N(),n=!1;D=48&&i<=57;D++);if(46==a.charCodeAt(D)){for(r=++D;r57);r++);r==D&&N(),D=r}if(101==(i=a.charCodeAt(D))||69==i){for(43!=(i=a.charCodeAt(++D))&&45!=i||D++,r=D;r57);r++);r==D&&N(),D=r}return+a.slice(t,D)}n&&N();var o=a.slice(D,D+4);if("true"==o)return D+=4,!0;if("fals"==o&&101==a.charCodeAt(D+4))return D+=5,!1;if("null"==o)return D+=4,null;N()}return"$"},U=function(e){var t,r;if("$"==e&&N(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=T());)r?","==e?"]"==(e=T())&&N():N():r=!0,","==e&&N(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=T());)r?","==e?"}"==(e=T())&&N():N():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==T()||N(),t[e.slice(1)]=U(T());return t}N()}return e},R=function(e,t,r){var n=B(e,t,r);n===g?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(_,S,i);else S(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return D=0,E=""+e,r=U(T()),"$"!=T()&&N(),D=E=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;o255||(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>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 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(r){logger.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){logger.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";_localStorage.set(t,r),_localStorage.get(t)!==r&&(e=!1),_localStorage.remove(t)}catch(n){e=!1}return e}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function getRandom(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),isObject(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(r){}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(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),n=0;n Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");for(var a in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function _URL(e){var t,r={};if("function"==typeof window.URL&&function(){try{return"https://www.sensorsdata.cn/"===new URL("https://www.sensorsdata.cn/").href}catch(e){return!1}}())(r=new URL(e)).searchParams||(r.searchParams=(t=getURLSearchParams(r.search),{get:function(e){return t[e]}}));else{if(isString(e)||(e=String(e)),e=trim(e),!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");var n=urlParse(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=getURLSearchParams("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}ConcurrentStorage.prototype.get=function(e,t,r,n){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,n=n||function(){};var i=this.lockGetPrefix+e,a=_localStorage.get(i),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return n(null);_localStorage.set(i,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(i))||{randomNum:0,expireTime:0})&&a.randomNum===s?(n(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(i)):n(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,n,i){if(!e||!t)throw new Error("key and val is must");r=r||1e4,n=n||1e3,i=i||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 i({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)&&i({status:"success"}):i({status:"fail",reason:"This key is locked"})},n)},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 n=0,i=r.length;n=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+t+"-"+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,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()||ry(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||a.target;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 addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(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){logger.log(t)}}}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(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument.documentElement;return{top:e.top+window.pageYOffset-t.clientTop,left:e.left+window.pageXOffset-t.clientLeft}}catch(r){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),ry(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||!isArray(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 siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return ry(e=e&&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(),n=[],i=0;i=200&&r.status<300||304==r.status?e.success(t(r.responseText),r.status):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),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(s){logger.log(s)}r.send(e.data||null)}function map(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(each(e,function(e,n,i){r.push(t(e,n,i))}),r)}function base64Decode(e){var t=[];try{t=map(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 base64Encode(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}function bindReady(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,s=i.addEventListener,o=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",d=s?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](d+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},u=function(){try{a.doScroll("left")}catch(e){return void setTimeout(u,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!s&&a.doScroll){try{n=!t.frameElement}catch(p){logger.log(p)}n&&u()}i[o](d+"DOMContentLoaded",c,!1),i[o](d+"readystatechange",c,!1),t[o](d+"load",c,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,-1!==document.cookie.indexOf(t+"=true")){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function getDomBySelector(e){if(!isString(e))return null;var t,r=e.split(">");return(t=function n(e){var t,i=r.shift();if(!i)return e;try{t=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(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(!(isElement(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l0)return null}return r||null}(i,e)}catch(a){logger.log(a)}return t&&isElement(t)?n(t):null}())&&isElement(t)?t:null}function getElementContent(e,t){var r="",n="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(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 getHostname(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=_URL(e).hostname}catch(n){logger.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}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(t){return""}}function getQueryParamsFromUrl(e){var t={},r=e.split("?")[1]||"";return r&&(t=getURLSearchParams("?"+r)),t}function getQueryParam(e,t){var r=_URL(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;i&&(n=getQueryParamsFromUrl(i)[t]||"")}return n}function mediaQueriesSupported(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function getScreenOrientation(){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(mediaQueriesSupported()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return 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,n=0;n0)for(var i=e.split(""),a=0;at)for(n=r+n;(o=31*n+s)t;)n=n/2+s;n=31*n+s}return n}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function isSupportCors(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(e){if(!isObject(e)||!isString(e.callbackName))return logger.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=isFunction(e.success)?e.success:function(){},e.error=isFunction(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),r=document.getElementsByTagName("head")[0],n=null,i=!1;if(t.defer="defer",r.appendChild(t),isNumber(e.timeout)){var a=Math.min(e.timeout,3e5);n=setTimeout(function(){if(i)return!1;e.error("timeout"),window[e.callbackName]=function(){logger.log("call jsonp error")},n=null,r.removeChild(t),i=!0},a)}if(window[e.callbackName]=function(){clearTimeout(n),n=null,e.success.apply(null,arguments),window[e.callbackName]=function(){logger.log("call jsonp error")},r.removeChild(t)},e.url.indexOf("?")>-1?e.url+="&callbackName="+e.callbackName:e.url+="?callbackName="+e.callbackName,isObject(e.data)){var s=[];each(e.data,function(e,t){s.push(t+"="+e)}),e.data=s.join("&"),e.url+="&"+e.data}t.onerror=function(a){if(i)return!1;window[e.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(n),n=null,r.removeChild(t),e.error(a),i=!0},t.src=encodeURI(e.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"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;addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else 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(""),n=0,i=r.length;nt?(s&&(clearTimeout(s),s=null),o=d,a=e.apply(n,i),s||(n=i=null)):s||!1===r.trailing||(s=setTimeout(l,c)),a}}function values(e){var t=[];return null==e?t:(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=[],n={},i=0;it._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_"+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,n=saCookie.get("sensorsdata2015jssdkcross"+sd.para.sdk_id),i={};null!=(n=sd.kit.userDecryptIfNeeded(n))&&isJSONString(n)&&(i=JSON.parse(n)).$device_id&&(r=i.$device_id),r=r||e,!0===sd.para.cross_subdomain?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),sd.para.encrypt_cookie&&(i=sd.kit.userEncrypt(i)),saCookie.set("sensorsdata2015jssdkcross"+sd.para.sdk_id,i,null,!0)),sd.para.is_track_device_id&&(pageInfo.currentProps.$device_id=r)},storeInitCheck:function(){if(sd.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else 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 n=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t&&(n=!0),addEvent(e,t,r,n)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function getSourceFromReferrer(){function e(e,t){for(var r=0;r20&&this.pendingEvents.shift()},on:function(e,t,r,n){isFunction(t)&&(this._events.push({type:e,callback:t,context:r||this}),n=!1!==n,this.pendingEvents.length>0&&n&&each(this.pendingEvents,function(n){n.type===e&&t.apply(r,n.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var ee={},spa=new EventEmitter;function eventEmitterFacade(e,t){var r=[];"string"==typeof e&&e in ee.EVENT_LIST&&(r=ee.EVENT_LIST[e],ee[r[0]].on(r[1],t))}ee.spa=spa,ee.sdk=new EventEmitter,ee.data=new EventEmitter,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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var AjaxSend=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};AjaxSend.prototype.start=function(){var e=this,t=new Date;ajax$1({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:sdPara.datasend_timeout,cors:!0,success:function(r,n){ee.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:sdPara.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){ee.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:sdPara.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},AjaxSend.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 dataStoragePrefix="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.server_url)&&""!==sdPara.server_url||isArray(sdPara.server_url)&&sdPara.server_url.length))return sdError("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01");this.serverUrl=isArray(sdPara.server_url)?sdPara.server_url[0]:sdPara.server_url},send:function(){if(this.sendTimeStamp&&now()-this.sendTimeStamp-1&&r.splice(i,1),_localStorage.remove(e[n])}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);null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),r=this.generateTabStorageVal()):r=safeJSONParse(r)||this.generateTabStorageVal(),r.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=0;ti.expireTime&&this.serverUrl===i.serverUrl&&new ConcurrentStorage("sajssdk-lock-get-").get(r,1e4,1e3,function(e){if(e){null===_localStorage.get(n.tabKey)&&n.generateTabStorage();var t=safeJSONParse(e)||n.generateTabStorageVal(),r=safeJSONParse(_localStorage.get(n.tabKey))||n.generateTabStorageVal();r.data=unique(r.data.concat(t.data)),_localStorage.set(n.tabKey,JSON.stringify(r))}})}else if(0===r.indexOf("sajssdk-lock-get-")){var s=safeJSONParse(_localStorage.get(r))||{expireTime:0};now()-s.expireTime>1e4&&_localStorage.remove(r)}}for(var o=0;o0)for(t=0;tsdPara.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!(indexOf(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(indexOf(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=store._state.history_login_id;return!(t&&t.name&&t.name===e||indexOf(this.bindReservedNames,e)>-1)}},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,t){check({propertyKey:t}),check({propertyValue:e},function(e,r,n){return e||(r=t+"'s Value",isFunction(checkLog[n])&&checkLog[n](r)),!0})}):ruleOption.voidZero(e)&&sdWarn("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return e!==undefined&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdWarn("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!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 n=this[e];if(isFunction(n))return n.call(this,t);if(!n)return!1;for(var i=0;i-1;if(isObject(r)&&"$option"!==n&&!a)try{e[n]=JSON.stringify(r)}catch(s){delete e[n],sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else isString(r)||isNumber(r)||isDate(r)||isBoolean(r)||isArray(r)||isFunction(r)||"$option"===n||a||(sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete e[n])}),e):e}function formatString(e,t){return isNumber(t)&&e.length>t?(sdWarn("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function filterReservedProperties(e,t){isObject(e)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(r,n){r in e&&(indexOf(t||[],r)>-1||(n<3?(delete e[r],sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function searchObjString(e){var t=["$element_selector","$element_path"],r=["sensorsdata_app_visual_properties"];isObject(e)&&each(e,function(n,i){if(isObject(n))searchObjString(e[i]);else if(isString(n)){if(indexOf(r,i)>-1)return;e[i]=formatString(n,indexOf(t,i)>-1?1024:sdPara.max_string_length)}})}function searchZZAppStyle(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(e){"item_type"in e&&check({item_type:e.item_type},function(t){return t||delete e.item_type,!0}),"item_id"in e&&check({item_id:e.item_id},function(t,r,n){return t||"string"!==n||delete e.item_id,!0})}function formatProperties(e,t){each(e,function(r,n){-1===indexOf(t||[],n)&&check({propertyKey:n},function(t,r,i){return t||"keyLength"===i||delete e[n],!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){var r=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(),r.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={server_url:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.server_url))return sdError("----vcollect---server_url\u5fc5\u987b\u4e3a\u6709\u6548 URL \u5b57\u7b26\u4e32"),!1;try{e=_URL(sd.para.server_url),r.server_url.project=e.searchParams.get("project")||"default",r.server_url.host=e.host}catch(n){return sdError("----vcollect---server_url\u89e3\u6790\u5f02\u5e38",n),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(n){return sdError("----vcollect---\u9875\u9762\u5730\u5740\u89e3\u6790\u5f02\u5e38",n),!1}return r},isDiv:function(e){return!e.element_path||"div"===trim(e.element_path.split(">").pop()).slice(0,3)},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 e.$element_selector.indexOf(t.element_selector)>-1}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 e.$element_path.indexOf(t.element_path)>-1}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(e.$element_position!==undefined){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(e,t,r){var n=[];if(!r){var i=vtrackBase.initUrl();if(!i)return[];r=i.page_url}return"$WebClick"===e.event&&each(t,function(t){isObject(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&isObject(t.event)&&t.event.url_host===r.host&&t.event.url_path===r.pathname&&vtrackBase.configIsMatch(e.properties,t.event)&&n.push(t)}),n},getPropElInLi:function(e,t){if(!(e&&isElement(e)&&isString(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r=sd.heatmap.getDomSelector(e);return r?getDomBySelector(r+t)||null:(sdWarn("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",r,t),null)},getProp:function(e,t){if(!isObject(e))return!1;if(!(isString(e.name)&&e.name.length>0))return sdWarn("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var r,n,i={};if("content"===e.method){var a;if(isString(e.element_selector)&&e.element_selector.length>0)a=getDomBySelector(e.element_selector);else{if(!t||!isString(e.list_selector))return sdWarn("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=getDomBySelector(t.properties.$element_selector);if(!s)return sdWarn("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var o=sd.heatmap.getClosestLi(s);a=vtrackBase.getPropElInLi(o,e.list_selector)}if(!a||!isElement(a))return sdWarn("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===a.tagName.toLowerCase())r=a.value||"";else if("select"===a.tagName.toLowerCase()){var l=a.selectedIndex;isNumber(l)&&isElement(a[l])&&(r=getElementContent$1(a[l],"select"))}else r=getElementContent$1(a,a.tagName.toLowerCase());if(e.regular){try{n=new RegExp(e.regular).exec(r)}catch(d){return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===n)return sdWarn("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!isArray(n)||!isString(n[0]))return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;r=n[0]}if("STRING"===e.type)i[e.name]=r;else if("NUMBER"===e.type){if(r.length<1)return sdWarn("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;if(isNaN(Number(r)))return sdWarn("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;i[e.name]=Number(r)}return i}return sdError("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},getAssignConfigs:function(e,t){var r=vtrackBase.initUrl();if(!r||!r.page_url)return[];if(!isObject(t))return[];var n=[];return t.events=t.events||t.eventList,isArray(t.events)&&t.events.length>0?(each(t.events,function(t){isObject(t)&&isObject(t.event)&&t.event.url_host===r.page_url.host&&t.event.url_path===r.page_url.pathname&&e(t)&&n.push(t)}),n):[]}},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(e){var t={},r=[],n=this;if(!this.events.length)return{};if("$WebClick"===e.event){var i=this.filterConfig(e,this.events);if(!i.length)return{};each(i,function(i){isObject(i)&&(isArray(i.properties)&&i.properties.length>0&&each(i.properties,function(r){if(isObject(r))if(!1===r.h5)isArray(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(r);else{var i=n.getProp(r,e);isObject(i)&&(t=extend(t,i))}}),isString(i.event_name)&&r.push(i.event_name))}),sd.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=r)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new sd.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(r){var n={};try{r=JSON.parse(base64Decode(r))}catch(s){sdError("getJSVisualProperties data parse error!")}if(isObject(r)){var i=r.sensorsdata_js_visual_properties,a=e.initUrl();a&&(a=a.page_url,isArray(i)&&i.length>0&&each(i,function(t){if(isObject(t)&&t.url_host===a.host&&t.url_path===a.pathname&&t.h5){var r=e.getProp(t);isObject(r)&&(n=extend(n,r))}}))}return"android"===sd.bridge.bridge_info.platform&&t.notifyApp({data:n},r.message_id),n}),t}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(base64Decode(t))}catch(r){return void sdError("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(base64Decode(e))}catch(t){e=null,sdError("getAppVisualConfig result parse error\uff01")}return e},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))return!1;for(var r=0;r0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,r){var n=this;r=r||this.filterConfig(e,t,vtrackcollect.url_info.page_url);var i={};return r.length?(each(r,function(t){isArray(t.properties)&&t.properties.length>0&&each(t.properties,function(t){var r=n.getProp(t,e);isObject(r)&&extend(i,r)})}),i):{}},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=vtrackBase.initUrl();if(e){var t;try{(t=new urlParse(sd.para.server_url))._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return sdError("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)return!1;if(_localStorage.isSupport()||(this.storageEnable=!1),!this.initUrl())return sdError("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=store.readObjectVal(this.storage_name);if(isObject(e)&&isObject(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime()-this.update_time;if(isNumber(t)&&t>0&&t0&&t-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===i&&sd.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)&&((sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1)>1||r.isCollectableDiv(n)))return n;if(r.isStyleTag(i)&&sd.para.heatmap.collect_tags.div){var o=r.getCollectableParent(n);if(o&&r.isDivLevelValid(o))return o}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var r=heatmap.getElementPath(e,!0,t).split(" > "),n=0;return each(r,function(e){"div"===e&&n++}),n},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(heatmap.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&isElement(e);){if(!isString(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){return function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&isString(e.tagName)&&"li"===e.tagName.toLowerCase())return e;return null}(e)},getElementPosition:function(e,t,r){var n=sd.heatmap.getClosestLi(e);if(!n||!isElement(e)||!isString(e.tagName))return null;var i=e.tagName.toLowerCase(),a=n.getElementsByTagName(i),s=a.length,o=[];if(s>1){for(var l=0;l1)return indexOf(o,e)}return function(e){if(!e.parentNode)return"";if(1===ry(e).getSameTypeSiblings().length)return 0;for(var t=0,r=e;ry(r).previousElementSibling().ele;r=ry(r).previousElementSibling().ele,t++);return t}(n)},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),sd.para.heatmap_url||(sd.para.heatmap_url=getSafeHttpProtocol()+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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});r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);var n=sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);return isNumber(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){if(!e)return{};function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}return function(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,s=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(s)}}(e)},start:function(e,t,r,n,i){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collect_element)&&!sd.para.heatmap.collect_element(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,n,i))},getBasicEleInfo:function(e,t,r,n,i){var a=isObject(n)?n:{},s=isFunction(i)?i:isFunction(n)?n:undefined,o=this.getEleDetail(t);if(sd.para.heatmap&&sd.para.heatmap.custom_property){var l=sd.para.heatmap.custom_property(t);isObject(l)&&(o=extend(o,l))}return{event:e,target:t,props:o=extend(o,this.getPointerEventProp(e,t),a),tagName:r,callback:s}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=ry(e.element).getParents());if(r&&isArray(r)&&r.length>0)for(var i=0;i-1)&&(!t||sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collect_tags)&&isObject(sd.para.heatmap.collect_tags.div)&&isArray(sd.para.heatmap.collect_tags.div.ignore_tags)&&indexOf(sd.para.heatmap.collect_tags.div.ignore_tags,e)>-1):indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){sdError("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=sd.para&&sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){sdError("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.scroll_notice_map)return!1;var e=!0;sd.para.scrollmap&&isFunction(sd.para.scrollmap.collect_url)&&this.listenUrlChange(function(){e=!!sd.para.scrollmap.collect_url()});var t=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t}({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>sd.para.heatmap.scroll_delay_time&&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.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=n}});t.current_time=new Date,saAddEvent(window,"scroll",function(){if(!e)return!1;t.go()}),saAddEvent(window,"unload",function(){if(!e)return!1;t.go("notime")})},initHeatmap:function(){var e=this,t=!0;if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)return!1;isFunction(sd.para.heatmap.collect_url)&&this.listenUrlChange(function(){t=!!sd.para.heatmap.collect_url()}),"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(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var s=isString(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===s||"button"===s?e.start(n,i.parentNode,s):e.start(n,i,a)}):saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement,a=sd.heatmap.getTargetElement(i,r);if(!isElement(a)&&!isString(i.tagName))return!1;isElement(a)&&isString(a.tagName)?e.start(n,a,a.tagName.toLowerCase()):isElement(i)&&"div"===i.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&unlimitedDiv.events.length>0&&unlimitedDiv.isTargetEle(i)&&e.start(n,i,i.tagName.toLowerCase(),{$lib_method:"vtrack"})})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),t={};return each(e,function(e,r,n){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+r+" ")?t["$"+r]=n[r]:t[r]=n[r]}),t}function sendFirstProfile(e,t,r){if(sd.is_first_visitor&&r){var n={};sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(n.$search_keyword_id=getBaiduKeyword.id(),n.$search_keyword_id_type=getBaiduKeyword.type(),n.$search_keyword_id_hash=hashCode53(n.$search_keyword_id));var i=getReferrer(null,t);e(extend({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?getHostname(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),n)),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.setProfile(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("sensorsdata_2015_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var n in e)!(n in t&&t[n]!==e[n])&&n in t||(t[n]=e[n],r=!0);r&&(store.saveObjectVal("sensorsdata_2015_jssdk_profile",t),sd.setProfile(e))}else store.saveObjectVal("sensorsdata_2015_jssdk_profile",e),sd.setProfile(e)},setInitReferrer:function(){var e=getReferrer();sd.setOnceProfile({_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){if("object"==typeof e&&e.tagName&&isElement(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||hasAttributes(e,a)||heatmap.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();heatmap.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){var r;r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer;var n=!(e=isObject(e)?e:{}).not_set_profile;function i(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,i(e,t),this.autoTrackSinglePage=i,sendFirstProfile(sd.setOnceProfile,!1,n)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=isObject(e)?e:{};var r=getClassifiedUtms(),n=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var i=location.href;sd.para.is_single_page&&addHashEvent(function(){var n=getReferrer(i,!0);sd.track("$pageview",extend({$referrer:n,$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),i=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),sendFirstProfile(sd.setOnceProfile,!0,n),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store.getAnonymousId()},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]?e(window.SensorsDataWebJSSDKPlugin[t]):isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sdWarn(t+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function loginBody(e,t){var r=e.id,n=e.callback,i=e.name,a=store.getFirstId(),s=store.getOriginDistinctId();if(!check({distinct_id:r}))return sdError("login id is invalid"),!1;if(r===store.getOriginDistinctId()&&!a)return sdError("login id is equal to distinct_id"),!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(i)&&r===store._state.first_id)return!1;if(store._state.history_login_id.name!==i||r!==store._state.history_login_id.value){store._state.identities[i]=r,store.set("history_login_id",{name:i,value:r}),a||store.set("first_id",s),t(r,"$SignUp",{},n);var o={$identity_cookie_id:store._state.identities.$identity_cookie_id};return o[i]=r,resetIdentities(o),!0}return!1}function resetIdentities(e){var t={};for(var r in e)t[r]=e[r];store._state.identities=t,store.save()}function deleteBindIDData(e,t){if(!check({unbindKey:e,bindValue:t}))return!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t){var r=store.getUnionId().login_id;r&&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())}var n={};return n[e]=t,n}function setInitVar(){sd._t=sd._t||1*new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var n in sd.para.is_track_latest)r["latest_"+n]=sd.para.is_track_latest[n];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 i=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],o={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof sd.para.source_type&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(i):i,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(a):a,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(s):s,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(o,sd.para.source_type.keyword):o);var l=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)){sd.para.heatmap.clickmap=sd.para.heatmap.clickmap||"default",sd.para.heatmap.scroll_notice_map=sd.para.heatmap.scroll_notice_map||"default",sd.para.heatmap.scroll_delay_time=sd.para.heatmap.scroll_delay_time||4e3,sd.para.heatmap.scroll_event_duration=sd.para.heatmap.scroll_event_duration||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);var d=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];d.push("data-sensors-click"),sd.para.heatmap.track_attr=d,isObject(sd.para.heatmap.collect_tags)?!0===sd.para.heatmap.collect_tags.div?sd.para.heatmap.collect_tags.div={ignore_tags:l,max_level:1}:isObject(sd.para.heatmap.collect_tags.div)?(sd.para.heatmap.collect_tags.div.ignore_tags?isArray(sd.para.heatmap.collect_tags.div.ignore_tags)||(sdWarn("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),sd.para.heatmap.collect_tags.div.ignore_tags=l):sd.para.heatmap.collect_tags.div.ignore_tags=l,sd.para.heatmap.collect_tags.div.max_level&&-1===indexOf([1,2,3],sd.para.heatmap.collect_tags.div.max_level)&&(sd.para.heatmap.collect_tags.div.max_level=1)):sd.para.heatmap.collect_tags.div=!1:sd.para.heatmap.collect_tags={div:!1}}sd.para.server_url=optimizeServerUrl(sd.para.server_url),!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.collect_tags&&isObject(sd.para.heatmap.collect_tags)&&each(sd.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&"default"===sd.para.heatmap.clickmap&&sd.heatmap.initUnlimitedTags()}var readyState={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},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):sdWarn("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0])}var nonameCount=1;function use(e,t){if(isString(e)||isObject(e)){var r;if(isObject(e)){var n=sd.modules&&sd.modules[e.plugin_name];n&&n!==e&&sdWarn(e.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),r=n||e}return 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.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[e]&&(r=window.sensorsDataAnalytic201505.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||sdWarn("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&sdWarn("warning: plugin version not match SDK version. plugin may not work correctly. "):sdWarn("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,r):(sdWarn((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),r)}sdError("use's first arguments must be string or object.")}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){var r=deleteBindIDData(e,t);r&&saEvent.send({identities:r,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(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&!(!e.href||/^javascript/.test(e.href)||e.target)&&void saAddEvent(e,"click",function(n){n.preventDefault();var i=!1;function a(){i||(i=!0,location.href=e.href)}setTimeout(a,1e3),sd.track(t,r,a)})}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 setProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function setOnceProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function appendProfile(e,t){check({propertiesMust:e})&&(each(e,function(t,r){isString(t)?e[r]=[t]:isArray(t)?e[r]=t:(delete e[r],sdWarn("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),isEmptyObject(e)||saEvent.send({type:"profile_append",properties:e},t))}function incrementProfile(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!1;return!0}(e)?saEvent.send({type:"profile_increment",properties:e},t):sdError("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}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,n={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?n[e]=!0:sdWarn("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),saEvent.send({type:"profile_unset",properties:n},t)):sdError("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function identify(e){"number"==typeof e&&(e=String(e));var t=store.getFirstId();if(void 0===e){var r=UUID();t?store.set("first_id",r):store.set("distinct_id",r)}else check({distinct_id:e})&&(t?store.set("first_id",e):store.set("distinct_id",e))}function resetAnonymousIdentity(e){if(store.getFirstId())return sdError("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),void 0===e){var t=UUID();store._state.identities.$identity_cookie_id=t,store.set("distinct_id",t)}else check({distinct_id:e})&&(store._state.identities.$identity_cookie_id=e,store.set("distinct_id",e))}function sendSignup(e,t,r,n){var i=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:i,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function trackSignup(e,t,r,n){"number"==typeof e&&(e=String(e)),check({distinct_id:e,event:t,properties:r})&&sendSignup(e,t,r,n)}function registerPage(e){check({properties:e})?extend(pageInfo.currentProps,e):sdError("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){var t;if(isArray(e)&&e.length>0)for(t=0;t-1?n:"https:")+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/vapph5define.min.js"})}else r();else r()}function listenSinglePage(e){sd.para.is_track_single_page&&spa.on("switch",function(t){var r=function(r){if(r=r||{},t!==location.href){pageInfo.pageProp.referrer=getURL(t);var n=extend({$url:getURL(),$referrer:getURL(t)},r);isFunction(e)?e(n):sd.quick&&sd.quick("autoTrack",n)}};if("boolean"==typeof sd.para.is_track_single_page)r();else if("function"==typeof sd.para.is_track_single_page){var n=sd.para.is_track_single_page();isObject(n)?r(n):!0===n&&r()}})}function enterFullTrack(){sd._q&&isArray(sd._q)&&sd._q.length>0&&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","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","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=[]),sdWarn("calling sdk api before init is deprecated."),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);sdError("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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 n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},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)&&r.length>0)for(var n={current:0,total:r.length},i=new InterceptorContext(t,n,sd),a=0;a=2)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="1.26.8";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return"dfm-enc-"+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf("dfm-enc-")&&(e=e.substring("dfm-enc-".length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="1.26.8";function wrapPluginInitFn$1(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$1(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$1(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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 t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),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="1.26.8";function wrapPluginInitFn$2(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$2(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$2(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(),log("---test---fail---",!sd$1,sd$1.bridge.activeBridge,!anServerUrl),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),log("---test---bridge-verify-",sd$1.bridge.is_verify_success)),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("---test---app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){if(log("---test---datasend-",sd$1.bridge.is_verify_success),sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$1.bridge.is_verify_success?(log("---test---bridge-verify-success---",e.data),anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({server_url:sd$1.para.server_url},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(log("---test---bridge-verify-fail-----",sd$1.bridge.is_verify_success),sd$1.para.app_js_bridge.is_send?(sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_$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="1.26.8";function wrapPluginInitFn$3(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$3(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$3(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(){if(log$1("ObsoleteBridge---test---init---"),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,log$1("ObsoleteBridge-",sd$2.bridge.activeBridge,anVerify,anTrack$1,anVisualVerify),sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)){sd$2.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack$1;anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({server_url:sd$2.para.server_url})),log$1("ObsoleteBridge---called-return",e)),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){if(log$1("ObsoleteBridge---senddata"),sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(anVerify){var n=anVerify&&anVerify.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data)));return log$1("ObsoleteBridge---anVerify-success",n),n?(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$2.para.app_js_bridge.is_send?(sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return log$1("ObsoleteBridge---is-send-old-way",sd$2.para.app_js_bridge.is_send),anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function handleCommand$1(e){log$1("ObsoleteBridge---handleCommadn");var t=e.callType;return t in vbridge$1$1.commands?(log$1("ObsoleteBridge---",t,vbridge$1$1.commands),vbridge$1$1.commands[t](e,anBridge$1)):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?(log$1("ObsoleteBridge---handleCommadn-abridge"),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="1.26.8";function wrapPluginInitFn$4(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$4(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$4(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var hidden,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||"sensorsdata2015jssdkchannel",sd$3=e;var r=this;!function(){if(_$3=sd$3._,store$1=sd$3.store,!_$3.localStorage.isSupport())return!1;sd$3.para.max_string_length=1024,r.eventList.init(),r.addLatestChannelUrl(),r.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd$3.registerPage({$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();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_$3.isReferralTraffic(document.referrer)){var r=_$3.getQueryParam(location.href,"sat_cf");_$3.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd$3.registerPage(t):sd$3.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd$3.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name));return e=_$3.safeJSONParse(e),!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);sd$3.para.encrypt_cookie&&(r=sd$3.kit.userEncrypt(r)),_$3.cookie.set(cookie_name,r)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$5(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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"undefined"!=typeof document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var iosServerUrl,iosTracker,sd$4,_$4,log$2,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){var t=e._.URL(e.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},handleAndroidLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=t;e.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,e.timer=setTimeout(function(){var t=isPageHidden();if(e.log("hide:"+hidden+":"+document[hidden]),t)return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=r},e.timeout)},handleIOSLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 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\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),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){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=e,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&isObject$1(arguments[0])?t=arguments[0]:arguments.length>=2&&isObject$1(arguments[1])&&(t=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=parseShortURL(n);if(!i)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f 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,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="1.26.8";function wrapPluginInitFn$6(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$6(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$6(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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){if(sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({server_url:sd$4.para.server_url},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$4.para.app_js_bridge.is_send?(sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_$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="1.26.8";function wrapPluginInitFn$7(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$7(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$7(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=_$5.URL(sd$5.para.server_url).hostname,r=_$5.URL(sd$5.para.server_url).searchParams.get("project")||"default"}catch(n){sd$5.log(n)}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)return e;var r,n,i=e.callback;if(sd$5.bridge.bridge_info.verify_success){var a=document.createElement("iframe"),s=(r=e.data,n=(n=JSON.stringify(_$5.extend({server_url:sd$5.para.server_url},r))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return a.setAttribute("src",s),document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null,_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),!0}return sd$5.para.app_js_bridge.is_send?(sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),e)}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="1.26.8";function wrapPluginInitFn$8(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$8(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$8(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}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\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},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,1==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},PageLeave.prototype.pageEndHandler=function(){if(!0!==this.page_hidden_status){var 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 e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.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;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},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;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var r=this.sd.store.readObjectVal(t);this._.isObject(r)&&1*new Date-r.time>r.heartbeat_interval_time+5e3&&(delete r.heartbeat_interval_time,r._flush_time=(new Date).getTime(),this.sd.kit.sendData(r),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),this._.extend(n,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="1.26.8";function wrapPluginInitFn$9(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$9(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$9(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){function r(){var n=0,i=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,a={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(i?(n=function(t){var r=0;return e._.isFunction(t.getEntriesByType)&&(r=((t.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),r}(i)||function(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}(i),function(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}(i,a)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),n>0){var s=e._.isObject(t)&&t.max_duration||1800;n=Number((n/1e3).toFixed(3)),(!e._.isNumber(s)||s<=0||n<=s)&&(a.event_duration=n)}eventSent||(e.track("$WebPageLoad",a),eventSent=!0),window.removeEventListener?window.removeEventListener("load",r):window.detachEvent&&window.detachEvent("onload",r)}"complete"==document.readyState?r():window.addEventListener?window.addEventListener("load",r):window.attachEvent&&window.attachEvent("onload",r)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),s=t.customRegister,o=a.properties,l=a.event,d={};return n.each(s,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(d=n.extend(d,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:o,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(d=n.extend(d,t))}}),e.properties=n.extend(o,d),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder$b="1.26.8";function wrapPluginInitFn$a(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$a(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$a(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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="1.26.8";function wrapPluginInitFn$b(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$b(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$b(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(i){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}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 \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="1.26.8";function wrapPluginInitFn$c(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$c(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$c(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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-1)return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r-1)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=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),i="";if(n){var a,s=n[1]||"",o=n[2]||"",l=n[3]||"",d="_sasdk="+this.getCurrenId(),c=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(d):n.push(e)}),n.join("&")};return this.getPartHash(e)?(a=l.indexOf("_sasdk"),i=l.indexOf("?")>-1?a>-1?s+o+"#"+l.substring(1,a)+c(l.substring(a,l.length)):s+o+l+"&"+d:s+o+"#"+l.substring(1)+"?"+d):(a=o.indexOf("_sasdk"),i=/^\?(\w)+/.test(o)?a>-1?s+"?"+c(o.substring(1))+l:s+o+"&"+d+l:s+"?"+d+l),t&&(t.href=i),i}},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},setRefferId:function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);(r=r.substring(1))!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},addListen:function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),s=i.parentNode;if("a"===a&&i.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===a&&i.href?(r=i.href,n=i):(r=s.href,n=s);var o=e._.URL(r).protocol;"http:"!==o&&"https:"!==o||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},init:function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var r=t.length,n=[],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$d(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(){return e=source_channel_standard$1.split(" "),t="",r={},sd$6._.isArray(sd$6.para.source_channel)&&sd$6.para.source_channel.length>0&&(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;var e,t,r}}})}},index$d=createPlugin$d(utm,"Utm","sdkAfterInitPara"),sdkversion_placeholder$f="1.26.8";function wrapPluginInitFn$e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$e(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$e(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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="1.26.8";function wrapPluginInitFn$f(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$f(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$f(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$f(e,t,r){return wrapPluginInitFn$f(e,t,r),e.plugin_version=sdkversion_placeholder$g,e}function debugPath(e){var t,r=e;t=-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:t,type:"GET",cors:!0,header:{"Dry-Run":String(sd$8.para.debug_mode_upload)},success:function(e){!0===_$6.isEmptyObject(e)?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+r):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData$4(e,t){if(!0===sd$8.para.debug_mode){var r=e.data;e.callback,debugPath(JSON.stringify(r)),t.cancellationToken.stop()}return 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.server_url)?sd$8.para.debug_mode_url=sd$8.para.server_url.replace("sa.gif","debug"):_$6.isArray(sd$8.para.server_url)&&_$6.isString(sd$8.para.server_url[0])?sd$8.para.debug_mode_url=sd$8.para.server_url[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="1.26.8";function wrapPluginInitFn$g(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$g(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$g(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){if(_$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()}return 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){if(!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData){sd$9.para.jsapp.isOnline=!0;var t=sd$9.para.jsapp.getData();_$7.isArray(t)&&t.length>0&&_$7.each(t,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})}else 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="1.26.8";function wrapPluginInitFn$h(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$h(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$h(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$i(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){var r=null,n=null;if(_$9.isObject(e.config)&&(r=e.config.send_type,n=_$9.optimizeServerUrl(e.config.server_url)),("beacon"===r||!r&&"beacon"===sd$b.para.send_type)&&_$9.isSupportBeaconSend()){var i=n||e.server_url;e.server_url=i,e.data=sd$b.kit.encodeTrackData(e.data),_$9.isArray(i)&&i.length?_$9.each(i,function(t){e.callback=null,e.server_url=t,sendData$7(e)}):"string"==typeof i&&""!==i?sendData$7(e):sd$b.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$3(){"beacon"!==sd$b.para.send_type||_$9.isSupportBeaconSend()||(sd$b.para.send_type="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="1.26.8";function wrapPluginInitFn$j(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$j(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$j(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){var r=null,n=null;if(_$a.isObject(e.config)&&(r=e.config.send_type,n=_$a.optimizeServerUrl(e.config.server_url)),("ajax"===r||!r&&"ajax"===sd$c.para.send_type)&&_$a.isSupportCors()){var i=n||e.server_url;e.server_url=i,e.data=sd$c.kit.encodeTrackData(e.data),_$a.isArray(i)&&i.length?_$a.each(i,function(t){e.callback=null,e.server_url=t,sendData$8(e)}):"string"==typeof i&&""!==i?sendData$8(e):sd$c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$4(){"ajax"!==sd$c.para.send_type||_$a.isSupportCors()||(sd$c.para.send_type="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="1.26.8";function wrapPluginInitFn$k(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$k(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$k(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){var r=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+r:e+"?"+r}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(e,t){var r=null;_$b.isObject(e.config)&&(r=_$b.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,_$b.isArray(n)&&n.length?_$b.each(n,function(t){t&&(e.data=getSendUrl(t,i),e.callback=null,e.server_url=t,sendData$9(e))}):"string"==typeof n&&""!==n?(e.data=getSendUrl(n,i),sendData$9(e)):sd$d.logger&&sd$d.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.send_type&&"ajax"!==sd$d.para.send_type&&"beacon"!==sd$d.para.send_type&&(sd$d.para.send_type="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}})})}var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender);function wrapPluginInitFn$l(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$l(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$l(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$l(e,t,r){return wrapPluginInitFn$l(e,t,r),e.plugin_version=sdkversion_placeholder,e}var _sd$1=null,_$c=null,_cacheLogs=[],ConsoleLogger={init:function(e){e&&(_$c=(_sd$1=e)._,_sd$1.logger&&_sd$1.logger.appendWriter(logWriter),_sd$1.on&&_sd$1.on("sdkAfterInitPara",function(){for(var e=0;e<_cacheLogs.length;e++)printLog(_cacheLogs[e]);_cacheLogs=null}),_sd$1.on&&_sd$1.on("sdkInitAPI",function(){_sd$1.enableLocalLog=enableLocalLog,_sd$1.disableLocalLog=disableLocalLog}))}},consoleLogger=createPlugin$l(ConsoleLogger,"ConsoleLogger");function logWriter(e){null!==_cacheLogs?_cacheLogs.push(e):printLog(e)}function printLog(e){try{if("log"===e.level&&canLog())return void writeLog(e);if("warn"===e.level&&canWarn())return void writeLog(e);if("error"===e.level&&canError())return void writeLog(e)}catch(t){}}function canLog(){return!!isLocalLogEnabled()||!0===_sd$1.para.show_log||_$c.isObject(_sd$1.para.show_log)&&"log"===_sd$1.para.show_log.level}function canWarn(){return!!isLocalLogEnabled()||canLog()||_$c.isObject(_sd$1.para.show_log)&&"warn"===_sd$1.para.show_log.level}function canError(){return!!isLocalLogEnabled()||!_$c.isObject(_sd$1.para.show_log)||"none"!==_sd$1.para.show_log.level}function writeLog(e){var t=e.content,r=_$c.isObject(t[0])?_$c.formatJsonString(t[0]):t[0],n=getLogHead(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(_$c.isFunction(console[e.level])?console[e.level].apply(console,t):_$c.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function getLogHead(e){var t="",r="",n=_sd$1.para.show_log;return _$c.isObject(n)&&!1===n.show_brand||(t+=e.brand),_$c.isObject(n)&&!1===n.show_level||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),_$c.isObject(n)&&!1===n.show_module||(r=e.module),t+r}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _$c.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}sd.modules=sd.modules||{};for(var builtinPlugins=[consoleLogger,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=[consoleLogger,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;i1)))/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;g(r+1,0)<=i;r++);for(n=c((i-g(r,0))/30.42);g(r,n+1)<=i;n++);i=1+i-g(r,n),s=c((a=(e%864e5+864e5)%864e5)/36e5)%24,o=c(a/6e4)%60,l=c(a/1e3)%60,d=a%1e3}}return(k=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+w(6,r<0?-r:r):w(4,r))+"-"+w(2,n+1)+"-"+w(2,i)+"T"+w(2,s)+":"+w(2,o)+":"+w(2,l)+"."+w(3,d)+"Z",r=n=i=s=o=l=d=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function P(e){return k(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=P;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var I=function(e){var t=e.charCodeAt(0);return $[t]||"\\u00"+w(2,t.toString(16))},j=/[\x00-\x1f\x22\x5c]/g,C=function(e){return j.lastIndex=0,'"'+(j.test(e)?e.replace(j,I):e)+'"'},L=function(e,t,r,n,i,a,s){var o,d,u,p,f,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=k(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==g)return o===g?o:"null";switch("object"==(d=typeof o)&&(u=_.call(o)),u||d){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 C(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw c();if(s.push(o),p=[],y=a,a+=i,"[object Array]"==u){for(h=0,v=o.length;h0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||N();e+=x("0x"+a.slice(t,D));break;default:N()}else{if(34==i)break;for(i=a.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++D);e+=a.slice(t,D)}if(34==a.charCodeAt(D))return D++,e;N();default:if(t=D,45==i&&(n=!0,i=a.charCodeAt(++D)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(D+1))>=48&&i<=57&&N(),n=!1;D=48&&i<=57;D++);if(46==a.charCodeAt(D)){for(r=++D;r57);r++);r==D&&N(),D=r}if(101==(i=a.charCodeAt(D))||69==i){for(43!=(i=a.charCodeAt(++D))&&45!=i||D++,r=D;r57);r++);r==D&&N(),D=r}return+a.slice(t,D)}n&&N();var o=a.slice(D,D+4);if("true"==o)return D+=4,!0;if("fals"==o&&101==a.charCodeAt(D+4))return D+=5,!1;if("null"==o)return D+=4,null;N()}return"$"},U=function(e){var t,r;if("$"==e&&N(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=T());)r?","==e?"]"==(e=T())&&N():N():r=!0,","==e&&N(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=T());)r?","==e?"}"==(e=T())&&N():N():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==T()||N(),t[e.slice(1)]=U(T());return t}N()}return e},R=function(e,t,r){var n=B(e,t,r);n===g?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(_,S,i);else S(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return D=0,E=""+e,r=U(T()),"$"!=T()&&N(),D=E=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;o255||(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>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 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(r){logger.log(r)}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){logger.log(r)}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";_localStorage.set(t,r),_localStorage.get(t)!==r&&(e=!1),_localStorage.remove(t)}catch(n){e=!1}return e}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function getRandom(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),isObject(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(r){}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(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),n=0;n Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");for(var a in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function _URL(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=getURLSearchParams(r.search),{get:function(e){return t[e]}}));else{if(isString(e)||(e=String(e)),e=trim(e),!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");var n=urlParse(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=getURLSearchParams("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}ConcurrentStorage.prototype.get=function(e,t,r,n){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,n=n||function(){};var i=this.lockGetPrefix+e,a=_localStorage.get(i),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return n(null);_localStorage.set(i,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(i))||{randomNum:0,expireTime:0})&&a.randomNum===s?(n(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(i)):n(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,n,i){if(!e||!t)throw new Error("key and val is must");r=r||1e4,n=n||1e3,i=i||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 i({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)&&i({status:"success"}):i({status:"fail",reason:"This key is locked"})},n)},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 n=0,i=r.length;n=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+t+"-"+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,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()||ry(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 addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(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){logger.log(t)}}}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=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),ry(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||!isArray(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 siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return ry(e=e&&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(),n=[],i=0;i=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),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(s){logger.log(s)}r.send(e.data||null)}function map(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(each(e,function(e,n,i){r.push(t(e,n,i))}),r)}function base64Decode(e){var t=[];try{t=map(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 base64Encode(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}function bindReady(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,s=i.addEventListener,o=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",d=s?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](d+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},u=function(){try{a.doScroll("left")}catch(e){return void setTimeout(u,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!s&&a.doScroll){try{n=!t.frameElement}catch(p){logger.log(p)}n&&u()}i[o](d+"DOMContentLoaded",c,!1),i[o](d+"readystatechange",c,!1),t[o](d+"load",c,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=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,cookie.set(t,"true",0,null,r,"; domain="+a),-1!==document.cookie.indexOf(t+"=true"))return cookie.set(t,"true","-1s",null,r,"; domain="+a),a;return""}function getDomBySelector(e){if(!isString(e))return null;var t,r=e.split(">");return(t=function n(e){var t,i=r.shift();if(!i)return e;try{t=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(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(!(isElement(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l0)return null}return r||null}(i,e)}catch(a){logger.log(a)}return t&&isElement(t)?n(t):null}())&&isElement(t)?t:null}function getElementContent(e,t){var r="",n="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(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 getHostname(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=_URL(e).hostname}catch(n){logger.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}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(t){return""}}function getQueryParam(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=_decodeURIComponent(e);var r=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null===r||r&&"string"!=typeof r[1]&&r[1].length?"":_decodeURIComponent(r[1])}function getQueryParamsFromUrl(e){var t={},r=e.split("?")[1]||"";return r&&(t=getURLSearchParams("?"+r)),t}function mediaQueriesSupported(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function getScreenOrientation(){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(mediaQueriesSupported()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return 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,n=0;n0)for(var i=e.split(""),a=0;at)for(n=r+n;(o=31*n+s)t;)n=n/2+s;n=31*n+s}return n}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function isSupportCors(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(e){if(!isObject(e)||!isString(e.callbackName))return logger.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=isFunction(e.success)?e.success:function(){},e.error=isFunction(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),r=document.getElementsByTagName("head")[0],n=null,i=!1;if(r.appendChild(t),isNumber(e.timeout)&&(n=setTimeout(function(){if(i)return!1;e.error("timeout"),window[e.callbackName]=function(){logger.log("call jsonp error")},n=null,r.removeChild(t),i=!0},e.timeout)),window[e.callbackName]=function(){clearTimeout(n),n=null,e.success.apply(null,arguments),window[e.callbackName]=function(){logger.log("call jsonp error")},r.removeChild(t)},e.url.indexOf("?")>-1?e.url+="&callbackName="+e.callbackName:e.url+="?callbackName="+e.callbackName,isObject(e.data)){var a=[];each(e.data,function(e,t){a.push(t+"="+e)}),e.data=a.join("&"),e.url+="&"+e.data}t.onerror=function(a){if(i)return!1;window[e.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(n),n=null,r.removeChild(t),e.error(a),i=!0},t.src=e.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"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;addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else 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(""),n=0,i=r.length;nt?(s&&(clearTimeout(s),s=null),o=d,a=e.apply(n,i),s||(n=i=null)):s||!1===r.trailing||(s=setTimeout(l,c)),a}}function values(e){var t=[];return null==e?t:(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=[],n={},i=0;it._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_"+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(){},storeInitCheck:function(){if(sd.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else 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 n=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t&&(n=!0),addEvent(e,t,r,n)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function isBaiduTraffic(){var e=document.referrer;if(!e)return!1;try{var t=_URL(e).hostname;return t&&"baidu.com"===t.substring(t.length-"baidu.com".length)}catch(r){return!1}}EventEmitterSa.prototype={emit:function(e){var t=[].slice.call(arguments,1);each(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,r,n){isFunction(t)&&(this._events.push({type:e,callback:t,context:r||this}),n=!1!==n,this.pendingEvents.length>0&&n&&each(this.pendingEvents,function(n){n.type===e&&t.apply(r,n.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var getBaiduKeyword={data:{},id:function(){return this.data.id?this.data.id:(this.data.id=getReferrerEqid(),this.data.id)},type:function(){return this.data.type?this.data.type:(this.data.type=getReferrerEqidType(),this.data.type)}};function getReferrerEqidType(){var e=getQueryParamsFromUrl(document.referrer);if(isEmptyObject(e)||!e.eqid){var t=getQueryParamsFromUrl(location.href);return e.ck||t.utm_source?"baidu_sem_keyword_id":"baidu_other_keyword_id"}return"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)?(0!==(e=_decodeURI(e=trim(e))).indexOf("https://www.baidu.com/")||t||(e=e.split("?")[0]),isString(e=e.slice(0,sdPara.max_referrer_string_length))?e:""):"\u53d6\u503c\u5f02\u5e38_referrer\u5f02\u5e38_"+String(e)}function isReferralTraffic(e){if(""===(e=e||document.referrer))return!0;var t=getCookieTopLevelDomain(null,domain_test_key,sdPara.is_secure_cookie),r=getHostname(e);return-1===(r="."+r).indexOf(t)&&""!==t}function getKeywordFromReferrer(e,t){e=e||document.referrer;var r=sdPara.source_type.keyword;if(document&&isString(e)){if(0===e.indexOf("http")){var n=getReferSearchEngine(e),i=getQueryParamsFromUrl(e);if(isEmptyObject(i))return sdPara.preset_properties.search_keyword_baidu&&isBaiduTraffic()?void 0:"\u672a\u53d6\u5230\u503c";var a=null;for(var s in r)if(n===s&&isObject(i))if(isArray(a=r[s]))for(s=0;s-1&&r.splice(i,1),_localStorage.remove(e[n])}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);null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),r=this.generateTabStorageVal()):r=safeJSONParse(r)||this.generateTabStorageVal(),r.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=0;ti.expireTime&&this.serverUrl===i.serverUrl&&new ConcurrentStorage("sajssdk-lock-get-").get(r,1e4,1e3,function(e){if(e){null===_localStorage.get(n.tabKey)&&n.generateTabStorage();var t=safeJSONParse(e)||n.generateTabStorageVal(),r=safeJSONParse(_localStorage.get(n.tabKey))||n.generateTabStorageVal();r.data=unique(r.data.concat(t.data)),_localStorage.set(n.tabKey,JSON.stringify(r))}})}else if(0===r.indexOf("sajssdk-lock-get-")){var s=safeJSONParse(_localStorage.get(r))||{expireTime:0};now()-s.expireTime>1e4&&_localStorage.remove(r)}}for(var o=0;o0)for(t=0;tsdPara.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!(indexOf(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(indexOf(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=store._state.history_login_id;return!(t&&t.name&&t.name===e||indexOf(this.bindReservedNames,e)>-1)}},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,t){check({propertyKey:t}),check({propertyValue:e},function(e,r,n){return e||(r=t+"'s Value",isFunction(checkLog[n])&&checkLog[n](r)),!0})}):ruleOption.voidZero(e)&&sdWarn("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return e!==undefined&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdWarn("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!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 n=this[e];if(isFunction(n))return n.call(this,t);if(!n)return!1;for(var i=0;i-1;if(isObject(r)&&"$option"!==n&&!a)try{e[n]=JSON.stringify(r)}catch(s){delete e[n],sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else isString(r)||isNumber(r)||isDate(r)||isBoolean(r)||isArray(r)||isFunction(r)||"$option"===n||a||(sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete e[n])}),e):e}function formatString(e,t){return isNumber(t)&&e.length>t?(sdWarn("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function filterReservedProperties(e,t){isObject(e)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(r,n){r in e&&(indexOf(t||[],r)>-1||(n<3?(delete e[r],sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function searchObjString(e){var t=["$element_selector","$element_path"],r=["sensorsdata_app_visual_properties"];isObject(e)&&each(e,function(n,i){if(isObject(n))searchObjString(e[i]);else if(isString(n)){if(indexOf(r,i)>-1)return;e[i]=formatString(n,indexOf(t,i)>-1?1024:sdPara.max_string_length)}})}function searchZZAppStyle(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(e){"item_type"in e&&check({item_type:e.item_type},function(t){return t||delete e.item_type,!0}),"item_id"in e&&check({item_id:e.item_id},function(t,r,n){return t||"string"!==n||delete e.item_id,!0})}function formatProperties(e,t){each(e,function(r,n){-1===indexOf(t||[],n)&&check({propertyKey:n},function(t,r,i){return t||"keyLength"===i||delete e[n],!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){var r=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(),r.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={server_url:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.server_url))return sdError("----vcollect---server_url\u5fc5\u987b\u4e3a\u6709\u6548 URL \u5b57\u7b26\u4e32"),!1;try{e=_URL(sd.para.server_url),r.server_url.project=e.searchParams.get("project")||"default",r.server_url.host=e.host}catch(n){return sdError("----vcollect---server_url\u89e3\u6790\u5f02\u5e38",n),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(n){return sdError("----vcollect---\u9875\u9762\u5730\u5740\u89e3\u6790\u5f02\u5e38",n),!1}return r},isDiv:function(e){return!e.element_path||"div"===trim(e.element_path.split(">").pop()).slice(0,3)},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 e.$element_selector.indexOf(t.element_selector)>-1}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 e.$element_path.indexOf(t.element_path)>-1}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(e.$element_position!==undefined){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(e,t,r){var n=[];if(!r){var i=vtrackBase.initUrl();if(!i)return[];r=i.page_url}return"$WebClick"===e.event&&each(t,function(t){isObject(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&isObject(t.event)&&t.event.url_host===r.host&&t.event.url_path===r.pathname&&vtrackBase.configIsMatch(e.properties,t.event)&&n.push(t)}),n},getPropElInLi:function(e,t){if(!(e&&isElement(e)&&isString(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r=sd.heatmap.getDomSelector(e);return r?getDomBySelector(r+t)||null:(sdWarn("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",r,t),null)},getProp:function(e,t){if(!isObject(e))return!1;if(!(isString(e.name)&&e.name.length>0))return sdWarn("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var r,n,i={};if("content"===e.method){var a;if(isString(e.element_selector)&&e.element_selector.length>0)a=getDomBySelector(e.element_selector);else{if(!t||!isString(e.list_selector))return sdWarn("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=getDomBySelector(t.properties.$element_selector);if(!s)return sdWarn("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var o=sd.heatmap.getClosestLi(s);a=vtrackBase.getPropElInLi(o,e.list_selector)}if(!a||!isElement(a))return sdWarn("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===a.tagName.toLowerCase())r=a.value||"";else if("select"===a.tagName.toLowerCase()){var l=a.selectedIndex;isNumber(l)&&isElement(a[l])&&(r=getElementContent$1(a[l],"select"))}else r=getElementContent$1(a,a.tagName.toLowerCase());if(e.regular){try{n=new RegExp(e.regular).exec(r)}catch(d){return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===n)return sdWarn("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!isArray(n)||!isString(n[0]))return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;r=n[0]}if("STRING"===e.type)i[e.name]=r;else if("NUMBER"===e.type){if(r.length<1)return sdWarn("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;if(isNaN(Number(r)))return sdWarn("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;i[e.name]=Number(r)}return i}return sdError("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},getAssignConfigs:function(e,t){var r=vtrackBase.initUrl();if(!r||!r.page_url)return[];if(!isObject(t))return[];var n=[];return t.events=t.events||t.eventList,isArray(t.events)&&t.events.length>0?(each(t.events,function(t){isObject(t)&&isObject(t.event)&&t.event.url_host===r.page_url.host&&t.event.url_path===r.page_url.pathname&&e(t)&&n.push(t)}),n):[]}},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(e){var t={},r=[],n=this;if(!this.events.length)return{};if("$WebClick"===e.event){var i=this.filterConfig(e,this.events);if(!i.length)return{};each(i,function(i){isObject(i)&&(isArray(i.properties)&&i.properties.length>0&&each(i.properties,function(r){if(isObject(r))if(!1===r.h5)isArray(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(r);else{var i=n.getProp(r,e);isObject(i)&&(t=extend(t,i))}}),isString(i.event_name)&&r.push(i.event_name))}),sd.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=r)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new sd.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(r){var n={};try{r=JSON.parse(base64Decode(r))}catch(s){sdError("getJSVisualProperties data parse error!")}if(isObject(r)){var i=r.sensorsdata_js_visual_properties,a=e.initUrl();a&&(a=a.page_url,isArray(i)&&i.length>0&&each(i,function(t){if(isObject(t)&&t.url_host===a.host&&t.url_path===a.pathname&&t.h5){var r=e.getProp(t);isObject(r)&&(n=extend(n,r))}}))}return"android"===sd.bridge.bridge_info.platform&&t.notifyApp({data:n},r.message_id),n}),t}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(base64Decode(t))}catch(r){return void sdError("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(base64Decode(e))}catch(t){e=null,sdError("getAppVisualConfig result parse error\uff01")}return e},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))return!1;for(var r=0;r0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,r){var n=this;r=r||this.filterConfig(e,t,vtrackcollect.url_info.page_url);var i={};return r.length?(each(r,function(t){isArray(t.properties)&&t.properties.length>0&&each(t.properties,function(t){var r=n.getProp(t,e);isObject(r)&&extend(i,r)})}),i):{}},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=vtrackBase.initUrl();if(e){var t;try{(t=new urlParse(sd.para.server_url))._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return sdError("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)return!1;if(_localStorage.isSupport()||(this.storageEnable=!1),!this.initUrl())return sdError("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=store.readObjectVal(this.storage_name);if(isObject(e)&&isObject(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime()-this.update_time;if(isNumber(t)&&t>0&&t0&&t-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===i&&sd.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)&&((sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1)>1||r.isCollectableDiv(n)))return n;if(r.isStyleTag(i)&&sd.para.heatmap.collect_tags.div){var o=r.getCollectableParent(n);if(o&&r.isDivLevelValid(o))return o}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var r=heatmap.getElementPath(e,!0,t).split(" > "),n=0;return each(r,function(e){"div"===e&&n++}),n},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(heatmap.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&isElement(e);){if(!isString(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){return function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&isString(e.tagName)&&"li"===e.tagName.toLowerCase())return e;return null}(e)},getElementPosition:function(e,t,r){var n=sd.heatmap.getClosestLi(e);if(!n||!isElement(e)||!isString(e.tagName))return null;var i=e.tagName.toLowerCase(),a=n.getElementsByTagName(i),s=a.length,o=[];if(s>1){for(var l=0;l1)return indexOf(o,e)}return function(e){if(!e.parentNode)return"";if(1===ry(e).getSameTypeSiblings().length)return 0;for(var t=0,r=e;ry(r).previousElementSibling().ele;r=ry(r).previousElementSibling().ele,t++);return t}(n)},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),sd.para.heatmap_url||(sd.para.heatmap_url=getSafeHttpProtocol()+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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});r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);var n=sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);return isNumber(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){if(!e)return{};function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}return function(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,s=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(s)}}(e)},start:function(e,t,r,n,i){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collect_element)&&!sd.para.heatmap.collect_element(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,n,i))},getBasicEleInfo:function(e,t,r,n,i){var a=isObject(n)?n:{},s=isFunction(i)?i:isFunction(n)?n:undefined,o=this.getEleDetail(t);if(sd.para.heatmap&&sd.para.heatmap.custom_property){var l=sd.para.heatmap.custom_property(t);isObject(l)&&(o=extend(o,l))}return{event:e,target:t,props:o=extend(o,this.getPointerEventProp(e,t),a),tagName:r,callback:s}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=ry(e.element).getParents());if(r&&isArray(r)&&r.length>0)for(var i=0;i-1)&&(!t||sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collect_tags)&&isObject(sd.para.heatmap.collect_tags.div)&&isArray(sd.para.heatmap.collect_tags.div.ignore_tags)&&indexOf(sd.para.heatmap.collect_tags.div.ignore_tags,e)>-1):indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){sdError("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=sd.para&&sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){sdError("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.scroll_notice_map)return!1;var e=!0;sd.para.scrollmap&&isFunction(sd.para.scrollmap.collect_url)&&this.listenUrlChange(function(){e=!!sd.para.scrollmap.collect_url()});var t=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t}({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>sd.para.heatmap.scroll_delay_time&&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.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=n}});t.current_time=new Date,saAddEvent(window,"scroll",function(){if(!e)return!1;t.go()}),saAddEvent(window,"unload",function(){if(!e)return!1;t.go("notime")})},initHeatmap:function(){var e=this,t=!0;if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)return!1;isFunction(sd.para.heatmap.collect_url)&&this.listenUrlChange(function(){t=!!sd.para.heatmap.collect_url()}),"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(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var s=isString(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===s||"button"===s?e.start(n,i.parentNode,s):e.start(n,i,a)}):saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement,a=sd.heatmap.getTargetElement(i,r);if(!isElement(a)&&!isString(i.tagName))return!1;isElement(a)&&isString(a.tagName)?e.start(n,a,a.tagName.toLowerCase()):isElement(i)&&"div"===i.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&unlimitedDiv.events.length>0&&unlimitedDiv.isTargetEle(i)&&e.start(n,i,i.tagName.toLowerCase(),{$lib_method:"vtrack"})})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),t={};return each(e,function(e,r,n){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+r+" ")?t["$"+r]=n[r]:t[r]=n[r]}),t}function sendFirstProfile(e,t,r){if(sd.is_first_visitor&&r){var n={};sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(n.$search_keyword_id=getBaiduKeyword.id(),n.$search_keyword_id_type=getBaiduKeyword.type(),n.$search_keyword_id_hash=hashCode53(n.$search_keyword_id));var i=getReferrer(null,t);e(extend({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?getHostname(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),n)),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.setProfile(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("sensorsdata_2015_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var n in e)!(n in t&&t[n]!==e[n])&&n in t||(t[n]=e[n],r=!0);r&&(store.saveObjectVal("sensorsdata_2015_jssdk_profile",t),sd.setProfile(e))}else store.saveObjectVal("sensorsdata_2015_jssdk_profile",e),sd.setProfile(e)},setInitReferrer:function(){var e=getReferrer();sd.setOnceProfile({_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){if("object"==typeof e&&e.tagName&&isElement(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||hasAttributes(e,a)||heatmap.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();heatmap.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){var r;r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer;var n=!(e=isObject(e)?e:{}).not_set_profile;function i(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,i(e,t),this.autoTrackSinglePage=i,sendFirstProfile(sd.setOnceProfile,!1,n)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=isObject(e)?e:{};var r=getClassifiedUtms(),n=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var i=location.href;sd.para.is_single_page&&addHashEvent(function(){var n=getReferrer(i,!0);sd.track("$pageview",extend({$referrer:n,$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),i=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),sendFirstProfile(sd.setOnceProfile,!0,n),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store.getAnonymousId()},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]?e(window.SensorsDataWebJSSDKPlugin[t]):isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sdWarn(t+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function loginBody(e,t){var r=e.id,n=e.callback,i=e.name,a=store.getFirstId(),s=store.getOriginDistinctId();if(!check({distinct_id:r}))return sdError("login id is invalid"),!1;if(r===store.getOriginDistinctId()&&!a)return sdError("login id is equal to distinct_id"),!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(i)&&r===store._state.first_id)return!1;if(store._state.history_login_id.name!==i||r!==store._state.history_login_id.value){store._state.identities[i]=r,store.set("history_login_id",{name:i,value:r}),a||store.set("first_id",s),t(r,"$SignUp",{},n);var o={$identity_cookie_id:store._state.identities.$identity_cookie_id};return o[i]=r,resetIdentities(o),!0}return!1}function resetIdentities(e){var t={};for(var r in e)t[r]=e[r];store._state.identities=t,store.save()}function deleteBindIDData(e,t){if(!check({unbindKey:e,bindValue:t}))return!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t){var r=store.getUnionId().login_id;r&&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())}var n={};return n[e]=t,n}function setInitVar(){sd._t=sd._t||1*new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var n in sd.para.is_track_latest)r["latest_"+n]=sd.para.is_track_latest[n];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 i=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],o={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof sd.para.source_type&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(i):i,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(a):a,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(s):s,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(o,sd.para.source_type.keyword):o);var l=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)){sd.para.heatmap.clickmap=sd.para.heatmap.clickmap||"default",sd.para.heatmap.scroll_notice_map=sd.para.heatmap.scroll_notice_map||"default",sd.para.heatmap.scroll_delay_time=sd.para.heatmap.scroll_delay_time||4e3,sd.para.heatmap.scroll_event_duration=sd.para.heatmap.scroll_event_duration||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);var d=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];d.push("data-sensors-click"),sd.para.heatmap.track_attr=d,isObject(sd.para.heatmap.collect_tags)?!0===sd.para.heatmap.collect_tags.div?sd.para.heatmap.collect_tags.div={ignore_tags:l,max_level:1}:isObject(sd.para.heatmap.collect_tags.div)?(sd.para.heatmap.collect_tags.div.ignore_tags?isArray(sd.para.heatmap.collect_tags.div.ignore_tags)||(sdWarn("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),sd.para.heatmap.collect_tags.div.ignore_tags=l):sd.para.heatmap.collect_tags.div.ignore_tags=l,sd.para.heatmap.collect_tags.div.max_level&&-1===indexOf([1,2,3],sd.para.heatmap.collect_tags.div.max_level)&&(sd.para.heatmap.collect_tags.div.max_level=1)):sd.para.heatmap.collect_tags.div=!1:sd.para.heatmap.collect_tags={div:!1}}sd.para.server_url=optimizeServerUrl(sd.para.server_url),!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.collect_tags&&isObject(sd.para.heatmap.collect_tags)&&each(sd.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&"default"===sd.para.heatmap.clickmap&&sd.heatmap.initUnlimitedTags()}var readyState={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},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):sdWarn("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0])}var nonameCount=1;function use(e,t){if(isString(e)||isObject(e)){var r;if(isObject(e)){var n=sd.modules&&sd.modules[e.plugin_name];n&&n!==e&&sdWarn(e.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),r=n||e}return 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.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[e]&&(r=window.sensorsDataAnalytic201505.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||sdWarn("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&sdWarn("warning: plugin version not match SDK version. plugin may not work correctly. "):sdWarn("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,r):(sdWarn((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),r)}sdError("use's first arguments must be string or object.")}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){var r=deleteBindIDData(e,t);r&&saEvent.send({identities:r,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(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&!(!e.href||/^javascript/.test(e.href)||e.target)&&void saAddEvent(e,"click",function(n){n.preventDefault();var i=!1;function a(){i||(i=!0,location.href=e.href)}setTimeout(a,1e3),sd.track(t,r,a)})}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 setProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function setOnceProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function appendProfile(e,t){check({propertiesMust:e})&&(each(e,function(t,r){isString(t)?e[r]=[t]:isArray(t)?e[r]=t:(delete e[r],sdWarn("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),isEmptyObject(e)||saEvent.send({type:"profile_append",properties:e},t))}function incrementProfile(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!1;return!0}(e)?saEvent.send({type:"profile_increment",properties:e},t):sdError("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}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,n={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?n[e]=!0:sdWarn("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),saEvent.send({type:"profile_unset",properties:n},t)):sdError("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function identify(e){"number"==typeof e&&(e=String(e));var t=store.getFirstId();if(void 0===e){var r=UUID();t?store.set("first_id",r):store.set("distinct_id",r)}else check({distinct_id:e})&&(t?store.set("first_id",e):store.set("distinct_id",e))}function resetAnonymousIdentity(e){if(store.getFirstId())return sdError("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),void 0===e){var t=UUID();store._state.identities.$identity_cookie_id=t,store.set("distinct_id",t)}else check({distinct_id:e})&&(store._state.identities.$identity_cookie_id=e,store.set("distinct_id",e))}function sendSignup(e,t,r,n){var i=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:i,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function trackSignup(e,t,r,n){"number"==typeof e&&(e=String(e)),check({distinct_id:e,event:t,properties:r})&&sendSignup(e,t,r,n)}function registerPage(e){check({properties:e})?extend(pageInfo.currentProps,e):sdError("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){var t;if(isArray(e)&&e.length>0)for(t=0;t-1?n:"https:")+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/vapph5define.min.js"})}else r();else r()}function listenSinglePage(e){sd.para.is_track_single_page&&spa.on("switch",function(t){var r=function(r){if(r=r||{},t!==location.href){pageInfo.pageProp.referrer=getURL(t);var n=extend({$url:getURL(),$referrer:getURL(t)},r);isFunction(e)?e(n):sd.quick&&sd.quick("autoTrack",n)}};if("boolean"==typeof sd.para.is_track_single_page)r();else if("function"==typeof sd.para.is_track_single_page){var n=sd.para.is_track_single_page();isObject(n)?r(n):!0===n&&r()}})}function enterFullTrack(){sd._q&&isArray(sd._q)&&sd._q.length>0&&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","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","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=[]),sdWarn("calling sdk api before init is deprecated."),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);sdError("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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 n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},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)&&r.length>0)for(var n={current:0,total:r.length},i=new InterceptorContext(t,n,sd),a=0;a=2)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="1.26.9";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return"dfm-enc-"+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf("dfm-enc-")&&(e=e.substring("dfm-enc-".length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="1.26.9";function wrapPluginInitFn$1(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$1(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$1(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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 t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),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="1.26.9";function wrapPluginInitFn$2(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$2(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$2(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(),log("---test---fail---",!sd$1,sd$1.bridge.activeBridge,!anServerUrl),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),log("---test---bridge-verify-",sd$1.bridge.is_verify_success)),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("---test---app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){if(log("---test---datasend-",sd$1.bridge.is_verify_success),sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$1.bridge.is_verify_success?(log("---test---bridge-verify-success---",e.data),anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({server_url:sd$1.para.server_url},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(log("---test---bridge-verify-fail-----",sd$1.bridge.is_verify_success),sd$1.para.app_js_bridge.is_send?(sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_$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="1.26.9";function wrapPluginInitFn$3(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$3(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$3(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(){if(log$1("ObsoleteBridge---test---init---"),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,log$1("ObsoleteBridge-",sd$2.bridge.activeBridge,anVerify,anTrack$1,anVisualVerify),sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)){sd$2.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack$1;anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({server_url:sd$2.para.server_url})),log$1("ObsoleteBridge---called-return",e)),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){if(log$1("ObsoleteBridge---senddata"),sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(anVerify){var n=anVerify&&anVerify.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data)));return log$1("ObsoleteBridge---anVerify-success",n),n?(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$2.para.app_js_bridge.is_send?(sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return log$1("ObsoleteBridge---is-send-old-way",sd$2.para.app_js_bridge.is_send),anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function handleCommand$1(e){log$1("ObsoleteBridge---handleCommadn");var t=e.callType;return t in vbridge$1$1.commands?(log$1("ObsoleteBridge---",t,vbridge$1$1.commands),vbridge$1$1.commands[t](e,anBridge$1)):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?(log$1("ObsoleteBridge---handleCommadn-abridge"),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="1.26.9";function wrapPluginInitFn$4(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$4(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$4(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var hidden,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||"sensorsdata2015jssdkchannel",sd$3=e;var r=this;!function(){if(_$3=sd$3._,store$1=sd$3.store,!_$3.localStorage.isSupport())return!1;sd$3.para.max_string_length=1024,r.eventList.init(),r.addLatestChannelUrl(),r.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd$3.registerPage({$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();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_$3.isReferralTraffic(document.referrer)){var r=_$3.getQueryParam(location.href,"sat_cf");_$3.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd$3.registerPage(t):sd$3.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd$3.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name));return e=_$3.safeJSONParse(e),!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);sd$3.para.encrypt_cookie&&(r=sd$3.kit.userEncrypt(r)),_$3.cookie.set(cookie_name,r)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$5(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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"undefined"!=typeof document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var iosServerUrl,iosTracker,sd$4,_$4,log$2,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){var t=e._.URL(e.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},handleAndroidLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=t;e.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,e.timer=setTimeout(function(){var t=isPageHidden();if(e.log("hide:"+hidden+":"+document[hidden]),t)return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=r},e.timeout)},handleIOSLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 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\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),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){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=e,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&isObject$1(arguments[0])?t=arguments[0]:arguments.length>=2&&isObject$1(arguments[1])&&(t=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=parseShortURL(n);if(!i)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f 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,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="1.26.9";function wrapPluginInitFn$6(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$6(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$6(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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){if(sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({server_url:sd$4.para.server_url},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$4.para.app_js_bridge.is_send?(sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_$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="1.26.9";function wrapPluginInitFn$7(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$7(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$7(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=_$5.URL(sd$5.para.server_url).hostname,r=_$5.URL(sd$5.para.server_url).searchParams.get("project")||"default"}catch(n){sd$5.log(n)}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)return e;var r,n,i=e.callback;if(sd$5.bridge.bridge_info.verify_success){var a=document.createElement("iframe"),s=(r=e.data,n=(n=JSON.stringify(_$5.extend({server_url:sd$5.para.server_url},r))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return a.setAttribute("src",s),document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null,_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),!0}return sd$5.para.app_js_bridge.is_send?(sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),e)}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="1.26.9";function wrapPluginInitFn$8(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$8(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$8(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}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\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},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,1==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},PageLeave.prototype.pageEndHandler=function(){if(!0!==this.page_hidden_status){var 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 e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.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;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},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;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var r=this.sd.store.readObjectVal(t);this._.isObject(r)&&1*new Date-r.time>r.heartbeat_interval_time+5e3&&(delete r.heartbeat_interval_time,r._flush_time=(new Date).getTime(),this.sd.kit.sendData(r),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),this._.extend(n,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="1.26.9";function wrapPluginInitFn$9(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$9(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$9(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){function r(){var n=0,i=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,a={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(i?(n=function(t){var r=0;return e._.isFunction(t.getEntriesByType)&&(r=((t.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),r}(i)||function(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}(i),function(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}(i,a)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),n>0){var s=e._.isObject(t)&&t.max_duration||1800;n=Number((n/1e3).toFixed(3)),(!e._.isNumber(s)||s<=0||n<=s)&&(a.event_duration=n)}eventSent||(e.track("$WebPageLoad",a),eventSent=!0),window.removeEventListener?window.removeEventListener("load",r):window.detachEvent&&window.detachEvent("onload",r)}"complete"==document.readyState?r():window.addEventListener?window.addEventListener("load",r):window.attachEvent&&window.attachEvent("onload",r)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),s=t.customRegister,o=a.properties,l=a.event,d={};return n.each(s,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(d=n.extend(d,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:o,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(d=n.extend(d,t))}}),e.properties=n.extend(o,d),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder$b="1.26.9";function wrapPluginInitFn$a(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$a(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$a(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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="1.26.9";function wrapPluginInitFn$b(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$b(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$b(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(i){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}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 \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="1.26.9";function wrapPluginInitFn$c(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$c(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$c(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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-1)return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r-1)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=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),i="";if(n){var a,s=n[1]||"",o=n[2]||"",l=n[3]||"",d="_sasdk="+this.getCurrenId(),c=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(d):n.push(e)}),n.join("&")};return this.getPartHash(e)?(a=l.indexOf("_sasdk"),i=l.indexOf("?")>-1?a>-1?s+o+"#"+l.substring(1,a)+c(l.substring(a,l.length)):s+o+l+"&"+d:s+o+"#"+l.substring(1)+"?"+d):(a=o.indexOf("_sasdk"),i=/^\?(\w)+/.test(o)?a>-1?s+"?"+c(o.substring(1))+l:s+o+"&"+d+l:s+"?"+d+l),t&&(t.href=i),i}},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},setRefferId:function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);(r=r.substring(1))!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},addListen:function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),s=i.parentNode;if("a"===a&&i.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===a&&i.href?(r=i.href,n=i):(r=s.href,n=s);var o=e._.URL(r).protocol;"http:"!==o&&"https:"!==o||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},init:function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var r=t.length,n=[],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$d(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(){return e=source_channel_standard$1.split(" "),t="",r={},sd$6._.isArray(sd$6.para.source_channel)&&sd$6.para.source_channel.length>0&&(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;var e,t,r}}})}},index$d=createPlugin$d(utm,"Utm","sdkAfterInitPara"),sdkversion_placeholder$f="1.26.9";function wrapPluginInitFn$e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$e(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$e(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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="1.26.9";function wrapPluginInitFn$f(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$f(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$f(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$f(e,t,r){return wrapPluginInitFn$f(e,t,r),e.plugin_version=sdkversion_placeholder$g,e}function debugPath(e){var t,r=e;t=-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:t,type:"GET",cors:!0,header:{"Dry-Run":String(sd$8.para.debug_mode_upload)},success:function(e){!0===_$6.isEmptyObject(e)?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+r):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData$4(e,t){if(!0===sd$8.para.debug_mode){var r=e.data;e.callback,debugPath(JSON.stringify(r)),t.cancellationToken.stop()}return 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.server_url)?sd$8.para.debug_mode_url=sd$8.para.server_url.replace("sa.gif","debug"):_$6.isArray(sd$8.para.server_url)&&_$6.isString(sd$8.para.server_url[0])?sd$8.para.debug_mode_url=sd$8.para.server_url[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="1.26.9";function wrapPluginInitFn$g(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$g(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$g(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){if(_$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()}return 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){if(!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData){sd$9.para.jsapp.isOnline=!0;var t=sd$9.para.jsapp.getData();_$7.isArray(t)&&t.length>0&&_$7.each(t,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})}else 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="1.26.9";function wrapPluginInitFn$h(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$h(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$h(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$i(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){var r=null,n=null;if(_$9.isObject(e.config)&&(r=e.config.send_type,n=_$9.optimizeServerUrl(e.config.server_url)),("beacon"===r||!r&&"beacon"===sd$b.para.send_type)&&_$9.isSupportBeaconSend()){var i=n||e.server_url;e.server_url=i,e.data=sd$b.kit.encodeTrackData(e.data),_$9.isArray(i)&&i.length?_$9.each(i,function(t){e.callback=null,e.server_url=t,sendData$7(e)}):"string"==typeof i&&""!==i?sendData$7(e):sd$b.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$3(){"beacon"!==sd$b.para.send_type||_$9.isSupportBeaconSend()||(sd$b.para.send_type="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="1.26.9";function wrapPluginInitFn$j(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$j(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$j(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){var r=null,n=null;if(_$a.isObject(e.config)&&(r=e.config.send_type,n=_$a.optimizeServerUrl(e.config.server_url)),("ajax"===r||!r&&"ajax"===sd$c.para.send_type)&&_$a.isSupportCors()){var i=n||e.server_url;e.server_url=i,e.data=sd$c.kit.encodeTrackData(e.data),_$a.isArray(i)&&i.length?_$a.each(i,function(t){e.callback=null,e.server_url=t,sendData$8(e)}):"string"==typeof i&&""!==i?sendData$8(e):sd$c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$4(){"ajax"!==sd$c.para.send_type||_$a.isSupportCors()||(sd$c.para.send_type="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="1.26.9";function wrapPluginInitFn$k(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$k(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$k(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){var r=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+r:e+"?"+r}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(e,t){var r=null;_$b.isObject(e.config)&&(r=_$b.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,_$b.isArray(n)&&n.length?_$b.each(n,function(t){t&&(e.data=getSendUrl(t,i),e.callback=null,e.server_url=t,sendData$9(e))}):"string"==typeof n&&""!==n?(e.data=getSendUrl(n,i),sendData$9(e)):sd$d.logger&&sd$d.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.send_type&&"ajax"!==sd$d.para.send_type&&"beacon"!==sd$d.para.send_type&&(sd$d.para.send_type="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}})})}var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender);function wrapPluginInitFn$l(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$l(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$l(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$l(e,t,r){return wrapPluginInitFn$l(e,t,r),e.plugin_version=sdkversion_placeholder,e}var _sd$1=null,_$c=null,_cacheLogs=[],ConsoleLogger={init:function(e){e&&(_$c=(_sd$1=e)._,_sd$1.logger&&_sd$1.logger.appendWriter(logWriter),_sd$1.on&&_sd$1.on("sdkAfterInitPara",function(){for(var e=0;e<_cacheLogs.length;e++)printLog(_cacheLogs[e]);_cacheLogs=null}),_sd$1.on&&_sd$1.on("sdkInitAPI",function(){_sd$1.enableLocalLog=enableLocalLog,_sd$1.disableLocalLog=disableLocalLog}))}},consoleLogger=createPlugin$l(ConsoleLogger,"ConsoleLogger");function logWriter(e){null!==_cacheLogs?_cacheLogs.push(e):printLog(e)}function printLog(e){try{if("log"===e.level&&canLog())return void writeLog(e);if("warn"===e.level&&canWarn())return void writeLog(e);if("error"===e.level&&canError())return void writeLog(e)}catch(t){}}function canLog(){return!!isLocalLogEnabled()||!0===_sd$1.para.show_log||_$c.isObject(_sd$1.para.show_log)&&"log"===_sd$1.para.show_log.level}function canWarn(){return!!isLocalLogEnabled()||canLog()||_$c.isObject(_sd$1.para.show_log)&&"warn"===_sd$1.para.show_log.level}function canError(){return!!isLocalLogEnabled()||!_$c.isObject(_sd$1.para.show_log)||"none"!==_sd$1.para.show_log.level}function writeLog(e){var t=e.content,r=_$c.isObject(t[0])?_$c.formatJsonString(t[0]):t[0],n=getLogHead(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(_$c.isFunction(console[e.level])?console[e.level].apply(console,t):_$c.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function getLogHead(e){var t="",r="",n=_sd$1.para.show_log;return _$c.isObject(n)&&!1===n.show_brand||(t+=e.brand),_$c.isObject(n)&&!1===n.show_level||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),_$c.isObject(n)&&!1===n.show_module||(r=e.module),t+r}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _$c.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}sd.modules=sd.modules||{};for(var builtinPlugins=[consoleLogger,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=[consoleLogger,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 Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("https://www.sensorsdata.cn/"),"https://www.sensorsdata.cn/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{d(e)||(e=String(e)),e=p(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void zi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new Qi(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement||a.target;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(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){zi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(ea&&e.forEach===ea)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText),i.status):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){zi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(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 j(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}function I(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(p){zi.log(p)}n&&d()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function T(e){return k(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 A(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function D(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,document.cookie.indexOf(t+"=true")!==-1){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function J(e){function t(e,t){e=p(e);var r;if("body"===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 o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){zi.log(o)}return i&&_(i)?r(i):null}if(!d(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=p(e.textContent):e.innerText&&(r=p(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 q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){zi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function V(e,t){var r=g(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i){var a=F(i);n=a[t]||""}}return n}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){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(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){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 Z(e){return d(e)?(e=p(e),A(e)):A(location.href)}function G(e){return d(e)?(e=p(e),A(e)):A(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function pe(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!d(t.callbackName))return zi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(n.defer="defer",i.appendChild(n),ce(t.timeout)){var s=Math.min(t.timeout,3e5);a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){zi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},s)}if(window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){zi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var l=[];k(t.data,function(e,t){l.push(t+"="+e)}),t.data=l.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){zi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=encodeURI(t.url)}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.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;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.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 he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,d)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else d(i)||ce(i)||$(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function it(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function at(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function ot(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))ot(e[a]);else if(d(i)){if(re(n,a)>-1)return;e[a]=it(i,re(t,a)>-1?1024:pa.max_string_length)}})}function st(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function lt(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};rt({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};rt({item_id:n},i)}}function ut(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&rt({propertyKey:n},i)})}function ct(e){var t=e.properties;ye(e),r(t)?(nt(t),at(t),st(e),ut(t),ot(t)):"properties"in e&&(e.properties={}),lt(e)}function dt(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function pt(e,t){try{var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,xa.getIdentities());var a={identities:i,distinct_id:xa.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,xa.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),"$UnbindID"===a.event&&(a.login_id&&delete a.login_id,a.anonymous_id&&delete a.anonymous_id),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},wa.properties(),xa.getProps(),xa.getSessionProps(),wa.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!d(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!d(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&d(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&d(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!d(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!d(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!d(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),d(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&$(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ha.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=qa.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),ka.checkIsAddSign(a),ka.checkIsFirstTime(a),Fe(a),Ve(a),a}catch(o){return{_debug_web_msg:String(o)}}}function ft(e){return Fa.stage.process("basicProps",e)}function gt(e){return Fa.stage.process("formatData",e)}function _t(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&Be(e.ele,"click",function(e){i(e)}))))}function ht(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function mt(e){return Wa.stage.process("webClickEvent",e)}function vt(e){return Wa.stage.process("webStayEvent",e)}function yt(){var e=wa.campaignParams(),t={};return k(e,function(e,r,n){(" "+Vi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function bt(e,t,r){if(Vi.is_first_visitor&&r){var n={};Vi.para.preset_properties.search_keyword_baidu&&xe(document.referrer)&&Te()&&(n.$search_keyword_id=ya.id(),n.$search_keyword_id_type=ya.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=$e(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:d(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:d(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:He(),$first_search_keyword:Ee()},yt(),n)),Vi.is_first_visitor=!1}}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=xa.getFirstId(),s=xa.getOriginDistinctId();if(!rt({distinct_id:n}))return je("login id is invalid"),!1;if(n===xa.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"), -!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(a)&&n===xa._state.first_id)return!1;var l=xa._state.history_login_id.name!==a||n!==xa._state.history_login_id.value;if(l){xa._state.identities[a]=n,xa.set("history_login_id",{name:a,value:n}),o||xa.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:xa._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];xa._state.identities=t,xa.save()}function kt(e,t){if(!rt({unbindKey:e,bindValue:t}))return!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(e)&&xa._state.identities[e]===t){var n=xa.getUnionId().login_id;n&&e+"+"+t===n&&(xa._state.distinct_id=xa._state.first_id,xa._state.first_id="",xa.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete xa._state.identities[e],xa.save())}var i={};return i[e]=t,i}function Pt(){Vi._t=Vi._t||1*new Date,Vi.is_first_visitor=!1,Vi.source_channel_standard=ga}function Ct(e){P(pa,e||Vi.para||{}),Vi.para=pa;var t={};if(r(Vi.para.is_track_latest))for(var n in Vi.para.is_track_latest)t["latest_"+n]=Vi.para.is_track_latest[n];Vi.para.preset_properties=P({},fa.preset_properties,t,Vi.para.preset_properties||{});var i;for(i in fa)void 0===Vi.para[i]&&(Vi.para[i]=fa[i]);"string"!=typeof Vi.para.web_url||"://"!==Vi.para.web_url.slice(0,3)&&"//"!==Vi.para.web_url.slice(0,2)||("://"===Vi.para.web_url.slice(0,3)?Vi.para.web_url=location.protocol.slice(0,-1)+Vi.para.web_url:Vi.para.web_url=location.protocol+Vi.para.web_url),ba.protocol.serverUrl(),Vi.bridge&&Vi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Vi.para.source_type&&(Vi.para.source_type.utm=v(Vi.para.source_type.utm)?Vi.para.source_type.utm.concat(a):a,Vi.para.source_type.search=v(Vi.para.source_type.search)?Vi.para.source_type.search.concat(o):o,Vi.para.source_type.social=v(Vi.para.source_type.social)?Vi.para.source_type.social.concat(s):s,Vi.para.source_type.keyword=r(Vi.para.source_type.keyword)?P(l,Vi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Vi.para.heatmap&&!r(Vi.para.heatmap)&&(Vi.para.heatmap={}),r(Vi.para.heatmap)){Vi.para.heatmap.clickmap=Vi.para.heatmap.clickmap||"default",Vi.para.heatmap.scroll_notice_map=Vi.para.heatmap.scroll_notice_map||"default",Vi.para.heatmap.scroll_delay_time=Vi.para.heatmap.scroll_delay_time||4e3,Vi.para.heatmap.scroll_event_duration=Vi.para.heatmap.scroll_event_duration||18e3,Vi.para.heatmap.renderRefreshTime=Vi.para.heatmap.renderRefreshTime||1e3,Vi.para.heatmap.loadTimeout=Vi.para.heatmap.loadTimeout||1e3,Vi.para.heatmap.get_vtrack_config!==!0&&(Vi.para.heatmap.get_vtrack_config=!1);var d=v(Vi.para.heatmap.track_attr)?U(Vi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),Vi.para.heatmap.track_attr=d,r(Vi.para.heatmap.collect_tags))if(Vi.para.heatmap.collect_tags.div===!0)Vi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Vi.para.heatmap.collect_tags.div)){if(Vi.para.heatmap.collect_tags.div.ignore_tags?v(Vi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Vi.para.heatmap.collect_tags.div.ignore_tags=c):Vi.para.heatmap.collect_tags.div.ignore_tags=c,Vi.para.heatmap.collect_tags.div.max_level){var p=[1,2,3];re(p,Vi.para.heatmap.collect_tags.div.max_level)===-1&&(Vi.para.heatmap.collect_tags.div.max_level=1)}}else Vi.para.heatmap.collect_tags.div=!1;else Vi.para.heatmap.collect_tags=u}Vi.para.server_url=Ge(Vi.para.server_url),Vi.para.noCache===!0?Vi.para.noCache="?"+(new Date).getTime():Vi.para.noCache="",Vi.para.callback_timeout>Vi.para.datasend_timeout&&(Vi.para.datasend_timeout=Vi.para.callback_timeout),Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&r(Vi.para.heatmap.collect_tags)&&k(Vi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Vi.heatmap.otherTags.push(t)}),Vi.para.heatmap&&"default"===Vi.para.heatmap.clickmap&&Vi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Za[t]?Za[t].apply(Za,r):void("function"==typeof t?t.apply(Vi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Vi,n),a.plugin_is_init=!0,Vi.modules=Vi.modules||{},Vi.modules[a.plugin_name||"unnamed_"+Qa++]=a,a}if(!d(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Vi.modules&&Vi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return d(t)&&(r(Vi.modules)&&r(Vi.modules[t])?a=Vi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Vi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){rt({event:e,properties:t})&&Va.send({type:"track",event:e,properties:t},r)}function It(e,t){return!!rt({bindKey:e,bindValue:t})&&(xa._state.identities[e]=t,xa.save(),void Va.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function Tt(e,t){var r=kt(e,t);r&&Va.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function At(e,t,r){"object"==typeof e&&e.tagName?_t({ele:e},t,r,Vi.track):"object"==typeof e&&e.target&&e.event&&_t(e,t,r,Vi.track)}function Dt(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&!(!e.href||/^javascript/.test(e.href)||e.target)&&void Be(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Vi.track(t,r,i)})}function $t(e,t,r){rt({item_type:e,item_id:t,properties:r})&&Va.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){rt({item_type:e,item_id:t})&&Va.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set",properties:e},t)}function Lt(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){rt({propertiesMust:e})&&(k(e,function(t,r){d(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Va.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;d(e)&&(e={},e[n]=1),rt({propertiesMust:e})&&(r(e)?Va.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Bt(e){Va.send({type:"profile_delete"},e),xa.set("distinct_id",Gi()),xa.set("first_id","")}function Ht(e,t){var r=e,n={};d(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){d(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Va.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e){"number"==typeof e&&(e=String(e));var t=xa.getFirstId();if("undefined"==typeof e){var r=Gi();t?xa.set("first_id",r):xa.set("distinct_id",r)}else rt({distinct_id:e})&&(t?xa.set("first_id",e):xa.set("distinct_id",e))}function Mt(e){var t=xa.getFirstId();if(t)return je("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),"undefined"==typeof e){var r=Gi();xa._state.identities.$identity_cookie_id=r,xa.set("distinct_id",r)}else rt({distinct_id:e})&&(xa._state.identities.$identity_cookie_id=e,xa.set("distinct_id",e))}function qt(e,t,r,n){var i=xa.getFirstId()||xa.getDistinctId();xa.set("distinct_id",e),Va.send({original_id:i,distinct_id:xa.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function Kt(e,t,r,n){"number"==typeof e&&(e=String(e)),rt({distinct_id:e,event:t,properties:r})&&qt(e,t,r,n)}function Ft(e){rt({properties:e})?P(wa.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Vt(e){xa.clearAllProps(e)}function Wt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Vi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vapph5define.min.js"})}else t();else t()}function cr(t){Vi.para.is_track_single_page&&Oa.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){wa.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Vi.quick&&Vi.quick("autoTrack",i)}};if("boolean"==typeof Vi.para.is_track_single_page)i();else if("function"==typeof Vi.para.is_track_single_page){var a=Vi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function dr(){Vi._q&&v(Vi._q)&&Vi._q.length>0&&k(Vi._q,function(e){Vi[e[0]].apply(Vi,Array.prototype.slice.call(e[1]))}),r(Vi.para.heatmap)&&(Xa.initHeatmap(),Xa.initScrollmap())}function pr(){Vi.readyState.setState(3),new Vi.SDKJSBridge("visualized").onAppNotify(function(){ur("undefined"!=typeof sa_jssdk_app_define_mode)}),ur(!1),Vi.bridge.app_js_bridge_v1(),wa.initPage(),cr(),xa.init(),sr(),gr(),Vi.readyState.setState(4),dr()}function fr(){ro.isSeachHasKeyword()?ro.hasKeywordHandle():window.parent!==self&&no.isSearchHasKeyword()?no.verifyVtrackMode():ro.isWindowNameHasKeyword()?ro.windowNameHasKeywordHandle():ro.isStorageHasKeyword()?ro.storageHasKeywordHandle():window.parent!==self&&no.isStorageHasKeyword()?no.verifyVtrackMode():(pr(),no.notifyUser())}function gr(){qa.init(),"success"===Vi.bridge.bridge_info.verify_success&&Ha.init()}function _r(){k(io,function(t){var r=Vi[t];Vi[t]=function(){return Vi.readyState.state<3?(v(Vi._q)||(Vi._q=[]),Ne("calling sdk api before init is deprecated."),Vi._q.push([t,arguments]),!1):e(Vi.getDisabled)&&Vi.getDisabled()?void 0:Vi.readyState.getState()?r.apply(Vi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function hr(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 mr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new hr,this.sensors=r}function vr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function yr(e){e&&e.buildDataStage&&so.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&po.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&uo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&go.registerStageImplementation(e.viewStage)}function br(e,t){_o[e]&&_o[e](t)}function wr(){return ho.stage&&ho.stage.process("getUtmData")}function Sr(e){return mo.stage.process("send",e)}function kr(e){e.kit=vo,e.saEvent=Va,this.buildDataStage=Fa,this.sendDataStage=mo,this.businessStage=ho}function Pr(e){e.heatmap=Xa,this.viewStage=Wa}function Cr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};br("buildDataStage",r)}function Or(e){e&&(Vi.events=$a,Vi.bridge=to,Vi.SDKJSBridge=nr,Vi.JSBridge=or,Vi.store=xa,Vi.unlimitedDiv=Ja,Vi.customProp=Ma,Vi.vtrackcollect=qa,Vi.vapph5collect=Ha,Vi.detectMode=fr,Vi.registerFeature=yr,Vi.registerInterceptor=br,Vi.commonWays=Za,yr(new kr(Vi)),yr(new Pr(Vi)),br("viewStage",yo));var t=e?Ya:ao;for(var r in t)Vi[r]=t[r];Vi.logger=da,Vi.log=Oe,Vi._=eo,Vi.on=et,Vi.ee=Ca,Vi.use=Nt,Vi.lib_version=_a,Vi.registerPropertyPlugin=Cr}function Nr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ir(e,t,r){return Nr(e,t,r),e.plugin_version=Ho,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ar(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ar(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dr(e,t,r){return Tr(e,t,r),e.plugin_version=qo,e}function $r(e){return zo&&zo.call(Vo,JSON.stringify(e))}function xr(e){return Wo.call(Vo)&&Xo&&Xo.call(Vo,JSON.stringify(e))}function Er(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Lr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ur(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ur(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rr(e,t,r){return Lr(e,t,r),e.plugin_version=Go,e}function Br(){if(So=window.SensorsData_APP_New_H5_Bridge,ko=So&&So.sensorsdata_track,Po=ko&&So.sensorsdata_get_server_url&&So.sensorsdata_get_server_url(),No("---test---fail---",!Co,Co.bridge.activeBridge,!Po),Co&&!Co.bridge.activeBridge&&Po)return Co.bridge.activeBridge=Qo,Co.para.app_js_bridge&&!Co.para.app_js_bridge.is_mui&&(Co.bridge.is_verify_success=Po&&Co.bridge.validateAppUrl(Po),No("---test---bridge-verify-",Co.bridge.is_verify_success)),Co.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:Co.bridge.is_verify_success?"success":"fail",support_two_way_call:!!So.sensorsdata_js_call_app},Co.para.app_js_bridge?void Co.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}):void No("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function Hr(e,t){if(No("---test---datasend-",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return Co.bridge.is_verify_success?(No("---test---bridge-verify-success---",e.data),ko&&ko.call(So,JSON.stringify(Oo.extend({server_url:Co.para.server_url},e.data))),Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(No("---test---bridge-verify-fail-----",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_send?(Co.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e))}function Jr(e){var t=e.callType;return t in Zo.commands?Zo.commands[t](e,So):void(So&&Oo.isFunction(So.sensorsdata_js_call_app)&&So.sensorsdata_js_call_app(JSON.stringify(e)))}function Mr(e){return rs&&rs.call(es,JSON.stringify(e))}function qr(e){return ts.call(es)&&ns&&ns.call(es,JSON.stringify(e))}function Kr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Fr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wr(e,t,r){return Fr(e,t,r),e.plugin_version=as,e}function zr(){if(xo("ObsoleteBridge---test---init---"),jo=window.SensorsData_APP_JS_Bridge,Io=jo&&jo.sensorsdata_track,To=jo&&jo.sensorsdata_verify,Ao=jo&&jo.sensorsdata_visual_verify,xo("ObsoleteBridge-",Do.bridge.activeBridge,To,Io,Ao),Do&&!Do.bridge.activeBridge&&(To||Io||Ao)){Do.bridge.activeBridge=os;var e=To||Io;if(Ao&&(e=!!Ao.call(jo,JSON.stringify({server_url:Do.para.server_url})),xo("ObsoleteBridge---called-return",e)),Do.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Do.para.app_js_bridge)return void xo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Do.registerInterceptor("sendDataStage",{send:{priority:80,entry:Xr}}),xo("Android obsolete bridge inits succeed.")}}function Xr(e,t){if(xo("ObsoleteBridge---senddata"),Do.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(To){var n=To&&To.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data)));return xo("ObsoleteBridge---anVerify-success",n),n?($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Do.para.app_js_bridge.is_send?(Do.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return xo("ObsoleteBridge---is-send-old-way",Do.para.app_js_bridge.is_send),Io&&Io.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data))),$o.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Zr(e){xo("ObsoleteBridge---handleCommadn");var t=e.callType;return t in is.commands?(xo("ObsoleteBridge---",t,is.commands),is.commands[t](e,jo)):jo&&$o.isFunction(jo.sensorsdata_js_call_app)?(xo("ObsoleteBridge---handleCommadn-abridge"),jo.sensorsdata_js_call_app(JSON.stringify(e))):void 0}function Gr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Qr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Qr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Yr(e,t,r){return Gr(e,t,r),e.plugin_version=ls,e}function en(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return tn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function tn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function rn(e,t,r){return en(e,t,r),e.plugin_version=ds,e}function nn(){return"undefined"!=typeof Bo&&document[Bo]}function an(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return on(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function on(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function sn(e,t,r){return an(e,t,r),e.plugin_version=Ds,e}function ln(){if(fs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,gs=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},_s&&!_s.bridge.activeBridge&&gs()&&gs().postMessage){if(_s.bridge.activeBridge=$s,_s.para.app_js_bridge&&!_s.para.app_js_bridge.is_mui&&(_s.bridge.is_verify_success=fs&&_s.bridge.validateAppUrl(fs)),_s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_s.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!_s.para.app_js_bridge)return void ms("app_js_bridge is not configured, data will not be sent by iOS bridge.");_s.registerInterceptor("sendDataStage",{send:{priority:70,entry:un}}),ms("IOS bridge inits succeed.")}}function un(e,t){if(_s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return _s.bridge.is_verify_success?(gs()&&gs().postMessage(JSON.stringify({callType:"app_h5_track",data:hs.extend({server_url:_s.para.server_url},e.data)})),hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e):_s.para.app_js_bridge.is_send?(_s.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function cn(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||_s.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?hs.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:gs()&&gs().postMessage(JSON.stringify(e)):null}function dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fn(e,t,r){return dn(e,t,r),e.plugin_version=Es,e}function gn(){if(vs&&!vs.bridge.activeBridge&&_n()){if(vs.bridge.activeBridge=Ls,vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:hn()?"success":"fail"},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:90,entry:mn}}),bs("IOS obsolete bridge inits succeed.")}}function _n(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function hn(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=ys.URL(vs.para.server_url).hostname,r=ys.URL(vs.para.server_url).searchParams.get("project")||"default"}catch(n){vs.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function mn(e,t){function r(e){var t=JSON.stringify(ys.extend({server_url:vs.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(vs.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,ys.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(ys.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bn(e,t,r){return vn(e,t,r),e.plugin_version=Rs,e}function wn(){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=Hs}function Sn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return kn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o); -}}return e}function kn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Pn(e,t,r){return Sn(e,t,r),e.plugin_version=qs,e}function Cn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function On(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function In(e,t,r){return Nn(e,t,r),e.plugin_version=Ws,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return An(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function An(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dn(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function $n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function xn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return En(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function En(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ln(e,t,r){return xn(e,t,r),e.plugin_version=rl,e}function Un(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Rn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Rn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Bn(e,t,r){return Un(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Mn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function qn(){kl=!0}function Kn(){kl=!1}function Fn(){return kl}function Vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zn(e,t,r){return Vn(e,t,r),e.plugin_version=Nl,e}function Xn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Zn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback,Xn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Gn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Qn(){al.on("sdkInitPara",function(){Gn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Zn}})})}function Yn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ei(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ei(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ti(e,t,r){return Yn(e,t,r),e.plugin_version=Tl,e}function ri(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ni(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ii),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ri}})})}function ii(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function si(e,t,r){return ai(e,t,r),e.plugin_version=$l,e}function li(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fi(e,t,r){return di(e,t,r),e.plugin_version=Ul,e}function gi(e){var t=new pl.BeaconSend(e);t.start()}function _i(e,t){var r=null,n=null;pl.isObject(e.config)&&(r=e.config.send_type,n=pl.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===dl.para.send_type;if(i&&pl.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=dl.kit.encodeTrackData(e.data),pl.isArray(a)&&a.length?pl.each(a,function(t){e.callback=null,e.server_url=t,gi(e)}):"string"==typeof a&&""!==a?gi(e):dl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function hi(){"beacon"!==dl.para.send_type||pl.isSupportBeaconSend()||(dl.para.send_type="image")}function mi(){dl.on("sdkInitPara",function(){hi()}),dl.on("sdkAfterInitPara",function(){dl.registerInterceptor("sendDataStage",{send:{priority:110,entry:_i}})})}function vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bi(e,t,r){return vi(e,t,r),e.plugin_version=Hl,e}function wi(e){var t=new gl.AjaxSend(e);t.start()}function Si(e,t){var r=null,n=null;gl.isObject(e.config)&&(r=e.config.send_type,n=gl.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===fl.para.send_type;if(i&&gl.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=fl.kit.encodeTrackData(e.data),gl.isArray(a)&&a.length?gl.each(a,function(t){e.callback=null,e.server_url=t,wi(e)}):"string"==typeof a&&""!==a?wi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function ki(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function Pi(){fl.on("sdkInitPara",function(){ki()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:Si}})})}function Ci(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ni(e,t,r){return Ci(e,t,r),e.plugin_version=ql,e}function ji(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function Ii(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=null;hl.isObject(e.config)&&(r=hl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,hl.isArray(n)&&n.length?hl.each(n,function(t){t&&(e.data=ji(t,i),e.callback=null,e.server_url=t,Ii(e))}):"string"==typeof n&&""!==n?(e.data=ji(n,i),Ii(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ai(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function Di(){_l.on("sdkInitPara",function(){Ai()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function $i(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ei(e,t,r){return $i(e,t,r),e.plugin_version=_a,e}function Li(e){return null===zl?void Ui(e):void zl.push(e)}function Ui(e){try{if("log"===e.level&&Ri())return void Ji(e);if("warn"===e.level&&Bi())return void Ji(e);if("error"===e.level&&Hi())return void Ji(e)}catch(t){}}function Ri(){return!!Fi()||Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level}function Bi(){return!!Fi()||Ri()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level}function Hi(){return!!Fi()||!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level}function Ji(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Mi(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Mi(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function Ki(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Fi(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Vi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new d((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new d((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new d((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var p,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),p=5==n.a.length&&1===n.a[0],p&&(a(function(){p=!f('"\t"')}),p&&a(function(){p=1!==f("01")}),p&&a(function(){p=1!==f("1.")})))},function(){p=!1}),t=p}}return o[e]=!!t}function s(e){return D(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,d=n.Date||r.Date,p=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new d((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T="000000",A=function(e,t){return(T+(t||0)).slice(-e)},D=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],p=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;p(r+1,0)<=i;r++);for(n=c((i-p(r,0))/30.42);p(r,n+1)<=i;n++);i=1+i-p(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(D=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+A(6,r<0?-r:r):A(4,r))+"-"+A(2,n+1)+"-"+A(2,i)+"T"+A(2,o)+":"+A(2,s)+":"+A(2,l)+"."+A(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var $=i.stringify;i.stringify=function(e,t,r){var n=d.prototype.toJSON;d.prototype.toJSON=s;var i=$(e,t,r);return d.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=I[t];return r?r:x+A(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,p,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===d.prototype.toJSON?l=D(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),p=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,B));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++B);e+=a.slice(t,B)}if(34==a.charCodeAt(B))return B++,e;q();default:if(t=B,45==i&&(n=!0,i=a.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(B+1),i>=48&&i<=57)&&q(),n=!1;B=48&&i<=57);B++);if(46==a.charCodeAt(B)){for(r=++B;r57));r++);r==B&&q(),B=r}if(i=a.charCodeAt(B),101==i||69==i){for(i=a.charCodeAt(++B),43!=i&&45!=i||B++,r=B;r57));r++);r==B&&q(),B=r}return+a.slice(t,B)}n&&q();var s=a.slice(B,B+4);if("true"==s)return B+=4,!0;if("fals"==s&&101==a.charCodeAt(B+4))return B+=5,!1;if("null"==s)return B+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return B=0,H=""+e,r=F(K()),"$"!=K()&&q(),B=H=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Wi,zi={setup:function(e){Wi=e},log:function(){(Wi||console&&console.log||function(){}).apply(null,arguments)}},Xi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Xi.get(e))||null}catch(r){zi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){zi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Xi.set(t,r),Xi.get(t)!==r&&(e=!1),Xi.remove(t)}catch(n){e=!1}return e}},Zi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Xi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Xi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Xi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Xi.get(e)),Xi.remove(e),Xi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Xi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Xi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Xi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Xi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.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=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Qi=function(e){this.ele=e},Yi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Qi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){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),y(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||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=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 Yi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Yi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},ka={checkIsAddSign:function(e){"track"===e.type&&(Re()?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,n=va.get("sensorsdata2015jssdkcross"+Vi.para.sdk_id);n=Vi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Vi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Vi.para.encrypt_cookie&&(i=Vi.kit.userEncrypt(i)),va.set("sensorsdata2015jssdkcross"+Vi.para.sdk_id,i,null,!0)),Vi.para.is_track_device_id&&(wa.currentProps.$device_id=r)},storeInitCheck:function(){if(Vi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};va.isSupport()?va.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):Sa.set(Sa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(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)}}},Pa=function(){this._events=[],this.pendingEvents=[]};Pa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(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():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Ca={},Oa=new l;Ca.spa=Oa,Ca.sdk=new l,Ca.data=new l,Ca.initSystemEvent=function(){Ye(function(e){Oa.emit("switch",e)})},Ca.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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var Na=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};Na.prototype.start=function(){var e=this,t=new Date;Ze({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(r,n){Ca.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){Ca.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},Na.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var ja="sawebjssdk-",Ia="tab-sawebjssdk-";tt.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()},pa.batch_send.send_interval)},getServerUrl:function(){return d(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),Xi.remove(e[n])}r=Ce(r),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=ja+String(n()),a=Xi.get(this.tabKey);null===a?(this.tabKey=Ia+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,Xi.set(this.tabKey,JSON.stringify(a)),Vi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Ia+String(n()),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var d=new a(n);d.get(s,r,1e3,function(e){if(e){null===Xi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Xi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Xi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var p=i(Xi.get(s))||{expireTime:0};t()-p.expireTime>r&&Xi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!d(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!d(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=xa._state.history_login_id;return!(t&&t.name&&t.name===e||re(this.bindReservedNames,e)>-1)}},Ua={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ea[n])&&Ea[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ea[n])&&Ea[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ea[n])&&Ea[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){rt({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ea[i])&&Ea[i](n)),!0};rt({propertyValue:t},n)}):La.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ea[n])&&Ea[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ea[n])&&Ea[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=p(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ra.configIsMatchNew=function(e,t){if(d(e.$element_selector)&&d(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 e.$element_selector.indexOf(t.element_selector)>-1}if(d(e.$element_path)&&d(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 e.$element_path.indexOf(t.element_path)>-1}return!1},Ra.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"]?Ra.configIsMatchNew(e,t):Ra.configIsMatchOldVersion(e,t))},Ra.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(Ra.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},Ra.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ra.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ra.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ra.getPropElInLi=function(e,t){if(!(e&&_(e)&&d(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Vi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ra.getProp=function(e,t){if(!r(e))return!1;if(!(d(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(d(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!d(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Vi.heatmap.getClosestLi(s);o=Ra.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!d(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ra.getAssignConfigs=function(e,t){var n=Ra.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ba={events:[],getAssignConfigs:Ra.getAssignConfigs,filterConfig:Ra.filterConfig,getProp:Ra.getProp,initUrl:Ra.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),d(a.event_name)&&n.push(a.event_name))}),Vi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Vi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Vi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ha={events:[],customProp:Ba,getAssignConfigs:Ra.getAssignConfigs,initUrl:Ra.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Vi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Vi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ja={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=qa.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Vi.heatmap.getEleDetail(e);if(!r(t)||!d(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,qa.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ra.getProp,getPropElInLi:Ra.getPropElInLi,filterConfig:Ra.filterConfig},qa={unlimitedDiv:Ja,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ma,initUrl:function(){var e=Ra.initUrl();if(e){var t;try{t=new f(Vi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Vi.para.heatmap)||!Vi.para.heatmap.get_vtrack_config)return!1;if(Xi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=xa.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Vi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Vi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Xa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Xa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(!d(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){var t=function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&d(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null};return t(e,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Vi.heatmap.getClosestLi(e);if(!i||!_(e)||!d(e.tagName))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Vi.is_heatmap_render_mode=!0,Vi.para.heatmap||(Vi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Vi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Vi.para.heatmap_url||(Vi.para.heatmap_url=ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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=We({target:e});r.$element_selector=t?t:"",r.$element_path=Vi.heatmap.getElementPath(e,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);var n=Vi.heatmap.getElementPosition(e,r.$element_path,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Vi.para.heatmap)&&e(Vi.para.heatmap.collect_element)&&!Vi.para.heatmap.collect_element(n))return!1;var s=Xa.getBasicEleInfo(t,n,i,a,o);mt(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Vi.para.heatmap&&Vi.para.heatmap.custom_property){var c=Vi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div?!!(r(Vi.para.heatmap)&&r(Vi.para.heatmap.collect_tags)&&r(Vi.para.heatmap.collect_tags.div)&&v(Vi.para.heatmap.collect_tags.div.ignore_tags)&&re(Vi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Vi.para&&Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Vi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.scroll_notice_map)return!1;var t=!0;Vi.para.scrollmap&&e(Vi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Vi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Vi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Vi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,vt(e)),this.current_time=n}});i.current_time=new Date,Be(window,"scroll",function(){return!!t&&void i.go()}),Be(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.clickmap)&&(e(Vi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Vi.para.heatmap.collect_url()}),"all"===Vi.para.heatmap.collect_elements?Vi.para.heatmap.collect_elements="all":Vi.para.heatmap.collect_elements="interact",void("all"===Vi.para.heatmap.collect_elements?Be(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=d(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):Be(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Vi.heatmap.getTargetElement(a,e);return!(!_(o)&&!d(a.tagName))&&void(_(o)&&d(o.tagName)?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Vi.para.heatmap)&&Vi.para.heatmap.get_vtrack_config&&Ja.events.length>0&&Ja.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"}))})))}},Za={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Vi.log("error: isReady callback must be function")},getUtm:function(){return wa.campaignParams()},getStayTime:function(){return(new Date-Vi._t)/1e3},setProfileLocal:function(e){if(!Xi.isSupport())return Vi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=xa.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(xa.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Vi.setProfile(e))}else xa.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Vi.setProfile(e)},setInitReferrer:function(){var e=$e();Vi.setOnceProfile({_init_referrer:e,_init_referrer_host:wa.pageProp.referrer_host})},setSessionReferrer:function(){var e=$e();xa.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:wa.pageProp.referrer_host})},setDefaultAttr:function(){wa.register({_current_url:location.href,_referrer:$e(),_referring_host:wa.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Vi.para.heatmap&&Vi.para.heatmap.track_attr?Vi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Xa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Xa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Vi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,yt()),t),i=Z()}var i;i=this.autoTrackIsUsed?wa.pageProp.url:wa.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,bt(Vi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=yt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Vi.para.is_single_page&&w(function(){var r=$e(a,!0);Vi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Vi.track("$pageview",P({$referrer:$e(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),bt(Vi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(xa._state)?"SDK is not initialized.":xa.getAnonymousId()},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Vi.modules)&&Vi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Vi.use.apply(Vi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:It,unbind:Tt,trackLink:At,trackLinks:Dt,setItem:$t,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Bt,unsetProfile:Ht,identify:Jt,resetAnonymousIdentity:Mt,trackSignup:Kt,registerPage:Ft,clearAllRegister:Vt,clearPageRegister:Wt,register:zt,registerOnce:Xt,registerSession:Zt,registerSessionOnce:Gt,login:Qt,loginWithKey:Yt,logout:er,getPresetProperties:tr,readyState:Ga,debug:ba,on:et,log:Oe};zi.setup(Oe);var eo=P({},ua,Da),to={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:Vi.para.use_app_track_is_send!==!1&&"only"!==Vi.para.use_app_track,white_list:[],is_mui:"mui"===Vi.para.use_app_track};"object"==typeof Vi.para.app_js_bridge?Vi.para.app_js_bridge=P({},e,Vi.para.app_js_bridge):Vi.para.use_app_track!==!0&&Vi.para.app_js_bridge!==!0&&"only"!==Vi.para.use_app_track&&"mui"!==Vi.para.use_app_track||(Vi.para.app_js_bridge=P({},e)),Vi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Vi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ar};nr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),ir(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},nr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},nr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),ir(r)},or.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Vi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==V(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=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Xa.setNotice(n),aa.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Vi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Vi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Vi.heatmap_version&&Vi.heatmap_version===Vi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Vi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Xa.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=d(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&d(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return d(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Xa.setNotice(i),aa.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(lr("sa-visual-mode")===!0||"true"===lr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Vi.para.vtrack_url?Vi.para.vtrack_url:ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vtrack.min.js"})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(aa.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var t=e.data.data.userURL;d(t)&&(window.location.href=encodeURI(t.replace(/javascript:/i,"")))}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:_a}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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){}};vr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new mr(t,n,Vi),a=0;a=2)&&(wo&&(Or(!0),_r()),Ca.initSystemEvent(),Vi.setInitVar(),Vi.readyState.setState(2),Vi.initPara(e),Ca.sdk.emit("initPara"),Ca.sdk.emit("afterInitPara"),Ca.sdk.emit("initAPI"),Ca.sdk.emit("afterInitAPI"),Vi.detectMode(),rr(),Ca.sdk.emit("afterInit"),void Ca.sdk.emit("ready"))},wo?Or(!1):(Or(!0),_r());var So,ko,Po,Co,Oo,No,jo,Io,To,Ao,Do,$o,xo,Eo,Lo,Uo,Ro,Bo,Ho="1.26.8",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=Ir(Jo),qo="1.26.8",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=Dr(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:$r,visualized_track:xr,page_info:xr,sensorsdata_get_app_visual_config:Er}},Go="1.26.8",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Br()},handleCommand:Jr},Yo=Rr(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Mr,visualized_track:qr,page_info:qr,sensorsdata_get_app_visual_config:Kr}},as="1.26.8",os={init:function(e){Do=e,$o=Do&&Do._,xo=Do&&Do.log||console&&console.log||function(){},zr()},handleCommand:Zr},ss=Wr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.26.8",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Ts.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Ts.data=e,Ts.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Ts.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Is(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(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=ps().visibilityChange,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},As=rn(Ts,"Deeplink","sdkReady"),Ds="1.26.8",$s={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},ln()},handleCommand:cn},xs=sn($s,"IOSBridge","sdkAfterInitPara"),Es="1.26.8",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},gn()}},Us=fn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.26.8",Bs=5e3,Hs=432e3;wn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},wn.prototype.log=function(e){this.sd&&this.sd.log(e)},wn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Bs)},wn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},wn.prototype.pageStartHandler=function(){this.start_time=+new Date,1==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},wn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&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()}},wn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},wn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},wn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||"string"!=typeof e||""===e||this.option.isCollectUrl(e)},wn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},wn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},wn.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()}})},wn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},wn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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()},wn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},wn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},wn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},wn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},wn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new wn,Ms=bn(Js,"PageLeave","sdkReady"),qs="1.26.8",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=Pn(Fs,"PageLoad","sdkReady");On.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Cn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.26.8";On.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new On,Gs=In(Zs),Qs="1.26.8",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=$n,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=Dn(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.26.8",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var p=u.indexOf("?");a=p>-1?o>-1?s+l+"#"+u.substring(1,o)+d(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+d(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,dl,pl,fl,gl,_l,hl,ml=Ln(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.26.8",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Bn(bl,"Utm","sdkAfterInitPara"),Sl="1.26.8",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=qn,Pl.enableSDK=Kn,Pl.getDisabled=Fn}},Ol=Mn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.26.8",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Qn()}},Il=zn(jl),Tl="1.26.8",Al={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ni()}},Dl=ti(Al),$l="1.26.8",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ci()}},Ll=si(El),Ul="1.26.8",Rl={plugin_name:"BeaconSender",init:function(e){dl=e,pl=dl._,mi()}},Bl=fi(Rl),Hl="1.26.8",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,Pi()}},Ml=bi(Jl),ql="1.26.8",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,Di()}},Fl=Ni(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Li),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("http://modernizr.com/"),"http://modernizr.com/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{d(e)||(e=String(e)),e=p(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void zi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new Qi(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(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){zi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(ea&&e.forEach===ea)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){zi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(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 j(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}function I(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(p){zi.log(p)}n&&d()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function T(e){return k(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 A(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function D(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=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,na.set(t,"true",0,null,r,"; domain="+a),document.cookie.indexOf(t+"=true")!==-1)return na.set(t,"true","-1s",null,r,"; domain="+a),a;return""}function J(e){function t(e,t){e=p(e);var r;if("body"===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 o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){zi.log(o)}return i&&_(i)?r(i):null}if(!d(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=p(e.textContent):e.innerText&&(r=p(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 q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){zi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=u(e);var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);return null===i||i&&"string"!=typeof i[1]&&i[1].length?"":u(i[1])}function V(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){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(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){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 Z(e){return d(e)?(e=p(e),A(e)):A(location.href)}function G(e){return d(e)?(e=p(e),A(e)):A(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function pe(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!d(t.callbackName))return zi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(i.appendChild(n),ce(t.timeout)&&(a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){zi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){zi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var s=[];k(t.data,function(e,t){s.push(t+"="+e)}),t.data=s.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){zi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=t.url}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.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;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.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 he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,d)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else d(i)||ce(i)||$(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function it(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function at(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function ot(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))ot(e[a]);else if(d(i)){if(re(n,a)>-1)return;e[a]=it(i,re(t,a)>-1?1024:pa.max_string_length)}})}function st(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function lt(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};rt({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};rt({item_id:n},i)}}function ut(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&rt({propertyKey:n},i)})}function ct(e){var t=e.properties;ye(e),r(t)?(nt(t),at(t),st(e),ut(t),ot(t)):"properties"in e&&(e.properties={}),lt(e)}function dt(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function pt(e,t){try{var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,xa.getIdentities());var a={identities:i,distinct_id:xa.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,xa.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),"$UnbindID"===a.event&&(a.login_id&&delete a.login_id,a.anonymous_id&&delete a.anonymous_id),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},Pa.properties(),xa.getProps(),xa.getSessionProps(),Pa.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!d(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!d(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&d(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&d(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!d(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!d(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!d(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),d(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&$(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ha.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=qa.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),ba.checkIsAddSign(a),ba.checkIsFirstTime(a),Fe(a),Ve(a),a}catch(o){return{_debug_web_msg:String(o)}}}function ft(e){return Fa.stage.process("basicProps",e)}function gt(e){return Fa.stage.process("formatData",e)}function _t(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&De(e.ele,"click",function(e){i(e)}))))}function ht(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function mt(e){return Wa.stage.process("webClickEvent",e)}function vt(e){return Wa.stage.process("webStayEvent",e)}function yt(){var e=Pa.campaignParams(),t={};return k(e,function(e,r,n){(" "+Vi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function bt(e,t,r){if(Vi.is_first_visitor&&r){var n={};Vi.para.preset_properties.search_keyword_baidu&&Ue(document.referrer)&&$e()&&(n.$search_keyword_id=Sa.id(),n.$search_keyword_id_type=Sa.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=Le(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:d(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:d(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:He(),$first_search_keyword:Re()},yt(),n)),Vi.is_first_visitor=!1}}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=xa.getFirstId(),s=xa.getOriginDistinctId();if(!rt({distinct_id:n}))return je("login id is invalid"),!1;if(n===xa.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"),!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(a)&&n===xa._state.first_id)return!1; +var l=xa._state.history_login_id.name!==a||n!==xa._state.history_login_id.value;if(l){xa._state.identities[a]=n,xa.set("history_login_id",{name:a,value:n}),o||xa.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:xa._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];xa._state.identities=t,xa.save()}function kt(e,t){if(!rt({unbindKey:e,bindValue:t}))return!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(e)&&xa._state.identities[e]===t){var n=xa.getUnionId().login_id;n&&e+"+"+t===n&&(xa._state.distinct_id=xa._state.first_id,xa._state.first_id="",xa.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete xa._state.identities[e],xa.save())}var i={};return i[e]=t,i}function Pt(){Vi._t=Vi._t||1*new Date,Vi.is_first_visitor=!1,Vi.source_channel_standard=ga}function Ct(e){P(pa,e||Vi.para||{}),Vi.para=pa;var t={};if(r(Vi.para.is_track_latest))for(var n in Vi.para.is_track_latest)t["latest_"+n]=Vi.para.is_track_latest[n];Vi.para.preset_properties=P({},fa.preset_properties,t,Vi.para.preset_properties||{});var i;for(i in fa)void 0===Vi.para[i]&&(Vi.para[i]=fa[i]);"string"!=typeof Vi.para.web_url||"://"!==Vi.para.web_url.slice(0,3)&&"//"!==Vi.para.web_url.slice(0,2)||("://"===Vi.para.web_url.slice(0,3)?Vi.para.web_url=location.protocol.slice(0,-1)+Vi.para.web_url:Vi.para.web_url=location.protocol+Vi.para.web_url),ka.protocol.serverUrl(),Vi.bridge&&Vi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Vi.para.source_type&&(Vi.para.source_type.utm=v(Vi.para.source_type.utm)?Vi.para.source_type.utm.concat(a):a,Vi.para.source_type.search=v(Vi.para.source_type.search)?Vi.para.source_type.search.concat(o):o,Vi.para.source_type.social=v(Vi.para.source_type.social)?Vi.para.source_type.social.concat(s):s,Vi.para.source_type.keyword=r(Vi.para.source_type.keyword)?P(l,Vi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Vi.para.heatmap&&!r(Vi.para.heatmap)&&(Vi.para.heatmap={}),r(Vi.para.heatmap)){Vi.para.heatmap.clickmap=Vi.para.heatmap.clickmap||"default",Vi.para.heatmap.scroll_notice_map=Vi.para.heatmap.scroll_notice_map||"default",Vi.para.heatmap.scroll_delay_time=Vi.para.heatmap.scroll_delay_time||4e3,Vi.para.heatmap.scroll_event_duration=Vi.para.heatmap.scroll_event_duration||18e3,Vi.para.heatmap.renderRefreshTime=Vi.para.heatmap.renderRefreshTime||1e3,Vi.para.heatmap.loadTimeout=Vi.para.heatmap.loadTimeout||1e3,Vi.para.heatmap.get_vtrack_config!==!0&&(Vi.para.heatmap.get_vtrack_config=!1);var d=v(Vi.para.heatmap.track_attr)?U(Vi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),Vi.para.heatmap.track_attr=d,r(Vi.para.heatmap.collect_tags))if(Vi.para.heatmap.collect_tags.div===!0)Vi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Vi.para.heatmap.collect_tags.div)){if(Vi.para.heatmap.collect_tags.div.ignore_tags?v(Vi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Vi.para.heatmap.collect_tags.div.ignore_tags=c):Vi.para.heatmap.collect_tags.div.ignore_tags=c,Vi.para.heatmap.collect_tags.div.max_level){var p=[1,2,3];re(p,Vi.para.heatmap.collect_tags.div.max_level)===-1&&(Vi.para.heatmap.collect_tags.div.max_level=1)}}else Vi.para.heatmap.collect_tags.div=!1;else Vi.para.heatmap.collect_tags=u}Vi.para.server_url=Ge(Vi.para.server_url),Vi.para.noCache===!0?Vi.para.noCache="?"+(new Date).getTime():Vi.para.noCache="",Vi.para.callback_timeout>Vi.para.datasend_timeout&&(Vi.para.datasend_timeout=Vi.para.callback_timeout),Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&r(Vi.para.heatmap.collect_tags)&&k(Vi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Vi.heatmap.otherTags.push(t)}),Vi.para.heatmap&&"default"===Vi.para.heatmap.clickmap&&Vi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Za[t]?Za[t].apply(Za,r):void("function"==typeof t?t.apply(Vi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Vi,n),a.plugin_is_init=!0,Vi.modules=Vi.modules||{},Vi.modules[a.plugin_name||"unnamed_"+Qa++]=a,a}if(!d(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Vi.modules&&Vi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return d(t)&&(r(Vi.modules)&&r(Vi.modules[t])?a=Vi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Vi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){rt({event:e,properties:t})&&Va.send({type:"track",event:e,properties:t},r)}function It(e,t){return!!rt({bindKey:e,bindValue:t})&&(xa._state.identities[e]=t,xa.save(),void Va.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function Tt(e,t){var r=kt(e,t);r&&Va.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function At(e,t,r){"object"==typeof e&&e.tagName?_t({ele:e},t,r,Vi.track):"object"==typeof e&&e.target&&e.event&&_t(e,t,r,Vi.track)}function Dt(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&!(!e.href||/^javascript/.test(e.href)||e.target)&&void De(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Vi.track(t,r,i)})}function $t(e,t,r){rt({item_type:e,item_id:t,properties:r})&&Va.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){rt({item_type:e,item_id:t})&&Va.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set",properties:e},t)}function Lt(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){rt({propertiesMust:e})&&(k(e,function(t,r){d(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Va.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;d(e)&&(e={},e[n]=1),rt({propertiesMust:e})&&(r(e)?Va.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Bt(e){Va.send({type:"profile_delete"},e),xa.set("distinct_id",Gi()),xa.set("first_id","")}function Ht(e,t){var r=e,n={};d(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){d(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Va.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e){"number"==typeof e&&(e=String(e));var t=xa.getFirstId();if("undefined"==typeof e){var r=Gi();t?xa.set("first_id",r):xa.set("distinct_id",r)}else rt({distinct_id:e})&&(t?xa.set("first_id",e):xa.set("distinct_id",e))}function Mt(e){var t=xa.getFirstId();if(t)return je("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),"undefined"==typeof e){var r=Gi();xa._state.identities.$identity_cookie_id=r,xa.set("distinct_id",r)}else rt({distinct_id:e})&&(xa._state.identities.$identity_cookie_id=e,xa.set("distinct_id",e))}function qt(e,t,r,n){var i=xa.getFirstId()||xa.getDistinctId();xa.set("distinct_id",e),Va.send({original_id:i,distinct_id:xa.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function Kt(e,t,r,n){"number"==typeof e&&(e=String(e)),rt({distinct_id:e,event:t,properties:r})&&qt(e,t,r,n)}function Ft(e){rt({properties:e})?P(Pa.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Vt(e){xa.clearAllProps(e)}function Wt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Vi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vapph5define.min.js"})}else t();else t()}function cr(t){Vi.para.is_track_single_page&&Oa.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){Pa.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Vi.quick&&Vi.quick("autoTrack",i)}};if("boolean"==typeof Vi.para.is_track_single_page)i();else if("function"==typeof Vi.para.is_track_single_page){var a=Vi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function dr(){Vi._q&&v(Vi._q)&&Vi._q.length>0&&k(Vi._q,function(e){Vi[e[0]].apply(Vi,Array.prototype.slice.call(e[1]))}),r(Vi.para.heatmap)&&(Xa.initHeatmap(),Xa.initScrollmap())}function pr(){Vi.readyState.setState(3),new Vi.SDKJSBridge("visualized").onAppNotify(function(){ur("undefined"!=typeof sa_jssdk_app_define_mode)}),ur(!1),Vi.bridge.app_js_bridge_v1(),Pa.initPage(),cr(),xa.init(),sr(),gr(),Vi.readyState.setState(4),dr()}function fr(){ro.isSeachHasKeyword()?ro.hasKeywordHandle():window.parent!==self&&no.isSearchHasKeyword()?no.verifyVtrackMode():ro.isWindowNameHasKeyword()?ro.windowNameHasKeywordHandle():ro.isStorageHasKeyword()?ro.storageHasKeywordHandle():window.parent!==self&&no.isStorageHasKeyword()?no.verifyVtrackMode():(pr(),no.notifyUser())}function gr(){qa.init(),"success"===Vi.bridge.bridge_info.verify_success&&Ha.init()}function _r(){k(io,function(t){var r=Vi[t];Vi[t]=function(){return Vi.readyState.state<3?(v(Vi._q)||(Vi._q=[]),Ne("calling sdk api before init is deprecated."),Vi._q.push([t,arguments]),!1):e(Vi.getDisabled)&&Vi.getDisabled()?void 0:Vi.readyState.getState()?r.apply(Vi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function hr(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 mr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new hr,this.sensors=r}function vr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function yr(e){e&&e.buildDataStage&&so.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&po.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&uo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&go.registerStageImplementation(e.viewStage)}function br(e,t){_o[e]&&_o[e](t)}function wr(){return ho.stage&&ho.stage.process("getUtmData")}function Sr(e){return mo.stage.process("send",e)}function kr(e){e.kit=vo,e.saEvent=Va,this.buildDataStage=Fa,this.sendDataStage=mo,this.businessStage=ho}function Pr(e){e.heatmap=Xa,this.viewStage=Wa}function Cr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};br("buildDataStage",r)}function Or(e){e&&(Vi.events=$a,Vi.bridge=to,Vi.SDKJSBridge=nr,Vi.JSBridge=or,Vi.store=xa,Vi.unlimitedDiv=Ja,Vi.customProp=Ma,Vi.vtrackcollect=qa,Vi.vapph5collect=Ha,Vi.detectMode=fr,Vi.registerFeature=yr,Vi.registerInterceptor=br,Vi.commonWays=Za,yr(new kr(Vi)),yr(new Pr(Vi)),br("viewStage",yo));var t=e?Ya:ao;for(var r in t)Vi[r]=t[r];Vi.logger=da,Vi.log=Oe,Vi._=eo,Vi.on=et,Vi.ee=Ca,Vi.use=Nt,Vi.lib_version=_a,Vi.registerPropertyPlugin=Cr}function Nr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ir(e,t,r){return Nr(e,t,r),e.plugin_version=Ho,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ar(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ar(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dr(e,t,r){return Tr(e,t,r),e.plugin_version=qo,e}function $r(e){return zo&&zo.call(Vo,JSON.stringify(e))}function xr(e){return Wo.call(Vo)&&Xo&&Xo.call(Vo,JSON.stringify(e))}function Er(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Lr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ur(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ur(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rr(e,t,r){return Lr(e,t,r),e.plugin_version=Go,e}function Br(){if(So=window.SensorsData_APP_New_H5_Bridge,ko=So&&So.sensorsdata_track,Po=ko&&So.sensorsdata_get_server_url&&So.sensorsdata_get_server_url(),No("---test---fail---",!Co,Co.bridge.activeBridge,!Po),Co&&!Co.bridge.activeBridge&&Po)return Co.bridge.activeBridge=Qo,Co.para.app_js_bridge&&!Co.para.app_js_bridge.is_mui&&(Co.bridge.is_verify_success=Po&&Co.bridge.validateAppUrl(Po),No("---test---bridge-verify-",Co.bridge.is_verify_success)),Co.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:Co.bridge.is_verify_success?"success":"fail",support_two_way_call:!!So.sensorsdata_js_call_app},Co.para.app_js_bridge?void Co.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}):void No("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function Hr(e,t){if(No("---test---datasend-",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return Co.bridge.is_verify_success?(No("---test---bridge-verify-success---",e.data),ko&&ko.call(So,JSON.stringify(Oo.extend({server_url:Co.para.server_url},e.data))),Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(No("---test---bridge-verify-fail-----",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_send?(Co.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e))}function Jr(e){var t=e.callType;return t in Zo.commands?Zo.commands[t](e,So):void(So&&Oo.isFunction(So.sensorsdata_js_call_app)&&So.sensorsdata_js_call_app(JSON.stringify(e)))}function Mr(e){return rs&&rs.call(es,JSON.stringify(e))}function qr(e){return ts.call(es)&&ns&&ns.call(es,JSON.stringify(e))}function Kr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Fr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wr(e,t,r){return Fr(e,t,r),e.plugin_version=as,e}function zr(){if(xo("ObsoleteBridge---test---init---"),jo=window.SensorsData_APP_JS_Bridge,Io=jo&&jo.sensorsdata_track,To=jo&&jo.sensorsdata_verify,Ao=jo&&jo.sensorsdata_visual_verify,xo("ObsoleteBridge-",Do.bridge.activeBridge,To,Io,Ao),Do&&!Do.bridge.activeBridge&&(To||Io||Ao)){Do.bridge.activeBridge=os;var e=To||Io;if(Ao&&(e=!!Ao.call(jo,JSON.stringify({server_url:Do.para.server_url})),xo("ObsoleteBridge---called-return",e)),Do.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Do.para.app_js_bridge)return void xo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Do.registerInterceptor("sendDataStage",{send:{priority:80,entry:Xr}}),xo("Android obsolete bridge inits succeed.")}}function Xr(e,t){if(xo("ObsoleteBridge---senddata"),Do.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(To){var n=To&&To.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data)));return xo("ObsoleteBridge---anVerify-success",n),n?($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Do.para.app_js_bridge.is_send?(Do.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return xo("ObsoleteBridge---is-send-old-way",Do.para.app_js_bridge.is_send),Io&&Io.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data))),$o.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Zr(e){xo("ObsoleteBridge---handleCommadn");var t=e.callType;return t in is.commands?(xo("ObsoleteBridge---",t,is.commands),is.commands[t](e,jo)):jo&&$o.isFunction(jo.sensorsdata_js_call_app)?(xo("ObsoleteBridge---handleCommadn-abridge"),jo.sensorsdata_js_call_app(JSON.stringify(e))):void 0}function Gr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Qr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Qr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Yr(e,t,r){return Gr(e,t,r),e.plugin_version=ls,e}function en(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return tn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function tn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function rn(e,t,r){return en(e,t,r),e.plugin_version=ds,e}function nn(){return"undefined"!=typeof Bo&&document[Bo]}function an(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return on(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function on(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function sn(e,t,r){return an(e,t,r),e.plugin_version=Ds,e}function ln(){if(fs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,gs=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},_s&&!_s.bridge.activeBridge&&gs()&&gs().postMessage){if(_s.bridge.activeBridge=$s,_s.para.app_js_bridge&&!_s.para.app_js_bridge.is_mui&&(_s.bridge.is_verify_success=fs&&_s.bridge.validateAppUrl(fs)),_s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_s.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!_s.para.app_js_bridge)return void ms("app_js_bridge is not configured, data will not be sent by iOS bridge.");_s.registerInterceptor("sendDataStage",{send:{priority:70,entry:un}}),ms("IOS bridge inits succeed.")}}function un(e,t){if(_s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return _s.bridge.is_verify_success?(gs()&&gs().postMessage(JSON.stringify({callType:"app_h5_track",data:hs.extend({server_url:_s.para.server_url},e.data)})),hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e):_s.para.app_js_bridge.is_send?(_s.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function cn(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||_s.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?hs.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:gs()&&gs().postMessage(JSON.stringify(e)):null}function dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fn(e,t,r){return dn(e,t,r),e.plugin_version=Es,e}function gn(){if(vs&&!vs.bridge.activeBridge&&_n()){if(vs.bridge.activeBridge=Ls,vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:hn()?"success":"fail"},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:90,entry:mn}}),bs("IOS obsolete bridge inits succeed.")}}function _n(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function hn(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=ys.URL(vs.para.server_url).hostname,r=ys.URL(vs.para.server_url).searchParams.get("project")||"default"}catch(n){vs.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function mn(e,t){function r(e){var t=JSON.stringify(ys.extend({server_url:vs.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(vs.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,ys.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(ys.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bn(e,t,r){return vn(e,t,r),e.plugin_version=Rs,e}function wn(){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=Hs}function Sn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return kn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function kn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n); +}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Pn(e,t,r){return Sn(e,t,r),e.plugin_version=qs,e}function Cn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function On(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function In(e,t,r){return Nn(e,t,r),e.plugin_version=Ws,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return An(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function An(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dn(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function $n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function xn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return En(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function En(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ln(e,t,r){return xn(e,t,r),e.plugin_version=rl,e}function Un(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Rn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Rn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Bn(e,t,r){return Un(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Mn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function qn(){kl=!0}function Kn(){kl=!1}function Fn(){return kl}function Vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zn(e,t,r){return Vn(e,t,r),e.plugin_version=Nl,e}function Xn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Zn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback,Xn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Gn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Qn(){al.on("sdkInitPara",function(){Gn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Zn}})})}function Yn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ei(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ei(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ti(e,t,r){return Yn(e,t,r),e.plugin_version=Tl,e}function ri(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ni(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ii),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ri}})})}function ii(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function si(e,t,r){return ai(e,t,r),e.plugin_version=$l,e}function li(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fi(e,t,r){return di(e,t,r),e.plugin_version=Ul,e}function gi(e){var t=new pl.BeaconSend(e);t.start()}function _i(e,t){var r=null,n=null;pl.isObject(e.config)&&(r=e.config.send_type,n=pl.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===dl.para.send_type;if(i&&pl.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=dl.kit.encodeTrackData(e.data),pl.isArray(a)&&a.length?pl.each(a,function(t){e.callback=null,e.server_url=t,gi(e)}):"string"==typeof a&&""!==a?gi(e):dl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function hi(){"beacon"!==dl.para.send_type||pl.isSupportBeaconSend()||(dl.para.send_type="image")}function mi(){dl.on("sdkInitPara",function(){hi()}),dl.on("sdkAfterInitPara",function(){dl.registerInterceptor("sendDataStage",{send:{priority:110,entry:_i}})})}function vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bi(e,t,r){return vi(e,t,r),e.plugin_version=Hl,e}function wi(e){var t=new gl.AjaxSend(e);t.start()}function Si(e,t){var r=null,n=null;gl.isObject(e.config)&&(r=e.config.send_type,n=gl.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===fl.para.send_type;if(i&&gl.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=fl.kit.encodeTrackData(e.data),gl.isArray(a)&&a.length?gl.each(a,function(t){e.callback=null,e.server_url=t,wi(e)}):"string"==typeof a&&""!==a?wi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function ki(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function Pi(){fl.on("sdkInitPara",function(){ki()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:Si}})})}function Ci(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ni(e,t,r){return Ci(e,t,r),e.plugin_version=ql,e}function ji(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function Ii(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=null;hl.isObject(e.config)&&(r=hl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,hl.isArray(n)&&n.length?hl.each(n,function(t){t&&(e.data=ji(t,i),e.callback=null,e.server_url=t,Ii(e))}):"string"==typeof n&&""!==n?(e.data=ji(n,i),Ii(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ai(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function Di(){_l.on("sdkInitPara",function(){Ai()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function $i(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ei(e,t,r){return $i(e,t,r),e.plugin_version=_a,e}function Li(e){return null===zl?void Ui(e):void zl.push(e)}function Ui(e){try{if("log"===e.level&&Ri())return void Ji(e);if("warn"===e.level&&Bi())return void Ji(e);if("error"===e.level&&Hi())return void Ji(e)}catch(t){}}function Ri(){return!!Fi()||Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level}function Bi(){return!!Fi()||Ri()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level}function Hi(){return!!Fi()||!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level}function Ji(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Mi(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Mi(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function Ki(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Fi(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Vi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new d((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new d((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new d((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var p,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),p=5==n.a.length&&1===n.a[0],p&&(a(function(){p=!f('"\t"')}),p&&a(function(){p=1!==f("01")}),p&&a(function(){p=1!==f("1.")})))},function(){p=!1}),t=p}}return o[e]=!!t}function s(e){return D(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,d=n.Date||r.Date,p=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new d((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T="000000",A=function(e,t){return(T+(t||0)).slice(-e)},D=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],p=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;p(r+1,0)<=i;r++);for(n=c((i-p(r,0))/30.42);p(r,n+1)<=i;n++);i=1+i-p(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(D=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+A(6,r<0?-r:r):A(4,r))+"-"+A(2,n+1)+"-"+A(2,i)+"T"+A(2,o)+":"+A(2,s)+":"+A(2,l)+"."+A(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var $=i.stringify;i.stringify=function(e,t,r){var n=d.prototype.toJSON;d.prototype.toJSON=s;var i=$(e,t,r);return d.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=I[t];return r?r:x+A(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,p,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===d.prototype.toJSON?l=D(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),p=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,B));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++B);e+=a.slice(t,B)}if(34==a.charCodeAt(B))return B++,e;q();default:if(t=B,45==i&&(n=!0,i=a.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(B+1),i>=48&&i<=57)&&q(),n=!1;B=48&&i<=57);B++);if(46==a.charCodeAt(B)){for(r=++B;r57));r++);r==B&&q(),B=r}if(i=a.charCodeAt(B),101==i||69==i){for(i=a.charCodeAt(++B),43!=i&&45!=i||B++,r=B;r57));r++);r==B&&q(),B=r}return+a.slice(t,B)}n&&q();var s=a.slice(B,B+4);if("true"==s)return B+=4,!0;if("fals"==s&&101==a.charCodeAt(B+4))return B+=5,!1;if("null"==s)return B+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return B=0,H=""+e,r=F(K()),"$"!=K()&&q(),B=H=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Wi,zi={setup:function(e){Wi=e},log:function(){(Wi||console&&console.log||function(){}).apply(null,arguments)}},Xi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Xi.get(e))||null}catch(r){zi.log(r)}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){zi.log(r)}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Xi.set(t,r),Xi.get(t)!==r&&(e=!1),Xi.remove(t)}catch(n){e=!1}return e}},Zi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Xi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Xi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Xi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Xi.get(e)),Xi.remove(e),Xi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Xi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Xi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Xi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Xi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.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=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Qi=function(e){this.ele=e},Yi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Qi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(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,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.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),y(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||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=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 Yi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Yi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},ba={checkIsAddSign:function(e){"track"===e.type&&(Ae()?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(Vi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};va.isSupport()?va.set(Te("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):ya.set(ya.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Ae()||(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)}}},wa=function(){this._events=[],this.pendingEvents=[]};wa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(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():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Sa={data:{},id:function(){return this.data.id?this.data.id:(this.data.id=Ee(),this.data.id)},type:function(){return this.data.type?this.data.type:(this.data.type=xe(),this.data.type)}},ka={distinct_id:function(){},jssdkDebug:function(){},_sendDebug:function(e){},apph5:function(e){var t="app_h5\u6253\u901a\u5931\u8d25-",n={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"},i=e.output,a=e.step,o=e.data||"";"all"!==i&&"console"!==i||Oe(n[a]),("all"===i||"code"===i)&&r(pa.is_debug)&&pa.is_debug.apph5&&(o.type&&"profile"===o.type.slice(0,7)||(o.properties._jssdk_debug_info="apph5-"+String(a)))},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(g(e).protocol!==g(t).protocol)return!1}catch(r){return Ne("\u4e0d\u652f\u6301 _.URL \u65b9\u6cd5"),!1}return!0},serverUrl:function(){d(pa.server_url)&&""!==pa.server_url&&!this.protocolIsSame(pa.server_url,location.href)&&Ne("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){return e!==pa.server_url&&void(d(e)&&""!==e&&!this.protocolIsSame(e,location.href)&&Ne("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"))}}},Pa={initPage:function(){var e=Le(),t=Z(),r=Ie(t);r||ka.jssdkDebug("url_domain\u5f02\u5e38_"+t+"_"+r),this.pageProp={referrer:e,referrer_host:e?q(e):"",url:t,url_host:q(t,"url_host\u53d6\u503c\u5f02\u5e38"),url_domain:r}},pageProp:{},campaignParams:function(){return Vi.kit.getUtmData()},campaignParamsStandard:function(e,t){e=e||"",t=t||"";var r=Pa.campaignParams(),n={},i={};return k(r,function(r,a,o){(" "+ga+" ").indexOf(" "+a+" ")!==-1?n[e+a]=o[a]:i[t+a]=o[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,r={$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:_a};return r},currentProps:{},register:function(e){P(Pa.currentProps,e)}},Ca={},Oa=new l;Ca.spa=Oa,Ca.sdk=new l,Ca.data=new l,Ca.initSystemEvent=function(){Ye(function(e){Oa.emit("switch",e)})},Ca.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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var Na=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};Na.prototype.start=function(){var e=this,t=new Date;Ze({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(r,n){Ca.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){Ca.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},Na.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var ja="sawebjssdk-",Ia="tab-sawebjssdk-";tt.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()},pa.batch_send.send_interval)},getServerUrl:function(){return d(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),Xi.remove(e[n])}r=Ce(r),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=ja+String(n()),a=Xi.get(this.tabKey);null===a?(this.tabKey=Ia+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,Xi.set(this.tabKey,JSON.stringify(a)),Vi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Ia+String(n()),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var d=new a(n);d.get(s,r,1e3,function(e){if(e){null===Xi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Xi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Xi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var p=i(Xi.get(s))||{expireTime:0};t()-p.expireTime>r&&Xi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!d(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!d(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=xa._state.history_login_id;return!(t&&t.name&&t.name===e||re(this.bindReservedNames,e)>-1)}},Ua={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ea[n])&&Ea[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ea[n])&&Ea[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ea[n])&&Ea[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){rt({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ea[i])&&Ea[i](n)),!0};rt({propertyValue:t},n)}):La.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ea[n])&&Ea[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ea[n])&&Ea[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=p(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ra.configIsMatchNew=function(e,t){if(d(e.$element_selector)&&d(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 e.$element_selector.indexOf(t.element_selector)>-1}if(d(e.$element_path)&&d(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 e.$element_path.indexOf(t.element_path)>-1}return!1},Ra.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"]?Ra.configIsMatchNew(e,t):Ra.configIsMatchOldVersion(e,t))},Ra.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(Ra.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},Ra.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ra.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ra.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ra.getPropElInLi=function(e,t){if(!(e&&_(e)&&d(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Vi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ra.getProp=function(e,t){if(!r(e))return!1;if(!(d(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(d(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!d(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Vi.heatmap.getClosestLi(s);o=Ra.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!d(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ra.getAssignConfigs=function(e,t){var n=Ra.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ba={events:[],getAssignConfigs:Ra.getAssignConfigs,filterConfig:Ra.filterConfig,getProp:Ra.getProp,initUrl:Ra.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),d(a.event_name)&&n.push(a.event_name))}),Vi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Vi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Vi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ha={events:[],customProp:Ba,getAssignConfigs:Ra.getAssignConfigs,initUrl:Ra.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Vi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Vi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ja={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=qa.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Vi.heatmap.getEleDetail(e);if(!r(t)||!d(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,qa.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ra.getProp,getPropElInLi:Ra.getPropElInLi,filterConfig:Ra.filterConfig},qa={unlimitedDiv:Ja,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ma,initUrl:function(){var e=Ra.initUrl();if(e){var t;try{t=new f(Vi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Vi.para.heatmap)||!Vi.para.heatmap.get_vtrack_config)return!1;if(Xi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=xa.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Vi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Vi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Xa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Xa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(!d(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){var t=function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&d(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null};return t(e,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Vi.heatmap.getClosestLi(e);if(!i||!_(e)||!d(e.tagName))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Vi.is_heatmap_render_mode=!0,Vi.para.heatmap||(Vi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Vi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Vi.para.heatmap_url||(Vi.para.heatmap_url=ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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=We({target:e});r.$element_selector=t?t:"",r.$element_path=Vi.heatmap.getElementPath(e,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);var n=Vi.heatmap.getElementPosition(e,r.$element_path,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Vi.para.heatmap)&&e(Vi.para.heatmap.collect_element)&&!Vi.para.heatmap.collect_element(n))return!1;var s=Xa.getBasicEleInfo(t,n,i,a,o);mt(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Vi.para.heatmap&&Vi.para.heatmap.custom_property){var c=Vi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div?!!(r(Vi.para.heatmap)&&r(Vi.para.heatmap.collect_tags)&&r(Vi.para.heatmap.collect_tags.div)&&v(Vi.para.heatmap.collect_tags.div.ignore_tags)&&re(Vi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Vi.para&&Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Vi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.scroll_notice_map)return!1;var t=!0;Vi.para.scrollmap&&e(Vi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Vi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Vi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Vi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,vt(e)),this.current_time=n}});i.current_time=new Date,De(window,"scroll",function(){return!!t&&void i.go()}),De(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.clickmap)&&(e(Vi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Vi.para.heatmap.collect_url()}),"all"===Vi.para.heatmap.collect_elements?Vi.para.heatmap.collect_elements="all":Vi.para.heatmap.collect_elements="interact",void("all"===Vi.para.heatmap.collect_elements?De(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=d(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):De(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Vi.heatmap.getTargetElement(a,e);return!(!_(o)&&!d(a.tagName))&&void(_(o)&&d(o.tagName)?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Vi.para.heatmap)&&Vi.para.heatmap.get_vtrack_config&&Ja.events.length>0&&Ja.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"}))})))}},Za={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Vi.log("error: isReady callback must be function")},getUtm:function(){return Pa.campaignParams()},getStayTime:function(){return(new Date-Vi._t)/1e3},setProfileLocal:function(e){if(!Xi.isSupport())return Vi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=xa.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(xa.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Vi.setProfile(e))}else xa.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Vi.setProfile(e)},setInitReferrer:function(){var e=Le();Vi.setOnceProfile({_init_referrer:e,_init_referrer_host:Pa.pageProp.referrer_host})},setSessionReferrer:function(){var e=Le();xa.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:Pa.pageProp.referrer_host})},setDefaultAttr:function(){Pa.register({_current_url:location.href,_referrer:Le(),_referring_host:Pa.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Vi.para.heatmap&&Vi.para.heatmap.track_attr?Vi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Xa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Xa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Vi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,yt()),t),i=Z()}var i;i=this.autoTrackIsUsed?Pa.pageProp.url:Pa.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,bt(Vi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=yt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Vi.para.is_single_page&&w(function(){var r=Le(a,!0);Vi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Vi.track("$pageview",P({$referrer:Le(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),bt(Vi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(xa._state)?"SDK is not initialized.":xa.getAnonymousId()},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Vi.modules)&&Vi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Vi.use.apply(Vi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:It,unbind:Tt,trackLink:At,trackLinks:Dt,setItem:$t,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Bt,unsetProfile:Ht,identify:Jt,resetAnonymousIdentity:Mt,trackSignup:Kt,registerPage:Ft,clearAllRegister:Vt,clearPageRegister:Wt,register:zt,registerOnce:Xt,registerSession:Zt,registerSessionOnce:Gt,login:Qt,loginWithKey:Yt,logout:er,getPresetProperties:tr,readyState:Ga,debug:ka,on:et,log:Oe};zi.setup(Oe);var eo=P({},ua,Da),to={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:Vi.para.use_app_track_is_send!==!1&&"only"!==Vi.para.use_app_track,white_list:[],is_mui:"mui"===Vi.para.use_app_track};"object"==typeof Vi.para.app_js_bridge?Vi.para.app_js_bridge=P({},e,Vi.para.app_js_bridge):Vi.para.use_app_track!==!0&&Vi.para.app_js_bridge!==!0&&"only"!==Vi.para.use_app_track&&"mui"!==Vi.para.use_app_track||(Vi.para.app_js_bridge=P({},e)),Vi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Vi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ar};nr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),ir(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},nr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},nr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),ir(r)},or.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Vi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==F(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=F(e,"sa-request-id")||null,r=F(e,"sa-request-type")||null,n=F(e,"sa-request-url")||null;if(Xa.setNotice(n),aa.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Vi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Vi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Vi.heatmap_version&&Vi.heatmap_version===Vi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Vi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Xa.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=d(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&d(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return d(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Xa.setNotice(i),aa.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(lr("sa-visual-mode")===!0||"true"===lr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Vi.para.vtrack_url?Vi.para.vtrack_url:ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vtrack.min.js"})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(aa.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var t=e.data.data.userURL;d(t)&&(window.location.href=encodeURI(t.replace(/javascript:/i,"")))}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:_a}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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){}};vr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new mr(t,n,Vi),a=0;a=2)&&(wo&&(Or(!0),_r()),Ca.initSystemEvent(),Vi.setInitVar(),Vi.readyState.setState(2),Vi.initPara(e),Ca.sdk.emit("initPara"),Ca.sdk.emit("afterInitPara"),Ca.sdk.emit("initAPI"),Ca.sdk.emit("afterInitAPI"),Vi.detectMode(),rr(),Ca.sdk.emit("afterInit"),void Ca.sdk.emit("ready"))},wo?Or(!1):(Or(!0),_r());var So,ko,Po,Co,Oo,No,jo,Io,To,Ao,Do,$o,xo,Eo,Lo,Uo,Ro,Bo,Ho="1.26.9",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=Ir(Jo),qo="1.26.9",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=Dr(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:$r,visualized_track:xr,page_info:xr,sensorsdata_get_app_visual_config:Er}},Go="1.26.9",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Br()},handleCommand:Jr},Yo=Rr(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Mr,visualized_track:qr,page_info:qr,sensorsdata_get_app_visual_config:Kr}},as="1.26.9",os={init:function(e){Do=e,$o=Do&&Do._,xo=Do&&Do.log||console&&console.log||function(){},zr()},handleCommand:Zr},ss=Wr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.26.9",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"), +!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Ts.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Ts.data=e,Ts.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Ts.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Is(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(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=ps().visibilityChange,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},As=rn(Ts,"Deeplink","sdkReady"),Ds="1.26.9",$s={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},ln()},handleCommand:cn},xs=sn($s,"IOSBridge","sdkAfterInitPara"),Es="1.26.9",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},gn()}},Us=fn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.26.9",Bs=5e3,Hs=432e3;wn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},wn.prototype.log=function(e){this.sd&&this.sd.log(e)},wn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Bs)},wn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},wn.prototype.pageStartHandler=function(){this.start_time=+new Date,1==!document.hidden?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},wn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&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()}},wn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},wn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},wn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||"string"!=typeof e||""===e||this.option.isCollectUrl(e)},wn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},wn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},wn.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()}})},wn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},wn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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()},wn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},wn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},wn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},wn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},wn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new wn,Ms=bn(Js,"PageLeave","sdkReady"),qs="1.26.9",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=Pn(Fs,"PageLoad","sdkReady");On.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Cn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.26.9";On.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new On,Gs=In(Zs),Qs="1.26.9",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=$n,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=Dn(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.26.9",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var p=u.indexOf("?");a=p>-1?o>-1?s+l+"#"+u.substring(1,o)+d(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+d(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,dl,pl,fl,gl,_l,hl,ml=Ln(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.26.9",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Bn(bl,"Utm","sdkAfterInitPara"),Sl="1.26.9",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=qn,Pl.enableSDK=Kn,Pl.getDisabled=Fn}},Ol=Mn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.26.9",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Qn()}},Il=zn(jl),Tl="1.26.9",Al={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ni()}},Dl=ti(Al),$l="1.26.9",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ci()}},Ll=si(El),Ul="1.26.9",Rl={plugin_name:"BeaconSender",init:function(e){dl=e,pl=dl._,mi()}},Bl=fi(Rl),Hl="1.26.9",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,Pi()}},Ml=bi(Jl),ql="1.26.9",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,Di()}},Fl=Ni(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Li),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("https://www.sensorsdata.cn/"),"https://www.sensorsdata.cn/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{d(e)||(e=String(e)),e=p(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void Gi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new ta(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement||a.target;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(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){Gi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(na&&e.forEach===na)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText),i.status):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){Gi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(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 j(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}function I(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(p){Gi.log(p)}n&&d()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function T(e){return k(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 A(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function D(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,document.cookie.indexOf(t+"=true")!==-1){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function J(e){function t(e,t){e=p(e);var r;if("body"===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 o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){Gi.log(o)}return i&&_(i)?r(i):null}if(!d(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=p(e.textContent):e.innerText&&(r=p(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 q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){Gi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function V(e,t){var r=g(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i){var a=F(i);n=a[t]||""}}return n}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){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(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){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 Z(e){return d(e)?(e=p(e),A(e)):A(location.href)}function G(e){return d(e)?(e=p(e),A(e)):A(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function pe(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!d(t.callbackName))return Gi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(n.defer="defer",i.appendChild(n),ce(t.timeout)){var s=Math.min(t.timeout,3e5);a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){Gi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},s)}if(window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){Gi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var l=[];k(t.data,function(e,t){l.push(t+"="+e)}),t.data=l.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){Gi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=encodeURI(t.url)}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.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;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.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 he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,d)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else d(i)||ce(i)||$(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function it(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function at(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function ot(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))ot(e[a]);else if(d(i)){if(re(n,a)>-1)return;e[a]=it(i,re(t,a)>-1?1024:_a.max_string_length)}})}function st(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function lt(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};rt({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};rt({item_id:n},i)}}function ut(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&rt({propertyKey:n},i)})}function ct(e){var t=e.properties;ye(e),r(t)?(nt(t),at(t),st(e),ut(t),ot(t)):"properties"in e&&(e.properties={}),lt(e)}function dt(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function pt(e,t){try{var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,Ua.getIdentities());var a={identities:i,distinct_id:Ua.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,Ua.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),"$UnbindID"===a.event&&(a.login_id&&delete a.login_id,a.anonymous_id&&delete a.anonymous_id),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},Pa.properties(),Ua.getProps(),Ua.getSessionProps(),Pa.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!d(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!d(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&d(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&d(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!d(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!d(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!d(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),d(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&$(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=qa.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=Va.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),Oa.checkIsAddSign(a),Oa.checkIsFirstTime(a),Fe(a),Ve(a),a}catch(o){return{_debug_web_msg:String(o)}}}function ft(e){return za.stage.process("basicProps",e)}function gt(e){return za.stage.process("formatData",e)}function _t(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&Be(e.ele,"click",function(e){i(e)}))))}function ht(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function mt(e){return Za.stage.process("webClickEvent",e)}function vt(e){return Za.stage.process("webStayEvent",e)}function yt(){var e=Pa.campaignParams(),t={};return k(e,function(e,r,n){(" "+Xi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function bt(e,t,r){if(Xi.is_first_visitor&&r){var n={};Xi.para.preset_properties.search_keyword_baidu&&xe(document.referrer)&&Te()&&(n.$search_keyword_id=Sa.id(),n.$search_keyword_id_type=Sa.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=$e(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:d(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:d(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:He(),$first_search_keyword:Ee()},yt(),n)),Xi.is_first_visitor=!1}}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=Ua.getFirstId(),s=Ua.getOriginDistinctId();if(!rt({distinct_id:n}))return je("login id is invalid"),!1;if(n===Ua.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"), -!1;if(r(Ua._state.identities)&&Ua._state.identities.hasOwnProperty(a)&&n===Ua._state.first_id)return!1;var l=Ua._state.history_login_id.name!==a||n!==Ua._state.history_login_id.value;if(l){Ua._state.identities[a]=n,Ua.set("history_login_id",{name:a,value:n}),o||Ua.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:Ua._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];Ua._state.identities=t,Ua.save()}function kt(e,t){if(!rt({unbindKey:e,bindValue:t}))return!1;if(r(Ua._state.identities)&&Ua._state.identities.hasOwnProperty(e)&&Ua._state.identities[e]===t){var n=Ua.getUnionId().login_id;n&&e+"+"+t===n&&(Ua._state.distinct_id=Ua._state.first_id,Ua._state.first_id="",Ua.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete Ua._state.identities[e],Ua.save())}var i={};return i[e]=t,i}function Pt(){Xi._t=Xi._t||1*new Date,Xi.is_first_visitor=!1,Xi.source_channel_standard=ma}function Ct(e){P(_a,e||Xi.para||{}),Xi.para=_a;var t={};if(r(Xi.para.is_track_latest))for(var n in Xi.para.is_track_latest)t["latest_"+n]=Xi.para.is_track_latest[n];Xi.para.preset_properties=P({},ha.preset_properties,t,Xi.para.preset_properties||{});var i;for(i in ha)void 0===Xi.para[i]&&(Xi.para[i]=ha[i]);"string"!=typeof Xi.para.web_url||"://"!==Xi.para.web_url.slice(0,3)&&"//"!==Xi.para.web_url.slice(0,2)||("://"===Xi.para.web_url.slice(0,3)?Xi.para.web_url=location.protocol.slice(0,-1)+Xi.para.web_url:Xi.para.web_url=location.protocol+Xi.para.web_url),ka.protocol.serverUrl(),Xi.bridge&&Xi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Xi.para.source_type&&(Xi.para.source_type.utm=v(Xi.para.source_type.utm)?Xi.para.source_type.utm.concat(a):a,Xi.para.source_type.search=v(Xi.para.source_type.search)?Xi.para.source_type.search.concat(o):o,Xi.para.source_type.social=v(Xi.para.source_type.social)?Xi.para.source_type.social.concat(s):s,Xi.para.source_type.keyword=r(Xi.para.source_type.keyword)?P(l,Xi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Xi.para.heatmap&&!r(Xi.para.heatmap)&&(Xi.para.heatmap={}),r(Xi.para.heatmap)){Xi.para.heatmap.clickmap=Xi.para.heatmap.clickmap||"default",Xi.para.heatmap.scroll_notice_map=Xi.para.heatmap.scroll_notice_map||"default",Xi.para.heatmap.scroll_delay_time=Xi.para.heatmap.scroll_delay_time||4e3,Xi.para.heatmap.scroll_event_duration=Xi.para.heatmap.scroll_event_duration||18e3,Xi.para.heatmap.renderRefreshTime=Xi.para.heatmap.renderRefreshTime||1e3,Xi.para.heatmap.loadTimeout=Xi.para.heatmap.loadTimeout||1e3,Xi.para.heatmap.get_vtrack_config!==!0&&(Xi.para.heatmap.get_vtrack_config=!1);var d=v(Xi.para.heatmap.track_attr)?U(Xi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),Xi.para.heatmap.track_attr=d,r(Xi.para.heatmap.collect_tags))if(Xi.para.heatmap.collect_tags.div===!0)Xi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Xi.para.heatmap.collect_tags.div)){if(Xi.para.heatmap.collect_tags.div.ignore_tags?v(Xi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Xi.para.heatmap.collect_tags.div.ignore_tags=c):Xi.para.heatmap.collect_tags.div.ignore_tags=c,Xi.para.heatmap.collect_tags.div.max_level){var p=[1,2,3];re(p,Xi.para.heatmap.collect_tags.div.max_level)===-1&&(Xi.para.heatmap.collect_tags.div.max_level=1)}}else Xi.para.heatmap.collect_tags.div=!1;else Xi.para.heatmap.collect_tags=u}Xi.para.server_url=Ge(Xi.para.server_url),Xi.para.noCache===!0?Xi.para.noCache="?"+(new Date).getTime():Xi.para.noCache="",Xi.para.callback_timeout>Xi.para.datasend_timeout&&(Xi.para.datasend_timeout=Xi.para.callback_timeout),Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&r(Xi.para.heatmap.collect_tags)&&k(Xi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Xi.heatmap.otherTags.push(t)}),Xi.para.heatmap&&"default"===Xi.para.heatmap.clickmap&&Xi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Ya[t]?Ya[t].apply(Ya,r):void("function"==typeof t?t.apply(Xi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Xi,n),a.plugin_is_init=!0,Xi.modules=Xi.modules||{},Xi.modules[a.plugin_name||"unnamed_"+to++]=a,a}if(!d(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Xi.modules&&Xi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return d(t)&&(r(Xi.modules)&&r(Xi.modules[t])?a=Xi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Xi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){rt({event:e,properties:t})&&Xa.send({type:"track",event:e,properties:t},r)}function It(e,t){return!!rt({bindKey:e,bindValue:t})&&(Ua._state.identities[e]=t,Ua.save(),void Xa.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function Tt(e,t){var r=kt(e,t);r&&Xa.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function At(e,t,r){"object"==typeof e&&e.tagName?_t({ele:e},t,r,Xi.track):"object"==typeof e&&e.target&&e.event&&_t(e,t,r,Xi.track)}function Dt(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void Be(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Xi.track(t,r,i)}))}function $t(e,t,r){rt({item_type:e,item_id:t,properties:r})&&Xa.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){rt({item_type:e,item_id:t})&&Xa.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){rt({propertiesMust:e})&&Xa.send({type:"profile_set",properties:e},t)}function Lt(e,t){rt({propertiesMust:e})&&Xa.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){rt({propertiesMust:e})&&(k(e,function(t,r){d(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Xa.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;d(e)&&(e={},e[n]=1),rt({propertiesMust:e})&&(r(e)?Xa.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Bt(e){Xa.send({type:"profile_delete"},e),Ua.set("distinct_id",ea()),Ua.set("first_id","")}function Ht(e,t){var r=e,n={};d(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){d(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Xa.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e){"number"==typeof e&&(e=String(e));var t=Ua.getFirstId();if("undefined"==typeof e){var r=ea();t?Ua.set("first_id",r):Ua.set("distinct_id",r)}else rt({distinct_id:e})&&(t?Ua.set("first_id",e):Ua.set("distinct_id",e))}function Mt(e){var t=Ua.getFirstId();if(t)return je("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),"undefined"==typeof e){var r=ea();Ua._state.identities.$identity_cookie_id=r,Ua.set("distinct_id",r)}else rt({distinct_id:e})&&(Ua._state.identities.$identity_cookie_id=e,Ua.set("distinct_id",e))}function qt(e,t,r,n){var i=Ua.getFirstId()||Ua.getDistinctId();Ua.set("distinct_id",e),Xa.send({original_id:i,distinct_id:Ua.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function Kt(e,t,r,n){"number"==typeof e&&(e=String(e)),rt({distinct_id:e,event:t,properties:r})&&qt(e,t,r,n)}function Ft(e){rt({properties:e})?P(Pa.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Vt(e){Ua.clearAllProps(e)}function Wt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Xi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Xi.lib_version+"/vapph5define.min.js"})}else t();else t()}function cr(t){Xi.para.is_track_single_page&&Ia.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){Pa.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Xi.quick&&Xi.quick("autoTrack",i)}};if("boolean"==typeof Xi.para.is_track_single_page)i();else if("function"==typeof Xi.para.is_track_single_page){var a=Xi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function dr(){Xi._q&&v(Xi._q)&&Xi._q.length>0&&k(Xi._q,function(e){Xi[e[0]].apply(Xi,Array.prototype.slice.call(e[1]))}),r(Xi.para.heatmap)&&(Qa.initHeatmap(),Qa.initScrollmap())}function pr(){Xi.readyState.setState(3),new Xi.SDKJSBridge("visualized").onAppNotify(function(){ur("undefined"!=typeof sa_jssdk_app_define_mode?!0:!1)}),ur(!1),Xi.bridge.app_js_bridge_v1(),Pa.initPage(),cr(),Ua.init(),sr(),gr(),Xi.readyState.setState(4),dr()}function fr(){ao.isSeachHasKeyword()?ao.hasKeywordHandle():window.parent!==self&&oo.isSearchHasKeyword()?oo.verifyVtrackMode():ao.isWindowNameHasKeyword()?ao.windowNameHasKeywordHandle():ao.isStorageHasKeyword()?ao.storageHasKeywordHandle():window.parent!==self&&oo.isStorageHasKeyword()?oo.verifyVtrackMode():(pr(),oo.notifyUser())}function gr(){Va.init(),"success"===Xi.bridge.bridge_info.verify_success&&qa.init()}function _r(){k(so,function(t){var r=Xi[t];Xi[t]=function(){if(Xi.readyState.state<3)return v(Xi._q)||(Xi._q=[]),Ne("calling sdk api before init is deprecated."),Xi._q.push([t,arguments]),!1;if(!e(Xi.getDisabled)||!Xi.getDisabled())return Xi.readyState.getState()?r.apply(Xi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function hr(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 mr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new hr,this.sensors=r}function vr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function yr(e){e&&e.buildDataStage&&co.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&_o.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&fo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&mo.registerStageImplementation(e.viewStage)}function br(e,t){vo[e]&&vo[e](t)}function wr(){return yo.stage&&yo.stage.process("getUtmData")}function Sr(e){return bo.stage.process("send",e)}function kr(e){e.kit=wo,e.saEvent=Xa,this.buildDataStage=za,this.sendDataStage=bo,this.businessStage=yo}function Pr(e){e.heatmap=Qa,this.viewStage=Za}function Cr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};br("buildDataStage",r)}function Or(e){e&&(Xi.events=La,Xi.bridge=io,Xi.SDKJSBridge=nr,Xi.JSBridge=or,Xi.store=Ua,Xi.unlimitedDiv=Ka,Xi.customProp=Fa,Xi.vtrackcollect=Va,Xi.vapph5collect=qa,Xi.detectMode=fr,Xi.registerFeature=yr,Xi.registerInterceptor=br,Xi.commonWays=Ya,yr(new kr(Xi)),yr(new Pr(Xi)),br("viewStage",So));var t=e?ro:lo;for(var r in t)Xi[r]=t[r];Xi.logger=ga,Xi.log=Oe,Xi._=no,Xi.on=et,Xi.ee=ja,Xi.use=Nt,Xi.lib_version=va,Xi.registerPropertyPlugin=Cr}function Nr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ir(e,t,r){return Nr(e,t,r),e.plugin_version=qo,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ar(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ar(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dr(e,t,r){return Tr(e,t,r),e.plugin_version=Vo,e}function $r(e){return Go&&Go.call(Xo,JSON.stringify(e))}function xr(e){return Zo.call(Xo)&&Qo&&Qo.call(Xo,JSON.stringify(e))}function Er(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Lr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ur(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ur(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rr(e,t,r){return Lr(e,t,r),e.plugin_version=es,e}function Br(){if(Co=window.SensorsData_APP_New_H5_Bridge,Oo=Co&&Co.sensorsdata_track,No=Oo&&Co.sensorsdata_get_server_url&&Co.sensorsdata_get_server_url(),To("---test---fail---",!jo,jo.bridge.activeBridge,!No),jo&&!jo.bridge.activeBridge&&No)return jo.bridge.activeBridge=ts,jo.para.app_js_bridge&&!jo.para.app_js_bridge.is_mui&&(jo.bridge.is_verify_success=No&&jo.bridge.validateAppUrl(No),To("---test---bridge-verify-",jo.bridge.is_verify_success)),jo.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:jo.bridge.is_verify_success?"success":"fail",support_two_way_call:!!Co.sensorsdata_js_call_app},jo.para.app_js_bridge?void jo.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}):void To("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function Hr(e,t){if(To("---test---datasend-",jo.bridge.is_verify_success),jo.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return jo.bridge.is_verify_success?(To("---test---bridge-verify-success---",e.data),Oo&&Oo.call(Co,JSON.stringify(Io.extend({server_url:jo.para.server_url},e.data))),Io.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(To("---test---bridge-verify-fail-----",jo.bridge.is_verify_success),jo.para.app_js_bridge.is_send?(jo.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Io.isFunction(r)&&r(),t.cancellationToken.cancel(),e))}function Jr(e){var t=e.callType;return t in Yo.commands?Yo.commands[t](e,Co):void(Co&&Io.isFunction(Co.sensorsdata_js_call_app)&&Co.sensorsdata_js_call_app(JSON.stringify(e)))}function Mr(e){return as&&as.call(ns,JSON.stringify(e))}function qr(e){return is.call(ns)&&os&&os.call(ns,JSON.stringify(e))}function Kr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Fr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wr(e,t,r){return Fr(e,t,r),e.plugin_version=ls,e}function zr(){if(Uo("ObsoleteBridge---test---init---"),Ao=window.SensorsData_APP_JS_Bridge,Do=Ao&&Ao.sensorsdata_track,$o=Ao&&Ao.sensorsdata_verify,xo=Ao&&Ao.sensorsdata_visual_verify,Uo("ObsoleteBridge-",Eo.bridge.activeBridge,$o,Do,xo),Eo&&!Eo.bridge.activeBridge&&($o||Do||xo)){Eo.bridge.activeBridge=us;var e=$o||Do;if(xo&&(e=!!xo.call(Ao,JSON.stringify({server_url:Eo.para.server_url})),Uo("ObsoleteBridge---called-return",e)),Eo.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Eo.para.app_js_bridge)return void Uo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Eo.registerInterceptor("sendDataStage",{send:{priority:80,entry:Xr}}),Uo("Android obsolete bridge inits succeed.")}}function Xr(e,t){if(Uo("ObsoleteBridge---senddata"),Eo.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if($o){var n=$o&&$o.call(Ao,JSON.stringify(Lo.extend({server_url:Eo.para.server_url},e.data)));return Uo("ObsoleteBridge---anVerify-success",n),n?(Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Eo.para.app_js_bridge.is_send?(Eo.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return Uo("ObsoleteBridge---is-send-old-way",Eo.para.app_js_bridge.is_send),Do&&Do.call(Ao,JSON.stringify(Lo.extend({server_url:Eo.para.server_url},e.data))),Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Zr(e){Uo("ObsoleteBridge---handleCommadn");var t=e.callType;return t in ss.commands?(Uo("ObsoleteBridge---",t,ss.commands),ss.commands[t](e,Ao)):Ao&&Lo.isFunction(Ao.sensorsdata_js_call_app)?(Uo("ObsoleteBridge---handleCommadn-abridge"),Ao.sensorsdata_js_call_app(JSON.stringify(e))):void 0}function Gr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Qr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Qr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Yr(e,t,r){return Gr(e,t,r),e.plugin_version=ds,e}function en(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return tn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function tn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function rn(e,t,r){return en(e,t,r),e.plugin_version=gs,e}function nn(){return"undefined"!=typeof Mo&&document[Mo]}function an(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return on(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function on(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function sn(e,t,r){return an(e,t,r),e.plugin_version=Es,e}function ln(){if(hs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,ms=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},vs&&!vs.bridge.activeBridge&&ms()&&ms().postMessage){if(vs.bridge.activeBridge=Ls,vs.para.app_js_bridge&&!vs.para.app_js_bridge.is_mui&&(vs.bridge.is_verify_success=hs&&vs.bridge.validateAppUrl(hs)),vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:vs.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:70,entry:un}}),bs("IOS bridge inits succeed.")}}function un(e,t){if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return vs.bridge.is_verify_success?(ms()&&ms().postMessage(JSON.stringify({callType:"app_h5_track",data:ys.extend({server_url:vs.para.server_url},e.data)})),ys.isFunction(r)&&r(),t.cancellationToken.cancel(),e):vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(ys.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function cn(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||vs.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?ys.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:ms()&&ms().postMessage(JSON.stringify(e)):null}function dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fn(e,t,r){return dn(e,t,r),e.plugin_version=Rs,e}function gn(){if(ws&&!ws.bridge.activeBridge&&_n()){if(ws.bridge.activeBridge=Bs,ws.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:hn()?"success":"fail"},!ws.para.app_js_bridge)return void ks("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");ws.registerInterceptor("sendDataStage",{send:{priority:90,entry:mn}}),ks("IOS obsolete bridge inits succeed.")}}function _n(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function hn(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=Ss.URL(ws.para.server_url).hostname,r=Ss.URL(ws.para.server_url).searchParams.get("project")||"default"}catch(n){ws.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function mn(e,t){function r(e){var t=JSON.stringify(Ss.extend({server_url:ws.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(ws.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(ws.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,Ss.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return ws.para.app_js_bridge.is_send?(ws.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(Ss.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bn(e,t,r){return vn(e,t,r),e.plugin_version=Js,e}function wn(){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=qs}function Sn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return kn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o); -}}return e}function kn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Pn(e,t,r){return Sn(e,t,r),e.plugin_version=Vs,e}function Cn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function On(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function In(e,t,r){return Nn(e,t,r),e.plugin_version=Zs,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return An(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function An(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dn(e,t,r){return Tn(e,t,r),e.plugin_version=tl,e}function $n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=Gs._.extend(e.properties||{},n)}}catch(i){rl("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Qs.call(Gs.kit,e)}function xn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return En(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function En(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ln(e,t,r){return xn(e,t,r),e.plugin_version=al,e}function Un(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Rn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Rn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Bn(e,t,r){return Un(e,t,r),e.plugin_version=Sl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Mn(e,t,r){return Hn(e,t,r),e.plugin_version=Cl,e}function qn(){Ol=!0}function Kn(){Ol=!1}function Fn(){return Ol}function Vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zn(e,t,r){return Vn(e,t,r),e.plugin_version=Tl,e}function Xn(e){var t=e,r="";r=ll.para.debug_mode_url.indexOf("?")!==-1?ll.para.debug_mode_url+"&"+ll.kit.encodeTrackData(e):ll.para.debug_mode_url+"?"+ll.kit.encodeTrackData(e),ul.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(ll.para.debug_mode_upload)},success:function(e){ul.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Zn(e,t){if(ll.para.debug_mode===!0){var r=e.data;e.callback;Xn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Gn(){ll.para.debug_mode===!0&&(ll.para.debug_mode_upload=ll.para.debug_mode_upload||!1,ul.isString(ll.para.debug_mode_url)||(ul.isString(ll.para.server_url)?ll.para.debug_mode_url=ll.para.server_url.replace("sa.gif","debug"):ul.isArray(ll.para.server_url)&&ul.isString(ll.para.server_url[0])?ll.para.debug_mode_url=ll.para.server_url[0].replace("sa.gif","debug"):ll.para.debug_mode=!1))}function Qn(){ll.on("sdkInitPara",function(){Gn()}),ll.on("sdkAfterInitPara",function(){ll.registerInterceptor("sendDataStage",{send:{priority:30,entry:Zn}})})}function Yn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ei(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ei(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ti(e,t,r){return Yn(e,t,r),e.plugin_version=$l,e}function ri(e,t){if(dl.isObject(cl.para.jsapp)&&!cl.para.jsapp.isOnline&&"function"==typeof cl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),cl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ni(){cl.on("sdkAfterInitAPI",function(){dl.isObject(cl.commonWays)&&(cl.commonWays.setOnlineState=ii),cl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ri}})})}function ii(e){if(e===!0&&dl.isObject(cl.para.jsapp)&&"function"==typeof cl.para.jsapp.getData){cl.para.jsapp.isOnline=!0;var t=cl.para.jsapp.getData();dl.isArray(t)&&t.length>0&&dl.each(t,function(e){dl.isJSONString(e)&&cl.kit.sendData(JSON.parse(e))})}else cl.para.jsapp.isOnline=!1}function ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function si(e,t,r){return ai(e,t,r),e.plugin_version=Ll,e}function li(e,t){return!pl.para.app_js_bridge&&pl.para.batch_send&&fl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fi(e,t,r){return di(e,t,r),e.plugin_version=Hl,e}function gi(e){var t=new _l.BeaconSend(e);t.start()}function _i(e,t){var r=null,n=null;_l.isObject(e.config)&&(r=e.config.send_type,n=_l.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===gl.para.send_type;if(i&&_l.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=gl.kit.encodeTrackData(e.data),_l.isArray(a)&&a.length?_l.each(a,function(t){e.callback=null,e.server_url=t,gi(e)}):"string"==typeof a&&""!==a?gi(e):gl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function hi(){"beacon"!==gl.para.send_type||_l.isSupportBeaconSend()||(gl.para.send_type="image")}function mi(){gl.on("sdkInitPara",function(){hi()}),gl.on("sdkAfterInitPara",function(){gl.registerInterceptor("sendDataStage",{send:{priority:110,entry:_i}})})}function vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bi(e,t,r){return vi(e,t,r),e.plugin_version=ql,e}function wi(e){var t=new ml.AjaxSend(e);t.start()}function Si(e,t){var r=null,n=null;ml.isObject(e.config)&&(r=e.config.send_type,n=ml.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===hl.para.send_type;if(i&&ml.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=hl.kit.encodeTrackData(e.data),ml.isArray(a)&&a.length?ml.each(a,function(t){e.callback=null,e.server_url=t,wi(e)}):"string"==typeof a&&""!==a?wi(e):hl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function ki(){"ajax"!==hl.para.send_type||ml.isSupportCors()||(hl.para.send_type="image")}function Pi(){hl.on("sdkInitPara",function(){ki()}),hl.on("sdkAfterInitPara",function(){hl.registerInterceptor("sendDataStage",{send:{priority:120,entry:Si}})})}function Ci(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ni(e,t,r){return Ci(e,t,r),e.plugin_version=Vl,e}function ji(e,t){var r=vl.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function Ii(e){var t=new yl.ImageSend(e);t.start()}function Ti(e,t){var r=null;yl.isObject(e.config)&&(r=yl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,yl.isArray(n)&&n.length?yl.each(n,function(t){t&&(e.data=ji(t,i),e.callback=null,e.server_url=t,Ii(e))}):"string"==typeof n&&""!==n?(e.data=ji(n,i),Ii(e)):vl.logger&&vl.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ai(){"image"!==vl.para.send_type&&"ajax"!==vl.para.send_type&&"beacon"!==vl.para.send_type&&(vl.para.send_type="image")}function Di(){vl.on("sdkInitPara",function(){Ai()}),vl.on("sdkAfterInitPara",function(){vl.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function $i(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ei(e,t,r){return $i(e,t,r),e.plugin_version=va,e}function Li(e){return null===Gl?void Ui(e):void Gl.push(e)}function Ui(e){try{if("log"===e.level&&Ri())return void Ji(e);if("warn"===e.level&&Bi())return void Ji(e);if("error"===e.level&&Hi())return void Ji(e)}catch(t){}}function Ri(){return!!Fi()||(Xl.para.show_log===!0||Zl.isObject(Xl.para.show_log)&&"log"===Xl.para.show_log.level)}function Bi(){return!!Fi()||(Ri()||Zl.isObject(Xl.para.show_log)&&"warn"===Xl.para.show_log.level)}function Hi(){return!!Fi()||(!Zl.isObject(Xl.para.show_log)||"none"!==Xl.para.show_log.level)}function Ji(e){var t=e.content,r=Zl.isObject(t[0])?Zl.formatJsonString(t[0]):t[0],n=Mi(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Zl.isFunction(console[e.level])?console[e.level].apply(console,t):Zl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Mi(e){var t="",r="",n=Xl.para.show_log;return Zl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Zl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Zl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function qi(){Zl.sessionStorage.isSupport()&&sessionStorage.setItem(eu,"true")}function Ki(){Zl.sessionStorage.isSupport()&&sessionStorage.removeItem(eu)}function Fi(){return Zl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(eu)}function Vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zi(e,t,r){return Vi(e,t,r),e.plugin_version=uu,e}var Xi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new d((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new d((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new d((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var p,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),p=5==n.a.length&&1===n.a[0],p&&(a(function(){p=!f('"\t"')}),p&&a(function(){p=1!==f("01")}),p&&a(function(){p=1!==f("1.")})))},function(){p=!1}),t=p}}return o[e]=!!t}function s(e){return D(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,d=n.Date||r.Date,p=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new d((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T="000000",A=function(e,t){return(T+(t||0)).slice(-e)},D=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],p=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;p(r+1,0)<=i;r++);for(n=c((i-p(r,0))/30.42);p(r,n+1)<=i;n++);i=1+i-p(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(D=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+A(6,r<0?-r:r):A(4,r))+"-"+A(2,n+1)+"-"+A(2,i)+"T"+A(2,o)+":"+A(2,s)+":"+A(2,l)+"."+A(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var $=i.stringify;i.stringify=function(e,t,r){var n=d.prototype.toJSON;d.prototype.toJSON=s;var i=$(e,t,r);return d.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=I[t];return r?r:x+A(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,p,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===d.prototype.toJSON?l=D(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),p=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,B));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++B);e+=a.slice(t,B)}if(34==a.charCodeAt(B))return B++,e;q();default:if(t=B,45==i&&(n=!0,i=a.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(B+1),i>=48&&i<=57)&&q(),n=!1;B=48&&i<=57);B++);if(46==a.charCodeAt(B)){for(r=++B;r57));r++);r==B&&q(),B=r}if(i=a.charCodeAt(B),101==i||69==i){for(i=a.charCodeAt(++B),43!=i&&45!=i||B++,r=B;r57));r++);r==B&&q(),B=r}return+a.slice(t,B)}n&&q();var s=a.slice(B,B+4);if("true"==s)return B+=4,!0;if("fals"==s&&101==a.charCodeAt(B+4))return B+=5,!1;if("null"==s)return B+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return B=0,H=""+e,r=F(K()),"$"!=K()&&q(),B=H=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Zi,Gi={setup:function(e){Zi=e},log:function(){(Zi||console&&console.log||function(){}).apply(null,arguments)}},Qi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Qi.get(e))||null}catch(r){Gi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Gi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Qi.set(t,r),Qi.get(t)!==r&&(e=!1),Qi.remove(t)}catch(n){e=!1}return e}},Yi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Qi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Qi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Qi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Qi.get(e)),Qi.remove(e),Qi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Qi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Qi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Qi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Qi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.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=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),ta=function(e){this.ele=e},ra=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};ta.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){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),y(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||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=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 ra((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return ra(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+_a.sdk_id+e}},Oa={checkIsAddSign:function(e){"track"===e.type&&(Re()?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,n=wa.get("sensorsdata2015jssdkcross"+Xi.para.sdk_id);n=Xi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Xi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Xi.para.encrypt_cookie&&(i=Xi.kit.userEncrypt(i)),wa.set("sensorsdata2015jssdkcross"+Xi.para.sdk_id,i,null,!0)),Xi.para.is_track_device_id&&(Pa.currentProps.$device_id=r)},storeInitCheck:function(){if(Xi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};wa.isSupport()?wa.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):Ca.set(Ca.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(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)}}},Na=function(){this._events=[],this.pendingEvents=[]};Na.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(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():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var ja={},Ia=new l;ja.spa=Ia,ja.sdk=new l,ja.data=new l,ja.initSystemEvent=function(){Ye(function(e){Ia.emit("switch",e)})},ja.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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var Ta=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};Ta.prototype.start=function(){var e=this,t=new Date;Ze({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:_a.datasend_timeout,cors:!0,success:function(r,n){ja.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:_a.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){ja.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:_a.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},Ta.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var Aa="sawebjssdk-",Da="tab-sawebjssdk-";tt.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()},_a.batch_send.send_interval)},getServerUrl:function(){return d(_a.server_url)&&""!==_a.server_url||v(_a.server_url)&&_a.server_url.length?void(this.serverUrl=v(_a.server_url)?_a.server_url[0]:_a.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(this.sendTimeStamp&&t()-this.sendTimeStamp<_a.batch_send.send_interval)return!1;var e=Qi.get(this.tabKey);if(e){this.sendTimeStamp=t(),e=i(e)||this.generateTabStorageVal();var r=Ce(e.data);if(r.length){for(var n=[],a=0;a-1&&r.splice(a,1),Qi.remove(e[n])}r=Ce(r),Qi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=Aa+String(n()),a=Qi.get(this.tabKey);null===a?(this.tabKey=Da+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*_a.batch_send.send_interval,Qi.set(this.tabKey,JSON.stringify(a)),Xi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Da+String(n()),Qi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*_a.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var d=new a(n);d.get(s,r,1e3,function(e){if(e){null===Qi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Qi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Qi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var p=i(Qi.get(s))||{expireTime:0};t()-p.expireTime>r&&Qi.remove(s)}}for(var f=0;f0)for(t=0;t_a.max_id_length)},keyLength:function(e){return!(!d(e)||e.length>_a.max_key_length)},stringLength:function(e){return!(!d(e)||e.length>_a.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=Ua._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},Ha={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ra[n])&&Ra[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ra[n])&&Ra[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ra[n])&&Ra[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ra[n])&&Ra[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){rt({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ra[i])&&Ra[i](n)),!0};rt({propertyValue:t},n)}):Ba.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ra[n])&&Ra[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ra[n])&&Ra[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ra[n])&&Ra[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ra[n])&&Ra[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ra[n])&&Ra[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ra[n])&&Ra[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=p(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ja.configIsMatchNew=function(e,t){if(d(e.$element_selector)&&d(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 e.$element_selector.indexOf(t.element_selector)>-1}if(d(e.$element_path)&&d(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 e.$element_path.indexOf(t.element_path)>-1}return!1},Ja.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"]?Ja.configIsMatchNew(e,t):Ja.configIsMatchOldVersion(e,t)))},Ja.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(Ja.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},Ja.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ja.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ja.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ja.getPropElInLi=function(e,t){if(!(e&&_(e)&&d(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Xi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ja.getProp=function(e,t){if(!r(e))return!1;if(!(d(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(d(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!d(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Xi.heatmap.getClosestLi(s);o=Ja.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!d(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ja.getAssignConfigs=function(e,t){var n=Ja.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ma={events:[],getAssignConfigs:Ja.getAssignConfigs,filterConfig:Ja.filterConfig,getProp:Ja.getProp,initUrl:Ja.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),d(a.event_name)&&n.push(a.event_name))}),Xi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Xi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Xi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},qa={events:[],customProp:Ma,getAssignConfigs:Ja.getAssignConfigs,initUrl:Ja.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Xi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Xi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ka={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=Va.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Xi.heatmap.getEleDetail(e);if(!r(t)||!d(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,Va.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ja.getProp,getPropElInLi:Ja.getPropElInLi,filterConfig:Ja.filterConfig},Va={unlimitedDiv:Ka,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Fa,initUrl:function(){var e=Ja.initUrl();if(e){var t;try{t=new f(Xi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Xi.para.heatmap)||!Xi.para.heatmap.get_vtrack_config)return!1;if(Qi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=Ua.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Xi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div&&Xi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Xi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Qa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div&&Xi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Qa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(!d(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){var t=function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&d(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null};return t(e,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Xi.heatmap.getClosestLi(e);if(!i||!_(e)||!d(e.tagName))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Xi.is_heatmap_render_mode=!0,Xi.para.heatmap||(Xi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Xi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Xi.para.heatmap_url||(Xi.para.heatmap_url=ht()+"//static.sensorsdata.cn/sdk/"+Xi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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=We({target:e});r.$element_selector=t?t:"",r.$element_path=Xi.heatmap.getElementPath(e,Xi.para.heatmap&&"not_use_id"===Xi.para.heatmap.element_selector);var n=Xi.heatmap.getElementPosition(e,r.$element_path,Xi.para.heatmap&&"not_use_id"===Xi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Xi.para.heatmap)&&e(Xi.para.heatmap.collect_element)&&!Xi.para.heatmap.collect_element(n))return!1;var s=Qa.getBasicEleInfo(t,n,i,a,o);mt(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Xi.para.heatmap&&Xi.para.heatmap.custom_property){var c=Xi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div?!!(r(Xi.para.heatmap)&&r(Xi.para.heatmap.collect_tags)&&r(Xi.para.heatmap.collect_tags.div)&&v(Xi.para.heatmap.collect_tags.div.ignore_tags)&&re(Xi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Xi.para&&Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div&&Xi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Xi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Xi.para.heatmap)||"default"!==Xi.para.heatmap.scroll_notice_map)return!1;var t=!0;Xi.para.scrollmap&&e(Xi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Xi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Xi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Xi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,vt(e)),this.current_time=n}});i.current_time=new Date,Be(window,"scroll",function(){return!!t&&void i.go()}),Be(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Xi.para.heatmap)||"default"!==Xi.para.heatmap.clickmap)&&(e(Xi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Xi.para.heatmap.collect_url()}),"all"===Xi.para.heatmap.collect_elements?Xi.para.heatmap.collect_elements="all":Xi.para.heatmap.collect_elements="interact",void("all"===Xi.para.heatmap.collect_elements?Be(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=d(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):Be(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Xi.heatmap.getTargetElement(a,e);return!(!_(o)&&!d(a.tagName))&&void(_(o)&&d(o.tagName)?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Xi.para.heatmap)&&Xi.para.heatmap.get_vtrack_config&&Ka.events.length>0&&Ka.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"}))})))}},Ya={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Xi.log("error: isReady callback must be function")},getUtm:function(){return Pa.campaignParams()},getStayTime:function(){return(new Date-Xi._t)/1e3},setProfileLocal:function(e){if(!Qi.isSupport())return Xi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=Ua.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(Ua.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Xi.setProfile(e))}else Ua.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Xi.setProfile(e)},setInitReferrer:function(){var e=$e();Xi.setOnceProfile({_init_referrer:e,_init_referrer_host:Pa.pageProp.referrer_host})},setSessionReferrer:function(){var e=$e();Ua.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:Pa.pageProp.referrer_host})},setDefaultAttr:function(){Pa.register({_current_url:location.href,_referrer:$e(),_referring_host:Pa.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Xi.para.heatmap&&Xi.para.heatmap.track_attr?Xi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Qa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Qa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Xi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,yt()),t),i=Z()}var i;i=this.autoTrackIsUsed?Pa.pageProp.url:Pa.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,bt(Xi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=yt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Xi.para.is_single_page&&w(function(){var r=$e(a,!0);Xi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Xi.track("$pageview",P({$referrer:$e(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),bt(Xi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(Ua._state)?"SDK is not initialized.":Ua.getAnonymousId()},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Xi.modules)&&Xi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Xi.use.apply(Xi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},eo={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},to=1,ro={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:It,unbind:Tt,trackLink:At,trackLinks:Dt,setItem:$t,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Bt,unsetProfile:Ht,identify:Jt,resetAnonymousIdentity:Mt,trackSignup:Kt,registerPage:Ft,clearAllRegister:Vt,clearPageRegister:Wt,register:zt,registerOnce:Xt,registerSession:Zt,registerSessionOnce:Gt,login:Qt,loginWithKey:Yt,logout:er,getPresetProperties:tr,readyState:eo,debug:ka,on:et,log:Oe};Gi.setup(Oe);var no=P({},pa,Ea),io={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:Xi.para.use_app_track_is_send!==!1&&"only"!==Xi.para.use_app_track,white_list:[],is_mui:"mui"===Xi.para.use_app_track};"object"==typeof Xi.para.app_js_bridge?Xi.para.app_js_bridge=P({},e,Xi.para.app_js_bridge):Xi.para.use_app_track!==!0&&Xi.para.app_js_bridge!==!0&&"only"!==Xi.para.use_app_track&&"mui"!==Xi.para.use_app_track||(Xi.para.app_js_bridge=P({},e)),Xi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Xi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ar};nr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),ir(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},nr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},nr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),ir(r)},or.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Xi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ao={isSeachHasKeyword:function(){return""!==V(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=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Qa.setNotice(n),la.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Xi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Xi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Xi.heatmap_version&&Xi.heatmap_version===Xi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Xi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return la.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Qa.setNotice(),ao.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=d(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&d(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return d(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Qa.setNotice(i),la.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ao.isReady(r,n)}},oo={isStorageHasKeyword:function(){return la.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(lr("sa-visual-mode")===!0||"true"===lr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Xi.para.vtrack_url?Xi.para.vtrack_url:ht()+"//static.sensorsdata.cn/sdk/"+Xi.lib_version+"/vtrack.min.js"})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(la.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var t=e.data.data.userURL;d(t)&&(window.location.href=encodeURI(t.replace(/javascript:/i,"")))}else oo.loadVtrack();window.removeEventListener("message",oo.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",oo.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",oo.messageListener,!1),oo.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:va}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),oo.postMessage()}},so=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],lo={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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){}};vr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new mr(t,n,Xi),a=0;a=2)&&(Po&&(Or(!0),_r()),ja.initSystemEvent(),Xi.setInitVar(),Xi.readyState.setState(2),Xi.initPara(e),ja.sdk.emit("initPara"),ja.sdk.emit("afterInitPara"),ja.sdk.emit("initAPI"),ja.sdk.emit("afterInitAPI"),Xi.detectMode(),rr(),ja.sdk.emit("afterInit"),void ja.sdk.emit("ready"))},Po?Or(!1):(Or(!0),_r());var Co,Oo,No,jo,Io,To,Ao,Do,$o,xo,Eo,Lo,Uo,Ro,Bo,Ho,Jo,Mo,qo="1.26.8",Ko={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Fo=Ir(Ko),Vo="1.26.8",Wo={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},zo=Dr(Wo,"Amp","sdkReady"),Xo=window.SensorsData_App_Visual_Bridge,Zo=Xo&&Xo.sensorsdata_visualized_mode,Go=Xo&&Xo.sensorsdata_visualized_alert_info,Qo=Xo&&Xo.sensorsdata_hover_web_nodes,Yo={isVerify:function(){return Zo&&(Zo===!0||Zo.call(Xo))},commands:{app_alert:$r,visualized_track:xr,page_info:xr,sensorsdata_get_app_visual_config:Er}},es="1.26.8",ts={init:function(e){jo=e,Io=jo&&jo._,To=jo&&jo.log||console&&console.log||function(){},Br()},handleCommand:Jr},rs=Rr(ts,"AndroidBridge","sdkAfterInitPara"),ns=window.SensorsData_App_Visual_Bridge,is=ns&&ns.sensorsdata_visualized_mode,as=ns&&ns.sensorsdata_visualized_alert_info,os=ns&&ns.sensorsdata_hover_web_nodes,ss={isVerify:function(){return is&&(is===!0||is.call(ns))},commands:{app_alert:Mr,visualized_track:qr,page_info:qr,sensorsdata_get_app_visual_config:Kr}},ls="1.26.8",us={init:function(e){Eo=e,Lo=Eo&&Eo._,Uo=Eo&&Eo.log||console&&console.log||function(){},zr()},handleCommand:Zr},cs=Wr(us,"AndroidObsoleteBridge","sdkAfterInitPara"),ds="1.26.8",ps={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Ro=Bo._,Ho=Bo.store,!!Ro.localStorage.isSupport()&&(Bo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Bo||!e)return!1;t=t||{},Jo=t.cookie_name||"sensorsdata2015jssdkchannel",Bo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Bo.registerPage({$is_channel_callback_event:function(e){if(Ro.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!ps.eventList.hasEvent(e.event)&&(ps.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Ro.isReferralTraffic(document.referrer)){var r=Ro.getQueryParam(location.href,"sat_cf");Ro.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),ps.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Bo.registerPage(t):Bo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Bo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Bo.kit.userDecryptIfNeeded(Ro.cookie.get(Jo));return e=Ro.safeJSONParse(e),!(!Ro.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Bo.para.encrypt_cookie&&(r=Bo.kit.userEncrypt(r)),Ro.cookie.set(Jo,r)}},channelLinkHandler:function(){this.eventList.reset(),Bo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Ro.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Ro.isNumber(e.latest_event_initial_time)&&Ro.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&js(arguments[0])?t=arguments[0]:arguments.length>=2&&js(arguments[1])&&(t=arguments[1])),!Ns())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(js(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ts(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Is(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?($s.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):($s.data=e,$s.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){$s.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===Os){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Ds(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),As(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=_s().visibilityChange,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},xs=rn($s,"Deeplink","sdkReady"),Es="1.26.8",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},ln()},handleCommand:cn},Us=sn(Ls,"IOSBridge","sdkAfterInitPara"),Rs="1.26.8",Bs={init:function(e){ws=e,Ss=ws&&ws._,ks=ws&&ws.log||console&&console.log||function(){},gn()}},Hs=fn(Bs,"IOSObsoleteBridge","sdkAfterInitPara"),Js="1.26.8",Ms=5e3,qs=432e3;wn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},wn.prototype.log=function(e){this.sd&&this.sd.log(e)},wn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Ms)},wn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},wn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},wn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&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()}},wn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},wn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},wn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},wn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},wn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},wn.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()}})},wn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},wn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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()},wn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},wn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},wn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},wn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},wn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Ks=new wn,Fs=bn(Ks,"PageLeave","sdkReady"),Vs="1.26.8",Ws=!1,zs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ws||(e.track("$WebPageLoad",l),Ws=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Xs=Pn(zs,"PageLoad","sdkReady");On.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Cn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Zs="1.26.8";On.prototype.plugin_name="RegisterProperties";var Gs,Qs,Ys=new On,el=In(Ys),tl="1.26.8",rl=window.console&&window.console.log||function(){},nl={init:function(e){return Gs=e,rl=Gs&&Gs.log||rl,e&&e.kit&&e.kit.buildData?(Qs=Gs.kit.buildData,Gs.kit.buildData=$n,void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},il=Dn(nl,"RegisterPropertyPageHeight","sdkReady"),al="1.26.8",ol={};ol.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},ol.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},ol.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},ol.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var p=u.indexOf("?");a=p>-1?o>-1?s+l+"#"+u.substring(1,o)+d(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+d(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},ol.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},ol.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},ol.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},ol.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var sl,ll,ul,cl,dl,pl,fl,gl,_l,hl,ml,vl,yl,bl=Ln(ol,"SiteLinker","sdkReady"),wl="utm_source utm_medium utm_campaign utm_content utm_term",Sl="1.26.8",kl={init:function(e){function t(){var e=wl.split(" "),t="",r={};return sl._.isArray(sl.para.source_channel)&&sl.para.source_channel.length>0&&(e=e.concat(sl.para.source_channel),e=sl._.unique(e)),sl._.each(e,function(e){t=sl._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!sl&&(sl=e,sl.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},Pl=Bn(kl,"Utm","sdkAfterInitPara"),Cl="1.26.8",Ol=!1,Nl=null,jl={init:function(e){Nl=e,Nl.disableSDK=qn,Nl.enableSDK=Kn,Nl.getDisabled=Fn}},Il=Mn(jl,"DisableSDK","sdkInitAPI"),Tl="1.26.8",Al={plugin_name:"DebugSender",init:function(e){ll=e,ul=ll._,Qn()}},Dl=zn(Al),$l="1.26.8",xl={plugin_name:"JsappSender",init:function(e){cl=e,dl=cl._,ni()}},El=ti(xl),Ll="1.26.8",Ul=null,Rl={plugin_name:"BatchSender",init:function(e){pl=e,fl=pl._,ci()}},Bl=si(Rl),Hl="1.26.8",Jl={plugin_name:"BeaconSender",init:function(e){gl=e,_l=gl._,mi()}},Ml=fi(Jl),ql="1.26.8",Kl={plugin_name:"AjaxSender",init:function(e){hl=e,ml=hl._,Pi()}},Fl=bi(Kl),Vl="1.26.8",Wl={plugin_name:"ImageSender",init:function(e){vl=e,yl=vl._,Di()}},zl=Ni(Wl),Xl=null,Zl=null,Gl=[],Ql={init:function(e){e&&(Xl=e,Zl=Xl._,Xl.logger&&Xl.logger.appendWriter(Li),Xl.on&&Xl.on("sdkAfterInitPara",function(){for(var e=0;e Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("http://modernizr.com/"),"http://modernizr.com/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{d(e)||(e=String(e)),e=p(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void Qi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new ta(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(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){Qi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(na&&e.forEach===na)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){Qi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(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 j(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}function I(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(p){Qi.log(p)}n&&d()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function T(e){return k(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 A(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function D(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=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,oa.set(t,"true",0,null,r,"; domain="+a),document.cookie.indexOf(t+"=true")!==-1)return oa.set(t,"true","-1s",null,r,"; domain="+a),a;return""}function J(e){function t(e,t){e=p(e);var r;if("body"===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 o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){Qi.log(o)}return i&&_(i)?r(i):null}if(!d(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=p(e.textContent):e.innerText&&(r=p(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 q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){Qi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=u(e);var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);return null===i||i&&"string"!=typeof i[1]&&i[1].length?"":u(i[1])}function V(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){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(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){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 Z(e){return d(e)?(e=p(e),A(e)):A(location.href)}function Q(e){return d(e)?(e=p(e),A(e)):A(location.pathname)}function G(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return G(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function pe(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!d(t.callbackName))return Qi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(i.appendChild(n),ce(t.timeout)&&(a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){Qi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){Qi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var s=[];k(t.data,function(e,t){s.push(t+"="+e)}),t.data=s.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){Qi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=t.url}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.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;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.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 he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,d)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else d(i)||ce(i)||$(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function it(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function at(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function ot(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))ot(e[a]);else if(d(i)){if(re(n,a)>-1)return;e[a]=it(i,re(t,a)>-1?1024:_a.max_string_length)}})}function st(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function lt(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};rt({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};rt({item_id:n},i)}}function ut(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&rt({propertyKey:n},i)})}function ct(e){var t=e.properties;ye(e),r(t)?(nt(t),at(t),st(e),ut(t),ot(t)):"properties"in e&&(e.properties={}),lt(e)}function dt(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function pt(e,t){try{var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,Ua.getIdentities());var a={identities:i,distinct_id:Ua.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,Ua.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),"$UnbindID"===a.event&&(a.login_id&&delete a.login_id,a.anonymous_id&&delete a.anonymous_id),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},Na.properties(),Ua.getProps(),Ua.getSessionProps(),Na.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!d(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!d(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&d(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&d(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!d(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!d(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!d(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),d(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&$(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=qa.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=Va.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),ka.checkIsAddSign(a),ka.checkIsFirstTime(a),Fe(a),Ve(a),a}catch(o){return{_debug_web_msg:String(o)}}}function ft(e){return za.stage.process("basicProps",e)}function gt(e){return za.stage.process("formatData",e)}function _t(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&De(e.ele,"click",function(e){i(e)}))))}function ht(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function mt(e){return Za.stage.process("webClickEvent",e)}function vt(e){return Za.stage.process("webStayEvent",e)}function yt(){var e=Na.campaignParams(),t={};return k(e,function(e,r,n){(" "+Xi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function bt(e,t,r){if(Xi.is_first_visitor&&r){var n={};Xi.para.preset_properties.search_keyword_baidu&&Ue(document.referrer)&&$e()&&(n.$search_keyword_id=Ca.id(),n.$search_keyword_id_type=Ca.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=Le(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:d(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:d(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:He(),$first_search_keyword:Re()},yt(),n)),Xi.is_first_visitor=!1}}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=Ua.getFirstId(),s=Ua.getOriginDistinctId();if(!rt({distinct_id:n}))return je("login id is invalid"),!1;if(n===Ua.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"),!1;if(r(Ua._state.identities)&&Ua._state.identities.hasOwnProperty(a)&&n===Ua._state.first_id)return!1; +var l=Ua._state.history_login_id.name!==a||n!==Ua._state.history_login_id.value;if(l){Ua._state.identities[a]=n,Ua.set("history_login_id",{name:a,value:n}),o||Ua.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:Ua._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];Ua._state.identities=t,Ua.save()}function kt(e,t){if(!rt({unbindKey:e,bindValue:t}))return!1;if(r(Ua._state.identities)&&Ua._state.identities.hasOwnProperty(e)&&Ua._state.identities[e]===t){var n=Ua.getUnionId().login_id;n&&e+"+"+t===n&&(Ua._state.distinct_id=Ua._state.first_id,Ua._state.first_id="",Ua.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete Ua._state.identities[e],Ua.save())}var i={};return i[e]=t,i}function Pt(){Xi._t=Xi._t||1*new Date,Xi.is_first_visitor=!1,Xi.source_channel_standard=ma}function Ct(e){P(_a,e||Xi.para||{}),Xi.para=_a;var t={};if(r(Xi.para.is_track_latest))for(var n in Xi.para.is_track_latest)t["latest_"+n]=Xi.para.is_track_latest[n];Xi.para.preset_properties=P({},ha.preset_properties,t,Xi.para.preset_properties||{});var i;for(i in ha)void 0===Xi.para[i]&&(Xi.para[i]=ha[i]);"string"!=typeof Xi.para.web_url||"://"!==Xi.para.web_url.slice(0,3)&&"//"!==Xi.para.web_url.slice(0,2)||("://"===Xi.para.web_url.slice(0,3)?Xi.para.web_url=location.protocol.slice(0,-1)+Xi.para.web_url:Xi.para.web_url=location.protocol+Xi.para.web_url),Oa.protocol.serverUrl(),Xi.bridge&&Xi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Xi.para.source_type&&(Xi.para.source_type.utm=v(Xi.para.source_type.utm)?Xi.para.source_type.utm.concat(a):a,Xi.para.source_type.search=v(Xi.para.source_type.search)?Xi.para.source_type.search.concat(o):o,Xi.para.source_type.social=v(Xi.para.source_type.social)?Xi.para.source_type.social.concat(s):s,Xi.para.source_type.keyword=r(Xi.para.source_type.keyword)?P(l,Xi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Xi.para.heatmap&&!r(Xi.para.heatmap)&&(Xi.para.heatmap={}),r(Xi.para.heatmap)){Xi.para.heatmap.clickmap=Xi.para.heatmap.clickmap||"default",Xi.para.heatmap.scroll_notice_map=Xi.para.heatmap.scroll_notice_map||"default",Xi.para.heatmap.scroll_delay_time=Xi.para.heatmap.scroll_delay_time||4e3,Xi.para.heatmap.scroll_event_duration=Xi.para.heatmap.scroll_event_duration||18e3,Xi.para.heatmap.renderRefreshTime=Xi.para.heatmap.renderRefreshTime||1e3,Xi.para.heatmap.loadTimeout=Xi.para.heatmap.loadTimeout||1e3,Xi.para.heatmap.get_vtrack_config!==!0&&(Xi.para.heatmap.get_vtrack_config=!1);var d=v(Xi.para.heatmap.track_attr)?U(Xi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),Xi.para.heatmap.track_attr=d,r(Xi.para.heatmap.collect_tags))if(Xi.para.heatmap.collect_tags.div===!0)Xi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Xi.para.heatmap.collect_tags.div)){if(Xi.para.heatmap.collect_tags.div.ignore_tags?v(Xi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Xi.para.heatmap.collect_tags.div.ignore_tags=c):Xi.para.heatmap.collect_tags.div.ignore_tags=c,Xi.para.heatmap.collect_tags.div.max_level){var p=[1,2,3];re(p,Xi.para.heatmap.collect_tags.div.max_level)===-1&&(Xi.para.heatmap.collect_tags.div.max_level=1)}}else Xi.para.heatmap.collect_tags.div=!1;else Xi.para.heatmap.collect_tags=u}Xi.para.server_url=Qe(Xi.para.server_url),Xi.para.noCache===!0?Xi.para.noCache="?"+(new Date).getTime():Xi.para.noCache="",Xi.para.callback_timeout>Xi.para.datasend_timeout&&(Xi.para.datasend_timeout=Xi.para.callback_timeout),Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&r(Xi.para.heatmap.collect_tags)&&k(Xi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Xi.heatmap.otherTags.push(t)}),Xi.para.heatmap&&"default"===Xi.para.heatmap.clickmap&&Xi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Ya[t]?Ya[t].apply(Ya,r):void("function"==typeof t?t.apply(Xi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Xi,n),a.plugin_is_init=!0,Xi.modules=Xi.modules||{},Xi.modules[a.plugin_name||"unnamed_"+to++]=a,a}if(!d(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Xi.modules&&Xi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return d(t)&&(r(Xi.modules)&&r(Xi.modules[t])?a=Xi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Xi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){rt({event:e,properties:t})&&Xa.send({type:"track",event:e,properties:t},r)}function It(e,t){return!!rt({bindKey:e,bindValue:t})&&(Ua._state.identities[e]=t,Ua.save(),void Xa.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function Tt(e,t){var r=kt(e,t);r&&Xa.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function At(e,t,r){"object"==typeof e&&e.tagName?_t({ele:e},t,r,Xi.track):"object"==typeof e&&e.target&&e.event&&_t(e,t,r,Xi.track)}function Dt(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void De(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Xi.track(t,r,i)}))}function $t(e,t,r){rt({item_type:e,item_id:t,properties:r})&&Xa.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){rt({item_type:e,item_id:t})&&Xa.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){rt({propertiesMust:e})&&Xa.send({type:"profile_set",properties:e},t)}function Lt(e,t){rt({propertiesMust:e})&&Xa.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){rt({propertiesMust:e})&&(k(e,function(t,r){d(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Xa.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;d(e)&&(e={},e[n]=1),rt({propertiesMust:e})&&(r(e)?Xa.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Bt(e){Xa.send({type:"profile_delete"},e),Ua.set("distinct_id",ea()),Ua.set("first_id","")}function Ht(e,t){var r=e,n={};d(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){d(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Xa.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e){"number"==typeof e&&(e=String(e));var t=Ua.getFirstId();if("undefined"==typeof e){var r=ea();t?Ua.set("first_id",r):Ua.set("distinct_id",r)}else rt({distinct_id:e})&&(t?Ua.set("first_id",e):Ua.set("distinct_id",e))}function Mt(e){var t=Ua.getFirstId();if(t)return je("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),"undefined"==typeof e){var r=ea();Ua._state.identities.$identity_cookie_id=r,Ua.set("distinct_id",r)}else rt({distinct_id:e})&&(Ua._state.identities.$identity_cookie_id=e,Ua.set("distinct_id",e))}function qt(e,t,r,n){var i=Ua.getFirstId()||Ua.getDistinctId();Ua.set("distinct_id",e),Xa.send({original_id:i,distinct_id:Ua.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function Kt(e,t,r,n){"number"==typeof e&&(e=String(e)),rt({distinct_id:e,event:t,properties:r})&&qt(e,t,r,n)}function Ft(e){rt({properties:e})?P(Na.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Vt(e){Ua.clearAllProps(e)}function Wt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Xi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Xi.lib_version+"/vapph5define.min.js"})}else t();else t()}function cr(t){Xi.para.is_track_single_page&&Ia.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){Na.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Xi.quick&&Xi.quick("autoTrack",i)}};if("boolean"==typeof Xi.para.is_track_single_page)i();else if("function"==typeof Xi.para.is_track_single_page){var a=Xi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function dr(){Xi._q&&v(Xi._q)&&Xi._q.length>0&&k(Xi._q,function(e){Xi[e[0]].apply(Xi,Array.prototype.slice.call(e[1]))}),r(Xi.para.heatmap)&&(Ga.initHeatmap(),Ga.initScrollmap())}function pr(){Xi.readyState.setState(3),new Xi.SDKJSBridge("visualized").onAppNotify(function(){ur("undefined"!=typeof sa_jssdk_app_define_mode?!0:!1)}),ur(!1),Xi.bridge.app_js_bridge_v1(),Na.initPage(),cr(),Ua.init(),sr(),gr(),Xi.readyState.setState(4),dr()}function fr(){ao.isSeachHasKeyword()?ao.hasKeywordHandle():window.parent!==self&&oo.isSearchHasKeyword()?oo.verifyVtrackMode():ao.isWindowNameHasKeyword()?ao.windowNameHasKeywordHandle():ao.isStorageHasKeyword()?ao.storageHasKeywordHandle():window.parent!==self&&oo.isStorageHasKeyword()?oo.verifyVtrackMode():(pr(),oo.notifyUser())}function gr(){Va.init(),"success"===Xi.bridge.bridge_info.verify_success&&qa.init()}function _r(){k(so,function(t){var r=Xi[t];Xi[t]=function(){if(Xi.readyState.state<3)return v(Xi._q)||(Xi._q=[]),Ne("calling sdk api before init is deprecated."),Xi._q.push([t,arguments]),!1;if(!e(Xi.getDisabled)||!Xi.getDisabled())return Xi.readyState.getState()?r.apply(Xi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function hr(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 mr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new hr,this.sensors=r}function vr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function yr(e){e&&e.buildDataStage&&co.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&_o.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&fo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&mo.registerStageImplementation(e.viewStage)}function br(e,t){vo[e]&&vo[e](t)}function wr(){return yo.stage&&yo.stage.process("getUtmData")}function Sr(e){return bo.stage.process("send",e)}function kr(e){e.kit=wo,e.saEvent=Xa,this.buildDataStage=za,this.sendDataStage=bo,this.businessStage=yo}function Pr(e){e.heatmap=Ga,this.viewStage=Za}function Cr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};br("buildDataStage",r)}function Or(e){e&&(Xi.events=La,Xi.bridge=io,Xi.SDKJSBridge=nr,Xi.JSBridge=or,Xi.store=Ua,Xi.unlimitedDiv=Ka,Xi.customProp=Fa,Xi.vtrackcollect=Va,Xi.vapph5collect=qa,Xi.detectMode=fr,Xi.registerFeature=yr,Xi.registerInterceptor=br,Xi.commonWays=Ya,yr(new kr(Xi)),yr(new Pr(Xi)),br("viewStage",So));var t=e?ro:lo;for(var r in t)Xi[r]=t[r];Xi.logger=ga,Xi.log=Oe,Xi._=no,Xi.on=et,Xi.ee=ja,Xi.use=Nt,Xi.lib_version=va,Xi.registerPropertyPlugin=Cr}function Nr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ir(e,t,r){return Nr(e,t,r),e.plugin_version=qo,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ar(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ar(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dr(e,t,r){return Tr(e,t,r),e.plugin_version=Vo,e}function $r(e){return Qo&&Qo.call(Xo,JSON.stringify(e))}function xr(e){return Zo.call(Xo)&&Go&&Go.call(Xo,JSON.stringify(e))}function Er(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Lr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ur(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ur(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rr(e,t,r){return Lr(e,t,r),e.plugin_version=es,e}function Br(){if(Co=window.SensorsData_APP_New_H5_Bridge,Oo=Co&&Co.sensorsdata_track,No=Oo&&Co.sensorsdata_get_server_url&&Co.sensorsdata_get_server_url(),To("---test---fail---",!jo,jo.bridge.activeBridge,!No),jo&&!jo.bridge.activeBridge&&No)return jo.bridge.activeBridge=ts,jo.para.app_js_bridge&&!jo.para.app_js_bridge.is_mui&&(jo.bridge.is_verify_success=No&&jo.bridge.validateAppUrl(No),To("---test---bridge-verify-",jo.bridge.is_verify_success)),jo.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:jo.bridge.is_verify_success?"success":"fail",support_two_way_call:!!Co.sensorsdata_js_call_app},jo.para.app_js_bridge?void jo.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}):void To("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function Hr(e,t){if(To("---test---datasend-",jo.bridge.is_verify_success),jo.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return jo.bridge.is_verify_success?(To("---test---bridge-verify-success---",e.data),Oo&&Oo.call(Co,JSON.stringify(Io.extend({server_url:jo.para.server_url},e.data))),Io.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(To("---test---bridge-verify-fail-----",jo.bridge.is_verify_success),jo.para.app_js_bridge.is_send?(jo.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Io.isFunction(r)&&r(),t.cancellationToken.cancel(),e))}function Jr(e){var t=e.callType;return t in Yo.commands?Yo.commands[t](e,Co):void(Co&&Io.isFunction(Co.sensorsdata_js_call_app)&&Co.sensorsdata_js_call_app(JSON.stringify(e)))}function Mr(e){return as&&as.call(ns,JSON.stringify(e))}function qr(e){return is.call(ns)&&os&&os.call(ns,JSON.stringify(e))}function Kr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Fr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wr(e,t,r){return Fr(e,t,r),e.plugin_version=ls,e}function zr(){if(Uo("ObsoleteBridge---test---init---"),Ao=window.SensorsData_APP_JS_Bridge,Do=Ao&&Ao.sensorsdata_track,$o=Ao&&Ao.sensorsdata_verify,xo=Ao&&Ao.sensorsdata_visual_verify,Uo("ObsoleteBridge-",Eo.bridge.activeBridge,$o,Do,xo),Eo&&!Eo.bridge.activeBridge&&($o||Do||xo)){Eo.bridge.activeBridge=us;var e=$o||Do;if(xo&&(e=!!xo.call(Ao,JSON.stringify({server_url:Eo.para.server_url})),Uo("ObsoleteBridge---called-return",e)),Eo.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Eo.para.app_js_bridge)return void Uo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Eo.registerInterceptor("sendDataStage",{send:{priority:80,entry:Xr}}),Uo("Android obsolete bridge inits succeed.")}}function Xr(e,t){if(Uo("ObsoleteBridge---senddata"),Eo.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if($o){var n=$o&&$o.call(Ao,JSON.stringify(Lo.extend({server_url:Eo.para.server_url},e.data)));return Uo("ObsoleteBridge---anVerify-success",n),n?(Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Eo.para.app_js_bridge.is_send?(Eo.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return Uo("ObsoleteBridge---is-send-old-way",Eo.para.app_js_bridge.is_send),Do&&Do.call(Ao,JSON.stringify(Lo.extend({server_url:Eo.para.server_url},e.data))),Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Zr(e){Uo("ObsoleteBridge---handleCommadn");var t=e.callType;return t in ss.commands?(Uo("ObsoleteBridge---",t,ss.commands),ss.commands[t](e,Ao)):Ao&&Lo.isFunction(Ao.sensorsdata_js_call_app)?(Uo("ObsoleteBridge---handleCommadn-abridge"),Ao.sensorsdata_js_call_app(JSON.stringify(e))):void 0}function Qr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Gr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Gr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Yr(e,t,r){return Qr(e,t,r),e.plugin_version=ds,e}function en(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return tn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function tn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function rn(e,t,r){return en(e,t,r),e.plugin_version=gs,e}function nn(){return"undefined"!=typeof Mo&&document[Mo]}function an(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return on(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function on(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function sn(e,t,r){return an(e,t,r),e.plugin_version=Es,e}function ln(){if(hs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,ms=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},vs&&!vs.bridge.activeBridge&&ms()&&ms().postMessage){if(vs.bridge.activeBridge=Ls,vs.para.app_js_bridge&&!vs.para.app_js_bridge.is_mui&&(vs.bridge.is_verify_success=hs&&vs.bridge.validateAppUrl(hs)),vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:vs.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:70,entry:un}}),bs("IOS bridge inits succeed.")}}function un(e,t){if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return vs.bridge.is_verify_success?(ms()&&ms().postMessage(JSON.stringify({callType:"app_h5_track",data:ys.extend({server_url:vs.para.server_url},e.data)})),ys.isFunction(r)&&r(),t.cancellationToken.cancel(),e):vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(ys.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function cn(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||vs.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?ys.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:ms()&&ms().postMessage(JSON.stringify(e)):null}function dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fn(e,t,r){return dn(e,t,r),e.plugin_version=Rs,e}function gn(){if(ws&&!ws.bridge.activeBridge&&_n()){if(ws.bridge.activeBridge=Bs,ws.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:hn()?"success":"fail"},!ws.para.app_js_bridge)return void ks("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");ws.registerInterceptor("sendDataStage",{send:{priority:90,entry:mn}}),ks("IOS obsolete bridge inits succeed.")}}function _n(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function hn(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=Ss.URL(ws.para.server_url).hostname,r=Ss.URL(ws.para.server_url).searchParams.get("project")||"default"}catch(n){ws.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function mn(e,t){function r(e){var t=JSON.stringify(Ss.extend({server_url:ws.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(ws.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(ws.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,Ss.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return ws.para.app_js_bridge.is_send?(ws.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(Ss.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bn(e,t,r){return vn(e,t,r),e.plugin_version=Js,e}function wn(){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=qs}function Sn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return kn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function kn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n); +}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Pn(e,t,r){return Sn(e,t,r),e.plugin_version=Vs,e}function Cn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function On(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function In(e,t,r){return Nn(e,t,r),e.plugin_version=Zs,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return An(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function An(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dn(e,t,r){return Tn(e,t,r),e.plugin_version=tl,e}function $n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=Qs._.extend(e.properties||{},n)}}catch(i){rl("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Gs.call(Qs.kit,e)}function xn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return En(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function En(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ln(e,t,r){return xn(e,t,r),e.plugin_version=al,e}function Un(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Rn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Rn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Bn(e,t,r){return Un(e,t,r),e.plugin_version=Sl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Mn(e,t,r){return Hn(e,t,r),e.plugin_version=Cl,e}function qn(){Ol=!0}function Kn(){Ol=!1}function Fn(){return Ol}function Vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zn(e,t,r){return Vn(e,t,r),e.plugin_version=Tl,e}function Xn(e){var t=e,r="";r=ll.para.debug_mode_url.indexOf("?")!==-1?ll.para.debug_mode_url+"&"+ll.kit.encodeTrackData(e):ll.para.debug_mode_url+"?"+ll.kit.encodeTrackData(e),ul.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(ll.para.debug_mode_upload)},success:function(e){ul.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Zn(e,t){if(ll.para.debug_mode===!0){var r=e.data;e.callback;Xn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Qn(){ll.para.debug_mode===!0&&(ll.para.debug_mode_upload=ll.para.debug_mode_upload||!1,ul.isString(ll.para.debug_mode_url)||(ul.isString(ll.para.server_url)?ll.para.debug_mode_url=ll.para.server_url.replace("sa.gif","debug"):ul.isArray(ll.para.server_url)&&ul.isString(ll.para.server_url[0])?ll.para.debug_mode_url=ll.para.server_url[0].replace("sa.gif","debug"):ll.para.debug_mode=!1))}function Gn(){ll.on("sdkInitPara",function(){Qn()}),ll.on("sdkAfterInitPara",function(){ll.registerInterceptor("sendDataStage",{send:{priority:30,entry:Zn}})})}function Yn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ei(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ei(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ti(e,t,r){return Yn(e,t,r),e.plugin_version=$l,e}function ri(e,t){if(dl.isObject(cl.para.jsapp)&&!cl.para.jsapp.isOnline&&"function"==typeof cl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),cl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ni(){cl.on("sdkAfterInitAPI",function(){dl.isObject(cl.commonWays)&&(cl.commonWays.setOnlineState=ii),cl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ri}})})}function ii(e){if(e===!0&&dl.isObject(cl.para.jsapp)&&"function"==typeof cl.para.jsapp.getData){cl.para.jsapp.isOnline=!0;var t=cl.para.jsapp.getData();dl.isArray(t)&&t.length>0&&dl.each(t,function(e){dl.isJSONString(e)&&cl.kit.sendData(JSON.parse(e))})}else cl.para.jsapp.isOnline=!1}function ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function si(e,t,r){return ai(e,t,r),e.plugin_version=Ll,e}function li(e,t){return!pl.para.app_js_bridge&&pl.para.batch_send&&fl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fi(e,t,r){return di(e,t,r),e.plugin_version=Hl,e}function gi(e){var t=new _l.BeaconSend(e);t.start()}function _i(e,t){var r=null,n=null;_l.isObject(e.config)&&(r=e.config.send_type,n=_l.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===gl.para.send_type;if(i&&_l.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=gl.kit.encodeTrackData(e.data),_l.isArray(a)&&a.length?_l.each(a,function(t){e.callback=null,e.server_url=t,gi(e)}):"string"==typeof a&&""!==a?gi(e):gl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function hi(){"beacon"!==gl.para.send_type||_l.isSupportBeaconSend()||(gl.para.send_type="image")}function mi(){gl.on("sdkInitPara",function(){hi()}),gl.on("sdkAfterInitPara",function(){gl.registerInterceptor("sendDataStage",{send:{priority:110,entry:_i}})})}function vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bi(e,t,r){return vi(e,t,r),e.plugin_version=ql,e}function wi(e){var t=new ml.AjaxSend(e);t.start()}function Si(e,t){var r=null,n=null;ml.isObject(e.config)&&(r=e.config.send_type,n=ml.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===hl.para.send_type;if(i&&ml.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=hl.kit.encodeTrackData(e.data),ml.isArray(a)&&a.length?ml.each(a,function(t){e.callback=null,e.server_url=t,wi(e)}):"string"==typeof a&&""!==a?wi(e):hl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function ki(){"ajax"!==hl.para.send_type||ml.isSupportCors()||(hl.para.send_type="image")}function Pi(){hl.on("sdkInitPara",function(){ki()}),hl.on("sdkAfterInitPara",function(){hl.registerInterceptor("sendDataStage",{send:{priority:120,entry:Si}})})}function Ci(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ni(e,t,r){return Ci(e,t,r),e.plugin_version=Vl,e}function ji(e,t){var r=vl.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function Ii(e){var t=new yl.ImageSend(e);t.start()}function Ti(e,t){var r=null;yl.isObject(e.config)&&(r=yl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,yl.isArray(n)&&n.length?yl.each(n,function(t){t&&(e.data=ji(t,i),e.callback=null,e.server_url=t,Ii(e))}):"string"==typeof n&&""!==n?(e.data=ji(n,i),Ii(e)):vl.logger&&vl.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ai(){"image"!==vl.para.send_type&&"ajax"!==vl.para.send_type&&"beacon"!==vl.para.send_type&&(vl.para.send_type="image")}function Di(){vl.on("sdkInitPara",function(){Ai()}),vl.on("sdkAfterInitPara",function(){vl.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function $i(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ei(e,t,r){return $i(e,t,r),e.plugin_version=va,e}function Li(e){return null===Ql?void Ui(e):void Ql.push(e)}function Ui(e){try{if("log"===e.level&&Ri())return void Ji(e);if("warn"===e.level&&Bi())return void Ji(e);if("error"===e.level&&Hi())return void Ji(e)}catch(t){}}function Ri(){return!!Fi()||(Xl.para.show_log===!0||Zl.isObject(Xl.para.show_log)&&"log"===Xl.para.show_log.level)}function Bi(){return!!Fi()||(Ri()||Zl.isObject(Xl.para.show_log)&&"warn"===Xl.para.show_log.level)}function Hi(){return!!Fi()||(!Zl.isObject(Xl.para.show_log)||"none"!==Xl.para.show_log.level)}function Ji(e){var t=e.content,r=Zl.isObject(t[0])?Zl.formatJsonString(t[0]):t[0],n=Mi(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Zl.isFunction(console[e.level])?console[e.level].apply(console,t):Zl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Mi(e){var t="",r="",n=Xl.para.show_log;return Zl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Zl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Zl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function qi(){Zl.sessionStorage.isSupport()&&sessionStorage.setItem(eu,"true")}function Ki(){Zl.sessionStorage.isSupport()&&sessionStorage.removeItem(eu)}function Fi(){return Zl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(eu)}function Vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zi(e,t,r){return Vi(e,t,r),e.plugin_version=uu,e}var Xi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new d((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new d((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new d((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var p,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),p=5==n.a.length&&1===n.a[0],p&&(a(function(){p=!f('"\t"')}),p&&a(function(){p=1!==f("01")}),p&&a(function(){p=1!==f("1.")})))},function(){p=!1}),t=p}}return o[e]=!!t}function s(e){return D(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,d=n.Date||r.Date,p=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new d((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T="000000",A=function(e,t){return(T+(t||0)).slice(-e)},D=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],p=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;p(r+1,0)<=i;r++);for(n=c((i-p(r,0))/30.42);p(r,n+1)<=i;n++);i=1+i-p(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(D=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+A(6,r<0?-r:r):A(4,r))+"-"+A(2,n+1)+"-"+A(2,i)+"T"+A(2,o)+":"+A(2,s)+":"+A(2,l)+"."+A(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var $=i.stringify;i.stringify=function(e,t,r){var n=d.prototype.toJSON;d.prototype.toJSON=s;var i=$(e,t,r);return d.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=I[t];return r?r:x+A(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,p,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===d.prototype.toJSON?l=D(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),p=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,B));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++B);e+=a.slice(t,B)}if(34==a.charCodeAt(B))return B++,e;q();default:if(t=B,45==i&&(n=!0,i=a.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(B+1),i>=48&&i<=57)&&q(),n=!1;B=48&&i<=57);B++);if(46==a.charCodeAt(B)){for(r=++B;r57));r++);r==B&&q(),B=r}if(i=a.charCodeAt(B),101==i||69==i){for(i=a.charCodeAt(++B),43!=i&&45!=i||B++,r=B;r57));r++);r==B&&q(),B=r}return+a.slice(t,B)}n&&q();var s=a.slice(B,B+4);if("true"==s)return B+=4,!0;if("fals"==s&&101==a.charCodeAt(B+4))return B+=5,!1;if("null"==s)return B+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return B=0,H=""+e,r=F(K()),"$"!=K()&&q(),B=H=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Zi,Qi={setup:function(e){Zi=e},log:function(){(Zi||console&&console.log||function(){}).apply(null,arguments)}},Gi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Gi.get(e))||null}catch(r){Qi.log(r)}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Qi.log(r)}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Gi.set(t,r),Gi.get(t)!==r&&(e=!1),Gi.remove(t)}catch(n){e=!1}return e}},Yi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Gi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Gi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Gi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Gi.get(e)),Gi.remove(e),Gi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Gi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Gi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Gi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Gi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.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=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),ta=function(e){this.ele=e},ra=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};ta.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(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,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.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),y(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||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=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 ra((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return ra(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+_a.sdk_id+e}},ka={checkIsAddSign:function(e){"track"===e.type&&(Ae()?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(Xi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};wa.isSupport()?wa.set(Te("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):Sa.set(Sa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Ae()||(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)}}},Pa=function(){this._events=[],this.pendingEvents=[]};Pa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(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():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Ca={data:{},id:function(){return this.data.id?this.data.id:(this.data.id=Ee(),this.data.id)},type:function(){return this.data.type?this.data.type:(this.data.type=xe(),this.data.type)}},Oa={distinct_id:function(){},jssdkDebug:function(){},_sendDebug:function(e){},apph5:function(e){var t="app_h5\u6253\u901a\u5931\u8d25-",n={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"},i=e.output,a=e.step,o=e.data||"";"all"!==i&&"console"!==i||Oe(n[a]),("all"===i||"code"===i)&&r(_a.is_debug)&&_a.is_debug.apph5&&(o.type&&"profile"===o.type.slice(0,7)||(o.properties._jssdk_debug_info="apph5-"+String(a)))},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(g(e).protocol!==g(t).protocol)return!1}catch(r){return Ne("\u4e0d\u652f\u6301 _.URL \u65b9\u6cd5"),!1}return!0},serverUrl:function(){d(_a.server_url)&&""!==_a.server_url&&!this.protocolIsSame(_a.server_url,location.href)&&Ne("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){return e!==_a.server_url&&void(d(e)&&""!==e&&!this.protocolIsSame(e,location.href)&&Ne("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"))}}},Na={initPage:function(){var e=Le(),t=Z(),r=Ie(t);r||Oa.jssdkDebug("url_domain\u5f02\u5e38_"+t+"_"+r),this.pageProp={referrer:e,referrer_host:e?q(e):"",url:t,url_host:q(t,"url_host\u53d6\u503c\u5f02\u5e38"),url_domain:r}},pageProp:{},campaignParams:function(){return Xi.kit.getUtmData()},campaignParamsStandard:function(e,t){e=e||"",t=t||"";var r=Na.campaignParams(),n={},i={};return k(r,function(r,a,o){(" "+ma+" ").indexOf(" "+a+" ")!==-1?n[e+a]=o[a]:i[t+a]=o[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,r={$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:va};return r},currentProps:{},register:function(e){P(Na.currentProps,e)}},ja={},Ia=new l;ja.spa=Ia,ja.sdk=new l,ja.data=new l,ja.initSystemEvent=function(){Ye(function(e){Ia.emit("switch",e)})},ja.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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var Ta=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};Ta.prototype.start=function(){var e=this,t=new Date;Ze({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:_a.datasend_timeout,cors:!0,success:function(r,n){ja.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:_a.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){ja.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:_a.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},Ta.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var Aa="sawebjssdk-",Da="tab-sawebjssdk-";tt.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()},_a.batch_send.send_interval)},getServerUrl:function(){return d(_a.server_url)&&""!==_a.server_url||v(_a.server_url)&&_a.server_url.length?void(this.serverUrl=v(_a.server_url)?_a.server_url[0]:_a.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(this.sendTimeStamp&&t()-this.sendTimeStamp<_a.batch_send.send_interval)return!1;var e=Gi.get(this.tabKey);if(e){this.sendTimeStamp=t(),e=i(e)||this.generateTabStorageVal();var r=Ce(e.data);if(r.length){for(var n=[],a=0;a-1&&r.splice(a,1),Gi.remove(e[n])}r=Ce(r),Gi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=Aa+String(n()),a=Gi.get(this.tabKey);null===a?(this.tabKey=Da+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*_a.batch_send.send_interval,Gi.set(this.tabKey,JSON.stringify(a)),Xi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Da+String(n()),Gi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*_a.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var d=new a(n);d.get(s,r,1e3,function(e){if(e){null===Gi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Gi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Gi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var p=i(Gi.get(s))||{expireTime:0};t()-p.expireTime>r&&Gi.remove(s)}}for(var f=0;f0)for(t=0;t_a.max_id_length)},keyLength:function(e){return!(!d(e)||e.length>_a.max_key_length)},stringLength:function(e){return!(!d(e)||e.length>_a.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=Ua._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},Ha={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ra[n])&&Ra[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ra[n])&&Ra[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ra[n])&&Ra[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ra[n])&&Ra[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){rt({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ra[i])&&Ra[i](n)),!0};rt({propertyValue:t},n)}):Ba.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ra[n])&&Ra[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ra[n])&&Ra[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ra[n])&&Ra[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ra[n])&&Ra[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ra[n])&&Ra[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ra[n])&&Ra[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=p(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ja.configIsMatchNew=function(e,t){if(d(e.$element_selector)&&d(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 e.$element_selector.indexOf(t.element_selector)>-1}if(d(e.$element_path)&&d(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 e.$element_path.indexOf(t.element_path)>-1}return!1},Ja.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"]?Ja.configIsMatchNew(e,t):Ja.configIsMatchOldVersion(e,t)))},Ja.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(Ja.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},Ja.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ja.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ja.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ja.getPropElInLi=function(e,t){if(!(e&&_(e)&&d(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Xi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ja.getProp=function(e,t){if(!r(e))return!1;if(!(d(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(d(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!d(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Xi.heatmap.getClosestLi(s);o=Ja.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!d(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ja.getAssignConfigs=function(e,t){var n=Ja.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ma={events:[],getAssignConfigs:Ja.getAssignConfigs,filterConfig:Ja.filterConfig,getProp:Ja.getProp,initUrl:Ja.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),d(a.event_name)&&n.push(a.event_name))}),Xi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Xi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Xi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},qa={events:[],customProp:Ma,getAssignConfigs:Ja.getAssignConfigs,initUrl:Ja.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Xi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Xi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ka={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=Va.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Xi.heatmap.getEleDetail(e);if(!r(t)||!d(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,Va.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ja.getProp,getPropElInLi:Ja.getPropElInLi,filterConfig:Ja.filterConfig},Va={unlimitedDiv:Ka,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Fa,initUrl:function(){var e=Ja.initUrl();if(e){var t;try{t=new f(Xi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Xi.para.heatmap)||!Xi.para.heatmap.get_vtrack_config)return!1;if(Gi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=Ua.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Xi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div&&Xi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Xi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Ga.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div&&Xi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Ga.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(!d(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){var t=function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&d(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null};return t(e,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Xi.heatmap.getClosestLi(e);if(!i||!_(e)||!d(e.tagName))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Xi.is_heatmap_render_mode=!0,Xi.para.heatmap||(Xi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Xi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Xi.para.heatmap_url||(Xi.para.heatmap_url=ht()+"//static.sensorsdata.cn/sdk/"+Xi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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=We({target:e});r.$element_selector=t?t:"",r.$element_path=Xi.heatmap.getElementPath(e,Xi.para.heatmap&&"not_use_id"===Xi.para.heatmap.element_selector);var n=Xi.heatmap.getElementPosition(e,r.$element_path,Xi.para.heatmap&&"not_use_id"===Xi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Xi.para.heatmap)&&e(Xi.para.heatmap.collect_element)&&!Xi.para.heatmap.collect_element(n))return!1;var s=Ga.getBasicEleInfo(t,n,i,a,o);mt(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Xi.para.heatmap&&Xi.para.heatmap.custom_property){var c=Xi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div?!!(r(Xi.para.heatmap)&&r(Xi.para.heatmap.collect_tags)&&r(Xi.para.heatmap.collect_tags.div)&&v(Xi.para.heatmap.collect_tags.div.ignore_tags)&&re(Xi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Xi.para&&Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div&&Xi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Xi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Xi.para.heatmap)||"default"!==Xi.para.heatmap.scroll_notice_map)return!1;var t=!0;Xi.para.scrollmap&&e(Xi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Xi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Xi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=Q(),e.event_duration=Math.min(Xi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,vt(e)),this.current_time=n}});i.current_time=new Date,De(window,"scroll",function(){return!!t&&void i.go()}),De(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Xi.para.heatmap)||"default"!==Xi.para.heatmap.clickmap)&&(e(Xi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Xi.para.heatmap.collect_url()}),"all"===Xi.para.heatmap.collect_elements?Xi.para.heatmap.collect_elements="all":Xi.para.heatmap.collect_elements="interact",void("all"===Xi.para.heatmap.collect_elements?De(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=d(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):De(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Xi.heatmap.getTargetElement(a,e);return!(!_(o)&&!d(a.tagName))&&void(_(o)&&d(o.tagName)?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Xi.para.heatmap)&&Xi.para.heatmap.get_vtrack_config&&Ka.events.length>0&&Ka.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"}))})))}},Ya={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Xi.log("error: isReady callback must be function")},getUtm:function(){return Na.campaignParams()},getStayTime:function(){return(new Date-Xi._t)/1e3},setProfileLocal:function(e){if(!Gi.isSupport())return Xi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=Ua.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(Ua.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Xi.setProfile(e))}else Ua.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Xi.setProfile(e)},setInitReferrer:function(){var e=Le();Xi.setOnceProfile({_init_referrer:e,_init_referrer_host:Na.pageProp.referrer_host})},setSessionReferrer:function(){var e=Le();Ua.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:Na.pageProp.referrer_host})},setDefaultAttr:function(){Na.register({_current_url:location.href,_referrer:Le(),_referring_host:Na.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Xi.para.heatmap&&Xi.para.heatmap.track_attr?Xi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Ga.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Ga.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Xi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:Q(),$title:document.title},e,yt()),t),i=Z()}var i;i=this.autoTrackIsUsed?Na.pageProp.url:Na.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,bt(Xi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=yt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Xi.para.is_single_page&&w(function(){var r=Le(a,!0);Xi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:Q(),$title:document.title},n,e),t),a=Z()}),Xi.track("$pageview",P({$referrer:Le(null,!0),$url:Z(),$url_path:Q(),$title:document.title},n,e),t),bt(Xi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(Ua._state)?"SDK is not initialized.":Ua.getAnonymousId()},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Xi.modules)&&Xi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Xi.use.apply(Xi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},eo={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},to=1,ro={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:It,unbind:Tt,trackLink:At,trackLinks:Dt,setItem:$t,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Bt,unsetProfile:Ht,identify:Jt,resetAnonymousIdentity:Mt,trackSignup:Kt,registerPage:Ft,clearAllRegister:Vt,clearPageRegister:Wt,register:zt,registerOnce:Xt,registerSession:Zt,registerSessionOnce:Qt,login:Gt,loginWithKey:Yt,logout:er,getPresetProperties:tr,readyState:eo,debug:Oa,on:et,log:Oe};Qi.setup(Oe);var no=P({},pa,Ea),io={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:Xi.para.use_app_track_is_send!==!1&&"only"!==Xi.para.use_app_track,white_list:[],is_mui:"mui"===Xi.para.use_app_track};"object"==typeof Xi.para.app_js_bridge?Xi.para.app_js_bridge=P({},e,Xi.para.app_js_bridge):Xi.para.use_app_track!==!0&&Xi.para.app_js_bridge!==!0&&"only"!==Xi.para.use_app_track&&"mui"!==Xi.para.use_app_track||(Xi.para.app_js_bridge=P({},e)),Xi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Xi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ar};nr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),ir(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},nr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},nr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),ir(r)},or.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Xi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ao={isSeachHasKeyword:function(){return""!==F(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=F(e,"sa-request-id")||null,r=F(e,"sa-request-type")||null,n=F(e,"sa-request-url")||null;if(Ga.setNotice(n),la.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Xi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Xi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Xi.heatmap_version&&Xi.heatmap_version===Xi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Xi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return la.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Ga.setNotice(),ao.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=d(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&d(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return d(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Ga.setNotice(i),la.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ao.isReady(r,n)}},oo={isStorageHasKeyword:function(){return la.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(lr("sa-visual-mode")===!0||"true"===lr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Xi.para.vtrack_url?Xi.para.vtrack_url:ht()+"//static.sensorsdata.cn/sdk/"+Xi.lib_version+"/vtrack.min.js"})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(la.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var t=e.data.data.userURL;d(t)&&(window.location.href=encodeURI(t.replace(/javascript:/i,"")))}else oo.loadVtrack();window.removeEventListener("message",oo.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",oo.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",oo.messageListener,!1),oo.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:va}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),oo.postMessage()}},so=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],lo={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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){}};vr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new mr(t,n,Xi),a=0;a=2)&&(Po&&(Or(!0),_r()),ja.initSystemEvent(),Xi.setInitVar(),Xi.readyState.setState(2),Xi.initPara(e),ja.sdk.emit("initPara"),ja.sdk.emit("afterInitPara"),ja.sdk.emit("initAPI"),ja.sdk.emit("afterInitAPI"),Xi.detectMode(),rr(),ja.sdk.emit("afterInit"),void ja.sdk.emit("ready"))},Po?Or(!1):(Or(!0),_r());var Co,Oo,No,jo,Io,To,Ao,Do,$o,xo,Eo,Lo,Uo,Ro,Bo,Ho,Jo,Mo,qo="1.26.9",Ko={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Fo=Ir(Ko),Vo="1.26.9",Wo={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},zo=Dr(Wo,"Amp","sdkReady"),Xo=window.SensorsData_App_Visual_Bridge,Zo=Xo&&Xo.sensorsdata_visualized_mode,Qo=Xo&&Xo.sensorsdata_visualized_alert_info,Go=Xo&&Xo.sensorsdata_hover_web_nodes,Yo={isVerify:function(){return Zo&&(Zo===!0||Zo.call(Xo))},commands:{app_alert:$r,visualized_track:xr,page_info:xr,sensorsdata_get_app_visual_config:Er}},es="1.26.9",ts={init:function(e){jo=e,Io=jo&&jo._,To=jo&&jo.log||console&&console.log||function(){},Br()},handleCommand:Jr},rs=Rr(ts,"AndroidBridge","sdkAfterInitPara"),ns=window.SensorsData_App_Visual_Bridge,is=ns&&ns.sensorsdata_visualized_mode,as=ns&&ns.sensorsdata_visualized_alert_info,os=ns&&ns.sensorsdata_hover_web_nodes,ss={isVerify:function(){return is&&(is===!0||is.call(ns))},commands:{app_alert:Mr,visualized_track:qr,page_info:qr,sensorsdata_get_app_visual_config:Kr}},ls="1.26.9",us={init:function(e){Eo=e,Lo=Eo&&Eo._,Uo=Eo&&Eo.log||console&&console.log||function(){},zr()},handleCommand:Zr},cs=Wr(us,"AndroidObsoleteBridge","sdkAfterInitPara"),ds="1.26.9",ps={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Ro=Bo._,Ho=Bo.store,!!Ro.localStorage.isSupport()&&(Bo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Bo||!e)return!1;t=t||{},Jo=t.cookie_name||"sensorsdata2015jssdkchannel",Bo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Bo.registerPage({$is_channel_callback_event:function(e){if(Ro.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!ps.eventList.hasEvent(e.event)&&(ps.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Ro.isReferralTraffic(document.referrer)){var r=Ro.getQueryParam(location.href,"sat_cf");Ro.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),ps.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Bo.registerPage(t):Bo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Bo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Bo.kit.userDecryptIfNeeded(Ro.cookie.get(Jo));return e=Ro.safeJSONParse(e),!(!Ro.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Bo.para.encrypt_cookie&&(r=Bo.kit.userEncrypt(r)),Ro.cookie.set(Jo,r)}},channelLinkHandler:function(){this.eventList.reset(),Bo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Ro.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Ro.isNumber(e.latest_event_initial_time)&&Ro.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&js(arguments[0])?t=arguments[0]:arguments.length>=2&&js(arguments[1])&&(t=arguments[1])),!Ns())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(js(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ts(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Is(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?($s.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):($s.data=e,$s.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){$s.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===Os){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Ds(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),As(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=_s().visibilityChange,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},xs=rn($s,"Deeplink","sdkReady"),Es="1.26.9",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},ln()},handleCommand:cn},Us=sn(Ls,"IOSBridge","sdkAfterInitPara"),Rs="1.26.9",Bs={init:function(e){ws=e,Ss=ws&&ws._,ks=ws&&ws.log||console&&console.log||function(){},gn()}},Hs=fn(Bs,"IOSObsoleteBridge","sdkAfterInitPara"),Js="1.26.9",Ms=5e3,qs=432e3;wn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},wn.prototype.log=function(e){this.sd&&this.sd.log(e)},wn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Ms)},wn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},wn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},wn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&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()}},wn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},wn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},wn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},wn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},wn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},wn.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()}})},wn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},wn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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()},wn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},wn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},wn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},wn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},wn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Ks=new wn,Fs=bn(Ks,"PageLeave","sdkReady"),Vs="1.26.9",Ws=!1,zs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ws||(e.track("$WebPageLoad",l),Ws=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Xs=Pn(zs,"PageLoad","sdkReady");On.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Cn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Zs="1.26.9";On.prototype.plugin_name="RegisterProperties";var Qs,Gs,Ys=new On,el=In(Ys),tl="1.26.9",rl=window.console&&window.console.log||function(){},nl={init:function(e){return Qs=e,rl=Qs&&Qs.log||rl,e&&e.kit&&e.kit.buildData?(Gs=Qs.kit.buildData,Qs.kit.buildData=$n,void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},il=Dn(nl,"RegisterPropertyPageHeight","sdkReady"),al="1.26.9",ol={};ol.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},ol.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},ol.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},ol.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var p=u.indexOf("?");a=p>-1?o>-1?s+l+"#"+u.substring(1,o)+d(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+d(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},ol.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},ol.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},ol.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},ol.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var sl,ll,ul,cl,dl,pl,fl,gl,_l,hl,ml,vl,yl,bl=Ln(ol,"SiteLinker","sdkReady"),wl="utm_source utm_medium utm_campaign utm_content utm_term",Sl="1.26.9",kl={init:function(e){function t(){var e=wl.split(" "),t="",r={};return sl._.isArray(sl.para.source_channel)&&sl.para.source_channel.length>0&&(e=e.concat(sl.para.source_channel),e=sl._.unique(e)),sl._.each(e,function(e){t=sl._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!sl&&(sl=e,sl.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},Pl=Bn(kl,"Utm","sdkAfterInitPara"),Cl="1.26.9",Ol=!1,Nl=null,jl={init:function(e){Nl=e,Nl.disableSDK=qn,Nl.enableSDK=Kn,Nl.getDisabled=Fn}},Il=Mn(jl,"DisableSDK","sdkInitAPI"),Tl="1.26.9",Al={plugin_name:"DebugSender",init:function(e){ll=e,ul=ll._,Gn()}},Dl=zn(Al),$l="1.26.9",xl={plugin_name:"JsappSender",init:function(e){cl=e,dl=cl._,ni()}},El=ti(xl),Ll="1.26.9",Ul=null,Rl={plugin_name:"BatchSender",init:function(e){pl=e,fl=pl._,ci()}},Bl=si(Rl),Hl="1.26.9",Jl={plugin_name:"BeaconSender",init:function(e){gl=e,_l=gl._,mi()}},Ml=fi(Jl),ql="1.26.9",Kl={plugin_name:"AjaxSender",init:function(e){hl=e,ml=hl._,Pi()}},Fl=bi(Kl),Vl="1.26.9",Wl={plugin_name:"ImageSender",init:function(e){vl=e,yl=vl._,Di()}},zl=Ni(Wl),Xl=null,Zl=null,Ql=[],Gl={init:function(e){e&&(Xl=e,Zl=Xl._,Xl.logger&&Xl.logger.appendWriter(Li),Xl.on&&Xl.on("sdkAfterInitPara",function(){for(var e=0;e1)))/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;g(r+1,0)<=i;r++);for(n=c((i-g(r,0))/30.42);g(r,n+1)<=i;n++);i=1+i-g(r,n),s=c((a=(e%864e5+864e5)%864e5)/36e5)%24,o=c(a/6e4)%60,l=c(a/1e3)%60,d=a%1e3}}return(k=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+w(6,r<0?-r:r):w(4,r))+"-"+w(2,n+1)+"-"+w(2,i)+"T"+w(2,s)+":"+w(2,o)+":"+w(2,l)+"."+w(3,d)+"Z",r=n=i=s=o=l=d=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function P(e){return k(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=P;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var I=function(e){var t=e.charCodeAt(0),r=$[t];return r||"\\u00"+w(2,t.toString(16))},j=/[\x00-\x1f\x22\x5c]/g,C=function(e){return j.lastIndex=0,'"'+(j.test(e)?e.replace(j,I):e)+'"'},L=function(e,t,r,n,i,a,s){var o,d,u,p,f,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=k(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==g)return o===g?o:"null";switch("object"==(d=typeof o)&&(u=_.call(o)),u||d){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 C(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw c();if(s.push(o),p=[],y=a,a+=i,"[object Array]"==u){for(h=0,v=o.length;h0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||N();e+=x("0x"+a.slice(t,D));break;default:N()}else{if(34==i)break;for(i=a.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++D);e+=a.slice(t,D)}if(34==a.charCodeAt(D))return D++,e;N();default:if(t=D,45==i&&(n=!0,i=a.charCodeAt(++D)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(D+1))>=48&&i<=57&&N(),n=!1;D=48&&i<=57;D++);if(46==a.charCodeAt(D)){for(r=++D;r57);r++);r==D&&N(),D=r}if(101==(i=a.charCodeAt(D))||69==i){for(43!=(i=a.charCodeAt(++D))&&45!=i||D++,r=D;r57);r++);r==D&&N(),D=r}return+a.slice(t,D)}n&&N();var o=a.slice(D,D+4);if("true"==o)return D+=4,!0;if("fals"==o&&101==a.charCodeAt(D+4))return D+=5,!1;if("null"==o)return D+=4,null;N()}return"$"},U=function(e){var t,r;if("$"==e&&N(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=T());)r?","==e?"]"==(e=T())&&N():N():r=!0,","==e&&N(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=T());)r?","==e?"}"==(e=T())&&N():N():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==T()||N(),t[e.slice(1)]=U(T());return t}N()}return e},R=function(e,t,r){var n=F(e,t,r);n===g?delete e[t]:e[t]=n},F=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(_,S,i);else S(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return D=0,E=""+e,r=U(T()),"$"!=T()&&N(),D=E=null,t&&"[object Function]"==_.call(t)?F(((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){e=String(e);for(var t,r,i,a,s="",o=0,l=e.length%3;o255||(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>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 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(r){logger.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){logger.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";_localStorage.set(t,r),_localStorage.get(t)!==r&&(e=!1),_localStorage.remove(t)}catch(n){e=!1}return e}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function getRandom(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),isObject(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(r){}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(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),n=0;n Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");for(var a in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function _URL(e){var t,r={};if("function"==typeof window.URL&&function(){try{return"https://www.sensorsdata.cn/"===new URL("https://www.sensorsdata.cn/").href}catch(e){return!1}}())(r=new URL(e)).searchParams||(r.searchParams=(t=getURLSearchParams(r.search),{get:function(e){return t[e]}}));else{isString(e)||(e=String(e)),e=trim(e);if(!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");var n=urlParse(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=getURLSearchParams("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}ConcurrentStorage.prototype.get=function(e,t,r,n){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,n=n||function(){};var i=this.lockGetPrefix+e,a=_localStorage.get(i),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return n(null);_localStorage.set(i,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(i))||{randomNum:0,expireTime:0})&&a.randomNum===s?(n(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(i)):n(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,n,i){if(!e||!t)throw new Error("key and val is must");r=r||1e4,n=n||1e3,i=i||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 i({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)&&i({status:"success"}):i({status:"fail",reason:"This key is locked"})},n)},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 n=0,i=r.length;n=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+t+"-"+e();return r||(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,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()||ry(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||a.target;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 addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(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){logger.log(t)}}}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(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument.documentElement;return{top:e.top+window.pageYOffset-t.clientTop,left:e.left+window.pageXOffset-t.clientLeft}}catch(r){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),ry(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||!isArray(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 siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return ry(e=e&&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(),n=[],i=0;i=200&&r.status<300||304==r.status?e.success(t(r.responseText),r.status):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),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(s){logger.log(s)}r.send(e.data||null)}function map(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(each(e,function(e,n,i){r.push(t(e,n,i))}),r)}function base64Decode(e){var t=[];try{t=map(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 base64Encode(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}function bindReady(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,s=i.addEventListener,o=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",d=s?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](d+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},u=function(){try{a.doScroll("left")}catch(e){return void setTimeout(u,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!s&&a.doScroll){try{n=!t.frameElement}catch(p){logger.log(p)}n&&u()}i[o](d+"DOMContentLoaded",c,!1),i[o](d+"readystatechange",c,!1),t[o](d+"load",c,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,-1!==document.cookie.indexOf(t+"=true")){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function getDomBySelector(e){if(!isString(e))return null;var t,r=e.split(">");return(t=function n(e){var t,i=r.shift();if(!i)return e;try{t=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(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(!(isElement(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l0)return null}return r||null}(i,e)}catch(a){logger.log(a)}return t&&isElement(t)?n(t):null}())&&isElement(t)?t:null}function getElementContent(e,t){var r="",n="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(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 getHostname(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=_URL(e).hostname}catch(n){logger.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}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(t){return""}}function getQueryParamsFromUrl(e){var t={},r=e.split("?")[1]||"";return r&&(t=getURLSearchParams("?"+r)),t}function getQueryParam(e,t){var r=_URL(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i)n=getQueryParamsFromUrl(i)[t]||""}return n}function mediaQueriesSupported(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function getScreenOrientation(){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(mediaQueriesSupported()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return 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,n=0;n0)for(var i=e.split(""),a=0;at)for(n=r+n;(o=31*n+s)t;)n=n/2+s;n=31*n+s}return n}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function isSupportCors(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(e){if(!isObject(e)||!isString(e.callbackName))return logger.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=isFunction(e.success)?e.success:function(){},e.error=isFunction(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),r=document.getElementsByTagName("head")[0],n=null,i=!1;if(t.defer="defer",r.appendChild(t),isNumber(e.timeout)){var a=Math.min(e.timeout,3e5);n=setTimeout(function(){if(i)return!1;e.error("timeout"),window[e.callbackName]=function(){logger.log("call jsonp error")},n=null,r.removeChild(t),i=!0},a)}if(window[e.callbackName]=function(){clearTimeout(n),n=null,e.success.apply(null,arguments),window[e.callbackName]=function(){logger.log("call jsonp error")},r.removeChild(t)},e.url.indexOf("?")>-1?e.url+="&callbackName="+e.callbackName:e.url+="?callbackName="+e.callbackName,isObject(e.data)){var s=[];each(e.data,function(e,t){s.push(t+"="+e)}),e.data=s.join("&"),e.url+="&"+e.data}t.onerror=function(a){if(i)return!1;window[e.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(n),n=null,r.removeChild(t),e.error(a),i=!0},t.src=encodeURI(e.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"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;addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else 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(""),n=0,i=r.length;nt?(s&&(clearTimeout(s),s=null),o=d,a=e.apply(n,i),s||(n=i=null)):s||!1===r.trailing||(s=setTimeout(l,c)),a}}function values(e){var t=[];return null==e?t:(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=[],n={},i=0;it._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_"+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,n=saCookie.get("sensorsdata2015jssdkcross"+sd.para.sdk_id),i={};null!=(n=sd.kit.userDecryptIfNeeded(n))&&isJSONString(n)&&(i=JSON.parse(n)).$device_id&&(r=i.$device_id),r=r||e,!0===sd.para.cross_subdomain?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),sd.para.encrypt_cookie&&(i=sd.kit.userEncrypt(i)),saCookie.set("sensorsdata2015jssdkcross"+sd.para.sdk_id,i,null,!0)),sd.para.is_track_device_id&&(pageInfo.currentProps.$device_id=r)},storeInitCheck:function(){if(sd.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else 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 n=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t&&(n=!0),addEvent(e,t,r,n)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function getSourceFromReferrer(){function e(e,t){for(var r=0;r20&&this.pendingEvents.shift()},on:function(e,t,r,n){isFunction(t)&&(this._events.push({type:e,callback:t,context:r||this}),n=!1!==n,this.pendingEvents.length>0&&n&&each(this.pendingEvents,function(n){n.type===e&&t.apply(r,n.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var ee={},spa=new EventEmitter;function eventEmitterFacade(e,t){var r=[];"string"==typeof e&&e in ee.EVENT_LIST&&(r=ee.EVENT_LIST[e],ee[r[0]].on(r[1],t))}ee.spa=spa,ee.sdk=new EventEmitter,ee.data=new EventEmitter,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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var AjaxSend=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};AjaxSend.prototype.start=function(){var e=this,t=new Date;ajax$1({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:sdPara.datasend_timeout,cors:!0,success:function(r,n){ee.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:sdPara.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){ee.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:sdPara.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},AjaxSend.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 dataStoragePrefix="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.server_url)&&""!==sdPara.server_url||isArray(sdPara.server_url)&&sdPara.server_url.length))return sdError("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01");this.serverUrl=isArray(sdPara.server_url)?sdPara.server_url[0]:sdPara.server_url},send:function(){if(this.sendTimeStamp&&now()-this.sendTimeStamp-1&&r.splice(i,1),_localStorage.remove(e[n])}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);null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),r=this.generateTabStorageVal()):r=safeJSONParse(r)||this.generateTabStorageVal(),r.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=0;ti.expireTime&&this.serverUrl===i.serverUrl)new ConcurrentStorage("sajssdk-lock-get-").get(r,1e4,1e3,function(e){if(e){null===_localStorage.get(n.tabKey)&&n.generateTabStorage();var t=safeJSONParse(e)||n.generateTabStorageVal(),r=safeJSONParse(_localStorage.get(n.tabKey))||n.generateTabStorageVal();r.data=unique(r.data.concat(t.data)),_localStorage.set(n.tabKey,JSON.stringify(r))}})}else if(0===r.indexOf("sajssdk-lock-get-")){var s=safeJSONParse(_localStorage.get(r))||{expireTime:0};now()-s.expireTime>1e4&&_localStorage.remove(r)}}for(var o=0;o0)for(t=0;tsdPara.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!(indexOf(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(indexOf(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=store._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(indexOf(this.bindReservedNames,e)>-1)}},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||("Property Value",isFunction(checkLog[r])&&checkLog[r]("Property Value")),!0}},properties:function(e){return isObject(e)?each(e,function(e,t){check({propertyKey:t});check({propertyValue:e},function(e,r,n){return e||(r=t+"'s Value",isFunction(checkLog[n])&&checkLog[n](r)),!0})}):ruleOption.voidZero(e)&&sdWarn("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return e!==undefined&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdWarn("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!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 n=this[e];if(isFunction(n))return n.call(this,t);if(!n)return!1;for(var i=0;i-1;if(isObject(r)&&"$option"!==n&&!a)try{e[n]=JSON.stringify(r)}catch(s){delete e[n],sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else isString(r)||isNumber(r)||isDate(r)||isBoolean(r)||isArray(r)||isFunction(r)||"$option"===n||a||(sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete e[n])}),e):e}function formatString(e,t){return isNumber(t)&&e.length>t?(sdWarn("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function filterReservedProperties(e,t){isObject(e)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(r,n){r in e&&(indexOf(t||[],r)>-1||(n<3?(delete e[r],sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function searchObjString(e){var t=["$element_selector","$element_path"],r=["sensorsdata_app_visual_properties"];isObject(e)&&each(e,function(n,i){if(isObject(n))searchObjString(e[i]);else if(isString(n)){if(indexOf(r,i)>-1)return;e[i]=formatString(n,indexOf(t,i)>-1?1024:sdPara.max_string_length)}})}function searchZZAppStyle(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(e){if("item_type"in e){check({item_type:e.item_type},function(t){return t||delete e.item_type,!0})}if("item_id"in e){check({item_id:e.item_id},function(t,r,n){return t||"string"!==n||delete e.item_id,!0})}}function formatProperties(e,t){each(e,function(r,n){-1===indexOf(t||[],n)&&check({propertyKey:n},function(t,r,i){return t||"keyLength"===i||delete e[n],!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){var r=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(),r.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={server_url:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.server_url))return sdError("----vcollect---server_url\u5fc5\u987b\u4e3a\u6709\u6548 URL \u5b57\u7b26\u4e32"),!1;try{e=_URL(sd.para.server_url),r.server_url.project=e.searchParams.get("project")||"default",r.server_url.host=e.host}catch(n){return sdError("----vcollect---server_url\u89e3\u6790\u5f02\u5e38",n),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(n){return sdError("----vcollect---\u9875\u9762\u5730\u5740\u89e3\u6790\u5f02\u5e38",n),!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 e.$element_selector.indexOf(t.element_selector)>-1}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 e.$element_path.indexOf(t.element_path)>-1}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(e.$element_position!==undefined){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(e,t,r){var n=[];if(!r){var i=vtrackBase.initUrl();if(!i)return[];r=i.page_url}return"$WebClick"===e.event&&each(t,function(t){isObject(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&isObject(t.event)&&t.event.url_host===r.host&&t.event.url_path===r.pathname&&vtrackBase.configIsMatch(e.properties,t.event)&&n.push(t)}),n},getPropElInLi:function(e,t){if(!(e&&isElement(e)&&isString(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r=sd.heatmap.getDomSelector(e);if(r){var n=getDomBySelector(r+t);return n||null}return sdWarn("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",r,t),null},getProp:function(e,t){if(!isObject(e))return!1;if(!(isString(e.name)&&e.name.length>0))return sdWarn("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var r,n,i={};if("content"===e.method){var a;if(isString(e.element_selector)&&e.element_selector.length>0)a=getDomBySelector(e.element_selector);else{if(!t||!isString(e.list_selector))return sdWarn("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=getDomBySelector(t.properties.$element_selector);if(!s)return sdWarn("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var o=sd.heatmap.getClosestLi(s);a=vtrackBase.getPropElInLi(o,e.list_selector)}if(!a||!isElement(a))return sdWarn("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===a.tagName.toLowerCase())r=a.value||"";else if("select"===a.tagName.toLowerCase()){var l=a.selectedIndex;isNumber(l)&&isElement(a[l])&&(r=getElementContent$1(a[l],"select"))}else r=getElementContent$1(a,a.tagName.toLowerCase());if(e.regular){try{n=new RegExp(e.regular).exec(r)}catch(d){return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===n)return sdWarn("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!isArray(n)||!isString(n[0]))return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;r=n[0]}if("STRING"===e.type)i[e.name]=r;else if("NUMBER"===e.type){if(r.length<1)return sdWarn("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;if(isNaN(Number(r)))return sdWarn("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;i[e.name]=Number(r)}return i}return sdError("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},getAssignConfigs:function(e,t){var r=vtrackBase.initUrl();if(!r||!r.page_url)return[];if(!isObject(t))return[];var n=[];return t.events=t.events||t.eventList,isArray(t.events)&&t.events.length>0?(each(t.events,function(t){isObject(t)&&isObject(t.event)&&t.event.url_host===r.page_url.host&&t.event.url_path===r.page_url.pathname&&e(t)&&n.push(t)}),n):[]}},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(e){var t={},r=[],n=this;if(!this.events.length)return{};if("$WebClick"===e.event){var i=this.filterConfig(e,this.events);if(!i.length)return{};each(i,function(i){isObject(i)&&(isArray(i.properties)&&i.properties.length>0&&each(i.properties,function(r){if(isObject(r))if(!1===r.h5)isArray(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(r);else{var i=n.getProp(r,e);isObject(i)&&(t=extend(t,i))}}),isString(i.event_name)&&r.push(i.event_name))}),sd.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=r)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new sd.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(r){var n={};try{r=JSON.parse(base64Decode(r))}catch(s){sdError("getJSVisualProperties data parse error!")}if(isObject(r)){var i=r.sensorsdata_js_visual_properties,a=e.initUrl();a&&(a=a.page_url,isArray(i)&&i.length>0&&each(i,function(t){if(isObject(t)&&t.url_host===a.host&&t.url_path===a.pathname&&t.h5){var r=e.getProp(t);isObject(r)&&(n=extend(n,r))}}))}return"android"===sd.bridge.bridge_info.platform&&t.notifyApp({data:n},r.message_id),n}),t}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(base64Decode(t))}catch(r){return void sdError("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(base64Decode(e))}catch(t){e=null,sdError("getAppVisualConfig result parse error\uff01")}return e},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))return!1;for(var r=0;r0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,r){var n=this;r=r||this.filterConfig(e,t,vtrackcollect.url_info.page_url);var i={};return r.length?(each(r,function(t){isArray(t.properties)&&t.properties.length>0&&each(t.properties,function(t){var r=n.getProp(t,e);isObject(r)&&extend(i,r)})}),i):{}},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=vtrackBase.initUrl();if(e){var t;try{(t=new urlParse(sd.para.server_url))._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return sdError("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)return!1;if(_localStorage.isSupport()||(this.storageEnable=!1),!this.initUrl())return sdError("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=store.readObjectVal(this.storage_name);if(isObject(e)&&isObject(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime()-this.update_time;if(isNumber(t)&&t>0&&t0&&t-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===i&&sd.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)&&((sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1)>1||r.isCollectableDiv(n)))return n;if(r.isStyleTag(i)&&sd.para.heatmap.collect_tags.div){var o=r.getCollectableParent(n);if(o&&r.isDivLevelValid(o))return o}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var r=heatmap.getElementPath(e,!0,t).split(" > "),n=0;return each(r,function(e){"div"===e&&n++}),n},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(heatmap.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&isElement(e);){if(!isString(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){return function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&isString(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null}(e,"li")},getElementPosition:function(e,t,r){var n=sd.heatmap.getClosestLi(e);if(!n||!isElement(e)||!isString(e.tagName))return null;var i=e.tagName.toLowerCase(),a=n.getElementsByTagName(i),s=a.length,o=[];if(s>1){for(var l=0;l1)return indexOf(o,e)}return function(e){if(!e.parentNode)return"";if(1===ry(e).getSameTypeSiblings().length)return 0;for(var t=0,r=e;ry(r).previousElementSibling().ele;r=ry(r).previousElementSibling().ele,t++);return t}(n)},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),sd.para.heatmap_url||(sd.para.heatmap_url=getSafeHttpProtocol()+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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});r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);var n=sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);return isNumber(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){if(!e)return{};function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}return function(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,s=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(s)}}(e)},start:function(e,t,r,n,i){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collect_element)&&!sd.para.heatmap.collect_element(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,n,i))},getBasicEleInfo:function(e,t,r,n,i){var a=isObject(n)?n:{},s=isFunction(i)?i:isFunction(n)?n:undefined,o=this.getEleDetail(t);if(sd.para.heatmap&&sd.para.heatmap.custom_property){var l=sd.para.heatmap.custom_property(t);isObject(l)&&(o=extend(o,l))}return{event:e,target:t,props:o=extend(o,this.getPointerEventProp(e,t),a),tagName:r,callback:s}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=ry(e.element).getParents());if(r&&isArray(r)&&r.length>0)for(var i=0;i-1)&&(!t||sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collect_tags)&&isObject(sd.para.heatmap.collect_tags.div)&&isArray(sd.para.heatmap.collect_tags.div.ignore_tags)&&indexOf(sd.para.heatmap.collect_tags.div.ignore_tags,e)>-1):indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){sdError("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=sd.para&&sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){sdError("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.scroll_notice_map)return!1;var e=!0;sd.para.scrollmap&&isFunction(sd.para.scrollmap.collect_url)&&this.listenUrlChange(function(){e=!!sd.para.scrollmap.collect_url()});var t=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t}({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>sd.para.heatmap.scroll_delay_time&&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.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=n}});t.current_time=new Date,saAddEvent(window,"scroll",function(){if(!e)return!1;t.go()}),saAddEvent(window,"unload",function(){if(!e)return!1;t.go("notime")})},initHeatmap:function(){var e=this,t=!0;if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)return!1;isFunction(sd.para.heatmap.collect_url)&&this.listenUrlChange(function(){t=!!sd.para.heatmap.collect_url()}),"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(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var s=isString(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===s||"button"===s?e.start(n,i.parentNode,s):e.start(n,i,a)}):saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement,a=sd.heatmap.getTargetElement(i,r);if(!isElement(a)&&!isString(i.tagName))return!1;isElement(a)&&isString(a.tagName)?e.start(n,a,a.tagName.toLowerCase()):isElement(i)&&"div"===i.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&unlimitedDiv.events.length>0&&unlimitedDiv.isTargetEle(i)&&e.start(n,i,i.tagName.toLowerCase(),{$lib_method:"vtrack"})})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),t={};return each(e,function(e,r,n){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+r+" ")?t["$"+r]=n[r]:t[r]=n[r]}),t}function sendFirstProfile(e,t,r){if(sd.is_first_visitor&&r){var n={};sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(n.$search_keyword_id=getBaiduKeyword.id(),n.$search_keyword_id_type=getBaiduKeyword.type(),n.$search_keyword_id_hash=hashCode53(n.$search_keyword_id));var i=getReferrer(null,t);e(extend({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?getHostname(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),n)),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.setProfile(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("sensorsdata_2015_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var n in e)!(n in t&&t[n]!==e[n])&&n in t||(t[n]=e[n],r=!0);r&&(store.saveObjectVal("sensorsdata_2015_jssdk_profile",t),sd.setProfile(e))}else store.saveObjectVal("sensorsdata_2015_jssdk_profile",e),sd.setProfile(e)},setInitReferrer:function(){var e=getReferrer();sd.setOnceProfile({_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){if("object"==typeof e&&e.tagName&&isElement(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||hasAttributes(e,a)||heatmap.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();heatmap.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){var r;r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer;var n=!(e=isObject(e)?e:{}).not_set_profile;function i(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,i(e,t),this.autoTrackSinglePage=i,sendFirstProfile(sd.setOnceProfile,!1,n)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=isObject(e)?e:{};var r=getClassifiedUtms(),n=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var i=location.href;sd.para.is_single_page&&addHashEvent(function(){var n=getReferrer(i,!0);sd.track("$pageview",extend({$referrer:n,$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),i=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),sendFirstProfile(sd.setOnceProfile,!0,n),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store.getAnonymousId()},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]?e(window.SensorsDataWebJSSDKPlugin[t]):isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sdWarn(t+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function loginBody(e,t){var r=e.id,n=e.callback,i=e.name,a=store.getFirstId(),s=store.getOriginDistinctId();if(!check({distinct_id:r}))return sdError("login id is invalid"),!1;if(r===store.getOriginDistinctId()&&!a)return sdError("login id is equal to distinct_id"),!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(i)&&r===store._state.first_id)return!1;if(store._state.history_login_id.name!==i||r!==store._state.history_login_id.value){store._state.identities[i]=r,store.set("history_login_id",{name:i,value:r}),a||store.set("first_id",s),t(r,"$SignUp",{},n);var o={$identity_cookie_id:store._state.identities.$identity_cookie_id};return o[i]=r,resetIdentities(o),!0}return!1}function resetIdentities(e){var t={};for(var r in e)t[r]=e[r];store._state.identities=t,store.save()}function deleteBindIDData(e,t){if(!check({unbindKey:e,bindValue:t}))return!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t){var r=store.getUnionId().login_id;r&&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())}var n={};return n[e]=t,n}function setInitVar(){sd._t=sd._t||1*new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var n in sd.para.is_track_latest)r["latest_"+n]=sd.para.is_track_latest[n];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 i=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],o={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof sd.para.source_type&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(i):i,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(a):a,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(s):s,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(o,sd.para.source_type.keyword):o);var l=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)){sd.para.heatmap.clickmap=sd.para.heatmap.clickmap||"default",sd.para.heatmap.scroll_notice_map=sd.para.heatmap.scroll_notice_map||"default",sd.para.heatmap.scroll_delay_time=sd.para.heatmap.scroll_delay_time||4e3,sd.para.heatmap.scroll_event_duration=sd.para.heatmap.scroll_event_duration||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);var d=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),sd.para.heatmap.track_attr=d,isObject(sd.para.heatmap.collect_tags))if(!0===sd.para.heatmap.collect_tags.div)sd.para.heatmap.collect_tags.div={ignore_tags:l,max_level:1};else if(isObject(sd.para.heatmap.collect_tags.div)){if(sd.para.heatmap.collect_tags.div.ignore_tags?isArray(sd.para.heatmap.collect_tags.div.ignore_tags)||(sdWarn("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),sd.para.heatmap.collect_tags.div.ignore_tags=l):sd.para.heatmap.collect_tags.div.ignore_tags=l,sd.para.heatmap.collect_tags.div.max_level){-1===indexOf([1,2,3],sd.para.heatmap.collect_tags.div.max_level)&&(sd.para.heatmap.collect_tags.div.max_level=1)}}else sd.para.heatmap.collect_tags.div=!1;else sd.para.heatmap.collect_tags={div:!1}}sd.para.server_url=optimizeServerUrl(sd.para.server_url),!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.collect_tags&&isObject(sd.para.heatmap.collect_tags)&&each(sd.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&"default"===sd.para.heatmap.clickmap&&sd.heatmap.initUnlimitedTags()}var readyState={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},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):sdWarn("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0])}var nonameCount=1;function use(e,t){if(isString(e)||isObject(e)){var r;if(isObject(e)){var n=sd.modules&&sd.modules[e.plugin_name];n&&n!==e&&sdWarn(e.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),r=n||e}return 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.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[e]&&(r=window.sensorsDataAnalytic201505.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||sdWarn("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&sdWarn("warning: plugin version not match SDK version. plugin may not work correctly. "):sdWarn("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,r):(sdWarn((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),r)}sdError("use's first arguments must be string or object.")}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){var r=deleteBindIDData(e,t);r&&saEvent.send({identities:r,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(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void saAddEvent(e,"click",function(n){n.preventDefault();var i=!1;function a(){i||(i=!0,location.href=e.href)}setTimeout(a,1e3),sd.track(t,r,a)}))}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 setProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function setOnceProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function appendProfile(e,t){check({propertiesMust:e})&&(each(e,function(t,r){isString(t)?e[r]=[t]:isArray(t)?e[r]=t:(delete e[r],sdWarn("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),isEmptyObject(e)||saEvent.send({type:"profile_append",properties:e},t))}function incrementProfile(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!1;return!0}(e)?sdError("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"):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,n={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?n[e]=!0:sdWarn("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),saEvent.send({type:"profile_unset",properties:n},t)):sdError("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function identify(e){"number"==typeof e&&(e=String(e));var t=store.getFirstId();if(void 0===e){var r=UUID();t?store.set("first_id",r):store.set("distinct_id",r)}else check({distinct_id:e})&&(t?store.set("first_id",e):store.set("distinct_id",e))}function resetAnonymousIdentity(e){if(store.getFirstId())return sdError("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),void 0===e){var t=UUID();store._state.identities.$identity_cookie_id=t,store.set("distinct_id",t)}else check({distinct_id:e})&&(store._state.identities.$identity_cookie_id=e,store.set("distinct_id",e))}function sendSignup(e,t,r,n){var i=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:i,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function trackSignup(e,t,r,n){"number"==typeof e&&(e=String(e)),check({distinct_id:e,event:t,properties:r})&&sendSignup(e,t,r,n)}function registerPage(e){check({properties:e})?extend(pageInfo.currentProps,e):sdError("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){var t;if(isArray(e)&&e.length>0)for(t=0;t-1?n:"https:")+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/vapph5define.min.js"})}else r();else r()}function listenSinglePage(e){sd.para.is_track_single_page&&spa.on("switch",function(t){var r=function(r){if(r=r||{},t!==location.href){pageInfo.pageProp.referrer=getURL(t);var n=extend({$url:getURL(),$referrer:getURL(t)},r);isFunction(e)?e(n):sd.quick&&sd.quick("autoTrack",n)}};if("boolean"==typeof sd.para.is_track_single_page)r();else if("function"==typeof sd.para.is_track_single_page){var n=sd.para.is_track_single_page();isObject(n)?r(n):!0===n&&r()}})}function enterFullTrack(){sd._q&&isArray(sd._q)&&sd._q.length>0&&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","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","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=[]),sdWarn("calling sdk api before init is deprecated."),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);sdError("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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 n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},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)&&r.length>0)for(var n={current:0,total:r.length},i=new InterceptorContext(t,n,sd),a=0;a=2)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="1.26.8";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return"dfm-enc-"+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf("dfm-enc-")&&(e=e.substring("dfm-enc-".length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="1.26.8";function wrapPluginInitFn$1(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$1(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$1(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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 t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),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="1.26.8";function wrapPluginInitFn$2(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$2(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$2(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(),log("---test---fail---",!sd$1,sd$1.bridge.activeBridge,!anServerUrl),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),log("---test---bridge-verify-",sd$1.bridge.is_verify_success)),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("---test---app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){if(log("---test---datasend-",sd$1.bridge.is_verify_success),sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$1.bridge.is_verify_success?(log("---test---bridge-verify-success---",e.data),anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({server_url:sd$1.para.server_url},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(log("---test---bridge-verify-fail-----",sd$1.bridge.is_verify_success),sd$1.para.app_js_bridge.is_send?(sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_$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="1.26.8";function wrapPluginInitFn$3(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$3(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$3(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(){if(log$1("ObsoleteBridge---test---init---"),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,log$1("ObsoleteBridge-",sd$2.bridge.activeBridge,anVerify,anTrack$1,anVisualVerify),sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)){sd$2.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack$1;anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({server_url:sd$2.para.server_url})),log$1("ObsoleteBridge---called-return",e)),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){if(log$1("ObsoleteBridge---senddata"),sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(anVerify){var n=anVerify&&anVerify.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data)));return log$1("ObsoleteBridge---anVerify-success",n),n?(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$2.para.app_js_bridge.is_send?(sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return log$1("ObsoleteBridge---is-send-old-way",sd$2.para.app_js_bridge.is_send),anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function handleCommand$1(e){log$1("ObsoleteBridge---handleCommadn");var t=e.callType;return t in vbridge$1$1.commands?(log$1("ObsoleteBridge---",t,vbridge$1$1.commands),vbridge$1$1.commands[t](e,anBridge$1)):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?(log$1("ObsoleteBridge---handleCommadn-abridge"),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="1.26.8";function wrapPluginInitFn$4(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$4(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$4(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var hidden,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||"sensorsdata2015jssdkchannel",sd$3=e;var r=this;!function(){if(_$3=sd$3._,store$1=sd$3.store,!_$3.localStorage.isSupport())return!1;sd$3.para.max_string_length=1024,r.eventList.init(),r.addLatestChannelUrl(),r.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd$3.registerPage({$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();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_$3.isReferralTraffic(document.referrer)){var r=_$3.getQueryParam(location.href,"sat_cf");_$3.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd$3.registerPage(t):sd$3.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd$3.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name));return e=_$3.safeJSONParse(e),!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);sd$3.para.encrypt_cookie&&(r=sd$3.kit.userEncrypt(r)),_$3.cookie.set(cookie_name,r)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$5(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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"undefined"!=typeof document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var iosServerUrl,iosTracker,sd$4,_$4,log$2,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){var t=e._.URL(e.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},handleAndroidLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=t;e.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,e.timer=setTimeout(function(){var t=isPageHidden();if(e.log("hide:"+hidden+":"+document[hidden]),t)return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=r},e.timeout)},handleIOSLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 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\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),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){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=e,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&isObject$1(arguments[0])?t=arguments[0]:arguments.length>=2&&isObject$1(arguments[1])&&(t=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=parseShortURL(n);if(!i)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f 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,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="1.26.8";function wrapPluginInitFn$6(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$6(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$6(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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){if(sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({server_url:sd$4.para.server_url},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$4.para.app_js_bridge.is_send?(sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_$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="1.26.8";function wrapPluginInitFn$7(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$7(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$7(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=_$5.URL(sd$5.para.server_url).hostname,r=_$5.URL(sd$5.para.server_url).searchParams.get("project")||"default"}catch(n){sd$5.log(n)}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)return e;var r,n,i=e.callback;if(sd$5.bridge.bridge_info.verify_success){var a=document.createElement("iframe"),s=(r=e.data,n=(n=JSON.stringify(_$5.extend({server_url:sd$5.para.server_url},r))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return a.setAttribute("src",s),document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null,_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),!0}return sd$5.para.app_js_bridge.is_send?(sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),e)}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="1.26.8";function wrapPluginInitFn$8(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$8(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$8(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}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\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},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(){if(!0!==this.page_hidden_status){var 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 e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.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;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},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;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var r=this.sd.store.readObjectVal(t);this._.isObject(r)&&1*new Date-r.time>r.heartbeat_interval_time+5e3&&(delete r.heartbeat_interval_time,r._flush_time=(new Date).getTime(),this.sd.kit.sendData(r),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="1.26.8";function wrapPluginInitFn$9(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$9(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$9(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){function r(){var n=0,i=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,a={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(i?(n=function(t){var r=0;return e._.isFunction(t.getEntriesByType)&&(r=((t.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),r}(i)||function(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}(i),function(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}(i,a)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),n>0){var s=e._.isObject(t)&&t.max_duration||1800;n=Number((n/1e3).toFixed(3)),(!e._.isNumber(s)||s<=0||n<=s)&&(a.event_duration=n)}eventSent||(e.track("$WebPageLoad",a),eventSent=!0),window.removeEventListener?window.removeEventListener("load",r):window.detachEvent&&window.detachEvent("onload",r)}"complete"==document.readyState?r():window.addEventListener?window.addEventListener("load",r):window.attachEvent&&window.attachEvent("onload",r)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),s=t.customRegister,o=a.properties,l=a.event,d={};return n.each(s,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(d=n.extend(d,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:o,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(d=n.extend(d,t))}}),e.properties=n.extend(o,d),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder$b="1.26.8";function wrapPluginInitFn$a(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$a(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$a(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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="1.26.8";function wrapPluginInitFn$b(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$b(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$b(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(i){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}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 \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="1.26.8";function wrapPluginInitFn$c(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$c(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$c(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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-1)return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r-1)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=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),i="";if(n){var a,s=n[1]||"",o=n[2]||"",l=n[3]||"",d="_sasdk="+this.getCurrenId(),c=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(d):n.push(e)}),n.join("&")};if(this.getPartHash(e))a=l.indexOf("_sasdk"),i=l.indexOf("?")>-1?a>-1?s+o+"#"+l.substring(1,a)+c(l.substring(a,l.length)):s+o+l+"&"+d:s+o+"#"+l.substring(1)+"?"+d;else a=o.indexOf("_sasdk"),i=/^\?(\w)+/.test(o)?a>-1?s+"?"+c(o.substring(1))+l:s+o+"&"+d+l:s+"?"+d+l;return t&&(t.href=i),i}},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},setRefferId:function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);(r=r.substring(1))!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},addListen:function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),s=i.parentNode;if("a"===a&&i.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===a&&i.href?(r=i.href,n=i):(r=s.href,n=s);var o=e._.URL(r).protocol;"http:"!==o&&"https:"!==o||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},init:function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var r=t.length,n=[],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$d(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(){return function(){var e=source_channel_standard$1.split(" "),t="",r={};sd$6._.isArray(sd$6.para.source_channel)&&sd$6.para.source_channel.length>0&&(e=e.concat(sd$6.para.source_channel),e=sd$6._.unique(e));return 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="1.26.8";function wrapPluginInitFn$e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$e(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$e(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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="1.26.8";function wrapPluginInitFn$f(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$f(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$f(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData$4(e,t){if(!0===sd$8.para.debug_mode){var r=e.data;e.callback;debugPath(JSON.stringify(r)),t.cancellationToken.stop()}return 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.server_url)?sd$8.para.debug_mode_url=sd$8.para.server_url.replace("sa.gif","debug"):_$6.isArray(sd$8.para.server_url)&&_$6.isString(sd$8.para.server_url[0])?sd$8.para.debug_mode_url=sd$8.para.server_url[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="1.26.8";function wrapPluginInitFn$g(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$g(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$g(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){if(_$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()}return 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){if(!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData){sd$9.para.jsapp.isOnline=!0;var t=sd$9.para.jsapp.getData();_$7.isArray(t)&&t.length>0&&_$7.each(t,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})}else 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="1.26.8";function wrapPluginInitFn$h(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$h(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$h(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$i(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){var r=null,n=null;if(_$9.isObject(e.config)&&(r=e.config.send_type,n=_$9.optimizeServerUrl(e.config.server_url)),("beacon"===r||!r&&"beacon"===sd$b.para.send_type)&&_$9.isSupportBeaconSend()){var i=n||e.server_url;e.server_url=i,e.data=sd$b.kit.encodeTrackData(e.data),_$9.isArray(i)&&i.length?_$9.each(i,function(t){e.callback=null,e.server_url=t,sendData$7(e)}):"string"==typeof i&&""!==i?sendData$7(e):sd$b.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$3(){"beacon"!==sd$b.para.send_type||_$9.isSupportBeaconSend()||(sd$b.para.send_type="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="1.26.8";function wrapPluginInitFn$j(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$j(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$j(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){var r=null,n=null;if(_$a.isObject(e.config)&&(r=e.config.send_type,n=_$a.optimizeServerUrl(e.config.server_url)),("ajax"===r||!r&&"ajax"===sd$c.para.send_type)&&_$a.isSupportCors()){var i=n||e.server_url;e.server_url=i,e.data=sd$c.kit.encodeTrackData(e.data),_$a.isArray(i)&&i.length?_$a.each(i,function(t){e.callback=null,e.server_url=t,sendData$8(e)}):"string"==typeof i&&""!==i?sendData$8(e):sd$c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$4(){"ajax"!==sd$c.para.send_type||_$a.isSupportCors()||(sd$c.para.send_type="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="1.26.8";function wrapPluginInitFn$k(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$k(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$k(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){var r=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+r:e+"?"+r}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(e,t){var r=null;_$b.isObject(e.config)&&(r=_$b.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,_$b.isArray(n)&&n.length?_$b.each(n,function(t){t&&(e.data=getSendUrl(t,i),e.callback=null,e.server_url=t,sendData$9(e))}):"string"==typeof n&&""!==n?(e.data=getSendUrl(n,i),sendData$9(e)):sd$d.logger&&sd$d.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.send_type&&"ajax"!==sd$d.para.send_type&&"beacon"!==sd$d.para.send_type&&(sd$d.para.send_type="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}})})}var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender);function wrapPluginInitFn$l(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$l(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$l(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$l(e,t,r){return wrapPluginInitFn$l(e,t,r),e.plugin_version=sdkversion_placeholder,e}var _sd$1=null,_$c=null,_cacheLogs=[],ConsoleLogger={init:function(e){e&&(_$c=(_sd$1=e)._,_sd$1.logger&&_sd$1.logger.appendWriter(logWriter),_sd$1.on&&_sd$1.on("sdkAfterInitPara",function(){for(var e=0;e<_cacheLogs.length;e++)printLog(_cacheLogs[e]);_cacheLogs=null}),_sd$1.on&&_sd$1.on("sdkInitAPI",function(){_sd$1.enableLocalLog=enableLocalLog,_sd$1.disableLocalLog=disableLocalLog}))}},consoleLogger=createPlugin$l(ConsoleLogger,"ConsoleLogger");function logWriter(e){null!==_cacheLogs?_cacheLogs.push(e):printLog(e)}function printLog(e){try{if("log"===e.level&&canLog())return void writeLog(e);if("warn"===e.level&&canWarn())return void writeLog(e);if("error"===e.level&&canError())return void writeLog(e)}catch(t){}}function canLog(){return!!isLocalLogEnabled()||(!0===_sd$1.para.show_log||_$c.isObject(_sd$1.para.show_log)&&"log"===_sd$1.para.show_log.level)}function canWarn(){return!!isLocalLogEnabled()||(canLog()||_$c.isObject(_sd$1.para.show_log)&&"warn"===_sd$1.para.show_log.level)}function canError(){return!!isLocalLogEnabled()||(!_$c.isObject(_sd$1.para.show_log)||"none"!==_sd$1.para.show_log.level)}function writeLog(e){var t=e.content,r=_$c.isObject(t[0])?_$c.formatJsonString(t[0]):t[0],n=getLogHead(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(_$c.isFunction(console[e.level])?console[e.level].apply(console,t):_$c.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function getLogHead(e){var t="",r="",n=_sd$1.para.show_log;return _$c.isObject(n)&&!1===n.show_brand||(t+=e.brand),_$c.isObject(n)&&!1===n.show_level||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),_$c.isObject(n)&&!1===n.show_module||(r=e.module),t+r}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _$c.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}sd.modules=sd.modules||{};for(var builtinPlugins=[consoleLogger,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=[consoleLogger,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=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$m(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$m(e,t,r){return wrapPluginInitFn$m(e,t,r),e.plugin_version=sdkversion_placeholder$m,e}var sd$f,utmKeys=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],ChannelUtm={init:function(e){e&&!sd$f&&((sd$f=e)._.each(utmKeys,function(e){sd$f.source_channel_standard=sd$f.source_channel_standard+" "+e,sd$f.para.source_type.utm.push(e)}),sd$f.registerInterceptor("businessStage",{getUtmData:{entry:function(e){var t=!1,r=e||{};return sd$f._.each(utmKeys,function(e){var n=sd$f._.getQueryParam(location.href,e);n.length&&(t=!0,r[e.slice(8)]=n)}),t&&sd$f.register&&sd$f.register({link_v:"1"}),r}}}))}},index$l=createPlugin$m(ChannelUtm,"ChannelUtm","sdkAfterInitPara");sd$e.use(index$4),sd$e.use(index$l);export default sd$e; \ No newline at end of file +var logFn,sd={};function isFunction(e){if(!e)return!1;var t=Object.prototype.toString.call(e);return"[object Function]"==t||"[object AsyncFunction]"==t}function now(){return Date.now&&isFunction(Date.now)?Date.now():(new Date).getTime()}(function(){var e={"function":!0,object:!0},t=e[typeof window]&&window||this;var 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,d=r.SyntaxError||t.SyntaxError,c=r.TypeError||t.TypeError,u=r.Math||t.Math,p=r.JSON||t.JSON;if("object"==typeof p&&p)return n.stringify=p.stringify,n.parse=p.parse,n.runInContext=s,n;var g,f=o.prototype,_=f.toString,h=f.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 d="function"==typeof(r=n.stringify);d&&((s=function(){return 1}).toJSON=s,m(function(){d="0"===r(0)&&"0"===r(new i)&&'""'==r(new a)&&r(_)===g&&r(g)===g&&r()===g&&"1"===r(s)&&"[1]"==r([s])&&"[null]"==r([g])&&"null"==r(null)&&"[null,null,null]"==r([g,_,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(){d=!1})),t=d}if("json-parse"==e){var c,u=n.parse;"function"==typeof u&&m(function(){0!==u("0")||u(!1)||(s=u(o),(c=5==s.a.length&&1===s.a[0])&&(m(function(){c=!u('"\t"')}),c&&m(function(){c=1!==u("01")}),c&&m(function(){c=1!==u("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"),S=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?S=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"],S=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)}),S(t,r)};if(!y("json-stringify")&&!y("date-serialization")){var $={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},w=function(e,t){return("000000"+(t||0)).slice(-e)},k=function(e){var t,r,n,i,a,s,o,l,d;if(v)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),s=e.getUTCHours(),o=e.getUTCMinutes(),l=e.getUTCSeconds(),d=e.getUTCMilliseconds()};else{var c=u.floor,p=[0,31,59,90,120,151,181,212,243,273,304,334],g=function(e,t){return p[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;g(r+1,0)<=i;r++);for(n=c((i-g(r,0))/30.42);g(r,n+1)<=i;n++);i=1+i-g(r,n),s=c((a=(e%864e5+864e5)%864e5)/36e5)%24,o=c(a/6e4)%60,l=c(a/1e3)%60,d=a%1e3}}return(k=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+w(6,r<0?-r:r):w(4,r))+"-"+w(2,n+1)+"-"+w(2,i)+"T"+w(2,s)+":"+w(2,o)+":"+w(2,l)+"."+w(3,d)+"Z",r=n=i=s=o=l=d=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function P(e){return k(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=P;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var I=function(e){var t=e.charCodeAt(0),r=$[t];return r||"\\u00"+w(2,t.toString(16))},j=/[\x00-\x1f\x22\x5c]/g,C=function(e){return j.lastIndex=0,'"'+(j.test(e)?e.replace(j,I):e)+'"'},L=function(e,t,r,n,i,a,s){var o,d,u,p,f,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=k(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==g)return o===g?o:"null";switch("object"==(d=typeof o)&&(u=_.call(o)),u||d){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 C(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw c();if(s.push(o),p=[],y=a,a+=i,"[object Array]"==u){for(h=0,v=o.length;h0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||N();e+=x("0x"+a.slice(t,D));break;default:N()}else{if(34==i)break;for(i=a.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++D);e+=a.slice(t,D)}if(34==a.charCodeAt(D))return D++,e;N();default:if(t=D,45==i&&(n=!0,i=a.charCodeAt(++D)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(D+1))>=48&&i<=57&&N(),n=!1;D=48&&i<=57;D++);if(46==a.charCodeAt(D)){for(r=++D;r57);r++);r==D&&N(),D=r}if(101==(i=a.charCodeAt(D))||69==i){for(43!=(i=a.charCodeAt(++D))&&45!=i||D++,r=D;r57);r++);r==D&&N(),D=r}return+a.slice(t,D)}n&&N();var o=a.slice(D,D+4);if("true"==o)return D+=4,!0;if("fals"==o&&101==a.charCodeAt(D+4))return D+=5,!1;if("null"==o)return D+=4,null;N()}return"$"},U=function(e){var t,r;if("$"==e&&N(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=T());)r?","==e?"]"==(e=T())&&N():N():r=!0,","==e&&N(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=T());)r?","==e?"}"==(e=T())&&N():N():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==T()||N(),t[e.slice(1)]=U(T());return t}N()}return e},R=function(e,t,r){var n=F(e,t,r);n===g?delete e[t]:e[t]=n},F=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(_,S,i);else S(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return D=0,E=""+e,r=U(T()),"$"!=T()&&N(),D=E=null,t&&"[object Function]"==_.call(t)?F(((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){e=String(e);for(var t,r,i,a,s="",o=0,l=e.length%3;o255||(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>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 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(r){logger.log(r)}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){logger.log(r)}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";_localStorage.set(t,r),_localStorage.get(t)!==r&&(e=!1),_localStorage.remove(t)}catch(n){e=!1}return e}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function getRandom(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),isObject(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(r){}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(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),n=0;n Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");for(var a in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function _URL(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=getURLSearchParams(r.search),{get:function(e){return t[e]}}));else{isString(e)||(e=String(e)),e=trim(e);if(!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");var n=urlParse(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=getURLSearchParams("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}ConcurrentStorage.prototype.get=function(e,t,r,n){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,n=n||function(){};var i=this.lockGetPrefix+e,a=_localStorage.get(i),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return n(null);_localStorage.set(i,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(i))||{randomNum:0,expireTime:0})&&a.randomNum===s?(n(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(i)):n(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,n,i){if(!e||!t)throw new Error("key and val is must");r=r||1e4,n=n||1e3,i=i||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 i({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)&&i({status:"success"}):i({status:"fail",reason:"This key is locked"})},n)},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 n=0,i=r.length;n=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+t+"-"+e();return r||(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,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()||ry(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 addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(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){logger.log(t)}}}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=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),ry(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||!isArray(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 siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return ry(e=e&&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(),n=[],i=0;i=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),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(s){logger.log(s)}r.send(e.data||null)}function map(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(each(e,function(e,n,i){r.push(t(e,n,i))}),r)}function base64Decode(e){var t=[];try{t=map(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 base64Encode(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}function bindReady(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,s=i.addEventListener,o=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",d=s?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](d+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},u=function(){try{a.doScroll("left")}catch(e){return void setTimeout(u,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!s&&a.doScroll){try{n=!t.frameElement}catch(p){logger.log(p)}n&&u()}i[o](d+"DOMContentLoaded",c,!1),i[o](d+"readystatechange",c,!1),t[o](d+"load",c,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=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,cookie.set(t,"true",0,null,r,"; domain="+a),-1!==document.cookie.indexOf(t+"=true"))return cookie.set(t,"true","-1s",null,r,"; domain="+a),a;return""}function getDomBySelector(e){if(!isString(e))return null;var t,r=e.split(">");return(t=function n(e){var t,i=r.shift();if(!i)return e;try{t=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(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(!(isElement(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l0)return null}return r||null}(i,e)}catch(a){logger.log(a)}return t&&isElement(t)?n(t):null}())&&isElement(t)?t:null}function getElementContent(e,t){var r="",n="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(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 getHostname(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=_URL(e).hostname}catch(n){logger.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}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(t){return""}}function getQueryParam(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=_decodeURIComponent(e);var r=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null===r||r&&"string"!=typeof r[1]&&r[1].length?"":_decodeURIComponent(r[1])}function getQueryParamsFromUrl(e){var t={},r=e.split("?")[1]||"";return r&&(t=getURLSearchParams("?"+r)),t}function mediaQueriesSupported(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function getScreenOrientation(){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(mediaQueriesSupported()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return 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,n=0;n0)for(var i=e.split(""),a=0;at)for(n=r+n;(o=31*n+s)t;)n=n/2+s;n=31*n+s}return n}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function isSupportCors(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(e){if(!isObject(e)||!isString(e.callbackName))return logger.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=isFunction(e.success)?e.success:function(){},e.error=isFunction(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),r=document.getElementsByTagName("head")[0],n=null,i=!1;if(r.appendChild(t),isNumber(e.timeout)&&(n=setTimeout(function(){if(i)return!1;e.error("timeout"),window[e.callbackName]=function(){logger.log("call jsonp error")},n=null,r.removeChild(t),i=!0},e.timeout)),window[e.callbackName]=function(){clearTimeout(n),n=null,e.success.apply(null,arguments),window[e.callbackName]=function(){logger.log("call jsonp error")},r.removeChild(t)},e.url.indexOf("?")>-1?e.url+="&callbackName="+e.callbackName:e.url+="?callbackName="+e.callbackName,isObject(e.data)){var a=[];each(e.data,function(e,t){a.push(t+"="+e)}),e.data=a.join("&"),e.url+="&"+e.data}t.onerror=function(a){if(i)return!1;window[e.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(n),n=null,r.removeChild(t),e.error(a),i=!0},t.src=e.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"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;addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else 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(""),n=0,i=r.length;nt?(s&&(clearTimeout(s),s=null),o=d,a=e.apply(n,i),s||(n=i=null)):s||!1===r.trailing||(s=setTimeout(l,c)),a}}function values(e){var t=[];return null==e?t:(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=[],n={},i=0;it._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_"+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(){},storeInitCheck:function(){if(sd.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else 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 n=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t&&(n=!0),addEvent(e,t,r,n)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function isBaiduTraffic(){var e=document.referrer;if(!e)return!1;try{var t=_URL(e).hostname;return t&&"baidu.com"===t.substring(t.length-"baidu.com".length)}catch(r){return!1}}EventEmitterSa.prototype={emit:function(e){var t=[].slice.call(arguments,1);each(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,r,n){isFunction(t)&&(this._events.push({type:e,callback:t,context:r||this}),n=!1!==n,this.pendingEvents.length>0&&n&&each(this.pendingEvents,function(n){n.type===e&&t.apply(r,n.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var getBaiduKeyword={data:{},id:function(){return this.data.id?this.data.id:(this.data.id=getReferrerEqid(),this.data.id)},type:function(){return this.data.type?this.data.type:(this.data.type=getReferrerEqidType(),this.data.type)}};function getReferrerEqidType(){var e=getQueryParamsFromUrl(document.referrer);if(isEmptyObject(e)||!e.eqid){var t=getQueryParamsFromUrl(location.href);return e.ck||t.utm_source?"baidu_sem_keyword_id":"baidu_other_keyword_id"}return"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)?(0!==(e=_decodeURI(e=trim(e))).indexOf("https://www.baidu.com/")||t||(e=e.split("?")[0]),isString(e=e.slice(0,sdPara.max_referrer_string_length))?e:""):"\u53d6\u503c\u5f02\u5e38_referrer\u5f02\u5e38_"+String(e)}function isReferralTraffic(e){if(""===(e=e||document.referrer))return!0;var t=getCookieTopLevelDomain(null,domain_test_key,sdPara.is_secure_cookie),r=getHostname(e);return-1===(r="."+r).indexOf(t)&&""!==t}function getKeywordFromReferrer(e,t){e=e||document.referrer;var r=sdPara.source_type.keyword;if(document&&isString(e)){if(0===e.indexOf("http")){var n=getReferSearchEngine(e),i=getQueryParamsFromUrl(e);if(isEmptyObject(i))return sdPara.preset_properties.search_keyword_baidu&&isBaiduTraffic()?void 0:"\u672a\u53d6\u5230\u503c";var a=null;for(var s in r)if(n===s&&isObject(i))if(isArray(a=r[s]))for(s=0;s-1&&r.splice(i,1),_localStorage.remove(e[n])}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);null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),r=this.generateTabStorageVal()):r=safeJSONParse(r)||this.generateTabStorageVal(),r.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=0;ti.expireTime&&this.serverUrl===i.serverUrl)new ConcurrentStorage("sajssdk-lock-get-").get(r,1e4,1e3,function(e){if(e){null===_localStorage.get(n.tabKey)&&n.generateTabStorage();var t=safeJSONParse(e)||n.generateTabStorageVal(),r=safeJSONParse(_localStorage.get(n.tabKey))||n.generateTabStorageVal();r.data=unique(r.data.concat(t.data)),_localStorage.set(n.tabKey,JSON.stringify(r))}})}else if(0===r.indexOf("sajssdk-lock-get-")){var s=safeJSONParse(_localStorage.get(r))||{expireTime:0};now()-s.expireTime>1e4&&_localStorage.remove(r)}}for(var o=0;o0)for(t=0;tsdPara.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!(indexOf(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(indexOf(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=store._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(indexOf(this.bindReservedNames,e)>-1)}},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||("Property Value",isFunction(checkLog[r])&&checkLog[r]("Property Value")),!0}},properties:function(e){return isObject(e)?each(e,function(e,t){check({propertyKey:t});check({propertyValue:e},function(e,r,n){return e||(r=t+"'s Value",isFunction(checkLog[n])&&checkLog[n](r)),!0})}):ruleOption.voidZero(e)&&sdWarn("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return e!==undefined&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdWarn("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!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 n=this[e];if(isFunction(n))return n.call(this,t);if(!n)return!1;for(var i=0;i-1;if(isObject(r)&&"$option"!==n&&!a)try{e[n]=JSON.stringify(r)}catch(s){delete e[n],sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else isString(r)||isNumber(r)||isDate(r)||isBoolean(r)||isArray(r)||isFunction(r)||"$option"===n||a||(sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete e[n])}),e):e}function formatString(e,t){return isNumber(t)&&e.length>t?(sdWarn("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function filterReservedProperties(e,t){isObject(e)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(r,n){r in e&&(indexOf(t||[],r)>-1||(n<3?(delete e[r],sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function searchObjString(e){var t=["$element_selector","$element_path"],r=["sensorsdata_app_visual_properties"];isObject(e)&&each(e,function(n,i){if(isObject(n))searchObjString(e[i]);else if(isString(n)){if(indexOf(r,i)>-1)return;e[i]=formatString(n,indexOf(t,i)>-1?1024:sdPara.max_string_length)}})}function searchZZAppStyle(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(e){if("item_type"in e){check({item_type:e.item_type},function(t){return t||delete e.item_type,!0})}if("item_id"in e){check({item_id:e.item_id},function(t,r,n){return t||"string"!==n||delete e.item_id,!0})}}function formatProperties(e,t){each(e,function(r,n){-1===indexOf(t||[],n)&&check({propertyKey:n},function(t,r,i){return t||"keyLength"===i||delete e[n],!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){var r=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(),r.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={server_url:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.server_url))return sdError("----vcollect---server_url\u5fc5\u987b\u4e3a\u6709\u6548 URL \u5b57\u7b26\u4e32"),!1;try{e=_URL(sd.para.server_url),r.server_url.project=e.searchParams.get("project")||"default",r.server_url.host=e.host}catch(n){return sdError("----vcollect---server_url\u89e3\u6790\u5f02\u5e38",n),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(n){return sdError("----vcollect---\u9875\u9762\u5730\u5740\u89e3\u6790\u5f02\u5e38",n),!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 e.$element_selector.indexOf(t.element_selector)>-1}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 e.$element_path.indexOf(t.element_path)>-1}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(e.$element_position!==undefined){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(e,t,r){var n=[];if(!r){var i=vtrackBase.initUrl();if(!i)return[];r=i.page_url}return"$WebClick"===e.event&&each(t,function(t){isObject(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&isObject(t.event)&&t.event.url_host===r.host&&t.event.url_path===r.pathname&&vtrackBase.configIsMatch(e.properties,t.event)&&n.push(t)}),n},getPropElInLi:function(e,t){if(!(e&&isElement(e)&&isString(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r=sd.heatmap.getDomSelector(e);if(r){var n=getDomBySelector(r+t);return n||null}return sdWarn("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",r,t),null},getProp:function(e,t){if(!isObject(e))return!1;if(!(isString(e.name)&&e.name.length>0))return sdWarn("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var r,n,i={};if("content"===e.method){var a;if(isString(e.element_selector)&&e.element_selector.length>0)a=getDomBySelector(e.element_selector);else{if(!t||!isString(e.list_selector))return sdWarn("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=getDomBySelector(t.properties.$element_selector);if(!s)return sdWarn("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var o=sd.heatmap.getClosestLi(s);a=vtrackBase.getPropElInLi(o,e.list_selector)}if(!a||!isElement(a))return sdWarn("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===a.tagName.toLowerCase())r=a.value||"";else if("select"===a.tagName.toLowerCase()){var l=a.selectedIndex;isNumber(l)&&isElement(a[l])&&(r=getElementContent$1(a[l],"select"))}else r=getElementContent$1(a,a.tagName.toLowerCase());if(e.regular){try{n=new RegExp(e.regular).exec(r)}catch(d){return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===n)return sdWarn("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!isArray(n)||!isString(n[0]))return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;r=n[0]}if("STRING"===e.type)i[e.name]=r;else if("NUMBER"===e.type){if(r.length<1)return sdWarn("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;if(isNaN(Number(r)))return sdWarn("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;i[e.name]=Number(r)}return i}return sdError("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},getAssignConfigs:function(e,t){var r=vtrackBase.initUrl();if(!r||!r.page_url)return[];if(!isObject(t))return[];var n=[];return t.events=t.events||t.eventList,isArray(t.events)&&t.events.length>0?(each(t.events,function(t){isObject(t)&&isObject(t.event)&&t.event.url_host===r.page_url.host&&t.event.url_path===r.page_url.pathname&&e(t)&&n.push(t)}),n):[]}},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(e){var t={},r=[],n=this;if(!this.events.length)return{};if("$WebClick"===e.event){var i=this.filterConfig(e,this.events);if(!i.length)return{};each(i,function(i){isObject(i)&&(isArray(i.properties)&&i.properties.length>0&&each(i.properties,function(r){if(isObject(r))if(!1===r.h5)isArray(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(r);else{var i=n.getProp(r,e);isObject(i)&&(t=extend(t,i))}}),isString(i.event_name)&&r.push(i.event_name))}),sd.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=r)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new sd.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(r){var n={};try{r=JSON.parse(base64Decode(r))}catch(s){sdError("getJSVisualProperties data parse error!")}if(isObject(r)){var i=r.sensorsdata_js_visual_properties,a=e.initUrl();a&&(a=a.page_url,isArray(i)&&i.length>0&&each(i,function(t){if(isObject(t)&&t.url_host===a.host&&t.url_path===a.pathname&&t.h5){var r=e.getProp(t);isObject(r)&&(n=extend(n,r))}}))}return"android"===sd.bridge.bridge_info.platform&&t.notifyApp({data:n},r.message_id),n}),t}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(base64Decode(t))}catch(r){return void sdError("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(base64Decode(e))}catch(t){e=null,sdError("getAppVisualConfig result parse error\uff01")}return e},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))return!1;for(var r=0;r0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,r){var n=this;r=r||this.filterConfig(e,t,vtrackcollect.url_info.page_url);var i={};return r.length?(each(r,function(t){isArray(t.properties)&&t.properties.length>0&&each(t.properties,function(t){var r=n.getProp(t,e);isObject(r)&&extend(i,r)})}),i):{}},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=vtrackBase.initUrl();if(e){var t;try{(t=new urlParse(sd.para.server_url))._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return sdError("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)return!1;if(_localStorage.isSupport()||(this.storageEnable=!1),!this.initUrl())return sdError("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=store.readObjectVal(this.storage_name);if(isObject(e)&&isObject(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime()-this.update_time;if(isNumber(t)&&t>0&&t0&&t-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===i&&sd.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)&&((sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1)>1||r.isCollectableDiv(n)))return n;if(r.isStyleTag(i)&&sd.para.heatmap.collect_tags.div){var o=r.getCollectableParent(n);if(o&&r.isDivLevelValid(o))return o}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var r=heatmap.getElementPath(e,!0,t).split(" > "),n=0;return each(r,function(e){"div"===e&&n++}),n},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(heatmap.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&isElement(e);){if(!isString(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){return function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&isString(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null}(e,"li")},getElementPosition:function(e,t,r){var n=sd.heatmap.getClosestLi(e);if(!n||!isElement(e)||!isString(e.tagName))return null;var i=e.tagName.toLowerCase(),a=n.getElementsByTagName(i),s=a.length,o=[];if(s>1){for(var l=0;l1)return indexOf(o,e)}return function(e){if(!e.parentNode)return"";if(1===ry(e).getSameTypeSiblings().length)return 0;for(var t=0,r=e;ry(r).previousElementSibling().ele;r=ry(r).previousElementSibling().ele,t++);return t}(n)},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),sd.para.heatmap_url||(sd.para.heatmap_url=getSafeHttpProtocol()+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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});r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);var n=sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);return isNumber(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){if(!e)return{};function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}return function(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,s=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(s)}}(e)},start:function(e,t,r,n,i){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collect_element)&&!sd.para.heatmap.collect_element(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,n,i))},getBasicEleInfo:function(e,t,r,n,i){var a=isObject(n)?n:{},s=isFunction(i)?i:isFunction(n)?n:undefined,o=this.getEleDetail(t);if(sd.para.heatmap&&sd.para.heatmap.custom_property){var l=sd.para.heatmap.custom_property(t);isObject(l)&&(o=extend(o,l))}return{event:e,target:t,props:o=extend(o,this.getPointerEventProp(e,t),a),tagName:r,callback:s}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=ry(e.element).getParents());if(r&&isArray(r)&&r.length>0)for(var i=0;i-1)&&(!t||sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collect_tags)&&isObject(sd.para.heatmap.collect_tags.div)&&isArray(sd.para.heatmap.collect_tags.div.ignore_tags)&&indexOf(sd.para.heatmap.collect_tags.div.ignore_tags,e)>-1):indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){sdError("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=sd.para&&sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){sdError("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.scroll_notice_map)return!1;var e=!0;sd.para.scrollmap&&isFunction(sd.para.scrollmap.collect_url)&&this.listenUrlChange(function(){e=!!sd.para.scrollmap.collect_url()});var t=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t}({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>sd.para.heatmap.scroll_delay_time&&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.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=n}});t.current_time=new Date,saAddEvent(window,"scroll",function(){if(!e)return!1;t.go()}),saAddEvent(window,"unload",function(){if(!e)return!1;t.go("notime")})},initHeatmap:function(){var e=this,t=!0;if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)return!1;isFunction(sd.para.heatmap.collect_url)&&this.listenUrlChange(function(){t=!!sd.para.heatmap.collect_url()}),"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(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var s=isString(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===s||"button"===s?e.start(n,i.parentNode,s):e.start(n,i,a)}):saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement,a=sd.heatmap.getTargetElement(i,r);if(!isElement(a)&&!isString(i.tagName))return!1;isElement(a)&&isString(a.tagName)?e.start(n,a,a.tagName.toLowerCase()):isElement(i)&&"div"===i.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&unlimitedDiv.events.length>0&&unlimitedDiv.isTargetEle(i)&&e.start(n,i,i.tagName.toLowerCase(),{$lib_method:"vtrack"})})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),t={};return each(e,function(e,r,n){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+r+" ")?t["$"+r]=n[r]:t[r]=n[r]}),t}function sendFirstProfile(e,t,r){if(sd.is_first_visitor&&r){var n={};sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(n.$search_keyword_id=getBaiduKeyword.id(),n.$search_keyword_id_type=getBaiduKeyword.type(),n.$search_keyword_id_hash=hashCode53(n.$search_keyword_id));var i=getReferrer(null,t);e(extend({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?getHostname(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),n)),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.setProfile(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("sensorsdata_2015_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var n in e)!(n in t&&t[n]!==e[n])&&n in t||(t[n]=e[n],r=!0);r&&(store.saveObjectVal("sensorsdata_2015_jssdk_profile",t),sd.setProfile(e))}else store.saveObjectVal("sensorsdata_2015_jssdk_profile",e),sd.setProfile(e)},setInitReferrer:function(){var e=getReferrer();sd.setOnceProfile({_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){if("object"==typeof e&&e.tagName&&isElement(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||hasAttributes(e,a)||heatmap.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();heatmap.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){var r;r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer;var n=!(e=isObject(e)?e:{}).not_set_profile;function i(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,i(e,t),this.autoTrackSinglePage=i,sendFirstProfile(sd.setOnceProfile,!1,n)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=isObject(e)?e:{};var r=getClassifiedUtms(),n=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var i=location.href;sd.para.is_single_page&&addHashEvent(function(){var n=getReferrer(i,!0);sd.track("$pageview",extend({$referrer:n,$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),i=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),sendFirstProfile(sd.setOnceProfile,!0,n),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store.getAnonymousId()},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]?e(window.SensorsDataWebJSSDKPlugin[t]):isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sdWarn(t+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function loginBody(e,t){var r=e.id,n=e.callback,i=e.name,a=store.getFirstId(),s=store.getOriginDistinctId();if(!check({distinct_id:r}))return sdError("login id is invalid"),!1;if(r===store.getOriginDistinctId()&&!a)return sdError("login id is equal to distinct_id"),!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(i)&&r===store._state.first_id)return!1;if(store._state.history_login_id.name!==i||r!==store._state.history_login_id.value){store._state.identities[i]=r,store.set("history_login_id",{name:i,value:r}),a||store.set("first_id",s),t(r,"$SignUp",{},n);var o={$identity_cookie_id:store._state.identities.$identity_cookie_id};return o[i]=r,resetIdentities(o),!0}return!1}function resetIdentities(e){var t={};for(var r in e)t[r]=e[r];store._state.identities=t,store.save()}function deleteBindIDData(e,t){if(!check({unbindKey:e,bindValue:t}))return!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t){var r=store.getUnionId().login_id;r&&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())}var n={};return n[e]=t,n}function setInitVar(){sd._t=sd._t||1*new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var n in sd.para.is_track_latest)r["latest_"+n]=sd.para.is_track_latest[n];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 i=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],o={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof sd.para.source_type&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(i):i,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(a):a,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(s):s,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(o,sd.para.source_type.keyword):o);var l=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)){sd.para.heatmap.clickmap=sd.para.heatmap.clickmap||"default",sd.para.heatmap.scroll_notice_map=sd.para.heatmap.scroll_notice_map||"default",sd.para.heatmap.scroll_delay_time=sd.para.heatmap.scroll_delay_time||4e3,sd.para.heatmap.scroll_event_duration=sd.para.heatmap.scroll_event_duration||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);var d=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),sd.para.heatmap.track_attr=d,isObject(sd.para.heatmap.collect_tags))if(!0===sd.para.heatmap.collect_tags.div)sd.para.heatmap.collect_tags.div={ignore_tags:l,max_level:1};else if(isObject(sd.para.heatmap.collect_tags.div)){if(sd.para.heatmap.collect_tags.div.ignore_tags?isArray(sd.para.heatmap.collect_tags.div.ignore_tags)||(sdWarn("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),sd.para.heatmap.collect_tags.div.ignore_tags=l):sd.para.heatmap.collect_tags.div.ignore_tags=l,sd.para.heatmap.collect_tags.div.max_level){-1===indexOf([1,2,3],sd.para.heatmap.collect_tags.div.max_level)&&(sd.para.heatmap.collect_tags.div.max_level=1)}}else sd.para.heatmap.collect_tags.div=!1;else sd.para.heatmap.collect_tags={div:!1}}sd.para.server_url=optimizeServerUrl(sd.para.server_url),!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.collect_tags&&isObject(sd.para.heatmap.collect_tags)&&each(sd.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&"default"===sd.para.heatmap.clickmap&&sd.heatmap.initUnlimitedTags()}var readyState={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},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):sdWarn("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0])}var nonameCount=1;function use(e,t){if(isString(e)||isObject(e)){var r;if(isObject(e)){var n=sd.modules&&sd.modules[e.plugin_name];n&&n!==e&&sdWarn(e.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),r=n||e}return 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.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[e]&&(r=window.sensorsDataAnalytic201505.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||sdWarn("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&sdWarn("warning: plugin version not match SDK version. plugin may not work correctly. "):sdWarn("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,r):(sdWarn((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),r)}sdError("use's first arguments must be string or object.")}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){var r=deleteBindIDData(e,t);r&&saEvent.send({identities:r,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(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void saAddEvent(e,"click",function(n){n.preventDefault();var i=!1;function a(){i||(i=!0,location.href=e.href)}setTimeout(a,1e3),sd.track(t,r,a)}))}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 setProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function setOnceProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function appendProfile(e,t){check({propertiesMust:e})&&(each(e,function(t,r){isString(t)?e[r]=[t]:isArray(t)?e[r]=t:(delete e[r],sdWarn("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),isEmptyObject(e)||saEvent.send({type:"profile_append",properties:e},t))}function incrementProfile(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!1;return!0}(e)?sdError("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"):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,n={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?n[e]=!0:sdWarn("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),saEvent.send({type:"profile_unset",properties:n},t)):sdError("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function identify(e){"number"==typeof e&&(e=String(e));var t=store.getFirstId();if(void 0===e){var r=UUID();t?store.set("first_id",r):store.set("distinct_id",r)}else check({distinct_id:e})&&(t?store.set("first_id",e):store.set("distinct_id",e))}function resetAnonymousIdentity(e){if(store.getFirstId())return sdError("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),void 0===e){var t=UUID();store._state.identities.$identity_cookie_id=t,store.set("distinct_id",t)}else check({distinct_id:e})&&(store._state.identities.$identity_cookie_id=e,store.set("distinct_id",e))}function sendSignup(e,t,r,n){var i=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:i,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function trackSignup(e,t,r,n){"number"==typeof e&&(e=String(e)),check({distinct_id:e,event:t,properties:r})&&sendSignup(e,t,r,n)}function registerPage(e){check({properties:e})?extend(pageInfo.currentProps,e):sdError("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){var t;if(isArray(e)&&e.length>0)for(t=0;t-1?n:"https:")+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/vapph5define.min.js"})}else r();else r()}function listenSinglePage(e){sd.para.is_track_single_page&&spa.on("switch",function(t){var r=function(r){if(r=r||{},t!==location.href){pageInfo.pageProp.referrer=getURL(t);var n=extend({$url:getURL(),$referrer:getURL(t)},r);isFunction(e)?e(n):sd.quick&&sd.quick("autoTrack",n)}};if("boolean"==typeof sd.para.is_track_single_page)r();else if("function"==typeof sd.para.is_track_single_page){var n=sd.para.is_track_single_page();isObject(n)?r(n):!0===n&&r()}})}function enterFullTrack(){sd._q&&isArray(sd._q)&&sd._q.length>0&&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","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","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=[]),sdWarn("calling sdk api before init is deprecated."),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);sdError("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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 n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},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)&&r.length>0)for(var n={current:0,total:r.length},i=new InterceptorContext(t,n,sd),a=0;a=2)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="1.26.9";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return"dfm-enc-"+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf("dfm-enc-")&&(e=e.substring("dfm-enc-".length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="1.26.9";function wrapPluginInitFn$1(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$1(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$1(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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 t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),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="1.26.9";function wrapPluginInitFn$2(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$2(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$2(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(),log("---test---fail---",!sd$1,sd$1.bridge.activeBridge,!anServerUrl),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),log("---test---bridge-verify-",sd$1.bridge.is_verify_success)),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("---test---app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){if(log("---test---datasend-",sd$1.bridge.is_verify_success),sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$1.bridge.is_verify_success?(log("---test---bridge-verify-success---",e.data),anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({server_url:sd$1.para.server_url},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(log("---test---bridge-verify-fail-----",sd$1.bridge.is_verify_success),sd$1.para.app_js_bridge.is_send?(sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_$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="1.26.9";function wrapPluginInitFn$3(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$3(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$3(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(){if(log$1("ObsoleteBridge---test---init---"),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,log$1("ObsoleteBridge-",sd$2.bridge.activeBridge,anVerify,anTrack$1,anVisualVerify),sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)){sd$2.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack$1;anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({server_url:sd$2.para.server_url})),log$1("ObsoleteBridge---called-return",e)),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){if(log$1("ObsoleteBridge---senddata"),sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(anVerify){var n=anVerify&&anVerify.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data)));return log$1("ObsoleteBridge---anVerify-success",n),n?(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$2.para.app_js_bridge.is_send?(sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return log$1("ObsoleteBridge---is-send-old-way",sd$2.para.app_js_bridge.is_send),anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function handleCommand$1(e){log$1("ObsoleteBridge---handleCommadn");var t=e.callType;return t in vbridge$1$1.commands?(log$1("ObsoleteBridge---",t,vbridge$1$1.commands),vbridge$1$1.commands[t](e,anBridge$1)):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?(log$1("ObsoleteBridge---handleCommadn-abridge"),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="1.26.9";function wrapPluginInitFn$4(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$4(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$4(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var hidden,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||"sensorsdata2015jssdkchannel",sd$3=e;var r=this;!function(){if(_$3=sd$3._,store$1=sd$3.store,!_$3.localStorage.isSupport())return!1;sd$3.para.max_string_length=1024,r.eventList.init(),r.addLatestChannelUrl(),r.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd$3.registerPage({$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();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_$3.isReferralTraffic(document.referrer)){var r=_$3.getQueryParam(location.href,"sat_cf");_$3.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd$3.registerPage(t):sd$3.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd$3.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name));return e=_$3.safeJSONParse(e),!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);sd$3.para.encrypt_cookie&&(r=sd$3.kit.userEncrypt(r)),_$3.cookie.set(cookie_name,r)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$5(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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"undefined"!=typeof document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var iosServerUrl,iosTracker,sd$4,_$4,log$2,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){var t=e._.URL(e.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},handleAndroidLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=t;e.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,e.timer=setTimeout(function(){var t=isPageHidden();if(e.log("hide:"+hidden+":"+document[hidden]),t)return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=r},e.timeout)},handleIOSLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 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\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),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){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=e,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&isObject$1(arguments[0])?t=arguments[0]:arguments.length>=2&&isObject$1(arguments[1])&&(t=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=parseShortURL(n);if(!i)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f 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,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="1.26.9";function wrapPluginInitFn$6(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$6(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$6(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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){if(sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({server_url:sd$4.para.server_url},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$4.para.app_js_bridge.is_send?(sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_$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="1.26.9";function wrapPluginInitFn$7(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$7(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$7(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=_$5.URL(sd$5.para.server_url).hostname,r=_$5.URL(sd$5.para.server_url).searchParams.get("project")||"default"}catch(n){sd$5.log(n)}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)return e;var r,n,i=e.callback;if(sd$5.bridge.bridge_info.verify_success){var a=document.createElement("iframe"),s=(r=e.data,n=(n=JSON.stringify(_$5.extend({server_url:sd$5.para.server_url},r))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return a.setAttribute("src",s),document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null,_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),!0}return sd$5.para.app_js_bridge.is_send?(sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),e)}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="1.26.9";function wrapPluginInitFn$8(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$8(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$8(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}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\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},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(){if(!0!==this.page_hidden_status){var 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 e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.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;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},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;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var r=this.sd.store.readObjectVal(t);this._.isObject(r)&&1*new Date-r.time>r.heartbeat_interval_time+5e3&&(delete r.heartbeat_interval_time,r._flush_time=(new Date).getTime(),this.sd.kit.sendData(r),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="1.26.9";function wrapPluginInitFn$9(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$9(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$9(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){function r(){var n=0,i=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,a={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(i?(n=function(t){var r=0;return e._.isFunction(t.getEntriesByType)&&(r=((t.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),r}(i)||function(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}(i),function(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}(i,a)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),n>0){var s=e._.isObject(t)&&t.max_duration||1800;n=Number((n/1e3).toFixed(3)),(!e._.isNumber(s)||s<=0||n<=s)&&(a.event_duration=n)}eventSent||(e.track("$WebPageLoad",a),eventSent=!0),window.removeEventListener?window.removeEventListener("load",r):window.detachEvent&&window.detachEvent("onload",r)}"complete"==document.readyState?r():window.addEventListener?window.addEventListener("load",r):window.attachEvent&&window.attachEvent("onload",r)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),s=t.customRegister,o=a.properties,l=a.event,d={};return n.each(s,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(d=n.extend(d,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:o,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(d=n.extend(d,t))}}),e.properties=n.extend(o,d),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder$b="1.26.9";function wrapPluginInitFn$a(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$a(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$a(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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="1.26.9";function wrapPluginInitFn$b(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$b(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$b(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(i){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}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 \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="1.26.9";function wrapPluginInitFn$c(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$c(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$c(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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-1)return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r-1)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=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),i="";if(n){var a,s=n[1]||"",o=n[2]||"",l=n[3]||"",d="_sasdk="+this.getCurrenId(),c=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(d):n.push(e)}),n.join("&")};if(this.getPartHash(e))a=l.indexOf("_sasdk"),i=l.indexOf("?")>-1?a>-1?s+o+"#"+l.substring(1,a)+c(l.substring(a,l.length)):s+o+l+"&"+d:s+o+"#"+l.substring(1)+"?"+d;else a=o.indexOf("_sasdk"),i=/^\?(\w)+/.test(o)?a>-1?s+"?"+c(o.substring(1))+l:s+o+"&"+d+l:s+"?"+d+l;return t&&(t.href=i),i}},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},setRefferId:function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);(r=r.substring(1))!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},addListen:function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),s=i.parentNode;if("a"===a&&i.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===a&&i.href?(r=i.href,n=i):(r=s.href,n=s);var o=e._.URL(r).protocol;"http:"!==o&&"https:"!==o||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},init:function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var r=t.length,n=[],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$d(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(){return function(){var e=source_channel_standard$1.split(" "),t="",r={};sd$6._.isArray(sd$6.para.source_channel)&&sd$6.para.source_channel.length>0&&(e=e.concat(sd$6.para.source_channel),e=sd$6._.unique(e));return 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="1.26.9";function wrapPluginInitFn$e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$e(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$e(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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="1.26.9";function wrapPluginInitFn$f(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$f(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$f(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData$4(e,t){if(!0===sd$8.para.debug_mode){var r=e.data;e.callback;debugPath(JSON.stringify(r)),t.cancellationToken.stop()}return 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.server_url)?sd$8.para.debug_mode_url=sd$8.para.server_url.replace("sa.gif","debug"):_$6.isArray(sd$8.para.server_url)&&_$6.isString(sd$8.para.server_url[0])?sd$8.para.debug_mode_url=sd$8.para.server_url[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="1.26.9";function wrapPluginInitFn$g(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$g(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$g(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){if(_$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()}return 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){if(!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData){sd$9.para.jsapp.isOnline=!0;var t=sd$9.para.jsapp.getData();_$7.isArray(t)&&t.length>0&&_$7.each(t,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})}else 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="1.26.9";function wrapPluginInitFn$h(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$h(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$h(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$i(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){var r=null,n=null;if(_$9.isObject(e.config)&&(r=e.config.send_type,n=_$9.optimizeServerUrl(e.config.server_url)),("beacon"===r||!r&&"beacon"===sd$b.para.send_type)&&_$9.isSupportBeaconSend()){var i=n||e.server_url;e.server_url=i,e.data=sd$b.kit.encodeTrackData(e.data),_$9.isArray(i)&&i.length?_$9.each(i,function(t){e.callback=null,e.server_url=t,sendData$7(e)}):"string"==typeof i&&""!==i?sendData$7(e):sd$b.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$3(){"beacon"!==sd$b.para.send_type||_$9.isSupportBeaconSend()||(sd$b.para.send_type="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="1.26.9";function wrapPluginInitFn$j(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$j(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$j(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){var r=null,n=null;if(_$a.isObject(e.config)&&(r=e.config.send_type,n=_$a.optimizeServerUrl(e.config.server_url)),("ajax"===r||!r&&"ajax"===sd$c.para.send_type)&&_$a.isSupportCors()){var i=n||e.server_url;e.server_url=i,e.data=sd$c.kit.encodeTrackData(e.data),_$a.isArray(i)&&i.length?_$a.each(i,function(t){e.callback=null,e.server_url=t,sendData$8(e)}):"string"==typeof i&&""!==i?sendData$8(e):sd$c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$4(){"ajax"!==sd$c.para.send_type||_$a.isSupportCors()||(sd$c.para.send_type="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="1.26.9";function wrapPluginInitFn$k(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$k(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$k(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){var r=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+r:e+"?"+r}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(e,t){var r=null;_$b.isObject(e.config)&&(r=_$b.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,_$b.isArray(n)&&n.length?_$b.each(n,function(t){t&&(e.data=getSendUrl(t,i),e.callback=null,e.server_url=t,sendData$9(e))}):"string"==typeof n&&""!==n?(e.data=getSendUrl(n,i),sendData$9(e)):sd$d.logger&&sd$d.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.send_type&&"ajax"!==sd$d.para.send_type&&"beacon"!==sd$d.para.send_type&&(sd$d.para.send_type="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}})})}var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender);function wrapPluginInitFn$l(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$l(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$l(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$l(e,t,r){return wrapPluginInitFn$l(e,t,r),e.plugin_version=sdkversion_placeholder,e}var _sd$1=null,_$c=null,_cacheLogs=[],ConsoleLogger={init:function(e){e&&(_$c=(_sd$1=e)._,_sd$1.logger&&_sd$1.logger.appendWriter(logWriter),_sd$1.on&&_sd$1.on("sdkAfterInitPara",function(){for(var e=0;e<_cacheLogs.length;e++)printLog(_cacheLogs[e]);_cacheLogs=null}),_sd$1.on&&_sd$1.on("sdkInitAPI",function(){_sd$1.enableLocalLog=enableLocalLog,_sd$1.disableLocalLog=disableLocalLog}))}},consoleLogger=createPlugin$l(ConsoleLogger,"ConsoleLogger");function logWriter(e){null!==_cacheLogs?_cacheLogs.push(e):printLog(e)}function printLog(e){try{if("log"===e.level&&canLog())return void writeLog(e);if("warn"===e.level&&canWarn())return void writeLog(e);if("error"===e.level&&canError())return void writeLog(e)}catch(t){}}function canLog(){return!!isLocalLogEnabled()||(!0===_sd$1.para.show_log||_$c.isObject(_sd$1.para.show_log)&&"log"===_sd$1.para.show_log.level)}function canWarn(){return!!isLocalLogEnabled()||(canLog()||_$c.isObject(_sd$1.para.show_log)&&"warn"===_sd$1.para.show_log.level)}function canError(){return!!isLocalLogEnabled()||(!_$c.isObject(_sd$1.para.show_log)||"none"!==_sd$1.para.show_log.level)}function writeLog(e){var t=e.content,r=_$c.isObject(t[0])?_$c.formatJsonString(t[0]):t[0],n=getLogHead(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(_$c.isFunction(console[e.level])?console[e.level].apply(console,t):_$c.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function getLogHead(e){var t="",r="",n=_sd$1.para.show_log;return _$c.isObject(n)&&!1===n.show_brand||(t+=e.brand),_$c.isObject(n)&&!1===n.show_level||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),_$c.isObject(n)&&!1===n.show_module||(r=e.module),t+r}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _$c.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}sd.modules=sd.modules||{};for(var builtinPlugins=[consoleLogger,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=[consoleLogger,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=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$m(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$m(e,t,r){return wrapPluginInitFn$m(e,t,r),e.plugin_version=sdkversion_placeholder$m,e}var sd$f,utmKeys=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],ChannelUtm={init:function(e){e&&!sd$f&&((sd$f=e)._.each(utmKeys,function(e){sd$f.source_channel_standard=sd$f.source_channel_standard+" "+e,sd$f.para.source_type.utm.push(e)}),sd$f.registerInterceptor("businessStage",{getUtmData:{entry:function(e){var t=!1,r=e||{};return sd$f._.each(utmKeys,function(e){var n=sd$f._.getQueryParam(location.href,e);n.length&&(t=!0,r[e.slice(8)]=n)}),t&&sd$f.register&&sd$f.register({link_v:"1"}),r}}}))}},index$l=createPlugin$m(ChannelUtm,"ChannelUtm","sdkAfterInitPara");sd$e.use(index$4),sd$e.use(index$l);export default sd$e; \ No newline at end of file diff --git a/dist/sat/sensorsdata-sat.js b/dist/sat/sensorsdata-sat.js index bedd8dad..58a8716d 100644 --- a/dist/sat/sensorsdata-sat.js +++ b/dist/sat/sensorsdata-sat.js @@ -1,6 +1,6 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():t()}(this,function(){function e(e){if(!e)return!1;var t=Object.prototype.toString.call(e);return"[object Function]"==t||"[object AsyncFunction]"==t}function t(){return Date.now&&e(Date.now)?Date.now():(new Date).getTime()}function r(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}function n(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),r(e)&&e.getRandomValues){var t=new Uint32Array(1),n=e.getRandomValues(t)[0],i=Math.pow(2,32);return n/i}}return Yi(1e19)/1e19}function i(e){var t=null;try{t=JSON.parse(e)}catch(r){}return t}function a(e,t){this.lockGetPrefix=e||"lock-get-prefix",this.lockSetPrefix=t||"lock-set-prefix"}function s(e){return"function"==typeof e||!(!e||"object"!=typeof e)&&s(e.listener)}function l(){this._events={}}function u(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function c(e){e=e||"";for(var t={},r=e.substring(1),n=r.split("&"),i=0;i Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("https://www.sensorsdata.cn/"),"https://www.sensorsdata.cn/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{d(e)||(e=String(e)),e=p(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void Gi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new ta(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement||a.target;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(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){Gi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(na&&e.forEach===na)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText),i.status):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){Gi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(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 j(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}function I(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(p){Gi.log(p)}n&&d()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function T(e){return k(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 A(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function D(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,document.cookie.indexOf(t+"=true")!==-1){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function J(e){function t(e,t){e=p(e);var r;if("body"===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 o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){Gi.log(o)}return i&&_(i)?r(i):null}if(!d(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=p(e.textContent):e.innerText&&(r=p(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 q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){Gi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function V(e,t){var r=g(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i){var a=F(i);n=a[t]||""}}return n}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){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(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){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 Z(e){return d(e)?(e=p(e),A(e)):A(location.href)}function G(e){return d(e)?(e=p(e),A(e)):A(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function pe(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!d(t.callbackName))return Gi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(n.defer="defer",i.appendChild(n),ce(t.timeout)){var s=Math.min(t.timeout,3e5);a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){Gi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},s)}if(window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){Gi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var l=[];k(t.data,function(e,t){l.push(t+"="+e)}),t.data=l.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){Gi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=encodeURI(t.url)}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.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;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.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 he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,d)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else d(i)||ce(i)||$(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function it(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function at(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function ot(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))ot(e[a]);else if(d(i)){if(re(n,a)>-1)return;e[a]=it(i,re(t,a)>-1?1024:_a.max_string_length)}})}function st(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function lt(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};rt({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};rt({item_id:n},i)}}function ut(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&rt({propertyKey:n},i)})}function ct(e){var t=e.properties;ye(e),r(t)?(nt(t),at(t),st(e),ut(t),ot(t)):"properties"in e&&(e.properties={}),lt(e)}function dt(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function pt(e,t){try{var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,Ua.getIdentities());var a={identities:i,distinct_id:Ua.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,Ua.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),"$UnbindID"===a.event&&(a.login_id&&delete a.login_id,a.anonymous_id&&delete a.anonymous_id),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},Pa.properties(),Ua.getProps(),Ua.getSessionProps(),Pa.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!d(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!d(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&d(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&d(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!d(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!d(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!d(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),d(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&$(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=qa.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=Va.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),Oa.checkIsAddSign(a),Oa.checkIsFirstTime(a),Fe(a),Ve(a),a}catch(o){return{_debug_web_msg:String(o)}}}function ft(e){return za.stage.process("basicProps",e)}function gt(e){return za.stage.process("formatData",e)}function _t(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&Be(e.ele,"click",function(e){i(e)}))))}function ht(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function mt(e){return Za.stage.process("webClickEvent",e)}function vt(e){return Za.stage.process("webStayEvent",e)}function yt(){var e=Pa.campaignParams(),t={};return k(e,function(e,r,n){(" "+Xi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function bt(e,t,r){if(Xi.is_first_visitor&&r){var n={};Xi.para.preset_properties.search_keyword_baidu&&xe(document.referrer)&&Te()&&(n.$search_keyword_id=Sa.id(),n.$search_keyword_id_type=Sa.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=$e(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:d(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:d(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:He(),$first_search_keyword:Ee()},yt(),n)),Xi.is_first_visitor=!1}}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=Ua.getFirstId(),s=Ua.getOriginDistinctId();if(!rt({distinct_id:n}))return je("login id is invalid"),!1;if(n===Ua.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"), -!1;if(r(Ua._state.identities)&&Ua._state.identities.hasOwnProperty(a)&&n===Ua._state.first_id)return!1;var l=Ua._state.history_login_id.name!==a||n!==Ua._state.history_login_id.value;if(l){Ua._state.identities[a]=n,Ua.set("history_login_id",{name:a,value:n}),o||Ua.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:Ua._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];Ua._state.identities=t,Ua.save()}function kt(e,t){if(!rt({unbindKey:e,bindValue:t}))return!1;if(r(Ua._state.identities)&&Ua._state.identities.hasOwnProperty(e)&&Ua._state.identities[e]===t){var n=Ua.getUnionId().login_id;n&&e+"+"+t===n&&(Ua._state.distinct_id=Ua._state.first_id,Ua._state.first_id="",Ua.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete Ua._state.identities[e],Ua.save())}var i={};return i[e]=t,i}function Pt(){Xi._t=Xi._t||1*new Date,Xi.is_first_visitor=!1,Xi.source_channel_standard=ma}function Ct(e){P(_a,e||Xi.para||{}),Xi.para=_a;var t={};if(r(Xi.para.is_track_latest))for(var n in Xi.para.is_track_latest)t["latest_"+n]=Xi.para.is_track_latest[n];Xi.para.preset_properties=P({},ha.preset_properties,t,Xi.para.preset_properties||{});var i;for(i in ha)void 0===Xi.para[i]&&(Xi.para[i]=ha[i]);"string"!=typeof Xi.para.web_url||"://"!==Xi.para.web_url.slice(0,3)&&"//"!==Xi.para.web_url.slice(0,2)||("://"===Xi.para.web_url.slice(0,3)?Xi.para.web_url=location.protocol.slice(0,-1)+Xi.para.web_url:Xi.para.web_url=location.protocol+Xi.para.web_url),ka.protocol.serverUrl(),Xi.bridge&&Xi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Xi.para.source_type&&(Xi.para.source_type.utm=v(Xi.para.source_type.utm)?Xi.para.source_type.utm.concat(a):a,Xi.para.source_type.search=v(Xi.para.source_type.search)?Xi.para.source_type.search.concat(o):o,Xi.para.source_type.social=v(Xi.para.source_type.social)?Xi.para.source_type.social.concat(s):s,Xi.para.source_type.keyword=r(Xi.para.source_type.keyword)?P(l,Xi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Xi.para.heatmap&&!r(Xi.para.heatmap)&&(Xi.para.heatmap={}),r(Xi.para.heatmap)){Xi.para.heatmap.clickmap=Xi.para.heatmap.clickmap||"default",Xi.para.heatmap.scroll_notice_map=Xi.para.heatmap.scroll_notice_map||"default",Xi.para.heatmap.scroll_delay_time=Xi.para.heatmap.scroll_delay_time||4e3,Xi.para.heatmap.scroll_event_duration=Xi.para.heatmap.scroll_event_duration||18e3,Xi.para.heatmap.renderRefreshTime=Xi.para.heatmap.renderRefreshTime||1e3,Xi.para.heatmap.loadTimeout=Xi.para.heatmap.loadTimeout||1e3,Xi.para.heatmap.get_vtrack_config!==!0&&(Xi.para.heatmap.get_vtrack_config=!1);var d=v(Xi.para.heatmap.track_attr)?U(Xi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),Xi.para.heatmap.track_attr=d,r(Xi.para.heatmap.collect_tags))if(Xi.para.heatmap.collect_tags.div===!0)Xi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Xi.para.heatmap.collect_tags.div)){if(Xi.para.heatmap.collect_tags.div.ignore_tags?v(Xi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Xi.para.heatmap.collect_tags.div.ignore_tags=c):Xi.para.heatmap.collect_tags.div.ignore_tags=c,Xi.para.heatmap.collect_tags.div.max_level){var p=[1,2,3];re(p,Xi.para.heatmap.collect_tags.div.max_level)===-1&&(Xi.para.heatmap.collect_tags.div.max_level=1)}}else Xi.para.heatmap.collect_tags.div=!1;else Xi.para.heatmap.collect_tags=u}Xi.para.server_url=Ge(Xi.para.server_url),Xi.para.noCache===!0?Xi.para.noCache="?"+(new Date).getTime():Xi.para.noCache="",Xi.para.callback_timeout>Xi.para.datasend_timeout&&(Xi.para.datasend_timeout=Xi.para.callback_timeout),Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&r(Xi.para.heatmap.collect_tags)&&k(Xi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Xi.heatmap.otherTags.push(t)}),Xi.para.heatmap&&"default"===Xi.para.heatmap.clickmap&&Xi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Ya[t]?Ya[t].apply(Ya,r):void("function"==typeof t?t.apply(Xi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Xi,n),a.plugin_is_init=!0,Xi.modules=Xi.modules||{},Xi.modules[a.plugin_name||"unnamed_"+to++]=a,a}if(!d(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Xi.modules&&Xi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return d(t)&&(r(Xi.modules)&&r(Xi.modules[t])?a=Xi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Xi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){rt({event:e,properties:t})&&Xa.send({type:"track",event:e,properties:t},r)}function It(e,t){return!!rt({bindKey:e,bindValue:t})&&(Ua._state.identities[e]=t,Ua.save(),void Xa.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function Tt(e,t){var r=kt(e,t);r&&Xa.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function At(e,t,r){"object"==typeof e&&e.tagName?_t({ele:e},t,r,Xi.track):"object"==typeof e&&e.target&&e.event&&_t(e,t,r,Xi.track)}function Dt(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void Be(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Xi.track(t,r,i)}))}function $t(e,t,r){rt({item_type:e,item_id:t,properties:r})&&Xa.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){rt({item_type:e,item_id:t})&&Xa.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){rt({propertiesMust:e})&&Xa.send({type:"profile_set",properties:e},t)}function Lt(e,t){rt({propertiesMust:e})&&Xa.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){rt({propertiesMust:e})&&(k(e,function(t,r){d(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Xa.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;d(e)&&(e={},e[n]=1),rt({propertiesMust:e})&&(r(e)?Xa.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Bt(e){Xa.send({type:"profile_delete"},e),Ua.set("distinct_id",ea()),Ua.set("first_id","")}function Ht(e,t){var r=e,n={};d(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){d(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Xa.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e){"number"==typeof e&&(e=String(e));var t=Ua.getFirstId();if("undefined"==typeof e){var r=ea();t?Ua.set("first_id",r):Ua.set("distinct_id",r)}else rt({distinct_id:e})&&(t?Ua.set("first_id",e):Ua.set("distinct_id",e))}function Mt(e){var t=Ua.getFirstId();if(t)return je("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),"undefined"==typeof e){var r=ea();Ua._state.identities.$identity_cookie_id=r,Ua.set("distinct_id",r)}else rt({distinct_id:e})&&(Ua._state.identities.$identity_cookie_id=e,Ua.set("distinct_id",e))}function qt(e,t,r,n){var i=Ua.getFirstId()||Ua.getDistinctId();Ua.set("distinct_id",e),Xa.send({original_id:i,distinct_id:Ua.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function Kt(e,t,r,n){"number"==typeof e&&(e=String(e)),rt({distinct_id:e,event:t,properties:r})&&qt(e,t,r,n)}function Ft(e){rt({properties:e})?P(Pa.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Vt(e){Ua.clearAllProps(e)}function Wt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Xi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Xi.lib_version+"/vapph5define.min.js"})}else t();else t()}function cr(t){Xi.para.is_track_single_page&&Ia.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){Pa.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Xi.quick&&Xi.quick("autoTrack",i)}};if("boolean"==typeof Xi.para.is_track_single_page)i();else if("function"==typeof Xi.para.is_track_single_page){var a=Xi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function dr(){Xi._q&&v(Xi._q)&&Xi._q.length>0&&k(Xi._q,function(e){Xi[e[0]].apply(Xi,Array.prototype.slice.call(e[1]))}),r(Xi.para.heatmap)&&(Qa.initHeatmap(),Qa.initScrollmap())}function pr(){Xi.readyState.setState(3),new Xi.SDKJSBridge("visualized").onAppNotify(function(){ur("undefined"!=typeof sa_jssdk_app_define_mode?!0:!1)}),ur(!1),Xi.bridge.app_js_bridge_v1(),Pa.initPage(),cr(),Ua.init(),sr(),gr(),Xi.readyState.setState(4),dr()}function fr(){ao.isSeachHasKeyword()?ao.hasKeywordHandle():window.parent!==self&&oo.isSearchHasKeyword()?oo.verifyVtrackMode():ao.isWindowNameHasKeyword()?ao.windowNameHasKeywordHandle():ao.isStorageHasKeyword()?ao.storageHasKeywordHandle():window.parent!==self&&oo.isStorageHasKeyword()?oo.verifyVtrackMode():(pr(),oo.notifyUser())}function gr(){Va.init(),"success"===Xi.bridge.bridge_info.verify_success&&qa.init()}function _r(){k(so,function(t){var r=Xi[t];Xi[t]=function(){if(Xi.readyState.state<3)return v(Xi._q)||(Xi._q=[]),Ne("calling sdk api before init is deprecated."),Xi._q.push([t,arguments]),!1;if(!e(Xi.getDisabled)||!Xi.getDisabled())return Xi.readyState.getState()?r.apply(Xi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function hr(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 mr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new hr,this.sensors=r}function vr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function yr(e){e&&e.buildDataStage&&co.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&_o.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&fo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&mo.registerStageImplementation(e.viewStage)}function br(e,t){vo[e]&&vo[e](t)}function wr(){return yo.stage&&yo.stage.process("getUtmData")}function Sr(e){return bo.stage.process("send",e)}function kr(e){e.kit=wo,e.saEvent=Xa,this.buildDataStage=za,this.sendDataStage=bo,this.businessStage=yo}function Pr(e){e.heatmap=Qa,this.viewStage=Za}function Cr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};br("buildDataStage",r)}function Or(e){e&&(Xi.events=La,Xi.bridge=io,Xi.SDKJSBridge=nr,Xi.JSBridge=or,Xi.store=Ua,Xi.unlimitedDiv=Ka,Xi.customProp=Fa,Xi.vtrackcollect=Va,Xi.vapph5collect=qa,Xi.detectMode=fr,Xi.registerFeature=yr,Xi.registerInterceptor=br,Xi.commonWays=Ya,yr(new kr(Xi)),yr(new Pr(Xi)),br("viewStage",So));var t=e?ro:lo;for(var r in t)Xi[r]=t[r];Xi.logger=ga,Xi.log=Oe,Xi._=no,Xi.on=et,Xi.ee=ja,Xi.use=Nt,Xi.lib_version=va,Xi.registerPropertyPlugin=Cr}function Nr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ir(e,t,r){return Nr(e,t,r),e.plugin_version=qo,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ar(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ar(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dr(e,t,r){return Tr(e,t,r),e.plugin_version=Vo,e}function $r(e){return Go&&Go.call(Xo,JSON.stringify(e))}function xr(e){return Zo.call(Xo)&&Qo&&Qo.call(Xo,JSON.stringify(e))}function Er(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Lr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ur(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ur(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rr(e,t,r){return Lr(e,t,r),e.plugin_version=es,e}function Br(){if(Co=window.SensorsData_APP_New_H5_Bridge,Oo=Co&&Co.sensorsdata_track,No=Oo&&Co.sensorsdata_get_server_url&&Co.sensorsdata_get_server_url(),To("---test---fail---",!jo,jo.bridge.activeBridge,!No),jo&&!jo.bridge.activeBridge&&No)return jo.bridge.activeBridge=ts,jo.para.app_js_bridge&&!jo.para.app_js_bridge.is_mui&&(jo.bridge.is_verify_success=No&&jo.bridge.validateAppUrl(No),To("---test---bridge-verify-",jo.bridge.is_verify_success)),jo.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:jo.bridge.is_verify_success?"success":"fail",support_two_way_call:!!Co.sensorsdata_js_call_app},jo.para.app_js_bridge?void jo.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}):void To("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function Hr(e,t){if(To("---test---datasend-",jo.bridge.is_verify_success),jo.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return jo.bridge.is_verify_success?(To("---test---bridge-verify-success---",e.data),Oo&&Oo.call(Co,JSON.stringify(Io.extend({server_url:jo.para.server_url},e.data))),Io.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(To("---test---bridge-verify-fail-----",jo.bridge.is_verify_success),jo.para.app_js_bridge.is_send?(jo.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Io.isFunction(r)&&r(),t.cancellationToken.cancel(),e))}function Jr(e){var t=e.callType;return t in Yo.commands?Yo.commands[t](e,Co):void(Co&&Io.isFunction(Co.sensorsdata_js_call_app)&&Co.sensorsdata_js_call_app(JSON.stringify(e)))}function Mr(e){return as&&as.call(ns,JSON.stringify(e))}function qr(e){return is.call(ns)&&os&&os.call(ns,JSON.stringify(e))}function Kr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Fr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wr(e,t,r){return Fr(e,t,r),e.plugin_version=ls,e}function zr(){if(Uo("ObsoleteBridge---test---init---"),Ao=window.SensorsData_APP_JS_Bridge,Do=Ao&&Ao.sensorsdata_track,$o=Ao&&Ao.sensorsdata_verify,xo=Ao&&Ao.sensorsdata_visual_verify,Uo("ObsoleteBridge-",Eo.bridge.activeBridge,$o,Do,xo),Eo&&!Eo.bridge.activeBridge&&($o||Do||xo)){Eo.bridge.activeBridge=us;var e=$o||Do;if(xo&&(e=!!xo.call(Ao,JSON.stringify({server_url:Eo.para.server_url})),Uo("ObsoleteBridge---called-return",e)),Eo.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Eo.para.app_js_bridge)return void Uo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Eo.registerInterceptor("sendDataStage",{send:{priority:80,entry:Xr}}),Uo("Android obsolete bridge inits succeed.")}}function Xr(e,t){if(Uo("ObsoleteBridge---senddata"),Eo.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if($o){var n=$o&&$o.call(Ao,JSON.stringify(Lo.extend({server_url:Eo.para.server_url},e.data)));return Uo("ObsoleteBridge---anVerify-success",n),n?(Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Eo.para.app_js_bridge.is_send?(Eo.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return Uo("ObsoleteBridge---is-send-old-way",Eo.para.app_js_bridge.is_send),Do&&Do.call(Ao,JSON.stringify(Lo.extend({server_url:Eo.para.server_url},e.data))),Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Zr(e){Uo("ObsoleteBridge---handleCommadn");var t=e.callType;return t in ss.commands?(Uo("ObsoleteBridge---",t,ss.commands),ss.commands[t](e,Ao)):Ao&&Lo.isFunction(Ao.sensorsdata_js_call_app)?(Uo("ObsoleteBridge---handleCommadn-abridge"),Ao.sensorsdata_js_call_app(JSON.stringify(e))):void 0}function Gr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Qr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Qr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Yr(e,t,r){return Gr(e,t,r),e.plugin_version=ds,e}function en(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return tn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function tn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function rn(e,t,r){return en(e,t,r),e.plugin_version=gs,e}function nn(){return"undefined"!=typeof Mo&&document[Mo]}function an(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return on(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function on(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function sn(e,t,r){return an(e,t,r),e.plugin_version=Es,e}function ln(){if(hs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,ms=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},vs&&!vs.bridge.activeBridge&&ms()&&ms().postMessage){if(vs.bridge.activeBridge=Ls,vs.para.app_js_bridge&&!vs.para.app_js_bridge.is_mui&&(vs.bridge.is_verify_success=hs&&vs.bridge.validateAppUrl(hs)),vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:vs.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:70,entry:un}}),bs("IOS bridge inits succeed.")}}function un(e,t){if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return vs.bridge.is_verify_success?(ms()&&ms().postMessage(JSON.stringify({callType:"app_h5_track",data:ys.extend({server_url:vs.para.server_url},e.data)})),ys.isFunction(r)&&r(),t.cancellationToken.cancel(),e):vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(ys.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function cn(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||vs.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?ys.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:ms()&&ms().postMessage(JSON.stringify(e)):null}function dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fn(e,t,r){return dn(e,t,r),e.plugin_version=Rs,e}function gn(){if(ws&&!ws.bridge.activeBridge&&_n()){if(ws.bridge.activeBridge=Bs,ws.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:hn()?"success":"fail"},!ws.para.app_js_bridge)return void ks("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");ws.registerInterceptor("sendDataStage",{send:{priority:90,entry:mn}}),ks("IOS obsolete bridge inits succeed.")}}function _n(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function hn(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=Ss.URL(ws.para.server_url).hostname,r=Ss.URL(ws.para.server_url).searchParams.get("project")||"default"}catch(n){ws.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function mn(e,t){function r(e){var t=JSON.stringify(Ss.extend({server_url:ws.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(ws.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(ws.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,Ss.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return ws.para.app_js_bridge.is_send?(ws.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(Ss.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bn(e,t,r){return vn(e,t,r),e.plugin_version=Js,e}function wn(){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=qs}function Sn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return kn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o); -}}return e}function kn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Pn(e,t,r){return Sn(e,t,r),e.plugin_version=Vs,e}function Cn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function On(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function In(e,t,r){return Nn(e,t,r),e.plugin_version=Zs,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return An(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function An(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dn(e,t,r){return Tn(e,t,r),e.plugin_version=tl,e}function $n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=Gs._.extend(e.properties||{},n)}}catch(i){rl("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Qs.call(Gs.kit,e)}function xn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return En(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function En(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ln(e,t,r){return xn(e,t,r),e.plugin_version=al,e}function Un(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Rn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Rn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Bn(e,t,r){return Un(e,t,r),e.plugin_version=Sl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Mn(e,t,r){return Hn(e,t,r),e.plugin_version=Cl,e}function qn(){Ol=!0}function Kn(){Ol=!1}function Fn(){return Ol}function Vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zn(e,t,r){return Vn(e,t,r),e.plugin_version=Tl,e}function Xn(e){var t=e,r="";r=ll.para.debug_mode_url.indexOf("?")!==-1?ll.para.debug_mode_url+"&"+ll.kit.encodeTrackData(e):ll.para.debug_mode_url+"?"+ll.kit.encodeTrackData(e),ul.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(ll.para.debug_mode_upload)},success:function(e){ul.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Zn(e,t){if(ll.para.debug_mode===!0){var r=e.data;e.callback;Xn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Gn(){ll.para.debug_mode===!0&&(ll.para.debug_mode_upload=ll.para.debug_mode_upload||!1,ul.isString(ll.para.debug_mode_url)||(ul.isString(ll.para.server_url)?ll.para.debug_mode_url=ll.para.server_url.replace("sa.gif","debug"):ul.isArray(ll.para.server_url)&&ul.isString(ll.para.server_url[0])?ll.para.debug_mode_url=ll.para.server_url[0].replace("sa.gif","debug"):ll.para.debug_mode=!1))}function Qn(){ll.on("sdkInitPara",function(){Gn()}),ll.on("sdkAfterInitPara",function(){ll.registerInterceptor("sendDataStage",{send:{priority:30,entry:Zn}})})}function Yn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ei(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ei(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ti(e,t,r){return Yn(e,t,r),e.plugin_version=$l,e}function ri(e,t){if(dl.isObject(cl.para.jsapp)&&!cl.para.jsapp.isOnline&&"function"==typeof cl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),cl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ni(){cl.on("sdkAfterInitAPI",function(){dl.isObject(cl.commonWays)&&(cl.commonWays.setOnlineState=ii),cl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ri}})})}function ii(e){if(e===!0&&dl.isObject(cl.para.jsapp)&&"function"==typeof cl.para.jsapp.getData){cl.para.jsapp.isOnline=!0;var t=cl.para.jsapp.getData();dl.isArray(t)&&t.length>0&&dl.each(t,function(e){dl.isJSONString(e)&&cl.kit.sendData(JSON.parse(e))})}else cl.para.jsapp.isOnline=!1}function ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function si(e,t,r){return ai(e,t,r),e.plugin_version=Ll,e}function li(e,t){return!pl.para.app_js_bridge&&pl.para.batch_send&&fl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fi(e,t,r){return di(e,t,r),e.plugin_version=Hl,e}function gi(e){var t=new _l.BeaconSend(e);t.start()}function _i(e,t){var r=null,n=null;_l.isObject(e.config)&&(r=e.config.send_type,n=_l.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===gl.para.send_type;if(i&&_l.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=gl.kit.encodeTrackData(e.data),_l.isArray(a)&&a.length?_l.each(a,function(t){e.callback=null,e.server_url=t,gi(e)}):"string"==typeof a&&""!==a?gi(e):gl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function hi(){"beacon"!==gl.para.send_type||_l.isSupportBeaconSend()||(gl.para.send_type="image")}function mi(){gl.on("sdkInitPara",function(){hi()}),gl.on("sdkAfterInitPara",function(){gl.registerInterceptor("sendDataStage",{send:{priority:110,entry:_i}})})}function vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bi(e,t,r){return vi(e,t,r),e.plugin_version=ql,e}function wi(e){var t=new ml.AjaxSend(e);t.start()}function Si(e,t){var r=null,n=null;ml.isObject(e.config)&&(r=e.config.send_type,n=ml.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===hl.para.send_type;if(i&&ml.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=hl.kit.encodeTrackData(e.data),ml.isArray(a)&&a.length?ml.each(a,function(t){e.callback=null,e.server_url=t,wi(e)}):"string"==typeof a&&""!==a?wi(e):hl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function ki(){"ajax"!==hl.para.send_type||ml.isSupportCors()||(hl.para.send_type="image")}function Pi(){hl.on("sdkInitPara",function(){ki()}),hl.on("sdkAfterInitPara",function(){hl.registerInterceptor("sendDataStage",{send:{priority:120,entry:Si}})})}function Ci(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ni(e,t,r){return Ci(e,t,r),e.plugin_version=Vl,e}function ji(e,t){var r=vl.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function Ii(e){var t=new yl.ImageSend(e);t.start()}function Ti(e,t){var r=null;yl.isObject(e.config)&&(r=yl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,yl.isArray(n)&&n.length?yl.each(n,function(t){t&&(e.data=ji(t,i),e.callback=null,e.server_url=t,Ii(e))}):"string"==typeof n&&""!==n?(e.data=ji(n,i),Ii(e)):vl.logger&&vl.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ai(){"image"!==vl.para.send_type&&"ajax"!==vl.para.send_type&&"beacon"!==vl.para.send_type&&(vl.para.send_type="image")}function Di(){vl.on("sdkInitPara",function(){Ai()}),vl.on("sdkAfterInitPara",function(){vl.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function $i(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ei(e,t,r){return $i(e,t,r),e.plugin_version=va,e}function Li(e){return null===Gl?void Ui(e):void Gl.push(e)}function Ui(e){try{if("log"===e.level&&Ri())return void Ji(e);if("warn"===e.level&&Bi())return void Ji(e);if("error"===e.level&&Hi())return void Ji(e)}catch(t){}}function Ri(){return!!Fi()||(Xl.para.show_log===!0||Zl.isObject(Xl.para.show_log)&&"log"===Xl.para.show_log.level)}function Bi(){return!!Fi()||(Ri()||Zl.isObject(Xl.para.show_log)&&"warn"===Xl.para.show_log.level)}function Hi(){return!!Fi()||(!Zl.isObject(Xl.para.show_log)||"none"!==Xl.para.show_log.level)}function Ji(e){var t=e.content,r=Zl.isObject(t[0])?Zl.formatJsonString(t[0]):t[0],n=Mi(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Zl.isFunction(console[e.level])?console[e.level].apply(console,t):Zl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Mi(e){var t="",r="",n=Xl.para.show_log;return Zl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Zl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Zl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function qi(){Zl.sessionStorage.isSupport()&&sessionStorage.setItem(eu,"true")}function Ki(){Zl.sessionStorage.isSupport()&&sessionStorage.removeItem(eu)}function Fi(){return Zl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(eu)}function Vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zi(e,t,r){return Vi(e,t,r),e.plugin_version=uu,e}var Xi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new d((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new d((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new d((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var p,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),p=5==n.a.length&&1===n.a[0],p&&(a(function(){p=!f('"\t"')}),p&&a(function(){p=1!==f("01")}),p&&a(function(){p=1!==f("1.")})))},function(){p=!1}),t=p}}return o[e]=!!t}function s(e){return D(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,d=n.Date||r.Date,p=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new d((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T="000000",A=function(e,t){return(T+(t||0)).slice(-e)},D=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],p=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;p(r+1,0)<=i;r++);for(n=c((i-p(r,0))/30.42);p(r,n+1)<=i;n++);i=1+i-p(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(D=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+A(6,r<0?-r:r):A(4,r))+"-"+A(2,n+1)+"-"+A(2,i)+"T"+A(2,o)+":"+A(2,s)+":"+A(2,l)+"."+A(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var $=i.stringify;i.stringify=function(e,t,r){var n=d.prototype.toJSON;d.prototype.toJSON=s;var i=$(e,t,r);return d.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=I[t];return r?r:x+A(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,p,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===d.prototype.toJSON?l=D(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),p=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,B));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++B);e+=a.slice(t,B)}if(34==a.charCodeAt(B))return B++,e;q();default:if(t=B,45==i&&(n=!0,i=a.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(B+1),i>=48&&i<=57)&&q(),n=!1;B=48&&i<=57);B++);if(46==a.charCodeAt(B)){for(r=++B;r57));r++);r==B&&q(),B=r}if(i=a.charCodeAt(B),101==i||69==i){for(i=a.charCodeAt(++B),43!=i&&45!=i||B++,r=B;r57));r++);r==B&&q(),B=r}return+a.slice(t,B)}n&&q();var s=a.slice(B,B+4);if("true"==s)return B+=4,!0;if("fals"==s&&101==a.charCodeAt(B+4))return B+=5,!1;if("null"==s)return B+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return B=0,H=""+e,r=F(K()),"$"!=K()&&q(),B=H=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Zi,Gi={setup:function(e){Zi=e},log:function(){(Zi||console&&console.log||function(){}).apply(null,arguments)}},Qi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Qi.get(e))||null}catch(r){Gi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Gi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Qi.set(t,r),Qi.get(t)!==r&&(e=!1),Qi.remove(t)}catch(n){e=!1}return e}},Yi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Qi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Qi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Qi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Qi.get(e)),Qi.remove(e),Qi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Qi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Qi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Qi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Qi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.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=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),ta=function(e){this.ele=e},ra=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};ta.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){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),y(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||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=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 ra((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return ra(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+_a.sdk_id+e}},Oa={checkIsAddSign:function(e){"track"===e.type&&(Re()?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,n=wa.get("sensorsdata2015jssdkcross"+Xi.para.sdk_id);n=Xi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Xi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Xi.para.encrypt_cookie&&(i=Xi.kit.userEncrypt(i)),wa.set("sensorsdata2015jssdkcross"+Xi.para.sdk_id,i,null,!0)),Xi.para.is_track_device_id&&(Pa.currentProps.$device_id=r)},storeInitCheck:function(){if(Xi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};wa.isSupport()?wa.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):Ca.set(Ca.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(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)}}},Na=function(){this._events=[],this.pendingEvents=[]};Na.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(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():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var ja={},Ia=new l;ja.spa=Ia,ja.sdk=new l,ja.data=new l,ja.initSystemEvent=function(){Ye(function(e){Ia.emit("switch",e)})},ja.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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var Ta=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};Ta.prototype.start=function(){var e=this,t=new Date;Ze({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:_a.datasend_timeout,cors:!0,success:function(r,n){ja.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:_a.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){ja.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:_a.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},Ta.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var Aa="sawebjssdk-",Da="tab-sawebjssdk-";tt.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()},_a.batch_send.send_interval)},getServerUrl:function(){return d(_a.server_url)&&""!==_a.server_url||v(_a.server_url)&&_a.server_url.length?void(this.serverUrl=v(_a.server_url)?_a.server_url[0]:_a.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(this.sendTimeStamp&&t()-this.sendTimeStamp<_a.batch_send.send_interval)return!1;var e=Qi.get(this.tabKey);if(e){this.sendTimeStamp=t(),e=i(e)||this.generateTabStorageVal();var r=Ce(e.data);if(r.length){for(var n=[],a=0;a-1&&r.splice(a,1),Qi.remove(e[n])}r=Ce(r),Qi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=Aa+String(n()),a=Qi.get(this.tabKey);null===a?(this.tabKey=Da+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*_a.batch_send.send_interval,Qi.set(this.tabKey,JSON.stringify(a)),Xi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Da+String(n()),Qi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*_a.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var d=new a(n);d.get(s,r,1e3,function(e){if(e){null===Qi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Qi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Qi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var p=i(Qi.get(s))||{expireTime:0};t()-p.expireTime>r&&Qi.remove(s)}}for(var f=0;f0)for(t=0;t_a.max_id_length)},keyLength:function(e){return!(!d(e)||e.length>_a.max_key_length)},stringLength:function(e){return!(!d(e)||e.length>_a.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=Ua._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},Ha={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ra[n])&&Ra[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ra[n])&&Ra[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ra[n])&&Ra[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ra[n])&&Ra[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){rt({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ra[i])&&Ra[i](n)),!0};rt({propertyValue:t},n)}):Ba.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ra[n])&&Ra[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ra[n])&&Ra[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ra[n])&&Ra[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ra[n])&&Ra[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ra[n])&&Ra[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ra[n])&&Ra[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=p(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ja.configIsMatchNew=function(e,t){if(d(e.$element_selector)&&d(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 e.$element_selector.indexOf(t.element_selector)>-1}if(d(e.$element_path)&&d(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 e.$element_path.indexOf(t.element_path)>-1}return!1},Ja.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"]?Ja.configIsMatchNew(e,t):Ja.configIsMatchOldVersion(e,t)))},Ja.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(Ja.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},Ja.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ja.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ja.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ja.getPropElInLi=function(e,t){if(!(e&&_(e)&&d(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Xi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ja.getProp=function(e,t){if(!r(e))return!1;if(!(d(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(d(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!d(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Xi.heatmap.getClosestLi(s);o=Ja.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!d(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ja.getAssignConfigs=function(e,t){var n=Ja.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ma={events:[],getAssignConfigs:Ja.getAssignConfigs,filterConfig:Ja.filterConfig,getProp:Ja.getProp,initUrl:Ja.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),d(a.event_name)&&n.push(a.event_name))}),Xi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Xi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Xi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},qa={events:[],customProp:Ma,getAssignConfigs:Ja.getAssignConfigs,initUrl:Ja.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Xi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Xi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ka={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=Va.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Xi.heatmap.getEleDetail(e);if(!r(t)||!d(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,Va.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ja.getProp,getPropElInLi:Ja.getPropElInLi,filterConfig:Ja.filterConfig},Va={unlimitedDiv:Ka,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Fa,initUrl:function(){var e=Ja.initUrl();if(e){var t;try{t=new f(Xi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Xi.para.heatmap)||!Xi.para.heatmap.get_vtrack_config)return!1;if(Qi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=Ua.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Xi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div&&Xi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Xi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Qa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div&&Xi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Qa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(!d(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){var t=function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&d(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null};return t(e,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Xi.heatmap.getClosestLi(e);if(!i||!_(e)||!d(e.tagName))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Xi.is_heatmap_render_mode=!0,Xi.para.heatmap||(Xi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Xi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Xi.para.heatmap_url||(Xi.para.heatmap_url=ht()+"//static.sensorsdata.cn/sdk/"+Xi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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=We({target:e});r.$element_selector=t?t:"",r.$element_path=Xi.heatmap.getElementPath(e,Xi.para.heatmap&&"not_use_id"===Xi.para.heatmap.element_selector);var n=Xi.heatmap.getElementPosition(e,r.$element_path,Xi.para.heatmap&&"not_use_id"===Xi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Xi.para.heatmap)&&e(Xi.para.heatmap.collect_element)&&!Xi.para.heatmap.collect_element(n))return!1;var s=Qa.getBasicEleInfo(t,n,i,a,o);mt(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Xi.para.heatmap&&Xi.para.heatmap.custom_property){var c=Xi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div?!!(r(Xi.para.heatmap)&&r(Xi.para.heatmap.collect_tags)&&r(Xi.para.heatmap.collect_tags.div)&&v(Xi.para.heatmap.collect_tags.div.ignore_tags)&&re(Xi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Xi.para&&Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div&&Xi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Xi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Xi.para.heatmap)||"default"!==Xi.para.heatmap.scroll_notice_map)return!1;var t=!0;Xi.para.scrollmap&&e(Xi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Xi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Xi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Xi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,vt(e)),this.current_time=n}});i.current_time=new Date,Be(window,"scroll",function(){return!!t&&void i.go()}),Be(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Xi.para.heatmap)||"default"!==Xi.para.heatmap.clickmap)&&(e(Xi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Xi.para.heatmap.collect_url()}),"all"===Xi.para.heatmap.collect_elements?Xi.para.heatmap.collect_elements="all":Xi.para.heatmap.collect_elements="interact",void("all"===Xi.para.heatmap.collect_elements?Be(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=d(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):Be(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Xi.heatmap.getTargetElement(a,e);return!(!_(o)&&!d(a.tagName))&&void(_(o)&&d(o.tagName)?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Xi.para.heatmap)&&Xi.para.heatmap.get_vtrack_config&&Ka.events.length>0&&Ka.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"}))})))}},Ya={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Xi.log("error: isReady callback must be function")},getUtm:function(){return Pa.campaignParams()},getStayTime:function(){return(new Date-Xi._t)/1e3},setProfileLocal:function(e){if(!Qi.isSupport())return Xi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=Ua.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(Ua.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Xi.setProfile(e))}else Ua.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Xi.setProfile(e)},setInitReferrer:function(){var e=$e();Xi.setOnceProfile({_init_referrer:e,_init_referrer_host:Pa.pageProp.referrer_host})},setSessionReferrer:function(){var e=$e();Ua.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:Pa.pageProp.referrer_host})},setDefaultAttr:function(){Pa.register({_current_url:location.href,_referrer:$e(),_referring_host:Pa.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Xi.para.heatmap&&Xi.para.heatmap.track_attr?Xi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Qa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Qa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Xi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,yt()),t),i=Z()}var i;i=this.autoTrackIsUsed?Pa.pageProp.url:Pa.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,bt(Xi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=yt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Xi.para.is_single_page&&w(function(){var r=$e(a,!0);Xi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Xi.track("$pageview",P({$referrer:$e(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),bt(Xi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(Ua._state)?"SDK is not initialized.":Ua.getAnonymousId()},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Xi.modules)&&Xi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Xi.use.apply(Xi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},eo={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},to=1,ro={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:It,unbind:Tt,trackLink:At,trackLinks:Dt,setItem:$t,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Bt,unsetProfile:Ht,identify:Jt,resetAnonymousIdentity:Mt,trackSignup:Kt,registerPage:Ft,clearAllRegister:Vt,clearPageRegister:Wt,register:zt,registerOnce:Xt,registerSession:Zt,registerSessionOnce:Gt,login:Qt,loginWithKey:Yt,logout:er,getPresetProperties:tr,readyState:eo,debug:ka,on:et,log:Oe};Gi.setup(Oe);var no=P({},pa,Ea),io={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:Xi.para.use_app_track_is_send!==!1&&"only"!==Xi.para.use_app_track,white_list:[],is_mui:"mui"===Xi.para.use_app_track};"object"==typeof Xi.para.app_js_bridge?Xi.para.app_js_bridge=P({},e,Xi.para.app_js_bridge):Xi.para.use_app_track!==!0&&Xi.para.app_js_bridge!==!0&&"only"!==Xi.para.use_app_track&&"mui"!==Xi.para.use_app_track||(Xi.para.app_js_bridge=P({},e)),Xi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Xi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ar};nr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),ir(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},nr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},nr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),ir(r)},or.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Xi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ao={isSeachHasKeyword:function(){return""!==V(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=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Qa.setNotice(n),la.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Xi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Xi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Xi.heatmap_version&&Xi.heatmap_version===Xi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Xi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return la.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Qa.setNotice(),ao.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=d(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&d(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return d(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Qa.setNotice(i),la.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ao.isReady(r,n)}},oo={isStorageHasKeyword:function(){return la.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(lr("sa-visual-mode")===!0||"true"===lr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Xi.para.vtrack_url?Xi.para.vtrack_url:ht()+"//static.sensorsdata.cn/sdk/"+Xi.lib_version+"/vtrack.min.js"})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(la.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var t=e.data.data.userURL;d(t)&&(window.location.href=encodeURI(t.replace(/javascript:/i,"")))}else oo.loadVtrack();window.removeEventListener("message",oo.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",oo.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",oo.messageListener,!1),oo.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:va}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),oo.postMessage()}},so=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],lo={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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){}};vr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new mr(t,n,Xi),a=0;a=2)&&(Po&&(Or(!0),_r()),ja.initSystemEvent(),Xi.setInitVar(),Xi.readyState.setState(2),Xi.initPara(e),ja.sdk.emit("initPara"),ja.sdk.emit("afterInitPara"),ja.sdk.emit("initAPI"),ja.sdk.emit("afterInitAPI"),Xi.detectMode(),rr(),ja.sdk.emit("afterInit"),void ja.sdk.emit("ready"))},Po?Or(!1):(Or(!0),_r());var Co,Oo,No,jo,Io,To,Ao,Do,$o,xo,Eo,Lo,Uo,Ro,Bo,Ho,Jo,Mo,qo="1.26.8",Ko={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Fo=Ir(Ko),Vo="1.26.8",Wo={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},zo=Dr(Wo,"Amp","sdkReady"),Xo=window.SensorsData_App_Visual_Bridge,Zo=Xo&&Xo.sensorsdata_visualized_mode,Go=Xo&&Xo.sensorsdata_visualized_alert_info,Qo=Xo&&Xo.sensorsdata_hover_web_nodes,Yo={isVerify:function(){return Zo&&(Zo===!0||Zo.call(Xo))},commands:{app_alert:$r,visualized_track:xr,page_info:xr,sensorsdata_get_app_visual_config:Er}},es="1.26.8",ts={init:function(e){jo=e,Io=jo&&jo._,To=jo&&jo.log||console&&console.log||function(){},Br()},handleCommand:Jr},rs=Rr(ts,"AndroidBridge","sdkAfterInitPara"),ns=window.SensorsData_App_Visual_Bridge,is=ns&&ns.sensorsdata_visualized_mode,as=ns&&ns.sensorsdata_visualized_alert_info,os=ns&&ns.sensorsdata_hover_web_nodes,ss={isVerify:function(){return is&&(is===!0||is.call(ns))},commands:{app_alert:Mr,visualized_track:qr,page_info:qr,sensorsdata_get_app_visual_config:Kr}},ls="1.26.8",us={init:function(e){Eo=e,Lo=Eo&&Eo._,Uo=Eo&&Eo.log||console&&console.log||function(){},zr()},handleCommand:Zr},cs=Wr(us,"AndroidObsoleteBridge","sdkAfterInitPara"),ds="1.26.8",ps={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Ro=Bo._,Ho=Bo.store,!!Ro.localStorage.isSupport()&&(Bo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Bo||!e)return!1;t=t||{},Jo=t.cookie_name||"sensorsdata2015jssdkchannel",Bo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Bo.registerPage({$is_channel_callback_event:function(e){if(Ro.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!ps.eventList.hasEvent(e.event)&&(ps.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Ro.isReferralTraffic(document.referrer)){var r=Ro.getQueryParam(location.href,"sat_cf");Ro.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),ps.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Bo.registerPage(t):Bo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Bo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Bo.kit.userDecryptIfNeeded(Ro.cookie.get(Jo));return e=Ro.safeJSONParse(e),!(!Ro.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Bo.para.encrypt_cookie&&(r=Bo.kit.userEncrypt(r)),Ro.cookie.set(Jo,r)}},channelLinkHandler:function(){this.eventList.reset(),Bo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Ro.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Ro.isNumber(e.latest_event_initial_time)&&Ro.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&js(arguments[0])?t=arguments[0]:arguments.length>=2&&js(arguments[1])&&(t=arguments[1])),!Ns())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(js(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ts(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Is(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?($s.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):($s.data=e,$s.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){$s.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===Os){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Ds(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),As(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=_s().visibilityChange,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},xs=rn($s,"Deeplink","sdkReady"),Es="1.26.8",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},ln()},handleCommand:cn},Us=sn(Ls,"IOSBridge","sdkAfterInitPara"),Rs="1.26.8",Bs={init:function(e){ws=e,Ss=ws&&ws._,ks=ws&&ws.log||console&&console.log||function(){},gn()}},Hs=fn(Bs,"IOSObsoleteBridge","sdkAfterInitPara"),Js="1.26.8",Ms=5e3,qs=432e3;wn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},wn.prototype.log=function(e){this.sd&&this.sd.log(e)},wn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Ms)},wn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},wn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},wn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&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()}},wn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},wn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},wn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},wn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},wn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},wn.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()}})},wn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},wn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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()},wn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},wn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},wn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},wn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},wn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Ks=new wn,Fs=bn(Ks,"PageLeave","sdkReady"),Vs="1.26.8",Ws=!1,zs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ws||(e.track("$WebPageLoad",l),Ws=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Xs=Pn(zs,"PageLoad","sdkReady");On.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Cn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Zs="1.26.8";On.prototype.plugin_name="RegisterProperties";var Gs,Qs,Ys=new On,el=In(Ys),tl="1.26.8",rl=window.console&&window.console.log||function(){},nl={init:function(e){return Gs=e,rl=Gs&&Gs.log||rl,e&&e.kit&&e.kit.buildData?(Qs=Gs.kit.buildData,Gs.kit.buildData=$n,void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},il=Dn(nl,"RegisterPropertyPageHeight","sdkReady"),al="1.26.8",ol={};ol.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},ol.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},ol.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},ol.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var p=u.indexOf("?");a=p>-1?o>-1?s+l+"#"+u.substring(1,o)+d(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+d(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},ol.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},ol.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},ol.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},ol.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var sl,ll,ul,cl,dl,pl,fl,gl,_l,hl,ml,vl,yl,bl=Ln(ol,"SiteLinker","sdkReady"),wl="utm_source utm_medium utm_campaign utm_content utm_term",Sl="1.26.8",kl={init:function(e){function t(){var e=wl.split(" "),t="",r={};return sl._.isArray(sl.para.source_channel)&&sl.para.source_channel.length>0&&(e=e.concat(sl.para.source_channel),e=sl._.unique(e)),sl._.each(e,function(e){t=sl._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!sl&&(sl=e,sl.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},Pl=Bn(kl,"Utm","sdkAfterInitPara"),Cl="1.26.8",Ol=!1,Nl=null,jl={init:function(e){Nl=e,Nl.disableSDK=qn,Nl.enableSDK=Kn,Nl.getDisabled=Fn}},Il=Mn(jl,"DisableSDK","sdkInitAPI"),Tl="1.26.8",Al={plugin_name:"DebugSender",init:function(e){ll=e,ul=ll._,Qn()}},Dl=zn(Al),$l="1.26.8",xl={plugin_name:"JsappSender",init:function(e){cl=e,dl=cl._,ni()}},El=ti(xl),Ll="1.26.8",Ul=null,Rl={plugin_name:"BatchSender",init:function(e){pl=e,fl=pl._,ci()}},Bl=si(Rl),Hl="1.26.8",Jl={plugin_name:"BeaconSender",init:function(e){gl=e,_l=gl._,mi()}},Ml=fi(Jl),ql="1.26.8",Kl={plugin_name:"AjaxSender",init:function(e){hl=e,ml=hl._,Pi()}},Fl=bi(Kl),Vl="1.26.8",Wl={plugin_name:"ImageSender",init:function(e){vl=e,yl=vl._,Di()}},zl=Ni(Wl),Xl=null,Zl=null,Gl=[],Ql={init:function(e){e&&(Xl=e,Zl=Xl._,Xl.logger&&Xl.logger.appendWriter(Li),Xl.on&&Xl.on("sdkAfterInitPara",function(){for(var e=0;e Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("http://modernizr.com/"),"http://modernizr.com/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{d(e)||(e=String(e)),e=p(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void Qi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new ta(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(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){Qi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(na&&e.forEach===na)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){Qi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(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 j(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}function I(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(p){Qi.log(p)}n&&d()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function T(e){return k(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 A(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function D(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=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,oa.set(t,"true",0,null,r,"; domain="+a),document.cookie.indexOf(t+"=true")!==-1)return oa.set(t,"true","-1s",null,r,"; domain="+a),a;return""}function J(e){function t(e,t){e=p(e);var r;if("body"===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 o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){Qi.log(o)}return i&&_(i)?r(i):null}if(!d(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=p(e.textContent):e.innerText&&(r=p(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 q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){Qi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=u(e);var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);return null===i||i&&"string"!=typeof i[1]&&i[1].length?"":u(i[1])}function V(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){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(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){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 Z(e){return d(e)?(e=p(e),A(e)):A(location.href)}function Q(e){return d(e)?(e=p(e),A(e)):A(location.pathname)}function G(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return G(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function pe(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!d(t.callbackName))return Qi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(i.appendChild(n),ce(t.timeout)&&(a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){Qi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){Qi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var s=[];k(t.data,function(e,t){s.push(t+"="+e)}),t.data=s.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){Qi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=t.url}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.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;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.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 he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,d)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else d(i)||ce(i)||$(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function it(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function at(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function ot(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))ot(e[a]);else if(d(i)){if(re(n,a)>-1)return;e[a]=it(i,re(t,a)>-1?1024:_a.max_string_length)}})}function st(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function lt(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};rt({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};rt({item_id:n},i)}}function ut(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&rt({propertyKey:n},i)})}function ct(e){var t=e.properties;ye(e),r(t)?(nt(t),at(t),st(e),ut(t),ot(t)):"properties"in e&&(e.properties={}),lt(e)}function dt(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function pt(e,t){try{var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,Ua.getIdentities());var a={identities:i,distinct_id:Ua.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,Ua.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),"$UnbindID"===a.event&&(a.login_id&&delete a.login_id,a.anonymous_id&&delete a.anonymous_id),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},Na.properties(),Ua.getProps(),Ua.getSessionProps(),Na.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!d(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!d(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&d(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&d(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!d(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!d(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!d(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),d(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&$(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=qa.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=Va.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),ka.checkIsAddSign(a),ka.checkIsFirstTime(a),Fe(a),Ve(a),a}catch(o){return{_debug_web_msg:String(o)}}}function ft(e){return za.stage.process("basicProps",e)}function gt(e){return za.stage.process("formatData",e)}function _t(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&De(e.ele,"click",function(e){i(e)}))))}function ht(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function mt(e){return Za.stage.process("webClickEvent",e)}function vt(e){return Za.stage.process("webStayEvent",e)}function yt(){var e=Na.campaignParams(),t={};return k(e,function(e,r,n){(" "+Xi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function bt(e,t,r){if(Xi.is_first_visitor&&r){var n={};Xi.para.preset_properties.search_keyword_baidu&&Ue(document.referrer)&&$e()&&(n.$search_keyword_id=Ca.id(),n.$search_keyword_id_type=Ca.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=Le(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:d(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:d(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:He(),$first_search_keyword:Re()},yt(),n)),Xi.is_first_visitor=!1}}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=Ua.getFirstId(),s=Ua.getOriginDistinctId();if(!rt({distinct_id:n}))return je("login id is invalid"),!1;if(n===Ua.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"),!1;if(r(Ua._state.identities)&&Ua._state.identities.hasOwnProperty(a)&&n===Ua._state.first_id)return!1; +var l=Ua._state.history_login_id.name!==a||n!==Ua._state.history_login_id.value;if(l){Ua._state.identities[a]=n,Ua.set("history_login_id",{name:a,value:n}),o||Ua.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:Ua._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];Ua._state.identities=t,Ua.save()}function kt(e,t){if(!rt({unbindKey:e,bindValue:t}))return!1;if(r(Ua._state.identities)&&Ua._state.identities.hasOwnProperty(e)&&Ua._state.identities[e]===t){var n=Ua.getUnionId().login_id;n&&e+"+"+t===n&&(Ua._state.distinct_id=Ua._state.first_id,Ua._state.first_id="",Ua.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete Ua._state.identities[e],Ua.save())}var i={};return i[e]=t,i}function Pt(){Xi._t=Xi._t||1*new Date,Xi.is_first_visitor=!1,Xi.source_channel_standard=ma}function Ct(e){P(_a,e||Xi.para||{}),Xi.para=_a;var t={};if(r(Xi.para.is_track_latest))for(var n in Xi.para.is_track_latest)t["latest_"+n]=Xi.para.is_track_latest[n];Xi.para.preset_properties=P({},ha.preset_properties,t,Xi.para.preset_properties||{});var i;for(i in ha)void 0===Xi.para[i]&&(Xi.para[i]=ha[i]);"string"!=typeof Xi.para.web_url||"://"!==Xi.para.web_url.slice(0,3)&&"//"!==Xi.para.web_url.slice(0,2)||("://"===Xi.para.web_url.slice(0,3)?Xi.para.web_url=location.protocol.slice(0,-1)+Xi.para.web_url:Xi.para.web_url=location.protocol+Xi.para.web_url),Oa.protocol.serverUrl(),Xi.bridge&&Xi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Xi.para.source_type&&(Xi.para.source_type.utm=v(Xi.para.source_type.utm)?Xi.para.source_type.utm.concat(a):a,Xi.para.source_type.search=v(Xi.para.source_type.search)?Xi.para.source_type.search.concat(o):o,Xi.para.source_type.social=v(Xi.para.source_type.social)?Xi.para.source_type.social.concat(s):s,Xi.para.source_type.keyword=r(Xi.para.source_type.keyword)?P(l,Xi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Xi.para.heatmap&&!r(Xi.para.heatmap)&&(Xi.para.heatmap={}),r(Xi.para.heatmap)){Xi.para.heatmap.clickmap=Xi.para.heatmap.clickmap||"default",Xi.para.heatmap.scroll_notice_map=Xi.para.heatmap.scroll_notice_map||"default",Xi.para.heatmap.scroll_delay_time=Xi.para.heatmap.scroll_delay_time||4e3,Xi.para.heatmap.scroll_event_duration=Xi.para.heatmap.scroll_event_duration||18e3,Xi.para.heatmap.renderRefreshTime=Xi.para.heatmap.renderRefreshTime||1e3,Xi.para.heatmap.loadTimeout=Xi.para.heatmap.loadTimeout||1e3,Xi.para.heatmap.get_vtrack_config!==!0&&(Xi.para.heatmap.get_vtrack_config=!1);var d=v(Xi.para.heatmap.track_attr)?U(Xi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),Xi.para.heatmap.track_attr=d,r(Xi.para.heatmap.collect_tags))if(Xi.para.heatmap.collect_tags.div===!0)Xi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Xi.para.heatmap.collect_tags.div)){if(Xi.para.heatmap.collect_tags.div.ignore_tags?v(Xi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Xi.para.heatmap.collect_tags.div.ignore_tags=c):Xi.para.heatmap.collect_tags.div.ignore_tags=c,Xi.para.heatmap.collect_tags.div.max_level){var p=[1,2,3];re(p,Xi.para.heatmap.collect_tags.div.max_level)===-1&&(Xi.para.heatmap.collect_tags.div.max_level=1)}}else Xi.para.heatmap.collect_tags.div=!1;else Xi.para.heatmap.collect_tags=u}Xi.para.server_url=Qe(Xi.para.server_url),Xi.para.noCache===!0?Xi.para.noCache="?"+(new Date).getTime():Xi.para.noCache="",Xi.para.callback_timeout>Xi.para.datasend_timeout&&(Xi.para.datasend_timeout=Xi.para.callback_timeout),Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&r(Xi.para.heatmap.collect_tags)&&k(Xi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Xi.heatmap.otherTags.push(t)}),Xi.para.heatmap&&"default"===Xi.para.heatmap.clickmap&&Xi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Ya[t]?Ya[t].apply(Ya,r):void("function"==typeof t?t.apply(Xi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Xi,n),a.plugin_is_init=!0,Xi.modules=Xi.modules||{},Xi.modules[a.plugin_name||"unnamed_"+to++]=a,a}if(!d(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Xi.modules&&Xi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return d(t)&&(r(Xi.modules)&&r(Xi.modules[t])?a=Xi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Xi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){rt({event:e,properties:t})&&Xa.send({type:"track",event:e,properties:t},r)}function It(e,t){return!!rt({bindKey:e,bindValue:t})&&(Ua._state.identities[e]=t,Ua.save(),void Xa.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function Tt(e,t){var r=kt(e,t);r&&Xa.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function At(e,t,r){"object"==typeof e&&e.tagName?_t({ele:e},t,r,Xi.track):"object"==typeof e&&e.target&&e.event&&_t(e,t,r,Xi.track)}function Dt(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void De(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Xi.track(t,r,i)}))}function $t(e,t,r){rt({item_type:e,item_id:t,properties:r})&&Xa.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){rt({item_type:e,item_id:t})&&Xa.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){rt({propertiesMust:e})&&Xa.send({type:"profile_set",properties:e},t)}function Lt(e,t){rt({propertiesMust:e})&&Xa.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){rt({propertiesMust:e})&&(k(e,function(t,r){d(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Xa.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;d(e)&&(e={},e[n]=1),rt({propertiesMust:e})&&(r(e)?Xa.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Bt(e){Xa.send({type:"profile_delete"},e),Ua.set("distinct_id",ea()),Ua.set("first_id","")}function Ht(e,t){var r=e,n={};d(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){d(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Xa.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e){"number"==typeof e&&(e=String(e));var t=Ua.getFirstId();if("undefined"==typeof e){var r=ea();t?Ua.set("first_id",r):Ua.set("distinct_id",r)}else rt({distinct_id:e})&&(t?Ua.set("first_id",e):Ua.set("distinct_id",e))}function Mt(e){var t=Ua.getFirstId();if(t)return je("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),"undefined"==typeof e){var r=ea();Ua._state.identities.$identity_cookie_id=r,Ua.set("distinct_id",r)}else rt({distinct_id:e})&&(Ua._state.identities.$identity_cookie_id=e,Ua.set("distinct_id",e))}function qt(e,t,r,n){var i=Ua.getFirstId()||Ua.getDistinctId();Ua.set("distinct_id",e),Xa.send({original_id:i,distinct_id:Ua.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function Kt(e,t,r,n){"number"==typeof e&&(e=String(e)),rt({distinct_id:e,event:t,properties:r})&&qt(e,t,r,n)}function Ft(e){rt({properties:e})?P(Na.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Vt(e){Ua.clearAllProps(e)}function Wt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Xi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Xi.lib_version+"/vapph5define.min.js"})}else t();else t()}function cr(t){Xi.para.is_track_single_page&&Ia.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){Na.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Xi.quick&&Xi.quick("autoTrack",i)}};if("boolean"==typeof Xi.para.is_track_single_page)i();else if("function"==typeof Xi.para.is_track_single_page){var a=Xi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function dr(){Xi._q&&v(Xi._q)&&Xi._q.length>0&&k(Xi._q,function(e){Xi[e[0]].apply(Xi,Array.prototype.slice.call(e[1]))}),r(Xi.para.heatmap)&&(Ga.initHeatmap(),Ga.initScrollmap())}function pr(){Xi.readyState.setState(3),new Xi.SDKJSBridge("visualized").onAppNotify(function(){ur("undefined"!=typeof sa_jssdk_app_define_mode?!0:!1)}),ur(!1),Xi.bridge.app_js_bridge_v1(),Na.initPage(),cr(),Ua.init(),sr(),gr(),Xi.readyState.setState(4),dr()}function fr(){ao.isSeachHasKeyword()?ao.hasKeywordHandle():window.parent!==self&&oo.isSearchHasKeyword()?oo.verifyVtrackMode():ao.isWindowNameHasKeyword()?ao.windowNameHasKeywordHandle():ao.isStorageHasKeyword()?ao.storageHasKeywordHandle():window.parent!==self&&oo.isStorageHasKeyword()?oo.verifyVtrackMode():(pr(),oo.notifyUser())}function gr(){Va.init(),"success"===Xi.bridge.bridge_info.verify_success&&qa.init()}function _r(){k(so,function(t){var r=Xi[t];Xi[t]=function(){if(Xi.readyState.state<3)return v(Xi._q)||(Xi._q=[]),Ne("calling sdk api before init is deprecated."),Xi._q.push([t,arguments]),!1;if(!e(Xi.getDisabled)||!Xi.getDisabled())return Xi.readyState.getState()?r.apply(Xi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function hr(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 mr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new hr,this.sensors=r}function vr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function yr(e){e&&e.buildDataStage&&co.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&_o.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&fo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&mo.registerStageImplementation(e.viewStage)}function br(e,t){vo[e]&&vo[e](t)}function wr(){return yo.stage&&yo.stage.process("getUtmData")}function Sr(e){return bo.stage.process("send",e)}function kr(e){e.kit=wo,e.saEvent=Xa,this.buildDataStage=za,this.sendDataStage=bo,this.businessStage=yo}function Pr(e){e.heatmap=Ga,this.viewStage=Za}function Cr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};br("buildDataStage",r)}function Or(e){e&&(Xi.events=La,Xi.bridge=io,Xi.SDKJSBridge=nr,Xi.JSBridge=or,Xi.store=Ua,Xi.unlimitedDiv=Ka,Xi.customProp=Fa,Xi.vtrackcollect=Va,Xi.vapph5collect=qa,Xi.detectMode=fr,Xi.registerFeature=yr,Xi.registerInterceptor=br,Xi.commonWays=Ya,yr(new kr(Xi)),yr(new Pr(Xi)),br("viewStage",So));var t=e?ro:lo;for(var r in t)Xi[r]=t[r];Xi.logger=ga,Xi.log=Oe,Xi._=no,Xi.on=et,Xi.ee=ja,Xi.use=Nt,Xi.lib_version=va,Xi.registerPropertyPlugin=Cr}function Nr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ir(e,t,r){return Nr(e,t,r),e.plugin_version=qo,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ar(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ar(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dr(e,t,r){return Tr(e,t,r),e.plugin_version=Vo,e}function $r(e){return Qo&&Qo.call(Xo,JSON.stringify(e))}function xr(e){return Zo.call(Xo)&&Go&&Go.call(Xo,JSON.stringify(e))}function Er(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Lr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ur(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ur(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rr(e,t,r){return Lr(e,t,r),e.plugin_version=es,e}function Br(){if(Co=window.SensorsData_APP_New_H5_Bridge,Oo=Co&&Co.sensorsdata_track,No=Oo&&Co.sensorsdata_get_server_url&&Co.sensorsdata_get_server_url(),To("---test---fail---",!jo,jo.bridge.activeBridge,!No),jo&&!jo.bridge.activeBridge&&No)return jo.bridge.activeBridge=ts,jo.para.app_js_bridge&&!jo.para.app_js_bridge.is_mui&&(jo.bridge.is_verify_success=No&&jo.bridge.validateAppUrl(No),To("---test---bridge-verify-",jo.bridge.is_verify_success)),jo.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:jo.bridge.is_verify_success?"success":"fail",support_two_way_call:!!Co.sensorsdata_js_call_app},jo.para.app_js_bridge?void jo.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}):void To("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function Hr(e,t){if(To("---test---datasend-",jo.bridge.is_verify_success),jo.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return jo.bridge.is_verify_success?(To("---test---bridge-verify-success---",e.data),Oo&&Oo.call(Co,JSON.stringify(Io.extend({server_url:jo.para.server_url},e.data))),Io.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(To("---test---bridge-verify-fail-----",jo.bridge.is_verify_success),jo.para.app_js_bridge.is_send?(jo.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Io.isFunction(r)&&r(),t.cancellationToken.cancel(),e))}function Jr(e){var t=e.callType;return t in Yo.commands?Yo.commands[t](e,Co):void(Co&&Io.isFunction(Co.sensorsdata_js_call_app)&&Co.sensorsdata_js_call_app(JSON.stringify(e)))}function Mr(e){return as&&as.call(ns,JSON.stringify(e))}function qr(e){return is.call(ns)&&os&&os.call(ns,JSON.stringify(e))}function Kr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Fr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wr(e,t,r){return Fr(e,t,r),e.plugin_version=ls,e}function zr(){if(Uo("ObsoleteBridge---test---init---"),Ao=window.SensorsData_APP_JS_Bridge,Do=Ao&&Ao.sensorsdata_track,$o=Ao&&Ao.sensorsdata_verify,xo=Ao&&Ao.sensorsdata_visual_verify,Uo("ObsoleteBridge-",Eo.bridge.activeBridge,$o,Do,xo),Eo&&!Eo.bridge.activeBridge&&($o||Do||xo)){Eo.bridge.activeBridge=us;var e=$o||Do;if(xo&&(e=!!xo.call(Ao,JSON.stringify({server_url:Eo.para.server_url})),Uo("ObsoleteBridge---called-return",e)),Eo.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Eo.para.app_js_bridge)return void Uo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Eo.registerInterceptor("sendDataStage",{send:{priority:80,entry:Xr}}),Uo("Android obsolete bridge inits succeed.")}}function Xr(e,t){if(Uo("ObsoleteBridge---senddata"),Eo.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if($o){var n=$o&&$o.call(Ao,JSON.stringify(Lo.extend({server_url:Eo.para.server_url},e.data)));return Uo("ObsoleteBridge---anVerify-success",n),n?(Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Eo.para.app_js_bridge.is_send?(Eo.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return Uo("ObsoleteBridge---is-send-old-way",Eo.para.app_js_bridge.is_send),Do&&Do.call(Ao,JSON.stringify(Lo.extend({server_url:Eo.para.server_url},e.data))),Lo.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Zr(e){Uo("ObsoleteBridge---handleCommadn");var t=e.callType;return t in ss.commands?(Uo("ObsoleteBridge---",t,ss.commands),ss.commands[t](e,Ao)):Ao&&Lo.isFunction(Ao.sensorsdata_js_call_app)?(Uo("ObsoleteBridge---handleCommadn-abridge"),Ao.sensorsdata_js_call_app(JSON.stringify(e))):void 0}function Qr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Gr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Gr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Yr(e,t,r){return Qr(e,t,r),e.plugin_version=ds,e}function en(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return tn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function tn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function rn(e,t,r){return en(e,t,r),e.plugin_version=gs,e}function nn(){return"undefined"!=typeof Mo&&document[Mo]}function an(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return on(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function on(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function sn(e,t,r){return an(e,t,r),e.plugin_version=Es,e}function ln(){if(hs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,ms=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},vs&&!vs.bridge.activeBridge&&ms()&&ms().postMessage){if(vs.bridge.activeBridge=Ls,vs.para.app_js_bridge&&!vs.para.app_js_bridge.is_mui&&(vs.bridge.is_verify_success=hs&&vs.bridge.validateAppUrl(hs)),vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:vs.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:70,entry:un}}),bs("IOS bridge inits succeed.")}}function un(e,t){if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return vs.bridge.is_verify_success?(ms()&&ms().postMessage(JSON.stringify({callType:"app_h5_track",data:ys.extend({server_url:vs.para.server_url},e.data)})),ys.isFunction(r)&&r(),t.cancellationToken.cancel(),e):vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(ys.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function cn(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||vs.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?ys.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:ms()&&ms().postMessage(JSON.stringify(e)):null}function dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fn(e,t,r){return dn(e,t,r),e.plugin_version=Rs,e}function gn(){if(ws&&!ws.bridge.activeBridge&&_n()){if(ws.bridge.activeBridge=Bs,ws.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:hn()?"success":"fail"},!ws.para.app_js_bridge)return void ks("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");ws.registerInterceptor("sendDataStage",{send:{priority:90,entry:mn}}),ks("IOS obsolete bridge inits succeed.")}}function _n(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function hn(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=Ss.URL(ws.para.server_url).hostname,r=Ss.URL(ws.para.server_url).searchParams.get("project")||"default"}catch(n){ws.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function mn(e,t){function r(e){var t=JSON.stringify(Ss.extend({server_url:ws.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(ws.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(ws.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,Ss.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return ws.para.app_js_bridge.is_send?(ws.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(Ss.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bn(e,t,r){return vn(e,t,r),e.plugin_version=Js,e}function wn(){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=qs}function Sn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return kn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function kn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n); +}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Pn(e,t,r){return Sn(e,t,r),e.plugin_version=Vs,e}function Cn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function On(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function In(e,t,r){return Nn(e,t,r),e.plugin_version=Zs,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return An(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function An(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dn(e,t,r){return Tn(e,t,r),e.plugin_version=tl,e}function $n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=Qs._.extend(e.properties||{},n)}}catch(i){rl("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Gs.call(Qs.kit,e)}function xn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return En(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function En(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ln(e,t,r){return xn(e,t,r),e.plugin_version=al,e}function Un(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Rn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Rn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Bn(e,t,r){return Un(e,t,r),e.plugin_version=Sl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Mn(e,t,r){return Hn(e,t,r),e.plugin_version=Cl,e}function qn(){Ol=!0}function Kn(){Ol=!1}function Fn(){return Ol}function Vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zn(e,t,r){return Vn(e,t,r),e.plugin_version=Tl,e}function Xn(e){var t=e,r="";r=ll.para.debug_mode_url.indexOf("?")!==-1?ll.para.debug_mode_url+"&"+ll.kit.encodeTrackData(e):ll.para.debug_mode_url+"?"+ll.kit.encodeTrackData(e),ul.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(ll.para.debug_mode_upload)},success:function(e){ul.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Zn(e,t){if(ll.para.debug_mode===!0){var r=e.data;e.callback;Xn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Qn(){ll.para.debug_mode===!0&&(ll.para.debug_mode_upload=ll.para.debug_mode_upload||!1,ul.isString(ll.para.debug_mode_url)||(ul.isString(ll.para.server_url)?ll.para.debug_mode_url=ll.para.server_url.replace("sa.gif","debug"):ul.isArray(ll.para.server_url)&&ul.isString(ll.para.server_url[0])?ll.para.debug_mode_url=ll.para.server_url[0].replace("sa.gif","debug"):ll.para.debug_mode=!1))}function Gn(){ll.on("sdkInitPara",function(){Qn()}),ll.on("sdkAfterInitPara",function(){ll.registerInterceptor("sendDataStage",{send:{priority:30,entry:Zn}})})}function Yn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ei(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ei(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ti(e,t,r){return Yn(e,t,r),e.plugin_version=$l,e}function ri(e,t){if(dl.isObject(cl.para.jsapp)&&!cl.para.jsapp.isOnline&&"function"==typeof cl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),cl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ni(){cl.on("sdkAfterInitAPI",function(){dl.isObject(cl.commonWays)&&(cl.commonWays.setOnlineState=ii),cl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ri}})})}function ii(e){if(e===!0&&dl.isObject(cl.para.jsapp)&&"function"==typeof cl.para.jsapp.getData){cl.para.jsapp.isOnline=!0;var t=cl.para.jsapp.getData();dl.isArray(t)&&t.length>0&&dl.each(t,function(e){dl.isJSONString(e)&&cl.kit.sendData(JSON.parse(e))})}else cl.para.jsapp.isOnline=!1}function ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function si(e,t,r){return ai(e,t,r),e.plugin_version=Ll,e}function li(e,t){return!pl.para.app_js_bridge&&pl.para.batch_send&&fl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fi(e,t,r){return di(e,t,r),e.plugin_version=Hl,e}function gi(e){var t=new _l.BeaconSend(e);t.start()}function _i(e,t){var r=null,n=null;_l.isObject(e.config)&&(r=e.config.send_type,n=_l.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===gl.para.send_type;if(i&&_l.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=gl.kit.encodeTrackData(e.data),_l.isArray(a)&&a.length?_l.each(a,function(t){e.callback=null,e.server_url=t,gi(e)}):"string"==typeof a&&""!==a?gi(e):gl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function hi(){"beacon"!==gl.para.send_type||_l.isSupportBeaconSend()||(gl.para.send_type="image")}function mi(){gl.on("sdkInitPara",function(){hi()}),gl.on("sdkAfterInitPara",function(){gl.registerInterceptor("sendDataStage",{send:{priority:110,entry:_i}})})}function vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bi(e,t,r){return vi(e,t,r),e.plugin_version=ql,e}function wi(e){var t=new ml.AjaxSend(e);t.start()}function Si(e,t){var r=null,n=null;ml.isObject(e.config)&&(r=e.config.send_type,n=ml.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===hl.para.send_type;if(i&&ml.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=hl.kit.encodeTrackData(e.data),ml.isArray(a)&&a.length?ml.each(a,function(t){e.callback=null,e.server_url=t,wi(e)}):"string"==typeof a&&""!==a?wi(e):hl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function ki(){"ajax"!==hl.para.send_type||ml.isSupportCors()||(hl.para.send_type="image")}function Pi(){hl.on("sdkInitPara",function(){ki()}),hl.on("sdkAfterInitPara",function(){hl.registerInterceptor("sendDataStage",{send:{priority:120,entry:Si}})})}function Ci(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ni(e,t,r){return Ci(e,t,r),e.plugin_version=Vl,e}function ji(e,t){var r=vl.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function Ii(e){var t=new yl.ImageSend(e);t.start()}function Ti(e,t){var r=null;yl.isObject(e.config)&&(r=yl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,yl.isArray(n)&&n.length?yl.each(n,function(t){t&&(e.data=ji(t,i),e.callback=null,e.server_url=t,Ii(e))}):"string"==typeof n&&""!==n?(e.data=ji(n,i),Ii(e)):vl.logger&&vl.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ai(){"image"!==vl.para.send_type&&"ajax"!==vl.para.send_type&&"beacon"!==vl.para.send_type&&(vl.para.send_type="image")}function Di(){vl.on("sdkInitPara",function(){Ai()}),vl.on("sdkAfterInitPara",function(){vl.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function $i(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ei(e,t,r){return $i(e,t,r),e.plugin_version=va,e}function Li(e){return null===Ql?void Ui(e):void Ql.push(e)}function Ui(e){try{if("log"===e.level&&Ri())return void Ji(e);if("warn"===e.level&&Bi())return void Ji(e);if("error"===e.level&&Hi())return void Ji(e)}catch(t){}}function Ri(){return!!Fi()||(Xl.para.show_log===!0||Zl.isObject(Xl.para.show_log)&&"log"===Xl.para.show_log.level)}function Bi(){return!!Fi()||(Ri()||Zl.isObject(Xl.para.show_log)&&"warn"===Xl.para.show_log.level)}function Hi(){return!!Fi()||(!Zl.isObject(Xl.para.show_log)||"none"!==Xl.para.show_log.level)}function Ji(e){var t=e.content,r=Zl.isObject(t[0])?Zl.formatJsonString(t[0]):t[0],n=Mi(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Zl.isFunction(console[e.level])?console[e.level].apply(console,t):Zl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Mi(e){var t="",r="",n=Xl.para.show_log;return Zl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Zl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Zl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function qi(){Zl.sessionStorage.isSupport()&&sessionStorage.setItem(eu,"true")}function Ki(){Zl.sessionStorage.isSupport()&&sessionStorage.removeItem(eu)}function Fi(){return Zl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(eu)}function Vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zi(e,t,r){return Vi(e,t,r),e.plugin_version=uu,e}var Xi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new d((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new d((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new d((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var p,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),p=5==n.a.length&&1===n.a[0],p&&(a(function(){p=!f('"\t"')}),p&&a(function(){p=1!==f("01")}),p&&a(function(){p=1!==f("1.")})))},function(){p=!1}),t=p}}return o[e]=!!t}function s(e){return D(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,d=n.Date||r.Date,p=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new d((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T="000000",A=function(e,t){return(T+(t||0)).slice(-e)},D=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],p=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;p(r+1,0)<=i;r++);for(n=c((i-p(r,0))/30.42);p(r,n+1)<=i;n++);i=1+i-p(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(D=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+A(6,r<0?-r:r):A(4,r))+"-"+A(2,n+1)+"-"+A(2,i)+"T"+A(2,o)+":"+A(2,s)+":"+A(2,l)+"."+A(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var $=i.stringify;i.stringify=function(e,t,r){var n=d.prototype.toJSON;d.prototype.toJSON=s;var i=$(e,t,r);return d.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=I[t];return r?r:x+A(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,p,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===d.prototype.toJSON?l=D(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),p=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,B));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++B);e+=a.slice(t,B)}if(34==a.charCodeAt(B))return B++,e;q();default:if(t=B,45==i&&(n=!0,i=a.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(B+1),i>=48&&i<=57)&&q(),n=!1;B=48&&i<=57);B++);if(46==a.charCodeAt(B)){for(r=++B;r57));r++);r==B&&q(),B=r}if(i=a.charCodeAt(B),101==i||69==i){for(i=a.charCodeAt(++B),43!=i&&45!=i||B++,r=B;r57));r++);r==B&&q(),B=r}return+a.slice(t,B)}n&&q();var s=a.slice(B,B+4);if("true"==s)return B+=4,!0;if("fals"==s&&101==a.charCodeAt(B+4))return B+=5,!1;if("null"==s)return B+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return B=0,H=""+e,r=F(K()),"$"!=K()&&q(),B=H=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Zi,Qi={setup:function(e){Zi=e},log:function(){(Zi||console&&console.log||function(){}).apply(null,arguments)}},Gi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Gi.get(e))||null}catch(r){Qi.log(r)}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){Qi.log(r)}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Gi.set(t,r),Gi.get(t)!==r&&(e=!1),Gi.remove(t)}catch(n){e=!1}return e}},Yi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Gi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Gi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Gi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Gi.get(e)),Gi.remove(e),Gi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Gi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Gi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Gi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Gi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.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=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),ta=function(e){this.ele=e},ra=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};ta.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(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,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.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),y(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||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=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 ra((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return ra(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+_a.sdk_id+e}},ka={checkIsAddSign:function(e){"track"===e.type&&(Ae()?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(Xi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};wa.isSupport()?wa.set(Te("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):Sa.set(Sa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Ae()||(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)}}},Pa=function(){this._events=[],this.pendingEvents=[]};Pa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(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():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Ca={data:{},id:function(){return this.data.id?this.data.id:(this.data.id=Ee(),this.data.id)},type:function(){return this.data.type?this.data.type:(this.data.type=xe(),this.data.type)}},Oa={distinct_id:function(){},jssdkDebug:function(){},_sendDebug:function(e){},apph5:function(e){var t="app_h5\u6253\u901a\u5931\u8d25-",n={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"},i=e.output,a=e.step,o=e.data||"";"all"!==i&&"console"!==i||Oe(n[a]),("all"===i||"code"===i)&&r(_a.is_debug)&&_a.is_debug.apph5&&(o.type&&"profile"===o.type.slice(0,7)||(o.properties._jssdk_debug_info="apph5-"+String(a)))},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(g(e).protocol!==g(t).protocol)return!1}catch(r){return Ne("\u4e0d\u652f\u6301 _.URL \u65b9\u6cd5"),!1}return!0},serverUrl:function(){d(_a.server_url)&&""!==_a.server_url&&!this.protocolIsSame(_a.server_url,location.href)&&Ne("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){return e!==_a.server_url&&void(d(e)&&""!==e&&!this.protocolIsSame(e,location.href)&&Ne("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"))}}},Na={initPage:function(){var e=Le(),t=Z(),r=Ie(t);r||Oa.jssdkDebug("url_domain\u5f02\u5e38_"+t+"_"+r),this.pageProp={referrer:e,referrer_host:e?q(e):"",url:t,url_host:q(t,"url_host\u53d6\u503c\u5f02\u5e38"),url_domain:r}},pageProp:{},campaignParams:function(){return Xi.kit.getUtmData()},campaignParamsStandard:function(e,t){e=e||"",t=t||"";var r=Na.campaignParams(),n={},i={};return k(r,function(r,a,o){(" "+ma+" ").indexOf(" "+a+" ")!==-1?n[e+a]=o[a]:i[t+a]=o[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,r={$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:va};return r},currentProps:{},register:function(e){P(Na.currentProps,e)}},ja={},Ia=new l;ja.spa=Ia,ja.sdk=new l,ja.data=new l,ja.initSystemEvent=function(){Ye(function(e){Ia.emit("switch",e)})},ja.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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var Ta=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};Ta.prototype.start=function(){var e=this,t=new Date;Ze({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:_a.datasend_timeout,cors:!0,success:function(r,n){ja.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:_a.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){ja.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:_a.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},Ta.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var Aa="sawebjssdk-",Da="tab-sawebjssdk-";tt.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()},_a.batch_send.send_interval)},getServerUrl:function(){return d(_a.server_url)&&""!==_a.server_url||v(_a.server_url)&&_a.server_url.length?void(this.serverUrl=v(_a.server_url)?_a.server_url[0]:_a.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(this.sendTimeStamp&&t()-this.sendTimeStamp<_a.batch_send.send_interval)return!1;var e=Gi.get(this.tabKey);if(e){this.sendTimeStamp=t(),e=i(e)||this.generateTabStorageVal();var r=Ce(e.data);if(r.length){for(var n=[],a=0;a-1&&r.splice(a,1),Gi.remove(e[n])}r=Ce(r),Gi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=Aa+String(n()),a=Gi.get(this.tabKey);null===a?(this.tabKey=Da+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*_a.batch_send.send_interval,Gi.set(this.tabKey,JSON.stringify(a)),Xi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Da+String(n()),Gi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*_a.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var d=new a(n);d.get(s,r,1e3,function(e){if(e){null===Gi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Gi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Gi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var p=i(Gi.get(s))||{expireTime:0};t()-p.expireTime>r&&Gi.remove(s)}}for(var f=0;f0)for(t=0;t_a.max_id_length)},keyLength:function(e){return!(!d(e)||e.length>_a.max_key_length)},stringLength:function(e){return!(!d(e)||e.length>_a.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=Ua._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},Ha={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ra[n])&&Ra[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ra[n])&&Ra[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ra[n])&&Ra[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ra[n])&&Ra[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){rt({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ra[i])&&Ra[i](n)),!0};rt({propertyValue:t},n)}):Ba.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ra[n])&&Ra[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ra[n])&&Ra[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ra[n])&&Ra[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ra[n])&&Ra[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ra[n])&&Ra[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ra[n])&&Ra[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=p(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ja.configIsMatchNew=function(e,t){if(d(e.$element_selector)&&d(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 e.$element_selector.indexOf(t.element_selector)>-1}if(d(e.$element_path)&&d(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 e.$element_path.indexOf(t.element_path)>-1}return!1},Ja.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"]?Ja.configIsMatchNew(e,t):Ja.configIsMatchOldVersion(e,t)))},Ja.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(Ja.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},Ja.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ja.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ja.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ja.getPropElInLi=function(e,t){if(!(e&&_(e)&&d(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Xi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ja.getProp=function(e,t){if(!r(e))return!1;if(!(d(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(d(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!d(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Xi.heatmap.getClosestLi(s);o=Ja.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!d(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ja.getAssignConfigs=function(e,t){var n=Ja.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ma={events:[],getAssignConfigs:Ja.getAssignConfigs,filterConfig:Ja.filterConfig,getProp:Ja.getProp,initUrl:Ja.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),d(a.event_name)&&n.push(a.event_name))}),Xi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Xi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Xi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},qa={events:[],customProp:Ma,getAssignConfigs:Ja.getAssignConfigs,initUrl:Ja.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Xi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Xi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ka={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=Va.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Xi.heatmap.getEleDetail(e);if(!r(t)||!d(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,Va.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ja.getProp,getPropElInLi:Ja.getPropElInLi,filterConfig:Ja.filterConfig},Va={unlimitedDiv:Ka,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Fa,initUrl:function(){var e=Ja.initUrl();if(e){var t;try{t=new f(Xi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Xi.para.heatmap)||!Xi.para.heatmap.get_vtrack_config)return!1;if(Gi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=Ua.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Xi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div&&Xi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Xi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Ga.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div&&Xi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Ga.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(!d(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){var t=function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&d(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null};return t(e,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Xi.heatmap.getClosestLi(e);if(!i||!_(e)||!d(e.tagName))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Xi.is_heatmap_render_mode=!0,Xi.para.heatmap||(Xi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Xi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Xi.para.heatmap_url||(Xi.para.heatmap_url=ht()+"//static.sensorsdata.cn/sdk/"+Xi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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=We({target:e});r.$element_selector=t?t:"",r.$element_path=Xi.heatmap.getElementPath(e,Xi.para.heatmap&&"not_use_id"===Xi.para.heatmap.element_selector);var n=Xi.heatmap.getElementPosition(e,r.$element_path,Xi.para.heatmap&&"not_use_id"===Xi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Xi.para.heatmap)&&e(Xi.para.heatmap.collect_element)&&!Xi.para.heatmap.collect_element(n))return!1;var s=Ga.getBasicEleInfo(t,n,i,a,o);mt(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Xi.para.heatmap&&Xi.para.heatmap.custom_property){var c=Xi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div?!!(r(Xi.para.heatmap)&&r(Xi.para.heatmap.collect_tags)&&r(Xi.para.heatmap.collect_tags.div)&&v(Xi.para.heatmap.collect_tags.div.ignore_tags)&&re(Xi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Xi.para&&Xi.para.heatmap&&Xi.para.heatmap.collect_tags&&Xi.para.heatmap.collect_tags.div&&Xi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Xi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Xi.para.heatmap)||"default"!==Xi.para.heatmap.scroll_notice_map)return!1;var t=!0;Xi.para.scrollmap&&e(Xi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Xi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Xi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=Q(),e.event_duration=Math.min(Xi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,vt(e)),this.current_time=n}});i.current_time=new Date,De(window,"scroll",function(){return!!t&&void i.go()}),De(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Xi.para.heatmap)||"default"!==Xi.para.heatmap.clickmap)&&(e(Xi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Xi.para.heatmap.collect_url()}),"all"===Xi.para.heatmap.collect_elements?Xi.para.heatmap.collect_elements="all":Xi.para.heatmap.collect_elements="interact",void("all"===Xi.para.heatmap.collect_elements?De(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=d(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):De(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Xi.heatmap.getTargetElement(a,e);return!(!_(o)&&!d(a.tagName))&&void(_(o)&&d(o.tagName)?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Xi.para.heatmap)&&Xi.para.heatmap.get_vtrack_config&&Ka.events.length>0&&Ka.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"}))})))}},Ya={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Xi.log("error: isReady callback must be function")},getUtm:function(){return Na.campaignParams()},getStayTime:function(){return(new Date-Xi._t)/1e3},setProfileLocal:function(e){if(!Gi.isSupport())return Xi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=Ua.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(Ua.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Xi.setProfile(e))}else Ua.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Xi.setProfile(e)},setInitReferrer:function(){var e=Le();Xi.setOnceProfile({_init_referrer:e,_init_referrer_host:Na.pageProp.referrer_host})},setSessionReferrer:function(){var e=Le();Ua.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:Na.pageProp.referrer_host})},setDefaultAttr:function(){Na.register({_current_url:location.href,_referrer:Le(),_referring_host:Na.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Xi.para.heatmap&&Xi.para.heatmap.track_attr?Xi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Ga.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Ga.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Xi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:Q(),$title:document.title},e,yt()),t),i=Z()}var i;i=this.autoTrackIsUsed?Na.pageProp.url:Na.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,bt(Xi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=yt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Xi.para.is_single_page&&w(function(){var r=Le(a,!0);Xi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:Q(),$title:document.title},n,e),t),a=Z()}),Xi.track("$pageview",P({$referrer:Le(null,!0),$url:Z(),$url_path:Q(),$title:document.title},n,e),t),bt(Xi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(Ua._state)?"SDK is not initialized.":Ua.getAnonymousId()},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Xi.modules)&&Xi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Xi.use.apply(Xi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},eo={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},to=1,ro={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:It,unbind:Tt,trackLink:At,trackLinks:Dt,setItem:$t,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Bt,unsetProfile:Ht,identify:Jt,resetAnonymousIdentity:Mt,trackSignup:Kt,registerPage:Ft,clearAllRegister:Vt,clearPageRegister:Wt,register:zt,registerOnce:Xt,registerSession:Zt,registerSessionOnce:Qt,login:Gt,loginWithKey:Yt,logout:er,getPresetProperties:tr,readyState:eo,debug:Oa,on:et,log:Oe};Qi.setup(Oe);var no=P({},pa,Ea),io={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:Xi.para.use_app_track_is_send!==!1&&"only"!==Xi.para.use_app_track,white_list:[],is_mui:"mui"===Xi.para.use_app_track};"object"==typeof Xi.para.app_js_bridge?Xi.para.app_js_bridge=P({},e,Xi.para.app_js_bridge):Xi.para.use_app_track!==!0&&Xi.para.app_js_bridge!==!0&&"only"!==Xi.para.use_app_track&&"mui"!==Xi.para.use_app_track||(Xi.para.app_js_bridge=P({},e)),Xi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Xi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ar};nr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),ir(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},nr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},nr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),ir(r)},or.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Xi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ao={isSeachHasKeyword:function(){return""!==F(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=F(e,"sa-request-id")||null,r=F(e,"sa-request-type")||null,n=F(e,"sa-request-url")||null;if(Ga.setNotice(n),la.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Xi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Xi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Xi.heatmap_version&&Xi.heatmap_version===Xi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Xi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return la.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Ga.setNotice(),ao.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=d(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&d(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return d(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Ga.setNotice(i),la.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ao.isReady(r,n)}},oo={isStorageHasKeyword:function(){return la.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(lr("sa-visual-mode")===!0||"true"===lr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Xi.para.vtrack_url?Xi.para.vtrack_url:ht()+"//static.sensorsdata.cn/sdk/"+Xi.lib_version+"/vtrack.min.js"})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(la.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var t=e.data.data.userURL;d(t)&&(window.location.href=encodeURI(t.replace(/javascript:/i,"")))}else oo.loadVtrack();window.removeEventListener("message",oo.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",oo.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",oo.messageListener,!1),oo.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:va}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),oo.postMessage()}},so=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],lo={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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){}};vr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new mr(t,n,Xi),a=0;a=2)&&(Po&&(Or(!0),_r()),ja.initSystemEvent(),Xi.setInitVar(),Xi.readyState.setState(2),Xi.initPara(e),ja.sdk.emit("initPara"),ja.sdk.emit("afterInitPara"),ja.sdk.emit("initAPI"),ja.sdk.emit("afterInitAPI"),Xi.detectMode(),rr(),ja.sdk.emit("afterInit"),void ja.sdk.emit("ready"))},Po?Or(!1):(Or(!0),_r());var Co,Oo,No,jo,Io,To,Ao,Do,$o,xo,Eo,Lo,Uo,Ro,Bo,Ho,Jo,Mo,qo="1.26.9",Ko={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Fo=Ir(Ko),Vo="1.26.9",Wo={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},zo=Dr(Wo,"Amp","sdkReady"),Xo=window.SensorsData_App_Visual_Bridge,Zo=Xo&&Xo.sensorsdata_visualized_mode,Qo=Xo&&Xo.sensorsdata_visualized_alert_info,Go=Xo&&Xo.sensorsdata_hover_web_nodes,Yo={isVerify:function(){return Zo&&(Zo===!0||Zo.call(Xo))},commands:{app_alert:$r,visualized_track:xr,page_info:xr,sensorsdata_get_app_visual_config:Er}},es="1.26.9",ts={init:function(e){jo=e,Io=jo&&jo._,To=jo&&jo.log||console&&console.log||function(){},Br()},handleCommand:Jr},rs=Rr(ts,"AndroidBridge","sdkAfterInitPara"),ns=window.SensorsData_App_Visual_Bridge,is=ns&&ns.sensorsdata_visualized_mode,as=ns&&ns.sensorsdata_visualized_alert_info,os=ns&&ns.sensorsdata_hover_web_nodes,ss={isVerify:function(){return is&&(is===!0||is.call(ns))},commands:{app_alert:Mr,visualized_track:qr,page_info:qr,sensorsdata_get_app_visual_config:Kr}},ls="1.26.9",us={init:function(e){Eo=e,Lo=Eo&&Eo._,Uo=Eo&&Eo.log||console&&console.log||function(){},zr()},handleCommand:Zr},cs=Wr(us,"AndroidObsoleteBridge","sdkAfterInitPara"),ds="1.26.9",ps={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Ro=Bo._,Ho=Bo.store,!!Ro.localStorage.isSupport()&&(Bo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Bo||!e)return!1;t=t||{},Jo=t.cookie_name||"sensorsdata2015jssdkchannel",Bo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Bo.registerPage({$is_channel_callback_event:function(e){if(Ro.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!ps.eventList.hasEvent(e.event)&&(ps.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Ro.isReferralTraffic(document.referrer)){var r=Ro.getQueryParam(location.href,"sat_cf");Ro.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),ps.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Bo.registerPage(t):Bo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Bo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Bo.kit.userDecryptIfNeeded(Ro.cookie.get(Jo));return e=Ro.safeJSONParse(e),!(!Ro.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Bo.para.encrypt_cookie&&(r=Bo.kit.userEncrypt(r)),Ro.cookie.set(Jo,r)}},channelLinkHandler:function(){this.eventList.reset(),Bo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Ro.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Ro.isNumber(e.latest_event_initial_time)&&Ro.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&js(arguments[0])?t=arguments[0]:arguments.length>=2&&js(arguments[1])&&(t=arguments[1])),!Ns())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(js(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ts(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Is(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?($s.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):($s.data=e,$s.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){$s.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===Os){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Ds(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),As(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=_s().visibilityChange,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},xs=rn($s,"Deeplink","sdkReady"),Es="1.26.9",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},ln()},handleCommand:cn},Us=sn(Ls,"IOSBridge","sdkAfterInitPara"),Rs="1.26.9",Bs={init:function(e){ws=e,Ss=ws&&ws._,ks=ws&&ws.log||console&&console.log||function(){},gn()}},Hs=fn(Bs,"IOSObsoleteBridge","sdkAfterInitPara"),Js="1.26.9",Ms=5e3,qs=432e3;wn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},wn.prototype.log=function(e){this.sd&&this.sd.log(e)},wn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Ms)},wn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},wn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},wn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&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()}},wn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},wn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},wn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},wn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},wn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},wn.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()}})},wn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},wn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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()},wn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},wn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},wn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},wn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},wn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Ks=new wn,Fs=bn(Ks,"PageLeave","sdkReady"),Vs="1.26.9",Ws=!1,zs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ws||(e.track("$WebPageLoad",l),Ws=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Xs=Pn(zs,"PageLoad","sdkReady");On.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Cn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Zs="1.26.9";On.prototype.plugin_name="RegisterProperties";var Qs,Gs,Ys=new On,el=In(Ys),tl="1.26.9",rl=window.console&&window.console.log||function(){},nl={init:function(e){return Qs=e,rl=Qs&&Qs.log||rl,e&&e.kit&&e.kit.buildData?(Gs=Qs.kit.buildData,Qs.kit.buildData=$n,void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void rl("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},il=Dn(nl,"RegisterPropertyPageHeight","sdkReady"),al="1.26.9",ol={};ol.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},ol.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},ol.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},ol.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var p=u.indexOf("?");a=p>-1?o>-1?s+l+"#"+u.substring(1,o)+d(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+d(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},ol.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},ol.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},ol.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},ol.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var sl,ll,ul,cl,dl,pl,fl,gl,_l,hl,ml,vl,yl,bl=Ln(ol,"SiteLinker","sdkReady"),wl="utm_source utm_medium utm_campaign utm_content utm_term",Sl="1.26.9",kl={init:function(e){function t(){var e=wl.split(" "),t="",r={};return sl._.isArray(sl.para.source_channel)&&sl.para.source_channel.length>0&&(e=e.concat(sl.para.source_channel),e=sl._.unique(e)),sl._.each(e,function(e){t=sl._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!sl&&(sl=e,sl.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},Pl=Bn(kl,"Utm","sdkAfterInitPara"),Cl="1.26.9",Ol=!1,Nl=null,jl={init:function(e){Nl=e,Nl.disableSDK=qn,Nl.enableSDK=Kn,Nl.getDisabled=Fn}},Il=Mn(jl,"DisableSDK","sdkInitAPI"),Tl="1.26.9",Al={plugin_name:"DebugSender",init:function(e){ll=e,ul=ll._,Gn()}},Dl=zn(Al),$l="1.26.9",xl={plugin_name:"JsappSender",init:function(e){cl=e,dl=cl._,ni()}},El=ti(xl),Ll="1.26.9",Ul=null,Rl={plugin_name:"BatchSender",init:function(e){pl=e,fl=pl._,ci()}},Bl=si(Rl),Hl="1.26.9",Jl={plugin_name:"BeaconSender",init:function(e){gl=e,_l=gl._,mi()}},Ml=fi(Jl),ql="1.26.9",Kl={plugin_name:"AjaxSender",init:function(e){hl=e,ml=hl._,Pi()}},Fl=bi(Kl),Vl="1.26.9",Wl={plugin_name:"ImageSender",init:function(e){vl=e,yl=vl._,Di()}},zl=Ni(Wl),Xl=null,Zl=null,Ql=[],Gl={init:function(e){e&&(Xl=e,Zl=Xl._,Xl.logger&&Xl.logger.appendWriter(Li),Xl.on&&Xl.on("sdkAfterInitPara",function(){for(var e=0;e "):h(t.parentNode,e)):(e.unshift("body"),e.join(" > "))}function d(t){var e=t.getBoundingClientRect(),s=e.top+(document.body.scrollTop||document.documentElement.scrollTop),i=e.left+(document.body.scrollLeft||document.documentElement.scrollLeft),r=U.ry(t).getStyle("z-index")||0;return{width:e.width,height:e.height,top:s,left:i,zIndex:r}}function p(t,e){var s={};return U.each(e||[],function(e){var i=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});s[e]=U.ry(t).getStyle(i)}),s}function _(t){var e=t.childNodes,s="",i=!1;return U.each(e,function(t){if(i===!1&&3===t.nodeType){var e=t.textContent||t.innerText||t.nodeValue||"";e&&(s=U.trim(e),i=!0)}}),s}function g(t){var e=t.match(/[\d.]+/g);if(e.length>=3){var s,i,r;return s=e[0],i=e[1],r=e[2],"rgb("+s+","+i+","+r+")"}return""}function f(t,e,s){var i=U.getUA(),r=i.ie&&i.ie<9,n="";U.each(e,function(t,e){r&&t.indexOf("rgba")>-1&&(t=g(t));var s=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});n+=s+": "+t+" !important;"}),""!==n&&(s=U.encodeSelector(s),n="[sensors_ab_ele_style_id="+s+"]{"+n+"}",A({attr_value:s,text:n,attr_key:"sensors_ab_ele_style_id"}),t.setAttribute("sensors_ab_ele_style_id",s))}function m(t,e){var s=t.tagName,i=_(t);i!==e&&(t.textContent?t.textContent=e:t.innerText?t.innerText=e:t.innerHTML=e,"input"!==s&&"INPUT"!==s||(t.value=e||""))}function v(t,e){var s=t.originProps||{},i=e.originProps||{},r=s.attributes||{},n=i.attributes||{},a=!0;return s.text&&s.text!==i.text&&(a=!1),r&&U.each(["src","href","target"],function(t){r[t]&&r[t]!==n[t]&&(a=!1)}),a}function b(t,e,s){t.setAttribute(e,s)}function y(t,e){var s=e.originProps,i={attributes:{}},r=s.attributes;return U.each(r.style||{},function(e,s){i.attributes.style[s]=U.ry(t).getStyle(s)}),Object.hasOwnProperty.call(s,"text")&&(i.attributes.text=_(t)),U.each(["src","href"],function(e){Object.hasOwnProperty.call(r,e)&&(i.attributes[e]=t[e])}),Object.hasOwnProperty.call(r,"target")&&(i.attributes.target=t.getAttribute("target")),i}function S(t,e,s){s||(s=y(t,e));var i=v(e,s);if(i){var r=e.props;U.isObject(r)&&T(t,r,e)}return i}function T(t,e,s){if(Object.hasOwnProperty.call(e,"attributes")){var i=e.attributes;Object.hasOwnProperty.call(i,"style")&&f(t,i.style,s.selector),U.each(["href","target","src"],function(e){i[e]&&t.getAttribute(e)!==i[e]&&b(t,e,i[e])})}Object.hasOwnProperty.call(e,"text")&&"innerHtml"!==s.type&&m(t,e.text)}function A(t){try{var e=document.createElement("style");e.innerHTML=t.text,e.setAttribute(t.attr_key,t.attr_value),document.getElementsByTagName("head")[0].append(e)}catch(s){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(t,s.stack||s.message)}}function B(t){try{var e=document.createElement("script");e.setAttribute(t.attr_key,t.attr_value),e.innerHTML="try{"+t.text+"}catch(e){ window.sensorsABTestModifyListener && window.sensorsABTestModifyListener("+JSON.stringify(t)+", e.stack || e.message) }",document.body.append(e)}catch(s){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(t,s.stack||s.message)}}function k(t,e){U.loadScript(U.extend({success:function(){},error:function(){},type:"js",url:t},e))}function x(t){var e={childList:!0,subtree:!0},s=window.MutationObserver,i=new s(t);return i.observe(document.body,e),i}function w(t){t&&t.disconnect()}function D(t,e,s){var i=t.tagName.toLowerCase(),r=p(t,e),n={selector:h(t),originProps:{attributes:{style:r},text:_(t),hasChildren:t.children.length>0},type:"text",tagName:i};"a"===i&&(n.originProps.attributes.href=t.href,t.getAttribute("target")&&(n.originProps.attributes.target=t.getAttribute("target")),n.type="link"),"img"===i&&(n.originProps.attributes.src=t.src,n.type="img"),t.hasAttribute("sensors_ab_widget")&&(n.type="innerHtml");var a=t.getAttribute("style");if(s)for(var o=0;o-1&&t.parentElement.removeChild(t)}),i&&s&&i.removeAttribute(s)}function L(t,e){var s=U.getDomBySelector(t.base),i=t.props.text,r=t.props.sensors_ab_widget,n=t.operation;if(!s)throw"VABTest: No base element";if(!s.parentNode)throw"base element parentNode not found";var a=document.createElement("font");if("text"===r&&(a.innerText=i),"html"===r&&(a.innerHTML=i),P(a,t,e),"BEFORE_INSERTION"===n)s.parentNode.insertBefore(a,s);else{if("AFTER_INSERTION"!==n)throw"operation not supported";s.nextSibling?s.parentNode.insertBefore(a,s.nextSibling):s.parentNode.appendChild(a)}var o=h(a);return o}function j(t,e){var s=t.selector,i=t.props.text,r="text"===t.props.sensors_ab_widget;const n=document.querySelector(s);if(!n)throw"element not found:"+s;r?n.innerText=i:n.innerHTML=i,P(n,t,e)}function N(t,e,s){function i(){return r=L(t,e)}var r=null,n=null,a=U.getDomBySelector(t.selector)||document.querySelector&&document.querySelector(t.selector);if(a&&a.hasAttribute("sensors_ab_widget")){j(t,e);var o=d(document.querySelector(t.selector));s&&s.setSelectElePostion(o)}else s?n=s.getModifiedEleSelectorsWhen(i):i();return{selector:t.selector,addedEleSelector:r,updatedSelectors:n}}function P(t,e,s){if(s&&s.length)for(var i=0;i0||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",e.param_name),r.verify_success=!1);break;case"value_type":U.isString(e.value_type)&&U.indexOf(i.value_type_list,e.value_type)!==-1||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",e.value_type),r.verify_success=!1);break;case"default_value":"undefined"==typeof e.default_value?(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),r.verify_success=!1):i.valueType(e.default_value,e.value_type)||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",e.default_value,e.value_type),r.verify_success=!1);break;case"callback":U.isFunction(e.callback)||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),r.verify_success=!1);break;default:r.verify_success=!1}else if("not_essential"===s)switch(n){case"timeout_milliseconds":e.timeout_milliseconds=e.timeout_milliseconds||i.SensorsABTest.para.timeout_milliseconds||i.SensorsABTest.default_para.timeout_milliseconds,(!U.isNumber(e.timeout_milliseconds)||U.isNumber(e.timeout_milliseconds)&&e.timeout_milliseconds<=0)&&(i.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",e.timeout_milliseconds),e.timeout_milliseconds=i.SensorsABTest.para.timeout_milliseconds),e.timeout_milliseconds<200&&(e.timeout_milliseconds=200);break;case"properties":e.properties=U.isObject(e.properties)?e.properties:{}}}),r.para=e,r},resolveCustomProperties:function(t){var e=this,s={verify_success:!0,para:null},i=t.custom_properties;if(!U.isObject(i)||U.isEmptyObject(i))return delete t.custom_properties,s.para=t,s;if(U.each(i,function(t,i){if((!U.isString(i)||!e.regName.test(i)||i.length>100)&&(e.SensorsABTest.log(" property name [ "+i+" ] is not invalid "),s.verify_success=!1),(U.isString(t)||U.isNumber(t)||U.isBoolean(t)||U.isArray(t)||U.isDate(t))&&!(U.isString(t)&&t.length>500)||(e.SensorsABTest.log("property [ "+i+" ] of value [ "+JSON.stringify(t)+" ] is not invalid"),s.verify_success=!1),U.isArray(t)){var r=!0;U.each(t,function(t){r!==!1&&(U.isString(t)||(r=!1))}),r||(e.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+i+" ] of value "+JSON.stringify(t)+" is not invalid"),s.verify_success=!1)}}),s.verify_success===!0){var r={};U.each(i,function(t,e){U.isDate(t)?r[e]=U.formatDate(t):U.isString(t)?r[e]=t:r[e]=JSON.stringify(t)}),t.custom_properties=r}return s.para=t,s}},U.VerifyStore=t,U.listenPageState=function(t){var e={visibleHandle:U.isFunction(t.visible)?t.visible:function(){},hiddenHandler:U.isFunction(t.hidden)?t.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 t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}};e.init()},U.listenPageState=function(t){var e={visibleHandle:U.isFunction(t.visible)?t.visible:function(){},hiddenHandler:U.isFunction(t.hidden)?t.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 t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}};e.init()},U.getStorageData=function(t,e){var s=U.localStorage.get(t);U.isString(s)&&(s=e.kit.userDecryptIfNeeded(s));try{s=JSON.parse(s)}catch(i){U.log(i)}return s},U.setStorageData=function(t,e,s){t=JSON.stringify(t),s&&(t=U.userEncrypt(t)),U.localStorage.set(e,t)},e.prototype={createMaskStyle:function(){var t="["+this.attr_name+"],["+this.attr_name+"] body{opacity:0 !important;-khtml-opacity:0 !important;-moz-opacity:0;filter:alpha(opacity=0);}",e=document.createElement("style");e.type="text/css";try{e.appendChild(document.createTextNode(t))}catch(s){e.styleSheet.cssText=t}try{this.style_element=e,document.getElementsByTagName("head")[0].appendChild(e)}catch(s){U.log("error when create calls")}},show:function(t){try{var e=this;if(this.is_abort)return!1;var s=null;if(s=document.getElementsByTagName("html")[0],!U.isElement(s))return;s.setAttribute(this.attr_name,"1"),this.is_added=!0,U.isNumber(t)&&(this.remove_timer=setTimeout(function(){e.is_timeout=!0,e.remove()},t))}catch(i){U.log("error when show calls")}},remove:function(){try{if(this.is_abort||(this.is_abort=!0),this.is_added){this.is_added=!1;var t=null;if(t=document.getElementsByTagName("html")[0],!U.isElement(t))return;t.removeAttribute(this.attr_name),this.style_element&&(document.getElementsByTagName("head")[0].removeChild(this.style_element),this.style_element=null)}this.remove_timer&&(clearTimeout(this.remove_timer),this.remove_timer=null)}catch(e){U.log("error when remove calls")}}},U.Mask=e,i.prototype={init:function(t){return!!this.setPara(t)&&(this.bridgeState="ab_no_host_bridge",/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?this.SensorsABTest.state.platform="H5":this.SensorsABTest.state.platform="Web",this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f\uff0c\u8bd5\u9a8c URL\uff1a",t.url),this.SensorsABTest.checkSADebug(),void this.SensorsABTest.store.init(this.getResultFromServer,this))},setPara:function(t){if(!U.isString(t.url)||"http"!==t.url.slice(0,4))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1;if("https"===location.protocol.slice(0,5)&&"http:"===t.url.slice(0,5))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0chttps \u9875\u9762\u5fc5\u987b\u4f7f\u7528 https \u7684 URL"),!1;var e=U.getQueryParam(t.url,"project-key");if(!e)return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff08\u5fc5\u987b\u5305\u542b project-key\uff09\uff01"),!1;t.project_key=e;var s=this.SensorsABTest.verifyStore.para("A/B Testing SDK \u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=U.extend({},this.SensorsABTest.default_para,s.para),U.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),U.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},asyncFetch:function(t){var e=this;this.SensorsABTest.normalStore.getCodeExpResultFromServer({para:t,suc:function(s){if(U.isObject(s)&&"SUCCESS"===s.status){var i=e.SensorsABTest.getExpResult(t);t.callback(i)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})},creatRequestData:function(t){var e="";U.isEmptyObject(this.SensorsABTest.sd.store._state)||(e=this.SensorsABTest.sd.store._state._first_id||this.SensorsABTest.sd.store._state.first_id||this.SensorsABTest.sd.store._state._distinct_id||this.SensorsABTest.sd.store._state.distinct_id);var s={anonymous_id:e,platform:this.SensorsABTest.state.platform,abtest_lib_version:this.SensorsABTest.lib_version,properties:{$is_first_day:this.SensorsABTest.sd._.cookie.getNewUser()}};return U.isObject(t.properties)&&(s.properties=U.extend({},s.properties,t.properties)),U.isObject(t.custom_properties)&&(s.custom_properties=U.extend({},t.custom_properties),s.param_name=t.param_name),this.SensorsABTest.sd.store._state.first_id&&(s.login_id=this.SensorsABTest.sd.store.getDistinctId()),s},getCodeExpResultFromServer:function(t){this.getResultFromServer(t,!0)},getResultFromServer:function(t,e){function s(){var t=i.SensorsABTest.sd.store.getDistinctId();i.SensorsABTest.sd._.ajax({url:i.SensorsABTest.para.url,type:"POST",data:JSON.stringify(o),credentials:!1,contentType:"application/json",timeout:r.timeout_milliseconds||i.SensorsABTest.para.timeout_milliseconds,cors:!0,success:function(s){e?i.SensorsABTest.dealCodeExpResponseData(s,t):i.SensorsABTest.dealResponseData(s,t),n&&n(s),i.SensorsABTest.fetchData.setNextFetch()},error:function(t){i.SensorsABTest.log("\u670d\u52a1\u7aef\u8bf7\u6c42\u53d1\u9001\u5931\u8d25",t),a&&a(),i.SensorsABTest.fetchData.setNextFetch()}})}var i=this;t=U.isObject(t)?t:{};var r=t.para||{},n=t.suc,a=t.err,o=this.creatRequestData(r);this.SensorsABTest.log("\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),s()}},i.prototype.methods={asyncFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!s.verify_success)return void t.callback(t.default_value);t=s.para,this.SensorsABTest.normalStore.asyncFetch(t)}},fastFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(U.isObject(s)){var i=this.SensorsABTest.getExpResult(t,s);return void t.callback(i)}var r=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!r.verify_success)return void t.callback(t.default_value);t=r.para,this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.normalStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!U.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}},r.prototype={init:function(t){var e=this;return this.SensorsABTest.state.storage.name="sawebjssdkabtest_bridge",!!this.setPara(t)&&(this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f"),this.abBridge=new this.SensorsABTest.sd.JSBridge({type:"abtest",app_call_js:function(t){try{t=U.base64Decode(t)}catch(s){e.SensorsABTest.log("App\u6570\u636ebase64\u89e3\u7801\u5f02\u5e38",t)}try{t=JSON.parse(t),t.message_id&&this["double"](t)}catch(s){e.SensorsABTest.log("App\u6570\u636e\u89e3\u6790\u5f02\u5e38",t)}}}),U.isObject(window.SensorsData_iOS_JS_Bridge)&&window.SensorsData_iOS_JS_Bridge.sensorsdata_abtest_module&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":U.isObject(window.SensorsData_APP_New_H5_Bridge)&&U.isFunction(window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module)&&window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module()&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":this.SensorsABTest.bridgeState="ab_no_abtest_bridge",void this.SensorsABTest.store.init(this.getResultFromApp,this))},setPara:function(t){var e=this.SensorsABTest.verifyStore.para("\u6253\u901a\u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=U.extend({},this.SensorsABTest.default_para,e.para),U.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),U.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},getResultFromApp:function(t){function e(){"ab_bridge_ok"===s.SensorsABTest.bridgeState?s.abBridge.requestToApp({data:{properties:i.properties,timeout:a,request_body:o},callback:function(t){U.isObject(t)&&U.isObject(t.data)?(s.SensorsABTest.log("\u6210\u529f\u83b7\u53d6\u5230 App \u7aef\u8fd4\u56de\u7684\u8bd5\u9a8c\u6570\u636e","data:",t),s.SensorsABTest.dealResponseData(t.data),r&&r(t)):(s.SensorsABTest.log("App \u7aef\u8bf7\u6c42\u5931\u8d25"),n&&n()),s.SensorsABTest.fetchData.setNextFetch()},timeout:{time:a,callback:function(){s.SensorsABTest.log("\u83b7\u53d6App\u7aef\u6570\u636e\u5931\u8d25"),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}}}):n&&(s.SensorsABTest.log("A/B Testing \u6253\u901a\u5931\u8d25\uff0c",s.SensorsABTest.bridgeState),n())}var s=this;t=U.isObject(t)?t:{};var i=t.para||{},r=t.suc,n=t.err,a=i.timeout_milliseconds||this.SensorsABTest.para.timeout_milliseconds,o={origin_platform:"H5"};U.isObject(i.custom_properties)&&(o=U.extend(o,{custom_properties:i.custom_properties,param_name:i.param_name})),this.SensorsABTest.log("\u5411App\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e()},asyncFetch:function(t){var e=this;this.SensorsABTest.bridgeStore.getResultFromApp({para:t,suc:function(s){if(U.isObject(s.properties)&&(t.properties=U.extend(s.properties,t.properties)),"SUCCESS"===s.data.status){var i=e.SensorsABTest.getExpResult(t);t.callback(i)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})}},r.prototype.methods={asyncFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);return s.verify_success?(t=s.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState?void t.callback(t.default_value):void this.SensorsABTest.bridgeStore.asyncFetch(t)):void t.callback(t.default_value)}},fastFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(U.isObject(s)){var i=this.SensorsABTest.getExpResult(t,s);return void t.callback(i)}var r=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!r.verify_success)return void t.callback(t.default_value);if(t=r.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState)return void t.callback(t.default_value);this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.bridgeStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!U.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}},n.prototype.init=function(t){if(this.pause_sdk_before_trigger=t.pause_sdk_before_trigger||!1,t.pause_sdk_before_trigger===!0){var e=this;this.sd.registerInterceptor("sendDataStage",{send:{priority:0,entry:function(t,s){e.sendInterceptor(t,s)}}})}},n.prototype.start=function(){this.pause_sdk_before_trigger!==!1&&(this.events=[],this.isStart=!0)},n.prototype.stop=function(){if(this.pause_sdk_before_trigger!==!1){this.isStart=!1;var t=this;U.each(this.events,function(e){e._flush_time=(new Date).getTime(),t.sd.kit.sendData(e)}),this.events=[]}},n.prototype.sendInterceptor=function(t,e){var s=t.data,i=s.event,r=s.type;return this.isStart===!0&&"track"===r&&["$ABTestTrigger","WebABTestTrigger"].indexOf(i)<0&&(this.events.push(s),e.cancellationToken.stop()),t},a.prototype.init=function(t){return this.initPara(t),this.para?(this.eventInterceptor=new n(this.SensorsABTest),this.eventInterceptor.init(this.para),this.eventInterceptor.start(),U.getQueryParam(location.href,"saSDKMultilink")?(this.is_filtered_out=!0,!1):(this.start_time=(new Date).getTime(),this.para.use_mask&&this.initMask(),void this.addSinglePageListener())):(this.SensorsABTest.log("multilink is closed"),!1)},a.prototype.addSinglePageListener=function(){var t=this;this.SensorsABTest.sd.ee.spa.prepend("switch",function(e){return e!==location.href&&(t.is_filtered_out=!1,t.isFirst=!0,t.mask_instance&&t.mask_instance.remove(),U.getQueryParam(location.href,"saSDKMultilink")?(t.is_filtered_out=!0,!1):(t.eventInterceptor&&t.eventInterceptor.start(),t.start_time=(new Date).getTime(),t.para.use_mask&&t.initMask(),void t.resolve()))})},a.prototype.initMask=function(){this.mask_instance=new U.Mask("link_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.para.timeout)},a.prototype.initPara=function(t){if(U.isFunction(t))try{t=t()}catch(e){return this.SensorsABTest.log("link para error!"),void(this.para=!1)}t===!1?this.para=!1:U.isObject(t)&&(this.para.timeout=U.isNumber(t.timeout)&&t.timeout>=0?t.timeout:500,this.para.use_mask=U.isBoolean(t.use_mask)?t.use_mask:this.para.use_mask,this.para.control_link_search=U.isString(t.control_link_search)?t.control_link_search:"default",this.para.experiment_link_search=U.isString(t.experiment_link_search)?t.experiment_link_search:"default",this.para.pass_params=!U.isBoolean(t.pass_params)||t.pass_params,this.para.onRedirect=U.isFunction(t.onRedirect)?t.onRedirect:null,this.para.pause_sdk_before_trigger=!!U.isBoolean(t.pause_sdk_before_trigger)&&t.pause_sdk_before_trigger)},a.prototype.resolve=function(){var t=this.SensorsABTest.results,e=this;if(!this.para||!U.isArray(t)||this.is_filtered_out||!this.isFirst||0===this.para.timeout)return this.eventInterceptor&&this.eventInterceptor.stop(),!1;if((new Date).getTime()-this.start_time>this.para.timeout)return this.SensorsABTest.log("The multilink was stopped because the request timeout"),this.eventInterceptor&&this.eventInterceptor.stop(),!1;this.isFirst=!1;var s=!1;U.each(t,function(t){return!(!U.isObject(t)||s||"LINK"!==t.experiment_type)&&void(e.isTriggerLinkExp(t)&&(s=!0,e.SensorsABTest.trackOutTestTrigger("LINK"),e.redirectUrl(t)))}),!s&&this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),!s&&this.eventInterceptor&&this.eventInterceptor.stop()},a.prototype.stopTrigger=function(){this.isFirst!==!1&&(this.isFirst=!1,this.SensorsABTest.log("The multilink was stopped because the request failed"),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),this.eventInterceptor&&this.eventInterceptor.stop())},a.prototype.isTriggerLinkExp=function(t){return U.isString(t.control_link)&&U.isString(t.link_match_type)?"REGEXP"===t.link_match_type?!!U.checkUrlIsRegexp(t.control_link,t.regexp_flags)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):!!U.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},a.prototype.redirectUrl=function(t){function e(t){return U.secCheck.isHttpUrl(t)?U.secCheck.removeScriptProtocol(t):(this.SensorsABTest.log("\u975e\u6cd5URL"),!1)}if(!t.experiment_link||!U.isString(t.experiment_link))return this.SensorsABTest.log("\u9875\u9762\u8df3\u8f6c\u5931\u8d25\uff0cexperiment_link\u5b57\u6bb5\u5f02\u5e38",t.abtest_experiment_id),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),void(this.eventInterceptor&&this.eventInterceptor.stop());if(t.is_control_group===!0&&("STRICT"===t.link_match_type||"REGEXP"===t.link_match_type))return this.SensorsABTest.triggerHandle(t), +define(function(){"use strict";function t(t){this.SensorsABTest=t}function e(t){this.attr_name="sa-abtest-"+t,this.remove_timer=null,this.is_added=!1,this.is_abort=!1,this.is_timeout=!1,this.style_element=null,this.createMaskStyle()}function s(t){t._.extend(U,t._)}function i(t){this.SensorsABTest=t,this.para=t.para}function r(t){this.SensorsABTest=t,this.para=t.para}function n(t){this.sd=t.sd,this.abTest=t,this.events=[],this.isStart=!1,this.pause_sdk_before_trigger=!1}function a(t){this.SensorsABTest=t,this.isFirst=!0,this.start_time=null,this.mask_instance=null,this.is_filtered_out=!1,this.para={timeout:500,use_mask:!0,pass_params:!0,control_link_search:"default",experiment_link_search:"default",pause_sdk_before_trigger:!1}}function o(){if(!window.name)return!1;try{var t=JSON.parse(decodeURIComponent(window.name||"")),e=t.is_vabtesting,s=t.source_url,i=t.link_match_type;return!(e!==!0||!U.checkUrlIsMatch(s,i))||(U.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(r){return!1}}function c(t){if(t)try{U.isString(t)&&(t=U.getDomBySelector(t)),t.parentNode&&t.parentNode.removeChild(t)}catch(e){U.logger.log("delete dom error:",e)}}function l(t){if(!t.parentNode)return-1;for(var e=0,s=t.tagName,i=t.parentNode.children,r=0;r "):h(t.parentNode,e)):(e.unshift("body"),e.join(" > "))}function d(t){var e=t.getBoundingClientRect(),s=e.top+(document.body.scrollTop||document.documentElement.scrollTop),i=e.left+(document.body.scrollLeft||document.documentElement.scrollLeft),r=U.ry(t).getStyle("z-index")||0;return{width:e.width,height:e.height,top:s,left:i,zIndex:r}}function p(t,e){var s={};return U.each(e||[],function(e){var i=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});s[e]=U.ry(t).getStyle(i)}),s}function _(t){var e=t.childNodes,s="",i=!1;return U.each(e,function(t){if(i===!1&&3===t.nodeType){var e=t.textContent||t.innerText||t.nodeValue||"";e&&(s=U.trim(e),i=!0)}}),s}function g(t){var e=t.match(/[\d.]+/g);if(e.length>=3){var s,i,r;return s=e[0],i=e[1],r=e[2],"rgb("+s+","+i+","+r+")"}return""}function f(t,e,s){var i=U.getUA(),r=i.ie&&i.ie<9,n="";U.each(e,function(t,e){r&&t.indexOf("rgba")>-1&&(t=g(t));var s=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});n+=s+": "+t+" !important;"}),""!==n&&(s=U.encodeSelector(s),n="[sensors_ab_ele_style_id="+s+"]{"+n+"}",A({attr_value:s,text:n,attr_key:"sensors_ab_ele_style_id"}),t.setAttribute("sensors_ab_ele_style_id",s))}function m(t,e){var s=t.tagName,i=_(t);i!==e&&(t.textContent?t.textContent=e:t.innerText?t.innerText=e:t.innerHTML=e,"input"!==s&&"INPUT"!==s||(t.value=e||""))}function v(t,e){var s=t.originProps||{},i=e.originProps||{},r=s.attributes||{},n=i.attributes||{},a=!0;return s.text&&s.text!==i.text&&(a=!1),r&&U.each(["src","href","target"],function(t){r[t]&&r[t]!==n[t]&&(a=!1)}),a}function b(t,e,s){t.setAttribute(e,s)}function y(t,e){var s=e.originProps,i={attributes:{}},r=s.attributes;return U.each(r.style||{},function(e,s){i.attributes.style[s]=U.ry(t).getStyle(s)}),Object.hasOwnProperty.call(s,"text")&&(i.attributes.text=_(t)),U.each(["src","href"],function(e){Object.hasOwnProperty.call(r,e)&&(i.attributes[e]=t[e])}),Object.hasOwnProperty.call(r,"target")&&(i.attributes.target=t.getAttribute("target")),i}function S(t,e,s){s||(s=y(t,e));var i=v(e,s);if(i){var r=e.props;U.isObject(r)&&T(t,r,e)}return i}function T(t,e,s){if(Object.hasOwnProperty.call(e,"attributes")){var i=e.attributes;Object.hasOwnProperty.call(i,"style")&&f(t,i.style,s.selector),U.each(["href","target","src"],function(e){i[e]&&t.getAttribute(e)!==i[e]&&b(t,e,i[e])})}Object.hasOwnProperty.call(e,"text")&&"innerHtml"!==s.type&&m(t,e.text)}function A(t){try{var e=document.createElement("style");e.innerHTML=t.text,e.setAttribute(t.attr_key,t.attr_value),document.getElementsByTagName("head")[0].append(e)}catch(s){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(t,s.stack||s.message)}}function B(t){try{var e=document.createElement("script");e.setAttribute(t.attr_key,t.attr_value),e.innerHTML="try{"+t.text+"}catch(e){ window.sensorsABTestModifyListener && window.sensorsABTestModifyListener("+JSON.stringify(t)+", e.stack || e.message) }",document.body.append(e)}catch(s){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(t,s.stack||s.message)}}function k(t,e){U.loadScript(U.extend({success:function(){},error:function(){},type:"js",url:t},e))}function x(t){var e={childList:!0,subtree:!0},s=window.MutationObserver,i=new s(t);return i.observe(document.body,e),i}function w(t){t&&t.disconnect()}function D(t,e,s){var i=t.tagName.toLowerCase(),r=p(t,e),n={selector:h(t),originProps:{attributes:{style:r},text:_(t),hasChildren:t.children.length>0},type:"text",tagName:i};"a"===i&&(n.originProps.attributes.href=t.href,t.getAttribute("target")&&(n.originProps.attributes.target=t.getAttribute("target")),n.type="link"),"img"===i&&(n.originProps.attributes.src=t.src,n.type="img"),t.hasAttribute("sensors_ab_widget")&&(n.type="innerHtml");var a=t.getAttribute("style");if(s)for(var o=0;o-1&&t.parentElement.removeChild(t)}),i&&s&&i.removeAttribute(s)}function L(t,e){var s=U.getDomBySelector(t.base),i=t.props.text,r=t.props.sensors_ab_widget,n=t.operation;if(!s)throw"VABTest: No base element";if(!s.parentNode)throw"base element parentNode not found";var a=document.createElement("font");if("text"===r&&(a.innerText=i),"html"===r&&(a.innerHTML=i),P(a,t,e),"BEFORE_INSERTION"===n)s.parentNode.insertBefore(a,s);else{if("AFTER_INSERTION"!==n)throw"operation not supported";s.nextSibling?s.parentNode.insertBefore(a,s.nextSibling):s.parentNode.appendChild(a)}var o=h(a);return o}function j(t,e){var s=t.selector,i=t.props.text,r="text"===t.props.sensors_ab_widget;const n=document.querySelector(s);if(!n)throw"element not found:"+s;r?n.innerText=i:n.innerHTML=i,P(n,t,e)}function N(t,e,s){function i(){return r=L(t,e)}var r=null,n=null,a=U.getDomBySelector(t.selector)||document.querySelector&&document.querySelector(t.selector);if(a&&a.hasAttribute("sensors_ab_widget")){j(t,e);var o=d(document.querySelector(t.selector));s&&s.setSelectElePostion(o)}else s?n=s.getModifiedEleSelectorsWhen(i):i();return{selector:t.selector,addedEleSelector:r,updatedSelectors:n}}function P(t,e,s){if(s&&s.length)for(var i=0;i0||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",e.param_name),r.verify_success=!1);break;case"value_type":U.isString(e.value_type)&&U.indexOf(i.value_type_list,e.value_type)!==-1||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",e.value_type),r.verify_success=!1);break;case"default_value":"undefined"==typeof e.default_value?(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),r.verify_success=!1):i.valueType(e.default_value,e.value_type)||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",e.default_value,e.value_type),r.verify_success=!1);break;case"callback":U.isFunction(e.callback)||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),r.verify_success=!1);break;default:r.verify_success=!1}else if("not_essential"===s)switch(n){case"timeout_milliseconds":e.timeout_milliseconds=e.timeout_milliseconds||i.SensorsABTest.para.timeout_milliseconds||i.SensorsABTest.default_para.timeout_milliseconds,(!U.isNumber(e.timeout_milliseconds)||U.isNumber(e.timeout_milliseconds)&&e.timeout_milliseconds<=0)&&(i.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",e.timeout_milliseconds),e.timeout_milliseconds=i.SensorsABTest.para.timeout_milliseconds),e.timeout_milliseconds<200&&(e.timeout_milliseconds=200);break;case"properties":e.properties=U.isObject(e.properties)?e.properties:{}}}),r.para=e,r},resolveCustomProperties:function(t){var e=this,s={verify_success:!0,para:null},i=t.custom_properties;if(!U.isObject(i)||U.isEmptyObject(i))return delete t.custom_properties,s.para=t,s;if(U.each(i,function(t,i){if((!U.isString(i)||!e.regName.test(i)||i.length>100)&&(e.SensorsABTest.log(" property name [ "+i+" ] is not invalid "),s.verify_success=!1),(U.isString(t)||U.isNumber(t)||U.isBoolean(t)||U.isArray(t)||U.isDate(t))&&!(U.isString(t)&&t.length>500)||(e.SensorsABTest.log("property [ "+i+" ] of value [ "+JSON.stringify(t)+" ] is not invalid"),s.verify_success=!1),U.isArray(t)){var r=!0;U.each(t,function(t){r!==!1&&(U.isString(t)||(r=!1))}),r||(e.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+i+" ] of value "+JSON.stringify(t)+" is not invalid"),s.verify_success=!1)}}),s.verify_success===!0){var r={};U.each(i,function(t,e){U.isDate(t)?r[e]=U.formatDate(t):U.isString(t)?r[e]=t:r[e]=JSON.stringify(t)}),t.custom_properties=r}return s.para=t,s}},U.VerifyStore=t,U.listenPageState=function(t){var e={visibleHandle:U.isFunction(t.visible)?t.visible:function(){},hiddenHandler:U.isFunction(t.hidden)?t.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 t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}};e.init()},U.listenPageState=function(t){var e={visibleHandle:U.isFunction(t.visible)?t.visible:function(){},hiddenHandler:U.isFunction(t.hidden)?t.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 t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}};e.init()},U.getStorageData=function(t,e){var s=U.localStorage.get(t);U.isString(s)&&(s=e.kit.userDecryptIfNeeded(s));try{s=JSON.parse(s)}catch(i){U.log(i)}return s},U.setStorageData=function(t,e,s){t=JSON.stringify(t),s&&(t=U.userEncrypt(t)),U.localStorage.set(e,t)},e.prototype={createMaskStyle:function(){var t="["+this.attr_name+"],["+this.attr_name+"] body{opacity:0 !important;-khtml-opacity:0 !important;-moz-opacity:0;filter:alpha(opacity=0);}",e=document.createElement("style");e.type="text/css";try{e.appendChild(document.createTextNode(t))}catch(s){e.styleSheet.cssText=t}try{this.style_element=e,document.getElementsByTagName("head")[0].appendChild(e)}catch(s){U.log("error when create calls")}},show:function(t){try{var e=this;if(this.is_abort)return!1;var s=null;if(s=document.getElementsByTagName("html")[0],!U.isElement(s))return;s.setAttribute(this.attr_name,"1"),this.is_added=!0,U.isNumber(t)&&(this.remove_timer=setTimeout(function(){e.is_timeout=!0,e.remove()},t))}catch(i){U.log("error when show calls")}},remove:function(){try{if(this.is_abort||(this.is_abort=!0),this.is_added){this.is_added=!1;var t=null;if(t=document.getElementsByTagName("html")[0],!U.isElement(t))return;t.removeAttribute(this.attr_name),this.style_element&&(document.getElementsByTagName("head")[0].removeChild(this.style_element),this.style_element=null)}this.remove_timer&&(clearTimeout(this.remove_timer),this.remove_timer=null)}catch(e){U.log("error when remove calls")}}},U.Mask=e,i.prototype={init:function(t){return!!this.setPara(t)&&(this.bridgeState="ab_no_host_bridge",/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?this.SensorsABTest.state.platform="H5":this.SensorsABTest.state.platform="Web",this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f\uff0c\u8bd5\u9a8c URL\uff1a",t.url),this.SensorsABTest.checkSADebug(),void this.SensorsABTest.store.init(this.getResultFromServer,this))},setPara:function(t){if(!U.isString(t.url)||"http"!==t.url.slice(0,4))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1;if("https"===location.protocol.slice(0,5)&&"http:"===t.url.slice(0,5))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0chttps \u9875\u9762\u5fc5\u987b\u4f7f\u7528 https \u7684 URL"),!1;var e=U.getQueryParam(t.url,"project-key");if(!e)return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff08\u5fc5\u987b\u5305\u542b project-key\uff09\uff01"),!1;t.project_key=e;var s=this.SensorsABTest.verifyStore.para("A/B Testing SDK \u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=U.extend({},this.SensorsABTest.default_para,s.para),U.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),U.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},asyncFetch:function(t){var e=this;this.SensorsABTest.normalStore.getCodeExpResultFromServer({para:t,suc:function(s){if(U.isObject(s)&&"SUCCESS"===s.status){var i=e.SensorsABTest.getExpResult(t);t.callback(i)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})},creatRequestData:function(t){var e="";U.isEmptyObject(this.SensorsABTest.sd.store._state)||(e=this.SensorsABTest.sd.store._state._first_id||this.SensorsABTest.sd.store._state.first_id||this.SensorsABTest.sd.store._state._distinct_id||this.SensorsABTest.sd.store._state.distinct_id);var s={anonymous_id:e,platform:this.SensorsABTest.state.platform,abtest_lib_version:this.SensorsABTest.lib_version,properties:{$is_first_day:this.SensorsABTest.sd._.cookie.getNewUser()}};return U.isObject(t.properties)&&(s.properties=U.extend({},s.properties,t.properties)),U.isObject(t.custom_properties)&&(s.custom_properties=U.extend({},t.custom_properties),s.param_name=t.param_name),this.SensorsABTest.sd.store._state.first_id&&(s.login_id=this.SensorsABTest.sd.store.getDistinctId()),s},getCodeExpResultFromServer:function(t){this.getResultFromServer(t,!0)},getResultFromServer:function(t,e){function s(){var t=i.SensorsABTest.sd.store.getDistinctId();i.SensorsABTest.sd._.ajax({url:i.SensorsABTest.para.url,type:"POST",data:JSON.stringify(o),credentials:!1,contentType:"application/json",timeout:r.timeout_milliseconds||i.SensorsABTest.para.timeout_milliseconds,cors:!0,success:function(s){e?i.SensorsABTest.dealCodeExpResponseData(s,t):i.SensorsABTest.dealResponseData(s,t),n&&n(s),i.SensorsABTest.fetchData.setNextFetch()},error:function(t){i.SensorsABTest.log("\u670d\u52a1\u7aef\u8bf7\u6c42\u53d1\u9001\u5931\u8d25",t),a&&a(),i.SensorsABTest.fetchData.setNextFetch()}})}var i=this;t=U.isObject(t)?t:{};var r=t.para||{},n=t.suc,a=t.err,o=this.creatRequestData(r);this.SensorsABTest.log("\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),s()}},i.prototype.methods={asyncFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!s.verify_success)return void t.callback(t.default_value);t=s.para,this.SensorsABTest.normalStore.asyncFetch(t)}},fastFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(U.isObject(s)){var i=this.SensorsABTest.getExpResult(t,s);return void t.callback(i)}var r=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!r.verify_success)return void t.callback(t.default_value);t=r.para,this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.normalStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!U.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}},r.prototype={init:function(t){var e=this;return this.SensorsABTest.state.storage.name="sawebjssdkabtest_bridge",!!this.setPara(t)&&(this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f"),this.abBridge=new this.SensorsABTest.sd.JSBridge({type:"abtest",app_call_js:function(t){try{t=U.base64Decode(t)}catch(s){e.SensorsABTest.log("App\u6570\u636ebase64\u89e3\u7801\u5f02\u5e38",t)}try{t=JSON.parse(t),t.message_id&&this["double"](t)}catch(s){e.SensorsABTest.log("App\u6570\u636e\u89e3\u6790\u5f02\u5e38",t)}}}),U.isObject(window.SensorsData_iOS_JS_Bridge)&&window.SensorsData_iOS_JS_Bridge.sensorsdata_abtest_module&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":U.isObject(window.SensorsData_APP_New_H5_Bridge)&&U.isFunction(window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module)&&window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module()&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":this.SensorsABTest.bridgeState="ab_no_abtest_bridge",void this.SensorsABTest.store.init(this.getResultFromApp,this))},setPara:function(t){var e=this.SensorsABTest.verifyStore.para("\u6253\u901a\u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=U.extend({},this.SensorsABTest.default_para,e.para),U.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),U.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},getResultFromApp:function(t){function e(){"ab_bridge_ok"===s.SensorsABTest.bridgeState?s.abBridge.requestToApp({data:{properties:i.properties,timeout:a,request_body:o},callback:function(t){U.isObject(t)&&U.isObject(t.data)?(s.SensorsABTest.log("\u6210\u529f\u83b7\u53d6\u5230 App \u7aef\u8fd4\u56de\u7684\u8bd5\u9a8c\u6570\u636e","data:",t),s.SensorsABTest.dealResponseData(t.data),r&&r(t)):(s.SensorsABTest.log("App \u7aef\u8bf7\u6c42\u5931\u8d25"),n&&n()),s.SensorsABTest.fetchData.setNextFetch()},timeout:{time:a,callback:function(){s.SensorsABTest.log("\u83b7\u53d6App\u7aef\u6570\u636e\u5931\u8d25"),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}}}):n&&(s.SensorsABTest.log("A/B Testing \u6253\u901a\u5931\u8d25\uff0c",s.SensorsABTest.bridgeState),n())}var s=this;t=U.isObject(t)?t:{};var i=t.para||{},r=t.suc,n=t.err,a=i.timeout_milliseconds||this.SensorsABTest.para.timeout_milliseconds,o={origin_platform:"H5"};U.isObject(i.custom_properties)&&(o=U.extend(o,{custom_properties:i.custom_properties,param_name:i.param_name})),this.SensorsABTest.log("\u5411App\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e()},asyncFetch:function(t){var e=this;this.SensorsABTest.bridgeStore.getResultFromApp({para:t,suc:function(s){if(U.isObject(s.properties)&&(t.properties=U.extend(s.properties,t.properties)),"SUCCESS"===s.data.status){var i=e.SensorsABTest.getExpResult(t);t.callback(i)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})}},r.prototype.methods={asyncFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);return s.verify_success?(t=s.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState?void t.callback(t.default_value):void this.SensorsABTest.bridgeStore.asyncFetch(t)):void t.callback(t.default_value)}},fastFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(U.isObject(s)){var i=this.SensorsABTest.getExpResult(t,s);return void t.callback(i)}var r=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!r.verify_success)return void t.callback(t.default_value);if(t=r.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState)return void t.callback(t.default_value);this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.bridgeStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!U.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}},n.prototype.init=function(t){if(this.pause_sdk_before_trigger=t.pause_sdk_before_trigger||!1,t.pause_sdk_before_trigger===!0){var e=this;this.sd.registerInterceptor("sendDataStage",{send:{priority:0,entry:function(t,s){e.sendInterceptor(t,s)}}})}},n.prototype.start=function(){this.pause_sdk_before_trigger!==!1&&(this.events=[],this.isStart=!0)},n.prototype.stop=function(){if(this.pause_sdk_before_trigger!==!1){this.isStart=!1;var t=this;U.each(this.events,function(e){e._flush_time=(new Date).getTime(),t.sd.kit.sendData(e)}),this.events=[]}},n.prototype.sendInterceptor=function(t,e){var s=t.data,i=s.event,r=s.type;return this.isStart===!0&&"track"===r&&["$ABTestTrigger","WebABTestTrigger"].indexOf(i)<0&&(this.events.push(s),e.cancellationToken.stop()),t},a.prototype.init=function(t){return this.initPara(t),this.para?(this.eventInterceptor=new n(this.SensorsABTest),this.eventInterceptor.init(this.para),this.eventInterceptor.start(),U.getQueryParam(location.href,"saSDKMultilink")?(this.is_filtered_out=!0,!1):(this.start_time=(new Date).getTime(),this.para.use_mask&&this.initMask(),void this.addSinglePageListener())):(this.SensorsABTest.log("multilink is closed"),!1)},a.prototype.addSinglePageListener=function(){var t=this;this.SensorsABTest.sd.ee.spa.prepend("switch",function(e){return e!==location.href&&(t.is_filtered_out=!1,t.isFirst=!0,t.mask_instance&&t.mask_instance.remove(),U.getQueryParam(location.href,"saSDKMultilink")?(t.is_filtered_out=!0,!1):(t.eventInterceptor&&t.eventInterceptor.start(),t.start_time=(new Date).getTime(),t.para.use_mask&&t.initMask(),void t.resolve()))})},a.prototype.initMask=function(){this.mask_instance=new U.Mask("link_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.para.timeout)},a.prototype.initPara=function(t){if(U.isFunction(t))try{t=t()}catch(e){return this.SensorsABTest.log("link para error!"),void(this.para=!1)}t===!1?this.para=!1:U.isObject(t)&&(this.para.timeout=U.isNumber(t.timeout)&&t.timeout>=0?t.timeout:500,this.para.use_mask=U.isBoolean(t.use_mask)?t.use_mask:this.para.use_mask,this.para.control_link_search=U.isString(t.control_link_search)?t.control_link_search:"default",this.para.experiment_link_search=U.isString(t.experiment_link_search)?t.experiment_link_search:"default",this.para.pass_params=!U.isBoolean(t.pass_params)||t.pass_params,this.para.onRedirect=U.isFunction(t.onRedirect)?t.onRedirect:null,this.para.pause_sdk_before_trigger=!!U.isBoolean(t.pause_sdk_before_trigger)&&t.pause_sdk_before_trigger)},a.prototype.resolve=function(){var t=this.SensorsABTest.results,e=this;if(!this.para||!U.isArray(t)||this.is_filtered_out||!this.isFirst||0===this.para.timeout)return this.eventInterceptor&&this.eventInterceptor.stop(),!1;if((new Date).getTime()-this.start_time>this.para.timeout)return this.SensorsABTest.log("The multilink was stopped because the request timeout"),this.eventInterceptor&&this.eventInterceptor.stop(),!1;this.isFirst=!1;var s=!1;U.each(t,function(t){return!(!U.isObject(t)||s||"LINK"!==t.experiment_type)&&void(e.isTriggerLinkExp(t)&&(s=!0,e.SensorsABTest.trackOutTestTrigger("LINK"),e.redirectUrl(t)))}),!s&&this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),!s&&this.eventInterceptor&&this.eventInterceptor.stop()},a.prototype.stopTrigger=function(){this.isFirst!==!1&&(this.isFirst=!1,this.SensorsABTest.log("The multilink was stopped because the request failed"),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),this.eventInterceptor&&this.eventInterceptor.stop())},a.prototype.isTriggerLinkExp=function(t){return U.isString(t.control_link)&&U.isString(t.link_match_type)?"REGEXP"===t.link_match_type?!!U.checkUrlIsRegexp(t.control_link,t.regexp_flags)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):!!U.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},a.prototype.redirectUrl=function(t){function e(t){return U.secCheck.isHttpUrl(t)?U.secCheck.removeScriptProtocol(t):(this.SensorsABTest.log("\u975e\u6cd5URL"),!1)}if(!t.experiment_link||!U.isString(t.experiment_link))return this.SensorsABTest.log("\u9875\u9762\u8df3\u8f6c\u5931\u8d25\uff0cexperiment_link\u5b57\u6bb5\u5f02\u5e38",t.abtest_experiment_id),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),void(this.eventInterceptor&&this.eventInterceptor.stop());if(t.is_control_group===!0&&("STRICT"===t.link_match_type||"REGEXP"===t.link_match_type))return this.SensorsABTest.triggerHandle(t), this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),void(this.eventInterceptor&&this.eventInterceptor.stop());var s=location.href,i=t.experiment_link,r=/\$\d+/;if("REGEXP"===t.link_match_type&&r.test(i)){var n=t.regexp_flags?new RegExp(t.control_link,t.regexp_flags):new RegExp(t.control_link);i=s.replace(n,i)}var a,o;if(this.para.pass_params?(o=this.getMergedUrl(t.is_control_group,i,s),a=e(o)):(o=this.getMergedUrl(t.is_control_group,i),a=e(o)),a){var c=this.SensorsABTest.triggerHandle(t),l=c?80:0;this.para.onRedirect?(this.para.onRedirect(a),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove()):this.redirect(a,l),this.mask_instance&&this.mask_instance.remove_timer&&clearTimeout(this.mask_instance.remove_timer)}},a.prototype.redirect=function(t,e){setTimeout(function(){location.href=t},e)},a.prototype.getMergedUrl=function(t,e,s){function i(t){var e=/([^?#]+)(\?[^#]*)?(#.*)?/,s=e.exec(t);if(s){var i=s[1]||"",r=s[2]||"",n=s[3]||"";return{host:i,search:r,hash:n}}}function r(t){var e={hash:"",search:""};if(!U.isString(t))return e;var s=t.indexOf("?");return s>-1?(e.search=t.slice(s),e.hash=t.slice(0,s)):e.hash=t,e}var n="",a="",o="",c={parse_url:null,search:""},l={parse_url:null,search:"",hash:""};return s&&(c.parse_url=i(s),!c.parse_url)?void this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",s):(l.parse_url=i(e),l.parse_url?(s&&("after_hash"===this.para.control_link_search?c.search=r(c.parse_url.hash).search:c.search=c.parse_url.search),t?"after_hash"===this.para.control_link_search?(l.search=r(l.parse_url.hash).search,l.hash=r(l.parse_url.hash).hash):l.search=l.parse_url.search:"after_hash"===this.para.experiment_link_search?(l.search=r(l.parse_url.hash).search,l.hash=r(l.parse_url.hash).hash):l.search=l.parse_url.search,a=s?this.getSearchStr(c.search,l.search):this.getSearchStr(l.search),t&&"after_hash"===this.para.control_link_search||!t&&"after_hash"===this.para.experiment_link_search?n=l.hash.length>0?l.parse_url.host+l.parse_url.search+l.hash+a:l.parse_url.search.length>0?l.parse_url.host+l.parse_url.search+"&"+a.substring(1):l.parse_url.host+a:(o="after_hash"===this.para.control_link_search?l.parse_url.hash:s?l.parse_url.hash||c.parse_url.hash:l.parse_url.hash,n=l.parse_url.host+a+o),n):void this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",e))},a.prototype.getSearchStr=function(t,e){var s=U.getQueryParamsFromUrl(t),i=U.getQueryParamsFromUrl(e),r=U.extend(s,i),n="";if(U.isEmptyObject(r))return"?saSDKMultilink=true";var a=!0;for(var o in r)a?(n+="?",a=!1):n+="&",null!==r[o]?n=n+o+"="+r[o]:n+=o;return n+="&saSDKMultilink=true"},window.MutationObserver||(window.MutationObserver=function(t){function e(t){this._watched=[],this._listener=t}function s(t){!function s(){var i=t.takeRecords();i.length&&t._listener(i,t),t._timeout=setTimeout(s,e._period)}()}function i(e){var s={type:null,target:null,addedNodes:[],removedNodes:[],previousSibling:null,nextSibling:null,attributeName:null,attributeNamespace:null,oldValue:null};for(var i in e)g(s,i)&&e[i]!==t&&(s[i]=e[i]);return s}function r(t,e){var s=l(t,e);return function(r){var n,a=r.length;e.charData&&3===t.nodeType&&t.nodeValue!==s.charData&&r.push(new i({type:"characterData",target:t,oldValue:s.charData})),e.attr&&s.attr&&o(r,t,s.attr,e.afilter),(e.kids||e.descendents)&&(n=c(r,t,s,e)),(n||r.length!==a)&&(s=l(t,e))}}function n(t,e){return e.value}function a(t,e){return"style"!==e.name?e.value:t.style.cssText}function o(t,e,s,r){for(var n,a,o={},c=e.attributes,l=c.length;l--;)n=c[l],a=n.name,r&&!g(r,a)||(v(e,n)!==s[a]&&t.push(i({type:"attributes",target:e,attributeName:a,oldValue:s[a],attributeNamespace:n.namespaceURI})),o[a]=!0);for(a in s)o[a]||t.push(i({target:e,type:"attributes",attributeName:a,oldValue:s[a]}))}function c(e,s,r,n){function a(t,s,r,a,l){for(var u,h,d,p=t.length-1,_=-~((p-l)/2);d=t.pop();)u=r[d.i],h=a[d.j],n.kids&&_&&Math.abs(d.i-d.j)>=p&&(e.push(i({type:"childList",target:s,addedNodes:[u],removedNodes:[u],nextSibling:u.nextSibling,previousSibling:u.previousSibling})),_--),n.attr&&h.attr&&o(e,u,h.attr,n.afilter),n.charData&&3===u.nodeType&&u.nodeValue!==h.charData&&e.push(i({type:"characterData",target:u,oldValue:h.charData})),n.descendents&&c(u,h)}function c(s,r){for(var d,p,g,f,m,v,b,y=s.childNodes,S=r.kids,T=y.length,A=S?S.length:0,B=0,k=0,x=0;k=0?t.timeout:this.timeout;var s=U.isString(t.vabtest_url)?t.vabtest_url:"";s&&("https:"===location.protocol?"https:"===s.slice(0,6)?this.vabtest_url=s:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u534f\u8bae\u5934\u5e94\u8bbe\u7f6e\u4e3a https"):"http:"===s.slice(0,5)||"https:"===s.slice(0,6)?this.vabtest_url=s:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u5e94\u8bbe\u7f6e\u4e3a\u6709\u6548 URL"))},C.prototype.resolve=function(){var t=this.SensorsABTest.results;if(this.enable_visualize!==!1&&this.is_editor!==!0&&this.isFirst!==!1){if((new Date).getTime()-this.start_time>this.timeout)return this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),!1;var e=this;this.isFirst=!1;var s=!1;U.each(t,function(t){if(!U.isObject(t)||"VISUAL"!==t.experiment_type)return!1;if(s)return!1;var i=t.experiment_value;if(!U.isArray(i))try{i=JSON.parse(t.experiment_value),t.experiment_value=i}catch(r){return!1}e.isTriggerVisualExp(t)&&(s=!0,e.renderGlobalElement(t),e.prepareResource(t,e.render.bind(e)),e.visualExp=t,e.SensorsABTest.trackOutTestTrigger("VISUAL"))}),!s&&this.use_mask&&this.destroyMask()}},C.prototype.initMask=function(){this.mask_instance=new U.Mask("vabtest_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.timeout)},C.prototype.destroyMask=function(){this.mask_instance&&this.mask_instance.remove()},C.prototype.prepareResource=function(t,e){var s=this,i=t.experiment_value;U.isArray(i)&&(U.each(i,function(i){function r(){var i=s.imgLoadingList.indexOf(o);s.loadedImages.push(o),i>-1&&s.imgLoadingList.splice(i,1),0===s.imgLoadingList.length&&e(t)}var n=i.tagName,a=i.props;if("img"===n&&a&&a.attributes&&U.isString(a.attributes.src)){var o=a.attributes.src;if(s.imgLoadingList.push(o),s.loadedImages.indexOf(o)>-1){var c=s.imgLoadingList.indexOf(o);return c>-1&&s.imgLoadingList.splice(c,1),void(0===s.imgLoadingList.length&&e(t))}var l=document.createElement("img");l.width=1,l.height=1,l.onload=r,l.onerror=r,l.onabort=r,l.src=a.attributes.src}}),0===this.imgLoadingList.length&&e(t))},C.prototype.render=function(t){this.removeDomChangeListener();var e=this,s=function(){if(e.isDomReady=!0,e.use_mask&&e.mask_instance&&e.mask_instance.is_timeout===!0)return void e.SensorsABTest.log("\u6e32\u67d3\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01");e.isTrigger||(e.SensorsABTest.triggerHandle(t),e.isTrigger=!0),U.isArray(e.originData)&&(U.each(e.originData,function(t){E(t)}),e.originData=[]),U.each(e.dynamicAddedElements,function(t){c(t)}),e.dynamicAddedElements=[];var s=t.experiment_value;U.isArray(s)&&U.each(s,function(t){var s=t.selector,i=t.type;if("innerHtml"===t.type){var r=N(t,!0,e.domEditor);r.addedEleSelector&&e.dynamicAddedElements.push(r.addedEleSele)}if("img"===i||"link"===i||"text"===i||"innerHtml"===i){var n=U.getDomBySelector(s);if(n)try{var a=D(n,[]),o=a.eleInfo,c=S(n,t,o);c&&e.originData.push(a)}catch(l){U.logger.log("render vabtest error")}}}),e.use_mask&&e.destroyMask(),e.addDomChangeListener()};this.isDomReady?s():U.bindReady(s)},C.prototype.restoreElements=function(){U.each(this.originData,function(t){E(t)}),U.each(this.dynamicAddedElements,function(t){c(t)}),this.dynamicAddedElements=[],this.visualExp=null,this.isFirst=!0,this.start_time=(new Date).getTime(),this.originData=[],this.isTrigger=!1,O({attr_key:"sensors_ab_style_id"}),O({attr_key:"sensors_ab_script_id"})},C.prototype.addDomChangeListener=function(){var t=this;U.bindReady(function(){t.isDomReady=!0,t.domChangeObserver=x(t.observerCallback.bind(t))})},C.prototype.removeDomChangeListener=function(){w(this.domChangeObserver),this.domChangeObserver=null},C.prototype.addSinglePageListener=function(){var t=this;this.SensorsABTest.sd.ee.spa.on("switch",function(e){return e!==location.href&&(t.mask_instance&&t.destroyMask(),t.start_time=(new Date).getTime(),t.use_mask&&t.initMask(),t.restoreElements(),void t.resolve())})},C.prototype.observerCallback=function(){this.visualExp&&this.prepareResource(this.visualExp,this.render.bind(this))},C.prototype.stopTrigger=function(){this.isFirst=!1,this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u5931\u8d25\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),this.use_mask&&this.destroyMask()},C.prototype.isTriggerVisualExp=function(t){return U.isString(t.control_link)&&U.isString(t.link_match_type)?!!U.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},C.prototype.renderGlobalElement=function(t){var e=t.experiment_value;U.isArray(e)&&U.each(e,function(t){var e=t.type;switch(e){case"globalScript":U.bindReady(function(){var e={attr_value:t.id,text:t.props.text,attr_key:"sensors_ab_script_id"};B(e)});break;case"globalStyle":var s={attr_value:t.id,text:t.props.text,attr_key:"sensors_ab_style_id"};A(s)}})},R.prototype.asyncFetchABTest=function(){U.error("asyncFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},R.prototype.fastFetchABTest=function(){U.error("fastFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},R.prototype.fetchCacheABTest=function(){U.error("fetchCacheABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},R.prototype.searchLocalExp=function(t){return this.codeExpData[t]?this.codeExpData[t]:null},R.prototype.getExpResult=function(t,e){var s=t.default_value,i=e?e:this.searchLocalExp(t.param_name);return U.isObject(i)?U.isObject(i.js_config)&&(i.js_config.type===t.value_type?(s=i.js_config.value,this.triggerHandle(i,t)):this.log("\u8bd5\u9a8c\u7ed3\u679c\u7c7b\u578b\u4e0e\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e0d\u4e00\u81f4\uff0cparam_name\uff1a"+t.param_name+"\uff0c\u5f53\u524d\u8fd4\u56de\u7c7b\u578b\u4e3a\uff1a"+i.js_config.type+"\uff0c\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e3a\uff1a"+t.value_type)):this.log("localdata\u672a\u67e5\u8be2\u5230\u8bd5\u9a8c\u6570\u636e\uff0c\u8bd5\u9a8c\u53c2\u6570\u540d\u79f0\uff1a"+t.param_name),this.trackOutTestTrigger("CODE",t),s},R.prototype.resolveVariables=function(){this.codeExpData={};var t=this,e=this.results;U.each(e,function(e){U.isObject(e)&&e.variables&&U.isArray(e.variables)&&U.each(e.variables,function(s){U.isObject(s)&&!t.codeExpData[s.name]&&(t.codeExpData[s.name]=U.extend({},e),t.codeExpData[s.name].js_config=t.getRelativeValue(s.value,s.type))})})},R.prototype.getRelativeValue=function(t,e){var s=this,i={},r={INTEGER:function(t){var e=parseFloat(t);isNaN(e)?s.log("\u539f\u59cb\u6570\u636e INTEGER \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t):(i.value=e,i.type="Number")},STRING:function(t){U.isString(t)?(i.value=t,i.type="String"):s.log("\u539f\u59cb\u6570\u636e STRING \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)},JSON:function(t){var e=JSON.parse(t);U.isObject(e)?(i.value=e,i.type="Object"):s.log("\u539f\u59cb\u6570\u636e JSON \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)},BOOLEAN:function(t){"true"===t?(i.value=!0,i.type="Boolean"):"false"===t?(i.value=!1,i.type="Boolean"):s.log("\u539f\u59cb\u6570\u636e BOOLEAN \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)}};try{r[e]?r[e](t):s.log("\u8bd5\u9a8c\u6570\u636e\u7c7b\u578b\u89e3\u6790\u5931\u8d25",e,t)}catch(n){s.log(n,t,e)}return i},R.prototype.dealResponseData=function(t,e){U.isObject(t)?"SUCCESS"===t.status?U.isArray(t.results)&&(this.fetchData.updateExpsCache(t),this.updateLocalData(e)):"FAILED"===t.status&&this.log("\u83b7\u53d6\u8bd5\u9a8c\u5931\u8d25\uff1aerror_type\uff1a"+t.error_type+",error\uff1a"+t.error):this.log("\u8bd5\u9a8c\u6570\u636e\u89e3\u6790\u5931\u8d25\uff0cresponse \uff1a",t)},R.prototype.dealCodeExpResponseData=function(t,e){U.isObject(t)?"SUCCESS"===t.status?U.isArray(t.results)&&(this.fetchData.updateExpsCache(t),this.updateCodeExpLocalData(e)):"FAILED"===t.status&&this.log("\u83b7\u53d6\u8bd5\u9a8c\u5931\u8d25\uff1aerror_type\uff1a"+t.error_type+",error\uff1a"+t.error):this.log("\u8bd5\u9a8c\u6570\u636e\u89e3\u6790\u5931\u8d25\uff0cresponse \uff1a",t)},R.prototype.updateCodeExpLocalData=function(t){this.analyzeCodeExpData(),this.updateStorage(t),this.log("\u66f4\u65b0\u8bd5\u9a8c\u6570\u636e\u6210\u529f")},R.prototype.analyzeCodeExpData=function(){var t=this.results;return U.isArray(t)?(this.resolveVariables(),void this.registerProperty()):(this.log("\u89e3\u6790——\u6570\u636e\u683c\u5f0f\u9519\u8bef",t),!1)},R.prototype.updateLocalData=function(t){this.analyzeData(),this.updateStorage(t),this.log("\u66f4\u65b0\u8bd5\u9a8c\u6570\u636e\u6210\u529f")},R.prototype.updateStorage=function(t){var e=(new Date).getTime(),s={results:this.results,updateTime:e,triggerList:this.triggerList,distinct_id:t||this.sd.store.getDistinctId(),outTriggerList:this.outTriggerList,out_list:this.out_list,track_config:this.track_config},i=this.state.storage.name,r=this.para.encrypt_cookie;U.setStorageData(s,i,r),this.updateTime=e},R.prototype.analyzeData=function(){var t=this.results;return U.isArray(t)?(this.link.resolve(),this.vabtest.resolve(),this.resolveVariables(),void this.registerProperty()):(this.log("\u89e3\u6790——\u6570\u636e\u683c\u5f0f\u9519\u8bef",t),!1)},R.prototype.trackOutTestTrigger=function(t,e){var s=this.out_list,i=this,r=!1,n={};if(U.isArray(s)&&s.length>0&&(U.each(s,function(s){U.isObject(s)&&!r&&("CODE"===t?U.isObject(s)&&s.variables&&U.isArray(s.variables)&&U.each(s.variables,function(t){var a=i.getRelativeValue(t.value,t.type);!r&&a&&U.isObject(t)&&e.param_name===t.name&&a.type===e.value_type&&(r=!0,n=s)}):"LINK"===t?U.isString(s.control_link)&&U.isString(s.link_match_type)&&("REGEXP"===s.link_match_type?U.checkUrlIsRegexp(s.control_link,s.regexp_flags)&&(r=!0,n=s):U.checkUrlIsMatch(s.control_link,s.link_match_type)&&(r=!0,n=s)):"VISUAL"===t&&U.isString(s.control_link)&&U.isString(s.link_match_type)&&U.checkUrlIsMatch(s.control_link,s.link_match_type)&&(r=!0,n=s))}),r)){var a=i.sd.store.getDistinctId();n.subject_id&&n.subject_name&&(a=n.subject_name+n.subject_id),i.sendTriggerEvent("outTriggerList",a,n,{})}},R.prototype.registerProperty=function(){var t=this.track_config.property_set_switch;if(t){var e=this.sd.store.getUnionId(),s=["USER"+(e.login_id||e.anonymous_id),"DEVICE"+e.anonymous_id],i=this.sd.bridge.is_verify_success?this.getLatestSubject():[],r=[],n=[];U.each(this.triggerList,function(t,e){s.indexOf(e)<0&&i.indexOf(e)<0||U.isArray(t)&&U.each(t,function(t){t.result_id&&r.push(t.result_id)})}),U.isArray(this.results)&&U.each(this.results,function(t){t.abtest_experiment_result_id&&n.push(t.abtest_experiment_result_id)}),r.length>0&&this.sd.registerPage({abtest_result:r}),n.length>0&&this.sd.registerPage({abtest_dispatch_result:n})}else this.sd.clearPageRegister(["abtest_result","abtest_dispatch_result"])},R.prototype.saveLatestSubject=function(t){var e=this.getLatestSubject()||[];e.indexOf(t)<0&&e.push(t);var s=this.state.storage.latest_name,i=this.para.encrypt_cookie;U.setStorageData(e,s,i)},R.prototype.getLatestSubject=function(){var t=this.state.storage.latest_name;return U.getStorageData(t,this.sd)||[]},R.prototype.triggerHandle=function(t,e){var s=this.sd.store.getDistinctId();t.subject_id&&t.subject_name&&(s=t.subject_name+t.subject_id),this.sd.bridge.is_verify_success&&this.saveLatestSubject(s);var i=this.trackTestTrigger(s,t,e);return i},R.prototype.getTriggerProps=function(t,e){var s={},i=U.isObject(e)&&U.isObject(e.properties)?e.properties:{};if("{}"!==JSON.stringify(this.triggerList)){var r="web_abtesting:"+this.lib_version;s.$lib_plugin_version=[r]}this.para.collect_bridge_status&&(s.$sdk_bridge_status=this.bridgeState);var n={$abtest_experiment_id:t.abtest_experiment_id,$abtest_experiment_group_id:t.abtest_experiment_group_id},a=this.track_config.trigger_content_ext;return U.each(a,function(e){void 0!==t[e]&&(s["$"+e]=t[e])}),s=U.extend(n,s,i)},R.prototype.sendTriggerEvent=function(t,e,s,i){var r=this.track_config.trigger_switch,n=!0,a=this[t];a&&U.isObject(a)&&a[e]&&U.each(a[e],function(t){t.experiment_id===s.abtest_experiment_id&&t.group_id===s.abtest_experiment_group_id&&t.result_id===s.abtest_experiment_result_id&&(n=!1)}),this[t][e]=F(a[e],s),this.updateStorage(),this.registerProperty();var o=this.getTriggerProps(s,i);return n&&r&&this.sd.track("$ABTestTrigger",o),n},R.prototype.trackTestTrigger=function(t,e,s){if(e.is_white_list)return!1;var i=this.sendTriggerEvent("triggerList",t,e,s),r=this.getTriggerProps(e,s);return this.sd.track("WebABTestTrigger",r),i},R.prototype.checkSADebug=function(){var t=this,e=U.getQueryParam(location.href,"sensors_abtest_url"),s=U.getQueryParam(location.href,"feature_code"),i=+U.getQueryParam(location.href,"account_id");if(e.length&&s.length&&U.isNumber(i)&&0!==i){var r={distinct_id:this.sd.store.getDistinctId(),feature_code:s,account_id:i};this.sd._.ajax({url:e,type:"POST",data:JSON.stringify(r),credentials:!1,contentType:"application/json",timeout:this.para.timeout_milliseconds,cors:!0,success:function(){},error:function(e){t.log("distinct_id\u53d1\u9001\u5931\u8d25,err:",e)}})}},R.prototype.initMethods=function(t){var e=this,s=["asyncFetchABTest","fastFetchABTest","fetchCacheABTest"];U.each(s,function(s){e[s]=t.methods[s].bind(t)})},I.prototype={timer:null,method:null,context:null,init:function(t,e){this.method=t,this.context=e,this.start(!0)},getServerData:function(t){var e=this;t?this.method.call(this.context,{suc:function(s){t&&("ab_bridge_ok"===e.SensorsABTest.bridgeState&&(s=s.data),U.isObject(s)&&"SUCCESS"===s.status&&U.isArray(s.results)||(e.SensorsABTest.link.stopTrigger(),e.SensorsABTest.vabtest.stopTrigger()))},err:function(){t&&(e.SensorsABTest.link.stopTrigger(),e.SensorsABTest.vabtest.stopTrigger())}}):this.method.call(this.context)},setNextFetch:function(t){var e=this,s=t||this.SensorsABTest.para.update_interval;this.clearFetchTimer(this.timer),this.timer=setTimeout(function(){e.getServerData()},s)},updateExpsCache:function(t){this.SensorsABTest.results=t.results||t.data||[];var e=t.triggerList,s=t.out_list,i=t.outTriggerList;U.isArray(s)&&(this.SensorsABTest.out_list=s),U.isObject(e)&&(this.SensorsABTest.triggerList=t.triggerList),U.isObject(i)&&(this.SensorsABTest.outTriggerList=i),U.isObject(t.track_config)?this.SensorsABTest.track_config=t.track_config:this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},clearExpsCache:function(){this.SensorsABTest.codeExpData={},this.SensorsABTest.results=[],this.SensorsABTest.out_list=[],this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},start:function(t){var e=null,s=(new Date).getTime(),i=U.getStorageData(this.SensorsABTest.state.storage.name,this.SensorsABTest.sd),r=this.SensorsABTest.sd.store.getDistinctId();if(i&&U.isObject(i)&&i.distinct_id===r)if(e=i.updateTime,t&&this.updateExpsCache(i),e&&U.isNumber(e)&&s-e>0&&s-e0&&s-e=3||!t.on)M.call(this,t,e);else{var s=this;t.on("sdkReady",function(){M.call(s,t,e)})}},R.prototype.initTest=function(){this.link.init(this.abtestingPara.multilink),this.vabtest.init(this.abtestingPara.visualize),this.sd.bridge.is_verify_success?this.bridgeStore.init(this.abtestingPara):this.normalStore.init(this.abtestingPara),this.registerProperty()},R.prototype.log=function(){return U.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]),this.sd&&this.sd.log.apply(this,arguments)};var V=new R;return V.__constructor__=R,window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.SensorsABTest=window.SensorsDataWebJSSDKPlugin.SensorsABTest||V:window.SensorsDataWebJSSDKPlugin={SensorsABTest:V},R}); \ No newline at end of file diff --git a/dist/web/plugin/abtesting-sdk-web/abtest.esm.min.js b/dist/web/plugin/abtesting-sdk-web/abtest.esm.min.js index ce5eccd5..3d6746b2 100644 --- a/dist/web/plugin/abtesting-sdk-web/abtest.esm.min.js +++ b/dist/web/plugin/abtesting-sdk-web/abtest.esm.min.js @@ -1 +1 @@ -var _={};function VerifyStore(e){this.SensorsABTest=e}function Mask(e){this.attr_name="sa-abtest-"+e,this.remove_timer=null,this.is_added=!1,this.is_abort=!1,this.is_timeout=!1,this.style_element=null,this.createMaskStyle()}function initUtility(e){e._.extend(_,e._)}function NormalStore(e){this.SensorsABTest=e,this.para=e.para}function BridgeStore(e){this.SensorsABTest=e,this.para=e.para}function EventInterceptor(e){this.sd=e.sd,this.abTest=e,this.events=[],this.isStart=!1,this.pause_sdk_before_trigger=!1}function Link(e){this.SensorsABTest=e,this.isFirst=!0,this.start_time=null,this.mask_instance=null,this.is_filtered_out=!1,this.para={timeout:500,use_mask:!0,pass_params:!0,control_link_search:"default",experiment_link_search:"default",pause_sdk_before_trigger:!1}}function validateProject(){if(!window.name)return!1;try{var e=JSON.parse(decodeURIComponent(window.name||"")),t=e.is_vabtesting,s=e.source_url,i=e.link_match_type;return!(!0!==t||!_.checkUrlIsMatch(s,i))||(_.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(r){return!1}}function removeElement(e){if(e)try{_.isString(e)&&(e=_.getDomBySelector(e)),e.parentNode&&e.parentNode.removeChild(e)}catch(t){_.logger.log("delete dom error:",t)}}function getDomIndex(e){if(!e.parentNode)return-1;for(var t=0,s=e.tagName,i=e.parentNode.children,r=0;r "):getDomSelector(e.parentNode,t)):(t.unshift("body"),t.join(" > "))}function getElementPostion(e){var t=e.getBoundingClientRect(),s=t.top+(document.body.scrollTop||document.documentElement.scrollTop),i=t.left+(document.body.scrollLeft||document.documentElement.scrollLeft),r=_.ry(e).getStyle("z-index")||0;return{width:t.width,height:t.height,top:s,left:i,zIndex:r}}function getElementStyles(e,t){var s={};return _.each(t||[],function(t){var i=t.replace(/[A-Z]+/g,function(e){return"-"+e.toLowerCase()});s[t]=_.ry(e).getStyle(i)}),s}function getElementText(e){var t=e.childNodes,s="",i=!1;return _.each(t,function(e){if(!1===i&&3===e.nodeType){var t=e.textContent||e.innerText||e.nodeValue||"";t&&(s=_.trim(t),i=!0)}}),s}function rgbaToRgb(e){var t=e.match(/[\d.]+/g);return t.length>=3?"rgb("+t[0]+","+t[1]+","+t[2]+")":""}function changeStyle(e,t,s){var i=_.getUA(),r=i.ie&&i.ie<9,n="";_.each(t,function(e,t){r&&e.indexOf("rgba")>-1&&(e=rgbaToRgb(e));var s=t.replace(/[A-Z]+/g,function(e){return"-"+e.toLowerCase()});n+=s+": "+e+" !important;"}),""!==n&&(addStyleToHead({attr_value:s=_.encodeSelector(s),text:n="[sensors_ab_ele_style_id="+s+"]{"+n+"}",attr_key:"sensors_ab_ele_style_id"}),e.setAttribute("sensors_ab_ele_style_id",s))}function changeText(e,t){var s=e.tagName;getElementText(e)!==t&&(e.textContent?e.textContent=t:e.innerText?e.innerText=t:e.innerHTML=t,"input"!==s&&"INPUT"!==s||(e.value=t||""))}function propsFilter(e,t){var s=e.originProps||{},i=t.originProps||{},r=s.attributes||{},n=i.attributes||{},a=!0;return s.text&&s.text!==i.text&&(a=!1),r&&_.each(["src","href","target"],function(e){r[e]&&r[e]!==n[e]&&(a=!1)}),a}function changeAttribute(e,t,s){e.setAttribute(t,s)}function getElementPropsByAttr(e,t){var s=t.originProps,i={attributes:{}},r=s.attributes;return _.each(r.style||{},function(t,s){i.attributes.style[s]=_.ry(e).getStyle(s)}),Object.hasOwnProperty.call(s,"text")&&(i.attributes.text=getElementText(e)),_.each(["src","href"],function(t){Object.hasOwnProperty.call(r,t)&&(i.attributes[t]=e[t])}),Object.hasOwnProperty.call(r,"target")&&(i.attributes.target=e.getAttribute("target")),i}function changeAttributes(e,t,s){s||(s=getElementPropsByAttr(e,t));var i=propsFilter(t,s);if(i){var r=t.props;_.isObject(r)&&setAttributes(e,r,t)}return i}function setAttributes(e,t,s){if(Object.hasOwnProperty.call(t,"attributes")){var i=t.attributes;Object.hasOwnProperty.call(i,"style")&&changeStyle(e,i.style,s.selector),_.each(["href","target","src"],function(t){i[t]&&e.getAttribute(t)!==i[t]&&changeAttribute(e,t,i[t])})}Object.hasOwnProperty.call(t,"text")&&"innerHtml"!==s.type&&changeText(e,t.text)}function addStyleToHead(e){try{var t=document.createElement("style");t.innerHTML=e.text,t.setAttribute(e.attr_key,e.attr_value),document.getElementsByTagName("head")[0].append(t)}catch(s){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(e,s.stack||s.message)}}function addScriptToBody(e){try{var t=document.createElement("script");t.setAttribute(e.attr_key,e.attr_value),t.innerHTML="try{"+e.text+"}catch(e){ window.sensorsABTestModifyListener && window.sensorsABTestModifyListener("+JSON.stringify(e)+", e.stack || e.message) }",document.body.append(t)}catch(s){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(e,s.stack||s.message)}}function loadVtesting(e,t){_.loadScript(_.extend({success:function(){},error:function(){},type:"js",url:e},t))}function addMutationObserver(e){var t=new(0,window.MutationObserver)(e);return t.observe(document.body,{childList:!0,subtree:!0}),t}function removeMutationObserver(e){e&&e.disconnect()}function getInfoByElement(e,t,s){var i=e.tagName.toLowerCase(),r=getElementStyles(e,t),n={selector:getDomSelector(e),originProps:{attributes:{style:r},text:getElementText(e),hasChildren:e.children.length>0},type:"text",tagName:i};"a"===i&&(n.originProps.attributes.href=e.href,e.getAttribute("target")&&(n.originProps.attributes.target=e.getAttribute("target")),n.type="link"),"img"===i&&(n.originProps.attributes.src=e.src,n.type="img"),e.hasAttribute("sensors_ab_widget")&&(n.type="innerHtml");var a=e.getAttribute("style");if(s)for(var o=0;o-1&&e.parentElement.removeChild(e)}),i&&s&&i.removeAttribute(s)}function addHtmlElement(e,t){var s=_.getDomBySelector(e.base),i=e.props.text,r=e.props.sensors_ab_widget,n=e.operation;if(!s)throw"VABTest: No base element";if(!s.parentNode)throw"base element parentNode not found";var a=document.createElement("font");if("text"===r&&(a.innerText=i),"html"===r&&(a.innerHTML=i),renderConfigAttrs(a,e,t),"BEFORE_INSERTION"===n)s.parentNode.insertBefore(a,s);else{if("AFTER_INSERTION"!==n)throw"operation not supported";s.nextSibling?s.parentNode.insertBefore(a,s.nextSibling):s.parentNode.appendChild(a)}return getDomSelector(a)}function updateHtmlElement(e,t){var s=e.selector,i=e.props.text,r="text"===e.props.sensors_ab_widget;const n=document.querySelector(s);if(!n)throw"element not found:"+s;r?n.innerText=i:n.innerHTML=i,renderConfigAttrs(n,e,t)}function renderInnerHtml(e,t,s){var i=null,r=null,n=_.getDomBySelector(e.selector)||document.querySelector&&document.querySelector(e.selector);if(n&&n.hasAttribute("sensors_ab_widget")){updateHtmlElement(e,t);var a=getElementPostion(document.querySelector(e.selector));s&&s.setSelectElePostion(a)}else{function o(){return i=addHtmlElement(e,t)}s?r=s.getModifiedEleSelectorsWhen(o):o()}return{selector:e.selector,addedEleSelector:i,updatedSelectors:r}}function renderConfigAttrs(e,t,s){if(s&&s.length)for(var i=0;i0||(i.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",t.param_name),r.verify_success=!1);break;case"value_type":_.isString(t.value_type)&&-1!==_.indexOf(i.value_type_list,t.value_type)||(i.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",t.value_type),r.verify_success=!1);break;case"default_value":"undefined"==typeof t.default_value?(i.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),r.verify_success=!1):i.valueType(t.default_value,t.value_type)||(i.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",t.default_value,t.value_type),r.verify_success=!1);break;case"callback":_.isFunction(t.callback)||(i.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),r.verify_success=!1);break;default:r.verify_success=!1}else if("not_essential"===s)switch(n){case"timeout_milliseconds":t.timeout_milliseconds=t.timeout_milliseconds||i.SensorsABTest.para.timeout_milliseconds||i.SensorsABTest.default_para.timeout_milliseconds,(!_.isNumber(t.timeout_milliseconds)||_.isNumber(t.timeout_milliseconds)&&t.timeout_milliseconds<=0)&&(i.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",t.timeout_milliseconds),t.timeout_milliseconds=i.SensorsABTest.para.timeout_milliseconds),t.timeout_milliseconds<200&&(t.timeout_milliseconds=200);break;case"properties":t.properties=_.isObject(t.properties)?t.properties:{}}}),r.para=t,r},resolveCustomProperties:function(e){var t=this,s={verify_success:!0,para:null},i=e.custom_properties;if(!_.isObject(i)||_.isEmptyObject(i))return delete e.custom_properties,s.para=e,s;if(_.each(i,function(e,i){if((!_.isString(i)||!t.regName.test(i)||i.length>100)&&(t.SensorsABTest.log(" property name [ "+i+" ] is not invalid "),s.verify_success=!1),(_.isString(e)||_.isNumber(e)||_.isBoolean(e)||_.isArray(e)||_.isDate(e))&&!(_.isString(e)&&e.length>500)||(t.SensorsABTest.log("property [ "+i+" ] of value [ "+JSON.stringify(e)+" ] is not invalid"),s.verify_success=!1),_.isArray(e)){var r=!0;_.each(e,function(e){!1!==r&&(_.isString(e)||(r=!1))}),r||(t.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+i+" ] of value "+JSON.stringify(e)+" is not invalid"),s.verify_success=!1)}}),!0===s.verify_success){var r={};_.each(i,function(e,t){_.isDate(e)?r[t]=_.formatDate(e):_.isString(e)?r[t]=e:r[t]=JSON.stringify(e)}),e.custom_properties=r}return s.para=e,s}},_.VerifyStore=VerifyStore,_.listenPageState=function(e){({visibleHandle:_.isFunction(e.visible)?e.visible:function(){},hiddenHandler:_.isFunction(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;document.addEventListener(e.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}}).init()},_.listenPageState=function(e){({visibleHandle:_.isFunction(e.visible)?e.visible:function(){},hiddenHandler:_.isFunction(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;document.addEventListener(e.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}}).init()},_.getStorageData=function(e,t){var s=_.localStorage.get(e);_.isString(s)&&(s=t.kit.userDecryptIfNeeded(s));try{s=JSON.parse(s)}catch(i){_.log(i)}return s},_.setStorageData=function(e,t,s){e=JSON.stringify(e),s&&(e=_.userEncrypt(e)),_.localStorage.set(t,e)},Mask.prototype={createMaskStyle:function(){var e="["+this.attr_name+"],["+this.attr_name+"] body{opacity:0 !important;-khtml-opacity:0 !important;-moz-opacity:0;filter:alpha(opacity=0);}",t=document.createElement("style");t.type="text/css";try{t.appendChild(document.createTextNode(e))}catch(s){t.styleSheet.cssText=e}try{this.style_element=t,document.getElementsByTagName("head")[0].appendChild(t)}catch(s){_.log("error when create calls")}},show:function(e){try{var t=this;if(this.is_abort)return!1;var s=null;if(s=document.getElementsByTagName("html")[0],!_.isElement(s))return;s.setAttribute(this.attr_name,"1"),this.is_added=!0,_.isNumber(e)&&(this.remove_timer=setTimeout(function(){t.is_timeout=!0,t.remove()},e))}catch(i){_.log("error when show calls")}},remove:function(){try{if(this.is_abort||(this.is_abort=!0),this.is_added){this.is_added=!1;var e=null;if(e=document.getElementsByTagName("html")[0],!_.isElement(e))return;e.removeAttribute(this.attr_name),this.style_element&&(document.getElementsByTagName("head")[0].removeChild(this.style_element),this.style_element=null)}this.remove_timer&&(clearTimeout(this.remove_timer),this.remove_timer=null)}catch(t){_.log("error when remove calls")}}},_.Mask=Mask,NormalStore.prototype={init:function(e){if(!this.setPara(e))return!1;this.bridgeState="ab_no_host_bridge",/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?this.SensorsABTest.state.platform="H5":this.SensorsABTest.state.platform="Web",this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f\uff0c\u8bd5\u9a8c URL\uff1a",e.url),this.SensorsABTest.checkSADebug(),this.SensorsABTest.store.init(this.getResultFromServer,this)},setPara:function(e){if(!_.isString(e.url)||"http"!==e.url.slice(0,4))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1;if("https"===location.protocol.slice(0,5)&&"http:"===e.url.slice(0,5))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0chttps \u9875\u9762\u5fc5\u987b\u4f7f\u7528 https \u7684 URL"),!1;var t=_.getQueryParam(e.url,"project-key");if(!t)return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff08\u5fc5\u987b\u5305\u542b project-key\uff09\uff01"),!1;e.project_key=t;var s=this.SensorsABTest.verifyStore.para("A/B Testing SDK \u521d\u59cb\u5316",e,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=_.extend({},this.SensorsABTest.default_para,s.para),_.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),_.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),!0===this.SensorsABTest.sd.para.encrypt_cookie&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},asyncFetch:function(e){var t=this;this.SensorsABTest.normalStore.getCodeExpResultFromServer({para:e,suc:function(s){if(_.isObject(s)&&"SUCCESS"===s.status){var i=t.SensorsABTest.getExpResult(e);e.callback(i)}else e.callback(e.default_value)},err:function(){e.callback(e.default_value)}})},creatRequestData:function(e){var t="";_.isEmptyObject(this.SensorsABTest.sd.store._state)||(t=this.SensorsABTest.sd.store._state._first_id||this.SensorsABTest.sd.store._state.first_id||this.SensorsABTest.sd.store._state._distinct_id||this.SensorsABTest.sd.store._state.distinct_id);var s={anonymous_id:t,platform:this.SensorsABTest.state.platform,abtest_lib_version:this.SensorsABTest.lib_version,properties:{$is_first_day:this.SensorsABTest.sd._.cookie.getNewUser()}};return _.isObject(e.properties)&&(s.properties=_.extend({},s.properties,e.properties)),_.isObject(e.custom_properties)&&(s.custom_properties=_.extend({},e.custom_properties),s.param_name=e.param_name),this.SensorsABTest.sd.store._state.first_id&&(s.login_id=this.SensorsABTest.sd.store.getDistinctId()),s},getCodeExpResultFromServer:function(e){this.getResultFromServer(e,!0)},getResultFromServer:function(e,t){var s,i=this,r=(e=_.isObject(e)?e:{}).para||{},n=e.suc,a=e.err,o=this.creatRequestData(r);this.SensorsABTest.log("\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),s=i.SensorsABTest.sd.store.getDistinctId(),i.SensorsABTest.sd._.ajax({url:i.SensorsABTest.para.url,type:"POST",data:JSON.stringify(o),credentials:!1,contentType:"application/json",timeout:r.timeout_milliseconds||i.SensorsABTest.para.timeout_milliseconds,cors:!0,success:function(e){t?i.SensorsABTest.dealCodeExpResponseData(e,s):i.SensorsABTest.dealResponseData(e,s),n&&n(e),i.SensorsABTest.fetchData.setNextFetch()},error:function(e){i.SensorsABTest.log("\u670d\u52a1\u7aef\u8bf7\u6c42\u53d1\u9001\u5931\u8d25",e),a&&a(),i.SensorsABTest.fetchData.setNextFetch()}})}},NormalStore.prototype.methods={asyncFetchABTest:function(e){if(!_.isObject(e))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=this.SensorsABTest.verifyStore.para("asyncFetchABTest",e,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(t.verify_success){e=t.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(e);s.verify_success?(e=s.para,this.SensorsABTest.normalStore.asyncFetch(e)):e.callback(e.default_value)}},fastFetchABTest:function(e){if(!_.isObject(e))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=this.SensorsABTest.verifyStore.para("fastFetchABTest",e,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(t.verify_success){e=t.para;var s=this.SensorsABTest.searchLocalExp(e.param_name);if(_.isObject(s)){var i=this.SensorsABTest.getExpResult(e,s);e.callback(i)}else{var r=this.SensorsABTest.verifyStore.resolveCustomProperties(e);r.verify_success?(e=r.para,this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.normalStore.asyncFetch(e)):e.callback(e.default_value)}}},fetchCacheABTest:function(e){if(_.isObject(e)){var t=this.SensorsABTest.verifyStore.para("fetchCacheABTest",e,{param_name:"essential",value_type:"essential",default_value:"essential"});if(t.verify_success)return this.SensorsABTest.getExpResult(t.para)}else this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e")}},BridgeStore.prototype={init:function(e){var t=this;if(this.SensorsABTest.state.storage.name="sawebjssdkabtest_bridge",!this.setPara(e))return!1;this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f"),this.abBridge=new this.SensorsABTest.sd.JSBridge({type:"abtest",app_call_js:function(e){try{e=_.base64Decode(e)}catch(s){t.SensorsABTest.log("App\u6570\u636ebase64\u89e3\u7801\u5f02\u5e38",e)}try{(e=JSON.parse(e)).message_id&&this.double(e)}catch(s){t.SensorsABTest.log("App\u6570\u636e\u89e3\u6790\u5f02\u5e38",e)}}}),_.isObject(window.SensorsData_iOS_JS_Bridge)&&window.SensorsData_iOS_JS_Bridge.sensorsdata_abtest_module&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":_.isObject(window.SensorsData_APP_New_H5_Bridge)&&_.isFunction(window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module)&&window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module()&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":this.SensorsABTest.bridgeState="ab_no_abtest_bridge",this.SensorsABTest.store.init(this.getResultFromApp,this)},setPara:function(e){var t=this.SensorsABTest.verifyStore.para("\u6253\u901a\u521d\u59cb\u5316",e,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=_.extend({},this.SensorsABTest.default_para,t.para),_.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),_.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),!0===this.SensorsABTest.sd.para.encrypt_cookie&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},getResultFromApp:function(e){var t=this,s=(e=_.isObject(e)?e:{}).para||{},i=e.suc,r=e.err,n=s.timeout_milliseconds||this.SensorsABTest.para.timeout_milliseconds,a={origin_platform:"H5"};_.isObject(s.custom_properties)&&(a=_.extend(a,{custom_properties:s.custom_properties,param_name:s.param_name})),this.SensorsABTest.log("\u5411App\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),"ab_bridge_ok"===t.SensorsABTest.bridgeState?t.abBridge.requestToApp({data:{properties:s.properties,timeout:n,request_body:a},callback:function(e){_.isObject(e)&&_.isObject(e.data)?(t.SensorsABTest.log("\u6210\u529f\u83b7\u53d6\u5230 App \u7aef\u8fd4\u56de\u7684\u8bd5\u9a8c\u6570\u636e","data:",e),t.SensorsABTest.dealResponseData(e.data),i&&i(e)):(t.SensorsABTest.log("App \u7aef\u8bf7\u6c42\u5931\u8d25"),r&&r()),t.SensorsABTest.fetchData.setNextFetch()},timeout:{time:n,callback:function(){t.SensorsABTest.log("\u83b7\u53d6App\u7aef\u6570\u636e\u5931\u8d25"),r&&r(),t.SensorsABTest.fetchData.setNextFetch()}}}):r&&(t.SensorsABTest.log("A/B Testing \u6253\u901a\u5931\u8d25\uff0c",t.SensorsABTest.bridgeState),r())},asyncFetch:function(e){var t=this;this.SensorsABTest.bridgeStore.getResultFromApp({para:e,suc:function(s){if(_.isObject(s.properties)&&(e.properties=_.extend(s.properties,e.properties)),"SUCCESS"===s.data.status){var i=t.SensorsABTest.getExpResult(e);e.callback(i)}else e.callback(e.default_value)},err:function(){e.callback(e.default_value)}})}},BridgeStore.prototype.methods={asyncFetchABTest:function(e){if(!_.isObject(e))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=this.SensorsABTest.verifyStore.para("asyncFetchABTest",e,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(t.verify_success){e=t.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(e);s.verify_success?(e=s.para,"ab_bridge_ok"===this.SensorsABTest.bridgeState?this.SensorsABTest.bridgeStore.asyncFetch(e):e.callback(e.default_value)):e.callback(e.default_value)}},fastFetchABTest:function(e){if(!_.isObject(e))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=this.SensorsABTest.verifyStore.para("fastFetchABTest",e,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(t.verify_success){e=t.para;var s=this.SensorsABTest.searchLocalExp(e.param_name);if(_.isObject(s)){var i=this.SensorsABTest.getExpResult(e,s);e.callback(i)}else{var r=this.SensorsABTest.verifyStore.resolveCustomProperties(e);r.verify_success?(e=r.para,"ab_bridge_ok"===this.SensorsABTest.bridgeState?(this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.bridgeStore.asyncFetch(e)):e.callback(e.default_value)):e.callback(e.default_value)}}},fetchCacheABTest:function(e){if(_.isObject(e)){var t=this.SensorsABTest.verifyStore.para("fetchCacheABTest",e,{param_name:"essential",value_type:"essential",default_value:"essential"});if(t.verify_success)return this.SensorsABTest.getExpResult(t.para)}else this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e")}},EventInterceptor.prototype.init=function(e){if(this.pause_sdk_before_trigger=e.pause_sdk_before_trigger||!1,!0===e.pause_sdk_before_trigger){var t=this;this.sd.registerInterceptor("sendDataStage",{send:{priority:0,entry:function(e,s){t.sendInterceptor(e,s)}}})}},EventInterceptor.prototype.start=function(){!1!==this.pause_sdk_before_trigger&&(this.events=[],this.isStart=!0)},EventInterceptor.prototype.stop=function(){if(!1!==this.pause_sdk_before_trigger){this.isStart=!1;var e=this;_.each(this.events,function(t){t._flush_time=(new Date).getTime(),e.sd.kit.sendData(t)}),this.events=[]}},EventInterceptor.prototype.sendInterceptor=function(e,t){var s=e.data,i=s.event,r=s.type;return!0===this.isStart&&"track"===r&&["$ABTestTrigger","WebABTestTrigger"].indexOf(i)<0&&(this.events.push(s),t.cancellationToken.stop()),e},Link.prototype.init=function(e){return this.initPara(e),this.para?(this.eventInterceptor=new EventInterceptor(this.SensorsABTest),this.eventInterceptor.init(this.para),this.eventInterceptor.start(),_.getQueryParam(location.href,"saSDKMultilink")?(this.is_filtered_out=!0,!1):(this.start_time=(new Date).getTime(),this.para.use_mask&&this.initMask(),void this.addSinglePageListener())):(this.SensorsABTest.log("multilink is closed"),!1)},Link.prototype.addSinglePageListener=function(){var e=this;this.SensorsABTest.sd.ee.spa.prepend("switch",function(t){return t!==location.href&&(e.is_filtered_out=!1,e.isFirst=!0,e.mask_instance&&e.mask_instance.remove(),_.getQueryParam(location.href,"saSDKMultilink")?(e.is_filtered_out=!0,!1):(e.eventInterceptor&&e.eventInterceptor.start(),e.start_time=(new Date).getTime(),e.para.use_mask&&e.initMask(),void e.resolve()))})},Link.prototype.initMask=function(){this.mask_instance=new _.Mask("link_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.para.timeout)},Link.prototype.initPara=function(e){if(_.isFunction(e))try{e=e()}catch(t){return this.SensorsABTest.log("link para error!"),void(this.para=!1)}!1===e?this.para=!1:_.isObject(e)&&(this.para.timeout=_.isNumber(e.timeout)&&e.timeout>=0?e.timeout:500,this.para.use_mask=_.isBoolean(e.use_mask)?e.use_mask:this.para.use_mask,this.para.control_link_search=_.isString(e.control_link_search)?e.control_link_search:"default",this.para.experiment_link_search=_.isString(e.experiment_link_search)?e.experiment_link_search:"default",this.para.pass_params=!_.isBoolean(e.pass_params)||e.pass_params,this.para.onRedirect=_.isFunction(e.onRedirect)?e.onRedirect:null,this.para.pause_sdk_before_trigger=!!_.isBoolean(e.pause_sdk_before_trigger)&&e.pause_sdk_before_trigger)},Link.prototype.resolve=function(){var e=this.SensorsABTest.results,t=this;if(!this.para||!_.isArray(e)||this.is_filtered_out||!this.isFirst||0===this.para.timeout)return this.eventInterceptor&&this.eventInterceptor.stop(),!1;if((new Date).getTime()-this.start_time>this.para.timeout)return this.SensorsABTest.log("The multilink was stopped because the request timeout"),this.eventInterceptor&&this.eventInterceptor.stop(),!1;this.isFirst=!1;var s=!1;_.each(e,function(e){if(!_.isObject(e)||s||"LINK"!==e.experiment_type)return!1;t.isTriggerLinkExp(e)&&(s=!0,t.SensorsABTest.trackOutTestTrigger("LINK"),t.redirectUrl(e))}),!s&&this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),!s&&this.eventInterceptor&&this.eventInterceptor.stop()},Link.prototype.stopTrigger=function(){!1!==this.isFirst&&(this.isFirst=!1,this.SensorsABTest.log("The multilink was stopped because the request failed"),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),this.eventInterceptor&&this.eventInterceptor.stop())},Link.prototype.isTriggerLinkExp=function(e){return _.isString(e.control_link)&&_.isString(e.link_match_type)?"REGEXP"===e.link_match_type?!!_.checkUrlIsRegexp(e.control_link,e.regexp_flags)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",e.abtest_experiment_id),!1):!!_.checkUrlIsMatch(e.control_link,e.link_match_type)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",e.abtest_experiment_id),!1):(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",e.abtest_experiment_id),!1)},Link.prototype.redirectUrl=function(e){if(!e.experiment_link||!_.isString(e.experiment_link))return this.SensorsABTest.log("\u9875\u9762\u8df3\u8f6c\u5931\u8d25\uff0cexperiment_link\u5b57\u6bb5\u5f02\u5e38",e.abtest_experiment_id),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),void(this.eventInterceptor&&this.eventInterceptor.stop());if(!0===e.is_control_group&&("STRICT"===e.link_match_type||"REGEXP"===e.link_match_type))return this.SensorsABTest.triggerHandle(e),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),void(this.eventInterceptor&&this.eventInterceptor.stop());function t(e){return _.secCheck.isHttpUrl(e)?_.secCheck.removeScriptProtocol(e):(this.SensorsABTest.log("\u975e\u6cd5URL"),!1)}var s,i=location.href,r=e.experiment_link;if("REGEXP"===e.link_match_type&&/\$\d+/.test(r)){var n=e.regexp_flags?new RegExp(e.control_link,e.regexp_flags):new RegExp(e.control_link);r=i.replace(n,r)}if(s=this.para.pass_params?t(this.getMergedUrl(e.is_control_group,r,i)):t(this.getMergedUrl(e.is_control_group,r))){var a=this.SensorsABTest.triggerHandle(e)?80:0;this.para.onRedirect?(this.para.onRedirect(s),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove()):this.redirect(s,a),this.mask_instance&&this.mask_instance.remove_timer&&clearTimeout(this.mask_instance.remove_timer)}},Link.prototype.redirect=function(e,t){setTimeout(function(){location.href=e},t)},Link.prototype.getMergedUrl=function(e,t,s){var i="",r="",n="",a={parse_url:null,search:""},o={parse_url:null,search:"",hash:""};function c(e){var t=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e);if(t)return{host:t[1]||"",search:t[2]||"",hash:t[3]||""}}if(!s||(a.parse_url=c(s),a.parse_url)){if(o.parse_url=c(t),o.parse_url)return s&&("after_hash"===this.para.control_link_search?a.search=l(a.parse_url.hash).search:a.search=a.parse_url.search),e?"after_hash"===this.para.control_link_search?(o.search=l(o.parse_url.hash).search,o.hash=l(o.parse_url.hash).hash):o.search=o.parse_url.search:"after_hash"===this.para.experiment_link_search?(o.search=l(o.parse_url.hash).search,o.hash=l(o.parse_url.hash).hash):o.search=o.parse_url.search,r=s?this.getSearchStr(a.search,o.search):this.getSearchStr(o.search),e&&"after_hash"===this.para.control_link_search||!e&&"after_hash"===this.para.experiment_link_search?i=o.hash.length>0?o.parse_url.host+o.parse_url.search+o.hash+r:o.parse_url.search.length>0?o.parse_url.host+o.parse_url.search+"&"+r.substring(1):o.parse_url.host+r:(n="after_hash"===this.para.control_link_search?o.parse_url.hash:s?o.parse_url.hash||a.parse_url.hash:o.parse_url.hash,i=o.parse_url.host+r+n),i;this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",t)}else this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",s);function l(e){var t={hash:"",search:""};if(!_.isString(e))return t;var s=e.indexOf("?");return s>-1?(t.search=e.slice(s),t.hash=e.slice(0,s)):t.hash=e,t}},Link.prototype.getSearchStr=function(e,t){var s=_.getQueryParamsFromUrl(e),i=_.getQueryParamsFromUrl(t),r=_.extend(s,i),n="";if(_.isEmptyObject(r))return"?saSDKMultilink=true";var a=!0;for(var o in r)a?(n+="?",a=!1):n+="&",null!==r[o]?n=n+o+"="+r[o]:n+=o;return n+"&saSDKMultilink=true"},window.MutationObserver||(window.MutationObserver=function(e){function t(e){this._watched=[],this._listener=e}function s(t){var s={type:null,target:null,addedNodes:[],removedNodes:[],previousSibling:null,nextSibling:null,attributeName:null,attributeNamespace:null,oldValue:null};for(var i in t)p(s,i)&&t[i]!==e&&(s[i]=t[i]);return s}function i(t,i){var r=o(t,i);return function(n){var l,u=n.length;i.charData&&3===t.nodeType&&t.nodeValue!==r.charData&&n.push(new s({type:"characterData",target:t,oldValue:r.charData})),i.attr&&r.attr&&a(n,t,r.attr,i.afilter),(i.kids||i.descendents)&&(l=function(t,i,r,n){var o;function l(e,i,r,o,c){for(var l,h,_,d=e.length-1,p=-~((d-c)/2);_=e.pop();)l=r[_.i],h=o[_.j],n.kids&&p&&Math.abs(_.i-_.j)>=d&&(t.push(s({type:"childList",target:i,addedNodes:[l],removedNodes:[l],nextSibling:l.nextSibling,previousSibling:l.previousSibling})),p--),n.attr&&h.attr&&a(t,l,h.attr,n.afilter),n.charData&&3===l.nodeType&&l.nodeValue!==h.charData&&t.push(s({type:"characterData",target:l,oldValue:h.charData})),n.descendents&&u(l,h)}function u(i,r){for(var _,p,g,f,m,S,v,b=i.childNodes,y=r.kids,T=b.length,A=y?y.length:0,B=0,k=0,x=0;k=0?e.timeout:this.timeout;var t=_.isString(e.vabtest_url)?e.vabtest_url:"";t&&("https:"===location.protocol?"https:"===t.slice(0,6)?this.vabtest_url=t:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u534f\u8bae\u5934\u5e94\u8bbe\u7f6e\u4e3a https"):"http:"===t.slice(0,5)||"https:"===t.slice(0,6)?this.vabtest_url=t:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u5e94\u8bbe\u7f6e\u4e3a\u6709\u6548 URL"))}else this.para=!1},Vabtesting.prototype.resolve=function(){var e=this.SensorsABTest.results;if(!1!==this.enable_visualize&&!0!==this.is_editor&&!1!==this.isFirst){if((new Date).getTime()-this.start_time>this.timeout)return this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),!1;var t=this;this.isFirst=!1;var s=!1;_.each(e,function(e){if(!_.isObject(e)||"VISUAL"!==e.experiment_type)return!1;if(s)return!1;var i=e.experiment_value;if(!_.isArray(i))try{i=JSON.parse(e.experiment_value),e.experiment_value=i}catch(r){return!1}t.isTriggerVisualExp(e)&&(s=!0,t.renderGlobalElement(e),t.prepareResource(e,t.render.bind(t)),t.visualExp=e,t.SensorsABTest.trackOutTestTrigger("VISUAL"))}),!s&&this.use_mask&&this.destroyMask()}},Vabtesting.prototype.initMask=function(){this.mask_instance=new _.Mask("vabtest_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.timeout)},Vabtesting.prototype.destroyMask=function(){this.mask_instance&&this.mask_instance.remove()},Vabtesting.prototype.prepareResource=function(e,t){var s=this,i=e.experiment_value;_.isArray(i)&&(_.each(i,function(i){var r=i.tagName,n=i.props;if("img"===r&&n&&n.attributes&&_.isString(n.attributes.src)){var a=n.attributes.src;if(s.imgLoadingList.push(a),s.loadedImages.indexOf(a)>-1){var o=s.imgLoadingList.indexOf(a);return o>-1&&s.imgLoadingList.splice(o,1),void(0===s.imgLoadingList.length&&t(e))}var c=document.createElement("img");c.width=1,c.height=1,c.onload=l,c.onerror=l,c.onabort=l,c.src=n.attributes.src}function l(){var i=s.imgLoadingList.indexOf(a);s.loadedImages.push(a),i>-1&&s.imgLoadingList.splice(i,1),0===s.imgLoadingList.length&&t(e)}}),0===this.imgLoadingList.length&&t(e))},Vabtesting.prototype.render=function(e){this.removeDomChangeListener();var t=this,s=function(){if(t.isDomReady=!0,t.use_mask&&t.mask_instance&&!0===t.mask_instance.is_timeout)t.SensorsABTest.log("\u6e32\u67d3\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01");else{t.isTrigger||(t.SensorsABTest.triggerHandle(e),t.isTrigger=!0),_.isArray(t.originData)&&(_.each(t.originData,function(e){restoreElement(e)}),t.originData=[]),_.each(t.dynamicAddedElements,function(e){removeElement(e)}),t.dynamicAddedElements=[];var s=e.experiment_value;_.isArray(s)&&_.each(s,function(e){var s=e.selector,i=e.type;if("innerHtml"===e.type){var r=renderInnerHtml(e,!0,t.domEditor);r.addedEleSelector&&t.dynamicAddedElements.push(r.addedEleSele)}if("img"===i||"link"===i||"text"===i||"innerHtml"===i){var n=_.getDomBySelector(s);if(n)try{var a=getInfoByElement(n,[]);changeAttributes(n,e,a.eleInfo)&&t.originData.push(a)}catch(o){_.logger.log("render vabtest error")}}}),t.use_mask&&t.destroyMask(),t.addDomChangeListener()}};this.isDomReady?s():_.bindReady(s)},Vabtesting.prototype.restoreElements=function(){_.each(this.originData,function(e){restoreElement(e)}),_.each(this.dynamicAddedElements,function(e){removeElement(e)}),this.dynamicAddedElements=[],this.visualExp=null,this.isFirst=!0,this.start_time=(new Date).getTime(),this.originData=[],this.isTrigger=!1,restoreInsertionElement({attr_key:"sensors_ab_style_id"}),restoreInsertionElement({attr_key:"sensors_ab_script_id"})},Vabtesting.prototype.addDomChangeListener=function(){var e=this;_.bindReady(function(){e.isDomReady=!0,e.domChangeObserver=addMutationObserver(e.observerCallback.bind(e))})},Vabtesting.prototype.removeDomChangeListener=function(){removeMutationObserver(this.domChangeObserver),this.domChangeObserver=null},Vabtesting.prototype.addSinglePageListener=function(){var e=this;this.SensorsABTest.sd.ee.spa.on("switch",function(t){if(t===location.href)return!1;e.mask_instance&&e.destroyMask(),e.start_time=(new Date).getTime(),e.use_mask&&e.initMask(),e.restoreElements(),e.resolve()})},Vabtesting.prototype.observerCallback=function(){this.visualExp&&this.prepareResource(this.visualExp,this.render.bind(this))},Vabtesting.prototype.stopTrigger=function(){this.isFirst=!1,this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u5931\u8d25\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),this.use_mask&&this.destroyMask()},Vabtesting.prototype.isTriggerVisualExp=function(e){return _.isString(e.control_link)&&_.isString(e.link_match_type)?!!_.checkUrlIsMatch(e.control_link,e.link_match_type)||(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",e.abtest_experiment_id),!1):(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",e.abtest_experiment_id),!1)},Vabtesting.prototype.renderGlobalElement=function(e){var t=e.experiment_value;_.isArray(t)&&_.each(t,function(e){switch(e.type){case"globalScript":_.bindReady(function(){addScriptToBody({attr_value:e.id,text:e.props.text,attr_key:"sensors_ab_script_id"})});break;case"globalStyle":addStyleToHead({attr_value:e.id,text:e.props.text,attr_key:"sensors_ab_style_id"})}})},SensorsABTest.prototype.asyncFetchABTest=function(){_.error("asyncFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},SensorsABTest.prototype.fastFetchABTest=function(){_.error("fastFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},SensorsABTest.prototype.fetchCacheABTest=function(){_.error("fetchCacheABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},SensorsABTest.prototype.searchLocalExp=function(e){return this.codeExpData[e]?this.codeExpData[e]:null},SensorsABTest.prototype.getExpResult=function(e,t){var s=e.default_value,i=t||this.searchLocalExp(e.param_name);return _.isObject(i)?_.isObject(i.js_config)&&(i.js_config.type===e.value_type?(s=i.js_config.value,this.triggerHandle(i,e)):this.log("\u8bd5\u9a8c\u7ed3\u679c\u7c7b\u578b\u4e0e\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e0d\u4e00\u81f4\uff0cparam_name\uff1a"+e.param_name+"\uff0c\u5f53\u524d\u8fd4\u56de\u7c7b\u578b\u4e3a\uff1a"+i.js_config.type+"\uff0c\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e3a\uff1a"+e.value_type)):this.log("localdata\u672a\u67e5\u8be2\u5230\u8bd5\u9a8c\u6570\u636e\uff0c\u8bd5\u9a8c\u53c2\u6570\u540d\u79f0\uff1a"+e.param_name),this.trackOutTestTrigger("CODE",e),s},SensorsABTest.prototype.resolveVariables=function(){this.codeExpData={};var e=this,t=this.results;_.each(t,function(t){_.isObject(t)&&t.variables&&_.isArray(t.variables)&&_.each(t.variables,function(s){_.isObject(s)&&!e.codeExpData[s.name]&&(e.codeExpData[s.name]=_.extend({},t),e.codeExpData[s.name].js_config=e.getRelativeValue(s.value,s.type))})})},SensorsABTest.prototype.getRelativeValue=function(e,t){var s=this,i={},r={INTEGER:function(e){var t=parseFloat(e);isNaN(t)?s.log("\u539f\u59cb\u6570\u636e INTEGER \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",e):(i.value=t,i.type="Number")},STRING:function(e){_.isString(e)?(i.value=e,i.type="String"):s.log("\u539f\u59cb\u6570\u636e STRING \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",e)},JSON:function(e){var t=JSON.parse(e);_.isObject(t)?(i.value=t,i.type="Object"):s.log("\u539f\u59cb\u6570\u636e JSON \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",e)},BOOLEAN:function(e){"true"===e?(i.value=!0,i.type="Boolean"):"false"===e?(i.value=!1,i.type="Boolean"):s.log("\u539f\u59cb\u6570\u636e BOOLEAN \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",e)}};try{r[t]?r[t](e):s.log("\u8bd5\u9a8c\u6570\u636e\u7c7b\u578b\u89e3\u6790\u5931\u8d25",t,e)}catch(n){s.log(n,e,t)}return i},SensorsABTest.prototype.dealResponseData=function(e,t){_.isObject(e)?"SUCCESS"===e.status?_.isArray(e.results)&&(this.fetchData.updateExpsCache(e),this.updateLocalData(t)):"FAILED"===e.status&&this.log("\u83b7\u53d6\u8bd5\u9a8c\u5931\u8d25\uff1aerror_type\uff1a"+e.error_type+",error\uff1a"+e.error):this.log("\u8bd5\u9a8c\u6570\u636e\u89e3\u6790\u5931\u8d25\uff0cresponse \uff1a",e)},SensorsABTest.prototype.dealCodeExpResponseData=function(e,t){_.isObject(e)?"SUCCESS"===e.status?_.isArray(e.results)&&(this.fetchData.updateExpsCache(e),this.updateCodeExpLocalData(t)):"FAILED"===e.status&&this.log("\u83b7\u53d6\u8bd5\u9a8c\u5931\u8d25\uff1aerror_type\uff1a"+e.error_type+",error\uff1a"+e.error):this.log("\u8bd5\u9a8c\u6570\u636e\u89e3\u6790\u5931\u8d25\uff0cresponse \uff1a",e)},SensorsABTest.prototype.updateCodeExpLocalData=function(e){this.analyzeCodeExpData(),this.updateStorage(e),this.log("\u66f4\u65b0\u8bd5\u9a8c\u6570\u636e\u6210\u529f")},SensorsABTest.prototype.analyzeCodeExpData=function(){var e=this.results;if(!_.isArray(e))return this.log("\u89e3\u6790——\u6570\u636e\u683c\u5f0f\u9519\u8bef",e),!1;this.resolveVariables(),this.registerProperty()},SensorsABTest.prototype.updateLocalData=function(e){this.analyzeData(),this.updateStorage(e),this.log("\u66f4\u65b0\u8bd5\u9a8c\u6570\u636e\u6210\u529f")},SensorsABTest.prototype.updateStorage=function(e){var t=(new Date).getTime(),s={results:this.results,updateTime:t,triggerList:this.triggerList,distinct_id:e||this.sd.store.getDistinctId(),outTriggerList:this.outTriggerList,out_list:this.out_list,track_config:this.track_config},i=this.state.storage.name,r=this.para.encrypt_cookie;_.setStorageData(s,i,r),this.updateTime=t},SensorsABTest.prototype.analyzeData=function(){var e=this.results;if(!_.isArray(e))return this.log("\u89e3\u6790——\u6570\u636e\u683c\u5f0f\u9519\u8bef",e),!1;this.link.resolve(),this.vabtest.resolve(),this.resolveVariables(),this.registerProperty()},SensorsABTest.prototype.trackOutTestTrigger=function(e,t){var s=this.out_list,i=this,r=!1,n={};if(_.isArray(s)&&s.length>0&&(_.each(s,function(s){_.isObject(s)&&!r&&("CODE"===e?_.isObject(s)&&s.variables&&_.isArray(s.variables)&&_.each(s.variables,function(e){var a=i.getRelativeValue(e.value,e.type);!r&&a&&_.isObject(e)&&t.param_name===e.name&&a.type===t.value_type&&(r=!0,n=s)}):"LINK"===e?_.isString(s.control_link)&&_.isString(s.link_match_type)&&("REGEXP"===s.link_match_type?_.checkUrlIsRegexp(s.control_link,s.regexp_flags)&&(r=!0,n=s):_.checkUrlIsMatch(s.control_link,s.link_match_type)&&(r=!0,n=s)):"VISUAL"===e&&_.isString(s.control_link)&&_.isString(s.link_match_type)&&_.checkUrlIsMatch(s.control_link,s.link_match_type)&&(r=!0,n=s))}),r)){var a=i.sd.store.getDistinctId();n.subject_id&&n.subject_name&&(a=n.subject_name+n.subject_id),i.sendTriggerEvent("outTriggerList",a,n,{})}},SensorsABTest.prototype.registerProperty=function(){if(this.track_config.property_set_switch){var e=this.sd.store.getUnionId(),t=["USER"+(e.login_id||e.anonymous_id),"DEVICE"+e.anonymous_id],s=this.sd.bridge.is_verify_success?this.getLatestSubject():[],i=[],r=[];_.each(this.triggerList,function(e,r){t.indexOf(r)<0&&s.indexOf(r)<0||_.isArray(e)&&_.each(e,function(e){e.result_id&&i.push(e.result_id)})}),_.isArray(this.results)&&_.each(this.results,function(e){e.abtest_experiment_result_id&&r.push(e.abtest_experiment_result_id)}),i.length>0&&this.sd.registerPage({abtest_result:i}),r.length>0&&this.sd.registerPage({abtest_dispatch_result:r})}else this.sd.clearPageRegister(["abtest_result","abtest_dispatch_result"])},SensorsABTest.prototype.saveLatestSubject=function(e){var t=this.getLatestSubject()||[];t.indexOf(e)<0&&t.push(e);var s=this.state.storage.latest_name,i=this.para.encrypt_cookie;_.setStorageData(t,s,i)},SensorsABTest.prototype.getLatestSubject=function(){var e=this.state.storage.latest_name;return _.getStorageData(e,this.sd)||[]},SensorsABTest.prototype.triggerHandle=function(e,t){var s=this.sd.store.getDistinctId();return e.subject_id&&e.subject_name&&(s=e.subject_name+e.subject_id),this.sd.bridge.is_verify_success&&this.saveLatestSubject(s),this.trackTestTrigger(s,e,t)},SensorsABTest.prototype.getTriggerProps=function(e,t){var s={},i=_.isObject(t)&&_.isObject(t.properties)?t.properties:{};if("{}"!==JSON.stringify(this.triggerList)){var r="web_abtesting:"+this.lib_version;s.$lib_plugin_version=[r]}this.para.collect_bridge_status&&(s.$sdk_bridge_status=this.bridgeState);var n={$abtest_experiment_id:e.abtest_experiment_id,$abtest_experiment_group_id:e.abtest_experiment_group_id},a=this.track_config.trigger_content_ext;return _.each(a,function(t){void 0!==e[t]&&(s["$"+t]=e[t])}),s=_.extend(n,s,i)},SensorsABTest.prototype.sendTriggerEvent=function(e,t,s,i){var r=this.track_config.trigger_switch,n=!0,a=this[e];a&&_.isObject(a)&&a[t]&&_.each(a[t],function(e){e.experiment_id===s.abtest_experiment_id&&e.group_id===s.abtest_experiment_group_id&&e.result_id===s.abtest_experiment_result_id&&(n=!1)}),this[e][t]=updateTriggerData(a[t],s),this.updateStorage(),this.registerProperty();var o=this.getTriggerProps(s,i);return n&&r&&this.sd.track("$ABTestTrigger",o),n},SensorsABTest.prototype.trackTestTrigger=function(e,t,s){if(t.is_white_list)return!1;var i=this.sendTriggerEvent("triggerList",e,t,s),r=this.getTriggerProps(t,s);return this.sd.track("WebABTestTrigger",r),i},SensorsABTest.prototype.checkSADebug=function(){var e=this,t=_.getQueryParam(location.href,"sensors_abtest_url"),s=_.getQueryParam(location.href,"feature_code"),i=+_.getQueryParam(location.href,"account_id");if(t.length&&s.length&&_.isNumber(i)&&0!==i){var r={distinct_id:this.sd.store.getDistinctId(),feature_code:s,account_id:i};this.sd._.ajax({url:t,type:"POST",data:JSON.stringify(r),credentials:!1,contentType:"application/json",timeout:this.para.timeout_milliseconds,cors:!0,success:function(){},error:function(t){e.log("distinct_id\u53d1\u9001\u5931\u8d25,err:",t)}})}},SensorsABTest.prototype.initMethods=function(e){var t=this;_.each(["asyncFetchABTest","fastFetchABTest","fetchCacheABTest"],function(s){t[s]=e.methods[s].bind(e)})},FetchData.prototype={timer:null,method:null,context:null,init:function(e,t){this.method=e,this.context=t,this.start(!0)},getServerData:function(e){var t=this;e?this.method.call(this.context,{suc:function(s){e&&("ab_bridge_ok"===t.SensorsABTest.bridgeState&&(s=s.data),_.isObject(s)&&"SUCCESS"===s.status&&_.isArray(s.results)||(t.SensorsABTest.link.stopTrigger(),t.SensorsABTest.vabtest.stopTrigger()))},err:function(){e&&(t.SensorsABTest.link.stopTrigger(),t.SensorsABTest.vabtest.stopTrigger())}}):this.method.call(this.context)},setNextFetch:function(e){var t=this,s=e||this.SensorsABTest.para.update_interval;this.clearFetchTimer(this.timer),this.timer=setTimeout(function(){t.getServerData()},s)},updateExpsCache:function(e){this.SensorsABTest.results=e.results||e.data||[];var t=e.triggerList,s=e.out_list,i=e.outTriggerList;_.isArray(s)&&(this.SensorsABTest.out_list=s),_.isObject(t)&&(this.SensorsABTest.triggerList=e.triggerList),_.isObject(i)&&(this.SensorsABTest.outTriggerList=i),_.isObject(e.track_config)?this.SensorsABTest.track_config=e.track_config:this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},clearExpsCache:function(){this.SensorsABTest.codeExpData={},this.SensorsABTest.results=[],this.SensorsABTest.out_list=[],this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},start:function(e){var t=null,s=(new Date).getTime(),i=_.getStorageData(this.SensorsABTest.state.storage.name,this.SensorsABTest.sd),r=this.SensorsABTest.sd.store.getDistinctId();if(i&&_.isObject(i)&&i.distinct_id===r)if(t=i.updateTime,e&&this.updateExpsCache(i),t&&_.isNumber(t)&&s-t>0&&s-t0&&s-t=3||!e.on)initSensorsABTest.call(this,e,t);else{var s=this;e.on("sdkReady",function(){initSensorsABTest.call(s,e,t)})}},SensorsABTest.prototype.initTest=function(){this.link.init(this.abtestingPara.multilink),this.vabtest.init(this.abtestingPara.visualize),this.sd.bridge.is_verify_success?this.bridgeStore.init(this.abtestingPara):this.normalStore.init(this.abtestingPara),this.registerProperty()},SensorsABTest.prototype.log=function(){return _.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]),this.sd&&this.sd.log.apply(this,arguments)};var instance=new SensorsABTest;instance.__constructor__=SensorsABTest,window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.SensorsABTest=window.SensorsDataWebJSSDKPlugin.SensorsABTest||instance:window.SensorsDataWebJSSDKPlugin={SensorsABTest:instance};export default SensorsABTest; \ No newline at end of file +var _={};function VerifyStore(e){this.SensorsABTest=e}function Mask(e){this.attr_name="sa-abtest-"+e,this.remove_timer=null,this.is_added=!1,this.is_abort=!1,this.is_timeout=!1,this.style_element=null,this.createMaskStyle()}function initUtility(e){e._.extend(_,e._)}function NormalStore(e){this.SensorsABTest=e,this.para=e.para}function BridgeStore(e){this.SensorsABTest=e,this.para=e.para}function EventInterceptor(e){this.sd=e.sd,this.abTest=e,this.events=[],this.isStart=!1,this.pause_sdk_before_trigger=!1}function Link(e){this.SensorsABTest=e,this.isFirst=!0,this.start_time=null,this.mask_instance=null,this.is_filtered_out=!1,this.para={timeout:500,use_mask:!0,pass_params:!0,control_link_search:"default",experiment_link_search:"default",pause_sdk_before_trigger:!1}}function validateProject(){if(!window.name)return!1;try{var e=JSON.parse(decodeURIComponent(window.name||"")),t=e.is_vabtesting,s=e.source_url,i=e.link_match_type;return!(!0!==t||!_.checkUrlIsMatch(s,i))||(_.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(r){return!1}}function removeElement(e){if(e)try{_.isString(e)&&(e=_.getDomBySelector(e)),e.parentNode&&e.parentNode.removeChild(e)}catch(t){_.logger.log("delete dom error:",t)}}function getDomIndex(e){if(!e.parentNode)return-1;for(var t=0,s=e.tagName,i=e.parentNode.children,r=0;r "):getDomSelector(e.parentNode,t)):(t.unshift("body"),t.join(" > "))}function getElementPostion(e){var t=e.getBoundingClientRect(),s=t.top+(document.body.scrollTop||document.documentElement.scrollTop),i=t.left+(document.body.scrollLeft||document.documentElement.scrollLeft),r=_.ry(e).getStyle("z-index")||0;return{width:t.width,height:t.height,top:s,left:i,zIndex:r}}function getElementStyles(e,t){var s={};return _.each(t||[],function(t){var i=t.replace(/[A-Z]+/g,function(e){return"-"+e.toLowerCase()});s[t]=_.ry(e).getStyle(i)}),s}function getElementText(e){var t=e.childNodes,s="",i=!1;return _.each(t,function(e){if(!1===i&&3===e.nodeType){var t=e.textContent||e.innerText||e.nodeValue||"";t&&(s=_.trim(t),i=!0)}}),s}function rgbaToRgb(e){var t=e.match(/[\d.]+/g);return t.length>=3?"rgb("+t[0]+","+t[1]+","+t[2]+")":""}function changeStyle(e,t,s){var i=_.getUA(),r=i.ie&&i.ie<9,n="";_.each(t,function(e,t){r&&e.indexOf("rgba")>-1&&(e=rgbaToRgb(e));var s=t.replace(/[A-Z]+/g,function(e){return"-"+e.toLowerCase()});n+=s+": "+e+" !important;"}),""!==n&&(addStyleToHead({attr_value:s=_.encodeSelector(s),text:n="[sensors_ab_ele_style_id="+s+"]{"+n+"}",attr_key:"sensors_ab_ele_style_id"}),e.setAttribute("sensors_ab_ele_style_id",s))}function changeText(e,t){var s=e.tagName;getElementText(e)!==t&&(e.textContent?e.textContent=t:e.innerText?e.innerText=t:e.innerHTML=t,"input"!==s&&"INPUT"!==s||(e.value=t||""))}function propsFilter(e,t){var s=e.originProps||{},i=t.originProps||{},r=s.attributes||{},n=i.attributes||{},a=!0;return s.text&&s.text!==i.text&&(a=!1),r&&_.each(["src","href","target"],function(e){r[e]&&r[e]!==n[e]&&(a=!1)}),a}function changeAttribute(e,t,s){e.setAttribute(t,s)}function getElementPropsByAttr(e,t){var s=t.originProps,i={attributes:{}},r=s.attributes;return _.each(r.style||{},function(t,s){i.attributes.style[s]=_.ry(e).getStyle(s)}),Object.hasOwnProperty.call(s,"text")&&(i.attributes.text=getElementText(e)),_.each(["src","href"],function(t){Object.hasOwnProperty.call(r,t)&&(i.attributes[t]=e[t])}),Object.hasOwnProperty.call(r,"target")&&(i.attributes.target=e.getAttribute("target")),i}function changeAttributes(e,t,s){s||(s=getElementPropsByAttr(e,t));var i=propsFilter(t,s);if(i){var r=t.props;_.isObject(r)&&setAttributes(e,r,t)}return i}function setAttributes(e,t,s){if(Object.hasOwnProperty.call(t,"attributes")){var i=t.attributes;Object.hasOwnProperty.call(i,"style")&&changeStyle(e,i.style,s.selector),_.each(["href","target","src"],function(t){i[t]&&e.getAttribute(t)!==i[t]&&changeAttribute(e,t,i[t])})}Object.hasOwnProperty.call(t,"text")&&"innerHtml"!==s.type&&changeText(e,t.text)}function addStyleToHead(e){try{var t=document.createElement("style");t.innerHTML=e.text,t.setAttribute(e.attr_key,e.attr_value),document.getElementsByTagName("head")[0].append(t)}catch(s){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(e,s.stack||s.message)}}function addScriptToBody(e){try{var t=document.createElement("script");t.setAttribute(e.attr_key,e.attr_value),t.innerHTML="try{"+e.text+"}catch(e){ window.sensorsABTestModifyListener && window.sensorsABTestModifyListener("+JSON.stringify(e)+", e.stack || e.message) }",document.body.append(t)}catch(s){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(e,s.stack||s.message)}}function loadVtesting(e,t){_.loadScript(_.extend({success:function(){},error:function(){},type:"js",url:e},t))}function addMutationObserver(e){var t=new(0,window.MutationObserver)(e);return t.observe(document.body,{childList:!0,subtree:!0}),t}function removeMutationObserver(e){e&&e.disconnect()}function getInfoByElement(e,t,s){var i=e.tagName.toLowerCase(),r=getElementStyles(e,t),n={selector:getDomSelector(e),originProps:{attributes:{style:r},text:getElementText(e),hasChildren:e.children.length>0},type:"text",tagName:i};"a"===i&&(n.originProps.attributes.href=e.href,e.getAttribute("target")&&(n.originProps.attributes.target=e.getAttribute("target")),n.type="link"),"img"===i&&(n.originProps.attributes.src=e.src,n.type="img"),e.hasAttribute("sensors_ab_widget")&&(n.type="innerHtml");var a=e.getAttribute("style");if(s)for(var o=0;o-1&&e.parentElement.removeChild(e)}),i&&s&&i.removeAttribute(s)}function addHtmlElement(e,t){var s=_.getDomBySelector(e.base),i=e.props.text,r=e.props.sensors_ab_widget,n=e.operation;if(!s)throw"VABTest: No base element";if(!s.parentNode)throw"base element parentNode not found";var a=document.createElement("font");if("text"===r&&(a.innerText=i),"html"===r&&(a.innerHTML=i),renderConfigAttrs(a,e,t),"BEFORE_INSERTION"===n)s.parentNode.insertBefore(a,s);else{if("AFTER_INSERTION"!==n)throw"operation not supported";s.nextSibling?s.parentNode.insertBefore(a,s.nextSibling):s.parentNode.appendChild(a)}return getDomSelector(a)}function updateHtmlElement(e,t){var s=e.selector,i=e.props.text,r="text"===e.props.sensors_ab_widget;const n=document.querySelector(s);if(!n)throw"element not found:"+s;r?n.innerText=i:n.innerHTML=i,renderConfigAttrs(n,e,t)}function renderInnerHtml(e,t,s){var i=null,r=null,n=_.getDomBySelector(e.selector)||document.querySelector&&document.querySelector(e.selector);if(n&&n.hasAttribute("sensors_ab_widget")){updateHtmlElement(e,t);var a=getElementPostion(document.querySelector(e.selector));s&&s.setSelectElePostion(a)}else{function o(){return i=addHtmlElement(e,t)}s?r=s.getModifiedEleSelectorsWhen(o):o()}return{selector:e.selector,addedEleSelector:i,updatedSelectors:r}}function renderConfigAttrs(e,t,s){if(s&&s.length)for(var i=0;i0||(i.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",t.param_name),r.verify_success=!1);break;case"value_type":_.isString(t.value_type)&&-1!==_.indexOf(i.value_type_list,t.value_type)||(i.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",t.value_type),r.verify_success=!1);break;case"default_value":"undefined"==typeof t.default_value?(i.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),r.verify_success=!1):i.valueType(t.default_value,t.value_type)||(i.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",t.default_value,t.value_type),r.verify_success=!1);break;case"callback":_.isFunction(t.callback)||(i.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),r.verify_success=!1);break;default:r.verify_success=!1}else if("not_essential"===s)switch(n){case"timeout_milliseconds":t.timeout_milliseconds=t.timeout_milliseconds||i.SensorsABTest.para.timeout_milliseconds||i.SensorsABTest.default_para.timeout_milliseconds,(!_.isNumber(t.timeout_milliseconds)||_.isNumber(t.timeout_milliseconds)&&t.timeout_milliseconds<=0)&&(i.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",t.timeout_milliseconds),t.timeout_milliseconds=i.SensorsABTest.para.timeout_milliseconds),t.timeout_milliseconds<200&&(t.timeout_milliseconds=200);break;case"properties":t.properties=_.isObject(t.properties)?t.properties:{}}}),r.para=t,r},resolveCustomProperties:function(e){var t=this,s={verify_success:!0,para:null},i=e.custom_properties;if(!_.isObject(i)||_.isEmptyObject(i))return delete e.custom_properties,s.para=e,s;if(_.each(i,function(e,i){if((!_.isString(i)||!t.regName.test(i)||i.length>100)&&(t.SensorsABTest.log(" property name [ "+i+" ] is not invalid "),s.verify_success=!1),(_.isString(e)||_.isNumber(e)||_.isBoolean(e)||_.isArray(e)||_.isDate(e))&&!(_.isString(e)&&e.length>500)||(t.SensorsABTest.log("property [ "+i+" ] of value [ "+JSON.stringify(e)+" ] is not invalid"),s.verify_success=!1),_.isArray(e)){var r=!0;_.each(e,function(e){!1!==r&&(_.isString(e)||(r=!1))}),r||(t.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+i+" ] of value "+JSON.stringify(e)+" is not invalid"),s.verify_success=!1)}}),!0===s.verify_success){var r={};_.each(i,function(e,t){_.isDate(e)?r[t]=_.formatDate(e):_.isString(e)?r[t]=e:r[t]=JSON.stringify(e)}),e.custom_properties=r}return s.para=e,s}},_.VerifyStore=VerifyStore,_.listenPageState=function(e){({visibleHandle:_.isFunction(e.visible)?e.visible:function(){},hiddenHandler:_.isFunction(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;document.addEventListener(e.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}}).init()},_.listenPageState=function(e){({visibleHandle:_.isFunction(e.visible)?e.visible:function(){},hiddenHandler:_.isFunction(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;document.addEventListener(e.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}}).init()},_.getStorageData=function(e,t){var s=_.localStorage.get(e);_.isString(s)&&(s=t.kit.userDecryptIfNeeded(s));try{s=JSON.parse(s)}catch(i){_.log(i)}return s},_.setStorageData=function(e,t,s){e=JSON.stringify(e),s&&(e=_.userEncrypt(e)),_.localStorage.set(t,e)},Mask.prototype={createMaskStyle:function(){var e="["+this.attr_name+"],["+this.attr_name+"] body{opacity:0 !important;-khtml-opacity:0 !important;-moz-opacity:0;filter:alpha(opacity=0);}",t=document.createElement("style");t.type="text/css";try{t.appendChild(document.createTextNode(e))}catch(s){t.styleSheet.cssText=e}try{this.style_element=t,document.getElementsByTagName("head")[0].appendChild(t)}catch(s){_.log("error when create calls")}},show:function(e){try{var t=this;if(this.is_abort)return!1;var s=null;if(s=document.getElementsByTagName("html")[0],!_.isElement(s))return;s.setAttribute(this.attr_name,"1"),this.is_added=!0,_.isNumber(e)&&(this.remove_timer=setTimeout(function(){t.is_timeout=!0,t.remove()},e))}catch(i){_.log("error when show calls")}},remove:function(){try{if(this.is_abort||(this.is_abort=!0),this.is_added){this.is_added=!1;var e=null;if(e=document.getElementsByTagName("html")[0],!_.isElement(e))return;e.removeAttribute(this.attr_name),this.style_element&&(document.getElementsByTagName("head")[0].removeChild(this.style_element),this.style_element=null)}this.remove_timer&&(clearTimeout(this.remove_timer),this.remove_timer=null)}catch(t){_.log("error when remove calls")}}},_.Mask=Mask,NormalStore.prototype={init:function(e){if(!this.setPara(e))return!1;this.bridgeState="ab_no_host_bridge",/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?this.SensorsABTest.state.platform="H5":this.SensorsABTest.state.platform="Web",this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f\uff0c\u8bd5\u9a8c URL\uff1a",e.url),this.SensorsABTest.checkSADebug(),this.SensorsABTest.store.init(this.getResultFromServer,this)},setPara:function(e){if(!_.isString(e.url)||"http"!==e.url.slice(0,4))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1;if("https"===location.protocol.slice(0,5)&&"http:"===e.url.slice(0,5))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0chttps \u9875\u9762\u5fc5\u987b\u4f7f\u7528 https \u7684 URL"),!1;var t=_.getQueryParam(e.url,"project-key");if(!t)return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff08\u5fc5\u987b\u5305\u542b project-key\uff09\uff01"),!1;e.project_key=t;var s=this.SensorsABTest.verifyStore.para("A/B Testing SDK \u521d\u59cb\u5316",e,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=_.extend({},this.SensorsABTest.default_para,s.para),_.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),_.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),!0===this.SensorsABTest.sd.para.encrypt_cookie&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},asyncFetch:function(e){var t=this;this.SensorsABTest.normalStore.getCodeExpResultFromServer({para:e,suc:function(s){if(_.isObject(s)&&"SUCCESS"===s.status){var i=t.SensorsABTest.getExpResult(e);e.callback(i)}else e.callback(e.default_value)},err:function(){e.callback(e.default_value)}})},creatRequestData:function(e){var t="";_.isEmptyObject(this.SensorsABTest.sd.store._state)||(t=this.SensorsABTest.sd.store._state._first_id||this.SensorsABTest.sd.store._state.first_id||this.SensorsABTest.sd.store._state._distinct_id||this.SensorsABTest.sd.store._state.distinct_id);var s={anonymous_id:t,platform:this.SensorsABTest.state.platform,abtest_lib_version:this.SensorsABTest.lib_version,properties:{$is_first_day:this.SensorsABTest.sd._.cookie.getNewUser()}};return _.isObject(e.properties)&&(s.properties=_.extend({},s.properties,e.properties)),_.isObject(e.custom_properties)&&(s.custom_properties=_.extend({},e.custom_properties),s.param_name=e.param_name),this.SensorsABTest.sd.store._state.first_id&&(s.login_id=this.SensorsABTest.sd.store.getDistinctId()),s},getCodeExpResultFromServer:function(e){this.getResultFromServer(e,!0)},getResultFromServer:function(e,t){var s,i=this,r=(e=_.isObject(e)?e:{}).para||{},n=e.suc,a=e.err,o=this.creatRequestData(r);this.SensorsABTest.log("\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),s=i.SensorsABTest.sd.store.getDistinctId(),i.SensorsABTest.sd._.ajax({url:i.SensorsABTest.para.url,type:"POST",data:JSON.stringify(o),credentials:!1,contentType:"application/json",timeout:r.timeout_milliseconds||i.SensorsABTest.para.timeout_milliseconds,cors:!0,success:function(e){t?i.SensorsABTest.dealCodeExpResponseData(e,s):i.SensorsABTest.dealResponseData(e,s),n&&n(e),i.SensorsABTest.fetchData.setNextFetch()},error:function(e){i.SensorsABTest.log("\u670d\u52a1\u7aef\u8bf7\u6c42\u53d1\u9001\u5931\u8d25",e),a&&a(),i.SensorsABTest.fetchData.setNextFetch()}})}},NormalStore.prototype.methods={asyncFetchABTest:function(e){if(!_.isObject(e))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=this.SensorsABTest.verifyStore.para("asyncFetchABTest",e,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(t.verify_success){e=t.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(e);s.verify_success?(e=s.para,this.SensorsABTest.normalStore.asyncFetch(e)):e.callback(e.default_value)}},fastFetchABTest:function(e){if(!_.isObject(e))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=this.SensorsABTest.verifyStore.para("fastFetchABTest",e,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(t.verify_success){e=t.para;var s=this.SensorsABTest.searchLocalExp(e.param_name);if(_.isObject(s)){var i=this.SensorsABTest.getExpResult(e,s);e.callback(i)}else{var r=this.SensorsABTest.verifyStore.resolveCustomProperties(e);r.verify_success?(e=r.para,this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.normalStore.asyncFetch(e)):e.callback(e.default_value)}}},fetchCacheABTest:function(e){if(_.isObject(e)){var t=this.SensorsABTest.verifyStore.para("fetchCacheABTest",e,{param_name:"essential",value_type:"essential",default_value:"essential"});if(t.verify_success)return this.SensorsABTest.getExpResult(t.para)}else this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e")}},BridgeStore.prototype={init:function(e){var t=this;if(this.SensorsABTest.state.storage.name="sawebjssdkabtest_bridge",!this.setPara(e))return!1;this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f"),this.abBridge=new this.SensorsABTest.sd.JSBridge({type:"abtest",app_call_js:function(e){try{e=_.base64Decode(e)}catch(s){t.SensorsABTest.log("App\u6570\u636ebase64\u89e3\u7801\u5f02\u5e38",e)}try{(e=JSON.parse(e)).message_id&&this.double(e)}catch(s){t.SensorsABTest.log("App\u6570\u636e\u89e3\u6790\u5f02\u5e38",e)}}}),_.isObject(window.SensorsData_iOS_JS_Bridge)&&window.SensorsData_iOS_JS_Bridge.sensorsdata_abtest_module&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":_.isObject(window.SensorsData_APP_New_H5_Bridge)&&_.isFunction(window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module)&&window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module()&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":this.SensorsABTest.bridgeState="ab_no_abtest_bridge",this.SensorsABTest.store.init(this.getResultFromApp,this)},setPara:function(e){var t=this.SensorsABTest.verifyStore.para("\u6253\u901a\u521d\u59cb\u5316",e,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=_.extend({},this.SensorsABTest.default_para,t.para),_.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),_.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),!0===this.SensorsABTest.sd.para.encrypt_cookie&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},getResultFromApp:function(e){var t=this,s=(e=_.isObject(e)?e:{}).para||{},i=e.suc,r=e.err,n=s.timeout_milliseconds||this.SensorsABTest.para.timeout_milliseconds,a={origin_platform:"H5"};_.isObject(s.custom_properties)&&(a=_.extend(a,{custom_properties:s.custom_properties,param_name:s.param_name})),this.SensorsABTest.log("\u5411App\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),"ab_bridge_ok"===t.SensorsABTest.bridgeState?t.abBridge.requestToApp({data:{properties:s.properties,timeout:n,request_body:a},callback:function(e){_.isObject(e)&&_.isObject(e.data)?(t.SensorsABTest.log("\u6210\u529f\u83b7\u53d6\u5230 App \u7aef\u8fd4\u56de\u7684\u8bd5\u9a8c\u6570\u636e","data:",e),t.SensorsABTest.dealResponseData(e.data),i&&i(e)):(t.SensorsABTest.log("App \u7aef\u8bf7\u6c42\u5931\u8d25"),r&&r()),t.SensorsABTest.fetchData.setNextFetch()},timeout:{time:n,callback:function(){t.SensorsABTest.log("\u83b7\u53d6App\u7aef\u6570\u636e\u5931\u8d25"),r&&r(),t.SensorsABTest.fetchData.setNextFetch()}}}):r&&(t.SensorsABTest.log("A/B Testing \u6253\u901a\u5931\u8d25\uff0c",t.SensorsABTest.bridgeState),r())},asyncFetch:function(e){var t=this;this.SensorsABTest.bridgeStore.getResultFromApp({para:e,suc:function(s){if(_.isObject(s.properties)&&(e.properties=_.extend(s.properties,e.properties)),"SUCCESS"===s.data.status){var i=t.SensorsABTest.getExpResult(e);e.callback(i)}else e.callback(e.default_value)},err:function(){e.callback(e.default_value)}})}},BridgeStore.prototype.methods={asyncFetchABTest:function(e){if(!_.isObject(e))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=this.SensorsABTest.verifyStore.para("asyncFetchABTest",e,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(t.verify_success){e=t.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(e);s.verify_success?(e=s.para,"ab_bridge_ok"===this.SensorsABTest.bridgeState?this.SensorsABTest.bridgeStore.asyncFetch(e):e.callback(e.default_value)):e.callback(e.default_value)}},fastFetchABTest:function(e){if(!_.isObject(e))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=this.SensorsABTest.verifyStore.para("fastFetchABTest",e,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(t.verify_success){e=t.para;var s=this.SensorsABTest.searchLocalExp(e.param_name);if(_.isObject(s)){var i=this.SensorsABTest.getExpResult(e,s);e.callback(i)}else{var r=this.SensorsABTest.verifyStore.resolveCustomProperties(e);r.verify_success?(e=r.para,"ab_bridge_ok"===this.SensorsABTest.bridgeState?(this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.bridgeStore.asyncFetch(e)):e.callback(e.default_value)):e.callback(e.default_value)}}},fetchCacheABTest:function(e){if(_.isObject(e)){var t=this.SensorsABTest.verifyStore.para("fetchCacheABTest",e,{param_name:"essential",value_type:"essential",default_value:"essential"});if(t.verify_success)return this.SensorsABTest.getExpResult(t.para)}else this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e")}},EventInterceptor.prototype.init=function(e){if(this.pause_sdk_before_trigger=e.pause_sdk_before_trigger||!1,!0===e.pause_sdk_before_trigger){var t=this;this.sd.registerInterceptor("sendDataStage",{send:{priority:0,entry:function(e,s){t.sendInterceptor(e,s)}}})}},EventInterceptor.prototype.start=function(){!1!==this.pause_sdk_before_trigger&&(this.events=[],this.isStart=!0)},EventInterceptor.prototype.stop=function(){if(!1!==this.pause_sdk_before_trigger){this.isStart=!1;var e=this;_.each(this.events,function(t){t._flush_time=(new Date).getTime(),e.sd.kit.sendData(t)}),this.events=[]}},EventInterceptor.prototype.sendInterceptor=function(e,t){var s=e.data,i=s.event,r=s.type;return!0===this.isStart&&"track"===r&&["$ABTestTrigger","WebABTestTrigger"].indexOf(i)<0&&(this.events.push(s),t.cancellationToken.stop()),e},Link.prototype.init=function(e){return this.initPara(e),this.para?(this.eventInterceptor=new EventInterceptor(this.SensorsABTest),this.eventInterceptor.init(this.para),this.eventInterceptor.start(),_.getQueryParam(location.href,"saSDKMultilink")?(this.is_filtered_out=!0,!1):(this.start_time=(new Date).getTime(),this.para.use_mask&&this.initMask(),void this.addSinglePageListener())):(this.SensorsABTest.log("multilink is closed"),!1)},Link.prototype.addSinglePageListener=function(){var e=this;this.SensorsABTest.sd.ee.spa.prepend("switch",function(t){return t!==location.href&&(e.is_filtered_out=!1,e.isFirst=!0,e.mask_instance&&e.mask_instance.remove(),_.getQueryParam(location.href,"saSDKMultilink")?(e.is_filtered_out=!0,!1):(e.eventInterceptor&&e.eventInterceptor.start(),e.start_time=(new Date).getTime(),e.para.use_mask&&e.initMask(),void e.resolve()))})},Link.prototype.initMask=function(){this.mask_instance=new _.Mask("link_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.para.timeout)},Link.prototype.initPara=function(e){if(_.isFunction(e))try{e=e()}catch(t){return this.SensorsABTest.log("link para error!"),void(this.para=!1)}!1===e?this.para=!1:_.isObject(e)&&(this.para.timeout=_.isNumber(e.timeout)&&e.timeout>=0?e.timeout:500,this.para.use_mask=_.isBoolean(e.use_mask)?e.use_mask:this.para.use_mask,this.para.control_link_search=_.isString(e.control_link_search)?e.control_link_search:"default",this.para.experiment_link_search=_.isString(e.experiment_link_search)?e.experiment_link_search:"default",this.para.pass_params=!_.isBoolean(e.pass_params)||e.pass_params,this.para.onRedirect=_.isFunction(e.onRedirect)?e.onRedirect:null,this.para.pause_sdk_before_trigger=!!_.isBoolean(e.pause_sdk_before_trigger)&&e.pause_sdk_before_trigger)},Link.prototype.resolve=function(){var e=this.SensorsABTest.results,t=this;if(!this.para||!_.isArray(e)||this.is_filtered_out||!this.isFirst||0===this.para.timeout)return this.eventInterceptor&&this.eventInterceptor.stop(),!1;if((new Date).getTime()-this.start_time>this.para.timeout)return this.SensorsABTest.log("The multilink was stopped because the request timeout"),this.eventInterceptor&&this.eventInterceptor.stop(),!1;this.isFirst=!1;var s=!1;_.each(e,function(e){if(!_.isObject(e)||s||"LINK"!==e.experiment_type)return!1;t.isTriggerLinkExp(e)&&(s=!0,t.SensorsABTest.trackOutTestTrigger("LINK"),t.redirectUrl(e))}),!s&&this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),!s&&this.eventInterceptor&&this.eventInterceptor.stop()},Link.prototype.stopTrigger=function(){!1!==this.isFirst&&(this.isFirst=!1,this.SensorsABTest.log("The multilink was stopped because the request failed"),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),this.eventInterceptor&&this.eventInterceptor.stop())},Link.prototype.isTriggerLinkExp=function(e){return _.isString(e.control_link)&&_.isString(e.link_match_type)?"REGEXP"===e.link_match_type?!!_.checkUrlIsRegexp(e.control_link,e.regexp_flags)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",e.abtest_experiment_id),!1):!!_.checkUrlIsMatch(e.control_link,e.link_match_type)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",e.abtest_experiment_id),!1):(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",e.abtest_experiment_id),!1)},Link.prototype.redirectUrl=function(e){if(!e.experiment_link||!_.isString(e.experiment_link))return this.SensorsABTest.log("\u9875\u9762\u8df3\u8f6c\u5931\u8d25\uff0cexperiment_link\u5b57\u6bb5\u5f02\u5e38",e.abtest_experiment_id),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),void(this.eventInterceptor&&this.eventInterceptor.stop());if(!0===e.is_control_group&&("STRICT"===e.link_match_type||"REGEXP"===e.link_match_type))return this.SensorsABTest.triggerHandle(e),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),void(this.eventInterceptor&&this.eventInterceptor.stop());function t(e){return _.secCheck.isHttpUrl(e)?_.secCheck.removeScriptProtocol(e):(this.SensorsABTest.log("\u975e\u6cd5URL"),!1)}var s,i=location.href,r=e.experiment_link;if("REGEXP"===e.link_match_type&&/\$\d+/.test(r)){var n=e.regexp_flags?new RegExp(e.control_link,e.regexp_flags):new RegExp(e.control_link);r=i.replace(n,r)}if(s=this.para.pass_params?t(this.getMergedUrl(e.is_control_group,r,i)):t(this.getMergedUrl(e.is_control_group,r))){var a=this.SensorsABTest.triggerHandle(e)?80:0;this.para.onRedirect?(this.para.onRedirect(s),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove()):this.redirect(s,a),this.mask_instance&&this.mask_instance.remove_timer&&clearTimeout(this.mask_instance.remove_timer)}},Link.prototype.redirect=function(e,t){setTimeout(function(){location.href=e},t)},Link.prototype.getMergedUrl=function(e,t,s){var i="",r="",n="",a={parse_url:null,search:""},o={parse_url:null,search:"",hash:""};function c(e){var t=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e);if(t)return{host:t[1]||"",search:t[2]||"",hash:t[3]||""}}if(!s||(a.parse_url=c(s),a.parse_url)){if(o.parse_url=c(t),o.parse_url)return s&&("after_hash"===this.para.control_link_search?a.search=l(a.parse_url.hash).search:a.search=a.parse_url.search),e?"after_hash"===this.para.control_link_search?(o.search=l(o.parse_url.hash).search,o.hash=l(o.parse_url.hash).hash):o.search=o.parse_url.search:"after_hash"===this.para.experiment_link_search?(o.search=l(o.parse_url.hash).search,o.hash=l(o.parse_url.hash).hash):o.search=o.parse_url.search,r=s?this.getSearchStr(a.search,o.search):this.getSearchStr(o.search),e&&"after_hash"===this.para.control_link_search||!e&&"after_hash"===this.para.experiment_link_search?i=o.hash.length>0?o.parse_url.host+o.parse_url.search+o.hash+r:o.parse_url.search.length>0?o.parse_url.host+o.parse_url.search+"&"+r.substring(1):o.parse_url.host+r:(n="after_hash"===this.para.control_link_search?o.parse_url.hash:s?o.parse_url.hash||a.parse_url.hash:o.parse_url.hash,i=o.parse_url.host+r+n),i;this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",t)}else this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",s);function l(e){var t={hash:"",search:""};if(!_.isString(e))return t;var s=e.indexOf("?");return s>-1?(t.search=e.slice(s),t.hash=e.slice(0,s)):t.hash=e,t}},Link.prototype.getSearchStr=function(e,t){var s=_.getQueryParamsFromUrl(e),i=_.getQueryParamsFromUrl(t),r=_.extend(s,i),n="";if(_.isEmptyObject(r))return"?saSDKMultilink=true";var a=!0;for(var o in r)a?(n+="?",a=!1):n+="&",null!==r[o]?n=n+o+"="+r[o]:n+=o;return n+"&saSDKMultilink=true"},window.MutationObserver||(window.MutationObserver=function(e){function t(e){this._watched=[],this._listener=e}function s(t){var s={type:null,target:null,addedNodes:[],removedNodes:[],previousSibling:null,nextSibling:null,attributeName:null,attributeNamespace:null,oldValue:null};for(var i in t)p(s,i)&&t[i]!==e&&(s[i]=t[i]);return s}function i(t,i){var r=o(t,i);return function(n){var l,u=n.length;i.charData&&3===t.nodeType&&t.nodeValue!==r.charData&&n.push(new s({type:"characterData",target:t,oldValue:r.charData})),i.attr&&r.attr&&a(n,t,r.attr,i.afilter),(i.kids||i.descendents)&&(l=function(t,i,r,n){var o;function l(e,i,r,o,c){for(var l,h,_,d=e.length-1,p=-~((d-c)/2);_=e.pop();)l=r[_.i],h=o[_.j],n.kids&&p&&Math.abs(_.i-_.j)>=d&&(t.push(s({type:"childList",target:i,addedNodes:[l],removedNodes:[l],nextSibling:l.nextSibling,previousSibling:l.previousSibling})),p--),n.attr&&h.attr&&a(t,l,h.attr,n.afilter),n.charData&&3===l.nodeType&&l.nodeValue!==h.charData&&t.push(s({type:"characterData",target:l,oldValue:h.charData})),n.descendents&&u(l,h)}function u(i,r){for(var _,p,g,f,m,S,v,b=i.childNodes,y=r.kids,T=b.length,A=y?y.length:0,B=0,k=0,x=0;k=0?e.timeout:this.timeout;var t=_.isString(e.vabtest_url)?e.vabtest_url:"";t&&("https:"===location.protocol?"https:"===t.slice(0,6)?this.vabtest_url=t:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u534f\u8bae\u5934\u5e94\u8bbe\u7f6e\u4e3a https"):"http:"===t.slice(0,5)||"https:"===t.slice(0,6)?this.vabtest_url=t:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u5e94\u8bbe\u7f6e\u4e3a\u6709\u6548 URL"))}else this.para=!1},Vabtesting.prototype.resolve=function(){var e=this.SensorsABTest.results;if(!1!==this.enable_visualize&&!0!==this.is_editor&&!1!==this.isFirst){if((new Date).getTime()-this.start_time>this.timeout)return this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),!1;var t=this;this.isFirst=!1;var s=!1;_.each(e,function(e){if(!_.isObject(e)||"VISUAL"!==e.experiment_type)return!1;if(s)return!1;var i=e.experiment_value;if(!_.isArray(i))try{i=JSON.parse(e.experiment_value),e.experiment_value=i}catch(r){return!1}t.isTriggerVisualExp(e)&&(s=!0,t.renderGlobalElement(e),t.prepareResource(e,t.render.bind(t)),t.visualExp=e,t.SensorsABTest.trackOutTestTrigger("VISUAL"))}),!s&&this.use_mask&&this.destroyMask()}},Vabtesting.prototype.initMask=function(){this.mask_instance=new _.Mask("vabtest_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.timeout)},Vabtesting.prototype.destroyMask=function(){this.mask_instance&&this.mask_instance.remove()},Vabtesting.prototype.prepareResource=function(e,t){var s=this,i=e.experiment_value;_.isArray(i)&&(_.each(i,function(i){var r=i.tagName,n=i.props;if("img"===r&&n&&n.attributes&&_.isString(n.attributes.src)){var a=n.attributes.src;if(s.imgLoadingList.push(a),s.loadedImages.indexOf(a)>-1){var o=s.imgLoadingList.indexOf(a);return o>-1&&s.imgLoadingList.splice(o,1),void(0===s.imgLoadingList.length&&t(e))}var c=document.createElement("img");c.width=1,c.height=1,c.onload=l,c.onerror=l,c.onabort=l,c.src=n.attributes.src}function l(){var i=s.imgLoadingList.indexOf(a);s.loadedImages.push(a),i>-1&&s.imgLoadingList.splice(i,1),0===s.imgLoadingList.length&&t(e)}}),0===this.imgLoadingList.length&&t(e))},Vabtesting.prototype.render=function(e){this.removeDomChangeListener();var t=this,s=function(){if(t.isDomReady=!0,t.use_mask&&t.mask_instance&&!0===t.mask_instance.is_timeout)t.SensorsABTest.log("\u6e32\u67d3\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01");else{t.isTrigger||(t.SensorsABTest.triggerHandle(e),t.isTrigger=!0),_.isArray(t.originData)&&(_.each(t.originData,function(e){restoreElement(e)}),t.originData=[]),_.each(t.dynamicAddedElements,function(e){removeElement(e)}),t.dynamicAddedElements=[];var s=e.experiment_value;_.isArray(s)&&_.each(s,function(e){var s=e.selector,i=e.type;if("innerHtml"===e.type){var r=renderInnerHtml(e,!0,t.domEditor);r.addedEleSelector&&t.dynamicAddedElements.push(r.addedEleSele)}if("img"===i||"link"===i||"text"===i||"innerHtml"===i){var n=_.getDomBySelector(s);if(n)try{var a=getInfoByElement(n,[]);changeAttributes(n,e,a.eleInfo)&&t.originData.push(a)}catch(o){_.logger.log("render vabtest error")}}}),t.use_mask&&t.destroyMask(),t.addDomChangeListener()}};this.isDomReady?s():_.bindReady(s)},Vabtesting.prototype.restoreElements=function(){_.each(this.originData,function(e){restoreElement(e)}),_.each(this.dynamicAddedElements,function(e){removeElement(e)}),this.dynamicAddedElements=[],this.visualExp=null,this.isFirst=!0,this.start_time=(new Date).getTime(),this.originData=[],this.isTrigger=!1,restoreInsertionElement({attr_key:"sensors_ab_style_id"}),restoreInsertionElement({attr_key:"sensors_ab_script_id"})},Vabtesting.prototype.addDomChangeListener=function(){var e=this;_.bindReady(function(){e.isDomReady=!0,e.domChangeObserver=addMutationObserver(e.observerCallback.bind(e))})},Vabtesting.prototype.removeDomChangeListener=function(){removeMutationObserver(this.domChangeObserver),this.domChangeObserver=null},Vabtesting.prototype.addSinglePageListener=function(){var e=this;this.SensorsABTest.sd.ee.spa.on("switch",function(t){if(t===location.href)return!1;e.mask_instance&&e.destroyMask(),e.start_time=(new Date).getTime(),e.use_mask&&e.initMask(),e.restoreElements(),e.resolve()})},Vabtesting.prototype.observerCallback=function(){this.visualExp&&this.prepareResource(this.visualExp,this.render.bind(this))},Vabtesting.prototype.stopTrigger=function(){this.isFirst=!1,this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u5931\u8d25\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),this.use_mask&&this.destroyMask()},Vabtesting.prototype.isTriggerVisualExp=function(e){return _.isString(e.control_link)&&_.isString(e.link_match_type)?!!_.checkUrlIsMatch(e.control_link,e.link_match_type)||(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",e.abtest_experiment_id),!1):(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",e.abtest_experiment_id),!1)},Vabtesting.prototype.renderGlobalElement=function(e){var t=e.experiment_value;_.isArray(t)&&_.each(t,function(e){switch(e.type){case"globalScript":_.bindReady(function(){addScriptToBody({attr_value:e.id,text:e.props.text,attr_key:"sensors_ab_script_id"})});break;case"globalStyle":addStyleToHead({attr_value:e.id,text:e.props.text,attr_key:"sensors_ab_style_id"})}})},SensorsABTest.prototype.asyncFetchABTest=function(){_.error("asyncFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},SensorsABTest.prototype.fastFetchABTest=function(){_.error("fastFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},SensorsABTest.prototype.fetchCacheABTest=function(){_.error("fetchCacheABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},SensorsABTest.prototype.searchLocalExp=function(e){return this.codeExpData[e]?this.codeExpData[e]:null},SensorsABTest.prototype.getExpResult=function(e,t){var s=e.default_value,i=t||this.searchLocalExp(e.param_name);return _.isObject(i)?_.isObject(i.js_config)&&(i.js_config.type===e.value_type?(s=i.js_config.value,this.triggerHandle(i,e)):this.log("\u8bd5\u9a8c\u7ed3\u679c\u7c7b\u578b\u4e0e\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e0d\u4e00\u81f4\uff0cparam_name\uff1a"+e.param_name+"\uff0c\u5f53\u524d\u8fd4\u56de\u7c7b\u578b\u4e3a\uff1a"+i.js_config.type+"\uff0c\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e3a\uff1a"+e.value_type)):this.log("localdata\u672a\u67e5\u8be2\u5230\u8bd5\u9a8c\u6570\u636e\uff0c\u8bd5\u9a8c\u53c2\u6570\u540d\u79f0\uff1a"+e.param_name),this.trackOutTestTrigger("CODE",e),s},SensorsABTest.prototype.resolveVariables=function(){this.codeExpData={};var e=this,t=this.results;_.each(t,function(t){_.isObject(t)&&t.variables&&_.isArray(t.variables)&&_.each(t.variables,function(s){_.isObject(s)&&!e.codeExpData[s.name]&&(e.codeExpData[s.name]=_.extend({},t),e.codeExpData[s.name].js_config=e.getRelativeValue(s.value,s.type))})})},SensorsABTest.prototype.getRelativeValue=function(e,t){var s=this,i={},r={INTEGER:function(e){var t=parseFloat(e);isNaN(t)?s.log("\u539f\u59cb\u6570\u636e INTEGER \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",e):(i.value=t,i.type="Number")},STRING:function(e){_.isString(e)?(i.value=e,i.type="String"):s.log("\u539f\u59cb\u6570\u636e STRING \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",e)},JSON:function(e){var t=JSON.parse(e);_.isObject(t)?(i.value=t,i.type="Object"):s.log("\u539f\u59cb\u6570\u636e JSON \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",e)},BOOLEAN:function(e){"true"===e?(i.value=!0,i.type="Boolean"):"false"===e?(i.value=!1,i.type="Boolean"):s.log("\u539f\u59cb\u6570\u636e BOOLEAN \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",e)}};try{r[t]?r[t](e):s.log("\u8bd5\u9a8c\u6570\u636e\u7c7b\u578b\u89e3\u6790\u5931\u8d25",t,e)}catch(n){s.log(n,e,t)}return i},SensorsABTest.prototype.dealResponseData=function(e,t){_.isObject(e)?"SUCCESS"===e.status?_.isArray(e.results)&&(this.fetchData.updateExpsCache(e),this.updateLocalData(t)):"FAILED"===e.status&&this.log("\u83b7\u53d6\u8bd5\u9a8c\u5931\u8d25\uff1aerror_type\uff1a"+e.error_type+",error\uff1a"+e.error):this.log("\u8bd5\u9a8c\u6570\u636e\u89e3\u6790\u5931\u8d25\uff0cresponse \uff1a",e)},SensorsABTest.prototype.dealCodeExpResponseData=function(e,t){_.isObject(e)?"SUCCESS"===e.status?_.isArray(e.results)&&(this.fetchData.updateExpsCache(e),this.updateCodeExpLocalData(t)):"FAILED"===e.status&&this.log("\u83b7\u53d6\u8bd5\u9a8c\u5931\u8d25\uff1aerror_type\uff1a"+e.error_type+",error\uff1a"+e.error):this.log("\u8bd5\u9a8c\u6570\u636e\u89e3\u6790\u5931\u8d25\uff0cresponse \uff1a",e)},SensorsABTest.prototype.updateCodeExpLocalData=function(e){this.analyzeCodeExpData(),this.updateStorage(e),this.log("\u66f4\u65b0\u8bd5\u9a8c\u6570\u636e\u6210\u529f")},SensorsABTest.prototype.analyzeCodeExpData=function(){var e=this.results;if(!_.isArray(e))return this.log("\u89e3\u6790——\u6570\u636e\u683c\u5f0f\u9519\u8bef",e),!1;this.resolveVariables(),this.registerProperty()},SensorsABTest.prototype.updateLocalData=function(e){this.analyzeData(),this.updateStorage(e),this.log("\u66f4\u65b0\u8bd5\u9a8c\u6570\u636e\u6210\u529f")},SensorsABTest.prototype.updateStorage=function(e){var t=(new Date).getTime(),s={results:this.results,updateTime:t,triggerList:this.triggerList,distinct_id:e||this.sd.store.getDistinctId(),outTriggerList:this.outTriggerList,out_list:this.out_list,track_config:this.track_config},i=this.state.storage.name,r=this.para.encrypt_cookie;_.setStorageData(s,i,r),this.updateTime=t},SensorsABTest.prototype.analyzeData=function(){var e=this.results;if(!_.isArray(e))return this.log("\u89e3\u6790——\u6570\u636e\u683c\u5f0f\u9519\u8bef",e),!1;this.link.resolve(),this.vabtest.resolve(),this.resolveVariables(),this.registerProperty()},SensorsABTest.prototype.trackOutTestTrigger=function(e,t){var s=this.out_list,i=this,r=!1,n={};if(_.isArray(s)&&s.length>0&&(_.each(s,function(s){_.isObject(s)&&!r&&("CODE"===e?_.isObject(s)&&s.variables&&_.isArray(s.variables)&&_.each(s.variables,function(e){var a=i.getRelativeValue(e.value,e.type);!r&&a&&_.isObject(e)&&t.param_name===e.name&&a.type===t.value_type&&(r=!0,n=s)}):"LINK"===e?_.isString(s.control_link)&&_.isString(s.link_match_type)&&("REGEXP"===s.link_match_type?_.checkUrlIsRegexp(s.control_link,s.regexp_flags)&&(r=!0,n=s):_.checkUrlIsMatch(s.control_link,s.link_match_type)&&(r=!0,n=s)):"VISUAL"===e&&_.isString(s.control_link)&&_.isString(s.link_match_type)&&_.checkUrlIsMatch(s.control_link,s.link_match_type)&&(r=!0,n=s))}),r)){var a=i.sd.store.getDistinctId();n.subject_id&&n.subject_name&&(a=n.subject_name+n.subject_id),i.sendTriggerEvent("outTriggerList",a,n,{})}},SensorsABTest.prototype.registerProperty=function(){if(this.track_config.property_set_switch){var e=this.sd.store.getUnionId(),t=["USER"+(e.login_id||e.anonymous_id),"DEVICE"+e.anonymous_id],s=this.sd.bridge.is_verify_success?this.getLatestSubject():[],i=[],r=[];_.each(this.triggerList,function(e,r){t.indexOf(r)<0&&s.indexOf(r)<0||_.isArray(e)&&_.each(e,function(e){e.result_id&&i.push(e.result_id)})}),_.isArray(this.results)&&_.each(this.results,function(e){e.abtest_experiment_result_id&&r.push(e.abtest_experiment_result_id)}),i.length>0&&this.sd.registerPage({abtest_result:i}),r.length>0&&this.sd.registerPage({abtest_dispatch_result:r})}else this.sd.clearPageRegister(["abtest_result","abtest_dispatch_result"])},SensorsABTest.prototype.saveLatestSubject=function(e){var t=this.getLatestSubject()||[];t.indexOf(e)<0&&t.push(e);var s=this.state.storage.latest_name,i=this.para.encrypt_cookie;_.setStorageData(t,s,i)},SensorsABTest.prototype.getLatestSubject=function(){var e=this.state.storage.latest_name;return _.getStorageData(e,this.sd)||[]},SensorsABTest.prototype.triggerHandle=function(e,t){var s=this.sd.store.getDistinctId();return e.subject_id&&e.subject_name&&(s=e.subject_name+e.subject_id),this.sd.bridge.is_verify_success&&this.saveLatestSubject(s),this.trackTestTrigger(s,e,t)},SensorsABTest.prototype.getTriggerProps=function(e,t){var s={},i=_.isObject(t)&&_.isObject(t.properties)?t.properties:{};if("{}"!==JSON.stringify(this.triggerList)){var r="web_abtesting:"+this.lib_version;s.$lib_plugin_version=[r]}this.para.collect_bridge_status&&(s.$sdk_bridge_status=this.bridgeState);var n={$abtest_experiment_id:e.abtest_experiment_id,$abtest_experiment_group_id:e.abtest_experiment_group_id},a=this.track_config.trigger_content_ext;return _.each(a,function(t){void 0!==e[t]&&(s["$"+t]=e[t])}),s=_.extend(n,s,i)},SensorsABTest.prototype.sendTriggerEvent=function(e,t,s,i){var r=this.track_config.trigger_switch,n=!0,a=this[e];a&&_.isObject(a)&&a[t]&&_.each(a[t],function(e){e.experiment_id===s.abtest_experiment_id&&e.group_id===s.abtest_experiment_group_id&&e.result_id===s.abtest_experiment_result_id&&(n=!1)}),this[e][t]=updateTriggerData(a[t],s),this.updateStorage(),this.registerProperty();var o=this.getTriggerProps(s,i);return n&&r&&this.sd.track("$ABTestTrigger",o),n},SensorsABTest.prototype.trackTestTrigger=function(e,t,s){if(t.is_white_list)return!1;var i=this.sendTriggerEvent("triggerList",e,t,s),r=this.getTriggerProps(t,s);return this.sd.track("WebABTestTrigger",r),i},SensorsABTest.prototype.checkSADebug=function(){var e=this,t=_.getQueryParam(location.href,"sensors_abtest_url"),s=_.getQueryParam(location.href,"feature_code"),i=+_.getQueryParam(location.href,"account_id");if(t.length&&s.length&&_.isNumber(i)&&0!==i){var r={distinct_id:this.sd.store.getDistinctId(),feature_code:s,account_id:i};this.sd._.ajax({url:t,type:"POST",data:JSON.stringify(r),credentials:!1,contentType:"application/json",timeout:this.para.timeout_milliseconds,cors:!0,success:function(){},error:function(t){e.log("distinct_id\u53d1\u9001\u5931\u8d25,err:",t)}})}},SensorsABTest.prototype.initMethods=function(e){var t=this;_.each(["asyncFetchABTest","fastFetchABTest","fetchCacheABTest"],function(s){t[s]=e.methods[s].bind(e)})},FetchData.prototype={timer:null,method:null,context:null,init:function(e,t){this.method=e,this.context=t,this.start(!0)},getServerData:function(e){var t=this;e?this.method.call(this.context,{suc:function(s){e&&("ab_bridge_ok"===t.SensorsABTest.bridgeState&&(s=s.data),_.isObject(s)&&"SUCCESS"===s.status&&_.isArray(s.results)||(t.SensorsABTest.link.stopTrigger(),t.SensorsABTest.vabtest.stopTrigger()))},err:function(){e&&(t.SensorsABTest.link.stopTrigger(),t.SensorsABTest.vabtest.stopTrigger())}}):this.method.call(this.context)},setNextFetch:function(e){var t=this,s=e||this.SensorsABTest.para.update_interval;this.clearFetchTimer(this.timer),this.timer=setTimeout(function(){t.getServerData()},s)},updateExpsCache:function(e){this.SensorsABTest.results=e.results||e.data||[];var t=e.triggerList,s=e.out_list,i=e.outTriggerList;_.isArray(s)&&(this.SensorsABTest.out_list=s),_.isObject(t)&&(this.SensorsABTest.triggerList=e.triggerList),_.isObject(i)&&(this.SensorsABTest.outTriggerList=i),_.isObject(e.track_config)?this.SensorsABTest.track_config=e.track_config:this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},clearExpsCache:function(){this.SensorsABTest.codeExpData={},this.SensorsABTest.results=[],this.SensorsABTest.out_list=[],this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},start:function(e){var t=null,s=(new Date).getTime(),i=_.getStorageData(this.SensorsABTest.state.storage.name,this.SensorsABTest.sd),r=this.SensorsABTest.sd.store.getDistinctId();if(i&&_.isObject(i)&&i.distinct_id===r)if(t=i.updateTime,e&&this.updateExpsCache(i),t&&_.isNumber(t)&&s-t>0&&s-t0&&s-t=3||!e.on)initSensorsABTest.call(this,e,t);else{var s=this;e.on("sdkReady",function(){initSensorsABTest.call(s,e,t)})}},SensorsABTest.prototype.initTest=function(){this.link.init(this.abtestingPara.multilink),this.vabtest.init(this.abtestingPara.visualize),this.sd.bridge.is_verify_success?this.bridgeStore.init(this.abtestingPara):this.normalStore.init(this.abtestingPara),this.registerProperty()},SensorsABTest.prototype.log=function(){return _.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]),this.sd&&this.sd.log.apply(this,arguments)};var instance=new SensorsABTest;instance.__constructor__=SensorsABTest,window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.SensorsABTest=window.SensorsDataWebJSSDKPlugin.SensorsABTest||instance:window.SensorsDataWebJSSDKPlugin={SensorsABTest:instance};export default SensorsABTest; \ No newline at end of file diff --git a/dist/web/plugin/abtesting-sdk-web/abtest.min.js b/dist/web/plugin/abtesting-sdk-web/abtest.min.js index 4b95008b..8c7d2838 100644 --- a/dist/web/plugin/abtesting-sdk-web/abtest.min.js +++ b/dist/web/plugin/abtesting-sdk-web/abtest.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():e()}(this,function(){"use strict";function t(t){this.SensorsABTest=t}function e(t){this.attr_name="sa-abtest-"+t,this.remove_timer=null,this.is_added=!1,this.is_abort=!1,this.is_timeout=!1,this.style_element=null,this.createMaskStyle()}function s(t){t._.extend(U,t._)}function i(t){this.SensorsABTest=t,this.para=t.para}function r(t){this.SensorsABTest=t,this.para=t.para}function n(t){this.sd=t.sd,this.abTest=t,this.events=[],this.isStart=!1,this.pause_sdk_before_trigger=!1}function a(t){this.SensorsABTest=t,this.isFirst=!0,this.start_time=null,this.mask_instance=null,this.is_filtered_out=!1,this.para={timeout:500,use_mask:!0,pass_params:!0,control_link_search:"default",experiment_link_search:"default",pause_sdk_before_trigger:!1}}function o(){if(!window.name)return!1;try{var t=JSON.parse(decodeURIComponent(window.name||"")),e=t.is_vabtesting,s=t.source_url,i=t.link_match_type;return!(e!==!0||!U.checkUrlIsMatch(s,i))||(U.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(r){return!1}}function c(t){if(t)try{U.isString(t)&&(t=U.getDomBySelector(t)),t.parentNode&&t.parentNode.removeChild(t)}catch(e){U.logger.log("delete dom error:",e)}}function l(t){if(!t.parentNode)return-1;for(var e=0,s=t.tagName,i=t.parentNode.children,r=0;r "):h(t.parentNode,e)):(e.unshift("body"),e.join(" > "))}function d(t){var e=t.getBoundingClientRect(),s=e.top+(document.body.scrollTop||document.documentElement.scrollTop),i=e.left+(document.body.scrollLeft||document.documentElement.scrollLeft),r=U.ry(t).getStyle("z-index")||0;return{width:e.width,height:e.height,top:s,left:i,zIndex:r}}function p(t,e){var s={};return U.each(e||[],function(e){var i=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});s[e]=U.ry(t).getStyle(i)}),s}function _(t){var e=t.childNodes,s="",i=!1;return U.each(e,function(t){if(i===!1&&3===t.nodeType){var e=t.textContent||t.innerText||t.nodeValue||"";e&&(s=U.trim(e),i=!0)}}),s}function g(t){var e=t.match(/[\d.]+/g);if(e.length>=3){var s,i,r;return s=e[0],i=e[1],r=e[2],"rgb("+s+","+i+","+r+")"}return""}function f(t,e,s){var i=U.getUA(),r=i.ie&&i.ie<9,n="";U.each(e,function(t,e){r&&t.indexOf("rgba")>-1&&(t=g(t));var s=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});n+=s+": "+t+" !important;"}),""!==n&&(s=U.encodeSelector(s),n="[sensors_ab_ele_style_id="+s+"]{"+n+"}",A({attr_value:s,text:n,attr_key:"sensors_ab_ele_style_id"}),t.setAttribute("sensors_ab_ele_style_id",s))}function m(t,e){var s=t.tagName,i=_(t);i!==e&&(t.textContent?t.textContent=e:t.innerText?t.innerText=e:t.innerHTML=e,"input"!==s&&"INPUT"!==s||(t.value=e||""))}function v(t,e){var s=t.originProps||{},i=e.originProps||{},r=s.attributes||{},n=i.attributes||{},a=!0;return s.text&&s.text!==i.text&&(a=!1),r&&U.each(["src","href","target"],function(t){r[t]&&r[t]!==n[t]&&(a=!1)}),a}function b(t,e,s){t.setAttribute(e,s)}function y(t,e){var s=e.originProps,i={attributes:{}},r=s.attributes;return U.each(r.style||{},function(e,s){i.attributes.style[s]=U.ry(t).getStyle(s)}),Object.hasOwnProperty.call(s,"text")&&(i.attributes.text=_(t)),U.each(["src","href"],function(e){Object.hasOwnProperty.call(r,e)&&(i.attributes[e]=t[e])}),Object.hasOwnProperty.call(r,"target")&&(i.attributes.target=t.getAttribute("target")),i}function S(t,e,s){s||(s=y(t,e));var i=v(e,s);if(i){var r=e.props;U.isObject(r)&&T(t,r,e)}return i}function T(t,e,s){if(Object.hasOwnProperty.call(e,"attributes")){var i=e.attributes;Object.hasOwnProperty.call(i,"style")&&f(t,i.style,s.selector),U.each(["href","target","src"],function(e){i[e]&&t.getAttribute(e)!==i[e]&&b(t,e,i[e])})}Object.hasOwnProperty.call(e,"text")&&"innerHtml"!==s.type&&m(t,e.text)}function A(t){try{var e=document.createElement("style");e.innerHTML=t.text,e.setAttribute(t.attr_key,t.attr_value),document.getElementsByTagName("head")[0].append(e)}catch(s){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(t,s.stack||s.message)}}function B(t){try{var e=document.createElement("script");e.setAttribute(t.attr_key,t.attr_value),e.innerHTML="try{"+t.text+"}catch(e){ window.sensorsABTestModifyListener && window.sensorsABTestModifyListener("+JSON.stringify(t)+", e.stack || e.message) }",document.body.append(e)}catch(s){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(t,s.stack||s.message)}}function k(t,e){U.loadScript(U.extend({success:function(){},error:function(){},type:"js",url:t},e))}function x(t){var e={childList:!0,subtree:!0},s=window.MutationObserver,i=new s(t);return i.observe(document.body,e),i}function w(t){t&&t.disconnect()}function D(t,e,s){var i=t.tagName.toLowerCase(),r=p(t,e),n={selector:h(t),originProps:{attributes:{style:r},text:_(t),hasChildren:t.children.length>0},type:"text",tagName:i};"a"===i&&(n.originProps.attributes.href=t.href,t.getAttribute("target")&&(n.originProps.attributes.target=t.getAttribute("target")),n.type="link"),"img"===i&&(n.originProps.attributes.src=t.src,n.type="img"),t.hasAttribute("sensors_ab_widget")&&(n.type="innerHtml");var a=t.getAttribute("style");if(s)for(var o=0;o-1&&t.parentElement.removeChild(t)}),i&&s&&i.removeAttribute(s)}function L(t,e){var s=U.getDomBySelector(t.base),i=t.props.text,r=t.props.sensors_ab_widget,n=t.operation;if(!s)throw"VABTest: No base element";if(!s.parentNode)throw"base element parentNode not found";var a=document.createElement("font");if("text"===r&&(a.innerText=i),"html"===r&&(a.innerHTML=i),P(a,t,e),"BEFORE_INSERTION"===n)s.parentNode.insertBefore(a,s);else{if("AFTER_INSERTION"!==n)throw"operation not supported";s.nextSibling?s.parentNode.insertBefore(a,s.nextSibling):s.parentNode.appendChild(a)}var o=h(a);return o}function j(t,e){var s=t.selector,i=t.props.text,r="text"===t.props.sensors_ab_widget;const n=document.querySelector(s);if(!n)throw"element not found:"+s;r?n.innerText=i:n.innerHTML=i,P(n,t,e)}function N(t,e,s){function i(){return r=L(t,e)}var r=null,n=null,a=U.getDomBySelector(t.selector)||document.querySelector&&document.querySelector(t.selector);if(a&&a.hasAttribute("sensors_ab_widget")){j(t,e);var o=d(document.querySelector(t.selector));s&&s.setSelectElePostion(o)}else s?n=s.getModifiedEleSelectorsWhen(i):i();return{selector:t.selector,addedEleSelector:r,updatedSelectors:n}}function P(t,e,s){if(s&&s.length)for(var i=0;i0||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",e.param_name),r.verify_success=!1);break;case"value_type":U.isString(e.value_type)&&U.indexOf(i.value_type_list,e.value_type)!==-1||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",e.value_type),r.verify_success=!1);break;case"default_value":"undefined"==typeof e.default_value?(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),r.verify_success=!1):i.valueType(e.default_value,e.value_type)||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",e.default_value,e.value_type),r.verify_success=!1);break;case"callback":U.isFunction(e.callback)||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),r.verify_success=!1);break;default:r.verify_success=!1}else if("not_essential"===s)switch(n){case"timeout_milliseconds":e.timeout_milliseconds=e.timeout_milliseconds||i.SensorsABTest.para.timeout_milliseconds||i.SensorsABTest.default_para.timeout_milliseconds,(!U.isNumber(e.timeout_milliseconds)||U.isNumber(e.timeout_milliseconds)&&e.timeout_milliseconds<=0)&&(i.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",e.timeout_milliseconds),e.timeout_milliseconds=i.SensorsABTest.para.timeout_milliseconds),e.timeout_milliseconds<200&&(e.timeout_milliseconds=200);break;case"properties":e.properties=U.isObject(e.properties)?e.properties:{}}}),r.para=e,r},resolveCustomProperties:function(t){var e=this,s={verify_success:!0,para:null},i=t.custom_properties;if(!U.isObject(i)||U.isEmptyObject(i))return delete t.custom_properties,s.para=t,s;if(U.each(i,function(t,i){if((!U.isString(i)||!e.regName.test(i)||i.length>100)&&(e.SensorsABTest.log(" property name [ "+i+" ] is not invalid "),s.verify_success=!1),(U.isString(t)||U.isNumber(t)||U.isBoolean(t)||U.isArray(t)||U.isDate(t))&&!(U.isString(t)&&t.length>500)||(e.SensorsABTest.log("property [ "+i+" ] of value [ "+JSON.stringify(t)+" ] is not invalid"),s.verify_success=!1),U.isArray(t)){var r=!0;U.each(t,function(t){r!==!1&&(U.isString(t)||(r=!1))}),r||(e.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+i+" ] of value "+JSON.stringify(t)+" is not invalid"),s.verify_success=!1)}}),s.verify_success===!0){var r={};U.each(i,function(t,e){U.isDate(t)?r[e]=U.formatDate(t):U.isString(t)?r[e]=t:r[e]=JSON.stringify(t)}),t.custom_properties=r}return s.para=t,s}},U.VerifyStore=t,U.listenPageState=function(t){var e={visibleHandle:U.isFunction(t.visible)?t.visible:function(){},hiddenHandler:U.isFunction(t.hidden)?t.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 t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}};e.init()},U.listenPageState=function(t){var e={visibleHandle:U.isFunction(t.visible)?t.visible:function(){},hiddenHandler:U.isFunction(t.hidden)?t.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 t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}};e.init()},U.getStorageData=function(t,e){var s=U.localStorage.get(t);U.isString(s)&&(s=e.kit.userDecryptIfNeeded(s));try{s=JSON.parse(s)}catch(i){U.log(i)}return s},U.setStorageData=function(t,e,s){t=JSON.stringify(t),s&&(t=U.userEncrypt(t)),U.localStorage.set(e,t)},e.prototype={createMaskStyle:function(){var t="["+this.attr_name+"],["+this.attr_name+"] body{opacity:0 !important;-khtml-opacity:0 !important;-moz-opacity:0;filter:alpha(opacity=0);}",e=document.createElement("style");e.type="text/css";try{e.appendChild(document.createTextNode(t))}catch(s){e.styleSheet.cssText=t}try{this.style_element=e,document.getElementsByTagName("head")[0].appendChild(e)}catch(s){U.log("error when create calls")}},show:function(t){try{var e=this;if(this.is_abort)return!1;var s=null;if(s=document.getElementsByTagName("html")[0],!U.isElement(s))return;s.setAttribute(this.attr_name,"1"),this.is_added=!0,U.isNumber(t)&&(this.remove_timer=setTimeout(function(){e.is_timeout=!0,e.remove()},t))}catch(i){U.log("error when show calls")}},remove:function(){try{if(this.is_abort||(this.is_abort=!0),this.is_added){this.is_added=!1;var t=null;if(t=document.getElementsByTagName("html")[0],!U.isElement(t))return;t.removeAttribute(this.attr_name),this.style_element&&(document.getElementsByTagName("head")[0].removeChild(this.style_element),this.style_element=null)}this.remove_timer&&(clearTimeout(this.remove_timer),this.remove_timer=null)}catch(e){U.log("error when remove calls")}}},U.Mask=e,i.prototype={init:function(t){return!!this.setPara(t)&&(this.bridgeState="ab_no_host_bridge",/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?this.SensorsABTest.state.platform="H5":this.SensorsABTest.state.platform="Web",this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f\uff0c\u8bd5\u9a8c URL\uff1a",t.url),this.SensorsABTest.checkSADebug(),void this.SensorsABTest.store.init(this.getResultFromServer,this))},setPara:function(t){if(!U.isString(t.url)||"http"!==t.url.slice(0,4))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1;if("https"===location.protocol.slice(0,5)&&"http:"===t.url.slice(0,5))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0chttps \u9875\u9762\u5fc5\u987b\u4f7f\u7528 https \u7684 URL"),!1;var e=U.getQueryParam(t.url,"project-key");if(!e)return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff08\u5fc5\u987b\u5305\u542b project-key\uff09\uff01"),!1;t.project_key=e;var s=this.SensorsABTest.verifyStore.para("A/B Testing SDK \u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=U.extend({},this.SensorsABTest.default_para,s.para),U.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),U.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},asyncFetch:function(t){var e=this;this.SensorsABTest.normalStore.getCodeExpResultFromServer({para:t,suc:function(s){if(U.isObject(s)&&"SUCCESS"===s.status){var i=e.SensorsABTest.getExpResult(t);t.callback(i)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})},creatRequestData:function(t){var e="";U.isEmptyObject(this.SensorsABTest.sd.store._state)||(e=this.SensorsABTest.sd.store._state._first_id||this.SensorsABTest.sd.store._state.first_id||this.SensorsABTest.sd.store._state._distinct_id||this.SensorsABTest.sd.store._state.distinct_id);var s={anonymous_id:e,platform:this.SensorsABTest.state.platform,abtest_lib_version:this.SensorsABTest.lib_version,properties:{$is_first_day:this.SensorsABTest.sd._.cookie.getNewUser()}};return U.isObject(t.properties)&&(s.properties=U.extend({},s.properties,t.properties)),U.isObject(t.custom_properties)&&(s.custom_properties=U.extend({},t.custom_properties),s.param_name=t.param_name),this.SensorsABTest.sd.store._state.first_id&&(s.login_id=this.SensorsABTest.sd.store.getDistinctId()),s},getCodeExpResultFromServer:function(t){this.getResultFromServer(t,!0)},getResultFromServer:function(t,e){function s(){var t=i.SensorsABTest.sd.store.getDistinctId();i.SensorsABTest.sd._.ajax({url:i.SensorsABTest.para.url,type:"POST",data:JSON.stringify(o),credentials:!1,contentType:"application/json",timeout:r.timeout_milliseconds||i.SensorsABTest.para.timeout_milliseconds,cors:!0,success:function(s){e?i.SensorsABTest.dealCodeExpResponseData(s,t):i.SensorsABTest.dealResponseData(s,t),n&&n(s),i.SensorsABTest.fetchData.setNextFetch()},error:function(t){i.SensorsABTest.log("\u670d\u52a1\u7aef\u8bf7\u6c42\u53d1\u9001\u5931\u8d25",t),a&&a(),i.SensorsABTest.fetchData.setNextFetch()}})}var i=this;t=U.isObject(t)?t:{};var r=t.para||{},n=t.suc,a=t.err,o=this.creatRequestData(r);this.SensorsABTest.log("\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),s()}},i.prototype.methods={asyncFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!s.verify_success)return void t.callback(t.default_value);t=s.para,this.SensorsABTest.normalStore.asyncFetch(t)}},fastFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(U.isObject(s)){var i=this.SensorsABTest.getExpResult(t,s);return void t.callback(i)}var r=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!r.verify_success)return void t.callback(t.default_value);t=r.para,this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.normalStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!U.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}},r.prototype={init:function(t){var e=this;return this.SensorsABTest.state.storage.name="sawebjssdkabtest_bridge",!!this.setPara(t)&&(this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f"),this.abBridge=new this.SensorsABTest.sd.JSBridge({type:"abtest",app_call_js:function(t){try{t=U.base64Decode(t)}catch(s){e.SensorsABTest.log("App\u6570\u636ebase64\u89e3\u7801\u5f02\u5e38",t)}try{t=JSON.parse(t),t.message_id&&this["double"](t)}catch(s){e.SensorsABTest.log("App\u6570\u636e\u89e3\u6790\u5f02\u5e38",t)}}}),U.isObject(window.SensorsData_iOS_JS_Bridge)&&window.SensorsData_iOS_JS_Bridge.sensorsdata_abtest_module&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":U.isObject(window.SensorsData_APP_New_H5_Bridge)&&U.isFunction(window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module)&&window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module()&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":this.SensorsABTest.bridgeState="ab_no_abtest_bridge",void this.SensorsABTest.store.init(this.getResultFromApp,this))},setPara:function(t){var e=this.SensorsABTest.verifyStore.para("\u6253\u901a\u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=U.extend({},this.SensorsABTest.default_para,e.para),U.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),U.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},getResultFromApp:function(t){function e(){"ab_bridge_ok"===s.SensorsABTest.bridgeState?s.abBridge.requestToApp({data:{properties:i.properties,timeout:a,request_body:o},callback:function(t){U.isObject(t)&&U.isObject(t.data)?(s.SensorsABTest.log("\u6210\u529f\u83b7\u53d6\u5230 App \u7aef\u8fd4\u56de\u7684\u8bd5\u9a8c\u6570\u636e","data:",t),s.SensorsABTest.dealResponseData(t.data),r&&r(t)):(s.SensorsABTest.log("App \u7aef\u8bf7\u6c42\u5931\u8d25"),n&&n()),s.SensorsABTest.fetchData.setNextFetch()},timeout:{time:a,callback:function(){s.SensorsABTest.log("\u83b7\u53d6App\u7aef\u6570\u636e\u5931\u8d25"),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}}}):n&&(s.SensorsABTest.log("A/B Testing \u6253\u901a\u5931\u8d25\uff0c",s.SensorsABTest.bridgeState),n())}var s=this;t=U.isObject(t)?t:{};var i=t.para||{},r=t.suc,n=t.err,a=i.timeout_milliseconds||this.SensorsABTest.para.timeout_milliseconds,o={origin_platform:"H5"};U.isObject(i.custom_properties)&&(o=U.extend(o,{custom_properties:i.custom_properties,param_name:i.param_name})),this.SensorsABTest.log("\u5411App\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e()},asyncFetch:function(t){var e=this;this.SensorsABTest.bridgeStore.getResultFromApp({para:t,suc:function(s){if(U.isObject(s.properties)&&(t.properties=U.extend(s.properties,t.properties)),"SUCCESS"===s.data.status){var i=e.SensorsABTest.getExpResult(t);t.callback(i)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})}},r.prototype.methods={asyncFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);return s.verify_success?(t=s.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState?void t.callback(t.default_value):void this.SensorsABTest.bridgeStore.asyncFetch(t)):void t.callback(t.default_value)}},fastFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(U.isObject(s)){var i=this.SensorsABTest.getExpResult(t,s);return void t.callback(i)}var r=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!r.verify_success)return void t.callback(t.default_value);if(t=r.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState)return void t.callback(t.default_value);this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.bridgeStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!U.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}},n.prototype.init=function(t){if(this.pause_sdk_before_trigger=t.pause_sdk_before_trigger||!1,t.pause_sdk_before_trigger===!0){var e=this;this.sd.registerInterceptor("sendDataStage",{send:{priority:0,entry:function(t,s){e.sendInterceptor(t,s)}}})}},n.prototype.start=function(){this.pause_sdk_before_trigger!==!1&&(this.events=[],this.isStart=!0)},n.prototype.stop=function(){if(this.pause_sdk_before_trigger!==!1){this.isStart=!1;var t=this;U.each(this.events,function(e){e._flush_time=(new Date).getTime(),t.sd.kit.sendData(e)}),this.events=[]}},n.prototype.sendInterceptor=function(t,e){var s=t.data,i=s.event,r=s.type;return this.isStart===!0&&"track"===r&&["$ABTestTrigger","WebABTestTrigger"].indexOf(i)<0&&(this.events.push(s),e.cancellationToken.stop()),t},a.prototype.init=function(t){return this.initPara(t),this.para?(this.eventInterceptor=new n(this.SensorsABTest),this.eventInterceptor.init(this.para),this.eventInterceptor.start(),U.getQueryParam(location.href,"saSDKMultilink")?(this.is_filtered_out=!0,!1):(this.start_time=(new Date).getTime(),this.para.use_mask&&this.initMask(),void this.addSinglePageListener())):(this.SensorsABTest.log("multilink is closed"),!1)},a.prototype.addSinglePageListener=function(){var t=this;this.SensorsABTest.sd.ee.spa.prepend("switch",function(e){return e!==location.href&&(t.is_filtered_out=!1,t.isFirst=!0,t.mask_instance&&t.mask_instance.remove(),U.getQueryParam(location.href,"saSDKMultilink")?(t.is_filtered_out=!0,!1):(t.eventInterceptor&&t.eventInterceptor.start(),t.start_time=(new Date).getTime(),t.para.use_mask&&t.initMask(),void t.resolve()))})},a.prototype.initMask=function(){this.mask_instance=new U.Mask("link_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.para.timeout)},a.prototype.initPara=function(t){if(U.isFunction(t))try{t=t()}catch(e){return this.SensorsABTest.log("link para error!"),void(this.para=!1)}t===!1?this.para=!1:U.isObject(t)&&(this.para.timeout=U.isNumber(t.timeout)&&t.timeout>=0?t.timeout:500,this.para.use_mask=U.isBoolean(t.use_mask)?t.use_mask:this.para.use_mask,this.para.control_link_search=U.isString(t.control_link_search)?t.control_link_search:"default",this.para.experiment_link_search=U.isString(t.experiment_link_search)?t.experiment_link_search:"default",this.para.pass_params=!U.isBoolean(t.pass_params)||t.pass_params,this.para.onRedirect=U.isFunction(t.onRedirect)?t.onRedirect:null,this.para.pause_sdk_before_trigger=!!U.isBoolean(t.pause_sdk_before_trigger)&&t.pause_sdk_before_trigger)},a.prototype.resolve=function(){var t=this.SensorsABTest.results,e=this;if(!this.para||!U.isArray(t)||this.is_filtered_out||!this.isFirst||0===this.para.timeout)return this.eventInterceptor&&this.eventInterceptor.stop(),!1;if((new Date).getTime()-this.start_time>this.para.timeout)return this.SensorsABTest.log("The multilink was stopped because the request timeout"),this.eventInterceptor&&this.eventInterceptor.stop(),!1;this.isFirst=!1;var s=!1;U.each(t,function(t){return!(!U.isObject(t)||s||"LINK"!==t.experiment_type)&&void(e.isTriggerLinkExp(t)&&(s=!0,e.SensorsABTest.trackOutTestTrigger("LINK"),e.redirectUrl(t)))}),!s&&this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),!s&&this.eventInterceptor&&this.eventInterceptor.stop()},a.prototype.stopTrigger=function(){this.isFirst!==!1&&(this.isFirst=!1,this.SensorsABTest.log("The multilink was stopped because the request failed"),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),this.eventInterceptor&&this.eventInterceptor.stop())},a.prototype.isTriggerLinkExp=function(t){return U.isString(t.control_link)&&U.isString(t.link_match_type)?"REGEXP"===t.link_match_type?!!U.checkUrlIsRegexp(t.control_link,t.regexp_flags)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):!!U.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},a.prototype.redirectUrl=function(t){function e(t){return U.secCheck.isHttpUrl(t)?U.secCheck.removeScriptProtocol(t):(this.SensorsABTest.log("\u975e\u6cd5URL"),!1)}if(!t.experiment_link||!U.isString(t.experiment_link))return this.SensorsABTest.log("\u9875\u9762\u8df3\u8f6c\u5931\u8d25\uff0cexperiment_link\u5b57\u6bb5\u5f02\u5e38",t.abtest_experiment_id),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),void(this.eventInterceptor&&this.eventInterceptor.stop()); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():e()}(this,function(){"use strict";function t(t){this.SensorsABTest=t}function e(t){this.attr_name="sa-abtest-"+t,this.remove_timer=null,this.is_added=!1,this.is_abort=!1,this.is_timeout=!1,this.style_element=null,this.createMaskStyle()}function s(t){t._.extend(U,t._)}function i(t){this.SensorsABTest=t,this.para=t.para}function r(t){this.SensorsABTest=t,this.para=t.para}function n(t){this.sd=t.sd,this.abTest=t,this.events=[],this.isStart=!1,this.pause_sdk_before_trigger=!1}function a(t){this.SensorsABTest=t,this.isFirst=!0,this.start_time=null,this.mask_instance=null,this.is_filtered_out=!1,this.para={timeout:500,use_mask:!0,pass_params:!0,control_link_search:"default",experiment_link_search:"default",pause_sdk_before_trigger:!1}}function o(){if(!window.name)return!1;try{var t=JSON.parse(decodeURIComponent(window.name||"")),e=t.is_vabtesting,s=t.source_url,i=t.link_match_type;return!(e!==!0||!U.checkUrlIsMatch(s,i))||(U.log("A/B Testing SDK \u9875\u9762\u5730\u5740\uff0c\u4e0e\u5f53\u524d\u5b9e\u9a8c URL \u4e0d\u5339\u914d\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1)}catch(r){return!1}}function c(t){if(t)try{U.isString(t)&&(t=U.getDomBySelector(t)),t.parentNode&&t.parentNode.removeChild(t)}catch(e){U.logger.log("delete dom error:",e)}}function l(t){if(!t.parentNode)return-1;for(var e=0,s=t.tagName,i=t.parentNode.children,r=0;r "):h(t.parentNode,e)):(e.unshift("body"),e.join(" > "))}function d(t){var e=t.getBoundingClientRect(),s=e.top+(document.body.scrollTop||document.documentElement.scrollTop),i=e.left+(document.body.scrollLeft||document.documentElement.scrollLeft),r=U.ry(t).getStyle("z-index")||0;return{width:e.width,height:e.height,top:s,left:i,zIndex:r}}function p(t,e){var s={};return U.each(e||[],function(e){var i=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});s[e]=U.ry(t).getStyle(i)}),s}function _(t){var e=t.childNodes,s="",i=!1;return U.each(e,function(t){if(i===!1&&3===t.nodeType){var e=t.textContent||t.innerText||t.nodeValue||"";e&&(s=U.trim(e),i=!0)}}),s}function g(t){var e=t.match(/[\d.]+/g);if(e.length>=3){var s,i,r;return s=e[0],i=e[1],r=e[2],"rgb("+s+","+i+","+r+")"}return""}function f(t,e,s){var i=U.getUA(),r=i.ie&&i.ie<9,n="";U.each(e,function(t,e){r&&t.indexOf("rgba")>-1&&(t=g(t));var s=e.replace(/[A-Z]+/g,function(t){return"-"+t.toLowerCase()});n+=s+": "+t+" !important;"}),""!==n&&(s=U.encodeSelector(s),n="[sensors_ab_ele_style_id="+s+"]{"+n+"}",A({attr_value:s,text:n,attr_key:"sensors_ab_ele_style_id"}),t.setAttribute("sensors_ab_ele_style_id",s))}function m(t,e){var s=t.tagName,i=_(t);i!==e&&(t.textContent?t.textContent=e:t.innerText?t.innerText=e:t.innerHTML=e,"input"!==s&&"INPUT"!==s||(t.value=e||""))}function v(t,e){var s=t.originProps||{},i=e.originProps||{},r=s.attributes||{},n=i.attributes||{},a=!0;return s.text&&s.text!==i.text&&(a=!1),r&&U.each(["src","href","target"],function(t){r[t]&&r[t]!==n[t]&&(a=!1)}),a}function b(t,e,s){t.setAttribute(e,s)}function y(t,e){var s=e.originProps,i={attributes:{}},r=s.attributes;return U.each(r.style||{},function(e,s){i.attributes.style[s]=U.ry(t).getStyle(s)}),Object.hasOwnProperty.call(s,"text")&&(i.attributes.text=_(t)),U.each(["src","href"],function(e){Object.hasOwnProperty.call(r,e)&&(i.attributes[e]=t[e])}),Object.hasOwnProperty.call(r,"target")&&(i.attributes.target=t.getAttribute("target")),i}function S(t,e,s){s||(s=y(t,e));var i=v(e,s);if(i){var r=e.props;U.isObject(r)&&T(t,r,e)}return i}function T(t,e,s){if(Object.hasOwnProperty.call(e,"attributes")){var i=e.attributes;Object.hasOwnProperty.call(i,"style")&&f(t,i.style,s.selector),U.each(["href","target","src"],function(e){i[e]&&t.getAttribute(e)!==i[e]&&b(t,e,i[e])})}Object.hasOwnProperty.call(e,"text")&&"innerHtml"!==s.type&&m(t,e.text)}function A(t){try{var e=document.createElement("style");e.innerHTML=t.text,e.setAttribute(t.attr_key,t.attr_value),document.getElementsByTagName("head")[0].append(e)}catch(s){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(t,s.stack||s.message)}}function B(t){try{var e=document.createElement("script");e.setAttribute(t.attr_key,t.attr_value),e.innerHTML="try{"+t.text+"}catch(e){ window.sensorsABTestModifyListener && window.sensorsABTestModifyListener("+JSON.stringify(t)+", e.stack || e.message) }",document.body.append(e)}catch(s){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(t,s.stack||s.message)}}function k(t,e){U.loadScript(U.extend({success:function(){},error:function(){},type:"js",url:t},e))}function x(t){var e={childList:!0,subtree:!0},s=window.MutationObserver,i=new s(t);return i.observe(document.body,e),i}function w(t){t&&t.disconnect()}function D(t,e,s){var i=t.tagName.toLowerCase(),r=p(t,e),n={selector:h(t),originProps:{attributes:{style:r},text:_(t),hasChildren:t.children.length>0},type:"text",tagName:i};"a"===i&&(n.originProps.attributes.href=t.href,t.getAttribute("target")&&(n.originProps.attributes.target=t.getAttribute("target")),n.type="link"),"img"===i&&(n.originProps.attributes.src=t.src,n.type="img"),t.hasAttribute("sensors_ab_widget")&&(n.type="innerHtml");var a=t.getAttribute("style");if(s)for(var o=0;o-1&&t.parentElement.removeChild(t)}),i&&s&&i.removeAttribute(s)}function L(t,e){var s=U.getDomBySelector(t.base),i=t.props.text,r=t.props.sensors_ab_widget,n=t.operation;if(!s)throw"VABTest: No base element";if(!s.parentNode)throw"base element parentNode not found";var a=document.createElement("font");if("text"===r&&(a.innerText=i),"html"===r&&(a.innerHTML=i),P(a,t,e),"BEFORE_INSERTION"===n)s.parentNode.insertBefore(a,s);else{if("AFTER_INSERTION"!==n)throw"operation not supported";s.nextSibling?s.parentNode.insertBefore(a,s.nextSibling):s.parentNode.appendChild(a)}var o=h(a);return o}function j(t,e){var s=t.selector,i=t.props.text,r="text"===t.props.sensors_ab_widget;const n=document.querySelector(s);if(!n)throw"element not found:"+s;r?n.innerText=i:n.innerHTML=i,P(n,t,e)}function N(t,e,s){function i(){return r=L(t,e)}var r=null,n=null,a=U.getDomBySelector(t.selector)||document.querySelector&&document.querySelector(t.selector);if(a&&a.hasAttribute("sensors_ab_widget")){j(t,e);var o=d(document.querySelector(t.selector));s&&s.setSelectElePostion(o)}else s?n=s.getModifiedEleSelectorsWhen(i):i();return{selector:t.selector,addedEleSelector:r,updatedSelectors:n}}function P(t,e,s){if(s&&s.length)for(var i=0;i0||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",e.param_name),r.verify_success=!1);break;case"value_type":U.isString(e.value_type)&&U.indexOf(i.value_type_list,e.value_type)!==-1||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",e.value_type),r.verify_success=!1);break;case"default_value":"undefined"==typeof e.default_value?(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),r.verify_success=!1):i.valueType(e.default_value,e.value_type)||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",e.default_value,e.value_type),r.verify_success=!1);break;case"callback":U.isFunction(e.callback)||(i.SensorsABTest.log(t+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),r.verify_success=!1);break;default:r.verify_success=!1}else if("not_essential"===s)switch(n){case"timeout_milliseconds":e.timeout_milliseconds=e.timeout_milliseconds||i.SensorsABTest.para.timeout_milliseconds||i.SensorsABTest.default_para.timeout_milliseconds,(!U.isNumber(e.timeout_milliseconds)||U.isNumber(e.timeout_milliseconds)&&e.timeout_milliseconds<=0)&&(i.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",e.timeout_milliseconds),e.timeout_milliseconds=i.SensorsABTest.para.timeout_milliseconds),e.timeout_milliseconds<200&&(e.timeout_milliseconds=200);break;case"properties":e.properties=U.isObject(e.properties)?e.properties:{}}}),r.para=e,r},resolveCustomProperties:function(t){var e=this,s={verify_success:!0,para:null},i=t.custom_properties;if(!U.isObject(i)||U.isEmptyObject(i))return delete t.custom_properties,s.para=t,s;if(U.each(i,function(t,i){if((!U.isString(i)||!e.regName.test(i)||i.length>100)&&(e.SensorsABTest.log(" property name [ "+i+" ] is not invalid "),s.verify_success=!1),(U.isString(t)||U.isNumber(t)||U.isBoolean(t)||U.isArray(t)||U.isDate(t))&&!(U.isString(t)&&t.length>500)||(e.SensorsABTest.log("property [ "+i+" ] of value [ "+JSON.stringify(t)+" ] is not invalid"),s.verify_success=!1),U.isArray(t)){var r=!0;U.each(t,function(t){r!==!1&&(U.isString(t)||(r=!1))}),r||(e.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+i+" ] of value "+JSON.stringify(t)+" is not invalid"),s.verify_success=!1)}}),s.verify_success===!0){var r={};U.each(i,function(t,e){U.isDate(t)?r[e]=U.formatDate(t):U.isString(t)?r[e]=t:r[e]=JSON.stringify(t)}),t.custom_properties=r}return s.para=t,s}},U.VerifyStore=t,U.listenPageState=function(t){var e={visibleHandle:U.isFunction(t.visible)?t.visible:function(){},hiddenHandler:U.isFunction(t.hidden)?t.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 t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}};e.init()},U.listenPageState=function(t){var e={visibleHandle:U.isFunction(t.visible)?t.visible:function(){},hiddenHandler:U.isFunction(t.hidden)?t.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 t=this;document.addEventListener(t.visibilityChange,function(){document[t.hidden]?t.hiddenHandler():t.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}};e.init()},U.getStorageData=function(t,e){var s=U.localStorage.get(t);U.isString(s)&&(s=e.kit.userDecryptIfNeeded(s));try{s=JSON.parse(s)}catch(i){U.log(i)}return s},U.setStorageData=function(t,e,s){t=JSON.stringify(t),s&&(t=U.userEncrypt(t)),U.localStorage.set(e,t)},e.prototype={createMaskStyle:function(){var t="["+this.attr_name+"],["+this.attr_name+"] body{opacity:0 !important;-khtml-opacity:0 !important;-moz-opacity:0;filter:alpha(opacity=0);}",e=document.createElement("style");e.type="text/css";try{e.appendChild(document.createTextNode(t))}catch(s){e.styleSheet.cssText=t}try{this.style_element=e,document.getElementsByTagName("head")[0].appendChild(e)}catch(s){U.log("error when create calls")}},show:function(t){try{var e=this;if(this.is_abort)return!1;var s=null;if(s=document.getElementsByTagName("html")[0],!U.isElement(s))return;s.setAttribute(this.attr_name,"1"),this.is_added=!0,U.isNumber(t)&&(this.remove_timer=setTimeout(function(){e.is_timeout=!0,e.remove()},t))}catch(i){U.log("error when show calls")}},remove:function(){try{if(this.is_abort||(this.is_abort=!0),this.is_added){this.is_added=!1;var t=null;if(t=document.getElementsByTagName("html")[0],!U.isElement(t))return;t.removeAttribute(this.attr_name),this.style_element&&(document.getElementsByTagName("head")[0].removeChild(this.style_element),this.style_element=null)}this.remove_timer&&(clearTimeout(this.remove_timer),this.remove_timer=null)}catch(e){U.log("error when remove calls")}}},U.Mask=e,i.prototype={init:function(t){return!!this.setPara(t)&&(this.bridgeState="ab_no_host_bridge",/Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent)?this.SensorsABTest.state.platform="H5":this.SensorsABTest.state.platform="Web",this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f\uff0c\u8bd5\u9a8c URL\uff1a",t.url),this.SensorsABTest.checkSADebug(),void this.SensorsABTest.store.init(this.getResultFromServer,this))},setPara:function(t){if(!U.isString(t.url)||"http"!==t.url.slice(0,4))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff01"),!1;if("https"===location.protocol.slice(0,5)&&"http:"===t.url.slice(0,5))return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0chttps \u9875\u9762\u5fc5\u987b\u4f7f\u7528 https \u7684 URL"),!1;var e=U.getQueryParam(t.url,"project-key");if(!e)return this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528\u6b63\u786e\u7684 URL\uff08\u5fc5\u987b\u5305\u542b project-key\uff09\uff01"),!1;t.project_key=e;var s=this.SensorsABTest.verifyStore.para("A/B Testing SDK \u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=U.extend({},this.SensorsABTest.default_para,s.para),U.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),U.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},asyncFetch:function(t){var e=this;this.SensorsABTest.normalStore.getCodeExpResultFromServer({para:t,suc:function(s){if(U.isObject(s)&&"SUCCESS"===s.status){var i=e.SensorsABTest.getExpResult(t);t.callback(i)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})},creatRequestData:function(t){var e="";U.isEmptyObject(this.SensorsABTest.sd.store._state)||(e=this.SensorsABTest.sd.store._state._first_id||this.SensorsABTest.sd.store._state.first_id||this.SensorsABTest.sd.store._state._distinct_id||this.SensorsABTest.sd.store._state.distinct_id);var s={anonymous_id:e,platform:this.SensorsABTest.state.platform,abtest_lib_version:this.SensorsABTest.lib_version,properties:{$is_first_day:this.SensorsABTest.sd._.cookie.getNewUser()}};return U.isObject(t.properties)&&(s.properties=U.extend({},s.properties,t.properties)),U.isObject(t.custom_properties)&&(s.custom_properties=U.extend({},t.custom_properties),s.param_name=t.param_name),this.SensorsABTest.sd.store._state.first_id&&(s.login_id=this.SensorsABTest.sd.store.getDistinctId()),s},getCodeExpResultFromServer:function(t){this.getResultFromServer(t,!0)},getResultFromServer:function(t,e){function s(){var t=i.SensorsABTest.sd.store.getDistinctId();i.SensorsABTest.sd._.ajax({url:i.SensorsABTest.para.url,type:"POST",data:JSON.stringify(o),credentials:!1,contentType:"application/json",timeout:r.timeout_milliseconds||i.SensorsABTest.para.timeout_milliseconds,cors:!0,success:function(s){e?i.SensorsABTest.dealCodeExpResponseData(s,t):i.SensorsABTest.dealResponseData(s,t),n&&n(s),i.SensorsABTest.fetchData.setNextFetch()},error:function(t){i.SensorsABTest.log("\u670d\u52a1\u7aef\u8bf7\u6c42\u53d1\u9001\u5931\u8d25",t),a&&a(),i.SensorsABTest.fetchData.setNextFetch()}})}var i=this;t=U.isObject(t)?t:{};var r=t.para||{},n=t.suc,a=t.err,o=this.creatRequestData(r);this.SensorsABTest.log("\u5411\u670d\u52a1\u7aef\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),s()}},i.prototype.methods={asyncFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!s.verify_success)return void t.callback(t.default_value);t=s.para,this.SensorsABTest.normalStore.asyncFetch(t)}},fastFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(U.isObject(s)){var i=this.SensorsABTest.getExpResult(t,s);return void t.callback(i)}var r=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!r.verify_success)return void t.callback(t.default_value);t=r.para,this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.normalStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!U.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}},r.prototype={init:function(t){var e=this;return this.SensorsABTest.state.storage.name="sawebjssdkabtest_bridge",!!this.setPara(t)&&(this.SensorsABTest.log("A/B Testing SDK \u521d\u59cb\u5316\u6210\u529f"),this.abBridge=new this.SensorsABTest.sd.JSBridge({type:"abtest",app_call_js:function(t){try{t=U.base64Decode(t)}catch(s){e.SensorsABTest.log("App\u6570\u636ebase64\u89e3\u7801\u5f02\u5e38",t)}try{t=JSON.parse(t),t.message_id&&this["double"](t)}catch(s){e.SensorsABTest.log("App\u6570\u636e\u89e3\u6790\u5f02\u5e38",t)}}}),U.isObject(window.SensorsData_iOS_JS_Bridge)&&window.SensorsData_iOS_JS_Bridge.sensorsdata_abtest_module&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":U.isObject(window.SensorsData_APP_New_H5_Bridge)&&U.isFunction(window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module)&&window.SensorsData_APP_New_H5_Bridge.sensorsdata_abtest_module()&&this.abBridge.hasAppBridge()?this.SensorsABTest.bridgeState="ab_bridge_ok":this.SensorsABTest.bridgeState="ab_no_abtest_bridge",void this.SensorsABTest.store.init(this.getResultFromApp,this))},setPara:function(t){var e=this.SensorsABTest.verifyStore.para("\u6253\u901a\u521d\u59cb\u5316",t,{timeout_milliseconds:"not_essential"});return this.SensorsABTest.para=U.extend({},this.SensorsABTest.default_para,e.para),U.isBoolean(this.SensorsABTest.para.collect_bridge_status)||(this.SensorsABTest.para.collect_bridge_status=!0),U.isNumber(this.SensorsABTest.para.update_interval)||(this.SensorsABTest.para.update_interval=6e5),this.SensorsABTest.sd.para.encrypt_cookie===!0&&(this.SensorsABTest.para.encrypt_cookie=!0),this.SensorsABTest.sd.para.sdk_id&&(this.SensorsABTest.state.storage.name+="_"+this.SensorsABTest.sd.para.sdk_id),!0},getResultFromApp:function(t){function e(){"ab_bridge_ok"===s.SensorsABTest.bridgeState?s.abBridge.requestToApp({data:{properties:i.properties,timeout:a,request_body:o},callback:function(t){U.isObject(t)&&U.isObject(t.data)?(s.SensorsABTest.log("\u6210\u529f\u83b7\u53d6\u5230 App \u7aef\u8fd4\u56de\u7684\u8bd5\u9a8c\u6570\u636e","data:",t),s.SensorsABTest.dealResponseData(t.data),r&&r(t)):(s.SensorsABTest.log("App \u7aef\u8bf7\u6c42\u5931\u8d25"),n&&n()),s.SensorsABTest.fetchData.setNextFetch()},timeout:{time:a,callback:function(){s.SensorsABTest.log("\u83b7\u53d6App\u7aef\u6570\u636e\u5931\u8d25"),n&&n(),s.SensorsABTest.fetchData.setNextFetch()}}}):n&&(s.SensorsABTest.log("A/B Testing \u6253\u901a\u5931\u8d25\uff0c",s.SensorsABTest.bridgeState),n())}var s=this;t=U.isObject(t)?t:{};var i=t.para||{},r=t.suc,n=t.err,a=i.timeout_milliseconds||this.SensorsABTest.para.timeout_milliseconds,o={origin_platform:"H5"};U.isObject(i.custom_properties)&&(o=U.extend(o,{custom_properties:i.custom_properties,param_name:i.param_name})),this.SensorsABTest.log("\u5411App\u53d1\u8d77\u8bd5\u9a8c\u8bf7\u6c42"),e()},asyncFetch:function(t){var e=this;this.SensorsABTest.bridgeStore.getResultFromApp({para:t,suc:function(s){if(U.isObject(s.properties)&&(t.properties=U.extend(s.properties,t.properties)),"SUCCESS"===s.data.status){var i=e.SensorsABTest.getExpResult(t);t.callback(i)}else t.callback(t.default_value)},err:function(){t.callback(t.default_value)}})}},r.prototype.methods={asyncFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("asyncFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("asyncFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.verifyStore.resolveCustomProperties(t);return s.verify_success?(t=s.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState?void t.callback(t.default_value):void this.SensorsABTest.bridgeStore.asyncFetch(t)):void t.callback(t.default_value)}},fastFetchABTest:function(t){if(!U.isObject(t))return this.SensorsABTest.log("fastFetchABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=this.SensorsABTest.verifyStore.para("fastFetchABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential",callback:"essential",timeout_milliseconds:"not_essential",properties:"not_essential"});if(e.verify_success){t=e.para;var s=this.SensorsABTest.searchLocalExp(t.param_name);if(U.isObject(s)){var i=this.SensorsABTest.getExpResult(t,s);return void t.callback(i)}var r=this.SensorsABTest.verifyStore.resolveCustomProperties(t);if(!r.verify_success)return void t.callback(t.default_value);if(t=r.para,"ab_bridge_ok"!==this.SensorsABTest.bridgeState)return void t.callback(t.default_value);this.SensorsABTest.log("fastFetchABTest\u7f13\u5b58\u4e2d\u672a\u8bfb\u53d6\u5230\u6570\u636e\uff0c\u53d1\u8d77\u8bf7\u6c42"),this.SensorsABTest.bridgeStore.asyncFetch(t)}},fetchCacheABTest:function(t){if(!U.isObject(t))return void this.SensorsABTest.log("fetchCacheABTest\u8c03\u7528\u5931\u8d25\uff0c\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e");var e=this.SensorsABTest.verifyStore.para("fetchCacheABTest",t,{param_name:"essential",value_type:"essential",default_value:"essential"});if(e.verify_success)return this.SensorsABTest.getExpResult(e.para)}},n.prototype.init=function(t){if(this.pause_sdk_before_trigger=t.pause_sdk_before_trigger||!1,t.pause_sdk_before_trigger===!0){var e=this;this.sd.registerInterceptor("sendDataStage",{send:{priority:0,entry:function(t,s){e.sendInterceptor(t,s)}}})}},n.prototype.start=function(){this.pause_sdk_before_trigger!==!1&&(this.events=[],this.isStart=!0)},n.prototype.stop=function(){if(this.pause_sdk_before_trigger!==!1){this.isStart=!1;var t=this;U.each(this.events,function(e){e._flush_time=(new Date).getTime(),t.sd.kit.sendData(e)}),this.events=[]}},n.prototype.sendInterceptor=function(t,e){var s=t.data,i=s.event,r=s.type;return this.isStart===!0&&"track"===r&&["$ABTestTrigger","WebABTestTrigger"].indexOf(i)<0&&(this.events.push(s),e.cancellationToken.stop()),t},a.prototype.init=function(t){return this.initPara(t),this.para?(this.eventInterceptor=new n(this.SensorsABTest),this.eventInterceptor.init(this.para),this.eventInterceptor.start(),U.getQueryParam(location.href,"saSDKMultilink")?(this.is_filtered_out=!0,!1):(this.start_time=(new Date).getTime(),this.para.use_mask&&this.initMask(),void this.addSinglePageListener())):(this.SensorsABTest.log("multilink is closed"),!1)},a.prototype.addSinglePageListener=function(){var t=this;this.SensorsABTest.sd.ee.spa.prepend("switch",function(e){return e!==location.href&&(t.is_filtered_out=!1,t.isFirst=!0,t.mask_instance&&t.mask_instance.remove(),U.getQueryParam(location.href,"saSDKMultilink")?(t.is_filtered_out=!0,!1):(t.eventInterceptor&&t.eventInterceptor.start(),t.start_time=(new Date).getTime(),t.para.use_mask&&t.initMask(),void t.resolve()))})},a.prototype.initMask=function(){this.mask_instance=new U.Mask("link_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.para.timeout)},a.prototype.initPara=function(t){if(U.isFunction(t))try{t=t()}catch(e){return this.SensorsABTest.log("link para error!"),void(this.para=!1)}t===!1?this.para=!1:U.isObject(t)&&(this.para.timeout=U.isNumber(t.timeout)&&t.timeout>=0?t.timeout:500,this.para.use_mask=U.isBoolean(t.use_mask)?t.use_mask:this.para.use_mask,this.para.control_link_search=U.isString(t.control_link_search)?t.control_link_search:"default",this.para.experiment_link_search=U.isString(t.experiment_link_search)?t.experiment_link_search:"default",this.para.pass_params=!U.isBoolean(t.pass_params)||t.pass_params,this.para.onRedirect=U.isFunction(t.onRedirect)?t.onRedirect:null,this.para.pause_sdk_before_trigger=!!U.isBoolean(t.pause_sdk_before_trigger)&&t.pause_sdk_before_trigger)},a.prototype.resolve=function(){var t=this.SensorsABTest.results,e=this;if(!this.para||!U.isArray(t)||this.is_filtered_out||!this.isFirst||0===this.para.timeout)return this.eventInterceptor&&this.eventInterceptor.stop(),!1;if((new Date).getTime()-this.start_time>this.para.timeout)return this.SensorsABTest.log("The multilink was stopped because the request timeout"),this.eventInterceptor&&this.eventInterceptor.stop(),!1;this.isFirst=!1;var s=!1;U.each(t,function(t){return!(!U.isObject(t)||s||"LINK"!==t.experiment_type)&&void(e.isTriggerLinkExp(t)&&(s=!0,e.SensorsABTest.trackOutTestTrigger("LINK"),e.redirectUrl(t)))}),!s&&this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),!s&&this.eventInterceptor&&this.eventInterceptor.stop()},a.prototype.stopTrigger=function(){this.isFirst!==!1&&(this.isFirst=!1,this.SensorsABTest.log("The multilink was stopped because the request failed"),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),this.eventInterceptor&&this.eventInterceptor.stop())},a.prototype.isTriggerLinkExp=function(t){return U.isString(t.control_link)&&U.isString(t.link_match_type)?"REGEXP"===t.link_match_type?!!U.checkUrlIsRegexp(t.control_link,t.regexp_flags)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):!!U.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u591a\u94fe\u63a5\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},a.prototype.redirectUrl=function(t){function e(t){return U.secCheck.isHttpUrl(t)?U.secCheck.removeScriptProtocol(t):(this.SensorsABTest.log("\u975e\u6cd5URL"),!1)}if(!t.experiment_link||!U.isString(t.experiment_link))return this.SensorsABTest.log("\u9875\u9762\u8df3\u8f6c\u5931\u8d25\uff0cexperiment_link\u5b57\u6bb5\u5f02\u5e38",t.abtest_experiment_id),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),void(this.eventInterceptor&&this.eventInterceptor.stop()); if(t.is_control_group===!0&&("STRICT"===t.link_match_type||"REGEXP"===t.link_match_type))return this.SensorsABTest.triggerHandle(t),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove(),void(this.eventInterceptor&&this.eventInterceptor.stop());var s=location.href,i=t.experiment_link,r=/\$\d+/;if("REGEXP"===t.link_match_type&&r.test(i)){var n=t.regexp_flags?new RegExp(t.control_link,t.regexp_flags):new RegExp(t.control_link);i=s.replace(n,i)}var a,o;if(this.para.pass_params?(o=this.getMergedUrl(t.is_control_group,i,s),a=e(o)):(o=this.getMergedUrl(t.is_control_group,i),a=e(o)),a){var c=this.SensorsABTest.triggerHandle(t),l=c?80:0;this.para.onRedirect?(this.para.onRedirect(a),this.para.use_mask&&this.mask_instance&&this.mask_instance.remove()):this.redirect(a,l),this.mask_instance&&this.mask_instance.remove_timer&&clearTimeout(this.mask_instance.remove_timer)}},a.prototype.redirect=function(t,e){setTimeout(function(){location.href=t},e)},a.prototype.getMergedUrl=function(t,e,s){function i(t){var e=/([^?#]+)(\?[^#]*)?(#.*)?/,s=e.exec(t);if(s){var i=s[1]||"",r=s[2]||"",n=s[3]||"";return{host:i,search:r,hash:n}}}function r(t){var e={hash:"",search:""};if(!U.isString(t))return e;var s=t.indexOf("?");return s>-1?(e.search=t.slice(s),e.hash=t.slice(0,s)):e.hash=t,e}var n="",a="",o="",c={parse_url:null,search:""},l={parse_url:null,search:"",hash:""};return s&&(c.parse_url=i(s),!c.parse_url)?void this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",s):(l.parse_url=i(e),l.parse_url?(s&&("after_hash"===this.para.control_link_search?c.search=r(c.parse_url.hash).search:c.search=c.parse_url.search),t?"after_hash"===this.para.control_link_search?(l.search=r(l.parse_url.hash).search,l.hash=r(l.parse_url.hash).hash):l.search=l.parse_url.search:"after_hash"===this.para.experiment_link_search?(l.search=r(l.parse_url.hash).search,l.hash=r(l.parse_url.hash).hash):l.search=l.parse_url.search,a=s?this.getSearchStr(c.search,l.search):this.getSearchStr(l.search),t&&"after_hash"===this.para.control_link_search||!t&&"after_hash"===this.para.experiment_link_search?n=l.hash.length>0?l.parse_url.host+l.parse_url.search+l.hash+a:l.parse_url.search.length>0?l.parse_url.host+l.parse_url.search+"&"+a.substring(1):l.parse_url.host+a:(o="after_hash"===this.para.control_link_search?l.parse_url.hash:s?l.parse_url.hash||c.parse_url.hash:l.parse_url.hash,n=l.parse_url.host+a+o),n):void this.SensorsABTest.log("url \u89e3\u6790\u5931\u8d25",e))},a.prototype.getSearchStr=function(t,e){var s=U.getQueryParamsFromUrl(t),i=U.getQueryParamsFromUrl(e),r=U.extend(s,i),n="";if(U.isEmptyObject(r))return"?saSDKMultilink=true";var a=!0;for(var o in r)a?(n+="?",a=!1):n+="&",null!==r[o]?n=n+o+"="+r[o]:n+=o;return n+="&saSDKMultilink=true"},window.MutationObserver||(window.MutationObserver=function(t){function e(t){this._watched=[],this._listener=t}function s(t){!function s(){var i=t.takeRecords();i.length&&t._listener(i,t),t._timeout=setTimeout(s,e._period)}()}function i(e){var s={type:null,target:null,addedNodes:[],removedNodes:[],previousSibling:null,nextSibling:null,attributeName:null,attributeNamespace:null,oldValue:null};for(var i in e)g(s,i)&&e[i]!==t&&(s[i]=e[i]);return s}function r(t,e){var s=l(t,e);return function(r){var n,a=r.length;e.charData&&3===t.nodeType&&t.nodeValue!==s.charData&&r.push(new i({type:"characterData",target:t,oldValue:s.charData})),e.attr&&s.attr&&o(r,t,s.attr,e.afilter),(e.kids||e.descendents)&&(n=c(r,t,s,e)),(n||r.length!==a)&&(s=l(t,e))}}function n(t,e){return e.value}function a(t,e){return"style"!==e.name?e.value:t.style.cssText}function o(t,e,s,r){for(var n,a,o={},c=e.attributes,l=c.length;l--;)n=c[l],a=n.name,r&&!g(r,a)||(v(e,n)!==s[a]&&t.push(i({type:"attributes",target:e,attributeName:a,oldValue:s[a],attributeNamespace:n.namespaceURI})),o[a]=!0);for(a in s)o[a]||t.push(i({target:e,type:"attributes",attributeName:a,oldValue:s[a]}))}function c(e,s,r,n){function a(t,s,r,a,l){for(var u,h,d,p=t.length-1,_=-~((p-l)/2);d=t.pop();)u=r[d.i],h=a[d.j],n.kids&&_&&Math.abs(d.i-d.j)>=p&&(e.push(i({type:"childList",target:s,addedNodes:[u],removedNodes:[u],nextSibling:u.nextSibling,previousSibling:u.previousSibling})),_--),n.attr&&h.attr&&o(e,u,h.attr,n.afilter),n.charData&&3===u.nodeType&&u.nodeValue!==h.charData&&e.push(i({type:"characterData",target:u,oldValue:h.charData})),n.descendents&&c(u,h)}function c(s,r){for(var d,p,g,f,m,v,b,y=s.childNodes,S=r.kids,T=y.length,A=S?S.length:0,B=0,k=0,x=0;k=0?t.timeout:this.timeout;var s=U.isString(t.vabtest_url)?t.vabtest_url:"";s&&("https:"===location.protocol?"https:"===s.slice(0,6)?this.vabtest_url=s:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u534f\u8bae\u5934\u5e94\u8bbe\u7f6e\u4e3a https"):"http:"===s.slice(0,5)||"https:"===s.slice(0,6)?this.vabtest_url=s:this.SensorsABTest.log("ABTesting SDK \u521d\u59cb\u5316\u53c2\u6570 vabtest_url \u5e94\u8bbe\u7f6e\u4e3a\u6709\u6548 URL"))},C.prototype.resolve=function(){var t=this.SensorsABTest.results;if(this.enable_visualize!==!1&&this.is_editor!==!0&&this.isFirst!==!1){if((new Date).getTime()-this.start_time>this.timeout)return this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),!1;var e=this;this.isFirst=!1;var s=!1;U.each(t,function(t){if(!U.isObject(t)||"VISUAL"!==t.experiment_type)return!1;if(s)return!1;var i=t.experiment_value;if(!U.isArray(i))try{i=JSON.parse(t.experiment_value),t.experiment_value=i}catch(r){return!1}e.isTriggerVisualExp(t)&&(s=!0,e.renderGlobalElement(t),e.prepareResource(t,e.render.bind(e)),e.visualExp=t,e.SensorsABTest.trackOutTestTrigger("VISUAL"))}),!s&&this.use_mask&&this.destroyMask()}},C.prototype.initMask=function(){this.mask_instance=new U.Mask("vabtest_"+this.SensorsABTest.sd.para.sdk_id),this.mask_instance.show(this.timeout)},C.prototype.destroyMask=function(){this.mask_instance&&this.mask_instance.remove()},C.prototype.prepareResource=function(t,e){var s=this,i=t.experiment_value;U.isArray(i)&&(U.each(i,function(i){function r(){var i=s.imgLoadingList.indexOf(o);s.loadedImages.push(o),i>-1&&s.imgLoadingList.splice(i,1),0===s.imgLoadingList.length&&e(t)}var n=i.tagName,a=i.props;if("img"===n&&a&&a.attributes&&U.isString(a.attributes.src)){var o=a.attributes.src;if(s.imgLoadingList.push(o),s.loadedImages.indexOf(o)>-1){var c=s.imgLoadingList.indexOf(o);return c>-1&&s.imgLoadingList.splice(c,1),void(0===s.imgLoadingList.length&&e(t))}var l=document.createElement("img");l.width=1,l.height=1,l.onload=r,l.onerror=r,l.onabort=r,l.src=a.attributes.src}}),0===this.imgLoadingList.length&&e(t))},C.prototype.render=function(t){this.removeDomChangeListener();var e=this,s=function(){if(e.isDomReady=!0,e.use_mask&&e.mask_instance&&e.mask_instance.is_timeout===!0)return void e.SensorsABTest.log("\u6e32\u67d3\u5b9e\u9a8c\u7ed3\u679c\u8d85\u65f6\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01");e.isTrigger||(e.SensorsABTest.triggerHandle(t),e.isTrigger=!0),U.isArray(e.originData)&&(U.each(e.originData,function(t){E(t)}),e.originData=[]),U.each(e.dynamicAddedElements,function(t){c(t)}),e.dynamicAddedElements=[];var s=t.experiment_value;U.isArray(s)&&U.each(s,function(t){var s=t.selector,i=t.type;if("innerHtml"===t.type){var r=N(t,!0,e.domEditor);r.addedEleSelector&&e.dynamicAddedElements.push(r.addedEleSele)}if("img"===i||"link"===i||"text"===i||"innerHtml"===i){var n=U.getDomBySelector(s);if(n)try{var a=D(n,[]),o=a.eleInfo,c=S(n,t,o);c&&e.originData.push(a)}catch(l){U.logger.log("render vabtest error")}}}),e.use_mask&&e.destroyMask(),e.addDomChangeListener()};this.isDomReady?s():U.bindReady(s)},C.prototype.restoreElements=function(){U.each(this.originData,function(t){E(t)}),U.each(this.dynamicAddedElements,function(t){c(t)}),this.dynamicAddedElements=[],this.visualExp=null,this.isFirst=!0,this.start_time=(new Date).getTime(),this.originData=[],this.isTrigger=!1,O({attr_key:"sensors_ab_style_id"}),O({attr_key:"sensors_ab_script_id"})},C.prototype.addDomChangeListener=function(){var t=this;U.bindReady(function(){t.isDomReady=!0,t.domChangeObserver=x(t.observerCallback.bind(t))})},C.prototype.removeDomChangeListener=function(){w(this.domChangeObserver),this.domChangeObserver=null},C.prototype.addSinglePageListener=function(){var t=this;this.SensorsABTest.sd.ee.spa.on("switch",function(e){return e!==location.href&&(t.mask_instance&&t.destroyMask(),t.start_time=(new Date).getTime(),t.use_mask&&t.initMask(),t.restoreElements(),void t.resolve())})},C.prototype.observerCallback=function(){this.visualExp&&this.prepareResource(this.visualExp,this.render.bind(this))},C.prototype.stopTrigger=function(){this.isFirst=!1,this.SensorsABTest.log("\u8bf7\u6c42\u5b9e\u9a8c\u7ed3\u679c\u5931\u8d25\uff0cA/B \u53ef\u89c6\u5316\u5b9e\u9a8c\u5931\u8d25\uff01"),this.use_mask&&this.destroyMask()},C.prototype.isTriggerVisualExp=function(t){return U.isString(t.control_link)&&U.isString(t.link_match_type)?!!U.checkUrlIsMatch(t.control_link,t.link_match_type)||(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u5339\u914d\u5931\u8d25",t.abtest_experiment_id),!1):(this.SensorsABTest.log("\u53ef\u89c6\u5316\u8bd5\u9a8c\u6570\u636e\u5f02\u5e38",t.abtest_experiment_id),!1)},C.prototype.renderGlobalElement=function(t){var e=t.experiment_value;U.isArray(e)&&U.each(e,function(t){var e=t.type;switch(e){case"globalScript":U.bindReady(function(){var e={attr_value:t.id,text:t.props.text,attr_key:"sensors_ab_script_id"};B(e)});break;case"globalStyle":var s={attr_value:t.id,text:t.props.text,attr_key:"sensors_ab_style_id"};A(s)}})},R.prototype.asyncFetchABTest=function(){U.error("asyncFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},R.prototype.fastFetchABTest=function(){U.error("fastFetchABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},R.prototype.fetchCacheABTest=function(){U.error("fetchCacheABTest\u8c03\u7528\u5931\u8d25,A/B Testing\u672a\u521d\u59cb\u5316")},R.prototype.searchLocalExp=function(t){return this.codeExpData[t]?this.codeExpData[t]:null},R.prototype.getExpResult=function(t,e){var s=t.default_value,i=e?e:this.searchLocalExp(t.param_name);return U.isObject(i)?U.isObject(i.js_config)&&(i.js_config.type===t.value_type?(s=i.js_config.value,this.triggerHandle(i,t)):this.log("\u8bd5\u9a8c\u7ed3\u679c\u7c7b\u578b\u4e0e\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e0d\u4e00\u81f4\uff0cparam_name\uff1a"+t.param_name+"\uff0c\u5f53\u524d\u8fd4\u56de\u7c7b\u578b\u4e3a\uff1a"+i.js_config.type+"\uff0c\u4ee3\u7801\u671f\u671b\u7c7b\u578b\u4e3a\uff1a"+t.value_type)):this.log("localdata\u672a\u67e5\u8be2\u5230\u8bd5\u9a8c\u6570\u636e\uff0c\u8bd5\u9a8c\u53c2\u6570\u540d\u79f0\uff1a"+t.param_name),this.trackOutTestTrigger("CODE",t),s},R.prototype.resolveVariables=function(){this.codeExpData={};var t=this,e=this.results;U.each(e,function(e){U.isObject(e)&&e.variables&&U.isArray(e.variables)&&U.each(e.variables,function(s){U.isObject(s)&&!t.codeExpData[s.name]&&(t.codeExpData[s.name]=U.extend({},e),t.codeExpData[s.name].js_config=t.getRelativeValue(s.value,s.type))})})},R.prototype.getRelativeValue=function(t,e){var s=this,i={},r={INTEGER:function(t){var e=parseFloat(t);isNaN(e)?s.log("\u539f\u59cb\u6570\u636e INTEGER \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t):(i.value=e,i.type="Number")},STRING:function(t){U.isString(t)?(i.value=t,i.type="String"):s.log("\u539f\u59cb\u6570\u636e STRING \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)},JSON:function(t){var e=JSON.parse(t);U.isObject(e)?(i.value=e,i.type="Object"):s.log("\u539f\u59cb\u6570\u636e JSON \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)},BOOLEAN:function(t){"true"===t?(i.value=!0,i.type="Boolean"):"false"===t?(i.value=!1,i.type="Boolean"):s.log("\u539f\u59cb\u6570\u636e BOOLEAN \u7c7b\u578b\u89e3\u6790\u5f02\u5e38",t)}};try{r[e]?r[e](t):s.log("\u8bd5\u9a8c\u6570\u636e\u7c7b\u578b\u89e3\u6790\u5931\u8d25",e,t)}catch(n){s.log(n,t,e)}return i},R.prototype.dealResponseData=function(t,e){U.isObject(t)?"SUCCESS"===t.status?U.isArray(t.results)&&(this.fetchData.updateExpsCache(t),this.updateLocalData(e)):"FAILED"===t.status&&this.log("\u83b7\u53d6\u8bd5\u9a8c\u5931\u8d25\uff1aerror_type\uff1a"+t.error_type+",error\uff1a"+t.error):this.log("\u8bd5\u9a8c\u6570\u636e\u89e3\u6790\u5931\u8d25\uff0cresponse \uff1a",t)},R.prototype.dealCodeExpResponseData=function(t,e){U.isObject(t)?"SUCCESS"===t.status?U.isArray(t.results)&&(this.fetchData.updateExpsCache(t),this.updateCodeExpLocalData(e)):"FAILED"===t.status&&this.log("\u83b7\u53d6\u8bd5\u9a8c\u5931\u8d25\uff1aerror_type\uff1a"+t.error_type+",error\uff1a"+t.error):this.log("\u8bd5\u9a8c\u6570\u636e\u89e3\u6790\u5931\u8d25\uff0cresponse \uff1a",t)},R.prototype.updateCodeExpLocalData=function(t){this.analyzeCodeExpData(),this.updateStorage(t),this.log("\u66f4\u65b0\u8bd5\u9a8c\u6570\u636e\u6210\u529f")},R.prototype.analyzeCodeExpData=function(){var t=this.results;return U.isArray(t)?(this.resolveVariables(),void this.registerProperty()):(this.log("\u89e3\u6790——\u6570\u636e\u683c\u5f0f\u9519\u8bef",t),!1)},R.prototype.updateLocalData=function(t){this.analyzeData(),this.updateStorage(t),this.log("\u66f4\u65b0\u8bd5\u9a8c\u6570\u636e\u6210\u529f")},R.prototype.updateStorage=function(t){var e=(new Date).getTime(),s={results:this.results,updateTime:e,triggerList:this.triggerList,distinct_id:t||this.sd.store.getDistinctId(),outTriggerList:this.outTriggerList,out_list:this.out_list,track_config:this.track_config},i=this.state.storage.name,r=this.para.encrypt_cookie;U.setStorageData(s,i,r),this.updateTime=e},R.prototype.analyzeData=function(){var t=this.results;return U.isArray(t)?(this.link.resolve(),this.vabtest.resolve(),this.resolveVariables(),void this.registerProperty()):(this.log("\u89e3\u6790——\u6570\u636e\u683c\u5f0f\u9519\u8bef",t),!1)},R.prototype.trackOutTestTrigger=function(t,e){var s=this.out_list,i=this,r=!1,n={};if(U.isArray(s)&&s.length>0&&(U.each(s,function(s){U.isObject(s)&&!r&&("CODE"===t?U.isObject(s)&&s.variables&&U.isArray(s.variables)&&U.each(s.variables,function(t){var a=i.getRelativeValue(t.value,t.type);!r&&a&&U.isObject(t)&&e.param_name===t.name&&a.type===e.value_type&&(r=!0,n=s)}):"LINK"===t?U.isString(s.control_link)&&U.isString(s.link_match_type)&&("REGEXP"===s.link_match_type?U.checkUrlIsRegexp(s.control_link,s.regexp_flags)&&(r=!0,n=s):U.checkUrlIsMatch(s.control_link,s.link_match_type)&&(r=!0,n=s)):"VISUAL"===t&&U.isString(s.control_link)&&U.isString(s.link_match_type)&&U.checkUrlIsMatch(s.control_link,s.link_match_type)&&(r=!0,n=s))}),r)){var a=i.sd.store.getDistinctId();n.subject_id&&n.subject_name&&(a=n.subject_name+n.subject_id),i.sendTriggerEvent("outTriggerList",a,n,{})}},R.prototype.registerProperty=function(){var t=this.track_config.property_set_switch;if(t){var e=this.sd.store.getUnionId(),s=["USER"+(e.login_id||e.anonymous_id),"DEVICE"+e.anonymous_id],i=this.sd.bridge.is_verify_success?this.getLatestSubject():[],r=[],n=[];U.each(this.triggerList,function(t,e){s.indexOf(e)<0&&i.indexOf(e)<0||U.isArray(t)&&U.each(t,function(t){t.result_id&&r.push(t.result_id)})}),U.isArray(this.results)&&U.each(this.results,function(t){t.abtest_experiment_result_id&&n.push(t.abtest_experiment_result_id)}),r.length>0&&this.sd.registerPage({abtest_result:r}),n.length>0&&this.sd.registerPage({abtest_dispatch_result:n})}else this.sd.clearPageRegister(["abtest_result","abtest_dispatch_result"])},R.prototype.saveLatestSubject=function(t){var e=this.getLatestSubject()||[];e.indexOf(t)<0&&e.push(t);var s=this.state.storage.latest_name,i=this.para.encrypt_cookie;U.setStorageData(e,s,i)},R.prototype.getLatestSubject=function(){var t=this.state.storage.latest_name;return U.getStorageData(t,this.sd)||[]},R.prototype.triggerHandle=function(t,e){var s=this.sd.store.getDistinctId();t.subject_id&&t.subject_name&&(s=t.subject_name+t.subject_id),this.sd.bridge.is_verify_success&&this.saveLatestSubject(s);var i=this.trackTestTrigger(s,t,e);return i},R.prototype.getTriggerProps=function(t,e){var s={},i=U.isObject(e)&&U.isObject(e.properties)?e.properties:{};if("{}"!==JSON.stringify(this.triggerList)){var r="web_abtesting:"+this.lib_version;s.$lib_plugin_version=[r]}this.para.collect_bridge_status&&(s.$sdk_bridge_status=this.bridgeState);var n={$abtest_experiment_id:t.abtest_experiment_id,$abtest_experiment_group_id:t.abtest_experiment_group_id},a=this.track_config.trigger_content_ext;return U.each(a,function(e){void 0!==t[e]&&(s["$"+e]=t[e])}),s=U.extend(n,s,i)},R.prototype.sendTriggerEvent=function(t,e,s,i){var r=this.track_config.trigger_switch,n=!0,a=this[t];a&&U.isObject(a)&&a[e]&&U.each(a[e],function(t){t.experiment_id===s.abtest_experiment_id&&t.group_id===s.abtest_experiment_group_id&&t.result_id===s.abtest_experiment_result_id&&(n=!1)}),this[t][e]=F(a[e],s),this.updateStorage(),this.registerProperty();var o=this.getTriggerProps(s,i);return n&&r&&this.sd.track("$ABTestTrigger",o),n},R.prototype.trackTestTrigger=function(t,e,s){if(e.is_white_list)return!1;var i=this.sendTriggerEvent("triggerList",t,e,s),r=this.getTriggerProps(e,s);return this.sd.track("WebABTestTrigger",r),i},R.prototype.checkSADebug=function(){var t=this,e=U.getQueryParam(location.href,"sensors_abtest_url"),s=U.getQueryParam(location.href,"feature_code"),i=+U.getQueryParam(location.href,"account_id");if(e.length&&s.length&&U.isNumber(i)&&0!==i){var r={distinct_id:this.sd.store.getDistinctId(),feature_code:s,account_id:i};this.sd._.ajax({url:e,type:"POST",data:JSON.stringify(r),credentials:!1,contentType:"application/json",timeout:this.para.timeout_milliseconds,cors:!0,success:function(){},error:function(e){t.log("distinct_id\u53d1\u9001\u5931\u8d25,err:",e)}})}},R.prototype.initMethods=function(t){var e=this,s=["asyncFetchABTest","fastFetchABTest","fetchCacheABTest"];U.each(s,function(s){e[s]=t.methods[s].bind(t)})},I.prototype={timer:null,method:null,context:null,init:function(t,e){this.method=t,this.context=e,this.start(!0)},getServerData:function(t){var e=this;t?this.method.call(this.context,{suc:function(s){t&&("ab_bridge_ok"===e.SensorsABTest.bridgeState&&(s=s.data),U.isObject(s)&&"SUCCESS"===s.status&&U.isArray(s.results)||(e.SensorsABTest.link.stopTrigger(),e.SensorsABTest.vabtest.stopTrigger()))},err:function(){t&&(e.SensorsABTest.link.stopTrigger(),e.SensorsABTest.vabtest.stopTrigger())}}):this.method.call(this.context)},setNextFetch:function(t){var e=this,s=t||this.SensorsABTest.para.update_interval;this.clearFetchTimer(this.timer),this.timer=setTimeout(function(){e.getServerData()},s)},updateExpsCache:function(t){this.SensorsABTest.results=t.results||t.data||[];var e=t.triggerList,s=t.out_list,i=t.outTriggerList;U.isArray(s)&&(this.SensorsABTest.out_list=s),U.isObject(e)&&(this.SensorsABTest.triggerList=t.triggerList),U.isObject(i)&&(this.SensorsABTest.outTriggerList=i),U.isObject(t.track_config)?this.SensorsABTest.track_config=t.track_config:this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},clearExpsCache:function(){this.SensorsABTest.codeExpData={},this.SensorsABTest.results=[],this.SensorsABTest.out_list=[],this.SensorsABTest.track_config=this.SensorsABTest.default_track_config},start:function(t){var e=null,s=(new Date).getTime(),i=U.getStorageData(this.SensorsABTest.state.storage.name,this.SensorsABTest.sd),r=this.SensorsABTest.sd.store.getDistinctId();if(i&&U.isObject(i)&&i.distinct_id===r)if(e=i.updateTime,t&&this.updateExpsCache(i),e&&U.isNumber(e)&&s-e>0&&s-e0&&s-e=3||!t.on)M.call(this,t,e);else{var s=this;t.on("sdkReady",function(){M.call(s,t,e)})}},R.prototype.initTest=function(){this.link.init(this.abtestingPara.multilink),this.vabtest.init(this.abtestingPara.visualize),this.sd.bridge.is_verify_success?this.bridgeStore.init(this.abtestingPara):this.normalStore.init(this.abtestingPara),this.registerProperty()},R.prototype.log=function(){return U.isString(arguments[0])&&(arguments[0]="sensorsabtest————"+arguments[0]),this.sd&&this.sd.log.apply(this,arguments)};var V=new R;return V.__constructor__=R,window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.SensorsABTest=window.SensorsDataWebJSSDKPlugin.SensorsABTest||V:window.SensorsDataWebJSSDKPlugin={SensorsABTest:V},R}); \ No newline at end of file diff --git a/dist/web/plugin/abtesting-sdk-web/vabtest.min.js b/dist/web/plugin/abtesting-sdk-web/vabtest.min.js index c6160868..ad877137 100644 --- a/dist/web/plugin/abtesting-sdk-web/vabtest.min.js +++ b/dist/web/plugin/abtesting-sdk-web/vabtest.min.js @@ -1 +1 @@ -!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";function e(){return(e=Object.assign||function(e){for(var t=1;t1?t-1:0),n=1;n "):v(e.parentNode,t)):(t.unshift("body"),t.join(" > "))}function E(e){var t=e.getBoundingClientRect(),i=t.top+(document.body.scrollTop||document.documentElement.scrollTop),n=t.left+(document.body.scrollLeft||document.documentElement.scrollLeft),o=m.ry(e).getStyle("z-index")||0;return{width:t.width,height:t.height,top:i,left:n,zIndex:o}}function y(e){var t=e.childNodes,i="",n=!1;return m.each(t,function(e){if(!1===n&&3===e.nodeType){var t=e.textContent||e.innerText||e.nodeValue||"";t&&(i=m.trim(t),n=!0)}}),i}function b(e,t){var i=e.tagName;y(e)!==t&&(e.textContent?e.textContent=t:e.innerText?e.innerText=t:e.innerHTML=t,"input"!==i&&"INPUT"!==i||(e.value=t||""))}function S(e,t,i){e.setAttribute(t,i)}function _(e,t,i){i||(i=function(e,t){var i=t.originProps,n={attributes:{}},o=i.attributes;return m.each(o.style||{},function(t,i){n.attributes.style[i]=m.ry(e).getStyle(i)}),Object.hasOwnProperty.call(i,"text")&&(n.attributes.text=y(e)),m.each(["src","href"],function(t){Object.hasOwnProperty.call(o,t)&&(n.attributes[t]=e[t])}),Object.hasOwnProperty.call(o,"target")&&(n.attributes.target=e.getAttribute("target")),n}(e,t));var n=function(e,t){var i=e.originProps||{},n=t.originProps||{},o=i.attributes||{},s=n.attributes||{},r=!0;return i.text&&i.text!==n.text&&(r=!1),o&&m.each(["src","href","target"],function(e){o[e]&&o[e]!==s[e]&&(r=!1)}),r}(t,i);if(n){var o=t.props;m.isObject(o)&&function(e,t,i){if(Object.hasOwnProperty.call(t,"attributes")){var n=t.attributes;Object.hasOwnProperty.call(n,"style")&&function(e,t,i){var n=m.getUA(),o=n.ie&&n.ie<9,s="";m.each(t,function(e,t){var i;o&&e.indexOf("rgba")>-1&&(e=(i=e.match(/[\d.]+/g)).length>=3?"rgb("+i[0]+","+i[1]+","+i[2]+")":"");var n=t.replace(/[A-Z]+/g,function(e){return"-"+e.toLowerCase()});s+=n+": "+e+" !important;"}),""!==s&&(w({attr_value:i=m.encodeSelector(i),text:s="[sensors_ab_ele_style_id="+i+"]{"+s+"}",attr_key:"sensors_ab_ele_style_id"}),e.setAttribute("sensors_ab_ele_style_id",i))}(e,n.style,i.selector),m.each(["href","target","src"],function(t){n[t]&&e.getAttribute(t)!==n[t]&&S(e,t,n[t])})}Object.hasOwnProperty.call(t,"text")&&"innerHtml"!==i.type&&b(e,t.text)}(e,o,t)}return n}function w(e){try{var t=document.createElement("style");t.innerHTML=e.text,t.setAttribute(e.attr_key,e.attr_value),document.getElementsByTagName("head")[0].append(t)}catch(i){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(e,i.stack||i.message)}}function D(e){try{var t=document.createElement("script");t.setAttribute(e.attr_key,e.attr_value),t.innerHTML="try{"+e.text+"}catch(e){ window.sensorsABTestModifyListener && window.sensorsABTestModifyListener("+JSON.stringify(e)+", e.stack || e.message) }",document.body.append(t)}catch(i){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(e,i.stack||i.message)}}function N(e){var t=e.getBoundingClientRect(),i=window.innerWidth?{w:window.innerWidth,h:window.innerHeight}:"BackCompat"==document.compatMode?{w:document.body.clientWidth,h:document.body.clientHeigth}:{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight},n=document.documentElement.scrollTop||document.body.scrollTop,o=document.documentElement.scrollLeft||document.body.scrollLeft,s=t.width,r=t.height,a=t.left+i.w/2-s/2+o,l=t.top-i.h/2+r/2+n;window.scrollTo(a,l)}function T(e,t,i){var n=e.tagName.toLowerCase(),o=function(e,t){var i={};return m.each(t||[],function(t){var n=t.replace(/[A-Z]+/g,function(e){return"-"+e.toLowerCase()});i[t]=m.ry(e).getStyle(n)}),i}(e,t),s={selector:v(e),originProps:{attributes:{style:o},text:y(e),hasChildren:e.children.length>0},type:"text",tagName:n};"a"===n&&(s.originProps.attributes.href=e.href,e.getAttribute("target")&&(s.originProps.attributes.target=e.getAttribute("target")),s.type="link"),"img"===n&&(s.originProps.attributes.src=e.src,s.type="img"),e.hasAttribute("sensors_ab_widget")&&(s.type="innerHtml");var r=e.getAttribute("style");if(i)for(var a=0;a-1&&e.parentElement.removeChild(e)}),n&&i&&n.removeAttribute(i)}function P(e){const t=e.hidden||"none"===e.style.display||"hidden"===e.style.visibility,i="0"===window.getComputedStyle(e).getPropertyValue("opacity");return t||i}function k(e){const t=e.split(">");for(;t.length>0;){if(P(document.querySelector(t.join(">"))))return!0;t.length-=1}return!1}function A(e,t,i){var n=null,o=null,s=m.getDomBySelector(e.selector)||document.querySelector&&document.querySelector(e.selector);if(s&&s.hasAttribute("sensors_ab_widget")){!function(e,t){var i=e.selector,n=e.props.text,o="text"===e.props.sensors_ab_widget;const s=document.querySelector(i);if(!s)throw"element not found:"+i;o?s.innerText=n:s.innerHTML=n,M(s,e,t)}(e,t);var r=E(document.querySelector(e.selector));i&&i.setSelectElePostion(r)}else{function a(){return n=function(e,t){var i=m.getDomBySelector(e.base),n=e.props.text,o=e.props.sensors_ab_widget,s=e.operation;if(!i)throw"VABTest: No base element";if(!i.parentNode)throw"base element parentNode not found";var r=document.createElement("font");if("text"===o&&(r.innerText=n),"html"===o&&(r.innerHTML=n),M(r,e,t),"BEFORE_INSERTION"===s)i.parentNode.insertBefore(r,i);else{if("AFTER_INSERTION"!==s)throw"operation not supported";i.nextSibling?i.parentNode.insertBefore(r,i.nextSibling):i.parentNode.appendChild(r)}return v(r)}(e,t)}i?o=i.getModifiedEleSelectorsWhen(a):a()}return{selector:e.selector,addedEleSelector:n,updatedSelectors:o}}function M(e,t,i){if(i&&i.length)for(var n=0;n0||(n.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",t.param_name),o.verify_success=!1);break;case"value_type":m.isString(t.value_type)&&-1!==m.indexOf(n.value_type_list,t.value_type)||(n.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",t.value_type),o.verify_success=!1);break;case"default_value":"undefined"==typeof t.default_value?(n.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),o.verify_success=!1):n.valueType(t.default_value,t.value_type)||(n.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",t.default_value,t.value_type),o.verify_success=!1);break;case"callback":m.isFunction(t.callback)||(n.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),o.verify_success=!1);break;default:o.verify_success=!1}else if("not_essential"===i)switch(s){case"timeout_milliseconds":t.timeout_milliseconds=t.timeout_milliseconds||n.SensorsABTest.para.timeout_milliseconds||n.SensorsABTest.default_para.timeout_milliseconds,(!m.isNumber(t.timeout_milliseconds)||m.isNumber(t.timeout_milliseconds)&&t.timeout_milliseconds<=0)&&(n.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",t.timeout_milliseconds),t.timeout_milliseconds=n.SensorsABTest.para.timeout_milliseconds),t.timeout_milliseconds<200&&(t.timeout_milliseconds=200);break;case"properties":t.properties=m.isObject(t.properties)?t.properties:{}}}),o.para=t,o},resolveCustomProperties:function(e){var t=this,i={verify_success:!0,para:null},n=e.custom_properties;if(!m.isObject(n)||m.isEmptyObject(n))return delete e.custom_properties,i.para=e,i;if(m.each(n,function(e,n){if((!m.isString(n)||!t.regName.test(n)||n.length>100)&&(t.SensorsABTest.log(" property name [ "+n+" ] is not invalid "),i.verify_success=!1),(m.isString(e)||m.isNumber(e)||m.isBoolean(e)||m.isArray(e)||m.isDate(e))&&!(m.isString(e)&&e.length>500)||(t.SensorsABTest.log("property [ "+n+" ] of value [ "+JSON.stringify(e)+" ] is not invalid"),i.verify_success=!1),m.isArray(e)){var o=!0;m.each(e,function(e){!1!==o&&(m.isString(e)||(o=!1))}),o||(t.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+n+" ] of value "+JSON.stringify(e)+" is not invalid"),i.verify_success=!1)}}),!0===i.verify_success){var o={};m.each(n,function(e,t){m.isDate(e)?o[t]=m.formatDate(e):m.isString(e)?o[t]=e:o[t]=JSON.stringify(e)}),e.custom_properties=o}return i.para=e,i}},m.VerifyStore=f,m.listenPageState=function(e){({visibleHandle:m.isFunction(e.visible)?e.visible:function(){},hiddenHandler:m.isFunction(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;document.addEventListener(e.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}}).init()},m.listenPageState=function(e){({visibleHandle:m.isFunction(e.visible)?e.visible:function(){},hiddenHandler:m.isFunction(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;document.addEventListener(e.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}}).init()},m.getStorageData=function(e,t){var i=m.localStorage.get(e);m.isString(i)&&(i=t.kit.userDecryptIfNeeded(i));try{i=JSON.parse(i)}catch(n){m.log(n)}return i},m.setStorageData=function(e,t,i){e=JSON.stringify(e),i&&(e=m.userEncrypt(e)),m.localStorage.set(t,e)},g.prototype={createMaskStyle:function(){var e="["+this.attr_name+"],["+this.attr_name+"] body{opacity:0 !important;-khtml-opacity:0 !important;-moz-opacity:0;filter:alpha(opacity=0);}",t=document.createElement("style");t.type="text/css";try{t.appendChild(document.createTextNode(e))}catch(i){t.styleSheet.cssText=e}try{this.style_element=t,document.getElementsByTagName("head")[0].appendChild(t)}catch(i){m.log("error when create calls")}},show:function(e){try{var t=this;if(this.is_abort)return!1;var i=null;if(i=document.getElementsByTagName("html")[0],!m.isElement(i))return;i.setAttribute(this.attr_name,"1"),this.is_added=!0,m.isNumber(e)&&(this.remove_timer=setTimeout(function(){t.is_timeout=!0,t.remove()},e))}catch(n){m.log("error when show calls")}},remove:function(){try{if(this.is_abort||(this.is_abort=!0),this.is_added){this.is_added=!1;var e=null;if(e=document.getElementsByTagName("html")[0],!m.isElement(e))return;e.removeAttribute(this.attr_name),this.style_element&&(document.getElementsByTagName("head")[0].removeChild(this.style_element),this.style_element=null)}this.remove_timer&&(clearTimeout(this.remove_timer),this.remove_timer=null)}catch(t){m.log("error when remove calls")}}},m.Mask=g;class R{constructor(e){this.bridge=e.bridge,this.domEditor=e.domEditor,this.pageContentObserver=null,this.dynamicAddedElements=[];for(let e in a)m.isFunction(this[e])&&this.bridge.on(a[e],this[e].bind(this))}listenPageContentChange(){var e,t;this.pageContentObserver=(e=this.mutationObserver.bind(this),(t=new(0,window.MutationObserver)(e)).observe(document.body,{childList:!0,subtree:!0}),t)}unListenPageContentChange(){var e;(e=this.pageContentObserver)&&e.disconnect(),this.pageContentObserver=null}getElementSnapshot(e,t){t.payload.selector;let i=t.payload.selector,n=this.domEditor.getOriginDataBySelector(i);if(n.ele){let t=n.eleInfo,o=this.domEditor.getServerDataBySelector(i),s=m.extend(o||{isModify:!1},t);e.reply({status:"SUCCESS",element:s})}else e.reply({status:"ERROR",message:"\u672a\u627e\u5230\u8be5\u5143\u7d20"})}updateElementSnapshot(e,t){this.unListenPageContentChange();let i=t.payload;let n={};switch(i.type){case"img":case"link":case"text":let t=this.domEditor.getOriginDataBySelector(i.selector),l=t.ele;if(this.domEditor.updataServerData(i.selector,i),!l)return void e.reply({status:"ERROR",message:"\u8be5\u5143\u7d20\u672a\u5728\u5f53\u524d\u9875\u9762\u51fa\u73b0\uff01",code:"4001"});{O(t),this.domEditor.editEleProps(i,t);let e=E(l);this.domEditor.setSelectElePostion(e)}break;case"globalScript":var o={attr_value:i.id,text:i.props.text,attr_key:"sensors_ab_script_id"};C(o),D(o);break;case"globalStyle":var s={attr_value:i.id,text:i.props.text,attr_key:"sensors_ab_style_id"};C(s),w(s);break;case"innerHtml":try{this.domEditor.updataServerData(i.selector,i);var r=A(i,this.domEditor.config.attributes,this.domEditor);r.addedEleSelector&&this.dynamicAddedElements.push(r.addedEleSelector);let e=this.domEditor.getOriginDataBySelector(i.selector);this.domEditor.editEleProps(i,e);let t=E(document.querySelector(i.selector));this.domEditor.setSelectElePostion(t),n={status:"SUCCESS",element:{selector:r.addedEleSelector},changedItems:r.updatedSelectors||[]}}catch(a){n.status="ERROR",m.logger.log(a)}}e.reply(n),this.listenPageContentChange()}setMode(e,t){let i=t.payload.type,n=!0;this.domEditor.setMode(i),H()||(n=!1,this.domEditor.mode_type="VIEW"),e.reply({status:"SUCCESS",check_url:n})}resetElementSnapshot(e,t){try{let o=this,s=t.payload,r=[];this.domEditor.saveServerData(s),this.domEditor.restoreElements(),m.each(this.dynamicAddedElements,function(e){p(e)}),this.dynamicAddedElements=[];var i=[];m.each(s,function(e){let t=e.type,n=o.domEditor.getOriginDataBySelector(e.selector),s=n.ele;if("innerHtml"===t){var a=A(e,o.domEditor.config.attributes,o.domEditor);a.addedEleSelector&&o.dynamicAddedElements.push(a.addedEleSelector),i=a.updatedSelectors,n=o.domEditor.getOriginDataBySelector(e.selector),o.domEditor.editEleProps(e,n)}else if(s)o.domEditor.editEleProps(e,n);else if("globalScript"===t){var l={attr_value:e.id,text:e.props.text,attr_key:"sensors_ab_script_id"};C(l),D(l)}else if("globalStyle"===t){var d={attr_value:e.id,text:e.props.text,attr_key:"sensors_ab_style_id"};C(d),w(d)}else r.push(e)}),this.domEditor.resetSelectDivPostion(),this.domEditor.resetHoverDivPostion(),e.reply({status:"SUCCESS",no_found_list:r,changedItems:i})}catch(n){e.reply({status:"ERROR",error:n})}}markElement(e,t){let i=t.payload,n=this.domEditor.getOriginDataBySelector(i.selector).ele;if(n){let t=E(n);this.domEditor.setHoverElePostion(t),e.reply({status:"SUCCESS"})}else e.reply({status:"ERROR",message:"\u8be5\u5143\u7d20\u672a\u5728\u5f53\u524d\u9875\u9762\u51fa\u73b0\uff01",code:"4001"})}selectElement(e,t){let i=t.payload,n=this.domEditor.getOriginDataBySelector(i.selector),o=n.ele;if(o){let t=E(o);this.domEditor.setSelectElePostion(t),N(o);let i=n.eleInfo,s=this.domEditor.getServerDataBySelector(i.selector),r=m.extend(s||{isModify:!1},i);e.reply({status:"SUCCESS",element:r})}else e.reply({status:"ERROR",message:"\u8be5\u5143\u7d20\u672a\u5728\u5f53\u524d\u9875\u9762\u51fa\u73b0\uff01",code:"4001"})}addElementSnapshot(e,t){this.updateElementSnapshot(e,t)}deleteElementSnapshot(e,t){var i=this,n="SUCCESS";try{var o=this.domEditor.getModifiedEleSelectorsWhen(function(){let e=t.payload.selector;return!!e&&(p(e),i.dynamicAddedElements=i.dynamicAddedElements.filter(t=>t!==e),!0)})}catch(s){n="ERROR"}e.reply({status:n,changedItems:o})}getHtml(e){let t=document.getElementsByTagName("html")[0].outerHTML;t=t.replace(/class="sa-vabtest-mark"/g,'class="sa-vabtest-mark-hidden"'),e.reply({status:"SUCCESS",visual_dom:t,origin_url:location.href,dom_width:Math.max(document.body.scrollWidth,document.body.offsetWidth,document.documentElement.clientWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth),dom_height:Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)})}cancelSelectElement(e){this.domEditor.resetSelectDivPostion(),e.reply({status:"SUCCESS"})}cancelMarkElement(e){this.domEditor.resetHoverDivPostion(),e.reply({status:"SUCCESS"})}checkUrl(e){let t=!0;H()||(t=!1,this.domEditor.mode_type="VIEW"),e.reply({status:t?"SUCCESS":"ERROR"})}searchElement(e,t){var i=[],n="SUCCESS";try{let e=t.payload,s=e.selector,r=e.limit;s=s.split(">").filter(e=>e).join(">");let a=Array.from(document.querySelectorAll(s)).filter(e=>"sa-vabtest-mark"!==e.id).slice(0,r);i=m.map(a,function(e){let t=(e.tagName||"").toLowerCase(),i=v(e);return{selector:i,type:"a"===t?"link":"img"===t?"img":e.hasAttribute("sensors_ab_widget")?"innerHtml":"text",tagName:t,hidden:k(i)}})}catch(o){n="ERROR",m.logger.log("\u641c\u7d22\u5143\u7d20\u5f02\u5e38\uff0c"+o.message)}e.reply({result:i,status:n})}mutationObserver(){let e=this;this.unListenPageContentChange(),m.each(e.domEditor.serverData,function(t){let i=e.domEditor.getOriginDataBySelector(t.selector);i.ele&&(O(i),e.domEditor.editEleProps(t,i))}),this.listenPageContentChange()}}class I{constructor(e){this.bridge=e.bridge,this.domEditor=e.domEditor,this.tagNames=e.tagNames,this.sd=e.sd}init(e){this.config=e,this.addLisenter()}addLisenter(){let e=this.config.action;e.KEY_DOWN&&m.addEvent(document.body,"keydown",this.keydownHandler.bind(this)),e.MOUSE_UP&&m.addEvent(document.body,"mouseup",this.mouseupHandler.bind(this)),e.WHEEL_EVENT&&m.addEvent(document.body,"wheel",this.wheelHandler.bind(this)),m.addEvent(document,"mousemove",this.moveHandler.bind(this)),m.addEvent(document,"click",this.clickHandler.bind(this),!0),this.sd.ee.spa.on("switch",this.singlePage.bind(this)),this.addInsertionErrorListener()}addInsertionErrorListener(){var e=this;window.sensorsABTestModifyListener=function(t,i){var n={type:t.type,id:t.id,isSuccess:!i};i&&(n.errorMessage=i),e.bridge.emit(a.insertionInfo,n)}}elementFilter(e){if(e){let t=e.tagName.toLowerCase();if(this.tagNames.indexOf(t)>-1){let i=this.domEditor.getAddedHtmlRoot(e);return i||("a"===t||"img"===t||"button"===t?e:this.domEditor.getOriginDataByElement(e).eleInfo.originProps.text?e:null)}}return null}getMouseElement(e){let t=null;return m.each(e,function(e){!t&&m.isString(e.className)&&-1===e.className.indexOf("sa-vabtest-mark")&&(t=e)}),t}moveHandler(e){try{let i=this.config.action;if(i.MOUSE_MOVE&&i.MOUSE_MOVE&&i.MOUSE_MOVE.eventValues&&m.isArray(i.MOUSE_MOVE.eventValues)){let t={};m.each(i.MOUSE_MOVE.eventValues,function(i){t[i]=e[i]}),this.bridge.emit(a.mousemoveEvent,t)}if("EDIT"!==this.domEditor.mode_type)return;let n=document.elementsFromPoint(e.clientX,e.clientY),o=this.getMouseElement(n),s=this.elementFilter(o);if(s){let e=E(s);this.domEditor.setHoverElePostion(e)}else this.domEditor.resetHoverDivPostion()}catch(t){}}clickHandler(e){if("EDIT"!==this.domEditor.mode_type)return;e.stopPropagation(),e.preventDefault();let t=document.elementsFromPoint(e.clientX,e.clientY),i=this.getMouseElement(t),n=this.elementFilter(i);if(n){let e=this.domEditor.getOriginDataByElement(n).eleInfo,t=e.selector,i=this.domEditor.getServerDataBySelector(t),o=m.extend(i||{isModify:!1},e),s=E(n);this.domEditor.setSelectElePostion(s),this.bridge.emit(a.selectElement,o)}else this.domEditor.resetSelectDivPostion(),this.bridge.emit(a.cancelSelectElement,{status:!0})}keydownHandler(e){try{let i={},n=this.config.action,o=(e.ctrlKey||e.metaKey?"cmd+":"")+e.key;"cmd+-"!==o&&"cmd+="!==o&&"Escape"!==o||(!0===n.KEY_DOWN.preventDefault&&e.preventDefault(),n.KEY_DOWN.eventValues&&m.isArray(n.KEY_DOWN.eventValues)&&m.each(n.KEY_DOWN.eventValues,function(t){i[t]=e[t]}),this.bridge.emit(a.keydownEvent,i))}catch(t){}}mouseupHandler(e){try{let i={},n=this.config.action;n.MOUSE_UP&&(!0===n.MOUSE_UP.preventDefault&&e.preventDefault(),n.MOUSE_UP.eventValues&&m.isArray(n.MOUSE_UP.eventValues)&&m.each(n.MOUSE_UP.eventValues,function(t){i[t]=e[t]}),this.bridge.emit(a.mouseupEvent,i))}catch(t){}}wheelHandler(e){try{let t={},i=this.config.action;i.WHEEL_EVENT&&(!0===i.WHEEL_EVENT.preventDefault&&e.preventDefault(),i.WHEEL_EVENT.eventValues&&m.isArray(i.WHEEL_EVENT.eventValues)&&m.each(i.WHEEL_EVENT.eventValues,function(i){t[i]=e[i]}),this.bridge.emit(a.wheelEvent,t))}catch(e){}}singlePage(e){if(e===location.href)return!1;let t=!0;H()||(t=!1,this.domEditor.mode_type="VIEW"),this.bridge.emit(a.checkUrl,{status:t?"SUCCESS":"ERROR"})}}class L{constructor(e){this.config=e.config,this.hoverDiv=null,this.selectDiv=null,this.maskDiv=null,this.mode_type="EDIT",this.serverData=[],this.originData=[],this.buildMarkDom()}setDomPostion(e,t){m.each(["width","height","left","top"],function(i){e.style[i]=t[i]+"px"}),e.style.zIndex=t.zIndex&&"auto"!==t.zIndex?Number(t.zIndex)+10:5e3}setHoverElePostion(e){this.selectDiv&&this.hoverDiv&&document.getElementById("sa-vabtest-mark")||this.buildMarkDom(),this.setDomPostion(this.hoverDiv,e)}setSelectElePostion(e){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.selectDiv,e)}restoreElements(){m.each(this.originData,function(e){O(e)}),this.originData=[],C({attr_key:"sensors_ab_style_id"}),C({attr_key:"sensors_ab_script_id"})}editEleProps(e,t){let i=t.eleInfo;_(t.ele,e,i)}setMode(e){this.mode_type=e,"VIEW"===e&&(p(this.maskDiv),this.hoverDiv=null,this.selectDiv=null,this.maskDiv=null)}resetMarkDom(e){e&&this.setDomPostion(e,{width:0,height:0,top:0,left:0})}resetSelectDivPostion(){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.selectDiv,{width:0,height:0,top:0,left:0})}resetHoverDivPostion(){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.hoverDiv,{width:0,height:0,top:0,left:0})}buildMarkDom(){var e=document.createElement("div"),t=document.createElement("div"),i=document.createElement("div"),n=document.createElement("style");e.className="sa-vabtest-mark",e.id="sa-vabtest-mark",t.className="sa-vabtest-hover",i.className="sa-vabtest-clickable";var o=e.attachShadow({mode:"open"});n.innerText=".sa-vabtest-clickable { background: rgba(49, 112, 235, 0.15) !important; outline: 2px solid #3170EB !important; outline-offset: -2px !important; width: 0;height: 0;position: absolute; top: 0; left: 0;}.sa-vabtest-hover { outline: 2px solid #3170EB !important; outline-offset: -2px !important; width: 0;height: 0;position: absolute; top: 0; left: 0;}",o.appendChild(n),o.appendChild(t),o.appendChild(i),document.body.appendChild(e),m.setCssStyle(".sa-vabtest-mark { pointer-events: none;}.sa-vabtest-mark-hidden { display: none;}"),this.hoverDiv=t,this.selectDiv=i,this.maskDiv=e}saveServerData(e){this.serverData=e}updataServerData(e,t){let i=!1,n=this;m.each(this.serverData,function(o,s){o.selector===e&&(n.serverData[s]=t,i=!0)}),i||this.serverData.push(t)}getServerDataBySelector(e){let t=null;return m.each(this.serverData,function(i){i.selector===e&&(t=i)}),t}setOriginData(e,t){let i=!1,n=this;m.each(this.originData,function(t,o){e===t.selector&&(n.originData[o]=t,i=!0)}),i||this.originData.push(t)}getOriginDataBySelector(e){let t=null;if(m.each(this.originData,function(i){e===i.eleInfo.selector&&(t=i)}),!t){let i=m.getDomBySelector(e);i?(t=T(i,this.config.styles,this.config.attributes),this.setOriginData(t.eleInfo.selector,t)):t={}}return t}getOriginDataByElement(e){let t=null;return m.each(this.originData,function(i){e===i.ele&&(t=i)}),t||(t=T(e,this.config.styles,this.config.attributes)),t}getModifiedEleSelectorsWhen(e){var t=[],i=[];if(m.each(this.serverData,function(e){let t=document.querySelector(e.selector);i.push([t,e])}),m.each(this.originData,function(e){let t=document.querySelector(e.eleInfo.selector);i.push([t,e.eleInfo])}),e&&e()){var n=new Map;m.each(i,function(e){var i=e[0],o=e[1],s=o.selector,r=v(i);r&&r!==s&&(o.selector=r,n.has(s)||(n.set(s,1),t.push({selectorFrom:s,selectorTo:r})))})}return t}getAddedHtmlRoot(e){const t=v(e).split(">");for(;t.length>0;){const e=document.querySelector(t.join(">"));if(e.hasAttribute("sensors_ab_widget"))return e;t.length-=1}return!1}}class x{constructor(){this.plugin_name="VABTest",this.plugin_version="1.26.8",this.abTestingSDK=null,this.bridge=new h({source:"sa-web-abtesting-sdk",frameSource:"sa-fe-abtesting-mode",version:"abtest_version"})}init(e,t){this.abTestingSDK=t.SensorsABTest;let i=this;if(e&&this.abTestingSDK){!function(e){e._.extend(m,e._)}(e),this.bridge.emit(a.connect,{status:!0,lib_version:2}).then(function(t){if("SUCCESS"===t.status){let n=t.payload.support;i.domEditor=new L({config:n}),i.sender=new I({bridge:i.bridge,domEditor:i.domEditor,tagNames:n.tagNames,sd:e}),new R({bridge:i.bridge,domEditor:i.domEditor}),i.sender.init(n)}else m.log("ABTesting SDK \u53ef\u89c6\u5316\u7f16\u8f91\u72b6\u6001\u521d\u59cb\u5316\u5931\u8d25")})}else m.log("ABTesting SDK \u53ef\u89c6\u5316\u7f16\u8f91\u72b6\u6001\u521d\u59cb\u5316\u5931\u8d25")}}let B=new x;B.__constructor__=x,window.SensorsDataWebJSSDKPlugin&&"[object Object]"===Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.VABTest=window.SensorsDataWebJSSDKPlugin.VABTest||B:window.SensorsDataWebJSSDKPlugin={VABTest:B}}); \ No newline at end of file +!function(e){"function"==typeof define&&define.amd?define(e):e()}(function(){"use strict";function e(){return(e=Object.assign||function(e){for(var t=1;t1?t-1:0),n=1;n "):v(e.parentNode,t)):(t.unshift("body"),t.join(" > "))}function E(e){var t=e.getBoundingClientRect(),i=t.top+(document.body.scrollTop||document.documentElement.scrollTop),n=t.left+(document.body.scrollLeft||document.documentElement.scrollLeft),o=m.ry(e).getStyle("z-index")||0;return{width:t.width,height:t.height,top:i,left:n,zIndex:o}}function y(e){var t=e.childNodes,i="",n=!1;return m.each(t,function(e){if(!1===n&&3===e.nodeType){var t=e.textContent||e.innerText||e.nodeValue||"";t&&(i=m.trim(t),n=!0)}}),i}function b(e,t){var i=e.tagName;y(e)!==t&&(e.textContent?e.textContent=t:e.innerText?e.innerText=t:e.innerHTML=t,"input"!==i&&"INPUT"!==i||(e.value=t||""))}function S(e,t,i){e.setAttribute(t,i)}function _(e,t,i){i||(i=function(e,t){var i=t.originProps,n={attributes:{}},o=i.attributes;return m.each(o.style||{},function(t,i){n.attributes.style[i]=m.ry(e).getStyle(i)}),Object.hasOwnProperty.call(i,"text")&&(n.attributes.text=y(e)),m.each(["src","href"],function(t){Object.hasOwnProperty.call(o,t)&&(n.attributes[t]=e[t])}),Object.hasOwnProperty.call(o,"target")&&(n.attributes.target=e.getAttribute("target")),n}(e,t));var n=function(e,t){var i=e.originProps||{},n=t.originProps||{},o=i.attributes||{},s=n.attributes||{},r=!0;return i.text&&i.text!==n.text&&(r=!1),o&&m.each(["src","href","target"],function(e){o[e]&&o[e]!==s[e]&&(r=!1)}),r}(t,i);if(n){var o=t.props;m.isObject(o)&&function(e,t,i){if(Object.hasOwnProperty.call(t,"attributes")){var n=t.attributes;Object.hasOwnProperty.call(n,"style")&&function(e,t,i){var n=m.getUA(),o=n.ie&&n.ie<9,s="";m.each(t,function(e,t){var i;o&&e.indexOf("rgba")>-1&&(e=(i=e.match(/[\d.]+/g)).length>=3?"rgb("+i[0]+","+i[1]+","+i[2]+")":"");var n=t.replace(/[A-Z]+/g,function(e){return"-"+e.toLowerCase()});s+=n+": "+e+" !important;"}),""!==s&&(w({attr_value:i=m.encodeSelector(i),text:s="[sensors_ab_ele_style_id="+i+"]{"+s+"}",attr_key:"sensors_ab_ele_style_id"}),e.setAttribute("sensors_ab_ele_style_id",i))}(e,n.style,i.selector),m.each(["href","target","src"],function(t){n[t]&&e.getAttribute(t)!==n[t]&&S(e,t,n[t])})}Object.hasOwnProperty.call(t,"text")&&"innerHtml"!==i.type&&b(e,t.text)}(e,o,t)}return n}function w(e){try{var t=document.createElement("style");t.innerHTML=e.text,t.setAttribute(e.attr_key,e.attr_value),document.getElementsByTagName("head")[0].append(t)}catch(i){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(e,i.stack||i.message)}}function D(e){try{var t=document.createElement("script");t.setAttribute(e.attr_key,e.attr_value),t.innerHTML="try{"+e.text+"}catch(e){ window.sensorsABTestModifyListener && window.sensorsABTestModifyListener("+JSON.stringify(e)+", e.stack || e.message) }",document.body.append(t)}catch(i){window.sensorsABTestModifyListener&&window.sensorsABTestModifyListener(e,i.stack||i.message)}}function N(e){var t=e.getBoundingClientRect(),i=window.innerWidth?{w:window.innerWidth,h:window.innerHeight}:"BackCompat"==document.compatMode?{w:document.body.clientWidth,h:document.body.clientHeigth}:{w:document.documentElement.clientWidth,h:document.documentElement.clientHeight},n=document.documentElement.scrollTop||document.body.scrollTop,o=document.documentElement.scrollLeft||document.body.scrollLeft,s=t.width,r=t.height,a=t.left+i.w/2-s/2+o,l=t.top-i.h/2+r/2+n;window.scrollTo(a,l)}function T(e,t,i){var n=e.tagName.toLowerCase(),o=function(e,t){var i={};return m.each(t||[],function(t){var n=t.replace(/[A-Z]+/g,function(e){return"-"+e.toLowerCase()});i[t]=m.ry(e).getStyle(n)}),i}(e,t),s={selector:v(e),originProps:{attributes:{style:o},text:y(e),hasChildren:e.children.length>0},type:"text",tagName:n};"a"===n&&(s.originProps.attributes.href=e.href,e.getAttribute("target")&&(s.originProps.attributes.target=e.getAttribute("target")),s.type="link"),"img"===n&&(s.originProps.attributes.src=e.src,s.type="img"),e.hasAttribute("sensors_ab_widget")&&(s.type="innerHtml");var r=e.getAttribute("style");if(i)for(var a=0;a-1&&e.parentElement.removeChild(e)}),n&&i&&n.removeAttribute(i)}function P(e){const t=e.hidden||"none"===e.style.display||"hidden"===e.style.visibility,i="0"===window.getComputedStyle(e).getPropertyValue("opacity");return t||i}function k(e){const t=e.split(">");for(;t.length>0;){if(P(document.querySelector(t.join(">"))))return!0;t.length-=1}return!1}function A(e,t,i){var n=null,o=null,s=m.getDomBySelector(e.selector)||document.querySelector&&document.querySelector(e.selector);if(s&&s.hasAttribute("sensors_ab_widget")){!function(e,t){var i=e.selector,n=e.props.text,o="text"===e.props.sensors_ab_widget;const s=document.querySelector(i);if(!s)throw"element not found:"+i;o?s.innerText=n:s.innerHTML=n,M(s,e,t)}(e,t);var r=E(document.querySelector(e.selector));i&&i.setSelectElePostion(r)}else{function a(){return n=function(e,t){var i=m.getDomBySelector(e.base),n=e.props.text,o=e.props.sensors_ab_widget,s=e.operation;if(!i)throw"VABTest: No base element";if(!i.parentNode)throw"base element parentNode not found";var r=document.createElement("font");if("text"===o&&(r.innerText=n),"html"===o&&(r.innerHTML=n),M(r,e,t),"BEFORE_INSERTION"===s)i.parentNode.insertBefore(r,i);else{if("AFTER_INSERTION"!==s)throw"operation not supported";i.nextSibling?i.parentNode.insertBefore(r,i.nextSibling):i.parentNode.appendChild(r)}return v(r)}(e,t)}i?o=i.getModifiedEleSelectorsWhen(a):a()}return{selector:e.selector,addedEleSelector:n,updatedSelectors:o}}function M(e,t,i){if(i&&i.length)for(var n=0;n0||(n.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cparam_name\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e\uff01param_name:",t.param_name),o.verify_success=!1);break;case"value_type":m.isString(t.value_type)&&-1!==m.indexOf(n.value_type_list,t.value_type)||(n.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cvalue_type\u914d\u7f6e\u9519\u8bef",t.value_type),o.verify_success=!1);break;case"default_value":"undefined"==typeof t.default_value?(n.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u53c2\u6570\u672a\u914d\u7f6e"),o.verify_success=!1):n.valueType(t.default_value,t.value_type)||(n.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0cdefault_value\u7c7b\u578b\u5fc5\u987b\u4e0evalue_type\u4e00\u81f4\uff01",t.default_value,t.value_type),o.verify_success=!1);break;case"callback":m.isFunction(t.callback)||(n.SensorsABTest.log(e+"\u65b9\u6cd5\u8c03\u7528\u5931\u8d25\uff0ccallback\u53c2\u6570\u672a\u6b63\u786e\u914d\u7f6e"),o.verify_success=!1);break;default:o.verify_success=!1}else if("not_essential"===i)switch(s){case"timeout_milliseconds":t.timeout_milliseconds=t.timeout_milliseconds||n.SensorsABTest.para.timeout_milliseconds||n.SensorsABTest.default_para.timeout_milliseconds,(!m.isNumber(t.timeout_milliseconds)||m.isNumber(t.timeout_milliseconds)&&t.timeout_milliseconds<=0)&&(n.SensorsABTest.log("timeout_milliseconds \u53c2\u6570\u9519\u8bef",t.timeout_milliseconds),t.timeout_milliseconds=n.SensorsABTest.para.timeout_milliseconds),t.timeout_milliseconds<200&&(t.timeout_milliseconds=200);break;case"properties":t.properties=m.isObject(t.properties)?t.properties:{}}}),o.para=t,o},resolveCustomProperties:function(e){var t=this,i={verify_success:!0,para:null},n=e.custom_properties;if(!m.isObject(n)||m.isEmptyObject(n))return delete e.custom_properties,i.para=e,i;if(m.each(n,function(e,n){if((!m.isString(n)||!t.regName.test(n)||n.length>100)&&(t.SensorsABTest.log(" property name [ "+n+" ] is not invalid "),i.verify_success=!1),(m.isString(e)||m.isNumber(e)||m.isBoolean(e)||m.isArray(e)||m.isDate(e))&&!(m.isString(e)&&e.length>500)||(t.SensorsABTest.log("property [ "+n+" ] of value [ "+JSON.stringify(e)+" ] is not invalid"),i.verify_success=!1),m.isArray(e)){var o=!0;m.each(e,function(e){!1!==o&&(m.isString(e)||(o=!1))}),o||(t.SensorsABTest.log("property value type can be array, but only allow string item. property [ "+n+" ] of value "+JSON.stringify(e)+" is not invalid"),i.verify_success=!1)}}),!0===i.verify_success){var o={};m.each(n,function(e,t){m.isDate(e)?o[t]=m.formatDate(e):m.isString(e)?o[t]=e:o[t]=JSON.stringify(e)}),e.custom_properties=o}return i.para=e,i}},m.VerifyStore=f,m.listenPageState=function(e){({visibleHandle:m.isFunction(e.visible)?e.visible:function(){},hiddenHandler:m.isFunction(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;document.addEventListener(e.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}}).init()},m.listenPageState=function(e){({visibleHandle:m.isFunction(e.visible)?e.visible:function(){},hiddenHandler:m.isFunction(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;document.addEventListener(e.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandle()},1)}else document.addEventListener?(window.addEventListener("focus",this.visibleHandle,1),window.addEventListener("blur",this.hiddenHandler,1)):(document.attachEvent("onfocusin",this.visibleHandle),document.attachEvent("onfocusout",this.hiddenHandler))}}).init()},m.getStorageData=function(e,t){var i=m.localStorage.get(e);m.isString(i)&&(i=t.kit.userDecryptIfNeeded(i));try{i=JSON.parse(i)}catch(n){m.log(n)}return i},m.setStorageData=function(e,t,i){e=JSON.stringify(e),i&&(e=m.userEncrypt(e)),m.localStorage.set(t,e)},g.prototype={createMaskStyle:function(){var e="["+this.attr_name+"],["+this.attr_name+"] body{opacity:0 !important;-khtml-opacity:0 !important;-moz-opacity:0;filter:alpha(opacity=0);}",t=document.createElement("style");t.type="text/css";try{t.appendChild(document.createTextNode(e))}catch(i){t.styleSheet.cssText=e}try{this.style_element=t,document.getElementsByTagName("head")[0].appendChild(t)}catch(i){m.log("error when create calls")}},show:function(e){try{var t=this;if(this.is_abort)return!1;var i=null;if(i=document.getElementsByTagName("html")[0],!m.isElement(i))return;i.setAttribute(this.attr_name,"1"),this.is_added=!0,m.isNumber(e)&&(this.remove_timer=setTimeout(function(){t.is_timeout=!0,t.remove()},e))}catch(n){m.log("error when show calls")}},remove:function(){try{if(this.is_abort||(this.is_abort=!0),this.is_added){this.is_added=!1;var e=null;if(e=document.getElementsByTagName("html")[0],!m.isElement(e))return;e.removeAttribute(this.attr_name),this.style_element&&(document.getElementsByTagName("head")[0].removeChild(this.style_element),this.style_element=null)}this.remove_timer&&(clearTimeout(this.remove_timer),this.remove_timer=null)}catch(t){m.log("error when remove calls")}}},m.Mask=g;class R{constructor(e){this.bridge=e.bridge,this.domEditor=e.domEditor,this.pageContentObserver=null,this.dynamicAddedElements=[];for(let e in a)m.isFunction(this[e])&&this.bridge.on(a[e],this[e].bind(this))}listenPageContentChange(){var e,t;this.pageContentObserver=(e=this.mutationObserver.bind(this),(t=new(0,window.MutationObserver)(e)).observe(document.body,{childList:!0,subtree:!0}),t)}unListenPageContentChange(){var e;(e=this.pageContentObserver)&&e.disconnect(),this.pageContentObserver=null}getElementSnapshot(e,t){t.payload.selector;let i=t.payload.selector,n=this.domEditor.getOriginDataBySelector(i);if(n.ele){let t=n.eleInfo,o=this.domEditor.getServerDataBySelector(i),s=m.extend(o||{isModify:!1},t);e.reply({status:"SUCCESS",element:s})}else e.reply({status:"ERROR",message:"\u672a\u627e\u5230\u8be5\u5143\u7d20"})}updateElementSnapshot(e,t){this.unListenPageContentChange();let i=t.payload;let n={};switch(i.type){case"img":case"link":case"text":let t=this.domEditor.getOriginDataBySelector(i.selector),l=t.ele;if(this.domEditor.updataServerData(i.selector,i),!l)return void e.reply({status:"ERROR",message:"\u8be5\u5143\u7d20\u672a\u5728\u5f53\u524d\u9875\u9762\u51fa\u73b0\uff01",code:"4001"});{O(t),this.domEditor.editEleProps(i,t);let e=E(l);this.domEditor.setSelectElePostion(e)}break;case"globalScript":var o={attr_value:i.id,text:i.props.text,attr_key:"sensors_ab_script_id"};C(o),D(o);break;case"globalStyle":var s={attr_value:i.id,text:i.props.text,attr_key:"sensors_ab_style_id"};C(s),w(s);break;case"innerHtml":try{this.domEditor.updataServerData(i.selector,i);var r=A(i,this.domEditor.config.attributes,this.domEditor);r.addedEleSelector&&this.dynamicAddedElements.push(r.addedEleSelector);let e=this.domEditor.getOriginDataBySelector(i.selector);this.domEditor.editEleProps(i,e);let t=E(document.querySelector(i.selector));this.domEditor.setSelectElePostion(t),n={status:"SUCCESS",element:{selector:r.addedEleSelector},changedItems:r.updatedSelectors||[]}}catch(a){n.status="ERROR",m.logger.log(a)}}e.reply(n),this.listenPageContentChange()}setMode(e,t){let i=t.payload.type,n=!0;this.domEditor.setMode(i),H()||(n=!1,this.domEditor.mode_type="VIEW"),e.reply({status:"SUCCESS",check_url:n})}resetElementSnapshot(e,t){try{let o=this,s=t.payload,r=[];this.domEditor.saveServerData(s),this.domEditor.restoreElements(),m.each(this.dynamicAddedElements,function(e){p(e)}),this.dynamicAddedElements=[];var i=[];m.each(s,function(e){let t=e.type,n=o.domEditor.getOriginDataBySelector(e.selector),s=n.ele;if("innerHtml"===t){var a=A(e,o.domEditor.config.attributes,o.domEditor);a.addedEleSelector&&o.dynamicAddedElements.push(a.addedEleSelector),i=a.updatedSelectors,n=o.domEditor.getOriginDataBySelector(e.selector),o.domEditor.editEleProps(e,n)}else if(s)o.domEditor.editEleProps(e,n);else if("globalScript"===t){var l={attr_value:e.id,text:e.props.text,attr_key:"sensors_ab_script_id"};C(l),D(l)}else if("globalStyle"===t){var d={attr_value:e.id,text:e.props.text,attr_key:"sensors_ab_style_id"};C(d),w(d)}else r.push(e)}),this.domEditor.resetSelectDivPostion(),this.domEditor.resetHoverDivPostion(),e.reply({status:"SUCCESS",no_found_list:r,changedItems:i})}catch(n){e.reply({status:"ERROR",error:n})}}markElement(e,t){let i=t.payload,n=this.domEditor.getOriginDataBySelector(i.selector).ele;if(n){let t=E(n);this.domEditor.setHoverElePostion(t),e.reply({status:"SUCCESS"})}else e.reply({status:"ERROR",message:"\u8be5\u5143\u7d20\u672a\u5728\u5f53\u524d\u9875\u9762\u51fa\u73b0\uff01",code:"4001"})}selectElement(e,t){let i=t.payload,n=this.domEditor.getOriginDataBySelector(i.selector),o=n.ele;if(o){let t=E(o);this.domEditor.setSelectElePostion(t),N(o);let i=n.eleInfo,s=this.domEditor.getServerDataBySelector(i.selector),r=m.extend(s||{isModify:!1},i);e.reply({status:"SUCCESS",element:r})}else e.reply({status:"ERROR",message:"\u8be5\u5143\u7d20\u672a\u5728\u5f53\u524d\u9875\u9762\u51fa\u73b0\uff01",code:"4001"})}addElementSnapshot(e,t){this.updateElementSnapshot(e,t)}deleteElementSnapshot(e,t){var i=this,n="SUCCESS";try{var o=this.domEditor.getModifiedEleSelectorsWhen(function(){let e=t.payload.selector;return!!e&&(p(e),i.dynamicAddedElements=i.dynamicAddedElements.filter(t=>t!==e),!0)})}catch(s){n="ERROR"}e.reply({status:n,changedItems:o})}getHtml(e){let t=document.getElementsByTagName("html")[0].outerHTML;t=t.replace(/class="sa-vabtest-mark"/g,'class="sa-vabtest-mark-hidden"'),e.reply({status:"SUCCESS",visual_dom:t,origin_url:location.href,dom_width:Math.max(document.body.scrollWidth,document.body.offsetWidth,document.documentElement.clientWidth,document.documentElement.scrollWidth,document.documentElement.offsetWidth),dom_height:Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight)})}cancelSelectElement(e){this.domEditor.resetSelectDivPostion(),e.reply({status:"SUCCESS"})}cancelMarkElement(e){this.domEditor.resetHoverDivPostion(),e.reply({status:"SUCCESS"})}checkUrl(e){let t=!0;H()||(t=!1,this.domEditor.mode_type="VIEW"),e.reply({status:t?"SUCCESS":"ERROR"})}searchElement(e,t){var i=[],n="SUCCESS";try{let e=t.payload,s=e.selector,r=e.limit;s=s.split(">").filter(e=>e).join(">");let a=Array.from(document.querySelectorAll(s)).filter(e=>"sa-vabtest-mark"!==e.id).slice(0,r);i=m.map(a,function(e){let t=(e.tagName||"").toLowerCase(),i=v(e);return{selector:i,type:"a"===t?"link":"img"===t?"img":e.hasAttribute("sensors_ab_widget")?"innerHtml":"text",tagName:t,hidden:k(i)}})}catch(o){n="ERROR",m.logger.log("\u641c\u7d22\u5143\u7d20\u5f02\u5e38\uff0c"+o.message)}e.reply({result:i,status:n})}mutationObserver(){let e=this;this.unListenPageContentChange(),m.each(e.domEditor.serverData,function(t){let i=e.domEditor.getOriginDataBySelector(t.selector);i.ele&&(O(i),e.domEditor.editEleProps(t,i))}),this.listenPageContentChange()}}class I{constructor(e){this.bridge=e.bridge,this.domEditor=e.domEditor,this.tagNames=e.tagNames,this.sd=e.sd}init(e){this.config=e,this.addLisenter()}addLisenter(){let e=this.config.action;e.KEY_DOWN&&m.addEvent(document.body,"keydown",this.keydownHandler.bind(this)),e.MOUSE_UP&&m.addEvent(document.body,"mouseup",this.mouseupHandler.bind(this)),e.WHEEL_EVENT&&m.addEvent(document.body,"wheel",this.wheelHandler.bind(this)),m.addEvent(document,"mousemove",this.moveHandler.bind(this)),m.addEvent(document,"click",this.clickHandler.bind(this),!0),this.sd.ee.spa.on("switch",this.singlePage.bind(this)),this.addInsertionErrorListener()}addInsertionErrorListener(){var e=this;window.sensorsABTestModifyListener=function(t,i){var n={type:t.type,id:t.id,isSuccess:!i};i&&(n.errorMessage=i),e.bridge.emit(a.insertionInfo,n)}}elementFilter(e){if(e){let t=e.tagName.toLowerCase();if(this.tagNames.indexOf(t)>-1){let i=this.domEditor.getAddedHtmlRoot(e);return i||("a"===t||"img"===t||"button"===t?e:this.domEditor.getOriginDataByElement(e).eleInfo.originProps.text?e:null)}}return null}getMouseElement(e){let t=null;return m.each(e,function(e){!t&&m.isString(e.className)&&-1===e.className.indexOf("sa-vabtest-mark")&&(t=e)}),t}moveHandler(e){try{let i=this.config.action;if(i.MOUSE_MOVE&&i.MOUSE_MOVE&&i.MOUSE_MOVE.eventValues&&m.isArray(i.MOUSE_MOVE.eventValues)){let t={};m.each(i.MOUSE_MOVE.eventValues,function(i){t[i]=e[i]}),this.bridge.emit(a.mousemoveEvent,t)}if("EDIT"!==this.domEditor.mode_type)return;let n=document.elementsFromPoint(e.clientX,e.clientY),o=this.getMouseElement(n),s=this.elementFilter(o);if(s){let e=E(s);this.domEditor.setHoverElePostion(e)}else this.domEditor.resetHoverDivPostion()}catch(t){}}clickHandler(e){if("EDIT"!==this.domEditor.mode_type)return;e.stopPropagation(),e.preventDefault();let t=document.elementsFromPoint(e.clientX,e.clientY),i=this.getMouseElement(t),n=this.elementFilter(i);if(n){let e=this.domEditor.getOriginDataByElement(n).eleInfo,t=e.selector,i=this.domEditor.getServerDataBySelector(t),o=m.extend(i||{isModify:!1},e),s=E(n);this.domEditor.setSelectElePostion(s),this.bridge.emit(a.selectElement,o)}else this.domEditor.resetSelectDivPostion(),this.bridge.emit(a.cancelSelectElement,{status:!0})}keydownHandler(e){try{let i={},n=this.config.action,o=(e.ctrlKey||e.metaKey?"cmd+":"")+e.key;"cmd+-"!==o&&"cmd+="!==o&&"Escape"!==o||(!0===n.KEY_DOWN.preventDefault&&e.preventDefault(),n.KEY_DOWN.eventValues&&m.isArray(n.KEY_DOWN.eventValues)&&m.each(n.KEY_DOWN.eventValues,function(t){i[t]=e[t]}),this.bridge.emit(a.keydownEvent,i))}catch(t){}}mouseupHandler(e){try{let i={},n=this.config.action;n.MOUSE_UP&&(!0===n.MOUSE_UP.preventDefault&&e.preventDefault(),n.MOUSE_UP.eventValues&&m.isArray(n.MOUSE_UP.eventValues)&&m.each(n.MOUSE_UP.eventValues,function(t){i[t]=e[t]}),this.bridge.emit(a.mouseupEvent,i))}catch(t){}}wheelHandler(e){try{let t={},i=this.config.action;i.WHEEL_EVENT&&(!0===i.WHEEL_EVENT.preventDefault&&e.preventDefault(),i.WHEEL_EVENT.eventValues&&m.isArray(i.WHEEL_EVENT.eventValues)&&m.each(i.WHEEL_EVENT.eventValues,function(i){t[i]=e[i]}),this.bridge.emit(a.wheelEvent,t))}catch(e){}}singlePage(e){if(e===location.href)return!1;let t=!0;H()||(t=!1,this.domEditor.mode_type="VIEW"),this.bridge.emit(a.checkUrl,{status:t?"SUCCESS":"ERROR"})}}class L{constructor(e){this.config=e.config,this.hoverDiv=null,this.selectDiv=null,this.maskDiv=null,this.mode_type="EDIT",this.serverData=[],this.originData=[],this.buildMarkDom()}setDomPostion(e,t){m.each(["width","height","left","top"],function(i){e.style[i]=t[i]+"px"}),e.style.zIndex=t.zIndex&&"auto"!==t.zIndex?Number(t.zIndex)+10:5e3}setHoverElePostion(e){this.selectDiv&&this.hoverDiv&&document.getElementById("sa-vabtest-mark")||this.buildMarkDom(),this.setDomPostion(this.hoverDiv,e)}setSelectElePostion(e){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.selectDiv,e)}restoreElements(){m.each(this.originData,function(e){O(e)}),this.originData=[],C({attr_key:"sensors_ab_style_id"}),C({attr_key:"sensors_ab_script_id"})}editEleProps(e,t){let i=t.eleInfo;_(t.ele,e,i)}setMode(e){this.mode_type=e,"VIEW"===e&&(p(this.maskDiv),this.hoverDiv=null,this.selectDiv=null,this.maskDiv=null)}resetMarkDom(e){e&&this.setDomPostion(e,{width:0,height:0,top:0,left:0})}resetSelectDivPostion(){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.selectDiv,{width:0,height:0,top:0,left:0})}resetHoverDivPostion(){this.selectDiv&&this.hoverDiv||this.buildMarkDom(),this.setDomPostion(this.hoverDiv,{width:0,height:0,top:0,left:0})}buildMarkDom(){var e=document.createElement("div"),t=document.createElement("div"),i=document.createElement("div"),n=document.createElement("style");e.className="sa-vabtest-mark",e.id="sa-vabtest-mark",t.className="sa-vabtest-hover",i.className="sa-vabtest-clickable";var o=e.attachShadow({mode:"open"});n.innerText=".sa-vabtest-clickable { background: rgba(49, 112, 235, 0.15) !important; outline: 2px solid #3170EB !important; outline-offset: -2px !important; width: 0;height: 0;position: absolute; top: 0; left: 0;}.sa-vabtest-hover { outline: 2px solid #3170EB !important; outline-offset: -2px !important; width: 0;height: 0;position: absolute; top: 0; left: 0;}",o.appendChild(n),o.appendChild(t),o.appendChild(i),document.body.appendChild(e),m.setCssStyle(".sa-vabtest-mark { pointer-events: none;}.sa-vabtest-mark-hidden { display: none;}"),this.hoverDiv=t,this.selectDiv=i,this.maskDiv=e}saveServerData(e){this.serverData=e}updataServerData(e,t){let i=!1,n=this;m.each(this.serverData,function(o,s){o.selector===e&&(n.serverData[s]=t,i=!0)}),i||this.serverData.push(t)}getServerDataBySelector(e){let t=null;return m.each(this.serverData,function(i){i.selector===e&&(t=i)}),t}setOriginData(e,t){let i=!1,n=this;m.each(this.originData,function(t,o){e===t.selector&&(n.originData[o]=t,i=!0)}),i||this.originData.push(t)}getOriginDataBySelector(e){let t=null;if(m.each(this.originData,function(i){e===i.eleInfo.selector&&(t=i)}),!t){let i=m.getDomBySelector(e);i?(t=T(i,this.config.styles,this.config.attributes),this.setOriginData(t.eleInfo.selector,t)):t={}}return t}getOriginDataByElement(e){let t=null;return m.each(this.originData,function(i){e===i.ele&&(t=i)}),t||(t=T(e,this.config.styles,this.config.attributes)),t}getModifiedEleSelectorsWhen(e){var t=[],i=[];if(m.each(this.serverData,function(e){let t=document.querySelector(e.selector);i.push([t,e])}),m.each(this.originData,function(e){let t=document.querySelector(e.eleInfo.selector);i.push([t,e.eleInfo])}),e&&e()){var n=new Map;m.each(i,function(e){var i=e[0],o=e[1],s=o.selector,r=v(i);r&&r!==s&&(o.selector=r,n.has(s)||(n.set(s,1),t.push({selectorFrom:s,selectorTo:r})))})}return t}getAddedHtmlRoot(e){const t=v(e).split(">");for(;t.length>0;){const e=document.querySelector(t.join(">"));if(e.hasAttribute("sensors_ab_widget"))return e;t.length-=1}return!1}}class x{constructor(){this.plugin_name="VABTest",this.plugin_version="1.26.9",this.abTestingSDK=null,this.bridge=new h({source:"sa-web-abtesting-sdk",frameSource:"sa-fe-abtesting-mode",version:"abtest_version"})}init(e,t){this.abTestingSDK=t.SensorsABTest;let i=this;if(e&&this.abTestingSDK){!function(e){e._.extend(m,e._)}(e),this.bridge.emit(a.connect,{status:!0,lib_version:2}).then(function(t){if("SUCCESS"===t.status){let n=t.payload.support;i.domEditor=new L({config:n}),i.sender=new I({bridge:i.bridge,domEditor:i.domEditor,tagNames:n.tagNames,sd:e}),new R({bridge:i.bridge,domEditor:i.domEditor}),i.sender.init(n)}else m.log("ABTesting SDK \u53ef\u89c6\u5316\u7f16\u8f91\u72b6\u6001\u521d\u59cb\u5316\u5931\u8d25")})}else m.log("ABTesting SDK \u53ef\u89c6\u5316\u7f16\u8f91\u72b6\u6001\u521d\u59cb\u5316\u5931\u8d25")}}let B=new x;B.__constructor__=x,window.SensorsDataWebJSSDKPlugin&&"[object Object]"===Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.VABTest=window.SensorsDataWebJSSDKPlugin.VABTest||B:window.SensorsDataWebJSSDKPlugin={VABTest:B}}); \ No newline at end of file diff --git a/dist/web/plugin/aes-encryption/index.closure.js b/dist/web/plugin/aes-encryption/index.closure.js index 4bc0ddf4..08a6868d 100644 --- a/dist/web/plugin/aes-encryption/index.closure.js +++ b/dist/web/plugin/aes-encryption/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function t(t,r,n){if(r&&(t.plugin_name=r),n&&t.init){var i=t.init;t.init=function(o,c){function a(){i.call(t,o,c)}return e(o,t,r),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(n,a)}}return t}function e(t,e,r){function n(e,n){t.logger?t.logger.msg.apply(t.logger,n).module(r+""||"").level(e).log():t.log&&t.log.apply(t,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function r(e,r,n){return t(e,r,n),e.plugin_version=l,e}function n(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)}function i(){if("function"==typeof Uint32Array){var t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),n(t)&&t.getRandomValues){var e=new Uint32Array(1),r=t.getRandomValues(e)[0],i=Math.pow(2,32);return r/i}}return m(1e19)/1e19}function o(t){return{mode:S.mode.CBC,padding:S.pad.Pkcs7,iv:t||s()}}function c(t,e,r,n){var i=o(r),c=t;"string"!=typeof t&&(c=JSON.stringify(t)),n||(e=S.enc.Base64.parse(e));var a=S.enc.Utf8.parse(c),s=S.AES.encrypt(a,e,i).toString(),u=i.iv.clone().concat(S.enc.Base64.parse(s)).toString(S.enc.Base64);return u}function a(t,e,r){var n=S.enc.Base64.parse(t).toString(),i=n.substr(0,32),c=S.enc.Hex.parse(n.substr(32)).toString(S.enc.Base64),a=o(S.enc.Hex.parse(i));r||(e=S.enc.Base64.parse(e));var s=S.AES.decrypt(c,e,a);return s.toString(S.enc.Utf8)}function s(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(127*i()).toString(16);e+=2===r.length?r:"0"+r}return S.enc.Hex.parse(e)}function u(t){var e=c(t,_.k,v);return{key_id:_.kid,key_hash:_.khash,nc:1,payload:e}}function f(t){try{var e=u(t),r=JSON.stringify(e),n="crc="+g._.hashCode(r);return"data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(i){return B("\u6570\u636e\u52a0\u5bc6\u53d1\u9001\u5f02\u5e38\u3002"),k.call(g.kit,t)}}function h(t,e){return!!t||(B(e+"\u4e0d\u80fd\u4e3a\u7a7a\u3002"),!1)}function d(t,e,r){return typeof t===r||(B("\u53c2\u6570\u7c7b\u578b\u9519\u8bef,"+e+"\u5fc5\u987b\u4e3a"+r),!1)}function p(t,e,r,n){try{var i=r||_&&_.k;return h(i,"\u53c2\u6570key")&&d(i,"\u53c2\u6570key","string")?(void 0===n&&(n=void 0!==r),t?c(e,i,null,n):a(e,i,n)):e}catch(o){return B("\u6267\u884c\u52a0\u89e3\u5bc6\u5931\u8d25\uff0c\u8fd4\u56de\u539f\u59cb\u6570\u636e\u3002"),e}}var l="1.26.8",y={};!function(t,e){t.CryptoJS=e()}(y,function(){var t=t||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(n){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),c={},a=c.lib={},s=a.Base=function(){return{extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=a.WordArray=s.extend({init:function(t,r){t=this.words=t||[],r!=e?this.sigBytes=r:this.sigBytes=4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=c<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new u.init(r,e/2)}},d=f.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new u.init(r,e)}},p=f.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},l=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,c=this.blockSize,a=4*c,s=o/a;s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0);var f=s*c,h=t.min(4*f,o);if(f){for(var d=0;d>>32-o)+e}function n(t,e,r,n,i,o,c){var a=t+(e&n|r&~n)+i+c;return(a<>>32-o)+e}function i(t,e,r,n,i,o,c){var a=t+(e^r^n)+i+c;return(a<>>32-o)+e}function o(t,e,r,n,i,o,c){var a=t+(r^(e|~n))+i+c;return(a<>>32-o)+e}var c=t,a=c.lib,s=a.WordArray,u=a.Hasher,f=c.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var d=f.MD5=u.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var c=0;c<16;c++){var a=e+c,s=t[a];t[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var u=this._hash.words,f=t[e+0],d=t[e+1],p=t[e+2],l=t[e+3],y=t[e+4],v=t[e+5],g=t[e+6],_=t[e+7],k=t[e+8],m=t[e+9],S=t[e+10],B=t[e+11],w=t[e+12],x=t[e+13],C=t[e+14],z=t[e+15],E=u[0],b=u[1],D=u[2],M=u[3];E=r(E,b,D,M,f,7,h[0]),M=r(M,E,b,D,d,12,h[1]),D=r(D,M,E,b,p,17,h[2]),b=r(b,D,M,E,l,22,h[3]),E=r(E,b,D,M,y,7,h[4]),M=r(M,E,b,D,v,12,h[5]),D=r(D,M,E,b,g,17,h[6]),b=r(b,D,M,E,_,22,h[7]),E=r(E,b,D,M,k,7,h[8]),M=r(M,E,b,D,m,12,h[9]),D=r(D,M,E,b,S,17,h[10]),b=r(b,D,M,E,B,22,h[11]),E=r(E,b,D,M,w,7,h[12]),M=r(M,E,b,D,x,12,h[13]),D=r(D,M,E,b,C,17,h[14]),b=r(b,D,M,E,z,22,h[15]),E=n(E,b,D,M,d,5,h[16]),M=n(M,E,b,D,g,9,h[17]),D=n(D,M,E,b,B,14,h[18]),b=n(b,D,M,E,f,20,h[19]),E=n(E,b,D,M,v,5,h[20]),M=n(M,E,b,D,S,9,h[21]),D=n(D,M,E,b,z,14,h[22]),b=n(b,D,M,E,y,20,h[23]),E=n(E,b,D,M,m,5,h[24]),M=n(M,E,b,D,C,9,h[25]),D=n(D,M,E,b,l,14,h[26]),b=n(b,D,M,E,k,20,h[27]),E=n(E,b,D,M,x,5,h[28]),M=n(M,E,b,D,p,9,h[29]),D=n(D,M,E,b,_,14,h[30]),b=n(b,D,M,E,w,20,h[31]),E=i(E,b,D,M,v,4,h[32]),M=i(M,E,b,D,k,11,h[33]),D=i(D,M,E,b,B,16,h[34]),b=i(b,D,M,E,C,23,h[35]),E=i(E,b,D,M,d,4,h[36]),M=i(M,E,b,D,y,11,h[37]),D=i(D,M,E,b,_,16,h[38]),b=i(b,D,M,E,S,23,h[39]),E=i(E,b,D,M,x,4,h[40]),M=i(M,E,b,D,f,11,h[41]),D=i(D,M,E,b,l,16,h[42]),b=i(b,D,M,E,g,23,h[43]),E=i(E,b,D,M,m,4,h[44]),M=i(M,E,b,D,w,11,h[45]),D=i(D,M,E,b,z,16,h[46]),b=i(b,D,M,E,p,23,h[47]),E=o(E,b,D,M,f,6,h[48]),M=o(M,E,b,D,_,10,h[49]),D=o(D,M,E,b,C,15,h[50]),b=o(b,D,M,E,v,21,h[51]),E=o(E,b,D,M,w,6,h[52]),M=o(M,E,b,D,l,10,h[53]),D=o(D,M,E,b,S,15,h[54]),b=o(b,D,M,E,d,21,h[55]),E=o(E,b,D,M,k,6,h[56]),M=o(M,E,b,D,z,10,h[57]),D=o(D,M,E,b,g,15,h[58]),b=o(b,D,M,E,x,21,h[59]),E=o(E,b,D,M,y,6,h[60]),M=o(M,E,b,D,B,10,h[61]),D=o(D,M,E,b,p,15,h[62]),b=o(b,D,M,E,m,21,h[63]),u[0]=u[0]+E|0,u[1]=u[1]+b|0,u[2]=u[2]+D|0,u[3]=u[3]+M|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),c=n;r[(i+64>>>9<<4)+15]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[(i+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u++){var f=s[u];s[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});c.MD5=u._createHelper(d),c.HmacMD5=u._createHmacHelper(d)}(Math),t.MD5}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.Base,i=r.WordArray,o=e.algo,c=o.MD5,a=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,o=n.hasher.create(),c=i.create(),a=c.words,s=n.keySize,u=n.iterations;a.length>>6-c%4*2,u=a|s;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}var r=t,n=r.lib,i=n.WordArray,o=r.enc;o.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255,a=e[o+1>>>2]>>>24-(o+1)%4*8&255,s=e[o+2>>>2]>>>24-(o+2)%4*8&255,u=c<<16|a<<8|s,f=0;f<4&&o+.75*f>>6*(3-f)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(t){var r=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>2];t.sigBytes-=e}},g=(n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:l,padding:v}),reset:function(){var t;h.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),n.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),_=r.format={},k=_.OpenSSL={stringify:function(t){var e,r=t.ciphertext,n=t.salt;return e=n?o.create([1398893684,1701076831]).concat(n).concat(r):r,e.toString(s)},parse:function(t){var e,r=s.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),g.create({ciphertext:r,salt:e})}},m=n.SerializableCipher=i.extend({cfg:i.extend({format:k}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),c=i.cfg;return g.create({ciphertext:o,key:r,iv:c.iv,algorithm:t,mode:c.mode,padding:c.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),S=r.kdf={},B=S.OpenSSL={execute:function(t,e,r,n){n||(n=o.random(8));var i=f.create({keySize:e+r}).compute(t,n),c=o.create(i.words.slice(e),4*r);return i.sigBytes=4*e,g.create({key:i,iv:c,salt:n})}},w=n.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:B}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=m.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=m.decrypt.call(this,t,e,i.key,n);return o}})}()}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.BlockCipher,i=e.algo,o=[],c=[],a=[],s=[],u=[],f=[],h=[],d=[],p=[],l=[];!function(){for(var t=[],e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var r=0,n=0,e=0;e<256;e++){var i=n^n<<1^n<<2^n<<3^n<<4;i=i>>>8^255&i^99,o[r]=i,c[i]=r;var y=t[r],v=t[y],g=t[v],_=257*t[i]^16843008*i;a[r]=_<<24|_>>>8,s[r]=_<<16|_>>>16,u[r]=_<<8|_>>>24,f[r]=_;var _=16843009*g^65537*v^257*y^16843008*r;h[i]=_<<24|_>>>8,d[i]=_<<16|_>>>16,p[i]=_<<8|_>>>24,l[i]=_,r?(r=y^t[t[t[g^y]]],n^=t[t[n]]):r=n=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],v=i.AES=n.extend({_doReset:function(){var t;if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,r=e.words,n=e.sigBytes/4,i=this._nRounds=n+6,c=4*(i+1),a=this._keySchedule=[],s=0;s6&&s%n==4&&(t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t]):(t=t<<8|t>>>24,t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t],t^=y[s/n|0]<<24),a[s]=a[s-n]^t);for(var u=this._invKeySchedule=[],f=0;f>>24]]^d[o[t>>>16&255]]^p[o[t>>>8&255]]^l[o[255&t]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,u,f,o)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,d,p,l,c);var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,c,a){for(var s=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],h=t[e+2]^r[2],d=t[e+3]^r[3],p=4,l=1;l>>24]^i[f>>>16&255]^o[h>>>8&255]^c[255&d]^r[p++],v=n[f>>>24]^i[h>>>16&255]^o[d>>>8&255]^c[255&u]^r[p++],g=n[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^c[255&f]^r[p++],_=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^c[255&h]^r[p++];u=y,f=v,h=g,d=_}var y=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^r[p++],v=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[p++],g=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[p++],_=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^r[p++];t[e]=y,t[e+1]=v,t[e+2]=g,t[e+3]=_},keySize:8});e.AES=n._createHelper(v)}(),t.AES});var v,g,_,k,m=function(){function t(){return r=(9301*r+49297)%233280,r/233280}var e=new Date,r=e.getTime();return function(e){return Math.ceil(t()*e)}}(),S=y.CryptoJS,B=window.console&&window.console.log||function(){},w={init:function(t,e){return g=t,B=g&&g.log||B,t&&t.kit&&t.kit.encodeTrackData?void(h(e,"\u521d\u59cb\u914d\u7f6econfig")&&h(e.k,"\u521d\u59cb\u53c2\u6570k")&&h(e.kid,"\u521d\u59cb\u53c2\u6570kid")&&h(e.khash,"\u521d\u59cb\u53c2\u6570khash")&&d(e.k,"\u521d\u59cb\u53c2\u6570k","string")&&d(e.khash,"\u521d\u59cb\u53c2\u6570khash","string")&&d(e.kid,"\u521d\u59cb\u53c2\u6570kid","number")?(_=e,v=s(),k=g.kit.encodeTrackData,g.kit.encodeTrackData=f,B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25")):void B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301AES\u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")},encrypt:function(t,e,r){return p(!0,t,e,r)},decrypt:function(t,e,r){return p(!1,t,e,r)}},x=r(w,"AesEncryption","sdkReady");return x}(); \ No newline at end of file +!function(){"use strict";function t(t,r,n){if(r&&(t.plugin_name=r),n&&t.init){var i=t.init;t.init=function(o,c){function a(){i.call(t,o,c)}return e(o,t,r),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(n,a)}}return t}function e(t,e,r){function n(e,n){t.logger?t.logger.msg.apply(t.logger,n).module(r+""||"").level(e).log():t.log&&t.log.apply(t,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function r(e,r,n){return t(e,r,n),e.plugin_version=l,e}function n(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)}function i(){if("function"==typeof Uint32Array){var t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),n(t)&&t.getRandomValues){var e=new Uint32Array(1),r=t.getRandomValues(e)[0],i=Math.pow(2,32);return r/i}}return m(1e19)/1e19}function o(t){return{mode:S.mode.CBC,padding:S.pad.Pkcs7,iv:t||s()}}function c(t,e,r,n){var i=o(r),c=t;"string"!=typeof t&&(c=JSON.stringify(t)),n||(e=S.enc.Base64.parse(e));var a=S.enc.Utf8.parse(c),s=S.AES.encrypt(a,e,i).toString(),u=i.iv.clone().concat(S.enc.Base64.parse(s)).toString(S.enc.Base64);return u}function a(t,e,r){var n=S.enc.Base64.parse(t).toString(),i=n.substr(0,32),c=S.enc.Hex.parse(n.substr(32)).toString(S.enc.Base64),a=o(S.enc.Hex.parse(i));r||(e=S.enc.Base64.parse(e));var s=S.AES.decrypt(c,e,a);return s.toString(S.enc.Utf8)}function s(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(127*i()).toString(16);e+=2===r.length?r:"0"+r}return S.enc.Hex.parse(e)}function u(t){var e=c(t,_.k,v);return{key_id:_.kid,key_hash:_.khash,nc:1,payload:e}}function f(t){try{var e=u(t),r=JSON.stringify(e),n="crc="+g._.hashCode(r);return"data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(i){return B("\u6570\u636e\u52a0\u5bc6\u53d1\u9001\u5f02\u5e38\u3002"),k.call(g.kit,t)}}function h(t,e){return!!t||(B(e+"\u4e0d\u80fd\u4e3a\u7a7a\u3002"),!1)}function d(t,e,r){return typeof t===r||(B("\u53c2\u6570\u7c7b\u578b\u9519\u8bef,"+e+"\u5fc5\u987b\u4e3a"+r),!1)}function p(t,e,r,n){try{var i=r||_&&_.k;return h(i,"\u53c2\u6570key")&&d(i,"\u53c2\u6570key","string")?(void 0===n&&(n=void 0!==r),t?c(e,i,null,n):a(e,i,n)):e}catch(o){return B("\u6267\u884c\u52a0\u89e3\u5bc6\u5931\u8d25\uff0c\u8fd4\u56de\u539f\u59cb\u6570\u636e\u3002"),e}}var l="1.26.9",y={};!function(t,e){t.CryptoJS=e()}(y,function(){var t=t||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(n){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),c={},a=c.lib={},s=a.Base=function(){return{extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=a.WordArray=s.extend({init:function(t,r){t=this.words=t||[],r!=e?this.sigBytes=r:this.sigBytes=4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=c<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new u.init(r,e/2)}},d=f.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new u.init(r,e)}},p=f.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},l=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,c=this.blockSize,a=4*c,s=o/a;s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0);var f=s*c,h=t.min(4*f,o);if(f){for(var d=0;d>>32-o)+e}function n(t,e,r,n,i,o,c){var a=t+(e&n|r&~n)+i+c;return(a<>>32-o)+e}function i(t,e,r,n,i,o,c){var a=t+(e^r^n)+i+c;return(a<>>32-o)+e}function o(t,e,r,n,i,o,c){var a=t+(r^(e|~n))+i+c;return(a<>>32-o)+e}var c=t,a=c.lib,s=a.WordArray,u=a.Hasher,f=c.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var d=f.MD5=u.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var c=0;c<16;c++){var a=e+c,s=t[a];t[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var u=this._hash.words,f=t[e+0],d=t[e+1],p=t[e+2],l=t[e+3],y=t[e+4],v=t[e+5],g=t[e+6],_=t[e+7],k=t[e+8],m=t[e+9],S=t[e+10],B=t[e+11],w=t[e+12],x=t[e+13],C=t[e+14],z=t[e+15],E=u[0],b=u[1],D=u[2],M=u[3];E=r(E,b,D,M,f,7,h[0]),M=r(M,E,b,D,d,12,h[1]),D=r(D,M,E,b,p,17,h[2]),b=r(b,D,M,E,l,22,h[3]),E=r(E,b,D,M,y,7,h[4]),M=r(M,E,b,D,v,12,h[5]),D=r(D,M,E,b,g,17,h[6]),b=r(b,D,M,E,_,22,h[7]),E=r(E,b,D,M,k,7,h[8]),M=r(M,E,b,D,m,12,h[9]),D=r(D,M,E,b,S,17,h[10]),b=r(b,D,M,E,B,22,h[11]),E=r(E,b,D,M,w,7,h[12]),M=r(M,E,b,D,x,12,h[13]),D=r(D,M,E,b,C,17,h[14]),b=r(b,D,M,E,z,22,h[15]),E=n(E,b,D,M,d,5,h[16]),M=n(M,E,b,D,g,9,h[17]),D=n(D,M,E,b,B,14,h[18]),b=n(b,D,M,E,f,20,h[19]),E=n(E,b,D,M,v,5,h[20]),M=n(M,E,b,D,S,9,h[21]),D=n(D,M,E,b,z,14,h[22]),b=n(b,D,M,E,y,20,h[23]),E=n(E,b,D,M,m,5,h[24]),M=n(M,E,b,D,C,9,h[25]),D=n(D,M,E,b,l,14,h[26]),b=n(b,D,M,E,k,20,h[27]),E=n(E,b,D,M,x,5,h[28]),M=n(M,E,b,D,p,9,h[29]),D=n(D,M,E,b,_,14,h[30]),b=n(b,D,M,E,w,20,h[31]),E=i(E,b,D,M,v,4,h[32]),M=i(M,E,b,D,k,11,h[33]),D=i(D,M,E,b,B,16,h[34]),b=i(b,D,M,E,C,23,h[35]),E=i(E,b,D,M,d,4,h[36]),M=i(M,E,b,D,y,11,h[37]),D=i(D,M,E,b,_,16,h[38]),b=i(b,D,M,E,S,23,h[39]),E=i(E,b,D,M,x,4,h[40]),M=i(M,E,b,D,f,11,h[41]),D=i(D,M,E,b,l,16,h[42]),b=i(b,D,M,E,g,23,h[43]),E=i(E,b,D,M,m,4,h[44]),M=i(M,E,b,D,w,11,h[45]),D=i(D,M,E,b,z,16,h[46]),b=i(b,D,M,E,p,23,h[47]),E=o(E,b,D,M,f,6,h[48]),M=o(M,E,b,D,_,10,h[49]),D=o(D,M,E,b,C,15,h[50]),b=o(b,D,M,E,v,21,h[51]),E=o(E,b,D,M,w,6,h[52]),M=o(M,E,b,D,l,10,h[53]),D=o(D,M,E,b,S,15,h[54]),b=o(b,D,M,E,d,21,h[55]),E=o(E,b,D,M,k,6,h[56]),M=o(M,E,b,D,z,10,h[57]),D=o(D,M,E,b,g,15,h[58]),b=o(b,D,M,E,x,21,h[59]),E=o(E,b,D,M,y,6,h[60]),M=o(M,E,b,D,B,10,h[61]),D=o(D,M,E,b,p,15,h[62]),b=o(b,D,M,E,m,21,h[63]),u[0]=u[0]+E|0,u[1]=u[1]+b|0,u[2]=u[2]+D|0,u[3]=u[3]+M|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),c=n;r[(i+64>>>9<<4)+15]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[(i+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u++){var f=s[u];s[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});c.MD5=u._createHelper(d),c.HmacMD5=u._createHmacHelper(d)}(Math),t.MD5}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.Base,i=r.WordArray,o=e.algo,c=o.MD5,a=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,o=n.hasher.create(),c=i.create(),a=c.words,s=n.keySize,u=n.iterations;a.length>>6-c%4*2,u=a|s;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}var r=t,n=r.lib,i=n.WordArray,o=r.enc;o.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255,a=e[o+1>>>2]>>>24-(o+1)%4*8&255,s=e[o+2>>>2]>>>24-(o+2)%4*8&255,u=c<<16|a<<8|s,f=0;f<4&&o+.75*f>>6*(3-f)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(t){var r=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>2];t.sigBytes-=e}},g=(n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:l,padding:v}),reset:function(){var t;h.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),n.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),_=r.format={},k=_.OpenSSL={stringify:function(t){var e,r=t.ciphertext,n=t.salt;return e=n?o.create([1398893684,1701076831]).concat(n).concat(r):r,e.toString(s)},parse:function(t){var e,r=s.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),g.create({ciphertext:r,salt:e})}},m=n.SerializableCipher=i.extend({cfg:i.extend({format:k}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),c=i.cfg;return g.create({ciphertext:o,key:r,iv:c.iv,algorithm:t,mode:c.mode,padding:c.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),S=r.kdf={},B=S.OpenSSL={execute:function(t,e,r,n){n||(n=o.random(8));var i=f.create({keySize:e+r}).compute(t,n),c=o.create(i.words.slice(e),4*r);return i.sigBytes=4*e,g.create({key:i,iv:c,salt:n})}},w=n.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:B}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=m.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=m.decrypt.call(this,t,e,i.key,n);return o}})}()}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.BlockCipher,i=e.algo,o=[],c=[],a=[],s=[],u=[],f=[],h=[],d=[],p=[],l=[];!function(){for(var t=[],e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var r=0,n=0,e=0;e<256;e++){var i=n^n<<1^n<<2^n<<3^n<<4;i=i>>>8^255&i^99,o[r]=i,c[i]=r;var y=t[r],v=t[y],g=t[v],_=257*t[i]^16843008*i;a[r]=_<<24|_>>>8,s[r]=_<<16|_>>>16,u[r]=_<<8|_>>>24,f[r]=_;var _=16843009*g^65537*v^257*y^16843008*r;h[i]=_<<24|_>>>8,d[i]=_<<16|_>>>16,p[i]=_<<8|_>>>24,l[i]=_,r?(r=y^t[t[t[g^y]]],n^=t[t[n]]):r=n=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],v=i.AES=n.extend({_doReset:function(){var t;if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,r=e.words,n=e.sigBytes/4,i=this._nRounds=n+6,c=4*(i+1),a=this._keySchedule=[],s=0;s6&&s%n==4&&(t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t]):(t=t<<8|t>>>24,t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t],t^=y[s/n|0]<<24),a[s]=a[s-n]^t);for(var u=this._invKeySchedule=[],f=0;f>>24]]^d[o[t>>>16&255]]^p[o[t>>>8&255]]^l[o[255&t]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,u,f,o)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,d,p,l,c);var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,c,a){for(var s=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],h=t[e+2]^r[2],d=t[e+3]^r[3],p=4,l=1;l>>24]^i[f>>>16&255]^o[h>>>8&255]^c[255&d]^r[p++],v=n[f>>>24]^i[h>>>16&255]^o[d>>>8&255]^c[255&u]^r[p++],g=n[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^c[255&f]^r[p++],_=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^c[255&h]^r[p++];u=y,f=v,h=g,d=_}var y=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^r[p++],v=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[p++],g=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[p++],_=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^r[p++];t[e]=y,t[e+1]=v,t[e+2]=g,t[e+3]=_},keySize:8});e.AES=n._createHelper(v)}(),t.AES});var v,g,_,k,m=function(){function t(){return r=(9301*r+49297)%233280,r/233280}var e=new Date,r=e.getTime();return function(e){return Math.ceil(t()*e)}}(),S=y.CryptoJS,B=window.console&&window.console.log||function(){},w={init:function(t,e){return g=t,B=g&&g.log||B,t&&t.kit&&t.kit.encodeTrackData?void(h(e,"\u521d\u59cb\u914d\u7f6econfig")&&h(e.k,"\u521d\u59cb\u53c2\u6570k")&&h(e.kid,"\u521d\u59cb\u53c2\u6570kid")&&h(e.khash,"\u521d\u59cb\u53c2\u6570khash")&&d(e.k,"\u521d\u59cb\u53c2\u6570k","string")&&d(e.khash,"\u521d\u59cb\u53c2\u6570khash","string")&&d(e.kid,"\u521d\u59cb\u53c2\u6570kid","number")?(_=e,v=s(),k=g.kit.encodeTrackData,g.kit.encodeTrackData=f,B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25")):void B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301AES\u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")},encrypt:function(t,e,r){return p(!0,t,e,r)},decrypt:function(t,e,r){return p(!1,t,e,r)}},x=r(w,"AesEncryption","sdkReady");return x}(); \ No newline at end of file diff --git a/dist/web/plugin/aes-encryption/index.es6.js b/dist/web/plugin/aes-encryption/index.es6.js index 9a7df7ce..773bf699 100644 --- a/dist/web/plugin/aes-encryption/index.es6.js +++ b/dist/web/plugin/aes-encryption/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.26.8";function wrapPluginInitFn(t,e,r){if(e&&(t.plugin_name=e),r&&t.init){var n=t.init;t.init=function(i,o){if(wrapLogFn(i,t,e),i.readyState&&i.readyState.state>=3||!i.on)return c();function c(){n.call(t,i,o)}i.on(r,c)}}return t}function wrapLogFn(t,e,r){function n(e,n){t.logger?t.logger.msg.apply(t.logger,n).module(r+""||"").level(e).log():t.log&&t.log.apply(t,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function createPlugin(t,e,r){return wrapPluginInitFn(t,e,r),t.plugin_version=sdkversion_placeholder,t}var root={};function isObject(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)}!function(t,e){var r;t.CryptoJS=r=r||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(y){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(y){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(y){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),o={},c=o.lib={},a=c.Base={extend:function(t){var e=i(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=c.WordArray=a.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=c<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s.init(r,e/2)}},p=u.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new s.init(r,e)}},d=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(p.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return p.parse(unescape(encodeURIComponent(t)))}},h=c.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,c=this.blockSize,a=4*c,u=o/a,f=(u=e?t.ceil(u):t.max((0|u)-this._minBufferSize,0))*c,p=t.min(4*f,o);if(f){for(var d=0;d>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,c=t[e+0],s=t[e+1],h=t[e+2],l=t[e+3],y=t[e+4],g=t[e+5],_=t[e+6],v=t[e+7],k=t[e+8],S=t[e+9],m=t[e+10],B=t[e+11],w=t[e+12],C=t[e+13],x=t[e+14],E=t[e+15],D=o[0],b=o[1],z=o[2],A=o[3];D=u(D,b,z,A,c,7,a[0]),A=u(A,D,b,z,s,12,a[1]),z=u(z,A,D,b,h,17,a[2]),b=u(b,z,A,D,l,22,a[3]),D=u(D,b,z,A,y,7,a[4]),A=u(A,D,b,z,g,12,a[5]),z=u(z,A,D,b,_,17,a[6]),b=u(b,z,A,D,v,22,a[7]),D=u(D,b,z,A,k,7,a[8]),A=u(A,D,b,z,S,12,a[9]),z=u(z,A,D,b,m,17,a[10]),b=u(b,z,A,D,B,22,a[11]),D=u(D,b,z,A,w,7,a[12]),A=u(A,D,b,z,C,12,a[13]),z=u(z,A,D,b,x,17,a[14]),D=f(D,b=u(b,z,A,D,E,22,a[15]),z,A,s,5,a[16]),A=f(A,D,b,z,_,9,a[17]),z=f(z,A,D,b,B,14,a[18]),b=f(b,z,A,D,c,20,a[19]),D=f(D,b,z,A,g,5,a[20]),A=f(A,D,b,z,m,9,a[21]),z=f(z,A,D,b,E,14,a[22]),b=f(b,z,A,D,y,20,a[23]),D=f(D,b,z,A,S,5,a[24]),A=f(A,D,b,z,x,9,a[25]),z=f(z,A,D,b,l,14,a[26]),b=f(b,z,A,D,k,20,a[27]),D=f(D,b,z,A,C,5,a[28]),A=f(A,D,b,z,h,9,a[29]),z=f(z,A,D,b,v,14,a[30]),D=p(D,b=f(b,z,A,D,w,20,a[31]),z,A,g,4,a[32]),A=p(A,D,b,z,k,11,a[33]),z=p(z,A,D,b,B,16,a[34]),b=p(b,z,A,D,x,23,a[35]),D=p(D,b,z,A,s,4,a[36]),A=p(A,D,b,z,y,11,a[37]),z=p(z,A,D,b,v,16,a[38]),b=p(b,z,A,D,m,23,a[39]),D=p(D,b,z,A,C,4,a[40]),A=p(A,D,b,z,c,11,a[41]),z=p(z,A,D,b,l,16,a[42]),b=p(b,z,A,D,_,23,a[43]),D=p(D,b,z,A,S,4,a[44]),A=p(A,D,b,z,w,11,a[45]),z=p(z,A,D,b,E,16,a[46]),D=d(D,b=p(b,z,A,D,h,23,a[47]),z,A,c,6,a[48]),A=d(A,D,b,z,v,10,a[49]),z=d(z,A,D,b,x,15,a[50]),b=d(b,z,A,D,g,21,a[51]),D=d(D,b,z,A,w,6,a[52]),A=d(A,D,b,z,l,10,a[53]),z=d(z,A,D,b,m,15,a[54]),b=d(b,z,A,D,s,21,a[55]),D=d(D,b,z,A,k,6,a[56]),A=d(A,D,b,z,E,10,a[57]),z=d(z,A,D,b,_,15,a[58]),b=d(b,z,A,D,C,21,a[59]),D=d(D,b,z,A,y,6,a[60]),A=d(A,D,b,z,B,10,a[61]),z=d(z,A,D,b,h,15,a[62]),b=d(b,z,A,D,S,21,a[63]),o[0]=o[0]+D|0,o[1]=o[1]+b|0,o[2]=o[2]+z|0,o[3]=o[3]+A|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),c=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u++){var f=s[u];s[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function u(t,e,r,n,i,o,c){var a=t+(e&r|~e&n)+i+c;return(a<>>32-o)+e}function f(t,e,r,n,i,o,c){var a=t+(e&n|r&~n)+i+c;return(a<>>32-o)+e}function p(t,e,r,n,i,o,c){var a=t+(e^r^n)+i+c;return(a<>>32-o)+e}function d(t,e,r,n,i,o,c){var a=t+(r^(e|~n))+i+c;return(a<>>32-o)+e}e.MD5=o._createHelper(s),e.HmacMD5=o._createHmacHelper(s)}(Math),r.MD5}(root),function(t,e,r){var n,i,o,c,a,s,u,f;n=t.CryptoJS,o=(i=n).lib,c=o.Base,a=o.WordArray,s=i.algo,u=s.MD5,f=s.EvpKDF=c.extend({cfg:c.extend({keySize:4,hasher:u,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,i=n.hasher.create(),o=a.create(),c=o.words,s=n.keySize,u=n.iterations;c.length>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var s=n.charAt(64);if(s)for(;i.length%4;)i.push(s);return i.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-c%4*2,u=a|s;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64}(root),function(t,e,r){var n,i,o,c,a,s,u,f,p,d,h,l,y,g,_,v,k,S,m,B,w,C,x,E;(n=t.CryptoJS).lib.Cipher||(c=(o=n).lib,a=c.Base,s=c.WordArray,u=c.BufferedBlockAlgorithm,(f=o.enc).Utf8,p=f.Base64,d=o.algo,h=d.EvpKDF,l=c.Cipher=u.extend({cfg:a.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){u.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?E:w}return function(e){return{encrypt:function(r,n,i){return t(n).encrypt(e,r,n,i)},decrypt:function(r,n,i){return t(n).decrypt(e,r,n,i)}}}}()}),c.StreamCipher=l.extend({_doFinalize:function(){var t=this._process(!0);return t},blockSize:1}),y=o.mode={},g=c.BlockCipherMode=a.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),_=y.CBC=function(){var t=g.extend();function e(t,e,r){var n,o=this._iv;o?(n=o,this._iv=i):n=this._prevBlock;for(var c=0;c>>2];t.sigBytes-=e}},c.BlockCipher=l.extend({cfg:l.cfg.extend({mode:_,padding:k}),reset:function(){var t;l.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),S=c.CipherParams=a.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),m=o.format={},B=m.OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;return(r?s.create([1398893684,1701076831]).concat(r).concat(e):e).toString(p)},parse:function(t){var e,r=p.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=s.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),S.create({ciphertext:r,salt:e})}},w=c.SerializableCipher=a.extend({cfg:a.extend({format:B}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),c=i.cfg;return S.create({ciphertext:o,key:r,iv:c.iv,algorithm:t,mode:c.mode,padding:c.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),C=o.kdf={},x=C.OpenSSL={execute:function(t,e,r,n){n||(n=s.random(8));var i=h.create({keySize:e+r}).compute(t,n),o=s.create(i.words.slice(e),4*r);return i.sigBytes=4*e,S.create({key:i,iv:o,salt:n})}},E=c.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:x}),encrypt:function(t,e,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=w.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=w.decrypt.call(this,t,e,i.key,n);return o}}))}(root),function(t,e,r){var n;n=t.CryptoJS,function(){var t=n,e=t.lib.BlockCipher,r=t.algo,i=[],o=[],c=[],a=[],s=[],u=[],f=[],p=[],d=[],h=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,n=0;for(e=0;e<256;e++){var l=n^n<<1^n<<2^n<<3^n<<4;l=l>>>8^255&l^99,i[r]=l,o[l]=r;var y=t[r],g=t[y],_=t[g],v=257*t[l]^16843008*l;c[r]=v<<24|v>>>8,a[r]=v<<16|v>>>16,s[r]=v<<8|v>>>24,u[r]=v,v=16843009*_^65537*g^257*y^16843008*r,f[l]=v<<24|v>>>8,p[l]=v<<16|v>>>16,d[l]=v<<8|v>>>24,h[l]=v,r?(r=y^t[t[t[_^y]]],n^=t[t[n]]):r=n=1}}();var l=[0,1,2,4,8,16,32,64,128,27,54],y=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],c=0;c6&&c%r==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=l[c/r|0]<<24),o[c]=o[c-r]^u);for(var a=this._invKeySchedule=[],s=0;s>>24]]^p[i[u>>>16&255]]^d[i[u>>>8&255]]^h[i[255&u]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,c,a,s,u,i)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,f,p,d,h,o),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,c,a){for(var s=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],p=t[e+2]^r[2],d=t[e+3]^r[3],h=4,l=1;l>>24]^i[f>>>16&255]^o[p>>>8&255]^c[255&d]^r[h++],g=n[f>>>24]^i[p>>>16&255]^o[d>>>8&255]^c[255&u]^r[h++],_=n[p>>>24]^i[d>>>16&255]^o[u>>>8&255]^c[255&f]^r[h++],v=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^c[255&p]^r[h++];u=y,f=g,p=_,d=v}y=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[p>>>8&255]<<8|a[255&d])^r[h++],g=(a[f>>>24]<<24|a[p>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[h++],_=(a[p>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[h++],v=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&p])^r[h++],t[e]=y,t[e+1]=g,t[e+2]=_,t[e+3]=v},keySize:8});t.AES=e._createHelper(y)}(),n.AES}(root);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 t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),isObject(t)&&t.getRandomValues){var e=new Uint32Array(1);return t.getRandomValues(e)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}var CryptoJS=root.CryptoJS;function buildAESOption(t){return{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7,iv:t||generateIVData()}}function encryptData(t,e,r,n){var i=buildAESOption(r),o=t;"string"!=typeof t&&(o=JSON.stringify(t)),n||(e=CryptoJS.enc.Base64.parse(e));var c=CryptoJS.enc.Utf8.parse(o),a=CryptoJS.AES.encrypt(c,e,i).toString();return i.iv.clone().concat(CryptoJS.enc.Base64.parse(a)).toString(CryptoJS.enc.Base64)}function decryptData(t,e,r){var n=CryptoJS.enc.Base64.parse(t).toString(),i=n.substr(0,32),o=CryptoJS.enc.Hex.parse(n.substr(32)).toString(CryptoJS.enc.Base64),c=buildAESOption(CryptoJS.enc.Hex.parse(i));return r||(e=CryptoJS.enc.Base64.parse(e)),CryptoJS.AES.decrypt(o,e,c).toString(CryptoJS.enc.Utf8)}function generateIVData(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(127*getRandom()).toString(16);e+=2===r.length?r:"0"+r}return CryptoJS.enc.Hex.parse(e)}var _iv,_sd,_config,_oldEncoder,_log=window.console&&window.console.log||function(){};function AesEncrypt(t){var e=encryptData(t,_config.k,_iv);return{key_id:_config.kid,key_hash:_config.khash,nc:1,payload:e}}function encodeTrackData(t){try{var e=AesEncrypt(t),r=JSON.stringify(e),n="crc="+_sd._.hashCode(r);return"data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(i){return _log("\u6570\u636e\u52a0\u5bc6\u53d1\u9001\u5f02\u5e38\u3002"),_oldEncoder.call(_sd.kit,t)}}function isTruthy(t,e){return!!t||(_log(e+"\u4e0d\u80fd\u4e3a\u7a7a\u3002"),!1)}function matchType(t,e,r){return typeof t===r||(_log("\u53c2\u6570\u7c7b\u578b\u9519\u8bef,"+e+"\u5fc5\u987b\u4e3a"+r),!1)}function doEnDecrypt(t,e,r,n){try{var i=r||_config&&_config.k;return isTruthy(i,"\u53c2\u6570key")&&matchType(i,"\u53c2\u6570key","string")?(n===undefined&&(n=r!==undefined),t?encryptData(e,i,null,n):decryptData(e,i,n)):e}catch(o){return _log("\u6267\u884c\u52a0\u89e3\u5bc6\u5931\u8d25\uff0c\u8fd4\u56de\u539f\u59cb\u6570\u636e\u3002"),e}}var AesEncryption={init:function(t,e){_log=(_sd=t)&&_sd.log||_log,t&&t.kit&&t.kit.encodeTrackData?isTruthy(e,"\u521d\u59cb\u914d\u7f6econfig")&&isTruthy(e.k,"\u521d\u59cb\u53c2\u6570k")&&isTruthy(e.kid,"\u521d\u59cb\u53c2\u6570kid")&&isTruthy(e.khash,"\u521d\u59cb\u53c2\u6570khash")&&matchType(e.k,"\u521d\u59cb\u53c2\u6570k","string")&&matchType(e.khash,"\u521d\u59cb\u53c2\u6570khash","string")&&matchType(e.kid,"\u521d\u59cb\u53c2\u6570kid","number")?(_config=e,_iv=generateIVData(),_oldEncoder=_sd.kit.encodeTrackData,_sd.kit.encodeTrackData=encodeTrackData,_log("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25"):_log("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301AES\u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")},encrypt:function(t,e,r){return doEnDecrypt(!0,t,e,r)},decrypt:function(t,e,r){return doEnDecrypt(!1,t,e,r)}},index=createPlugin(AesEncryption,"AesEncryption","sdkReady");export default index; \ No newline at end of file +var sdkversion_placeholder="1.26.9";function wrapPluginInitFn(t,e,r){if(e&&(t.plugin_name=e),r&&t.init){var n=t.init;t.init=function(i,o){if(wrapLogFn(i,t,e),i.readyState&&i.readyState.state>=3||!i.on)return c();function c(){n.call(t,i,o)}i.on(r,c)}}return t}function wrapLogFn(t,e,r){function n(e,n){t.logger?t.logger.msg.apply(t.logger,n).module(r+""||"").level(e).log():t.log&&t.log.apply(t,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function createPlugin(t,e,r){return wrapPluginInitFn(t,e,r),t.plugin_version=sdkversion_placeholder,t}var root={};function isObject(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)}!function(t,e){var r;t.CryptoJS=r=r||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(y){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(y){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(y){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),o={},c=o.lib={},a=c.Base={extend:function(t){var e=i(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},s=c.WordArray=a.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||f).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=c<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new s.init(r,e/2)}},p=u.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new s.init(r,e)}},d=u.Utf8={stringify:function(t){try{return decodeURIComponent(escape(p.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return p.parse(unescape(encodeURIComponent(t)))}},h=c.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new s.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=d.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,c=this.blockSize,a=4*c,u=o/a,f=(u=e?t.ceil(u):t.max((0|u)-this._minBufferSize,0))*c,p=t.min(4*f,o);if(f){for(var d=0;d>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,c=t[e+0],s=t[e+1],h=t[e+2],l=t[e+3],y=t[e+4],g=t[e+5],_=t[e+6],v=t[e+7],k=t[e+8],S=t[e+9],m=t[e+10],B=t[e+11],w=t[e+12],C=t[e+13],x=t[e+14],E=t[e+15],D=o[0],b=o[1],z=o[2],A=o[3];D=u(D,b,z,A,c,7,a[0]),A=u(A,D,b,z,s,12,a[1]),z=u(z,A,D,b,h,17,a[2]),b=u(b,z,A,D,l,22,a[3]),D=u(D,b,z,A,y,7,a[4]),A=u(A,D,b,z,g,12,a[5]),z=u(z,A,D,b,_,17,a[6]),b=u(b,z,A,D,v,22,a[7]),D=u(D,b,z,A,k,7,a[8]),A=u(A,D,b,z,S,12,a[9]),z=u(z,A,D,b,m,17,a[10]),b=u(b,z,A,D,B,22,a[11]),D=u(D,b,z,A,w,7,a[12]),A=u(A,D,b,z,C,12,a[13]),z=u(z,A,D,b,x,17,a[14]),D=f(D,b=u(b,z,A,D,E,22,a[15]),z,A,s,5,a[16]),A=f(A,D,b,z,_,9,a[17]),z=f(z,A,D,b,B,14,a[18]),b=f(b,z,A,D,c,20,a[19]),D=f(D,b,z,A,g,5,a[20]),A=f(A,D,b,z,m,9,a[21]),z=f(z,A,D,b,E,14,a[22]),b=f(b,z,A,D,y,20,a[23]),D=f(D,b,z,A,S,5,a[24]),A=f(A,D,b,z,x,9,a[25]),z=f(z,A,D,b,l,14,a[26]),b=f(b,z,A,D,k,20,a[27]),D=f(D,b,z,A,C,5,a[28]),A=f(A,D,b,z,h,9,a[29]),z=f(z,A,D,b,v,14,a[30]),D=p(D,b=f(b,z,A,D,w,20,a[31]),z,A,g,4,a[32]),A=p(A,D,b,z,k,11,a[33]),z=p(z,A,D,b,B,16,a[34]),b=p(b,z,A,D,x,23,a[35]),D=p(D,b,z,A,s,4,a[36]),A=p(A,D,b,z,y,11,a[37]),z=p(z,A,D,b,v,16,a[38]),b=p(b,z,A,D,m,23,a[39]),D=p(D,b,z,A,C,4,a[40]),A=p(A,D,b,z,c,11,a[41]),z=p(z,A,D,b,l,16,a[42]),b=p(b,z,A,D,_,23,a[43]),D=p(D,b,z,A,S,4,a[44]),A=p(A,D,b,z,w,11,a[45]),z=p(z,A,D,b,E,16,a[46]),D=d(D,b=p(b,z,A,D,h,23,a[47]),z,A,c,6,a[48]),A=d(A,D,b,z,v,10,a[49]),z=d(z,A,D,b,x,15,a[50]),b=d(b,z,A,D,g,21,a[51]),D=d(D,b,z,A,w,6,a[52]),A=d(A,D,b,z,l,10,a[53]),z=d(z,A,D,b,m,15,a[54]),b=d(b,z,A,D,s,21,a[55]),D=d(D,b,z,A,k,6,a[56]),A=d(A,D,b,z,E,10,a[57]),z=d(z,A,D,b,_,15,a[58]),b=d(b,z,A,D,C,21,a[59]),D=d(D,b,z,A,y,6,a[60]),A=d(A,D,b,z,B,10,a[61]),z=d(z,A,D,b,h,15,a[62]),b=d(b,z,A,D,S,21,a[63]),o[0]=o[0]+D|0,o[1]=o[1]+b|0,o[2]=o[2]+z|0,o[3]=o[3]+A|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var o=t.floor(n/4294967296),c=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u++){var f=s[u];s[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=o.clone.call(this);return t._hash=this._hash.clone(),t}});function u(t,e,r,n,i,o,c){var a=t+(e&r|~e&n)+i+c;return(a<>>32-o)+e}function f(t,e,r,n,i,o,c){var a=t+(e&n|r&~n)+i+c;return(a<>>32-o)+e}function p(t,e,r,n,i,o,c){var a=t+(e^r^n)+i+c;return(a<>>32-o)+e}function d(t,e,r,n,i,o,c){var a=t+(r^(e|~n))+i+c;return(a<>>32-o)+e}e.MD5=o._createHelper(s),e.HmacMD5=o._createHmacHelper(s)}(Math),r.MD5}(root),function(t,e,r){var n,i,o,c,a,s,u,f;n=t.CryptoJS,o=(i=n).lib,c=o.Base,a=o.WordArray,s=i.algo,u=s.MD5,f=s.EvpKDF=c.extend({cfg:c.extend({keySize:4,hasher:u,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,i=n.hasher.create(),o=a.create(),c=o.words,s=n.keySize,u=n.iterations;c.length>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var s=n.charAt(64);if(s)for(;i.length%4;)i.push(s);return i.join("")},parse:function(t){var e=t.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-c%4*2,u=a|s;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}(t,e,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64}(root),function(t,e,r){var n,i,o,c,a,s,u,f,p,d,h,l,y,g,_,v,k,S,m,B,w,C,x,E;(n=t.CryptoJS).lib.Cipher||(c=(o=n).lib,a=c.Base,s=c.WordArray,u=c.BufferedBlockAlgorithm,(f=o.enc).Utf8,p=f.Base64,d=o.algo,h=d.EvpKDF,l=c.Cipher=u.extend({cfg:a.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){u.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?E:w}return function(e){return{encrypt:function(r,n,i){return t(n).encrypt(e,r,n,i)},decrypt:function(r,n,i){return t(n).decrypt(e,r,n,i)}}}}()}),c.StreamCipher=l.extend({_doFinalize:function(){var t=this._process(!0);return t},blockSize:1}),y=o.mode={},g=c.BlockCipherMode=a.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),_=y.CBC=function(){var t=g.extend();function e(t,e,r){var n,o=this._iv;o?(n=o,this._iv=i):n=this._prevBlock;for(var c=0;c>>2];t.sigBytes-=e}},c.BlockCipher=l.extend({cfg:l.cfg.extend({mode:_,padding:k}),reset:function(){var t;l.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),S=c.CipherParams=a.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}}),m=o.format={},B=m.OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;return(r?s.create([1398893684,1701076831]).concat(r).concat(e):e).toString(p)},parse:function(t){var e,r=p.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=s.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),S.create({ciphertext:r,salt:e})}},w=c.SerializableCipher=a.extend({cfg:a.extend({format:B}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),c=i.cfg;return S.create({ciphertext:o,key:r,iv:c.iv,algorithm:t,mode:c.mode,padding:c.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),C=o.kdf={},x=C.OpenSSL={execute:function(t,e,r,n){n||(n=s.random(8));var i=h.create({keySize:e+r}).compute(t,n),o=s.create(i.words.slice(e),4*r);return i.sigBytes=4*e,S.create({key:i,iv:o,salt:n})}},E=c.PasswordBasedCipher=w.extend({cfg:w.cfg.extend({kdf:x}),encrypt:function(t,e,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=w.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=w.decrypt.call(this,t,e,i.key,n);return o}}))}(root),function(t,e,r){var n;n=t.CryptoJS,function(){var t=n,e=t.lib.BlockCipher,r=t.algo,i=[],o=[],c=[],a=[],s=[],u=[],f=[],p=[],d=[],h=[];!function(){for(var t=[],e=0;e<256;e++)t[e]=e<128?e<<1:e<<1^283;var r=0,n=0;for(e=0;e<256;e++){var l=n^n<<1^n<<2^n<<3^n<<4;l=l>>>8^255&l^99,i[r]=l,o[l]=r;var y=t[r],g=t[y],_=t[g],v=257*t[l]^16843008*l;c[r]=v<<24|v>>>8,a[r]=v<<16|v>>>16,s[r]=v<<8|v>>>24,u[r]=v,v=16843009*_^65537*g^257*y^16843008*r,f[l]=v<<24|v>>>8,p[l]=v<<16|v>>>16,d[l]=v<<8|v>>>24,h[l]=v,r?(r=y^t[t[t[_^y]]],n^=t[t[n]]):r=n=1}}();var l=[0,1,2,4,8,16,32,64,128,27,54],y=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],c=0;c6&&c%r==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=l[c/r|0]<<24),o[c]=o[c-r]^u);for(var a=this._invKeySchedule=[],s=0;s>>24]]^p[i[u>>>16&255]]^d[i[u>>>8&255]]^h[i[255&u]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,c,a,s,u,i)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,f,p,d,h,o),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,c,a){for(var s=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],p=t[e+2]^r[2],d=t[e+3]^r[3],h=4,l=1;l>>24]^i[f>>>16&255]^o[p>>>8&255]^c[255&d]^r[h++],g=n[f>>>24]^i[p>>>16&255]^o[d>>>8&255]^c[255&u]^r[h++],_=n[p>>>24]^i[d>>>16&255]^o[u>>>8&255]^c[255&f]^r[h++],v=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^c[255&p]^r[h++];u=y,f=g,p=_,d=v}y=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[p>>>8&255]<<8|a[255&d])^r[h++],g=(a[f>>>24]<<24|a[p>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[h++],_=(a[p>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[h++],v=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&p])^r[h++],t[e]=y,t[e+1]=g,t[e+2]=_,t[e+3]=v},keySize:8});t.AES=e._createHelper(y)}(),n.AES}(root);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 t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),isObject(t)&&t.getRandomValues){var e=new Uint32Array(1);return t.getRandomValues(e)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}var CryptoJS=root.CryptoJS;function buildAESOption(t){return{mode:CryptoJS.mode.CBC,padding:CryptoJS.pad.Pkcs7,iv:t||generateIVData()}}function encryptData(t,e,r,n){var i=buildAESOption(r),o=t;"string"!=typeof t&&(o=JSON.stringify(t)),n||(e=CryptoJS.enc.Base64.parse(e));var c=CryptoJS.enc.Utf8.parse(o),a=CryptoJS.AES.encrypt(c,e,i).toString();return i.iv.clone().concat(CryptoJS.enc.Base64.parse(a)).toString(CryptoJS.enc.Base64)}function decryptData(t,e,r){var n=CryptoJS.enc.Base64.parse(t).toString(),i=n.substr(0,32),o=CryptoJS.enc.Hex.parse(n.substr(32)).toString(CryptoJS.enc.Base64),c=buildAESOption(CryptoJS.enc.Hex.parse(i));return r||(e=CryptoJS.enc.Base64.parse(e)),CryptoJS.AES.decrypt(o,e,c).toString(CryptoJS.enc.Utf8)}function generateIVData(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(127*getRandom()).toString(16);e+=2===r.length?r:"0"+r}return CryptoJS.enc.Hex.parse(e)}var _iv,_sd,_config,_oldEncoder,_log=window.console&&window.console.log||function(){};function AesEncrypt(t){var e=encryptData(t,_config.k,_iv);return{key_id:_config.kid,key_hash:_config.khash,nc:1,payload:e}}function encodeTrackData(t){try{var e=AesEncrypt(t),r=JSON.stringify(e),n="crc="+_sd._.hashCode(r);return"data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(i){return _log("\u6570\u636e\u52a0\u5bc6\u53d1\u9001\u5f02\u5e38\u3002"),_oldEncoder.call(_sd.kit,t)}}function isTruthy(t,e){return!!t||(_log(e+"\u4e0d\u80fd\u4e3a\u7a7a\u3002"),!1)}function matchType(t,e,r){return typeof t===r||(_log("\u53c2\u6570\u7c7b\u578b\u9519\u8bef,"+e+"\u5fc5\u987b\u4e3a"+r),!1)}function doEnDecrypt(t,e,r,n){try{var i=r||_config&&_config.k;return isTruthy(i,"\u53c2\u6570key")&&matchType(i,"\u53c2\u6570key","string")?(n===undefined&&(n=r!==undefined),t?encryptData(e,i,null,n):decryptData(e,i,n)):e}catch(o){return _log("\u6267\u884c\u52a0\u89e3\u5bc6\u5931\u8d25\uff0c\u8fd4\u56de\u539f\u59cb\u6570\u636e\u3002"),e}}var AesEncryption={init:function(t,e){_log=(_sd=t)&&_sd.log||_log,t&&t.kit&&t.kit.encodeTrackData?isTruthy(e,"\u521d\u59cb\u914d\u7f6econfig")&&isTruthy(e.k,"\u521d\u59cb\u53c2\u6570k")&&isTruthy(e.kid,"\u521d\u59cb\u53c2\u6570kid")&&isTruthy(e.khash,"\u521d\u59cb\u53c2\u6570khash")&&matchType(e.k,"\u521d\u59cb\u53c2\u6570k","string")&&matchType(e.khash,"\u521d\u59cb\u53c2\u6570khash","string")&&matchType(e.kid,"\u521d\u59cb\u53c2\u6570kid","number")?(_config=e,_iv=generateIVData(),_oldEncoder=_sd.kit.encodeTrackData,_sd.kit.encodeTrackData=encodeTrackData,_log("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25"):_log("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301AES\u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")},encrypt:function(t,e,r){return doEnDecrypt(!0,t,e,r)},decrypt:function(t,e,r){return doEnDecrypt(!1,t,e,r)}},index=createPlugin(AesEncryption,"AesEncryption","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/aes-encryption/index.js b/dist/web/plugin/aes-encryption/index.js index 1bf6bad0..1ede0c42 100644 --- a/dist/web/plugin/aes-encryption/index.js +++ b/dist/web/plugin/aes-encryption/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AesEncryption=function(){"use strict";function t(t,r,n){if(r&&(t.plugin_name=r),n&&t.init){var i=t.init;t.init=function(o,c){function a(){i.call(t,o,c)}return e(o,t,r),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(n,a)}}return t}function e(t,e,r){function n(e,n){t.logger?t.logger.msg.apply(t.logger,n).module(r+""||"").level(e).log():t.log&&t.log.apply(t,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function r(e,r,n){return t(e,r,n),e.plugin_version=l,e}function n(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)}function i(){if("function"==typeof Uint32Array){var t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),n(t)&&t.getRandomValues){var e=new Uint32Array(1),r=t.getRandomValues(e)[0],i=Math.pow(2,32);return r/i}}return m(1e19)/1e19}function o(t){return{mode:S.mode.CBC,padding:S.pad.Pkcs7,iv:t||s()}}function c(t,e,r,n){var i=o(r),c=t;"string"!=typeof t&&(c=JSON.stringify(t)),n||(e=S.enc.Base64.parse(e));var a=S.enc.Utf8.parse(c),s=S.AES.encrypt(a,e,i).toString(),u=i.iv.clone().concat(S.enc.Base64.parse(s)).toString(S.enc.Base64);return u}function a(t,e,r){var n=S.enc.Base64.parse(t).toString(),i=n.substr(0,32),c=S.enc.Hex.parse(n.substr(32)).toString(S.enc.Base64),a=o(S.enc.Hex.parse(i));r||(e=S.enc.Base64.parse(e));var s=S.AES.decrypt(c,e,a);return s.toString(S.enc.Utf8)}function s(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(127*i()).toString(16);e+=2===r.length?r:"0"+r}return S.enc.Hex.parse(e)}function u(t){var e=c(t,_.k,v);return{key_id:_.kid,key_hash:_.khash,nc:1,payload:e}}function f(t){try{var e=u(t),r=JSON.stringify(e),n="crc="+g._.hashCode(r);return"data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(i){return B("\u6570\u636e\u52a0\u5bc6\u53d1\u9001\u5f02\u5e38\u3002"),k.call(g.kit,t)}}function h(t,e){return!!t||(B(e+"\u4e0d\u80fd\u4e3a\u7a7a\u3002"),!1)}function d(t,e,r){return typeof t===r||(B("\u53c2\u6570\u7c7b\u578b\u9519\u8bef,"+e+"\u5fc5\u987b\u4e3a"+r),!1)}function p(t,e,r,n){try{var i=r||_&&_.k;return h(i,"\u53c2\u6570key")&&d(i,"\u53c2\u6570key","string")?(void 0===n&&(n=void 0!==r),t?c(e,i,null,n):a(e,i,n)):e}catch(o){return B("\u6267\u884c\u52a0\u89e3\u5bc6\u5931\u8d25\uff0c\u8fd4\u56de\u539f\u59cb\u6570\u636e\u3002"),e}}var l="1.26.8",y={};!function(t,e){t.CryptoJS=e()}(y,function(){var t=t||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(n){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),c={},a=c.lib={},s=a.Base=function(){return{extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=a.WordArray=s.extend({init:function(t,r){t=this.words=t||[],r!=e?this.sigBytes=r:this.sigBytes=4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=c<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new u.init(r,e/2)}},d=f.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new u.init(r,e)}},p=f.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},l=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,c=this.blockSize,a=4*c,s=o/a;s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0);var f=s*c,h=t.min(4*f,o);if(f){for(var d=0;d>>32-o)+e}function n(t,e,r,n,i,o,c){var a=t+(e&n|r&~n)+i+c;return(a<>>32-o)+e}function i(t,e,r,n,i,o,c){var a=t+(e^r^n)+i+c;return(a<>>32-o)+e}function o(t,e,r,n,i,o,c){var a=t+(r^(e|~n))+i+c;return(a<>>32-o)+e}var c=t,a=c.lib,s=a.WordArray,u=a.Hasher,f=c.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var d=f.MD5=u.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var c=0;c<16;c++){var a=e+c,s=t[a];t[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var u=this._hash.words,f=t[e+0],d=t[e+1],p=t[e+2],l=t[e+3],y=t[e+4],v=t[e+5],g=t[e+6],_=t[e+7],k=t[e+8],m=t[e+9],S=t[e+10],B=t[e+11],w=t[e+12],x=t[e+13],C=t[e+14],z=t[e+15],b=u[0],E=u[1],D=u[2],M=u[3];b=r(b,E,D,M,f,7,h[0]),M=r(M,b,E,D,d,12,h[1]),D=r(D,M,b,E,p,17,h[2]),E=r(E,D,M,b,l,22,h[3]),b=r(b,E,D,M,y,7,h[4]),M=r(M,b,E,D,v,12,h[5]),D=r(D,M,b,E,g,17,h[6]),E=r(E,D,M,b,_,22,h[7]),b=r(b,E,D,M,k,7,h[8]),M=r(M,b,E,D,m,12,h[9]),D=r(D,M,b,E,S,17,h[10]),E=r(E,D,M,b,B,22,h[11]),b=r(b,E,D,M,w,7,h[12]),M=r(M,b,E,D,x,12,h[13]),D=r(D,M,b,E,C,17,h[14]),E=r(E,D,M,b,z,22,h[15]),b=n(b,E,D,M,d,5,h[16]),M=n(M,b,E,D,g,9,h[17]),D=n(D,M,b,E,B,14,h[18]),E=n(E,D,M,b,f,20,h[19]),b=n(b,E,D,M,v,5,h[20]),M=n(M,b,E,D,S,9,h[21]),D=n(D,M,b,E,z,14,h[22]),E=n(E,D,M,b,y,20,h[23]),b=n(b,E,D,M,m,5,h[24]),M=n(M,b,E,D,C,9,h[25]),D=n(D,M,b,E,l,14,h[26]),E=n(E,D,M,b,k,20,h[27]),b=n(b,E,D,M,x,5,h[28]),M=n(M,b,E,D,p,9,h[29]),D=n(D,M,b,E,_,14,h[30]),E=n(E,D,M,b,w,20,h[31]),b=i(b,E,D,M,v,4,h[32]),M=i(M,b,E,D,k,11,h[33]),D=i(D,M,b,E,B,16,h[34]),E=i(E,D,M,b,C,23,h[35]),b=i(b,E,D,M,d,4,h[36]),M=i(M,b,E,D,y,11,h[37]),D=i(D,M,b,E,_,16,h[38]),E=i(E,D,M,b,S,23,h[39]),b=i(b,E,D,M,x,4,h[40]),M=i(M,b,E,D,f,11,h[41]),D=i(D,M,b,E,l,16,h[42]),E=i(E,D,M,b,g,23,h[43]),b=i(b,E,D,M,m,4,h[44]),M=i(M,b,E,D,w,11,h[45]),D=i(D,M,b,E,z,16,h[46]),E=i(E,D,M,b,p,23,h[47]),b=o(b,E,D,M,f,6,h[48]),M=o(M,b,E,D,_,10,h[49]),D=o(D,M,b,E,C,15,h[50]),E=o(E,D,M,b,v,21,h[51]),b=o(b,E,D,M,w,6,h[52]),M=o(M,b,E,D,l,10,h[53]),D=o(D,M,b,E,S,15,h[54]),E=o(E,D,M,b,d,21,h[55]),b=o(b,E,D,M,k,6,h[56]),M=o(M,b,E,D,z,10,h[57]),D=o(D,M,b,E,g,15,h[58]),E=o(E,D,M,b,x,21,h[59]),b=o(b,E,D,M,y,6,h[60]),M=o(M,b,E,D,B,10,h[61]),D=o(D,M,b,E,p,15,h[62]),E=o(E,D,M,b,m,21,h[63]),u[0]=u[0]+b|0,u[1]=u[1]+E|0,u[2]=u[2]+D|0,u[3]=u[3]+M|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),c=n;r[(i+64>>>9<<4)+15]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[(i+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u++){var f=s[u];s[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});c.MD5=u._createHelper(d),c.HmacMD5=u._createHmacHelper(d)}(Math),t.MD5}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.Base,i=r.WordArray,o=e.algo,c=o.MD5,a=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,o=n.hasher.create(),c=i.create(),a=c.words,s=n.keySize,u=n.iterations;a.length>>6-c%4*2,u=a|s;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}var r=t,n=r.lib,i=n.WordArray,o=r.enc;o.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255,a=e[o+1>>>2]>>>24-(o+1)%4*8&255,s=e[o+2>>>2]>>>24-(o+2)%4*8&255,u=c<<16|a<<8|s,f=0;f<4&&o+.75*f>>6*(3-f)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(t){var r=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>2];t.sigBytes-=e}},g=(n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:l,padding:v}),reset:function(){var t;h.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),n.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),_=r.format={},k=_.OpenSSL={stringify:function(t){var e,r=t.ciphertext,n=t.salt;return e=n?o.create([1398893684,1701076831]).concat(n).concat(r):r,e.toString(s)},parse:function(t){var e,r=s.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),g.create({ciphertext:r,salt:e})}},m=n.SerializableCipher=i.extend({cfg:i.extend({format:k}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),c=i.cfg;return g.create({ciphertext:o,key:r,iv:c.iv,algorithm:t,mode:c.mode,padding:c.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),S=r.kdf={},B=S.OpenSSL={execute:function(t,e,r,n){n||(n=o.random(8));var i=f.create({keySize:e+r}).compute(t,n),c=o.create(i.words.slice(e),4*r);return i.sigBytes=4*e,g.create({key:i,iv:c,salt:n})}},w=n.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:B}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=m.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=m.decrypt.call(this,t,e,i.key,n);return o}})}()}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.BlockCipher,i=e.algo,o=[],c=[],a=[],s=[],u=[],f=[],h=[],d=[],p=[],l=[];!function(){for(var t=[],e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var r=0,n=0,e=0;e<256;e++){var i=n^n<<1^n<<2^n<<3^n<<4;i=i>>>8^255&i^99,o[r]=i,c[i]=r;var y=t[r],v=t[y],g=t[v],_=257*t[i]^16843008*i;a[r]=_<<24|_>>>8,s[r]=_<<16|_>>>16,u[r]=_<<8|_>>>24,f[r]=_;var _=16843009*g^65537*v^257*y^16843008*r;h[i]=_<<24|_>>>8,d[i]=_<<16|_>>>16,p[i]=_<<8|_>>>24,l[i]=_,r?(r=y^t[t[t[g^y]]],n^=t[t[n]]):r=n=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],v=i.AES=n.extend({_doReset:function(){var t;if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,r=e.words,n=e.sigBytes/4,i=this._nRounds=n+6,c=4*(i+1),a=this._keySchedule=[],s=0;s6&&s%n==4&&(t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t]):(t=t<<8|t>>>24,t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t],t^=y[s/n|0]<<24),a[s]=a[s-n]^t);for(var u=this._invKeySchedule=[],f=0;f>>24]]^d[o[t>>>16&255]]^p[o[t>>>8&255]]^l[o[255&t]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,u,f,o)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,d,p,l,c);var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,c,a){for(var s=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],h=t[e+2]^r[2],d=t[e+3]^r[3],p=4,l=1;l>>24]^i[f>>>16&255]^o[h>>>8&255]^c[255&d]^r[p++],v=n[f>>>24]^i[h>>>16&255]^o[d>>>8&255]^c[255&u]^r[p++],g=n[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^c[255&f]^r[p++],_=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^c[255&h]^r[p++];u=y,f=v,h=g,d=_}var y=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^r[p++],v=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[p++],g=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[p++],_=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^r[p++];t[e]=y,t[e+1]=v,t[e+2]=g,t[e+3]=_},keySize:8});e.AES=n._createHelper(v)}(),t.AES});var v,g,_,k,m=function(){function t(){return r=(9301*r+49297)%233280,r/233280}var e=new Date,r=e.getTime();return function(e){return Math.ceil(t()*e)}}(),S=y.CryptoJS,B=window.console&&window.console.log||function(){},w={init:function(t,e){return g=t,B=g&&g.log||B,t&&t.kit&&t.kit.encodeTrackData?void(h(e,"\u521d\u59cb\u914d\u7f6econfig")&&h(e.k,"\u521d\u59cb\u53c2\u6570k")&&h(e.kid,"\u521d\u59cb\u53c2\u6570kid")&&h(e.khash,"\u521d\u59cb\u53c2\u6570khash")&&d(e.k,"\u521d\u59cb\u53c2\u6570k","string")&&d(e.khash,"\u521d\u59cb\u53c2\u6570khash","string")&&d(e.kid,"\u521d\u59cb\u53c2\u6570kid","number")?(_=e,v=s(),k=g.kit.encodeTrackData,g.kit.encodeTrackData=f,B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25")):void B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301AES\u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")},encrypt:function(t,e,r){return p(!0,t,e,r)},decrypt:function(t,e,r){return p(!1,t,e,r)}},x=r(w,"AesEncryption","sdkReady");return x}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AesEncryption=function(){"use strict";function t(t,r,n){if(r&&(t.plugin_name=r),n&&t.init){var i=t.init;t.init=function(o,c){function a(){i.call(t,o,c)}return e(o,t,r),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(n,a)}}return t}function e(t,e,r){function n(e,n){t.logger?t.logger.msg.apply(t.logger,n).module(r+""||"").level(e).log():t.log&&t.log.apply(t,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function r(e,r,n){return t(e,r,n),e.plugin_version=l,e}function n(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)}function i(){if("function"==typeof Uint32Array){var t="";if("undefined"!=typeof crypto?t=crypto:"undefined"!=typeof msCrypto&&(t=msCrypto),n(t)&&t.getRandomValues){var e=new Uint32Array(1),r=t.getRandomValues(e)[0],i=Math.pow(2,32);return r/i}}return m(1e19)/1e19}function o(t){return{mode:S.mode.CBC,padding:S.pad.Pkcs7,iv:t||s()}}function c(t,e,r,n){var i=o(r),c=t;"string"!=typeof t&&(c=JSON.stringify(t)),n||(e=S.enc.Base64.parse(e));var a=S.enc.Utf8.parse(c),s=S.AES.encrypt(a,e,i).toString(),u=i.iv.clone().concat(S.enc.Base64.parse(s)).toString(S.enc.Base64);return u}function a(t,e,r){var n=S.enc.Base64.parse(t).toString(),i=n.substr(0,32),c=S.enc.Hex.parse(n.substr(32)).toString(S.enc.Base64),a=o(S.enc.Hex.parse(i));r||(e=S.enc.Base64.parse(e));var s=S.AES.decrypt(c,e,a);return s.toString(S.enc.Utf8)}function s(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(127*i()).toString(16);e+=2===r.length?r:"0"+r}return S.enc.Hex.parse(e)}function u(t){var e=c(t,_.k,v);return{key_id:_.kid,key_hash:_.khash,nc:1,payload:e}}function f(t){try{var e=u(t),r=JSON.stringify(e),n="crc="+g._.hashCode(r);return"data="+encodeURIComponent(r)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(i){return B("\u6570\u636e\u52a0\u5bc6\u53d1\u9001\u5f02\u5e38\u3002"),k.call(g.kit,t)}}function h(t,e){return!!t||(B(e+"\u4e0d\u80fd\u4e3a\u7a7a\u3002"),!1)}function d(t,e,r){return typeof t===r||(B("\u53c2\u6570\u7c7b\u578b\u9519\u8bef,"+e+"\u5fc5\u987b\u4e3a"+r),!1)}function p(t,e,r,n){try{var i=r||_&&_.k;return h(i,"\u53c2\u6570key")&&d(i,"\u53c2\u6570key","string")?(void 0===n&&(n=void 0!==r),t?c(e,i,null,n):a(e,i,n)):e}catch(o){return B("\u6267\u884c\u52a0\u89e3\u5bc6\u5931\u8d25\uff0c\u8fd4\u56de\u539f\u59cb\u6570\u636e\u3002"),e}}var l="1.26.9",y={};!function(t,e){t.CryptoJS=e()}(y,function(){var t=t||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&"undefined"!=typeof global&&global.crypto&&(r=global.crypto),!r&&"function"==typeof require)try{r=require("crypto")}catch(n){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(t){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(t){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),c={},a=c.lib={},s=a.Base=function(){return{extend:function(t){var e=o(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=a.WordArray=s.extend({init:function(t,r){t=this.words=t||[],r!=e?this.sigBytes=r:this.sigBytes=4*t.length},toString:function(t){return(t||h).stringify(this)},concat:function(t){var e=this.words,r=t.words,n=this.sigBytes,i=t.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[n+o>>>2]|=c<<24-(n+o)%4*8}else for(var a=0;a>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=s.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>3]|=parseInt(t.substr(n,2),16)<<24-n%8*4;return new u.init(r,e/2)}},d=f.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(t){for(var e=t.length,r=[],n=0;n>>2]|=(255&t.charCodeAt(n))<<24-n%4*8;return new u.init(r,e)}},p=f.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},l=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,n=this._data,i=n.words,o=n.sigBytes,c=this.blockSize,a=4*c,s=o/a;s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0);var f=s*c,h=t.min(4*f,o);if(f){for(var d=0;d>>32-o)+e}function n(t,e,r,n,i,o,c){var a=t+(e&n|r&~n)+i+c;return(a<>>32-o)+e}function i(t,e,r,n,i,o,c){var a=t+(e^r^n)+i+c;return(a<>>32-o)+e}function o(t,e,r,n,i,o,c){var a=t+(r^(e|~n))+i+c;return(a<>>32-o)+e}var c=t,a=c.lib,s=a.WordArray,u=a.Hasher,f=c.algo,h=[];!function(){for(var t=0;t<64;t++)h[t]=4294967296*e.abs(e.sin(t+1))|0}();var d=f.MD5=u.extend({_doReset:function(){this._hash=new s.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var c=0;c<16;c++){var a=e+c,s=t[a];t[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}var u=this._hash.words,f=t[e+0],d=t[e+1],p=t[e+2],l=t[e+3],y=t[e+4],v=t[e+5],g=t[e+6],_=t[e+7],k=t[e+8],m=t[e+9],S=t[e+10],B=t[e+11],w=t[e+12],x=t[e+13],C=t[e+14],z=t[e+15],b=u[0],E=u[1],D=u[2],M=u[3];b=r(b,E,D,M,f,7,h[0]),M=r(M,b,E,D,d,12,h[1]),D=r(D,M,b,E,p,17,h[2]),E=r(E,D,M,b,l,22,h[3]),b=r(b,E,D,M,y,7,h[4]),M=r(M,b,E,D,v,12,h[5]),D=r(D,M,b,E,g,17,h[6]),E=r(E,D,M,b,_,22,h[7]),b=r(b,E,D,M,k,7,h[8]),M=r(M,b,E,D,m,12,h[9]),D=r(D,M,b,E,S,17,h[10]),E=r(E,D,M,b,B,22,h[11]),b=r(b,E,D,M,w,7,h[12]),M=r(M,b,E,D,x,12,h[13]),D=r(D,M,b,E,C,17,h[14]),E=r(E,D,M,b,z,22,h[15]),b=n(b,E,D,M,d,5,h[16]),M=n(M,b,E,D,g,9,h[17]),D=n(D,M,b,E,B,14,h[18]),E=n(E,D,M,b,f,20,h[19]),b=n(b,E,D,M,v,5,h[20]),M=n(M,b,E,D,S,9,h[21]),D=n(D,M,b,E,z,14,h[22]),E=n(E,D,M,b,y,20,h[23]),b=n(b,E,D,M,m,5,h[24]),M=n(M,b,E,D,C,9,h[25]),D=n(D,M,b,E,l,14,h[26]),E=n(E,D,M,b,k,20,h[27]),b=n(b,E,D,M,x,5,h[28]),M=n(M,b,E,D,p,9,h[29]),D=n(D,M,b,E,_,14,h[30]),E=n(E,D,M,b,w,20,h[31]),b=i(b,E,D,M,v,4,h[32]),M=i(M,b,E,D,k,11,h[33]),D=i(D,M,b,E,B,16,h[34]),E=i(E,D,M,b,C,23,h[35]),b=i(b,E,D,M,d,4,h[36]),M=i(M,b,E,D,y,11,h[37]),D=i(D,M,b,E,_,16,h[38]),E=i(E,D,M,b,S,23,h[39]),b=i(b,E,D,M,x,4,h[40]),M=i(M,b,E,D,f,11,h[41]),D=i(D,M,b,E,l,16,h[42]),E=i(E,D,M,b,g,23,h[43]),b=i(b,E,D,M,m,4,h[44]),M=i(M,b,E,D,w,11,h[45]),D=i(D,M,b,E,z,16,h[46]),E=i(E,D,M,b,p,23,h[47]),b=o(b,E,D,M,f,6,h[48]),M=o(M,b,E,D,_,10,h[49]),D=o(D,M,b,E,C,15,h[50]),E=o(E,D,M,b,v,21,h[51]),b=o(b,E,D,M,w,6,h[52]),M=o(M,b,E,D,l,10,h[53]),D=o(D,M,b,E,S,15,h[54]),E=o(E,D,M,b,d,21,h[55]),b=o(b,E,D,M,k,6,h[56]),M=o(M,b,E,D,z,10,h[57]),D=o(D,M,b,E,g,15,h[58]),E=o(E,D,M,b,x,21,h[59]),b=o(b,E,D,M,y,6,h[60]),M=o(M,b,E,D,B,10,h[61]),D=o(D,M,b,E,p,15,h[62]),E=o(E,D,M,b,m,21,h[63]),u[0]=u[0]+b|0,u[1]=u[1]+E|0,u[2]=u[2]+D|0,u[3]=u[3]+M|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),c=n;r[(i+64>>>9<<4)+15]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[(i+64>>>9<<4)+14]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),t.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,s=a.words,u=0;u<4;u++){var f=s[u];s[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return a},clone:function(){var t=u.clone.call(this);return t._hash=this._hash.clone(),t}});c.MD5=u._createHelper(d),c.HmacMD5=u._createHmacHelper(d)}(Math),t.MD5}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.Base,i=r.WordArray,o=e.algo,c=o.MD5,a=o.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:c,iterations:1}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){for(var r,n=this.cfg,o=n.hasher.create(),c=i.create(),a=c.words,s=n.keySize,u=n.iterations;a.length>>6-c%4*2,u=a|s;n[o>>>2]|=u<<24-o%4*8,o++}return i.create(n,o)}var r=t,n=r.lib,i=n.WordArray,o=r.enc;o.Base64={stringify:function(t){var e=t.words,r=t.sigBytes,n=this._map;t.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255,a=e[o+1>>>2]>>>24-(o+1)%4*8&255,s=e[o+2>>>2]>>>24-(o+2)%4*8&255,u=c<<16|a<<8|s,f=0;f<4&&o+.75*f>>6*(3-f)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(t){var r=t.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o>>2];t.sigBytes-=e}},g=(n.BlockCipher=h.extend({cfg:h.cfg.extend({mode:l,padding:v}),reset:function(){var t;h.reset.call(this);var e=this.cfg,r=e.iv,n=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=n.createEncryptor:(t=n.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(n,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),n.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),_=r.format={},k=_.OpenSSL={stringify:function(t){var e,r=t.ciphertext,n=t.salt;return e=n?o.create([1398893684,1701076831]).concat(n).concat(r):r,e.toString(s)},parse:function(t){var e,r=s.parse(t),n=r.words;return 1398893684==n[0]&&1701076831==n[1]&&(e=o.create(n.slice(2,4)),n.splice(0,4),r.sigBytes-=16),g.create({ciphertext:r,salt:e})}},m=n.SerializableCipher=i.extend({cfg:i.extend({format:k}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=t.createEncryptor(r,n),o=i.finalize(e),c=i.cfg;return g.create({ciphertext:o,key:r,iv:c.iv,algorithm:t,mode:c.mode,padding:c.padding,blockSize:t.blockSize,formatter:n.format})},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=t.createDecryptor(r,n).finalize(e.ciphertext);return i},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),S=r.kdf={},B=S.OpenSSL={execute:function(t,e,r,n){n||(n=o.random(8));var i=f.create({keySize:e+r}).compute(t,n),c=o.create(i.words.slice(e),4*r);return i.sigBytes=4*e,g.create({key:i,iv:c,salt:n})}},w=n.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:B}),encrypt:function(t,e,r,n){n=this.cfg.extend(n);var i=n.kdf.execute(r,t.keySize,t.ivSize);n.iv=i.iv;var o=m.encrypt.call(this,t,e,i.key,n);return o.mixIn(i),o},decrypt:function(t,e,r,n){n=this.cfg.extend(n),e=this._parse(e,n.format);var i=n.kdf.execute(r,t.keySize,t.ivSize,e.salt);n.iv=i.iv;var o=m.decrypt.call(this,t,e,i.key,n);return o}})}()}),function(t,e,r){e(t.CryptoJS)}(y,function(t){return function(){var e=t,r=e.lib,n=r.BlockCipher,i=e.algo,o=[],c=[],a=[],s=[],u=[],f=[],h=[],d=[],p=[],l=[];!function(){for(var t=[],e=0;e<256;e++)e<128?t[e]=e<<1:t[e]=e<<1^283;for(var r=0,n=0,e=0;e<256;e++){var i=n^n<<1^n<<2^n<<3^n<<4;i=i>>>8^255&i^99,o[r]=i,c[i]=r;var y=t[r],v=t[y],g=t[v],_=257*t[i]^16843008*i;a[r]=_<<24|_>>>8,s[r]=_<<16|_>>>16,u[r]=_<<8|_>>>24,f[r]=_;var _=16843009*g^65537*v^257*y^16843008*r;h[i]=_<<24|_>>>8,d[i]=_<<16|_>>>16,p[i]=_<<8|_>>>24,l[i]=_,r?(r=y^t[t[t[g^y]]],n^=t[t[n]]):r=n=1}}();var y=[0,1,2,4,8,16,32,64,128,27,54],v=i.AES=n.extend({_doReset:function(){var t;if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,r=e.words,n=e.sigBytes/4,i=this._nRounds=n+6,c=4*(i+1),a=this._keySchedule=[],s=0;s6&&s%n==4&&(t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t]):(t=t<<8|t>>>24,t=o[t>>>24]<<24|o[t>>>16&255]<<16|o[t>>>8&255]<<8|o[255&t],t^=y[s/n|0]<<24),a[s]=a[s-n]^t);for(var u=this._invKeySchedule=[],f=0;f>>24]]^d[o[t>>>16&255]]^p[o[t>>>8&255]]^l[o[255&t]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,a,s,u,f,o)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,h,d,p,l,c);var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,n,i,o,c,a){for(var s=this._nRounds,u=t[e]^r[0],f=t[e+1]^r[1],h=t[e+2]^r[2],d=t[e+3]^r[3],p=4,l=1;l>>24]^i[f>>>16&255]^o[h>>>8&255]^c[255&d]^r[p++],v=n[f>>>24]^i[h>>>16&255]^o[d>>>8&255]^c[255&u]^r[p++],g=n[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^c[255&f]^r[p++],_=n[d>>>24]^i[u>>>16&255]^o[f>>>8&255]^c[255&h]^r[p++];u=y,f=v,h=g,d=_}var y=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[h>>>8&255]<<8|a[255&d])^r[p++],v=(a[f>>>24]<<24|a[h>>>16&255]<<16|a[d>>>8&255]<<8|a[255&u])^r[p++],g=(a[h>>>24]<<24|a[d>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[p++],_=(a[d>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&h])^r[p++];t[e]=y,t[e+1]=v,t[e+2]=g,t[e+3]=_},keySize:8});e.AES=n._createHelper(v)}(),t.AES});var v,g,_,k,m=function(){function t(){return r=(9301*r+49297)%233280,r/233280}var e=new Date,r=e.getTime();return function(e){return Math.ceil(t()*e)}}(),S=y.CryptoJS,B=window.console&&window.console.log||function(){},w={init:function(t,e){return g=t,B=g&&g.log||B,t&&t.kit&&t.kit.encodeTrackData?void(h(e,"\u521d\u59cb\u914d\u7f6econfig")&&h(e.k,"\u521d\u59cb\u53c2\u6570k")&&h(e.kid,"\u521d\u59cb\u53c2\u6570kid")&&h(e.khash,"\u521d\u59cb\u53c2\u6570khash")&&d(e.k,"\u521d\u59cb\u53c2\u6570k","string")&&d(e.khash,"\u521d\u59cb\u53c2\u6570khash","string")&&d(e.kid,"\u521d\u59cb\u53c2\u6570kid","number")?(_=e,v=s(),k=g.kit.encodeTrackData,g.kit.encodeTrackData=f,B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25")):void B("AES\u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301AES\u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")},encrypt:function(t,e,r){return p(!0,t,e,r)},decrypt:function(t,e,r){return p(!1,t,e,r)}},x=r(w,"AesEncryption","sdkReady");return x}(); \ No newline at end of file diff --git a/dist/web/plugin/ajax-sender/index.closure.js b/dist/web/plugin/ajax-sender/index.closure.js index a653014f..06a587c0 100644 --- a/dist/web/plugin/ajax-sender/index.closure.js +++ b/dist/web/plugin/ajax-sender/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return r(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(t,u)}}return n}function r(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function e(r,e,t){return n(r,e,t),r.plugin_version=c,r}function t(n){var r=new l.AjaxSend(n);r.start()}function a(n,r){var e=null,a=null;l.isObject(n.config)&&(e=n.config.send_type,a=l.optimizeServerUrl(n.config.server_url));var i="ajax"===e||!e&&"ajax"===u.para.send_type;if(i&&l.isSupportCors()){var o=a||n.server_url;n.server_url=o,n.data=u.kit.encodeTrackData(n.data),l.isArray(o)&&o.length?l.each(o,function(r){n.callback=null,n.server_url=r,t(n)}):"string"==typeof o&&""!==o?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),r.cancellationToken.stop()}return n}function i(){"ajax"!==u.para.send_type||l.isSupportCors()||(u.para.send_type="image")}function o(){u.on("sdkInitPara",function(){i()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:120,entry:a}})})}var u,l,c="1.26.8",s={plugin_name:"AjaxSender",init:function(n){u=n,l=u._,o()}},f=e(s);return f}(); \ No newline at end of file +!function(){"use strict";function n(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return r(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(t,u)}}return n}function r(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function e(r,e,t){return n(r,e,t),r.plugin_version=c,r}function t(n){var r=new l.AjaxSend(n);r.start()}function a(n,r){var e=null,a=null;l.isObject(n.config)&&(e=n.config.send_type,a=l.optimizeServerUrl(n.config.server_url));var i="ajax"===e||!e&&"ajax"===u.para.send_type;if(i&&l.isSupportCors()){var o=a||n.server_url;n.server_url=o,n.data=u.kit.encodeTrackData(n.data),l.isArray(o)&&o.length?l.each(o,function(r){n.callback=null,n.server_url=r,t(n)}):"string"==typeof o&&""!==o?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),r.cancellationToken.stop()}return n}function i(){"ajax"!==u.para.send_type||l.isSupportCors()||(u.para.send_type="image")}function o(){u.on("sdkInitPara",function(){i()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:120,entry:a}})})}var u,l,c="1.26.9",s={plugin_name:"AjaxSender",init:function(n){u=n,l=u._,o()}},f=e(s);return f}(); \ No newline at end of file diff --git a/dist/web/plugin/ajax-sender/index.es6.js b/dist/web/plugin/ajax-sender/index.es6.js index 15c20e96..d1f5d959 100644 --- a/dist/web/plugin/ajax-sender/index.es6.js +++ b/dist/web/plugin/ajax-sender/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}function sendData(n){new _.AjaxSend(n).start()}function sendInterceptor(n,e){var r=null,t=null;if(_.isObject(n.config)&&(r=n.config.send_type,t=_.optimizeServerUrl(n.config.server_url)),("ajax"===r||!r&&"ajax"===sd.para.send_type)&&_.isSupportCors()){var a=t||n.server_url;n.server_url=a,n.data=sd.kit.encodeTrackData(n.data),_.isArray(a)&&a.length?_.each(a,function(e){n.callback=null,n.server_url=e,sendData(n)}):"string"==typeof a&&""!==a?sendData(n):sd.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function initPara(){"ajax"!==sd.para.send_type||_.isSupportCors()||(sd.para.send_type="image")}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:120,entry:sendInterceptor}})})}var AjaxSender={plugin_name:"AjaxSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(AjaxSender);export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}function sendData(n){new _.AjaxSend(n).start()}function sendInterceptor(n,e){var r=null,t=null;if(_.isObject(n.config)&&(r=n.config.send_type,t=_.optimizeServerUrl(n.config.server_url)),("ajax"===r||!r&&"ajax"===sd.para.send_type)&&_.isSupportCors()){var a=t||n.server_url;n.server_url=a,n.data=sd.kit.encodeTrackData(n.data),_.isArray(a)&&a.length?_.each(a,function(e){n.callback=null,n.server_url=e,sendData(n)}):"string"==typeof a&&""!==a?sendData(n):sd.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function initPara(){"ajax"!==sd.para.send_type||_.isSupportCors()||(sd.para.send_type="image")}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:120,entry:sendInterceptor}})})}var AjaxSender={plugin_name:"AjaxSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(AjaxSender);export default index; \ No newline at end of file diff --git a/dist/web/plugin/ajax-sender/index.js b/dist/web/plugin/ajax-sender/index.js index 84be9c00..989e12ef 100644 --- a/dist/web/plugin/ajax-sender/index.js +++ b/dist/web/plugin/ajax-sender/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AjaxSender=function(){"use strict";function n(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return r(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(t,u)}}return n}function r(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function e(r,e,t){return n(r,e,t),r.plugin_version=s,r}function t(n){var r=new l.AjaxSend(n);r.start()}function a(n,r){var e=null,a=null;l.isObject(n.config)&&(e=n.config.send_type,a=l.optimizeServerUrl(n.config.server_url));var i="ajax"===e||!e&&"ajax"===u.para.send_type;if(i&&l.isSupportCors()){var o=a||n.server_url;n.server_url=o,n.data=u.kit.encodeTrackData(n.data),l.isArray(o)&&o.length?l.each(o,function(r){n.callback=null,n.server_url=r,t(n)}):"string"==typeof o&&""!==o?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),r.cancellationToken.stop()}return n}function i(){"ajax"!==u.para.send_type||l.isSupportCors()||(u.para.send_type="image")}function o(){u.on("sdkInitPara",function(){i()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:120,entry:a}})})}var u,l,s="1.26.8",c={plugin_name:"AjaxSender",init:function(n){u=n,l=u._,o()}},g=e(c);return g}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AjaxSender=function(){"use strict";function n(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return r(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(t,u)}}return n}function r(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function e(r,e,t){return n(r,e,t),r.plugin_version=s,r}function t(n){var r=new l.AjaxSend(n);r.start()}function a(n,r){var e=null,a=null;l.isObject(n.config)&&(e=n.config.send_type,a=l.optimizeServerUrl(n.config.server_url));var i="ajax"===e||!e&&"ajax"===u.para.send_type;if(i&&l.isSupportCors()){var o=a||n.server_url;n.server_url=o,n.data=u.kit.encodeTrackData(n.data),l.isArray(o)&&o.length?l.each(o,function(r){n.callback=null,n.server_url=r,t(n)}):"string"==typeof o&&""!==o?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),r.cancellationToken.stop()}return n}function i(){"ajax"!==u.para.send_type||l.isSupportCors()||(u.para.send_type="image")}function o(){u.on("sdkInitPara",function(){i()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:120,entry:a}})})}var u,l,s="1.26.9",c={plugin_name:"AjaxSender",init:function(n){u=n,l=u._,o()}},g=e(c);return g}(); \ No newline at end of file diff --git a/dist/web/plugin/amp/index.closure.js b/dist/web/plugin/amp/index.closure.js index c2524e05..60a666d2 100644 --- a/dist/web/plugin/amp/index.closure.js +++ b/dist/web/plugin/amp/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function t(t,n,s){if(n&&(t.plugin_name=n),s&&t.init){var e=t.init;t.init=function(r,d){function o(){e.call(t,r,d)}return i(r,t,n),r.readyState&&r.readyState.state>=3||!r.on?o():void r.on(s,o)}}return t}function i(t,i,n){function s(i,s){t.logger?t.logger.msg.apply(t.logger,s).module(n+""||"").level(i).log():t.log&&t.log.apply(t,s)}i.log=function(){s("log",arguments)},i.warn=function(){s("warn",arguments)},i.error=function(){s("error",arguments)}}function n(i,n,e){return t(i,n,e),i.plugin_version=s,i}var s="1.26.8",e={sd:null,init:function(t){if(this.sd)return!1;if(this.sd=t,!this.sd||!this.sd._)return!1;var i=this.sd._.cookie.get("sensors_amp_id"),n=this.sd.store._state.distinct_id;if(i&&i.length>0){var s="amp-"===i.slice(0,4);if(i!==n){if(!s)return!1;this.sd.store._state.first_id?(this.sd.identify(i,!0),this.sd.saEvent.send({original_id:i,distinct_id:n,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(n)):this.sd.identify(i,!0)}}else this.setAmpId(n);this.addListener()},addListener:function(){var t=this;this.sd.events.on("changeDistinctId",function(i){t.setAmpId(i)}),this.sd.events.isReady()},setAmpId:function(t){this.sd._.cookie.set("sensors_amp_id",t)}},r=n(e,"Amp","sdkReady");return r}(); \ No newline at end of file +!function(){"use strict";function t(t,n,s){if(n&&(t.plugin_name=n),s&&t.init){var e=t.init;t.init=function(r,d){function o(){e.call(t,r,d)}return i(r,t,n),r.readyState&&r.readyState.state>=3||!r.on?o():void r.on(s,o)}}return t}function i(t,i,n){function s(i,s){t.logger?t.logger.msg.apply(t.logger,s).module(n+""||"").level(i).log():t.log&&t.log.apply(t,s)}i.log=function(){s("log",arguments)},i.warn=function(){s("warn",arguments)},i.error=function(){s("error",arguments)}}function n(i,n,e){return t(i,n,e),i.plugin_version=s,i}var s="1.26.9",e={sd:null,init:function(t){if(this.sd)return!1;if(this.sd=t,!this.sd||!this.sd._)return!1;var i=this.sd._.cookie.get("sensors_amp_id"),n=this.sd.store._state.distinct_id;if(i&&i.length>0){var s="amp-"===i.slice(0,4);if(i!==n){if(!s)return!1;this.sd.store._state.first_id?(this.sd.identify(i,!0),this.sd.saEvent.send({original_id:i,distinct_id:n,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(n)):this.sd.identify(i,!0)}}else this.setAmpId(n);this.addListener()},addListener:function(){var t=this;this.sd.events.on("changeDistinctId",function(i){t.setAmpId(i)}),this.sd.events.isReady()},setAmpId:function(t){this.sd._.cookie.set("sensors_amp_id",t)}},r=n(e,"Amp","sdkReady");return r}(); \ No newline at end of file diff --git a/dist/web/plugin/amp/index.es6.js b/dist/web/plugin/amp/index.es6.js index e1fe3c1e..91dca7a4 100644 --- a/dist/web/plugin/amp/index.es6.js +++ b/dist/web/plugin/amp/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.26.8";function wrapPluginInitFn(i,t,n){if(t&&(i.plugin_name=t),n&&i.init){var e=i.init;i.init=function(s,r){if(wrapLogFn(s,i,t),s.readyState&&s.readyState.state>=3||!s.on)return d();function d(){e.call(i,s,r)}s.on(n,d)}}return i}function wrapLogFn(i,t,n){function e(t,e){i.logger?i.logger.msg.apply(i.logger,e).module(n+""||"").level(t).log():i.log&&i.log.apply(i,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function createPlugin(i,t,n){return wrapPluginInitFn(i,t,n),i.plugin_version=sdkversion_placeholder,i}var amp={sd:null,init:function(i){if(this.sd)return!1;if(this.sd=i,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),n=this.sd.store._state.distinct_id;if(t&&t.length>0){var e="amp-"===t.slice(0,4);if(t!==n){if(!e)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:n,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(n)):this.sd.identify(t,!0)}}else this.setAmpId(n);this.addListener()},addListener:function(){var i=this;this.sd.events.on("changeDistinctId",function(t){i.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(i){this.sd._.cookie.set("sensors_amp_id",i)}},index=createPlugin(amp,"Amp","sdkReady");export default index; \ No newline at end of file +var sdkversion_placeholder="1.26.9";function wrapPluginInitFn(i,t,n){if(t&&(i.plugin_name=t),n&&i.init){var e=i.init;i.init=function(s,r){if(wrapLogFn(s,i,t),s.readyState&&s.readyState.state>=3||!s.on)return d();function d(){e.call(i,s,r)}s.on(n,d)}}return i}function wrapLogFn(i,t,n){function e(t,e){i.logger?i.logger.msg.apply(i.logger,e).module(n+""||"").level(t).log():i.log&&i.log.apply(i,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function createPlugin(i,t,n){return wrapPluginInitFn(i,t,n),i.plugin_version=sdkversion_placeholder,i}var amp={sd:null,init:function(i){if(this.sd)return!1;if(this.sd=i,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),n=this.sd.store._state.distinct_id;if(t&&t.length>0){var e="amp-"===t.slice(0,4);if(t!==n){if(!e)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:n,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(n)):this.sd.identify(t,!0)}}else this.setAmpId(n);this.addListener()},addListener:function(){var i=this;this.sd.events.on("changeDistinctId",function(t){i.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(i){this.sd._.cookie.set("sensors_amp_id",i)}},index=createPlugin(amp,"Amp","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/amp/index.js b/dist/web/plugin/amp/index.js index f7441f7a..e27f954d 100644 --- a/dist/web/plugin/amp/index.js +++ b/dist/web/plugin/amp/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Amp=function(){"use strict";function t(t,n,s){if(n&&(t.plugin_name=n),s&&t.init){var e=t.init;t.init=function(r,o){function d(){e.call(t,r,o)}return i(r,t,n),r.readyState&&r.readyState.state>=3||!r.on?d():void r.on(s,d)}}return t}function i(t,i,n){function s(i,s){t.logger?t.logger.msg.apply(t.logger,s).module(n+""||"").level(i).log():t.log&&t.log.apply(t,s)}i.log=function(){s("log",arguments)},i.warn=function(){s("warn",arguments)},i.error=function(){s("error",arguments)}}function n(i,n,e){return t(i,n,e),i.plugin_version=s,i}var s="1.26.8",e={sd:null,init:function(t){if(this.sd)return!1;if(this.sd=t,!this.sd||!this.sd._)return!1;var i=this.sd._.cookie.get("sensors_amp_id"),n=this.sd.store._state.distinct_id;if(i&&i.length>0){var s="amp-"===i.slice(0,4);if(i!==n){if(!s)return!1;this.sd.store._state.first_id?(this.sd.identify(i,!0),this.sd.saEvent.send({original_id:i,distinct_id:n,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(n)):this.sd.identify(i,!0)}}else this.setAmpId(n);this.addListener()},addListener:function(){var t=this;this.sd.events.on("changeDistinctId",function(i){t.setAmpId(i)}),this.sd.events.isReady()},setAmpId:function(t){this.sd._.cookie.set("sensors_amp_id",t)}},r=n(e,"Amp","sdkReady");return r}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Amp=function(){"use strict";function t(t,n,s){if(n&&(t.plugin_name=n),s&&t.init){var e=t.init;t.init=function(r,o){function d(){e.call(t,r,o)}return i(r,t,n),r.readyState&&r.readyState.state>=3||!r.on?d():void r.on(s,d)}}return t}function i(t,i,n){function s(i,s){t.logger?t.logger.msg.apply(t.logger,s).module(n+""||"").level(i).log():t.log&&t.log.apply(t,s)}i.log=function(){s("log",arguments)},i.warn=function(){s("warn",arguments)},i.error=function(){s("error",arguments)}}function n(i,n,e){return t(i,n,e),i.plugin_version=s,i}var s="1.26.9",e={sd:null,init:function(t){if(this.sd)return!1;if(this.sd=t,!this.sd||!this.sd._)return!1;var i=this.sd._.cookie.get("sensors_amp_id"),n=this.sd.store._state.distinct_id;if(i&&i.length>0){var s="amp-"===i.slice(0,4);if(i!==n){if(!s)return!1;this.sd.store._state.first_id?(this.sd.identify(i,!0),this.sd.saEvent.send({original_id:i,distinct_id:n,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(n)):this.sd.identify(i,!0)}}else this.setAmpId(n);this.addListener()},addListener:function(){var t=this;this.sd.events.on("changeDistinctId",function(i){t.setAmpId(i)}),this.sd.events.isReady()},setAmpId:function(t){this.sd._.cookie.set("sensors_amp_id",t)}},r=n(e,"Amp","sdkReady");return r}(); \ No newline at end of file diff --git a/dist/web/plugin/android-bridge/index.closure.js b/dist/web/plugin/android-bridge/index.closure.js index 94cad162..7a4883cb 100644 --- a/dist/web/plugin/android-bridge/index.closure.js +++ b/dist/web/plugin/android-bridge/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e){return y&&y.call(f,JSON.stringify(e))}function i(e){return v.call(f)&&b&&b.call(f,JSON.stringify(e))}function r(e,i){return i&&"function"==typeof i[e.callType]&&i[e.callType]()}function a(e,i,r){if(i&&(e.plugin_name=i),r&&e.init){var a=e.init;e.init=function(s,t){function o(){a.call(e,s,t)}return n(s,e,i),s.readyState&&s.readyState.state>=3||!s.on?o():void s.on(r,o)}}return e}function n(e,i,r){function a(i,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(i).log():e.log&&e.log.apply(e,a)}i.log=function(){a("log",arguments)},i.warn=function(){a("warn",arguments)},i.error=function(){a("error",arguments)}}function s(e,i,r){return a(e,i,r),e.plugin_version=w,e}function t(){if(c=window.SensorsData_APP_New_H5_Bridge,_=c&&c.sensorsdata_track,l=_&&c.sensorsdata_get_server_url&&c.sensorsdata_get_server_url(),p("---test---fail---",!u,u.bridge.activeBridge,!l),u&&!u.bridge.activeBridge&&l)return u.bridge.activeBridge=j,u.para.app_js_bridge&&!u.para.app_js_bridge.is_mui&&(u.bridge.is_verify_success=l&&u.bridge.validateAppUrl(l),p("---test---bridge-verify-",u.bridge.is_verify_success)),u.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:u.bridge.is_verify_success?"success":"fail",support_two_way_call:!!c.sensorsdata_js_call_app},u.para.app_js_bridge?void u.registerInterceptor("sendDataStage",{send:{priority:60,entry:o}}):void p("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function o(e,i){if(p("---test---datasend-",u.bridge.is_verify_success),u.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return u.bridge.is_verify_success?(p("---test---bridge-verify-success---",e.data),_&&_.call(c,JSON.stringify(g.extend({server_url:u.para.server_url},e.data))),g.isFunction(r)&&r(),i.cancellationToken.cancel(),e):(p("---test---bridge-verify-fail-----",u.bridge.is_verify_success),u.para.app_js_bridge.is_send?(u.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(g.isFunction(r)&&r(),i.cancellationToken.cancel(),e))}function d(e){var i=e.callType;return i in m.commands?m.commands[i](e,c):void(c&&g.isFunction(c.sensorsdata_js_call_app)&&c.sensorsdata_js_call_app(JSON.stringify(e)))}var c,_,l,u,g,p,f=window.SensorsData_App_Visual_Bridge,v=f&&f.sensorsdata_visualized_mode,y=f&&f.sensorsdata_visualized_alert_info,b=f&&f.sensorsdata_hover_web_nodes,m={isVerify:function(){return v&&(v===!0||v.call(f))},commands:{app_alert:e,visualized_track:i,page_info:i,sensorsdata_get_app_visual_config:r}},w="1.26.8",j={init:function(e){u=e,g=u&&u._,p=u&&u.log||console&&console.log||function(){},t()},handleCommand:d},S=s(j,"AndroidBridge","sdkAfterInitPara");return S}(); \ No newline at end of file +!function(){"use strict";function e(e){return y&&y.call(f,JSON.stringify(e))}function i(e){return v.call(f)&&b&&b.call(f,JSON.stringify(e))}function r(e,i){return i&&"function"==typeof i[e.callType]&&i[e.callType]()}function a(e,i,r){if(i&&(e.plugin_name=i),r&&e.init){var a=e.init;e.init=function(s,t){function o(){a.call(e,s,t)}return n(s,e,i),s.readyState&&s.readyState.state>=3||!s.on?o():void s.on(r,o)}}return e}function n(e,i,r){function a(i,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(i).log():e.log&&e.log.apply(e,a)}i.log=function(){a("log",arguments)},i.warn=function(){a("warn",arguments)},i.error=function(){a("error",arguments)}}function s(e,i,r){return a(e,i,r),e.plugin_version=w,e}function t(){if(c=window.SensorsData_APP_New_H5_Bridge,_=c&&c.sensorsdata_track,l=_&&c.sensorsdata_get_server_url&&c.sensorsdata_get_server_url(),p("---test---fail---",!u,u.bridge.activeBridge,!l),u&&!u.bridge.activeBridge&&l)return u.bridge.activeBridge=j,u.para.app_js_bridge&&!u.para.app_js_bridge.is_mui&&(u.bridge.is_verify_success=l&&u.bridge.validateAppUrl(l),p("---test---bridge-verify-",u.bridge.is_verify_success)),u.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:u.bridge.is_verify_success?"success":"fail",support_two_way_call:!!c.sensorsdata_js_call_app},u.para.app_js_bridge?void u.registerInterceptor("sendDataStage",{send:{priority:60,entry:o}}):void p("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function o(e,i){if(p("---test---datasend-",u.bridge.is_verify_success),u.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return u.bridge.is_verify_success?(p("---test---bridge-verify-success---",e.data),_&&_.call(c,JSON.stringify(g.extend({server_url:u.para.server_url},e.data))),g.isFunction(r)&&r(),i.cancellationToken.cancel(),e):(p("---test---bridge-verify-fail-----",u.bridge.is_verify_success),u.para.app_js_bridge.is_send?(u.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(g.isFunction(r)&&r(),i.cancellationToken.cancel(),e))}function d(e){var i=e.callType;return i in m.commands?m.commands[i](e,c):void(c&&g.isFunction(c.sensorsdata_js_call_app)&&c.sensorsdata_js_call_app(JSON.stringify(e)))}var c,_,l,u,g,p,f=window.SensorsData_App_Visual_Bridge,v=f&&f.sensorsdata_visualized_mode,y=f&&f.sensorsdata_visualized_alert_info,b=f&&f.sensorsdata_hover_web_nodes,m={isVerify:function(){return v&&(v===!0||v.call(f))},commands:{app_alert:e,visualized_track:i,page_info:i,sensorsdata_get_app_visual_config:r}},w="1.26.9",j={init:function(e){u=e,g=u&&u._,p=u&&u.log||console&&console.log||function(){},t()},handleCommand:d},S=s(j,"AndroidBridge","sdkAfterInitPara");return S}(); \ No newline at end of file diff --git a/dist/web/plugin/android-bridge/index.es6.js b/dist/web/plugin/android-bridge/index.es6.js index 1440bbb2..4a3eef62 100644 --- a/dist/web/plugin/android-bridge/index.es6.js +++ b/dist/web/plugin/android-bridge/index.es6.js @@ -1 +1 @@ -var 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,r){return r&&"function"==typeof r[e.callType]&&r[e.callType]()}var anBridge,anTrack,anServerUrl,sd,_,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="1.26.8";function wrapPluginInitFn(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var i=e.init;e.init=function(n,d){if(wrapLogFn(n,e,r),n.readyState&&n.readyState.state>=3||!n.on)return s();function s(){i.call(e,n,d)}n.on(a,s)}}return e}function wrapLogFn(e,r,a){function i(r,i){e.logger?e.logger.msg.apply(e.logger,i).module(a+""||"").level(r).log():e.log&&e.log.apply(e,i)}r.log=function(){i("log",arguments)},r.warn=function(){i("warn",arguments)},r.error=function(){i("error",arguments)}}function createPlugin(e,r,a){return wrapPluginInitFn(e,r,a),e.plugin_version=sdkversion_placeholder,e}var AndroidBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.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(),log("---test---fail---",!sd,sd.bridge.activeBridge,!anServerUrl),sd&&!sd.bridge.activeBridge&&anServerUrl&&(sd.bridge.activeBridge=AndroidBridge,sd.para.app_js_bridge&&!sd.para.app_js_bridge.is_mui&&(sd.bridge.is_verify_success=anServerUrl&&sd.bridge.validateAppUrl(anServerUrl),log("---test---bridge-verify-",sd.bridge.is_verify_success)),sd.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:sd.bridge.is_verify_success?"success":"fail",support_two_way_call:!!anBridge.sensorsdata_js_call_app},sd.para.app_js_bridge?sd.registerInterceptor("sendDataStage",{send:{priority:60,entry:sendData}}):log("---test---app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,r){if(log("---test---datasend-",sd.bridge.is_verify_success),sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var a=e.callback;return sd.bridge.is_verify_success?(log("---test---bridge-verify-success---",e.data),anTrack&&anTrack.call(anBridge,JSON.stringify(_.extend({server_url:sd.para.server_url},e.data))),_.isFunction(a)&&a(),r.cancellationToken.cancel(),e):(log("---test---bridge-verify-fail-----",sd.bridge.is_verify_success),sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_.isFunction(a)&&a(),r.cancellationToken.cancel(),e))}function handleCommand(e){var r=e.callType;if(r in vbridge$1.commands)return vbridge$1.commands[r](e,anBridge);anBridge&&_.isFunction(anBridge.sensorsdata_js_call_app)&&anBridge.sensorsdata_js_call_app(JSON.stringify(e))}var index=createPlugin(AndroidBridge,"AndroidBridge","sdkAfterInitPara");export default index; \ No newline at end of file +var 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,r){return r&&"function"==typeof r[e.callType]&&r[e.callType]()}var anBridge,anTrack,anServerUrl,sd,_,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="1.26.9";function wrapPluginInitFn(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var i=e.init;e.init=function(n,d){if(wrapLogFn(n,e,r),n.readyState&&n.readyState.state>=3||!n.on)return s();function s(){i.call(e,n,d)}n.on(a,s)}}return e}function wrapLogFn(e,r,a){function i(r,i){e.logger?e.logger.msg.apply(e.logger,i).module(a+""||"").level(r).log():e.log&&e.log.apply(e,i)}r.log=function(){i("log",arguments)},r.warn=function(){i("warn",arguments)},r.error=function(){i("error",arguments)}}function createPlugin(e,r,a){return wrapPluginInitFn(e,r,a),e.plugin_version=sdkversion_placeholder,e}var AndroidBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.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(),log("---test---fail---",!sd,sd.bridge.activeBridge,!anServerUrl),sd&&!sd.bridge.activeBridge&&anServerUrl&&(sd.bridge.activeBridge=AndroidBridge,sd.para.app_js_bridge&&!sd.para.app_js_bridge.is_mui&&(sd.bridge.is_verify_success=anServerUrl&&sd.bridge.validateAppUrl(anServerUrl),log("---test---bridge-verify-",sd.bridge.is_verify_success)),sd.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:sd.bridge.is_verify_success?"success":"fail",support_two_way_call:!!anBridge.sensorsdata_js_call_app},sd.para.app_js_bridge?sd.registerInterceptor("sendDataStage",{send:{priority:60,entry:sendData}}):log("---test---app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,r){if(log("---test---datasend-",sd.bridge.is_verify_success),sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var a=e.callback;return sd.bridge.is_verify_success?(log("---test---bridge-verify-success---",e.data),anTrack&&anTrack.call(anBridge,JSON.stringify(_.extend({server_url:sd.para.server_url},e.data))),_.isFunction(a)&&a(),r.cancellationToken.cancel(),e):(log("---test---bridge-verify-fail-----",sd.bridge.is_verify_success),sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_.isFunction(a)&&a(),r.cancellationToken.cancel(),e))}function handleCommand(e){var r=e.callType;if(r in vbridge$1.commands)return vbridge$1.commands[r](e,anBridge);anBridge&&_.isFunction(anBridge.sensorsdata_js_call_app)&&anBridge.sensorsdata_js_call_app(JSON.stringify(e))}var index=createPlugin(AndroidBridge,"AndroidBridge","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/android-bridge/index.js b/dist/web/plugin/android-bridge/index.js index 2bdfd810..b4e94ec1 100644 --- a/dist/web/plugin/android-bridge/index.js +++ b/dist/web/plugin/android-bridge/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AndroidBridge=function(){"use strict";function e(e){return b&&b.call(f,JSON.stringify(e))}function i(e){return v.call(f)&&y&&y.call(f,JSON.stringify(e))}function r(e,i){return i&&"function"==typeof i[e.callType]&&i[e.callType]()}function a(e,i,r){if(i&&(e.plugin_name=i),r&&e.init){var a=e.init;e.init=function(s,t){function o(){a.call(e,s,t)}return n(s,e,i),s.readyState&&s.readyState.state>=3||!s.on?o():void s.on(r,o)}}return e}function n(e,i,r){function a(i,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(i).log():e.log&&e.log.apply(e,a)}i.log=function(){a("log",arguments)},i.warn=function(){a("warn",arguments)},i.error=function(){a("error",arguments)}}function s(e,i,r){return a(e,i,r),e.plugin_version=w,e}function t(){if(c=window.SensorsData_APP_New_H5_Bridge,_=c&&c.sensorsdata_track,l=_&&c.sensorsdata_get_server_url&&c.sensorsdata_get_server_url(),p("---test---fail---",!u,u.bridge.activeBridge,!l),u&&!u.bridge.activeBridge&&l)return u.bridge.activeBridge=S,u.para.app_js_bridge&&!u.para.app_js_bridge.is_mui&&(u.bridge.is_verify_success=l&&u.bridge.validateAppUrl(l),p("---test---bridge-verify-",u.bridge.is_verify_success)),u.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:u.bridge.is_verify_success?"success":"fail",support_two_way_call:!!c.sensorsdata_js_call_app},u.para.app_js_bridge?void u.registerInterceptor("sendDataStage",{send:{priority:60,entry:o}}):void p("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function o(e,i){if(p("---test---datasend-",u.bridge.is_verify_success),u.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return u.bridge.is_verify_success?(p("---test---bridge-verify-success---",e.data),_&&_.call(c,JSON.stringify(g.extend({server_url:u.para.server_url},e.data))),g.isFunction(r)&&r(),i.cancellationToken.cancel(),e):(p("---test---bridge-verify-fail-----",u.bridge.is_verify_success),u.para.app_js_bridge.is_send?(u.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(g.isFunction(r)&&r(),i.cancellationToken.cancel(),e))}function d(e){var i=e.callType;return i in m.commands?m.commands[i](e,c):void(c&&g.isFunction(c.sensorsdata_js_call_app)&&c.sensorsdata_js_call_app(JSON.stringify(e)))}var c,_,l,u,g,p,f=window.SensorsData_App_Visual_Bridge,v=f&&f.sensorsdata_visualized_mode,b=f&&f.sensorsdata_visualized_alert_info,y=f&&f.sensorsdata_hover_web_nodes,m={isVerify:function(){return v&&(v===!0||v.call(f))},commands:{app_alert:e,visualized_track:i,page_info:i,sensorsdata_get_app_visual_config:r}},w="1.26.8",S={init:function(e){u=e,g=u&&u._,p=u&&u.log||console&&console.log||function(){},t()},handleCommand:d},j=s(S,"AndroidBridge","sdkAfterInitPara");return j}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AndroidBridge=function(){"use strict";function e(e){return b&&b.call(f,JSON.stringify(e))}function i(e){return v.call(f)&&y&&y.call(f,JSON.stringify(e))}function r(e,i){return i&&"function"==typeof i[e.callType]&&i[e.callType]()}function a(e,i,r){if(i&&(e.plugin_name=i),r&&e.init){var a=e.init;e.init=function(s,t){function o(){a.call(e,s,t)}return n(s,e,i),s.readyState&&s.readyState.state>=3||!s.on?o():void s.on(r,o)}}return e}function n(e,i,r){function a(i,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(i).log():e.log&&e.log.apply(e,a)}i.log=function(){a("log",arguments)},i.warn=function(){a("warn",arguments)},i.error=function(){a("error",arguments)}}function s(e,i,r){return a(e,i,r),e.plugin_version=w,e}function t(){if(c=window.SensorsData_APP_New_H5_Bridge,_=c&&c.sensorsdata_track,l=_&&c.sensorsdata_get_server_url&&c.sensorsdata_get_server_url(),p("---test---fail---",!u,u.bridge.activeBridge,!l),u&&!u.bridge.activeBridge&&l)return u.bridge.activeBridge=S,u.para.app_js_bridge&&!u.para.app_js_bridge.is_mui&&(u.bridge.is_verify_success=l&&u.bridge.validateAppUrl(l),p("---test---bridge-verify-",u.bridge.is_verify_success)),u.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:u.bridge.is_verify_success?"success":"fail",support_two_way_call:!!c.sensorsdata_js_call_app},u.para.app_js_bridge?void u.registerInterceptor("sendDataStage",{send:{priority:60,entry:o}}):void p("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function o(e,i){if(p("---test---datasend-",u.bridge.is_verify_success),u.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return u.bridge.is_verify_success?(p("---test---bridge-verify-success---",e.data),_&&_.call(c,JSON.stringify(g.extend({server_url:u.para.server_url},e.data))),g.isFunction(r)&&r(),i.cancellationToken.cancel(),e):(p("---test---bridge-verify-fail-----",u.bridge.is_verify_success),u.para.app_js_bridge.is_send?(u.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(g.isFunction(r)&&r(),i.cancellationToken.cancel(),e))}function d(e){var i=e.callType;return i in m.commands?m.commands[i](e,c):void(c&&g.isFunction(c.sensorsdata_js_call_app)&&c.sensorsdata_js_call_app(JSON.stringify(e)))}var c,_,l,u,g,p,f=window.SensorsData_App_Visual_Bridge,v=f&&f.sensorsdata_visualized_mode,b=f&&f.sensorsdata_visualized_alert_info,y=f&&f.sensorsdata_hover_web_nodes,m={isVerify:function(){return v&&(v===!0||v.call(f))},commands:{app_alert:e,visualized_track:i,page_info:i,sensorsdata_get_app_visual_config:r}},w="1.26.9",S={init:function(e){u=e,g=u&&u._,p=u&&u.log||console&&console.log||function(){},t()},handleCommand:d},j=s(S,"AndroidBridge","sdkAfterInitPara");return j}(); \ No newline at end of file diff --git a/dist/web/plugin/android-obsolete-bridge/index.closure.js b/dist/web/plugin/android-obsolete-bridge/index.closure.js index 31a9edf4..d1868624 100644 --- a/dist/web/plugin/android-obsolete-bridge/index.closure.js +++ b/dist/web/plugin/android-obsolete-bridge/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e){return y&&y.call(b,JSON.stringify(e))}function n(e){return v.call(b)&&m&&m.call(b,JSON.stringify(e))}function r(e,n){return n&&"function"==typeof n[e.callType]&&n[e.callType]()}function a(e,n,r){if(n&&(e.plugin_name=n),r&&e.init){var a=e.init;e.init=function(t,s){function o(){a.call(e,t,s)}return i(t,e,n),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(r,o)}}return e}function i(e,n,r){function a(n,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(n).log():e.log&&e.log.apply(e,a)}n.log=function(){a("log",arguments)},n.warn=function(){a("warn",arguments)},n.error=function(){a("error",arguments)}}function t(e,n,r){return a(e,n,r),e.plugin_version=B,e}function s(){if(f("ObsoleteBridge---test---init---"),d=window.SensorsData_APP_JS_Bridge,c=d&&d.sensorsdata_track,u=d&&d.sensorsdata_verify,_=d&&d.sensorsdata_visual_verify,f("ObsoleteBridge-",g.bridge.activeBridge,u,c,_),g&&!g.bridge.activeBridge&&(u||c||_)){g.bridge.activeBridge=S;var e=u||c;if(_&&(e=!!_.call(d,JSON.stringify({server_url:g.para.server_url})),f("ObsoleteBridge---called-return",e)),g.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!g.para.app_js_bridge)return void f("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");g.registerInterceptor("sendDataStage",{send:{priority:80,entry:o}}),f("Android obsolete bridge inits succeed.")}}function o(e,n){if(f("ObsoleteBridge---senddata"),g.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(u){var a=u&&u.call(d,JSON.stringify(p.extend({server_url:g.para.server_url},e.data)));return f("ObsoleteBridge---anVerify-success",a),a?(p.isFunction(r)&&r(),n.cancellationToken.cancel(),e):g.para.app_js_bridge.is_send?(g.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(p.isFunction(r)&&r(),n.cancellationToken.cancel(),e)}return f("ObsoleteBridge---is-send-old-way",g.para.app_js_bridge.is_send),c&&c.call(d,JSON.stringify(p.extend({server_url:g.para.server_url},e.data))),p.isFunction(r)&&r(),n.cancellationToken.cancel(),e}function l(e){f("ObsoleteBridge---handleCommadn");var n=e.callType;return n in O.commands?(f("ObsoleteBridge---",n,O.commands),O.commands[n](e,d)):d&&p.isFunction(d.sensorsdata_js_call_app)?(f("ObsoleteBridge---handleCommadn-abridge"),d.sensorsdata_js_call_app(JSON.stringify(e))):void 0}var d,c,u,_,g,p,f,b=window.SensorsData_App_Visual_Bridge,v=b&&b.sensorsdata_visualized_mode,y=b&&b.sensorsdata_visualized_alert_info,m=b&&b.sensorsdata_hover_web_nodes,O={isVerify:function(){return v&&(v===!0||v.call(b))},commands:{app_alert:e,visualized_track:n,page_info:n,sensorsdata_get_app_visual_config:r}},B="1.26.8",S={init:function(e){g=e,p=g&&g._,f=g&&g.log||console&&console.log||function(){},s()},handleCommand:l},w=t(S,"AndroidObsoleteBridge","sdkAfterInitPara");return w}(); \ No newline at end of file +!function(){"use strict";function e(e){return y&&y.call(b,JSON.stringify(e))}function n(e){return v.call(b)&&m&&m.call(b,JSON.stringify(e))}function r(e,n){return n&&"function"==typeof n[e.callType]&&n[e.callType]()}function a(e,n,r){if(n&&(e.plugin_name=n),r&&e.init){var a=e.init;e.init=function(t,s){function o(){a.call(e,t,s)}return i(t,e,n),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(r,o)}}return e}function i(e,n,r){function a(n,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(n).log():e.log&&e.log.apply(e,a)}n.log=function(){a("log",arguments)},n.warn=function(){a("warn",arguments)},n.error=function(){a("error",arguments)}}function t(e,n,r){return a(e,n,r),e.plugin_version=B,e}function s(){if(f("ObsoleteBridge---test---init---"),d=window.SensorsData_APP_JS_Bridge,c=d&&d.sensorsdata_track,u=d&&d.sensorsdata_verify,_=d&&d.sensorsdata_visual_verify,f("ObsoleteBridge-",g.bridge.activeBridge,u,c,_),g&&!g.bridge.activeBridge&&(u||c||_)){g.bridge.activeBridge=S;var e=u||c;if(_&&(e=!!_.call(d,JSON.stringify({server_url:g.para.server_url})),f("ObsoleteBridge---called-return",e)),g.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!g.para.app_js_bridge)return void f("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");g.registerInterceptor("sendDataStage",{send:{priority:80,entry:o}}),f("Android obsolete bridge inits succeed.")}}function o(e,n){if(f("ObsoleteBridge---senddata"),g.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(u){var a=u&&u.call(d,JSON.stringify(p.extend({server_url:g.para.server_url},e.data)));return f("ObsoleteBridge---anVerify-success",a),a?(p.isFunction(r)&&r(),n.cancellationToken.cancel(),e):g.para.app_js_bridge.is_send?(g.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(p.isFunction(r)&&r(),n.cancellationToken.cancel(),e)}return f("ObsoleteBridge---is-send-old-way",g.para.app_js_bridge.is_send),c&&c.call(d,JSON.stringify(p.extend({server_url:g.para.server_url},e.data))),p.isFunction(r)&&r(),n.cancellationToken.cancel(),e}function l(e){f("ObsoleteBridge---handleCommadn");var n=e.callType;return n in O.commands?(f("ObsoleteBridge---",n,O.commands),O.commands[n](e,d)):d&&p.isFunction(d.sensorsdata_js_call_app)?(f("ObsoleteBridge---handleCommadn-abridge"),d.sensorsdata_js_call_app(JSON.stringify(e))):void 0}var d,c,u,_,g,p,f,b=window.SensorsData_App_Visual_Bridge,v=b&&b.sensorsdata_visualized_mode,y=b&&b.sensorsdata_visualized_alert_info,m=b&&b.sensorsdata_hover_web_nodes,O={isVerify:function(){return v&&(v===!0||v.call(b))},commands:{app_alert:e,visualized_track:n,page_info:n,sensorsdata_get_app_visual_config:r}},B="1.26.9",S={init:function(e){g=e,p=g&&g._,f=g&&g.log||console&&console.log||function(){},s()},handleCommand:l},w=t(S,"AndroidObsoleteBridge","sdkAfterInitPara");return w}(); \ No newline at end of file diff --git a/dist/web/plugin/android-obsolete-bridge/index.es6.js b/dist/web/plugin/android-obsolete-bridge/index.es6.js index 4663ecad..0e44558d 100644 --- a/dist/web/plugin/android-obsolete-bridge/index.es6.js +++ b/dist/web/plugin/android-obsolete-bridge/index.es6.js @@ -1 +1 @@ -var 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,r){return r&&"function"==typeof r[e.callType]&&r[e.callType]()}var anBridge,anTrack,anVerify,anVisualVerify,sd,_,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="1.26.8";function wrapPluginInitFn(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var i=e.init;e.init=function(n,d){if(wrapLogFn(n,e,r),n.readyState&&n.readyState.state>=3||!n.on)return o();function o(){i.call(e,n,d)}n.on(a,o)}}return e}function wrapLogFn(e,r,a){function i(r,i){e.logger?e.logger.msg.apply(e.logger,i).module(a+""||"").level(r).log():e.log&&e.log.apply(e,i)}r.log=function(){i("log",arguments)},r.warn=function(){i("warn",arguments)},r.error=function(){i("error",arguments)}}function createPlugin(e,r,a){return wrapPluginInitFn(e,r,a),e.plugin_version=sdkversion_placeholder,e}var AndroidObsoleteBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){if(log("ObsoleteBridge---test---init---"),anBridge=window.SensorsData_APP_JS_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anVerify=anBridge&&anBridge.sensorsdata_verify,anVisualVerify=anBridge&&anBridge.sensorsdata_visual_verify,log("ObsoleteBridge-",sd.bridge.activeBridge,anVerify,anTrack,anVisualVerify),sd&&!sd.bridge.activeBridge&&(anVerify||anTrack||anVisualVerify)){sd.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack;anVisualVerify&&(e=!!anVisualVerify.call(anBridge,JSON.stringify({server_url:sd.para.server_url})),log("ObsoleteBridge---called-return",e)),sd.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:80,entry:sendData}}),log("Android obsolete bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android obsolete bridge.")}}function sendData(e,r){if(log("ObsoleteBridge---senddata"),sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var a=e.callback;if(anVerify){var i=anVerify&&anVerify.call(anBridge,JSON.stringify(_.extend({server_url:sd.para.server_url},e.data)));return log("ObsoleteBridge---anVerify-success",i),i?(_.isFunction(a)&&a(),r.cancellationToken.cancel(),e):sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_.isFunction(a)&&a(),r.cancellationToken.cancel(),e)}return log("ObsoleteBridge---is-send-old-way",sd.para.app_js_bridge.is_send),anTrack&&anTrack.call(anBridge,JSON.stringify(_.extend({server_url:sd.para.server_url},e.data))),_.isFunction(a)&&a(),r.cancellationToken.cancel(),e}function handleCommand(e){log("ObsoleteBridge---handleCommadn");var r=e.callType;return r in vbridge$1.commands?(log("ObsoleteBridge---",r,vbridge$1.commands),vbridge$1.commands[r](e,anBridge)):anBridge&&_.isFunction(anBridge.sensorsdata_js_call_app)?(log("ObsoleteBridge---handleCommadn-abridge"),anBridge.sensorsdata_js_call_app(JSON.stringify(e))):void 0}var index=createPlugin(AndroidObsoleteBridge,"AndroidObsoleteBridge","sdkAfterInitPara");export default index; \ No newline at end of file +var 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,r){return r&&"function"==typeof r[e.callType]&&r[e.callType]()}var anBridge,anTrack,anVerify,anVisualVerify,sd,_,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="1.26.9";function wrapPluginInitFn(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var i=e.init;e.init=function(n,d){if(wrapLogFn(n,e,r),n.readyState&&n.readyState.state>=3||!n.on)return o();function o(){i.call(e,n,d)}n.on(a,o)}}return e}function wrapLogFn(e,r,a){function i(r,i){e.logger?e.logger.msg.apply(e.logger,i).module(a+""||"").level(r).log():e.log&&e.log.apply(e,i)}r.log=function(){i("log",arguments)},r.warn=function(){i("warn",arguments)},r.error=function(){i("error",arguments)}}function createPlugin(e,r,a){return wrapPluginInitFn(e,r,a),e.plugin_version=sdkversion_placeholder,e}var AndroidObsoleteBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){if(log("ObsoleteBridge---test---init---"),anBridge=window.SensorsData_APP_JS_Bridge,anTrack=anBridge&&anBridge.sensorsdata_track,anVerify=anBridge&&anBridge.sensorsdata_verify,anVisualVerify=anBridge&&anBridge.sensorsdata_visual_verify,log("ObsoleteBridge-",sd.bridge.activeBridge,anVerify,anTrack,anVisualVerify),sd&&!sd.bridge.activeBridge&&(anVerify||anTrack||anVisualVerify)){sd.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack;anVisualVerify&&(e=!!anVisualVerify.call(anBridge,JSON.stringify({server_url:sd.para.server_url})),log("ObsoleteBridge---called-return",e)),sd.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:80,entry:sendData}}),log("Android obsolete bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by android obsolete bridge.")}}function sendData(e,r){if(log("ObsoleteBridge---senddata"),sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var a=e.callback;if(anVerify){var i=anVerify&&anVerify.call(anBridge,JSON.stringify(_.extend({server_url:sd.para.server_url},e.data)));return log("ObsoleteBridge---anVerify-success",i),i?(_.isFunction(a)&&a(),r.cancellationToken.cancel(),e):sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_.isFunction(a)&&a(),r.cancellationToken.cancel(),e)}return log("ObsoleteBridge---is-send-old-way",sd.para.app_js_bridge.is_send),anTrack&&anTrack.call(anBridge,JSON.stringify(_.extend({server_url:sd.para.server_url},e.data))),_.isFunction(a)&&a(),r.cancellationToken.cancel(),e}function handleCommand(e){log("ObsoleteBridge---handleCommadn");var r=e.callType;return r in vbridge$1.commands?(log("ObsoleteBridge---",r,vbridge$1.commands),vbridge$1.commands[r](e,anBridge)):anBridge&&_.isFunction(anBridge.sensorsdata_js_call_app)?(log("ObsoleteBridge---handleCommadn-abridge"),anBridge.sensorsdata_js_call_app(JSON.stringify(e))):void 0}var index=createPlugin(AndroidObsoleteBridge,"AndroidObsoleteBridge","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/android-obsolete-bridge/index.js b/dist/web/plugin/android-obsolete-bridge/index.js index 37ab10d3..4993303b 100644 --- a/dist/web/plugin/android-obsolete-bridge/index.js +++ b/dist/web/plugin/android-obsolete-bridge/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AndroidObsoleteBridge=function(){"use strict";function e(e){return y&&y.call(b,JSON.stringify(e))}function n(e){return v.call(b)&&m&&m.call(b,JSON.stringify(e))}function r(e,n){return n&&"function"==typeof n[e.callType]&&n[e.callType]()}function i(e,n,r){if(n&&(e.plugin_name=n),r&&e.init){var i=e.init;e.init=function(t,s){function o(){i.call(e,t,s)}return a(t,e,n),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(r,o)}}return e}function a(e,n,r){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(r+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function t(e,n,r){return i(e,n,r),e.plugin_version=O,e}function s(){if(f("ObsoleteBridge---test---init---"),d=window.SensorsData_APP_JS_Bridge,c=d&&d.sensorsdata_track,u=d&&d.sensorsdata_verify,g=d&&d.sensorsdata_visual_verify,f("ObsoleteBridge-",_.bridge.activeBridge,u,c,g),_&&!_.bridge.activeBridge&&(u||c||g)){_.bridge.activeBridge=B;var e=u||c;if(g&&(e=!!g.call(d,JSON.stringify({server_url:_.para.server_url})),f("ObsoleteBridge---called-return",e)),_.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!_.para.app_js_bridge)return void f("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");_.registerInterceptor("sendDataStage",{send:{priority:80,entry:o}}),f("Android obsolete bridge inits succeed.")}}function o(e,n){if(f("ObsoleteBridge---senddata"),_.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(u){var i=u&&u.call(d,JSON.stringify(p.extend({server_url:_.para.server_url},e.data)));return f("ObsoleteBridge---anVerify-success",i),i?(p.isFunction(r)&&r(),n.cancellationToken.cancel(),e):_.para.app_js_bridge.is_send?(_.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(p.isFunction(r)&&r(),n.cancellationToken.cancel(),e)}return f("ObsoleteBridge---is-send-old-way",_.para.app_js_bridge.is_send),c&&c.call(d,JSON.stringify(p.extend({server_url:_.para.server_url},e.data))),p.isFunction(r)&&r(),n.cancellationToken.cancel(),e}function l(e){f("ObsoleteBridge---handleCommadn");var n=e.callType;return n in S.commands?(f("ObsoleteBridge---",n,S.commands),S.commands[n](e,d)):d&&p.isFunction(d.sensorsdata_js_call_app)?(f("ObsoleteBridge---handleCommadn-abridge"),d.sensorsdata_js_call_app(JSON.stringify(e))):void 0}var d,c,u,g,_,p,f,b=window.SensorsData_App_Visual_Bridge,v=b&&b.sensorsdata_visualized_mode,y=b&&b.sensorsdata_visualized_alert_info,m=b&&b.sensorsdata_hover_web_nodes,S={isVerify:function(){return v&&(v===!0||v.call(b))},commands:{app_alert:e,visualized_track:n,page_info:n,sensorsdata_get_app_visual_config:r}},O="1.26.8",B={init:function(e){_=e,p=_&&_._,f=_&&_.log||console&&console.log||function(){},s()},handleCommand:l},w=t(B,"AndroidObsoleteBridge","sdkAfterInitPara");return w}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).AndroidObsoleteBridge=function(){"use strict";function e(e){return y&&y.call(b,JSON.stringify(e))}function n(e){return v.call(b)&&m&&m.call(b,JSON.stringify(e))}function r(e,n){return n&&"function"==typeof n[e.callType]&&n[e.callType]()}function i(e,n,r){if(n&&(e.plugin_name=n),r&&e.init){var i=e.init;e.init=function(t,s){function o(){i.call(e,t,s)}return a(t,e,n),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(r,o)}}return e}function a(e,n,r){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(r+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function t(e,n,r){return i(e,n,r),e.plugin_version=O,e}function s(){if(f("ObsoleteBridge---test---init---"),d=window.SensorsData_APP_JS_Bridge,c=d&&d.sensorsdata_track,u=d&&d.sensorsdata_verify,g=d&&d.sensorsdata_visual_verify,f("ObsoleteBridge-",_.bridge.activeBridge,u,c,g),_&&!_.bridge.activeBridge&&(u||c||g)){_.bridge.activeBridge=B;var e=u||c;if(g&&(e=!!g.call(d,JSON.stringify({server_url:_.para.server_url})),f("ObsoleteBridge---called-return",e)),_.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!_.para.app_js_bridge)return void f("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");_.registerInterceptor("sendDataStage",{send:{priority:80,entry:o}}),f("Android obsolete bridge inits succeed.")}}function o(e,n){if(f("ObsoleteBridge---senddata"),_.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(u){var i=u&&u.call(d,JSON.stringify(p.extend({server_url:_.para.server_url},e.data)));return f("ObsoleteBridge---anVerify-success",i),i?(p.isFunction(r)&&r(),n.cancellationToken.cancel(),e):_.para.app_js_bridge.is_send?(_.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(p.isFunction(r)&&r(),n.cancellationToken.cancel(),e)}return f("ObsoleteBridge---is-send-old-way",_.para.app_js_bridge.is_send),c&&c.call(d,JSON.stringify(p.extend({server_url:_.para.server_url},e.data))),p.isFunction(r)&&r(),n.cancellationToken.cancel(),e}function l(e){f("ObsoleteBridge---handleCommadn");var n=e.callType;return n in S.commands?(f("ObsoleteBridge---",n,S.commands),S.commands[n](e,d)):d&&p.isFunction(d.sensorsdata_js_call_app)?(f("ObsoleteBridge---handleCommadn-abridge"),d.sensorsdata_js_call_app(JSON.stringify(e))):void 0}var d,c,u,g,_,p,f,b=window.SensorsData_App_Visual_Bridge,v=b&&b.sensorsdata_visualized_mode,y=b&&b.sensorsdata_visualized_alert_info,m=b&&b.sensorsdata_hover_web_nodes,S={isVerify:function(){return v&&(v===!0||v.call(b))},commands:{app_alert:e,visualized_track:n,page_info:n,sensorsdata_get_app_visual_config:r}},O="1.26.9",B={init:function(e){_=e,p=_&&_._,f=_&&_.log||console&&console.log||function(){},s()},handleCommand:l},w=t(B,"AndroidObsoleteBridge","sdkAfterInitPara");return w}(); \ No newline at end of file diff --git a/dist/web/plugin/batch-sender/index.closure.js b/dist/web/plugin/batch-sender/index.closure.js index 763aac3a..28fa09da 100644 --- a/dist/web/plugin/batch-sender/index.closure.js +++ b/dist/web/plugin/batch-sender/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(o,i){function c(){r.call(n,o,i)}return t(o,n,a),o.readyState&&o.readyState.state>=3||!o.on?c():void o.on(e,c)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=l,t}function e(n,t){return!i.para.app_js_bridge&&i.para.batch_send&&c.localStorage.isSupport()&&localStorage.length=3||!o.on?c():void o.on(e,c)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=l,t}function e(n,t){return!i.para.app_js_bridge&&i.para.batch_send&&c.localStorage.isSupport()&&localStorage.length=3||!r.on)return i();function i(){e.call(n,r,o)}r.on(t,i)}}return n}function wrapLogFn(n,a,t){function e(a,e){n.logger?n.logger.msg.apply(n.logger,e).module(t+""||"").level(a).log():n.log&&n.log.apply(n,e)}a.log=function(){e("log",arguments)},a.warn=function(){e("warn",arguments)},a.error=function(){e("error",arguments)}}function createPlugin(n,a,t){return wrapPluginInitFn(n,a,t),n.plugin_version=sdkversion_placeholder,n}var batchInstance=null;function sendData(n,a){return!sd.para.app_js_bridge&&sd.para.batch_send&&_.localStorage.isSupport()&&localStorage.length=3||!r.on)return i();function i(){e.call(n,r,o)}r.on(t,i)}}return n}function wrapLogFn(n,a,t){function e(a,e){n.logger?n.logger.msg.apply(n.logger,e).module(t+""||"").level(a).log():n.log&&n.log.apply(n,e)}a.log=function(){e("log",arguments)},a.warn=function(){e("warn",arguments)},a.error=function(){e("error",arguments)}}function createPlugin(n,a,t){return wrapPluginInitFn(n,a,t),n.plugin_version=sdkversion_placeholder,n}var batchInstance=null;function sendData(n,a){return!sd.para.app_js_bridge&&sd.para.batch_send&&_.localStorage.isSupport()&&localStorage.length=3||!o.on?c():void o.on(e,c)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=l,t}function e(n,t){return!i.para.app_js_bridge&&i.para.batch_send&&c.localStorage.isSupport()&&localStorage.length=3||!o.on?c():void o.on(e,c)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=l,t}function e(n,t){return!i.para.app_js_bridge&&i.para.batch_send&&c.localStorage.isSupport()&&localStorage.length=3||!a.on?c():void a.on(t,c)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=l,e}function t(n){var e=new u.BeaconSend(n);e.start()}function o(n,e){var r=null,o=null;u.isObject(n.config)&&(r=n.config.send_type,o=u.optimizeServerUrl(n.config.server_url));var a="beacon"===r||!r&&"beacon"===c.para.send_type;if(a&&u.isSupportBeaconSend()){var i=o||n.server_url;n.server_url=i,n.data=c.kit.encodeTrackData(n.data),u.isArray(i)&&i.length?u.each(i,function(e){n.callback=null,n.server_url=e,t(n)}):"string"==typeof i&&""!==i?t(n):c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function a(){"beacon"!==c.para.send_type||u.isSupportBeaconSend()||(c.para.send_type="image")}function i(){c.on("sdkInitPara",function(){a()}),c.on("sdkAfterInitPara",function(){c.registerInterceptor("sendDataStage",{send:{priority:110,entry:o}})})}var c,u,l="1.26.8",s={plugin_name:"BeaconSender",init:function(n){c=n,u=c._,i()}},f=r(s);return f}(); \ No newline at end of file +!function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var o=n.init;n.init=function(a,i){function c(){o.call(n,a,i)}return e(a,n,r),a.readyState&&a.readyState.state>=3||!a.on?c():void a.on(t,c)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=l,e}function t(n){var e=new u.BeaconSend(n);e.start()}function o(n,e){var r=null,o=null;u.isObject(n.config)&&(r=n.config.send_type,o=u.optimizeServerUrl(n.config.server_url));var a="beacon"===r||!r&&"beacon"===c.para.send_type;if(a&&u.isSupportBeaconSend()){var i=o||n.server_url;n.server_url=i,n.data=c.kit.encodeTrackData(n.data),u.isArray(i)&&i.length?u.each(i,function(e){n.callback=null,n.server_url=e,t(n)}):"string"==typeof i&&""!==i?t(n):c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function a(){"beacon"!==c.para.send_type||u.isSupportBeaconSend()||(c.para.send_type="image")}function i(){c.on("sdkInitPara",function(){a()}),c.on("sdkAfterInitPara",function(){c.registerInterceptor("sendDataStage",{send:{priority:110,entry:o}})})}var c,u,l="1.26.9",s={plugin_name:"BeaconSender",init:function(n){c=n,u=c._,i()}},f=r(s);return f}(); \ No newline at end of file diff --git a/dist/web/plugin/beacon-sender/index.es6.js b/dist/web/plugin/beacon-sender/index.es6.js index 8acce8ea..807187f2 100644 --- a/dist/web/plugin/beacon-sender/index.es6.js +++ b/dist/web/plugin/beacon-sender/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}function sendData(n){new _.BeaconSend(n).start()}function sendInterceptor(n,e){var r=null,t=null;if(_.isObject(n.config)&&(r=n.config.send_type,t=_.optimizeServerUrl(n.config.server_url)),("beacon"===r||!r&&"beacon"===sd.para.send_type)&&_.isSupportBeaconSend()){var a=t||n.server_url;n.server_url=a,n.data=sd.kit.encodeTrackData(n.data),_.isArray(a)&&a.length?_.each(a,function(e){n.callback=null,n.server_url=e,sendData(n)}):"string"==typeof a&&""!==a?sendData(n):sd.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function initPara(){"beacon"!==sd.para.send_type||_.isSupportBeaconSend()||(sd.para.send_type="image")}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:110,entry:sendInterceptor}})})}var BeaconSender={plugin_name:"BeaconSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(BeaconSender);export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}function sendData(n){new _.BeaconSend(n).start()}function sendInterceptor(n,e){var r=null,t=null;if(_.isObject(n.config)&&(r=n.config.send_type,t=_.optimizeServerUrl(n.config.server_url)),("beacon"===r||!r&&"beacon"===sd.para.send_type)&&_.isSupportBeaconSend()){var a=t||n.server_url;n.server_url=a,n.data=sd.kit.encodeTrackData(n.data),_.isArray(a)&&a.length?_.each(a,function(e){n.callback=null,n.server_url=e,sendData(n)}):"string"==typeof a&&""!==a?sendData(n):sd.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function initPara(){"beacon"!==sd.para.send_type||_.isSupportBeaconSend()||(sd.para.send_type="image")}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:110,entry:sendInterceptor}})})}var BeaconSender={plugin_name:"BeaconSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(BeaconSender);export default index; \ No newline at end of file diff --git a/dist/web/plugin/beacon-sender/index.js b/dist/web/plugin/beacon-sender/index.js index 56004d1e..3b291006 100644 --- a/dist/web/plugin/beacon-sender/index.js +++ b/dist/web/plugin/beacon-sender/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).BeaconSender=function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var o=n.init;n.init=function(a,i){function u(){o.call(n,a,i)}return e(a,n,r),a.readyState&&a.readyState.state>=3||!a.on?u():void a.on(t,u)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=l,e}function t(n){var e=new c.BeaconSend(n);e.start()}function o(n,e){var r=null,o=null;c.isObject(n.config)&&(r=n.config.send_type,o=c.optimizeServerUrl(n.config.server_url));var a="beacon"===r||!r&&"beacon"===u.para.send_type;if(a&&c.isSupportBeaconSend()){var i=o||n.server_url;n.server_url=i,n.data=u.kit.encodeTrackData(n.data),c.isArray(i)&&i.length?c.each(i,function(e){n.callback=null,n.server_url=e,t(n)}):"string"==typeof i&&""!==i?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function a(){"beacon"!==u.para.send_type||c.isSupportBeaconSend()||(u.para.send_type="image")}function i(){u.on("sdkInitPara",function(){a()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:110,entry:o}})})}var u,c,l="1.26.8",s={plugin_name:"BeaconSender",init:function(n){u=n,c=u._,i()}},g=r(s);return g}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).BeaconSender=function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var o=n.init;n.init=function(a,i){function u(){o.call(n,a,i)}return e(a,n,r),a.readyState&&a.readyState.state>=3||!a.on?u():void a.on(t,u)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=l,e}function t(n){var e=new c.BeaconSend(n);e.start()}function o(n,e){var r=null,o=null;c.isObject(n.config)&&(r=n.config.send_type,o=c.optimizeServerUrl(n.config.server_url));var a="beacon"===r||!r&&"beacon"===u.para.send_type;if(a&&c.isSupportBeaconSend()){var i=o||n.server_url;n.server_url=i,n.data=u.kit.encodeTrackData(n.data),c.isArray(i)&&i.length?c.each(i,function(e){n.callback=null,n.server_url=e,t(n)}):"string"==typeof i&&""!==i?t(n):u.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),e.cancellationToken.stop()}return n}function a(){"beacon"!==u.para.send_type||c.isSupportBeaconSend()||(u.para.send_type="image")}function i(){u.on("sdkInitPara",function(){a()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:110,entry:o}})})}var u,c,l="1.26.9",s={plugin_name:"BeaconSender",init:function(n){u=n,c=u._,i()}},g=r(s);return g}(); \ No newline at end of file diff --git a/dist/web/plugin/channel-utm/index.closure.js b/dist/web/plugin/channel-utm/index.closure.js index dc2558e8..6b775d4d 100644 --- a/dist/web/plugin/channel-utm/index.closure.js +++ b/dist/web/plugin/channel-utm/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return t(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return n}function t(n,t,e){function r(t,r){n.logger?n.logger.msg.apply(n.logger,r).module(e+""||"").level(t).log():n.log&&n.log.apply(n,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function e(t,e,r){return n(t,e,r),t.plugin_version=a,t}var r,a="1.26.8",i=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],o={init:function(n){n&&!r&&(r=n,r._.each(i,function(n){r.source_channel_standard=r.source_channel_standard+" "+n,r.para.source_type.utm.push(n)}),r.registerInterceptor("businessStage",{getUtmData:{entry:function(n){var t=!1,e=n||{};return r._.each(i,function(n){var a=r._.getQueryParam(location.href,n);a.length&&(t=!0,e[n.slice(8)]=a)}),t&&r.register&&r.register({link_v:"1"}),e}}}))}},u=e(o,"ChannelUtm","sdkAfterInitPara");return u}(); \ No newline at end of file +!function(){"use strict";function n(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return t(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return n}function t(n,t,e){function r(t,r){n.logger?n.logger.msg.apply(n.logger,r).module(e+""||"").level(t).log():n.log&&n.log.apply(n,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function e(t,e,r){return n(t,e,r),t.plugin_version=a,t}var r,a="1.26.9",i=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],o={init:function(n){n&&!r&&(r=n,r._.each(i,function(n){r.source_channel_standard=r.source_channel_standard+" "+n,r.para.source_type.utm.push(n)}),r.registerInterceptor("businessStage",{getUtmData:{entry:function(n){var t=!1,e=n||{};return r._.each(i,function(n){var a=r._.getQueryParam(location.href,n);a.length&&(t=!0,e[n.slice(8)]=a)}),t&&r.register&&r.register({link_v:"1"}),e}}}))}},u=e(o,"ChannelUtm","sdkAfterInitPara");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/channel-utm/index.es6.js b/dist/web/plugin/channel-utm/index.es6.js index 9167cfc9..8bff54d3 100644 --- a/dist/web/plugin/channel-utm/index.es6.js +++ b/dist/web/plugin/channel-utm/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.26.8";function wrapPluginInitFn(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var r=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){r.call(n,a,i)}a.on(t,o)}}return n}function wrapLogFn(n,e,t){function r(e,r){n.logger?n.logger.msg.apply(n.logger,r).module(t+""||"").level(e).log():n.log&&n.log.apply(n,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(n,e,t){return wrapPluginInitFn(n,e,t),n.plugin_version=sdkversion_placeholder,n}var sd,utmKeys=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],ChannelUtm={init:function(n){n&&!sd&&((sd=n)._.each(utmKeys,function(n){sd.source_channel_standard=sd.source_channel_standard+" "+n,sd.para.source_type.utm.push(n)}),sd.registerInterceptor("businessStage",{getUtmData:{entry:function(n){var e=!1,t=n||{};return sd._.each(utmKeys,function(n){var r=sd._.getQueryParam(location.href,n);r.length&&(e=!0,t[n.slice(8)]=r)}),e&&sd.register&&sd.register({link_v:"1"}),t}}}))}},index=createPlugin(ChannelUtm,"ChannelUtm","sdkAfterInitPara");export default index; \ No newline at end of file +var sdkversion_placeholder="1.26.9";function wrapPluginInitFn(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var r=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){r.call(n,a,i)}a.on(t,o)}}return n}function wrapLogFn(n,e,t){function r(e,r){n.logger?n.logger.msg.apply(n.logger,r).module(t+""||"").level(e).log():n.log&&n.log.apply(n,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(n,e,t){return wrapPluginInitFn(n,e,t),n.plugin_version=sdkversion_placeholder,n}var sd,utmKeys=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],ChannelUtm={init:function(n){n&&!sd&&((sd=n)._.each(utmKeys,function(n){sd.source_channel_standard=sd.source_channel_standard+" "+n,sd.para.source_type.utm.push(n)}),sd.registerInterceptor("businessStage",{getUtmData:{entry:function(n){var e=!1,t=n||{};return sd._.each(utmKeys,function(n){var r=sd._.getQueryParam(location.href,n);r.length&&(e=!0,t[n.slice(8)]=r)}),e&&sd.register&&sd.register({link_v:"1"}),t}}}))}},index=createPlugin(ChannelUtm,"ChannelUtm","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/channel-utm/index.js b/dist/web/plugin/channel-utm/index.js index 363f87d5..1a28f481 100644 --- a/dist/web/plugin/channel-utm/index.js +++ b/dist/web/plugin/channel-utm/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).ChannelUtm=function(){"use strict";function n(n,t,r){if(t&&(n.plugin_name=t),r&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return e(i,n,t),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return n}function e(n,e,t){function r(e,r){n.logger?n.logger.msg.apply(n.logger,r).module(t+""||"").level(e).log():n.log&&n.log.apply(n,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function t(e,t,r){return n(e,t,r),e.plugin_version=a,e}var r,a="1.26.8",i=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],o={init:function(n){n&&!r&&(r=n,r._.each(i,function(n){r.source_channel_standard=r.source_channel_standard+" "+n,r.para.source_type.utm.push(n)}),r.registerInterceptor("businessStage",{getUtmData:{entry:function(n){var e=!1,t=n||{};return r._.each(i,function(n){var a=r._.getQueryParam(location.href,n);a.length&&(e=!0,t[n.slice(8)]=a)}),e&&r.register&&r.register({link_v:"1"}),t}}}))}},u=t(o,"ChannelUtm","sdkAfterInitPara");return u}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).ChannelUtm=function(){"use strict";function n(n,t,r){if(t&&(n.plugin_name=t),r&&n.init){var a=n.init;n.init=function(i,o){function u(){a.call(n,i,o)}return e(i,n,t),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return n}function e(n,e,t){function r(e,r){n.logger?n.logger.msg.apply(n.logger,r).module(t+""||"").level(e).log():n.log&&n.log.apply(n,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function t(e,t,r){return n(e,t,r),e.plugin_version=a,e}var r,a="1.26.9",i=["channel_utm_source","channel_utm_content","channel_utm_term","channel_utm_medium","channel_utm_campaign"],o={init:function(n){n&&!r&&(r=n,r._.each(i,function(n){r.source_channel_standard=r.source_channel_standard+" "+n,r.para.source_type.utm.push(n)}),r.registerInterceptor("businessStage",{getUtmData:{entry:function(n){var e=!1,t=n||{};return r._.each(i,function(n){var a=r._.getQueryParam(location.href,n);a.length&&(e=!0,t[n.slice(8)]=a)}),e&&r.register&&r.register({link_v:"1"}),t}}}))}},u=t(o,"ChannelUtm","sdkAfterInitPara");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/channel/index.closure.js b/dist/web/plugin/channel/index.closure.js index 919215e6..1578b8e2 100644 --- a/dist/web/plugin/channel/index.closure.js +++ b/dist/web/plugin/channel/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var a=e.init;e.init=function(r,s){function l(){a.call(e,r,s)}return n(r,e,t),r.readyState&&r.readyState.state>=3||!r.on?l():void r.on(i,l)}}return e}function n(e,n,t){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(t+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function t(n,t,i){return e(n,t,i),n.plugin_version=l,n}var i,a,r,s,l="1.26.8",o={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,n){function t(){return i=a._,r=a.store,!!i.localStorage.isSupport()&&(a.para.max_string_length=1024,l.eventList.init(),l.addLatestChannelUrl(),void l.addIsChannelCallbackEvent())}if(a||!e)return!1;n=n||{},s=n.cookie_name||"sensorsdata2015jssdkchannel",a=e;var l=this;t()},addIsChannelCallbackEvent:function(){a.registerPage({$is_channel_callback_event:function(e){if(i.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!o.eventList.hasEvent(e.event)&&(o.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),n=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(i.isReferralTraffic(document.referrer)){var t=i.getQueryParam(location.href,"sat_cf");i.isString(t)&&t.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),o.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else n?a.registerPage(n):a.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){a.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=a.kit.userDecryptIfNeeded(i.cookie.get(s));return e=i.safeJSONParse(e),!(!i.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var n={prop:e},t=JSON.stringify(n);a.para.encrypt_cookie&&(t=a.kit.userEncrypt(t)),i.cookie.set(s,t)}},channelLinkHandler:function(){this.eventList.reset(),a.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=i.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),n=(new Date).getTime();if(e&&i.isNumber(e.latest_event_initial_time)&&i.isArray(e.eventList)){var t=n-e.latest_event_initial_time;t>0&&t=3||!r.on?l():void r.on(i,l)}}return e}function n(e,n,t){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(t+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function t(n,t,i){return e(n,t,i),n.plugin_version=l,n}var i,a,r,s,l="1.26.9",o={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,n){function t(){return i=a._,r=a.store,!!i.localStorage.isSupport()&&(a.para.max_string_length=1024,l.eventList.init(),l.addLatestChannelUrl(),void l.addIsChannelCallbackEvent())}if(a||!e)return!1;n=n||{},s=n.cookie_name||"sensorsdata2015jssdkchannel",a=e;var l=this;t()},addIsChannelCallbackEvent:function(){a.registerPage({$is_channel_callback_event:function(e){if(i.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!o.eventList.hasEvent(e.event)&&(o.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),n=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(i.isReferralTraffic(document.referrer)){var t=i.getQueryParam(location.href,"sat_cf");i.isString(t)&&t.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),o.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else n?a.registerPage(n):a.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){a.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=a.kit.userDecryptIfNeeded(i.cookie.get(s));return e=i.safeJSONParse(e),!(!i.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var n={prop:e},t=JSON.stringify(n);a.para.encrypt_cookie&&(t=a.kit.userEncrypt(t)),i.cookie.set(s,t)}},channelLinkHandler:function(){this.eventList.reset(),a.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=i.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),n=(new Date).getTime();if(e&&i.isNumber(e.latest_event_initial_time)&&i.isArray(e.eventList)){var t=n-e.latest_event_initial_time;t>0&&t=3||!a.on)return l();function l(){i.call(e,a,r)}a.on(t,l)}}return e}function wrapLogFn(e,n,t){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(t+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function createPlugin(e,n,t){return wrapPluginInitFn(e,n,t),e.plugin_version=sdkversion_placeholder,e}var Channel={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,n){if(sd||!e)return!1;cookie_name=(n=n||{}).cookie_name||"sensorsdata2015jssdkchannel",sd=e;var t=this;!function(){if(_=sd._,store=sd.store,!_.localStorage.isSupport())return!1;sd.para.max_string_length=1024,t.eventList.init(),t.addLatestChannelUrl(),t.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd.registerPage({$is_channel_callback_event:function(e){if(_.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(),n=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_.isReferralTraffic(document.referrer)){var t=_.getQueryParam(location.href,"sat_cf");_.isString(t)&&t.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else n?sd.registerPage(n):sd.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd.kit.userDecryptIfNeeded(_.cookie.get(cookie_name));return e=_.safeJSONParse(e),!(!_.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var n={prop:e},t=JSON.stringify(n);sd.para.encrypt_cookie&&(t=sd.kit.userEncrypt(t)),_.cookie.set(cookie_name,t)}},channelLinkHandler:function(){this.eventList.reset(),sd.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),n=(new Date).getTime();if(e&&_.isNumber(e.latest_event_initial_time)&&_.isArray(e.eventList)){var t=n-e.latest_event_initial_time;t>0&&t=3||!a.on)return l();function l(){i.call(e,a,r)}a.on(t,l)}}return e}function wrapLogFn(e,n,t){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(t+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function createPlugin(e,n,t){return wrapPluginInitFn(e,n,t),e.plugin_version=sdkversion_placeholder,e}var Channel={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,n){if(sd||!e)return!1;cookie_name=(n=n||{}).cookie_name||"sensorsdata2015jssdkchannel",sd=e;var t=this;!function(){if(_=sd._,store=sd.store,!_.localStorage.isSupport())return!1;sd.para.max_string_length=1024,t.eventList.init(),t.addLatestChannelUrl(),t.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd.registerPage({$is_channel_callback_event:function(e){if(_.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(),n=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_.isReferralTraffic(document.referrer)){var t=_.getQueryParam(location.href,"sat_cf");_.isString(t)&&t.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else n?sd.registerPage(n):sd.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd.kit.userDecryptIfNeeded(_.cookie.get(cookie_name));return e=_.safeJSONParse(e),!(!_.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var n={prop:e},t=JSON.stringify(n);sd.para.encrypt_cookie&&(t=sd.kit.userEncrypt(t)),_.cookie.set(cookie_name,t)}},channelLinkHandler:function(){this.eventList.reset(),sd.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),n=(new Date).getTime();if(e&&_.isNumber(e.latest_event_initial_time)&&_.isArray(e.eventList)){var t=n-e.latest_event_initial_time;t>0&&t=3||!r.on?l():void r.on(i,l)}}return e}function n(e,n,t){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(t+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function t(n,t,i){return e(n,t,i),n.plugin_version=l,n}var i,a,r,s,l="1.26.8",o={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,n){function t(){return i=a._,r=a.store,!!i.localStorage.isSupport()&&(a.para.max_string_length=1024,l.eventList.init(),l.addLatestChannelUrl(),void l.addIsChannelCallbackEvent())}if(a||!e)return!1;n=n||{},s=n.cookie_name||"sensorsdata2015jssdkchannel",a=e;var l=this;t()},addIsChannelCallbackEvent:function(){a.registerPage({$is_channel_callback_event:function(e){if(i.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!o.eventList.hasEvent(e.event)&&(o.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),n=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(i.isReferralTraffic(document.referrer)){var t=i.getQueryParam(location.href,"sat_cf");i.isString(t)&&t.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),o.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else n?a.registerPage(n):a.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){a.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=a.kit.userDecryptIfNeeded(i.cookie.get(s));return e=i.safeJSONParse(e),!(!i.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var n={prop:e},t=JSON.stringify(n);a.para.encrypt_cookie&&(t=a.kit.userEncrypt(t)),i.cookie.set(s,t)}},channelLinkHandler:function(){this.eventList.reset(),a.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=i.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),n=(new Date).getTime();if(e&&i.isNumber(e.latest_event_initial_time)&&i.isArray(e.eventList)){var t=n-e.latest_event_initial_time;t>0&&t=3||!r.on?l():void r.on(i,l)}}return e}function n(e,n,t){function i(n,i){e.logger?e.logger.msg.apply(e.logger,i).module(t+""||"").level(n).log():e.log&&e.log.apply(e,i)}n.log=function(){i("log",arguments)},n.warn=function(){i("warn",arguments)},n.error=function(){i("error",arguments)}}function t(n,t,i){return e(n,t,i),n.plugin_version=l,n}var i,a,r,s,l="1.26.9",o={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,n){function t(){return i=a._,r=a.store,!!i.localStorage.isSupport()&&(a.para.max_string_length=1024,l.eventList.init(),l.addLatestChannelUrl(),void l.addIsChannelCallbackEvent())}if(a||!e)return!1;n=n||{},s=n.cookie_name||"sensorsdata2015jssdkchannel",a=e;var l=this;t()},addIsChannelCallbackEvent:function(){a.registerPage({$is_channel_callback_event:function(e){if(i.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!o.eventList.hasEvent(e.event)&&(o.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),n=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(i.isReferralTraffic(document.referrer)){var t=i.getQueryParam(location.href,"sat_cf");i.isString(t)&&t.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),o.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else n?a.registerPage(n):a.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){a.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=a.kit.userDecryptIfNeeded(i.cookie.get(s));return e=i.safeJSONParse(e),!(!i.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var n={prop:e},t=JSON.stringify(n);a.para.encrypt_cookie&&(t=a.kit.userEncrypt(t)),i.cookie.set(s,t)}},channelLinkHandler:function(){this.eventList.reset(),a.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=i.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),n=(new Date).getTime();if(e&&i.isNumber(e.latest_event_initial_time)&&i.isArray(e.eventList)){var t=n-e.latest_event_initial_time;t>0&&t=3||!l.on?s():void l.on(t,s)}}return o}function n(o,n,e){function t(n,t){o.logger?o.logger.msg.apply(o.logger,t).module(e+""||"").level(n).log():o.log&&o.log.apply(o,t)}n.log=function(){t("log",arguments)},n.warn=function(){t("warn",arguments)},n.error=function(){t("error",arguments)}}function e(n,e,t){return o(n,e,t),n.plugin_version=v,n}function t(o){return null===h?void r(o):void h.push(o)}function r(o){try{if("log"===o.level&&l())return void a(o);if("warn"===o.level&&i())return void a(o);if("error"===o.level&&s())return void a(o)}catch(n){}}function l(){return!!f()||(p.para.show_log===!0||d.isObject(p.para.show_log)&&"log"===p.para.show_log.level)}function i(){return!!f()||(l()||d.isObject(p.para.show_log)&&"warn"===p.para.show_log.level)}function s(){return!!f()||(!d.isObject(p.para.show_log)||"none"!==p.para.show_log.level)}function a(o){var n=o.content,e=d.isObject(n[0])?d.formatJsonString(n[0]):n[0],t=u(o);n[0]=t+(t.length>0?": ":"")+e;try{console&&(d.isFunction(console[o.level])?console[o.level].apply(console,n):d.isObject(console[o.level])&&console[o.level](n[0]))}catch(r){}}function u(o){var n="",e="",t=p.para.show_log;return d.isObject(t)&&t.show_brand===!1||(n+=o.brand),d.isObject(t)&&t.show_level===!1||(n+=(n.length>0?"-":"")+o.level),n.length>0&&(n="["+n+"]"),d.isObject(t)&&t.show_module===!1||(e=o.module),n+e}function c(){d.sessionStorage.isSupport()&&sessionStorage.setItem(b,"true")}function g(){d.sessionStorage.isSupport()&&sessionStorage.removeItem(b)}function f(){return d.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(b)}var v="1.26.8",p=null,d=null,h=[],_={init:function(o){o&&(p=o,d=p._,p.logger&&p.logger.appendWriter(t),p.on&&p.on("sdkAfterInitPara",function(){for(var o=0;o=3||!l.on?s():void l.on(t,s)}}return o}function n(o,n,e){function t(n,t){o.logger?o.logger.msg.apply(o.logger,t).module(e+""||"").level(n).log():o.log&&o.log.apply(o,t)}n.log=function(){t("log",arguments)},n.warn=function(){t("warn",arguments)},n.error=function(){t("error",arguments)}}function e(n,e,t){return o(n,e,t),n.plugin_version=v,n}function t(o){return null===h?void r(o):void h.push(o)}function r(o){try{if("log"===o.level&&l())return void a(o);if("warn"===o.level&&i())return void a(o);if("error"===o.level&&s())return void a(o)}catch(n){}}function l(){return!!f()||(p.para.show_log===!0||d.isObject(p.para.show_log)&&"log"===p.para.show_log.level)}function i(){return!!f()||(l()||d.isObject(p.para.show_log)&&"warn"===p.para.show_log.level)}function s(){return!!f()||(!d.isObject(p.para.show_log)||"none"!==p.para.show_log.level)}function a(o){var n=o.content,e=d.isObject(n[0])?d.formatJsonString(n[0]):n[0],t=u(o);n[0]=t+(t.length>0?": ":"")+e;try{console&&(d.isFunction(console[o.level])?console[o.level].apply(console,n):d.isObject(console[o.level])&&console[o.level](n[0]))}catch(r){}}function u(o){var n="",e="",t=p.para.show_log;return d.isObject(t)&&t.show_brand===!1||(n+=o.brand),d.isObject(t)&&t.show_level===!1||(n+=(n.length>0?"-":"")+o.level),n.length>0&&(n="["+n+"]"),d.isObject(t)&&t.show_module===!1||(e=o.module),n+e}function c(){d.sessionStorage.isSupport()&&sessionStorage.setItem(b,"true")}function g(){d.sessionStorage.isSupport()&&sessionStorage.removeItem(b)}function f(){return d.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(b)}var v="1.26.9",p=null,d=null,h=[],_={init:function(o){o&&(p=o,d=p._,p.logger&&p.logger.appendWriter(t),p.on&&p.on("sdkAfterInitPara",function(){for(var o=0;o=3||!l.on)return t();function t(){r.call(o,l,a)}l.on(n,t)}}return o}function wrapLogFn(o,e,n){function r(e,r){o.logger?o.logger.msg.apply(o.logger,r).module(n+""||"").level(e).log():o.log&&o.log.apply(o,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(o,e,n){return wrapPluginInitFn(o,e,n),o.plugin_version=sdkversion_placeholder,o}var _sd=null,_=null,_cacheLogs=[],ConsoleLogger={init:function(o){o&&(_=(_sd=o)._,_sd.logger&&_sd.logger.appendWriter(logWriter),_sd.on&&_sd.on("sdkAfterInitPara",function(){for(var o=0;o<_cacheLogs.length;o++)printLog(_cacheLogs[o]);_cacheLogs=null}),_sd.on&&_sd.on("sdkInitAPI",function(){_sd.enableLocalLog=enableLocalLog,_sd.disableLocalLog=disableLocalLog}))}},index=createPlugin(ConsoleLogger,"ConsoleLogger");function logWriter(o){null!==_cacheLogs?_cacheLogs.push(o):printLog(o)}function printLog(o){try{if("log"===o.level&&canLog())return void writeLog(o);if("warn"===o.level&&canWarn())return void writeLog(o);if("error"===o.level&&canError())return void writeLog(o)}catch(e){}}function canLog(){return!!isLocalLogEnabled()||(!0===_sd.para.show_log||_.isObject(_sd.para.show_log)&&"log"===_sd.para.show_log.level)}function canWarn(){return!!isLocalLogEnabled()||(canLog()||_.isObject(_sd.para.show_log)&&"warn"===_sd.para.show_log.level)}function canError(){return!!isLocalLogEnabled()||(!_.isObject(_sd.para.show_log)||"none"!==_sd.para.show_log.level)}function writeLog(o){var e=o.content,n=_.isObject(e[0])?_.formatJsonString(e[0]):e[0],r=getLogHead(o);e[0]=r+(r.length>0?": ":"")+n;try{console&&(_.isFunction(console[o.level])?console[o.level].apply(console,e):_.isObject(console[o.level])&&console[o.level](e[0]))}catch(l){}}function getLogHead(o){var e="",n="",r=_sd.para.show_log;return _.isObject(r)&&!1===r.show_brand||(e+=o.brand),_.isObject(r)&&!1===r.show_level||(e+=(e.length>0?"-":"")+o.level),e.length>0&&(e="["+e+"]"),_.isObject(r)&&!1===r.show_module||(n=o.module),e+n}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}export default index; \ No newline at end of file +var sdkversion_placeholder="1.26.9";function wrapPluginInitFn(o,e,n){if(e&&(o.plugin_name=e),n&&o.init){var r=o.init;o.init=function(l,a){if(wrapLogFn(l,o,e),l.readyState&&l.readyState.state>=3||!l.on)return t();function t(){r.call(o,l,a)}l.on(n,t)}}return o}function wrapLogFn(o,e,n){function r(e,r){o.logger?o.logger.msg.apply(o.logger,r).module(n+""||"").level(e).log():o.log&&o.log.apply(o,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(o,e,n){return wrapPluginInitFn(o,e,n),o.plugin_version=sdkversion_placeholder,o}var _sd=null,_=null,_cacheLogs=[],ConsoleLogger={init:function(o){o&&(_=(_sd=o)._,_sd.logger&&_sd.logger.appendWriter(logWriter),_sd.on&&_sd.on("sdkAfterInitPara",function(){for(var o=0;o<_cacheLogs.length;o++)printLog(_cacheLogs[o]);_cacheLogs=null}),_sd.on&&_sd.on("sdkInitAPI",function(){_sd.enableLocalLog=enableLocalLog,_sd.disableLocalLog=disableLocalLog}))}},index=createPlugin(ConsoleLogger,"ConsoleLogger");function logWriter(o){null!==_cacheLogs?_cacheLogs.push(o):printLog(o)}function printLog(o){try{if("log"===o.level&&canLog())return void writeLog(o);if("warn"===o.level&&canWarn())return void writeLog(o);if("error"===o.level&&canError())return void writeLog(o)}catch(e){}}function canLog(){return!!isLocalLogEnabled()||(!0===_sd.para.show_log||_.isObject(_sd.para.show_log)&&"log"===_sd.para.show_log.level)}function canWarn(){return!!isLocalLogEnabled()||(canLog()||_.isObject(_sd.para.show_log)&&"warn"===_sd.para.show_log.level)}function canError(){return!!isLocalLogEnabled()||(!_.isObject(_sd.para.show_log)||"none"!==_sd.para.show_log.level)}function writeLog(o){var e=o.content,n=_.isObject(e[0])?_.formatJsonString(e[0]):e[0],r=getLogHead(o);e[0]=r+(r.length>0?": ":"")+n;try{console&&(_.isFunction(console[o.level])?console[o.level].apply(console,e):_.isObject(console[o.level])&&console[o.level](e[0]))}catch(l){}}function getLogHead(o){var e="",n="",r=_sd.para.show_log;return _.isObject(r)&&!1===r.show_brand||(e+=o.brand),_.isObject(r)&&!1===r.show_level||(e+=(e.length>0?"-":"")+o.level),e.length>0&&(e="["+e+"]"),_.isObject(r)&&!1===r.show_module||(n=o.module),e+n}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}export default index; \ No newline at end of file diff --git a/dist/web/plugin/custom-events-sender/index.closure.js b/dist/web/plugin/custom-events-sender/index.closure.js index b75f2d40..bf13b4ad 100644 --- a/dist/web/plugin/custom-events-sender/index.closure.js +++ b/dist/web/plugin/custom-events-sender/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,e,a){if(e&&(n.plugin_name=e),a&&n.init){var r=n.init;n.init=function(i,o){function c(){r.call(n,i,o)}return t(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?c():void i.on(a,c)}}return n}function t(n,t,e){function a(t,a){n.logger?n.logger.msg.apply(n.logger,a).module(e+""||"").level(t).log():n.log&&n.log.apply(n,a)}t.log=function(){a("log",arguments)},t.warn=function(){a("warn",arguments)},t.error=function(){a("error",arguments)}}function e(t,e,a){return n(t,e,a),t.plugin_version=l,t}function a(n){var t=[];return c.each(n,function(n){c.isArray(n)?t=t.concat(a(n)):t.push(c.optimizeServerUrl(n))}),t}function r(n,t){t=c.isArray(t)?t:[t];var e=!1;return c.isArray(n)?c.each(n,function(n){c.indexOf(t,n)>-1&&(e=!0)}):c.indexOf(t,n)>-1&&(e=!0),e}function i(n,t){var e=o.kit.encodeTrackData(t);return n.indexOf("?")!==-1?n+"&"+e:n+"?"+e}var o,c,u,l="1.26.8",s={hookFn:null,init:function(n){this.hookFn=n,o.registerInterceptor("sendDataStage",{send:{priority:20,entry:function(n,t){return s.sendData(n,t),n}}})},sendData:function(n,t){var e=n.data,i=e.event,o=n.server_url,u=n.callback,l=this,s=this.hookFn({event_name:i,data:c.extend2Lev({identities:{},lib:{},properties:{}},e),server_url:o});return c.isArray(s)&&s.length?(s=a(s),r(o,s)?u=null:t.cancellationToken.stop(),c.each(s,function(t){if(t&&""!==t&&!r(t,o)){var e=function(t){return function(){l.sendCall({server_url:t,data:n.data,config:null,callback:u}),u=null,n.callback=null}}(t);setTimeout(e)}}),n):(c.isFunction(u)&&u(),t.cancellationToken.stop(),n)},getInstance:function(n){return"beacon"===o.para.send_type&&c.isSupportBeaconSend()?(n.data=o.kit.encodeTrackData(n.data),new c.BeaconSend(n)):"ajax"===o.para.send_type&&c.isSupportCors()?(n.data=o.kit.encodeTrackData(n.data),new c.AjaxSend(n)):(n.data.time=1*new Date,n.data=i(n.server_url,n.data),new c.ImageSend(n))},sendCall:function(n){var t=this.getInstance(n);t.start()}},d={plugin_name:"CustomEventsSender",init:function(n,t){if(o=n,c=o._,u=o&&o.log||console&&console.log||function(){},c.isFunction(t)){if(o.readyState&&o.readyState.state>=3||!o.on)return s.init(t);o.on("sdkAfterInitPara",function(){s.init(t)})}else u("CustomEventsSender init failed\uff0chookFn error. hookFn:",t)}},f=e(d);return f}(); \ No newline at end of file +!function(){"use strict";function n(n,e,a){if(e&&(n.plugin_name=e),a&&n.init){var r=n.init;n.init=function(i,o){function c(){r.call(n,i,o)}return t(i,n,e),i.readyState&&i.readyState.state>=3||!i.on?c():void i.on(a,c)}}return n}function t(n,t,e){function a(t,a){n.logger?n.logger.msg.apply(n.logger,a).module(e+""||"").level(t).log():n.log&&n.log.apply(n,a)}t.log=function(){a("log",arguments)},t.warn=function(){a("warn",arguments)},t.error=function(){a("error",arguments)}}function e(t,e,a){return n(t,e,a),t.plugin_version=l,t}function a(n){var t=[];return c.each(n,function(n){c.isArray(n)?t=t.concat(a(n)):t.push(c.optimizeServerUrl(n))}),t}function r(n,t){t=c.isArray(t)?t:[t];var e=!1;return c.isArray(n)?c.each(n,function(n){c.indexOf(t,n)>-1&&(e=!0)}):c.indexOf(t,n)>-1&&(e=!0),e}function i(n,t){var e=o.kit.encodeTrackData(t);return n.indexOf("?")!==-1?n+"&"+e:n+"?"+e}var o,c,u,l="1.26.9",s={hookFn:null,init:function(n){this.hookFn=n,o.registerInterceptor("sendDataStage",{send:{priority:20,entry:function(n,t){return s.sendData(n,t),n}}})},sendData:function(n,t){var e=n.data,i=e.event,o=n.server_url,u=n.callback,l=this,s=this.hookFn({event_name:i,data:c.extend2Lev({identities:{},lib:{},properties:{}},e),server_url:o});return c.isArray(s)&&s.length?(s=a(s),r(o,s)?u=null:t.cancellationToken.stop(),c.each(s,function(t){if(t&&""!==t&&!r(t,o)){var e=function(t){return function(){l.sendCall({server_url:t,data:n.data,config:null,callback:u}),u=null,n.callback=null}}(t);setTimeout(e)}}),n):(c.isFunction(u)&&u(),t.cancellationToken.stop(),n)},getInstance:function(n){return"beacon"===o.para.send_type&&c.isSupportBeaconSend()?(n.data=o.kit.encodeTrackData(n.data),new c.BeaconSend(n)):"ajax"===o.para.send_type&&c.isSupportCors()?(n.data=o.kit.encodeTrackData(n.data),new c.AjaxSend(n)):(n.data.time=1*new Date,n.data=i(n.server_url,n.data),new c.ImageSend(n))},sendCall:function(n){var t=this.getInstance(n);t.start()}},d={plugin_name:"CustomEventsSender",init:function(n,t){if(o=n,c=o._,u=o&&o.log||console&&console.log||function(){},c.isFunction(t)){if(o.readyState&&o.readyState.state>=3||!o.on)return s.init(t);o.on("sdkAfterInitPara",function(){s.init(t)})}else u("CustomEventsSender init failed\uff0chookFn error. hookFn:",t)}},f=e(d);return f}(); \ No newline at end of file diff --git a/dist/web/plugin/custom-events-sender/index.es6.js b/dist/web/plugin/custom-events-sender/index.es6.js index 2c22633c..ddd06082 100644 --- a/dist/web/plugin/custom-events-sender/index.es6.js +++ b/dist/web/plugin/custom-events-sender/index.es6.js @@ -1 +1 @@ -var sd,_,log,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var r=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){r.call(n,a,i)}a.on(t,o)}}return n}function wrapLogFn(n,e,t){function r(e,r){n.logger?n.logger.msg.apply(n.logger,r).module(t+""||"").level(e).log():n.log&&n.log.apply(n,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(n,e,t){return wrapPluginInitFn(n,e,t),n.plugin_version=sdkversion_placeholder,n}function flattenArray(n){var e=[];return _.each(n,function(n){_.isArray(n)?e=e.concat(flattenArray(n)):e.push(_.optimizeServerUrl(n))}),e}function hasEqualServerUrl(n,e){e=_.isArray(e)?e:[e];var t=!1;return _.isArray(n)?_.each(n,function(n){_.indexOf(e,n)>-1&&(t=!0)}):_.indexOf(e,n)>-1&&(t=!0),t}function getSendUrl(n,e){var t=sd.kit.encodeTrackData(e);return-1!==n.indexOf("?")?n+"&"+t:n+"?"+t}var sender={hookFn:null,init:function(n){this.hookFn=n,sd.registerInterceptor("sendDataStage",{send:{priority:20,entry:function(n,e){return sender.sendData(n,e),n}}})},sendData:function(n,e){var t=n.data,r=t.event,a=n.server_url,i=n.callback,o=this,l=this.hookFn({event_name:r,data:_.extend2Lev({identities:{},lib:{},properties:{}},t),server_url:a});return _.isArray(l)&&l.length?(l=flattenArray(l),hasEqualServerUrl(a,l)?i=null:e.cancellationToken.stop(),_.each(l,function(e){if(e&&""!==e&&!hasEqualServerUrl(e,a)){var t=(r=e,function(){o.sendCall({server_url:r,data:n.data,config:null,callback:i}),i=null,n.callback=null});setTimeout(t)}var r}),n):(_.isFunction(i)&&i(),e.cancellationToken.stop(),n)},getInstance:function(n){return"beacon"===sd.para.send_type&&_.isSupportBeaconSend()?(n.data=sd.kit.encodeTrackData(n.data),new _.BeaconSend(n)):"ajax"===sd.para.send_type&&_.isSupportCors()?(n.data=sd.kit.encodeTrackData(n.data),new _.AjaxSend(n)):(n.data.time=1*new Date,n.data=getSendUrl(n.server_url,n.data),new _.ImageSend(n))},sendCall:function(n){this.getInstance(n).start()}},CustomEventsSender={plugin_name:"CustomEventsSender",init:function(n,e){if(_=(sd=n)._,log=sd&&sd.log||console&&console.log||function(){},_.isFunction(e)){if(sd.readyState&&sd.readyState.state>=3||!sd.on)return sender.init(e);sd.on("sdkAfterInitPara",function(){sender.init(e)})}else log("CustomEventsSender init failed\uff0chookFn error. hookFn:",e)}},index=createPlugin(CustomEventsSender);export default index; \ No newline at end of file +var sd,_,log,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var r=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){r.call(n,a,i)}a.on(t,o)}}return n}function wrapLogFn(n,e,t){function r(e,r){n.logger?n.logger.msg.apply(n.logger,r).module(t+""||"").level(e).log():n.log&&n.log.apply(n,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(n,e,t){return wrapPluginInitFn(n,e,t),n.plugin_version=sdkversion_placeholder,n}function flattenArray(n){var e=[];return _.each(n,function(n){_.isArray(n)?e=e.concat(flattenArray(n)):e.push(_.optimizeServerUrl(n))}),e}function hasEqualServerUrl(n,e){e=_.isArray(e)?e:[e];var t=!1;return _.isArray(n)?_.each(n,function(n){_.indexOf(e,n)>-1&&(t=!0)}):_.indexOf(e,n)>-1&&(t=!0),t}function getSendUrl(n,e){var t=sd.kit.encodeTrackData(e);return-1!==n.indexOf("?")?n+"&"+t:n+"?"+t}var sender={hookFn:null,init:function(n){this.hookFn=n,sd.registerInterceptor("sendDataStage",{send:{priority:20,entry:function(n,e){return sender.sendData(n,e),n}}})},sendData:function(n,e){var t=n.data,r=t.event,a=n.server_url,i=n.callback,o=this,l=this.hookFn({event_name:r,data:_.extend2Lev({identities:{},lib:{},properties:{}},t),server_url:a});return _.isArray(l)&&l.length?(l=flattenArray(l),hasEqualServerUrl(a,l)?i=null:e.cancellationToken.stop(),_.each(l,function(e){if(e&&""!==e&&!hasEqualServerUrl(e,a)){var t=(r=e,function(){o.sendCall({server_url:r,data:n.data,config:null,callback:i}),i=null,n.callback=null});setTimeout(t)}var r}),n):(_.isFunction(i)&&i(),e.cancellationToken.stop(),n)},getInstance:function(n){return"beacon"===sd.para.send_type&&_.isSupportBeaconSend()?(n.data=sd.kit.encodeTrackData(n.data),new _.BeaconSend(n)):"ajax"===sd.para.send_type&&_.isSupportCors()?(n.data=sd.kit.encodeTrackData(n.data),new _.AjaxSend(n)):(n.data.time=1*new Date,n.data=getSendUrl(n.server_url,n.data),new _.ImageSend(n))},sendCall:function(n){this.getInstance(n).start()}},CustomEventsSender={plugin_name:"CustomEventsSender",init:function(n,e){if(_=(sd=n)._,log=sd&&sd.log||console&&console.log||function(){},_.isFunction(e)){if(sd.readyState&&sd.readyState.state>=3||!sd.on)return sender.init(e);sd.on("sdkAfterInitPara",function(){sender.init(e)})}else log("CustomEventsSender init failed\uff0chookFn error. hookFn:",e)}},index=createPlugin(CustomEventsSender);export default index; \ No newline at end of file diff --git a/dist/web/plugin/custom-events-sender/index.js b/dist/web/plugin/custom-events-sender/index.js index 9ee1f58e..a621af19 100644 --- a/dist/web/plugin/custom-events-sender/index.js +++ b/dist/web/plugin/custom-events-sender/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).CustomEventsSender=function(){"use strict";function n(n,t,a){if(t&&(n.plugin_name=t),a&&n.init){var r=n.init;n.init=function(i,o){function u(){r.call(n,i,o)}return e(i,n,t),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(a,u)}}return n}function e(n,e,t){function a(e,a){n.logger?n.logger.msg.apply(n.logger,a).module(t+""||"").level(e).log():n.log&&n.log.apply(n,a)}e.log=function(){a("log",arguments)},e.warn=function(){a("warn",arguments)},e.error=function(){a("error",arguments)}}function t(e,t,a){return n(e,t,a),e.plugin_version=l,e}function a(n){var e=[];return u.each(n,function(n){u.isArray(n)?e=e.concat(a(n)):e.push(u.optimizeServerUrl(n))}),e}function r(n,e){e=u.isArray(e)?e:[e];var t=!1;return u.isArray(n)?u.each(n,function(n){u.indexOf(e,n)>-1&&(t=!0)}):u.indexOf(e,n)>-1&&(t=!0),t}function i(n,e){var t=o.kit.encodeTrackData(e);return n.indexOf("?")!==-1?n+"&"+t:n+"?"+t}var o,u,c,l="1.26.8",s={hookFn:null,init:function(n){this.hookFn=n,o.registerInterceptor("sendDataStage",{send:{priority:20,entry:function(n,e){return s.sendData(n,e),n}}})},sendData:function(n,e){var t=n.data,i=t.event,o=n.server_url,c=n.callback,l=this,s=this.hookFn({event_name:i,data:u.extend2Lev({identities:{},lib:{},properties:{}},t),server_url:o});return u.isArray(s)&&s.length?(s=a(s),r(o,s)?c=null:e.cancellationToken.stop(),u.each(s,function(e){if(e&&""!==e&&!r(e,o)){var t=function(e){return function(){l.sendCall({server_url:e,data:n.data,config:null,callback:c}),c=null,n.callback=null}}(e);setTimeout(t)}}),n):(u.isFunction(c)&&c(),e.cancellationToken.stop(),n)},getInstance:function(n){return"beacon"===o.para.send_type&&u.isSupportBeaconSend()?(n.data=o.kit.encodeTrackData(n.data),new u.BeaconSend(n)):"ajax"===o.para.send_type&&u.isSupportCors()?(n.data=o.kit.encodeTrackData(n.data),new u.AjaxSend(n)):(n.data.time=1*new Date,n.data=i(n.server_url,n.data),new u.ImageSend(n))},sendCall:function(n){var e=this.getInstance(n);e.start()}},d={plugin_name:"CustomEventsSender",init:function(n,e){if(o=n,u=o._,c=o&&o.log||console&&console.log||function(){},u.isFunction(e)){if(o.readyState&&o.readyState.state>=3||!o.on)return s.init(e);o.on("sdkAfterInitPara",function(){s.init(e)})}else c("CustomEventsSender init failed\uff0chookFn error. hookFn:",e)}},f=t(d);return f}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).CustomEventsSender=function(){"use strict";function n(n,t,a){if(t&&(n.plugin_name=t),a&&n.init){var r=n.init;n.init=function(i,o){function u(){r.call(n,i,o)}return e(i,n,t),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(a,u)}}return n}function e(n,e,t){function a(e,a){n.logger?n.logger.msg.apply(n.logger,a).module(t+""||"").level(e).log():n.log&&n.log.apply(n,a)}e.log=function(){a("log",arguments)},e.warn=function(){a("warn",arguments)},e.error=function(){a("error",arguments)}}function t(e,t,a){return n(e,t,a),e.plugin_version=l,e}function a(n){var e=[];return u.each(n,function(n){u.isArray(n)?e=e.concat(a(n)):e.push(u.optimizeServerUrl(n))}),e}function r(n,e){e=u.isArray(e)?e:[e];var t=!1;return u.isArray(n)?u.each(n,function(n){u.indexOf(e,n)>-1&&(t=!0)}):u.indexOf(e,n)>-1&&(t=!0),t}function i(n,e){var t=o.kit.encodeTrackData(e);return n.indexOf("?")!==-1?n+"&"+t:n+"?"+t}var o,u,c,l="1.26.9",s={hookFn:null,init:function(n){this.hookFn=n,o.registerInterceptor("sendDataStage",{send:{priority:20,entry:function(n,e){return s.sendData(n,e),n}}})},sendData:function(n,e){var t=n.data,i=t.event,o=n.server_url,c=n.callback,l=this,s=this.hookFn({event_name:i,data:u.extend2Lev({identities:{},lib:{},properties:{}},t),server_url:o});return u.isArray(s)&&s.length?(s=a(s),r(o,s)?c=null:e.cancellationToken.stop(),u.each(s,function(e){if(e&&""!==e&&!r(e,o)){var t=function(e){return function(){l.sendCall({server_url:e,data:n.data,config:null,callback:c}),c=null,n.callback=null}}(e);setTimeout(t)}}),n):(u.isFunction(c)&&c(),e.cancellationToken.stop(),n)},getInstance:function(n){return"beacon"===o.para.send_type&&u.isSupportBeaconSend()?(n.data=o.kit.encodeTrackData(n.data),new u.BeaconSend(n)):"ajax"===o.para.send_type&&u.isSupportCors()?(n.data=o.kit.encodeTrackData(n.data),new u.AjaxSend(n)):(n.data.time=1*new Date,n.data=i(n.server_url,n.data),new u.ImageSend(n))},sendCall:function(n){var e=this.getInstance(n);e.start()}},d={plugin_name:"CustomEventsSender",init:function(n,e){if(o=n,u=o._,c=o&&o.log||console&&console.log||function(){},u.isFunction(e)){if(o.readyState&&o.readyState.state>=3||!o.on)return s.init(e);o.on("sdkAfterInitPara",function(){s.init(e)})}else c("CustomEventsSender init failed\uff0chookFn error. hookFn:",e)}},f=t(d);return f}(); \ No newline at end of file diff --git a/dist/web/plugin/debug-sender/index.closure.js b/dist/web/plugin/debug-sender/index.closure.js index d9f5cf10..65e71898 100644 --- a/dist/web/plugin/debug-sender/index.closure.js +++ b/dist/web/plugin/debug-sender/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function r(r,a,n){if(a&&(r.plugin_name=a),n&&r.init){var t=r.init;r.init=function(u,i){function o(){t.call(r,u,i)}return e(u,r,a),u.readyState&&u.readyState.state>=3||!u.on?o():void u.on(n,o)}}return r}function e(r,e,a){function n(e,n){r.logger?r.logger.msg.apply(r.logger,n).module(a+""||"").level(e).log():r.log&&r.log.apply(r,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function a(e,a,n){return r(e,a,n),e.plugin_version=g,e}function n(r){var e=r,a="";a=o.para.debug_mode_url.indexOf("?")!==-1?o.para.debug_mode_url+"&"+o.kit.encodeTrackData(r):o.para.debug_mode_url+"?"+o.kit.encodeTrackData(r),d.ajax({url:a,type:"GET",cors:!0,header:{"Dry-Run":String(o.para.debug_mode_upload)},success:function(r){d.isEmptyObject(r)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+e):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(r))}})}function t(r,e){if(o.para.debug_mode===!0){var a=r.data;r.callback;n(JSON.stringify(a)),e.cancellationToken.stop()}return r}function u(){o.para.debug_mode===!0&&(o.para.debug_mode_upload=o.para.debug_mode_upload||!1,d.isString(o.para.debug_mode_url)||(d.isString(o.para.server_url)?o.para.debug_mode_url=o.para.server_url.replace("sa.gif","debug"):d.isArray(o.para.server_url)&&d.isString(o.para.server_url[0])?o.para.debug_mode_url=o.para.server_url[0].replace("sa.gif","debug"):o.para.debug_mode=!1))}function i(){o.on("sdkInitPara",function(){u()}),o.on("sdkAfterInitPara",function(){o.registerInterceptor("sendDataStage",{send:{priority:30,entry:t}})})}var o,d,g="1.26.8",l={plugin_name:"DebugSender",init:function(r){o=r,d=o._,i()}},c=a(l);return c}(); \ No newline at end of file +!function(){"use strict";function r(r,a,n){if(a&&(r.plugin_name=a),n&&r.init){var t=r.init;r.init=function(u,i){function o(){t.call(r,u,i)}return e(u,r,a),u.readyState&&u.readyState.state>=3||!u.on?o():void u.on(n,o)}}return r}function e(r,e,a){function n(e,n){r.logger?r.logger.msg.apply(r.logger,n).module(a+""||"").level(e).log():r.log&&r.log.apply(r,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function a(e,a,n){return r(e,a,n),e.plugin_version=g,e}function n(r){var e=r,a="";a=o.para.debug_mode_url.indexOf("?")!==-1?o.para.debug_mode_url+"&"+o.kit.encodeTrackData(r):o.para.debug_mode_url+"?"+o.kit.encodeTrackData(r),d.ajax({url:a,type:"GET",cors:!0,header:{"Dry-Run":String(o.para.debug_mode_upload)},success:function(r){d.isEmptyObject(r)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+e):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(r))}})}function t(r,e){if(o.para.debug_mode===!0){var a=r.data;r.callback;n(JSON.stringify(a)),e.cancellationToken.stop()}return r}function u(){o.para.debug_mode===!0&&(o.para.debug_mode_upload=o.para.debug_mode_upload||!1,d.isString(o.para.debug_mode_url)||(d.isString(o.para.server_url)?o.para.debug_mode_url=o.para.server_url.replace("sa.gif","debug"):d.isArray(o.para.server_url)&&d.isString(o.para.server_url[0])?o.para.debug_mode_url=o.para.server_url[0].replace("sa.gif","debug"):o.para.debug_mode=!1))}function i(){o.on("sdkInitPara",function(){u()}),o.on("sdkAfterInitPara",function(){o.registerInterceptor("sendDataStage",{send:{priority:30,entry:t}})})}var o,d,g="1.26.9",l={plugin_name:"DebugSender",init:function(r){o=r,d=o._,i()}},c=a(l);return c}(); \ No newline at end of file diff --git a/dist/web/plugin/debug-sender/index.es6.js b/dist/web/plugin/debug-sender/index.es6.js index 82b8730d..46d86db7 100644 --- a/dist/web/plugin/debug-sender/index.es6.js +++ b/dist/web/plugin/debug-sender/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(d,t){if(wrapLogFn(d,e,r),d.readyState&&d.readyState.state>=3||!d.on)return i();function i(){n.call(e,d,t)}d.on(a,i)}}return e}function wrapLogFn(e,r,a){function n(r,n){e.logger?e.logger.msg.apply(e.logger,n).module(a+""||"").level(r).log():e.log&&e.log.apply(e,n)}r.log=function(){n("log",arguments)},r.warn=function(){n("warn",arguments)},r.error=function(){n("error",arguments)}}function createPlugin(e,r,a){return wrapPluginInitFn(e,r,a),e.plugin_version=sdkversion_placeholder,e}function debugPath(e){var r=e,a="";a=-1!==sd.para.debug_mode_url.indexOf("?")?sd.para.debug_mode_url+"&"+sd.kit.encodeTrackData(e):sd.para.debug_mode_url+"?"+sd.kit.encodeTrackData(e),_.ajax({url:a,type:"GET",cors:!0,header:{"Dry-Run":String(sd.para.debug_mode_upload)},success:function(e){!0===_.isEmptyObject(e)?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+r):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData(e,r){if(!0===sd.para.debug_mode){var a=e.data;e.callback;debugPath(JSON.stringify(a)),r.cancellationToken.stop()}return e}function initPara(){!0===sd.para.debug_mode&&(sd.para.debug_mode_upload=sd.para.debug_mode_upload||!1,_.isString(sd.para.debug_mode_url)||(_.isString(sd.para.server_url)?sd.para.debug_mode_url=sd.para.server_url.replace("sa.gif","debug"):_.isArray(sd.para.server_url)&&_.isString(sd.para.server_url[0])?sd.para.debug_mode_url=sd.para.server_url[0].replace("sa.gif","debug"):sd.para.debug_mode=!1))}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:30,entry:sendData}})})}var DebugSender={plugin_name:"DebugSender",init:function(e){_=(sd=e)._,senderInit()}},index=createPlugin(DebugSender);export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(d,t){if(wrapLogFn(d,e,r),d.readyState&&d.readyState.state>=3||!d.on)return i();function i(){n.call(e,d,t)}d.on(a,i)}}return e}function wrapLogFn(e,r,a){function n(r,n){e.logger?e.logger.msg.apply(e.logger,n).module(a+""||"").level(r).log():e.log&&e.log.apply(e,n)}r.log=function(){n("log",arguments)},r.warn=function(){n("warn",arguments)},r.error=function(){n("error",arguments)}}function createPlugin(e,r,a){return wrapPluginInitFn(e,r,a),e.plugin_version=sdkversion_placeholder,e}function debugPath(e){var r=e,a="";a=-1!==sd.para.debug_mode_url.indexOf("?")?sd.para.debug_mode_url+"&"+sd.kit.encodeTrackData(e):sd.para.debug_mode_url+"?"+sd.kit.encodeTrackData(e),_.ajax({url:a,type:"GET",cors:!0,header:{"Dry-Run":String(sd.para.debug_mode_upload)},success:function(e){!0===_.isEmptyObject(e)?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+r):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData(e,r){if(!0===sd.para.debug_mode){var a=e.data;e.callback;debugPath(JSON.stringify(a)),r.cancellationToken.stop()}return e}function initPara(){!0===sd.para.debug_mode&&(sd.para.debug_mode_upload=sd.para.debug_mode_upload||!1,_.isString(sd.para.debug_mode_url)||(_.isString(sd.para.server_url)?sd.para.debug_mode_url=sd.para.server_url.replace("sa.gif","debug"):_.isArray(sd.para.server_url)&&_.isString(sd.para.server_url[0])?sd.para.debug_mode_url=sd.para.server_url[0].replace("sa.gif","debug"):sd.para.debug_mode=!1))}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:30,entry:sendData}})})}var DebugSender={plugin_name:"DebugSender",init:function(e){_=(sd=e)._,senderInit()}},index=createPlugin(DebugSender);export default index; \ No newline at end of file diff --git a/dist/web/plugin/debug-sender/index.js b/dist/web/plugin/debug-sender/index.js index 67f3aab9..4ec5e85c 100644 --- a/dist/web/plugin/debug-sender/index.js +++ b/dist/web/plugin/debug-sender/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).DebugSender=function(){"use strict";function r(r,a,n){if(a&&(r.plugin_name=a),n&&r.init){var t=r.init;r.init=function(u,i){function o(){t.call(r,u,i)}return e(u,r,a),u.readyState&&u.readyState.state>=3||!u.on?o():void u.on(n,o)}}return r}function e(r,e,a){function n(e,n){r.logger?r.logger.msg.apply(r.logger,n).module(a+""||"").level(e).log():r.log&&r.log.apply(r,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function a(e,a,n){return r(e,a,n),e.plugin_version=g,e}function n(r){var e=r,a="";a=o.para.debug_mode_url.indexOf("?")!==-1?o.para.debug_mode_url+"&"+o.kit.encodeTrackData(r):o.para.debug_mode_url+"?"+o.kit.encodeTrackData(r),d.ajax({url:a,type:"GET",cors:!0,header:{"Dry-Run":String(o.para.debug_mode_upload)},success:function(r){d.isEmptyObject(r)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+e):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(r))}})}function t(r,e){if(o.para.debug_mode===!0){var a=r.data;r.callback;n(JSON.stringify(a)),e.cancellationToken.stop()}return r}function u(){o.para.debug_mode===!0&&(o.para.debug_mode_upload=o.para.debug_mode_upload||!1,d.isString(o.para.debug_mode_url)||(d.isString(o.para.server_url)?o.para.debug_mode_url=o.para.server_url.replace("sa.gif","debug"):d.isArray(o.para.server_url)&&d.isString(o.para.server_url[0])?o.para.debug_mode_url=o.para.server_url[0].replace("sa.gif","debug"):o.para.debug_mode=!1))}function i(){o.on("sdkInitPara",function(){u()}),o.on("sdkAfterInitPara",function(){o.registerInterceptor("sendDataStage",{send:{priority:30,entry:t}})})}var o,d,g="1.26.8",l={plugin_name:"DebugSender",init:function(r){o=r,d=o._,i()}},c=a(l);return c}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).DebugSender=function(){"use strict";function r(r,a,n){if(a&&(r.plugin_name=a),n&&r.init){var t=r.init;r.init=function(u,i){function o(){t.call(r,u,i)}return e(u,r,a),u.readyState&&u.readyState.state>=3||!u.on?o():void u.on(n,o)}}return r}function e(r,e,a){function n(e,n){r.logger?r.logger.msg.apply(r.logger,n).module(a+""||"").level(e).log():r.log&&r.log.apply(r,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function a(e,a,n){return r(e,a,n),e.plugin_version=g,e}function n(r){var e=r,a="";a=o.para.debug_mode_url.indexOf("?")!==-1?o.para.debug_mode_url+"&"+o.kit.encodeTrackData(r):o.para.debug_mode_url+"?"+o.kit.encodeTrackData(r),d.ajax({url:a,type:"GET",cors:!0,header:{"Dry-Run":String(o.para.debug_mode_upload)},success:function(r){d.isEmptyObject(r)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+e):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(r))}})}function t(r,e){if(o.para.debug_mode===!0){var a=r.data;r.callback;n(JSON.stringify(a)),e.cancellationToken.stop()}return r}function u(){o.para.debug_mode===!0&&(o.para.debug_mode_upload=o.para.debug_mode_upload||!1,d.isString(o.para.debug_mode_url)||(d.isString(o.para.server_url)?o.para.debug_mode_url=o.para.server_url.replace("sa.gif","debug"):d.isArray(o.para.server_url)&&d.isString(o.para.server_url[0])?o.para.debug_mode_url=o.para.server_url[0].replace("sa.gif","debug"):o.para.debug_mode=!1))}function i(){o.on("sdkInitPara",function(){u()}),o.on("sdkAfterInitPara",function(){o.registerInterceptor("sendDataStage",{send:{priority:30,entry:t}})})}var o,d,g="1.26.9",l={plugin_name:"DebugSender",init:function(r){o=r,d=o._,i()}},c=a(l);return c}(); \ No newline at end of file diff --git a/dist/web/plugin/deeplink/index.closure.js b/dist/web/plugin/deeplink/index.closure.js index ba50ec57..0f305499 100644 --- a/dist/web/plugin/deeplink/index.closure.js +++ b/dist/web/plugin/deeplink/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function i(i,e,n){if(e&&(i.plugin_name=e),n&&i.init){var o=i.init;i.init=function(r,s){function a(){o.call(i,r,s)}return t(r,i,e),r.readyState&&r.readyState.state>=3||!r.on?a():void r.on(n,a)}}return i}function t(i,t,e){function n(t,n){i.logger?i.logger.msg.apply(i.logger,n).module(e+""||"").level(t).log():i.log&&i.log.apply(i,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function e(t,e,n){return i(t,e,n),t.plugin_version=r,t}function n(){return"undefined"!=typeof o&&document[o]}var o,r="1.26.8",s=(/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),function(){var i={};return"undefined"!=typeof document.hidden?(i.hidden="hidden",i.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(i.hidden="msHidden",i.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i.hidden="webkitHidden",i.visibilityChange="webkitvisibilitychange"),i});o=s().hidden;var a={android:/Android/i,iOS:/iPhone|iPad|iPod/i},d=function(){for(var i in a)if(navigator.userAgent.match(a[i]))return i;return""},l=d(),u=function(){return a.hasOwnProperty(l)},h=function(i){return null!=i&&"[object Object]"==Object.prototype.toString.call(i)},c=function(i){var t=/\/sd\/(\w+)\/(\w+)$/;return i.match(t)},g=function(i){var t=i._.URL(i.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},p=function(i,t,e){i.log("\u5c1d\u8bd5\u5524\u8d77 android app");var r=t;i.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+r),window.location=r,i.timer=setTimeout(function(){var t=n();return i.log("hide:"+o+":"+document[o]),t?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location=e))},i.timeout)},f=function(i,t,e){i.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+t),window.location.href=t,i.timer=setTimeout(function(){var t=n();return t?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location.href=e))},i.timeout),i.log("new timer:"+i.timer)},m={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(i){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=i,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&h(arguments[0])?t=arguments[0]:arguments.length>=2&&h(arguments[1])&&(t=arguments[1])),!u())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(h(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=g(this.sd);this.apiURL=this.apiURL.replace("{origin}",e.origin).replace("{project}",e.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var o=c(n);return o?(this.key=o[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(o[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(i){return i.errorMsg?(m.log("API\u62a5\u9519\uff1a"+i.errorMsg),!1):(m.data=i,m.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(i,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){m.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===l){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var i=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+i),f(this,i,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),p(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(i){this.sd&&this.sd.log(i)},addListeners:function(){var i=s().visibilityChange,t=this;i&&document.addEventListener(i,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},v=e(m,"Deeplink","sdkReady");return v}(); \ No newline at end of file +!function(){"use strict";function i(i,e,n){if(e&&(i.plugin_name=e),n&&i.init){var o=i.init;i.init=function(r,s){function a(){o.call(i,r,s)}return t(r,i,e),r.readyState&&r.readyState.state>=3||!r.on?a():void r.on(n,a)}}return i}function t(i,t,e){function n(t,n){i.logger?i.logger.msg.apply(i.logger,n).module(e+""||"").level(t).log():i.log&&i.log.apply(i,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function e(t,e,n){return i(t,e,n),t.plugin_version=r,t}function n(){return"undefined"!=typeof o&&document[o]}var o,r="1.26.9",s=(/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),function(){var i={};return"undefined"!=typeof document.hidden?(i.hidden="hidden",i.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(i.hidden="msHidden",i.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i.hidden="webkitHidden",i.visibilityChange="webkitvisibilitychange"),i});o=s().hidden;var a={android:/Android/i,iOS:/iPhone|iPad|iPod/i},d=function(){for(var i in a)if(navigator.userAgent.match(a[i]))return i;return""},l=d(),u=function(){return a.hasOwnProperty(l)},h=function(i){return null!=i&&"[object Object]"==Object.prototype.toString.call(i)},c=function(i){var t=/\/sd\/(\w+)\/(\w+)$/;return i.match(t)},g=function(i){var t=i._.URL(i.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},p=function(i,t,e){i.log("\u5c1d\u8bd5\u5524\u8d77 android app");var r=t;i.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+r),window.location=r,i.timer=setTimeout(function(){var t=n();return i.log("hide:"+o+":"+document[o]),t?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location=e))},i.timeout)},f=function(i,t,e){i.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+t),window.location.href=t,i.timer=setTimeout(function(){var t=n();return t?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location.href=e))},i.timeout),i.log("new timer:"+i.timer)},m={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(i){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=i,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&h(arguments[0])?t=arguments[0]:arguments.length>=2&&h(arguments[1])&&(t=arguments[1])),!u())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(h(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var e=g(this.sd);this.apiURL=this.apiURL.replace("{origin}",e.origin).replace("{project}",e.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var o=c(n);return o?(this.key=o[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(o[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(i){return i.errorMsg?(m.log("API\u62a5\u9519\uff1a"+i.errorMsg),!1):(m.data=i,m.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(i,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){m.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===l){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var i=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+i),f(this,i,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),p(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(i){this.sd&&this.sd.log(i)},addListeners:function(){var i=s().visibilityChange,t=this;i&&document.addEventListener(i,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},v=e(m,"Deeplink","sdkReady");return v}(); \ No newline at end of file diff --git a/dist/web/plugin/deeplink/index.es6.js b/dist/web/plugin/deeplink/index.es6.js index 058d20b2..ce94cbea 100644 --- a/dist/web/plugin/deeplink/index.es6.js +++ b/dist/web/plugin/deeplink/index.es6.js @@ -1 +1 @@ -var hidden,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(i,e,t){if(e&&(i.plugin_name=e),t&&i.init){var n=i.init;i.init=function(o,r){if(wrapLogFn(o,i,e),o.readyState&&o.readyState.state>=3||!o.on)return d();function d(){n.call(i,o,r)}o.on(t,d)}}return i}function wrapLogFn(i,e,t){function n(e,n){i.logger?i.logger.msg.apply(i.logger,n).module(t+""||"").level(e).log():i.log&&i.log.apply(i,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function createPlugin(i,e,t){return wrapPluginInitFn(i,e,t),i.plugin_version=sdkversion_placeholder,i}var isWechat=/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),getSupportedProperty=function(){var i={};return"undefined"!=typeof document.hidden?(i.hidden="hidden",i.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(i.hidden="msHidden",i.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i.hidden="webkitHidden",i.visibilityChange="webkitvisibilitychange"),i};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var OSs={android:/Android/i,iOS:/iPhone|iPad|iPod/i},getOS=function(){for(var i in OSs)if(navigator.userAgent.match(OSs[i]))return i;return""},currentOS=getOS(),isSupportedOS=function(){return OSs.hasOwnProperty(currentOS)},isObject=function(i){return null!=i&&"[object Object]"==Object.prototype.toString.call(i)},parseShortURL=function(i){return i.match(/\/sd\/(\w+)\/(\w+)$/)},parseAPIURL=function(i){var e=i._.URL(i.para.server_url);return{origin:e.origin,project:e.searchParams.get("project")||"default"}},handleAndroidLinks=function(i,e,t){i.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=e;i.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,i.timer=setTimeout(function(){var e=isPageHidden();if(i.log("hide:"+hidden+":"+document[hidden]),e)return i.log("The page is hidden, stop navigating to download page"),!1;i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=t},i.timeout)},handleIOSLinks=function(i,e,t){i.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+e),window.location.href=e,i.timer=setTimeout(function(){if(isPageHidden())return i.log("The page is hidden, stop navigating to download page"),!1;i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location.href=t},i.timeout),i.log("new timer:"+i.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(i){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=i,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var e={};if(arguments.length>0&&(1===arguments.length&&isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&isObject(arguments[1])&&(e=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject(e)&&this.sd._.isNumber(e.timeout)&&e.timeout>=2500&&(this.timeout=e.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",t.origin).replace("{project}",t.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var o=parseShortURL(n);if(!o)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=o[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(o[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(i){if(i.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+i.errorMsg),!1;SADeepLink.data=i,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(i,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var i=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+i),handleIOSLinks(this,i,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),handleAndroidLinks(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(i){this.sd&&this.sd.log(i)},addListeners:function(){var i=getSupportedProperty().visibilityChange,e=this;i&&document.addEventListener(i,function(){clearTimeout(e.timer),e.log("visibilitychange, clear timeout:"+e.timer)},!1),window.addEventListener("pagehide",function(){e.log("page hide, clear timeout:"+e.timer),clearTimeout(e.timer)},!1)}},index=createPlugin(SADeepLink,"Deeplink","sdkReady");export default index; \ No newline at end of file +var hidden,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(i,e,t){if(e&&(i.plugin_name=e),t&&i.init){var n=i.init;i.init=function(o,r){if(wrapLogFn(o,i,e),o.readyState&&o.readyState.state>=3||!o.on)return d();function d(){n.call(i,o,r)}o.on(t,d)}}return i}function wrapLogFn(i,e,t){function n(e,n){i.logger?i.logger.msg.apply(i.logger,n).module(t+""||"").level(e).log():i.log&&i.log.apply(i,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function createPlugin(i,e,t){return wrapPluginInitFn(i,e,t),i.plugin_version=sdkversion_placeholder,i}var isWechat=/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),getSupportedProperty=function(){var i={};return"undefined"!=typeof document.hidden?(i.hidden="hidden",i.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(i.hidden="msHidden",i.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i.hidden="webkitHidden",i.visibilityChange="webkitvisibilitychange"),i};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var OSs={android:/Android/i,iOS:/iPhone|iPad|iPod/i},getOS=function(){for(var i in OSs)if(navigator.userAgent.match(OSs[i]))return i;return""},currentOS=getOS(),isSupportedOS=function(){return OSs.hasOwnProperty(currentOS)},isObject=function(i){return null!=i&&"[object Object]"==Object.prototype.toString.call(i)},parseShortURL=function(i){return i.match(/\/sd\/(\w+)\/(\w+)$/)},parseAPIURL=function(i){var e=i._.URL(i.para.server_url);return{origin:e.origin,project:e.searchParams.get("project")||"default"}},handleAndroidLinks=function(i,e,t){i.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=e;i.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,i.timer=setTimeout(function(){var e=isPageHidden();if(i.log("hide:"+hidden+":"+document[hidden]),e)return i.log("The page is hidden, stop navigating to download page"),!1;i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=t},i.timeout)},handleIOSLinks=function(i,e,t){i.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+e),window.location.href=e,i.timer=setTimeout(function(){if(isPageHidden())return i.log("The page is hidden, stop navigating to download page"),!1;i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location.href=t},i.timeout),i.log("new timer:"+i.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(i){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=i,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var e={};if(arguments.length>0&&(1===arguments.length&&isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&isObject(arguments[1])&&(e=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject(e)&&this.sd._.isNumber(e.timeout)&&e.timeout>=2500&&(this.timeout=e.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",t.origin).replace("{project}",t.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var o=parseShortURL(n);if(!o)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=o[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(o[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(i){if(i.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+i.errorMsg),!1;SADeepLink.data=i,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(i,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var i=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+i),handleIOSLinks(this,i,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),handleAndroidLinks(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(i){this.sd&&this.sd.log(i)},addListeners:function(){var i=getSupportedProperty().visibilityChange,e=this;i&&document.addEventListener(i,function(){clearTimeout(e.timer),e.log("visibilitychange, clear timeout:"+e.timer)},!1),window.addEventListener("pagehide",function(){e.log("page hide, clear timeout:"+e.timer),clearTimeout(e.timer)},!1)}},index=createPlugin(SADeepLink,"Deeplink","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/deeplink/index.js b/dist/web/plugin/deeplink/index.js index dc50a8fa..5a6bf24c 100644 --- a/dist/web/plugin/deeplink/index.js +++ b/dist/web/plugin/deeplink/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Deeplink=(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).deeplink=function(){"use strict";function i(i,t,n){if(t&&(i.plugin_name=t),n&&i.init){var o=i.init;i.init=function(r,s){function a(){o.call(i,r,s)}return e(r,i,t),r.readyState&&r.readyState.state>=3||!r.on?a():void r.on(n,a)}}return i}function e(i,e,t){function n(e,n){i.logger?i.logger.msg.apply(i.logger,n).module(t+""||"").level(e).log():i.log&&i.log.apply(i,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function t(e,t,n){return i(e,t,n),e.plugin_version=r,e}function n(){return"undefined"!=typeof o&&document[o]}var o,r="1.26.8",s=(/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),function(){var i={};return"undefined"!=typeof document.hidden?(i.hidden="hidden",i.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(i.hidden="msHidden",i.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i.hidden="webkitHidden",i.visibilityChange="webkitvisibilitychange"),i});o=s().hidden;var a={android:/Android/i,iOS:/iPhone|iPad|iPod/i},d=function(){for(var i in a)if(navigator.userAgent.match(a[i]))return i;return""},l=d(),u=function(){return a.hasOwnProperty(l)},h=function(i){return null!=i&&"[object Object]"==Object.prototype.toString.call(i)},g=function(i){var e=/\/sd\/(\w+)\/(\w+)$/;return i.match(e)},c=function(i){var e=i._.URL(i.para.server_url);return{origin:e.origin,project:e.searchParams.get("project")||"default"}},p=function(i,e,t){i.log("\u5c1d\u8bd5\u5524\u8d77 android app");var r=e;i.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+r),window.location=r,i.timer=setTimeout(function(){var e=n();return i.log("hide:"+o+":"+document[o]),e?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location=t))},i.timeout)},f=function(i,e,t){i.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+e),window.location.href=e,i.timer=setTimeout(function(){var e=n();return e?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location.href=t))},i.timeout),i.log("new timer:"+i.timer)},m={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(i){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=i,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var e={};if(arguments.length>0&&(1===arguments.length&&h(arguments[0])?e=arguments[0]:arguments.length>=2&&h(arguments[1])&&(e=arguments[1])),!u())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(h(e)&&this.sd._.isNumber(e.timeout)&&e.timeout>=2500&&(this.timeout=e.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=c(this.sd);this.apiURL=this.apiURL.replace("{origin}",t.origin).replace("{project}",t.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var o=g(n);return o?(this.key=o[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(o[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(i){return i.errorMsg?(m.log("API\u62a5\u9519\uff1a"+i.errorMsg),!1):(m.data=i,m.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(i,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){m.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===l){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var i=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+i),f(this,i,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),p(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(i){this.sd&&this.sd.log(i)},addListeners:function(){var i=s().visibilityChange,e=this;i&&document.addEventListener(i,function(){clearTimeout(e.timer),e.log("visibilitychange, clear timeout:"+e.timer)},!1),window.addEventListener("pagehide",function(){e.log("page hide, clear timeout:"+e.timer),clearTimeout(e.timer)},!1)}},v=t(m,"Deeplink","sdkReady");return v}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Deeplink=(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).deeplink=function(){"use strict";function i(i,t,n){if(t&&(i.plugin_name=t),n&&i.init){var o=i.init;i.init=function(r,s){function a(){o.call(i,r,s)}return e(r,i,t),r.readyState&&r.readyState.state>=3||!r.on?a():void r.on(n,a)}}return i}function e(i,e,t){function n(e,n){i.logger?i.logger.msg.apply(i.logger,n).module(t+""||"").level(e).log():i.log&&i.log.apply(i,n)}e.log=function(){n("log",arguments)},e.warn=function(){n("warn",arguments)},e.error=function(){n("error",arguments)}}function t(e,t,n){return i(e,t,n),e.plugin_version=r,e}function n(){return"undefined"!=typeof o&&document[o]}var o,r="1.26.9",s=(/micromessenger\/([\d.]+)/i.test(navigator.userAgent||""),function(){var i={};return"undefined"!=typeof document.hidden?(i.hidden="hidden",i.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(i.hidden="msHidden",i.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(i.hidden="webkitHidden",i.visibilityChange="webkitvisibilitychange"),i});o=s().hidden;var a={android:/Android/i,iOS:/iPhone|iPad|iPod/i},d=function(){for(var i in a)if(navigator.userAgent.match(a[i]))return i;return""},l=d(),u=function(){return a.hasOwnProperty(l)},h=function(i){return null!=i&&"[object Object]"==Object.prototype.toString.call(i)},g=function(i){var e=/\/sd\/(\w+)\/(\w+)$/;return i.match(e)},c=function(i){var e=i._.URL(i.para.server_url);return{origin:e.origin,project:e.searchParams.get("project")||"default"}},p=function(i,e,t){i.log("\u5c1d\u8bd5\u5524\u8d77 android app");var r=e;i.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+r),window.location=r,i.timer=setTimeout(function(){var e=n();return i.log("hide:"+o+":"+document[o]),e?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location=t))},i.timeout)},f=function(i,e,t){i.log("\u5c1d\u8bd5\u5524\u8d77 iOS app:"+e),window.location.href=e,i.timer=setTimeout(function(){var e=n();return e?(i.log("The page is hidden, stop navigating to download page"),!1):(i.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),void(window.location.href=t))},i.timeout),i.log("new timer:"+i.timer)},m={key:null,timer:null,sd:null,data:null,timeout:2500,apiURL:"{origin}/sdk/deeplink/param?key={key}&system_type=JS&project={project}",init:function(i){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=i,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var e={};if(arguments.length>0&&(1===arguments.length&&h(arguments[0])?e=arguments[0]:arguments.length>=2&&h(arguments[1])&&(e=arguments[1])),!u())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(h(e)&&this.sd._.isNumber(e.timeout)&&e.timeout>=2500&&(this.timeout=e.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var t=c(this.sd);this.apiURL=this.apiURL.replace("{origin}",t.origin).replace("{project}",t.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var o=g(n);return o?(this.key=o[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(o[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(i){return i.errorMsg?(m.log("API\u62a5\u9519\uff1a"+i.errorMsg),!1):(m.data=i,m.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(i,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){m.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===l){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var i=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+i),f(this,i,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),p(this,this.data.android_info.url_schemes,this.data.android_info.download_url)},log:function(i){this.sd&&this.sd.log(i)},addListeners:function(){var i=s().visibilityChange,e=this;i&&document.addEventListener(i,function(){clearTimeout(e.timer),e.log("visibilitychange, clear timeout:"+e.timer)},!1),window.addEventListener("pagehide",function(){e.log("page hide, clear timeout:"+e.timer),clearTimeout(e.timer)},!1)}},v=t(m,"Deeplink","sdkReady");return v}(); \ No newline at end of file diff --git a/dist/web/plugin/disable-sdk/index.closure.js b/dist/web/plugin/disable-sdk/index.closure.js index 97018639..585c26c6 100644 --- a/dist/web/plugin/disable-sdk/index.closure.js +++ b/dist/web/plugin/disable-sdk/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,i,o){if(i&&(n.plugin_name=i),o&&n.init){var e=n.init;n.init=function(r,u){function l(){e.call(n,r,u)}return t(r,n,i),r.readyState&&r.readyState.state>=3||!r.on?l():void r.on(o,l)}}return n}function t(n,t,i){function o(t,o){n.logger?n.logger.msg.apply(n.logger,o).module(i+""||"").level(t).log():n.log&&n.log.apply(n,o)}t.log=function(){o("log",arguments)},t.warn=function(){o("warn",arguments)},t.error=function(){o("error",arguments)}}function i(t,i,o){return n(t,i,o),t.plugin_version=u,t}function o(){l=!0}function e(){l=!1}function r(){return l}var u="1.26.8",l=!1,a=null,c={init:function(n){a=n,a.disableSDK=o,a.enableSDK=e,a.getDisabled=r}},f=i(c,"DisableSDK","sdkInitAPI");return f}(); \ No newline at end of file +!function(){"use strict";function n(n,i,o){if(i&&(n.plugin_name=i),o&&n.init){var e=n.init;n.init=function(r,u){function l(){e.call(n,r,u)}return t(r,n,i),r.readyState&&r.readyState.state>=3||!r.on?l():void r.on(o,l)}}return n}function t(n,t,i){function o(t,o){n.logger?n.logger.msg.apply(n.logger,o).module(i+""||"").level(t).log():n.log&&n.log.apply(n,o)}t.log=function(){o("log",arguments)},t.warn=function(){o("warn",arguments)},t.error=function(){o("error",arguments)}}function i(t,i,o){return n(t,i,o),t.plugin_version=u,t}function o(){l=!0}function e(){l=!1}function r(){return l}var u="1.26.9",l=!1,a=null,c={init:function(n){a=n,a.disableSDK=o,a.enableSDK=e,a.getDisabled=r}},f=i(c,"DisableSDK","sdkInitAPI");return f}(); \ No newline at end of file diff --git a/dist/web/plugin/disable-sdk/index.es6.js b/dist/web/plugin/disable-sdk/index.es6.js index dfeaaede..ff14a5a1 100644 --- a/dist/web/plugin/disable-sdk/index.es6.js +++ b/dist/web/plugin/disable-sdk/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.26.8";function wrapPluginInitFn(n,i,e){if(i&&(n.plugin_name=i),e&&n.init){var l=n.init;n.init=function(a,r){if(wrapLogFn(a,n,i),a.readyState&&a.readyState.state>=3||!a.on)return t();function t(){l.call(n,a,r)}a.on(e,t)}}return n}function wrapLogFn(n,i,e){function l(i,l){n.logger?n.logger.msg.apply(n.logger,l).module(e+""||"").level(i).log():n.log&&n.log.apply(n,l)}i.log=function(){l("log",arguments)},i.warn=function(){l("warn",arguments)},i.error=function(){l("error",arguments)}}function createPlugin(n,i,e){return wrapPluginInitFn(n,i,e),n.plugin_version=sdkversion_placeholder,n}var isDisabled=!1,sd=null,disableSDKPlugin={init:function(n){(sd=n).disableSDK=disableSDK,sd.enableSDK=enableSDK,sd.getDisabled=getDisabled}};function disableSDK(){isDisabled=!0}function enableSDK(){isDisabled=!1}function getDisabled(){return isDisabled}var index=createPlugin(disableSDKPlugin,"DisableSDK","sdkInitAPI");export default index; \ No newline at end of file +var sdkversion_placeholder="1.26.9";function wrapPluginInitFn(n,i,e){if(i&&(n.plugin_name=i),e&&n.init){var l=n.init;n.init=function(a,r){if(wrapLogFn(a,n,i),a.readyState&&a.readyState.state>=3||!a.on)return t();function t(){l.call(n,a,r)}a.on(e,t)}}return n}function wrapLogFn(n,i,e){function l(i,l){n.logger?n.logger.msg.apply(n.logger,l).module(e+""||"").level(i).log():n.log&&n.log.apply(n,l)}i.log=function(){l("log",arguments)},i.warn=function(){l("warn",arguments)},i.error=function(){l("error",arguments)}}function createPlugin(n,i,e){return wrapPluginInitFn(n,i,e),n.plugin_version=sdkversion_placeholder,n}var isDisabled=!1,sd=null,disableSDKPlugin={init:function(n){(sd=n).disableSDK=disableSDK,sd.enableSDK=enableSDK,sd.getDisabled=getDisabled}};function disableSDK(){isDisabled=!0}function enableSDK(){isDisabled=!1}function getDisabled(){return isDisabled}var index=createPlugin(disableSDKPlugin,"DisableSDK","sdkInitAPI");export default index; \ No newline at end of file diff --git a/dist/web/plugin/disable-sdk/index.js b/dist/web/plugin/disable-sdk/index.js index f64918b4..139918ee 100644 --- a/dist/web/plugin/disable-sdk/index.js +++ b/dist/web/plugin/disable-sdk/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).DisableSDK=function(){"use strict";function n(n,t,o){if(t&&(n.plugin_name=t),o&&n.init){var e=n.init;n.init=function(r,l){function u(){e.call(n,r,l)}return i(r,n,t),r.readyState&&r.readyState.state>=3||!r.on?u():void r.on(o,u)}}return n}function i(n,i,t){function o(i,o){n.logger?n.logger.msg.apply(n.logger,o).module(t+""||"").level(i).log():n.log&&n.log.apply(n,o)}i.log=function(){o("log",arguments)},i.warn=function(){o("warn",arguments)},i.error=function(){o("error",arguments)}}function t(i,t,o){return n(i,t,o),i.plugin_version=l,i}function o(){u=!0}function e(){u=!1}function r(){return u}var l="1.26.8",u=!1,a=null,g={init:function(n){a=n,a.disableSDK=o,a.enableSDK=e,a.getDisabled=r}},c=t(g,"DisableSDK","sdkInitAPI");return c}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).DisableSDK=function(){"use strict";function n(n,t,o){if(t&&(n.plugin_name=t),o&&n.init){var e=n.init;n.init=function(r,l){function u(){e.call(n,r,l)}return i(r,n,t),r.readyState&&r.readyState.state>=3||!r.on?u():void r.on(o,u)}}return n}function i(n,i,t){function o(i,o){n.logger?n.logger.msg.apply(n.logger,o).module(t+""||"").level(i).log():n.log&&n.log.apply(n,o)}i.log=function(){o("log",arguments)},i.warn=function(){o("warn",arguments)},i.error=function(){o("error",arguments)}}function t(i,t,o){return n(i,t,o),i.plugin_version=l,i}function o(){u=!0}function e(){u=!1}function r(){return u}var l="1.26.9",u=!1,a=null,g={init:function(n){a=n,a.disableSDK=o,a.enableSDK=e,a.getDisabled=r}},c=t(g,"DisableSDK","sdkInitAPI");return c}(); \ No newline at end of file diff --git a/dist/web/plugin/exposure/index.closure.js b/dist/web/plugin/exposure/index.closure.js index 1e569bc8..0f62feae 100644 --- a/dist/web/plugin/exposure/index.closure.js +++ b/dist/web/plugin/exposure/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=s,t}function n(){return("MutationObserver"in window||"WebKitMutationObserver"in window||"MozMutationObserver"in window)&&"IntersectionObserver"in window}function i(e){var t={};return o.each(e,function(r,n){switch(n){case"area_rate":r=Number(r),!isNaN(r)&&r>=0&&r<=1?t.area_rate=r:c("parameter config.area_rate error. config:",e);break;case"stay_duration":r=Number(r),!isNaN(r)&&r>=0?t.stay_duration=r:c("parameter config.stay_duration error. config:",e);break;case"repeated":"false"===r||r===!1||"true"===r||r===!0?t.repeated="false"!==r&&Boolean(r):c("parameter config.repeated error. config:",e)}}),t}var a,o,s="1.26.8",c=console&&console.log||function(){},u="data-sensors-exposure-event-name",d={},l=[],f={area_rate:0,stay_duration:0,repeated:!0},v={isReady:!1,init:function(e){if(!n())return void c("The current browser does not support the element exposure key API, and the element exposure plugin initialization failed.");var t=this;o.isObject(e)&&(f=o.extend(f,i(e))),o.bindReady(function(){var e=t.getElesByEventName();t.addObserveByNodes(e),p.init()}),a.ee.spa.on("switch",function(e){if(e===location.href)return!1;t.clear();var r=t.getElesByEventName();t.addObserveByNodes(r)}),o.listenPageState({visible:function(){t.start()},hidden:function(){t.stop()}}),this.isReady=!0},getElesByEventName:function(e){return e=e||document,e.querySelectorAll("["+u+"]")},getEleEventName:function(e){return e.getAttribute(u)},getEleAttr:function(e,t){t=t||e.attributes;var r={},n={},a=this.getEleEventName(e),s={};return a&&(s.eventName=a),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{if("data-sensors-exposure-option"===t.name){var a=o.isObject(i)?i:JSON.parse(i);n=o.isObject(a.config)?a.config:n,r=o.isObject(a.properties)?a.properties:r}}catch(s){c("element attribute data-sensors-exposure-option error. value:",i)}}),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{var a=t.name.match(/^data-sensors-exposure-property-(.+)/);a&&(r[a[1]]=i)}catch(o){}try{var s=t.name.match(/^data-sensors-exposure-config-(.+)/);if(s)switch(s[1]){case"area_rate":n.area_rate=i;break;case"stay_duration":n.stay_duration=i;break;case"repeated":n.repeated=i}}catch(o){}}),s.config=i(n),s.properties=r,s},addObserveByNodes:function(e){if(e.length){var t=this;o.each(e,function(e){if(1===e.nodeType&&e.hasAttribute(u)){var r=t.getEleAttr(e);r.ele=e,t.addOrUpdateWatchEle(r)}})}},getIntersection:function(e){var t=null,r=this;return t=d[e.area_rate]?d[e.area_rate]:d[e.area_rate]=new IntersectionObserver(function(){r.exposure.apply(r,arguments)},{threshold:e.area_rate})},exposure:function(e){var t=this;o.each(e,function(e){var r=e.target,n=t.getEleOption(r);return e.isIntersecting===!1||!n||n.config.isSend?void(n&&n.timer&&(clearTimeout(n.timer),n.timer=null)):void(e.intersectionRatio>=n.config.area_rate&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){var e=r.getBoundingClientRect(),n=t.getEleOption(r);if(e.width&&e.height&&n&&n.eventName&&!n.config.isSend){var i=n.listener,s=i&&i.shouldExpose,c=i&&i.didExpose,u=a.heatmap.getEleDetail(r),d=o.extend({},u,n.properties);if(s&&o.isFunction(s))try{if(s(r,d)===!1)return}catch(l){}if(a.track(n.eventName,d),n.config.isSend=!0,n.config.repeated&&(n.config.isSend=!1),c&&o.isFunction(c))try{c(r,d)}catch(l){}}},1e3*n.config.stay_duration)))})},getEleOption:function(e){var t=null;return o.each(l,function(r){e===r.ele&&(t=r)}),t},addOrUpdateWatchEle:function(e){var t=e.ele,r=e.config;r.isSend=!1;var n=v.getEleOption(t);if(n){if(r.area_rate===n.config.area_rate)return o.extend2Lev(n,e),void(n.config.repeated&&(n.config.isSend=!1));this.removeWatchEle(t)}if(e=o.extend2Lev({},{config:o.extend({},f)},n,e),!e.eventName)return c("parameter option.eventName error. option:",e),!1;o.isElement(t)||c("parameter element error. option:",e);var i=this.getIntersection(e.config);i.observe(t),l.push(e)},removeWatchEle:function(e){var t=null,r=-1;if(o.each(l,function(n,i){e===n.ele&&(t=n,r=i)}),t){var n=t.config,i=d[n.area_rate];i&&o.isElement(e)&&(i.unobserve(e),t.timer&&(clearTimeout(t.timer),t.timer=null),r>-1&&l.splice(r,1))}},start:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&n.observe(r)})},stop:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&(n.unobserve(r),e.timer&&(clearTimeout(e.timer),e.timer=null))})},clear:function(){this.stop(),d={},l=[]}},p={mo:null,init:function(){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;this.mo=new e(this.listenNodesChange),this.observe()},observe:function(){this.mo.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})},listenNodesChange:function(e){o.each(e,function(e){switch(e.type){case"childList":e.removedNodes.length>0?o.each(e.removedNodes,function(e){if(1===e.nodeType){v.removeWatchEle(e);var t=v.getElesByEventName(e);t.length&&o.each(t,function(e){v.removeWatchEle(e)})}}):e.addedNodes.length&&(v.addObserveByNodes(e.addedNodes),o.each(e.addedNodes,function(e){if(1===e.nodeType){var t=v.getElesByEventName(e);v.addObserveByNodes(t)}}));break;case"attributes":if(!e.attributeName)return!1;var t=e.target,r=e.attributeName;if(!o.isString(r)||r.indexOf("data-sensors-exposure")<0)return;if(t.getAttribute(r)){var n=v.getEleAttr(t);n.ele=t,v.addOrUpdateWatchEle(n)}else r===u&&v.removeWatchEle(t)}})}},g={exposureViews:l,init:function(e,t){return!(!e||a)&&(a=e,o=a._,c=a.log,v.init(t),void c("Exposure Plugin initialized successfully"))},addExposureView:function(e,t){if(!v.isReady)return void c("Exposure Plugin uninitialized.");if(!o.isElement(e))return void c("parameter element error.");var r={ele:e,config:o.isObject(t.config)?i(t.config):{},eventName:t.eventName,properties:o.isObject(t.properties)?t.properties:{},listener:o.isObject(t.listener)?t.listener:{}};return o.isString(r.eventName)&&r.eventName?void v.addOrUpdateWatchEle(r):void c("parameter option.eventName error. option",t)},removeExposureView:function(e){return v.isReady?o.isElement(e)?void v.removeWatchEle(e):void c("removeExposureView parameter ele errors."):void c("Exposure Plugin uninitialized.")}},m=r(g,"Exposure","sdkAfterInitPara");return m}(); \ No newline at end of file +!function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=s,t}function n(){return("MutationObserver"in window||"WebKitMutationObserver"in window||"MozMutationObserver"in window)&&"IntersectionObserver"in window}function i(e){var t={};return o.each(e,function(r,n){switch(n){case"area_rate":r=Number(r),!isNaN(r)&&r>=0&&r<=1?t.area_rate=r:c("parameter config.area_rate error. config:",e);break;case"stay_duration":r=Number(r),!isNaN(r)&&r>=0?t.stay_duration=r:c("parameter config.stay_duration error. config:",e);break;case"repeated":"false"===r||r===!1||"true"===r||r===!0?t.repeated="false"!==r&&Boolean(r):c("parameter config.repeated error. config:",e)}}),t}var a,o,s="1.26.9",c=console&&console.log||function(){},u="data-sensors-exposure-event-name",d={},l=[],f={area_rate:0,stay_duration:0,repeated:!0},v={isReady:!1,init:function(e){if(!n())return void c("The current browser does not support the element exposure key API, and the element exposure plugin initialization failed.");var t=this;o.isObject(e)&&(f=o.extend(f,i(e))),o.bindReady(function(){var e=t.getElesByEventName();t.addObserveByNodes(e),p.init()}),a.ee.spa.on("switch",function(e){if(e===location.href)return!1;t.clear();var r=t.getElesByEventName();t.addObserveByNodes(r)}),o.listenPageState({visible:function(){t.start()},hidden:function(){t.stop()}}),this.isReady=!0},getElesByEventName:function(e){return e=e||document,e.querySelectorAll("["+u+"]")},getEleEventName:function(e){return e.getAttribute(u)},getEleAttr:function(e,t){t=t||e.attributes;var r={},n={},a=this.getEleEventName(e),s={};return a&&(s.eventName=a),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{if("data-sensors-exposure-option"===t.name){var a=o.isObject(i)?i:JSON.parse(i);n=o.isObject(a.config)?a.config:n,r=o.isObject(a.properties)?a.properties:r}}catch(s){c("element attribute data-sensors-exposure-option error. value:",i)}}),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{var a=t.name.match(/^data-sensors-exposure-property-(.+)/);a&&(r[a[1]]=i)}catch(o){}try{var s=t.name.match(/^data-sensors-exposure-config-(.+)/);if(s)switch(s[1]){case"area_rate":n.area_rate=i;break;case"stay_duration":n.stay_duration=i;break;case"repeated":n.repeated=i}}catch(o){}}),s.config=i(n),s.properties=r,s},addObserveByNodes:function(e){if(e.length){var t=this;o.each(e,function(e){if(1===e.nodeType&&e.hasAttribute(u)){var r=t.getEleAttr(e);r.ele=e,t.addOrUpdateWatchEle(r)}})}},getIntersection:function(e){var t=null,r=this;return t=d[e.area_rate]?d[e.area_rate]:d[e.area_rate]=new IntersectionObserver(function(){r.exposure.apply(r,arguments)},{threshold:e.area_rate})},exposure:function(e){var t=this;o.each(e,function(e){var r=e.target,n=t.getEleOption(r);return e.isIntersecting===!1||!n||n.config.isSend?void(n&&n.timer&&(clearTimeout(n.timer),n.timer=null)):void(e.intersectionRatio>=n.config.area_rate&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){var e=r.getBoundingClientRect(),n=t.getEleOption(r);if(e.width&&e.height&&n&&n.eventName&&!n.config.isSend){var i=n.listener,s=i&&i.shouldExpose,c=i&&i.didExpose,u=a.heatmap.getEleDetail(r),d=o.extend({},u,n.properties);if(s&&o.isFunction(s))try{if(s(r,d)===!1)return}catch(l){}if(a.track(n.eventName,d),n.config.isSend=!0,n.config.repeated&&(n.config.isSend=!1),c&&o.isFunction(c))try{c(r,d)}catch(l){}}},1e3*n.config.stay_duration)))})},getEleOption:function(e){var t=null;return o.each(l,function(r){e===r.ele&&(t=r)}),t},addOrUpdateWatchEle:function(e){var t=e.ele,r=e.config;r.isSend=!1;var n=v.getEleOption(t);if(n){if(r.area_rate===n.config.area_rate)return o.extend2Lev(n,e),void(n.config.repeated&&(n.config.isSend=!1));this.removeWatchEle(t)}if(e=o.extend2Lev({},{config:o.extend({},f)},n,e),!e.eventName)return c("parameter option.eventName error. option:",e),!1;o.isElement(t)||c("parameter element error. option:",e);var i=this.getIntersection(e.config);i.observe(t),l.push(e)},removeWatchEle:function(e){var t=null,r=-1;if(o.each(l,function(n,i){e===n.ele&&(t=n,r=i)}),t){var n=t.config,i=d[n.area_rate];i&&o.isElement(e)&&(i.unobserve(e),t.timer&&(clearTimeout(t.timer),t.timer=null),r>-1&&l.splice(r,1))}},start:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&n.observe(r)})},stop:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&(n.unobserve(r),e.timer&&(clearTimeout(e.timer),e.timer=null))})},clear:function(){this.stop(),d={},l=[]}},p={mo:null,init:function(){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;this.mo=new e(this.listenNodesChange),this.observe()},observe:function(){this.mo.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})},listenNodesChange:function(e){o.each(e,function(e){switch(e.type){case"childList":e.removedNodes.length>0?o.each(e.removedNodes,function(e){if(1===e.nodeType){v.removeWatchEle(e);var t=v.getElesByEventName(e);t.length&&o.each(t,function(e){v.removeWatchEle(e)})}}):e.addedNodes.length&&(v.addObserveByNodes(e.addedNodes),o.each(e.addedNodes,function(e){if(1===e.nodeType){var t=v.getElesByEventName(e);v.addObserveByNodes(t)}}));break;case"attributes":if(!e.attributeName)return!1;var t=e.target,r=e.attributeName;if(!o.isString(r)||r.indexOf("data-sensors-exposure")<0)return;if(t.getAttribute(r)){var n=v.getEleAttr(t);n.ele=t,v.addOrUpdateWatchEle(n)}else r===u&&v.removeWatchEle(t)}})}},g={exposureViews:l,init:function(e,t){return!(!e||a)&&(a=e,o=a._,c=a.log,v.init(t),void c("Exposure Plugin initialized successfully"))},addExposureView:function(e,t){if(!v.isReady)return void c("Exposure Plugin uninitialized.");if(!o.isElement(e))return void c("parameter element error.");var r={ele:e,config:o.isObject(t.config)?i(t.config):{},eventName:t.eventName,properties:o.isObject(t.properties)?t.properties:{},listener:o.isObject(t.listener)?t.listener:{}};return o.isString(r.eventName)&&r.eventName?void v.addOrUpdateWatchEle(r):void c("parameter option.eventName error. option",t)},removeExposureView:function(e){return v.isReady?o.isElement(e)?void v.removeWatchEle(e):void c("removeExposureView parameter ele errors."):void c("Exposure Plugin uninitialized.")}},m=r(g,"Exposure","sdkAfterInitPara");return m}(); \ No newline at end of file diff --git a/dist/web/plugin/exposure/index.es6.js b/dist/web/plugin/exposure/index.es6.js index 16fff50b..5b902110 100644 --- a/dist/web/plugin/exposure/index.es6.js +++ b/dist/web/plugin/exposure/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,o){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return a();function a(){n.call(e,i,o)}i.on(r,a)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder,e}var log=console&&console.log||function(){},EXPOSURE_ATTR_EVENT_NAME="data-sensors-exposure-event-name",exposureIntersection={},exposureEleOption=[],exposureConfig={area_rate:0,stay_duration:0,repeated:!0};function isSupport(){return("MutationObserver"in window||"WebKitMutationObserver"in window||"MozMutationObserver"in window)&&"IntersectionObserver"in window}function formatConfig(e){var t={};return _.each(e,function(r,n){switch(n){case"area_rate":r=Number(r),!isNaN(r)&&r>=0&&r<=1?t.area_rate=r:log("parameter config.area_rate error. config:",e);break;case"stay_duration":r=Number(r),!isNaN(r)&&r>=0?t.stay_duration=r:log("parameter config.stay_duration error. config:",e);break;case"repeated":"false"===r||!1===r||"true"===r||!0===r?t.repeated="false"!==r&&Boolean(r):log("parameter config.repeated error. config:",e)}}),t}var exposurePlugin={isReady:!1,init:function(e){if(isSupport()){var t=this;_.isObject(e)&&(exposureConfig=_.extend(exposureConfig,formatConfig(e))),_.bindReady(function(){var e=t.getElesByEventName();t.addObserveByNodes(e),mutation.init()}),sd.ee.spa.on("switch",function(e){if(e===location.href)return!1;t.clear();var r=t.getElesByEventName();t.addObserveByNodes(r)}),_.listenPageState({visible:function(){t.start()},hidden:function(){t.stop()}}),this.isReady=!0}else log("The current browser does not support the element exposure key API, and the element exposure plugin initialization failed.")},getElesByEventName:function(e){return(e=e||document).querySelectorAll("["+EXPOSURE_ATTR_EVENT_NAME+"]")},getEleEventName:function(e){return e.getAttribute(EXPOSURE_ATTR_EVENT_NAME)},getEleAttr:function(e,t){t=t||e.attributes;var r={},n={},i=this.getEleEventName(e),o={};return i&&(o.eventName=i),_.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{if("data-sensors-exposure-option"===t.name){var o=_.isObject(i)?i:JSON.parse(i);n=_.isObject(o.config)?o.config:n,r=_.isObject(o.properties)?o.properties:r}}catch(a){log("element attribute data-sensors-exposure-option error. value:",i)}}),_.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{var o=t.name.match(/^data-sensors-exposure-property-(.+)/);o&&(r[o[1]]=i)}catch(s){}try{var a=t.name.match(/^data-sensors-exposure-config-(.+)/);if(a)switch(a[1]){case"area_rate":n.area_rate=i;break;case"stay_duration":n.stay_duration=i;break;case"repeated":n.repeated=i}}catch(s){}}),o.config=formatConfig(n),o.properties=r,o},addObserveByNodes:function(e){if(e.length){var t=this;_.each(e,function(e){if(1===e.nodeType&&e.hasAttribute(EXPOSURE_ATTR_EVENT_NAME)){var r=t.getEleAttr(e);r.ele=e,t.addOrUpdateWatchEle(r)}})}},getIntersection:function(e){var t=this;return exposureIntersection[e.area_rate]?exposureIntersection[e.area_rate]:exposureIntersection[e.area_rate]=new IntersectionObserver(function(){t.exposure.apply(t,arguments)},{threshold:e.area_rate})},exposure:function(e){var t=this;_.each(e,function(e){var r=e.target,n=t.getEleOption(r);!1!==e.isIntersecting&&n&&!n.config.isSend?e.intersectionRatio>=n.config.area_rate&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){var e=r.getBoundingClientRect(),n=t.getEleOption(r);if(e.width&&e.height&&n&&n.eventName&&!n.config.isSend){var i=n.listener,o=i&&i.shouldExpose,a=i&&i.didExpose,s=sd.heatmap.getEleDetail(r),u=_.extend({},s,n.properties);if(o&&_.isFunction(o))try{if(!1===o(r,u))return}catch(l){}if(sd.track(n.eventName,u),n.config.isSend=!0,n.config.repeated&&(n.config.isSend=!1),a&&_.isFunction(a))try{a(r,u)}catch(l){}}},1e3*n.config.stay_duration)):n&&n.timer&&(clearTimeout(n.timer),n.timer=null)})},getEleOption:function(e){var t=null;return _.each(exposureEleOption,function(r){e===r.ele&&(t=r)}),t},addOrUpdateWatchEle:function(e){var t=e.ele,r=e.config;r.isSend=!1;var n=exposurePlugin.getEleOption(t);if(n){if(r.area_rate===n.config.area_rate)return _.extend2Lev(n,e),void(n.config.repeated&&(n.config.isSend=!1));this.removeWatchEle(t)}if(!(e=_.extend2Lev({},{config:_.extend({},exposureConfig)},n,e)).eventName)return log("parameter option.eventName error. option:",e),!1;_.isElement(t)||log("parameter element error. option:",e),this.getIntersection(e.config).observe(t),exposureEleOption.push(e)},removeWatchEle:function(e){var t=null,r=-1;if(_.each(exposureEleOption,function(n,i){e===n.ele&&(t=n,r=i)}),t){var n=t.config,i=exposureIntersection[n.area_rate];i&&_.isElement(e)&&(i.unobserve(e),t.timer&&(clearTimeout(t.timer),t.timer=null),r>-1&&exposureEleOption.splice(r,1))}},start:function(){_.each(exposureEleOption,function(e){var t=e.config,r=e.ele,n=exposureIntersection[t.area_rate];n&&_.isElement(r)&&n.observe(r)})},stop:function(){_.each(exposureEleOption,function(e){var t=e.config,r=e.ele,n=exposureIntersection[t.area_rate];n&&_.isElement(r)&&(n.unobserve(r),e.timer&&(clearTimeout(e.timer),e.timer=null))})},clear:function(){this.stop(),exposureIntersection={},exposureEleOption=[]}},mutation={mo:null,init:function(){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;this.mo=new e(this.listenNodesChange),this.observe()},observe:function(){this.mo.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})},listenNodesChange:function(e){_.each(e,function(e){switch(e.type){case"childList":e.removedNodes.length>0?_.each(e.removedNodes,function(e){if(1===e.nodeType){exposurePlugin.removeWatchEle(e);var t=exposurePlugin.getElesByEventName(e);t.length&&_.each(t,function(e){exposurePlugin.removeWatchEle(e)})}}):e.addedNodes.length&&(exposurePlugin.addObserveByNodes(e.addedNodes),_.each(e.addedNodes,function(e){if(1===e.nodeType){var t=exposurePlugin.getElesByEventName(e);exposurePlugin.addObserveByNodes(t)}}));break;case"attributes":if(!e.attributeName)return!1;var t=e.target,r=e.attributeName;if(!_.isString(r)||r.indexOf("data-sensors-exposure")<0)return;if(t.getAttribute(r)){var n=exposurePlugin.getEleAttr(t);n.ele=t,exposurePlugin.addOrUpdateWatchEle(n)}else r===EXPOSURE_ATTR_EVENT_NAME&&exposurePlugin.removeWatchEle(t)}})}},Exposure={exposureViews:exposureEleOption,init:function(e,t){if(!e||sd)return!1;_=(sd=e)._,log=sd.log,exposurePlugin.init(t),log("Exposure Plugin initialized successfully")},addExposureView:function(e,t){if(exposurePlugin.isReady)if(_.isElement(e)){var r={ele:e,config:_.isObject(t.config)?formatConfig(t.config):{},eventName:t.eventName,properties:_.isObject(t.properties)?t.properties:{},listener:_.isObject(t.listener)?t.listener:{}};_.isString(r.eventName)&&r.eventName?exposurePlugin.addOrUpdateWatchEle(r):log("parameter option.eventName error. option",t)}else log("parameter element error.");else log("Exposure Plugin uninitialized.")},removeExposureView:function(e){exposurePlugin.isReady?_.isElement(e)?exposurePlugin.removeWatchEle(e):log("removeExposureView parameter ele errors."):log("Exposure Plugin uninitialized.")}},index=createPlugin(Exposure,"Exposure","sdkAfterInitPara");export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,o){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return a();function a(){n.call(e,i,o)}i.on(r,a)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder,e}var log=console&&console.log||function(){},EXPOSURE_ATTR_EVENT_NAME="data-sensors-exposure-event-name",exposureIntersection={},exposureEleOption=[],exposureConfig={area_rate:0,stay_duration:0,repeated:!0};function isSupport(){return("MutationObserver"in window||"WebKitMutationObserver"in window||"MozMutationObserver"in window)&&"IntersectionObserver"in window}function formatConfig(e){var t={};return _.each(e,function(r,n){switch(n){case"area_rate":r=Number(r),!isNaN(r)&&r>=0&&r<=1?t.area_rate=r:log("parameter config.area_rate error. config:",e);break;case"stay_duration":r=Number(r),!isNaN(r)&&r>=0?t.stay_duration=r:log("parameter config.stay_duration error. config:",e);break;case"repeated":"false"===r||!1===r||"true"===r||!0===r?t.repeated="false"!==r&&Boolean(r):log("parameter config.repeated error. config:",e)}}),t}var exposurePlugin={isReady:!1,init:function(e){if(isSupport()){var t=this;_.isObject(e)&&(exposureConfig=_.extend(exposureConfig,formatConfig(e))),_.bindReady(function(){var e=t.getElesByEventName();t.addObserveByNodes(e),mutation.init()}),sd.ee.spa.on("switch",function(e){if(e===location.href)return!1;t.clear();var r=t.getElesByEventName();t.addObserveByNodes(r)}),_.listenPageState({visible:function(){t.start()},hidden:function(){t.stop()}}),this.isReady=!0}else log("The current browser does not support the element exposure key API, and the element exposure plugin initialization failed.")},getElesByEventName:function(e){return(e=e||document).querySelectorAll("["+EXPOSURE_ATTR_EVENT_NAME+"]")},getEleEventName:function(e){return e.getAttribute(EXPOSURE_ATTR_EVENT_NAME)},getEleAttr:function(e,t){t=t||e.attributes;var r={},n={},i=this.getEleEventName(e),o={};return i&&(o.eventName=i),_.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{if("data-sensors-exposure-option"===t.name){var o=_.isObject(i)?i:JSON.parse(i);n=_.isObject(o.config)?o.config:n,r=_.isObject(o.properties)?o.properties:r}}catch(a){log("element attribute data-sensors-exposure-option error. value:",i)}}),_.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{var o=t.name.match(/^data-sensors-exposure-property-(.+)/);o&&(r[o[1]]=i)}catch(s){}try{var a=t.name.match(/^data-sensors-exposure-config-(.+)/);if(a)switch(a[1]){case"area_rate":n.area_rate=i;break;case"stay_duration":n.stay_duration=i;break;case"repeated":n.repeated=i}}catch(s){}}),o.config=formatConfig(n),o.properties=r,o},addObserveByNodes:function(e){if(e.length){var t=this;_.each(e,function(e){if(1===e.nodeType&&e.hasAttribute(EXPOSURE_ATTR_EVENT_NAME)){var r=t.getEleAttr(e);r.ele=e,t.addOrUpdateWatchEle(r)}})}},getIntersection:function(e){var t=this;return exposureIntersection[e.area_rate]?exposureIntersection[e.area_rate]:exposureIntersection[e.area_rate]=new IntersectionObserver(function(){t.exposure.apply(t,arguments)},{threshold:e.area_rate})},exposure:function(e){var t=this;_.each(e,function(e){var r=e.target,n=t.getEleOption(r);!1!==e.isIntersecting&&n&&!n.config.isSend?e.intersectionRatio>=n.config.area_rate&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){var e=r.getBoundingClientRect(),n=t.getEleOption(r);if(e.width&&e.height&&n&&n.eventName&&!n.config.isSend){var i=n.listener,o=i&&i.shouldExpose,a=i&&i.didExpose,s=sd.heatmap.getEleDetail(r),u=_.extend({},s,n.properties);if(o&&_.isFunction(o))try{if(!1===o(r,u))return}catch(l){}if(sd.track(n.eventName,u),n.config.isSend=!0,n.config.repeated&&(n.config.isSend=!1),a&&_.isFunction(a))try{a(r,u)}catch(l){}}},1e3*n.config.stay_duration)):n&&n.timer&&(clearTimeout(n.timer),n.timer=null)})},getEleOption:function(e){var t=null;return _.each(exposureEleOption,function(r){e===r.ele&&(t=r)}),t},addOrUpdateWatchEle:function(e){var t=e.ele,r=e.config;r.isSend=!1;var n=exposurePlugin.getEleOption(t);if(n){if(r.area_rate===n.config.area_rate)return _.extend2Lev(n,e),void(n.config.repeated&&(n.config.isSend=!1));this.removeWatchEle(t)}if(!(e=_.extend2Lev({},{config:_.extend({},exposureConfig)},n,e)).eventName)return log("parameter option.eventName error. option:",e),!1;_.isElement(t)||log("parameter element error. option:",e),this.getIntersection(e.config).observe(t),exposureEleOption.push(e)},removeWatchEle:function(e){var t=null,r=-1;if(_.each(exposureEleOption,function(n,i){e===n.ele&&(t=n,r=i)}),t){var n=t.config,i=exposureIntersection[n.area_rate];i&&_.isElement(e)&&(i.unobserve(e),t.timer&&(clearTimeout(t.timer),t.timer=null),r>-1&&exposureEleOption.splice(r,1))}},start:function(){_.each(exposureEleOption,function(e){var t=e.config,r=e.ele,n=exposureIntersection[t.area_rate];n&&_.isElement(r)&&n.observe(r)})},stop:function(){_.each(exposureEleOption,function(e){var t=e.config,r=e.ele,n=exposureIntersection[t.area_rate];n&&_.isElement(r)&&(n.unobserve(r),e.timer&&(clearTimeout(e.timer),e.timer=null))})},clear:function(){this.stop(),exposureIntersection={},exposureEleOption=[]}},mutation={mo:null,init:function(){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;this.mo=new e(this.listenNodesChange),this.observe()},observe:function(){this.mo.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})},listenNodesChange:function(e){_.each(e,function(e){switch(e.type){case"childList":e.removedNodes.length>0?_.each(e.removedNodes,function(e){if(1===e.nodeType){exposurePlugin.removeWatchEle(e);var t=exposurePlugin.getElesByEventName(e);t.length&&_.each(t,function(e){exposurePlugin.removeWatchEle(e)})}}):e.addedNodes.length&&(exposurePlugin.addObserveByNodes(e.addedNodes),_.each(e.addedNodes,function(e){if(1===e.nodeType){var t=exposurePlugin.getElesByEventName(e);exposurePlugin.addObserveByNodes(t)}}));break;case"attributes":if(!e.attributeName)return!1;var t=e.target,r=e.attributeName;if(!_.isString(r)||r.indexOf("data-sensors-exposure")<0)return;if(t.getAttribute(r)){var n=exposurePlugin.getEleAttr(t);n.ele=t,exposurePlugin.addOrUpdateWatchEle(n)}else r===EXPOSURE_ATTR_EVENT_NAME&&exposurePlugin.removeWatchEle(t)}})}},Exposure={exposureViews:exposureEleOption,init:function(e,t){if(!e||sd)return!1;_=(sd=e)._,log=sd.log,exposurePlugin.init(t),log("Exposure Plugin initialized successfully")},addExposureView:function(e,t){if(exposurePlugin.isReady)if(_.isElement(e)){var r={ele:e,config:_.isObject(t.config)?formatConfig(t.config):{},eventName:t.eventName,properties:_.isObject(t.properties)?t.properties:{},listener:_.isObject(t.listener)?t.listener:{}};_.isString(r.eventName)&&r.eventName?exposurePlugin.addOrUpdateWatchEle(r):log("parameter option.eventName error. option",t)}else log("parameter element error.");else log("Exposure Plugin uninitialized.")},removeExposureView:function(e){exposurePlugin.isReady?_.isElement(e)?exposurePlugin.removeWatchEle(e):log("removeExposureView parameter ele errors."):log("Exposure Plugin uninitialized.")}},index=createPlugin(Exposure,"Exposure","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/exposure/index.js b/dist/web/plugin/exposure/index.js index 4364c6d8..184bdd3a 100644 --- a/dist/web/plugin/exposure/index.js +++ b/dist/web/plugin/exposure/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Exposure=function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=s,t}function n(){return("MutationObserver"in window||"WebKitMutationObserver"in window||"MozMutationObserver"in window)&&"IntersectionObserver"in window}function i(e){var t={};return o.each(e,function(r,n){switch(n){case"area_rate":r=Number(r),!isNaN(r)&&r>=0&&r<=1?t.area_rate=r:u("parameter config.area_rate error. config:",e);break;case"stay_duration":r=Number(r),!isNaN(r)&&r>=0?t.stay_duration=r:u("parameter config.stay_duration error. config:",e);break;case"repeated":"false"===r||r===!1||"true"===r||r===!0?t.repeated="false"!==r&&Boolean(r):u("parameter config.repeated error. config:",e)}}),t}var a,o,s="1.26.8",u=console&&console.log||function(){},c="data-sensors-exposure-event-name",d={},l=[],f={area_rate:0,stay_duration:0,repeated:!0},v={isReady:!1,init:function(e){if(!n())return void u("The current browser does not support the element exposure key API, and the element exposure plugin initialization failed.");var t=this;o.isObject(e)&&(f=o.extend(f,i(e))),o.bindReady(function(){var e=t.getElesByEventName();t.addObserveByNodes(e),p.init()}),a.ee.spa.on("switch",function(e){if(e===location.href)return!1;t.clear();var r=t.getElesByEventName();t.addObserveByNodes(r)}),o.listenPageState({visible:function(){t.start()},hidden:function(){t.stop()}}),this.isReady=!0},getElesByEventName:function(e){return e=e||document,e.querySelectorAll("["+c+"]")},getEleEventName:function(e){return e.getAttribute(c)},getEleAttr:function(e,t){t=t||e.attributes;var r={},n={},a=this.getEleEventName(e),s={};return a&&(s.eventName=a),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{if("data-sensors-exposure-option"===t.name){var a=o.isObject(i)?i:JSON.parse(i);n=o.isObject(a.config)?a.config:n,r=o.isObject(a.properties)?a.properties:r}}catch(s){u("element attribute data-sensors-exposure-option error. value:",i)}}),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{var a=t.name.match(/^data-sensors-exposure-property-(.+)/);a&&(r[a[1]]=i)}catch(o){}try{var s=t.name.match(/^data-sensors-exposure-config-(.+)/);if(s)switch(s[1]){case"area_rate":n.area_rate=i;break;case"stay_duration":n.stay_duration=i;break;case"repeated":n.repeated=i}}catch(o){}}),s.config=i(n),s.properties=r,s},addObserveByNodes:function(e){if(e.length){var t=this;o.each(e,function(e){if(1===e.nodeType&&e.hasAttribute(c)){var r=t.getEleAttr(e);r.ele=e,t.addOrUpdateWatchEle(r)}})}},getIntersection:function(e){var t=null,r=this;return t=d[e.area_rate]?d[e.area_rate]:d[e.area_rate]=new IntersectionObserver(function(){r.exposure.apply(r,arguments)},{threshold:e.area_rate})},exposure:function(e){var t=this;o.each(e,function(e){var r=e.target,n=t.getEleOption(r);return e.isIntersecting===!1||!n||n.config.isSend?void(n&&n.timer&&(clearTimeout(n.timer),n.timer=null)):void(e.intersectionRatio>=n.config.area_rate&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){var e=r.getBoundingClientRect(),n=t.getEleOption(r);if(e.width&&e.height&&n&&n.eventName&&!n.config.isSend){var i=n.listener,s=i&&i.shouldExpose,u=i&&i.didExpose,c=a.heatmap.getEleDetail(r),d=o.extend({},c,n.properties);if(s&&o.isFunction(s))try{if(s(r,d)===!1)return}catch(l){}if(a.track(n.eventName,d),n.config.isSend=!0,n.config.repeated&&(n.config.isSend=!1),u&&o.isFunction(u))try{u(r,d)}catch(l){}}},1e3*n.config.stay_duration)))})},getEleOption:function(e){var t=null;return o.each(l,function(r){e===r.ele&&(t=r)}),t},addOrUpdateWatchEle:function(e){var t=e.ele,r=e.config;r.isSend=!1;var n=v.getEleOption(t);if(n){if(r.area_rate===n.config.area_rate)return o.extend2Lev(n,e),void(n.config.repeated&&(n.config.isSend=!1));this.removeWatchEle(t)}if(e=o.extend2Lev({},{config:o.extend({},f)},n,e),!e.eventName)return u("parameter option.eventName error. option:",e),!1;o.isElement(t)||u("parameter element error. option:",e);var i=this.getIntersection(e.config);i.observe(t),l.push(e)},removeWatchEle:function(e){var t=null,r=-1;if(o.each(l,function(n,i){e===n.ele&&(t=n,r=i)}),t){var n=t.config,i=d[n.area_rate];i&&o.isElement(e)&&(i.unobserve(e),t.timer&&(clearTimeout(t.timer),t.timer=null),r>-1&&l.splice(r,1))}},start:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&n.observe(r)})},stop:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&(n.unobserve(r),e.timer&&(clearTimeout(e.timer),e.timer=null))})},clear:function(){this.stop(),d={},l=[]}},p={mo:null,init:function(){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;this.mo=new e(this.listenNodesChange),this.observe()},observe:function(){this.mo.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})},listenNodesChange:function(e){o.each(e,function(e){switch(e.type){case"childList":e.removedNodes.length>0?o.each(e.removedNodes,function(e){if(1===e.nodeType){v.removeWatchEle(e);var t=v.getElesByEventName(e);t.length&&o.each(t,function(e){v.removeWatchEle(e)})}}):e.addedNodes.length&&(v.addObserveByNodes(e.addedNodes),o.each(e.addedNodes,function(e){if(1===e.nodeType){var t=v.getElesByEventName(e);v.addObserveByNodes(t)}}));break;case"attributes":if(!e.attributeName)return!1;var t=e.target,r=e.attributeName;if(!o.isString(r)||r.indexOf("data-sensors-exposure")<0)return;if(t.getAttribute(r)){var n=v.getEleAttr(t);n.ele=t,v.addOrUpdateWatchEle(n)}else r===c&&v.removeWatchEle(t)}})}},g={exposureViews:l,init:function(e,t){return!(!e||a)&&(a=e,o=a._,u=a.log,v.init(t),void u("Exposure Plugin initialized successfully"))},addExposureView:function(e,t){if(!v.isReady)return void u("Exposure Plugin uninitialized.");if(!o.isElement(e))return void u("parameter element error.");var r={ele:e,config:o.isObject(t.config)?i(t.config):{},eventName:t.eventName,properties:o.isObject(t.properties)?t.properties:{},listener:o.isObject(t.listener)?t.listener:{}};return o.isString(r.eventName)&&r.eventName?void v.addOrUpdateWatchEle(r):void u("parameter option.eventName error. option",t)},removeExposureView:function(e){return v.isReady?o.isElement(e)?void v.removeWatchEle(e):void u("removeExposureView parameter ele errors."):void u("Exposure Plugin uninitialized.")}},m=r(g,"Exposure","sdkAfterInitPara");return m}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Exposure=function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=s,t}function n(){return("MutationObserver"in window||"WebKitMutationObserver"in window||"MozMutationObserver"in window)&&"IntersectionObserver"in window}function i(e){var t={};return o.each(e,function(r,n){switch(n){case"area_rate":r=Number(r),!isNaN(r)&&r>=0&&r<=1?t.area_rate=r:u("parameter config.area_rate error. config:",e);break;case"stay_duration":r=Number(r),!isNaN(r)&&r>=0?t.stay_duration=r:u("parameter config.stay_duration error. config:",e);break;case"repeated":"false"===r||r===!1||"true"===r||r===!0?t.repeated="false"!==r&&Boolean(r):u("parameter config.repeated error. config:",e)}}),t}var a,o,s="1.26.9",u=console&&console.log||function(){},c="data-sensors-exposure-event-name",d={},l=[],f={area_rate:0,stay_duration:0,repeated:!0},v={isReady:!1,init:function(e){if(!n())return void u("The current browser does not support the element exposure key API, and the element exposure plugin initialization failed.");var t=this;o.isObject(e)&&(f=o.extend(f,i(e))),o.bindReady(function(){var e=t.getElesByEventName();t.addObserveByNodes(e),p.init()}),a.ee.spa.on("switch",function(e){if(e===location.href)return!1;t.clear();var r=t.getElesByEventName();t.addObserveByNodes(r)}),o.listenPageState({visible:function(){t.start()},hidden:function(){t.stop()}}),this.isReady=!0},getElesByEventName:function(e){return e=e||document,e.querySelectorAll("["+c+"]")},getEleEventName:function(e){return e.getAttribute(c)},getEleAttr:function(e,t){t=t||e.attributes;var r={},n={},a=this.getEleEventName(e),s={};return a&&(s.eventName=a),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{if("data-sensors-exposure-option"===t.name){var a=o.isObject(i)?i:JSON.parse(i);n=o.isObject(a.config)?a.config:n,r=o.isObject(a.properties)?a.properties:r}}catch(s){u("element attribute data-sensors-exposure-option error. value:",i)}}),o.each(t,function(t){var i=t.value||e.getAttribute(t.name);try{var a=t.name.match(/^data-sensors-exposure-property-(.+)/);a&&(r[a[1]]=i)}catch(o){}try{var s=t.name.match(/^data-sensors-exposure-config-(.+)/);if(s)switch(s[1]){case"area_rate":n.area_rate=i;break;case"stay_duration":n.stay_duration=i;break;case"repeated":n.repeated=i}}catch(o){}}),s.config=i(n),s.properties=r,s},addObserveByNodes:function(e){if(e.length){var t=this;o.each(e,function(e){if(1===e.nodeType&&e.hasAttribute(c)){var r=t.getEleAttr(e);r.ele=e,t.addOrUpdateWatchEle(r)}})}},getIntersection:function(e){var t=null,r=this;return t=d[e.area_rate]?d[e.area_rate]:d[e.area_rate]=new IntersectionObserver(function(){r.exposure.apply(r,arguments)},{threshold:e.area_rate})},exposure:function(e){var t=this;o.each(e,function(e){var r=e.target,n=t.getEleOption(r);return e.isIntersecting===!1||!n||n.config.isSend?void(n&&n.timer&&(clearTimeout(n.timer),n.timer=null)):void(e.intersectionRatio>=n.config.area_rate&&(n.timer&&(clearTimeout(n.timer),n.timer=null),n.timer=setTimeout(function(){var e=r.getBoundingClientRect(),n=t.getEleOption(r);if(e.width&&e.height&&n&&n.eventName&&!n.config.isSend){var i=n.listener,s=i&&i.shouldExpose,u=i&&i.didExpose,c=a.heatmap.getEleDetail(r),d=o.extend({},c,n.properties);if(s&&o.isFunction(s))try{if(s(r,d)===!1)return}catch(l){}if(a.track(n.eventName,d),n.config.isSend=!0,n.config.repeated&&(n.config.isSend=!1),u&&o.isFunction(u))try{u(r,d)}catch(l){}}},1e3*n.config.stay_duration)))})},getEleOption:function(e){var t=null;return o.each(l,function(r){e===r.ele&&(t=r)}),t},addOrUpdateWatchEle:function(e){var t=e.ele,r=e.config;r.isSend=!1;var n=v.getEleOption(t);if(n){if(r.area_rate===n.config.area_rate)return o.extend2Lev(n,e),void(n.config.repeated&&(n.config.isSend=!1));this.removeWatchEle(t)}if(e=o.extend2Lev({},{config:o.extend({},f)},n,e),!e.eventName)return u("parameter option.eventName error. option:",e),!1;o.isElement(t)||u("parameter element error. option:",e);var i=this.getIntersection(e.config);i.observe(t),l.push(e)},removeWatchEle:function(e){var t=null,r=-1;if(o.each(l,function(n,i){e===n.ele&&(t=n,r=i)}),t){var n=t.config,i=d[n.area_rate];i&&o.isElement(e)&&(i.unobserve(e),t.timer&&(clearTimeout(t.timer),t.timer=null),r>-1&&l.splice(r,1))}},start:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&n.observe(r)})},stop:function(){o.each(l,function(e){var t=e.config,r=e.ele,n=d[t.area_rate];n&&o.isElement(r)&&(n.unobserve(r),e.timer&&(clearTimeout(e.timer),e.timer=null))})},clear:function(){this.stop(),d={},l=[]}},p={mo:null,init:function(){var e=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;this.mo=new e(this.listenNodesChange),this.observe()},observe:function(){this.mo.observe(document.body,{attributes:!0,childList:!0,subtree:!0,attributeOldValue:!0})},listenNodesChange:function(e){o.each(e,function(e){switch(e.type){case"childList":e.removedNodes.length>0?o.each(e.removedNodes,function(e){if(1===e.nodeType){v.removeWatchEle(e);var t=v.getElesByEventName(e);t.length&&o.each(t,function(e){v.removeWatchEle(e)})}}):e.addedNodes.length&&(v.addObserveByNodes(e.addedNodes),o.each(e.addedNodes,function(e){if(1===e.nodeType){var t=v.getElesByEventName(e);v.addObserveByNodes(t)}}));break;case"attributes":if(!e.attributeName)return!1;var t=e.target,r=e.attributeName;if(!o.isString(r)||r.indexOf("data-sensors-exposure")<0)return;if(t.getAttribute(r)){var n=v.getEleAttr(t);n.ele=t,v.addOrUpdateWatchEle(n)}else r===c&&v.removeWatchEle(t)}})}},g={exposureViews:l,init:function(e,t){return!(!e||a)&&(a=e,o=a._,u=a.log,v.init(t),void u("Exposure Plugin initialized successfully"))},addExposureView:function(e,t){if(!v.isReady)return void u("Exposure Plugin uninitialized.");if(!o.isElement(e))return void u("parameter element error.");var r={ele:e,config:o.isObject(t.config)?i(t.config):{},eventName:t.eventName,properties:o.isObject(t.properties)?t.properties:{},listener:o.isObject(t.listener)?t.listener:{}};return o.isString(r.eventName)&&r.eventName?void v.addOrUpdateWatchEle(r):void u("parameter option.eventName error. option",t)},removeExposureView:function(e){return v.isReady?o.isElement(e)?void v.removeWatchEle(e):void u("removeExposureView parameter ele errors."):void u("Exposure Plugin uninitialized.")}},m=r(g,"Exposure","sdkAfterInitPara");return m}(); \ No newline at end of file diff --git a/dist/web/plugin/general-encryption/index.closure.js b/dist/web/plugin/general-encryption/index.closure.js index 2ece7dc9..c2ebc5a7 100644 --- a/dist/web/plugin/general-encryption/index.closure.js +++ b/dist/web/plugin/general-encryption/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,t,e){if(t&&(n.plugin_name=t),e&&n.init){var r=n.init;n.init=function(o,c){function a(){r.call(n,o,c)}return i(o,n,t),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(e,a)}}return n}function i(n,i,t){function e(i,e){n.logger?n.logger.msg.apply(n.logger,e).module(t+""||"").level(i).log():n.log&&n.log.apply(n,e)}i.log=function(){e("log",arguments)},i.warn=function(){e("warn",arguments)},i.error=function(){e("error",arguments)}}function t(i,t,e){return n(i,t,e),i.plugin_version=o,i}var e,r,o="1.26.8",c={init:function(n,i){e=n,r=e._;var t=i&&i.encrypt_utils,o=window.console&&window.console.log||function(){};o=e&&e.log||o;var c=e.kit.encodeTrackData;return e&&e.kit&&c?r.isObject(t)&&r.isFunction(t.encryptEvent)&&r.isFunction(t.encryptSymmetricKeyWithPublicKey)&&r.isString(i.pub_key)&&r.isNumber(i.pkv)?(e.kit.encodeTrackData=function(n){try{var a=t.encryptEvent,l=t.encryptSymmetricKeyWithPublicKey,u=i.pkv,y=i.pub_key;if(r.isFunction(t.encryptEvent)){var p=a(n),d=e._.base64Encode(p),s={pkv:u,ekey:l(y),payloads:[d]},g=JSON.stringify(s),f=encodeURIComponent(g);return"data="+f}return c.call(e.kit,n)}catch(v){return o("Encrypted data exception."),c.call(e.kit,n)}},void o("GeneralEncryption Plugin initialized successfully.")):void o("GeneralEncryption Plugin initialization failed. parameter error."):void o("Web SDK initialization failed.")}},a=t(c,"GeneralEncryption","sdkReady");return a}(); \ No newline at end of file +!function(){"use strict";function n(n,t,e){if(t&&(n.plugin_name=t),e&&n.init){var r=n.init;n.init=function(o,c){function a(){r.call(n,o,c)}return i(o,n,t),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(e,a)}}return n}function i(n,i,t){function e(i,e){n.logger?n.logger.msg.apply(n.logger,e).module(t+""||"").level(i).log():n.log&&n.log.apply(n,e)}i.log=function(){e("log",arguments)},i.warn=function(){e("warn",arguments)},i.error=function(){e("error",arguments)}}function t(i,t,e){return n(i,t,e),i.plugin_version=o,i}var e,r,o="1.26.9",c={init:function(n,i){e=n,r=e._;var t=i&&i.encrypt_utils,o=window.console&&window.console.log||function(){};o=e&&e.log||o;var c=e.kit.encodeTrackData;return e&&e.kit&&c?r.isObject(t)&&r.isFunction(t.encryptEvent)&&r.isFunction(t.encryptSymmetricKeyWithPublicKey)&&r.isString(i.pub_key)&&r.isNumber(i.pkv)?(e.kit.encodeTrackData=function(n){try{var a=t.encryptEvent,l=t.encryptSymmetricKeyWithPublicKey,u=i.pkv,y=i.pub_key;if(r.isFunction(t.encryptEvent)){var p=a(n),d=e._.base64Encode(p),s={pkv:u,ekey:l(y),payloads:[d]},g=JSON.stringify(s),f=encodeURIComponent(g);return"data="+f}return c.call(e.kit,n)}catch(v){return o("Encrypted data exception."),c.call(e.kit,n)}},void o("GeneralEncryption Plugin initialized successfully.")):void o("GeneralEncryption Plugin initialization failed. parameter error."):void o("Web SDK initialization failed.")}},a=t(c,"GeneralEncryption","sdkReady");return a}(); \ No newline at end of file diff --git a/dist/web/plugin/general-encryption/index.es6.js b/dist/web/plugin/general-encryption/index.es6.js index cc06601b..eef3fd29 100644 --- a/dist/web/plugin/general-encryption/index.es6.js +++ b/dist/web/plugin/general-encryption/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(n,e,i){if(e&&(n.plugin_name=e),i&&n.init){var t=n.init;n.init=function(r,o){if(wrapLogFn(r,n,e),r.readyState&&r.readyState.state>=3||!r.on)return a();function a(){t.call(n,r,o)}r.on(i,a)}}return n}function wrapLogFn(n,e,i){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(i+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,i){return wrapPluginInitFn(n,e,i),n.plugin_version=sdkversion_placeholder,n}var GeneralEncryption={init:function(n,e){_=(sd=n)._;var i=e&&e.encrypt_utils,t=window.console&&window.console.log||function(){};t=sd&&sd.log||t;var r=sd.kit.encodeTrackData;sd&&sd.kit&&r?_.isObject(i)&&_.isFunction(i.encryptEvent)&&_.isFunction(i.encryptSymmetricKeyWithPublicKey)&&_.isString(e.pub_key)&&_.isNumber(e.pkv)?(sd.kit.encodeTrackData=function(n){try{var o=i.encryptEvent,a=i.encryptSymmetricKeyWithPublicKey,c=e.pkv,l=e.pub_key;if(_.isFunction(i.encryptEvent)){var u=o(n),d=sd._.base64Encode(u),p={pkv:c,ekey:a(l),payloads:[d]},s=JSON.stringify(p);return"data="+encodeURIComponent(s)}return r.call(sd.kit,n)}catch(y){return t("Encrypted data exception."),r.call(sd.kit,n)}},t("GeneralEncryption Plugin initialized successfully.")):t("GeneralEncryption Plugin initialization failed. parameter error."):t("Web SDK initialization failed.")}},index=createPlugin(GeneralEncryption,"GeneralEncryption","sdkReady");export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(n,e,i){if(e&&(n.plugin_name=e),i&&n.init){var t=n.init;n.init=function(r,o){if(wrapLogFn(r,n,e),r.readyState&&r.readyState.state>=3||!r.on)return a();function a(){t.call(n,r,o)}r.on(i,a)}}return n}function wrapLogFn(n,e,i){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(i+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,i){return wrapPluginInitFn(n,e,i),n.plugin_version=sdkversion_placeholder,n}var GeneralEncryption={init:function(n,e){_=(sd=n)._;var i=e&&e.encrypt_utils,t=window.console&&window.console.log||function(){};t=sd&&sd.log||t;var r=sd.kit.encodeTrackData;sd&&sd.kit&&r?_.isObject(i)&&_.isFunction(i.encryptEvent)&&_.isFunction(i.encryptSymmetricKeyWithPublicKey)&&_.isString(e.pub_key)&&_.isNumber(e.pkv)?(sd.kit.encodeTrackData=function(n){try{var o=i.encryptEvent,a=i.encryptSymmetricKeyWithPublicKey,c=e.pkv,l=e.pub_key;if(_.isFunction(i.encryptEvent)){var u=o(n),d=sd._.base64Encode(u),p={pkv:c,ekey:a(l),payloads:[d]},s=JSON.stringify(p);return"data="+encodeURIComponent(s)}return r.call(sd.kit,n)}catch(y){return t("Encrypted data exception."),r.call(sd.kit,n)}},t("GeneralEncryption Plugin initialized successfully.")):t("GeneralEncryption Plugin initialization failed. parameter error."):t("Web SDK initialization failed.")}},index=createPlugin(GeneralEncryption,"GeneralEncryption","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/general-encryption/index.js b/dist/web/plugin/general-encryption/index.js index d013c7bb..2eb42d5d 100644 --- a/dist/web/plugin/general-encryption/index.js +++ b/dist/web/plugin/general-encryption/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).GeneralEncryption=function(){"use strict";function n(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var r=n.init;n.init=function(o,a){function c(){r.call(n,o,a)}return i(o,n,e),o.readyState&&o.readyState.state>=3||!o.on?c():void o.on(t,c)}}return n}function i(n,i,e){function t(i,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(i).log():n.log&&n.log.apply(n,t)}i.log=function(){t("log",arguments)},i.warn=function(){t("warn",arguments)},i.error=function(){t("error",arguments)}}function e(i,e,t){return n(i,e,t),i.plugin_version=o,i}var t,r,o="1.26.8",a={init:function(n,i){t=n,r=t._;var e=i&&i.encrypt_utils,o=window.console&&window.console.log||function(){};o=t&&t.log||o;var a=t.kit.encodeTrackData;return t&&t.kit&&a?r.isObject(e)&&r.isFunction(e.encryptEvent)&&r.isFunction(e.encryptSymmetricKeyWithPublicKey)&&r.isString(i.pub_key)&&r.isNumber(i.pkv)?(t.kit.encodeTrackData=function(n){try{var c=e.encryptEvent,l=e.encryptSymmetricKeyWithPublicKey,u=i.pkv,y=i.pub_key;if(r.isFunction(e.encryptEvent)){var p=c(n),s=t._.base64Encode(p),d={pkv:u,ekey:l(y),payloads:[s]},g=JSON.stringify(d),f=encodeURIComponent(g);return"data="+f}return a.call(t.kit,n)}catch(v){return o("Encrypted data exception."),a.call(t.kit,n)}},void o("GeneralEncryption Plugin initialized successfully.")):void o("GeneralEncryption Plugin initialization failed. parameter error."):void o("Web SDK initialization failed.")}},c=e(a,"GeneralEncryption","sdkReady");return c}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).GeneralEncryption=function(){"use strict";function n(n,e,t){if(e&&(n.plugin_name=e),t&&n.init){var r=n.init;n.init=function(o,a){function c(){r.call(n,o,a)}return i(o,n,e),o.readyState&&o.readyState.state>=3||!o.on?c():void o.on(t,c)}}return n}function i(n,i,e){function t(i,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(i).log():n.log&&n.log.apply(n,t)}i.log=function(){t("log",arguments)},i.warn=function(){t("warn",arguments)},i.error=function(){t("error",arguments)}}function e(i,e,t){return n(i,e,t),i.plugin_version=o,i}var t,r,o="1.26.9",a={init:function(n,i){t=n,r=t._;var e=i&&i.encrypt_utils,o=window.console&&window.console.log||function(){};o=t&&t.log||o;var a=t.kit.encodeTrackData;return t&&t.kit&&a?r.isObject(e)&&r.isFunction(e.encryptEvent)&&r.isFunction(e.encryptSymmetricKeyWithPublicKey)&&r.isString(i.pub_key)&&r.isNumber(i.pkv)?(t.kit.encodeTrackData=function(n){try{var c=e.encryptEvent,l=e.encryptSymmetricKeyWithPublicKey,u=i.pkv,y=i.pub_key;if(r.isFunction(e.encryptEvent)){var p=c(n),s=t._.base64Encode(p),d={pkv:u,ekey:l(y),payloads:[s]},g=JSON.stringify(d),f=encodeURIComponent(g);return"data="+f}return a.call(t.kit,n)}catch(v){return o("Encrypted data exception."),a.call(t.kit,n)}},void o("GeneralEncryption Plugin initialized successfully.")):void o("GeneralEncryption Plugin initialization failed. parameter error."):void o("Web SDK initialization failed.")}},c=e(a,"GeneralEncryption","sdkReady");return c}(); \ No newline at end of file diff --git a/dist/web/plugin/image-sender/index.closure.js b/dist/web/plugin/image-sender/index.closure.js index 7614b296..2410cb80 100644 --- a/dist/web/plugin/image-sender/index.closure.js +++ b/dist/web/plugin/image-sender/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var a=n.init;n.init=function(i,o){function l(){a.call(n,i,o)}return e(i,n,r),i.readyState&&i.readyState.state>=3||!i.on?l():void i.on(t,l)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=g,e}function t(n,e){var r=u.kit.encodeTrackData(e);return n.indexOf("?")!==-1?n+"&"+r:n+"?"+r}function a(n){var e=new c.ImageSend(n);e.start()}function i(n,e){var r=null;c.isObject(n.config)&&(r=c.optimizeServerUrl(n.config.server_url));var i=r||n.server_url,o=n.data;n.server_url=i,c.isArray(i)&&i.length?c.each(i,function(e){e&&(n.data=t(e,o),n.callback=null,n.server_url=e,a(n))}):"string"==typeof i&&""!==i?(n.data=t(i,o),a(n)):u.logger&&u.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),e.cancellationToken.stop()}function o(){"image"!==u.para.send_type&&"ajax"!==u.para.send_type&&"beacon"!==u.para.send_type&&(u.para.send_type="image")}function l(){u.on("sdkInitPara",function(){o()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:130,entry:i}})})}var u,c,g="1.26.8",s={plugin_name:"ImageSender",init:function(n){u=n,c=u._,l()}},f=r(s);return f}(); \ No newline at end of file +!function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var a=n.init;n.init=function(i,o){function l(){a.call(n,i,o)}return e(i,n,r),i.readyState&&i.readyState.state>=3||!i.on?l():void i.on(t,l)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=g,e}function t(n,e){var r=u.kit.encodeTrackData(e);return n.indexOf("?")!==-1?n+"&"+r:n+"?"+r}function a(n){var e=new c.ImageSend(n);e.start()}function i(n,e){var r=null;c.isObject(n.config)&&(r=c.optimizeServerUrl(n.config.server_url));var i=r||n.server_url,o=n.data;n.server_url=i,c.isArray(i)&&i.length?c.each(i,function(e){e&&(n.data=t(e,o),n.callback=null,n.server_url=e,a(n))}):"string"==typeof i&&""!==i?(n.data=t(i,o),a(n)):u.logger&&u.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),e.cancellationToken.stop()}function o(){"image"!==u.para.send_type&&"ajax"!==u.para.send_type&&"beacon"!==u.para.send_type&&(u.para.send_type="image")}function l(){u.on("sdkInitPara",function(){o()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:130,entry:i}})})}var u,c,g="1.26.9",s={plugin_name:"ImageSender",init:function(n){u=n,c=u._,l()}},f=r(s);return f}(); \ No newline at end of file diff --git a/dist/web/plugin/image-sender/index.es6.js b/dist/web/plugin/image-sender/index.es6.js index 354771e9..ec1c11ad 100644 --- a/dist/web/plugin/image-sender/index.es6.js +++ b/dist/web/plugin/image-sender/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}function getSendUrl(n,e){var r=sd.kit.encodeTrackData(e);return-1!==n.indexOf("?")?n+"&"+r:n+"?"+r}function sendData(n){new _.ImageSend(n).start()}function sendInterceptor(n,e){var r=null;_.isObject(n.config)&&(r=_.optimizeServerUrl(n.config.server_url));var t=r||n.server_url,a=n.data;n.server_url=t,_.isArray(t)&&t.length?_.each(t,function(e){e&&(n.data=getSendUrl(e,a),n.callback=null,n.server_url=e,sendData(n))}):"string"==typeof t&&""!==t?(n.data=getSendUrl(t,a),sendData(n)):sd.logger&&sd.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),e.cancellationToken.stop()}function initPara(){"image"!==sd.para.send_type&&"ajax"!==sd.para.send_type&&"beacon"!==sd.para.send_type&&(sd.para.send_type="image")}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:130,entry:sendInterceptor}})})}var ImageSender={plugin_name:"ImageSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(ImageSender);export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,e),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}function getSendUrl(n,e){var r=sd.kit.encodeTrackData(e);return-1!==n.indexOf("?")?n+"&"+r:n+"?"+r}function sendData(n){new _.ImageSend(n).start()}function sendInterceptor(n,e){var r=null;_.isObject(n.config)&&(r=_.optimizeServerUrl(n.config.server_url));var t=r||n.server_url,a=n.data;n.server_url=t,_.isArray(t)&&t.length?_.each(t,function(e){e&&(n.data=getSendUrl(e,a),n.callback=null,n.server_url=e,sendData(n))}):"string"==typeof t&&""!==t?(n.data=getSendUrl(t,a),sendData(n)):sd.logger&&sd.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),e.cancellationToken.stop()}function initPara(){"image"!==sd.para.send_type&&"ajax"!==sd.para.send_type&&"beacon"!==sd.para.send_type&&(sd.para.send_type="image")}function senderInit(){sd.on("sdkInitPara",function(){initPara()}),sd.on("sdkAfterInitPara",function(){sd.registerInterceptor("sendDataStage",{send:{priority:130,entry:sendInterceptor}})})}var ImageSender={plugin_name:"ImageSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(ImageSender);export default index; \ No newline at end of file diff --git a/dist/web/plugin/image-sender/index.js b/dist/web/plugin/image-sender/index.js index 96d4aab3..df45ca7a 100644 --- a/dist/web/plugin/image-sender/index.js +++ b/dist/web/plugin/image-sender/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).ImageSender=function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var a=n.init;n.init=function(i,o){function l(){a.call(n,i,o)}return e(i,n,r),i.readyState&&i.readyState.state>=3||!i.on?l():void i.on(t,l)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=c,e}function t(n,e){var r=u.kit.encodeTrackData(e);return n.indexOf("?")!==-1?n+"&"+r:n+"?"+r}function a(n){var e=new g.ImageSend(n);e.start()}function i(n,e){var r=null;g.isObject(n.config)&&(r=g.optimizeServerUrl(n.config.server_url));var i=r||n.server_url,o=n.data;n.server_url=i,g.isArray(i)&&i.length?g.each(i,function(e){e&&(n.data=t(e,o),n.callback=null,n.server_url=e,a(n))}):"string"==typeof i&&""!==i?(n.data=t(i,o),a(n)):u.logger&&u.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),e.cancellationToken.stop()}function o(){"image"!==u.para.send_type&&"ajax"!==u.para.send_type&&"beacon"!==u.para.send_type&&(u.para.send_type="image")}function l(){u.on("sdkInitPara",function(){o()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:130,entry:i}})})}var u,g,c="1.26.8",s={plugin_name:"ImageSender",init:function(n){u=n,g=u._,l()}},f=r(s);return f}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).ImageSender=function(){"use strict";function n(n,r,t){if(r&&(n.plugin_name=r),t&&n.init){var a=n.init;n.init=function(i,o){function l(){a.call(n,i,o)}return e(i,n,r),i.readyState&&i.readyState.state>=3||!i.on?l():void i.on(t,l)}}return n}function e(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function r(e,r,t){return n(e,r,t),e.plugin_version=c,e}function t(n,e){var r=u.kit.encodeTrackData(e);return n.indexOf("?")!==-1?n+"&"+r:n+"?"+r}function a(n){var e=new g.ImageSend(n);e.start()}function i(n,e){var r=null;g.isObject(n.config)&&(r=g.optimizeServerUrl(n.config.server_url));var i=r||n.server_url,o=n.data;n.server_url=i,g.isArray(i)&&i.length?g.each(i,function(e){e&&(n.data=t(e,o),n.callback=null,n.server_url=e,a(n))}):"string"==typeof i&&""!==i?(n.data=t(i,o),a(n)):u.logger&&u.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),e.cancellationToken.stop()}function o(){"image"!==u.para.send_type&&"ajax"!==u.para.send_type&&"beacon"!==u.para.send_type&&(u.para.send_type="image")}function l(){u.on("sdkInitPara",function(){o()}),u.on("sdkAfterInitPara",function(){u.registerInterceptor("sendDataStage",{send:{priority:130,entry:i}})})}var u,g,c="1.26.9",s={plugin_name:"ImageSender",init:function(n){u=n,g=u._,l()}},f=r(s);return f}(); \ No newline at end of file diff --git a/dist/web/plugin/ios-bridge/index.closure.js b/dist/web/plugin/ios-bridge/index.closure.js index 2bdafadc..7ea33577 100644 --- a/dist/web/plugin/ios-bridge/index.closure.js +++ b/dist/web/plugin/ios-bridge/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(t,s){function o(){n.call(e,t,s)}return i(t,e,r),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(a,o)}}return e}function i(e,i,r){function a(i,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(i).log():e.log&&e.log.apply(e,a)}i.log=function(){a("log",arguments)},i.warn=function(){a("warn",arguments)},i.error=function(){a("error",arguments)}}function r(i,r,a){return e(i,r,a),i.plugin_version=g,i}function a(){if(s=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,o=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},d&&!d.bridge.activeBridge&&o()&&o().postMessage){if(d.bridge.activeBridge=l,d.para.app_js_bridge&&!d.para.app_js_bridge.is_mui&&(d.bridge.is_verify_success=s&&d.bridge.validateAppUrl(s)),d.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:d.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!d.para.app_js_bridge)return void c("app_js_bridge is not configured, data will not be sent by iOS bridge.");d.registerInterceptor("sendDataStage",{send:{priority:70,entry:n}}),c("IOS bridge inits succeed.")}}function n(e,i){if(d.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return d.bridge.is_verify_success?(o()&&o().postMessage(JSON.stringify({callType:"app_h5_track",data:_.extend({server_url:d.para.server_url},e.data)})),_.isFunction(r)&&r(),i.cancellationToken.cancel(),e):d.para.app_js_bridge.is_send?(d.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_.isFunction(r)&&r(),i.cancellationToken.cancel(),e)}function t(e){var i=e.callType;return"page_info"!==i&&"visualized_track"!==i||d.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===i?_.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[i]:o()&&o().postMessage(JSON.stringify(e)):null}var s,o,d,_,c,g="1.26.8",l={init:function(e){d=e,_=d&&d._,c=d&&d.log||console&&console.log||function(){},a()},handleCommand:t},u=r(l,"IOSBridge","sdkAfterInitPara");return u}(); \ No newline at end of file +!function(){"use strict";function e(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(t,s){function o(){n.call(e,t,s)}return i(t,e,r),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(a,o)}}return e}function i(e,i,r){function a(i,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(i).log():e.log&&e.log.apply(e,a)}i.log=function(){a("log",arguments)},i.warn=function(){a("warn",arguments)},i.error=function(){a("error",arguments)}}function r(i,r,a){return e(i,r,a),i.plugin_version=g,i}function a(){if(s=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,o=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},d&&!d.bridge.activeBridge&&o()&&o().postMessage){if(d.bridge.activeBridge=l,d.para.app_js_bridge&&!d.para.app_js_bridge.is_mui&&(d.bridge.is_verify_success=s&&d.bridge.validateAppUrl(s)),d.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:d.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!d.para.app_js_bridge)return void c("app_js_bridge is not configured, data will not be sent by iOS bridge.");d.registerInterceptor("sendDataStage",{send:{priority:70,entry:n}}),c("IOS bridge inits succeed.")}}function n(e,i){if(d.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return d.bridge.is_verify_success?(o()&&o().postMessage(JSON.stringify({callType:"app_h5_track",data:_.extend({server_url:d.para.server_url},e.data)})),_.isFunction(r)&&r(),i.cancellationToken.cancel(),e):d.para.app_js_bridge.is_send?(d.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_.isFunction(r)&&r(),i.cancellationToken.cancel(),e)}function t(e){var i=e.callType;return"page_info"!==i&&"visualized_track"!==i||d.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===i?_.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[i]:o()&&o().postMessage(JSON.stringify(e)):null}var s,o,d,_,c,g="1.26.9",l={init:function(e){d=e,_=d&&d._,c=d&&d.log||console&&console.log||function(){},a()},handleCommand:t},u=r(l,"IOSBridge","sdkAfterInitPara");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/ios-bridge/index.es6.js b/dist/web/plugin/ios-bridge/index.es6.js index d784debd..35b056b7 100644 --- a/dist/web/plugin/ios-bridge/index.es6.js +++ b/dist/web/plugin/ios-bridge/index.es6.js @@ -1 +1 @@ -var iosServerUrl,iosTracker,sd,_,log,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(e,r,i){if(r&&(e.plugin_name=r),i&&e.init){var a=e.init;e.init=function(s,n){if(wrapLogFn(s,e,r),s.readyState&&s.readyState.state>=3||!s.on)return t();function t(){a.call(e,s,n)}s.on(i,t)}}return e}function wrapLogFn(e,r,i){function a(r,a){e.logger?e.logger.msg.apply(e.logger,a).module(i+""||"").level(r).log():e.log&&e.log.apply(e,a)}r.log=function(){a("log",arguments)},r.warn=function(){a("warn",arguments)},r.error=function(){a("error",arguments)}}function createPlugin(e,r,i){return wrapPluginInitFn(e,r,i),e.plugin_version=sdkversion_placeholder,e}var IOSBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){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&&!sd.bridge.activeBridge&&iosTracker()&&iosTracker().postMessage&&(sd.bridge.activeBridge=IOSBridge,sd.para.app_js_bridge&&!sd.para.app_js_bridge.is_mui&&(sd.bridge.is_verify_success=iosServerUrl&&sd.bridge.validateAppUrl(iosServerUrl)),sd.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:sd.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:70,entry:sendData}}),log("IOS bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by iOS bridge."))}function sendData(e,r){if(sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var i=e.callback;return sd.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_.extend({server_url:sd.para.server_url},e.data)})),_.isFunction(i)&&i(),r.cancellationToken.cancel(),e):sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_.isFunction(i)&&i(),r.cancellationToken.cancel(),e)}function handleCommand(e){var r=e.callType;return"page_info"!==r&&"visualized_track"!==r||sd.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===r?_.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[r]:iosTracker()&&iosTracker().postMessage(JSON.stringify(e)):null}var index=createPlugin(IOSBridge,"IOSBridge","sdkAfterInitPara");export default index; \ No newline at end of file +var iosServerUrl,iosTracker,sd,_,log,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(e,r,i){if(r&&(e.plugin_name=r),i&&e.init){var a=e.init;e.init=function(s,n){if(wrapLogFn(s,e,r),s.readyState&&s.readyState.state>=3||!s.on)return t();function t(){a.call(e,s,n)}s.on(i,t)}}return e}function wrapLogFn(e,r,i){function a(r,a){e.logger?e.logger.msg.apply(e.logger,a).module(i+""||"").level(r).log():e.log&&e.log.apply(e,a)}r.log=function(){a("log",arguments)},r.warn=function(){a("warn",arguments)},r.error=function(){a("error",arguments)}}function createPlugin(e,r,i){return wrapPluginInitFn(e,r,i),e.plugin_version=sdkversion_placeholder,e}var IOSBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()},handleCommand:handleCommand};function initBridge(){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&&!sd.bridge.activeBridge&&iosTracker()&&iosTracker().postMessage&&(sd.bridge.activeBridge=IOSBridge,sd.para.app_js_bridge&&!sd.para.app_js_bridge.is_mui&&(sd.bridge.is_verify_success=iosServerUrl&&sd.bridge.validateAppUrl(iosServerUrl)),sd.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:sd.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:70,entry:sendData}}),log("IOS bridge inits succeed.")):log("app_js_bridge is not configured, data will not be sent by iOS bridge."))}function sendData(e,r){if(sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var i=e.callback;return sd.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_.extend({server_url:sd.para.server_url},e.data)})),_.isFunction(i)&&i(),r.cancellationToken.cancel(),e):sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_.isFunction(i)&&i(),r.cancellationToken.cancel(),e)}function handleCommand(e){var r=e.callType;return"page_info"!==r&&"visualized_track"!==r||sd.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===r?_.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[r]:iosTracker()&&iosTracker().postMessage(JSON.stringify(e)):null}var index=createPlugin(IOSBridge,"IOSBridge","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/ios-bridge/index.js b/dist/web/plugin/ios-bridge/index.js index 9444abb2..efc1c356 100644 --- a/dist/web/plugin/ios-bridge/index.js +++ b/dist/web/plugin/ios-bridge/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).IOSBridge=function(){"use strict";function e(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(t,s){function o(){n.call(e,t,s)}return i(t,e,r),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(a,o)}}return e}function i(e,i,r){function a(i,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(i).log():e.log&&e.log.apply(e,a)}i.log=function(){a("log",arguments)},i.warn=function(){a("warn",arguments)},i.error=function(){a("error",arguments)}}function r(i,r,a){return e(i,r,a),i.plugin_version=c,i}function a(){if(s=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,o=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},d&&!d.bridge.activeBridge&&o()&&o().postMessage){if(d.bridge.activeBridge=l,d.para.app_js_bridge&&!d.para.app_js_bridge.is_mui&&(d.bridge.is_verify_success=s&&d.bridge.validateAppUrl(s)),d.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:d.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!d.para.app_js_bridge)return void g("app_js_bridge is not configured, data will not be sent by iOS bridge.");d.registerInterceptor("sendDataStage",{send:{priority:70,entry:n}}),g("IOS bridge inits succeed.")}}function n(e,i){if(d.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return d.bridge.is_verify_success?(o()&&o().postMessage(JSON.stringify({callType:"app_h5_track",data:_.extend({server_url:d.para.server_url},e.data)})),_.isFunction(r)&&r(),i.cancellationToken.cancel(),e):d.para.app_js_bridge.is_send?(d.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_.isFunction(r)&&r(),i.cancellationToken.cancel(),e)}function t(e){var i=e.callType;return"page_info"!==i&&"visualized_track"!==i||d.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===i?_.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[i]:o()&&o().postMessage(JSON.stringify(e)):null}var s,o,d,_,g,c="1.26.8",l={init:function(e){d=e,_=d&&d._,g=d&&d.log||console&&console.log||function(){},a()},handleCommand:t},u=r(l,"IOSBridge","sdkAfterInitPara");return u}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).IOSBridge=function(){"use strict";function e(e,r,a){if(r&&(e.plugin_name=r),a&&e.init){var n=e.init;e.init=function(t,s){function o(){n.call(e,t,s)}return i(t,e,r),t.readyState&&t.readyState.state>=3||!t.on?o():void t.on(a,o)}}return e}function i(e,i,r){function a(i,a){e.logger?e.logger.msg.apply(e.logger,a).module(r+""||"").level(i).log():e.log&&e.log.apply(e,a)}i.log=function(){a("log",arguments)},i.warn=function(){a("warn",arguments)},i.error=function(){a("error",arguments)}}function r(i,r,a){return e(i,r,a),i.plugin_version=c,i}function a(){if(s=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,o=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},d&&!d.bridge.activeBridge&&o()&&o().postMessage){if(d.bridge.activeBridge=l,d.para.app_js_bridge&&!d.para.app_js_bridge.is_mui&&(d.bridge.is_verify_success=s&&d.bridge.validateAppUrl(s)),d.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:d.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!d.para.app_js_bridge)return void g("app_js_bridge is not configured, data will not be sent by iOS bridge.");d.registerInterceptor("sendDataStage",{send:{priority:70,entry:n}}),g("IOS bridge inits succeed.")}}function n(e,i){if(d.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return d.bridge.is_verify_success?(o()&&o().postMessage(JSON.stringify({callType:"app_h5_track",data:_.extend({server_url:d.para.server_url},e.data)})),_.isFunction(r)&&r(),i.cancellationToken.cancel(),e):d.para.app_js_bridge.is_send?(d.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_.isFunction(r)&&r(),i.cancellationToken.cancel(),e)}function t(e){var i=e.callType;return"page_info"!==i&&"visualized_track"!==i||d.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===i?_.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[i]:o()&&o().postMessage(JSON.stringify(e)):null}var s,o,d,_,g,c="1.26.9",l={init:function(e){d=e,_=d&&d._,g=d&&d.log||console&&console.log||function(){},a()},handleCommand:t},u=r(l,"IOSBridge","sdkAfterInitPara");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/ios-obsolete-bridge/index.closure.js b/dist/web/plugin/ios-obsolete-bridge/index.closure.js index f1616536..f5b49c9f 100644 --- a/dist/web/plugin/ios-obsolete-bridge/index.closure.js +++ b/dist/web/plugin/ios-obsolete-bridge/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=l,t}function n(){if(s&&!s.bridge.activeBridge&&i()){if(s.bridge.activeBridge=g,s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:a()?"success":"fail"},!s.para.app_js_bridge)return void c("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");s.registerInterceptor("sendDataStage",{send:{priority:90,entry:o}}),c("IOS obsolete bridge inits succeed.")}}function i(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function a(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=u.URL(s.para.server_url).hostname,r=u.URL(s.para.server_url).searchParams.get("project")||"default"}catch(n){s.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function o(e,t){function r(e){var t=JSON.stringify(u.extend({server_url:s.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(s.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,u.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return s.para.app_js_bridge.is_send?(s.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(u.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}var s,u,c,l="1.26.8",g={init:function(e){s=e,u=s&&s._,c=s&&s.log||console&&console.log||function(){},n()}},d=r(g,"IOSObsoleteBridge","sdkAfterInitPara");return d}(); \ No newline at end of file +!function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=l,t}function n(){if(s&&!s.bridge.activeBridge&&i()){if(s.bridge.activeBridge=g,s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:a()?"success":"fail"},!s.para.app_js_bridge)return void c("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");s.registerInterceptor("sendDataStage",{send:{priority:90,entry:o}}),c("IOS obsolete bridge inits succeed.")}}function i(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function a(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=u.URL(s.para.server_url).hostname,r=u.URL(s.para.server_url).searchParams.get("project")||"default"}catch(n){s.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function o(e,t){function r(e){var t=JSON.stringify(u.extend({server_url:s.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(s.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,u.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return s.para.app_js_bridge.is_send?(s.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(u.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}var s,u,c,l="1.26.9",g={init:function(e){s=e,u=s&&s._,c=s&&s.log||console&&console.log||function(){},n()}},d=r(g,"IOSObsoleteBridge","sdkAfterInitPara");return d}(); \ No newline at end of file diff --git a/dist/web/plugin/ios-obsolete-bridge/index.es6.js b/dist/web/plugin/ios-obsolete-bridge/index.es6.js index 98d79310..fcf61f48 100644 --- a/dist/web/plugin/ios-obsolete-bridge/index.es6.js +++ b/dist/web/plugin/ios-obsolete-bridge/index.es6.js @@ -1 +1 @@ -var sd,_,log,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(e,r,t){if(r&&(e.plugin_name=r),t&&e.init){var n=e.init;e.init=function(i,s){if(wrapLogFn(i,e,r),i.readyState&&i.readyState.state>=3||!i.on)return a();function a(){n.call(e,i,s)}i.on(t,a)}}return e}function wrapLogFn(e,r,t){function n(r,n){e.logger?e.logger.msg.apply(e.logger,n).module(t+""||"").level(r).log():e.log&&e.log.apply(e,n)}r.log=function(){n("log",arguments)},r.warn=function(){n("warn",arguments)},r.error=function(){n("error",arguments)}}function createPlugin(e,r,t){return wrapPluginInitFn(e,r,t),e.plugin_version=sdkversion_placeholder,e}var IOSObsoleteBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()}};function initBridge(){sd&&!sd.bridge.activeBridge&&hasBridge()&&(sd.bridge.activeBridge=IOSObsoleteBridge,sd.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:verifyIOSObsoleteBridge()?"success":"fail"},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:90,entry:sendData}}),log("IOS obsolete bridge inits succeed.")):log("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)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var r=null,t=null;try{r=_.URL(sd.para.server_url).hostname,t=_.URL(sd.para.server_url).searchParams.get("project")||"default"}catch(n){sd.log(n)}return!(!r||r!==e[0]||!t||t!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function sendData(e,r){if(sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var t,n,i=e.callback;if(sd.bridge.bridge_info.verify_success){var s=document.createElement("iframe"),a=(t=e.data,n=(n=JSON.stringify(_.extend({server_url:sd.para.server_url},t))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return s.setAttribute("src",a),document.documentElement.appendChild(s),s.parentNode.removeChild(s),s=null,_.isFunction(i)&&i(),r.cancellationToken.cancel(),!0}return sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_.isFunction(i)&&i(),r.cancellationToken.cancel(),e)}var index=createPlugin(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara");export default index; \ No newline at end of file +var sd,_,log,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(e,r,t){if(r&&(e.plugin_name=r),t&&e.init){var n=e.init;e.init=function(i,s){if(wrapLogFn(i,e,r),i.readyState&&i.readyState.state>=3||!i.on)return a();function a(){n.call(e,i,s)}i.on(t,a)}}return e}function wrapLogFn(e,r,t){function n(r,n){e.logger?e.logger.msg.apply(e.logger,n).module(t+""||"").level(r).log():e.log&&e.log.apply(e,n)}r.log=function(){n("log",arguments)},r.warn=function(){n("warn",arguments)},r.error=function(){n("error",arguments)}}function createPlugin(e,r,t){return wrapPluginInitFn(e,r,t),e.plugin_version=sdkversion_placeholder,e}var IOSObsoleteBridge={init:function(e){_=(sd=e)&&sd._,log=sd&&sd.log||console&&console.log||function(){},initBridge()}};function initBridge(){sd&&!sd.bridge.activeBridge&&hasBridge()&&(sd.bridge.activeBridge=IOSObsoleteBridge,sd.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:verifyIOSObsoleteBridge()?"success":"fail"},sd.para.app_js_bridge?(sd.registerInterceptor("sendDataStage",{send:{priority:90,entry:sendData}}),log("IOS obsolete bridge inits succeed.")):log("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)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var r=null,t=null;try{r=_.URL(sd.para.server_url).hostname,t=_.URL(sd.para.server_url).searchParams.get("project")||"default"}catch(n){sd.log(n)}return!(!r||r!==e[0]||!t||t!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function sendData(e,r){if(sd.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var t,n,i=e.callback;if(sd.bridge.bridge_info.verify_success){var s=document.createElement("iframe"),a=(t=e.data,n=(n=JSON.stringify(_.extend({server_url:sd.para.server_url},t))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return s.setAttribute("src",a),document.documentElement.appendChild(s),s.parentNode.removeChild(s),s=null,_.isFunction(i)&&i(),r.cancellationToken.cancel(),!0}return sd.para.app_js_bridge.is_send?(sd.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_.isFunction(i)&&i(),r.cancellationToken.cancel(),e)}var index=createPlugin(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/ios-obsolete-bridge/index.js b/dist/web/plugin/ios-obsolete-bridge/index.js index 3a4b5d6e..6497a032 100644 --- a/dist/web/plugin/ios-obsolete-bridge/index.js +++ b/dist/web/plugin/ios-obsolete-bridge/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).IOSObsoleteBridge=function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=c,t}function n(){if(s&&!s.bridge.activeBridge&&i()){if(s.bridge.activeBridge=g,s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:a()?"success":"fail"},!s.para.app_js_bridge)return void l("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");s.registerInterceptor("sendDataStage",{send:{priority:90,entry:o}}),l("IOS obsolete bridge inits succeed.")}}function i(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function a(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=u.URL(s.para.server_url).hostname,r=u.URL(s.para.server_url).searchParams.get("project")||"default"}catch(n){s.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function o(e,t){function r(e){var t=JSON.stringify(u.extend({server_url:s.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(s.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,u.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return s.para.app_js_bridge.is_send?(s.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(u.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}var s,u,l,c="1.26.8",g={init:function(e){s=e,u=s&&s._,l=s&&s.log||console&&console.log||function(){},n()}},d=r(g,"IOSObsoleteBridge","sdkAfterInitPara");return d}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).IOSObsoleteBridge=function(){"use strict";function e(e,r,n){if(r&&(e.plugin_name=r),n&&e.init){var i=e.init;e.init=function(a,o){function s(){i.call(e,a,o)}return t(a,e,r),a.readyState&&a.readyState.state>=3||!a.on?s():void a.on(n,s)}}return e}function t(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function r(t,r,n){return e(t,r,n),t.plugin_version=c,t}function n(){if(s&&!s.bridge.activeBridge&&i()){if(s.bridge.activeBridge=g,s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:a()?"success":"fail"},!s.para.app_js_bridge)return void l("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");s.registerInterceptor("sendDataStage",{send:{priority:90,entry:o}}),l("IOS obsolete bridge inits succeed.")}}function i(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function a(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=u.URL(s.para.server_url).hostname,r=u.URL(s.para.server_url).searchParams.get("project")||"default"}catch(n){s.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function o(e,t){function r(e){var t=JSON.stringify(u.extend({server_url:s.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(s.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,u.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return s.para.app_js_bridge.is_send?(s.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(u.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}var s,u,l,c="1.26.9",g={init:function(e){s=e,u=s&&s._,l=s&&s.log||console&&console.log||function(){},n()}},d=r(g,"IOSObsoleteBridge","sdkAfterInitPara");return d}(); \ No newline at end of file diff --git a/dist/web/plugin/jsapp-sender/index.closure.js b/dist/web/plugin/jsapp-sender/index.closure.js index 42ab84b5..5218f676 100644 --- a/dist/web/plugin/jsapp-sender/index.closure.js +++ b/dist/web/plugin/jsapp-sender/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var i=n.init;n.init=function(r,o){function p(){i.call(n,r,o)}return t(r,n,a),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(e,p)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=s,t}function e(n,t){if(p.isObject(o.para.jsapp)&&!o.para.jsapp.isOnline&&"function"==typeof o.para.jsapp.setData){var a=n;delete a.callback,a=JSON.stringify(a),o.para.jsapp.setData(a),t.cancellationToken.stop()}return n}function i(){o.on("sdkAfterInitAPI",function(){p.isObject(o.commonWays)&&(o.commonWays.setOnlineState=r),o.registerInterceptor("sendDataStage",{send:{priority:40,entry:e}})})}function r(n){if(n===!0&&p.isObject(o.para.jsapp)&&"function"==typeof o.para.jsapp.getData){o.para.jsapp.isOnline=!0;var t=o.para.jsapp.getData();p.isArray(t)&&t.length>0&&p.each(t,function(n){p.isJSONString(n)&&o.kit.sendData(JSON.parse(n))})}else o.para.jsapp.isOnline=!1}var o,p,s="1.26.8",c={plugin_name:"JsappSender",init:function(n){o=n,p=o._,i()}},l=a(c);return l}(); \ No newline at end of file +!function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var i=n.init;n.init=function(r,o){function p(){i.call(n,r,o)}return t(r,n,a),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(e,p)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=s,t}function e(n,t){if(p.isObject(o.para.jsapp)&&!o.para.jsapp.isOnline&&"function"==typeof o.para.jsapp.setData){var a=n;delete a.callback,a=JSON.stringify(a),o.para.jsapp.setData(a),t.cancellationToken.stop()}return n}function i(){o.on("sdkAfterInitAPI",function(){p.isObject(o.commonWays)&&(o.commonWays.setOnlineState=r),o.registerInterceptor("sendDataStage",{send:{priority:40,entry:e}})})}function r(n){if(n===!0&&p.isObject(o.para.jsapp)&&"function"==typeof o.para.jsapp.getData){o.para.jsapp.isOnline=!0;var t=o.para.jsapp.getData();p.isArray(t)&&t.length>0&&p.each(t,function(n){p.isJSONString(n)&&o.kit.sendData(JSON.parse(n))})}else o.para.jsapp.isOnline=!1}var o,p,s="1.26.9",c={plugin_name:"JsappSender",init:function(n){o=n,p=o._,i()}},l=a(c);return l}(); \ No newline at end of file diff --git a/dist/web/plugin/jsapp-sender/index.es6.js b/dist/web/plugin/jsapp-sender/index.es6.js index f0103cc8..1c1e4b41 100644 --- a/dist/web/plugin/jsapp-sender/index.es6.js +++ b/dist/web/plugin/jsapp-sender/index.es6.js @@ -1 +1 @@ -var sd,_,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(n,e,a){if(e&&(n.plugin_name=e),a&&n.init){var t=n.init;n.init=function(i,r){if(wrapLogFn(i,n,e),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){t.call(n,i,r)}i.on(a,s)}}return n}function wrapLogFn(n,e,a){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(a+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,a){return wrapPluginInitFn(n,e,a),n.plugin_version=sdkversion_placeholder,n}function sendData(n,e){if(_.isObject(sd.para.jsapp)&&!sd.para.jsapp.isOnline&&"function"==typeof sd.para.jsapp.setData){var a=n;delete a.callback,a=JSON.stringify(a),sd.para.jsapp.setData(a),e.cancellationToken.stop()}return n}function senderInit(){sd.on("sdkAfterInitAPI",function(){_.isObject(sd.commonWays)&&(sd.commonWays.setOnlineState=setOnlineState),sd.registerInterceptor("sendDataStage",{send:{priority:40,entry:sendData}})})}function setOnlineState(n){if(!0===n&&_.isObject(sd.para.jsapp)&&"function"==typeof sd.para.jsapp.getData){sd.para.jsapp.isOnline=!0;var e=sd.para.jsapp.getData();_.isArray(e)&&e.length>0&&_.each(e,function(n){_.isJSONString(n)&&sd.kit.sendData(JSON.parse(n))})}else sd.para.jsapp.isOnline=!1}var JsappSender={plugin_name:"JsappSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(JsappSender);export default index; \ No newline at end of file +var sd,_,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(n,e,a){if(e&&(n.plugin_name=e),a&&n.init){var t=n.init;n.init=function(i,r){if(wrapLogFn(i,n,e),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){t.call(n,i,r)}i.on(a,s)}}return n}function wrapLogFn(n,e,a){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(a+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,a){return wrapPluginInitFn(n,e,a),n.plugin_version=sdkversion_placeholder,n}function sendData(n,e){if(_.isObject(sd.para.jsapp)&&!sd.para.jsapp.isOnline&&"function"==typeof sd.para.jsapp.setData){var a=n;delete a.callback,a=JSON.stringify(a),sd.para.jsapp.setData(a),e.cancellationToken.stop()}return n}function senderInit(){sd.on("sdkAfterInitAPI",function(){_.isObject(sd.commonWays)&&(sd.commonWays.setOnlineState=setOnlineState),sd.registerInterceptor("sendDataStage",{send:{priority:40,entry:sendData}})})}function setOnlineState(n){if(!0===n&&_.isObject(sd.para.jsapp)&&"function"==typeof sd.para.jsapp.getData){sd.para.jsapp.isOnline=!0;var e=sd.para.jsapp.getData();_.isArray(e)&&e.length>0&&_.each(e,function(n){_.isJSONString(n)&&sd.kit.sendData(JSON.parse(n))})}else sd.para.jsapp.isOnline=!1}var JsappSender={plugin_name:"JsappSender",init:function(n){_=(sd=n)._,senderInit()}},index=createPlugin(JsappSender);export default index; \ No newline at end of file diff --git a/dist/web/plugin/jsapp-sender/index.js b/dist/web/plugin/jsapp-sender/index.js index 7ab9b159..3ad24aca 100644 --- a/dist/web/plugin/jsapp-sender/index.js +++ b/dist/web/plugin/jsapp-sender/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).JsappSender=function(){"use strict";function n(n,t,e){if(t&&(n.plugin_name=t),e&&n.init){var i=n.init;n.init=function(r,o){function p(){i.call(n,r,o)}return a(r,n,t),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(e,p)}}return n}function a(n,a,t){function e(a,e){n.logger?n.logger.msg.apply(n.logger,e).module(t+""||"").level(a).log():n.log&&n.log.apply(n,e)}a.log=function(){e("log",arguments)},a.warn=function(){e("warn",arguments)},a.error=function(){e("error",arguments)}}function t(a,t,e){return n(a,t,e),a.plugin_version=s,a}function e(n,a){if(p.isObject(o.para.jsapp)&&!o.para.jsapp.isOnline&&"function"==typeof o.para.jsapp.setData){var t=n;delete t.callback,t=JSON.stringify(t),o.para.jsapp.setData(t),a.cancellationToken.stop()}return n}function i(){o.on("sdkAfterInitAPI",function(){p.isObject(o.commonWays)&&(o.commonWays.setOnlineState=r),o.registerInterceptor("sendDataStage",{send:{priority:40,entry:e}})})}function r(n){if(n===!0&&p.isObject(o.para.jsapp)&&"function"==typeof o.para.jsapp.getData){o.para.jsapp.isOnline=!0;var a=o.para.jsapp.getData();p.isArray(a)&&a.length>0&&p.each(a,function(n){p.isJSONString(n)&&o.kit.sendData(JSON.parse(n))})}else o.para.jsapp.isOnline=!1}var o,p,s="1.26.8",c={plugin_name:"JsappSender",init:function(n){o=n,p=o._,i()}},l=t(c);return l}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).JsappSender=function(){"use strict";function n(n,t,e){if(t&&(n.plugin_name=t),e&&n.init){var i=n.init;n.init=function(r,o){function p(){i.call(n,r,o)}return a(r,n,t),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(e,p)}}return n}function a(n,a,t){function e(a,e){n.logger?n.logger.msg.apply(n.logger,e).module(t+""||"").level(a).log():n.log&&n.log.apply(n,e)}a.log=function(){e("log",arguments)},a.warn=function(){e("warn",arguments)},a.error=function(){e("error",arguments)}}function t(a,t,e){return n(a,t,e),a.plugin_version=s,a}function e(n,a){if(p.isObject(o.para.jsapp)&&!o.para.jsapp.isOnline&&"function"==typeof o.para.jsapp.setData){var t=n;delete t.callback,t=JSON.stringify(t),o.para.jsapp.setData(t),a.cancellationToken.stop()}return n}function i(){o.on("sdkAfterInitAPI",function(){p.isObject(o.commonWays)&&(o.commonWays.setOnlineState=r),o.registerInterceptor("sendDataStage",{send:{priority:40,entry:e}})})}function r(n){if(n===!0&&p.isObject(o.para.jsapp)&&"function"==typeof o.para.jsapp.getData){o.para.jsapp.isOnline=!0;var a=o.para.jsapp.getData();p.isArray(a)&&a.length>0&&p.each(a,function(n){p.isJSONString(n)&&o.kit.sendData(JSON.parse(n))})}else o.para.jsapp.isOnline=!1}var o,p,s="1.26.9",c={plugin_name:"JsappSender",init:function(n){o=n,p=o._,i()}},l=t(c);return l}(); \ No newline at end of file diff --git a/dist/web/plugin/pageleave/index.closure.js b/dist/web/plugin/pageleave/index.closure.js index 638948a7..5943c465 100644 --- a/dist/web/plugin/pageleave/index.closure.js +++ b/dist/web/plugin/pageleave/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function t(t,a,i){if(a&&(t.plugin_name=a),i&&t.init){var r=t.init;t.init=function(n,s){function o(){r.call(t,n,s)}return e(n,t,a),n.readyState&&n.readyState.state>=3||!n.on?o():void n.on(i,o)}}return t}function e(t,e,a){function i(e,i){t.logger?t.logger.msg.apply(t.logger,i).module(a+""||"").level(e).log():t.log&&t.log.apply(t,i)}e.log=function(){i("log",arguments)},e.warn=function(){i("warn",arguments)},e.error=function(){i("error",arguments)}}function a(e,a,i){return t(e,a,i),e.plugin_version=r,e}function i(){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=s}var r="1.26.8",n=5e3,s=432e3;i.prototype.init=function(t,e){if(t){if(this.sd=t,this._=this.sd._,e){this.option=e;var a=e.heartbeat_interval_time;a&&(this._.isNumber(a)||this._.isNumber(1*a))&&1*a>0&&(this.heartbeat_interval_time=1e3*a);var i=e.max_duration;i&&(this._.isNumber(i)||this._.isNumber(1*i))&&1*i>0&&(this.max_duration=i)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},i.prototype.log=function(t){this.sd&&this.sd.log(t)},i.prototype.refreshPageEndTimer=function(){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){t.page_hidden_status=!1},n)},i.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},i.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},i.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var t=this.getPageLeaveProperties();this.page_show_status===!1&&delete t.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",t),this.refreshPageEndTimer(),this.delHeartBeatData()}},i.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},i.prototype.addPageStartListener=function(){var t=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){t.pageStartHandler(),t.hiddenStatusHandler()})},i.prototype.isCollectUrl=function(t){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof t||""===t||this.option.isCollectUrl(t))},i.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())})},i.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()})})},i.prototype.addPageSwitchListener=function(){var t=this;this._.listenPageState({visible:function(){t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval()},hidden:function(){t.url=location.href,t.title=document.title,t.pageEndHandler(),t.stopHeartBeatInterval()}})},i.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},i.prototype.startHeartBeatInterval=function(){var t=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var e=!0;this.isCollectUrl(this.url)||(e=!1),this.heartbeat_interval_timer=setInterval(function(){e&&t.saveHeartBeatData()},this.heartbeat_interval_time),e&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},i.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},i.prototype.saveHeartBeatData=function(t){var e=this.getPageLeaveProperties(),a=new Date;e.$time=a,"is_first_heartbeat"===t&&(e.event_duration=3.14);var i=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:e});i.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,i)},i.prototype.delHeartBeatData=function(t){this._.localStorage.isSupport()&&this._.localStorage.remove(t||this.storage_name+"-"+this.page_id)},i.prototype.reissueHeartBeatData=function(){for(var t=window.localStorage.length,e=t-1;e>=0;e--){var a=window.localStorage.key(e);if(a&&a!==this.storage_name+"-"+this.page_id&&0===a.indexOf(this.storage_name+"-")){var i=this.sd.store.readObjectVal(a);this._.isObject(i)&&1*new Date-i.time>i.heartbeat_interval_time+5e3&&(delete i.heartbeat_interval_time,i._flush_time=(new Date).getTime(),this.sd.kit.sendData(i),this.delHeartBeatData(a))}}},i.prototype.getPageLeaveProperties=function(){var t=(+new Date-this.start_time)/1e3;(isNaN(t)||t<0||t>this.max_duration)&&(t=0),t=Number(t.toFixed(3));var e=this._.getReferrer(this.current_page_url),a=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;a=Math.round(a)||0;var i={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:e?this._.getHostname(e):"",$referrer:e,$viewport_position:a};return 0!==t&&(i.event_duration=t),i=this._.extend(i,this.option.custom_props)};var o=new i,h=a(o,"PageLeave","sdkReady");return h}(); \ No newline at end of file +!function(){"use strict";function t(t,a,i){if(a&&(t.plugin_name=a),i&&t.init){var r=t.init;t.init=function(n,s){function o(){r.call(t,n,s)}return e(n,t,a),n.readyState&&n.readyState.state>=3||!n.on?o():void n.on(i,o)}}return t}function e(t,e,a){function i(e,i){t.logger?t.logger.msg.apply(t.logger,i).module(a+""||"").level(e).log():t.log&&t.log.apply(t,i)}e.log=function(){i("log",arguments)},e.warn=function(){i("warn",arguments)},e.error=function(){i("error",arguments)}}function a(e,a,i){return t(e,a,i),e.plugin_version=r,e}function i(){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=s}var r="1.26.9",n=5e3,s=432e3;i.prototype.init=function(t,e){if(t){if(this.sd=t,this._=this.sd._,e){this.option=e;var a=e.heartbeat_interval_time;a&&(this._.isNumber(a)||this._.isNumber(1*a))&&1*a>0&&(this.heartbeat_interval_time=1e3*a);var i=e.max_duration;i&&(this._.isNumber(i)||this._.isNumber(1*i))&&1*i>0&&(this.max_duration=i)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},i.prototype.log=function(t){this.sd&&this.sd.log(t)},i.prototype.refreshPageEndTimer=function(){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){t.page_hidden_status=!1},n)},i.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},i.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},i.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var t=this.getPageLeaveProperties();this.page_show_status===!1&&delete t.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",t),this.refreshPageEndTimer(),this.delHeartBeatData()}},i.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},i.prototype.addPageStartListener=function(){var t=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){t.pageStartHandler(),t.hiddenStatusHandler()})},i.prototype.isCollectUrl=function(t){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof t||""===t||this.option.isCollectUrl(t))},i.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())})},i.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()})})},i.prototype.addPageSwitchListener=function(){var t=this;this._.listenPageState({visible:function(){t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval()},hidden:function(){t.url=location.href,t.title=document.title,t.pageEndHandler(),t.stopHeartBeatInterval()}})},i.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},i.prototype.startHeartBeatInterval=function(){var t=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var e=!0;this.isCollectUrl(this.url)||(e=!1),this.heartbeat_interval_timer=setInterval(function(){e&&t.saveHeartBeatData()},this.heartbeat_interval_time),e&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},i.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},i.prototype.saveHeartBeatData=function(t){var e=this.getPageLeaveProperties(),a=new Date;e.$time=a,"is_first_heartbeat"===t&&(e.event_duration=3.14);var i=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:e});i.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,i)},i.prototype.delHeartBeatData=function(t){this._.localStorage.isSupport()&&this._.localStorage.remove(t||this.storage_name+"-"+this.page_id)},i.prototype.reissueHeartBeatData=function(){for(var t=window.localStorage.length,e=t-1;e>=0;e--){var a=window.localStorage.key(e);if(a&&a!==this.storage_name+"-"+this.page_id&&0===a.indexOf(this.storage_name+"-")){var i=this.sd.store.readObjectVal(a);this._.isObject(i)&&1*new Date-i.time>i.heartbeat_interval_time+5e3&&(delete i.heartbeat_interval_time,i._flush_time=(new Date).getTime(),this.sd.kit.sendData(i),this.delHeartBeatData(a))}}},i.prototype.getPageLeaveProperties=function(){var t=(+new Date-this.start_time)/1e3;(isNaN(t)||t<0||t>this.max_duration)&&(t=0),t=Number(t.toFixed(3));var e=this._.getReferrer(this.current_page_url),a=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;a=Math.round(a)||0;var i={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:e?this._.getHostname(e):"",$referrer:e,$viewport_position:a};return 0!==t&&(i.event_duration=t),i=this._.extend(i,this.option.custom_props)};var o=new i,h=a(o,"PageLeave","sdkReady");return h}(); \ No newline at end of file diff --git a/dist/web/plugin/pageleave/index.es6.js b/dist/web/plugin/pageleave/index.es6.js index 39e144a8..6e89dce7 100644 --- a/dist/web/plugin/pageleave/index.es6.js +++ b/dist/web/plugin/pageleave/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.26.8";function wrapPluginInitFn(e,t,a){if(t&&(e.plugin_name=t),a&&e.init){var i=e.init;e.init=function(r,n){if(wrapLogFn(r,e,t),r.readyState&&r.readyState.state>=3||!r.on)return s();function s(){i.call(e,r,n)}r.on(a,s)}}return e}function wrapLogFn(e,t,a){function i(t,i){e.logger?e.logger.msg.apply(e.logger,i).module(a+""||"").level(t).log():e.log&&e.log.apply(e,i)}t.log=function(){i("log",arguments)},t.warn=function(){i("warn",arguments)},t.error=function(){i("error",arguments)}}function createPlugin(e,t,a){return wrapPluginInitFn(e,t,a),e.plugin_version=sdkversion_placeholder,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){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var a=t.heartbeat_interval_time;a&&(this._.isNumber(a)||this._.isNumber(1*a))&&1*a>0&&(this.heartbeat_interval_time=1e3*a);var i=t.max_duration;i&&(this._.isNumber(i)||this._.isNumber(1*i))&&1*i>0&&(this.max_duration=i)}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\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},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(){if(!0!==this.page_hidden_status){var 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 e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.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;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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(),a=new Date;t.$time=a,"is_first_heartbeat"===e&&(t.event_duration=3.14);var i=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});i.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,i)},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;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var a=this.sd.store.readObjectVal(t);this._.isObject(a)&&1*new Date-a.time>a.heartbeat_interval_time+5e3&&(delete a.heartbeat_interval_time,a._flush_time=(new Date).getTime(),this.sd.kit.sendData(a),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),a=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;a=Math.round(a)||0;var i={$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:a};return 0!==e&&(i.event_duration=e),i=this._.extend(i,this.option.custom_props)};var pageLeave=new PageLeave,index=createPlugin(pageLeave,"PageLeave","sdkReady");export default index; \ No newline at end of file +var sdkversion_placeholder="1.26.9";function wrapPluginInitFn(e,t,a){if(t&&(e.plugin_name=t),a&&e.init){var i=e.init;e.init=function(r,n){if(wrapLogFn(r,e,t),r.readyState&&r.readyState.state>=3||!r.on)return s();function s(){i.call(e,r,n)}r.on(a,s)}}return e}function wrapLogFn(e,t,a){function i(t,i){e.logger?e.logger.msg.apply(e.logger,i).module(a+""||"").level(t).log():e.log&&e.log.apply(e,i)}t.log=function(){i("log",arguments)},t.warn=function(){i("warn",arguments)},t.error=function(){i("error",arguments)}}function createPlugin(e,t,a){return wrapPluginInitFn(e,t,a),e.plugin_version=sdkversion_placeholder,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){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var a=t.heartbeat_interval_time;a&&(this._.isNumber(a)||this._.isNumber(1*a))&&1*a>0&&(this.heartbeat_interval_time=1e3*a);var i=t.max_duration;i&&(this._.isNumber(i)||this._.isNumber(1*i))&&1*i>0&&(this.max_duration=i)}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\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},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(){if(!0!==this.page_hidden_status){var 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 e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.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;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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(),a=new Date;t.$time=a,"is_first_heartbeat"===e&&(t.event_duration=3.14);var i=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});i.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,i)},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;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var a=this.sd.store.readObjectVal(t);this._.isObject(a)&&1*new Date-a.time>a.heartbeat_interval_time+5e3&&(delete a.heartbeat_interval_time,a._flush_time=(new Date).getTime(),this.sd.kit.sendData(a),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=this._.getReferrer(this.current_page_url),a=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;a=Math.round(a)||0;var i={$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:a};return 0!==e&&(i.event_duration=e),i=this._.extend(i,this.option.custom_props)};var pageLeave=new PageLeave,index=createPlugin(pageLeave,"PageLeave","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/pageleave/index.js b/dist/web/plugin/pageleave/index.js index 42e2a539..c1e5d201 100644 --- a/dist/web/plugin/pageleave/index.js +++ b/dist/web/plugin/pageleave/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).PageLeave=function(){"use strict";function t(t,a,i){if(a&&(t.plugin_name=a),i&&t.init){var r=t.init;t.init=function(n,s){function o(){r.call(t,n,s)}return e(n,t,a),n.readyState&&n.readyState.state>=3||!n.on?o():void n.on(i,o)}}return t}function e(t,e,a){function i(e,i){t.logger?t.logger.msg.apply(t.logger,i).module(a+""||"").level(e).log():t.log&&t.log.apply(t,i)}e.log=function(){i("log",arguments)},e.warn=function(){i("warn",arguments)},e.error=function(){i("error",arguments)}}function a(e,a,i){return t(e,a,i),e.plugin_version=r,e}function i(){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=s}var r="1.26.8",n=5e3,s=432e3;i.prototype.init=function(t,e){if(t){if(this.sd=t,this._=this.sd._,e){this.option=e;var a=e.heartbeat_interval_time;a&&(this._.isNumber(a)||this._.isNumber(1*a))&&1*a>0&&(this.heartbeat_interval_time=1e3*a);var i=e.max_duration;i&&(this._.isNumber(i)||this._.isNumber(1*i))&&1*i>0&&(this.max_duration=i)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},i.prototype.log=function(t){this.sd&&this.sd.log(t)},i.prototype.refreshPageEndTimer=function(){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){t.page_hidden_status=!1},n)},i.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},i.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},i.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var t=this.getPageLeaveProperties();this.page_show_status===!1&&delete t.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",t),this.refreshPageEndTimer(),this.delHeartBeatData()}},i.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},i.prototype.addPageStartListener=function(){var t=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){t.pageStartHandler(),t.hiddenStatusHandler()})},i.prototype.isCollectUrl=function(t){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof t||""===t||this.option.isCollectUrl(t))},i.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())})},i.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()})})},i.prototype.addPageSwitchListener=function(){var t=this;this._.listenPageState({visible:function(){t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval()},hidden:function(){t.url=location.href,t.title=document.title,t.pageEndHandler(),t.stopHeartBeatInterval()}})},i.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},i.prototype.startHeartBeatInterval=function(){var t=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var e=!0;this.isCollectUrl(this.url)||(e=!1),this.heartbeat_interval_timer=setInterval(function(){e&&t.saveHeartBeatData()},this.heartbeat_interval_time),e&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},i.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},i.prototype.saveHeartBeatData=function(t){var e=this.getPageLeaveProperties(),a=new Date;e.$time=a,"is_first_heartbeat"===t&&(e.event_duration=3.14);var i=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:e});i.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,i)},i.prototype.delHeartBeatData=function(t){this._.localStorage.isSupport()&&this._.localStorage.remove(t||this.storage_name+"-"+this.page_id)},i.prototype.reissueHeartBeatData=function(){for(var t=window.localStorage.length,e=t-1;e>=0;e--){var a=window.localStorage.key(e);if(a&&a!==this.storage_name+"-"+this.page_id&&0===a.indexOf(this.storage_name+"-")){var i=this.sd.store.readObjectVal(a);this._.isObject(i)&&1*new Date-i.time>i.heartbeat_interval_time+5e3&&(delete i.heartbeat_interval_time,i._flush_time=(new Date).getTime(),this.sd.kit.sendData(i),this.delHeartBeatData(a))}}},i.prototype.getPageLeaveProperties=function(){var t=(+new Date-this.start_time)/1e3;(isNaN(t)||t<0||t>this.max_duration)&&(t=0),t=Number(t.toFixed(3));var e=this._.getReferrer(this.current_page_url),a=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;a=Math.round(a)||0;var i={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:e?this._.getHostname(e):"",$referrer:e,$viewport_position:a};return 0!==t&&(i.event_duration=t),i=this._.extend(i,this.option.custom_props)};var o=new i,h=a(o,"PageLeave","sdkReady");return h}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).PageLeave=function(){"use strict";function t(t,a,i){if(a&&(t.plugin_name=a),i&&t.init){var r=t.init;t.init=function(n,s){function o(){r.call(t,n,s)}return e(n,t,a),n.readyState&&n.readyState.state>=3||!n.on?o():void n.on(i,o)}}return t}function e(t,e,a){function i(e,i){t.logger?t.logger.msg.apply(t.logger,i).module(a+""||"").level(e).log():t.log&&t.log.apply(t,i)}e.log=function(){i("log",arguments)},e.warn=function(){i("warn",arguments)},e.error=function(){i("error",arguments)}}function a(e,a,i){return t(e,a,i),e.plugin_version=r,e}function i(){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=s}var r="1.26.9",n=5e3,s=432e3;i.prototype.init=function(t,e){if(t){if(this.sd=t,this._=this.sd._,e){this.option=e;var a=e.heartbeat_interval_time;a&&(this._.isNumber(a)||this._.isNumber(1*a))&&1*a>0&&(this.heartbeat_interval_time=1e3*a);var i=e.max_duration;i&&(this._.isNumber(i)||this._.isNumber(1*i))&&1*i>0&&(this.max_duration=i)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},i.prototype.log=function(t){this.sd&&this.sd.log(t)},i.prototype.refreshPageEndTimer=function(){var t=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){t.page_hidden_status=!1},n)},i.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},i.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},i.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var t=this.getPageLeaveProperties();this.page_show_status===!1&&delete t.event_duration,this.page_show_status=!1,this.page_hidden_status=!0,this.isCollectUrl(this.url)&&this.sd.track("$WebPageLeave",t),this.refreshPageEndTimer(),this.delHeartBeatData()}},i.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},i.prototype.addPageStartListener=function(){var t=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){t.pageStartHandler(),t.hiddenStatusHandler()})},i.prototype.isCollectUrl=function(t){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof t||""===t||this.option.isCollectUrl(t))},i.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())})},i.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()})})},i.prototype.addPageSwitchListener=function(){var t=this;this._.listenPageState({visible:function(){t.pageStartHandler(),t.hiddenStatusHandler(),t.addHeartBeatInterval()},hidden:function(){t.url=location.href,t.title=document.title,t.pageEndHandler(),t.stopHeartBeatInterval()}})},i.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},i.prototype.startHeartBeatInterval=function(){var t=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var e=!0;this.isCollectUrl(this.url)||(e=!1),this.heartbeat_interval_timer=setInterval(function(){e&&t.saveHeartBeatData()},this.heartbeat_interval_time),e&&this.saveHeartBeatData("is_first_heartbeat"),this.reissueHeartBeatData()},i.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},i.prototype.saveHeartBeatData=function(t){var e=this.getPageLeaveProperties(),a=new Date;e.$time=a,"is_first_heartbeat"===t&&(e.event_duration=3.14);var i=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:e});i.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,i)},i.prototype.delHeartBeatData=function(t){this._.localStorage.isSupport()&&this._.localStorage.remove(t||this.storage_name+"-"+this.page_id)},i.prototype.reissueHeartBeatData=function(){for(var t=window.localStorage.length,e=t-1;e>=0;e--){var a=window.localStorage.key(e);if(a&&a!==this.storage_name+"-"+this.page_id&&0===a.indexOf(this.storage_name+"-")){var i=this.sd.store.readObjectVal(a);this._.isObject(i)&&1*new Date-i.time>i.heartbeat_interval_time+5e3&&(delete i.heartbeat_interval_time,i._flush_time=(new Date).getTime(),this.sd.kit.sendData(i),this.delHeartBeatData(a))}}},i.prototype.getPageLeaveProperties=function(){var t=(+new Date-this.start_time)/1e3;(isNaN(t)||t<0||t>this.max_duration)&&(t=0),t=Number(t.toFixed(3));var e=this._.getReferrer(this.current_page_url),a=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body&&document.body.scrollTop||0;a=Math.round(a)||0;var i={$title:this.title,$url:this._.getURL(this.url),$url_path:this._.getURLPath(this._.URL(this.url).pathname),$referrer_host:e?this._.getHostname(e):"",$referrer:e,$viewport_position:a};return 0!==t&&(i.event_duration=t),i=this._.extend(i,this.option.custom_props)};var o=new i,h=a(o,"PageLeave","sdkReady");return h}(); \ No newline at end of file diff --git a/dist/web/plugin/pageload/index.closure.js b/dist/web/plugin/pageload/index.closure.js index b8fb4519..5d1dc563 100644 --- a/dist/web/plugin/pageload/index.closure.js +++ b/dist/web/plugin/pageload/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var o=e.init;e.init=function(i,a){function d(){o.call(e,i,a)}return n(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?d():void i.on(r,d)}}return e}function n(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function t(n,t,o){return e(n,t,o),n.plugin_version=r,n}var r="1.26.8",o=!1,i={init:function(e,n){function t(n,t){if(n.getEntries&&"function"==typeof n.getEntries){for(var r=n.getEntries(),o=null,i=0;i=0&&o<10737418240&&(t.$page_resource_size=Number((o/1024).toFixed(3)))}}function r(n){var t=0;if(n.timing){var r=n.timing;0!==r.fetchStart&&e._.isNumber(r.fetchStart)&&0!==r.domContentLoadedEventEnd&&e._.isNumber(r.domContentLoadedEventEnd)?t=r.domContentLoadedEventEnd-r.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return t}function i(n){var t=0;if(e._.isFunction(n.getEntriesByType)){var r=n.getEntriesByType("navigation")||[{}];t=(r[0]||{}).domContentLoadedEventEnd||0}return t}function a(){var d=0,u=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,c={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(u?(d=i(u)||r(u),t(u,c)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),d>0){var f=e._.isObject(n)&&n.max_duration||1800;d=Number((d/1e3).toFixed(3)),(!e._.isNumber(f)||f<=0||d<=f)&&(c.event_duration=d)}o||(e.track("$WebPageLoad",c),o=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},a=t(i,"PageLoad","sdkReady");return a}(); \ No newline at end of file +!function(){"use strict";function e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var o=e.init;e.init=function(i,a){function d(){o.call(e,i,a)}return n(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?d():void i.on(r,d)}}return e}function n(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function t(n,t,o){return e(n,t,o),n.plugin_version=r,n}var r="1.26.9",o=!1,i={init:function(e,n){function t(n,t){if(n.getEntries&&"function"==typeof n.getEntries){for(var r=n.getEntries(),o=null,i=0;i=0&&o<10737418240&&(t.$page_resource_size=Number((o/1024).toFixed(3)))}}function r(n){var t=0;if(n.timing){var r=n.timing;0!==r.fetchStart&&e._.isNumber(r.fetchStart)&&0!==r.domContentLoadedEventEnd&&e._.isNumber(r.domContentLoadedEventEnd)?t=r.domContentLoadedEventEnd-r.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return t}function i(n){var t=0;if(e._.isFunction(n.getEntriesByType)){var r=n.getEntriesByType("navigation")||[{}];t=(r[0]||{}).domContentLoadedEventEnd||0}return t}function a(){var d=0,u=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,c={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(u?(d=i(u)||r(u),t(u,c)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),d>0){var f=e._.isObject(n)&&n.max_duration||1800;d=Number((d/1e3).toFixed(3)),(!e._.isNumber(f)||f<=0||d<=f)&&(c.event_duration=d)}o||(e.track("$WebPageLoad",c),o=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},a=t(i,"PageLoad","sdkReady");return a}(); \ No newline at end of file diff --git a/dist/web/plugin/pageload/index.es6.js b/dist/web/plugin/pageload/index.es6.js index a9bb4e2b..382890a2 100644 --- a/dist/web/plugin/pageload/index.es6.js +++ b/dist/web/plugin/pageload/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.26.8";function wrapPluginInitFn(e,n,t){if(n&&(e.plugin_name=n),t&&e.init){var r=e.init;e.init=function(o,i){if(wrapLogFn(o,e,n),o.readyState&&o.readyState.state>=3||!o.on)return a();function a(){r.call(e,o,i)}o.on(t,a)}}return e}function wrapLogFn(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function createPlugin(e,n,t){return wrapPluginInitFn(e,n,t),e.plugin_version=sdkversion_placeholder,e}var eventSent=!1,PageLoad={init:function(e,n){function t(){var r=0,o=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,i={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(o?(r=function(n){var t=0;return e._.isFunction(n.getEntriesByType)&&(t=((n.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),t}(o)||function(n){var t=0;if(n.timing){var r=n.timing;0!==r.fetchStart&&e._.isNumber(r.fetchStart)&&0!==r.domContentLoadedEventEnd&&e._.isNumber(r.domContentLoadedEventEnd)?t=r.domContentLoadedEventEnd-r.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return t}(o),function(n,t){if(n.getEntries&&"function"==typeof n.getEntries){for(var r=n.getEntries(),o=null,i=0;i=0&&o<10737418240&&(t.$page_resource_size=Number((o/1024).toFixed(3)))}}(o,i)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),r>0){var a=e._.isObject(n)&&n.max_duration||1800;r=Number((r/1e3).toFixed(3)),(!e._.isNumber(a)||a<=0||r<=a)&&(i.event_duration=r)}eventSent||(e.track("$WebPageLoad",i),eventSent=!0),window.removeEventListener?window.removeEventListener("load",t):window.detachEvent&&window.detachEvent("onload",t)}"complete"==document.readyState?t():window.addEventListener?window.addEventListener("load",t):window.attachEvent&&window.attachEvent("onload",t)}},index=createPlugin(PageLoad,"PageLoad","sdkReady");export default index; \ No newline at end of file +var sdkversion_placeholder="1.26.9";function wrapPluginInitFn(e,n,t){if(n&&(e.plugin_name=n),t&&e.init){var r=e.init;e.init=function(o,i){if(wrapLogFn(o,e,n),o.readyState&&o.readyState.state>=3||!o.on)return a();function a(){r.call(e,o,i)}o.on(t,a)}}return e}function wrapLogFn(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function createPlugin(e,n,t){return wrapPluginInitFn(e,n,t),e.plugin_version=sdkversion_placeholder,e}var eventSent=!1,PageLoad={init:function(e,n){function t(){var r=0,o=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,i={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(o?(r=function(n){var t=0;return e._.isFunction(n.getEntriesByType)&&(t=((n.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),t}(o)||function(n){var t=0;if(n.timing){var r=n.timing;0!==r.fetchStart&&e._.isNumber(r.fetchStart)&&0!==r.domContentLoadedEventEnd&&e._.isNumber(r.domContentLoadedEventEnd)?t=r.domContentLoadedEventEnd-r.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return t}(o),function(n,t){if(n.getEntries&&"function"==typeof n.getEntries){for(var r=n.getEntries(),o=null,i=0;i=0&&o<10737418240&&(t.$page_resource_size=Number((o/1024).toFixed(3)))}}(o,i)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),r>0){var a=e._.isObject(n)&&n.max_duration||1800;r=Number((r/1e3).toFixed(3)),(!e._.isNumber(a)||a<=0||r<=a)&&(i.event_duration=r)}eventSent||(e.track("$WebPageLoad",i),eventSent=!0),window.removeEventListener?window.removeEventListener("load",t):window.detachEvent&&window.detachEvent("onload",t)}"complete"==document.readyState?t():window.addEventListener?window.addEventListener("load",t):window.attachEvent&&window.attachEvent("onload",t)}},index=createPlugin(PageLoad,"PageLoad","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/pageload/index.js b/dist/web/plugin/pageload/index.js index 1e8b1436..dad04c3a 100644 --- a/dist/web/plugin/pageload/index.js +++ b/dist/web/plugin/pageload/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).PageLoad=function(){"use strict";function e(e,t,o){if(t&&(e.plugin_name=t),o&&e.init){var r=e.init;e.init=function(i,a){function d(){r.call(e,i,a)}return n(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?d():void i.on(o,d)}}return e}function n(e,n,t){function o(n,o){e.logger?e.logger.msg.apply(e.logger,o).module(t+""||"").level(n).log():e.log&&e.log.apply(e,o)}n.log=function(){o("log",arguments)},n.warn=function(){o("warn",arguments)},n.error=function(){o("error",arguments)}}function t(n,t,r){return e(n,t,r),n.plugin_version=o,n}var o="1.26.8",r=!1,i={init:function(e,n){function t(n,t){if(n.getEntries&&"function"==typeof n.getEntries){for(var o=n.getEntries(),r=null,i=0;i=0&&r<10737418240&&(t.$page_resource_size=Number((r/1024).toFixed(3)))}}function o(n){var t=0;if(n.timing){var o=n.timing;0!==o.fetchStart&&e._.isNumber(o.fetchStart)&&0!==o.domContentLoadedEventEnd&&e._.isNumber(o.domContentLoadedEventEnd)?t=o.domContentLoadedEventEnd-o.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return t}function i(n){var t=0;if(e._.isFunction(n.getEntriesByType)){var o=n.getEntriesByType("navigation")||[{}];t=(o[0]||{}).domContentLoadedEventEnd||0}return t}function a(){var d=0,u=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,c={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(u?(d=i(u)||o(u),t(u,c)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),d>0){var f=e._.isObject(n)&&n.max_duration||1800;d=Number((d/1e3).toFixed(3)),(!e._.isNumber(f)||f<=0||d<=f)&&(c.event_duration=d)}r||(e.track("$WebPageLoad",c),r=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},a=t(i,"PageLoad","sdkReady");return a}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).PageLoad=function(){"use strict";function e(e,t,o){if(t&&(e.plugin_name=t),o&&e.init){var r=e.init;e.init=function(i,a){function d(){r.call(e,i,a)}return n(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?d():void i.on(o,d)}}return e}function n(e,n,t){function o(n,o){e.logger?e.logger.msg.apply(e.logger,o).module(t+""||"").level(n).log():e.log&&e.log.apply(e,o)}n.log=function(){o("log",arguments)},n.warn=function(){o("warn",arguments)},n.error=function(){o("error",arguments)}}function t(n,t,r){return e(n,t,r),n.plugin_version=o,n}var o="1.26.9",r=!1,i={init:function(e,n){function t(n,t){if(n.getEntries&&"function"==typeof n.getEntries){for(var o=n.getEntries(),r=null,i=0;i=0&&r<10737418240&&(t.$page_resource_size=Number((r/1024).toFixed(3)))}}function o(n){var t=0;if(n.timing){var o=n.timing;0!==o.fetchStart&&e._.isNumber(o.fetchStart)&&0!==o.domContentLoadedEventEnd&&e._.isNumber(o.domContentLoadedEventEnd)?t=o.domContentLoadedEventEnd-o.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return t}function i(n){var t=0;if(e._.isFunction(n.getEntriesByType)){var o=n.getEntriesByType("navigation")||[{}];t=(o[0]||{}).domContentLoadedEventEnd||0}return t}function a(){var d=0,u=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,c={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(u?(d=i(u)||o(u),t(u,c)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),d>0){var f=e._.isObject(n)&&n.max_duration||1800;d=Number((d/1e3).toFixed(3)),(!e._.isNumber(f)||f<=0||d<=f)&&(c.event_duration=d)}r||(e.track("$WebPageLoad",c),r=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},a=t(i,"PageLoad","sdkReady");return a}(); \ No newline at end of file diff --git a/dist/web/plugin/register-properties/index.closure.js b/dist/web/plugin/register-properties/index.closure.js index bd911b02..03838070 100644 --- a/dist/web/plugin/register-properties/index.closure.js +++ b/dist/web/plugin/register-properties/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function t(t,e){if("track"!==t.type)return t;var i=e.sd,r=i._,o=i.saEvent.check,n=r.extend2Lev({properties:{}},t),s=e.customRegister,p=n.properties,u=n.event,c={};return r.each(s,function(t){if(r.isObject(t))r.indexOf(t.events,u)>-1&&o({properties:t.properties})&&(c=r.extend(c,t.properties));else if(r.isFunction(t)){var e=t({event:u,properties:p,data:n});r.isObject(e)&&!r.isEmptyObject(e)&&o({properties:e})&&(c=r.extend(c,e))}}),t.properties=r.extend(p,c),t}function e(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function i(t,e,i){if(e&&(t.plugin_name=e),i&&t.init){var o=t.init;t.init=function(n,s){function p(){o.call(t,n,s)}return r(n,t,e),n.readyState&&n.readyState.state>=3||!n.on?p():void n.on(i,p)}}return t}function r(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function o(t,e,r){return i(t,e,r),t.plugin_version=n,t}e.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var i=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return t(e,i)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},e.prototype.register=function(t){return this.sd?void(this._.isObject(t)&&this._.isArray(t.events)&&t.events.length>0&&this._.isObject(t.properties)&&!this._.isEmptyObject(t.properties)?this.customRegister.push(t):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},e.prototype.hookRegister=function(t){return this.sd?void(this._.isFunction(t)?this.customRegister.push(t):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var n="1.26.8";e.prototype.plugin_name="RegisterProperties";var s=new e,p=o(s);return p}(); \ No newline at end of file +!function(){"use strict";function t(t,e){if("track"!==t.type)return t;var i=e.sd,r=i._,o=i.saEvent.check,n=r.extend2Lev({properties:{}},t),s=e.customRegister,p=n.properties,u=n.event,c={};return r.each(s,function(t){if(r.isObject(t))r.indexOf(t.events,u)>-1&&o({properties:t.properties})&&(c=r.extend(c,t.properties));else if(r.isFunction(t)){var e=t({event:u,properties:p,data:n});r.isObject(e)&&!r.isEmptyObject(e)&&o({properties:e})&&(c=r.extend(c,e))}}),t.properties=r.extend(p,c),t}function e(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function i(t,e,i){if(e&&(t.plugin_name=e),i&&t.init){var o=t.init;t.init=function(n,s){function p(){o.call(t,n,s)}return r(n,t,e),n.readyState&&n.readyState.state>=3||!n.on?p():void n.on(i,p)}}return t}function r(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function o(t,e,r){return i(t,e,r),t.plugin_version=n,t}e.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var i=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return t(e,i)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},e.prototype.register=function(t){return this.sd?void(this._.isObject(t)&&this._.isArray(t.events)&&t.events.length>0&&this._.isObject(t.properties)&&!this._.isEmptyObject(t.properties)?this.customRegister.push(t):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},e.prototype.hookRegister=function(t){return this.sd?void(this._.isFunction(t)?this.customRegister.push(t):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var n="1.26.9";e.prototype.plugin_name="RegisterProperties";var s=new e,p=o(s);return p}(); \ No newline at end of file diff --git a/dist/web/plugin/register-properties/index.es6.js b/dist/web/plugin/register-properties/index.es6.js index 70baa437..0d525cb1 100644 --- a/dist/web/plugin/register-properties/index.es6.js +++ b/dist/web/plugin/register-properties/index.es6.js @@ -1 +1 @@ -function addProperties(e,t){if("track"!==e.type)return e;var i=t.sd,r=i._,s=i.saEvent.check,n=r.extend2Lev({properties:{}},e),o=t.customRegister,p=n.properties,g=n.event,l={};return r.each(o,function(e){if(r.isObject(e))r.indexOf(e.events,g)>-1&&s({properties:e.properties})&&(l=r.extend(l,e.properties));else if(r.isFunction(e)){var t=e({event:g,properties:p,data:n});r.isObject(t)&&!r.isEmptyObject(t)&&s({properties:t})&&(l=r.extend(l,t))}}),e.properties=r.extend(p,l),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder="1.26.8";function wrapPluginInitFn(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var r=e.init;e.init=function(s,n){if(wrapLogFn(s,e,t),s.readyState&&s.readyState.state>=3||!s.on)return o();function o(){r.call(e,s,n)}s.on(i,o)}}return e}function wrapLogFn(e,t,i){function r(t,r){e.logger?e.logger.msg.apply(e.logger,r).module(i+""||"").level(t).log():e.log&&e.log.apply(e,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function createPlugin(e,t,i){return wrapPluginInitFn(e,t,i),e.plugin_version=sdkversion_placeholder,e}RegisterProperties.prototype.plugin_name="RegisterProperties";var instance=new RegisterProperties,index=createPlugin(instance);export default index; \ No newline at end of file +function addProperties(e,t){if("track"!==e.type)return e;var i=t.sd,r=i._,s=i.saEvent.check,n=r.extend2Lev({properties:{}},e),o=t.customRegister,p=n.properties,g=n.event,l={};return r.each(o,function(e){if(r.isObject(e))r.indexOf(e.events,g)>-1&&s({properties:e.properties})&&(l=r.extend(l,e.properties));else if(r.isFunction(e)){var t=e({event:g,properties:p,data:n});r.isObject(t)&&!r.isEmptyObject(t)&&s({properties:t})&&(l=r.extend(l,t))}}),e.properties=r.extend(p,l),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder="1.26.9";function wrapPluginInitFn(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var r=e.init;e.init=function(s,n){if(wrapLogFn(s,e,t),s.readyState&&s.readyState.state>=3||!s.on)return o();function o(){r.call(e,s,n)}s.on(i,o)}}return e}function wrapLogFn(e,t,i){function r(t,r){e.logger?e.logger.msg.apply(e.logger,r).module(i+""||"").level(t).log():e.log&&e.log.apply(e,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function createPlugin(e,t,i){return wrapPluginInitFn(e,t,i),e.plugin_version=sdkversion_placeholder,e}RegisterProperties.prototype.plugin_name="RegisterProperties";var instance=new RegisterProperties,index=createPlugin(instance);export default index; \ No newline at end of file diff --git a/dist/web/plugin/register-properties/index.js b/dist/web/plugin/register-properties/index.js index 98b2bff8..98af562b 100644 --- a/dist/web/plugin/register-properties/index.js +++ b/dist/web/plugin/register-properties/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).RegisterProperties=function(){"use strict";function e(e,t){if("track"!==e.type)return e;var i=t.sd,r=i._,o=i.saEvent.check,n=r.extend2Lev({properties:{}},e),s=t.customRegister,p=n.properties,u=n.event,g={};return r.each(s,function(e){if(r.isObject(e))r.indexOf(e.events,u)>-1&&o({properties:e.properties})&&(g=r.extend(g,e.properties));else if(r.isFunction(e)){var t=e({event:u,properties:p,data:n});r.isObject(t)&&!r.isEmptyObject(t)&&o({properties:t})&&(g=r.extend(g,t))}}),e.properties=r.extend(p,g),e}function t(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function i(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var o=e.init;e.init=function(n,s){function p(){o.call(e,n,s)}return r(n,e,t),n.readyState&&n.readyState.state>=3||!n.on?p():void n.on(i,p)}}return e}function r(e,t,i){function r(t,r){e.logger?e.logger.msg.apply(e.logger,r).module(i+""||"").level(t).log():e.log&&e.log.apply(e,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function o(e,t,r){return i(e,t,r),e.plugin_version=n,e}t.prototype.init=function(t){if(t){this.sd=t,this._=t._,this.log=t.log;var i=this;t.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(t){return e(t,i)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},t.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},t.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var n="1.26.8";t.prototype.plugin_name="RegisterProperties";var s=new t,p=o(s);return p}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).RegisterProperties=function(){"use strict";function e(e,t){if("track"!==e.type)return e;var i=t.sd,r=i._,o=i.saEvent.check,n=r.extend2Lev({properties:{}},e),s=t.customRegister,p=n.properties,u=n.event,g={};return r.each(s,function(e){if(r.isObject(e))r.indexOf(e.events,u)>-1&&o({properties:e.properties})&&(g=r.extend(g,e.properties));else if(r.isFunction(e)){var t=e({event:u,properties:p,data:n});r.isObject(t)&&!r.isEmptyObject(t)&&o({properties:t})&&(g=r.extend(g,t))}}),e.properties=r.extend(p,g),e}function t(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function i(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var o=e.init;e.init=function(n,s){function p(){o.call(e,n,s)}return r(n,e,t),n.readyState&&n.readyState.state>=3||!n.on?p():void n.on(i,p)}}return e}function r(e,t,i){function r(t,r){e.logger?e.logger.msg.apply(e.logger,r).module(i+""||"").level(t).log():e.log&&e.log.apply(e,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function o(e,t,r){return i(e,t,r),e.plugin_version=n,e}t.prototype.init=function(t){if(t){this.sd=t,this._=t._,this.log=t.log;var i=this;t.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(t){return e(t,i)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},t.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},t.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var n="1.26.9";t.prototype.plugin_name="RegisterProperties";var s=new t,p=o(s);return p}(); \ No newline at end of file diff --git a/dist/web/plugin/register-property-page-height/index.closure.js b/dist/web/plugin/register-property-page-height/index.closure.js index 65e1bef2..1bc7b9a9 100644 --- a/dist/web/plugin/register-property-page-height/index.closure.js +++ b/dist/web/plugin/register-property-page-height/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,i,n){if(i&&(e.plugin_name=i),n&&e.init){var o=e.init;e.init=function(r,g){function l(){o.call(e,r,g)}return t(r,e,i),r.readyState&&r.readyState.state>=3||!r.on?l():void r.on(n,l)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=g,t}function n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,i=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,i)||0};e.properties=o._.extend(e.properties||{},n)}}catch(g){l("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return r.call(o.kit,e)}var o,r,g="1.26.8",l=window.console&&window.console.log||function(){},a={init:function(e){return o=e,l=o&&o.log||l,e&&e.kit&&e.kit.buildData?(r=o.kit.buildData,o.kit.buildData=n,void l("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void l("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},u=i(a,"RegisterPropertyPageHeight","sdkReady");return u}(); \ No newline at end of file +!function(){"use strict";function e(e,i,n){if(i&&(e.plugin_name=i),n&&e.init){var o=e.init;e.init=function(r,g){function l(){o.call(e,r,g)}return t(r,e,i),r.readyState&&r.readyState.state>=3||!r.on?l():void r.on(n,l)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=g,t}function n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,i=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,i)||0};e.properties=o._.extend(e.properties||{},n)}}catch(g){l("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return r.call(o.kit,e)}var o,r,g="1.26.9",l=window.console&&window.console.log||function(){},a={init:function(e){return o=e,l=o&&o.log||l,e&&e.kit&&e.kit.buildData?(r=o.kit.buildData,o.kit.buildData=n,void l("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void l("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},u=i(a,"RegisterPropertyPageHeight","sdkReady");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/register-property-page-height/index.es6.js b/dist/web/plugin/register-property-page-height/index.es6.js index 7e8cb43b..38605bac 100644 --- a/dist/web/plugin/register-property-page-height/index.es6.js +++ b/dist/web/plugin/register-property-page-height/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.26.8";function wrapPluginInitFn(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var n=e.init;e.init=function(o,r){if(wrapLogFn(o,e,t),o.readyState&&o.readyState.state>=3||!o.on)return l();function l(){n.call(e,o,r)}o.on(i,l)}}return e}function wrapLogFn(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,i){return wrapPluginInitFn(e,t,i),e.plugin_version=sdkversion_placeholder,e}var _sd,_oldBuildData,_log=window.console&&window.console.log||function(){};function buildData(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,i=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,i)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(o){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}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 \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index=createPlugin(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady");export default index; \ No newline at end of file +var sdkversion_placeholder="1.26.9";function wrapPluginInitFn(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var n=e.init;e.init=function(o,r){if(wrapLogFn(o,e,t),o.readyState&&o.readyState.state>=3||!o.on)return l();function l(){n.call(e,o,r)}o.on(i,l)}}return e}function wrapLogFn(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,i){return wrapPluginInitFn(e,t,i),e.plugin_version=sdkversion_placeholder,e}var _sd,_oldBuildData,_log=window.console&&window.console.log||function(){};function buildData(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,i=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,i)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(o){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}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 \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index=createPlugin(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/register-property-page-height/index.js b/dist/web/plugin/register-property-page-height/index.js index 1575dc98..96fabf65 100644 --- a/dist/web/plugin/register-property-page-height/index.js +++ b/dist/web/plugin/register-property-page-height/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).RegisterPropertyPageHeight=function(){"use strict";function e(e,i,n){if(i&&(e.plugin_name=i),n&&e.init){var o=e.init;e.init=function(r,g){function a(){o.call(e,r,g)}return t(r,e,i),r.readyState&&r.readyState.state>=3||!r.on?a():void r.on(n,a)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=g,t}function n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,i=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,i)||0};e.properties=o._.extend(e.properties||{},n)}}catch(g){a("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return r.call(o.kit,e)}var o,r,g="1.26.8",a=window.console&&window.console.log||function(){},l={init:function(e){return o=e,a=o&&o.log||a,e&&e.kit&&e.kit.buildData?(r=o.kit.buildData,o.kit.buildData=n,void a("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void a("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},u=i(l,"RegisterPropertyPageHeight","sdkReady");return u}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).RegisterPropertyPageHeight=function(){"use strict";function e(e,i,n){if(i&&(e.plugin_name=i),n&&e.init){var o=e.init;e.init=function(r,g){function a(){o.call(e,r,g)}return t(r,e,i),r.readyState&&r.readyState.state>=3||!r.on?a():void r.on(n,a)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=g,t}function n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,i=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,i)||0};e.properties=o._.extend(e.properties||{},n)}}catch(g){a("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return r.call(o.kit,e)}var o,r,g="1.26.9",a=window.console&&window.console.log||function(){},l={init:function(e){return o=e,a=o&&o.log||a,e&&e.kit&&e.kit.buildData?(r=o.kit.buildData,o.kit.buildData=n,void a("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void a("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},u=i(l,"RegisterPropertyPageHeight","sdkReady");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/sat-props-patch/index.closure.js b/dist/web/plugin/sat-props-patch/index.closure.js index 7f8b79a3..5a7e841f 100644 --- a/dist/web/plugin/sat-props-patch/index.closure.js +++ b/dist/web/plugin/sat-props-patch/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(i,_){function l(){r.call(n,i,_)}return t(i,n,a),i.readyState&&i.readyState.state>=3||!i.on?l():void i.on(e,l)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=i,t}function e(n){if(n.properties){var t=n.properties;r.each(l,function(n,a){r.isUndefined(t[a])||(t[n]=t[a],delete t[a])})}}var r,i="1.26.8",_={init:function(n){r=n._,n.registerInterceptor("buildDataStage",{formatData:{entry:function(n){return e(n),n}}})}},l={_latest_wx_ad_click_id:"$latest_wx_ad_click_id",_latest_wx_ad_callbacks:"$latest_wx_ad_callbacks",_latest_wx_ad_hash_key:"$latest_wx_ad_hash_key",_sa_channel_landing_url:"$ad_landing_page_url",_sa_channel_landing_url_error:"$sa_channel_landing_url_error"},o=a(_,"SatPropsPatch","sdkAfterInitPara");return o}(); \ No newline at end of file +!function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(i,_){function l(){r.call(n,i,_)}return t(i,n,a),i.readyState&&i.readyState.state>=3||!i.on?l():void i.on(e,l)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=i,t}function e(n){if(n.properties){var t=n.properties;r.each(l,function(n,a){r.isUndefined(t[a])||(t[n]=t[a],delete t[a])})}}var r,i="1.26.9",_={init:function(n){r=n._,n.registerInterceptor("buildDataStage",{formatData:{entry:function(n){return e(n),n}}})}},l={_latest_wx_ad_click_id:"$latest_wx_ad_click_id",_latest_wx_ad_callbacks:"$latest_wx_ad_callbacks",_latest_wx_ad_hash_key:"$latest_wx_ad_hash_key",_sa_channel_landing_url:"$ad_landing_page_url",_sa_channel_landing_url_error:"$sa_channel_landing_url_error"},o=a(_,"SatPropsPatch","sdkAfterInitPara");return o}(); \ No newline at end of file diff --git a/dist/web/plugin/sat-props-patch/index.es6.js b/dist/web/plugin/sat-props-patch/index.es6.js index 2b3f4954..88f31ebb 100644 --- a/dist/web/plugin/sat-props-patch/index.es6.js +++ b/dist/web/plugin/sat-props-patch/index.es6.js @@ -1 +1 @@ -var _,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(t,i){if(wrapLogFn(t,n,a),t.readyState&&t.readyState.state>=3||!t.on)return l();function l(){r.call(n,t,i)}t.on(e,l)}}return n}function wrapLogFn(n,a,e){function r(a,r){n.logger?n.logger.msg.apply(n.logger,r).module(e+""||"").level(a).log():n.log&&n.log.apply(n,r)}a.log=function(){r("log",arguments)},a.warn=function(){r("warn",arguments)},a.error=function(){r("error",arguments)}}function createPlugin(n,a,e){return wrapPluginInitFn(n,a,e),n.plugin_version=sdkversion_placeholder,n}var plugin={init:function(n){_=n._,n.registerInterceptor("buildDataStage",{formatData:{entry:function(n){return convertSatPropsName(n),n}}})}},pMap={_latest_wx_ad_click_id:"$latest_wx_ad_click_id",_latest_wx_ad_callbacks:"$latest_wx_ad_callbacks",_latest_wx_ad_hash_key:"$latest_wx_ad_hash_key",_sa_channel_landing_url:"$ad_landing_page_url",_sa_channel_landing_url_error:"$sa_channel_landing_url_error"};function convertSatPropsName(n){if(n.properties){var a=n.properties;_.each(pMap,function(n,e){_.isUndefined(a[e])||(a[n]=a[e],delete a[e])})}}var index=createPlugin(plugin,"SatPropsPatch","sdkAfterInitPara");export default index; \ No newline at end of file +var _,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(t,i){if(wrapLogFn(t,n,a),t.readyState&&t.readyState.state>=3||!t.on)return l();function l(){r.call(n,t,i)}t.on(e,l)}}return n}function wrapLogFn(n,a,e){function r(a,r){n.logger?n.logger.msg.apply(n.logger,r).module(e+""||"").level(a).log():n.log&&n.log.apply(n,r)}a.log=function(){r("log",arguments)},a.warn=function(){r("warn",arguments)},a.error=function(){r("error",arguments)}}function createPlugin(n,a,e){return wrapPluginInitFn(n,a,e),n.plugin_version=sdkversion_placeholder,n}var plugin={init:function(n){_=n._,n.registerInterceptor("buildDataStage",{formatData:{entry:function(n){return convertSatPropsName(n),n}}})}},pMap={_latest_wx_ad_click_id:"$latest_wx_ad_click_id",_latest_wx_ad_callbacks:"$latest_wx_ad_callbacks",_latest_wx_ad_hash_key:"$latest_wx_ad_hash_key",_sa_channel_landing_url:"$ad_landing_page_url",_sa_channel_landing_url_error:"$sa_channel_landing_url_error"};function convertSatPropsName(n){if(n.properties){var a=n.properties;_.each(pMap,function(n,e){_.isUndefined(a[e])||(a[n]=a[e],delete a[e])})}}var index=createPlugin(plugin,"SatPropsPatch","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/sat-props-patch/index.js b/dist/web/plugin/sat-props-patch/index.js index 649ee785..2c84c803 100644 --- a/dist/web/plugin/sat-props-patch/index.js +++ b/dist/web/plugin/sat-props-patch/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SatPropsPatch=function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(i,l){function _(){r.call(n,i,l)}return t(i,n,a),i.readyState&&i.readyState.state>=3||!i.on?_():void i.on(e,_)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=i,t}function e(n){if(n.properties){var t=n.properties;r.each(_,function(n,a){r.isUndefined(t[a])||(t[n]=t[a],delete t[a])})}}var r,i="1.26.8",l={init:function(n){r=n._,n.registerInterceptor("buildDataStage",{formatData:{entry:function(n){return e(n),n}}})}},_={_latest_wx_ad_click_id:"$latest_wx_ad_click_id",_latest_wx_ad_callbacks:"$latest_wx_ad_callbacks",_latest_wx_ad_hash_key:"$latest_wx_ad_hash_key",_sa_channel_landing_url:"$ad_landing_page_url",_sa_channel_landing_url_error:"$sa_channel_landing_url_error"},o=a(l,"SatPropsPatch","sdkAfterInitPara");return o}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SatPropsPatch=function(){"use strict";function n(n,a,e){if(a&&(n.plugin_name=a),e&&n.init){var r=n.init;n.init=function(i,l){function _(){r.call(n,i,l)}return t(i,n,a),i.readyState&&i.readyState.state>=3||!i.on?_():void i.on(e,_)}}return n}function t(n,t,a){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(a+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function a(t,a,e){return n(t,a,e),t.plugin_version=i,t}function e(n){if(n.properties){var t=n.properties;r.each(_,function(n,a){r.isUndefined(t[a])||(t[n]=t[a],delete t[a])})}}var r,i="1.26.9",l={init:function(n){r=n._,n.registerInterceptor("buildDataStage",{formatData:{entry:function(n){return e(n),n}}})}},_={_latest_wx_ad_click_id:"$latest_wx_ad_click_id",_latest_wx_ad_callbacks:"$latest_wx_ad_callbacks",_latest_wx_ad_hash_key:"$latest_wx_ad_hash_key",_sa_channel_landing_url:"$ad_landing_page_url",_sa_channel_landing_url_error:"$sa_channel_landing_url_error"},o=a(l,"SatPropsPatch","sdkAfterInitPara");return o}(); \ No newline at end of file diff --git a/dist/web/plugin/session-event/index.closure.js b/dist/web/plugin/session-event/index.closure.js index 5f8f8c64..bbc5f4c4 100644 --- a/dist/web/plugin/session-event/index.closure.js +++ b/dist/web/plugin/session-event/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function t(t,i,s){if(i&&(t.plugin_name=i),s&&t.init){var o=t.init;t.init=function(r,n){function p(){o.call(t,r,n)}return e(r,t,i),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(s,p)}}return t}function e(t,e,i){function s(e,s){t.logger?t.logger.msg.apply(t.logger,s).module(i+""||"").level(e).log():t.log&&t.log.apply(t,s)}e.log=function(){s("log",arguments)},e.warn=function(){s("warn",arguments)},e.error=function(){s("error",arguments)}}function i(e,i,s){return t(e,i,s),e.plugin_version=p,e}function s(t,e){if("track"!==t.type)return t;var i=e.sd,s=i._,o=i.saEvent.check,r=s.extend2Lev({properties:{}},t),n=e.customRegister,p=r.properties,h=r.event,c={};return s.each(n,function(t){if(s.isObject(t))s.indexOf(t.events,h)>-1&&o({properties:t.properties})&&(c=s.extend(c,t.properties));else if(s.isFunction(t)){var e=t({event:h,properties:p,data:r});s.isObject(e)&&!s.isEmptyObject(e)&&o({properties:e})&&(c=s.extend(c,e))}}),t.properties=s.extend(p,c),t}function o(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function r(t){this.sd=t,this._=t._,this.cookie_value=null}function n(){this.registerProperties=null,this.store=null,this.sd=null,this._=null,this.log=window.console&&window.console.log||function(){},this.cookie_name="",this.prop={}}var p="1.26.8";o.prototype.init=function(t){if(t){this.sd=t,this._=t._,this.log=t.log;var e=this;t.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(t){return s(t,e)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.register=function(t){return this.sd?void(this._.isObject(t)&&this._.isArray(t.events)&&t.events.length>0&&this._.isObject(t.properties)&&!this._.isEmptyObject(t.properties)?this.customRegister.push(t):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.hookRegister=function(t){return this.sd?void(this._.isFunction(t)?this.customRegister.push(t):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},r.prototype.saveObjectVal=function(t,e){this._.isString(e)||(e=JSON.stringify(e)),1==this.sd.para.encrypt_cookie&&(e=this.sd.kit.userEncrypt(e)),this._.cookie.isSupport()&&this._.cookie.set(t,e),this.cookie_value=e},r.prototype.readObjectVal=function(t){var e=this._.cookie.isSupport()?this._.cookie.get(t):this.cookie_value;return e?(e=this.sd.kit.userDecryptIfNeeded(e),this._.safeJSONParse(e)):null};var h="sensorsdata2015jssdksession";n.prototype.init=function(t){if(!t||"object"!=typeof t)return void this.log("Session Event \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\uff01");var e=this;this.sd=t,this._=t._,this.log=t.log,this.cookie_name=h+(t.para.sdk_id||""),this.registerProperties=new o,this.registerProperties.init(t),this.store=new r(t),this.registerProperties.hookRegister(function(){return e.addSessionID()})},n.prototype.addSessionID=function(){var t=+new Date;this.prop=this.store.readObjectVal(this.cookie_name)||{};var e=this.prop.first_session_time,i=this.prop.latest_session_time;if(!e||!i||e>t||i>t||t-e>432e5||t-i>18e5){var s=this._.UUID();this.prop={session_id:s.replace(/-/g,""),first_session_time:t,latest_session_time:t}}else this.prop.latest_session_time=t;return this.store.saveObjectVal(this.cookie_name,this.prop),{$event_session_id:this.prop.session_id}};var c=new n,u=i(c,"SessionEvent","sdkReady");return u}(); \ No newline at end of file +!function(){"use strict";function t(t,i,s){if(i&&(t.plugin_name=i),s&&t.init){var o=t.init;t.init=function(r,n){function p(){o.call(t,r,n)}return e(r,t,i),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(s,p)}}return t}function e(t,e,i){function s(e,s){t.logger?t.logger.msg.apply(t.logger,s).module(i+""||"").level(e).log():t.log&&t.log.apply(t,s)}e.log=function(){s("log",arguments)},e.warn=function(){s("warn",arguments)},e.error=function(){s("error",arguments)}}function i(e,i,s){return t(e,i,s),e.plugin_version=p,e}function s(t,e){if("track"!==t.type)return t;var i=e.sd,s=i._,o=i.saEvent.check,r=s.extend2Lev({properties:{}},t),n=e.customRegister,p=r.properties,h=r.event,c={};return s.each(n,function(t){if(s.isObject(t))s.indexOf(t.events,h)>-1&&o({properties:t.properties})&&(c=s.extend(c,t.properties));else if(s.isFunction(t)){var e=t({event:h,properties:p,data:r});s.isObject(e)&&!s.isEmptyObject(e)&&o({properties:e})&&(c=s.extend(c,e))}}),t.properties=s.extend(p,c),t}function o(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function r(t){this.sd=t,this._=t._,this.cookie_value=null}function n(){this.registerProperties=null,this.store=null,this.sd=null,this._=null,this.log=window.console&&window.console.log||function(){},this.cookie_name="",this.prop={}}var p="1.26.9";o.prototype.init=function(t){if(t){this.sd=t,this._=t._,this.log=t.log;var e=this;t.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(t){return s(t,e)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.register=function(t){return this.sd?void(this._.isObject(t)&&this._.isArray(t.events)&&t.events.length>0&&this._.isObject(t.properties)&&!this._.isEmptyObject(t.properties)?this.customRegister.push(t):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.hookRegister=function(t){return this.sd?void(this._.isFunction(t)?this.customRegister.push(t):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},r.prototype.saveObjectVal=function(t,e){this._.isString(e)||(e=JSON.stringify(e)),1==this.sd.para.encrypt_cookie&&(e=this.sd.kit.userEncrypt(e)),this._.cookie.isSupport()&&this._.cookie.set(t,e),this.cookie_value=e},r.prototype.readObjectVal=function(t){var e=this._.cookie.isSupport()?this._.cookie.get(t):this.cookie_value;return e?(e=this.sd.kit.userDecryptIfNeeded(e),this._.safeJSONParse(e)):null};var h="sensorsdata2015jssdksession";n.prototype.init=function(t){if(!t||"object"!=typeof t)return void this.log("Session Event \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\uff01");var e=this;this.sd=t,this._=t._,this.log=t.log,this.cookie_name=h+(t.para.sdk_id||""),this.registerProperties=new o,this.registerProperties.init(t),this.store=new r(t),this.registerProperties.hookRegister(function(){return e.addSessionID()})},n.prototype.addSessionID=function(){var t=+new Date;this.prop=this.store.readObjectVal(this.cookie_name)||{};var e=this.prop.first_session_time,i=this.prop.latest_session_time;if(!e||!i||e>t||i>t||t-e>432e5||t-i>18e5){var s=this._.UUID();this.prop={session_id:s.replace(/-/g,""),first_session_time:t,latest_session_time:t}}else this.prop.latest_session_time=t;return this.store.saveObjectVal(this.cookie_name,this.prop),{$event_session_id:this.prop.session_id}};var c=new n,u=i(c,"SessionEvent","sdkReady");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/session-event/index.es6.js b/dist/web/plugin/session-event/index.es6.js index a14a3ca1..90ea28df 100644 --- a/dist/web/plugin/session-event/index.es6.js +++ b/dist/web/plugin/session-event/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.26.8";function wrapPluginInitFn(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var s=e.init;e.init=function(o,r){if(wrapLogFn(o,e,t),o.readyState&&o.readyState.state>=3||!o.on)return n();function n(){s.call(e,o,r)}o.on(i,n)}}return e}function wrapLogFn(e,t,i){function s(t,s){e.logger?e.logger.msg.apply(e.logger,s).module(i+""||"").level(t).log():e.log&&e.log.apply(e,s)}t.log=function(){s("log",arguments)},t.warn=function(){s("warn",arguments)},t.error=function(){s("error",arguments)}}function createPlugin(e,t,i){return wrapPluginInitFn(e,t,i),e.plugin_version=sdkversion_placeholder,e}function addProperties(e,t){if("track"!==e.type)return e;var i=t.sd,s=i._,o=i.saEvent.check,r=s.extend2Lev({properties:{}},e),n=t.customRegister,p=r.properties,a=r.event,l={};return s.each(n,function(e){if(s.isObject(e))s.indexOf(e.events,a)>-1&&o({properties:e.properties})&&(l=s.extend(l,e.properties));else if(s.isFunction(e)){var t=e({event:a,properties:p,data:r});s.isObject(t)&&!s.isEmptyObject(t)&&o({properties:t})&&(l=s.extend(l,t))}}),e.properties=s.extend(p,l),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Store(e){this.sd=e,this._=e._,this.cookie_value=null}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Store.prototype.saveObjectVal=function(e,t){this._.isString(t)||(t=JSON.stringify(t)),1==this.sd.para.encrypt_cookie&&(t=this.sd.kit.userEncrypt(t)),this._.cookie.isSupport()&&this._.cookie.set(e,t),this.cookie_value=t},Store.prototype.readObjectVal=function(e){var t=this._.cookie.isSupport()?this._.cookie.get(e):this.cookie_value;return t?(t=this.sd.kit.userDecryptIfNeeded(t),this._.safeJSONParse(t)):null};var COOKIE_NAME="sensorsdata2015jssdksession";function SessionEvent(){this.registerProperties=null,this.store=null,this.sd=null,this._=null,this.log=window.console&&window.console.log||function(){},this.cookie_name="",this.prop={}}SessionEvent.prototype.init=function(e){if(e&&"object"==typeof e){var t=this;this.sd=e,this._=e._,this.log=e.log,this.cookie_name=COOKIE_NAME+(e.para.sdk_id||""),this.registerProperties=new RegisterProperties,this.registerProperties.init(e),this.store=new Store(e),this.registerProperties.hookRegister(function(){return t.addSessionID()})}else this.log("Session Event \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\uff01")},SessionEvent.prototype.addSessionID=function(){var e=+new Date;this.prop=this.store.readObjectVal(this.cookie_name)||{};var t=this.prop.first_session_time,i=this.prop.latest_session_time;if(!t||!i||t>e||i>e||e-t>432e5||e-i>18e5){var s=this._.UUID();this.prop={session_id:s.replace(/-/g,""),first_session_time:e,latest_session_time:e}}else this.prop.latest_session_time=e;return this.store.saveObjectVal(this.cookie_name,this.prop),{$event_session_id:this.prop.session_id}};var instance=new SessionEvent,index=createPlugin(instance,"SessionEvent","sdkReady");export default index; \ No newline at end of file +var sdkversion_placeholder="1.26.9";function wrapPluginInitFn(e,t,i){if(t&&(e.plugin_name=t),i&&e.init){var s=e.init;e.init=function(o,r){if(wrapLogFn(o,e,t),o.readyState&&o.readyState.state>=3||!o.on)return n();function n(){s.call(e,o,r)}o.on(i,n)}}return e}function wrapLogFn(e,t,i){function s(t,s){e.logger?e.logger.msg.apply(e.logger,s).module(i+""||"").level(t).log():e.log&&e.log.apply(e,s)}t.log=function(){s("log",arguments)},t.warn=function(){s("warn",arguments)},t.error=function(){s("error",arguments)}}function createPlugin(e,t,i){return wrapPluginInitFn(e,t,i),e.plugin_version=sdkversion_placeholder,e}function addProperties(e,t){if("track"!==e.type)return e;var i=t.sd,s=i._,o=i.saEvent.check,r=s.extend2Lev({properties:{}},e),n=t.customRegister,p=r.properties,a=r.event,l={};return s.each(n,function(e){if(s.isObject(e))s.indexOf(e.events,a)>-1&&o({properties:e.properties})&&(l=s.extend(l,e.properties));else if(s.isFunction(e)){var t=e({event:a,properties:p,data:r});s.isObject(t)&&!s.isEmptyObject(t)&&o({properties:t})&&(l=s.extend(l,t))}}),e.properties=s.extend(p,l),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Store(e){this.sd=e,this._=e._,this.cookie_value=null}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},Store.prototype.saveObjectVal=function(e,t){this._.isString(t)||(t=JSON.stringify(t)),1==this.sd.para.encrypt_cookie&&(t=this.sd.kit.userEncrypt(t)),this._.cookie.isSupport()&&this._.cookie.set(e,t),this.cookie_value=t},Store.prototype.readObjectVal=function(e){var t=this._.cookie.isSupport()?this._.cookie.get(e):this.cookie_value;return t?(t=this.sd.kit.userDecryptIfNeeded(t),this._.safeJSONParse(t)):null};var COOKIE_NAME="sensorsdata2015jssdksession";function SessionEvent(){this.registerProperties=null,this.store=null,this.sd=null,this._=null,this.log=window.console&&window.console.log||function(){},this.cookie_name="",this.prop={}}SessionEvent.prototype.init=function(e){if(e&&"object"==typeof e){var t=this;this.sd=e,this._=e._,this.log=e.log,this.cookie_name=COOKIE_NAME+(e.para.sdk_id||""),this.registerProperties=new RegisterProperties,this.registerProperties.init(e),this.store=new Store(e),this.registerProperties.hookRegister(function(){return t.addSessionID()})}else this.log("Session Event \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\uff01")},SessionEvent.prototype.addSessionID=function(){var e=+new Date;this.prop=this.store.readObjectVal(this.cookie_name)||{};var t=this.prop.first_session_time,i=this.prop.latest_session_time;if(!t||!i||t>e||i>e||e-t>432e5||e-i>18e5){var s=this._.UUID();this.prop={session_id:s.replace(/-/g,""),first_session_time:e,latest_session_time:e}}else this.prop.latest_session_time=e;return this.store.saveObjectVal(this.cookie_name,this.prop),{$event_session_id:this.prop.session_id}};var instance=new SessionEvent,index=createPlugin(instance,"SessionEvent","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/session-event/index.js b/dist/web/plugin/session-event/index.js index 62969ca4..947d076f 100644 --- a/dist/web/plugin/session-event/index.js +++ b/dist/web/plugin/session-event/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SessionEvent=function(){"use strict";function t(t,i,s){if(i&&(t.plugin_name=i),s&&t.init){var o=t.init;t.init=function(r,n){function p(){o.call(t,r,n)}return e(r,t,i),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(s,p)}}return t}function e(t,e,i){function s(e,s){t.logger?t.logger.msg.apply(t.logger,s).module(i+""||"").level(e).log():t.log&&t.log.apply(t,s)}e.log=function(){s("log",arguments)},e.warn=function(){s("warn",arguments)},e.error=function(){s("error",arguments)}}function i(e,i,s){return t(e,i,s),e.plugin_version=p,e}function s(t,e){if("track"!==t.type)return t;var i=e.sd,s=i._,o=i.saEvent.check,r=s.extend2Lev({properties:{}},t),n=e.customRegister,p=r.properties,h=r.event,c={};return s.each(n,function(t){if(s.isObject(t))s.indexOf(t.events,h)>-1&&o({properties:t.properties})&&(c=s.extend(c,t.properties));else if(s.isFunction(t)){var e=t({event:h,properties:p,data:r});s.isObject(e)&&!s.isEmptyObject(e)&&o({properties:e})&&(c=s.extend(c,e))}}),t.properties=s.extend(p,c),t}function o(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function r(t){this.sd=t,this._=t._,this.cookie_value=null}function n(){this.registerProperties=null,this.store=null,this.sd=null,this._=null,this.log=window.console&&window.console.log||function(){},this.cookie_name="",this.prop={}}var p="1.26.8";o.prototype.init=function(t){if(t){this.sd=t,this._=t._,this.log=t.log;var e=this;t.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(t){return s(t,e)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.register=function(t){return this.sd?void(this._.isObject(t)&&this._.isArray(t.events)&&t.events.length>0&&this._.isObject(t.properties)&&!this._.isEmptyObject(t.properties)?this.customRegister.push(t):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.hookRegister=function(t){return this.sd?void(this._.isFunction(t)?this.customRegister.push(t):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},r.prototype.saveObjectVal=function(t,e){this._.isString(e)||(e=JSON.stringify(e)),1==this.sd.para.encrypt_cookie&&(e=this.sd.kit.userEncrypt(e)),this._.cookie.isSupport()&&this._.cookie.set(t,e),this.cookie_value=e},r.prototype.readObjectVal=function(t){var e=this._.cookie.isSupport()?this._.cookie.get(t):this.cookie_value;return e?(e=this.sd.kit.userDecryptIfNeeded(e),this._.safeJSONParse(e)):null};var h="sensorsdata2015jssdksession";n.prototype.init=function(t){if(!t||"object"!=typeof t)return void this.log("Session Event \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\uff01");var e=this;this.sd=t,this._=t._,this.log=t.log,this.cookie_name=h+(t.para.sdk_id||""),this.registerProperties=new o,this.registerProperties.init(t),this.store=new r(t),this.registerProperties.hookRegister(function(){return e.addSessionID()})},n.prototype.addSessionID=function(){var t=+new Date;this.prop=this.store.readObjectVal(this.cookie_name)||{};var e=this.prop.first_session_time,i=this.prop.latest_session_time;if(!e||!i||e>t||i>t||t-e>432e5||t-i>18e5){var s=this._.UUID();this.prop={session_id:s.replace(/-/g,""),first_session_time:t,latest_session_time:t}}else this.prop.latest_session_time=t;return this.store.saveObjectVal(this.cookie_name,this.prop),{$event_session_id:this.prop.session_id}};var c=new n,u=i(c,"SessionEvent","sdkReady");return u}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SessionEvent=function(){"use strict";function t(t,i,s){if(i&&(t.plugin_name=i),s&&t.init){var o=t.init;t.init=function(r,n){function p(){o.call(t,r,n)}return e(r,t,i),r.readyState&&r.readyState.state>=3||!r.on?p():void r.on(s,p)}}return t}function e(t,e,i){function s(e,s){t.logger?t.logger.msg.apply(t.logger,s).module(i+""||"").level(e).log():t.log&&t.log.apply(t,s)}e.log=function(){s("log",arguments)},e.warn=function(){s("warn",arguments)},e.error=function(){s("error",arguments)}}function i(e,i,s){return t(e,i,s),e.plugin_version=p,e}function s(t,e){if("track"!==t.type)return t;var i=e.sd,s=i._,o=i.saEvent.check,r=s.extend2Lev({properties:{}},t),n=e.customRegister,p=r.properties,h=r.event,c={};return s.each(n,function(t){if(s.isObject(t))s.indexOf(t.events,h)>-1&&o({properties:t.properties})&&(c=s.extend(c,t.properties));else if(s.isFunction(t)){var e=t({event:h,properties:p,data:r});s.isObject(e)&&!s.isEmptyObject(e)&&o({properties:e})&&(c=s.extend(c,e))}}),t.properties=s.extend(p,c),t}function o(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function r(t){this.sd=t,this._=t._,this.cookie_value=null}function n(){this.registerProperties=null,this.store=null,this.sd=null,this._=null,this.log=window.console&&window.console.log||function(){},this.cookie_name="",this.prop={}}var p="1.26.9";o.prototype.init=function(t){if(t){this.sd=t,this._=t._,this.log=t.log;var e=this;t.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(t){return s(t,e)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.register=function(t){return this.sd?void(this._.isObject(t)&&this._.isArray(t.events)&&t.events.length>0&&this._.isObject(t.properties)&&!this._.isEmptyObject(t.properties)?this.customRegister.push(t):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},o.prototype.hookRegister=function(t){return this.sd?void(this._.isFunction(t)?this.customRegister.push(t):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},r.prototype.saveObjectVal=function(t,e){this._.isString(e)||(e=JSON.stringify(e)),1==this.sd.para.encrypt_cookie&&(e=this.sd.kit.userEncrypt(e)),this._.cookie.isSupport()&&this._.cookie.set(t,e),this.cookie_value=e},r.prototype.readObjectVal=function(t){var e=this._.cookie.isSupport()?this._.cookie.get(t):this.cookie_value;return e?(e=this.sd.kit.userDecryptIfNeeded(e),this._.safeJSONParse(e)):null};var h="sensorsdata2015jssdksession";n.prototype.init=function(t){if(!t||"object"!=typeof t)return void this.log("Session Event \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25\uff01");var e=this;this.sd=t,this._=t._,this.log=t.log,this.cookie_name=h+(t.para.sdk_id||""),this.registerProperties=new o,this.registerProperties.init(t),this.store=new r(t),this.registerProperties.hookRegister(function(){return e.addSessionID()})},n.prototype.addSessionID=function(){var t=+new Date;this.prop=this.store.readObjectVal(this.cookie_name)||{};var e=this.prop.first_session_time,i=this.prop.latest_session_time;if(!e||!i||e>t||i>t||t-e>432e5||t-i>18e5){var s=this._.UUID();this.prop={session_id:s.replace(/-/g,""),first_session_time:t,latest_session_time:t}}else this.prop.latest_session_time=t;return this.store.saveObjectVal(this.cookie_name,this.prop),{$event_session_id:this.prop.session_id}};var c=new n,u=i(c,"SessionEvent","sdkReady");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/sf-instant-event/index.closure.js b/dist/web/plugin/sf-instant-event/index.closure.js index 74b5e27b..7ab6b604 100644 --- a/dist/web/plugin/sf-instant-event/index.closure.js +++ b/dist/web/plugin/sf-instant-event/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,n,r){if(n&&(e.plugin_name=n),r&&e.init){var a=e.init;e.init=function(i,o){function u(){a.call(e,i,o)}return t(i,e,n),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return e}function t(e,t,n){function r(t,r){e.logger?e.logger.msg.apply(e.logger,r).module(n+""||"").level(t).log():e.log&&e.log.apply(e,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function n(t,n,r){return e(t,n,r),t.plugin_version=f,t}function r(e,t){var n=s.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+n:e+"?"+n}function a(e){if("beacon"===s.para.send_type&&c.isSupportBeaconSend())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new c.BeaconSend(e);if("ajax"===s.para.send_type&&c.isSupportCors())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new c.BeaconSend(e);var t=r(e.server_url,e.data),n=c.getQueryParam(t,"ext"),a=c.urlParse(t);return a.addQueryString({ext:n+"%2Cinstant_evnet%3Dtrue"}),e.data=a.getUrl(),new c.ImageSend(e)}function i(e){var t=a(e);t.start()}function o(e,t){var n=e.data.event,r=e.data.type;if(!n||c.indexOf(d,n)===-1)return e;var a=s.para.app_js_bridge&&s.bridge&&s.bridge.bridge_info&&"success"===s.bridge.bridge_info.verify_success,o="item_set"===r||"item_delete"===r,u=s.para.app_js_bridge.is_mui===!0;if(a&&!o&&!u)return e.data.is_instant_event=!0,e;t.cancellationToken.stop();var f=e.server_url;return c.isArray(f)&&f.length?void c.each(f,function(t){e.callback=null,e.server_url=t,i(e)}):(i(e),e)}function u(){s.registerInterceptor("sendDataStage",{send:{priority:50,entry:o}})}var s,c,d,f="1.26.8",l={plugin_name:"SfInstantEvent",init:function(e,t){if(s=e,c=s._,c.isObject(t)&&c.isArray(t.instant_events)){if(d=t.instant_events,s.readyState&&s.readyState.state>=3||!s.on)return u();s.on("sdkAfterInitPara",function(){u()})}else s.log("SfInstantEvent init failed\uff0cparameter error. option:",t)}},g=n(l);return g}(); \ No newline at end of file +!function(){"use strict";function e(e,n,r){if(n&&(e.plugin_name=n),r&&e.init){var a=e.init;e.init=function(i,o){function u(){a.call(e,i,o)}return t(i,e,n),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return e}function t(e,t,n){function r(t,r){e.logger?e.logger.msg.apply(e.logger,r).module(n+""||"").level(t).log():e.log&&e.log.apply(e,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function n(t,n,r){return e(t,n,r),t.plugin_version=f,t}function r(e,t){var n=s.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+n:e+"?"+n}function a(e){if("beacon"===s.para.send_type&&c.isSupportBeaconSend())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new c.BeaconSend(e);if("ajax"===s.para.send_type&&c.isSupportCors())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new c.BeaconSend(e);var t=r(e.server_url,e.data),n=c.getQueryParam(t,"ext"),a=c.urlParse(t);return a.addQueryString({ext:n+"%2Cinstant_evnet%3Dtrue"}),e.data=a.getUrl(),new c.ImageSend(e)}function i(e){var t=a(e);t.start()}function o(e,t){var n=e.data.event,r=e.data.type;if(!n||c.indexOf(d,n)===-1)return e;var a=s.para.app_js_bridge&&s.bridge&&s.bridge.bridge_info&&"success"===s.bridge.bridge_info.verify_success,o="item_set"===r||"item_delete"===r,u=s.para.app_js_bridge.is_mui===!0;if(a&&!o&&!u)return e.data.is_instant_event=!0,e;t.cancellationToken.stop();var f=e.server_url;return c.isArray(f)&&f.length?void c.each(f,function(t){e.callback=null,e.server_url=t,i(e)}):(i(e),e)}function u(){s.registerInterceptor("sendDataStage",{send:{priority:50,entry:o}})}var s,c,d,f="1.26.9",l={plugin_name:"SfInstantEvent",init:function(e,t){if(s=e,c=s._,c.isObject(t)&&c.isArray(t.instant_events)){if(d=t.instant_events,s.readyState&&s.readyState.state>=3||!s.on)return u();s.on("sdkAfterInitPara",function(){u()})}else s.log("SfInstantEvent init failed\uff0cparameter error. option:",t)}},g=n(l);return g}(); \ No newline at end of file diff --git a/dist/web/plugin/sf-instant-event/index.es6.js b/dist/web/plugin/sf-instant-event/index.es6.js index b4ca6f76..0008a734 100644 --- a/dist/web/plugin/sf-instant-event/index.es6.js +++ b/dist/web/plugin/sf-instant-event/index.es6.js @@ -1 +1 @@ -var sd,_,instant_events,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(e,n,t){if(n&&(e.plugin_name=n),t&&e.init){var r=e.init;e.init=function(a,i){if(wrapLogFn(a,e,n),a.readyState&&a.readyState.state>=3||!a.on)return s();function s(){r.call(e,a,i)}a.on(t,s)}}return e}function wrapLogFn(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function createPlugin(e,n,t){return wrapPluginInitFn(e,n,t),e.plugin_version=sdkversion_placeholder,e}function getSendUrl(e,n){var t=sd.kit.encodeTrackData(n);return-1!==e.indexOf("?")?e+"&"+t:e+"?"+t}function getInstance(e){if("beacon"===sd.para.send_type&&_.isSupportBeaconSend())return e.data=sd.kit.encodeTrackData(e.data)+"&instant_event=true",new _.BeaconSend(e);if("ajax"===sd.para.send_type&&_.isSupportCors())return e.data=sd.kit.encodeTrackData(e.data)+"&instant_event=true",new _.BeaconSend(e);var n=getSendUrl(e.server_url,e.data),t=_.getQueryParam(n,"ext"),r=_.urlParse(n);return r.addQueryString({ext:t+"%2Cinstant_evnet%3Dtrue"}),e.data=r.getUrl(),new _.ImageSend(e)}function sendCall(e){getInstance(e).start()}function sendInterceptor(e,n){var t=e.data.event,r=e.data.type;if(!t||-1===_.indexOf(instant_events,t))return e;var a=sd.para.app_js_bridge&&sd.bridge&&sd.bridge.bridge_info&&"success"===sd.bridge.bridge_info.verify_success,i="item_set"===r||"item_delete"===r,s=!0===sd.para.app_js_bridge.is_mui;if(a&&!i&&!s)return e.data.is_instant_event=!0,e;n.cancellationToken.stop();var d=e.server_url;if(!_.isArray(d)||!d.length)return sendCall(e),e;_.each(d,function(n){e.callback=null,e.server_url=n,sendCall(e)})}function senderInit(){sd.registerInterceptor("sendDataStage",{send:{priority:50,entry:sendInterceptor}})}var SfInstantEvent={plugin_name:"SfInstantEvent",init:function(e,n){if((_=(sd=e)._).isObject(n)&&_.isArray(n.instant_events)){if(instant_events=n.instant_events,sd.readyState&&sd.readyState.state>=3||!sd.on)return senderInit();sd.on("sdkAfterInitPara",function(){senderInit()})}else sd.log("SfInstantEvent init failed\uff0cparameter error. option:",n)}},index=createPlugin(SfInstantEvent);export default index; \ No newline at end of file +var sd,_,instant_events,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(e,n,t){if(n&&(e.plugin_name=n),t&&e.init){var r=e.init;e.init=function(a,i){if(wrapLogFn(a,e,n),a.readyState&&a.readyState.state>=3||!a.on)return s();function s(){r.call(e,a,i)}a.on(t,s)}}return e}function wrapLogFn(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function createPlugin(e,n,t){return wrapPluginInitFn(e,n,t),e.plugin_version=sdkversion_placeholder,e}function getSendUrl(e,n){var t=sd.kit.encodeTrackData(n);return-1!==e.indexOf("?")?e+"&"+t:e+"?"+t}function getInstance(e){if("beacon"===sd.para.send_type&&_.isSupportBeaconSend())return e.data=sd.kit.encodeTrackData(e.data)+"&instant_event=true",new _.BeaconSend(e);if("ajax"===sd.para.send_type&&_.isSupportCors())return e.data=sd.kit.encodeTrackData(e.data)+"&instant_event=true",new _.BeaconSend(e);var n=getSendUrl(e.server_url,e.data),t=_.getQueryParam(n,"ext"),r=_.urlParse(n);return r.addQueryString({ext:t+"%2Cinstant_evnet%3Dtrue"}),e.data=r.getUrl(),new _.ImageSend(e)}function sendCall(e){getInstance(e).start()}function sendInterceptor(e,n){var t=e.data.event,r=e.data.type;if(!t||-1===_.indexOf(instant_events,t))return e;var a=sd.para.app_js_bridge&&sd.bridge&&sd.bridge.bridge_info&&"success"===sd.bridge.bridge_info.verify_success,i="item_set"===r||"item_delete"===r,s=!0===sd.para.app_js_bridge.is_mui;if(a&&!i&&!s)return e.data.is_instant_event=!0,e;n.cancellationToken.stop();var d=e.server_url;if(!_.isArray(d)||!d.length)return sendCall(e),e;_.each(d,function(n){e.callback=null,e.server_url=n,sendCall(e)})}function senderInit(){sd.registerInterceptor("sendDataStage",{send:{priority:50,entry:sendInterceptor}})}var SfInstantEvent={plugin_name:"SfInstantEvent",init:function(e,n){if((_=(sd=e)._).isObject(n)&&_.isArray(n.instant_events)){if(instant_events=n.instant_events,sd.readyState&&sd.readyState.state>=3||!sd.on)return senderInit();sd.on("sdkAfterInitPara",function(){senderInit()})}else sd.log("SfInstantEvent init failed\uff0cparameter error. option:",n)}},index=createPlugin(SfInstantEvent);export default index; \ No newline at end of file diff --git a/dist/web/plugin/sf-instant-event/index.js b/dist/web/plugin/sf-instant-event/index.js index d69dc487..832cabef 100644 --- a/dist/web/plugin/sf-instant-event/index.js +++ b/dist/web/plugin/sf-instant-event/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SfInstantEvent=function(){"use strict";function e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var a=e.init;e.init=function(i,o){function u(){a.call(e,i,o)}return n(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return e}function n(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function t(n,t,r){return e(n,t,r),n.plugin_version=l,n}function r(e,n){var t=s.kit.encodeTrackData(n);return e.indexOf("?")!==-1?e+"&"+t:e+"?"+t}function a(e){if("beacon"===s.para.send_type&&d.isSupportBeaconSend())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new d.BeaconSend(e);if("ajax"===s.para.send_type&&d.isSupportCors())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new d.BeaconSend(e);var n=r(e.server_url,e.data),t=d.getQueryParam(n,"ext"),a=d.urlParse(n);return a.addQueryString({ext:t+"%2Cinstant_evnet%3Dtrue"}),e.data=a.getUrl(),new d.ImageSend(e)}function i(e){var n=a(e);n.start()}function o(e,n){var t=e.data.event,r=e.data.type;if(!t||d.indexOf(c,t)===-1)return e;var a=s.para.app_js_bridge&&s.bridge&&s.bridge.bridge_info&&"success"===s.bridge.bridge_info.verify_success,o="item_set"===r||"item_delete"===r,u=s.para.app_js_bridge.is_mui===!0;if(a&&!o&&!u)return e.data.is_instant_event=!0,e;n.cancellationToken.stop();var l=e.server_url;return d.isArray(l)&&l.length?void d.each(l,function(n){e.callback=null,e.server_url=n,i(e)}):(i(e),e)}function u(){s.registerInterceptor("sendDataStage",{send:{priority:50,entry:o}})}var s,d,c,l="1.26.8",f={plugin_name:"SfInstantEvent",init:function(e,n){if(s=e,d=s._,d.isObject(n)&&d.isArray(n.instant_events)){if(c=n.instant_events,s.readyState&&s.readyState.state>=3||!s.on)return u();s.on("sdkAfterInitPara",function(){u()})}else s.log("SfInstantEvent init failed\uff0cparameter error. option:",n)}},g=t(f);return g}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SfInstantEvent=function(){"use strict";function e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var a=e.init;e.init=function(i,o){function u(){a.call(e,i,o)}return n(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?u():void i.on(r,u)}}return e}function n(e,n,t){function r(n,r){e.logger?e.logger.msg.apply(e.logger,r).module(t+""||"").level(n).log():e.log&&e.log.apply(e,r)}n.log=function(){r("log",arguments)},n.warn=function(){r("warn",arguments)},n.error=function(){r("error",arguments)}}function t(n,t,r){return e(n,t,r),n.plugin_version=l,n}function r(e,n){var t=s.kit.encodeTrackData(n);return e.indexOf("?")!==-1?e+"&"+t:e+"?"+t}function a(e){if("beacon"===s.para.send_type&&d.isSupportBeaconSend())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new d.BeaconSend(e);if("ajax"===s.para.send_type&&d.isSupportCors())return e.data=s.kit.encodeTrackData(e.data)+"&instant_event=true",new d.BeaconSend(e);var n=r(e.server_url,e.data),t=d.getQueryParam(n,"ext"),a=d.urlParse(n);return a.addQueryString({ext:t+"%2Cinstant_evnet%3Dtrue"}),e.data=a.getUrl(),new d.ImageSend(e)}function i(e){var n=a(e);n.start()}function o(e,n){var t=e.data.event,r=e.data.type;if(!t||d.indexOf(c,t)===-1)return e;var a=s.para.app_js_bridge&&s.bridge&&s.bridge.bridge_info&&"success"===s.bridge.bridge_info.verify_success,o="item_set"===r||"item_delete"===r,u=s.para.app_js_bridge.is_mui===!0;if(a&&!o&&!u)return e.data.is_instant_event=!0,e;n.cancellationToken.stop();var l=e.server_url;return d.isArray(l)&&l.length?void d.each(l,function(n){e.callback=null,e.server_url=n,i(e)}):(i(e),e)}function u(){s.registerInterceptor("sendDataStage",{send:{priority:50,entry:o}})}var s,d,c,l="1.26.9",f={plugin_name:"SfInstantEvent",init:function(e,n){if(s=e,d=s._,d.isObject(n)&&d.isArray(n.instant_events)){if(c=n.instant_events,s.readyState&&s.readyState.state>=3||!s.on)return u();s.on("sdkAfterInitPara",function(){u()})}else s.log("SfInstantEvent init failed\uff0cparameter error. option:",n)}},g=t(f);return g}(); \ No newline at end of file diff --git a/dist/web/plugin/sf-sdk-web/popup.amd.min.js b/dist/web/plugin/sf-sdk-web/popup.amd.min.js index ace28945..1427081d 100644 --- a/dist/web/plugin/sf-sdk-web/popup.amd.min.js +++ b/dist/web/plugin/sf-sdk-web/popup.amd.min.js @@ -1,2 +1,2 @@ -define(function(){"use strict";function e(e){this.properties=e.properties,this.template=e.template,this.maskEle=null,this.containerEle=null,this.msg={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:"",$sf_succeed:"",$sf_fail_reason:"",$sf_msg_id:"",plan:{}},this.popupCheckInstance=null}function t(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=t.length-1,i={},o=0;for(o=0;o1024)return"object"==typeof console&&console.log&&console.log("H5 \u5f39\u7a97\u4ec5\u652f\u6301\u79fb\u52a8\u7aef\u548c ipad\uff0c\u6216\u8005\u5c4f\u5e55\u5bbd\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 1024\u3002"),!1;var e={};return arguments.length>0&&(1===arguments.length&&r.isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&r.isObject(arguments[1])&&(e=arguments[1])),!!this.setPara(e)&&(a.info.platform="H5",!!a.setIsLoad()&&(!!this.getBridgeState()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial()))))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.26.8",plugin_version:"1.26.8",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(e){var t={};if(e&&"[object Object]"===Object.prototype.toString.call(e)){for(var n in e)n&&"popup_window_content"!==n&&(t[n]=e[n]);return JSON.stringify(t,null," ")}return e},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-popupdata",loadedSign:"SensorsData2015JSSDKH5PopupIsLoad"};var r={visibility:function(e){e=e||{};var t={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:e.onVisible,_hidden:e.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){t._nativeSwitch.apply(t,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(e){}},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()}};t.init()},getRgba:function(e){return"object"!=typeof e?e:"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"},conversionNum:function(e){if(e){if(/^[0|1]?\.\d+$/.test(e))return 100*Number(e)+"%";var t=/^(-?\d+(\.\d+)?)px$/.exec(e);return t?(Number(t[1])/375*window.screen.width).toFixed(2)+"px":e}},boxModel:function(e){return function(t){if("object"!=typeof t)return e+":"+t+";";var n="";for(var i in t)n+=e+"-"+i+":"+r.conversionNum(t[i])+";";return n}},localStorage:{get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t=null;try{t=JSON.parse(r.localStorage.get(e))||null}catch(n){}return t},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";r.localStorage.set(t,n),r.localStorage.get(t)!==n&&(e=!1),r.localStorage.remove(t)}catch(i){e=!1}return e}},addEvent:function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}function t(t,n,i){var o=function(o){if(o=o||e(window.event)){o.target=o.srcElement;var a,r,s=!0;return"function"==typeof i&&(a=i(o)),r=n.call(t,o),!1!==a&&!1!==r||(s=!1),s}};return o}e._getPath=function(){var e=this,t=function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||t()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,o){if(n&&n.addEventListener)n.addEventListener(i,function(t){t._getPath=e._getPath,o.call(this,t)},!1);else{var a="on"+i,r=n[a];n[a]=t(n,o,r)}};n.apply(null,arguments)},extend:function(e){var t=Array.prototype.slice;return r.each(t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},extend2Lev:function(e){return r.each(Array.prototype.slice.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(r.isObject(t[n])&&r.isObject(e[n])?r.extend(e[n],t[n]):e[n]=t[n])}),e},each:function(e,t,n){var i=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,a={};if(null==e)return!1;if(o&&e.forEach===o)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,s=e.length;r=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r.isObject(e.header)&&r.each(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(e.data||null)},getUuid:function(){var e=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},t=function(){return Math.random().toString(16).replace(".","")};return function(){var n=e()+"-"+t()+"-"+t();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(e){var t=Object.prototype.hasOwnProperty;if(r.isObject(e)){for(var n in e)if(t.call(e,n))return!1;return!0}return!1},filter:function(e,t,n){var i=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var o=[],a=0;a=0;s--){var p=n[s];t[p]=a[p]}t.hostname&&"string"==typeof t.pathname&&0!==t.pathname.indexOf("/")&&(t.pathname="/"+t.pathname),t.searchParams=function(){var e=r.getURLSearchParams(t.search);return{get:function(t){return e[t]}}}()}return t},contentLoaded:function(e,t){var n=!1,i=!0,o=e.document,a=o.documentElement,r=o.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",l=r?"":"on",u=function(i){"readystatechange"==i.type&&"complete"!=o.readyState||(("load"==i.type?e:o)[p](l+i.type,u,!1),!n&&(n=!0)&&t.call(e,i.type||i))},c=function(){try{a.doScroll("left")}catch(e){return void setTimeout(c,50)}u("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(!r&&a.doScroll){try{i=!e.frameElement}catch(_){}i&&c()}o[s](l+"DOMContentLoaded",u,!1),o[s](l+"readystatechange",u,!1),e[s](l+"load",u,!1)}},indexOf:function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(e){function t(e){r.each(e.subviews,function(e){var i=e.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===e.type&&(n.$sf_msg_image_url=i.image),e.subviews&&t(e)})}if(!r.isObject(e)||!r.isObject(e.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return t(e.template),n},a.getSFCampaign=function(e){e=r.isObject(e)?e:{};var t={planId:"",name:"",content:null,type:""};return t.planId=e.plan_id||"",t.name=e.cname||"",t.content=r.isObject(e.popup_window_content)?e.popup_window_content.content:"",t.type=r.isObject(e.popup_window_content)&&e.popup_window_content.popup_type?e.popup_window_content.popup_type:"PRESET",t},a.getImageList=function(e){if(!r.isArray(e))return!1;for(var t,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),a={},s=e.length,p=[],l=!1,u=0;u0&&(a[n[0]]||(a[n[0]]=1));return r.each(a,function(e,t){p.push(t)}),p},a.setIsLoad=function(){var e=window.self===window.top;if(e){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(t){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",t),!0}};var s={close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAe1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////NgkbwAAAAKHRSTlMA5if6t/B0UjMSxpAtJB4MBfTr30oY6NjV0r2loZ6XkoaBenFp3UA/LNePaQAAAsxJREFUWMOsltlygzAMRRXMZsAsAZJmX9v6/7+wg1QXpjGxCDkvyWTIQZauDcCgzKLrPtnUSyGW9SbZX6OshDcQh36lH6j8MJ7pTZd6lGX6sr0IP7SDj7CA6chLoBkEFzm14nM1/P/2eGti1RZFq+LmdtwGw7afJ1Ue1dogcGCW4QptqCO2OPe1IbnL0Y7dE23wc2bJgSn44MFTvIMwLeMUXqZGfGKUkp+MPC2dwUjMGhWwUL7pnXRUsdbIIpow84VG1k9Xmf1e5U8Kq/R/68memAPqcggTCQUNc9SdL+iCL5jMd0B1j/RErh3LYrRyLa2po2x8KngJ9Uk5sWUwpZoVvIiiulNLhMwgHDhDED2MEH8X3zCDL4HV/R8lRTOEWYS0KWzt8GEm/mNLihpHKOeqJY6yLqDnbO42F1r9eXCzitMOfkuqfvkXTId6h1phSi5/ncbgneAtnDCAxTAzIn+POhfDFOObzAEsNLu0HXO06a4BCwd89wEk1h2ezdwl0rObvS5nNreHurg/lxKwsNPoHjXrHVhI+lMK3xjvMH4YelYzCSzc8V3zrx9CWtu5MG67eWEdhBSmI+GT7eIZt+Nny7YJ+y8ON9/cF1tWVL7LzTdTi6sSMtw9AE432wwl7u6MzqotMNwcM7Glc/TafRyB4+aa4dhdcoV993EDlptphlt3zZ72TgM8N88MDe3vDQWE5V6tWGaKyAbwqaiA5+aZQeETkk6QFtxuvhlaOkVwwxfgdq/IvHKbocBj6ac5OzYCIASBKGo10n+HBgakMswbaYDgTmX3fzgafhD4G+Hhg1cGXnT4PMFHVayCdVcBXGBu7cKwACOOC2YwTsIQ7KI7LBywJrlyByupK9Kw/lto4VFLAqLdmRwJiBDWwjDOI0QPPhPXRn3yTlyrILND4w7oOw3h5AlTPk5U/ddrZSk4RWW+C9hp2rgru6GiP/678n2UFPV1AAAAAElFTkSuQmCC"},p={row:"div",column:"div",label:"pre",image:"img",button:"button",link:"button",image_button:"img"},l={textAlign:"text-align",font:"font-size",backgroundColor:"background-color",borderWidth:function(e){return"border-width: "+e+";border-style: solid;"},borderColor:"border-color",cornerRadius:"border-radius",backgroundImage:function(e){return"background-image:url("+e+");background-repeat: no-repeat;background-size: 100% 100%;"},margin:r.boxModel("margin"),padding:r.boxModel("padding"),maxHeight:"max-height",maxWidth:"max-width",scrollableX:function(e){if(e)return"overflow-x:auto;"},scrollableY:function(e){if(e)return"overflow-y:auto;"}};e.prototype={constructor:e,render:function(){function e(e,n){var i=e.maskAction.H5,o=r.isArray(i)&&i[0];if(r.isObject(o))switch(n.$sf_close_type=o.$sf_close_type||"",n.$sf_msg_element_action=o.type||"",o.type){case"copy":a.track.trackEvent("$PlanPopupClick",n,t.msg);break;case"customize":case"openlink":a.track.trackEvent("$PlanPopupClick",n,t.msg),o.closeable&&t.destory();break;case"close":o.closeable&&(a.track.trackEvent("$PlanPopupClick",n,t.msg),t.destory())}}var t=this,n=document.querySelector("div[data-sf-mask]");return!n&&(t.template.isRoot=!0,t.containerEle=t.createView(t.template),t.maskEle=t.getElement({nodeName:"div",attr:{"data-sensors-click":!0},style:t.getStyle({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:r.getRgba(t.properties.maskColor),"z-index":999998})}),r.addEvent(t.maskEle,"click",function(n){var i=n.target,o=i.getAttribute("data-ele-mask"),r=t.properties,s=t.msg;if(!s)return!1;var p={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_action:"close",$sf_msg_element_type:"mask",$sf_msg_action_id:r.maskActionId};return o&&r&&r.maskAction?(e(r,p),!1):o&&t.properties.maskCloseEnabled?(a.track.trackEvent("$PlanPopupClick",p,s),t.destory(),!1):void a.track.elementClickCallback(n,t)}),t.maskEle.setAttribute("data-sf-mask",!0),t.maskEle.appendChild(t.containerEle),r.contentLoaded(window,function(){t.appendPopup()}),!0)},appendPopup:function(){if(window.self===window.top)document.body.appendChild(this.maskEle);else try{window.top.document.body.appendChild(this.maskEle)}catch(e){document.body.appendChild(this.maskEle)}var t=document.querySelector("[data-ele-mask] > div"),n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;t&&t.offsetHeight>n&&(t.style.marginTop="auto")},getElement:function(e){var t=e.nodeName||"div",n=e.style,i=e.attr,o=e.prop,a=e.child,s=e.action,p=e.element_info,l=document.createElement(t);return n&&l.setAttribute("style",n),i&&r.each(i,function(e,t){e&&l.setAttribute(t,e)}),o&&r.each(o,function(e,t){e&&(l[t]=e)}),a&&a.length&&r.each(a,function(e){return!!e&&void l.appendChild(e)}),s&&s.H5&&s.H5.length&&l.setAttribute("data-action",JSON.stringify(s.H5)),p&&l.setAttribute("data-info",JSON.stringify(p)),l},getStyle:function(e){var t="",n=["msgType","text","image","name","isHidden","align","localImageName"];return r.each(e,function(e,i){var e=r.conversionNum(e),o=l[i];return!(r.indexOf(n,i)>=0)&&void(t+=r.isString(o)?o+":"+r.getRgba(e)+";":r.isFunction(o)?o(e)+";":i+":"+r.getRgba(e)+";")}),t},createView:function(e){var t=[],n={"box-sizing":"border-box",display:"block","pointer-events":"auto",overflow:"hidden"},i={},o={},a=p[e.type]||null;e.properties=e.properties||{},e.layout=e.layout||{};var l=e.properties.font,u=l?1.7*parseInt(l)+"px":"normal";if(e.properties.isHidden)return!1;switch(e.properties.text?o.innerText=e.properties.text:e.properties.image&&(i["data-sensors-click"]=!0,e.properties.localImageName?i.src=s[e.properties.localImageName]:i.src=e.properties.image),e.isRoot&&(e.layout.margin.top="-40px",r.extend(n,{position:"relative","z-index":999999,"pointer-events":"none"})),e.type){case"row":n.display="flex";break;case"link":r.extend(n,{"text-decoration":"underline",outline:"none","letter-spacing":"1px","line-height":u});break;case"label":r.extend(n,{"white-space":"pre-wrap","word-wrap":"break-word","letter-spacing":"1px","line-height":u,"margin-top":"0px","margin-bottom":"0px"});break;case"button":r.extend(n,{outline:"none","letter-spacing":"1px","line-height":u})}r.extend(n,e.layout,e.properties),e.subviews&&e.subviews.length>0&&r.each(e.subviews,function(e){t.push(this.createView(e))},this);var c=this.getElement({element_info:{$sf_msg_element_type:e.type,$sf_msg_element_content:e.properties.text||""},nodeName:a,attr:i,prop:o,style:this.getStyle(n),child:t,action:e.action});if(e.layout.align){var _={center:"center",left:"flex-start",right:"flex-end"},d=document.createElement("div"),n="display:flex;justify-content:"+_[e.layout.align]+";";return e.isRoot?(n+="width:100%;height:100%;overflow-y:auto;box-sizing: border-box;align-items:center;",d.setAttribute("style",n),d.setAttribute("data-ele-mask",!0)):d.setAttribute("style",n),d.appendChild(c),d}return c},destory:function(){var e=this.msg.plan.plan_id||"";if(window.self===window.top)document.body.removeChild(this.maskEle);else try{window.top.document.body.removeChild(this.maskEle)}catch(t){document.body.removeChild(this.maskEle)}a.info.popup_listener.onClose(e),a.info.popup_campaign_listener.onEnd(a.getSFCampaign(this.msg.plan)),this.popupCheckInstance&&this.popupCheckInstance.resetPopupIntervalWindow()}},a.ElementRender=e,a.handlerCampaign=function(e){var t=e,n=r.getUuid()(),i=t.plan.popup_window_content;if(!r.isObject(i))return t.popupFailed(1001,!1,{uuid:n,content:"",plan:t.plan}),!1;var o;if(i.content)try{o=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(t.plan),l={state:"",isCustom:!1},u=!0;try{u=a.info.popup_campaign_listener.shouldStart(p)}catch(s){u=!1,a.log(s)}var c={uuid:n,content:o,plan:t.plan};switch(t.plan.strategy_id?t.plan.is_trigger?u?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":r.isString(i.content)?l.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":l.state="DIALOG_NOT_SHOW_JSON_FAILED":"PRESET"===i.popup_type&&r.isObject(o)&&r.isObject(o.properties)&&r.isObject(o.template)?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START":l.state="CAMPAIGN_NOT_START_TRIGGER":t.plan.is_control_group?l.state="DIALOG_NOT_SHOW":u?r.isObject(o)&&o.properties&&o.template?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START",l.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",l,"plan:",t.plan.cname),l.state){case"DIALOG_SHOW":t.showPopup(c);break;case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":t.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":t.popupFailed(1004,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":t.popupFailed(1006,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":t.popupFailed(1006,l.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":t.popupFailed(1001,l.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":t.popupFailed(1005,l.isCustom,c);break;case"DIALOG_NOT_SHOW":t.popupFailed(1003,l.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(e){var t=e.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:e.$sf_msg_id};return r.isEmptyObject(t)||!r.isObject(t)?n:(n.$sf_plan_id=t.plan_id+"",n.$sf_plan_strategy_id=t.strategy_id?t.strategy_id:t.is_control_group?"-1":"0",t.audience_id&&(n.$sf_audience_id=t.audience_id+""),t.section_id&&(n.$sf_section_id=String(t.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(e){var t={$sf_msg_title:e.$sf_msg_title,$sf_msg_content:e.$sf_msg_content,$sf_msg_image_url:e.$sf_msg_image_url,$sf_succeed:e.$sf_succeed,$sf_fail_reason:e.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",t,e)},trackEvent:function(e,t,n){var i=a.track.getPublicProps(n);r.extend(t,i),r.each(t,function(e,n){""!==e&&void 0!==e||delete t[n]}),a.sa.track(e,t)},maskClick:function(e){if(!e.msg)return!1;var t={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:e.msg.$sf_msg_title,$sf_msg_content:e.msg.$sf_msg_content,$sf_msg_image_url:e.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:e.properties.maskActionId};this.trackEvent("$PlanPopupClick",t,e.msg),e.destory()},elementClickCallback:function(e,t){var n=e.target,i=n.getAttribute("data-action"),o=n.getAttribute("data-info"),s=t.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},l=p[0],u=JSON.parse(o)||{}}catch(e){a.log("elementClickCallback error",e)}var c={type:l.type,value:r.isString(l.value)?l.value:"",extra:r.isObject(l.value)?l.value:""},_=t.msg.plan?t.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:u.$sf_msg_element_type,$sf_msg_element_content:u.$sf_msg_element_content,$sf_msg_element_action:l.type,$sf_msg_action_id:l.id,$sf_close_type:"close"===l.type?l.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=t.msg.plan;if(f){var m={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(m)}}catch(e){a.log("popup_listener.onClick error",e)}if("close"===l.type)t.destory();else if(l.closeable?t.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===l.type){if("http"!==l.value.slice(0,4))return!1;window.location.href=l.value}}};var u=a.log;a.changeCovertStatus=function(e){var t=JSON.parse(JSON.stringify(a.convertPlans));r.each(t,function(t,n){if(!t.is_in_convert_window)return!1;var i=t.is_in_convert_window.step,o=t.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!e&&void r.each(e,function(e){e.popup_display_uuid===o&&e.convert_time&&(u("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(e){function t(){if(r.isEmptyObject(a.localData)||!r.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var e=JSON.parse(JSON.stringify(a.convertPlans)),i=e[0].is_in_convert_window&&e[0].is_in_convert_window.step||5e3,o=[];return r.each(e,function(e,t){if(!e.is_in_convert_window)return!1;var n=(new Date).getTime(),r=e.is_in_convert_window.expire_time;return n>r?(u("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[t].plan_id),delete a.convertPlans[t].is_in_convert_window,a.convertPlans.splice(t,1),a.updateDataAndSetListen.updateLocalData(),!1):(o.push(e.is_in_convert_window.uuid),e.is_in_convert_window.step||(e.is_in_convert_window.step=5e3,a.convertPlans[t].is_in_convert_window.step=5e3),void(i>e.is_in_convert_window.step&&(i=e.is_in_convert_window.step)))}),!!o.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){r.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(e){a.changeCovertStatus(e),t()},error:function(){a.changeCovertStatus(),t()}})},i)))}var n=a.info.project,i=!1;return!(!e&&0===a.convertPlans.length)&&(e&&(r.each(a.convertPlans,function(t){t.plan_id===e.plan_id&&(i=!0)}),i||a.convertPlans.push(e)),void t())},a.ruleTime={getExpire:function(e,t){var n=t,i=Number(e.value)||0,o=Number(e.value)||0,a=String(e.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(o-1)},week:function(){r=new Date(n);var e=r.getDay();0===e&&(e=7);var t=7-e;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*t*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){r=new Date(n);var e=r.getMonth(),t=e+o;return t>=11?(r.setFullYear(r.getFullYear()+parseInt(t/12)),r.setMonth(t%12)):r.setMonth(t),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(e){var t={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return r=new Date(n),e in t&&(o=t[e]*i),r.getTime()+o}};return e.natural!==!0?s.second(a):a in s?s[a]():void 0},getLast:function(e,t){var n=Number(e.value)||0,i=Number(e.value)-1||0,o=String(e.unit).toLowerCase(),a=null,r={day:function(){return a=new Date(t),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-864e5*i},week:function(){a=new Date(t);var e=a.getDay();return 0===e&&(e=7),--e,a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-(24*e*60*60*1e3+7*i*24*60*60*1e3)},month:function(){a=new Date(t);var e=a.getMonth()+1,n=e-i;return n<=0?(a.setFullYear(a.getFullYear()+(parseInt(n/12)-1)),a.setMonth(12+n%12-1)):a.setMonth(n-1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(e){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(t),e in i&&(o=i[e]*n),a.getTime()-o}};return e.natural!==!0?r.second(o):o in r?r[o]():void 0},getArrMatchCount:function(e,t){var n=0;for(n=0;n=e[n])return n;return e.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!r.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;u("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var e=!1,t=a.localData.eventQueue[0],n=a.eventRule[t.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),r.isArray(n)&&r.isObject(n[0])&&n.length>0&&(u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),r.each(n,function(e){r.isObject(e)&&"undefined"!=typeof e.match_state&&delete e.match_state,new a.RuleCheck(e,t)}),r.each(n,function(t){t.match_state===!0?e===!1?(e=!0,u("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",t.plan.cname),new a.PopupCheck(t,(!0))):e===!0&&(u("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",t.plan.cname),new a.PopupCheck(t,(!1))):u("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",t.plan.cname)}),e||a.completeWindowLifecycle(),u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(e,t){this.plan=e.plan,this.current_time=(new Date).getTime(),t?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(e,t){this.startConvertWindow(e),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),t&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(e,t,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},o=i[e],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=o,a.track.popupDisplay(s),!t&&a.info.popup_listener&&r.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,e,o),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),e,o),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(e){var t=a.getSFCampaign(e.plan),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(t),this.createPopupWindow(e.uuid,!0)},a.PopupCheck.prototype.showPopup=function(e){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var t=new a.ElementRender(e.content),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,r.extend(t.msg,n),t.popupCheckInstance=this,a.track.popupDisplay(n);var i=t.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(e.plan)),this.createPopupWindow(e.uuid),void a.info.popup_listener.onLoadSuccess(e.plan.plan_id)):(u("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(e){u("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),r.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:e},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(e){r.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,e))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var e=(new Date).getTime();this.startPopupIntervalWindow(e),this.resetGlobalLimit(e),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){u("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),r.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(r.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={ +define(function(){"use strict";function e(e){this.properties=e.properties,this.template=e.template,this.maskEle=null,this.containerEle=null,this.msg={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:"",$sf_succeed:"",$sf_fail_reason:"",$sf_msg_id:"",plan:{}},this.popupCheckInstance=null}function t(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=t.length-1,i={},o=0;for(o=0;o1024)return"object"==typeof console&&console.log&&console.log("H5 \u5f39\u7a97\u4ec5\u652f\u6301\u79fb\u52a8\u7aef\u548c ipad\uff0c\u6216\u8005\u5c4f\u5e55\u5bbd\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 1024\u3002"),!1;var e={};return arguments.length>0&&(1===arguments.length&&r.isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&r.isObject(arguments[1])&&(e=arguments[1])),!!this.setPara(e)&&(a.info.platform="H5",!!a.setIsLoad()&&(!!this.getBridgeState()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial()))))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.26.9",plugin_version:"1.26.9",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(e){var t={};if(e&&"[object Object]"===Object.prototype.toString.call(e)){for(var n in e)n&&"popup_window_content"!==n&&(t[n]=e[n]);return JSON.stringify(t,null," ")}return e},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-popupdata",loadedSign:"SensorsData2015JSSDKH5PopupIsLoad"};var r={visibility:function(e){e=e||{};var t={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:e.onVisible,_hidden:e.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){t._nativeSwitch.apply(t,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(e){}},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()}};t.init()},getRgba:function(e){return"object"!=typeof e?e:"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"},conversionNum:function(e){if(e){if(/^[0|1]?\.\d+$/.test(e))return 100*Number(e)+"%";var t=/^(-?\d+(\.\d+)?)px$/.exec(e);return t?(Number(t[1])/375*window.screen.width).toFixed(2)+"px":e}},boxModel:function(e){return function(t){if("object"!=typeof t)return e+":"+t+";";var n="";for(var i in t)n+=e+"-"+i+":"+r.conversionNum(t[i])+";";return n}},localStorage:{get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t=null;try{t=JSON.parse(r.localStorage.get(e))||null}catch(n){}return t},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";r.localStorage.set(t,n),r.localStorage.get(t)!==n&&(e=!1),r.localStorage.remove(t)}catch(i){e=!1}return e}},addEvent:function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}function t(t,n,i){var o=function(o){if(o=o||e(window.event)){o.target=o.srcElement;var a,r,s=!0;return"function"==typeof i&&(a=i(o)),r=n.call(t,o),!1!==a&&!1!==r||(s=!1),s}};return o}e._getPath=function(){var e=this,t=function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||t()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,o){if(n&&n.addEventListener)n.addEventListener(i,function(t){t._getPath=e._getPath,o.call(this,t)},!1);else{var a="on"+i,r=n[a];n[a]=t(n,o,r)}};n.apply(null,arguments)},extend:function(e){var t=Array.prototype.slice;return r.each(t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},extend2Lev:function(e){return r.each(Array.prototype.slice.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(r.isObject(t[n])&&r.isObject(e[n])?r.extend(e[n],t[n]):e[n]=t[n])}),e},each:function(e,t,n){var i=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,a={};if(null==e)return!1;if(o&&e.forEach===o)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,s=e.length;r=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r.isObject(e.header)&&r.each(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(e.data||null)},getUuid:function(){var e=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},t=function(){return Math.random().toString(16).replace(".","")};return function(){var n=e()+"-"+t()+"-"+t();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(e){var t=Object.prototype.hasOwnProperty;if(r.isObject(e)){for(var n in e)if(t.call(e,n))return!1;return!0}return!1},filter:function(e,t,n){var i=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var o=[],a=0;a=0;s--){var p=n[s];t[p]=a[p]}t.hostname&&"string"==typeof t.pathname&&0!==t.pathname.indexOf("/")&&(t.pathname="/"+t.pathname),t.searchParams=function(){var e=r.getURLSearchParams(t.search);return{get:function(t){return e[t]}}}()}return t},contentLoaded:function(e,t){var n=!1,i=!0,o=e.document,a=o.documentElement,r=o.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",l=r?"":"on",u=function(i){"readystatechange"==i.type&&"complete"!=o.readyState||(("load"==i.type?e:o)[p](l+i.type,u,!1),!n&&(n=!0)&&t.call(e,i.type||i))},c=function(){try{a.doScroll("left")}catch(e){return void setTimeout(c,50)}u("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(!r&&a.doScroll){try{i=!e.frameElement}catch(_){}i&&c()}o[s](l+"DOMContentLoaded",u,!1),o[s](l+"readystatechange",u,!1),e[s](l+"load",u,!1)}},indexOf:function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(e){function t(e){r.each(e.subviews,function(e){var i=e.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===e.type&&(n.$sf_msg_image_url=i.image),e.subviews&&t(e)})}if(!r.isObject(e)||!r.isObject(e.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return t(e.template),n},a.getSFCampaign=function(e){e=r.isObject(e)?e:{};var t={planId:"",name:"",content:null,type:""};return t.planId=e.plan_id||"",t.name=e.cname||"",t.content=r.isObject(e.popup_window_content)?e.popup_window_content.content:"",t.type=r.isObject(e.popup_window_content)&&e.popup_window_content.popup_type?e.popup_window_content.popup_type:"PRESET",t},a.getImageList=function(e){if(!r.isArray(e))return!1;for(var t,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),a={},s=e.length,p=[],l=!1,u=0;u0&&(a[n[0]]||(a[n[0]]=1));return r.each(a,function(e,t){p.push(t)}),p},a.setIsLoad=function(){var e=window.self===window.top;if(e){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(t){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",t),!0}};var s={close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAe1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////NgkbwAAAAKHRSTlMA5if6t/B0UjMSxpAtJB4MBfTr30oY6NjV0r2loZ6XkoaBenFp3UA/LNePaQAAAsxJREFUWMOsltlygzAMRRXMZsAsAZJmX9v6/7+wg1QXpjGxCDkvyWTIQZauDcCgzKLrPtnUSyGW9SbZX6OshDcQh36lH6j8MJ7pTZd6lGX6sr0IP7SDj7CA6chLoBkEFzm14nM1/P/2eGti1RZFq+LmdtwGw7afJ1Ue1dogcGCW4QptqCO2OPe1IbnL0Y7dE23wc2bJgSn44MFTvIMwLeMUXqZGfGKUkp+MPC2dwUjMGhWwUL7pnXRUsdbIIpow84VG1k9Xmf1e5U8Kq/R/68memAPqcggTCQUNc9SdL+iCL5jMd0B1j/RErh3LYrRyLa2po2x8KngJ9Uk5sWUwpZoVvIiiulNLhMwgHDhDED2MEH8X3zCDL4HV/R8lRTOEWYS0KWzt8GEm/mNLihpHKOeqJY6yLqDnbO42F1r9eXCzitMOfkuqfvkXTId6h1phSi5/ncbgneAtnDCAxTAzIn+POhfDFOObzAEsNLu0HXO06a4BCwd89wEk1h2ezdwl0rObvS5nNreHurg/lxKwsNPoHjXrHVhI+lMK3xjvMH4YelYzCSzc8V3zrx9CWtu5MG67eWEdhBSmI+GT7eIZt+Nny7YJ+y8ON9/cF1tWVL7LzTdTi6sSMtw9AE432wwl7u6MzqotMNwcM7Glc/TafRyB4+aa4dhdcoV993EDlptphlt3zZ72TgM8N88MDe3vDQWE5V6tWGaKyAbwqaiA5+aZQeETkk6QFtxuvhlaOkVwwxfgdq/IvHKbocBj6ac5OzYCIASBKGo10n+HBgakMswbaYDgTmX3fzgafhD4G+Hhg1cGXnT4PMFHVayCdVcBXGBu7cKwACOOC2YwTsIQ7KI7LBywJrlyByupK9Kw/lto4VFLAqLdmRwJiBDWwjDOI0QPPhPXRn3yTlyrILND4w7oOw3h5AlTPk5U/ddrZSk4RWW+C9hp2rgru6GiP/678n2UFPV1AAAAAElFTkSuQmCC"},p={row:"div",column:"div",label:"pre",image:"img",button:"button",link:"button",image_button:"img"},l={textAlign:"text-align",font:"font-size",backgroundColor:"background-color",borderWidth:function(e){return"border-width: "+e+";border-style: solid;"},borderColor:"border-color",cornerRadius:"border-radius",backgroundImage:function(e){return"background-image:url("+e+");background-repeat: no-repeat;background-size: 100% 100%;"},margin:r.boxModel("margin"),padding:r.boxModel("padding"),maxHeight:"max-height",maxWidth:"max-width",scrollableX:function(e){if(e)return"overflow-x:auto;"},scrollableY:function(e){if(e)return"overflow-y:auto;"}};e.prototype={constructor:e,render:function(){function e(e,n){var i=e.maskAction.H5,o=r.isArray(i)&&i[0];if(r.isObject(o))switch(n.$sf_close_type=o.$sf_close_type||"",n.$sf_msg_element_action=o.type||"",o.type){case"copy":a.track.trackEvent("$PlanPopupClick",n,t.msg);break;case"customize":case"openlink":a.track.trackEvent("$PlanPopupClick",n,t.msg),o.closeable&&t.destory();break;case"close":o.closeable&&(a.track.trackEvent("$PlanPopupClick",n,t.msg),t.destory())}}var t=this,n=document.querySelector("div[data-sf-mask]");return!n&&(t.template.isRoot=!0,t.containerEle=t.createView(t.template),t.maskEle=t.getElement({nodeName:"div",attr:{"data-sensors-click":!0},style:t.getStyle({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:r.getRgba(t.properties.maskColor),"z-index":999998})}),r.addEvent(t.maskEle,"click",function(n){var i=n.target,o=i.getAttribute("data-ele-mask"),r=t.properties,s=t.msg;if(!s)return!1;var p={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_action:"close",$sf_msg_element_type:"mask",$sf_msg_action_id:r.maskActionId};return o&&r&&r.maskAction?(e(r,p),!1):o&&t.properties.maskCloseEnabled?(a.track.trackEvent("$PlanPopupClick",p,s),t.destory(),!1):void a.track.elementClickCallback(n,t)}),t.maskEle.setAttribute("data-sf-mask",!0),t.maskEle.appendChild(t.containerEle),r.contentLoaded(window,function(){t.appendPopup()}),!0)},appendPopup:function(){if(window.self===window.top)document.body.appendChild(this.maskEle);else try{window.top.document.body.appendChild(this.maskEle)}catch(e){document.body.appendChild(this.maskEle)}var t=document.querySelector("[data-ele-mask] > div"),n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;t&&t.offsetHeight>n&&(t.style.marginTop="auto")},getElement:function(e){var t=e.nodeName||"div",n=e.style,i=e.attr,o=e.prop,a=e.child,s=e.action,p=e.element_info,l=document.createElement(t);return n&&l.setAttribute("style",n),i&&r.each(i,function(e,t){e&&l.setAttribute(t,e)}),o&&r.each(o,function(e,t){e&&(l[t]=e)}),a&&a.length&&r.each(a,function(e){return!!e&&void l.appendChild(e)}),s&&s.H5&&s.H5.length&&l.setAttribute("data-action",JSON.stringify(s.H5)),p&&l.setAttribute("data-info",JSON.stringify(p)),l},getStyle:function(e){var t="",n=["msgType","text","image","name","isHidden","align","localImageName"];return r.each(e,function(e,i){var e=r.conversionNum(e),o=l[i];return!(r.indexOf(n,i)>=0)&&void(t+=r.isString(o)?o+":"+r.getRgba(e)+";":r.isFunction(o)?o(e)+";":i+":"+r.getRgba(e)+";")}),t},createView:function(e){var t=[],n={"box-sizing":"border-box",display:"block","pointer-events":"auto",overflow:"hidden"},i={},o={},a=p[e.type]||null;e.properties=e.properties||{},e.layout=e.layout||{};var l=e.properties.font,u=l?1.7*parseInt(l)+"px":"normal";if(e.properties.isHidden)return!1;switch(e.properties.text?o.innerText=e.properties.text:e.properties.image&&(i["data-sensors-click"]=!0,e.properties.localImageName?i.src=s[e.properties.localImageName]:i.src=e.properties.image),e.isRoot&&(e.layout.margin.top="-40px",r.extend(n,{position:"relative","z-index":999999,"pointer-events":"none"})),e.type){case"row":n.display="flex";break;case"link":r.extend(n,{"text-decoration":"underline",outline:"none","letter-spacing":"1px","line-height":u});break;case"label":r.extend(n,{"white-space":"pre-wrap","word-wrap":"break-word","letter-spacing":"1px","line-height":u,"margin-top":"0px","margin-bottom":"0px"});break;case"button":r.extend(n,{outline:"none","letter-spacing":"1px","line-height":u})}r.extend(n,e.layout,e.properties),e.subviews&&e.subviews.length>0&&r.each(e.subviews,function(e){t.push(this.createView(e))},this);var c=this.getElement({element_info:{$sf_msg_element_type:e.type,$sf_msg_element_content:e.properties.text||""},nodeName:a,attr:i,prop:o,style:this.getStyle(n),child:t,action:e.action});if(e.layout.align){var _={center:"center",left:"flex-start",right:"flex-end"},d=document.createElement("div"),n="display:flex;justify-content:"+_[e.layout.align]+";";return e.isRoot?(n+="width:100%;height:100%;overflow-y:auto;box-sizing: border-box;align-items:center;",d.setAttribute("style",n),d.setAttribute("data-ele-mask",!0)):d.setAttribute("style",n),d.appendChild(c),d}return c},destory:function(){var e=this.msg.plan.plan_id||"";if(window.self===window.top)document.body.removeChild(this.maskEle);else try{window.top.document.body.removeChild(this.maskEle)}catch(t){document.body.removeChild(this.maskEle)}a.info.popup_listener.onClose(e),a.info.popup_campaign_listener.onEnd(a.getSFCampaign(this.msg.plan)),this.popupCheckInstance&&this.popupCheckInstance.resetPopupIntervalWindow()}},a.ElementRender=e,a.handlerCampaign=function(e){var t=e,n=r.getUuid()(),i=t.plan.popup_window_content;if(!r.isObject(i))return t.popupFailed(1001,!1,{uuid:n,content:"",plan:t.plan}),!1;var o;if(i.content)try{o=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(t.plan),l={state:"",isCustom:!1},u=!0;try{u=a.info.popup_campaign_listener.shouldStart(p)}catch(s){u=!1,a.log(s)}var c={uuid:n,content:o,plan:t.plan};switch(t.plan.strategy_id?t.plan.is_trigger?u?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":r.isString(i.content)?l.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":l.state="DIALOG_NOT_SHOW_JSON_FAILED":"PRESET"===i.popup_type&&r.isObject(o)&&r.isObject(o.properties)&&r.isObject(o.template)?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START":l.state="CAMPAIGN_NOT_START_TRIGGER":t.plan.is_control_group?l.state="DIALOG_NOT_SHOW":u?r.isObject(o)&&o.properties&&o.template?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START",l.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",l,"plan:",t.plan.cname),l.state){case"DIALOG_SHOW":t.showPopup(c);break;case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":t.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":t.popupFailed(1004,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":t.popupFailed(1006,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":t.popupFailed(1006,l.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":t.popupFailed(1001,l.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":t.popupFailed(1005,l.isCustom,c);break;case"DIALOG_NOT_SHOW":t.popupFailed(1003,l.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(e){var t=e.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:e.$sf_msg_id};return r.isEmptyObject(t)||!r.isObject(t)?n:(n.$sf_plan_id=t.plan_id+"",n.$sf_plan_strategy_id=t.strategy_id?t.strategy_id:t.is_control_group?"-1":"0",t.audience_id&&(n.$sf_audience_id=t.audience_id+""),t.section_id&&(n.$sf_section_id=String(t.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(e){var t={$sf_msg_title:e.$sf_msg_title,$sf_msg_content:e.$sf_msg_content,$sf_msg_image_url:e.$sf_msg_image_url,$sf_succeed:e.$sf_succeed,$sf_fail_reason:e.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",t,e)},trackEvent:function(e,t,n){var i=a.track.getPublicProps(n);r.extend(t,i),r.each(t,function(e,n){""!==e&&void 0!==e||delete t[n]}),a.sa.track(e,t)},maskClick:function(e){if(!e.msg)return!1;var t={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:e.msg.$sf_msg_title,$sf_msg_content:e.msg.$sf_msg_content,$sf_msg_image_url:e.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:e.properties.maskActionId};this.trackEvent("$PlanPopupClick",t,e.msg),e.destory()},elementClickCallback:function(e,t){var n=e.target,i=n.getAttribute("data-action"),o=n.getAttribute("data-info"),s=t.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},l=p[0],u=JSON.parse(o)||{}}catch(e){a.log("elementClickCallback error",e)}var c={type:l.type,value:r.isString(l.value)?l.value:"",extra:r.isObject(l.value)?l.value:""},_=t.msg.plan?t.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:u.$sf_msg_element_type,$sf_msg_element_content:u.$sf_msg_element_content,$sf_msg_element_action:l.type,$sf_msg_action_id:l.id,$sf_close_type:"close"===l.type?l.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=t.msg.plan;if(f){var m={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(m)}}catch(e){a.log("popup_listener.onClick error",e)}if("close"===l.type)t.destory();else if(l.closeable?t.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===l.type){if("http"!==l.value.slice(0,4))return!1;window.location.href=l.value}}};var u=a.log;a.changeCovertStatus=function(e){var t=JSON.parse(JSON.stringify(a.convertPlans));r.each(t,function(t,n){if(!t.is_in_convert_window)return!1;var i=t.is_in_convert_window.step,o=t.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!e&&void r.each(e,function(e){e.popup_display_uuid===o&&e.convert_time&&(u("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(e){function t(){if(r.isEmptyObject(a.localData)||!r.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var e=JSON.parse(JSON.stringify(a.convertPlans)),i=e[0].is_in_convert_window&&e[0].is_in_convert_window.step||5e3,o=[];return r.each(e,function(e,t){if(!e.is_in_convert_window)return!1;var n=(new Date).getTime(),r=e.is_in_convert_window.expire_time;return n>r?(u("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[t].plan_id),delete a.convertPlans[t].is_in_convert_window,a.convertPlans.splice(t,1),a.updateDataAndSetListen.updateLocalData(),!1):(o.push(e.is_in_convert_window.uuid),e.is_in_convert_window.step||(e.is_in_convert_window.step=5e3,a.convertPlans[t].is_in_convert_window.step=5e3),void(i>e.is_in_convert_window.step&&(i=e.is_in_convert_window.step)))}),!!o.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){r.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(e){a.changeCovertStatus(e),t()},error:function(){a.changeCovertStatus(),t()}})},i)))}var n=a.info.project,i=!1;return!(!e&&0===a.convertPlans.length)&&(e&&(r.each(a.convertPlans,function(t){t.plan_id===e.plan_id&&(i=!0)}),i||a.convertPlans.push(e)),void t())},a.ruleTime={getExpire:function(e,t){var n=t,i=Number(e.value)||0,o=Number(e.value)||0,a=String(e.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(o-1)},week:function(){r=new Date(n);var e=r.getDay();0===e&&(e=7);var t=7-e;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*t*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){r=new Date(n);var e=r.getMonth(),t=e+o;return t>=11?(r.setFullYear(r.getFullYear()+parseInt(t/12)),r.setMonth(t%12)):r.setMonth(t),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(e){var t={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return r=new Date(n),e in t&&(o=t[e]*i),r.getTime()+o}};return e.natural!==!0?s.second(a):a in s?s[a]():void 0},getLast:function(e,t){var n=Number(e.value)||0,i=Number(e.value)-1||0,o=String(e.unit).toLowerCase(),a=null,r={day:function(){return a=new Date(t),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-864e5*i},week:function(){a=new Date(t);var e=a.getDay();return 0===e&&(e=7),--e,a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-(24*e*60*60*1e3+7*i*24*60*60*1e3)},month:function(){a=new Date(t);var e=a.getMonth()+1,n=e-i;return n<=0?(a.setFullYear(a.getFullYear()+(parseInt(n/12)-1)),a.setMonth(12+n%12-1)):a.setMonth(n-1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(e){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(t),e in i&&(o=i[e]*n),a.getTime()-o}};return e.natural!==!0?r.second(o):o in r?r[o]():void 0},getArrMatchCount:function(e,t){var n=0;for(n=0;n=e[n])return n;return e.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!r.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;u("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var e=!1,t=a.localData.eventQueue[0],n=a.eventRule[t.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),r.isArray(n)&&r.isObject(n[0])&&n.length>0&&(u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),r.each(n,function(e){r.isObject(e)&&"undefined"!=typeof e.match_state&&delete e.match_state,new a.RuleCheck(e,t)}),r.each(n,function(t){t.match_state===!0?e===!1?(e=!0,u("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",t.plan.cname),new a.PopupCheck(t,(!0))):e===!0&&(u("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",t.plan.cname),new a.PopupCheck(t,(!1))):u("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",t.plan.cname)}),e||a.completeWindowLifecycle(),u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(e,t){this.plan=e.plan,this.current_time=(new Date).getTime(),t?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(e,t){this.startConvertWindow(e),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),t&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(e,t,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},o=i[e],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=o,a.track.popupDisplay(s),!t&&a.info.popup_listener&&r.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,e,o),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),e,o),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(e){var t=a.getSFCampaign(e.plan),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(t),this.createPopupWindow(e.uuid,!0)},a.PopupCheck.prototype.showPopup=function(e){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var t=new a.ElementRender(e.content),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,r.extend(t.msg,n),t.popupCheckInstance=this,a.track.popupDisplay(n);var i=t.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(e.plan)),this.createPopupWindow(e.uuid),void a.info.popup_listener.onLoadSuccess(e.plan.plan_id)):(u("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(e){u("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),r.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:e},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(e){r.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,e))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var e=(new Date).getTime();this.startPopupIntervalWindow(e),this.resetGlobalLimit(e),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){u("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),r.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(r.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={ expire_time:a.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},a.PopupCheck.prototype.setGlobalLimit=function(){u("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),r.isArray(a.localData.global_popup_count)||(a.localData.global_popup_count=[]),a.localData.global_popup_count.unshift(this.current_time);for(var e=a.localData.global_popup_count,t=e[e.length-1];t+7776e63e3;)e.pop(),t=e[e.length-1]},a.PopupCheck.prototype.resetGlobalLimit=function(e){r.isArray(a.localData.global_popup_count)&&a.localData.global_popup_count.length>0&&(a.localData.global_popup_count.shift(),a.localData.global_popup_count.unshift(e))},a.PopupCheck.prototype.deletePlanAllWindow=function(){var e=this.plan.pattern_popup.matcher_list;r.isArray(e)&&r.each(e,function(e){e.is_in_window&&(u("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete e.is_in_window)})},a.RuleCheck=function(e,t){this.plan_match=e,this.plan=e.plan,this.rule_arr=e.rule,this.event_data=t,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";r.each(this.rule_arr,function(e){n+="--\u5305\u542b\u89c4\u5219-("+e.event_name+"\uff09-\u89e6\u53d1"+e.params[0]+"\u6b21"}),u(n),u(this.plan),this.checkPlanIsExpire(),a.updateDataAndSetListen.updateLocalData()},a.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||r.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)u("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(r.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){u("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var e=0;e=1){var t=a.ruleTime.getLast(a.localData.popup_interval_global,this.current_time);t>e[0]?(u("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+t+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0]),this.checkPopupInterval()):u("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+t+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0])}else u("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},a.RuleCheck.prototype.checkPopupInterval=function(){var e=!0;r.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(u("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null):(u("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"),e=!1):(u("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null),e&&this.checkPermission()&&this.checkProperties()},a.RuleCheck.prototype.isMatched=function(e){var t={equal:function(e,t){if(!r.isNumber(e)&&!r.isString(e))return!1;for(var n=0,i=t.length;n=0},notContain:function(e,t){return!!r.isString(e)&&e.indexOf(t[0])===-1},isTrue:function(e){return e===!0},isFalse:function(e){return e===!1},isSet:function(e){return"undefined"!=typeof e},notSet:function(e){return"undefined"==typeof e},isEmpty:function(e){if(!r.isString(e)&&!r.isArray(e))return!1;if(r.isString(e))return""===e;for(var t=0;tr.getConvertNumberValue(t[0]))},between:function(e,t){if(!r.isNumber(e))return!1;if("undefined"==typeof t[0]&&"undefined"==typeof t[1])return!1;var n=r.getConvertNumberValue(e),i=r.getConvertNumberValue(t[0]),o=r.getConvertNumberValue(t[1]);return n>=i&&n<=o},isIn:function(e,t){if(!r.isArray(e))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(e,t){if(!r.isArray(e))return!1;for(var n=0;n=n&&o<=i}catch(a){u("absolute_between Error",a)}},absoluteBetween:function(e,t){try{var n=new Date(t[0]),i=new Date(t[1]),o=new Date(e);return o>=n&&o<=i}catch(a){u("absolute_between Error",a)}}},n=this,i=e.relation,o="or"===String(i).toLowerCase(),a="and"===String(i).toLowerCase(),s=!!a,p=!0;return r.each(e.conditions,function(e){if(!p)return!1;if(!e.field)return!1;var i=e.field.lastIndexOf("."),r=e.params,l="in"===e["function"]?"isIn":e["function"];if(!t[l])return s=!1,p=!1,!1;if(i<0)return!1;var u=e.field.slice(i+1),c=n.event_data.properties,_=c[u];"$event_duration"===u&&void 0===_&&(_=c.event_duration);var d=t[l](_,r);o&&d&&(s=!0,p=!1),a&&!d&&(s=!1,p=!1)}),s},a.RuleCheck.prototype.checkProperties=function(){var e=this,t=r.filter(this.rule_arr,function(t){var n=t.multi_filter?t.multi_filter:t.filter;return!(n&&(!n.conditions||0!==n.conditions.length))||e.isMatched(n)});r.isArray(t)&&t.length>0?(this.checkWindowAndMatch(t),u("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",t)):u("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},a.RuleCheck.prototype.checkPermission=function(){function e(t){r.each(t,function(t){if(o=s([t]),r.isArray(o)&&o.length>0){var n=t.filters||[];n&&n.length>0&&e(n)}})}var t=this.plan.event_permission;if(!r.isObject(t)||r.isEmptyObject(t))return!0;var n=[t],i=this,o=[],s=function(e){var t=r.filter(e,function(e){return!(e&&e.conditions&&(!e.conditions||0!==e.conditions.length))||i.isMatched(e)});return t};return e(n),r.isArray(o)&&o.length>0?(a.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",o),!0):(a.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3"),!1)},a.RuleCheck.prototype.checkWindowAndMatch=function(e){var t=this,n=[];r.each(e,function(e){if(!e.params||!e.params[0])return u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var i=Number(e.params[0]);1===i?n.push(e):i>1&&r.isObject(e.window)&&e.window.value>0&&(!r.isObject(e.is_in_window)||!r.isNumber(e.is_in_window.expire_time)||e.is_in_window.expire_time=i?n.push(e):u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",e.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",i))}),n.length>0?(u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},a.RuleCheck.prototype.checkGlobalPopupLimit=function(){var e=a.localData.msg_limit_global,t=!0,n=this;r.isObject(e)&&e.is_in_use===!0&&r.isArray(e.limits)&&r.isArray(a.localData.global_popup_count)&&this.plan.global_msg_limit_enabled===!0?(r.each(e.limits,function(e){if(r.isObject(e)&&r.isNumber(e.limit)){var i=a.ruleTime.getLast(e,n.current_time),o=a.ruleTime.getArrMatchCount(a.localData.global_popup_count,i);u("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+o+"-\u9650\u5236\u7684\u6b21\u6570"+e.limit+"-\u9650\u5236\u65f6\u95f4-"+i),t=o0&&(a.updateDataAndSetListen.interval_time=a.localData.config_pull_interval_ms),this.removeLocalData(),a.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var e=r.localStorage.get(a.config.storageName);r.isString(e)&&(e=n(e));try{e=JSON.parse(e)}catch(t){r.log(t)}return e},saveJSONData:function(e){e=JSON.stringify(e),a.info.encrypt_cookie&&(e=i(e)),r.localStorage.set(a.config.storageName,e)},migrateLocalData:function(){var e=this.getJSONData()||{},t=a.sa.store.getDistinctId();if(e.popup_sdk_users&&e.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[t]=e,n.popup_sdk_users[t]={user_id:t},this.saveJSONData(n)},getLocalData:function(){var e=this.getJSONData(),t=a.sa.store.getDistinctId(),n=null;return e?(r.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id),n&&r.isObject(e.popup_sdk_plans[n])?(e.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(e),e.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var e=this.getJSONData(),t=a.sa.store.getDistinctId(),n=null;return!!e&&void(e.popup_sdk_users&&r.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id,e.popup_sdk_plans[n]=a.localData,this.saveJSONData(e)))},removeLocalData:function(){var e=this.getJSONData(),t=this.delete_time;if(!e||!e.popup_sdk_plans||!e.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(e.popup_sdk_plans)),i=JSON.parse(JSON.stringify(e.popup_sdk_users)),o=(new Date).getTime(),a=[];r.each(n,function(n,i){o-n.update_time>t&&(delete e.popup_sdk_plans[i],a.push(i))}),r.each(i,function(t,n){a.length>0&&r.each(a,function(i){t.user_id&&i===t.user_id&&delete e.popup_sdk_users[n]})}),this.saveJSONData(e)}},a.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var e=a.localData.popup_plans;if(!e||!r.isArray(e))return!1;var t=r.filter(e,function(e){return!!e.convert_window&&!!e.is_in_convert_window});a.convertPlans=t,a.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",a.convertPlans),a.asyncConvert()},diffData:function(){var e=a.localData,t=JSON.parse(JSON.stringify(a.serverData));(new Date).getTime();if(!t||r.isEmptyObject(t))return!1;if(!e||r.isEmptyObject(e)||!e.popup_plans||0===e.popup_plans.length)return r.extend(a.localData,t),!1;var n=t.popup_plans;r.each(n,function(t,i){var o=null;if(r.each(e.popup_plans,function(e){e.plan_id===t.plan_id&&(o=e,t.audience_id||delete o.audience_id,r.isObject(t.window_update)&&r.each(t.window_update,function(e,n){o.window_update&&o.window_update[n]===e||("trigger_window"===n?o.pattern_popup.matcher_list=t.pattern_popup.matcher_list:"convert_window"===n&&o.is_in_convert_window&&t.convert_window&&o.is_in_convert_window.start_time&&(o.is_in_convert_window.expire_time=a.ruleTime.getExpire(t.convert_window,o.is_in_convert_window.start_time)))}))}),!o)return!1;if(!t.window_update&&o.last_update_config_time!==t.last_update_config_time)return!1;var s=o.pattern_popup.matcher_list;r.extend2Lev(o,t),o.pattern_popup.matcher_list=s,n[i]=o}),r.extend(a.localData,t)},getEventRule:function(){var e=a.localData.popup_plans,t={};return!(!e||!r.isArray(e))&&(r.each(e,function(e){var n=e.pattern_popup.matcher_list;r.each(n,function(n){var i={plan:e,rule:[n]},o=n.event_name,a=!1;if(t[o]){if(r.each(t[o],function(t){t.plan.plan_id===e.plan_id&&(t.rule.push(n),a=!0)}),a)return!1;t[o].push(i)}else t[o]=[i]})}),r.each(t,function(e){e.sort(function(e,t){var n=t.plan.absolute_priority-e.plan.absolute_priority;return 0===n?t.plan.plan_id-e.plan.plan_id:n})}),a.eventRule=t,a.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),void a.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------"))},registerListen:function(){var e=this;a.sa.events.on("send",function(t){t.event&&a.eventRule[t.event]&&(r.isArray(a.localData.eventQueue)||(a.localData.eventQueue=[]),a.localData.eventQueue.push(t),e.updateLocalData(),a.eventTriggerProcess())}),a.sa.events.on("changeDistinctId",function(t){e.changeId()}),a.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(e){function t(e){var t=new Image;t.src=e}if(e.length<1)return!1;if(JSON.stringify(e)===JSON.stringify(this.image_list))return!1;this.image_list=e;for(var n=0;n0&&(n.interval_time=i.config_pull_interval_ms),a.serverData.local_update_time=(new Date).getTime(),a.info.preload_image&&n.loadImage(a.getImageList(i.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},a.localData={},n.updateLocalData()),e(),void n.setIntervalTime(n.interval_time)):(t(),!1)},error:function(){return n.active_state?(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},e(),void n.setIntervalTime(n.interval_time)):(t(),!1)}})},updateUserPlans:function(){var e=a.store.getJSONData(),t=a.sa.store.getDistinctId(),n=a.serverData.user_id;e.popup_sdk_users[t]={user_id:n||t},n?e.popup_sdk_plans[n]?a.localData=e.popup_sdk_plans[n]:e.popup_sdk_plans[t]&&(a.localData=e.popup_sdk_plans[t],delete e.popup_sdk_plans[t]):e.popup_sdk_plans[t]&&(a.localData=e.popup_sdk_plans[t]),a.localData.update_time=(new Date).getTime(),a.store.saveJSONData(e)},setIntervalTime:function(e){var t=this;this.data_interval=setTimeout(function(){a.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),t.getDataFromServer()},e)},setFirstListen:function(){var e=this;this.getDataFromServer(function(){e.registerListen()})},updateLocalData:function(){var e=JSON.stringify(a.localData);this.local_data!==e&&(this.local_data=e,a.store.saveLocalData())},initial:function(){a.store.init();var e=a.localData.local_update_time,t=(new Date).getTime();if(r.isNumber(e)){var n=t-e;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),a.info.preload_image&&this.loadImage(a.getImageList(a.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,a.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),a.asyncConvert.timer&&window.clearTimeout(a.asyncConvert.timer),a.convertPlans=[],a.localData={},this.resetState()},resetState:function(){return"WEB"!==a.info.platform&&void(!document.querySelector("div[data-sf-mask]")&&a.isRun&&(a.isRun=!1))},startState:function(e){this.active_state=!0,e=e||{getLocalData:!0},e.getLocalData&&(this.resetState(),a.localData=a.store.getLocalData()),this.getDataFromServer()}},a.testSend={hasParam:function(){var e=r.URL(window.location.href).searchParams,t=e.get("sf_popup_test")||"",n=e.get("popup_window_id")||"",i=e.get("platform");return!(!t||!n)&&{sf_popup_test:t,popup_window_id:n,platform:i}},start:function(){var e=a.info.project,t=a.info.platform,n=this.hasParam().popup_window_id,i=this.hasParam().platform,o=encodeURIComponent(a.sa.store.getDistinctId());return"WEB"===i?(a.log("WEB\u7aef\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728PC\u8bbe\u5907\u6253\u5f00\uff01"),!1):void r.ajax({url:a.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(e)+"&time="+(new Date).getTime()+"&sdk_version="+a.lib_version+"&platform="+encodeURIComponent(t)+"&distinct_id="+o,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(e){var t,n=r.getUuid();r.isObject(e)||(a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",e),e={});try{t=JSON.parse(e.content)}catch(i){a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",e,i)}var o=a.getPopupInfo(t);o.$sf_msg_id=n;var s={content:e.content,type:e.popup_type||"PRESET"};if(Object.hasOwnProperty.call(e,"name")&&(s.name=e.name),e.popup_type&&"CUSTOMIZED"===e.popup_type)r.isString(e.content)?"withoutCampaignListener"===a.info.supportCustom||"withoutStart"===a.info.supportCustom?(o.$sf_succeed=!1,o.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",a.track.popupDisplay(o),a.info.popup_campaign_listener.onFailed(s,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(o.$sf_succeed=!0,a.track.popupDisplay(o),a.info.popup_campaign_listener.onStart(s)):(o.$sf_succeed=!1,o.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",a.track.popupDisplay(o),a.info.popup_campaign_listener.onFailed(s,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"));else if(r.isObject(t)&&r.isObject(t.properties)&&r.isObject(t.template)){var p=new a.ElementRender(t);p.render(),o.$sf_succeed=!0,a.track.popupDisplay(o),a.info.popup_campaign_listener.onStart(s),a.info.popup_listener.onLoadSuccess()}else o.$sf_succeed=!1,o.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",a.track.popupDisplay(o),a.info.popup_listener.onLoadFailed("",1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"),a.info.popup_campaign_listener.onFailed(s,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e")},error:function(e){a.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",e)}})}},a.setPara=function(e){r.isObject(e)||(e={}),a.info=r.extend({},a.defaultPara,e);var t=a.sa;if(!t)return a.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1;if(t.para.encrypt_cookie===!0&&(a.info.encrypt_cookie=!0),!r.isString(a.info.api_base_url)||"http"!==a.info.api_base_url.slice(0,4))return a.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1;if("http:"===a.info.api_base_url.slice(0,5)&&"https:"===location.protocol)return a.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1;if(a.info.api_base_url="/"===a.info.api_base_url.slice(-1)?a.info.api_base_url.slice(0,-1):a.info.api_base_url,!r.isString(t.para.server_url)||"http"!==t.para.server_url.slice(0,4))return a.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1;if(a.info.project||(a.info.project=r.URL(t.para.server_url).searchParams.get("project")||"default"),r.isObject(a.info.popup_listener)){var n=a.info.popup_listener;r.isFunction(n.onClick)||(a.info.popup_listener.onClick=function(){}),r.isFunction(n.onLoadSuccess)||(a.info.popup_listener.onLoadSuccess=function(){}),r.isFunction(n.onLoadFailed)||(a.info.popup_listener.onLoadFailed=function(){}),r.isFunction(n.onClose)||(a.info.popup_listener.onClose=function(){}),r.isString(n.openlink)?"auto"!==n.openlink&&"customize"!==n.openlink&&(a.info.popup_listener.openlink="customize"):a.info.popup_listener.openlink="customize"}else a.info.popup_listener={onClick:function(){},onLoadSuccess:function(){},onLoadFailed:function(){},onClose:function(){},openlink:"customize"};return a.info.supportCustom=!0,r.isObject(a.info.popup_campaign_listener)?(r.isFunction(a.info.popup_campaign_listener.shouldStart)||(a.info.popup_campaign_listener.shouldStart=function(){return!0}),r.isFunction(a.info.popup_campaign_listener.onStart)||(a.info.supportCustom="withoutStart",a.info.popup_campaign_listener.onStart=function(){}),r.isFunction(a.info.popup_campaign_listener.onEnd)||(a.info.popup_campaign_listener.onEnd=function(){}),r.isFunction(a.info.popup_campaign_listener.onFailed)||(a.info.popup_campaign_listener.onFailed=function(){}),r.isFunction(a.info.popup_campaign_listener.onClick)||(a.info.popup_campaign_listener.onClick=function(){})):(a.info.supportCustom="withoutCampaignListener",a.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0},a.getBridgeState=function(){return!r.isObject(a.sa.para.app_js_bridge)||!a.sa.para.app_js_bridge.is_mui&&(!a.sa.bridge||!a.sa.bridge.is_verify_success)},a.init=function(){var e=window.sensorsDataAnalytic201505;if(a.sa=e,e&&e.readyState&&e.readyState.state>=3||!e.on)o.apply(this,arguments);else{var t=this,n=arguments;e&&e.on("sdkReady",function(){o.apply(t,n)})}},a.plugin_name="Popup",window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?(window.SensorsDataWebJSSDKPlugin.popup=window.SensorsDataWebJSSDKPlugin.popup||a,window.SensorsDataWebJSSDKPlugin.Popup=window.SensorsDataWebJSSDKPlugin.Popup||a):window.SensorsDataWebJSSDKPlugin={popup:a,Popup:a},a}); \ No newline at end of file diff --git a/dist/web/plugin/sf-sdk-web/popup.esm.min.js b/dist/web/plugin/sf-sdk-web/popup.esm.min.js index c7e16fc6..a9e15b2c 100644 --- a/dist/web/plugin/sf-sdk-web/popup.esm.min.js +++ b/dist/web/plugin/sf-sdk-web/popup.esm.min.js @@ -1 +1 @@ -var popup={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.26.8",plugin_version:"1.26.8",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(e){var t={};if(e&&"[object Object]"===Object.prototype.toString.call(e)){for(var n in e)n&&"popup_window_content"!==n&&(t[n]=e[n]);return JSON.stringify(t,null," ")}return e},log:function(){if(!0===popup.info.show_log&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=popup.setArg(arguments[0]),arguments[1]=popup.setArg(arguments[1]),console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}},config:{storageName:"sensorsdata202002-popupdata",loadedSign:"SensorsData2015JSSDKH5PopupIsLoad"}},_={visibility:function(e){e=e||{};var t={hidden:undefined,visibilityChange:undefined,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:e.onVisible,_hidden:e.onHidden,_nativeSwitch:function(){!0===document[this.hidden]?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){t._nativeSwitch.apply(t,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(e){}},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()}};t.init()},getRgba:function(e){return"object"!=typeof e?e:"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"},conversionNum:function(e){if(e){if(/^[0|1]?\.\d+$/.test(e))return 100*Number(e)+"%";var t=/^(-?\d+(\.\d+)?)px$/.exec(e);return t?(Number(t[1])/375*window.screen.width).toFixed(2)+"px":e}},boxModel:function(e){return function(t){if("object"!=typeof t)return e+":"+t+";";var n="";for(var p in t)n+=e+"-"+p+":"+_.conversionNum(t[p])+";";return n}},localStorage:{get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t=null;try{t=JSON.parse(_.localStorage.get(e))||null}catch(n){}return t},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";_.localStorage.set(t,n),_.localStorage.get(t)!==n&&(e=!1),_.localStorage.remove(t)}catch(p){e=!1}return e}},addEvent:function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}e._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(p){return[]}}()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};(function(t,n,p){if(t&&t.addEventListener)t.addEventListener(n,function(t){t._getPath=e._getPath,p.call(this,t)},!1);else{var o="on"+n,i=t[o];t[o]=function(t,n,p){return function(o){if(!(o=o||e(window.event)))return undefined;o.target=o.srcElement;var i,a,r=!0;return"function"==typeof p&&(i=p(o)),a=n.call(t,o),!1!==i&&!1!==a||(r=!1),r}}(t,p,i)}}).apply(null,arguments)},extend:function(e){var t=Array.prototype.slice;return _.each(t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},extend2Lev:function(e){return _.each(Array.prototype.slice.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(_.isObject(t[n])&&_.isObject(e[n])?_.extend(e[n],t[n]):e[n]=t[n])}),e},each:function(e,t,n){var p=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,i={};if(null==e)return!1;if(o&&e.forEach===o)e.forEach(t,n);else if(e.length===+e.length){for(var a=0,r=e.length;a=200&&n.status<300||304==n.status?e.success(t(n.responseText)):e.error(t(n.responseText),n.status),n.onreadystatechange=null,n.onload=null)}catch(p){n.onreadystatechange=null,n.onload=null}},n.open(e.type,e.url,!0);try{e.credentials&&(n.withCredentials=!0),_.isObject(e.header)&&_.each(e.header,function(e,t){n.setRequestHeader&&n.setRequestHeader(t,e)}),e.data&&(e.cors||n.setRequestHeader&&n.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?n.setRequestHeader&&n.setRequestHeader("Content-type","application/json; charset=UTF-8"):n.setRequestHeader&&n.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(a){sd.log(a)}n.send(e.data||null)},getUuid:function(){var e=function(){return Math.random().toString(16).replace(".","")};return function(){var t=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)}()+"-"+e()+"-"+e();return t||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(e){var t=Object.prototype.hasOwnProperty;if(_.isObject(e)){for(var n in e)if(t.call(e,n))return!1;return!0}return!1},filter:function(e,t,n){var p=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var o=[],i=0;i=0;i--){var a=p[i];n[a]=o[a]}n.hostname&&"string"==typeof n.pathname&&0!==n.pathname.indexOf("/")&&(n.pathname="/"+n.pathname),n.searchParams=function(){var e=_.getURLSearchParams(n.search);return{get:function(t){return e[t]}}}()}return n},contentLoaded:function(e,t){var n=!1,p=!0,o=e.document,i=o.documentElement,a=o.addEventListener,r=a?"addEventListener":"attachEvent",s=a?"removeEventListener":"detachEvent",u=a?"":"on",l=function(p){"readystatechange"==p.type&&"complete"!=o.readyState||(("load"==p.type?e:o)[s](u+p.type,l,!1),!n&&(n=!0)&&t.call(e,p.type||p))},c=function(){try{i.doScroll("left")}catch(e){return void setTimeout(c,50)}l("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(!a&&i.doScroll){try{p=!e.frameElement}catch(_){}p&&c()}o[r](u+"DOMContentLoaded",l,!1),o[r](u+"readystatechange",l,!1),e[r](u+"load",l,!1)}},indexOf:function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var p=0;p=3)&&window.sensorsDataAnalytic201505},popup.getPopupInfo=function(e){if(!_.isObject(e)||!_.isObject(e.template))return{};var t={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return function n(e){_.each(e.subviews,function(e){var p=e.properties||{};"title"===p.msgType?t.$sf_msg_title=p.text:"content"===p.msgType?t.$sf_msg_content=p.text:"image"===e.type&&(t.$sf_msg_image_url=p.image),e.subviews&&n(e)})}(e.template),t},popup.getSFCampaign=function(e){e=_.isObject(e)?e:{};var t={planId:"",name:"",content:null,type:""};return t.planId=e.plan_id||"",t.name=e.cname||"",t.content=_.isObject(e.popup_window_content)?e.popup_window_content.content:"",t.type=_.isObject(e.popup_window_content)&&e.popup_window_content.popup_type?e.popup_window_content.popup_type:"PRESET",t},popup.getImageList=function(e){if(!_.isArray(e))return!1;for(var t,n,p=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),i={},a=e.length,r=[],s=0;s0&&(i[n[0]]||(i[n[0]]=1));return _.each(i,function(e,t){r.push(t)}),r},popup.setIsLoad=function(){if(window.self===window.top){if(window[popup.config.loadedSign])return!1;if("undefined"==typeof window[popup.config.loadedSign])return window[popup.config.loadedSign]=!0,!0}else try{return!window.top[popup.config.loadedSign]&&(window.top[popup.config.loadedSign]=!0,!0)}catch(e){return popup.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",e),!0}};var IMAGE_MAP={close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAe1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////NgkbwAAAAKHRSTlMA5if6t/B0UjMSxpAtJB4MBfTr30oY6NjV0r2loZ6XkoaBenFp3UA/LNePaQAAAsxJREFUWMOsltlygzAMRRXMZsAsAZJmX9v6/7+wg1QXpjGxCDkvyWTIQZauDcCgzKLrPtnUSyGW9SbZX6OshDcQh36lH6j8MJ7pTZd6lGX6sr0IP7SDj7CA6chLoBkEFzm14nM1/P/2eGti1RZFq+LmdtwGw7afJ1Ue1dogcGCW4QptqCO2OPe1IbnL0Y7dE23wc2bJgSn44MFTvIMwLeMUXqZGfGKUkp+MPC2dwUjMGhWwUL7pnXRUsdbIIpow84VG1k9Xmf1e5U8Kq/R/68memAPqcggTCQUNc9SdL+iCL5jMd0B1j/RErh3LYrRyLa2po2x8KngJ9Uk5sWUwpZoVvIiiulNLhMwgHDhDED2MEH8X3zCDL4HV/R8lRTOEWYS0KWzt8GEm/mNLihpHKOeqJY6yLqDnbO42F1r9eXCzitMOfkuqfvkXTId6h1phSi5/ncbgneAtnDCAxTAzIn+POhfDFOObzAEsNLu0HXO06a4BCwd89wEk1h2ezdwl0rObvS5nNreHurg/lxKwsNPoHjXrHVhI+lMK3xjvMH4YelYzCSzc8V3zrx9CWtu5MG67eWEdhBSmI+GT7eIZt+Nny7YJ+y8ON9/cF1tWVL7LzTdTi6sSMtw9AE432wwl7u6MzqotMNwcM7Glc/TafRyB4+aa4dhdcoV993EDlptphlt3zZ72TgM8N88MDe3vDQWE5V6tWGaKyAbwqaiA5+aZQeETkk6QFtxuvhlaOkVwwxfgdq/IvHKbocBj6ac5OzYCIASBKGo10n+HBgakMswbaYDgTmX3fzgafhD4G+Hhg1cGXnT4PMFHVayCdVcBXGBu7cKwACOOC2YwTsIQ7KI7LBywJrlyByupK9Kw/lto4VFLAqLdmRwJiBDWwjDOI0QPPhPXRn3yTlyrILND4w7oOw3h5AlTPk5U/ddrZSk4RWW+C9hp2rgru6GiP/678n2UFPV1AAAAAElFTkSuQmCC"},NODE_NAME_MAP={row:"div",column:"div",label:"pre",image:"img",button:"button",link:"button",image_button:"img"},NODE_STYLE_MAP={textAlign:"text-align",font:"font-size",backgroundColor:"background-color",borderWidth:function(e){return"border-width: "+e+";border-style: solid;"},borderColor:"border-color",cornerRadius:"border-radius",backgroundImage:function(e){return"background-image:url("+e+");background-repeat: no-repeat;background-size: 100% 100%;"},margin:_.boxModel("margin"),padding:_.boxModel("padding"),maxHeight:"max-height",maxWidth:"max-width",scrollableX:function(e){if(e)return"overflow-x:auto;"},scrollableY:function(e){if(e)return"overflow-y:auto;"}};function ElementRender(e){this.properties=e.properties,this.template=e.template,this.maskEle=null,this.containerEle=null,this.msg={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:"",$sf_succeed:"",$sf_fail_reason:"",$sf_msg_id:"",plan:{}},this.popupCheckInstance=null}ElementRender.prototype={constructor:ElementRender,render:function(){var e=this;if(document.querySelector("div[data-sf-mask]"))return!1;return e.template.isRoot=!0,e.containerEle=e.createView(e.template),e.maskEle=e.getElement({nodeName:"div",attr:{"data-sensors-click":!0},style:e.getStyle({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:_.getRgba(e.properties.maskColor),"z-index":999998})}),_.addEvent(e.maskEle,"click",function(t){var n=t.target.getAttribute("data-ele-mask"),p=e.properties,o=e.msg;if(!o)return!1;var i={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:o.$sf_msg_title,$sf_msg_content:o.$sf_msg_content,$sf_msg_image_url:o.$sf_msg_image_url,$sf_msg_element_action:"close",$sf_msg_element_type:"mask",$sf_msg_action_id:p.maskActionId};return n&&p&&p.maskAction?(function(t,n){var p=t.maskAction.H5,o=_.isArray(p)&&p[0];if(_.isObject(o))switch(n.$sf_close_type=o.$sf_close_type||"",n.$sf_msg_element_action=o.type||"",o.type){case"copy":popup.track.trackEvent("$PlanPopupClick",n,e.msg);break;case"customize":case"openlink":popup.track.trackEvent("$PlanPopupClick",n,e.msg),o.closeable&&e.destory();break;case"close":o.closeable&&(popup.track.trackEvent("$PlanPopupClick",n,e.msg),e.destory())}}(p,i),!1):n&&e.properties.maskCloseEnabled?(popup.track.trackEvent("$PlanPopupClick",i,o),e.destory(),!1):void popup.track.elementClickCallback(t,e)}),e.maskEle.setAttribute("data-sf-mask",!0),e.maskEle.appendChild(e.containerEle),_.contentLoaded(window,function(){e.appendPopup()}),!0},appendPopup:function(){if(window.self===window.top)document.body.appendChild(this.maskEle);else try{window.top.document.body.appendChild(this.maskEle)}catch(n){document.body.appendChild(this.maskEle)}var e=document.querySelector("[data-ele-mask] > div"),t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;e&&e.offsetHeight>t&&(e.style.marginTop="auto")},getElement:function(e){var t=e.nodeName||"div",n=e.style,p=e.attr,o=e.prop,i=e.child,a=e.action,r=e.element_info,s=document.createElement(t);return n&&s.setAttribute("style",n),p&&_.each(p,function(e,t){e&&s.setAttribute(t,e)}),o&&_.each(o,function(e,t){e&&(s[t]=e)}),i&&i.length&&_.each(i,function(e){if(!e)return!1;s.appendChild(e)}),a&&a.H5&&a.H5.length&&s.setAttribute("data-action",JSON.stringify(a.H5)),r&&s.setAttribute("data-info",JSON.stringify(r)),s},getStyle:function(e){var t="",n=["msgType","text","image","name","isHidden","align","localImageName"];return _.each(e,function(e,p){e=_.conversionNum(e);var o=NODE_STYLE_MAP[p];if(_.indexOf(n,p)>=0)return!1;_.isString(o)?t+=o+":"+_.getRgba(e)+";":_.isFunction(o)?t+=o(e)+";":t+=p+":"+_.getRgba(e)+";"}),t},createView:function(e){var t=[],n={"box-sizing":"border-box",display:"block","pointer-events":"auto",overflow:"hidden"},p={},o={},i=NODE_NAME_MAP[e.type]||null;e.properties=e.properties||{},e.layout=e.layout||{};var a=e.properties.font,r=a?1.7*parseInt(a)+"px":"normal";if(e.properties.isHidden)return!1;switch(e.properties.text?o.innerText=e.properties.text:e.properties.image&&(p["data-sensors-click"]=!0,e.properties.localImageName?p.src=IMAGE_MAP[e.properties.localImageName]:p.src=e.properties.image),e.isRoot&&(e.layout.margin.top="-40px",_.extend(n,{position:"relative","z-index":999999,"pointer-events":"none"})),e.type){case"row":n.display="flex";break;case"link":_.extend(n,{"text-decoration":"underline",outline:"none","letter-spacing":"1px","line-height":r});break;case"label":_.extend(n,{"white-space":"pre-wrap","word-wrap":"break-word","letter-spacing":"1px","line-height":r,"margin-top":"0px","margin-bottom":"0px"});break;case"button":_.extend(n,{outline:"none","letter-spacing":"1px","line-height":r})}_.extend(n,e.layout,e.properties),e.subviews&&e.subviews.length>0&&_.each(e.subviews,function(e){t.push(this.createView(e))},this);var s=this.getElement({element_info:{$sf_msg_element_type:e.type,$sf_msg_element_content:e.properties.text||""},nodeName:i,attr:p,prop:o,style:this.getStyle(n),child:t,action:e.action});if(e.layout.align){var u=document.createElement("div");n="display:flex;justify-content:"+{center:"center",left:"flex-start",right:"flex-end"}[e.layout.align]+";";return e.isRoot?(n+="width:100%;height:100%;overflow-y:auto;box-sizing: border-box;align-items:center;",u.setAttribute("style",n),u.setAttribute("data-ele-mask",!0)):u.setAttribute("style",n),u.appendChild(s),u}return s},destory:function(){var e=this.msg.plan.plan_id||"";if(window.self===window.top)document.body.removeChild(this.maskEle);else try{window.top.document.body.removeChild(this.maskEle)}catch(t){document.body.removeChild(this.maskEle)}popup.info.popup_listener.onClose(e),popup.info.popup_campaign_listener.onEnd(popup.getSFCampaign(this.msg.plan)),this.popupCheckInstance&&this.popupCheckInstance.resetPopupIntervalWindow()}},popup.ElementRender=ElementRender,popup.handlerCampaign=function(e){var t,n=e,p=_.getUuid()(),o=n.plan.popup_window_content;if(!_.isObject(o))return n.popupFailed(1001,!1,{uuid:p,content:"",plan:n.plan}),!1;if(o.content)try{t=JSON.parse(o.content)}catch(u){popup.log(u)}var i=popup.getSFCampaign(n.plan),a={state:"",isCustom:!1},r=!0;try{r=popup.info.popup_campaign_listener.shouldStart(i)}catch(u){r=!1,popup.log(u)}var s={uuid:p,content:t,plan:n.plan};switch(n.plan.strategy_id?n.plan.is_trigger?r?"CUSTOMIZED"===o.popup_type?"withoutCampaignListener"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":_.isString(o.content)?a.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":a.state="DIALOG_NOT_SHOW_JSON_FAILED":"PRESET"===o.popup_type&&_.isObject(t)&&_.isObject(t.properties)&&_.isObject(t.template)?a.state="DIALOG_SHOW":a.state="DIALOG_NOT_SHOW_JSON_FAILED":a.state="CAMPAIGN_NOT_START_LISTENER_START":a.state="CAMPAIGN_NOT_START_TRIGGER":n.plan.is_control_group?a.state="DIALOG_NOT_SHOW":r?_.isObject(t)&&t.properties&&t.template?a.state="DIALOG_SHOW":a.state="DIALOG_NOT_SHOW_JSON_FAILED":a.state="CAMPAIGN_NOT_START_LISTENER_START",a.isCustom=!(!o.popup_type||"CUSTOMIZED"!==o.popup_type),popup.log("campaign:",a,"plan:",n.plan.cname),a.state){case"DIALOG_SHOW":n.showPopup(s);break;case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":n.customCampaign(s);break;case"CAMPAIGN_NOT_START_LISTENER_START":n.popupFailed(1004,a.isCustom,s);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":n.popupFailed(1006,a.isCustom,s);break;case"DIALOG_NOT_SHOW_JSON_FAILED":n.popupFailed(1001,a.isCustom,s);break;case"CAMPAIGN_NOT_START_TRIGGER":n.popupFailed(1005,a.isCustom,s);break;case"DIALOG_NOT_SHOW":n.popupFailed(1003,a.isCustom,s);break;default:popup.log("CampaignState\u5f02\u5e38")}},popup.track={getPublicProps:function(e){var t=e.plan,n={$sf_lib_version:popup.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:popup.info.platform,$sf_msg_id:e.$sf_msg_id};return _.isEmptyObject(t)||!_.isObject(t)?n:(n.$sf_plan_id=t.plan_id+"",n.$sf_plan_strategy_id=t.strategy_id?t.strategy_id:t.is_control_group?"-1":"0",t.audience_id&&(n.$sf_audience_id=t.audience_id+""),t.section_id&&(n.$sf_section_id=String(t.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(e){var t={$sf_msg_title:e.$sf_msg_title,$sf_msg_content:e.$sf_msg_content,$sf_msg_image_url:e.$sf_msg_image_url,$sf_succeed:e.$sf_succeed,$sf_fail_reason:e.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",t,e)},trackEvent:function(e,t,n){var p=popup.track.getPublicProps(n);_.extend(t,p),_.each(t,function(e,n){""!==e&&e!==undefined||delete t[n]}),popup.sa.track(e,t)},maskClick:function(e){if(!e.msg)return!1;var t={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:e.msg.$sf_msg_title,$sf_msg_content:e.msg.$sf_msg_content,$sf_msg_image_url:e.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:e.properties.maskActionId};this.trackEvent("$PlanPopupClick",t,e.msg),e.destory()},elementClickCallback:function(e,t){var n=e.target,p=n.getAttribute("data-action"),o=n.getAttribute("data-info"),i=t.msg||{};if(!p)return!1;try{var a=(JSON.parse(p)||{})[0],r=JSON.parse(o)||{}}catch(e){popup.log("elementClickCallback error",e)}var s={type:a.type,value:_.isString(a.value)?a.value:"",extra:_.isObject(a.value)?a.value:""},u=t.msg.plan?t.msg.plan.plan_id:"",l={$sf_msg_title:i.$sf_msg_title,$sf_msg_content:i.$sf_msg_content,$sf_msg_image_url:i.$sf_msg_image_url,$sf_msg_element_type:r.$sf_msg_element_type,$sf_msg_element_content:r.$sf_msg_element_content,$sf_msg_element_action:a.type,$sf_msg_action_id:a.id,$sf_close_type:"close"===a.type?a.$sf_close_type:""};this.trackEvent("$PlanPopupClick",l,i);try{popup.info.popup_listener.onClick(u,s);var c=t.msg.plan;if(c){var d={name:c.cname,plan_id:c.plan_id,content:c.popup_window_content?c.popup_window_content.content:"",type:c.popup_window_content?c.popup_window_content.popup_type:"",action:s};popup.info.popup_campaign_listener.onClick(d)}}catch(e){popup.log("popup_listener.onClick error",e)}if("close"===a.type)t.destory();else if(a.closeable&&t.destory(),"auto"===popup.info.popup_listener.openlink&&"openlink"===a.type){if("http"!==a.value.slice(0,4))return!1;window.location.href=a.value}}};var salog=popup.log;popup.changeCovertStatus=function(e){var t=JSON.parse(JSON.stringify(popup.convertPlans));_.each(t,function(t,n){if(!t.is_in_convert_window)return!1;var p=t.is_in_convert_window.step,o=t.is_in_convert_window.uuid;if(popup.convertPlans[n].is_in_convert_window.step=Math.min(2*p,6e5),!e)return!1;_.each(e,function(e){e.popup_display_uuid===o&&e.convert_time&&(salog("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",popup.convertPlans[n].plan_id),delete popup.convertPlans[n].is_in_convert_window,popup.convertPlans.splice(n,1))})}),popup.updateDataAndSetListen.updateLocalData()},popup.asyncConvert=function(e){var t=popup.info.project,n=!1;if(!e&&0===popup.convertPlans.length)return!1;e&&(_.each(popup.convertPlans,function(t){t.plan_id===e.plan_id&&(n=!0)}),n||popup.convertPlans.push(e)),function p(){if(_.isEmptyObject(popup.localData)||!_.isArray(popup.convertPlans)||0===popup.convertPlans.length)return!1;var e=JSON.parse(JSON.stringify(popup.convertPlans)),n=e[0].is_in_convert_window&&e[0].is_in_convert_window.step||5e3,o=[];if(_.each(e,function(e,t){return!!e.is_in_convert_window&&((new Date).getTime()>e.is_in_convert_window.expire_time?(salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",popup.convertPlans[t].plan_id),delete popup.convertPlans[t].is_in_convert_window,popup.convertPlans.splice(t,1),popup.updateDataAndSetListen.updateLocalData(),!1):(o.push(e.is_in_convert_window.uuid),e.is_in_convert_window.step||(e.is_in_convert_window.step=5e3,popup.convertPlans[t].is_in_convert_window.step=5e3),void(n>e.is_in_convert_window.step&&(n=e.is_in_convert_window.step))))}),!o.length)return!1;popup.asyncConvert.timer&&clearTimeout(popup.asyncConvert.timer),popup.asyncConvert.timer=setTimeout(function(){_.ajax({url:popup.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(t)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(e){popup.changeCovertStatus(e),p()},error:function(){popup.changeCovertStatus(),p()}})},n)}()},popup.ruleTime={getExpire:function(e,t){var n=t,p=Number(e.value)||0,o=Number(e.value)||0,i=String(e.unit).toLowerCase(),a=null,r={day:function(){return(a=new Date(n)).setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+864e5*(o-1)},week:function(){var e=(a=new Date(n)).getDay();0===e&&(e=7);var t=7-e;return a.setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+24*t*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){var e=(a=new Date(n)).getMonth()+o;return e>=11?(a.setFullYear(a.getFullYear()+parseInt(e/12)),a.setMonth(e%12)):a.setMonth(e),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(e){var t={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(n),e in t&&(o=t[e]*p),a.getTime()+o}};return!0!==e.natural?r.second(i):i in r?r[i]():void 0},getLast:function(e,t){var n=Number(e.value)||0,p=Number(e.value)-1||0,o=String(e.unit).toLowerCase(),i=null,a={day:function(){return(i=new Date(t)).setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-864e5*p},week:function(){var e=(i=new Date(t)).getDay();return 0===e&&(e=7),--e,i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-(24*e*60*60*1e3+7*p*24*60*60*1e3)},month:function(){var e=(i=new Date(t)).getMonth()+1-p;return e<=0?(i.setFullYear(i.getFullYear()+(parseInt(e/12)-1)),i.setMonth(12+e%12-1)):i.setMonth(e-1),i.setDate(1),i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.getTime()},second:function(e){var p={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return i=new Date(t),e in p&&(o=p[e]*n),i.getTime()-o}};return!0!==e.natural?a.second(o):o in a?a[o]():void 0},getArrMatchCount:function(e,t){var n=0;for(n=0;n=e[n])return n;return e.length}},popup.eventTriggerProcess=function(){if(!popup.updateDataAndSetListen.active_state)return!1;if(!_.isArray(popup.localData.eventQueue))return!1;if(0===popup.localData.eventQueue.length)return!1;if(popup.isRun)return!1;salog("\u4e8b\u4ef6\u961f\u5217---eventQueue",popup.localData.eventQueue);var e=!1,t=popup.localData.eventQueue[0],n=popup.eventRule[t.event];popup.isRun=!0,popup.localData.eventQueue.shift(),popup.updateDataAndSetListen.updateLocalData(),_.isArray(n)&&_.isObject(n[0])&&n.length>0&&(salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),_.each(n,function(e){_.isObject(e)&&"undefined"!=typeof e.match_state&&delete e.match_state,new popup.RuleCheck(e,t)}),_.each(n,function(t){!0===t.match_state?!1===e?(e=!0,salog("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",t.plan.cname),new popup.PopupCheck(t,!0)):!0===e&&(salog("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",t.plan.cname),new popup.PopupCheck(t,!1)):salog("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",t.plan.cname)}),e||popup.completeWindowLifecycle(),salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},popup.completeWindowLifecycle=function(){popup.isRun=!1,popup.eventTriggerProcess()},popup.PopupCheck=function(e,t){this.plan=e.plan,this.current_time=(new Date).getTime(),t?this.renderPopup():this.hidePopup(),popup.updateDataAndSetListen.updateLocalData()},popup.PopupCheck.prototype.createPopupWindow=function(e,t){this.startConvertWindow(e),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),t&&popup.completeWindowLifecycle()},popup.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},popup.PopupCheck.prototype.renderPopup=function(){popup.handlerCampaign(this)},popup.PopupCheck.prototype.popupFailed=function(e,t,n){var p={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"}[e],o=popup.getPopupInfo(n.content);o.$sf_msg_id=n.uuid,o.plan=n.plan,o.$sf_succeed=!1,o.$sf_fail_reason=p,popup.track.popupDisplay(o),!t&&popup.info.popup_listener&&_.isFunction(popup.info.popup_listener.onLoadFailed)&&popup.info.popup_listener.onLoadFailed(n.plan.plan_id,e,p),popup.info.popup_campaign_listener.onFailed(popup.getSFCampaign(n.plan),e,p),this.createPopupWindow(n.uuid,!0)},popup.PopupCheck.prototype.customCampaign=function(e){var t=popup.getSFCampaign(e.plan),n=popup.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,popup.track.popupDisplay(n),popup.info.popup_campaign_listener.onStart(t),this.createPopupWindow(e.uuid,!0)},popup.PopupCheck.prototype.showPopup=function(e){if(!popup.ElementRender)return popup.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var t=new popup.ElementRender(e.content),n=popup.getPopupInfo(e.content);if(n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,_.extend(t.msg,n),t.popupCheckInstance=this,popup.track.popupDisplay(n),!t.render())return salog("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1;popup.info.popup_campaign_listener.onStart(popup.getSFCampaign(e.plan)),this.createPopupWindow(e.uuid),popup.info.popup_listener.onLoadSuccess(e.plan.plan_id)},popup.PopupCheck.prototype.startConvertWindow=function(e){salog("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),_.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:popup.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:e},popup.asyncConvert(this.plan))},popup.PopupCheck.prototype.startPopupIntervalWindow=function(e){_.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=popup.ruleTime.getExpire(this.plan.popup_interval,e))},popup.PopupCheck.prototype.resetPopupIntervalWindow=function(){var e=(new Date).getTime();this.startPopupIntervalWindow(e),this.resetGlobalLimit(e),popup.completeWindowLifecycle()},popup.PopupCheck.prototype.startPopupLimitWindow=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),_.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(_.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:popup.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},popup.PopupCheck.prototype.setGlobalLimit=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),_.isArray(popup.localData.global_popup_count)||(popup.localData.global_popup_count=[]),popup.localData.global_popup_count.unshift(this.current_time);for(var e=popup.localData.global_popup_count,t=e[e.length-1];t+7776e63e3;)e.pop(),t=e[e.length-1]},popup.PopupCheck.prototype.resetGlobalLimit=function(e){_.isArray(popup.localData.global_popup_count)&&popup.localData.global_popup_count.length>0&&(popup.localData.global_popup_count.shift(),popup.localData.global_popup_count.unshift(e))},popup.PopupCheck.prototype.deletePlanAllWindow=function(){var e=this.plan.pattern_popup.matcher_list;_.isArray(e)&&_.each(e,function(e){e.is_in_window&&(salog("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete e.is_in_window)})},popup.RuleCheck=function(e,t){this.plan_match=e,this.plan=e.plan,this.rule_arr=e.rule,this.event_data=t,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";_.each(this.rule_arr,function(e){n+="--\u5305\u542b\u89c4\u5219-("+e.event_name+"\uff09-\u89e6\u53d1"+e.params[0]+"\u6b21"}),salog(n),salog(this.plan),this.checkPlanIsExpire(),popup.updateDataAndSetListen.updateLocalData()},popup.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||_.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)salog("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(_.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var e=0;e=1){var t=popup.ruleTime.getLast(popup.localData.popup_interval_global,this.current_time);t>e[0]?(salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+t+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0]),this.checkPopupInterval()):salog("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+t+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0])}else salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},popup.RuleCheck.prototype.checkPopupInterval=function(){var e=!0;_.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null):(salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"),e=!1):(salog("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null),e&&this.checkPermission()&&this.checkProperties()},popup.RuleCheck.prototype.isMatched=function(e){var t={equal:function(e,t){if(!_.isNumber(e)&&!_.isString(e))return!1;for(var n=0,p=t.length;n=0},notContain:function(e,t){return!!_.isString(e)&&-1===e.indexOf(t[0])},isTrue:function(e){return!0===e},isFalse:function(e){return!1===e},isSet:function(e){return void 0!==e},notSet:function(e){return void 0===e},isEmpty:function(e){if(!_.isString(e)&&!_.isArray(e))return!1;if(_.isString(e))return""===e;for(var t=0;t_.getConvertNumberValue(t[0]))},between:function(e,t){if(!_.isNumber(e))return!1;if("undefined"==typeof t[0]&&"undefined"==typeof t[1])return!1;var n=_.getConvertNumberValue(e),p=_.getConvertNumberValue(t[0]),o=_.getConvertNumberValue(t[1]);return n>=p&&n<=o},isIn:function(e,t){if(!_.isArray(e))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(e,t){if(!_.isArray(e))return!1;for(var n=0;n=n&&o<=p}catch(i){salog("absolute_between Error",i)}},absoluteBetween:function(e,t){try{var n=new Date(t[0]),p=new Date(t[1]),o=new Date(e);return o>=n&&o<=p}catch(i){salog("absolute_between Error",i)}}},n=this,p=e.relation,o="or"===String(p).toLowerCase(),i="and"===String(p).toLowerCase(),a=!!i,r=!0;return _.each(e.conditions,function(e){if(!r)return!1;if(!e.field)return!1;var p=e.field.lastIndexOf("."),s=e.params,u="in"===e["function"]?"isIn":e["function"];if(!t[u])return a=!1,r=!1,!1;if(p<0)return!1;var l=e.field.slice(p+1),c=n.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=t[u](_,s);o&&d&&(a=!0,r=!1),i&&!d&&(a=!1,r=!1)}),a},popup.RuleCheck.prototype.checkProperties=function(){var e=this,t=_.filter(this.rule_arr,function(t){var n=t.multi_filter?t.multi_filter:t.filter;return!(n&&(!n.conditions||0!==n.conditions.length))||e.isMatched(n)});_.isArray(t)&&t.length>0?(this.checkWindowAndMatch(t),salog("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",t)):salog("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},popup.RuleCheck.prototype.checkPermission=function(){var e=this.plan.event_permission;if(!_.isObject(e)||_.isEmptyObject(e))return!0;var t=this,n=[],p=function(e){return _.filter(e,function(e){return!(e&&e.conditions&&(!e.conditions||0!==e.conditions.length))||t.isMatched(e)})};return function o(e){_.each(e,function(e){if(n=p([e]),_.isArray(n)&&n.length>0){var t=e.filters||[];t&&t.length>0&&o(t)}})}([e]),_.isArray(n)&&n.length>0?(popup.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n),!0):(popup.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3"),!1)},popup.RuleCheck.prototype.checkWindowAndMatch=function(e){var t=this,n=[];_.each(e,function(e){if(!e.params||!e.params[0])return salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var p=Number(e.params[0]);1===p?n.push(e):p>1&&_.isObject(e.window)&&e.window.value>0&&(!_.isObject(e.is_in_window)||!_.isNumber(e.is_in_window.expire_time)||e.is_in_window.expire_time=p?n.push(e):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",e.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",p))}),n.length>0?(salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},popup.RuleCheck.prototype.checkGlobalPopupLimit=function(){var e=popup.localData.msg_limit_global,t=!0,n=this;_.isObject(e)&&!0===e.is_in_use&&_.isArray(e.limits)&&_.isArray(popup.localData.global_popup_count)&&!0===this.plan.global_msg_limit_enabled?(_.each(e.limits,function(e){if(_.isObject(e)&&_.isNumber(e.limit)){var p=popup.ruleTime.getLast(e,n.current_time),o=popup.ruleTime.getArrMatchCount(popup.localData.global_popup_count,p);salog("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+o+"-\u9650\u5236\u7684\u6b21\u6570"+e.limit+"-\u9650\u5236\u65f6\u95f4-"+p),t=o1024)return"object"==typeof console&&console.log&&console.log("H5 \u5f39\u7a97\u4ec5\u652f\u6301\u79fb\u52a8\u7aef\u548c ipad\uff0c\u6216\u8005\u5c4f\u5e55\u5bbd\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 1024\u3002"),!1;var e={};return arguments.length>0&&(1===arguments.length&&_.isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&_.isObject(arguments[1])&&(e=arguments[1])),!!this.setPara(e)&&(popup.info.platform="H5",!!popup.setIsLoad()&&(!!this.getBridgeState()&&void(popup.testSend.hasParam()?popup.testSend.start():(popup.listenPageStateChange(),popup.updateDataAndSetListen.initial()))))}popup.store={delete_time:2592e6,init:function(){this.migrateLocalData(),popup.localData=this.getLocalData(),_.isNumber(popup.localData.config_pull_interval_ms)&&popup.localData.config_pull_interval_ms>0&&(popup.updateDataAndSetListen.interval_time=popup.localData.config_pull_interval_ms),this.removeLocalData(),popup.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var e=_.localStorage.get(popup.config.storageName);_.isString(e)&&(e=decrypt(e));try{e=JSON.parse(e)}catch(t){_.log(t)}return e},saveJSONData:function(e){e=JSON.stringify(e),popup.info.encrypt_cookie&&(e=encrypt(e)),_.localStorage.set(popup.config.storageName,e)},migrateLocalData:function(){var e=this.getJSONData()||{},t=popup.sa.store.getDistinctId();if(e.popup_sdk_users&&e.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[t]=e,n.popup_sdk_users[t]={user_id:t},this.saveJSONData(n)},getLocalData:function(){var e=this.getJSONData(),t=popup.sa.store.getDistinctId(),n=null;return e?(_.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id),n&&_.isObject(e.popup_sdk_plans[n])?(e.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(e),e.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var e=this.getJSONData(),t=popup.sa.store.getDistinctId(),n=null;if(!e)return!1;e.popup_sdk_users&&_.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id,e.popup_sdk_plans[n]=popup.localData,this.saveJSONData(e))},removeLocalData:function(){var e=this.getJSONData(),t=this.delete_time;if(!e||!e.popup_sdk_plans||!e.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(e.popup_sdk_plans)),p=JSON.parse(JSON.stringify(e.popup_sdk_users)),o=(new Date).getTime(),i=[];_.each(n,function(n,p){o-n.update_time>t&&(delete e.popup_sdk_plans[p],i.push(p))}),_.each(p,function(t,n){i.length>0&&_.each(i,function(p){t.user_id&&p===t.user_id&&delete e.popup_sdk_users[n]})}),this.saveJSONData(e)}},popup.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var e=popup.localData.popup_plans;if(!e||!_.isArray(e))return!1;var t=_.filter(e,function(e){return!!e.convert_window&&!!e.is_in_convert_window});popup.convertPlans=t,popup.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",popup.convertPlans),popup.asyncConvert()},diffData:function(){var e=popup.localData,t=JSON.parse(JSON.stringify(popup.serverData));(new Date).getTime();if(!t||_.isEmptyObject(t))return!1;if(!e||_.isEmptyObject(e)||!e.popup_plans||0===e.popup_plans.length)return _.extend(popup.localData,t),!1;var n=t.popup_plans;_.each(n,function(t,p){var o=null;if(_.each(e.popup_plans,function(e){e.plan_id===t.plan_id&&(o=e,t.audience_id||delete o.audience_id,_.isObject(t.window_update)&&_.each(t.window_update,function(e,n){o.window_update&&o.window_update[n]===e||("trigger_window"===n?o.pattern_popup.matcher_list=t.pattern_popup.matcher_list:"convert_window"===n&&o.is_in_convert_window&&t.convert_window&&o.is_in_convert_window.start_time&&(o.is_in_convert_window.expire_time=popup.ruleTime.getExpire(t.convert_window,o.is_in_convert_window.start_time)))}))}),!o)return!1;if(!t.window_update&&o.last_update_config_time!==t.last_update_config_time)return!1;var i=o.pattern_popup.matcher_list;_.extend2Lev(o,t),o.pattern_popup.matcher_list=i,n[p]=o}),_.extend(popup.localData,t)},getEventRule:function(){var e=popup.localData.popup_plans,t={};if(!e||!_.isArray(e))return!1;_.each(e,function(e){var n=e.pattern_popup.matcher_list;_.each(n,function(n){var p={plan:e,rule:[n]},o=n.event_name,i=!1;if(t[o]){if(_.each(t[o],function(t){t.plan.plan_id===e.plan_id&&(t.rule.push(n),i=!0)}),i)return!1;t[o].push(p)}else t[o]=[p]})}),_.each(t,function(e){e.sort(function(e,t){var n=t.plan.absolute_priority-e.plan.absolute_priority;return 0===n?t.plan.plan_id-e.plan.plan_id:n})}),popup.eventRule=t,popup.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),popup.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------")},registerListen:function(){var e=this;popup.sa.events.on("send",function(t){t.event&&popup.eventRule[t.event]&&(_.isArray(popup.localData.eventQueue)||(popup.localData.eventQueue=[]),popup.localData.eventQueue.push(t),e.updateLocalData(),popup.eventTriggerProcess())}),popup.sa.events.on("changeDistinctId",function(t){e.changeId()}),popup.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(e){if(e.length<1)return!1;if(JSON.stringify(e)===JSON.stringify(this.image_list))return!1;this.image_list=e;for(var t=0;t0&&(n.interval_time=p.config_pull_interval_ms),popup.serverData.local_update_time=(new Date).getTime(),popup.info.preload_image&&n.loadImage(popup.getImageList(p.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},popup.localData={},n.updateLocalData()),e(),n.setIntervalTime(n.interval_time)},error:function(){if(!n.active_state)return t(),!1;popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},e(),n.setIntervalTime(n.interval_time)}})},updateUserPlans:function(){var e=popup.store.getJSONData(),t=popup.sa.store.getDistinctId(),n=popup.serverData.user_id;e.popup_sdk_users[t]={user_id:n||t},n?e.popup_sdk_plans[n]?popup.localData=e.popup_sdk_plans[n]:e.popup_sdk_plans[t]&&(popup.localData=e.popup_sdk_plans[t],delete e.popup_sdk_plans[t]):e.popup_sdk_plans[t]&&(popup.localData=e.popup_sdk_plans[t]),popup.localData.update_time=(new Date).getTime(),popup.store.saveJSONData(e)},setIntervalTime:function(e){var t=this;this.data_interval=setTimeout(function(){popup.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),t.getDataFromServer()},e)},setFirstListen:function(){var e=this;this.getDataFromServer(function(){e.registerListen()})},updateLocalData:function(){var e=JSON.stringify(popup.localData);this.local_data!==e&&(this.local_data=e,popup.store.saveLocalData())},initial:function(){popup.store.init();var e=popup.localData.local_update_time,t=(new Date).getTime();if(_.isNumber(e)){var n=t-e;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),popup.info.preload_image&&this.loadImage(popup.getImageList(popup.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,popup.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),popup.asyncConvert.timer&&window.clearTimeout(popup.asyncConvert.timer),popup.convertPlans=[],popup.localData={},this.resetState()},resetState:function(){if("WEB"===popup.info.platform)return!1;!document.querySelector("div[data-sf-mask]")&&popup.isRun&&(popup.isRun=!1)},startState:function(e){this.active_state=!0,(e=e||{getLocalData:!0}).getLocalData&&(this.resetState(),popup.localData=popup.store.getLocalData()),this.getDataFromServer()}},popup.testSend={hasParam:function(){var e=_.URL(window.location.href).searchParams,t=e.get("sf_popup_test")||"",n=e.get("popup_window_id")||"",p=e.get("platform");return!(!t||!n)&&{sf_popup_test:t,popup_window_id:n,platform:p}},start:function(){var e=popup.info.project,t=popup.info.platform,n=this.hasParam().popup_window_id,p=this.hasParam().platform,o=encodeURIComponent(popup.sa.store.getDistinctId());if("WEB"===p)return popup.log("WEB\u7aef\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728PC\u8bbe\u5907\u6253\u5f00\uff01"),!1;_.ajax({url:popup.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(e)+"&time="+(new Date).getTime()+"&sdk_version="+popup.lib_version+"&platform="+encodeURIComponent(t)+"&distinct_id="+o,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(e){var t,n=_.getUuid();_.isObject(e)||(popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",e),e={});try{t=JSON.parse(e.content)}catch(i){popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",e,i)}var p=popup.getPopupInfo(t);p.$sf_msg_id=n;var o={content:e.content,type:e.popup_type||"PRESET"};(Object.hasOwnProperty.call(e,"name")&&(o.name=e.name),e.popup_type&&"CUSTOMIZED"===e.popup_type)?_.isString(e.content)?"withoutCampaignListener"===popup.info.supportCustom||"withoutStart"===popup.info.supportCustom?(p.$sf_succeed=!1,p.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(p.$sf_succeed=!0,popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onStart(o)):(p.$sf_succeed=!1,p.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e")):_.isObject(t)&&_.isObject(t.properties)&&_.isObject(t.template)?(new popup.ElementRender(t).render(),p.$sf_succeed=!0,popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onStart(o),popup.info.popup_listener.onLoadSuccess()):(p.$sf_succeed=!1,p.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",popup.track.popupDisplay(p),popup.info.popup_listener.onLoadFailed("",1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"),popup.info.popup_campaign_listener.onFailed(o,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"))},error:function(e){popup.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",e)}})}},popup.setPara=function(e){_.isObject(e)||(e={}),popup.info=_.extend({},popup.defaultPara,e);var t=popup.sa;if(!t)return popup.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1;if(!0===t.para.encrypt_cookie&&(popup.info.encrypt_cookie=!0),!_.isString(popup.info.api_base_url)||"http"!==popup.info.api_base_url.slice(0,4))return popup.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1;if("http:"===popup.info.api_base_url.slice(0,5)&&"https:"===location.protocol)return popup.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1;if(popup.info.api_base_url="/"===popup.info.api_base_url.slice(-1)?popup.info.api_base_url.slice(0,-1):popup.info.api_base_url,!_.isString(t.para.server_url)||"http"!==t.para.server_url.slice(0,4))return popup.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1;if(popup.info.project||(popup.info.project=_.URL(t.para.server_url).searchParams.get("project")||"default"),_.isObject(popup.info.popup_listener)){var n=popup.info.popup_listener;_.isFunction(n.onClick)||(popup.info.popup_listener.onClick=function(){}),_.isFunction(n.onLoadSuccess)||(popup.info.popup_listener.onLoadSuccess=function(){}),_.isFunction(n.onLoadFailed)||(popup.info.popup_listener.onLoadFailed=function(){}),_.isFunction(n.onClose)||(popup.info.popup_listener.onClose=function(){}),_.isString(n.openlink)?"auto"!==n.openlink&&"customize"!==n.openlink&&(popup.info.popup_listener.openlink="customize"):popup.info.popup_listener.openlink="customize"}else popup.info.popup_listener={onClick:function(){},onLoadSuccess:function(){},onLoadFailed:function(){},onClose:function(){},openlink:"customize"};return popup.info.supportCustom=!0,_.isObject(popup.info.popup_campaign_listener)?(_.isFunction(popup.info.popup_campaign_listener.shouldStart)||(popup.info.popup_campaign_listener.shouldStart=function(){return!0}),_.isFunction(popup.info.popup_campaign_listener.onStart)||(popup.info.supportCustom="withoutStart",popup.info.popup_campaign_listener.onStart=function(){}),_.isFunction(popup.info.popup_campaign_listener.onEnd)||(popup.info.popup_campaign_listener.onEnd=function(){}),_.isFunction(popup.info.popup_campaign_listener.onFailed)||(popup.info.popup_campaign_listener.onFailed=function(){}),_.isFunction(popup.info.popup_campaign_listener.onClick)||(popup.info.popup_campaign_listener.onClick=function(){})):(popup.info.supportCustom="withoutCampaignListener",popup.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0},popup.getBridgeState=function(){return!_.isObject(popup.sa.para.app_js_bridge)||!popup.sa.para.app_js_bridge.is_mui&&(!popup.sa.bridge||!popup.sa.bridge.is_verify_success)},popup.init=function(){var e=window.sensorsDataAnalytic201505;if(popup.sa=e,e&&e.readyState&&e.readyState.state>=3||!e.on)initPopup.apply(this,arguments);else{var t=this,n=arguments;e&&e.on("sdkReady",function(){initPopup.apply(t,n)})}},popup.plugin_name="Popup",window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?(window.SensorsDataWebJSSDKPlugin.popup=window.SensorsDataWebJSSDKPlugin.popup||popup,window.SensorsDataWebJSSDKPlugin.Popup=window.SensorsDataWebJSSDKPlugin.Popup||popup):window.SensorsDataWebJSSDKPlugin={popup:popup,Popup:popup};export default popup; \ No newline at end of file +var popup={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.26.9",plugin_version:"1.26.9",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(e){var t={};if(e&&"[object Object]"===Object.prototype.toString.call(e)){for(var n in e)n&&"popup_window_content"!==n&&(t[n]=e[n]);return JSON.stringify(t,null," ")}return e},log:function(){if(!0===popup.info.show_log&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=popup.setArg(arguments[0]),arguments[1]=popup.setArg(arguments[1]),console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}},config:{storageName:"sensorsdata202002-popupdata",loadedSign:"SensorsData2015JSSDKH5PopupIsLoad"}},_={visibility:function(e){e=e||{};var t={hidden:undefined,visibilityChange:undefined,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:e.onVisible,_hidden:e.onHidden,_nativeSwitch:function(){!0===document[this.hidden]?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){t._nativeSwitch.apply(t,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(e){}},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()}};t.init()},getRgba:function(e){return"object"!=typeof e?e:"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"},conversionNum:function(e){if(e){if(/^[0|1]?\.\d+$/.test(e))return 100*Number(e)+"%";var t=/^(-?\d+(\.\d+)?)px$/.exec(e);return t?(Number(t[1])/375*window.screen.width).toFixed(2)+"px":e}},boxModel:function(e){return function(t){if("object"!=typeof t)return e+":"+t+";";var n="";for(var p in t)n+=e+"-"+p+":"+_.conversionNum(t[p])+";";return n}},localStorage:{get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t=null;try{t=JSON.parse(_.localStorage.get(e))||null}catch(n){}return t},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";_.localStorage.set(t,n),_.localStorage.get(t)!==n&&(e=!1),_.localStorage.remove(t)}catch(p){e=!1}return e}},addEvent:function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}e._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(p){return[]}}()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};(function(t,n,p){if(t&&t.addEventListener)t.addEventListener(n,function(t){t._getPath=e._getPath,p.call(this,t)},!1);else{var o="on"+n,i=t[o];t[o]=function(t,n,p){return function(o){if(!(o=o||e(window.event)))return undefined;o.target=o.srcElement;var i,a,r=!0;return"function"==typeof p&&(i=p(o)),a=n.call(t,o),!1!==i&&!1!==a||(r=!1),r}}(t,p,i)}}).apply(null,arguments)},extend:function(e){var t=Array.prototype.slice;return _.each(t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},extend2Lev:function(e){return _.each(Array.prototype.slice.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(_.isObject(t[n])&&_.isObject(e[n])?_.extend(e[n],t[n]):e[n]=t[n])}),e},each:function(e,t,n){var p=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,i={};if(null==e)return!1;if(o&&e.forEach===o)e.forEach(t,n);else if(e.length===+e.length){for(var a=0,r=e.length;a=200&&n.status<300||304==n.status?e.success(t(n.responseText)):e.error(t(n.responseText),n.status),n.onreadystatechange=null,n.onload=null)}catch(p){n.onreadystatechange=null,n.onload=null}},n.open(e.type,e.url,!0);try{e.credentials&&(n.withCredentials=!0),_.isObject(e.header)&&_.each(e.header,function(e,t){n.setRequestHeader&&n.setRequestHeader(t,e)}),e.data&&(e.cors||n.setRequestHeader&&n.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?n.setRequestHeader&&n.setRequestHeader("Content-type","application/json; charset=UTF-8"):n.setRequestHeader&&n.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(a){sd.log(a)}n.send(e.data||null)},getUuid:function(){var e=function(){return Math.random().toString(16).replace(".","")};return function(){var t=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)}()+"-"+e()+"-"+e();return t||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(e){var t=Object.prototype.hasOwnProperty;if(_.isObject(e)){for(var n in e)if(t.call(e,n))return!1;return!0}return!1},filter:function(e,t,n){var p=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var o=[],i=0;i=0;i--){var a=p[i];n[a]=o[a]}n.hostname&&"string"==typeof n.pathname&&0!==n.pathname.indexOf("/")&&(n.pathname="/"+n.pathname),n.searchParams=function(){var e=_.getURLSearchParams(n.search);return{get:function(t){return e[t]}}}()}return n},contentLoaded:function(e,t){var n=!1,p=!0,o=e.document,i=o.documentElement,a=o.addEventListener,r=a?"addEventListener":"attachEvent",s=a?"removeEventListener":"detachEvent",u=a?"":"on",l=function(p){"readystatechange"==p.type&&"complete"!=o.readyState||(("load"==p.type?e:o)[s](u+p.type,l,!1),!n&&(n=!0)&&t.call(e,p.type||p))},c=function(){try{i.doScroll("left")}catch(e){return void setTimeout(c,50)}l("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(!a&&i.doScroll){try{p=!e.frameElement}catch(_){}p&&c()}o[r](u+"DOMContentLoaded",l,!1),o[r](u+"readystatechange",l,!1),e[r](u+"load",l,!1)}},indexOf:function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var p=0;p=3)&&window.sensorsDataAnalytic201505},popup.getPopupInfo=function(e){if(!_.isObject(e)||!_.isObject(e.template))return{};var t={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return function n(e){_.each(e.subviews,function(e){var p=e.properties||{};"title"===p.msgType?t.$sf_msg_title=p.text:"content"===p.msgType?t.$sf_msg_content=p.text:"image"===e.type&&(t.$sf_msg_image_url=p.image),e.subviews&&n(e)})}(e.template),t},popup.getSFCampaign=function(e){e=_.isObject(e)?e:{};var t={planId:"",name:"",content:null,type:""};return t.planId=e.plan_id||"",t.name=e.cname||"",t.content=_.isObject(e.popup_window_content)?e.popup_window_content.content:"",t.type=_.isObject(e.popup_window_content)&&e.popup_window_content.popup_type?e.popup_window_content.popup_type:"PRESET",t},popup.getImageList=function(e){if(!_.isArray(e))return!1;for(var t,n,p=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),i={},a=e.length,r=[],s=0;s0&&(i[n[0]]||(i[n[0]]=1));return _.each(i,function(e,t){r.push(t)}),r},popup.setIsLoad=function(){if(window.self===window.top){if(window[popup.config.loadedSign])return!1;if("undefined"==typeof window[popup.config.loadedSign])return window[popup.config.loadedSign]=!0,!0}else try{return!window.top[popup.config.loadedSign]&&(window.top[popup.config.loadedSign]=!0,!0)}catch(e){return popup.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",e),!0}};var IMAGE_MAP={close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAe1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////NgkbwAAAAKHRSTlMA5if6t/B0UjMSxpAtJB4MBfTr30oY6NjV0r2loZ6XkoaBenFp3UA/LNePaQAAAsxJREFUWMOsltlygzAMRRXMZsAsAZJmX9v6/7+wg1QXpjGxCDkvyWTIQZauDcCgzKLrPtnUSyGW9SbZX6OshDcQh36lH6j8MJ7pTZd6lGX6sr0IP7SDj7CA6chLoBkEFzm14nM1/P/2eGti1RZFq+LmdtwGw7afJ1Ue1dogcGCW4QptqCO2OPe1IbnL0Y7dE23wc2bJgSn44MFTvIMwLeMUXqZGfGKUkp+MPC2dwUjMGhWwUL7pnXRUsdbIIpow84VG1k9Xmf1e5U8Kq/R/68memAPqcggTCQUNc9SdL+iCL5jMd0B1j/RErh3LYrRyLa2po2x8KngJ9Uk5sWUwpZoVvIiiulNLhMwgHDhDED2MEH8X3zCDL4HV/R8lRTOEWYS0KWzt8GEm/mNLihpHKOeqJY6yLqDnbO42F1r9eXCzitMOfkuqfvkXTId6h1phSi5/ncbgneAtnDCAxTAzIn+POhfDFOObzAEsNLu0HXO06a4BCwd89wEk1h2ezdwl0rObvS5nNreHurg/lxKwsNPoHjXrHVhI+lMK3xjvMH4YelYzCSzc8V3zrx9CWtu5MG67eWEdhBSmI+GT7eIZt+Nny7YJ+y8ON9/cF1tWVL7LzTdTi6sSMtw9AE432wwl7u6MzqotMNwcM7Glc/TafRyB4+aa4dhdcoV993EDlptphlt3zZ72TgM8N88MDe3vDQWE5V6tWGaKyAbwqaiA5+aZQeETkk6QFtxuvhlaOkVwwxfgdq/IvHKbocBj6ac5OzYCIASBKGo10n+HBgakMswbaYDgTmX3fzgafhD4G+Hhg1cGXnT4PMFHVayCdVcBXGBu7cKwACOOC2YwTsIQ7KI7LBywJrlyByupK9Kw/lto4VFLAqLdmRwJiBDWwjDOI0QPPhPXRn3yTlyrILND4w7oOw3h5AlTPk5U/ddrZSk4RWW+C9hp2rgru6GiP/678n2UFPV1AAAAAElFTkSuQmCC"},NODE_NAME_MAP={row:"div",column:"div",label:"pre",image:"img",button:"button",link:"button",image_button:"img"},NODE_STYLE_MAP={textAlign:"text-align",font:"font-size",backgroundColor:"background-color",borderWidth:function(e){return"border-width: "+e+";border-style: solid;"},borderColor:"border-color",cornerRadius:"border-radius",backgroundImage:function(e){return"background-image:url("+e+");background-repeat: no-repeat;background-size: 100% 100%;"},margin:_.boxModel("margin"),padding:_.boxModel("padding"),maxHeight:"max-height",maxWidth:"max-width",scrollableX:function(e){if(e)return"overflow-x:auto;"},scrollableY:function(e){if(e)return"overflow-y:auto;"}};function ElementRender(e){this.properties=e.properties,this.template=e.template,this.maskEle=null,this.containerEle=null,this.msg={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:"",$sf_succeed:"",$sf_fail_reason:"",$sf_msg_id:"",plan:{}},this.popupCheckInstance=null}ElementRender.prototype={constructor:ElementRender,render:function(){var e=this;if(document.querySelector("div[data-sf-mask]"))return!1;return e.template.isRoot=!0,e.containerEle=e.createView(e.template),e.maskEle=e.getElement({nodeName:"div",attr:{"data-sensors-click":!0},style:e.getStyle({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:_.getRgba(e.properties.maskColor),"z-index":999998})}),_.addEvent(e.maskEle,"click",function(t){var n=t.target.getAttribute("data-ele-mask"),p=e.properties,o=e.msg;if(!o)return!1;var i={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:o.$sf_msg_title,$sf_msg_content:o.$sf_msg_content,$sf_msg_image_url:o.$sf_msg_image_url,$sf_msg_element_action:"close",$sf_msg_element_type:"mask",$sf_msg_action_id:p.maskActionId};return n&&p&&p.maskAction?(function(t,n){var p=t.maskAction.H5,o=_.isArray(p)&&p[0];if(_.isObject(o))switch(n.$sf_close_type=o.$sf_close_type||"",n.$sf_msg_element_action=o.type||"",o.type){case"copy":popup.track.trackEvent("$PlanPopupClick",n,e.msg);break;case"customize":case"openlink":popup.track.trackEvent("$PlanPopupClick",n,e.msg),o.closeable&&e.destory();break;case"close":o.closeable&&(popup.track.trackEvent("$PlanPopupClick",n,e.msg),e.destory())}}(p,i),!1):n&&e.properties.maskCloseEnabled?(popup.track.trackEvent("$PlanPopupClick",i,o),e.destory(),!1):void popup.track.elementClickCallback(t,e)}),e.maskEle.setAttribute("data-sf-mask",!0),e.maskEle.appendChild(e.containerEle),_.contentLoaded(window,function(){e.appendPopup()}),!0},appendPopup:function(){if(window.self===window.top)document.body.appendChild(this.maskEle);else try{window.top.document.body.appendChild(this.maskEle)}catch(n){document.body.appendChild(this.maskEle)}var e=document.querySelector("[data-ele-mask] > div"),t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;e&&e.offsetHeight>t&&(e.style.marginTop="auto")},getElement:function(e){var t=e.nodeName||"div",n=e.style,p=e.attr,o=e.prop,i=e.child,a=e.action,r=e.element_info,s=document.createElement(t);return n&&s.setAttribute("style",n),p&&_.each(p,function(e,t){e&&s.setAttribute(t,e)}),o&&_.each(o,function(e,t){e&&(s[t]=e)}),i&&i.length&&_.each(i,function(e){if(!e)return!1;s.appendChild(e)}),a&&a.H5&&a.H5.length&&s.setAttribute("data-action",JSON.stringify(a.H5)),r&&s.setAttribute("data-info",JSON.stringify(r)),s},getStyle:function(e){var t="",n=["msgType","text","image","name","isHidden","align","localImageName"];return _.each(e,function(e,p){e=_.conversionNum(e);var o=NODE_STYLE_MAP[p];if(_.indexOf(n,p)>=0)return!1;_.isString(o)?t+=o+":"+_.getRgba(e)+";":_.isFunction(o)?t+=o(e)+";":t+=p+":"+_.getRgba(e)+";"}),t},createView:function(e){var t=[],n={"box-sizing":"border-box",display:"block","pointer-events":"auto",overflow:"hidden"},p={},o={},i=NODE_NAME_MAP[e.type]||null;e.properties=e.properties||{},e.layout=e.layout||{};var a=e.properties.font,r=a?1.7*parseInt(a)+"px":"normal";if(e.properties.isHidden)return!1;switch(e.properties.text?o.innerText=e.properties.text:e.properties.image&&(p["data-sensors-click"]=!0,e.properties.localImageName?p.src=IMAGE_MAP[e.properties.localImageName]:p.src=e.properties.image),e.isRoot&&(e.layout.margin.top="-40px",_.extend(n,{position:"relative","z-index":999999,"pointer-events":"none"})),e.type){case"row":n.display="flex";break;case"link":_.extend(n,{"text-decoration":"underline",outline:"none","letter-spacing":"1px","line-height":r});break;case"label":_.extend(n,{"white-space":"pre-wrap","word-wrap":"break-word","letter-spacing":"1px","line-height":r,"margin-top":"0px","margin-bottom":"0px"});break;case"button":_.extend(n,{outline:"none","letter-spacing":"1px","line-height":r})}_.extend(n,e.layout,e.properties),e.subviews&&e.subviews.length>0&&_.each(e.subviews,function(e){t.push(this.createView(e))},this);var s=this.getElement({element_info:{$sf_msg_element_type:e.type,$sf_msg_element_content:e.properties.text||""},nodeName:i,attr:p,prop:o,style:this.getStyle(n),child:t,action:e.action});if(e.layout.align){var u=document.createElement("div");n="display:flex;justify-content:"+{center:"center",left:"flex-start",right:"flex-end"}[e.layout.align]+";";return e.isRoot?(n+="width:100%;height:100%;overflow-y:auto;box-sizing: border-box;align-items:center;",u.setAttribute("style",n),u.setAttribute("data-ele-mask",!0)):u.setAttribute("style",n),u.appendChild(s),u}return s},destory:function(){var e=this.msg.plan.plan_id||"";if(window.self===window.top)document.body.removeChild(this.maskEle);else try{window.top.document.body.removeChild(this.maskEle)}catch(t){document.body.removeChild(this.maskEle)}popup.info.popup_listener.onClose(e),popup.info.popup_campaign_listener.onEnd(popup.getSFCampaign(this.msg.plan)),this.popupCheckInstance&&this.popupCheckInstance.resetPopupIntervalWindow()}},popup.ElementRender=ElementRender,popup.handlerCampaign=function(e){var t,n=e,p=_.getUuid()(),o=n.plan.popup_window_content;if(!_.isObject(o))return n.popupFailed(1001,!1,{uuid:p,content:"",plan:n.plan}),!1;if(o.content)try{t=JSON.parse(o.content)}catch(u){popup.log(u)}var i=popup.getSFCampaign(n.plan),a={state:"",isCustom:!1},r=!0;try{r=popup.info.popup_campaign_listener.shouldStart(i)}catch(u){r=!1,popup.log(u)}var s={uuid:p,content:t,plan:n.plan};switch(n.plan.strategy_id?n.plan.is_trigger?r?"CUSTOMIZED"===o.popup_type?"withoutCampaignListener"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":_.isString(o.content)?a.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":a.state="DIALOG_NOT_SHOW_JSON_FAILED":"PRESET"===o.popup_type&&_.isObject(t)&&_.isObject(t.properties)&&_.isObject(t.template)?a.state="DIALOG_SHOW":a.state="DIALOG_NOT_SHOW_JSON_FAILED":a.state="CAMPAIGN_NOT_START_LISTENER_START":a.state="CAMPAIGN_NOT_START_TRIGGER":n.plan.is_control_group?a.state="DIALOG_NOT_SHOW":r?_.isObject(t)&&t.properties&&t.template?a.state="DIALOG_SHOW":a.state="DIALOG_NOT_SHOW_JSON_FAILED":a.state="CAMPAIGN_NOT_START_LISTENER_START",a.isCustom=!(!o.popup_type||"CUSTOMIZED"!==o.popup_type),popup.log("campaign:",a,"plan:",n.plan.cname),a.state){case"DIALOG_SHOW":n.showPopup(s);break;case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":n.customCampaign(s);break;case"CAMPAIGN_NOT_START_LISTENER_START":n.popupFailed(1004,a.isCustom,s);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":n.popupFailed(1006,a.isCustom,s);break;case"DIALOG_NOT_SHOW_JSON_FAILED":n.popupFailed(1001,a.isCustom,s);break;case"CAMPAIGN_NOT_START_TRIGGER":n.popupFailed(1005,a.isCustom,s);break;case"DIALOG_NOT_SHOW":n.popupFailed(1003,a.isCustom,s);break;default:popup.log("CampaignState\u5f02\u5e38")}},popup.track={getPublicProps:function(e){var t=e.plan,n={$sf_lib_version:popup.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:popup.info.platform,$sf_msg_id:e.$sf_msg_id};return _.isEmptyObject(t)||!_.isObject(t)?n:(n.$sf_plan_id=t.plan_id+"",n.$sf_plan_strategy_id=t.strategy_id?t.strategy_id:t.is_control_group?"-1":"0",t.audience_id&&(n.$sf_audience_id=t.audience_id+""),t.section_id&&(n.$sf_section_id=String(t.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(e){var t={$sf_msg_title:e.$sf_msg_title,$sf_msg_content:e.$sf_msg_content,$sf_msg_image_url:e.$sf_msg_image_url,$sf_succeed:e.$sf_succeed,$sf_fail_reason:e.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",t,e)},trackEvent:function(e,t,n){var p=popup.track.getPublicProps(n);_.extend(t,p),_.each(t,function(e,n){""!==e&&e!==undefined||delete t[n]}),popup.sa.track(e,t)},maskClick:function(e){if(!e.msg)return!1;var t={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:e.msg.$sf_msg_title,$sf_msg_content:e.msg.$sf_msg_content,$sf_msg_image_url:e.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:e.properties.maskActionId};this.trackEvent("$PlanPopupClick",t,e.msg),e.destory()},elementClickCallback:function(e,t){var n=e.target,p=n.getAttribute("data-action"),o=n.getAttribute("data-info"),i=t.msg||{};if(!p)return!1;try{var a=(JSON.parse(p)||{})[0],r=JSON.parse(o)||{}}catch(e){popup.log("elementClickCallback error",e)}var s={type:a.type,value:_.isString(a.value)?a.value:"",extra:_.isObject(a.value)?a.value:""},u=t.msg.plan?t.msg.plan.plan_id:"",l={$sf_msg_title:i.$sf_msg_title,$sf_msg_content:i.$sf_msg_content,$sf_msg_image_url:i.$sf_msg_image_url,$sf_msg_element_type:r.$sf_msg_element_type,$sf_msg_element_content:r.$sf_msg_element_content,$sf_msg_element_action:a.type,$sf_msg_action_id:a.id,$sf_close_type:"close"===a.type?a.$sf_close_type:""};this.trackEvent("$PlanPopupClick",l,i);try{popup.info.popup_listener.onClick(u,s);var c=t.msg.plan;if(c){var d={name:c.cname,plan_id:c.plan_id,content:c.popup_window_content?c.popup_window_content.content:"",type:c.popup_window_content?c.popup_window_content.popup_type:"",action:s};popup.info.popup_campaign_listener.onClick(d)}}catch(e){popup.log("popup_listener.onClick error",e)}if("close"===a.type)t.destory();else if(a.closeable&&t.destory(),"auto"===popup.info.popup_listener.openlink&&"openlink"===a.type){if("http"!==a.value.slice(0,4))return!1;window.location.href=a.value}}};var salog=popup.log;popup.changeCovertStatus=function(e){var t=JSON.parse(JSON.stringify(popup.convertPlans));_.each(t,function(t,n){if(!t.is_in_convert_window)return!1;var p=t.is_in_convert_window.step,o=t.is_in_convert_window.uuid;if(popup.convertPlans[n].is_in_convert_window.step=Math.min(2*p,6e5),!e)return!1;_.each(e,function(e){e.popup_display_uuid===o&&e.convert_time&&(salog("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",popup.convertPlans[n].plan_id),delete popup.convertPlans[n].is_in_convert_window,popup.convertPlans.splice(n,1))})}),popup.updateDataAndSetListen.updateLocalData()},popup.asyncConvert=function(e){var t=popup.info.project,n=!1;if(!e&&0===popup.convertPlans.length)return!1;e&&(_.each(popup.convertPlans,function(t){t.plan_id===e.plan_id&&(n=!0)}),n||popup.convertPlans.push(e)),function p(){if(_.isEmptyObject(popup.localData)||!_.isArray(popup.convertPlans)||0===popup.convertPlans.length)return!1;var e=JSON.parse(JSON.stringify(popup.convertPlans)),n=e[0].is_in_convert_window&&e[0].is_in_convert_window.step||5e3,o=[];if(_.each(e,function(e,t){return!!e.is_in_convert_window&&((new Date).getTime()>e.is_in_convert_window.expire_time?(salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",popup.convertPlans[t].plan_id),delete popup.convertPlans[t].is_in_convert_window,popup.convertPlans.splice(t,1),popup.updateDataAndSetListen.updateLocalData(),!1):(o.push(e.is_in_convert_window.uuid),e.is_in_convert_window.step||(e.is_in_convert_window.step=5e3,popup.convertPlans[t].is_in_convert_window.step=5e3),void(n>e.is_in_convert_window.step&&(n=e.is_in_convert_window.step))))}),!o.length)return!1;popup.asyncConvert.timer&&clearTimeout(popup.asyncConvert.timer),popup.asyncConvert.timer=setTimeout(function(){_.ajax({url:popup.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(t)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(e){popup.changeCovertStatus(e),p()},error:function(){popup.changeCovertStatus(),p()}})},n)}()},popup.ruleTime={getExpire:function(e,t){var n=t,p=Number(e.value)||0,o=Number(e.value)||0,i=String(e.unit).toLowerCase(),a=null,r={day:function(){return(a=new Date(n)).setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+864e5*(o-1)},week:function(){var e=(a=new Date(n)).getDay();0===e&&(e=7);var t=7-e;return a.setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+24*t*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){var e=(a=new Date(n)).getMonth()+o;return e>=11?(a.setFullYear(a.getFullYear()+parseInt(e/12)),a.setMonth(e%12)):a.setMonth(e),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(e){var t={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(n),e in t&&(o=t[e]*p),a.getTime()+o}};return!0!==e.natural?r.second(i):i in r?r[i]():void 0},getLast:function(e,t){var n=Number(e.value)||0,p=Number(e.value)-1||0,o=String(e.unit).toLowerCase(),i=null,a={day:function(){return(i=new Date(t)).setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-864e5*p},week:function(){var e=(i=new Date(t)).getDay();return 0===e&&(e=7),--e,i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-(24*e*60*60*1e3+7*p*24*60*60*1e3)},month:function(){var e=(i=new Date(t)).getMonth()+1-p;return e<=0?(i.setFullYear(i.getFullYear()+(parseInt(e/12)-1)),i.setMonth(12+e%12-1)):i.setMonth(e-1),i.setDate(1),i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.getTime()},second:function(e){var p={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return i=new Date(t),e in p&&(o=p[e]*n),i.getTime()-o}};return!0!==e.natural?a.second(o):o in a?a[o]():void 0},getArrMatchCount:function(e,t){var n=0;for(n=0;n=e[n])return n;return e.length}},popup.eventTriggerProcess=function(){if(!popup.updateDataAndSetListen.active_state)return!1;if(!_.isArray(popup.localData.eventQueue))return!1;if(0===popup.localData.eventQueue.length)return!1;if(popup.isRun)return!1;salog("\u4e8b\u4ef6\u961f\u5217---eventQueue",popup.localData.eventQueue);var e=!1,t=popup.localData.eventQueue[0],n=popup.eventRule[t.event];popup.isRun=!0,popup.localData.eventQueue.shift(),popup.updateDataAndSetListen.updateLocalData(),_.isArray(n)&&_.isObject(n[0])&&n.length>0&&(salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),_.each(n,function(e){_.isObject(e)&&"undefined"!=typeof e.match_state&&delete e.match_state,new popup.RuleCheck(e,t)}),_.each(n,function(t){!0===t.match_state?!1===e?(e=!0,salog("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",t.plan.cname),new popup.PopupCheck(t,!0)):!0===e&&(salog("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",t.plan.cname),new popup.PopupCheck(t,!1)):salog("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",t.plan.cname)}),e||popup.completeWindowLifecycle(),salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},popup.completeWindowLifecycle=function(){popup.isRun=!1,popup.eventTriggerProcess()},popup.PopupCheck=function(e,t){this.plan=e.plan,this.current_time=(new Date).getTime(),t?this.renderPopup():this.hidePopup(),popup.updateDataAndSetListen.updateLocalData()},popup.PopupCheck.prototype.createPopupWindow=function(e,t){this.startConvertWindow(e),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),t&&popup.completeWindowLifecycle()},popup.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},popup.PopupCheck.prototype.renderPopup=function(){popup.handlerCampaign(this)},popup.PopupCheck.prototype.popupFailed=function(e,t,n){var p={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"}[e],o=popup.getPopupInfo(n.content);o.$sf_msg_id=n.uuid,o.plan=n.plan,o.$sf_succeed=!1,o.$sf_fail_reason=p,popup.track.popupDisplay(o),!t&&popup.info.popup_listener&&_.isFunction(popup.info.popup_listener.onLoadFailed)&&popup.info.popup_listener.onLoadFailed(n.plan.plan_id,e,p),popup.info.popup_campaign_listener.onFailed(popup.getSFCampaign(n.plan),e,p),this.createPopupWindow(n.uuid,!0)},popup.PopupCheck.prototype.customCampaign=function(e){var t=popup.getSFCampaign(e.plan),n=popup.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,popup.track.popupDisplay(n),popup.info.popup_campaign_listener.onStart(t),this.createPopupWindow(e.uuid,!0)},popup.PopupCheck.prototype.showPopup=function(e){if(!popup.ElementRender)return popup.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var t=new popup.ElementRender(e.content),n=popup.getPopupInfo(e.content);if(n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,_.extend(t.msg,n),t.popupCheckInstance=this,popup.track.popupDisplay(n),!t.render())return salog("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1;popup.info.popup_campaign_listener.onStart(popup.getSFCampaign(e.plan)),this.createPopupWindow(e.uuid),popup.info.popup_listener.onLoadSuccess(e.plan.plan_id)},popup.PopupCheck.prototype.startConvertWindow=function(e){salog("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),_.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:popup.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:e},popup.asyncConvert(this.plan))},popup.PopupCheck.prototype.startPopupIntervalWindow=function(e){_.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=popup.ruleTime.getExpire(this.plan.popup_interval,e))},popup.PopupCheck.prototype.resetPopupIntervalWindow=function(){var e=(new Date).getTime();this.startPopupIntervalWindow(e),this.resetGlobalLimit(e),popup.completeWindowLifecycle()},popup.PopupCheck.prototype.startPopupLimitWindow=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),_.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(_.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:popup.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},popup.PopupCheck.prototype.setGlobalLimit=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),_.isArray(popup.localData.global_popup_count)||(popup.localData.global_popup_count=[]),popup.localData.global_popup_count.unshift(this.current_time);for(var e=popup.localData.global_popup_count,t=e[e.length-1];t+7776e63e3;)e.pop(),t=e[e.length-1]},popup.PopupCheck.prototype.resetGlobalLimit=function(e){_.isArray(popup.localData.global_popup_count)&&popup.localData.global_popup_count.length>0&&(popup.localData.global_popup_count.shift(),popup.localData.global_popup_count.unshift(e))},popup.PopupCheck.prototype.deletePlanAllWindow=function(){var e=this.plan.pattern_popup.matcher_list;_.isArray(e)&&_.each(e,function(e){e.is_in_window&&(salog("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete e.is_in_window)})},popup.RuleCheck=function(e,t){this.plan_match=e,this.plan=e.plan,this.rule_arr=e.rule,this.event_data=t,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";_.each(this.rule_arr,function(e){n+="--\u5305\u542b\u89c4\u5219-("+e.event_name+"\uff09-\u89e6\u53d1"+e.params[0]+"\u6b21"}),salog(n),salog(this.plan),this.checkPlanIsExpire(),popup.updateDataAndSetListen.updateLocalData()},popup.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||_.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)salog("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(_.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var e=0;e=1){var t=popup.ruleTime.getLast(popup.localData.popup_interval_global,this.current_time);t>e[0]?(salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+t+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0]),this.checkPopupInterval()):salog("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+t+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0])}else salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},popup.RuleCheck.prototype.checkPopupInterval=function(){var e=!0;_.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null):(salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"),e=!1):(salog("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null),e&&this.checkPermission()&&this.checkProperties()},popup.RuleCheck.prototype.isMatched=function(e){var t={equal:function(e,t){if(!_.isNumber(e)&&!_.isString(e))return!1;for(var n=0,p=t.length;n=0},notContain:function(e,t){return!!_.isString(e)&&-1===e.indexOf(t[0])},isTrue:function(e){return!0===e},isFalse:function(e){return!1===e},isSet:function(e){return void 0!==e},notSet:function(e){return void 0===e},isEmpty:function(e){if(!_.isString(e)&&!_.isArray(e))return!1;if(_.isString(e))return""===e;for(var t=0;t_.getConvertNumberValue(t[0]))},between:function(e,t){if(!_.isNumber(e))return!1;if("undefined"==typeof t[0]&&"undefined"==typeof t[1])return!1;var n=_.getConvertNumberValue(e),p=_.getConvertNumberValue(t[0]),o=_.getConvertNumberValue(t[1]);return n>=p&&n<=o},isIn:function(e,t){if(!_.isArray(e))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(e,t){if(!_.isArray(e))return!1;for(var n=0;n=n&&o<=p}catch(i){salog("absolute_between Error",i)}},absoluteBetween:function(e,t){try{var n=new Date(t[0]),p=new Date(t[1]),o=new Date(e);return o>=n&&o<=p}catch(i){salog("absolute_between Error",i)}}},n=this,p=e.relation,o="or"===String(p).toLowerCase(),i="and"===String(p).toLowerCase(),a=!!i,r=!0;return _.each(e.conditions,function(e){if(!r)return!1;if(!e.field)return!1;var p=e.field.lastIndexOf("."),s=e.params,u="in"===e["function"]?"isIn":e["function"];if(!t[u])return a=!1,r=!1,!1;if(p<0)return!1;var l=e.field.slice(p+1),c=n.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=t[u](_,s);o&&d&&(a=!0,r=!1),i&&!d&&(a=!1,r=!1)}),a},popup.RuleCheck.prototype.checkProperties=function(){var e=this,t=_.filter(this.rule_arr,function(t){var n=t.multi_filter?t.multi_filter:t.filter;return!(n&&(!n.conditions||0!==n.conditions.length))||e.isMatched(n)});_.isArray(t)&&t.length>0?(this.checkWindowAndMatch(t),salog("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",t)):salog("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},popup.RuleCheck.prototype.checkPermission=function(){var e=this.plan.event_permission;if(!_.isObject(e)||_.isEmptyObject(e))return!0;var t=this,n=[],p=function(e){return _.filter(e,function(e){return!(e&&e.conditions&&(!e.conditions||0!==e.conditions.length))||t.isMatched(e)})};return function o(e){_.each(e,function(e){if(n=p([e]),_.isArray(n)&&n.length>0){var t=e.filters||[];t&&t.length>0&&o(t)}})}([e]),_.isArray(n)&&n.length>0?(popup.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n),!0):(popup.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3"),!1)},popup.RuleCheck.prototype.checkWindowAndMatch=function(e){var t=this,n=[];_.each(e,function(e){if(!e.params||!e.params[0])return salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var p=Number(e.params[0]);1===p?n.push(e):p>1&&_.isObject(e.window)&&e.window.value>0&&(!_.isObject(e.is_in_window)||!_.isNumber(e.is_in_window.expire_time)||e.is_in_window.expire_time=p?n.push(e):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",e.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",p))}),n.length>0?(salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},popup.RuleCheck.prototype.checkGlobalPopupLimit=function(){var e=popup.localData.msg_limit_global,t=!0,n=this;_.isObject(e)&&!0===e.is_in_use&&_.isArray(e.limits)&&_.isArray(popup.localData.global_popup_count)&&!0===this.plan.global_msg_limit_enabled?(_.each(e.limits,function(e){if(_.isObject(e)&&_.isNumber(e.limit)){var p=popup.ruleTime.getLast(e,n.current_time),o=popup.ruleTime.getArrMatchCount(popup.localData.global_popup_count,p);salog("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+o+"-\u9650\u5236\u7684\u6b21\u6570"+e.limit+"-\u9650\u5236\u65f6\u95f4-"+p),t=o1024)return"object"==typeof console&&console.log&&console.log("H5 \u5f39\u7a97\u4ec5\u652f\u6301\u79fb\u52a8\u7aef\u548c ipad\uff0c\u6216\u8005\u5c4f\u5e55\u5bbd\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 1024\u3002"),!1;var e={};return arguments.length>0&&(1===arguments.length&&_.isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&_.isObject(arguments[1])&&(e=arguments[1])),!!this.setPara(e)&&(popup.info.platform="H5",!!popup.setIsLoad()&&(!!this.getBridgeState()&&void(popup.testSend.hasParam()?popup.testSend.start():(popup.listenPageStateChange(),popup.updateDataAndSetListen.initial()))))}popup.store={delete_time:2592e6,init:function(){this.migrateLocalData(),popup.localData=this.getLocalData(),_.isNumber(popup.localData.config_pull_interval_ms)&&popup.localData.config_pull_interval_ms>0&&(popup.updateDataAndSetListen.interval_time=popup.localData.config_pull_interval_ms),this.removeLocalData(),popup.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var e=_.localStorage.get(popup.config.storageName);_.isString(e)&&(e=decrypt(e));try{e=JSON.parse(e)}catch(t){_.log(t)}return e},saveJSONData:function(e){e=JSON.stringify(e),popup.info.encrypt_cookie&&(e=encrypt(e)),_.localStorage.set(popup.config.storageName,e)},migrateLocalData:function(){var e=this.getJSONData()||{},t=popup.sa.store.getDistinctId();if(e.popup_sdk_users&&e.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[t]=e,n.popup_sdk_users[t]={user_id:t},this.saveJSONData(n)},getLocalData:function(){var e=this.getJSONData(),t=popup.sa.store.getDistinctId(),n=null;return e?(_.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id),n&&_.isObject(e.popup_sdk_plans[n])?(e.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(e),e.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var e=this.getJSONData(),t=popup.sa.store.getDistinctId(),n=null;if(!e)return!1;e.popup_sdk_users&&_.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id,e.popup_sdk_plans[n]=popup.localData,this.saveJSONData(e))},removeLocalData:function(){var e=this.getJSONData(),t=this.delete_time;if(!e||!e.popup_sdk_plans||!e.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(e.popup_sdk_plans)),p=JSON.parse(JSON.stringify(e.popup_sdk_users)),o=(new Date).getTime(),i=[];_.each(n,function(n,p){o-n.update_time>t&&(delete e.popup_sdk_plans[p],i.push(p))}),_.each(p,function(t,n){i.length>0&&_.each(i,function(p){t.user_id&&p===t.user_id&&delete e.popup_sdk_users[n]})}),this.saveJSONData(e)}},popup.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var e=popup.localData.popup_plans;if(!e||!_.isArray(e))return!1;var t=_.filter(e,function(e){return!!e.convert_window&&!!e.is_in_convert_window});popup.convertPlans=t,popup.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",popup.convertPlans),popup.asyncConvert()},diffData:function(){var e=popup.localData,t=JSON.parse(JSON.stringify(popup.serverData));(new Date).getTime();if(!t||_.isEmptyObject(t))return!1;if(!e||_.isEmptyObject(e)||!e.popup_plans||0===e.popup_plans.length)return _.extend(popup.localData,t),!1;var n=t.popup_plans;_.each(n,function(t,p){var o=null;if(_.each(e.popup_plans,function(e){e.plan_id===t.plan_id&&(o=e,t.audience_id||delete o.audience_id,_.isObject(t.window_update)&&_.each(t.window_update,function(e,n){o.window_update&&o.window_update[n]===e||("trigger_window"===n?o.pattern_popup.matcher_list=t.pattern_popup.matcher_list:"convert_window"===n&&o.is_in_convert_window&&t.convert_window&&o.is_in_convert_window.start_time&&(o.is_in_convert_window.expire_time=popup.ruleTime.getExpire(t.convert_window,o.is_in_convert_window.start_time)))}))}),!o)return!1;if(!t.window_update&&o.last_update_config_time!==t.last_update_config_time)return!1;var i=o.pattern_popup.matcher_list;_.extend2Lev(o,t),o.pattern_popup.matcher_list=i,n[p]=o}),_.extend(popup.localData,t)},getEventRule:function(){var e=popup.localData.popup_plans,t={};if(!e||!_.isArray(e))return!1;_.each(e,function(e){var n=e.pattern_popup.matcher_list;_.each(n,function(n){var p={plan:e,rule:[n]},o=n.event_name,i=!1;if(t[o]){if(_.each(t[o],function(t){t.plan.plan_id===e.plan_id&&(t.rule.push(n),i=!0)}),i)return!1;t[o].push(p)}else t[o]=[p]})}),_.each(t,function(e){e.sort(function(e,t){var n=t.plan.absolute_priority-e.plan.absolute_priority;return 0===n?t.plan.plan_id-e.plan.plan_id:n})}),popup.eventRule=t,popup.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),popup.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------")},registerListen:function(){var e=this;popup.sa.events.on("send",function(t){t.event&&popup.eventRule[t.event]&&(_.isArray(popup.localData.eventQueue)||(popup.localData.eventQueue=[]),popup.localData.eventQueue.push(t),e.updateLocalData(),popup.eventTriggerProcess())}),popup.sa.events.on("changeDistinctId",function(t){e.changeId()}),popup.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(e){if(e.length<1)return!1;if(JSON.stringify(e)===JSON.stringify(this.image_list))return!1;this.image_list=e;for(var t=0;t0&&(n.interval_time=p.config_pull_interval_ms),popup.serverData.local_update_time=(new Date).getTime(),popup.info.preload_image&&n.loadImage(popup.getImageList(p.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},popup.localData={},n.updateLocalData()),e(),n.setIntervalTime(n.interval_time)},error:function(){if(!n.active_state)return t(),!1;popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},e(),n.setIntervalTime(n.interval_time)}})},updateUserPlans:function(){var e=popup.store.getJSONData(),t=popup.sa.store.getDistinctId(),n=popup.serverData.user_id;e.popup_sdk_users[t]={user_id:n||t},n?e.popup_sdk_plans[n]?popup.localData=e.popup_sdk_plans[n]:e.popup_sdk_plans[t]&&(popup.localData=e.popup_sdk_plans[t],delete e.popup_sdk_plans[t]):e.popup_sdk_plans[t]&&(popup.localData=e.popup_sdk_plans[t]),popup.localData.update_time=(new Date).getTime(),popup.store.saveJSONData(e)},setIntervalTime:function(e){var t=this;this.data_interval=setTimeout(function(){popup.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),t.getDataFromServer()},e)},setFirstListen:function(){var e=this;this.getDataFromServer(function(){e.registerListen()})},updateLocalData:function(){var e=JSON.stringify(popup.localData);this.local_data!==e&&(this.local_data=e,popup.store.saveLocalData())},initial:function(){popup.store.init();var e=popup.localData.local_update_time,t=(new Date).getTime();if(_.isNumber(e)){var n=t-e;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),popup.info.preload_image&&this.loadImage(popup.getImageList(popup.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,popup.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),popup.asyncConvert.timer&&window.clearTimeout(popup.asyncConvert.timer),popup.convertPlans=[],popup.localData={},this.resetState()},resetState:function(){if("WEB"===popup.info.platform)return!1;!document.querySelector("div[data-sf-mask]")&&popup.isRun&&(popup.isRun=!1)},startState:function(e){this.active_state=!0,(e=e||{getLocalData:!0}).getLocalData&&(this.resetState(),popup.localData=popup.store.getLocalData()),this.getDataFromServer()}},popup.testSend={hasParam:function(){var e=_.URL(window.location.href).searchParams,t=e.get("sf_popup_test")||"",n=e.get("popup_window_id")||"",p=e.get("platform");return!(!t||!n)&&{sf_popup_test:t,popup_window_id:n,platform:p}},start:function(){var e=popup.info.project,t=popup.info.platform,n=this.hasParam().popup_window_id,p=this.hasParam().platform,o=encodeURIComponent(popup.sa.store.getDistinctId());if("WEB"===p)return popup.log("WEB\u7aef\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728PC\u8bbe\u5907\u6253\u5f00\uff01"),!1;_.ajax({url:popup.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(e)+"&time="+(new Date).getTime()+"&sdk_version="+popup.lib_version+"&platform="+encodeURIComponent(t)+"&distinct_id="+o,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(e){var t,n=_.getUuid();_.isObject(e)||(popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",e),e={});try{t=JSON.parse(e.content)}catch(i){popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",e,i)}var p=popup.getPopupInfo(t);p.$sf_msg_id=n;var o={content:e.content,type:e.popup_type||"PRESET"};(Object.hasOwnProperty.call(e,"name")&&(o.name=e.name),e.popup_type&&"CUSTOMIZED"===e.popup_type)?_.isString(e.content)?"withoutCampaignListener"===popup.info.supportCustom||"withoutStart"===popup.info.supportCustom?(p.$sf_succeed=!1,p.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(p.$sf_succeed=!0,popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onStart(o)):(p.$sf_succeed=!1,p.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e")):_.isObject(t)&&_.isObject(t.properties)&&_.isObject(t.template)?(new popup.ElementRender(t).render(),p.$sf_succeed=!0,popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onStart(o),popup.info.popup_listener.onLoadSuccess()):(p.$sf_succeed=!1,p.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",popup.track.popupDisplay(p),popup.info.popup_listener.onLoadFailed("",1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"),popup.info.popup_campaign_listener.onFailed(o,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"))},error:function(e){popup.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",e)}})}},popup.setPara=function(e){_.isObject(e)||(e={}),popup.info=_.extend({},popup.defaultPara,e);var t=popup.sa;if(!t)return popup.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1;if(!0===t.para.encrypt_cookie&&(popup.info.encrypt_cookie=!0),!_.isString(popup.info.api_base_url)||"http"!==popup.info.api_base_url.slice(0,4))return popup.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1;if("http:"===popup.info.api_base_url.slice(0,5)&&"https:"===location.protocol)return popup.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1;if(popup.info.api_base_url="/"===popup.info.api_base_url.slice(-1)?popup.info.api_base_url.slice(0,-1):popup.info.api_base_url,!_.isString(t.para.server_url)||"http"!==t.para.server_url.slice(0,4))return popup.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1;if(popup.info.project||(popup.info.project=_.URL(t.para.server_url).searchParams.get("project")||"default"),_.isObject(popup.info.popup_listener)){var n=popup.info.popup_listener;_.isFunction(n.onClick)||(popup.info.popup_listener.onClick=function(){}),_.isFunction(n.onLoadSuccess)||(popup.info.popup_listener.onLoadSuccess=function(){}),_.isFunction(n.onLoadFailed)||(popup.info.popup_listener.onLoadFailed=function(){}),_.isFunction(n.onClose)||(popup.info.popup_listener.onClose=function(){}),_.isString(n.openlink)?"auto"!==n.openlink&&"customize"!==n.openlink&&(popup.info.popup_listener.openlink="customize"):popup.info.popup_listener.openlink="customize"}else popup.info.popup_listener={onClick:function(){},onLoadSuccess:function(){},onLoadFailed:function(){},onClose:function(){},openlink:"customize"};return popup.info.supportCustom=!0,_.isObject(popup.info.popup_campaign_listener)?(_.isFunction(popup.info.popup_campaign_listener.shouldStart)||(popup.info.popup_campaign_listener.shouldStart=function(){return!0}),_.isFunction(popup.info.popup_campaign_listener.onStart)||(popup.info.supportCustom="withoutStart",popup.info.popup_campaign_listener.onStart=function(){}),_.isFunction(popup.info.popup_campaign_listener.onEnd)||(popup.info.popup_campaign_listener.onEnd=function(){}),_.isFunction(popup.info.popup_campaign_listener.onFailed)||(popup.info.popup_campaign_listener.onFailed=function(){}),_.isFunction(popup.info.popup_campaign_listener.onClick)||(popup.info.popup_campaign_listener.onClick=function(){})):(popup.info.supportCustom="withoutCampaignListener",popup.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0},popup.getBridgeState=function(){return!_.isObject(popup.sa.para.app_js_bridge)||!popup.sa.para.app_js_bridge.is_mui&&(!popup.sa.bridge||!popup.sa.bridge.is_verify_success)},popup.init=function(){var e=window.sensorsDataAnalytic201505;if(popup.sa=e,e&&e.readyState&&e.readyState.state>=3||!e.on)initPopup.apply(this,arguments);else{var t=this,n=arguments;e&&e.on("sdkReady",function(){initPopup.apply(t,n)})}},popup.plugin_name="Popup",window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?(window.SensorsDataWebJSSDKPlugin.popup=window.SensorsDataWebJSSDKPlugin.popup||popup,window.SensorsDataWebJSSDKPlugin.Popup=window.SensorsDataWebJSSDKPlugin.Popup||popup):window.SensorsDataWebJSSDKPlugin={popup:popup,Popup:popup};export default popup; \ No newline at end of file diff --git a/dist/web/plugin/sf-sdk-web/popup.min.js b/dist/web/plugin/sf-sdk-web/popup.min.js index b7a9cec4..e87d91c6 100644 --- a/dist/web/plugin/sf-sdk-web/popup.min.js +++ b/dist/web/plugin/sf-sdk-web/popup.min.js @@ -1,2 +1,2 @@ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():t()}(this,function(){"use strict";function e(e){this.properties=e.properties,this.template=e.template,this.maskEle=null,this.containerEle=null,this.msg={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:"",$sf_succeed:"",$sf_fail_reason:"",$sf_msg_id:"",plan:{}},this.popupCheckInstance=null}function t(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=t.length-1,i={},o=0;for(o=0;o1024)return"object"==typeof console&&console.log&&console.log("H5 \u5f39\u7a97\u4ec5\u652f\u6301\u79fb\u52a8\u7aef\u548c ipad\uff0c\u6216\u8005\u5c4f\u5e55\u5bbd\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 1024\u3002"),!1;var e={};return arguments.length>0&&(1===arguments.length&&r.isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&r.isObject(arguments[1])&&(e=arguments[1])),!!this.setPara(e)&&(a.info.platform="H5",!!a.setIsLoad()&&(!!this.getBridgeState()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial()))))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.26.8",plugin_version:"1.26.8",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(e){var t={};if(e&&"[object Object]"===Object.prototype.toString.call(e)){for(var n in e)n&&"popup_window_content"!==n&&(t[n]=e[n]);return JSON.stringify(t,null," ")}return e},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-popupdata",loadedSign:"SensorsData2015JSSDKH5PopupIsLoad"};var r={visibility:function(e){e=e||{};var t={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:e.onVisible,_hidden:e.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){t._nativeSwitch.apply(t,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(e){}},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()}};t.init()},getRgba:function(e){return"object"!=typeof e?e:"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"},conversionNum:function(e){if(e){if(/^[0|1]?\.\d+$/.test(e))return 100*Number(e)+"%";var t=/^(-?\d+(\.\d+)?)px$/.exec(e);return t?(Number(t[1])/375*window.screen.width).toFixed(2)+"px":e}},boxModel:function(e){return function(t){if("object"!=typeof t)return e+":"+t+";";var n="";for(var i in t)n+=e+"-"+i+":"+r.conversionNum(t[i])+";";return n}},localStorage:{get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t=null;try{t=JSON.parse(r.localStorage.get(e))||null}catch(n){}return t},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";r.localStorage.set(t,n),r.localStorage.get(t)!==n&&(e=!1),r.localStorage.remove(t)}catch(i){e=!1}return e}},addEvent:function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}function t(t,n,i){var o=function(o){if(o=o||e(window.event)){o.target=o.srcElement;var a,r,s=!0;return"function"==typeof i&&(a=i(o)),r=n.call(t,o),!1!==a&&!1!==r||(s=!1),s}};return o}e._getPath=function(){var e=this,t=function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||t()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,o){if(n&&n.addEventListener)n.addEventListener(i,function(t){t._getPath=e._getPath,o.call(this,t)},!1);else{var a="on"+i,r=n[a];n[a]=t(n,o,r)}};n.apply(null,arguments)},extend:function(e){var t=Array.prototype.slice;return r.each(t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},extend2Lev:function(e){return r.each(Array.prototype.slice.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(r.isObject(t[n])&&r.isObject(e[n])?r.extend(e[n],t[n]):e[n]=t[n])}),e},each:function(e,t,n){var i=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,a={};if(null==e)return!1;if(o&&e.forEach===o)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,s=e.length;r=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r.isObject(e.header)&&r.each(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(e.data||null)},getUuid:function(){var e=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},t=function(){return Math.random().toString(16).replace(".","")};return function(){var n=e()+"-"+t()+"-"+t();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(e){var t=Object.prototype.hasOwnProperty;if(r.isObject(e)){for(var n in e)if(t.call(e,n))return!1;return!0}return!1},filter:function(e,t,n){var i=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var o=[],a=0;a=0;s--){var p=n[s];t[p]=a[p]}t.hostname&&"string"==typeof t.pathname&&0!==t.pathname.indexOf("/")&&(t.pathname="/"+t.pathname),t.searchParams=function(){var e=r.getURLSearchParams(t.search);return{get:function(t){return e[t]}}}()}return t},contentLoaded:function(e,t){var n=!1,i=!0,o=e.document,a=o.documentElement,r=o.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",l=r?"":"on",u=function(i){"readystatechange"==i.type&&"complete"!=o.readyState||(("load"==i.type?e:o)[p](l+i.type,u,!1),!n&&(n=!0)&&t.call(e,i.type||i))},c=function(){try{a.doScroll("left")}catch(e){return void setTimeout(c,50)}u("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(!r&&a.doScroll){try{i=!e.frameElement}catch(_){}i&&c()}o[s](l+"DOMContentLoaded",u,!1),o[s](l+"readystatechange",u,!1),e[s](l+"load",u,!1)}},indexOf:function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(e){function t(e){r.each(e.subviews,function(e){var i=e.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===e.type&&(n.$sf_msg_image_url=i.image),e.subviews&&t(e)})}if(!r.isObject(e)||!r.isObject(e.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return t(e.template),n},a.getSFCampaign=function(e){e=r.isObject(e)?e:{};var t={planId:"",name:"",content:null,type:""};return t.planId=e.plan_id||"",t.name=e.cname||"",t.content=r.isObject(e.popup_window_content)?e.popup_window_content.content:"",t.type=r.isObject(e.popup_window_content)&&e.popup_window_content.popup_type?e.popup_window_content.popup_type:"PRESET",t},a.getImageList=function(e){if(!r.isArray(e))return!1;for(var t,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),a={},s=e.length,p=[],l=!1,u=0;u0&&(a[n[0]]||(a[n[0]]=1));return r.each(a,function(e,t){p.push(t)}),p},a.setIsLoad=function(){var e=window.self===window.top;if(e){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(t){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",t),!0}};var s={close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAe1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////NgkbwAAAAKHRSTlMA5if6t/B0UjMSxpAtJB4MBfTr30oY6NjV0r2loZ6XkoaBenFp3UA/LNePaQAAAsxJREFUWMOsltlygzAMRRXMZsAsAZJmX9v6/7+wg1QXpjGxCDkvyWTIQZauDcCgzKLrPtnUSyGW9SbZX6OshDcQh36lH6j8MJ7pTZd6lGX6sr0IP7SDj7CA6chLoBkEFzm14nM1/P/2eGti1RZFq+LmdtwGw7afJ1Ue1dogcGCW4QptqCO2OPe1IbnL0Y7dE23wc2bJgSn44MFTvIMwLeMUXqZGfGKUkp+MPC2dwUjMGhWwUL7pnXRUsdbIIpow84VG1k9Xmf1e5U8Kq/R/68memAPqcggTCQUNc9SdL+iCL5jMd0B1j/RErh3LYrRyLa2po2x8KngJ9Uk5sWUwpZoVvIiiulNLhMwgHDhDED2MEH8X3zCDL4HV/R8lRTOEWYS0KWzt8GEm/mNLihpHKOeqJY6yLqDnbO42F1r9eXCzitMOfkuqfvkXTId6h1phSi5/ncbgneAtnDCAxTAzIn+POhfDFOObzAEsNLu0HXO06a4BCwd89wEk1h2ezdwl0rObvS5nNreHurg/lxKwsNPoHjXrHVhI+lMK3xjvMH4YelYzCSzc8V3zrx9CWtu5MG67eWEdhBSmI+GT7eIZt+Nny7YJ+y8ON9/cF1tWVL7LzTdTi6sSMtw9AE432wwl7u6MzqotMNwcM7Glc/TafRyB4+aa4dhdcoV993EDlptphlt3zZ72TgM8N88MDe3vDQWE5V6tWGaKyAbwqaiA5+aZQeETkk6QFtxuvhlaOkVwwxfgdq/IvHKbocBj6ac5OzYCIASBKGo10n+HBgakMswbaYDgTmX3fzgafhD4G+Hhg1cGXnT4PMFHVayCdVcBXGBu7cKwACOOC2YwTsIQ7KI7LBywJrlyByupK9Kw/lto4VFLAqLdmRwJiBDWwjDOI0QPPhPXRn3yTlyrILND4w7oOw3h5AlTPk5U/ddrZSk4RWW+C9hp2rgru6GiP/678n2UFPV1AAAAAElFTkSuQmCC"},p={row:"div",column:"div",label:"pre",image:"img",button:"button",link:"button",image_button:"img"},l={textAlign:"text-align",font:"font-size",backgroundColor:"background-color",borderWidth:function(e){return"border-width: "+e+";border-style: solid;"},borderColor:"border-color",cornerRadius:"border-radius",backgroundImage:function(e){return"background-image:url("+e+");background-repeat: no-repeat;background-size: 100% 100%;"},margin:r.boxModel("margin"),padding:r.boxModel("padding"),maxHeight:"max-height",maxWidth:"max-width",scrollableX:function(e){if(e)return"overflow-x:auto;"},scrollableY:function(e){if(e)return"overflow-y:auto;"}};e.prototype={constructor:e,render:function(){function e(e,n){var i=e.maskAction.H5,o=r.isArray(i)&&i[0];if(r.isObject(o))switch(n.$sf_close_type=o.$sf_close_type||"",n.$sf_msg_element_action=o.type||"",o.type){case"copy":a.track.trackEvent("$PlanPopupClick",n,t.msg);break;case"customize":case"openlink":a.track.trackEvent("$PlanPopupClick",n,t.msg),o.closeable&&t.destory();break;case"close":o.closeable&&(a.track.trackEvent("$PlanPopupClick",n,t.msg),t.destory())}}var t=this,n=document.querySelector("div[data-sf-mask]");return!n&&(t.template.isRoot=!0,t.containerEle=t.createView(t.template),t.maskEle=t.getElement({nodeName:"div",attr:{"data-sensors-click":!0},style:t.getStyle({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:r.getRgba(t.properties.maskColor),"z-index":999998})}),r.addEvent(t.maskEle,"click",function(n){var i=n.target,o=i.getAttribute("data-ele-mask"),r=t.properties,s=t.msg;if(!s)return!1;var p={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_action:"close",$sf_msg_element_type:"mask",$sf_msg_action_id:r.maskActionId};return o&&r&&r.maskAction?(e(r,p),!1):o&&t.properties.maskCloseEnabled?(a.track.trackEvent("$PlanPopupClick",p,s),t.destory(),!1):void a.track.elementClickCallback(n,t)}),t.maskEle.setAttribute("data-sf-mask",!0),t.maskEle.appendChild(t.containerEle),r.contentLoaded(window,function(){t.appendPopup()}),!0)},appendPopup:function(){if(window.self===window.top)document.body.appendChild(this.maskEle);else try{window.top.document.body.appendChild(this.maskEle)}catch(e){document.body.appendChild(this.maskEle)}var t=document.querySelector("[data-ele-mask] > div"),n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;t&&t.offsetHeight>n&&(t.style.marginTop="auto")},getElement:function(e){var t=e.nodeName||"div",n=e.style,i=e.attr,o=e.prop,a=e.child,s=e.action,p=e.element_info,l=document.createElement(t);return n&&l.setAttribute("style",n),i&&r.each(i,function(e,t){e&&l.setAttribute(t,e)}),o&&r.each(o,function(e,t){e&&(l[t]=e)}),a&&a.length&&r.each(a,function(e){return!!e&&void l.appendChild(e)}),s&&s.H5&&s.H5.length&&l.setAttribute("data-action",JSON.stringify(s.H5)),p&&l.setAttribute("data-info",JSON.stringify(p)),l},getStyle:function(e){var t="",n=["msgType","text","image","name","isHidden","align","localImageName"];return r.each(e,function(e,i){var e=r.conversionNum(e),o=l[i];return!(r.indexOf(n,i)>=0)&&void(t+=r.isString(o)?o+":"+r.getRgba(e)+";":r.isFunction(o)?o(e)+";":i+":"+r.getRgba(e)+";")}),t},createView:function(e){var t=[],n={"box-sizing":"border-box",display:"block","pointer-events":"auto",overflow:"hidden"},i={},o={},a=p[e.type]||null;e.properties=e.properties||{},e.layout=e.layout||{};var l=e.properties.font,u=l?1.7*parseInt(l)+"px":"normal";if(e.properties.isHidden)return!1;switch(e.properties.text?o.innerText=e.properties.text:e.properties.image&&(i["data-sensors-click"]=!0,e.properties.localImageName?i.src=s[e.properties.localImageName]:i.src=e.properties.image),e.isRoot&&(e.layout.margin.top="-40px",r.extend(n,{position:"relative","z-index":999999,"pointer-events":"none"})),e.type){case"row":n.display="flex";break;case"link":r.extend(n,{"text-decoration":"underline",outline:"none","letter-spacing":"1px","line-height":u});break;case"label":r.extend(n,{"white-space":"pre-wrap","word-wrap":"break-word","letter-spacing":"1px","line-height":u,"margin-top":"0px","margin-bottom":"0px"});break;case"button":r.extend(n,{outline:"none","letter-spacing":"1px","line-height":u})}r.extend(n,e.layout,e.properties),e.subviews&&e.subviews.length>0&&r.each(e.subviews,function(e){t.push(this.createView(e))},this);var c=this.getElement({element_info:{$sf_msg_element_type:e.type,$sf_msg_element_content:e.properties.text||""},nodeName:a,attr:i,prop:o,style:this.getStyle(n),child:t,action:e.action});if(e.layout.align){var _={center:"center",left:"flex-start",right:"flex-end"},d=document.createElement("div"),n="display:flex;justify-content:"+_[e.layout.align]+";";return e.isRoot?(n+="width:100%;height:100%;overflow-y:auto;box-sizing: border-box;align-items:center;",d.setAttribute("style",n),d.setAttribute("data-ele-mask",!0)):d.setAttribute("style",n),d.appendChild(c),d}return c},destory:function(){var e=this.msg.plan.plan_id||"";if(window.self===window.top)document.body.removeChild(this.maskEle);else try{window.top.document.body.removeChild(this.maskEle)}catch(t){document.body.removeChild(this.maskEle)}a.info.popup_listener.onClose(e),a.info.popup_campaign_listener.onEnd(a.getSFCampaign(this.msg.plan)),this.popupCheckInstance&&this.popupCheckInstance.resetPopupIntervalWindow()}},a.ElementRender=e,a.handlerCampaign=function(e){var t=e,n=r.getUuid()(),i=t.plan.popup_window_content;if(!r.isObject(i))return t.popupFailed(1001,!1,{uuid:n,content:"",plan:t.plan}),!1;var o;if(i.content)try{o=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(t.plan),l={state:"",isCustom:!1},u=!0;try{u=a.info.popup_campaign_listener.shouldStart(p)}catch(s){u=!1,a.log(s)}var c={uuid:n,content:o,plan:t.plan};switch(t.plan.strategy_id?t.plan.is_trigger?u?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":r.isString(i.content)?l.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":l.state="DIALOG_NOT_SHOW_JSON_FAILED":"PRESET"===i.popup_type&&r.isObject(o)&&r.isObject(o.properties)&&r.isObject(o.template)?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START":l.state="CAMPAIGN_NOT_START_TRIGGER":t.plan.is_control_group?l.state="DIALOG_NOT_SHOW":u?r.isObject(o)&&o.properties&&o.template?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START",l.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",l,"plan:",t.plan.cname),l.state){case"DIALOG_SHOW":t.showPopup(c);break;case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":t.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":t.popupFailed(1004,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":t.popupFailed(1006,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":t.popupFailed(1006,l.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":t.popupFailed(1001,l.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":t.popupFailed(1005,l.isCustom,c);break;case"DIALOG_NOT_SHOW":t.popupFailed(1003,l.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(e){var t=e.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:e.$sf_msg_id};return r.isEmptyObject(t)||!r.isObject(t)?n:(n.$sf_plan_id=t.plan_id+"",n.$sf_plan_strategy_id=t.strategy_id?t.strategy_id:t.is_control_group?"-1":"0",t.audience_id&&(n.$sf_audience_id=t.audience_id+""),t.section_id&&(n.$sf_section_id=String(t.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(e){var t={$sf_msg_title:e.$sf_msg_title,$sf_msg_content:e.$sf_msg_content,$sf_msg_image_url:e.$sf_msg_image_url,$sf_succeed:e.$sf_succeed,$sf_fail_reason:e.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",t,e)},trackEvent:function(e,t,n){var i=a.track.getPublicProps(n);r.extend(t,i),r.each(t,function(e,n){""!==e&&void 0!==e||delete t[n]}),a.sa.track(e,t)},maskClick:function(e){if(!e.msg)return!1;var t={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:e.msg.$sf_msg_title,$sf_msg_content:e.msg.$sf_msg_content,$sf_msg_image_url:e.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:e.properties.maskActionId};this.trackEvent("$PlanPopupClick",t,e.msg),e.destory()},elementClickCallback:function(e,t){var n=e.target,i=n.getAttribute("data-action"),o=n.getAttribute("data-info"),s=t.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},l=p[0],u=JSON.parse(o)||{}}catch(e){a.log("elementClickCallback error",e)}var c={type:l.type,value:r.isString(l.value)?l.value:"",extra:r.isObject(l.value)?l.value:""},_=t.msg.plan?t.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:u.$sf_msg_element_type,$sf_msg_element_content:u.$sf_msg_element_content,$sf_msg_element_action:l.type,$sf_msg_action_id:l.id,$sf_close_type:"close"===l.type?l.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=t.msg.plan;if(f){var m={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(m)}}catch(e){a.log("popup_listener.onClick error",e)}if("close"===l.type)t.destory();else if(l.closeable?t.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===l.type){if("http"!==l.value.slice(0,4))return!1;window.location.href=l.value}}};var u=a.log;a.changeCovertStatus=function(e){var t=JSON.parse(JSON.stringify(a.convertPlans));r.each(t,function(t,n){if(!t.is_in_convert_window)return!1;var i=t.is_in_convert_window.step,o=t.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!e&&void r.each(e,function(e){e.popup_display_uuid===o&&e.convert_time&&(u("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(e){function t(){if(r.isEmptyObject(a.localData)||!r.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var e=JSON.parse(JSON.stringify(a.convertPlans)),i=e[0].is_in_convert_window&&e[0].is_in_convert_window.step||5e3,o=[];return r.each(e,function(e,t){if(!e.is_in_convert_window)return!1;var n=(new Date).getTime(),r=e.is_in_convert_window.expire_time;return n>r?(u("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[t].plan_id),delete a.convertPlans[t].is_in_convert_window,a.convertPlans.splice(t,1),a.updateDataAndSetListen.updateLocalData(),!1):(o.push(e.is_in_convert_window.uuid),e.is_in_convert_window.step||(e.is_in_convert_window.step=5e3,a.convertPlans[t].is_in_convert_window.step=5e3),void(i>e.is_in_convert_window.step&&(i=e.is_in_convert_window.step)))}),!!o.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){r.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(e){a.changeCovertStatus(e),t()},error:function(){a.changeCovertStatus(),t()}})},i)))}var n=a.info.project,i=!1;return!(!e&&0===a.convertPlans.length)&&(e&&(r.each(a.convertPlans,function(t){t.plan_id===e.plan_id&&(i=!0)}),i||a.convertPlans.push(e)),void t())},a.ruleTime={getExpire:function(e,t){var n=t,i=Number(e.value)||0,o=Number(e.value)||0,a=String(e.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(o-1)},week:function(){r=new Date(n);var e=r.getDay();0===e&&(e=7);var t=7-e;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*t*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){r=new Date(n);var e=r.getMonth(),t=e+o;return t>=11?(r.setFullYear(r.getFullYear()+parseInt(t/12)),r.setMonth(t%12)):r.setMonth(t),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(e){var t={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return r=new Date(n),e in t&&(o=t[e]*i),r.getTime()+o}};return e.natural!==!0?s.second(a):a in s?s[a]():void 0},getLast:function(e,t){var n=Number(e.value)||0,i=Number(e.value)-1||0,o=String(e.unit).toLowerCase(),a=null,r={day:function(){return a=new Date(t),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-864e5*i},week:function(){a=new Date(t);var e=a.getDay();return 0===e&&(e=7),--e,a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-(24*e*60*60*1e3+7*i*24*60*60*1e3)},month:function(){a=new Date(t);var e=a.getMonth()+1,n=e-i;return n<=0?(a.setFullYear(a.getFullYear()+(parseInt(n/12)-1)),a.setMonth(12+n%12-1)):a.setMonth(n-1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(e){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(t),e in i&&(o=i[e]*n),a.getTime()-o}};return e.natural!==!0?r.second(o):o in r?r[o]():void 0},getArrMatchCount:function(e,t){var n=0;for(n=0;n=e[n])return n;return e.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!r.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;u("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var e=!1,t=a.localData.eventQueue[0],n=a.eventRule[t.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),r.isArray(n)&&r.isObject(n[0])&&n.length>0&&(u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),r.each(n,function(e){r.isObject(e)&&"undefined"!=typeof e.match_state&&delete e.match_state,new a.RuleCheck(e,t)}),r.each(n,function(t){t.match_state===!0?e===!1?(e=!0,u("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",t.plan.cname),new a.PopupCheck(t,(!0))):e===!0&&(u("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",t.plan.cname),new a.PopupCheck(t,(!1))):u("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",t.plan.cname)}),e||a.completeWindowLifecycle(),u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(e,t){this.plan=e.plan,this.current_time=(new Date).getTime(),t?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(e,t){this.startConvertWindow(e),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),t&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(e,t,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},o=i[e],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=o,a.track.popupDisplay(s),!t&&a.info.popup_listener&&r.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,e,o),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),e,o),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(e){var t=a.getSFCampaign(e.plan),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(t),this.createPopupWindow(e.uuid,!0)},a.PopupCheck.prototype.showPopup=function(e){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var t=new a.ElementRender(e.content),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,r.extend(t.msg,n),t.popupCheckInstance=this,a.track.popupDisplay(n);var i=t.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(e.plan)),this.createPopupWindow(e.uuid),void a.info.popup_listener.onLoadSuccess(e.plan.plan_id)):(u("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(e){u("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),r.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:e},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(e){r.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,e))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var e=(new Date).getTime();this.startPopupIntervalWindow(e),this.resetGlobalLimit(e),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){u("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),r.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(r.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={ +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():t()}(this,function(){"use strict";function e(e){this.properties=e.properties,this.template=e.template,this.maskEle=null,this.containerEle=null,this.msg={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:"",$sf_succeed:"",$sf_fail_reason:"",$sf_msg_id:"",plan:{}},this.popupCheckInstance=null}function t(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=t.length-1,i={},o=0;for(o=0;o1024)return"object"==typeof console&&console.log&&console.log("H5 \u5f39\u7a97\u4ec5\u652f\u6301\u79fb\u52a8\u7aef\u548c ipad\uff0c\u6216\u8005\u5c4f\u5e55\u5bbd\u5ea6\u5c0f\u4e8e\u7b49\u4e8e 1024\u3002"),!1;var e={};return arguments.length>0&&(1===arguments.length&&r.isObject(arguments[0])?e=arguments[0]:arguments.length>=2&&r.isObject(arguments[1])&&(e=arguments[1])),!!this.setPara(e)&&(a.info.platform="H5",!!a.setIsLoad()&&(!!this.getBridgeState()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial()))))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.26.9",plugin_version:"1.26.9",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(e){var t={};if(e&&"[object Object]"===Object.prototype.toString.call(e)){for(var n in e)n&&"popup_window_content"!==n&&(t[n]=e[n]);return JSON.stringify(t,null," ")}return e},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(e){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-popupdata",loadedSign:"SensorsData2015JSSDKH5PopupIsLoad"};var r={visibility:function(e){e=e||{};var t={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:e.onVisible,_hidden:e.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){t._nativeSwitch.apply(t,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(e){}},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()}};t.init()},getRgba:function(e){return"object"!=typeof e?e:"rgba("+e.r+","+e.g+","+e.b+","+e.a+")"},conversionNum:function(e){if(e){if(/^[0|1]?\.\d+$/.test(e))return 100*Number(e)+"%";var t=/^(-?\d+(\.\d+)?)px$/.exec(e);return t?(Number(t[1])/375*window.screen.width).toFixed(2)+"px":e}},boxModel:function(e){return function(t){if("object"!=typeof t)return e+":"+t+";";var n="";for(var i in t)n+=e+"-"+i+":"+r.conversionNum(t[i])+";";return n}},localStorage:{get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t=null;try{t=JSON.parse(r.localStorage.get(e))||null}catch(n){}return t},set:function(e,t){window.localStorage.setItem(e,t)},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__sensorsdatasupport__",n="testIsSupportStorage";r.localStorage.set(t,n),r.localStorage.get(t)!==n&&(e=!1),r.localStorage.remove(t)}catch(i){e=!1}return e}},addEvent:function(){function e(t){return t&&(t.preventDefault=e.preventDefault,t.stopPropagation=e.stopPropagation,t._getPath=e._getPath),t}function t(t,n,i){var o=function(o){if(o=o||e(window.event)){o.target=o.srcElement;var a,r,s=!0;return"function"==typeof i&&(a=i(o)),r=n.call(t,o),!1!==a&&!1!==r||(s=!1),s}};return o}e._getPath=function(){var e=this,t=function(){try{var t=e.target,n=[t];if(null===t||null===t.parentElement)return[];for(;null!==t.parentElement;)t=t.parentElement,n.unshift(t);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||t()},e.preventDefault=function(){this.returnValue=!1},e.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,o){if(n&&n.addEventListener)n.addEventListener(i,function(t){t._getPath=e._getPath,o.call(this,t)},!1);else{var a="on"+i,r=n[a];n[a]=t(n,o,r)}};n.apply(null,arguments)},extend:function(e){var t=Array.prototype.slice;return r.each(t.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(e[n]=t[n])}),e},extend2Lev:function(e){return r.each(Array.prototype.slice.call(arguments,1),function(t){for(var n in t)void 0!==t[n]&&(r.isObject(t[n])&&r.isObject(e[n])?r.extend(e[n],t[n]):e[n]=t[n])}),e},each:function(e,t,n){var i=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,a={};if(null==e)return!1;if(o&&e.forEach===o)e.forEach(t,n);else if(e.length===+e.length){for(var r=0,s=e.length;r=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r.isObject(e.header)&&r.each(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(e.data||null)},getUuid:function(){var e=function(){for(var e=1*new Date,t=0;e==1*new Date;)t++;return e.toString(16)+t.toString(16)},t=function(){return Math.random().toString(16).replace(".","")};return function(){var n=e()+"-"+t()+"-"+t();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(e){return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(e){var t=Object.prototype.hasOwnProperty;if(r.isObject(e)){for(var n in e)if(t.call(e,n))return!1;return!0}return!1},filter:function(e,t,n){var i=Object.prototype.hasOwnProperty;if(e.filter)return e.filter(t);for(var o=[],a=0;a=0;s--){var p=n[s];t[p]=a[p]}t.hostname&&"string"==typeof t.pathname&&0!==t.pathname.indexOf("/")&&(t.pathname="/"+t.pathname),t.searchParams=function(){var e=r.getURLSearchParams(t.search);return{get:function(t){return e[t]}}}()}return t},contentLoaded:function(e,t){var n=!1,i=!0,o=e.document,a=o.documentElement,r=o.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",l=r?"":"on",u=function(i){"readystatechange"==i.type&&"complete"!=o.readyState||(("load"==i.type?e:o)[p](l+i.type,u,!1),!n&&(n=!0)&&t.call(e,i.type||i))},c=function(){try{a.doScroll("left")}catch(e){return void setTimeout(c,50)}u("poll")};if("complete"==o.readyState)t.call(e,"lazy");else{if(!r&&a.doScroll){try{i=!e.frameElement}catch(_){}i&&c()}o[s](l+"DOMContentLoaded",u,!1),o[s](l+"readystatechange",u,!1),e[s](l+"load",u,!1)}},indexOf:function(e,t){var n=e.indexOf;if(n)return n.call(e,t);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(e){function t(e){r.each(e.subviews,function(e){var i=e.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===e.type&&(n.$sf_msg_image_url=i.image),e.subviews&&t(e)})}if(!r.isObject(e)||!r.isObject(e.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return t(e.template),n},a.getSFCampaign=function(e){e=r.isObject(e)?e:{};var t={planId:"",name:"",content:null,type:""};return t.planId=e.plan_id||"",t.name=e.cname||"",t.content=r.isObject(e.popup_window_content)?e.popup_window_content.content:"",t.type=r.isObject(e.popup_window_content)&&e.popup_window_content.popup_type?e.popup_window_content.popup_type:"PRESET",t},a.getImageList=function(e){if(!r.isArray(e))return!1;for(var t,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),a={},s=e.length,p=[],l=!1,u=0;u0&&(a[n[0]]||(a[n[0]]=1));return r.each(a,function(e,t){p.push(t)}),p},a.setIsLoad=function(){var e=window.self===window.top;if(e){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(t){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",t),!0}};var s={close:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAMAAAAPdrEwAAAAe1BMVEUAAAD////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////NgkbwAAAAKHRSTlMA5if6t/B0UjMSxpAtJB4MBfTr30oY6NjV0r2loZ6XkoaBenFp3UA/LNePaQAAAsxJREFUWMOsltlygzAMRRXMZsAsAZJmX9v6/7+wg1QXpjGxCDkvyWTIQZauDcCgzKLrPtnUSyGW9SbZX6OshDcQh36lH6j8MJ7pTZd6lGX6sr0IP7SDj7CA6chLoBkEFzm14nM1/P/2eGti1RZFq+LmdtwGw7afJ1Ue1dogcGCW4QptqCO2OPe1IbnL0Y7dE23wc2bJgSn44MFTvIMwLeMUXqZGfGKUkp+MPC2dwUjMGhWwUL7pnXRUsdbIIpow84VG1k9Xmf1e5U8Kq/R/68memAPqcggTCQUNc9SdL+iCL5jMd0B1j/RErh3LYrRyLa2po2x8KngJ9Uk5sWUwpZoVvIiiulNLhMwgHDhDED2MEH8X3zCDL4HV/R8lRTOEWYS0KWzt8GEm/mNLihpHKOeqJY6yLqDnbO42F1r9eXCzitMOfkuqfvkXTId6h1phSi5/ncbgneAtnDCAxTAzIn+POhfDFOObzAEsNLu0HXO06a4BCwd89wEk1h2ezdwl0rObvS5nNreHurg/lxKwsNPoHjXrHVhI+lMK3xjvMH4YelYzCSzc8V3zrx9CWtu5MG67eWEdhBSmI+GT7eIZt+Nny7YJ+y8ON9/cF1tWVL7LzTdTi6sSMtw9AE432wwl7u6MzqotMNwcM7Glc/TafRyB4+aa4dhdcoV993EDlptphlt3zZ72TgM8N88MDe3vDQWE5V6tWGaKyAbwqaiA5+aZQeETkk6QFtxuvhlaOkVwwxfgdq/IvHKbocBj6ac5OzYCIASBKGo10n+HBgakMswbaYDgTmX3fzgafhD4G+Hhg1cGXnT4PMFHVayCdVcBXGBu7cKwACOOC2YwTsIQ7KI7LBywJrlyByupK9Kw/lto4VFLAqLdmRwJiBDWwjDOI0QPPhPXRn3yTlyrILND4w7oOw3h5AlTPk5U/ddrZSk4RWW+C9hp2rgru6GiP/678n2UFPV1AAAAAElFTkSuQmCC"},p={row:"div",column:"div",label:"pre",image:"img",button:"button",link:"button",image_button:"img"},l={textAlign:"text-align",font:"font-size",backgroundColor:"background-color",borderWidth:function(e){return"border-width: "+e+";border-style: solid;"},borderColor:"border-color",cornerRadius:"border-radius",backgroundImage:function(e){return"background-image:url("+e+");background-repeat: no-repeat;background-size: 100% 100%;"},margin:r.boxModel("margin"),padding:r.boxModel("padding"),maxHeight:"max-height",maxWidth:"max-width",scrollableX:function(e){if(e)return"overflow-x:auto;"},scrollableY:function(e){if(e)return"overflow-y:auto;"}};e.prototype={constructor:e,render:function(){function e(e,n){var i=e.maskAction.H5,o=r.isArray(i)&&i[0];if(r.isObject(o))switch(n.$sf_close_type=o.$sf_close_type||"",n.$sf_msg_element_action=o.type||"",o.type){case"copy":a.track.trackEvent("$PlanPopupClick",n,t.msg);break;case"customize":case"openlink":a.track.trackEvent("$PlanPopupClick",n,t.msg),o.closeable&&t.destory();break;case"close":o.closeable&&(a.track.trackEvent("$PlanPopupClick",n,t.msg),t.destory())}}var t=this,n=document.querySelector("div[data-sf-mask]");return!n&&(t.template.isRoot=!0,t.containerEle=t.createView(t.template),t.maskEle=t.getElement({nodeName:"div",attr:{"data-sensors-click":!0},style:t.getStyle({position:"fixed",width:"100%",height:"100%",top:"0px",left:"0px",backgroundColor:r.getRgba(t.properties.maskColor),"z-index":999998})}),r.addEvent(t.maskEle,"click",function(n){var i=n.target,o=i.getAttribute("data-ele-mask"),r=t.properties,s=t.msg;if(!s)return!1;var p={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_action:"close",$sf_msg_element_type:"mask",$sf_msg_action_id:r.maskActionId};return o&&r&&r.maskAction?(e(r,p),!1):o&&t.properties.maskCloseEnabled?(a.track.trackEvent("$PlanPopupClick",p,s),t.destory(),!1):void a.track.elementClickCallback(n,t)}),t.maskEle.setAttribute("data-sf-mask",!0),t.maskEle.appendChild(t.containerEle),r.contentLoaded(window,function(){t.appendPopup()}),!0)},appendPopup:function(){if(window.self===window.top)document.body.appendChild(this.maskEle);else try{window.top.document.body.appendChild(this.maskEle)}catch(e){document.body.appendChild(this.maskEle)}var t=document.querySelector("[data-ele-mask] > div"),n=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight;t&&t.offsetHeight>n&&(t.style.marginTop="auto")},getElement:function(e){var t=e.nodeName||"div",n=e.style,i=e.attr,o=e.prop,a=e.child,s=e.action,p=e.element_info,l=document.createElement(t);return n&&l.setAttribute("style",n),i&&r.each(i,function(e,t){e&&l.setAttribute(t,e)}),o&&r.each(o,function(e,t){e&&(l[t]=e)}),a&&a.length&&r.each(a,function(e){return!!e&&void l.appendChild(e)}),s&&s.H5&&s.H5.length&&l.setAttribute("data-action",JSON.stringify(s.H5)),p&&l.setAttribute("data-info",JSON.stringify(p)),l},getStyle:function(e){var t="",n=["msgType","text","image","name","isHidden","align","localImageName"];return r.each(e,function(e,i){var e=r.conversionNum(e),o=l[i];return!(r.indexOf(n,i)>=0)&&void(t+=r.isString(o)?o+":"+r.getRgba(e)+";":r.isFunction(o)?o(e)+";":i+":"+r.getRgba(e)+";")}),t},createView:function(e){var t=[],n={"box-sizing":"border-box",display:"block","pointer-events":"auto",overflow:"hidden"},i={},o={},a=p[e.type]||null;e.properties=e.properties||{},e.layout=e.layout||{};var l=e.properties.font,u=l?1.7*parseInt(l)+"px":"normal";if(e.properties.isHidden)return!1;switch(e.properties.text?o.innerText=e.properties.text:e.properties.image&&(i["data-sensors-click"]=!0,e.properties.localImageName?i.src=s[e.properties.localImageName]:i.src=e.properties.image),e.isRoot&&(e.layout.margin.top="-40px",r.extend(n,{position:"relative","z-index":999999,"pointer-events":"none"})),e.type){case"row":n.display="flex";break;case"link":r.extend(n,{"text-decoration":"underline",outline:"none","letter-spacing":"1px","line-height":u});break;case"label":r.extend(n,{"white-space":"pre-wrap","word-wrap":"break-word","letter-spacing":"1px","line-height":u,"margin-top":"0px","margin-bottom":"0px"});break;case"button":r.extend(n,{outline:"none","letter-spacing":"1px","line-height":u})}r.extend(n,e.layout,e.properties),e.subviews&&e.subviews.length>0&&r.each(e.subviews,function(e){t.push(this.createView(e))},this);var c=this.getElement({element_info:{$sf_msg_element_type:e.type,$sf_msg_element_content:e.properties.text||""},nodeName:a,attr:i,prop:o,style:this.getStyle(n),child:t,action:e.action});if(e.layout.align){var _={center:"center",left:"flex-start",right:"flex-end"},d=document.createElement("div"),n="display:flex;justify-content:"+_[e.layout.align]+";";return e.isRoot?(n+="width:100%;height:100%;overflow-y:auto;box-sizing: border-box;align-items:center;",d.setAttribute("style",n),d.setAttribute("data-ele-mask",!0)):d.setAttribute("style",n),d.appendChild(c),d}return c},destory:function(){var e=this.msg.plan.plan_id||"";if(window.self===window.top)document.body.removeChild(this.maskEle);else try{window.top.document.body.removeChild(this.maskEle)}catch(t){document.body.removeChild(this.maskEle)}a.info.popup_listener.onClose(e),a.info.popup_campaign_listener.onEnd(a.getSFCampaign(this.msg.plan)),this.popupCheckInstance&&this.popupCheckInstance.resetPopupIntervalWindow()}},a.ElementRender=e,a.handlerCampaign=function(e){var t=e,n=r.getUuid()(),i=t.plan.popup_window_content;if(!r.isObject(i))return t.popupFailed(1001,!1,{uuid:n,content:"",plan:t.plan}),!1;var o;if(i.content)try{o=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(t.plan),l={state:"",isCustom:!1},u=!0;try{u=a.info.popup_campaign_listener.shouldStart(p)}catch(s){u=!1,a.log(s)}var c={uuid:n,content:o,plan:t.plan};switch(t.plan.strategy_id?t.plan.is_trigger?u?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?l.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":r.isString(i.content)?l.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":l.state="DIALOG_NOT_SHOW_JSON_FAILED":"PRESET"===i.popup_type&&r.isObject(o)&&r.isObject(o.properties)&&r.isObject(o.template)?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START":l.state="CAMPAIGN_NOT_START_TRIGGER":t.plan.is_control_group?l.state="DIALOG_NOT_SHOW":u?r.isObject(o)&&o.properties&&o.template?l.state="DIALOG_SHOW":l.state="DIALOG_NOT_SHOW_JSON_FAILED":l.state="CAMPAIGN_NOT_START_LISTENER_START",l.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",l,"plan:",t.plan.cname),l.state){case"DIALOG_SHOW":t.showPopup(c);break;case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":t.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":t.popupFailed(1004,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":t.popupFailed(1006,l.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":t.popupFailed(1006,l.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":t.popupFailed(1001,l.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":t.popupFailed(1005,l.isCustom,c);break;case"DIALOG_NOT_SHOW":t.popupFailed(1003,l.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(e){var t=e.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:e.$sf_msg_id};return r.isEmptyObject(t)||!r.isObject(t)?n:(n.$sf_plan_id=t.plan_id+"",n.$sf_plan_strategy_id=t.strategy_id?t.strategy_id:t.is_control_group?"-1":"0",t.audience_id&&(n.$sf_audience_id=t.audience_id+""),t.section_id&&(n.$sf_section_id=String(t.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(e){var t={$sf_msg_title:e.$sf_msg_title,$sf_msg_content:e.$sf_msg_content,$sf_msg_image_url:e.$sf_msg_image_url,$sf_succeed:e.$sf_succeed,$sf_fail_reason:e.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",t,e)},trackEvent:function(e,t,n){var i=a.track.getPublicProps(n);r.extend(t,i),r.each(t,function(e,n){""!==e&&void 0!==e||delete t[n]}),a.sa.track(e,t)},maskClick:function(e){if(!e.msg)return!1;var t={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:e.msg.$sf_msg_title,$sf_msg_content:e.msg.$sf_msg_content,$sf_msg_image_url:e.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:e.properties.maskActionId};this.trackEvent("$PlanPopupClick",t,e.msg),e.destory()},elementClickCallback:function(e,t){var n=e.target,i=n.getAttribute("data-action"),o=n.getAttribute("data-info"),s=t.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},l=p[0],u=JSON.parse(o)||{}}catch(e){a.log("elementClickCallback error",e)}var c={type:l.type,value:r.isString(l.value)?l.value:"",extra:r.isObject(l.value)?l.value:""},_=t.msg.plan?t.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:u.$sf_msg_element_type,$sf_msg_element_content:u.$sf_msg_element_content,$sf_msg_element_action:l.type,$sf_msg_action_id:l.id,$sf_close_type:"close"===l.type?l.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=t.msg.plan;if(f){var m={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(m)}}catch(e){a.log("popup_listener.onClick error",e)}if("close"===l.type)t.destory();else if(l.closeable?t.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===l.type){if("http"!==l.value.slice(0,4))return!1;window.location.href=l.value}}};var u=a.log;a.changeCovertStatus=function(e){var t=JSON.parse(JSON.stringify(a.convertPlans));r.each(t,function(t,n){if(!t.is_in_convert_window)return!1;var i=t.is_in_convert_window.step,o=t.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!e&&void r.each(e,function(e){e.popup_display_uuid===o&&e.convert_time&&(u("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(e){function t(){if(r.isEmptyObject(a.localData)||!r.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var e=JSON.parse(JSON.stringify(a.convertPlans)),i=e[0].is_in_convert_window&&e[0].is_in_convert_window.step||5e3,o=[];return r.each(e,function(e,t){if(!e.is_in_convert_window)return!1;var n=(new Date).getTime(),r=e.is_in_convert_window.expire_time;return n>r?(u("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[t].plan_id),delete a.convertPlans[t].is_in_convert_window,a.convertPlans.splice(t,1),a.updateDataAndSetListen.updateLocalData(),!1):(o.push(e.is_in_convert_window.uuid),e.is_in_convert_window.step||(e.is_in_convert_window.step=5e3,a.convertPlans[t].is_in_convert_window.step=5e3),void(i>e.is_in_convert_window.step&&(i=e.is_in_convert_window.step)))}),!!o.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){r.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(e){a.changeCovertStatus(e),t()},error:function(){a.changeCovertStatus(),t()}})},i)))}var n=a.info.project,i=!1;return!(!e&&0===a.convertPlans.length)&&(e&&(r.each(a.convertPlans,function(t){t.plan_id===e.plan_id&&(i=!0)}),i||a.convertPlans.push(e)),void t())},a.ruleTime={getExpire:function(e,t){var n=t,i=Number(e.value)||0,o=Number(e.value)||0,a=String(e.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(o-1)},week:function(){r=new Date(n);var e=r.getDay();0===e&&(e=7);var t=7-e;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*t*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){r=new Date(n);var e=r.getMonth(),t=e+o;return t>=11?(r.setFullYear(r.getFullYear()+parseInt(t/12)),r.setMonth(t%12)):r.setMonth(t),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(e){var t={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return r=new Date(n),e in t&&(o=t[e]*i),r.getTime()+o}};return e.natural!==!0?s.second(a):a in s?s[a]():void 0},getLast:function(e,t){var n=Number(e.value)||0,i=Number(e.value)-1||0,o=String(e.unit).toLowerCase(),a=null,r={day:function(){return a=new Date(t),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-864e5*i},week:function(){a=new Date(t);var e=a.getDay();return 0===e&&(e=7),--e,a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a=a.getTime()-(24*e*60*60*1e3+7*i*24*60*60*1e3)},month:function(){a=new Date(t);var e=a.getMonth()+1,n=e-i;return n<=0?(a.setFullYear(a.getFullYear()+(parseInt(n/12)-1)),a.setMonth(12+n%12-1)):a.setMonth(n-1),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(e){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(t),e in i&&(o=i[e]*n),a.getTime()-o}};return e.natural!==!0?r.second(o):o in r?r[o]():void 0},getArrMatchCount:function(e,t){var n=0;for(n=0;n=e[n])return n;return e.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!r.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;u("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var e=!1,t=a.localData.eventQueue[0],n=a.eventRule[t.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),r.isArray(n)&&r.isObject(n[0])&&n.length>0&&(u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),r.each(n,function(e){r.isObject(e)&&"undefined"!=typeof e.match_state&&delete e.match_state,new a.RuleCheck(e,t)}),r.each(n,function(t){t.match_state===!0?e===!1?(e=!0,u("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",t.plan.cname),new a.PopupCheck(t,(!0))):e===!0&&(u("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",t.plan.cname),new a.PopupCheck(t,(!1))):u("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",t.plan.cname)}),e||a.completeWindowLifecycle(),u("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(e,t){this.plan=e.plan,this.current_time=(new Date).getTime(),t?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(e,t){this.startConvertWindow(e),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),t&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(e,t,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},o=i[e],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=o,a.track.popupDisplay(s),!t&&a.info.popup_listener&&r.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,e,o),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),e,o),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(e){var t=a.getSFCampaign(e.plan),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(t),this.createPopupWindow(e.uuid,!0)},a.PopupCheck.prototype.showPopup=function(e){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var t=new a.ElementRender(e.content),n=a.getPopupInfo(e.content);n.$sf_msg_id=e.uuid,n.plan=e.plan,n.$sf_succeed=!0,r.extend(t.msg,n),t.popupCheckInstance=this,a.track.popupDisplay(n);var i=t.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(e.plan)),this.createPopupWindow(e.uuid),void a.info.popup_listener.onLoadSuccess(e.plan.plan_id)):(u("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(e){u("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),r.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:e},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(e){r.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,e))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var e=(new Date).getTime();this.startPopupIntervalWindow(e),this.resetGlobalLimit(e),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){u("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),r.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(r.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={ expire_time:a.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},a.PopupCheck.prototype.setGlobalLimit=function(){u("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),r.isArray(a.localData.global_popup_count)||(a.localData.global_popup_count=[]),a.localData.global_popup_count.unshift(this.current_time);for(var e=a.localData.global_popup_count,t=e[e.length-1];t+7776e63e3;)e.pop(),t=e[e.length-1]},a.PopupCheck.prototype.resetGlobalLimit=function(e){r.isArray(a.localData.global_popup_count)&&a.localData.global_popup_count.length>0&&(a.localData.global_popup_count.shift(),a.localData.global_popup_count.unshift(e))},a.PopupCheck.prototype.deletePlanAllWindow=function(){var e=this.plan.pattern_popup.matcher_list;r.isArray(e)&&r.each(e,function(e){e.is_in_window&&(u("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete e.is_in_window)})},a.RuleCheck=function(e,t){this.plan_match=e,this.plan=e.plan,this.rule_arr=e.rule,this.event_data=t,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";r.each(this.rule_arr,function(e){n+="--\u5305\u542b\u89c4\u5219-("+e.event_name+"\uff09-\u89e6\u53d1"+e.params[0]+"\u6b21"}),u(n),u(this.plan),this.checkPlanIsExpire(),a.updateDataAndSetListen.updateLocalData()},a.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||r.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)u("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(r.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){u("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var e=0;e=1){var t=a.ruleTime.getLast(a.localData.popup_interval_global,this.current_time);t>e[0]?(u("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+t+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0]),this.checkPopupInterval()):u("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+t+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+e[0])}else u("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},a.RuleCheck.prototype.checkPopupInterval=function(){var e=!0;r.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(u("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null):(u("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"),e=!1):(u("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null),e&&this.checkPermission()&&this.checkProperties()},a.RuleCheck.prototype.isMatched=function(e){var t={equal:function(e,t){if(!r.isNumber(e)&&!r.isString(e))return!1;for(var n=0,i=t.length;n=0},notContain:function(e,t){return!!r.isString(e)&&e.indexOf(t[0])===-1},isTrue:function(e){return e===!0},isFalse:function(e){return e===!1},isSet:function(e){return"undefined"!=typeof e},notSet:function(e){return"undefined"==typeof e},isEmpty:function(e){if(!r.isString(e)&&!r.isArray(e))return!1;if(r.isString(e))return""===e;for(var t=0;tr.getConvertNumberValue(t[0]))},between:function(e,t){if(!r.isNumber(e))return!1;if("undefined"==typeof t[0]&&"undefined"==typeof t[1])return!1;var n=r.getConvertNumberValue(e),i=r.getConvertNumberValue(t[0]),o=r.getConvertNumberValue(t[1]);return n>=i&&n<=o},isIn:function(e,t){if(!r.isArray(e))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(e,t){if(!r.isArray(e))return!1;for(var n=0;n=n&&o<=i}catch(a){u("absolute_between Error",a)}},absoluteBetween:function(e,t){try{var n=new Date(t[0]),i=new Date(t[1]),o=new Date(e);return o>=n&&o<=i}catch(a){u("absolute_between Error",a)}}},n=this,i=e.relation,o="or"===String(i).toLowerCase(),a="and"===String(i).toLowerCase(),s=!!a,p=!0;return r.each(e.conditions,function(e){if(!p)return!1;if(!e.field)return!1;var i=e.field.lastIndexOf("."),r=e.params,l="in"===e["function"]?"isIn":e["function"];if(!t[l])return s=!1,p=!1,!1;if(i<0)return!1;var u=e.field.slice(i+1),c=n.event_data.properties,_=c[u];"$event_duration"===u&&void 0===_&&(_=c.event_duration);var d=t[l](_,r);o&&d&&(s=!0,p=!1),a&&!d&&(s=!1,p=!1)}),s},a.RuleCheck.prototype.checkProperties=function(){var e=this,t=r.filter(this.rule_arr,function(t){var n=t.multi_filter?t.multi_filter:t.filter;return!(n&&(!n.conditions||0!==n.conditions.length))||e.isMatched(n)});r.isArray(t)&&t.length>0?(this.checkWindowAndMatch(t),u("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",t)):u("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},a.RuleCheck.prototype.checkPermission=function(){function e(t){r.each(t,function(t){if(o=s([t]),r.isArray(o)&&o.length>0){var n=t.filters||[];n&&n.length>0&&e(n)}})}var t=this.plan.event_permission;if(!r.isObject(t)||r.isEmptyObject(t))return!0;var n=[t],i=this,o=[],s=function(e){var t=r.filter(e,function(e){return!(e&&e.conditions&&(!e.conditions||0!==e.conditions.length))||i.isMatched(e)});return t};return e(n),r.isArray(o)&&o.length>0?(a.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",o),!0):(a.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3"),!1)},a.RuleCheck.prototype.checkWindowAndMatch=function(e){var t=this,n=[];r.each(e,function(e){if(!e.params||!e.params[0])return u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var i=Number(e.params[0]);1===i?n.push(e):i>1&&r.isObject(e.window)&&e.window.value>0&&(!r.isObject(e.is_in_window)||!r.isNumber(e.is_in_window.expire_time)||e.is_in_window.expire_time=i?n.push(e):u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",e.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",i))}),n.length>0?(u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):u("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},a.RuleCheck.prototype.checkGlobalPopupLimit=function(){var e=a.localData.msg_limit_global,t=!0,n=this;r.isObject(e)&&e.is_in_use===!0&&r.isArray(e.limits)&&r.isArray(a.localData.global_popup_count)&&this.plan.global_msg_limit_enabled===!0?(r.each(e.limits,function(e){if(r.isObject(e)&&r.isNumber(e.limit)){var i=a.ruleTime.getLast(e,n.current_time),o=a.ruleTime.getArrMatchCount(a.localData.global_popup_count,i);u("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+o+"-\u9650\u5236\u7684\u6b21\u6570"+e.limit+"-\u9650\u5236\u65f6\u95f4-"+i),t=o0&&(a.updateDataAndSetListen.interval_time=a.localData.config_pull_interval_ms),this.removeLocalData(),a.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var e=r.localStorage.get(a.config.storageName);r.isString(e)&&(e=n(e));try{e=JSON.parse(e)}catch(t){r.log(t)}return e},saveJSONData:function(e){e=JSON.stringify(e),a.info.encrypt_cookie&&(e=i(e)),r.localStorage.set(a.config.storageName,e)},migrateLocalData:function(){var e=this.getJSONData()||{},t=a.sa.store.getDistinctId();if(e.popup_sdk_users&&e.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[t]=e,n.popup_sdk_users[t]={user_id:t},this.saveJSONData(n)},getLocalData:function(){var e=this.getJSONData(),t=a.sa.store.getDistinctId(),n=null;return e?(r.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id),n&&r.isObject(e.popup_sdk_plans[n])?(e.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(e),e.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var e=this.getJSONData(),t=a.sa.store.getDistinctId(),n=null;return!!e&&void(e.popup_sdk_users&&r.isObject(e.popup_sdk_users[t])&&e.popup_sdk_users[t].user_id&&(n=e.popup_sdk_users[t].user_id,e.popup_sdk_plans[n]=a.localData,this.saveJSONData(e)))},removeLocalData:function(){var e=this.getJSONData(),t=this.delete_time;if(!e||!e.popup_sdk_plans||!e.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(e.popup_sdk_plans)),i=JSON.parse(JSON.stringify(e.popup_sdk_users)),o=(new Date).getTime(),a=[];r.each(n,function(n,i){o-n.update_time>t&&(delete e.popup_sdk_plans[i],a.push(i))}),r.each(i,function(t,n){a.length>0&&r.each(a,function(i){t.user_id&&i===t.user_id&&delete e.popup_sdk_users[n]})}),this.saveJSONData(e)}},a.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var e=a.localData.popup_plans;if(!e||!r.isArray(e))return!1;var t=r.filter(e,function(e){return!!e.convert_window&&!!e.is_in_convert_window});a.convertPlans=t,a.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",a.convertPlans),a.asyncConvert()},diffData:function(){var e=a.localData,t=JSON.parse(JSON.stringify(a.serverData));(new Date).getTime();if(!t||r.isEmptyObject(t))return!1;if(!e||r.isEmptyObject(e)||!e.popup_plans||0===e.popup_plans.length)return r.extend(a.localData,t),!1;var n=t.popup_plans;r.each(n,function(t,i){var o=null;if(r.each(e.popup_plans,function(e){e.plan_id===t.plan_id&&(o=e,t.audience_id||delete o.audience_id,r.isObject(t.window_update)&&r.each(t.window_update,function(e,n){o.window_update&&o.window_update[n]===e||("trigger_window"===n?o.pattern_popup.matcher_list=t.pattern_popup.matcher_list:"convert_window"===n&&o.is_in_convert_window&&t.convert_window&&o.is_in_convert_window.start_time&&(o.is_in_convert_window.expire_time=a.ruleTime.getExpire(t.convert_window,o.is_in_convert_window.start_time)))}))}),!o)return!1;if(!t.window_update&&o.last_update_config_time!==t.last_update_config_time)return!1;var s=o.pattern_popup.matcher_list;r.extend2Lev(o,t),o.pattern_popup.matcher_list=s,n[i]=o}),r.extend(a.localData,t)},getEventRule:function(){var e=a.localData.popup_plans,t={};return!(!e||!r.isArray(e))&&(r.each(e,function(e){var n=e.pattern_popup.matcher_list;r.each(n,function(n){var i={plan:e,rule:[n]},o=n.event_name,a=!1;if(t[o]){if(r.each(t[o],function(t){t.plan.plan_id===e.plan_id&&(t.rule.push(n),a=!0)}),a)return!1;t[o].push(i)}else t[o]=[i]})}),r.each(t,function(e){e.sort(function(e,t){var n=t.plan.absolute_priority-e.plan.absolute_priority;return 0===n?t.plan.plan_id-e.plan.plan_id:n})}),a.eventRule=t,a.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),void a.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------"))},registerListen:function(){var e=this;a.sa.events.on("send",function(t){t.event&&a.eventRule[t.event]&&(r.isArray(a.localData.eventQueue)||(a.localData.eventQueue=[]),a.localData.eventQueue.push(t),e.updateLocalData(),a.eventTriggerProcess())}),a.sa.events.on("changeDistinctId",function(t){e.changeId()}),a.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(e){function t(e){var t=new Image;t.src=e}if(e.length<1)return!1;if(JSON.stringify(e)===JSON.stringify(this.image_list))return!1;this.image_list=e;for(var n=0;n0&&(n.interval_time=i.config_pull_interval_ms),a.serverData.local_update_time=(new Date).getTime(),a.info.preload_image&&n.loadImage(a.getImageList(i.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},a.localData={},n.updateLocalData()),e(),void n.setIntervalTime(n.interval_time)):(t(),!1)},error:function(){return n.active_state?(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},e(),void n.setIntervalTime(n.interval_time)):(t(),!1)}})},updateUserPlans:function(){var e=a.store.getJSONData(),t=a.sa.store.getDistinctId(),n=a.serverData.user_id;e.popup_sdk_users[t]={user_id:n||t},n?e.popup_sdk_plans[n]?a.localData=e.popup_sdk_plans[n]:e.popup_sdk_plans[t]&&(a.localData=e.popup_sdk_plans[t],delete e.popup_sdk_plans[t]):e.popup_sdk_plans[t]&&(a.localData=e.popup_sdk_plans[t]),a.localData.update_time=(new Date).getTime(),a.store.saveJSONData(e)},setIntervalTime:function(e){var t=this;this.data_interval=setTimeout(function(){a.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),t.getDataFromServer()},e)},setFirstListen:function(){var e=this;this.getDataFromServer(function(){e.registerListen()})},updateLocalData:function(){var e=JSON.stringify(a.localData);this.local_data!==e&&(this.local_data=e,a.store.saveLocalData())},initial:function(){a.store.init();var e=a.localData.local_update_time,t=(new Date).getTime();if(r.isNumber(e)){var n=t-e;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),a.info.preload_image&&this.loadImage(a.getImageList(a.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,a.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),a.asyncConvert.timer&&window.clearTimeout(a.asyncConvert.timer),a.convertPlans=[],a.localData={},this.resetState()},resetState:function(){return"WEB"!==a.info.platform&&void(!document.querySelector("div[data-sf-mask]")&&a.isRun&&(a.isRun=!1))},startState:function(e){this.active_state=!0,e=e||{getLocalData:!0},e.getLocalData&&(this.resetState(),a.localData=a.store.getLocalData()),this.getDataFromServer()}},a.testSend={hasParam:function(){var e=r.URL(window.location.href).searchParams,t=e.get("sf_popup_test")||"",n=e.get("popup_window_id")||"",i=e.get("platform");return!(!t||!n)&&{sf_popup_test:t,popup_window_id:n,platform:i}},start:function(){var e=a.info.project,t=a.info.platform,n=this.hasParam().popup_window_id,i=this.hasParam().platform,o=encodeURIComponent(a.sa.store.getDistinctId());return"WEB"===i?(a.log("WEB\u7aef\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728PC\u8bbe\u5907\u6253\u5f00\uff01"),!1):void r.ajax({url:a.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(e)+"&time="+(new Date).getTime()+"&sdk_version="+a.lib_version+"&platform="+encodeURIComponent(t)+"&distinct_id="+o,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(e){var t,n=r.getUuid();r.isObject(e)||(a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",e),e={});try{t=JSON.parse(e.content)}catch(i){a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",e,i)}var o=a.getPopupInfo(t);o.$sf_msg_id=n;var s={content:e.content,type:e.popup_type||"PRESET"};if(Object.hasOwnProperty.call(e,"name")&&(s.name=e.name),e.popup_type&&"CUSTOMIZED"===e.popup_type)r.isString(e.content)?"withoutCampaignListener"===a.info.supportCustom||"withoutStart"===a.info.supportCustom?(o.$sf_succeed=!1,o.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",a.track.popupDisplay(o),a.info.popup_campaign_listener.onFailed(s,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(o.$sf_succeed=!0,a.track.popupDisplay(o),a.info.popup_campaign_listener.onStart(s)):(o.$sf_succeed=!1,o.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",a.track.popupDisplay(o),a.info.popup_campaign_listener.onFailed(s,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"));else if(r.isObject(t)&&r.isObject(t.properties)&&r.isObject(t.template)){var p=new a.ElementRender(t);p.render(),o.$sf_succeed=!0,a.track.popupDisplay(o),a.info.popup_campaign_listener.onStart(s),a.info.popup_listener.onLoadSuccess()}else o.$sf_succeed=!1,o.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",a.track.popupDisplay(o),a.info.popup_listener.onLoadFailed("",1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"),a.info.popup_campaign_listener.onFailed(s,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e")},error:function(e){a.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",e)}})}},a.setPara=function(e){r.isObject(e)||(e={}),a.info=r.extend({},a.defaultPara,e);var t=a.sa;if(!t)return a.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1;if(t.para.encrypt_cookie===!0&&(a.info.encrypt_cookie=!0),!r.isString(a.info.api_base_url)||"http"!==a.info.api_base_url.slice(0,4))return a.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1;if("http:"===a.info.api_base_url.slice(0,5)&&"https:"===location.protocol)return a.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1;if(a.info.api_base_url="/"===a.info.api_base_url.slice(-1)?a.info.api_base_url.slice(0,-1):a.info.api_base_url,!r.isString(t.para.server_url)||"http"!==t.para.server_url.slice(0,4))return a.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1;if(a.info.project||(a.info.project=r.URL(t.para.server_url).searchParams.get("project")||"default"),r.isObject(a.info.popup_listener)){var n=a.info.popup_listener;r.isFunction(n.onClick)||(a.info.popup_listener.onClick=function(){}),r.isFunction(n.onLoadSuccess)||(a.info.popup_listener.onLoadSuccess=function(){}),r.isFunction(n.onLoadFailed)||(a.info.popup_listener.onLoadFailed=function(){}),r.isFunction(n.onClose)||(a.info.popup_listener.onClose=function(){}),r.isString(n.openlink)?"auto"!==n.openlink&&"customize"!==n.openlink&&(a.info.popup_listener.openlink="customize"):a.info.popup_listener.openlink="customize"}else a.info.popup_listener={onClick:function(){},onLoadSuccess:function(){},onLoadFailed:function(){},onClose:function(){},openlink:"customize"};return a.info.supportCustom=!0,r.isObject(a.info.popup_campaign_listener)?(r.isFunction(a.info.popup_campaign_listener.shouldStart)||(a.info.popup_campaign_listener.shouldStart=function(){return!0}),r.isFunction(a.info.popup_campaign_listener.onStart)||(a.info.supportCustom="withoutStart",a.info.popup_campaign_listener.onStart=function(){}),r.isFunction(a.info.popup_campaign_listener.onEnd)||(a.info.popup_campaign_listener.onEnd=function(){}),r.isFunction(a.info.popup_campaign_listener.onFailed)||(a.info.popup_campaign_listener.onFailed=function(){}),r.isFunction(a.info.popup_campaign_listener.onClick)||(a.info.popup_campaign_listener.onClick=function(){})):(a.info.supportCustom="withoutCampaignListener",a.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0},a.getBridgeState=function(){return!r.isObject(a.sa.para.app_js_bridge)||!a.sa.para.app_js_bridge.is_mui&&(!a.sa.bridge||!a.sa.bridge.is_verify_success)},a.init=function(){var e=window.sensorsDataAnalytic201505;if(a.sa=e,e&&e.readyState&&e.readyState.state>=3||!e.on)o.apply(this,arguments);else{var t=this,n=arguments;e&&e.on("sdkReady",function(){o.apply(t,n)})}},a.plugin_name="Popup",window.SensorsDataWebJSSDKPlugin&&"[object Object]"==Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?(window.SensorsDataWebJSSDKPlugin.popup=window.SensorsDataWebJSSDKPlugin.popup||a,window.SensorsDataWebJSSDKPlugin.Popup=window.SensorsDataWebJSSDKPlugin.Popup||a):window.SensorsDataWebJSSDKPlugin={popup:a,Popup:a},a}); \ No newline at end of file diff --git a/dist/web/plugin/sf-sdk-web/webPopup.amd.min.js b/dist/web/plugin/sf-sdk-web/webPopup.amd.min.js index e1f33017..7febd484 100644 --- a/dist/web/plugin/sf-sdk-web/webPopup.amd.min.js +++ b/dist/web/plugin/sf-sdk-web/webPopup.amd.min.js @@ -1,2 +1,2 @@ -define(function(){"use strict";function t(t){var e="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=e.length-1,i={},a=0;for(a=0;a0&&(1===arguments.length&&o.isObject(arguments[0])?t=arguments[0]:arguments.length>=2&&o.isObject(arguments[1])&&(t=arguments[1])),!!this.setPara(t)&&(a.info.platform="WEB",!!a.setIsLoad()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial())))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.26.8",plugin_version:"1.26.8",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(t){var e={};if(t&&"[object Object]"===Object.prototype.toString.call(t)){for(var n in t)n&&"popup_window_content"!==n&&(e[n]=t[n]);return JSON.stringify(e,null," ")}return t},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-webpopupdata",loadedSign:"SensorsData2015JSSDKWebPopupIsLoad"};var o={visibility:function(t){t=t||{};var e={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:t.onVisible,_hidden:t.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){e._nativeSwitch.apply(e,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(t){}},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()}};e.init()},getRgba:function(t){return"object"!=typeof t?t:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},conversionNum:function(t){if(t){if(/^[0|1]?\.\d+$/.test(t))return 100*Number(t)+"%";var e=/^(-?\d+(\.\d+)?)px$/.exec(t);return e?(Number(e[1])/375*window.screen.width).toFixed(2)+"px":t}},boxModel:function(t){return function(e){if("object"!=typeof e)return t+":"+e+";";var n="";for(var i in e)n+=t+"-"+i+":"+o.conversionNum(e[i])+";";return n}},localStorage:{get:function(t){return window.localStorage.getItem(t)},parse:function(t){var e=null;try{e=JSON.parse(o.localStorage.get(t))||null}catch(n){}return e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",n="testIsSupportStorage";o.localStorage.set(e,n),o.localStorage.get(e)!==n&&(t=!1),o.localStorage.remove(e)}catch(i){t=!1}return t}},addEvent:function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}function e(e,n,i){var a=function(a){if(a=a||t(window.event)){a.target=a.srcElement;var o,r,s=!0;return"function"==typeof i&&(o=i(a)),r=n.call(e,a),!1!==o&&!1!==r||(s=!1),s}};return a}t._getPath=function(){var t=this,e=function(){try{var e=t.target,n=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,n.unshift(e);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||e()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,a){if(n&&n.addEventListener)n.addEventListener(i,function(e){e._getPath=t._getPath,a.call(this,e)},!1);else{var o="on"+i,r=n[o];n[o]=e(n,a,r)}};n.apply(null,arguments)},extend:function(t){var e=Array.prototype.slice;return o.each(e.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])}),t},extend2Lev:function(t){return o.each(Array.prototype.slice.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(o.isObject(e[n])&&o.isObject(t[n])?o.extend(t[n],e[n]):t[n]=e[n])}),t},each:function(t,e,n){var i=Object.prototype.hasOwnProperty,a=Array.prototype.forEach,o={};if(null==t)return!1;if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,s=t.length;r=200&&i.status<300||304==i.status?t.success(e(i.responseText)):t.error(e(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(t.type,t.url,!0);try{t.credentials&&(i.withCredentials=!0),o.isObject(t.header)&&o.each(t.header,function(t,e){i.setRequestHeader&&i.setRequestHeader(e,t)}),t.data&&(t.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===t.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(t.data||null)},getUuid:function(){var t=function(){for(var t=1*new Date,e=0;t==1*new Date;)e++;return t.toString(16)+e.toString(16)},e=function(){return Math.random().toString(16).replace(".","")};return function(){var n=t()+"-"+e()+"-"+e();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(t){var e=Object.prototype.hasOwnProperty;if(o.isObject(t)){for(var n in t)if(e.call(t,n))return!1;return!0}return!1},filter:function(t,e,n){var i=Object.prototype.hasOwnProperty;if(t.filter)return t.filter(e);for(var a=[],o=0;o=0;s--){var p=n[s];e[p]=r[p]}e.hostname&&"string"==typeof e.pathname&&0!==e.pathname.indexOf("/")&&(e.pathname="/"+e.pathname),e.searchParams=function(){var t=o.getURLSearchParams(e.search);return{get:function(e){return t[e]}}}()}return e},contentLoaded:function(t,e){var n=!1,i=!0,a=t.document,o=a.documentElement,r=a.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",u=r?"":"on",l=function(i){"readystatechange"==i.type&&"complete"!=a.readyState||(("load"==i.type?t:a)[p](u+i.type,l,!1),!n&&(n=!0)&&e.call(t,i.type||i))},c=function(){try{o.doScroll("left")}catch(t){return void setTimeout(c,50)}l("poll")};if("complete"==a.readyState)e.call(t,"lazy");else{if(!r&&o.doScroll){try{i=!t.frameElement}catch(_){}i&&c()}a[s](u+"DOMContentLoaded",l,!1),a[s](u+"readystatechange",l,!1),t[s](u+"load",l,!1)}},indexOf:function(t,e){var n=t.indexOf;if(n)return n.call(t,e);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(t){function e(t){o.each(t.subviews,function(t){var i=t.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===t.type&&(n.$sf_msg_image_url=i.image),t.subviews&&e(t)})}if(!o.isObject(t)||!o.isObject(t.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return e(t.template),n},a.getSFCampaign=function(t){t=o.isObject(t)?t:{};var e={planId:"",name:"",content:null,type:""};return e.planId=t.plan_id||"",e.name=t.cname||"",e.content=o.isObject(t.popup_window_content)?t.popup_window_content.content:"",e.type=o.isObject(t.popup_window_content)&&t.popup_window_content.popup_type?t.popup_window_content.popup_type:"PRESET",e},a.getImageList=function(t){if(!o.isArray(t))return!1;for(var e,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),a=new RegExp('http(s)?://.[^S^"]*'),r={},s=t.length,p=[],u=!1,l=0;l0&&(r[n[0]]||(r[n[0]]=1));return o.each(r,function(t,e){p.push(e)}),p},a.setIsLoad=function(){var t=window.self===window.top;if(t){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(e){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",e),!0}},a.handlerCampaign=function(t){var e=t,n=o.getUuid()(),i=e.plan.popup_window_content;if(!o.isObject(i))return e.popupFailed(1001,!1,{uuid:n,content:"",plan:e.plan}),!1;var r;if(i.content)try{r=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(e.plan),u={state:"",isCustom:!1},l=!0;try{l=a.info.popup_campaign_listener.shouldStart(p)}catch(s){l=!1,a.log(s)}var c={uuid:n,content:r,plan:e.plan};switch(e.plan.is_trigger?l?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":o.isString(i.content)?u.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":u.state="DIALOG_NOT_SHOW_JSON_FAILED":("PRESET"===i.popup_type&&a.log("\u6b64\u7248\u672csdk\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97"),u.state="DIALOG_NOT_SHOW_JSON_FAILED"):u.state="CAMPAIGN_NOT_START_LISTENER_START":u.state="CAMPAIGN_NOT_START_TRIGGER",u.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",u,"plan:",e.plan.cname),u.state){case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":e.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":e.popupFailed(1004,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":e.popupFailed(1006,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":e.popupFailed(1006,u.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":e.popupFailed(1001,u.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":e.popupFailed(1005,u.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(t){var e=t.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:t.$sf_msg_id};return o.isEmptyObject(e)||!o.isObject(e)?n:(n.$sf_plan_id=e.plan_id+"",n.$sf_plan_strategy_id=e.strategy_id?e.strategy_id:e.is_control_group?"-1":"0",e.audience_id&&(n.$sf_audience_id=e.audience_id+""),e.section_id&&(n.$sf_section_id=String(e.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(t){var e={$sf_msg_title:t.$sf_msg_title,$sf_msg_content:t.$sf_msg_content,$sf_msg_image_url:t.$sf_msg_image_url,$sf_succeed:t.$sf_succeed,$sf_fail_reason:t.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",e,t)},trackEvent:function(t,e,n){var i=a.track.getPublicProps(n);o.extend(e,i),o.each(e,function(t,n){""!==t&&void 0!==t||delete e[n]}),a.sa.track(t,e)},maskClick:function(t){if(!t.msg)return!1;var e={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:t.msg.$sf_msg_title,$sf_msg_content:t.msg.$sf_msg_content,$sf_msg_image_url:t.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:t.properties.maskActionId};this.trackEvent("$PlanPopupClick",e,t.msg),t.destory()},elementClickCallback:function(t,e){var n=t.target,i=n.getAttribute("data-action"),r=n.getAttribute("data-info"),s=e.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},u=p[0],l=JSON.parse(r)||{}}catch(t){a.log("elementClickCallback error",t)}var c={type:u.type,value:o.isString(u.value)?u.value:"",extra:o.isObject(u.value)?u.value:""},_=e.msg.plan?e.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:l.$sf_msg_element_type,$sf_msg_element_content:l.$sf_msg_element_content,$sf_msg_element_action:u.type,$sf_msg_action_id:u.id,$sf_close_type:"close"===u.type?u.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=e.msg.plan;if(f){var h={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(h)}}catch(t){a.log("popup_listener.onClick error",t)}if("close"===u.type)e.destory();else if(u.closeable?e.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===u.type){if("http"!==u.value.slice(0,4))return!1;window.location.href=u.value}}};var r=a.log;a.changeCovertStatus=function(t){var e=JSON.parse(JSON.stringify(a.convertPlans));o.each(e,function(e,n){if(!e.is_in_convert_window)return!1;var i=e.is_in_convert_window.step,s=e.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!t&&void o.each(t,function(t){t.popup_display_uuid===s&&t.convert_time&&(r("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(t){function e(){if(o.isEmptyObject(a.localData)||!o.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var t=JSON.parse(JSON.stringify(a.convertPlans)),i=t[0].is_in_convert_window&&t[0].is_in_convert_window.step||5e3,s=[];return o.each(t,function(t,e){if(!t.is_in_convert_window)return!1;var n=(new Date).getTime(),o=t.is_in_convert_window.expire_time;return n>o?(r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[e].plan_id),delete a.convertPlans[e].is_in_convert_window,a.convertPlans.splice(e,1),a.updateDataAndSetListen.updateLocalData(),!1):(s.push(t.is_in_convert_window.uuid),t.is_in_convert_window.step||(t.is_in_convert_window.step=5e3,a.convertPlans[e].is_in_convert_window.step=5e3),void(i>t.is_in_convert_window.step&&(i=t.is_in_convert_window.step)))}),!!s.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){o.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(s)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(t){a.changeCovertStatus(t),e()},error:function(){a.changeCovertStatus(),e()}})},i)))}var n=a.info.project,i=!1;return!(!t&&0===a.convertPlans.length)&&(t&&(o.each(a.convertPlans,function(e){e.plan_id===t.plan_id&&(i=!0)}),i||a.convertPlans.push(t)),void e())},a.ruleTime={getExpire:function(t,e){var n=e,i=Number(t.value)||0,a=Number(t.value)||0,o=String(t.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(a-1)},week:function(){r=new Date(n);var t=r.getDay();0===t&&(t=7);var e=7-t;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*e*60*60*1e3+7*(a-1)*24*60*60*1e3},month:function(){r=new Date(n);var t=r.getMonth(),e=t+a;return e>=11?(r.setFullYear(r.getFullYear()+parseInt(e/12)),r.setMonth(e%12)):r.setMonth(e),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(t){var e={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return r=new Date(n),t in e&&(a=e[t]*i),r.getTime()+a}};return t.natural!==!0?s.second(o):o in s?s[o]():void 0},getLast:function(t,e){var n=Number(t.value)||0,i=Number(t.value)-1||0,a=String(t.unit).toLowerCase(),o=null,r={day:function(){return o=new Date(e),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-864e5*i},week:function(){o=new Date(e);var t=o.getDay();return 0===t&&(t=7),--t,o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-(24*t*60*60*1e3+7*i*24*60*60*1e3)},month:function(){o=new Date(e);var t=o.getMonth()+1,n=t-i;return n<=0?(o.setFullYear(o.getFullYear()+(parseInt(n/12)-1)),o.setMonth(12+n%12-1)):o.setMonth(n-1),o.setDate(1),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o.getTime()},second:function(t){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return o=new Date(e),t in i&&(a=i[t]*n),o.getTime()-a}};return t.natural!==!0?r.second(a):a in r?r[a]():void 0},getArrMatchCount:function(t,e){var n=0;for(n=0;n=t[n])return n;return t.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!o.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;r("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var t=!1,e=a.localData.eventQueue[0],n=a.eventRule[e.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),o.isArray(n)&&o.isObject(n[0])&&n.length>0&&(r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),o.each(n,function(t){o.isObject(t)&&"undefined"!=typeof t.match_state&&delete t.match_state,new a.RuleCheck(t,e)}),o.each(n,function(e){e.match_state===!0?t===!1?(t=!0,r("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",e.plan.cname),new a.PopupCheck(e,(!0))):t===!0&&(r("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",e.plan.cname),new a.PopupCheck(e,(!1))):r("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",e.plan.cname)}),t||a.completeWindowLifecycle(),r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(t,e){this.plan=t.plan,this.current_time=(new Date).getTime(),e?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(t,e){this.startConvertWindow(t),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),e&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(t,e,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},r=i[t],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=r,a.track.popupDisplay(s),!e&&a.info.popup_listener&&o.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,t,r),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),t,r),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(t){var e=a.getSFCampaign(t.plan),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(e),this.createPopupWindow(t.uuid,!0)},a.PopupCheck.prototype.showPopup=function(t){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var e=new a.ElementRender(t.content),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,o.extend(e.msg,n),e.popupCheckInstance=this,a.track.popupDisplay(n);var i=e.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(t.plan)),this.createPopupWindow(t.uuid),void a.info.popup_listener.onLoadSuccess(t.plan.plan_id)):(r("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(t){r("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),o.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:t},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(t){o.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,t))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var t=(new Date).getTime();this.startPopupIntervalWindow(t),this.resetGlobalLimit(t),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){r("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),o.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(o.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:a.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},a.PopupCheck.prototype.setGlobalLimit=function(){r("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),o.isArray(a.localData.global_popup_count)||(a.localData.global_popup_count=[]),a.localData.global_popup_count.unshift(this.current_time);for(var t=a.localData.global_popup_count,e=t[t.length-1];e+7776e63e3;)t.pop(),e=t[t.length-1]},a.PopupCheck.prototype.resetGlobalLimit=function(t){o.isArray(a.localData.global_popup_count)&&a.localData.global_popup_count.length>0&&(a.localData.global_popup_count.shift(),a.localData.global_popup_count.unshift(t))},a.PopupCheck.prototype.deletePlanAllWindow=function(){var t=this.plan.pattern_popup.matcher_list;o.isArray(t)&&o.each(t,function(t){t.is_in_window&&(r("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete t.is_in_window)})},a.RuleCheck=function(t,e){this.plan_match=t,this.plan=t.plan,this.rule_arr=t.rule,this.event_data=e,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";o.each(this.rule_arr,function(t){n+="--\u5305\u542b\u89c4\u5219-("+t.event_name+"\uff09-\u89e6\u53d1"+t.params[0]+"\u6b21"}),r(n),r(this.plan),this.checkPlanIsExpire(),a.updateDataAndSetListen.updateLocalData()},a.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||o.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)r("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(o.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var t=0;t=1){var e=a.ruleTime.getLast(a.localData.popup_interval_global,this.current_time);e>t[0]?(r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+e+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0]),this.checkPopupInterval()):r("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+e+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0])}else r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},a.RuleCheck.prototype.checkPopupInterval=function(){var t=!0;o.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null):(r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"),t=!1):(r("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null),t&&this.checkPermission()&&this.checkProperties()},a.RuleCheck.prototype.isMatched=function(t){var e={equal:function(t,e){if(!o.isNumber(t)&&!o.isString(t))return!1;for(var n=0,i=e.length;n=0},notContain:function(t,e){return!!o.isString(t)&&t.indexOf(e[0])===-1},isTrue:function(t){return t===!0},isFalse:function(t){return t===!1},isSet:function(t){return"undefined"!=typeof t},notSet:function(t){return"undefined"==typeof t},isEmpty:function(t){if(!o.isString(t)&&!o.isArray(t))return!1;if(o.isString(t))return""===t;for(var e=0;eo.getConvertNumberValue(e[0]))},between:function(t,e){if(!o.isNumber(t))return!1;if("undefined"==typeof e[0]&&"undefined"==typeof e[1])return!1;var n=o.getConvertNumberValue(t),i=o.getConvertNumberValue(e[0]),a=o.getConvertNumberValue(e[1]);return n>=i&&n<=a},isIn:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=n&&a<=i}catch(o){r("absolute_between Error",o)}},absoluteBetween:function(t,e){try{var n=new Date(e[0]),i=new Date(e[1]),a=new Date(t);return a>=n&&a<=i}catch(o){r("absolute_between Error",o)}}},n=this,i=t.relation,a="or"===String(i).toLowerCase(),s="and"===String(i).toLowerCase(),p=!!s,u=!0;return o.each(t.conditions,function(t){if(!u)return!1;if(!t.field)return!1;var i=t.field.lastIndexOf("."),o=t.params,r="in"===t["function"]?"isIn":t["function"];if(!e[r])return p=!1,u=!1,!1;if(i<0)return!1;var l=t.field.slice(i+1),c=n.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=e[r](_,o);a&&d&&(p=!0,u=!1),s&&!d&&(p=!1,u=!1)}),p},a.RuleCheck.prototype.checkProperties=function(){var t=this,e=o.filter(this.rule_arr,function(e){var n=e.multi_filter?e.multi_filter:e.filter;return!(n&&(!n.conditions||0!==n.conditions.length))||t.isMatched(n)});o.isArray(e)&&e.length>0?(this.checkWindowAndMatch(e),r("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",e)):r("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},a.RuleCheck.prototype.checkPermission=function(){function t(e){o.each(e,function(e){if(r=s([e]),o.isArray(r)&&r.length>0){var n=e.filters||[];n&&n.length>0&&t(n)}})}var e=this.plan.event_permission;if(!o.isObject(e)||o.isEmptyObject(e))return!0;var n=[e],i=this,r=[],s=function(t){var e=o.filter(t,function(t){return!(t&&t.conditions&&(!t.conditions||0!==t.conditions.length))||i.isMatched(t)});return e};return t(n),o.isArray(r)&&r.length>0?(a.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",r),!0):(a.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3"),!1)},a.RuleCheck.prototype.checkWindowAndMatch=function(t){var e=this,n=[];o.each(t,function(t){if(!t.params||!t.params[0])return r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var i=Number(t.params[0]);1===i?n.push(t):i>1&&o.isObject(t.window)&&t.window.value>0&&(!o.isObject(t.is_in_window)||!o.isNumber(t.is_in_window.expire_time)||t.is_in_window.expire_time=i?n.push(t):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",t.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",i)); +define(function(){"use strict";function t(t){var e="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=e.length-1,i={},a=0;for(a=0;a0&&(1===arguments.length&&o.isObject(arguments[0])?t=arguments[0]:arguments.length>=2&&o.isObject(arguments[1])&&(t=arguments[1])),!!this.setPara(t)&&(a.info.platform="WEB",!!a.setIsLoad()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial())))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.26.9",plugin_version:"1.26.9",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(t){var e={};if(t&&"[object Object]"===Object.prototype.toString.call(t)){for(var n in t)n&&"popup_window_content"!==n&&(e[n]=t[n]);return JSON.stringify(e,null," ")}return t},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-webpopupdata",loadedSign:"SensorsData2015JSSDKWebPopupIsLoad"};var o={visibility:function(t){t=t||{};var e={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:t.onVisible,_hidden:t.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){e._nativeSwitch.apply(e,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(t){}},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()}};e.init()},getRgba:function(t){return"object"!=typeof t?t:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},conversionNum:function(t){if(t){if(/^[0|1]?\.\d+$/.test(t))return 100*Number(t)+"%";var e=/^(-?\d+(\.\d+)?)px$/.exec(t);return e?(Number(e[1])/375*window.screen.width).toFixed(2)+"px":t}},boxModel:function(t){return function(e){if("object"!=typeof e)return t+":"+e+";";var n="";for(var i in e)n+=t+"-"+i+":"+o.conversionNum(e[i])+";";return n}},localStorage:{get:function(t){return window.localStorage.getItem(t)},parse:function(t){var e=null;try{e=JSON.parse(o.localStorage.get(t))||null}catch(n){}return e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",n="testIsSupportStorage";o.localStorage.set(e,n),o.localStorage.get(e)!==n&&(t=!1),o.localStorage.remove(e)}catch(i){t=!1}return t}},addEvent:function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}function e(e,n,i){var a=function(a){if(a=a||t(window.event)){a.target=a.srcElement;var o,r,s=!0;return"function"==typeof i&&(o=i(a)),r=n.call(e,a),!1!==o&&!1!==r||(s=!1),s}};return a}t._getPath=function(){var t=this,e=function(){try{var e=t.target,n=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,n.unshift(e);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||e()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,a){if(n&&n.addEventListener)n.addEventListener(i,function(e){e._getPath=t._getPath,a.call(this,e)},!1);else{var o="on"+i,r=n[o];n[o]=e(n,a,r)}};n.apply(null,arguments)},extend:function(t){var e=Array.prototype.slice;return o.each(e.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])}),t},extend2Lev:function(t){return o.each(Array.prototype.slice.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(o.isObject(e[n])&&o.isObject(t[n])?o.extend(t[n],e[n]):t[n]=e[n])}),t},each:function(t,e,n){var i=Object.prototype.hasOwnProperty,a=Array.prototype.forEach,o={};if(null==t)return!1;if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,s=t.length;r=200&&i.status<300||304==i.status?t.success(e(i.responseText)):t.error(e(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(t.type,t.url,!0);try{t.credentials&&(i.withCredentials=!0),o.isObject(t.header)&&o.each(t.header,function(t,e){i.setRequestHeader&&i.setRequestHeader(e,t)}),t.data&&(t.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===t.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(t.data||null)},getUuid:function(){var t=function(){for(var t=1*new Date,e=0;t==1*new Date;)e++;return t.toString(16)+e.toString(16)},e=function(){return Math.random().toString(16).replace(".","")};return function(){var n=t()+"-"+e()+"-"+e();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(t){var e=Object.prototype.hasOwnProperty;if(o.isObject(t)){for(var n in t)if(e.call(t,n))return!1;return!0}return!1},filter:function(t,e,n){var i=Object.prototype.hasOwnProperty;if(t.filter)return t.filter(e);for(var a=[],o=0;o=0;s--){var p=n[s];e[p]=r[p]}e.hostname&&"string"==typeof e.pathname&&0!==e.pathname.indexOf("/")&&(e.pathname="/"+e.pathname),e.searchParams=function(){var t=o.getURLSearchParams(e.search);return{get:function(e){return t[e]}}}()}return e},contentLoaded:function(t,e){var n=!1,i=!0,a=t.document,o=a.documentElement,r=a.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",u=r?"":"on",l=function(i){"readystatechange"==i.type&&"complete"!=a.readyState||(("load"==i.type?t:a)[p](u+i.type,l,!1),!n&&(n=!0)&&e.call(t,i.type||i))},c=function(){try{o.doScroll("left")}catch(t){return void setTimeout(c,50)}l("poll")};if("complete"==a.readyState)e.call(t,"lazy");else{if(!r&&o.doScroll){try{i=!t.frameElement}catch(_){}i&&c()}a[s](u+"DOMContentLoaded",l,!1),a[s](u+"readystatechange",l,!1),t[s](u+"load",l,!1)}},indexOf:function(t,e){var n=t.indexOf;if(n)return n.call(t,e);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(t){function e(t){o.each(t.subviews,function(t){var i=t.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===t.type&&(n.$sf_msg_image_url=i.image),t.subviews&&e(t)})}if(!o.isObject(t)||!o.isObject(t.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return e(t.template),n},a.getSFCampaign=function(t){t=o.isObject(t)?t:{};var e={planId:"",name:"",content:null,type:""};return e.planId=t.plan_id||"",e.name=t.cname||"",e.content=o.isObject(t.popup_window_content)?t.popup_window_content.content:"",e.type=o.isObject(t.popup_window_content)&&t.popup_window_content.popup_type?t.popup_window_content.popup_type:"PRESET",e},a.getImageList=function(t){if(!o.isArray(t))return!1;for(var e,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),a=new RegExp('http(s)?://.[^S^"]*'),r={},s=t.length,p=[],u=!1,l=0;l0&&(r[n[0]]||(r[n[0]]=1));return o.each(r,function(t,e){p.push(e)}),p},a.setIsLoad=function(){var t=window.self===window.top;if(t){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(e){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",e),!0}},a.handlerCampaign=function(t){var e=t,n=o.getUuid()(),i=e.plan.popup_window_content;if(!o.isObject(i))return e.popupFailed(1001,!1,{uuid:n,content:"",plan:e.plan}),!1;var r;if(i.content)try{r=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(e.plan),u={state:"",isCustom:!1},l=!0;try{l=a.info.popup_campaign_listener.shouldStart(p)}catch(s){l=!1,a.log(s)}var c={uuid:n,content:r,plan:e.plan};switch(e.plan.is_trigger?l?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":o.isString(i.content)?u.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":u.state="DIALOG_NOT_SHOW_JSON_FAILED":("PRESET"===i.popup_type&&a.log("\u6b64\u7248\u672csdk\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97"),u.state="DIALOG_NOT_SHOW_JSON_FAILED"):u.state="CAMPAIGN_NOT_START_LISTENER_START":u.state="CAMPAIGN_NOT_START_TRIGGER",u.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",u,"plan:",e.plan.cname),u.state){case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":e.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":e.popupFailed(1004,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":e.popupFailed(1006,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":e.popupFailed(1006,u.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":e.popupFailed(1001,u.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":e.popupFailed(1005,u.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(t){var e=t.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:t.$sf_msg_id};return o.isEmptyObject(e)||!o.isObject(e)?n:(n.$sf_plan_id=e.plan_id+"",n.$sf_plan_strategy_id=e.strategy_id?e.strategy_id:e.is_control_group?"-1":"0",e.audience_id&&(n.$sf_audience_id=e.audience_id+""),e.section_id&&(n.$sf_section_id=String(e.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(t){var e={$sf_msg_title:t.$sf_msg_title,$sf_msg_content:t.$sf_msg_content,$sf_msg_image_url:t.$sf_msg_image_url,$sf_succeed:t.$sf_succeed,$sf_fail_reason:t.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",e,t)},trackEvent:function(t,e,n){var i=a.track.getPublicProps(n);o.extend(e,i),o.each(e,function(t,n){""!==t&&void 0!==t||delete e[n]}),a.sa.track(t,e)},maskClick:function(t){if(!t.msg)return!1;var e={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:t.msg.$sf_msg_title,$sf_msg_content:t.msg.$sf_msg_content,$sf_msg_image_url:t.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:t.properties.maskActionId};this.trackEvent("$PlanPopupClick",e,t.msg),t.destory()},elementClickCallback:function(t,e){var n=t.target,i=n.getAttribute("data-action"),r=n.getAttribute("data-info"),s=e.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},u=p[0],l=JSON.parse(r)||{}}catch(t){a.log("elementClickCallback error",t)}var c={type:u.type,value:o.isString(u.value)?u.value:"",extra:o.isObject(u.value)?u.value:""},_=e.msg.plan?e.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:l.$sf_msg_element_type,$sf_msg_element_content:l.$sf_msg_element_content,$sf_msg_element_action:u.type,$sf_msg_action_id:u.id,$sf_close_type:"close"===u.type?u.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=e.msg.plan;if(f){var h={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(h)}}catch(t){a.log("popup_listener.onClick error",t)}if("close"===u.type)e.destory();else if(u.closeable?e.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===u.type){if("http"!==u.value.slice(0,4))return!1;window.location.href=u.value}}};var r=a.log;a.changeCovertStatus=function(t){var e=JSON.parse(JSON.stringify(a.convertPlans));o.each(e,function(e,n){if(!e.is_in_convert_window)return!1;var i=e.is_in_convert_window.step,s=e.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!t&&void o.each(t,function(t){t.popup_display_uuid===s&&t.convert_time&&(r("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(t){function e(){if(o.isEmptyObject(a.localData)||!o.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var t=JSON.parse(JSON.stringify(a.convertPlans)),i=t[0].is_in_convert_window&&t[0].is_in_convert_window.step||5e3,s=[];return o.each(t,function(t,e){if(!t.is_in_convert_window)return!1;var n=(new Date).getTime(),o=t.is_in_convert_window.expire_time;return n>o?(r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[e].plan_id),delete a.convertPlans[e].is_in_convert_window,a.convertPlans.splice(e,1),a.updateDataAndSetListen.updateLocalData(),!1):(s.push(t.is_in_convert_window.uuid),t.is_in_convert_window.step||(t.is_in_convert_window.step=5e3,a.convertPlans[e].is_in_convert_window.step=5e3),void(i>t.is_in_convert_window.step&&(i=t.is_in_convert_window.step)))}),!!s.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){o.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(s)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(t){a.changeCovertStatus(t),e()},error:function(){a.changeCovertStatus(),e()}})},i)))}var n=a.info.project,i=!1;return!(!t&&0===a.convertPlans.length)&&(t&&(o.each(a.convertPlans,function(e){e.plan_id===t.plan_id&&(i=!0)}),i||a.convertPlans.push(t)),void e())},a.ruleTime={getExpire:function(t,e){var n=e,i=Number(t.value)||0,a=Number(t.value)||0,o=String(t.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(a-1)},week:function(){r=new Date(n);var t=r.getDay();0===t&&(t=7);var e=7-t;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*e*60*60*1e3+7*(a-1)*24*60*60*1e3},month:function(){r=new Date(n);var t=r.getMonth(),e=t+a;return e>=11?(r.setFullYear(r.getFullYear()+parseInt(e/12)),r.setMonth(e%12)):r.setMonth(e),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(t){var e={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return r=new Date(n),t in e&&(a=e[t]*i),r.getTime()+a}};return t.natural!==!0?s.second(o):o in s?s[o]():void 0},getLast:function(t,e){var n=Number(t.value)||0,i=Number(t.value)-1||0,a=String(t.unit).toLowerCase(),o=null,r={day:function(){return o=new Date(e),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-864e5*i},week:function(){o=new Date(e);var t=o.getDay();return 0===t&&(t=7),--t,o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-(24*t*60*60*1e3+7*i*24*60*60*1e3)},month:function(){o=new Date(e);var t=o.getMonth()+1,n=t-i;return n<=0?(o.setFullYear(o.getFullYear()+(parseInt(n/12)-1)),o.setMonth(12+n%12-1)):o.setMonth(n-1),o.setDate(1),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o.getTime()},second:function(t){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return o=new Date(e),t in i&&(a=i[t]*n),o.getTime()-a}};return t.natural!==!0?r.second(a):a in r?r[a]():void 0},getArrMatchCount:function(t,e){var n=0;for(n=0;n=t[n])return n;return t.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!o.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;r("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var t=!1,e=a.localData.eventQueue[0],n=a.eventRule[e.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),o.isArray(n)&&o.isObject(n[0])&&n.length>0&&(r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),o.each(n,function(t){o.isObject(t)&&"undefined"!=typeof t.match_state&&delete t.match_state,new a.RuleCheck(t,e)}),o.each(n,function(e){e.match_state===!0?t===!1?(t=!0,r("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",e.plan.cname),new a.PopupCheck(e,(!0))):t===!0&&(r("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",e.plan.cname),new a.PopupCheck(e,(!1))):r("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",e.plan.cname)}),t||a.completeWindowLifecycle(),r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(t,e){this.plan=t.plan,this.current_time=(new Date).getTime(),e?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(t,e){this.startConvertWindow(t),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),e&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(t,e,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},r=i[t],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=r,a.track.popupDisplay(s),!e&&a.info.popup_listener&&o.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,t,r),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),t,r),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(t){var e=a.getSFCampaign(t.plan),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(e),this.createPopupWindow(t.uuid,!0)},a.PopupCheck.prototype.showPopup=function(t){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var e=new a.ElementRender(t.content),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,o.extend(e.msg,n),e.popupCheckInstance=this,a.track.popupDisplay(n);var i=e.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(t.plan)),this.createPopupWindow(t.uuid),void a.info.popup_listener.onLoadSuccess(t.plan.plan_id)):(r("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(t){r("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),o.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:t},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(t){o.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,t))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var t=(new Date).getTime();this.startPopupIntervalWindow(t),this.resetGlobalLimit(t),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){r("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),o.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(o.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:a.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},a.PopupCheck.prototype.setGlobalLimit=function(){r("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),o.isArray(a.localData.global_popup_count)||(a.localData.global_popup_count=[]),a.localData.global_popup_count.unshift(this.current_time);for(var t=a.localData.global_popup_count,e=t[t.length-1];e+7776e63e3;)t.pop(),e=t[t.length-1]},a.PopupCheck.prototype.resetGlobalLimit=function(t){o.isArray(a.localData.global_popup_count)&&a.localData.global_popup_count.length>0&&(a.localData.global_popup_count.shift(),a.localData.global_popup_count.unshift(t))},a.PopupCheck.prototype.deletePlanAllWindow=function(){var t=this.plan.pattern_popup.matcher_list;o.isArray(t)&&o.each(t,function(t){t.is_in_window&&(r("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete t.is_in_window)})},a.RuleCheck=function(t,e){this.plan_match=t,this.plan=t.plan,this.rule_arr=t.rule,this.event_data=e,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";o.each(this.rule_arr,function(t){n+="--\u5305\u542b\u89c4\u5219-("+t.event_name+"\uff09-\u89e6\u53d1"+t.params[0]+"\u6b21"}),r(n),r(this.plan),this.checkPlanIsExpire(),a.updateDataAndSetListen.updateLocalData()},a.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||o.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)r("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(o.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var t=0;t=1){var e=a.ruleTime.getLast(a.localData.popup_interval_global,this.current_time);e>t[0]?(r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+e+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0]),this.checkPopupInterval()):r("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+e+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0])}else r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},a.RuleCheck.prototype.checkPopupInterval=function(){var t=!0;o.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null):(r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"),t=!1):(r("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null),t&&this.checkPermission()&&this.checkProperties()},a.RuleCheck.prototype.isMatched=function(t){var e={equal:function(t,e){if(!o.isNumber(t)&&!o.isString(t))return!1;for(var n=0,i=e.length;n=0},notContain:function(t,e){return!!o.isString(t)&&t.indexOf(e[0])===-1},isTrue:function(t){return t===!0},isFalse:function(t){return t===!1},isSet:function(t){return"undefined"!=typeof t},notSet:function(t){return"undefined"==typeof t},isEmpty:function(t){if(!o.isString(t)&&!o.isArray(t))return!1;if(o.isString(t))return""===t;for(var e=0;eo.getConvertNumberValue(e[0]))},between:function(t,e){if(!o.isNumber(t))return!1;if("undefined"==typeof e[0]&&"undefined"==typeof e[1])return!1;var n=o.getConvertNumberValue(t),i=o.getConvertNumberValue(e[0]),a=o.getConvertNumberValue(e[1]);return n>=i&&n<=a},isIn:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=n&&a<=i}catch(o){r("absolute_between Error",o)}},absoluteBetween:function(t,e){try{var n=new Date(e[0]),i=new Date(e[1]),a=new Date(t);return a>=n&&a<=i}catch(o){r("absolute_between Error",o)}}},n=this,i=t.relation,a="or"===String(i).toLowerCase(),s="and"===String(i).toLowerCase(),p=!!s,u=!0;return o.each(t.conditions,function(t){if(!u)return!1;if(!t.field)return!1;var i=t.field.lastIndexOf("."),o=t.params,r="in"===t["function"]?"isIn":t["function"];if(!e[r])return p=!1,u=!1,!1;if(i<0)return!1;var l=t.field.slice(i+1),c=n.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=e[r](_,o);a&&d&&(p=!0,u=!1),s&&!d&&(p=!1,u=!1)}),p},a.RuleCheck.prototype.checkProperties=function(){var t=this,e=o.filter(this.rule_arr,function(e){var n=e.multi_filter?e.multi_filter:e.filter;return!(n&&(!n.conditions||0!==n.conditions.length))||t.isMatched(n)});o.isArray(e)&&e.length>0?(this.checkWindowAndMatch(e),r("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",e)):r("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},a.RuleCheck.prototype.checkPermission=function(){function t(e){o.each(e,function(e){if(r=s([e]),o.isArray(r)&&r.length>0){var n=e.filters||[];n&&n.length>0&&t(n)}})}var e=this.plan.event_permission;if(!o.isObject(e)||o.isEmptyObject(e))return!0;var n=[e],i=this,r=[],s=function(t){var e=o.filter(t,function(t){return!(t&&t.conditions&&(!t.conditions||0!==t.conditions.length))||i.isMatched(t)});return e};return t(n),o.isArray(r)&&r.length>0?(a.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",r),!0):(a.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3"),!1)},a.RuleCheck.prototype.checkWindowAndMatch=function(t){var e=this,n=[];o.each(t,function(t){if(!t.params||!t.params[0])return r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var i=Number(t.params[0]);1===i?n.push(t):i>1&&o.isObject(t.window)&&t.window.value>0&&(!o.isObject(t.is_in_window)||!o.isNumber(t.is_in_window.expire_time)||t.is_in_window.expire_time=i?n.push(t):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",t.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",i)); }),n.length>0?(r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},a.RuleCheck.prototype.checkGlobalPopupLimit=function(){var t=a.localData.msg_limit_global,e=!0,n=this;o.isObject(t)&&t.is_in_use===!0&&o.isArray(t.limits)&&o.isArray(a.localData.global_popup_count)&&this.plan.global_msg_limit_enabled===!0?(o.each(t.limits,function(t){if(o.isObject(t)&&o.isNumber(t.limit)){var i=a.ruleTime.getLast(t,n.current_time),s=a.ruleTime.getArrMatchCount(a.localData.global_popup_count,i);r("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+s+"-\u9650\u5236\u7684\u6b21\u6570"+t.limit+"-\u9650\u5236\u65f6\u95f4-"+i),e=s0&&(a.updateDataAndSetListen.interval_time=a.localData.config_pull_interval_ms),this.removeLocalData(),a.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var t=o.localStorage.get(a.config.storageName);o.isString(t)&&(t=e(t));try{t=JSON.parse(t)}catch(n){o.log(n)}return t},saveJSONData:function(t){t=JSON.stringify(t),a.info.encrypt_cookie&&(t=n(t)),o.localStorage.set(a.config.storageName,t)},migrateLocalData:function(){var t=this.getJSONData()||{},e=a.sa.store.getDistinctId();if(t.popup_sdk_users&&t.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[e]=t,n.popup_sdk_users[e]={user_id:e},this.saveJSONData(n)},getLocalData:function(){var t=this.getJSONData(),e=a.sa.store.getDistinctId(),n=null;return t?(o.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id),n&&o.isObject(t.popup_sdk_plans[n])?(t.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(t),t.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var t=this.getJSONData(),e=a.sa.store.getDistinctId(),n=null;return!!t&&void(t.popup_sdk_users&&o.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id,t.popup_sdk_plans[n]=a.localData,this.saveJSONData(t)))},removeLocalData:function(){var t=this.getJSONData(),e=this.delete_time;if(!t||!t.popup_sdk_plans||!t.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(t.popup_sdk_plans)),i=JSON.parse(JSON.stringify(t.popup_sdk_users)),a=(new Date).getTime(),r=[];o.each(n,function(n,i){a-n.update_time>e&&(delete t.popup_sdk_plans[i],r.push(i))}),o.each(i,function(e,n){r.length>0&&o.each(r,function(i){e.user_id&&i===e.user_id&&delete t.popup_sdk_users[n]})}),this.saveJSONData(t)}},a.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var t=a.localData.popup_plans;if(!t||!o.isArray(t))return!1;var e=o.filter(t,function(t){return!!t.convert_window&&!!t.is_in_convert_window});a.convertPlans=e,a.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",a.convertPlans),a.asyncConvert()},diffData:function(){var t=a.localData,e=JSON.parse(JSON.stringify(a.serverData));(new Date).getTime();if(!e||o.isEmptyObject(e))return!1;if(!t||o.isEmptyObject(t)||!t.popup_plans||0===t.popup_plans.length)return o.extend(a.localData,e),!1;var n=e.popup_plans;o.each(n,function(e,i){var r=null;if(o.each(t.popup_plans,function(t){t.plan_id===e.plan_id&&(r=t,e.audience_id||delete r.audience_id,o.isObject(e.window_update)&&o.each(e.window_update,function(t,n){r.window_update&&r.window_update[n]===t||("trigger_window"===n?r.pattern_popup.matcher_list=e.pattern_popup.matcher_list:"convert_window"===n&&r.is_in_convert_window&&e.convert_window&&r.is_in_convert_window.start_time&&(r.is_in_convert_window.expire_time=a.ruleTime.getExpire(e.convert_window,r.is_in_convert_window.start_time)))}))}),!r)return!1;if(!e.window_update&&r.last_update_config_time!==e.last_update_config_time)return!1;var s=r.pattern_popup.matcher_list;o.extend2Lev(r,e),r.pattern_popup.matcher_list=s,n[i]=r}),o.extend(a.localData,e)},getEventRule:function(){var t=a.localData.popup_plans,e={};return!(!t||!o.isArray(t))&&(o.each(t,function(t){var n=t.pattern_popup.matcher_list;o.each(n,function(n){var i={plan:t,rule:[n]},a=n.event_name,r=!1;if(e[a]){if(o.each(e[a],function(e){e.plan.plan_id===t.plan_id&&(e.rule.push(n),r=!0)}),r)return!1;e[a].push(i)}else e[a]=[i]})}),o.each(e,function(t){t.sort(function(t,e){var n=e.plan.absolute_priority-t.plan.absolute_priority;return 0===n?e.plan.plan_id-t.plan.plan_id:n})}),a.eventRule=e,a.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),void a.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------"))},registerListen:function(){var t=this;a.sa.events.on("send",function(e){e.event&&a.eventRule[e.event]&&(o.isArray(a.localData.eventQueue)||(a.localData.eventQueue=[]),a.localData.eventQueue.push(e),t.updateLocalData(),a.eventTriggerProcess())}),a.sa.events.on("changeDistinctId",function(e){t.changeId()}),a.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(t){function e(t){var e=new Image;e.src=t}if(t.length<1)return!1;if(JSON.stringify(t)===JSON.stringify(this.image_list))return!1;this.image_list=t;for(var n=0;n0&&(n.interval_time=i.config_pull_interval_ms),a.serverData.local_update_time=(new Date).getTime(),a.info.preload_image&&n.loadImage(a.getImageList(i.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},a.localData={},n.updateLocalData()),t(),void n.setIntervalTime(n.interval_time)):(e(),!1)},error:function(){return n.active_state?(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},t(),void n.setIntervalTime(n.interval_time)):(e(),!1)}})},updateUserPlans:function(){var t=a.store.getJSONData(),e=a.sa.store.getDistinctId(),n=a.serverData.user_id;t.popup_sdk_users[e]={user_id:n||e},n?t.popup_sdk_plans[n]?a.localData=t.popup_sdk_plans[n]:t.popup_sdk_plans[e]&&(a.localData=t.popup_sdk_plans[e],delete t.popup_sdk_plans[e]):t.popup_sdk_plans[e]&&(a.localData=t.popup_sdk_plans[e]),a.localData.update_time=(new Date).getTime(),a.store.saveJSONData(t)},setIntervalTime:function(t){var e=this;this.data_interval=setTimeout(function(){a.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),e.getDataFromServer()},t)},setFirstListen:function(){var t=this;this.getDataFromServer(function(){t.registerListen()})},updateLocalData:function(){var t=JSON.stringify(a.localData);this.local_data!==t&&(this.local_data=t,a.store.saveLocalData())},initial:function(){a.store.init();var t=a.localData.local_update_time,e=(new Date).getTime();if(o.isNumber(t)){var n=e-t;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),a.info.preload_image&&this.loadImage(a.getImageList(a.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,a.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),a.asyncConvert.timer&&window.clearTimeout(a.asyncConvert.timer),a.convertPlans=[],a.localData={},this.resetState()},resetState:function(){return"WEB"!==a.info.platform&&void(!document.querySelector("div[data-sf-mask]")&&a.isRun&&(a.isRun=!1))},startState:function(t){this.active_state=!0,t=t||{getLocalData:!0},t.getLocalData&&(this.resetState(),a.localData=a.store.getLocalData()),this.getDataFromServer()}},a.testSend={hasParam:function(){var t=o.URL(window.location.href).searchParams,e=t.get("sf_popup_test")||"",n=t.get("popup_window_id")||"",i=t.get("platform");return!(!e||!n)&&{sf_popup_test:e,popup_window_id:n,platform:i}},start:function(){var t=this.hasParam().platform;return"WEB"!==t?(a.log("H5\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728\u79fb\u52a8\u7aef\u67e5\u770b\uff01"),!1):void this.webCampaign()},webCampaign:function(){var t=a.info.project,e=a.info.platform,n=this.hasParam().popup_window_id,i=encodeURIComponent(a.sa.store.getDistinctId());o.ajax({url:a.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(t)+"&time="+(new Date).getTime()+"&sdk_version="+a.lib_version+"&platform="+encodeURIComponent(e)+"&distinct_id="+i,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(t){var e,n=o.getUuid();o.isObject(t)||(a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",t),t={});try{e=JSON.parse(t.content)}catch(i){a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",t,i)}var r=a.getPopupInfo(e);r.$sf_msg_id=n;var s={content:t.content,type:t.popup_type||"CUSTOMIZED"};Object.hasOwnProperty.call(t,"name")&&(s.name=t.name),o.isString(t.content)?"withoutCampaignListener"===a.info.supportCustom||"withoutStart"===a.info.supportCustom?(r.$sf_succeed=!1,r.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",a.track.popupDisplay(r),a.info.popup_campaign_listener.onFailed(s,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(r.$sf_succeed=!0,a.track.popupDisplay(r),a.info.popup_campaign_listener.onStart(s)):(r.$sf_succeed=!1,r.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",a.track.popupDisplay(r),a.info.popup_campaign_listener.onFailed(s,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"))},error:function(t){a.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",t)}})}},a.setPara=function(t){o.isObject(t)||(t={}),a.info=o.extend({},a.defaultPara,t);var e=a.sa;return e?(e.para.encrypt_cookie===!0&&(a.info.encrypt_cookie=!0),o.isString(a.info.api_base_url)&&"http"===a.info.api_base_url.slice(0,4)?"http:"===a.info.api_base_url.slice(0,5)&&"https:"===location.protocol?(a.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1):(a.info.api_base_url="/"===a.info.api_base_url.slice(-1)?a.info.api_base_url.slice(0,-1):a.info.api_base_url,o.isString(e.para.server_url)&&"http"===e.para.server_url.slice(0,4)?(a.info.project||(a.info.project=o.URL(e.para.server_url).searchParams.get("project")||"default"),a.info.supportCustom=!0,o.isObject(a.info.popup_campaign_listener)?(o.isFunction(a.info.popup_campaign_listener.shouldStart)||(a.info.popup_campaign_listener.shouldStart=function(){return!0}),o.isFunction(a.info.popup_campaign_listener.onStart)||(a.info.supportCustom="withoutStart",a.info.popup_campaign_listener.onStart=function(){}),o.isFunction(a.info.popup_campaign_listener.onEnd)||(a.info.popup_campaign_listener.onEnd=function(){}),o.isFunction(a.info.popup_campaign_listener.onFailed)||(a.info.popup_campaign_listener.onFailed=function(){}),o.isFunction(a.info.popup_campaign_listener.onClick)||(a.info.popup_campaign_listener.onClick=function(){})):(a.info.supportCustom="withoutCampaignListener",a.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0):(a.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1)):(a.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1)):(a.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)},a.init=function(){var t=window.sensorsDataAnalytic201505;if(a.sa=t,t&&t.readyState&&t.readyState.state>=3||!t.on)i.apply(this,arguments);else{var e=this,n=arguments;t&&t.on("sdkReady",function(){i.apply(e,n)})}},window.SensorsDataWebJSSDKPlugin&&"[object Object]"===Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.WebPopup=window.SensorsDataWebJSSDKPlugin.WebPopup||a:window.SensorsDataWebJSSDKPlugin={WebPopup:a},a}); \ No newline at end of file diff --git a/dist/web/plugin/sf-sdk-web/webPopup.esm.min.js b/dist/web/plugin/sf-sdk-web/webPopup.esm.min.js index 5a0442e6..d9ea5d06 100644 --- a/dist/web/plugin/sf-sdk-web/webPopup.esm.min.js +++ b/dist/web/plugin/sf-sdk-web/webPopup.esm.min.js @@ -1 +1 @@ -var popup={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.26.8",plugin_version:"1.26.8",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(t){var e={};if(t&&"[object Object]"===Object.prototype.toString.call(t)){for(var n in t)n&&"popup_window_content"!==n&&(e[n]=t[n]);return JSON.stringify(e,null," ")}return t},log:function(){if(!0===popup.info.show_log&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=popup.setArg(arguments[0]),arguments[1]=popup.setArg(arguments[1]),console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}},config:{storageName:"sensorsdata202002-webpopupdata",loadedSign:"SensorsData2015JSSDKWebPopupIsLoad"}},_={visibility:function(t){t=t||{};var e={hidden:undefined,visibilityChange:undefined,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:t.onVisible,_hidden:t.onHidden,_nativeSwitch:function(){!0===document[this.hidden]?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){e._nativeSwitch.apply(e,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(t){}},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()}};e.init()},getRgba:function(t){return"object"!=typeof t?t:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},conversionNum:function(t){if(t){if(/^[0|1]?\.\d+$/.test(t))return 100*Number(t)+"%";var e=/^(-?\d+(\.\d+)?)px$/.exec(t);return e?(Number(e[1])/375*window.screen.width).toFixed(2)+"px":t}},boxModel:function(t){return function(e){if("object"!=typeof e)return t+":"+e+";";var n="";for(var p in e)n+=t+"-"+p+":"+_.conversionNum(e[p])+";";return n}},localStorage:{get:function(t){return window.localStorage.getItem(t)},parse:function(t){var e=null;try{e=JSON.parse(_.localStorage.get(t))||null}catch(n){}return e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",n="testIsSupportStorage";_.localStorage.set(e,n),_.localStorage.get(e)!==n&&(t=!1),_.localStorage.remove(e)}catch(p){t=!1}return t}},addEvent:function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}t._getPath=function(){var t=this;return this.path||this.composedPath&&this.composedPath()||function(){try{var e=t.target,n=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,n.unshift(e);return n}catch(p){return[]}}()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};(function(e,n,p){if(e&&e.addEventListener)e.addEventListener(n,function(e){e._getPath=t._getPath,p.call(this,e)},!1);else{var o="on"+n,i=e[o];e[o]=function(e,n,p){return function(o){if(!(o=o||t(window.event)))return undefined;o.target=o.srcElement;var i,a,r=!0;return"function"==typeof p&&(i=p(o)),a=n.call(e,o),!1!==i&&!1!==a||(r=!1),r}}(e,p,i)}}).apply(null,arguments)},extend:function(t){var e=Array.prototype.slice;return _.each(e.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])}),t},extend2Lev:function(t){return _.each(Array.prototype.slice.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(_.isObject(e[n])&&_.isObject(t[n])?_.extend(t[n],e[n]):t[n]=e[n])}),t},each:function(t,e,n){var p=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,i={};if(null==t)return!1;if(o&&t.forEach===o)t.forEach(e,n);else if(t.length===+t.length){for(var a=0,r=t.length;a=200&&n.status<300||304==n.status?t.success(e(n.responseText)):t.error(e(n.responseText),n.status),n.onreadystatechange=null,n.onload=null)}catch(p){n.onreadystatechange=null,n.onload=null}},n.open(t.type,t.url,!0);try{t.credentials&&(n.withCredentials=!0),_.isObject(t.header)&&_.each(t.header,function(t,e){n.setRequestHeader&&n.setRequestHeader(e,t)}),t.data&&(t.cors||n.setRequestHeader&&n.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===t.contentType?n.setRequestHeader&&n.setRequestHeader("Content-type","application/json; charset=UTF-8"):n.setRequestHeader&&n.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(a){sd.log(a)}n.send(t.data||null)},getUuid:function(){var t=function(){return Math.random().toString(16).replace(".","")};return function(){var e=function(){for(var t=1*new Date,e=0;t==1*new Date;)e++;return t.toString(16)+e.toString(16)}()+"-"+t()+"-"+t();return e||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(t){var e=Object.prototype.hasOwnProperty;if(_.isObject(t)){for(var n in t)if(e.call(t,n))return!1;return!0}return!1},filter:function(t,e,n){var p=Object.prototype.hasOwnProperty;if(t.filter)return t.filter(e);for(var o=[],i=0;i=0;i--){var a=p[i];n[a]=o[a]}n.hostname&&"string"==typeof n.pathname&&0!==n.pathname.indexOf("/")&&(n.pathname="/"+n.pathname),n.searchParams=function(){var t=_.getURLSearchParams(n.search);return{get:function(e){return t[e]}}}()}return n},contentLoaded:function(t,e){var n=!1,p=!0,o=t.document,i=o.documentElement,a=o.addEventListener,r=a?"addEventListener":"attachEvent",s=a?"removeEventListener":"detachEvent",u=a?"":"on",l=function(p){"readystatechange"==p.type&&"complete"!=o.readyState||(("load"==p.type?t:o)[s](u+p.type,l,!1),!n&&(n=!0)&&e.call(t,p.type||p))},c=function(){try{i.doScroll("left")}catch(t){return void setTimeout(c,50)}l("poll")};if("complete"==o.readyState)e.call(t,"lazy");else{if(!a&&i.doScroll){try{p=!t.frameElement}catch(_){}p&&c()}o[r](u+"DOMContentLoaded",l,!1),o[r](u+"readystatechange",l,!1),t[r](u+"load",l,!1)}},indexOf:function(t,e){var n=t.indexOf;if(n)return n.call(t,e);for(var p=0;p=3)&&window.sensorsDataAnalytic201505},popup.getPopupInfo=function(t){if(!_.isObject(t)||!_.isObject(t.template))return{};var e={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return function n(t){_.each(t.subviews,function(t){var p=t.properties||{};"title"===p.msgType?e.$sf_msg_title=p.text:"content"===p.msgType?e.$sf_msg_content=p.text:"image"===t.type&&(e.$sf_msg_image_url=p.image),t.subviews&&n(t)})}(t.template),e},popup.getSFCampaign=function(t){t=_.isObject(t)?t:{};var e={planId:"",name:"",content:null,type:""};return e.planId=t.plan_id||"",e.name=t.cname||"",e.content=_.isObject(t.popup_window_content)?t.popup_window_content.content:"",e.type=_.isObject(t.popup_window_content)&&t.popup_window_content.popup_type?t.popup_window_content.popup_type:"PRESET",e},popup.getImageList=function(t){if(!_.isArray(t))return!1;for(var e,n,p=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),i={},a=t.length,r=[],s=0;s0&&(i[n[0]]||(i[n[0]]=1));return _.each(i,function(t,e){r.push(e)}),r},popup.setIsLoad=function(){if(window.self===window.top){if(window[popup.config.loadedSign])return!1;if("undefined"==typeof window[popup.config.loadedSign])return window[popup.config.loadedSign]=!0,!0}else try{return!window.top[popup.config.loadedSign]&&(window.top[popup.config.loadedSign]=!0,!0)}catch(t){return popup.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",t),!0}},popup.handlerCampaign=function(t){var e,n=t,p=_.getUuid()(),o=n.plan.popup_window_content;if(!_.isObject(o))return n.popupFailed(1001,!1,{uuid:p,content:"",plan:n.plan}),!1;if(o.content)try{e=JSON.parse(o.content)}catch(u){popup.log(u)}var i=popup.getSFCampaign(n.plan),a={state:"",isCustom:!1},r=!0;try{r=popup.info.popup_campaign_listener.shouldStart(i)}catch(u){r=!1,popup.log(u)}var s={uuid:p,content:e,plan:n.plan};switch(n.plan.is_trigger?r?"CUSTOMIZED"===o.popup_type?"withoutCampaignListener"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":_.isString(o.content)?a.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":a.state="DIALOG_NOT_SHOW_JSON_FAILED":("PRESET"===o.popup_type&&popup.log("\u6b64\u7248\u672csdk\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97"),a.state="DIALOG_NOT_SHOW_JSON_FAILED"):a.state="CAMPAIGN_NOT_START_LISTENER_START":a.state="CAMPAIGN_NOT_START_TRIGGER",a.isCustom=!(!o.popup_type||"CUSTOMIZED"!==o.popup_type),popup.log("campaign:",a,"plan:",n.plan.cname),a.state){case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":n.customCampaign(s);break;case"CAMPAIGN_NOT_START_LISTENER_START":n.popupFailed(1004,a.isCustom,s);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":n.popupFailed(1006,a.isCustom,s);break;case"DIALOG_NOT_SHOW_JSON_FAILED":n.popupFailed(1001,a.isCustom,s);break;case"CAMPAIGN_NOT_START_TRIGGER":n.popupFailed(1005,a.isCustom,s);break;default:popup.log("CampaignState\u5f02\u5e38")}},popup.track={getPublicProps:function(t){var e=t.plan,n={$sf_lib_version:popup.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:popup.info.platform,$sf_msg_id:t.$sf_msg_id};return _.isEmptyObject(e)||!_.isObject(e)?n:(n.$sf_plan_id=e.plan_id+"",n.$sf_plan_strategy_id=e.strategy_id?e.strategy_id:e.is_control_group?"-1":"0",e.audience_id&&(n.$sf_audience_id=e.audience_id+""),e.section_id&&(n.$sf_section_id=String(e.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(t){var e={$sf_msg_title:t.$sf_msg_title,$sf_msg_content:t.$sf_msg_content,$sf_msg_image_url:t.$sf_msg_image_url,$sf_succeed:t.$sf_succeed,$sf_fail_reason:t.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",e,t)},trackEvent:function(t,e,n){var p=popup.track.getPublicProps(n);_.extend(e,p),_.each(e,function(t,n){""!==t&&t!==undefined||delete e[n]}),popup.sa.track(t,e)},maskClick:function(t){if(!t.msg)return!1;var e={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:t.msg.$sf_msg_title,$sf_msg_content:t.msg.$sf_msg_content,$sf_msg_image_url:t.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:t.properties.maskActionId};this.trackEvent("$PlanPopupClick",e,t.msg),t.destory()},elementClickCallback:function(t,e){var n=t.target,p=n.getAttribute("data-action"),o=n.getAttribute("data-info"),i=e.msg||{};if(!p)return!1;try{var a=(JSON.parse(p)||{})[0],r=JSON.parse(o)||{}}catch(t){popup.log("elementClickCallback error",t)}var s={type:a.type,value:_.isString(a.value)?a.value:"",extra:_.isObject(a.value)?a.value:""},u=e.msg.plan?e.msg.plan.plan_id:"",l={$sf_msg_title:i.$sf_msg_title,$sf_msg_content:i.$sf_msg_content,$sf_msg_image_url:i.$sf_msg_image_url,$sf_msg_element_type:r.$sf_msg_element_type,$sf_msg_element_content:r.$sf_msg_element_content,$sf_msg_element_action:a.type,$sf_msg_action_id:a.id,$sf_close_type:"close"===a.type?a.$sf_close_type:""};this.trackEvent("$PlanPopupClick",l,i);try{popup.info.popup_listener.onClick(u,s);var c=e.msg.plan;if(c){var d={name:c.cname,plan_id:c.plan_id,content:c.popup_window_content?c.popup_window_content.content:"",type:c.popup_window_content?c.popup_window_content.popup_type:"",action:s};popup.info.popup_campaign_listener.onClick(d)}}catch(t){popup.log("popup_listener.onClick error",t)}if("close"===a.type)e.destory();else if(a.closeable&&e.destory(),"auto"===popup.info.popup_listener.openlink&&"openlink"===a.type){if("http"!==a.value.slice(0,4))return!1;window.location.href=a.value}}};var salog=popup.log;popup.changeCovertStatus=function(t){var e=JSON.parse(JSON.stringify(popup.convertPlans));_.each(e,function(e,n){if(!e.is_in_convert_window)return!1;var p=e.is_in_convert_window.step,o=e.is_in_convert_window.uuid;if(popup.convertPlans[n].is_in_convert_window.step=Math.min(2*p,6e5),!t)return!1;_.each(t,function(t){t.popup_display_uuid===o&&t.convert_time&&(salog("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",popup.convertPlans[n].plan_id),delete popup.convertPlans[n].is_in_convert_window,popup.convertPlans.splice(n,1))})}),popup.updateDataAndSetListen.updateLocalData()},popup.asyncConvert=function(t){var e=popup.info.project,n=!1;if(!t&&0===popup.convertPlans.length)return!1;t&&(_.each(popup.convertPlans,function(e){e.plan_id===t.plan_id&&(n=!0)}),n||popup.convertPlans.push(t)),function p(){if(_.isEmptyObject(popup.localData)||!_.isArray(popup.convertPlans)||0===popup.convertPlans.length)return!1;var t=JSON.parse(JSON.stringify(popup.convertPlans)),n=t[0].is_in_convert_window&&t[0].is_in_convert_window.step||5e3,o=[];if(_.each(t,function(t,e){return!!t.is_in_convert_window&&((new Date).getTime()>t.is_in_convert_window.expire_time?(salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",popup.convertPlans[e].plan_id),delete popup.convertPlans[e].is_in_convert_window,popup.convertPlans.splice(e,1),popup.updateDataAndSetListen.updateLocalData(),!1):(o.push(t.is_in_convert_window.uuid),t.is_in_convert_window.step||(t.is_in_convert_window.step=5e3,popup.convertPlans[e].is_in_convert_window.step=5e3),void(n>t.is_in_convert_window.step&&(n=t.is_in_convert_window.step))))}),!o.length)return!1;popup.asyncConvert.timer&&clearTimeout(popup.asyncConvert.timer),popup.asyncConvert.timer=setTimeout(function(){_.ajax({url:popup.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(e)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(t){popup.changeCovertStatus(t),p()},error:function(){popup.changeCovertStatus(),p()}})},n)}()},popup.ruleTime={getExpire:function(t,e){var n=e,p=Number(t.value)||0,o=Number(t.value)||0,i=String(t.unit).toLowerCase(),a=null,r={day:function(){return(a=new Date(n)).setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+864e5*(o-1)},week:function(){var t=(a=new Date(n)).getDay();0===t&&(t=7);var e=7-t;return a.setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+24*e*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){var t=(a=new Date(n)).getMonth()+o;return t>=11?(a.setFullYear(a.getFullYear()+parseInt(t/12)),a.setMonth(t%12)):a.setMonth(t),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(t){var e={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(n),t in e&&(o=e[t]*p),a.getTime()+o}};return!0!==t.natural?r.second(i):i in r?r[i]():void 0},getLast:function(t,e){var n=Number(t.value)||0,p=Number(t.value)-1||0,o=String(t.unit).toLowerCase(),i=null,a={day:function(){return(i=new Date(e)).setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-864e5*p},week:function(){var t=(i=new Date(e)).getDay();return 0===t&&(t=7),--t,i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-(24*t*60*60*1e3+7*p*24*60*60*1e3)},month:function(){var t=(i=new Date(e)).getMonth()+1-p;return t<=0?(i.setFullYear(i.getFullYear()+(parseInt(t/12)-1)),i.setMonth(12+t%12-1)):i.setMonth(t-1),i.setDate(1),i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.getTime()},second:function(t){var p={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return i=new Date(e),t in p&&(o=p[t]*n),i.getTime()-o}};return!0!==t.natural?a.second(o):o in a?a[o]():void 0},getArrMatchCount:function(t,e){var n=0;for(n=0;n=t[n])return n;return t.length}},popup.eventTriggerProcess=function(){if(!popup.updateDataAndSetListen.active_state)return!1;if(!_.isArray(popup.localData.eventQueue))return!1;if(0===popup.localData.eventQueue.length)return!1;if(popup.isRun)return!1;salog("\u4e8b\u4ef6\u961f\u5217---eventQueue",popup.localData.eventQueue);var t=!1,e=popup.localData.eventQueue[0],n=popup.eventRule[e.event];popup.isRun=!0,popup.localData.eventQueue.shift(),popup.updateDataAndSetListen.updateLocalData(),_.isArray(n)&&_.isObject(n[0])&&n.length>0&&(salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),_.each(n,function(t){_.isObject(t)&&"undefined"!=typeof t.match_state&&delete t.match_state,new popup.RuleCheck(t,e)}),_.each(n,function(e){!0===e.match_state?!1===t?(t=!0,salog("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",e.plan.cname),new popup.PopupCheck(e,!0)):!0===t&&(salog("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",e.plan.cname),new popup.PopupCheck(e,!1)):salog("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",e.plan.cname)}),t||popup.completeWindowLifecycle(),salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},popup.completeWindowLifecycle=function(){popup.isRun=!1,popup.eventTriggerProcess()},popup.PopupCheck=function(t,e){this.plan=t.plan,this.current_time=(new Date).getTime(),e?this.renderPopup():this.hidePopup(),popup.updateDataAndSetListen.updateLocalData()},popup.PopupCheck.prototype.createPopupWindow=function(t,e){this.startConvertWindow(t),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),e&&popup.completeWindowLifecycle()},popup.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},popup.PopupCheck.prototype.renderPopup=function(){popup.handlerCampaign(this)},popup.PopupCheck.prototype.popupFailed=function(t,e,n){var p={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"}[t],o=popup.getPopupInfo(n.content);o.$sf_msg_id=n.uuid,o.plan=n.plan,o.$sf_succeed=!1,o.$sf_fail_reason=p,popup.track.popupDisplay(o),!e&&popup.info.popup_listener&&_.isFunction(popup.info.popup_listener.onLoadFailed)&&popup.info.popup_listener.onLoadFailed(n.plan.plan_id,t,p),popup.info.popup_campaign_listener.onFailed(popup.getSFCampaign(n.plan),t,p),this.createPopupWindow(n.uuid,!0)},popup.PopupCheck.prototype.customCampaign=function(t){var e=popup.getSFCampaign(t.plan),n=popup.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,popup.track.popupDisplay(n),popup.info.popup_campaign_listener.onStart(e),this.createPopupWindow(t.uuid,!0)},popup.PopupCheck.prototype.showPopup=function(t){if(!popup.ElementRender)return popup.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var e=new popup.ElementRender(t.content),n=popup.getPopupInfo(t.content);if(n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,_.extend(e.msg,n),e.popupCheckInstance=this,popup.track.popupDisplay(n),!e.render())return salog("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1;popup.info.popup_campaign_listener.onStart(popup.getSFCampaign(t.plan)),this.createPopupWindow(t.uuid),popup.info.popup_listener.onLoadSuccess(t.plan.plan_id)},popup.PopupCheck.prototype.startConvertWindow=function(t){salog("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),_.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:popup.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:t},popup.asyncConvert(this.plan))},popup.PopupCheck.prototype.startPopupIntervalWindow=function(t){_.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=popup.ruleTime.getExpire(this.plan.popup_interval,t))},popup.PopupCheck.prototype.resetPopupIntervalWindow=function(){var t=(new Date).getTime();this.startPopupIntervalWindow(t),this.resetGlobalLimit(t),popup.completeWindowLifecycle()},popup.PopupCheck.prototype.startPopupLimitWindow=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),_.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(_.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:popup.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},popup.PopupCheck.prototype.setGlobalLimit=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),_.isArray(popup.localData.global_popup_count)||(popup.localData.global_popup_count=[]),popup.localData.global_popup_count.unshift(this.current_time);for(var t=popup.localData.global_popup_count,e=t[t.length-1];e+7776e63e3;)t.pop(),e=t[t.length-1]},popup.PopupCheck.prototype.resetGlobalLimit=function(t){_.isArray(popup.localData.global_popup_count)&&popup.localData.global_popup_count.length>0&&(popup.localData.global_popup_count.shift(),popup.localData.global_popup_count.unshift(t))},popup.PopupCheck.prototype.deletePlanAllWindow=function(){var t=this.plan.pattern_popup.matcher_list;_.isArray(t)&&_.each(t,function(t){t.is_in_window&&(salog("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete t.is_in_window)})},popup.RuleCheck=function(t,e){this.plan_match=t,this.plan=t.plan,this.rule_arr=t.rule,this.event_data=e,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";_.each(this.rule_arr,function(t){n+="--\u5305\u542b\u89c4\u5219-("+t.event_name+"\uff09-\u89e6\u53d1"+t.params[0]+"\u6b21"}),salog(n),salog(this.plan),this.checkPlanIsExpire(),popup.updateDataAndSetListen.updateLocalData()},popup.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||_.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)salog("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(_.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var t=0;t=1){var e=popup.ruleTime.getLast(popup.localData.popup_interval_global,this.current_time);e>t[0]?(salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+e+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0]),this.checkPopupInterval()):salog("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+e+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0])}else salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},popup.RuleCheck.prototype.checkPopupInterval=function(){var t=!0;_.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null):(salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"),t=!1):(salog("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null),t&&this.checkPermission()&&this.checkProperties()},popup.RuleCheck.prototype.isMatched=function(t){var e={equal:function(t,e){if(!_.isNumber(t)&&!_.isString(t))return!1;for(var n=0,p=e.length;n=0},notContain:function(t,e){return!!_.isString(t)&&-1===t.indexOf(e[0])},isTrue:function(t){return!0===t},isFalse:function(t){return!1===t},isSet:function(t){return void 0!==t},notSet:function(t){return void 0===t},isEmpty:function(t){if(!_.isString(t)&&!_.isArray(t))return!1;if(_.isString(t))return""===t;for(var e=0;e_.getConvertNumberValue(e[0]))},between:function(t,e){if(!_.isNumber(t))return!1;if("undefined"==typeof e[0]&&"undefined"==typeof e[1])return!1;var n=_.getConvertNumberValue(t),p=_.getConvertNumberValue(e[0]),o=_.getConvertNumberValue(e[1]);return n>=p&&n<=o},isIn:function(t,e){if(!_.isArray(t))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(t,e){if(!_.isArray(t))return!1;for(var n=0;n=n&&o<=p}catch(i){salog("absolute_between Error",i)}},absoluteBetween:function(t,e){try{var n=new Date(e[0]),p=new Date(e[1]),o=new Date(t);return o>=n&&o<=p}catch(i){salog("absolute_between Error",i)}}},n=this,p=t.relation,o="or"===String(p).toLowerCase(),i="and"===String(p).toLowerCase(),a=!!i,r=!0;return _.each(t.conditions,function(t){if(!r)return!1;if(!t.field)return!1;var p=t.field.lastIndexOf("."),s=t.params,u="in"===t["function"]?"isIn":t["function"];if(!e[u])return a=!1,r=!1,!1;if(p<0)return!1;var l=t.field.slice(p+1),c=n.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=e[u](_,s);o&&d&&(a=!0,r=!1),i&&!d&&(a=!1,r=!1)}),a},popup.RuleCheck.prototype.checkProperties=function(){var t=this,e=_.filter(this.rule_arr,function(e){var n=e.multi_filter?e.multi_filter:e.filter;return!(n&&(!n.conditions||0!==n.conditions.length))||t.isMatched(n)});_.isArray(e)&&e.length>0?(this.checkWindowAndMatch(e),salog("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",e)):salog("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},popup.RuleCheck.prototype.checkPermission=function(){var t=this.plan.event_permission;if(!_.isObject(t)||_.isEmptyObject(t))return!0;var e=this,n=[],p=function(t){return _.filter(t,function(t){return!(t&&t.conditions&&(!t.conditions||0!==t.conditions.length))||e.isMatched(t)})};return function o(t){_.each(t,function(t){if(n=p([t]),_.isArray(n)&&n.length>0){var e=t.filters||[];e&&e.length>0&&o(e)}})}([t]),_.isArray(n)&&n.length>0?(popup.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n),!0):(popup.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3"),!1)},popup.RuleCheck.prototype.checkWindowAndMatch=function(t){var e=this,n=[];_.each(t,function(t){if(!t.params||!t.params[0])return salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var p=Number(t.params[0]);1===p?n.push(t):p>1&&_.isObject(t.window)&&t.window.value>0&&(!_.isObject(t.is_in_window)||!_.isNumber(t.is_in_window.expire_time)||t.is_in_window.expire_time=p?n.push(t):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",t.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",p))}),n.length>0?(salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},popup.RuleCheck.prototype.checkGlobalPopupLimit=function(){var t=popup.localData.msg_limit_global,e=!0,n=this;_.isObject(t)&&!0===t.is_in_use&&_.isArray(t.limits)&&_.isArray(popup.localData.global_popup_count)&&!0===this.plan.global_msg_limit_enabled?(_.each(t.limits,function(t){if(_.isObject(t)&&_.isNumber(t.limit)){var p=popup.ruleTime.getLast(t,n.current_time),o=popup.ruleTime.getArrMatchCount(popup.localData.global_popup_count,p);salog("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+o+"-\u9650\u5236\u7684\u6b21\u6570"+t.limit+"-\u9650\u5236\u65f6\u95f4-"+p),e=o0&&(1===arguments.length&&_.isObject(arguments[0])?t=arguments[0]:arguments.length>=2&&_.isObject(arguments[1])&&(t=arguments[1])),!!this.setPara(t)&&(popup.info.platform="WEB",!!popup.setIsLoad()&&void(popup.testSend.hasParam()?popup.testSend.start():(popup.listenPageStateChange(),popup.updateDataAndSetListen.initial())))}popup.store={delete_time:2592e6,init:function(){this.migrateLocalData(),popup.localData=this.getLocalData(),_.isNumber(popup.localData.config_pull_interval_ms)&&popup.localData.config_pull_interval_ms>0&&(popup.updateDataAndSetListen.interval_time=popup.localData.config_pull_interval_ms),this.removeLocalData(),popup.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var t=_.localStorage.get(popup.config.storageName);_.isString(t)&&(t=decrypt(t));try{t=JSON.parse(t)}catch(e){_.log(e)}return t},saveJSONData:function(t){t=JSON.stringify(t),popup.info.encrypt_cookie&&(t=encrypt(t)),_.localStorage.set(popup.config.storageName,t)},migrateLocalData:function(){var t=this.getJSONData()||{},e=popup.sa.store.getDistinctId();if(t.popup_sdk_users&&t.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[e]=t,n.popup_sdk_users[e]={user_id:e},this.saveJSONData(n)},getLocalData:function(){var t=this.getJSONData(),e=popup.sa.store.getDistinctId(),n=null;return t?(_.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id),n&&_.isObject(t.popup_sdk_plans[n])?(t.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(t),t.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var t=this.getJSONData(),e=popup.sa.store.getDistinctId(),n=null;if(!t)return!1;t.popup_sdk_users&&_.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id,t.popup_sdk_plans[n]=popup.localData,this.saveJSONData(t))},removeLocalData:function(){var t=this.getJSONData(),e=this.delete_time;if(!t||!t.popup_sdk_plans||!t.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(t.popup_sdk_plans)),p=JSON.parse(JSON.stringify(t.popup_sdk_users)),o=(new Date).getTime(),i=[];_.each(n,function(n,p){o-n.update_time>e&&(delete t.popup_sdk_plans[p],i.push(p))}),_.each(p,function(e,n){i.length>0&&_.each(i,function(p){e.user_id&&p===e.user_id&&delete t.popup_sdk_users[n]})}),this.saveJSONData(t)}},popup.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var t=popup.localData.popup_plans;if(!t||!_.isArray(t))return!1;var e=_.filter(t,function(t){return!!t.convert_window&&!!t.is_in_convert_window});popup.convertPlans=e,popup.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",popup.convertPlans),popup.asyncConvert()},diffData:function(){var t=popup.localData,e=JSON.parse(JSON.stringify(popup.serverData));(new Date).getTime();if(!e||_.isEmptyObject(e))return!1;if(!t||_.isEmptyObject(t)||!t.popup_plans||0===t.popup_plans.length)return _.extend(popup.localData,e),!1;var n=e.popup_plans;_.each(n,function(e,p){var o=null;if(_.each(t.popup_plans,function(t){t.plan_id===e.plan_id&&(o=t,e.audience_id||delete o.audience_id,_.isObject(e.window_update)&&_.each(e.window_update,function(t,n){o.window_update&&o.window_update[n]===t||("trigger_window"===n?o.pattern_popup.matcher_list=e.pattern_popup.matcher_list:"convert_window"===n&&o.is_in_convert_window&&e.convert_window&&o.is_in_convert_window.start_time&&(o.is_in_convert_window.expire_time=popup.ruleTime.getExpire(e.convert_window,o.is_in_convert_window.start_time)))}))}),!o)return!1;if(!e.window_update&&o.last_update_config_time!==e.last_update_config_time)return!1;var i=o.pattern_popup.matcher_list;_.extend2Lev(o,e),o.pattern_popup.matcher_list=i,n[p]=o}),_.extend(popup.localData,e)},getEventRule:function(){var t=popup.localData.popup_plans,e={};if(!t||!_.isArray(t))return!1;_.each(t,function(t){var n=t.pattern_popup.matcher_list;_.each(n,function(n){var p={plan:t,rule:[n]},o=n.event_name,i=!1;if(e[o]){if(_.each(e[o],function(e){e.plan.plan_id===t.plan_id&&(e.rule.push(n),i=!0)}),i)return!1;e[o].push(p)}else e[o]=[p]})}),_.each(e,function(t){t.sort(function(t,e){var n=e.plan.absolute_priority-t.plan.absolute_priority;return 0===n?e.plan.plan_id-t.plan.plan_id:n})}),popup.eventRule=e,popup.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),popup.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------")},registerListen:function(){var t=this;popup.sa.events.on("send",function(e){e.event&&popup.eventRule[e.event]&&(_.isArray(popup.localData.eventQueue)||(popup.localData.eventQueue=[]),popup.localData.eventQueue.push(e),t.updateLocalData(),popup.eventTriggerProcess())}),popup.sa.events.on("changeDistinctId",function(e){t.changeId()}),popup.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(t){if(t.length<1)return!1;if(JSON.stringify(t)===JSON.stringify(this.image_list))return!1;this.image_list=t;for(var e=0;e0&&(n.interval_time=p.config_pull_interval_ms),popup.serverData.local_update_time=(new Date).getTime(),popup.info.preload_image&&n.loadImage(popup.getImageList(p.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},popup.localData={},n.updateLocalData()),t(),n.setIntervalTime(n.interval_time)},error:function(){if(!n.active_state)return e(),!1;popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},t(),n.setIntervalTime(n.interval_time)}})},updateUserPlans:function(){var t=popup.store.getJSONData(),e=popup.sa.store.getDistinctId(),n=popup.serverData.user_id;t.popup_sdk_users[e]={user_id:n||e},n?t.popup_sdk_plans[n]?popup.localData=t.popup_sdk_plans[n]:t.popup_sdk_plans[e]&&(popup.localData=t.popup_sdk_plans[e],delete t.popup_sdk_plans[e]):t.popup_sdk_plans[e]&&(popup.localData=t.popup_sdk_plans[e]),popup.localData.update_time=(new Date).getTime(),popup.store.saveJSONData(t)},setIntervalTime:function(t){var e=this;this.data_interval=setTimeout(function(){popup.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),e.getDataFromServer()},t)},setFirstListen:function(){var t=this;this.getDataFromServer(function(){t.registerListen()})},updateLocalData:function(){var t=JSON.stringify(popup.localData);this.local_data!==t&&(this.local_data=t,popup.store.saveLocalData())},initial:function(){popup.store.init();var t=popup.localData.local_update_time,e=(new Date).getTime();if(_.isNumber(t)){var n=e-t;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),popup.info.preload_image&&this.loadImage(popup.getImageList(popup.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,popup.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),popup.asyncConvert.timer&&window.clearTimeout(popup.asyncConvert.timer),popup.convertPlans=[],popup.localData={},this.resetState()},resetState:function(){if("WEB"===popup.info.platform)return!1;!document.querySelector("div[data-sf-mask]")&&popup.isRun&&(popup.isRun=!1)},startState:function(t){this.active_state=!0,(t=t||{getLocalData:!0}).getLocalData&&(this.resetState(),popup.localData=popup.store.getLocalData()),this.getDataFromServer()}},popup.testSend={hasParam:function(){var t=_.URL(window.location.href).searchParams,e=t.get("sf_popup_test")||"",n=t.get("popup_window_id")||"",p=t.get("platform");return!(!e||!n)&&{sf_popup_test:e,popup_window_id:n,platform:p}},start:function(){if("WEB"!==this.hasParam().platform)return popup.log("H5\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728\u79fb\u52a8\u7aef\u67e5\u770b\uff01"),!1;this.webCampaign()},webCampaign:function(){var t=popup.info.project,e=popup.info.platform,n=this.hasParam().popup_window_id,p=encodeURIComponent(popup.sa.store.getDistinctId());_.ajax({url:popup.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(t)+"&time="+(new Date).getTime()+"&sdk_version="+popup.lib_version+"&platform="+encodeURIComponent(e)+"&distinct_id="+p,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(t){var e,n=_.getUuid();_.isObject(t)||(popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",t),t={});try{e=JSON.parse(t.content)}catch(i){popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",t,i)}var p=popup.getPopupInfo(e);p.$sf_msg_id=n;var o={content:t.content,type:t.popup_type||"CUSTOMIZED"};Object.hasOwnProperty.call(t,"name")&&(o.name=t.name),_.isString(t.content)?"withoutCampaignListener"===popup.info.supportCustom||"withoutStart"===popup.info.supportCustom?(p.$sf_succeed=!1,p.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(p.$sf_succeed=!0,popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onStart(o)):(p.$sf_succeed=!1,p.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"))},error:function(t){popup.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",t)}})}},popup.setPara=function(t){_.isObject(t)||(t={}),popup.info=_.extend({},popup.defaultPara,t);var e=popup.sa;return e?(!0===e.para.encrypt_cookie&&(popup.info.encrypt_cookie=!0),_.isString(popup.info.api_base_url)&&"http"===popup.info.api_base_url.slice(0,4)?"http:"===popup.info.api_base_url.slice(0,5)&&"https:"===location.protocol?(popup.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1):(popup.info.api_base_url="/"===popup.info.api_base_url.slice(-1)?popup.info.api_base_url.slice(0,-1):popup.info.api_base_url,_.isString(e.para.server_url)&&"http"===e.para.server_url.slice(0,4)?(popup.info.project||(popup.info.project=_.URL(e.para.server_url).searchParams.get("project")||"default"),popup.info.supportCustom=!0,_.isObject(popup.info.popup_campaign_listener)?(_.isFunction(popup.info.popup_campaign_listener.shouldStart)||(popup.info.popup_campaign_listener.shouldStart=function(){return!0}),_.isFunction(popup.info.popup_campaign_listener.onStart)||(popup.info.supportCustom="withoutStart",popup.info.popup_campaign_listener.onStart=function(){}),_.isFunction(popup.info.popup_campaign_listener.onEnd)||(popup.info.popup_campaign_listener.onEnd=function(){}),_.isFunction(popup.info.popup_campaign_listener.onFailed)||(popup.info.popup_campaign_listener.onFailed=function(){}),_.isFunction(popup.info.popup_campaign_listener.onClick)||(popup.info.popup_campaign_listener.onClick=function(){})):(popup.info.supportCustom="withoutCampaignListener",popup.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0):(popup.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1)):(popup.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1)):(popup.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)},popup.init=function(){var t=window.sensorsDataAnalytic201505;if(popup.sa=t,t&&t.readyState&&t.readyState.state>=3||!t.on)initPopup.apply(this,arguments);else{var e=this,n=arguments;t&&t.on("sdkReady",function(){initPopup.apply(e,n)})}},window.SensorsDataWebJSSDKPlugin&&"[object Object]"===Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.WebPopup=window.SensorsDataWebJSSDKPlugin.WebPopup||popup:window.SensorsDataWebJSSDKPlugin={WebPopup:popup};export default popup; \ No newline at end of file +var popup={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.26.9",plugin_version:"1.26.9",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(t){var e={};if(t&&"[object Object]"===Object.prototype.toString.call(t)){for(var n in t)n&&"popup_window_content"!==n&&(e[n]=t[n]);return JSON.stringify(e,null," ")}return t},log:function(){if(!0===popup.info.show_log&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=popup.setArg(arguments[0]),arguments[1]=popup.setArg(arguments[1]),console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}},config:{storageName:"sensorsdata202002-webpopupdata",loadedSign:"SensorsData2015JSSDKWebPopupIsLoad"}},_={visibility:function(t){t=t||{};var e={hidden:undefined,visibilityChange:undefined,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:t.onVisible,_hidden:t.onHidden,_nativeSwitch:function(){!0===document[this.hidden]?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){e._nativeSwitch.apply(e,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(t){}},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()}};e.init()},getRgba:function(t){return"object"!=typeof t?t:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},conversionNum:function(t){if(t){if(/^[0|1]?\.\d+$/.test(t))return 100*Number(t)+"%";var e=/^(-?\d+(\.\d+)?)px$/.exec(t);return e?(Number(e[1])/375*window.screen.width).toFixed(2)+"px":t}},boxModel:function(t){return function(e){if("object"!=typeof e)return t+":"+e+";";var n="";for(var p in e)n+=t+"-"+p+":"+_.conversionNum(e[p])+";";return n}},localStorage:{get:function(t){return window.localStorage.getItem(t)},parse:function(t){var e=null;try{e=JSON.parse(_.localStorage.get(t))||null}catch(n){}return e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",n="testIsSupportStorage";_.localStorage.set(e,n),_.localStorage.get(e)!==n&&(t=!1),_.localStorage.remove(e)}catch(p){t=!1}return t}},addEvent:function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}t._getPath=function(){var t=this;return this.path||this.composedPath&&this.composedPath()||function(){try{var e=t.target,n=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,n.unshift(e);return n}catch(p){return[]}}()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};(function(e,n,p){if(e&&e.addEventListener)e.addEventListener(n,function(e){e._getPath=t._getPath,p.call(this,e)},!1);else{var o="on"+n,i=e[o];e[o]=function(e,n,p){return function(o){if(!(o=o||t(window.event)))return undefined;o.target=o.srcElement;var i,a,r=!0;return"function"==typeof p&&(i=p(o)),a=n.call(e,o),!1!==i&&!1!==a||(r=!1),r}}(e,p,i)}}).apply(null,arguments)},extend:function(t){var e=Array.prototype.slice;return _.each(e.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])}),t},extend2Lev:function(t){return _.each(Array.prototype.slice.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(_.isObject(e[n])&&_.isObject(t[n])?_.extend(t[n],e[n]):t[n]=e[n])}),t},each:function(t,e,n){var p=Object.prototype.hasOwnProperty,o=Array.prototype.forEach,i={};if(null==t)return!1;if(o&&t.forEach===o)t.forEach(e,n);else if(t.length===+t.length){for(var a=0,r=t.length;a=200&&n.status<300||304==n.status?t.success(e(n.responseText)):t.error(e(n.responseText),n.status),n.onreadystatechange=null,n.onload=null)}catch(p){n.onreadystatechange=null,n.onload=null}},n.open(t.type,t.url,!0);try{t.credentials&&(n.withCredentials=!0),_.isObject(t.header)&&_.each(t.header,function(t,e){n.setRequestHeader&&n.setRequestHeader(e,t)}),t.data&&(t.cors||n.setRequestHeader&&n.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===t.contentType?n.setRequestHeader&&n.setRequestHeader("Content-type","application/json; charset=UTF-8"):n.setRequestHeader&&n.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(a){sd.log(a)}n.send(t.data||null)},getUuid:function(){var t=function(){return Math.random().toString(16).replace(".","")};return function(){var e=function(){for(var t=1*new Date,e=0;t==1*new Date;)e++;return t.toString(16)+e.toString(16)}()+"-"+t()+"-"+t();return e||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(t){var e=Object.prototype.hasOwnProperty;if(_.isObject(t)){for(var n in t)if(e.call(t,n))return!1;return!0}return!1},filter:function(t,e,n){var p=Object.prototype.hasOwnProperty;if(t.filter)return t.filter(e);for(var o=[],i=0;i=0;i--){var a=p[i];n[a]=o[a]}n.hostname&&"string"==typeof n.pathname&&0!==n.pathname.indexOf("/")&&(n.pathname="/"+n.pathname),n.searchParams=function(){var t=_.getURLSearchParams(n.search);return{get:function(e){return t[e]}}}()}return n},contentLoaded:function(t,e){var n=!1,p=!0,o=t.document,i=o.documentElement,a=o.addEventListener,r=a?"addEventListener":"attachEvent",s=a?"removeEventListener":"detachEvent",u=a?"":"on",l=function(p){"readystatechange"==p.type&&"complete"!=o.readyState||(("load"==p.type?t:o)[s](u+p.type,l,!1),!n&&(n=!0)&&e.call(t,p.type||p))},c=function(){try{i.doScroll("left")}catch(t){return void setTimeout(c,50)}l("poll")};if("complete"==o.readyState)e.call(t,"lazy");else{if(!a&&i.doScroll){try{p=!t.frameElement}catch(_){}p&&c()}o[r](u+"DOMContentLoaded",l,!1),o[r](u+"readystatechange",l,!1),t[r](u+"load",l,!1)}},indexOf:function(t,e){var n=t.indexOf;if(n)return n.call(t,e);for(var p=0;p=3)&&window.sensorsDataAnalytic201505},popup.getPopupInfo=function(t){if(!_.isObject(t)||!_.isObject(t.template))return{};var e={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return function n(t){_.each(t.subviews,function(t){var p=t.properties||{};"title"===p.msgType?e.$sf_msg_title=p.text:"content"===p.msgType?e.$sf_msg_content=p.text:"image"===t.type&&(e.$sf_msg_image_url=p.image),t.subviews&&n(t)})}(t.template),e},popup.getSFCampaign=function(t){t=_.isObject(t)?t:{};var e={planId:"",name:"",content:null,type:""};return e.planId=t.plan_id||"",e.name=t.cname||"",e.content=_.isObject(t.popup_window_content)?t.popup_window_content.content:"",e.type=_.isObject(t.popup_window_content)&&t.popup_window_content.popup_type?t.popup_window_content.popup_type:"PRESET",e},popup.getImageList=function(t){if(!_.isArray(t))return!1;for(var e,n,p=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),o=new RegExp('http(s)?://.[^S^"]*'),i={},a=t.length,r=[],s=0;s0&&(i[n[0]]||(i[n[0]]=1));return _.each(i,function(t,e){r.push(e)}),r},popup.setIsLoad=function(){if(window.self===window.top){if(window[popup.config.loadedSign])return!1;if("undefined"==typeof window[popup.config.loadedSign])return window[popup.config.loadedSign]=!0,!0}else try{return!window.top[popup.config.loadedSign]&&(window.top[popup.config.loadedSign]=!0,!0)}catch(t){return popup.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",t),!0}},popup.handlerCampaign=function(t){var e,n=t,p=_.getUuid()(),o=n.plan.popup_window_content;if(!_.isObject(o))return n.popupFailed(1001,!1,{uuid:p,content:"",plan:n.plan}),!1;if(o.content)try{e=JSON.parse(o.content)}catch(u){popup.log(u)}var i=popup.getSFCampaign(n.plan),a={state:"",isCustom:!1},r=!0;try{r=popup.info.popup_campaign_listener.shouldStart(i)}catch(u){r=!1,popup.log(u)}var s={uuid:p,content:e,plan:n.plan};switch(n.plan.is_trigger?r?"CUSTOMIZED"===o.popup_type?"withoutCampaignListener"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===popup.info.supportCustom?a.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":_.isString(o.content)?a.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":a.state="DIALOG_NOT_SHOW_JSON_FAILED":("PRESET"===o.popup_type&&popup.log("\u6b64\u7248\u672csdk\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97"),a.state="DIALOG_NOT_SHOW_JSON_FAILED"):a.state="CAMPAIGN_NOT_START_LISTENER_START":a.state="CAMPAIGN_NOT_START_TRIGGER",a.isCustom=!(!o.popup_type||"CUSTOMIZED"!==o.popup_type),popup.log("campaign:",a,"plan:",n.plan.cname),a.state){case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":n.customCampaign(s);break;case"CAMPAIGN_NOT_START_LISTENER_START":n.popupFailed(1004,a.isCustom,s);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":n.popupFailed(1006,a.isCustom,s);break;case"DIALOG_NOT_SHOW_JSON_FAILED":n.popupFailed(1001,a.isCustom,s);break;case"CAMPAIGN_NOT_START_TRIGGER":n.popupFailed(1005,a.isCustom,s);break;default:popup.log("CampaignState\u5f02\u5e38")}},popup.track={getPublicProps:function(t){var e=t.plan,n={$sf_lib_version:popup.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:popup.info.platform,$sf_msg_id:t.$sf_msg_id};return _.isEmptyObject(e)||!_.isObject(e)?n:(n.$sf_plan_id=e.plan_id+"",n.$sf_plan_strategy_id=e.strategy_id?e.strategy_id:e.is_control_group?"-1":"0",e.audience_id&&(n.$sf_audience_id=e.audience_id+""),e.section_id&&(n.$sf_section_id=String(e.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(t){var e={$sf_msg_title:t.$sf_msg_title,$sf_msg_content:t.$sf_msg_content,$sf_msg_image_url:t.$sf_msg_image_url,$sf_succeed:t.$sf_succeed,$sf_fail_reason:t.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",e,t)},trackEvent:function(t,e,n){var p=popup.track.getPublicProps(n);_.extend(e,p),_.each(e,function(t,n){""!==t&&t!==undefined||delete e[n]}),popup.sa.track(t,e)},maskClick:function(t){if(!t.msg)return!1;var e={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:t.msg.$sf_msg_title,$sf_msg_content:t.msg.$sf_msg_content,$sf_msg_image_url:t.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:t.properties.maskActionId};this.trackEvent("$PlanPopupClick",e,t.msg),t.destory()},elementClickCallback:function(t,e){var n=t.target,p=n.getAttribute("data-action"),o=n.getAttribute("data-info"),i=e.msg||{};if(!p)return!1;try{var a=(JSON.parse(p)||{})[0],r=JSON.parse(o)||{}}catch(t){popup.log("elementClickCallback error",t)}var s={type:a.type,value:_.isString(a.value)?a.value:"",extra:_.isObject(a.value)?a.value:""},u=e.msg.plan?e.msg.plan.plan_id:"",l={$sf_msg_title:i.$sf_msg_title,$sf_msg_content:i.$sf_msg_content,$sf_msg_image_url:i.$sf_msg_image_url,$sf_msg_element_type:r.$sf_msg_element_type,$sf_msg_element_content:r.$sf_msg_element_content,$sf_msg_element_action:a.type,$sf_msg_action_id:a.id,$sf_close_type:"close"===a.type?a.$sf_close_type:""};this.trackEvent("$PlanPopupClick",l,i);try{popup.info.popup_listener.onClick(u,s);var c=e.msg.plan;if(c){var d={name:c.cname,plan_id:c.plan_id,content:c.popup_window_content?c.popup_window_content.content:"",type:c.popup_window_content?c.popup_window_content.popup_type:"",action:s};popup.info.popup_campaign_listener.onClick(d)}}catch(t){popup.log("popup_listener.onClick error",t)}if("close"===a.type)e.destory();else if(a.closeable&&e.destory(),"auto"===popup.info.popup_listener.openlink&&"openlink"===a.type){if("http"!==a.value.slice(0,4))return!1;window.location.href=a.value}}};var salog=popup.log;popup.changeCovertStatus=function(t){var e=JSON.parse(JSON.stringify(popup.convertPlans));_.each(e,function(e,n){if(!e.is_in_convert_window)return!1;var p=e.is_in_convert_window.step,o=e.is_in_convert_window.uuid;if(popup.convertPlans[n].is_in_convert_window.step=Math.min(2*p,6e5),!t)return!1;_.each(t,function(t){t.popup_display_uuid===o&&t.convert_time&&(salog("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",popup.convertPlans[n].plan_id),delete popup.convertPlans[n].is_in_convert_window,popup.convertPlans.splice(n,1))})}),popup.updateDataAndSetListen.updateLocalData()},popup.asyncConvert=function(t){var e=popup.info.project,n=!1;if(!t&&0===popup.convertPlans.length)return!1;t&&(_.each(popup.convertPlans,function(e){e.plan_id===t.plan_id&&(n=!0)}),n||popup.convertPlans.push(t)),function p(){if(_.isEmptyObject(popup.localData)||!_.isArray(popup.convertPlans)||0===popup.convertPlans.length)return!1;var t=JSON.parse(JSON.stringify(popup.convertPlans)),n=t[0].is_in_convert_window&&t[0].is_in_convert_window.step||5e3,o=[];if(_.each(t,function(t,e){return!!t.is_in_convert_window&&((new Date).getTime()>t.is_in_convert_window.expire_time?(salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",popup.convertPlans[e].plan_id),delete popup.convertPlans[e].is_in_convert_window,popup.convertPlans.splice(e,1),popup.updateDataAndSetListen.updateLocalData(),!1):(o.push(t.is_in_convert_window.uuid),t.is_in_convert_window.step||(t.is_in_convert_window.step=5e3,popup.convertPlans[e].is_in_convert_window.step=5e3),void(n>t.is_in_convert_window.step&&(n=t.is_in_convert_window.step))))}),!o.length)return!1;popup.asyncConvert.timer&&clearTimeout(popup.asyncConvert.timer),popup.asyncConvert.timer=setTimeout(function(){_.ajax({url:popup.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(e)+"&popup_display_uuids="+encodeURIComponent(o)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(t){popup.changeCovertStatus(t),p()},error:function(){popup.changeCovertStatus(),p()}})},n)}()},popup.ruleTime={getExpire:function(t,e){var n=e,p=Number(t.value)||0,o=Number(t.value)||0,i=String(t.unit).toLowerCase(),a=null,r={day:function(){return(a=new Date(n)).setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+864e5*(o-1)},week:function(){var t=(a=new Date(n)).getDay();0===t&&(t=7);var e=7-t;return a.setHours(23),a.setMinutes(59),a.setSeconds(59),a.setMilliseconds(999),a=a.getTime()+24*e*60*60*1e3+7*(o-1)*24*60*60*1e3},month:function(){var t=(a=new Date(n)).getMonth()+o;return t>=11?(a.setFullYear(a.getFullYear()+parseInt(t/12)),a.setMonth(t%12)):a.setMonth(t),a.setDate(1),a.setHours(0),a.setMinutes(0),a.setSeconds(0),a.setMilliseconds(0),a.getTime()},second:function(t){var e={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return a=new Date(n),t in e&&(o=e[t]*p),a.getTime()+o}};return!0!==t.natural?r.second(i):i in r?r[i]():void 0},getLast:function(t,e){var n=Number(t.value)||0,p=Number(t.value)-1||0,o=String(t.unit).toLowerCase(),i=null,a={day:function(){return(i=new Date(e)).setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-864e5*p},week:function(){var t=(i=new Date(e)).getDay();return 0===t&&(t=7),--t,i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i=i.getTime()-(24*t*60*60*1e3+7*p*24*60*60*1e3)},month:function(){var t=(i=new Date(e)).getMonth()+1-p;return t<=0?(i.setFullYear(i.getFullYear()+(parseInt(t/12)-1)),i.setMonth(12+t%12-1)):i.setMonth(t-1),i.setDate(1),i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setMilliseconds(0),i.getTime()},second:function(t){var p={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},o=null;return i=new Date(e),t in p&&(o=p[t]*n),i.getTime()-o}};return!0!==t.natural?a.second(o):o in a?a[o]():void 0},getArrMatchCount:function(t,e){var n=0;for(n=0;n=t[n])return n;return t.length}},popup.eventTriggerProcess=function(){if(!popup.updateDataAndSetListen.active_state)return!1;if(!_.isArray(popup.localData.eventQueue))return!1;if(0===popup.localData.eventQueue.length)return!1;if(popup.isRun)return!1;salog("\u4e8b\u4ef6\u961f\u5217---eventQueue",popup.localData.eventQueue);var t=!1,e=popup.localData.eventQueue[0],n=popup.eventRule[e.event];popup.isRun=!0,popup.localData.eventQueue.shift(),popup.updateDataAndSetListen.updateLocalData(),_.isArray(n)&&_.isObject(n[0])&&n.length>0&&(salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),_.each(n,function(t){_.isObject(t)&&"undefined"!=typeof t.match_state&&delete t.match_state,new popup.RuleCheck(t,e)}),_.each(n,function(e){!0===e.match_state?!1===t?(t=!0,salog("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",e.plan.cname),new popup.PopupCheck(e,!0)):!0===t&&(salog("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",e.plan.cname),new popup.PopupCheck(e,!1)):salog("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",e.plan.cname)}),t||popup.completeWindowLifecycle(),salog("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},popup.completeWindowLifecycle=function(){popup.isRun=!1,popup.eventTriggerProcess()},popup.PopupCheck=function(t,e){this.plan=t.plan,this.current_time=(new Date).getTime(),e?this.renderPopup():this.hidePopup(),popup.updateDataAndSetListen.updateLocalData()},popup.PopupCheck.prototype.createPopupWindow=function(t,e){this.startConvertWindow(t),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),e&&popup.completeWindowLifecycle()},popup.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},popup.PopupCheck.prototype.renderPopup=function(){popup.handlerCampaign(this)},popup.PopupCheck.prototype.popupFailed=function(t,e,n){var p={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"}[t],o=popup.getPopupInfo(n.content);o.$sf_msg_id=n.uuid,o.plan=n.plan,o.$sf_succeed=!1,o.$sf_fail_reason=p,popup.track.popupDisplay(o),!e&&popup.info.popup_listener&&_.isFunction(popup.info.popup_listener.onLoadFailed)&&popup.info.popup_listener.onLoadFailed(n.plan.plan_id,t,p),popup.info.popup_campaign_listener.onFailed(popup.getSFCampaign(n.plan),t,p),this.createPopupWindow(n.uuid,!0)},popup.PopupCheck.prototype.customCampaign=function(t){var e=popup.getSFCampaign(t.plan),n=popup.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,popup.track.popupDisplay(n),popup.info.popup_campaign_listener.onStart(e),this.createPopupWindow(t.uuid,!0)},popup.PopupCheck.prototype.showPopup=function(t){if(!popup.ElementRender)return popup.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var e=new popup.ElementRender(t.content),n=popup.getPopupInfo(t.content);if(n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,_.extend(e.msg,n),e.popupCheckInstance=this,popup.track.popupDisplay(n),!e.render())return salog("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1;popup.info.popup_campaign_listener.onStart(popup.getSFCampaign(t.plan)),this.createPopupWindow(t.uuid),popup.info.popup_listener.onLoadSuccess(t.plan.plan_id)},popup.PopupCheck.prototype.startConvertWindow=function(t){salog("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),_.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:popup.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:t},popup.asyncConvert(this.plan))},popup.PopupCheck.prototype.startPopupIntervalWindow=function(t){_.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=popup.ruleTime.getExpire(this.plan.popup_interval,t))},popup.PopupCheck.prototype.resetPopupIntervalWindow=function(){var t=(new Date).getTime();this.startPopupIntervalWindow(t),this.resetGlobalLimit(t),popup.completeWindowLifecycle()},popup.PopupCheck.prototype.startPopupLimitWindow=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),_.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(_.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:popup.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},popup.PopupCheck.prototype.setGlobalLimit=function(){salog("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),_.isArray(popup.localData.global_popup_count)||(popup.localData.global_popup_count=[]),popup.localData.global_popup_count.unshift(this.current_time);for(var t=popup.localData.global_popup_count,e=t[t.length-1];e+7776e63e3;)t.pop(),e=t[t.length-1]},popup.PopupCheck.prototype.resetGlobalLimit=function(t){_.isArray(popup.localData.global_popup_count)&&popup.localData.global_popup_count.length>0&&(popup.localData.global_popup_count.shift(),popup.localData.global_popup_count.unshift(t))},popup.PopupCheck.prototype.deletePlanAllWindow=function(){var t=this.plan.pattern_popup.matcher_list;_.isArray(t)&&_.each(t,function(t){t.is_in_window&&(salog("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete t.is_in_window)})},popup.RuleCheck=function(t,e){this.plan_match=t,this.plan=t.plan,this.rule_arr=t.rule,this.event_data=e,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";_.each(this.rule_arr,function(t){n+="--\u5305\u542b\u89c4\u5219-("+t.event_name+"\uff09-\u89e6\u53d1"+t.params[0]+"\u6b21"}),salog(n),salog(this.plan),this.checkPlanIsExpire(),popup.updateDataAndSetListen.updateLocalData()},popup.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||_.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)salog("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(_.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){salog("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var t=0;t=1){var e=popup.ruleTime.getLast(popup.localData.popup_interval_global,this.current_time);e>t[0]?(salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+e+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0]),this.checkPopupInterval()):salog("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+e+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0])}else salog("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},popup.RuleCheck.prototype.checkPopupInterval=function(){var t=!0;_.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null):(salog("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"),t=!1):(salog("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null),t&&this.checkPermission()&&this.checkProperties()},popup.RuleCheck.prototype.isMatched=function(t){var e={equal:function(t,e){if(!_.isNumber(t)&&!_.isString(t))return!1;for(var n=0,p=e.length;n=0},notContain:function(t,e){return!!_.isString(t)&&-1===t.indexOf(e[0])},isTrue:function(t){return!0===t},isFalse:function(t){return!1===t},isSet:function(t){return void 0!==t},notSet:function(t){return void 0===t},isEmpty:function(t){if(!_.isString(t)&&!_.isArray(t))return!1;if(_.isString(t))return""===t;for(var e=0;e_.getConvertNumberValue(e[0]))},between:function(t,e){if(!_.isNumber(t))return!1;if("undefined"==typeof e[0]&&"undefined"==typeof e[1])return!1;var n=_.getConvertNumberValue(t),p=_.getConvertNumberValue(e[0]),o=_.getConvertNumberValue(e[1]);return n>=p&&n<=o},isIn:function(t,e){if(!_.isArray(t))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(t,e){if(!_.isArray(t))return!1;for(var n=0;n=n&&o<=p}catch(i){salog("absolute_between Error",i)}},absoluteBetween:function(t,e){try{var n=new Date(e[0]),p=new Date(e[1]),o=new Date(t);return o>=n&&o<=p}catch(i){salog("absolute_between Error",i)}}},n=this,p=t.relation,o="or"===String(p).toLowerCase(),i="and"===String(p).toLowerCase(),a=!!i,r=!0;return _.each(t.conditions,function(t){if(!r)return!1;if(!t.field)return!1;var p=t.field.lastIndexOf("."),s=t.params,u="in"===t["function"]?"isIn":t["function"];if(!e[u])return a=!1,r=!1,!1;if(p<0)return!1;var l=t.field.slice(p+1),c=n.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=e[u](_,s);o&&d&&(a=!0,r=!1),i&&!d&&(a=!1,r=!1)}),a},popup.RuleCheck.prototype.checkProperties=function(){var t=this,e=_.filter(this.rule_arr,function(e){var n=e.multi_filter?e.multi_filter:e.filter;return!(n&&(!n.conditions||0!==n.conditions.length))||t.isMatched(n)});_.isArray(e)&&e.length>0?(this.checkWindowAndMatch(e),salog("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",e)):salog("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},popup.RuleCheck.prototype.checkPermission=function(){var t=this.plan.event_permission;if(!_.isObject(t)||_.isEmptyObject(t))return!0;var e=this,n=[],p=function(t){return _.filter(t,function(t){return!(t&&t.conditions&&(!t.conditions||0!==t.conditions.length))||e.isMatched(t)})};return function o(t){_.each(t,function(t){if(n=p([t]),_.isArray(n)&&n.length>0){var e=t.filters||[];e&&e.length>0&&o(e)}})}([t]),_.isArray(n)&&n.length>0?(popup.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",n),!0):(popup.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3"),!1)},popup.RuleCheck.prototype.checkWindowAndMatch=function(t){var e=this,n=[];_.each(t,function(t){if(!t.params||!t.params[0])return salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var p=Number(t.params[0]);1===p?n.push(t):p>1&&_.isObject(t.window)&&t.window.value>0&&(!_.isObject(t.is_in_window)||!_.isNumber(t.is_in_window.expire_time)||t.is_in_window.expire_time=p?n.push(t):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",t.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",p))}),n.length>0?(salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):salog("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},popup.RuleCheck.prototype.checkGlobalPopupLimit=function(){var t=popup.localData.msg_limit_global,e=!0,n=this;_.isObject(t)&&!0===t.is_in_use&&_.isArray(t.limits)&&_.isArray(popup.localData.global_popup_count)&&!0===this.plan.global_msg_limit_enabled?(_.each(t.limits,function(t){if(_.isObject(t)&&_.isNumber(t.limit)){var p=popup.ruleTime.getLast(t,n.current_time),o=popup.ruleTime.getArrMatchCount(popup.localData.global_popup_count,p);salog("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+o+"-\u9650\u5236\u7684\u6b21\u6570"+t.limit+"-\u9650\u5236\u65f6\u95f4-"+p),e=o0&&(1===arguments.length&&_.isObject(arguments[0])?t=arguments[0]:arguments.length>=2&&_.isObject(arguments[1])&&(t=arguments[1])),!!this.setPara(t)&&(popup.info.platform="WEB",!!popup.setIsLoad()&&void(popup.testSend.hasParam()?popup.testSend.start():(popup.listenPageStateChange(),popup.updateDataAndSetListen.initial())))}popup.store={delete_time:2592e6,init:function(){this.migrateLocalData(),popup.localData=this.getLocalData(),_.isNumber(popup.localData.config_pull_interval_ms)&&popup.localData.config_pull_interval_ms>0&&(popup.updateDataAndSetListen.interval_time=popup.localData.config_pull_interval_ms),this.removeLocalData(),popup.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var t=_.localStorage.get(popup.config.storageName);_.isString(t)&&(t=decrypt(t));try{t=JSON.parse(t)}catch(e){_.log(e)}return t},saveJSONData:function(t){t=JSON.stringify(t),popup.info.encrypt_cookie&&(t=encrypt(t)),_.localStorage.set(popup.config.storageName,t)},migrateLocalData:function(){var t=this.getJSONData()||{},e=popup.sa.store.getDistinctId();if(t.popup_sdk_users&&t.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[e]=t,n.popup_sdk_users[e]={user_id:e},this.saveJSONData(n)},getLocalData:function(){var t=this.getJSONData(),e=popup.sa.store.getDistinctId(),n=null;return t?(_.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id),n&&_.isObject(t.popup_sdk_plans[n])?(t.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(t),t.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var t=this.getJSONData(),e=popup.sa.store.getDistinctId(),n=null;if(!t)return!1;t.popup_sdk_users&&_.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id,t.popup_sdk_plans[n]=popup.localData,this.saveJSONData(t))},removeLocalData:function(){var t=this.getJSONData(),e=this.delete_time;if(!t||!t.popup_sdk_plans||!t.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(t.popup_sdk_plans)),p=JSON.parse(JSON.stringify(t.popup_sdk_users)),o=(new Date).getTime(),i=[];_.each(n,function(n,p){o-n.update_time>e&&(delete t.popup_sdk_plans[p],i.push(p))}),_.each(p,function(e,n){i.length>0&&_.each(i,function(p){e.user_id&&p===e.user_id&&delete t.popup_sdk_users[n]})}),this.saveJSONData(t)}},popup.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var t=popup.localData.popup_plans;if(!t||!_.isArray(t))return!1;var e=_.filter(t,function(t){return!!t.convert_window&&!!t.is_in_convert_window});popup.convertPlans=e,popup.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",popup.convertPlans),popup.asyncConvert()},diffData:function(){var t=popup.localData,e=JSON.parse(JSON.stringify(popup.serverData));(new Date).getTime();if(!e||_.isEmptyObject(e))return!1;if(!t||_.isEmptyObject(t)||!t.popup_plans||0===t.popup_plans.length)return _.extend(popup.localData,e),!1;var n=e.popup_plans;_.each(n,function(e,p){var o=null;if(_.each(t.popup_plans,function(t){t.plan_id===e.plan_id&&(o=t,e.audience_id||delete o.audience_id,_.isObject(e.window_update)&&_.each(e.window_update,function(t,n){o.window_update&&o.window_update[n]===t||("trigger_window"===n?o.pattern_popup.matcher_list=e.pattern_popup.matcher_list:"convert_window"===n&&o.is_in_convert_window&&e.convert_window&&o.is_in_convert_window.start_time&&(o.is_in_convert_window.expire_time=popup.ruleTime.getExpire(e.convert_window,o.is_in_convert_window.start_time)))}))}),!o)return!1;if(!e.window_update&&o.last_update_config_time!==e.last_update_config_time)return!1;var i=o.pattern_popup.matcher_list;_.extend2Lev(o,e),o.pattern_popup.matcher_list=i,n[p]=o}),_.extend(popup.localData,e)},getEventRule:function(){var t=popup.localData.popup_plans,e={};if(!t||!_.isArray(t))return!1;_.each(t,function(t){var n=t.pattern_popup.matcher_list;_.each(n,function(n){var p={plan:t,rule:[n]},o=n.event_name,i=!1;if(e[o]){if(_.each(e[o],function(e){e.plan.plan_id===t.plan_id&&(e.rule.push(n),i=!0)}),i)return!1;e[o].push(p)}else e[o]=[p]})}),_.each(e,function(t){t.sort(function(t,e){var n=e.plan.absolute_priority-t.plan.absolute_priority;return 0===n?e.plan.plan_id-t.plan.plan_id:n})}),popup.eventRule=e,popup.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),popup.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------")},registerListen:function(){var t=this;popup.sa.events.on("send",function(e){e.event&&popup.eventRule[e.event]&&(_.isArray(popup.localData.eventQueue)||(popup.localData.eventQueue=[]),popup.localData.eventQueue.push(e),t.updateLocalData(),popup.eventTriggerProcess())}),popup.sa.events.on("changeDistinctId",function(e){t.changeId()}),popup.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(t){if(t.length<1)return!1;if(JSON.stringify(t)===JSON.stringify(this.image_list))return!1;this.image_list=t;for(var e=0;e0&&(n.interval_time=p.config_pull_interval_ms),popup.serverData.local_update_time=(new Date).getTime(),popup.info.preload_image&&n.loadImage(popup.getImageList(p.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},popup.localData={},n.updateLocalData()),t(),n.setIntervalTime(n.interval_time)},error:function(){if(!n.active_state)return e(),!1;popup.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),popup.serverData={},t(),n.setIntervalTime(n.interval_time)}})},updateUserPlans:function(){var t=popup.store.getJSONData(),e=popup.sa.store.getDistinctId(),n=popup.serverData.user_id;t.popup_sdk_users[e]={user_id:n||e},n?t.popup_sdk_plans[n]?popup.localData=t.popup_sdk_plans[n]:t.popup_sdk_plans[e]&&(popup.localData=t.popup_sdk_plans[e],delete t.popup_sdk_plans[e]):t.popup_sdk_plans[e]&&(popup.localData=t.popup_sdk_plans[e]),popup.localData.update_time=(new Date).getTime(),popup.store.saveJSONData(t)},setIntervalTime:function(t){var e=this;this.data_interval=setTimeout(function(){popup.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),e.getDataFromServer()},t)},setFirstListen:function(){var t=this;this.getDataFromServer(function(){t.registerListen()})},updateLocalData:function(){var t=JSON.stringify(popup.localData);this.local_data!==t&&(this.local_data=t,popup.store.saveLocalData())},initial:function(){popup.store.init();var t=popup.localData.local_update_time,e=(new Date).getTime();if(_.isNumber(t)){var n=e-t;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),popup.info.preload_image&&this.loadImage(popup.getImageList(popup.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,popup.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),popup.asyncConvert.timer&&window.clearTimeout(popup.asyncConvert.timer),popup.convertPlans=[],popup.localData={},this.resetState()},resetState:function(){if("WEB"===popup.info.platform)return!1;!document.querySelector("div[data-sf-mask]")&&popup.isRun&&(popup.isRun=!1)},startState:function(t){this.active_state=!0,(t=t||{getLocalData:!0}).getLocalData&&(this.resetState(),popup.localData=popup.store.getLocalData()),this.getDataFromServer()}},popup.testSend={hasParam:function(){var t=_.URL(window.location.href).searchParams,e=t.get("sf_popup_test")||"",n=t.get("popup_window_id")||"",p=t.get("platform");return!(!e||!n)&&{sf_popup_test:e,popup_window_id:n,platform:p}},start:function(){if("WEB"!==this.hasParam().platform)return popup.log("H5\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728\u79fb\u52a8\u7aef\u67e5\u770b\uff01"),!1;this.webCampaign()},webCampaign:function(){var t=popup.info.project,e=popup.info.platform,n=this.hasParam().popup_window_id,p=encodeURIComponent(popup.sa.store.getDistinctId());_.ajax({url:popup.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(t)+"&time="+(new Date).getTime()+"&sdk_version="+popup.lib_version+"&platform="+encodeURIComponent(e)+"&distinct_id="+p,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(t){var e,n=_.getUuid();_.isObject(t)||(popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",t),t={});try{e=JSON.parse(t.content)}catch(i){popup.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",t,i)}var p=popup.getPopupInfo(e);p.$sf_msg_id=n;var o={content:t.content,type:t.popup_type||"CUSTOMIZED"};Object.hasOwnProperty.call(t,"name")&&(o.name=t.name),_.isString(t.content)?"withoutCampaignListener"===popup.info.supportCustom||"withoutStart"===popup.info.supportCustom?(p.$sf_succeed=!1,p.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(p.$sf_succeed=!0,popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onStart(o)):(p.$sf_succeed=!1,p.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",popup.track.popupDisplay(p),popup.info.popup_campaign_listener.onFailed(o,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"))},error:function(t){popup.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",t)}})}},popup.setPara=function(t){_.isObject(t)||(t={}),popup.info=_.extend({},popup.defaultPara,t);var e=popup.sa;return e?(!0===e.para.encrypt_cookie&&(popup.info.encrypt_cookie=!0),_.isString(popup.info.api_base_url)&&"http"===popup.info.api_base_url.slice(0,4)?"http:"===popup.info.api_base_url.slice(0,5)&&"https:"===location.protocol?(popup.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1):(popup.info.api_base_url="/"===popup.info.api_base_url.slice(-1)?popup.info.api_base_url.slice(0,-1):popup.info.api_base_url,_.isString(e.para.server_url)&&"http"===e.para.server_url.slice(0,4)?(popup.info.project||(popup.info.project=_.URL(e.para.server_url).searchParams.get("project")||"default"),popup.info.supportCustom=!0,_.isObject(popup.info.popup_campaign_listener)?(_.isFunction(popup.info.popup_campaign_listener.shouldStart)||(popup.info.popup_campaign_listener.shouldStart=function(){return!0}),_.isFunction(popup.info.popup_campaign_listener.onStart)||(popup.info.supportCustom="withoutStart",popup.info.popup_campaign_listener.onStart=function(){}),_.isFunction(popup.info.popup_campaign_listener.onEnd)||(popup.info.popup_campaign_listener.onEnd=function(){}),_.isFunction(popup.info.popup_campaign_listener.onFailed)||(popup.info.popup_campaign_listener.onFailed=function(){}),_.isFunction(popup.info.popup_campaign_listener.onClick)||(popup.info.popup_campaign_listener.onClick=function(){})):(popup.info.supportCustom="withoutCampaignListener",popup.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0):(popup.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1)):(popup.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1)):(popup.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)},popup.init=function(){var t=window.sensorsDataAnalytic201505;if(popup.sa=t,t&&t.readyState&&t.readyState.state>=3||!t.on)initPopup.apply(this,arguments);else{var e=this,n=arguments;t&&t.on("sdkReady",function(){initPopup.apply(e,n)})}},window.SensorsDataWebJSSDKPlugin&&"[object Object]"===Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.WebPopup=window.SensorsDataWebJSSDKPlugin.WebPopup||popup:window.SensorsDataWebJSSDKPlugin={WebPopup:popup};export default popup; \ No newline at end of file diff --git a/dist/web/plugin/sf-sdk-web/webPopup.min.js b/dist/web/plugin/sf-sdk-web/webPopup.min.js index e56850e4..9b35bef9 100644 --- a/dist/web/plugin/sf-sdk-web/webPopup.min.js +++ b/dist/web/plugin/sf-sdk-web/webPopup.min.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():e()}(this,function(){"use strict";function t(t){var e="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",n=e.length-1,i={},a=0;for(a=0;a0&&(1===arguments.length&&o.isObject(arguments[0])?t=arguments[0]:arguments.length>=2&&o.isObject(arguments[1])&&(t=arguments[1])),!!this.setPara(t)&&(a.info.platform="WEB",!!a.setIsLoad()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial())))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.26.8",plugin_version:"1.26.8",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(t){var e={};if(t&&"[object Object]"===Object.prototype.toString.call(t)){for(var n in t)n&&"popup_window_content"!==n&&(e[n]=t[n]);return JSON.stringify(e,null," ")}return t},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-webpopupdata",loadedSign:"SensorsData2015JSSDKWebPopupIsLoad"};var o={visibility:function(t){t=t||{};var e={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:t.onVisible,_hidden:t.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){e._nativeSwitch.apply(e,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(t){}},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()}};e.init()},getRgba:function(t){return"object"!=typeof t?t:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},conversionNum:function(t){if(t){if(/^[0|1]?\.\d+$/.test(t))return 100*Number(t)+"%";var e=/^(-?\d+(\.\d+)?)px$/.exec(t);return e?(Number(e[1])/375*window.screen.width).toFixed(2)+"px":t}},boxModel:function(t){return function(e){if("object"!=typeof e)return t+":"+e+";";var n="";for(var i in e)n+=t+"-"+i+":"+o.conversionNum(e[i])+";";return n}},localStorage:{get:function(t){return window.localStorage.getItem(t)},parse:function(t){var e=null;try{e=JSON.parse(o.localStorage.get(t))||null}catch(n){}return e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",n="testIsSupportStorage";o.localStorage.set(e,n),o.localStorage.get(e)!==n&&(t=!1),o.localStorage.remove(e)}catch(i){t=!1}return t}},addEvent:function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}function e(e,n,i){var a=function(a){if(a=a||t(window.event)){a.target=a.srcElement;var o,r,s=!0;return"function"==typeof i&&(o=i(a)),r=n.call(e,a),!1!==o&&!1!==r||(s=!1),s}};return a}t._getPath=function(){var t=this,e=function(){try{var e=t.target,n=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,n.unshift(e);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||e()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,a){if(n&&n.addEventListener)n.addEventListener(i,function(e){e._getPath=t._getPath,a.call(this,e)},!1);else{var o="on"+i,r=n[o];n[o]=e(n,a,r)}};n.apply(null,arguments)},extend:function(t){var e=Array.prototype.slice;return o.each(e.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])}),t},extend2Lev:function(t){return o.each(Array.prototype.slice.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(o.isObject(e[n])&&o.isObject(t[n])?o.extend(t[n],e[n]):t[n]=e[n])}),t},each:function(t,e,n){var i=Object.prototype.hasOwnProperty,a=Array.prototype.forEach,o={};if(null==t)return!1;if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,s=t.length;r=200&&i.status<300||304==i.status?t.success(e(i.responseText)):t.error(e(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(t.type,t.url,!0);try{t.credentials&&(i.withCredentials=!0),o.isObject(t.header)&&o.each(t.header,function(t,e){i.setRequestHeader&&i.setRequestHeader(e,t)}),t.data&&(t.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===t.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(t.data||null)},getUuid:function(){var t=function(){for(var t=1*new Date,e=0;t==1*new Date;)e++;return t.toString(16)+e.toString(16)},e=function(){return Math.random().toString(16).replace(".","")};return function(){var n=t()+"-"+e()+"-"+e();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(t){var e=Object.prototype.hasOwnProperty;if(o.isObject(t)){for(var n in t)if(e.call(t,n))return!1;return!0}return!1},filter:function(t,e,n){var i=Object.prototype.hasOwnProperty;if(t.filter)return t.filter(e);for(var a=[],o=0;o=0;s--){var p=n[s];e[p]=r[p]}e.hostname&&"string"==typeof e.pathname&&0!==e.pathname.indexOf("/")&&(e.pathname="/"+e.pathname),e.searchParams=function(){var t=o.getURLSearchParams(e.search);return{get:function(e){return t[e]}}}()}return e},contentLoaded:function(t,e){var n=!1,i=!0,a=t.document,o=a.documentElement,r=a.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",u=r?"":"on",l=function(i){"readystatechange"==i.type&&"complete"!=a.readyState||(("load"==i.type?t:a)[p](u+i.type,l,!1),!n&&(n=!0)&&e.call(t,i.type||i))},c=function(){try{o.doScroll("left")}catch(t){return void setTimeout(c,50)}l("poll")};if("complete"==a.readyState)e.call(t,"lazy");else{if(!r&&o.doScroll){try{i=!t.frameElement}catch(_){}i&&c()}a[s](u+"DOMContentLoaded",l,!1),a[s](u+"readystatechange",l,!1),t[s](u+"load",l,!1)}},indexOf:function(t,e){var n=t.indexOf;if(n)return n.call(t,e);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(t){function e(t){o.each(t.subviews,function(t){var i=t.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===t.type&&(n.$sf_msg_image_url=i.image),t.subviews&&e(t)})}if(!o.isObject(t)||!o.isObject(t.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return e(t.template),n},a.getSFCampaign=function(t){t=o.isObject(t)?t:{};var e={planId:"",name:"",content:null,type:""};return e.planId=t.plan_id||"",e.name=t.cname||"",e.content=o.isObject(t.popup_window_content)?t.popup_window_content.content:"",e.type=o.isObject(t.popup_window_content)&&t.popup_window_content.popup_type?t.popup_window_content.popup_type:"PRESET",e},a.getImageList=function(t){if(!o.isArray(t))return!1;for(var e,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),a=new RegExp('http(s)?://.[^S^"]*'),r={},s=t.length,p=[],u=!1,l=0;l0&&(r[n[0]]||(r[n[0]]=1));return o.each(r,function(t,e){p.push(e)}),p},a.setIsLoad=function(){var t=window.self===window.top;if(t){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(e){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",e),!0}},a.handlerCampaign=function(t){var e=t,n=o.getUuid()(),i=e.plan.popup_window_content;if(!o.isObject(i))return e.popupFailed(1001,!1,{uuid:n,content:"",plan:e.plan}),!1;var r;if(i.content)try{r=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(e.plan),u={state:"",isCustom:!1},l=!0;try{l=a.info.popup_campaign_listener.shouldStart(p)}catch(s){l=!1,a.log(s)}var c={uuid:n,content:r,plan:e.plan};switch(e.plan.is_trigger?l?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":o.isString(i.content)?u.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":u.state="DIALOG_NOT_SHOW_JSON_FAILED":("PRESET"===i.popup_type&&a.log("\u6b64\u7248\u672csdk\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97"),u.state="DIALOG_NOT_SHOW_JSON_FAILED"):u.state="CAMPAIGN_NOT_START_LISTENER_START":u.state="CAMPAIGN_NOT_START_TRIGGER",u.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",u,"plan:",e.plan.cname),u.state){case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":e.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":e.popupFailed(1004,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":e.popupFailed(1006,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":e.popupFailed(1006,u.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":e.popupFailed(1001,u.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":e.popupFailed(1005,u.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(t){var e=t.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:t.$sf_msg_id};return o.isEmptyObject(e)||!o.isObject(e)?n:(n.$sf_plan_id=e.plan_id+"",n.$sf_plan_strategy_id=e.strategy_id?e.strategy_id:e.is_control_group?"-1":"0",e.audience_id&&(n.$sf_audience_id=e.audience_id+""),e.section_id&&(n.$sf_section_id=String(e.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(t){var e={$sf_msg_title:t.$sf_msg_title,$sf_msg_content:t.$sf_msg_content,$sf_msg_image_url:t.$sf_msg_image_url,$sf_succeed:t.$sf_succeed,$sf_fail_reason:t.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",e,t)},trackEvent:function(t,e,n){var i=a.track.getPublicProps(n);o.extend(e,i),o.each(e,function(t,n){""!==t&&void 0!==t||delete e[n]}),a.sa.track(t,e)},maskClick:function(t){if(!t.msg)return!1;var e={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:t.msg.$sf_msg_title,$sf_msg_content:t.msg.$sf_msg_content,$sf_msg_image_url:t.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:t.properties.maskActionId};this.trackEvent("$PlanPopupClick",e,t.msg),t.destory()},elementClickCallback:function(t,e){var n=t.target,i=n.getAttribute("data-action"),r=n.getAttribute("data-info"),s=e.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},u=p[0],l=JSON.parse(r)||{}}catch(t){a.log("elementClickCallback error",t)}var c={type:u.type,value:o.isString(u.value)?u.value:"",extra:o.isObject(u.value)?u.value:""},_=e.msg.plan?e.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:l.$sf_msg_element_type,$sf_msg_element_content:l.$sf_msg_element_content,$sf_msg_element_action:u.type,$sf_msg_action_id:u.id,$sf_close_type:"close"===u.type?u.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=e.msg.plan;if(f){var h={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(h)}}catch(t){a.log("popup_listener.onClick error",t)}if("close"===u.type)e.destory();else if(u.closeable?e.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===u.type){if("http"!==u.value.slice(0,4))return!1;window.location.href=u.value}}};var r=a.log;a.changeCovertStatus=function(t){var e=JSON.parse(JSON.stringify(a.convertPlans));o.each(e,function(e,n){if(!e.is_in_convert_window)return!1;var i=e.is_in_convert_window.step,s=e.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!t&&void o.each(t,function(t){t.popup_display_uuid===s&&t.convert_time&&(r("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(t){function e(){if(o.isEmptyObject(a.localData)||!o.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var t=JSON.parse(JSON.stringify(a.convertPlans)),i=t[0].is_in_convert_window&&t[0].is_in_convert_window.step||5e3,s=[];return o.each(t,function(t,e){if(!t.is_in_convert_window)return!1;var n=(new Date).getTime(),o=t.is_in_convert_window.expire_time;return n>o?(r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[e].plan_id),delete a.convertPlans[e].is_in_convert_window,a.convertPlans.splice(e,1),a.updateDataAndSetListen.updateLocalData(),!1):(s.push(t.is_in_convert_window.uuid),t.is_in_convert_window.step||(t.is_in_convert_window.step=5e3,a.convertPlans[e].is_in_convert_window.step=5e3),void(i>t.is_in_convert_window.step&&(i=t.is_in_convert_window.step)))}),!!s.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){o.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(s)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(t){a.changeCovertStatus(t),e()},error:function(){a.changeCovertStatus(),e()}})},i)))}var n=a.info.project,i=!1;return!(!t&&0===a.convertPlans.length)&&(t&&(o.each(a.convertPlans,function(e){e.plan_id===t.plan_id&&(i=!0)}),i||a.convertPlans.push(t)),void e())},a.ruleTime={getExpire:function(t,e){var n=e,i=Number(t.value)||0,a=Number(t.value)||0,o=String(t.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(a-1)},week:function(){r=new Date(n);var t=r.getDay();0===t&&(t=7);var e=7-t;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*e*60*60*1e3+7*(a-1)*24*60*60*1e3},month:function(){r=new Date(n);var t=r.getMonth(),e=t+a;return e>=11?(r.setFullYear(r.getFullYear()+parseInt(e/12)),r.setMonth(e%12)):r.setMonth(e),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(t){var e={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return r=new Date(n),t in e&&(a=e[t]*i),r.getTime()+a}};return t.natural!==!0?s.second(o):o in s?s[o]():void 0},getLast:function(t,e){var n=Number(t.value)||0,i=Number(t.value)-1||0,a=String(t.unit).toLowerCase(),o=null,r={day:function(){return o=new Date(e),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-864e5*i},week:function(){o=new Date(e);var t=o.getDay();return 0===t&&(t=7),--t,o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-(24*t*60*60*1e3+7*i*24*60*60*1e3)},month:function(){o=new Date(e);var t=o.getMonth()+1,n=t-i;return n<=0?(o.setFullYear(o.getFullYear()+(parseInt(n/12)-1)),o.setMonth(12+n%12-1)):o.setMonth(n-1),o.setDate(1),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o.getTime()},second:function(t){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return o=new Date(e),t in i&&(a=i[t]*n),o.getTime()-a}};return t.natural!==!0?r.second(a):a in r?r[a]():void 0},getArrMatchCount:function(t,e){var n=0;for(n=0;n=t[n])return n;return t.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!o.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;r("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var t=!1,e=a.localData.eventQueue[0],n=a.eventRule[e.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),o.isArray(n)&&o.isObject(n[0])&&n.length>0&&(r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),o.each(n,function(t){o.isObject(t)&&"undefined"!=typeof t.match_state&&delete t.match_state,new a.RuleCheck(t,e)}),o.each(n,function(e){e.match_state===!0?t===!1?(t=!0,r("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",e.plan.cname),new a.PopupCheck(e,(!0))):t===!0&&(r("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",e.plan.cname),new a.PopupCheck(e,(!1))):r("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",e.plan.cname)}),t||a.completeWindowLifecycle(),r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(t,e){this.plan=t.plan,this.current_time=(new Date).getTime(),e?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(t,e){this.startConvertWindow(t),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),e&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(t,e,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},r=i[t],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=r,a.track.popupDisplay(s),!e&&a.info.popup_listener&&o.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,t,r),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),t,r),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(t){var e=a.getSFCampaign(t.plan),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(e),this.createPopupWindow(t.uuid,!0)},a.PopupCheck.prototype.showPopup=function(t){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var e=new a.ElementRender(t.content),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,o.extend(e.msg,n),e.popupCheckInstance=this,a.track.popupDisplay(n);var i=e.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(t.plan)),this.createPopupWindow(t.uuid),void a.info.popup_listener.onLoadSuccess(t.plan.plan_id)):(r("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(t){r("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),o.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:t},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(t){o.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,t))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var t=(new Date).getTime();this.startPopupIntervalWindow(t),this.resetGlobalLimit(t),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){r("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),o.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(o.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:a.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},a.PopupCheck.prototype.setGlobalLimit=function(){r("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),o.isArray(a.localData.global_popup_count)||(a.localData.global_popup_count=[]),a.localData.global_popup_count.unshift(this.current_time);for(var t=a.localData.global_popup_count,e=t[t.length-1];e+7776e63e3;)t.pop(),e=t[t.length-1]},a.PopupCheck.prototype.resetGlobalLimit=function(t){o.isArray(a.localData.global_popup_count)&&a.localData.global_popup_count.length>0&&(a.localData.global_popup_count.shift(),a.localData.global_popup_count.unshift(t))},a.PopupCheck.prototype.deletePlanAllWindow=function(){var t=this.plan.pattern_popup.matcher_list;o.isArray(t)&&o.each(t,function(t){t.is_in_window&&(r("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete t.is_in_window)})},a.RuleCheck=function(t,e){this.plan_match=t,this.plan=t.plan,this.rule_arr=t.rule,this.event_data=e,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";o.each(this.rule_arr,function(t){n+="--\u5305\u542b\u89c4\u5219-("+t.event_name+"\uff09-\u89e6\u53d1"+t.params[0]+"\u6b21"}),r(n),r(this.plan),this.checkPlanIsExpire(),a.updateDataAndSetListen.updateLocalData()},a.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||o.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)r("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(o.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var t=0;t=1){var e=a.ruleTime.getLast(a.localData.popup_interval_global,this.current_time);e>t[0]?(r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+e+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0]),this.checkPopupInterval()):r("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+e+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0])}else r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},a.RuleCheck.prototype.checkPopupInterval=function(){var t=!0;o.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null):(r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"),t=!1):(r("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null),t&&this.checkPermission()&&this.checkProperties()},a.RuleCheck.prototype.isMatched=function(t){var e={equal:function(t,e){if(!o.isNumber(t)&&!o.isString(t))return!1;for(var n=0,i=e.length;n=0},notContain:function(t,e){return!!o.isString(t)&&t.indexOf(e[0])===-1},isTrue:function(t){return t===!0},isFalse:function(t){return t===!1},isSet:function(t){return"undefined"!=typeof t},notSet:function(t){return"undefined"==typeof t},isEmpty:function(t){if(!o.isString(t)&&!o.isArray(t))return!1;if(o.isString(t))return""===t;for(var e=0;eo.getConvertNumberValue(e[0]))},between:function(t,e){if(!o.isNumber(t))return!1;if("undefined"==typeof e[0]&&"undefined"==typeof e[1])return!1;var n=o.getConvertNumberValue(t),i=o.getConvertNumberValue(e[0]),a=o.getConvertNumberValue(e[1]);return n>=i&&n<=a},isIn:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=n&&a<=i}catch(o){r("absolute_between Error",o)}},absoluteBetween:function(t,e){try{var n=new Date(e[0]),i=new Date(e[1]),a=new Date(t);return a>=n&&a<=i}catch(o){r("absolute_between Error",o)}}},n=this,i=t.relation,a="or"===String(i).toLowerCase(),s="and"===String(i).toLowerCase(),p=!!s,u=!0;return o.each(t.conditions,function(t){if(!u)return!1;if(!t.field)return!1;var i=t.field.lastIndexOf("."),o=t.params,r="in"===t["function"]?"isIn":t["function"];if(!e[r])return p=!1,u=!1,!1;if(i<0)return!1;var l=t.field.slice(i+1),c=n.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=e[r](_,o);a&&d&&(p=!0,u=!1),s&&!d&&(p=!1,u=!1)}),p},a.RuleCheck.prototype.checkProperties=function(){var t=this,e=o.filter(this.rule_arr,function(e){var n=e.multi_filter?e.multi_filter:e.filter;return!(n&&(!n.conditions||0!==n.conditions.length))||t.isMatched(n)});o.isArray(e)&&e.length>0?(this.checkWindowAndMatch(e),r("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",e)):r("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},a.RuleCheck.prototype.checkPermission=function(){function t(e){o.each(e,function(e){if(r=s([e]),o.isArray(r)&&r.length>0){var n=e.filters||[];n&&n.length>0&&t(n)}})}var e=this.plan.event_permission;if(!o.isObject(e)||o.isEmptyObject(e))return!0;var n=[e],i=this,r=[],s=function(t){var e=o.filter(t,function(t){return!(t&&t.conditions&&(!t.conditions||0!==t.conditions.length))||i.isMatched(t)});return e};return t(n),o.isArray(r)&&r.length>0?(a.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",r),!0):(a.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3"),!1)},a.RuleCheck.prototype.checkWindowAndMatch=function(t){var e=this,n=[];o.each(t,function(t){if(!t.params||!t.params[0])return r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var i=Number(t.params[0]);1===i?n.push(t):i>1&&o.isObject(t.window)&&t.window.value>0&&(!o.isObject(t.is_in_window)||!o.isNumber(t.is_in_window.expire_time)||t.is_in_window.expire_time0&&(1===arguments.length&&o.isObject(arguments[0])?t=arguments[0]:arguments.length>=2&&o.isObject(arguments[1])&&(t=arguments[1])),!!this.setPara(t)&&(a.info.platform="WEB",!!a.setIsLoad()&&void(a.testSend.hasParam()?a.testSend.start():(a.listenPageStateChange(),a.updateDataAndSetListen.initial())))}var a={sa:{},info:{},plugin_name:"WebPopup",lib_version:"1.26.9",plugin_version:"1.26.9",defaultPara:{platform:"H5",preload_image:!0,encrypt_cookie:!1},serverData:{},localData:{global_popup_count:[],local_update_time:null,eventQueue:[],update_time:null},eventRule:{},convertPlans:[],isRun:!1,setArg:function(t){var e={};if(t&&"[object Object]"===Object.prototype.toString.call(t)){for(var n in t)n&&"popup_window_content"!==n&&(e[n]=t[n]);return JSON.stringify(e,null," ")}return t},log:function(){if(a.info.show_log===!0&&"object"==typeof console&&"function"==typeof console.log)try{return arguments[0]=a.setArg(arguments[0]),arguments[1]=a.setArg(arguments[1]),console.log.apply(console,arguments)}catch(t){console.log(arguments[0])}}};a.config={storageName:"sensorsdata202002-webpopupdata",loadedSign:"SensorsData2015JSSDKWebPopupIsLoad"};var o={visibility:function(t){t=t||{};var e={hidden:void 0,visibilityChange:void 0,isSupported:function(){return"undefined"!=typeof this.hidden},_visible:t.onVisible,_hidden:t.onHidden,_nativeSwitch:function(){document[this.hidden]===!0?this._hidden():this._visible()},listen:function(){try{this.isSupported()?document.addEventListener(this.visibilityChange,function(){e._nativeSwitch.apply(e,arguments)},1):document.addEventListener?(window.addEventListener("focus",this._visible,1),window.addEventListener("blur",this._hidden,1)):(document.attachEvent("onfocusin",this._visible),document.attachEvent("onfocusout",this._hidden))}catch(t){}},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()}};e.init()},getRgba:function(t){return"object"!=typeof t?t:"rgba("+t.r+","+t.g+","+t.b+","+t.a+")"},conversionNum:function(t){if(t){if(/^[0|1]?\.\d+$/.test(t))return 100*Number(t)+"%";var e=/^(-?\d+(\.\d+)?)px$/.exec(t);return e?(Number(e[1])/375*window.screen.width).toFixed(2)+"px":t}},boxModel:function(t){return function(e){if("object"!=typeof e)return t+":"+e+";";var n="";for(var i in e)n+=t+"-"+i+":"+o.conversionNum(e[i])+";";return n}},localStorage:{get:function(t){return window.localStorage.getItem(t)},parse:function(t){var e=null;try{e=JSON.parse(o.localStorage.get(t))||null}catch(n){}return e},set:function(t,e){window.localStorage.setItem(t,e)},remove:function(t){window.localStorage.removeItem(t)},isSupport:function(){var t=!0;try{var e="__sensorsdatasupport__",n="testIsSupportStorage";o.localStorage.set(e,n),o.localStorage.get(e)!==n&&(t=!1),o.localStorage.remove(e)}catch(i){t=!1}return t}},addEvent:function(){function t(e){return e&&(e.preventDefault=t.preventDefault,e.stopPropagation=t.stopPropagation,e._getPath=t._getPath),e}function e(e,n,i){var a=function(a){if(a=a||t(window.event)){a.target=a.srcElement;var o,r,s=!0;return"function"==typeof i&&(o=i(a)),r=n.call(e,a),!1!==o&&!1!==r||(s=!1),s}};return a}t._getPath=function(){var t=this,e=function(){try{var e=t.target,n=[e];if(null===e||null===e.parentElement)return[];for(;null!==e.parentElement;)e=e.parentElement,n.unshift(e);return n}catch(i){return[]}};return this.path||this.composedPath&&this.composedPath()||e()},t.preventDefault=function(){this.returnValue=!1},t.stopPropagation=function(){this.cancelBubble=!0};var n=function(n,i,a){if(n&&n.addEventListener)n.addEventListener(i,function(e){e._getPath=t._getPath,a.call(this,e)},!1);else{var o="on"+i,r=n[o];n[o]=e(n,a,r)}};n.apply(null,arguments)},extend:function(t){var e=Array.prototype.slice;return o.each(e.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(t[n]=e[n])}),t},extend2Lev:function(t){return o.each(Array.prototype.slice.call(arguments,1),function(e){for(var n in e)void 0!==e[n]&&(o.isObject(e[n])&&o.isObject(t[n])?o.extend(t[n],e[n]):t[n]=e[n])}),t},each:function(t,e,n){var i=Object.prototype.hasOwnProperty,a=Array.prototype.forEach,o={};if(null==t)return!1;if(a&&t.forEach===a)t.forEach(e,n);else if(t.length===+t.length){for(var r=0,s=t.length;r=200&&i.status<300||304==i.status?t.success(e(i.responseText)):t.error(e(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(n){i.onreadystatechange=null,i.onload=null}},i.open(t.type,t.url,!0);try{t.credentials&&(i.withCredentials=!0),o.isObject(t.header)&&o.each(t.header,function(t,e){i.setRequestHeader&&i.setRequestHeader(e,t)}),t.data&&(t.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===t.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(p){sd.log(p)}i.send(t.data||null)},getUuid:function(){var t=function(){for(var t=1*new Date,e=0;t==1*new Date;)e++;return t.toString(16)+e.toString(16)},e=function(){return Math.random().toString(16).replace(".","")};return function(){var n=t()+"-"+e()+"-"+e();return n?n:(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}},trim:function(t){return t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},isEmptyObject:function(t){var e=Object.prototype.hasOwnProperty;if(o.isObject(t)){for(var n in t)if(e.call(t,n))return!1;return!0}return!1},filter:function(t,e,n){var i=Object.prototype.hasOwnProperty;if(t.filter)return t.filter(e);for(var a=[],o=0;o=0;s--){var p=n[s];e[p]=r[p]}e.hostname&&"string"==typeof e.pathname&&0!==e.pathname.indexOf("/")&&(e.pathname="/"+e.pathname),e.searchParams=function(){var t=o.getURLSearchParams(e.search);return{get:function(e){return t[e]}}}()}return e},contentLoaded:function(t,e){var n=!1,i=!0,a=t.document,o=a.documentElement,r=a.addEventListener,s=r?"addEventListener":"attachEvent",p=r?"removeEventListener":"detachEvent",u=r?"":"on",l=function(i){"readystatechange"==i.type&&"complete"!=a.readyState||(("load"==i.type?t:a)[p](u+i.type,l,!1),!n&&(n=!0)&&e.call(t,i.type||i))},c=function(){try{o.doScroll("left")}catch(t){return void setTimeout(c,50)}l("poll")};if("complete"==a.readyState)e.call(t,"lazy");else{if(!r&&o.doScroll){try{i=!t.frameElement}catch(_){}i&&c()}a[s](u+"DOMContentLoaded",l,!1),a[s](u+"readystatechange",l,!1),t[s](u+"load",l,!1)}},indexOf:function(t,e){var n=t.indexOf;if(n)return n.call(t,e);for(var i=0;i=3)&&window.sensorsDataAnalytic201505},a.getPopupInfo=function(t){function e(t){o.each(t.subviews,function(t){var i=t.properties||{};"title"===i.msgType?n.$sf_msg_title=i.text:"content"===i.msgType?n.$sf_msg_content=i.text:"image"===t.type&&(n.$sf_msg_image_url=i.image),t.subviews&&e(t)})}if(!o.isObject(t)||!o.isObject(t.template))return{};var n={$sf_msg_title:"",$sf_msg_content:"",$sf_msg_image_url:""};return e(t.template),n},a.getSFCampaign=function(t){t=o.isObject(t)?t:{};var e={planId:"",name:"",content:null,type:""};return e.planId=t.plan_id||"",e.name=t.cname||"",e.content=o.isObject(t.popup_window_content)?t.popup_window_content.content:"",e.type=o.isObject(t.popup_window_content)&&t.popup_window_content.popup_type?t.popup_window_content.popup_type:"PRESET",e},a.getImageList=function(t){if(!o.isArray(t))return!1;for(var e,n,i=new RegExp('("(backgroundImage|image)":"(http(s)?://.[^"]*)")',"g"),a=new RegExp('http(s)?://.[^S^"]*'),r={},s=t.length,p=[],u=!1,l=0;l0&&(r[n[0]]||(r[n[0]]=1));return o.each(r,function(t,e){p.push(e)}),p},a.setIsLoad=function(){var t=window.self===window.top;if(t){if(window[a.config.loadedSign])return!1;if("undefined"==typeof window[a.config.loadedSign])return window[a.config.loadedSign]=!0,!0}else try{return!window.top[a.config.loadedSign]&&(window.top[a.config.loadedSign]=!0,!0)}catch(e){return a.log("\u975e\u540c\u57df\u540diframe\u5185\u5d4c\u4e0d\u80fd\u83b7\u53d6\u7236\u7ea7\u7a97\u4f53\u5185\u5bb9",e),!0}},a.handlerCampaign=function(t){var e=t,n=o.getUuid()(),i=e.plan.popup_window_content;if(!o.isObject(i))return e.popupFailed(1001,!1,{uuid:n,content:"",plan:e.plan}),!1;var r;if(i.content)try{r=JSON.parse(i.content)}catch(s){a.log(s)}var p=a.getSFCampaign(e.plan),u={state:"",isCustom:!1},l=!0;try{l=a.info.popup_campaign_listener.shouldStart(p)}catch(s){l=!1,a.log(s)}var c={uuid:n,content:r,plan:e.plan};switch(e.plan.is_trigger?l?"CUSTOMIZED"===i.popup_type?"withoutCampaignListener"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_NULL_LISTENER":"withoutStart"===a.info.supportCustom?u.state="CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":o.isString(i.content)?u.state="CAMPAIGN_TRIGGER_CUSTOMIZED_START":u.state="DIALOG_NOT_SHOW_JSON_FAILED":("PRESET"===i.popup_type&&a.log("\u6b64\u7248\u672csdk\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97"),u.state="DIALOG_NOT_SHOW_JSON_FAILED"):u.state="CAMPAIGN_NOT_START_LISTENER_START":u.state="CAMPAIGN_NOT_START_TRIGGER",u.isCustom=!(!i.popup_type||"CUSTOMIZED"!==i.popup_type),a.log("campaign:",u,"plan:",e.plan.cname),u.state){case"CAMPAIGN_TRIGGER_CUSTOMIZED_START":e.customCampaign(c);break;case"CAMPAIGN_NOT_START_LISTENER_START":e.popupFailed(1004,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_NULL_LISTENER":e.popupFailed(1006,u.isCustom,c);break;case"CAMPAIGN_CUSTOMIZED_LISTENER_NULL_START":e.popupFailed(1006,u.isCustom,c);break;case"DIALOG_NOT_SHOW_JSON_FAILED":e.popupFailed(1001,u.isCustom,c);break;case"CAMPAIGN_NOT_START_TRIGGER":e.popupFailed(1005,u.isCustom,c);break;default:a.log("CampaignState\u5f02\u5e38")}},a.track={getPublicProps:function(t){var e=t.plan,n={$sf_lib_version:a.lib_version,$sf_plan_type:"\u8fd0\u8425\u8ba1\u5212",$sf_channel_service_name:"SENSORS_FOCUS",$sf_channel_category:"POPUP",$sf_platform_tag:a.info.platform,$sf_msg_id:t.$sf_msg_id};return o.isEmptyObject(e)||!o.isObject(e)?n:(n.$sf_plan_id=e.plan_id+"",n.$sf_plan_strategy_id=e.strategy_id?e.strategy_id:e.is_control_group?"-1":"0",e.audience_id&&(n.$sf_audience_id=e.audience_id+""),e.section_id&&(n.$sf_section_id=String(e.section_id),n.$sf_plan_type="\u65b0\u8d44\u6e90\u4f4d"),n)},popupDisplay:function(t){var e={$sf_msg_title:t.$sf_msg_title,$sf_msg_content:t.$sf_msg_content,$sf_msg_image_url:t.$sf_msg_image_url,$sf_succeed:t.$sf_succeed,$sf_fail_reason:t.$sf_fail_reason};this.trackEvent("$PlanPopupDisplay",e,t)},trackEvent:function(t,e,n){var i=a.track.getPublicProps(n);o.extend(e,i),o.each(e,function(t,n){""!==t&&void 0!==t||delete e[n]}),a.sa.track(t,e)},maskClick:function(t){if(!t.msg)return!1;var e={$sf_close_type:"POPUP_CLOSE_MASK",$sf_msg_title:t.msg.$sf_msg_title,$sf_msg_content:t.msg.$sf_msg_content,$sf_msg_image_url:t.msg.$sf_msg_image_url,$sf_msg_element_type:"mask",$sf_msg_action_id:t.properties.maskActionId};this.trackEvent("$PlanPopupClick",e,t.msg),t.destory()},elementClickCallback:function(t,e){var n=t.target,i=n.getAttribute("data-action"),r=n.getAttribute("data-info"),s=e.msg||{};if(!i)return!1;try{var p=JSON.parse(i)||{},u=p[0],l=JSON.parse(r)||{}}catch(t){a.log("elementClickCallback error",t)}var c={type:u.type,value:o.isString(u.value)?u.value:"",extra:o.isObject(u.value)?u.value:""},_=e.msg.plan?e.msg.plan.plan_id:"",d={$sf_msg_title:s.$sf_msg_title,$sf_msg_content:s.$sf_msg_content,$sf_msg_image_url:s.$sf_msg_image_url,$sf_msg_element_type:l.$sf_msg_element_type,$sf_msg_element_content:l.$sf_msg_element_content,$sf_msg_element_action:u.type,$sf_msg_action_id:u.id,$sf_close_type:"close"===u.type?u.$sf_close_type:""};this.trackEvent("$PlanPopupClick",d,s);try{a.info.popup_listener.onClick(_,c);var f=e.msg.plan;if(f){var h={name:f.cname,plan_id:f.plan_id,content:f.popup_window_content?f.popup_window_content.content:"",type:f.popup_window_content?f.popup_window_content.popup_type:"",action:c};a.info.popup_campaign_listener.onClick(h)}}catch(t){a.log("popup_listener.onClick error",t)}if("close"===u.type)e.destory();else if(u.closeable?e.destory():null,"auto"===a.info.popup_listener.openlink&&"openlink"===u.type){if("http"!==u.value.slice(0,4))return!1;window.location.href=u.value}}};var r=a.log;a.changeCovertStatus=function(t){var e=JSON.parse(JSON.stringify(a.convertPlans));o.each(e,function(e,n){if(!e.is_in_convert_window)return!1;var i=e.is_in_convert_window.step,s=e.is_in_convert_window.uuid;return a.convertPlans[n].is_in_convert_window.step=Math.min(2*i,6e5),!!t&&void o.each(t,function(t){t.popup_display_uuid===s&&t.convert_time&&(r("--\u8f6c\u5316\u7a97\u53e3- \u76ee\u6807\u4e8b\u4ef6\u5df2\u7ecf\u5b8c\u6210 - \u6ee1\u8db3",a.convertPlans[n].plan_id),delete a.convertPlans[n].is_in_convert_window,a.convertPlans.splice(n,1))})}),a.updateDataAndSetListen.updateLocalData()},a.asyncConvert=function(t){function e(){if(o.isEmptyObject(a.localData)||!o.isArray(a.convertPlans)||0===a.convertPlans.length)return!1;var t=JSON.parse(JSON.stringify(a.convertPlans)),i=t[0].is_in_convert_window&&t[0].is_in_convert_window.step||5e3,s=[];return o.each(t,function(t,e){if(!t.is_in_convert_window)return!1;var n=(new Date).getTime(),o=t.is_in_convert_window.expire_time;return n>o?(r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",a.convertPlans[e].plan_id),delete a.convertPlans[e].is_in_convert_window,a.convertPlans.splice(e,1),a.updateDataAndSetListen.updateLocalData(),!1):(s.push(t.is_in_convert_window.uuid),t.is_in_convert_window.step||(t.is_in_convert_window.step=5e3,a.convertPlans[e].is_in_convert_window.step=5e3),void(i>t.is_in_convert_window.step&&(i=t.is_in_convert_window.step)))}),!!s.length&&(a.asyncConvert.timer&&clearTimeout(a.asyncConvert.timer),void(a.asyncConvert.timer=setTimeout(function(){o.ajax({url:a.info.api_base_url+"/sfo/popup_displays?project="+encodeURIComponent(n)+"&popup_display_uuids="+encodeURIComponent(s)+"&time="+(new Date).getTime(),type:"GET",cors:!0,credentials:!1,contentType:"application/json",success:function(t){a.changeCovertStatus(t),e()},error:function(){a.changeCovertStatus(),e()}})},i)))}var n=a.info.project,i=!1;return!(!t&&0===a.convertPlans.length)&&(t&&(o.each(a.convertPlans,function(e){e.plan_id===t.plan_id&&(i=!0)}),i||a.convertPlans.push(t)),void e())},a.ruleTime={getExpire:function(t,e){var n=e,i=Number(t.value)||0,a=Number(t.value)||0,o=String(t.unit).toLowerCase(),r=null,s={day:function(){return r=new Date(n),r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+864e5*(a-1)},week:function(){r=new Date(n);var t=r.getDay();0===t&&(t=7);var e=7-t;return r.setHours(23),r.setMinutes(59),r.setSeconds(59),r.setMilliseconds(999),r=r.getTime()+24*e*60*60*1e3+7*(a-1)*24*60*60*1e3},month:function(){r=new Date(n);var t=r.getMonth(),e=t+a;return e>=11?(r.setFullYear(r.getFullYear()+parseInt(e/12)),r.setMonth(e%12)):r.setMonth(e),r.setDate(1),r.setHours(0),r.setMinutes(0),r.setSeconds(0),r.setMilliseconds(0),r.getTime()},second:function(t){var e={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return r=new Date(n),t in e&&(a=e[t]*i),r.getTime()+a}};return t.natural!==!0?s.second(o):o in s?s[o]():void 0},getLast:function(t,e){var n=Number(t.value)||0,i=Number(t.value)-1||0,a=String(t.unit).toLowerCase(),o=null,r={day:function(){return o=new Date(e),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-864e5*i},week:function(){o=new Date(e);var t=o.getDay();return 0===t&&(t=7),--t,o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o=o.getTime()-(24*t*60*60*1e3+7*i*24*60*60*1e3)},month:function(){o=new Date(e);var t=o.getMonth()+1,n=t-i;return n<=0?(o.setFullYear(o.getFullYear()+(parseInt(n/12)-1)),o.setMonth(12+n%12-1)):o.setMonth(n-1),o.setDate(1),o.setHours(0),o.setMinutes(0),o.setSeconds(0),o.setMilliseconds(0),o.getTime()},second:function(t){var i={month:2592e6,week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3},a=null;return o=new Date(e),t in i&&(a=i[t]*n),o.getTime()-a}};return t.natural!==!0?r.second(a):a in r?r[a]():void 0},getArrMatchCount:function(t,e){var n=0;for(n=0;n=t[n])return n;return t.length}},a.eventTriggerProcess=function(){if(!a.updateDataAndSetListen.active_state)return!1;if(!o.isArray(a.localData.eventQueue))return!1;if(0===a.localData.eventQueue.length)return!1;if(a.isRun)return!1;r("\u4e8b\u4ef6\u961f\u5217---eventQueue",a.localData.eventQueue);var t=!1,e=a.localData.eventQueue[0],n=a.eventRule[e.event];a.isRun=!0,a.localData.eventQueue.shift(),a.updateDataAndSetListen.updateLocalData(),o.isArray(n)&&o.isObject(n[0])&&n.length>0&&(r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u5f00\u59cb--------------------"),o.each(n,function(t){o.isObject(t)&&"undefined"!=typeof t.match_state&&delete t.match_state,new a.RuleCheck(t,e)}),o.each(n,function(e){e.match_state===!0?t===!1?(t=!0,r("\u68c0\u67e5\u5b8c\u6bd5-\u4f18\u5148\u5f39\u7a97-\u5f00\u59cb",e.plan.cname),new a.PopupCheck(e,(!0))):t===!0&&(r("\u68c0\u67e5\u5b8c\u6bd5-\u975e\u4f18\u5148\u5f39\u7a97-\u4e0d\u6e32\u67d3",e.plan.cname),new a.PopupCheck(e,(!1))):r("\u68c0\u67e5\u5b8c\u6bd5-\u8ba1\u5212-\u4e0d\u6ee1\u8db3",e.plan.cname)}),t||a.completeWindowLifecycle(),r("--------------------\u89e6\u53d1\u4e8b\u4ef6\u7ed3\u675f--------------------"))},a.completeWindowLifecycle=function(){a.isRun=!1,a.eventTriggerProcess()},a.PopupCheck=function(t,e){this.plan=t.plan,this.current_time=(new Date).getTime(),e?this.renderPopup():this.hidePopup(),a.updateDataAndSetListen.updateLocalData()},a.PopupCheck.prototype.createPopupWindow=function(t,e){this.startConvertWindow(t),this.startPopupIntervalWindow(this.current_time),this.startPopupLimitWindow(),this.setGlobalLimit(),this.deletePlanAllWindow(),e&&a.completeWindowLifecycle()},a.PopupCheck.prototype.hidePopup=function(){this.deletePlanAllWindow()},a.PopupCheck.prototype.renderPopup=function(){a.handlerCampaign(this)},a.PopupCheck.prototype.popupFailed=function(t,e,n){var i={1001:"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",1003:"\u5bf9\u7167\u7ec4",1004:"campaignShouldStart \u63a5\u53e3\u8fd4\u56de false",1005:"\u8ba1\u5212\u4e0b\u53d1 is_trigger \u4e3a false",1006:"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03"},r=i[t],s=a.getPopupInfo(n.content);s.$sf_msg_id=n.uuid,s.plan=n.plan,s.$sf_succeed=!1,s.$sf_fail_reason=r,a.track.popupDisplay(s),!e&&a.info.popup_listener&&o.isFunction(a.info.popup_listener.onLoadFailed)&&a.info.popup_listener.onLoadFailed(n.plan.plan_id,t,r),a.info.popup_campaign_listener.onFailed(a.getSFCampaign(n.plan),t,r),this.createPopupWindow(n.uuid,!0)},a.PopupCheck.prototype.customCampaign=function(t){var e=a.getSFCampaign(t.plan),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,a.track.popupDisplay(n),a.info.popup_campaign_listener.onStart(e),this.createPopupWindow(t.uuid,!0)},a.PopupCheck.prototype.showPopup=function(t){if(!a.ElementRender)return a.log("\u6682\u4e0d\u652f\u6301\u9884\u7f6e\u5f39\u7a97UI"),!1;var e=new a.ElementRender(t.content),n=a.getPopupInfo(t.content);n.$sf_msg_id=t.uuid,n.plan=t.plan,n.$sf_succeed=!0,o.extend(e.msg,n),e.popupCheckInstance=this,a.track.popupDisplay(n);var i=e.render();return i?(a.info.popup_campaign_listener.onStart(a.getSFCampaign(t.plan)),this.createPopupWindow(t.uuid),void a.info.popup_listener.onLoadSuccess(t.plan.plan_id)):(r("\u5f53\u524d\u9875\u9762\u5df2\u6709\u4e00\u4e2a\u5f39\u6846\u6b63\u5728\u6e32\u67d3\uff0c\u672c\u6b21\u5f39\u6846\u4e0d\u6e32\u67d3\uff01"),!1)},a.PopupCheck.prototype.startConvertWindow=function(t){r("--\u5f39\u7a97\u5c55\u793a-\u8f6c\u5316\u7a97\u53e3\u8bbe\u7f6e",this.plan.cname),o.isObject(this.plan.convert_window)&&this.plan.convert_window.value&&(this.plan.is_in_convert_window={expire_time:a.ruleTime.getExpire(this.plan.convert_window,this.current_time),start_time:this.current_time,uuid:t},a.asyncConvert(this.plan))},a.PopupCheck.prototype.startPopupIntervalWindow=function(t){o.isObject(this.plan.popup_interval)&&this.plan.popup_interval.value&&(this.plan.is_in_popup_interval_window=a.ruleTime.getExpire(this.plan.popup_interval,t))},a.PopupCheck.prototype.resetPopupIntervalWindow=function(){var t=(new Date).getTime();this.startPopupIntervalWindow(t),this.resetGlobalLimit(t),a.completeWindowLifecycle()},a.PopupCheck.prototype.startPopupLimitWindow=function(){r("--\u5f39\u7a97\u5c55\u793a-\u53c2\u4e0e\u9650\u5236\u7a97\u53e3\u8bbe\u7f6e\u91cd\u7f6e"),o.isObject(this.plan.re_enter)&&this.plan.re_enter.value&&(o.isObject(this.plan.is_in_popup_limit_window)?this.plan.is_in_popup_limit_window.count++:this.plan.is_in_popup_limit_window={expire_time:a.ruleTime.getExpire(this.plan.re_enter,this.current_time),count:1})},a.PopupCheck.prototype.setGlobalLimit=function(){r("--\u5f39\u7a97\u5c55\u793a-\u5168\u5c40\u5f39\u7a97\u6b21\u6570\u8bbe\u7f6e"),o.isArray(a.localData.global_popup_count)||(a.localData.global_popup_count=[]),a.localData.global_popup_count.unshift(this.current_time);for(var t=a.localData.global_popup_count,e=t[t.length-1];e+7776e63e3;)t.pop(),e=t[t.length-1]},a.PopupCheck.prototype.resetGlobalLimit=function(t){o.isArray(a.localData.global_popup_count)&&a.localData.global_popup_count.length>0&&(a.localData.global_popup_count.shift(),a.localData.global_popup_count.unshift(t))},a.PopupCheck.prototype.deletePlanAllWindow=function(){var t=this.plan.pattern_popup.matcher_list;o.isArray(t)&&o.each(t,function(t){t.is_in_window&&(r("--\u5f39\u7a97\u5c55\u793a-\u91cd\u7f6e\u5404\u4e2a\u89c4\u5219\u7684\u7a97\u53e3\u8ba1\u7b97-\u6210\u529f"),delete t.is_in_window)})},a.RuleCheck=function(t,e){this.plan_match=t,this.plan=t.plan,this.rule_arr=t.rule,this.event_data=e,this.current_time=(new Date).getTime();var n="-------------\u68c0\u67e5-\u8ba1\u5212-("+this.plan.cname+")";o.each(this.rule_arr,function(t){n+="--\u5305\u542b\u89c4\u5219-("+t.event_name+"\uff09-\u89e6\u53d1"+t.params[0]+"\u6b21"}),r(n),r(this.plan),this.checkPlanIsExpire(),a.updateDataAndSetListen.updateLocalData()},a.RuleCheck.prototype.checkPlanIsExpire=function(){!this.plan.expire_at||o.isNumber(this.plan.expire_at)&&this.current_timethis.current_time)r("--\u5b58\u5728\u8f6c\u5316\u7a97\u53e3 - \u4e0d\u6ee1\u8db3",this.plan.is_in_convert_window);else if(o.isObject(this.plan.is_in_convert_window)&&this.current_time>this.plan.is_in_convert_window.expire_time){r("--\u8f6c\u5316\u7a97\u53e3\u8d85\u65f6\u5df2\u7ecf\u8fc7\u671f - \u6ee1\u8db3",this.plan.plan_id),delete this.plan.is_in_convert_window;for(var t=0;t=1){var e=a.ruleTime.getLast(a.localData.popup_interval_global,this.current_time);e>t[0]?(r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3-"+e+">\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0]),this.checkPopupInterval()):r("\u68c0\u67e5-\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3-"+e+"<\u4e0a\u6b21\u5f39\u7a97\u65f6\u95f4"+t[0])}else r("--\u5168\u5c40\u5f39\u7a97\u95f4\u9694-\u6ca1\u6709\u5f39\u8fc7\u7a97-\u6ee1\u8db3"),this.checkPopupInterval()},a.RuleCheck.prototype.checkPopupInterval=function(){var t=!0;o.isNumber(this.plan.is_in_popup_interval_window)?this.current_time>this.plan.is_in_popup_interval_window?(r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5927\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u6ee1\u8db3"),this.plan.is_in_popup_interval_window=null):(r("--\u5f39\u7a97\u95f4\u9694-\u5f53\u524d\u65f6\u95f4\u5c0f\u4e8e\u56fa\u5b9a\u5f39\u7a97\u95f4\u9694-\u4e0d\u6ee1\u8db3"),t=!1):(r("--\u5f39\u7a97\u95f4\u9694-\u7a97\u53e3\u4e0d\u5b58\u5728-\u65b0\u5f00"),this.plan.is_in_popup_interval_window=null),t&&this.checkPermission()&&this.checkProperties()},a.RuleCheck.prototype.isMatched=function(t){var e={equal:function(t,e){if(!o.isNumber(t)&&!o.isString(t))return!1;for(var n=0,i=e.length;n=0},notContain:function(t,e){return!!o.isString(t)&&t.indexOf(e[0])===-1},isTrue:function(t){return t===!0},isFalse:function(t){return t===!1},isSet:function(t){return"undefined"!=typeof t},notSet:function(t){return"undefined"==typeof t},isEmpty:function(t){if(!o.isString(t)&&!o.isArray(t))return!1;if(o.isString(t))return""===t;for(var e=0;eo.getConvertNumberValue(e[0]))},between:function(t,e){if(!o.isNumber(t))return!1;if("undefined"==typeof e[0]&&"undefined"==typeof e[1])return!1;var n=o.getConvertNumberValue(t),i=o.getConvertNumberValue(e[0]),a=o.getConvertNumberValue(e[1]);return n>=i&&n<=a},isIn:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=0)return!0;return!1},notInclude:function(t,e){if(!o.isArray(t))return!1;for(var n=0;n=n&&a<=i}catch(o){r("absolute_between Error",o)}},absoluteBetween:function(t,e){try{var n=new Date(e[0]),i=new Date(e[1]),a=new Date(t);return a>=n&&a<=i}catch(o){r("absolute_between Error",o)}}},n=this,i=t.relation,a="or"===String(i).toLowerCase(),s="and"===String(i).toLowerCase(),p=!!s,u=!0;return o.each(t.conditions,function(t){if(!u)return!1;if(!t.field)return!1;var i=t.field.lastIndexOf("."),o=t.params,r="in"===t["function"]?"isIn":t["function"];if(!e[r])return p=!1,u=!1,!1;if(i<0)return!1;var l=t.field.slice(i+1),c=n.event_data.properties,_=c[l];"$event_duration"===l&&void 0===_&&(_=c.event_duration);var d=e[r](_,o);a&&d&&(p=!0,u=!1),s&&!d&&(p=!1,u=!1)}),p},a.RuleCheck.prototype.checkProperties=function(){var t=this,e=o.filter(this.rule_arr,function(e){var n=e.multi_filter?e.multi_filter:e.filter;return!(n&&(!n.conditions||0!==n.conditions.length))||t.isMatched(n)});o.isArray(e)&&e.length>0?(this.checkWindowAndMatch(e),r("--\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",e)):r("--\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3")},a.RuleCheck.prototype.checkPermission=function(){function t(e){o.each(e,function(e){if(r=s([e]),o.isArray(r)&&r.length>0){var n=e.filters||[];n&&n.length>0&&t(n)}})}var e=this.plan.event_permission;if(!o.isObject(e)||o.isEmptyObject(e))return!0;var n=[e],i=this,r=[],s=function(t){var e=o.filter(t,function(t){return!(t&&t.conditions&&(!t.conditions||0!==t.conditions.length))||i.isMatched(t)});return e};return t(n),o.isArray(r)&&r.length>0?(a.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u6ee1\u8db3",r),!0):(a.log("--\u89d2\u8272\u5c5e\u6027\u5339\u914d-\u4e0d\u6ee1\u8db3"),!1)},a.RuleCheck.prototype.checkWindowAndMatch=function(t){var e=this,n=[];o.each(t,function(t){if(!t.params||!t.params[0])return r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570\u636e\u5f02\u5e38"),!1;var i=Number(t.params[0]);1===i?n.push(t):i>1&&o.isObject(t.window)&&t.window.value>0&&(!o.isObject(t.is_in_window)||!o.isNumber(t.is_in_window.expire_time)||t.is_in_window.expire_time=i?n.push(t):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u89c4\u5219\u6570",t.is_in_window.count,"\u4e0d\u5339\u914d\u5f53\u524d\u6b21\u6570",i))}),n.length>0?(r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n),this.checkGlobalPopupLimit()):r("--\u7a97\u53e3\u671f\u548c\u6b21\u6570-\u6ca1\u6709\u5339\u914d\u6210\u529f\u7684\u89c4\u5219",n)},a.RuleCheck.prototype.checkGlobalPopupLimit=function(){var t=a.localData.msg_limit_global,e=!0,n=this;o.isObject(t)&&t.is_in_use===!0&&o.isArray(t.limits)&&o.isArray(a.localData.global_popup_count)&&this.plan.global_msg_limit_enabled===!0?(o.each(t.limits,function(t){if(o.isObject(t)&&o.isNumber(t.limit)){var i=a.ruleTime.getLast(t,n.current_time),s=a.ruleTime.getArrMatchCount(a.localData.global_popup_count,i);r("--\u5168\u5c40\u5f39\u7a97\u9650\u5236-\u5df2\u7ecf\u5f39\u7a97\u6b21\u6570-"+s+"-\u9650\u5236\u7684\u6b21\u6570"+t.limit+"-\u9650\u5236\u65f6\u95f4-"+i),e=s0&&(a.updateDataAndSetListen.interval_time=a.localData.config_pull_interval_ms),this.removeLocalData(),a.log("\u521d\u59cb\u5316-\u83b7\u53d6-\u5185\u5b58-localData")},getJSONData:function(){var t=o.localStorage.get(a.config.storageName);o.isString(t)&&(t=e(t));try{t=JSON.parse(t)}catch(n){o.log(n)}return t},saveJSONData:function(t){t=JSON.stringify(t),a.info.encrypt_cookie&&(t=n(t)),o.localStorage.set(a.config.storageName,t)},migrateLocalData:function(){var t=this.getJSONData()||{},e=a.sa.store.getDistinctId();if(t.popup_sdk_users&&t.popup_sdk_plans)return!1;var n={popup_sdk_plans:{},popup_sdk_users:{}};n.popup_sdk_plans[e]=t,n.popup_sdk_users[e]={user_id:e},this.saveJSONData(n)},getLocalData:function(){var t=this.getJSONData(),e=a.sa.store.getDistinctId(),n=null;return t?(o.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id),n&&o.isObject(t.popup_sdk_plans[n])?(t.popup_sdk_plans[n].update_time=(new Date).getTime(),this.saveJSONData(t),t.popup_sdk_plans[n]):{}):{}},saveLocalData:function(){var t=this.getJSONData(),e=a.sa.store.getDistinctId(),n=null;return!!t&&void(t.popup_sdk_users&&o.isObject(t.popup_sdk_users[e])&&t.popup_sdk_users[e].user_id&&(n=t.popup_sdk_users[e].user_id,t.popup_sdk_plans[n]=a.localData,this.saveJSONData(t)))},removeLocalData:function(){var t=this.getJSONData(),e=this.delete_time;if(!t||!t.popup_sdk_plans||!t.popup_sdk_users)return!1;var n=JSON.parse(JSON.stringify(t.popup_sdk_plans)),i=JSON.parse(JSON.stringify(t.popup_sdk_users)),a=(new Date).getTime(),r=[];o.each(n,function(n,i){a-n.update_time>e&&(delete t.popup_sdk_plans[i],r.push(i))}),o.each(i,function(e,n){r.length>0&&o.each(r,function(i){e.user_id&&i===e.user_id&&delete t.popup_sdk_users[n]})}),this.saveJSONData(t)}},a.updateDataAndSetListen={active_state:!0,interval_time:6e5,save_interval:null,data_interval:null,image_list:null,local_data:null,filterConvertPlans:function(){var t=a.localData.popup_plans;if(!t||!o.isArray(t))return!1;var e=o.filter(t,function(t){return!!t.convert_window&&!!t.is_in_convert_window});a.convertPlans=e,a.log("\u521d\u59cb\u5316-\u5f02\u6b65\u7684convertWindow",a.convertPlans),a.asyncConvert()},diffData:function(){var t=a.localData,e=JSON.parse(JSON.stringify(a.serverData));(new Date).getTime();if(!e||o.isEmptyObject(e))return!1;if(!t||o.isEmptyObject(t)||!t.popup_plans||0===t.popup_plans.length)return o.extend(a.localData,e),!1;var n=e.popup_plans;o.each(n,function(e,i){var r=null;if(o.each(t.popup_plans,function(t){t.plan_id===e.plan_id&&(r=t,e.audience_id||delete r.audience_id,o.isObject(e.window_update)&&o.each(e.window_update,function(t,n){r.window_update&&r.window_update[n]===t||("trigger_window"===n?r.pattern_popup.matcher_list=e.pattern_popup.matcher_list:"convert_window"===n&&r.is_in_convert_window&&e.convert_window&&r.is_in_convert_window.start_time&&(r.is_in_convert_window.expire_time=a.ruleTime.getExpire(e.convert_window,r.is_in_convert_window.start_time)))}))}),!r)return!1;if(!e.window_update&&r.last_update_config_time!==e.last_update_config_time)return!1;var s=r.pattern_popup.matcher_list;o.extend2Lev(r,e),r.pattern_popup.matcher_list=s,n[i]=r}),o.extend(a.localData,e)},getEventRule:function(){var t=a.localData.popup_plans,e={};return!(!t||!o.isArray(t))&&(o.each(t,function(t){var n=t.pattern_popup.matcher_list;o.each(n,function(n){var i={plan:t,rule:[n]},a=n.event_name,r=!1;if(e[a]){if(o.each(e[a],function(e){e.plan.plan_id===t.plan_id&&(e.rule.push(n),r=!0)}),r)return!1;e[a].push(i)}else e[a]=[i]})}),o.each(e,function(t){t.sort(function(t,e){var n=e.plan.absolute_priority-t.plan.absolute_priority;return 0===n?e.plan.plan_id-t.plan.plan_id:n})}),a.eventRule=e,a.log("\u521d\u59cb\u5316-\u5f97\u5230\u4e8b\u4ef6\u548c\u8ba1\u5212\u7684\u5173\u7cfb"),void a.log("--------------------\u521d\u59cb\u5316\u5b8c\u6210--------------------\u7b49\u5f85\u4e8b\u4ef6\u89e6\u53d1\u8ba1\u5212--------------------"))},registerListen:function(){var t=this;a.sa.events.on("send",function(e){e.event&&a.eventRule[e.event]&&(o.isArray(a.localData.eventQueue)||(a.localData.eventQueue=[]),a.localData.eventQueue.push(e),t.updateLocalData(),a.eventTriggerProcess())}),a.sa.events.on("changeDistinctId",function(e){t.changeId()}),a.sa.events.isReady()},setListenEvent:function(){this.diffData(),this.filterConvertPlans(),this.getEventRule(),this.updateLocalData()},loadImage:function(t){function e(t){var e=new Image;e.src=t}if(t.length<1)return!1;if(JSON.stringify(t)===JSON.stringify(this.image_list))return!1;this.image_list=t;for(var n=0;n0&&(n.interval_time=i.config_pull_interval_ms),a.serverData.local_update_time=(new Date).getTime(),a.info.preload_image&&n.loadImage(a.getImageList(i.popup_plans)),n.updateUserPlans(),n.setListenEvent()):(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},a.localData={},n.updateLocalData()),t(),void n.setIntervalTime(n.interval_time)):(e(),!1)},error:function(){return n.active_state?(a.log("\u521d\u59cb\u5316-\u6570\u636e\u5f02\u5e38-\u8bf7\u6c42\u9519\u8bef-\u4e2d\u6b62"),a.serverData={},t(),void n.setIntervalTime(n.interval_time)):(e(),!1)}})},updateUserPlans:function(){var t=a.store.getJSONData(),e=a.sa.store.getDistinctId(),n=a.serverData.user_id;t.popup_sdk_users[e]={user_id:n||e},n?t.popup_sdk_plans[n]?a.localData=t.popup_sdk_plans[n]:t.popup_sdk_plans[e]&&(a.localData=t.popup_sdk_plans[e],delete t.popup_sdk_plans[e]):t.popup_sdk_plans[e]&&(a.localData=t.popup_sdk_plans[e]),a.localData.update_time=(new Date).getTime(),a.store.saveJSONData(t)},setIntervalTime:function(t){var e=this;this.data_interval=setTimeout(function(){a.log("10\u5206\u949f\u5b9a\u65f6\u66f4\u65b0\u6570\u636e\u5f00\u59cb-------"),e.getDataFromServer()},t)},setFirstListen:function(){var t=this;this.getDataFromServer(function(){t.registerListen()})},updateLocalData:function(){var t=JSON.stringify(a.localData);this.local_data!==t&&(this.local_data=t,a.store.saveLocalData())},initial:function(){a.store.init();var t=a.localData.local_update_time,e=(new Date).getTime();if(o.isNumber(t)){var n=e-t;n<=0||n>=this.interval_time?this.setFirstListen():(this.setIntervalTime(this.interval_time-n),this.setListenEvent(),this.registerListen(),a.info.preload_image&&this.loadImage(a.getImageList(a.localData.popup_plans)))}else this.setFirstListen()},changeId:function(){this.stopAllState(),this.startState({getLocalData:!1})},stopAllState:function(){this.active_state=!1,a.eventRule={},this.data_interval&&window.clearTimeout(this.data_interval),this.save_interval&&window.clearInterval(this.save_interval),a.asyncConvert.timer&&window.clearTimeout(a.asyncConvert.timer),a.convertPlans=[],a.localData={},this.resetState()},resetState:function(){return"WEB"!==a.info.platform&&void(!document.querySelector("div[data-sf-mask]")&&a.isRun&&(a.isRun=!1))},startState:function(t){this.active_state=!0,t=t||{getLocalData:!0},t.getLocalData&&(this.resetState(),a.localData=a.store.getLocalData()),this.getDataFromServer()}},a.testSend={hasParam:function(){var t=o.URL(window.location.href).searchParams,e=t.get("sf_popup_test")||"",n=t.get("popup_window_id")||"",i=t.get("platform");return!(!e||!n)&&{sf_popup_test:e,popup_window_id:n,platform:i}},start:function(){var t=this.hasParam().platform;return"WEB"!==t?(a.log("H5\u6d4b\u8bd5\u5f39\u7a97\u8bf7\u5728\u79fb\u52a8\u7aef\u67e5\u770b\uff01"),!1):void this.webCampaign()},webCampaign:function(){var t=a.info.project,e=a.info.platform,n=this.hasParam().popup_window_id,i=encodeURIComponent(a.sa.store.getDistinctId());o.ajax({url:a.info.api_base_url+"/sfo/popup_windows/"+n+"?project="+encodeURIComponent(t)+"&time="+(new Date).getTime()+"&sdk_version="+a.lib_version+"&platform="+encodeURIComponent(e)+"&distinct_id="+i,type:"GET",credentials:!1,cors:!0,contentType:"application/json",success:function(t){var e,n=o.getUuid();o.isObject(t)||(a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-\u670d\u52a1\u7aef\u6570\u636e\u683c\u5f0f\u4e0d\u5408\u6cd5",t),t={});try{e=JSON.parse(t.content)}catch(i){a.sa.log("\u6d4b\u8bd5\u5f39\u7a97-content\u89e3\u6790\u5931\u8d25,content:",t,i)}var r=a.getPopupInfo(e);r.$sf_msg_id=n;var s={content:t.content,type:t.popup_type||"CUSTOMIZED"};Object.hasOwnProperty.call(t,"name")&&(s.name=t.name),o.isString(t.content)?"withoutCampaignListener"===a.info.supportCustom||"withoutStart"===a.info.supportCustom?(r.$sf_succeed=!1,r.$sf_fail_reason="\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03",a.track.popupDisplay(r),a.info.popup_campaign_listener.onFailed(s,1006,"\u81ea\u5b9a\u4e49\u89e6\u8fbe\u8ba1\u5212\u672a\u5b9e\u73b0\u5f39\u7a97\u751f\u547d\u5468\u671f\u56de\u8c03")):(r.$sf_succeed=!0,a.track.popupDisplay(r),a.info.popup_campaign_listener.onStart(s)):(r.$sf_succeed=!1,r.$sf_fail_reason="\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e",a.track.popupDisplay(r),a.info.popup_campaign_listener.onFailed(s,1001,"\u9884\u89c8\u4fe1\u606f\u89e3\u6790\u5931\u8d25\uff0c\u8bf7\u68c0\u67e5\u8ba1\u5212\u914d\u7f6e"))},error:function(t){a.log("\u6d4b\u8bd5\u5f39\u7a97\u83b7\u53d6\u6570\u636e\u9519\u8bef",t)}})}},a.setPara=function(t){o.isObject(t)||(t={}),a.info=o.extend({},a.defaultPara,t);var e=a.sa;return e?(e.para.encrypt_cookie===!0&&(a.info.encrypt_cookie=!0),o.isString(a.info.api_base_url)&&"http"===a.info.api_base_url.slice(0,4)?"http:"===a.info.api_base_url.slice(0,5)&&"https:"===location.protocol?(a.log("\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0capi_base_url \u4e5f\u5fc5\u987b\u662fhttps\uff01"),!1):(a.info.api_base_url="/"===a.info.api_base_url.slice(-1)?a.info.api_base_url.slice(0,-1):a.info.api_base_url,o.isString(e.para.server_url)&&"http"===e.para.server_url.slice(0,4)?(a.info.project||(a.info.project=o.URL(e.para.server_url).searchParams.get("project")||"default"),a.info.supportCustom=!0,o.isObject(a.info.popup_campaign_listener)?(o.isFunction(a.info.popup_campaign_listener.shouldStart)||(a.info.popup_campaign_listener.shouldStart=function(){return!0}),o.isFunction(a.info.popup_campaign_listener.onStart)||(a.info.supportCustom="withoutStart",a.info.popup_campaign_listener.onStart=function(){}),o.isFunction(a.info.popup_campaign_listener.onEnd)||(a.info.popup_campaign_listener.onEnd=function(){}),o.isFunction(a.info.popup_campaign_listener.onFailed)||(a.info.popup_campaign_listener.onFailed=function(){}),o.isFunction(a.info.popup_campaign_listener.onClick)||(a.info.popup_campaign_listener.onClick=function(){})):(a.info.supportCustom="withoutCampaignListener",a.info.popup_campaign_listener={shouldStart:function(){return!0},onClick:function(){},onStart:function(){},onEnd:function(){},onFailed:function(){}}),!0):(a.log("server_url \u5fc5\u987b\u586b\u5199\u6709\u6548\u6570\u636e\u63a5\u6536\u5730\u5740"),!1)):(a.log("popup \u5fc5\u987b\u586b\u5199\u6709\u6548 api_base_url"),!1)):(a.log("web js sdk \u8fd8\u6ca1\u6709\u521d\u59cb\u5316\u5b8c\u6210"),!1)},a.init=function(){var t=window.sensorsDataAnalytic201505;if(a.sa=t,t&&t.readyState&&t.readyState.state>=3||!t.on)i.apply(this,arguments);else{var e=this,n=arguments;t&&t.on("sdkReady",function(){i.apply(e,n)})}},window.SensorsDataWebJSSDKPlugin&&"[object Object]"===Object.prototype.toString.call(window.SensorsDataWebJSSDKPlugin)?window.SensorsDataWebJSSDKPlugin.WebPopup=window.SensorsDataWebJSSDKPlugin.WebPopup||a:window.SensorsDataWebJSSDKPlugin={WebPopup:a},a}); \ No newline at end of file diff --git a/dist/web/plugin/site-linker-concat-utm/index.closure.js b/dist/web/plugin/site-linker-concat-utm/index.closure.js index 18dae036..2bc08874 100644 --- a/dist/web/plugin/site-linker-concat-utm/index.closure.js +++ b/dist/web/plugin/site-linker-concat-utm/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function t(t,r,e){if(r&&(t.plugin_name=r),e&&t.init){var n=t.init;t.init=function(s,a){function o(){n.call(t,s,a)}return i(s,t,r),s.readyState&&s.readyState.state>=3||!s.on?o():void s.on(e,o)}}return t}function i(t,i,r){function e(i,e){t.logger?t.logger.msg.apply(t.logger,e).module(r+""||"").level(i).log():t.log&&t.log.apply(t,e)}i.log=function(){e("log",arguments)},i.warn=function(){e("warn",arguments)},i.error=function(){e("error",arguments)}}function r(i,r,n){return t(i,r,n),i.plugin_version=e,i}var e="1.26.8",n={};n.getPart=function(t){var i=!1,r=this.option.length;if(r)for(var e=0;e-1)return!0;return i},n.getPartHash=function(t){var i=this.option.length,r=!1;if(i)for(var e=0;e-1)return this.option[e].after_hash;return!!r},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",i=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var r=i?"f"+t:"d"+t;return encodeURIComponent(r)},n.rewriteUrl=function(t,i){var r=this,e=/([^?#]+)(\?[^#]*)?(#.*)?/,n=e.exec(t),s="";if(n){var a,o=n[1]||"",u=n[2]||"",f=n[3]||"",l="_sasdk="+this.getCurrenId(),h=function(t){var i=t.split("&"),e=[];return r._.each(i,function(t){t.indexOf("_sasdk=")>-1?e.push(l):e.push(t)}),e.join("&")};if(this.getPartHash(t)){a=f.indexOf("_sasdk");var d=f.indexOf("?");s=d>-1?a>-1?o+u+"#"+f.substring(1,a)+h(f.substring(a,f.length)):o+u+f+"&"+l:o+u+"#"+f.substring(1)+"?"+l}else{a=u.indexOf("_sasdk");var c=/^\?(\w)+/.test(u);s=c?a>-1?o+"?"+h(u.substring(1))+f:o+u+"&"+l+f:o+"?"+l+f}return i&&(i.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var i=decodeURIComponent(t[1]);return!i||"f"!==i.substring(0,1)&&"d"!==i.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(i)?i=i.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(i.substring(1))):this._.rot13defs&&(i=i.substring(0,1)+this._.rot13defs(i.substring(1)))),i}return""},n.setRefferId=function(t){var i=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var e="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==i&&(e?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:i,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(r))}},n.addListen=function(){var t=this,i=function(i){var r,e,n=i.target,s=n.tagName.toLowerCase(),a=n.parentNode;if("a"===s&&n.href||a&&a.tagName&&"a"===a.tagName.toLowerCase()&&a.href){"a"===s&&n.href?(r=n.href,e=n):(r=a.href,e=a);var o=t._.URL(r),u=o.protocol;"http:"!==u&&"https:"!==u||t.getPart(r)&&t.rewriteUrl(r,e)}};t._.addEvent(document,"mousedown",i),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",i)},n.init=function(t,i){function r(i){for(var r=i.length,e=[],n=0;n0?(this.setRefferId(i),this.addListen(),this.option=i.linker,void(this.option=r(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=r(n,"SiteLinker","sdkReady"),a=s,o=s.rewriteUrl;return a.rewriteUrl=function(t,i){function r(t){var i={};if(s._.isArray(t)){var r=t[2]||"";if(""!==r)for(var e=r.slice(1).split("&"),n=0;n=3||!s.on?o():void s.on(e,o)}}return t}function i(t,i,r){function e(i,e){t.logger?t.logger.msg.apply(t.logger,e).module(r+""||"").level(i).log():t.log&&t.log.apply(t,e)}i.log=function(){e("log",arguments)},i.warn=function(){e("warn",arguments)},i.error=function(){e("error",arguments)}}function r(i,r,n){return t(i,r,n),i.plugin_version=e,i}var e="1.26.9",n={};n.getPart=function(t){var i=!1,r=this.option.length;if(r)for(var e=0;e-1)return!0;return i},n.getPartHash=function(t){var i=this.option.length,r=!1;if(i)for(var e=0;e-1)return this.option[e].after_hash;return!!r},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",i=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var r=i?"f"+t:"d"+t;return encodeURIComponent(r)},n.rewriteUrl=function(t,i){var r=this,e=/([^?#]+)(\?[^#]*)?(#.*)?/,n=e.exec(t),s="";if(n){var a,o=n[1]||"",u=n[2]||"",f=n[3]||"",l="_sasdk="+this.getCurrenId(),h=function(t){var i=t.split("&"),e=[];return r._.each(i,function(t){t.indexOf("_sasdk=")>-1?e.push(l):e.push(t)}),e.join("&")};if(this.getPartHash(t)){a=f.indexOf("_sasdk");var d=f.indexOf("?");s=d>-1?a>-1?o+u+"#"+f.substring(1,a)+h(f.substring(a,f.length)):o+u+f+"&"+l:o+u+"#"+f.substring(1)+"?"+l}else{a=u.indexOf("_sasdk");var c=/^\?(\w)+/.test(u);s=c?a>-1?o+"?"+h(u.substring(1))+f:o+u+"&"+l+f:o+"?"+l+f}return i&&(i.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var i=decodeURIComponent(t[1]);return!i||"f"!==i.substring(0,1)&&"d"!==i.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(i)?i=i.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(i.substring(1))):this._.rot13defs&&(i=i.substring(0,1)+this._.rot13defs(i.substring(1)))),i}return""},n.setRefferId=function(t){var i=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var e="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==i&&(e?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:i,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(r))}},n.addListen=function(){var t=this,i=function(i){var r,e,n=i.target,s=n.tagName.toLowerCase(),a=n.parentNode;if("a"===s&&n.href||a&&a.tagName&&"a"===a.tagName.toLowerCase()&&a.href){"a"===s&&n.href?(r=n.href,e=n):(r=a.href,e=a);var o=t._.URL(r),u=o.protocol;"http:"!==u&&"https:"!==u||t.getPart(r)&&t.rewriteUrl(r,e)}};t._.addEvent(document,"mousedown",i),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",i)},n.init=function(t,i){function r(i){for(var r=i.length,e=[],n=0;n0?(this.setRefferId(i),this.addListen(),this.option=i.linker,void(this.option=r(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=r(n,"SiteLinker","sdkReady"),a=s,o=s.rewriteUrl;return a.rewriteUrl=function(t,i){function r(t){var i={};if(s._.isArray(t)){var r=t[2]||"";if(""!==r)for(var e=r.slice(1).split("&"),n=0;n=3||!n.on)return a();function a(){r.call(t,n,s)}n.on(e,a)}}return t}function wrapLogFn(t,i,e){function r(i,r){t.logger?t.logger.msg.apply(t.logger,r).module(e+""||"").level(i).log():t.log&&t.log.apply(t,r)}i.log=function(){r("log",arguments)},i.warn=function(){r("warn",arguments)},i.error=function(){r("error",arguments)}}function createPlugin(t,i,e){return wrapPluginInitFn(t,i,e),t.plugin_version=sdkversion_placeholder,t}var siteLinker={getPart:function(t){var i=this.option.length;if(i)for(var e=0;e-1)return!0;return!1},getPartHash:function(t){var i=this.option.length;if(i)for(var e=0;e-1)return this.option[e].after_hash;return!1},getCurrenId:function(){var t=this.store.getDistinctId()||"",i=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):""),encodeURIComponent(i?"f"+t:"d"+t)},rewriteUrl:function(t,i){var e=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(t),n="";if(r){var s,a=r[1]||"",o=r[2]||"",l=r[3]||"",u="_sasdk="+this.getCurrenId(),f=function(t){var i=t.split("&"),r=[];return e._.each(i,function(t){t.indexOf("_sasdk=")>-1?r.push(u):r.push(t)}),r.join("&")};if(this.getPartHash(t))s=l.indexOf("_sasdk"),n=l.indexOf("?")>-1?s>-1?a+o+"#"+l.substring(1,s)+f(l.substring(s,l.length)):a+o+l+"&"+u:a+o+"#"+l.substring(1)+"?"+u;else s=o.indexOf("_sasdk"),n=/^\?(\w)+/.test(o)?s>-1?a+"?"+f(o.substring(1))+l:a+o+"&"+u+l:a+"?"+u+l;return i&&(i.href=n),n}},getUrlId:function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var i=decodeURIComponent(t[1]);return!i||"f"!==i.substring(0,1)&&"d"!==i.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(i)?i=i.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(i.substring(1))):this._.rot13defs&&(i=i.substring(0,1)+this._.rot13defs(i.substring(1)))),i}return""},setRefferId:function(t){var i=this.store.getDistinctId(),e=this.getUrlId();if(e&&""!==e){var r="a"===e.substring(0,1)||"d"===e.substring(0,1);(e=e.substring(1))!==i&&(r?(this.sd.identify(e,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:e,distinct_id:i,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(e))}},addListen:function(){var t=this,i=function(i){var e,r,n=i.target,s=n.tagName.toLowerCase(),a=n.parentNode;if("a"===s&&n.href||a&&a.tagName&&"a"===a.tagName.toLowerCase()&&a.href){"a"===s&&n.href?(e=n.href,r=n):(e=a.href,r=a);var o=t._.URL(e).protocol;"http:"!==o&&"https:"!==o||t.getPart(e)&&t.rewriteUrl(e,r)}};t._.addEvent(document,"mousedown",i),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",i)},init:function(t,i){this.sd=t,this._=t._,this.store=t.store,this.para=t.para,this._.isObject(i)&&this._.isArray(i.linker)&&i.linker.length>0?(this.setRefferId(i),this.addListen(),this.option=i.linker,this.option=function(i){for(var e=i.length,r=[],n=0;n=3||!n.on)return a();function a(){r.call(t,n,s)}n.on(e,a)}}return t}function wrapLogFn(t,i,e){function r(i,r){t.logger?t.logger.msg.apply(t.logger,r).module(e+""||"").level(i).log():t.log&&t.log.apply(t,r)}i.log=function(){r("log",arguments)},i.warn=function(){r("warn",arguments)},i.error=function(){r("error",arguments)}}function createPlugin(t,i,e){return wrapPluginInitFn(t,i,e),t.plugin_version=sdkversion_placeholder,t}var siteLinker={getPart:function(t){var i=this.option.length;if(i)for(var e=0;e-1)return!0;return!1},getPartHash:function(t){var i=this.option.length;if(i)for(var e=0;e-1)return this.option[e].after_hash;return!1},getCurrenId:function(){var t=this.store.getDistinctId()||"",i=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):""),encodeURIComponent(i?"f"+t:"d"+t)},rewriteUrl:function(t,i){var e=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(t),n="";if(r){var s,a=r[1]||"",o=r[2]||"",l=r[3]||"",u="_sasdk="+this.getCurrenId(),f=function(t){var i=t.split("&"),r=[];return e._.each(i,function(t){t.indexOf("_sasdk=")>-1?r.push(u):r.push(t)}),r.join("&")};if(this.getPartHash(t))s=l.indexOf("_sasdk"),n=l.indexOf("?")>-1?s>-1?a+o+"#"+l.substring(1,s)+f(l.substring(s,l.length)):a+o+l+"&"+u:a+o+"#"+l.substring(1)+"?"+u;else s=o.indexOf("_sasdk"),n=/^\?(\w)+/.test(o)?s>-1?a+"?"+f(o.substring(1))+l:a+o+"&"+u+l:a+"?"+u+l;return i&&(i.href=n),n}},getUrlId:function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var i=decodeURIComponent(t[1]);return!i||"f"!==i.substring(0,1)&&"d"!==i.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(i)?i=i.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(i.substring(1))):this._.rot13defs&&(i=i.substring(0,1)+this._.rot13defs(i.substring(1)))),i}return""},setRefferId:function(t){var i=this.store.getDistinctId(),e=this.getUrlId();if(e&&""!==e){var r="a"===e.substring(0,1)||"d"===e.substring(0,1);(e=e.substring(1))!==i&&(r?(this.sd.identify(e,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:e,distinct_id:i,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(e))}},addListen:function(){var t=this,i=function(i){var e,r,n=i.target,s=n.tagName.toLowerCase(),a=n.parentNode;if("a"===s&&n.href||a&&a.tagName&&"a"===a.tagName.toLowerCase()&&a.href){"a"===s&&n.href?(e=n.href,r=n):(e=a.href,r=a);var o=t._.URL(e).protocol;"http:"!==o&&"https:"!==o||t.getPart(e)&&t.rewriteUrl(e,r)}};t._.addEvent(document,"mousedown",i),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",i)},init:function(t,i){this.sd=t,this._=t._,this.store=t.store,this.para=t.para,this._.isObject(i)&&this._.isArray(i.linker)&&i.linker.length>0?(this.setRefferId(i),this.addListen(),this.option=i.linker,this.option=function(i){for(var e=i.length,r=[],n=0;n=3||!s.on?o():void s.on(r,o)}}return t}function i(t,i,e){function r(i,r){t.logger?t.logger.msg.apply(t.logger,r).module(e+""||"").level(i).log():t.log&&t.log.apply(t,r)}i.log=function(){r("log",arguments)},i.warn=function(){r("warn",arguments)},i.error=function(){r("error",arguments)}}function e(i,e,n){return t(i,e,n),i.plugin_version=r,i}var r="1.26.8",n={};n.getPart=function(t){var i=!1,e=this.option.length;if(e)for(var r=0;r-1)return!0;return i},n.getPartHash=function(t){var i=this.option.length,e=!1;if(i)for(var r=0;r-1)return this.option[r].after_hash;return!!e},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",i=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var e=i?"f"+t:"d"+t;return encodeURIComponent(e)},n.rewriteUrl=function(t,i){var e=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/,n=r.exec(t),s="";if(n){var a,o=n[1]||"",u=n[2]||"",f=n[3]||"",l="_sasdk="+this.getCurrenId(),h=function(t){var i=t.split("&"),r=[];return e._.each(i,function(t){t.indexOf("_sasdk=")>-1?r.push(l):r.push(t)}),r.join("&")};if(this.getPartHash(t)){a=f.indexOf("_sasdk");var d=f.indexOf("?");s=d>-1?a>-1?o+u+"#"+f.substring(1,a)+h(f.substring(a,f.length)):o+u+f+"&"+l:o+u+"#"+f.substring(1)+"?"+l}else{a=u.indexOf("_sasdk");var c=/^\?(\w)+/.test(u);s=c?a>-1?o+"?"+h(u.substring(1))+f:o+u+"&"+l+f:o+"?"+l+f}return i&&(i.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var i=decodeURIComponent(t[1]);return!i||"f"!==i.substring(0,1)&&"d"!==i.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(i)?i=i.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(i.substring(1))):this._.rot13defs&&(i=i.substring(0,1)+this._.rot13defs(i.substring(1)))),i}return""},n.setRefferId=function(t){var i=this.store.getDistinctId(),e=this.getUrlId();if(e&&""!==e){var r="a"===e.substring(0,1)||"d"===e.substring(0,1);e=e.substring(1),e!==i&&(r?(this.sd.identify(e,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:e,distinct_id:i,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(e))}},n.addListen=function(){var t=this,i=function(i){var e,r,n=i.target,s=n.tagName.toLowerCase(),a=n.parentNode;if("a"===s&&n.href||a&&a.tagName&&"a"===a.tagName.toLowerCase()&&a.href){"a"===s&&n.href?(e=n.href,r=n):(e=a.href,r=a);var o=t._.URL(e),u=o.protocol;"http:"!==u&&"https:"!==u||t.getPart(e)&&t.rewriteUrl(e,r)}};t._.addEvent(document,"mousedown",i),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",i)},n.init=function(t,i){function e(i){for(var e=i.length,r=[],n=0;n0?(this.setRefferId(i),this.addListen(),this.option=i.linker,void(this.option=e(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=e(n,"SiteLinker","sdkReady"),a=s,o=s.rewriteUrl;return a.rewriteUrl=function(t,i){function e(t){var i={};if(s._.isArray(t)){var e=t[2]||"";if(""!==e)for(var r=e.slice(1).split("&"),n=0;n=3||!s.on?o():void s.on(r,o)}}return t}function i(t,i,e){function r(i,r){t.logger?t.logger.msg.apply(t.logger,r).module(e+""||"").level(i).log():t.log&&t.log.apply(t,r)}i.log=function(){r("log",arguments)},i.warn=function(){r("warn",arguments)},i.error=function(){r("error",arguments)}}function e(i,e,n){return t(i,e,n),i.plugin_version=r,i}var r="1.26.9",n={};n.getPart=function(t){var i=!1,e=this.option.length;if(e)for(var r=0;r-1)return!0;return i},n.getPartHash=function(t){var i=this.option.length,e=!1;if(i)for(var r=0;r-1)return this.option[r].after_hash;return!!e},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",i=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var e=i?"f"+t:"d"+t;return encodeURIComponent(e)},n.rewriteUrl=function(t,i){var e=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/,n=r.exec(t),s="";if(n){var a,o=n[1]||"",u=n[2]||"",f=n[3]||"",l="_sasdk="+this.getCurrenId(),h=function(t){var i=t.split("&"),r=[];return e._.each(i,function(t){t.indexOf("_sasdk=")>-1?r.push(l):r.push(t)}),r.join("&")};if(this.getPartHash(t)){a=f.indexOf("_sasdk");var d=f.indexOf("?");s=d>-1?a>-1?o+u+"#"+f.substring(1,a)+h(f.substring(a,f.length)):o+u+f+"&"+l:o+u+"#"+f.substring(1)+"?"+l}else{a=u.indexOf("_sasdk");var c=/^\?(\w)+/.test(u);s=c?a>-1?o+"?"+h(u.substring(1))+f:o+u+"&"+l+f:o+"?"+l+f}return i&&(i.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var i=decodeURIComponent(t[1]);return!i||"f"!==i.substring(0,1)&&"d"!==i.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(i)?i=i.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(i.substring(1))):this._.rot13defs&&(i=i.substring(0,1)+this._.rot13defs(i.substring(1)))),i}return""},n.setRefferId=function(t){var i=this.store.getDistinctId(),e=this.getUrlId();if(e&&""!==e){var r="a"===e.substring(0,1)||"d"===e.substring(0,1);e=e.substring(1),e!==i&&(r?(this.sd.identify(e,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:e,distinct_id:i,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(e))}},n.addListen=function(){var t=this,i=function(i){var e,r,n=i.target,s=n.tagName.toLowerCase(),a=n.parentNode;if("a"===s&&n.href||a&&a.tagName&&"a"===a.tagName.toLowerCase()&&a.href){"a"===s&&n.href?(e=n.href,r=n):(e=a.href,r=a);var o=t._.URL(e),u=o.protocol;"http:"!==u&&"https:"!==u||t.getPart(e)&&t.rewriteUrl(e,r)}};t._.addEvent(document,"mousedown",i),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",i)},n.init=function(t,i){function e(i){for(var e=i.length,r=[],n=0;n0?(this.setRefferId(i),this.addListen(),this.option=i.linker,void(this.option=e(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=e(n,"SiteLinker","sdkReady"),a=s,o=s.rewriteUrl;return a.rewriteUrl=function(t,i){function e(t){var i={};if(s._.isArray(t)){var e=t[2]||"";if(""!==e)for(var r=e.slice(1).split("&"),n=0;n=3||!s.on?a():void s.on(r,a)}}return t}function e(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function i(e,i,n){return t(e,i,n),e.plugin_version=r,e}var r="1.26.8",n={};n.getPart=function(t){var e=!1,i=this.option.length;if(i)for(var r=0;r-1)return!0;return e},n.getPartHash=function(t){var e=this.option.length,i=!1;if(e)for(var r=0;r-1)return this.option[r].after_hash;return!!i},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",e=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var i=e?"f"+t:"d"+t;return encodeURIComponent(i)},n.rewriteUrl=function(t,e){var i=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/,n=r.exec(t),s="";if(n){var o,a=n[1]||"",u=n[2]||"",f=n[3]||"",h="_sasdk="+this.getCurrenId(),d=function(t){var e=t.split("&"),r=[];return i._.each(e,function(t){t.indexOf("_sasdk=")>-1?r.push(h):r.push(t)}),r.join("&")};if(this.getPartHash(t)){o=f.indexOf("_sasdk");var g=f.indexOf("?");s=g>-1?o>-1?a+u+"#"+f.substring(1,o)+d(f.substring(o,f.length)):a+u+f+"&"+h:a+u+"#"+f.substring(1)+"?"+h}else{o=u.indexOf("_sasdk");var l=/^\?(\w)+/.test(u);s=l?o>-1?a+"?"+d(u.substring(1))+f:a+u+"&"+h+f:a+"?"+h+f}return e&&(e.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var e=decodeURIComponent(t[1]);return!e||"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}return""},n.setRefferId=function(t){var e=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var r="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==e&&(r?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:e,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(i))}},n.addListen=function(){var t=this,e=function(e){var i,r,n=e.target,s=n.tagName.toLowerCase(),o=n.parentNode;if("a"===s&&n.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===s&&n.href?(i=n.href,r=n):(i=o.href,r=o);var a=t._.URL(i),u=a.protocol;"http:"!==u&&"https:"!==u||t.getPart(i)&&t.rewriteUrl(i,r)}};t._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",e)},n.init=function(t,e){function i(e){for(var i=e.length,r=[],n=0;n0?(this.setRefferId(e),this.addListen(),this.option=e.linker,void(this.option=i(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=i(n,"SiteLinker","sdkReady");return s}(); \ No newline at end of file +!function(){"use strict";function t(t,i,r){if(i&&(t.plugin_name=i),r&&t.init){var n=t.init;t.init=function(s,o){function a(){n.call(t,s,o)}return e(s,t,i),s.readyState&&s.readyState.state>=3||!s.on?a():void s.on(r,a)}}return t}function e(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function i(e,i,n){return t(e,i,n),e.plugin_version=r,e}var r="1.26.9",n={};n.getPart=function(t){var e=!1,i=this.option.length;if(i)for(var r=0;r-1)return!0;return e},n.getPartHash=function(t){var e=this.option.length,i=!1;if(e)for(var r=0;r-1)return this.option[r].after_hash;return!!i},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",e=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var i=e?"f"+t:"d"+t;return encodeURIComponent(i)},n.rewriteUrl=function(t,e){var i=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/,n=r.exec(t),s="";if(n){var o,a=n[1]||"",u=n[2]||"",f=n[3]||"",h="_sasdk="+this.getCurrenId(),d=function(t){var e=t.split("&"),r=[];return i._.each(e,function(t){t.indexOf("_sasdk=")>-1?r.push(h):r.push(t)}),r.join("&")};if(this.getPartHash(t)){o=f.indexOf("_sasdk");var g=f.indexOf("?");s=g>-1?o>-1?a+u+"#"+f.substring(1,o)+d(f.substring(o,f.length)):a+u+f+"&"+h:a+u+"#"+f.substring(1)+"?"+h}else{o=u.indexOf("_sasdk");var l=/^\?(\w)+/.test(u);s=l?o>-1?a+"?"+d(u.substring(1))+f:a+u+"&"+h+f:a+"?"+h+f}return e&&(e.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var e=decodeURIComponent(t[1]);return!e||"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}return""},n.setRefferId=function(t){var e=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var r="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==e&&(r?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:e,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(i))}},n.addListen=function(){var t=this,e=function(e){var i,r,n=e.target,s=n.tagName.toLowerCase(),o=n.parentNode;if("a"===s&&n.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===s&&n.href?(i=n.href,r=n):(i=o.href,r=o);var a=t._.URL(i),u=a.protocol;"http:"!==u&&"https:"!==u||t.getPart(i)&&t.rewriteUrl(i,r)}};t._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",e)},n.init=function(t,e){function i(e){for(var i=e.length,r=[],n=0;n0?(this.setRefferId(e),this.addListen(),this.option=e.linker,void(this.option=i(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=i(n,"SiteLinker","sdkReady");return s}(); \ No newline at end of file diff --git a/dist/web/plugin/site-linker/index.es6.js b/dist/web/plugin/site-linker/index.es6.js index 1621435c..e9d6d8d1 100644 --- a/dist/web/plugin/site-linker/index.es6.js +++ b/dist/web/plugin/site-linker/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.26.8";function wrapPluginInitFn(t,e,i){if(e&&(t.plugin_name=e),i&&t.init){var r=t.init;t.init=function(n,s){if(wrapLogFn(n,t,e),n.readyState&&n.readyState.state>=3||!n.on)return o();function o(){r.call(t,n,s)}n.on(i,o)}}return t}function wrapLogFn(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(t,e,i){return wrapPluginInitFn(t,e,i),t.plugin_version=sdkversion_placeholder,t}var siteLinker={getPart:function(t){var e=this.option.length;if(e)for(var i=0;i-1)return!0;return!1},getPartHash:function(t){var e=this.option.length;if(e)for(var i=0;i-1)return this.option[i].after_hash;return!1},getCurrenId:function(){var t=this.store.getDistinctId()||"",e=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):""),encodeURIComponent(e?"f"+t:"d"+t)},rewriteUrl:function(t,e){var i=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(t),n="";if(r){var s,o=r[1]||"",a=r[2]||"",u=r[3]||"",d="_sasdk="+this.getCurrenId(),f=function(t){var e=t.split("&"),r=[];return i._.each(e,function(t){t.indexOf("_sasdk=")>-1?r.push(d):r.push(t)}),r.join("&")};if(this.getPartHash(t))s=u.indexOf("_sasdk"),n=u.indexOf("?")>-1?s>-1?o+a+"#"+u.substring(1,s)+f(u.substring(s,u.length)):o+a+u+"&"+d:o+a+"#"+u.substring(1)+"?"+d;else s=a.indexOf("_sasdk"),n=/^\?(\w)+/.test(a)?s>-1?o+"?"+f(a.substring(1))+u:o+a+"&"+d+u:o+"?"+d+u;return e&&(e.href=n),n}},getUrlId:function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var e=decodeURIComponent(t[1]);return!e||"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}return""},setRefferId:function(t){var e=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var r="a"===i.substring(0,1)||"d"===i.substring(0,1);(i=i.substring(1))!==e&&(r?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:e,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(i))}},addListen:function(){var t=this,e=function(e){var i,r,n=e.target,s=n.tagName.toLowerCase(),o=n.parentNode;if("a"===s&&n.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===s&&n.href?(i=n.href,r=n):(i=o.href,r=o);var a=t._.URL(i).protocol;"http:"!==a&&"https:"!==a||t.getPart(i)&&t.rewriteUrl(i,r)}};t._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",e)},init:function(t,e){this.sd=t,this._=t._,this.store=t.store,this.para=t.para,this._.isObject(e)&&this._.isArray(e.linker)&&e.linker.length>0?(this.setRefferId(e),this.addListen(),this.option=e.linker,this.option=function(e){for(var i=e.length,r=[],n=0;n=3||!n.on)return o();function o(){r.call(t,n,s)}n.on(i,o)}}return t}function wrapLogFn(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function createPlugin(t,e,i){return wrapPluginInitFn(t,e,i),t.plugin_version=sdkversion_placeholder,t}var siteLinker={getPart:function(t){var e=this.option.length;if(e)for(var i=0;i-1)return!0;return!1},getPartHash:function(t){var e=this.option.length;if(e)for(var i=0;i-1)return this.option[i].after_hash;return!1},getCurrenId:function(){var t=this.store.getDistinctId()||"",e=this.store.getFirstId()||"";return this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):""),encodeURIComponent(e?"f"+t:"d"+t)},rewriteUrl:function(t,e){var i=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(t),n="";if(r){var s,o=r[1]||"",a=r[2]||"",u=r[3]||"",d="_sasdk="+this.getCurrenId(),f=function(t){var e=t.split("&"),r=[];return i._.each(e,function(t){t.indexOf("_sasdk=")>-1?r.push(d):r.push(t)}),r.join("&")};if(this.getPartHash(t))s=u.indexOf("_sasdk"),n=u.indexOf("?")>-1?s>-1?o+a+"#"+u.substring(1,s)+f(u.substring(s,u.length)):o+a+u+"&"+d:o+a+"#"+u.substring(1)+"?"+d;else s=a.indexOf("_sasdk"),n=/^\?(\w)+/.test(a)?s>-1?o+"?"+f(a.substring(1))+u:o+a+"&"+d+u:o+"?"+d+u;return e&&(e.href=n),n}},getUrlId:function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var e=decodeURIComponent(t[1]);return!e||"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}return""},setRefferId:function(t){var e=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var r="a"===i.substring(0,1)||"d"===i.substring(0,1);(i=i.substring(1))!==e&&(r?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:e,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(i))}},addListen:function(){var t=this,e=function(e){var i,r,n=e.target,s=n.tagName.toLowerCase(),o=n.parentNode;if("a"===s&&n.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===s&&n.href?(i=n.href,r=n):(i=o.href,r=o);var a=t._.URL(i).protocol;"http:"!==a&&"https:"!==a||t.getPart(i)&&t.rewriteUrl(i,r)}};t._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",e)},init:function(t,e){this.sd=t,this._=t._,this.store=t.store,this.para=t.para,this._.isObject(e)&&this._.isArray(e.linker)&&e.linker.length>0?(this.setRefferId(e),this.addListen(),this.option=e.linker,this.option=function(e){for(var i=e.length,r=[],n=0;n=3||!s.on?a():void s.on(r,a)}}return t}function e(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function i(e,i,n){return t(e,i,n),e.plugin_version=r,e}var r="1.26.8",n={};n.getPart=function(t){var e=!1,i=this.option.length;if(i)for(var r=0;r-1)return!0;return e},n.getPartHash=function(t){var e=this.option.length,i=!1;if(e)for(var r=0;r-1)return this.option[r].after_hash;return!!i},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",e=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var i=e?"f"+t:"d"+t;return encodeURIComponent(i)},n.rewriteUrl=function(t,e){var i=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/,n=r.exec(t),s="";if(n){var o,a=n[1]||"",u=n[2]||"",d=n[3]||"",f="_sasdk="+this.getCurrenId(),h=function(t){var e=t.split("&"),r=[];return i._.each(e,function(t){t.indexOf("_sasdk=")>-1?r.push(f):r.push(t)}),r.join("&")};if(this.getPartHash(t)){o=d.indexOf("_sasdk");var g=d.indexOf("?");s=g>-1?o>-1?a+u+"#"+d.substring(1,o)+h(d.substring(o,d.length)):a+u+d+"&"+f:a+u+"#"+d.substring(1)+"?"+f}else{o=u.indexOf("_sasdk");var l=/^\?(\w)+/.test(u);s=l?o>-1?a+"?"+h(u.substring(1))+d:a+u+"&"+f+d:a+"?"+f+d}return e&&(e.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var e=decodeURIComponent(t[1]);return!e||"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}return""},n.setRefferId=function(t){var e=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var r="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==e&&(r?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:e,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(i))}},n.addListen=function(){var t=this,e=function(e){var i,r,n=e.target,s=n.tagName.toLowerCase(),o=n.parentNode;if("a"===s&&n.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===s&&n.href?(i=n.href,r=n):(i=o.href,r=o);var a=t._.URL(i),u=a.protocol;"http:"!==u&&"https:"!==u||t.getPart(i)&&t.rewriteUrl(i,r)}};t._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",e)},n.init=function(t,e){function i(e){for(var i=e.length,r=[],n=0;n0?(this.setRefferId(e),this.addListen(),this.option=e.linker,void(this.option=i(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=i(n,"SiteLinker","sdkReady");return s}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SiteLinker=function(){"use strict";function t(t,i,r){if(i&&(t.plugin_name=i),r&&t.init){var n=t.init;t.init=function(s,o){function a(){n.call(t,s,o)}return e(s,t,i),s.readyState&&s.readyState.state>=3||!s.on?a():void s.on(r,a)}}return t}function e(t,e,i){function r(e,r){t.logger?t.logger.msg.apply(t.logger,r).module(i+""||"").level(e).log():t.log&&t.log.apply(t,r)}e.log=function(){r("log",arguments)},e.warn=function(){r("warn",arguments)},e.error=function(){r("error",arguments)}}function i(e,i,n){return t(e,i,n),e.plugin_version=r,e}var r="1.26.9",n={};n.getPart=function(t){var e=!1,i=this.option.length;if(i)for(var r=0;r-1)return!0;return e},n.getPartHash=function(t){var e=this.option.length,i=!1;if(e)for(var r=0;r-1)return this.option[r].after_hash;return!!i},n.getCurrenId=function(){var t=this.store.getDistinctId()||"",e=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?t=t?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(t))):"":this._.rot13obfs&&(t=t?this._.rot13obfs(t):"");var i=e?"f"+t:"d"+t;return encodeURIComponent(i)},n.rewriteUrl=function(t,e){var i=this,r=/([^?#]+)(\?[^#]*)?(#.*)?/,n=r.exec(t),s="";if(n){var o,a=n[1]||"",u=n[2]||"",d=n[3]||"",f="_sasdk="+this.getCurrenId(),h=function(t){var e=t.split("&"),r=[];return i._.each(e,function(t){t.indexOf("_sasdk=")>-1?r.push(f):r.push(t)}),r.join("&")};if(this.getPartHash(t)){o=d.indexOf("_sasdk");var g=d.indexOf("?");s=g>-1?o>-1?a+u+"#"+d.substring(1,o)+h(d.substring(o,d.length)):a+u+d+"&"+f:a+u+"#"+d.substring(1)+"?"+f}else{o=u.indexOf("_sasdk");var l=/^\?(\w)+/.test(u);s=l?o>-1?a+"?"+h(u.substring(1))+d:a+u+"&"+f+d:a+"?"+f+d}return e&&(e.href=s),s}},n.getUrlId=function(){var t=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(t)&&t[1]){var e=decodeURIComponent(t[1]);return!e||"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}return""},n.setRefferId=function(t){var e=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var r="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==e&&(r?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:e,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!t.re_login||this.sd.login(i))}},n.addListen=function(){var t=this,e=function(e){var i,r,n=e.target,s=n.tagName.toLowerCase(),o=n.parentNode;if("a"===s&&n.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===s&&n.href?(i=n.href,r=n):(i=o.href,r=o);var a=t._.URL(i),u=a.protocol;"http:"!==u&&"https:"!==u||t.getPart(i)&&t.rewriteUrl(i,r)}};t._.addEvent(document,"mousedown",e),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&t._.addEvent(document,"pointerdown",e)},n.init=function(t,e){function i(e){for(var i=e.length,r=[],n=0;n0?(this.setRefferId(e),this.addListen(),this.option=e.linker,void(this.option=i(this.option))):void t.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var s=i(n,"SiteLinker","sdkReady");return s}(); \ No newline at end of file diff --git a/dist/web/plugin/sm-encryption/index.closure.js b/dist/web/plugin/sm-encryption/index.closure.js index 41584c53..fdf37e59 100644 --- a/dist/web/plugin/sm-encryption/index.closure.js +++ b/dist/web/plugin/sm-encryption/index.closure.js @@ -1,3 +1,3 @@ !function(){"use strict";function t(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:i})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(e.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var n in t)e.d(i,n,function(e){return t[e]}.bind(null,n));return i},e.n=function(t){var r=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=2)}function e(){return t(S())}function r(){function t(t){for(var e=t.length;--e>=0;)t[e]=0}function e(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function i(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}function n(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ee,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*le),this.dyn_dtree=new Uint16Array(2*(2*he+1)),this.bl_tree=new Uint16Array(2*(2*ue+1)),De(this.dyn_ltree),De(this.dyn_dtree),De(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(fe+1),this.heap=new Uint16Array(2*ae+1),De(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*ae+1),De(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function s(t){"@babel/helpers - typeof";return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function a(t){this.options=vr.assign({level:qr,method:Pr,chunkSize:16384,windowBits:15,memLevel:8,strategy:Zr},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Br,this.strm.avail_out=0;var r=pr.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Rr)throw new Error(Dt[r]);if(e.header&&pr.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(i="string"==typeof e.dictionary?Er.string2buf(e.dictionary):"[object ArrayBuffer]"===zr.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=pr.deflateSetDictionary(this.strm,i),r!==Rr)throw new Error(Dt[r]);this._dict_set=!0}}function h(t,e){var r=new a(e);if(r.push(t,!0),r.err)throw r.msg||Dt[r.err];return r.result}function u(t,e){return e=e||{},e.raw=!0,h(t,e)}function l(t,e){return e=e||{},e.gzip=!0,h(t,e)}var f=4,c=0,p=1,d=2,_=0,g=1,v=2,m=3,y=258,w=29,b=256,T=b+1+w,x=30,F=19,S=2*T+1,E=15,B=16,z=7,A=256,k=16,D=17,I=18,R=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),O=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),q=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Z=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),P=512,M=new Array(2*(T+2));t(M);var C=new Array(2*x);t(C);var U=new Array(P);t(U);var L=new Array(y-m+1);t(L);var N=new Array(w);t(N);var H=new Array(x);t(H);var j,V,K,Y=function(t){return t<256?U[t]:U[256+(t>>>7)]},X=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},G=function(t,e,r){t.bi_valid>B-r?(t.bi_buf|=e<>B-t.bi_valid,t.bi_valid+=r-B):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0);return r>>>1},$=function(t){16===t.bi_valid?(X(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)},Q=function(t,e){var r,i,n,s,o,a,h=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,c=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,d=e.stat_desc.max_length,_=0;for(s=0;s<=E;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;rd&&(s=d,_++),h[2*i+1]=s,i>u||(t.bl_count[s]++,o=0,i>=p&&(o=c[i-p]),a=h[2*i],t.opt_len+=a*(s+o),f&&(t.static_len+=a*(l[2*i+1]+o)));if(0!==_){do{for(s=d-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[d]--,_-=2}while(_>0);for(s=d;0!==s;s--)for(i=t.bl_count[s];0!==i;)n=t.heap[--r],n>u||(h[2*n+1]!==s&&(t.opt_len+=(s-h[2*n+1])*h[2*n],h[2*n+1]=s),i--)}},tt=function(t,e,r){var i,n,s=new Array(E+1),o=0;for(i=1;i<=E;i++)o=o+r[i-1]<<1,s[i]=o;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=W(s[a]++,a))}},et=function(){var t,r,i,n,s,o=new Array(E+1);for(i=0,n=0;n>=7;n8?X(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},nt=function(t,e,r,i){var n=2*e,s=2*r;return t[n]>1;r>=1;r--)st(t,s,r);n=h;do r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],st(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,st(t,s,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Q(t,e),tt(s,u,t.bl_count)},ht=function(t,e,r){var i,n,s=-1,o=e[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=o,o=e[2*(i+1)+1],++a=3&&0===t.bl_tree[2*Z[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e},ft=function(t,e,r,i){var n;for(G(t,e-257,5),G(t,r-1,5),G(t,i-4,4),n=0;n>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return c;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return p;for(e=32;e0?(t.strm.data_type===d&&(t.strm.data_type=ct(t)),at(t,t.l_desc),at(t,t.d_desc),o=lt(t),n=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=n&&(n=s)):n=s=r+5,r+4<=n&&e!==-1?_t(t,e,r,i):t.strategy===f||s===n?(G(t,(g<<1)+(i?1:0),3),ot(t,M,C)):(G(t,(v<<1)+(i?1:0),3),ft(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),ot(t,t.dyn_ltree,t.dyn_dtree)),rt(t),i&&it(t)},mt=function(t,e,r){return t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(L[r]+b+1)]++,t.dyn_dtree[2*Y(e)]++),t.sym_next===t.sym_end},yt=dt,wt=_t,bt=vt,Tt=mt,xt=gt,Ft={_tr_init:yt,_tr_stored_block:wt,_tr_flush_block:bt,_tr_tally:Tt,_tr_align:xt},St=function(t,e,r,i){for(var n=65535&t|0,s=t>>>16&65535|0,o=0;0!==r;){o=r>2e3?2e3:r,r-=o;do n=n+e[i++]|0,s=s+n|0;while(--o);n%=65521,s%=65521}return n|s<<16|0},Et=St,Bt=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e},zt=new Uint32Array(Bt()),At=function(t,e,r,i){var n=zt,s=i+r;t^=-1;for(var o=i;o>>8^n[255&(t^e[o])];return t^-1},kt=At,Dt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},It={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},Rt=Ft._tr_init,Ot=Ft._tr_stored_block,qt=Ft._tr_flush_block,Zt=Ft._tr_tally,Pt=Ft._tr_align,Mt=It.Z_NO_FLUSH,Ct=It.Z_PARTIAL_FLUSH,Ut=It.Z_FULL_FLUSH,Lt=It.Z_FINISH,Nt=It.Z_BLOCK,Ht=It.Z_OK,jt=It.Z_STREAM_END,Vt=It.Z_STREAM_ERROR,Kt=It.Z_DATA_ERROR,Yt=It.Z_BUF_ERROR,Xt=It.Z_DEFAULT_COMPRESSION,Gt=It.Z_FILTERED,Jt=It.Z_HUFFMAN_ONLY,Wt=It.Z_RLE,$t=It.Z_FIXED,Qt=It.Z_DEFAULT_STRATEGY,te=It.Z_UNKNOWN,ee=It.Z_DEFLATED,re=9,ie=15,ne=8,se=29,oe=256,ae=oe+1+se,he=30,ue=19,le=2*ae+1,fe=15,ce=3,pe=258,de=pe+ce+1,_e=32,ge=42,ve=57,me=69,ye=73,we=91,be=103,Te=113,xe=666,Fe=1,Se=2,Ee=3,Be=4,ze=3,Ae=function(t,e){return t.msg=Dt[e],e},ke=function(t){return 2*t-(t>4?9:0)},De=function(t){for(var e=t.length;--e>=0;)t[e]=0},Ie=function(t){var e,r,i,n=t.w_size;e=t.hash_size,i=e;do r=t.head[--i],t.head[i]=r>=n?r-n:0;while(--e);e=n,i=e;do r=t.prev[--i],t.prev[i]=r>=n?r-n:0;while(--e)},Re=function(t,e,r){return(e<t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},Ze=function(t,e){qt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,qe(t.strm)},Pe=function(t,e){t.pending_buf[t.pending++]=e},Me=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Ce=function(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),r),1===t.state.wrap?t.adler=Et(t.adler,e,n,r):2===t.state.wrap&&(t.adler=kt(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)},Ue=function(t,e){var r,i,n=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-de?t.strstart-(t.w_size-de):0,u=t.window,l=t.w_mask,f=t.prev,c=t.strstart+pe,p=u[s+o-1],d=u[s+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do if(r=e,u[r+o]===d&&u[r+o-1]===p&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do;while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&so){if(t.match_start=e,o=i,i>=a)break;p=u[s+o-1],d=u[s+o]}}while((e=f[e&l])>h&&0!==--n);return o<=t.lookahead?o:t.lookahead},Le=function(t){var e,r,i,n=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=n+(n-de)&&(t.window.set(t.window.subarray(n,n+n-r),0),t.match_start-=n,t.strstart-=n,t.block_start-=n,t.insert>t.strstart&&(t.insert=t.strstart),Ie(t),r+=n),0===t.strm.avail_in)break;if(e=Ce(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=e,t.lookahead+t.insert>=ce)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Oe(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Oe(t,t.ins_h,t.window[i+ce-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insertt.w_size?t.w_size:t.pending_buf_size-5,o=0,a=t.strm.avail_in;do{if(r=65535,n=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(r=i+t.strm.avail_in),r>n&&(r=n),r>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,qe(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(Ce(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===o);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_watern&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(Ce(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===Lt)&&e!==Mt&&0===t.strm.avail_in&&i<=n)&&(r=i>n?n:i,o=e===Lt&&0===t.strm.avail_in&&r===i?1:0,Ot(t,t.block_start,r,o),t.block_start+=r,qe(t.strm)),o?Ee:Fe)},He=function(t,e){for(var r,i;;){if(t.lookahead=ce&&(t.ins_h=Oe(t,t.ins_h,t.window[t.strstart+ce-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-de&&(t.match_length=Ue(t,r)),t.match_length>=ce)if(i=Zt(t,t.strstart-t.match_start,t.match_length-ce),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ce){t.match_length--;do t.strstart++,t.ins_h=Oe(t,t.ins_h,t.window[t.strstart+ce-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Oe(t,t.ins_h,t.window[t.strstart+1]);else i=Zt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(Ze(t,!1),0===t.strm.avail_out))return Fe}return t.insert=t.strstart=ce&&(t.ins_h=Oe(t,t.ins_h,t.window[t.strstart+ce-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=ce-1,0!==r&&t.prev_length4096)&&(t.match_length=ce-1)),t.prev_length>=ce&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ce,i=Zt(t,t.strstart-1-t.prev_match,t.prev_length-ce),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=Oe(t,t.ins_h,t.window[t.strstart+ce-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(0!==--t.prev_length);if(t.match_available=0,t.match_length=ce-1,t.strstart++,i&&(Ze(t,!1),0===t.strm.avail_out))return Fe}else if(t.match_available){if(i=Zt(t,0,t.window[t.strstart-1]),i&&Ze(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return Fe}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=Zt(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart=ce&&t.strstart>0&&(n=t.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){s=t.strstart+pe;do;while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ce?(r=Zt(t,1,t.match_length-ce),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Zt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Ze(t,!1),0===t.strm.avail_out))return Fe}return t.insert=0,e===Lt?(Ze(t,!0),0===t.strm.avail_out?Ee:Be):t.sym_next&&(Ze(t,!1),0===t.strm.avail_out)?Fe:Se},Ke=function(t,e){for(var r;;){if(0===t.lookahead&&(Le(t),0===t.lookahead)){if(e===Mt)return Fe;break}if(t.match_length=0,r=Zt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Ze(t,!1),0===t.strm.avail_out))return Fe}return t.insert=0,e===Lt?(Ze(t,!0),0===t.strm.avail_out?Ee:Be):t.sym_next&&(Ze(t,!1),0===t.strm.avail_out)?Fe:Se},Ye=[new i(0,0,0,0,Ne),new i(4,4,8,4,He),new i(4,5,16,8,He),new i(4,6,32,32,He),new i(4,4,16,16,je),new i(8,16,32,32,je),new i(8,16,128,128,je),new i(8,32,128,256,je),new i(32,128,258,1024,je),new i(32,258,258,4096,je)],Xe=function(t){t.window_size=2*t.w_size,De(t.head),t.max_lazy_match=Ye[t.level].max_lazy,t.good_match=Ye[t.level].good_length,t.nice_match=Ye[t.level].nice_length,t.max_chain_length=Ye[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ce-1,t.match_available=0,t.ins_h=0},Ge=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||e.status!==ge&&e.status!==ve&&e.status!==me&&e.status!==ye&&e.status!==we&&e.status!==be&&e.status!==Te&&e.status!==xe?1:0},Je=function(t){if(Ge(t))return Ae(t,Vt);t.total_in=t.total_out=0,t.data_type=te;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?ve:e.wrap?ge:Te,t.adler=2===e.wrap?0:1,e.last_flush=-2,Rt(e),Ht},We=function(t){var e=Je(t);return e===Ht&&Xe(t.state),e},$e=function(t,e){return Ge(t)||2!==t.state.wrap?Vt:(t.state.gzhead=e,Ht)},Qe=function(t,e,r,i,s,o){if(!t)return Vt;var a=1;if(e===Xt&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),s<1||s>re||r!==ee||i<8||i>15||e<0||e>9||o<0||o>$t||8===i&&1!==a)return Ae(t,Vt);8===i&&(i=9);var h=new n;return t.state=h,h.strm=t,h.status=ge,h.wrap=a,h.gzhead=null,h.w_bits=i,h.w_size=1<Nt||e<0)return t?Ae(t,Vt):Vt;var r=t.state;if(!t.output||0!==t.avail_in&&!t.input||r.status===xe&&e!==Lt)return Ae(t,0===t.avail_out?Yt:Vt);var i=r.last_flush;if(r.last_flush=e,0!==r.pending){if(qe(t),0===t.avail_out)return r.last_flush=-1,Ht}else if(0===t.avail_in&&ke(e)<=ke(i)&&e!==Lt)return Ae(t,Yt);if(r.status===xe&&0!==t.avail_in)return Ae(t,Yt);if(r.status===ge&&0===r.wrap&&(r.status=Te),r.status===ge){var n=ee+(r.w_bits-8<<4)<<8,s=-1;if(s=r.strategy>=Jt||r.level<2?0:r.level<6?1:6===r.level?2:3,n|=s<<6,0!==r.strstart&&(n|=_e),n+=31-n%31,Me(r,n),0!==r.strstart&&(Me(r,t.adler>>>16),Me(r,65535&t.adler)),t.adler=1,r.status=Te,qe(t),0!==r.pending)return r.last_flush=-1,Ht}if(r.status===ve)if(t.adler=0,Pe(r,31),Pe(r,139),Pe(r,8),r.gzhead)Pe(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Pe(r,255&r.gzhead.time),Pe(r,r.gzhead.time>>8&255),Pe(r,r.gzhead.time>>16&255),Pe(r,r.gzhead.time>>24&255),Pe(r,9===r.level?2:r.strategy>=Jt||r.level<2?4:0),Pe(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Pe(r,255&r.gzhead.extra.length),Pe(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=kt(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=me;else if(Pe(r,0),Pe(r,0),Pe(r,0),Pe(r,0),Pe(r,0),Pe(r,9===r.level?2:r.strategy>=Jt||r.level<2?4:0),Pe(r,ze),r.status=Te,qe(t),0!==r.pending)return r.last_flush=-1,Ht;if(r.status===me){if(r.gzhead.extra){for(var o=r.pending,a=(65535&r.gzhead.extra.length)-r.gzindex;r.pending+a>r.pending_buf_size;){var h=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+h),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>o&&(t.adler=kt(t.adler,r.pending_buf,r.pending-o,o)),r.gzindex+=h,qe(t),0!==r.pending)return r.last_flush=-1,Ht;o=0,a-=h}var u=new Uint8Array(r.gzhead.extra);r.pending_buf.set(u.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>o&&(t.adler=kt(t.adler,r.pending_buf,r.pending-o,o)),r.gzindex=0}r.status=ye}if(r.status===ye){if(r.gzhead.name){var l,f=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>f&&(t.adler=kt(t.adler,r.pending_buf,r.pending-f,f)),qe(t),0!==r.pending)return r.last_flush=-1,Ht;f=0}l=r.gzindexf&&(t.adler=kt(t.adler,r.pending_buf,r.pending-f,f)),r.gzindex=0}r.status=we}if(r.status===we){if(r.gzhead.comment){var c,p=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>p&&(t.adler=kt(t.adler,r.pending_buf,r.pending-p,p)),qe(t),0!==r.pending)return r.last_flush=-1,Ht;p=0}c=r.gzindexp&&(t.adler=kt(t.adler,r.pending_buf,r.pending-p,p))}r.status=be}if(r.status===be){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(qe(t),0!==r.pending))return r.last_flush=-1,Ht;Pe(r,255&t.adler),Pe(r,t.adler>>8&255),t.adler=0}if(r.status=Te,qe(t),0!==r.pending)return r.last_flush=-1,Ht}if(0!==t.avail_in||0!==r.lookahead||e!==Mt&&r.status!==xe){var d=0===r.level?Ne(r,e):r.strategy===Jt?Ke(r,e):r.strategy===Wt?Ve(r,e):Ye[r.level].func(r,e);if(d!==Ee&&d!==Be||(r.status=xe),d===Fe||d===Ee)return 0===t.avail_out&&(r.last_flush=-1),Ht;if(d===Se&&(e===Ct?Pt(r):e!==Nt&&(Ot(r,0,0,!1),e===Ut&&(De(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),qe(t),0===t.avail_out))return r.last_flush=-1,Ht}return e!==Lt?Ht:r.wrap<=0?jt:(2===r.wrap?(Pe(r,255&t.adler),Pe(r,t.adler>>8&255),Pe(r,t.adler>>16&255),Pe(r,t.adler>>24&255),Pe(r,255&t.total_in),Pe(r,t.total_in>>8&255),Pe(r,t.total_in>>16&255),Pe(r,t.total_in>>24&255)):(Me(r,t.adler>>>16),Me(r,65535&t.adler)),qe(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Ht:jt)},rr=function(t){if(Ge(t))return Vt;var e=t.state.status;return t.state=null,e===Te?Ae(t,Kt):Ht},ir=function(t,e){var r=e.length;if(Ge(t))return Vt;var i=t.state,n=i.wrap;if(2===n||1===n&&i.status!==ge||i.lookahead)return Vt;if(1===n&&(t.adler=Et(t.adler,e,r,0)),i.wrap=0,r>=i.w_size){0===n&&(De(i.head),i.strstart=0,i.block_start=0,i.insert=0);var s=new Uint8Array(i.w_size);s.set(e.subarray(r-i.w_size,r),0),e=s,r=i.w_size}var o=t.avail_in,a=t.next_in,h=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Le(i);i.lookahead>=ce;){var u=i.strstart,l=i.lookahead-(ce-1);do i.ins_h=Oe(i,i.ins_h,i.window[u+ce-1]),i.prev[u&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=u,u++;while(--l);i.strstart=u,i.lookahead=ce-1,Le(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=ce-1,i.match_available=0,t.next_in=a,t.input=h,t.avail_in=o,i.wrap=n,Ht},nr=tr,sr=Qe,or=We,ar=Je,hr=$e,ur=er,lr=rr,fr=ir,cr="pako deflate (from Nodeca project)",pr={deflateInit:nr,deflateInit2:sr,deflateReset:or,deflateResetKeep:ar,deflateSetHeader:hr,deflate:ur,deflateEnd:lr,deflateSetDictionary:fr,deflateInfo:cr},dr=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},_r=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!==s(r))throw new TypeError(r+"must be non-object");for(var i in r)dr(r,i)&&(t[i]=r[i])}}return t},gr=function(t){for(var e=0,r=0,i=t.length;r=252?6:br>=248?5:br>=240?4:br>=224?3:br>=192?2:1;wr[254]=wr[254]=1;var Tr=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,r,i,n,s,o=t.length,a=0;for(n=0;n>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e},xr=function(t,e){if(e<65534&&t.subarray&&mr)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var r="",i=0;i4)s[n++]=65533,i+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&i1?s[n++]=65533:o<65536?s[n++]=o:(o-=65536,s[n++]=55296|o>>10&1023,s[n++]=56320|1023&o)}}}return xr(s,n)},Sr=function(t,e){e=e||t.length,e>t.length&&(e=t.length);for(var r=e-1;r>=0&&128===(192&t[r]);)r--;return r<0?e:0===r?e:r+wr[t[r]]>e?r:e},Er={string2buf:Tr,buf2string:Fr,utf8border:Sr},Br=o,zr=Object.prototype.toString,Ar=It.Z_NO_FLUSH,kr=It.Z_SYNC_FLUSH,Dr=It.Z_FULL_FLUSH,Ir=It.Z_FINISH,Rr=It.Z_OK,Or=It.Z_STREAM_END,qr=It.Z_DEFAULT_COMPRESSION,Zr=It.Z_DEFAULT_STRATEGY,Pr=It.Z_DEFLATED;a.prototype.push=function(t,e){var r,i,n=this.strm,s=this.options.chunkSize;if(this.ended)return!1;for(i=e===~~e?e:e===!0?Ir:Ar,"string"==typeof t?n.input=Er.string2buf(t):"[object ArrayBuffer]"===zr.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(s),n.next_out=0,n.avail_out=s),(i===kr||i===Dr)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(r=pr.deflate(n,i),r===Or)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=pr.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Rr;if(0!==n.avail_out){if(i>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},a.prototype.onData=function(t){this.chunks.push(t)},a.prototype.onEnd=function(t){t===Rr&&(this.result=vr.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Mr=a,Cr=h,Ur=u,Lr=l,Nr=It,Hr={Deflate:Mr,deflate:Cr,deflateRaw:Ur,gzip:Lr,constants:Nr};return Hr}function i(t,e,r){if(e&&(t.plugin_name=e),r&&t.init){var i=t.init;t.init=function(s,o){function a(){i.call(t,s,o)}return n(s,t,e),s.readyState&&s.readyState.state>=3||!s.on?a():void s.on(r,a)}}return t}function n(t,e,r){function i(e,i){t.logger?t.logger.msg.apply(t.logger,i).module(r+""||"").level(e).log():t.log&&t.log.apply(t,i)}e.log=function(){i("log",arguments)},e.warn=function(){i("warn",arguments)},e.error=function(){i("error",arguments)}}function s(t,e,r){return i(t,e,r),t.plugin_version=E,t}function o(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(255*T._.getRandom()).toString(16);e+=2===r.length?r:"0"+r}return e}function a(t,e,r){return typeof t===r||(b.error(e+" must be "+r),!1)}function h(t,e){return!!t||(b.error(e+" cant not be null"),!1)}function u(){try{var t=new Uint8Array(1);return t[0]=1,1===t[0]}catch(e){return!1}}function l(t){return btoa(String.fromCharCode.apply(null,t.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")))}function f(t){t=JSON.stringify(t),t=Array.prototype.slice.call(F.gzip(t));var e=_.encrypt(t,v,{mode:"cbc",iv:y});return l(y+e)}function c(t){try{var e="",r=f(t);e={pkv:x.pkv,ekey:m,flush_time:T._.now(),payloads:[r]};var i=JSON.stringify(e),n="crc="+T._.hashCode(i);return"data="+encodeURIComponent(i)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(s){b.error("SM encryption error, data will not be encrypted")}return w.call(T.kit,t)}function p(t,e){for(var r=0;r<10;){r++;var i=d.doEncrypt(g(t).slice(),e,1); if("0"!==i[0]||"4"!==i[1])return l(i)}throw"generate SM4 ekey failed"}var d,_,g,v,m,y,w,b,T,x,F,S=function(){function t(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function e(){return new t(null)}function r(t,e,r,i,n,s){for(;--s>=0;){var o=e*this[t++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n}function i(t,e,r,i,n,s){for(var o=32767&e,a=e>>15;--s>=0;){var h=32767&this[t],u=this[t++]>>15,l=a*h+u*o;h=o*h+((32767&l)<<15)+r[i]+(1073741823&n),n=(h>>>30)+(l>>>15)+a*u+(n>>>30),r[i++]=1073741823&h}return n}function n(t,e,r,i,n,s){for(var o=16383&e,a=e>>14;--s>=0;){var h=16383&this[t],u=this[t++]>>14,l=a*h+u*o;h=o*h+((16383&l)<<14)+r[i]+n,n=(h>>28)+(l>>14)+a*u,r[i++]=268435455&h}return n}function s(t){return de.charAt(t)}function o(t,e){var r=_e[t.charCodeAt(e)];return null==r?-1:r}function a(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function h(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function u(t){var r=e();return r.fromInt(t),r}function l(e,r){if(!r&&e.length>=2&&"0"===e[0]){var i=!0;switch(e[1]){case"x":r=16;break;case"b":r=2;break;case"o":r=8;break;default:i=!1}i&&(e=e.substr(2))}var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(e,r);n=2}this.t=0,this.s=0;for(var s=e.length,a=!1,h=0;--s>=0;){var u=8==n?255&e[s]:o(e,s);u<0?"-"==e.charAt(s)&&(a=!0):(a=!1,0==h?this[this.t++]=u:h+n>this.DB?(this[this.t-1]|=(u&(1<>this.DB-h):this[this.t-1]|=u<=this.DB&&(h-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,h>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t}function c(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,i=(1<0)for(h>h)>0&&(n=!0,o=s(r));a>=0;)h>(h+=this.DB-e)):(r=this[a]>>(h-=e)&i,h<=0&&(h+=this.DB,--a)),r>0&&(n=!0),n&&(o+=s(r));return n?o:"0"}function p(){var r=e();return t.ZERO.subTo(this,r),r}function d(){return this.s<0?this.negate():this}function _(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(e=r-t.t,0!=e)return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0}function g(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function v(){return this.t<=0?0:this.DB*(this.t-1)+g(this[this.t-1]^this.s&this.DM)}function m(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s}function y(t,e){for(var r=t;r=0;--r)e[r+o+1]=this[r]>>n|a,a=(this[r]&s)<=0;--r)e[r]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()}function b(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)return void(e.t=0);var i=t%this.DB,n=this.DB-i,s=(1<>i;for(var o=r+1;o>i;i>0&&(e[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[r++]=this.DV+i:i>0&&(e[r++]=i),e.t=r,e.clamp()}function x(e,r){var i=this.abs(),n=e.abs(),s=i.t;for(r.t=s+n.t;--s>=0;)r[s]=0;for(s=0;s=0;)t[r]=0;for(r=0;r=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()}function S(r,i,n){var s=r.abs();if(!(s.t<=0)){var o=this.abs();if(o.t0?(s.lShiftTo(l,a),o.lShiftTo(l,n)):(s.copyTo(a),o.copyTo(n));var f=a.t,c=a[f-1];if(0!=c){var p=c*(1<1?a[f-2]>>this.F2:0),d=this.FV/p,_=(1<=0&&(n[n.t++]=1,n.subTo(w,n)),t.ONE.dlShiftTo(f,w),w.subTo(a,a);a.t=0;){var b=n[--m]==c?this.DM:Math.floor(n[m]*d+(n[m-1]+v)*_);if((n[m]+=a.am(0,b,n,y,0,f))0&&n.rShiftTo(l,n),h<0&&t.ZERO.subTo(n,n)}}}function E(r){var i=e();return this.abs().divRemTo(r,null,i),this.s<0&&i.compareTo(t.ZERO)>0&&r.subTo(i,i),i}function B(t){this.m=t}function z(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function A(t){return t}function k(t){t.divRemTo(this.m,null,t)}function D(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function I(t,e){t.squareTo(e),this.reduce(e)}function R(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function O(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(i,i),i}function Z(t){var r=e();return t.copyTo(r),this.reduce(r),r}function P(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t[r]+=this.m.am(0,i,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function M(t,e){t.squareTo(e),this.reduce(e)}function C(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function U(){return 0==(this.t>0?1&this[0]:this.s)}function L(r,i){if(r>4294967295||r<1)return t.ONE;var n=e(),s=e(),o=i.convert(this),a=g(r)-1;for(o.copyTo(n);--a>=0;)if(i.sqrTo(n,s),(r&1<0)i.mulTo(s,o,n);else{var h=n;n=s,s=h}return i.revert(n)}function N(t,e){var r;return r=t<256||e.isEven()?new B(e):new O(e),this.exp(t,r)}function H(){var t=e();return this.copyTo(t),t}function j(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function K(){return 0==this.t?this.s:this[0]<<16>>16}function Y(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function X(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function G(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var r=this.chunkSize(t),i=Math.pow(t,r),n=u(i),s=e(),o=e(),a="";for(this.divRemTo(n,s,o);s.signum()>0;)a=(i+o.intValue()).toString(t).substr(1)+a,s.divRemTo(n,s,o);return o.intValue().toString(t)+a}function J(e,r){this.fromInt(0),null==r&&(r=10);for(var i=this.chunkSize(r),n=Math.pow(r,i),s=!1,a=0,h=0,u=0;u=i&&(this.dMultiply(n),this.dAddOffset(h,0),a=0,h=0))}a>0&&(this.dMultiply(Math.pow(r,a)),this.dAddOffset(h,0)),s&&t.ZERO.subTo(this,this)}function W(e,r,i){if("number"==typeof r)if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),st,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var n=new Array,s=7&e;n.length=(e>>3)+1,r.nextBytes(n),s>0?n[0]&=(1<0)for(i>i)!=(this.s&this.DM)>>i&&(e[n++]=r|this.s<=0;)i<8?(r=(this[t]&(1<>(i+=this.DB-8)):(r=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(e[n++]=r);return e}function Q(t){return 0==this.compareTo(t)}function tt(t){return this.compareTo(t)<0?this:t}function et(t){return this.compareTo(t)>0?this:t}function rt(t,e,r){var i,n,s=Math.min(t.t,this.t);for(i=0;i>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function _t(){for(var t=0;t=this.t?0!=this.s:0!=(this[e]&1<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e[r++]=i:i<-1&&(e[r++]=this.DV+i),e.t=r,e.clamp()}function Ft(t){var r=e();return this.addTo(t,r),r}function St(t){var r=e();return this.subTo(t,r),r}function Et(t){var r=e();return this.multiplyTo(t,r),r}function Bt(){var t=e();return this.squareTo(t),t}function zt(t){var r=e();return this.divRemTo(t,r,null),r}function At(t){var r=e();return this.divRemTo(t,null,r),r}function kt(t){var r=e(),i=e();return this.divRemTo(t,r,i),new Array(r,i)}function Dt(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function It(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function Rt(){}function Ot(t){return t}function qt(t,e,r){t.multiplyTo(e,r)}function Zt(t,e){t.squareTo(e)}function Pt(t){return this.exp(t,new Rt)}function Mt(t,e,r){var i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;var n;for(n=r.t-this.t;i=0;)r[i]=0;for(i=Math.max(e-this.t,0);i2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var r=e();return t.copyTo(r),this.reduce(r),r}function Nt(t){return t}function Ht(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function jt(t,e){t.squareTo(e),this.reduce(e)}function Vt(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function Kt(t,r){var i,n,s=t.bitLength(),o=u(1);if(s<=0)return o;i=s<18?1:s<48?3:s<144?4:s<768?5:6,n=s<8?new B(r):r.isEven()?new Ut(r):new O(r);var a=new Array,h=3,l=i-1,f=(1<1){var c=e();for(n.sqrTo(a[1],c);h<=f;)a[h]=e(),n.mulTo(c,a[h-2],a[h]),h+=2}var p,d,_=t.t-1,v=!0,m=e();for(s=g(t[_])-1;_>=0;){for(s>=l?p=t[_]>>s-l&f:(p=(t[_]&(1<0&&(p|=t[_-1]>>this.DB+s-l)),h=i;0==(1&p);)p>>=1,--h;if((s-=h)<0&&(s+=this.DB,--_),v)a[p].copyTo(o),v=!1;else{for(;h>1;)n.sqrTo(o,m),n.sqrTo(m,o),h-=2;h>0?n.sqrTo(o,m):(d=o,o=m,m=d),n.mulTo(m,a[p],o)}for(;_>=0&&0==(t[_]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function Xt(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this[i])%t;return r}function Gt(e){var r=e.isEven();if(this.isEven()&&r||0==e.signum())return t.ZERO;for(var i=e.clone(),n=this.clone(),s=u(1),o=u(0),a=u(0),h=u(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),r?(s.isEven()&&o.isEven()||(s.addTo(this,s),o.subTo(e,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),r?(a.isEven()&&h.isEven()||(a.addTo(this,a),h.subTo(e,h)),a.rShiftTo(1,a)):h.isEven()||h.subTo(e,h),h.rShiftTo(1,h);i.compareTo(n)>=0?(i.subTo(n,i),r&&s.subTo(a,s),o.subTo(h,o)):(n.subTo(i,n),r&&a.subTo(s,a),h.subTo(o,h))}return 0!=n.compareTo(t.ONE)?t.ZERO:h.compareTo(e)>=0?h.subtract(e):h.signum()<0?(h.addTo(e,h),h.signum()<0?h.add(e):h):h}function Jt(t){var e,r=this.abs();if(1==r.t&&r[0]<=ge[ge.length-1]){for(e=0;e>1,r>ge.length&&(r=ge.length);for(var o=e(),a=0;a>8&255,ye[we++]^=t>>16&255,ye[we++]^=t>>24&255,we>=Fe&&(we-=Fe)}function Qt(){$t((new Date).getTime())}function te(){if(null==me){for(Qt(),me=oe(),me.init(ye),we=0;we>>8,ye[we++]=255&be;we=0,Qt()}re.prototype.nextBytes=ee,ie.prototype.init=ne,ie.prototype.next=se;var Fe=256,Se={BigInteger:t,SecureRandom:re};return[function(t,e){t.exports=Se},function(t,e,r){function i(t,e){var r=31&e;return t<>>32-r}function n(t,e){for(var r=[],i=t.length-1;i>=0;i--)r[i]=255&(t[i]^e[i]);return r}function s(t){return t^i(t,9)^i(t,17)}function o(t){return t^i(t,15)^i(t,23)}function a(t){var e=8*t.length,r=e%512;r=r>=448?512-r%448-1:448-r-1;for(var n=new Array((r-7)/8),a=new Array(8),h=0,f=n.length;h=0;d--)if(e.length>8){var _=e.length-8;a[d]=parseInt(e.substr(_),2),e=e.substr(0,_)}else e.length>0&&(a[d]=parseInt(e,2),e="");for(var g=new Uint8Array([].concat(t,[128],n,a)),v=new DataView(g.buffer,0),m=g.length/64,y=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]),w=0;w=0&&L<=15?E:B,Z=i(i(z,12)+I+i(U,L),7),P=Z^i(z,12),M=(L>=0&&L<=15?z^A^k:z&A|z&k|A&k)+D+P+l[L],C=(L>=0&&L<=15?I^R^O:I&R|~I&O)+q+Z+u[L],D=k,k=i(A,9),A=z,z=M,q=O,O=i(R,19),R=I,I=s(C);y[0]^=z,y[1]^=A,y[2]^=k,y[3]^=D,y[4]^=I,y[5]^=R,y[6]^=O,y[7]^=q}for(var N=[],H=0,j=y.length;H>>24,(16711680&V)>>>16,(65280&V)>>>8,255&V)}return N}function h(t,e){for(e.length>f&&(e=a(e));e.length2&&void 0!==arguments[2]?arguments[2]:1;t="string"==typeof t?_.hexToArray(_.utf8ToHex(t)):Array.prototype.slice.call(t),e=_.getGlobalCurve().decodePointHex(e);var i=_.generateKeyPairHex(),n=new f(i.privateKey,16),s=i.publicKey;s.length>128&&(s=s.substr(s.length-128));var o=e.multiply(n),a=_.hexToArray(_.leftPad(o.getX().toBigInteger().toRadix(16),64)),h=_.hexToArray(_.leftPad(o.getY().toBigInteger().toRadix(16),64)),u=_.arrayToHex(g([].concat(a,t,h))),l=1,c=0,p=[],d=[].concat(a,h),v=function(){p=g([].concat(d,[l>>24&255,l>>16&255,l>>8&255,255&l])),l++,c=0};v();for(var m=0,y=t.length;m2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i.output,s=void 0===n?"string":n;e=new f(e,16);var o=t.substr(128,64),a=t.substr(192);r===b&&(o=t.substr(t.length-64),a=t.substr(128,t.length-128-64));var h=_.hexToArray(a),u=_.getGlobalCurve().decodePointHex("04"+t.substr(0,128)),l=u.multiply(e),c=_.hexToArray(_.leftPad(l.getX().toBigInteger().toRadix(16),64)),p=_.hexToArray(_.leftPad(l.getY().toBigInteger().toRadix(16),64)),d=1,v=0,m=[],y=[].concat(c,p),w=function(){m=g([].concat(y,[d>>24&255,d>>16&255,d>>8&255,255&d])),d++,v=0};w();for(var T=0,x=h.length;T2&&void 0!==arguments[2]?arguments[2]:{},i=r.pointPool,n=r.der,s=r.hash,o=r.publicKey,l=r.userId,c="string"==typeof t?_.utf8ToHex(t):_.arrayToHex(t);s&&(o=o||h(e),c=a(c,o,l));var d=new f(e,16),g=new f(c,16),v=null,m=null,y=null;do{do{var b=void 0;b=i&&i.length?i.pop():u(),v=b.k,m=g.add(b.x1).mod(w)}while(m.equals(f.ZERO)||m.add(v).equals(w));y=d.add(f.ONE).modInverse(w).multiply(v.subtract(m.multiply(d))).mod(w)}while(y.equals(f.ZERO));return n?p(m,y):_.leftPad(m.toString(16),64)+_.leftPad(y.toString(16),64)}function o(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i.der,s=i.hash,o=i.userId,h="string"==typeof t?_.utf8ToHex(t):_.arrayToHex(t);s&&(h=a(h,r,o));var u=void 0,l=void 0;if(n){var c=d(e);u=c.r,l=c.s}else u=new f(e.substring(0,64),16),l=new f(e.substring(64),16);var p=y.decodePointHex(r),g=new f(h,16),v=u.add(l).mod(w);if(v.equals(f.ZERO))return!1;var b=m.multiply(l).add(p.multiply(v)),T=g.add(b.getX().toBigInteger()).mod(w);return u.equals(T)}function a(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1234567812345678";r=_.utf8ToHex(r);var i=_.leftPad(m.curve.a.toBigInteger().toRadix(16),64),n=_.leftPad(m.curve.b.toBigInteger().toRadix(16),64),s=_.leftPad(m.getX().toBigInteger().toRadix(16),64),o=_.leftPad(m.getY().toBigInteger().toRadix(16),64),a=void 0,h=void 0;if(128===e.length)a=e.substr(0,64),h=e.substr(64,64);else{var u=m.curve.decodePointHex(e);a=_.leftPad(u.getX().toBigInteger().toRadix(16),64),h=_.leftPad(u.getY().toBigInteger().toRadix(16),64)}var l=_.hexToArray(r+i+n+s+o+a+h),f=4*r.length;l.unshift(255&f),l.unshift(f>>8&255);var c=g(l);return _.arrayToHex(g(c.concat(_.hexToArray(t))))}function h(t){var e=m.multiply(new f(t,16)),r=_.leftPad(e.getX().toBigInteger().toString(16),64),i=_.leftPad(e.getY().toBigInteger().toString(16),64);return"04"+r+i}function u(){var t=_.generateKeyPairHex(),e=y.decodePointHex(t.publicKey);return t.k=new f(t.privateKey,16),t.x1=e.getX().toBigInteger(),t}var l=r(0),f=l.BigInteger,c=r(4),p=c.encodeDer,d=c.decodeDer,_=r(5),g=r(1).sm3,v=_.generateEcparam(),m=v.G,y=v.curve,w=v.n,b=0;t.exports={generateKeyPairHex:_.generateKeyPairHex,compressPublicKeyHex:_.compressPublicKeyHex,comparePublicKeyHex:_.comparePublicKeyHex,doEncrypt:i,doDecrypt:n,doSignature:s,doVerifySignature:o,getPoint:u,verifyPublicKey:_.verifyPublicKey,hexToArray:_.hexToArray}},function(t,e,r){function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){var e=t.toString(16);if("-"!==e[0])e.length%2===1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{e=e.substr(1);var r=e.length;r%2===1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var i="",n=0;n>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;for(var n=[],s=0;s>>2]>>>24-s%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")}function h(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t}function u(t){return t.map(function(t){return t=t.toString(16),1===t.length?"0"+t:t}).join("")}function l(t){for(var e=[],r=0,i=0;i<2*t.length;i+=2)e[i>>>3]|=parseInt(t[r],10)<<24-i%8*4,r++;try{for(var n=[],s=0;s>>2]>>>24-s%4*8&255;n.push(String.fromCharCode(o))}return decodeURIComponent(escape(n.join("")))}catch(a){throw new Error("Malformed UTF-8 data")}}function f(t){var e=[],r=t.length;r%2!==0&&(t=h(t,r+1)),r=t.length;for(var i=0;i0;n--){i=i.twice();var s=e.testBit(n),o=t.testBit(n);s!==o&&(i=i.add(s?this:r))}return i},t}(),l=function(){function t(e,r,n){i(this,t),this.q=e,this.a=this.fromBigInteger(r),this.b=this.fromBigInteger(n),this.infinity=new u(this,null,null)}return t.prototype.equals=function(t){return t===this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},t.prototype.fromBigInteger=function(t){return new h(this.q,t)},t.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var e=this.fromBigInteger(new s(t.substr(2),16)),r=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new s("4")).add(s.ONE),this.q));return r.toBigInteger().mod(o).equals(new s(t.substr(0,2),16).subtract(o))||(r=r.negate()),new u(this,e,r);case 4:case 6:case 7:var i=(t.length-2)/2,n=t.substr(2,i),a=t.substr(i+2,i);return new u(this,this.fromBigInteger(new s(n,16)),this.fromBigInteger(new s(a,16)));default:return null}},t}();t.exports={ECPointFp:u,ECCurveFp:l}},function(t,e,r){function i(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t}function n(t){return t.map(function(t){return t=t.toString(16),1===t.length?"0"+t:t}).join("")}function s(t){var e=[],r=t.length;r%2!==0&&(t=i(t,r+1)),r=t.length;for(var n=0;n>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}var a=r(1),h=a.sm3,u=a.hmac;t.exports=function(t,e){if(t="string"==typeof t?o(t):Array.prototype.slice.call(t),e){var r=e.mode||"hmac";if("hmac"!==r)throw new Error("invalid mode");var i=e.key;if(!i)throw new Error("invalid key");return i="string"==typeof i?s(i):Array.prototype.slice.call(i),n(u(t,i))}return n(h(t))}},function(t,e,r){function i(t){for(var e=[],r=0,i=t.length;r>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}function o(t){for(var e=[],r=0,i=t.length;r=240&&t[r]<=247?(e.push(String.fromCodePoint(((7&t[r])<<18)+((63&t[r+1])<<12)+((63&t[r+2])<<6)+(63&t[r+3]))),r+=3):t[r]>=224&&t[r]<=239?(e.push(String.fromCodePoint(((15&t[r])<<12)+((63&t[r+1])<<6)+(63&t[r+2]))),r+=2):t[r]>=192&&t[r]<=223?(e.push(String.fromCodePoint(((31&t[r])<<6)+(63&t[r+1]))),r++):e.push(String.fromCodePoint(t[r]));return e.join("")}function a(t,e){var r=31&e;return t<>>32-r}function h(t){return(255&v[t>>>24&255])<<24|(255&v[t>>>16&255])<<16|(255&v[t>>>8&255])<<8|255&v[255&t]}function u(t){return t^a(t,2)^a(t,10)^a(t,18)^a(t,24)}function l(t){return t^a(t,13)^a(t,23)}function f(t,e,r){for(var i=new Array(4),n=new Array(4),s=0;s<4;s++)n[0]=255&t[4*s],n[1]=255&t[4*s+1],n[2]=255&t[4*s+2],n[3]=255&t[4*s+3],i[s]=n[0]<<24|n[1]<<16|n[2]<<8|n[3];for(var o,a=0;a<32;a+=4)o=i[1]^i[2]^i[3]^r[a+0],i[0]^=u(h(o)),o=i[2]^i[3]^i[0]^r[a+1],i[1]^=u(h(o)),o=i[3]^i[0]^i[1]^r[a+2],i[2]^=u(h(o)),o=i[0]^i[1]^i[2]^r[a+3],i[3]^=u(h(o));for(var l=0;l<16;l+=4)e[l]=i[3-l/4]>>>24&255,e[l+1]=i[3-l/4]>>>16&255,e[l+2]=i[3-l/4]>>>8&255,e[l+3]=255&i[3-l/4]}function c(t,e,r){for(var i=new Array(4),n=new Array(4),s=0;s<4;s++)n[0]=255&t[0+4*s],n[1]=255&t[1+4*s],n[2]=255&t[2+4*s],n[3]=255&t[3+4*s],i[s]=n[0]<<24|n[1]<<16|n[2]<<8|n[3];i[0]^=2746333894,i[1]^=1453994832,i[2]^=1736282519,i[3]^=2993693404;for(var o,a=0;a<32;a+=4)o=i[1]^i[2]^i[3]^m[a+0],e[a+0]=i[0]^=l(h(o)),o=i[2]^i[3]^i[0]^m[a+1],e[a+1]=i[1]^=l(h(o)),o=i[3]^i[0]^i[1]^m[a+2],e[a+2]=i[2]^=l(h(o)),o=i[0]^i[1]^i[2]^m[a+3],e[a+3]=i[3]^=l(h(o));if(r===d)for(var u,f=0;f<16;f++)u=e[f],e[f]=e[31-f],e[31-f]=u}function p(t,e,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},h=a.padding,u=void 0===h?"pkcs#7":h,l=a.mode,p=a.iv,v=void 0===p?[]:p,m=a.output,y=void 0===m?"string":m;if("cbc"===l&&("string"==typeof v&&(v=i(v)),16!==v.length))throw new Error("iv is invalid");if("string"==typeof e&&(e=i(e)),16!==e.length)throw new Error("key is invalid");if(t="string"==typeof t?r!==d?s(t):i(t):[].concat(t),("pkcs#5"===u||"pkcs#7"===u)&&r!==d)for(var w=g-t.length%g,b=0;b=g;){var B=t.slice(E,E+16),z=new Array(16);if("cbc"===l)for(var A=0;A0;n--){i=i.twice();var s=e.testBit(n),o=t.testBit(n);s!==o&&(i=i.add(s?this:r))}return i},t}(),l=function(){function t(e,r,n){i(this,t),this.q=e,this.a=this.fromBigInteger(r),this.b=this.fromBigInteger(n),this.infinity=new u(this,null,null)}return t.prototype.equals=function(t){return t===this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},t.prototype.fromBigInteger=function(t){return new h(this.q,t)},t.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var e=this.fromBigInteger(new s(t.substr(2),16)),r=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new s("4")).add(s.ONE),this.q));return r.toBigInteger().mod(o).equals(new s(t.substr(0,2),16).subtract(o))||(r=r.negate()),new u(this,e,r);case 4:case 6:case 7:var i=(t.length-2)/2,n=t.substr(2,i),a=t.substr(i+2,i);return new u(this,this.fromBigInteger(new s(n,16)),this.fromBigInteger(new s(a,16)));default:return null}},t}();t.exports={ECPointFp:u,ECCurveFp:l}},function(t,e,r){function i(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t}function n(t){return t.map(function(t){return t=t.toString(16),1===t.length?"0"+t:t}).join("")}function s(t){var e=[],r=t.length;r%2!==0&&(t=i(t,r+1)),r=t.length;for(var n=0;n>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}var a=r(1),h=a.sm3,u=a.hmac;t.exports=function(t,e){if(t="string"==typeof t?o(t):Array.prototype.slice.call(t),e){var r=e.mode||"hmac";if("hmac"!==r)throw new Error("invalid mode");var i=e.key;if(!i)throw new Error("invalid key");return i="string"==typeof i?s(i):Array.prototype.slice.call(i),n(u(t,i))}return n(h(t))}},function(t,e,r){function i(t){for(var e=[],r=0,i=t.length;r>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}function o(t){for(var e=[],r=0,i=t.length;r=240&&t[r]<=247?(e.push(String.fromCodePoint(((7&t[r])<<18)+((63&t[r+1])<<12)+((63&t[r+2])<<6)+(63&t[r+3]))),r+=3):t[r]>=224&&t[r]<=239?(e.push(String.fromCodePoint(((15&t[r])<<12)+((63&t[r+1])<<6)+(63&t[r+2]))),r+=2):t[r]>=192&&t[r]<=223?(e.push(String.fromCodePoint(((31&t[r])<<6)+(63&t[r+1]))),r++):e.push(String.fromCodePoint(t[r]));return e.join("")}function a(t,e){var r=31&e;return t<>>32-r}function h(t){return(255&v[t>>>24&255])<<24|(255&v[t>>>16&255])<<16|(255&v[t>>>8&255])<<8|255&v[255&t]}function u(t){return t^a(t,2)^a(t,10)^a(t,18)^a(t,24)}function l(t){return t^a(t,13)^a(t,23)}function f(t,e,r){for(var i=new Array(4),n=new Array(4),s=0;s<4;s++)n[0]=255&t[4*s],n[1]=255&t[4*s+1],n[2]=255&t[4*s+2],n[3]=255&t[4*s+3],i[s]=n[0]<<24|n[1]<<16|n[2]<<8|n[3];for(var o,a=0;a<32;a+=4)o=i[1]^i[2]^i[3]^r[a+0],i[0]^=u(h(o)),o=i[2]^i[3]^i[0]^r[a+1],i[1]^=u(h(o)),o=i[3]^i[0]^i[1]^r[a+2],i[2]^=u(h(o)),o=i[0]^i[1]^i[2]^r[a+3],i[3]^=u(h(o));for(var l=0;l<16;l+=4)e[l]=i[3-l/4]>>>24&255,e[l+1]=i[3-l/4]>>>16&255,e[l+2]=i[3-l/4]>>>8&255,e[l+3]=255&i[3-l/4]}function c(t,e,r){for(var i=new Array(4),n=new Array(4),s=0;s<4;s++)n[0]=255&t[0+4*s],n[1]=255&t[1+4*s],n[2]=255&t[2+4*s],n[3]=255&t[3+4*s],i[s]=n[0]<<24|n[1]<<16|n[2]<<8|n[3];i[0]^=2746333894,i[1]^=1453994832,i[2]^=1736282519,i[3]^=2993693404;for(var o,a=0;a<32;a+=4)o=i[1]^i[2]^i[3]^m[a+0],e[a+0]=i[0]^=l(h(o)),o=i[2]^i[3]^i[0]^m[a+1],e[a+1]=i[1]^=l(h(o)),o=i[3]^i[0]^i[1]^m[a+2],e[a+2]=i[2]^=l(h(o)),o=i[0]^i[1]^i[2]^m[a+3],e[a+3]=i[3]^=l(h(o));if(r===d)for(var u,f=0;f<16;f++)u=e[f],e[f]=e[31-f],e[31-f]=u}function p(t,e,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},h=a.padding,u=void 0===h?"pkcs#7":h,l=a.mode,p=a.iv,v=void 0===p?[]:p,m=a.output,y=void 0===m?"string":m;if("cbc"===l&&("string"==typeof v&&(v=i(v)),16!==v.length))throw new Error("iv is invalid");if("string"==typeof e&&(e=i(e)),16!==e.length)throw new Error("key is invalid");if(t="string"==typeof t?r!==d?s(t):i(t):[].concat(t),("pkcs#5"===u||"pkcs#7"===u)&&r!==d)for(var w=g-t.length%g,b=0;b=g;){var B=t.slice(E,E+16),z=new Array(16);if("cbc"===l)for(var A=0;A>15;--s>=0;){var h=32767&this[t],u=this[t++]>>15,l=a*h+u*o;n=((h=o*h+((32767&l)<<15)+r[i]+(1073741823&n))>>>30)+(l>>>15)+a*u+(n>>>30),r[i++]=1073741823&h}return n},t=30):i&&"Netscape"!=navigator.appName?(e.prototype.am=function(t,e,r,i,n,s){for(;--s>=0;){var o=e*this[t++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},t=26):(e.prototype.am=function(t,e,r,i,n,s){for(var o=16383&e,a=e>>14;--s>=0;){var h=16383&this[t],u=this[t++]>>14,l=a*h+u*o;n=((h=o*h+((16383&l)<<14)+r[i]+n)>>28)+(l>>14)+a*u,r[i++]=268435455&h}return n},t=28),e.prototype.DB=t,e.prototype.DM=(1<>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function c(t){this.m=t}function d(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function y(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function w(){}function b(t){return t}function T(t){this.r2=r(),this.q3=r(),e.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}c.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},c.prototype.revert=function(t){return t},c.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},c.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},c.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},d.prototype.convert=function(t){var i=r();return t.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),t.s<0&&i.compareTo(e.ZERO)>0&&this.m.subTo(i,i),i},d.prototype.revert=function(t){var e=r();return t.copyTo(e),this.reduce(e),e},d.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,i,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},d.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},d.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},e.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},e.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},e.prototype.fromString=function(t,r){if(!r&&t.length>=2&&"0"===t[0]){var i=!0;switch(t[1]){case"x":r=16;break;case"b":r=2;break;case"o":r=8;break;default:i=!1}i&&(t=t.substr(2))}var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(t,r);n=2}this.t=0,this.s=0;for(var s=t.length,o=!1,a=0;--s>=0;){var h=8==n?255&t[s]:u(t,s);h<0?"-"==t.charAt(s)&&(o=!0):(o=!1,0==a?this[this.t++]=h:a+n>this.DB?(this[this.t-1]|=(h&(1<>this.DB-a):this[this.t-1]|=h<=this.DB&&(a-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t},e.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},e.prototype.drShiftTo=function(t,e){for(var r=t;r=0;--r)e[r+o+1]=this[r]>>n|a,a=(this[r]&s)<=0;--r)e[r]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()},e.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var i=t%this.DB,n=this.DB-i,s=(1<>i;for(var o=r+1;o>i;i>0&&(e[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[r++]=this.DV+i:i>0&&(e[r++]=i),e.t=r,e.clamp()},e.prototype.multiplyTo=function(t,r){var i=this.abs(),n=t.abs(),s=i.t;for(r.t=s+n.t;--s>=0;)r[s]=0;for(s=0;s=0;)t[r]=0;for(r=0;r=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},e.prototype.divRemTo=function(t,i,n){var s=t.abs();if(!(s.t<=0)){var o=this.abs();if(o.t0?(s.lShiftTo(l,a),o.lShiftTo(l,n)):(s.copyTo(a),o.copyTo(n));var c=a.t,d=a[c-1];if(0!=d){var p=d*(1<1?a[c-2]>>this.F2:0),_=this.FV/p,g=(1<=0&&(n[n.t++]=1,n.subTo(w,n)),e.ONE.dlShiftTo(c,w),w.subTo(a,a);a.t=0;){var b=n[--v]==d?this.DM:Math.floor(n[v]*_+(n[v-1]+m)*g);if((n[v]+=a.am(0,b,n,y,0,c))0&&n.rShiftTo(l,n),h<0&&e.ZERO.subTo(n,n)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,i){if(t>4294967295||t<1)return e.ONE;var n=r(),s=r(),o=i.convert(this),a=f(t)-1;for(o.copyTo(n);--a>=0;)if(i.sqrTo(n,s),(t&1<0)i.mulTo(s,o,n);else{var h=n;n=s,s=h}return i.revert(n)},e.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,i=(1<0)for(a>a)>0&&(n=!0,s=h(r));o>=0;)a>(a+=this.DB-e)):(r=this[o]>>(a-=e)&i,a<=0&&(a+=this.DB,--o)),r>0&&(n=!0),n&&(s+=h(r));return n?s:"0"},e.prototype.negate=function(){var t=r();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+f(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var i=r();return this.abs().divRemTo(t,null,i),this.s<0&&i.compareTo(e.ZERO)>0&&t.subTo(i,i),i},e.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new c(e):new d(e),this.exp(t,r)},e.ZERO=l(0),e.ONE=l(1),w.prototype.convert=b,w.prototype.revert=b,w.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},w.prototype.sqrTo=function(t,e){t.squareTo(e)},T.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=r();return t.copyTo(e),this.reduce(e),e},T.prototype.revert=function(t){return t},T.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var x,F,S,E=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],B=(1<<26)/E[E.length-1];function k(){var t;t=(new Date).getTime(),F[S++]^=255&t,F[S++]^=t>>8&255,F[S++]^=t>>16&255,F[S++]^=t>>24&255,S>=q&&(S-=q)}if(e.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},e.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),n=l(i),s=r(),o=r(),a="";for(this.divRemTo(n,s,o);s.signum()>0;)a=(i+o.intValue()).toString(t).substr(1)+a,s.divRemTo(n,s,o);return o.intValue().toString(t)+a},e.prototype.fromRadix=function(t,r){this.fromInt(0),null==r&&(r=10);for(var i=this.chunkSize(r),n=Math.pow(r,i),s=!1,o=0,a=0,h=0;h=i&&(this.dMultiply(n),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(r,o)),this.dAddOffset(a,0)),s&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,r,i){if("number"==typeof r)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),_,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var n=new Array,s=7&t;n.length=1+(t>>3),r.nextBytes(n),s>0?n[0]&=(1<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e[r++]=i:i<-1&&(e[r++]=this.DV+i),e.t=r,e.clamp()},e.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},e.prototype.multiplyLowerTo=function(t,e,r){var i,n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(i=r.t-this.t;n=0;)r[i]=0;for(i=Math.max(e-this.t,0);i0)if(0==e)r=this[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this[i])%t;return r},e.prototype.millerRabin=function(t){var i=this.subtract(e.ONE),n=i.getLowestSetBit();if(n<=0)return!1;var s=i.shiftRight(n);(t=t+1>>1)>E.length&&(t=E.length);for(var o=r(),a=0;a>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,i=this.DB-t*this.DB%8,n=0;if(t-- >0)for(i>i)!=(this.s&this.DM)>>i&&(e[n++]=r|this.s<=0;)i<8?(r=(this[t]&(1<>(i+=this.DB-8)):(r=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(e[n++]=r);return e},e.prototype.equals=function(t){return 0==this.compareTo(t)},e.prototype.min=function(t){return this.compareTo(t)<0?this:t},e.prototype.max=function(t){return this.compareTo(t)>0?this:t},e.prototype.and=function(t){var e=r();return this.bitwiseTo(t,p,e),e},e.prototype.or=function(t){var e=r();return this.bitwiseTo(t,_,e),e},e.prototype.xor=function(t){var e=r();return this.bitwiseTo(t,g,e),e},e.prototype.andNot=function(t){var e=r();return this.bitwiseTo(t,m,e),e},e.prototype.not=function(){for(var t=r(),e=0;e=this.t?0!=this.s:0!=(this[e]&1<1){var _=r();for(n.sqrTo(a[1],_);h<=p;)a[h]=r(),n.mulTo(_,a[h-2],a[h]),h+=2}var g,m,v=t.t-1,y=!0,w=r();for(s=f(t[v])-1;v>=0;){for(s>=u?g=t[v]>>s-u&p:(g=(t[v]&(1<0&&(g|=t[v-1]>>this.DB+s-u)),h=i;0==(1&g);)g>>=1,--h;if((s-=h)<0&&(s+=this.DB,--v),y)a[g].copyTo(o),y=!1;else{for(;h>1;)n.sqrTo(o,w),n.sqrTo(w,o),h-=2;h>0?n.sqrTo(o,w):(m=o,o=w,w=m),n.mulTo(w,a[g],o)}for(;v>=0&&0==(t[v]&1<=0?(i.subTo(n,i),r&&s.subTo(a,s),o.subTo(h,o)):(n.subTo(i,n),r&&a.subTo(s,a),h.subTo(o,h))}return 0!=n.compareTo(e.ONE)?e.ZERO:h.compareTo(t)>=0?h.subtract(t):h.signum()<0?(h.addTo(t,h),h.signum()<0?h.add(t):h):h},e.prototype.pow=function(t){return this.exp(t,new w)},e.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var i=e;e=r,r=i}var n=e.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return e;for(n0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r},e.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=E[E.length-1]){for(e=0;e>>8,F[S++]=255&A;S=0,k()}function I(){if(null==x){for(k(),(x=new O).init(F),S=0;S>>32-r}function o(t,e){for(var r=[],i=t.length-1;i>=0;i--)r[i]=255&(t[i]^e[i]);return r}function a(t){return t^s(t,9)^s(t,17)}function h(t){var e=8*t.length,r=e%512;r=r>=448?512-r%448-1:448-r-1;for(var o=new Array((r-7)/8),h=new Array(8),u=0,l=o.length;u=0;d--)if(e.length>8){var p=e.length-8;h[d]=parseInt(e.substr(p),2),e=e.substr(0,p)}else e.length>0&&(h[d]=parseInt(e,2),e="");for(var _,g=new Uint8Array([].concat(t,[128],o,h)),m=new DataView(g.buffer,0),v=g.length/64,y=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]),w=0;w=0&&Z<=15?2043430169:2055708042,q=(Z>=0&&Z<=15?E^B^k:E&B|E&k|B&k)+A+((O=s(s(E,12)+z+s(M,Z),7))^s(E,12))+n[Z],P=(Z>=0&&Z<=15?z^D^I:z&D|~z&I)+R+O+i[Z],A=k,k=s(B,9),B=E,E=q,R=I,I=s(D,19),D=z,z=a(P);y[0]^=E,y[1]^=B,y[2]^=k,y[3]^=A,y[4]^=z,y[5]^=D,y[6]^=I,y[7]^=R}for(var C=[],U=0,L=y.length;U>>24,(16711680&N)>>>16,(65280&N)>>>8,255&N)}return C}for(var u=64,l=new Uint8Array(u),f=new Uint8Array(u),c=0;cu&&(e=h(e));e.length2&&arguments[2]!==undefined?arguments[2]:"1234567812345678";r=a.utf8ToHex(r);var i=a.leftPad(l.curve.a.toBigInteger().toRadix(16),64),n=a.leftPad(l.curve.b.toBigInteger().toRadix(16),64),s=a.leftPad(l.getX().toBigInteger().toRadix(16),64),o=a.leftPad(l.getY().toBigInteger().toRadix(16),64),u=void 0,f=void 0;if(128===e.length)u=e.substr(0,64),f=e.substr(64,64);else{var c=l.curve.decodePointHex(e);u=a.leftPad(c.getX().toBigInteger().toRadix(16),64),f=a.leftPad(c.getY().toBigInteger().toRadix(16),64)}var d=a.hexToArray(r+i+n+s+o+u+f),p=4*r.length;d.unshift(255&p),d.unshift(p>>8&255);var _=h(d);return a.arrayToHex(h(_.concat(a.hexToArray(t))))}function _(){var t=a.generateKeyPairHex(),e=f.decodePointHex(t.publicKey);return t.k=new i(t.privateKey,16),t.x1=e.getX().toBigInteger(),t}t.exports={generateKeyPairHex:a.generateKeyPairHex,compressPublicKeyHex:a.compressPublicKeyHex,comparePublicKeyHex:a.comparePublicKeyHex,doEncrypt:function(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t="string"==typeof t?a.hexToArray(a.utf8ToHex(t)):Array.prototype.slice.call(t),e=a.getGlobalCurve().decodePointHex(e);var n=a.generateKeyPairHex(),s=new i(n.privateKey,16),o=n.publicKey;o.length>128&&(o=o.substr(o.length-128));var u=e.multiply(s),l=a.hexToArray(a.leftPad(u.getX().toBigInteger().toRadix(16),64)),f=a.hexToArray(a.leftPad(u.getY().toBigInteger().toRadix(16),64)),c=a.arrayToHex(h([].concat(l,t,f))),p=1,_=0,g=[],m=[].concat(l,f),v=function(){g=h([].concat(m,[p>>24&255,p>>16&255,p>>8&255,255&p])),p++,_=0};v();for(var y=0,w=t.length;y2&&arguments[2]!==undefined?arguments[2]:1,n=(arguments.length>3&&arguments[3]!==undefined?arguments[3]:{}).output,s=n===undefined?"string":n;e=new i(e,16);var o=t.substr(128,64),u=t.substr(192);r===d&&(o=t.substr(t.length-64),u=t.substr(128,t.length-128-64));var l=a.hexToArray(u),f=a.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(e),c=a.hexToArray(a.leftPad(f.getX().toBigInteger().toRadix(16),64)),p=a.hexToArray(a.leftPad(f.getY().toBigInteger().toRadix(16),64)),_=1,g=0,m=[],v=[].concat(c,p),y=function(){m=h([].concat(v,[_>>24&255,_>>16&255,_>>8&255,255&_])),_++,g=0};y();for(var w=0,b=l.length;w2&&arguments[2]!==undefined?arguments[2]:{},n=r.pointPool,o=r.der,h=r.hash,u=r.publicKey,f=r.userId,d="string"==typeof t?a.utf8ToHex(t):a.arrayToHex(t);h&&(d=p(d,u=u||function(t){var e=l.multiply(new i(t,16)),r=a.leftPad(e.getX().toBigInteger().toString(16),64),n=a.leftPad(e.getY().toBigInteger().toString(16),64);return"04"+r+n}(e),f));var g=new i(e,16),m=new i(d,16),v=null,y=null,w=null;do{do{var b=void 0;v=(b=n&&n.length?n.pop():_()).k,y=m.add(b.x1).mod(c)}while(y.equals(i.ZERO)||y.add(v).equals(c));w=g.add(i.ONE).modInverse(c).multiply(v.subtract(y.multiply(g))).mod(c)}while(w.equals(i.ZERO));return o?s(y,w):a.leftPad(y.toString(16),64)+a.leftPad(w.toString(16),64)},doVerifySignature:function(t,e,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},s=n.der,h=n.hash,u=n.userId,d="string"==typeof t?a.utf8ToHex(t):a.arrayToHex(t);h&&(d=p(d,r,u));var _=void 0,g=void 0;if(s){var m=o(e);_=m.r,g=m.s}else _=new i(e.substring(0,64),16),g=new i(e.substring(64),16);var v=f.decodePointHex(r),y=new i(d,16),w=_.add(g).mod(c);if(w.equals(i.ZERO))return!1;var b=l.multiply(g).add(v.multiply(w)),T=y.add(b.getX().toBigInteger()).mod(c);return _.equals(T)},getPoint:_,verifyPublicKey:a.verifyPublicKey,hexToArray:a.hexToArray}},function(t,e,r){function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=r(0).BigInteger;var a=function(){function t(){s(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return t.prototype.getEncodedHex=function(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv},t.prototype.getLength=function(){var t=this.v.length/2,e=t.toString(16);return e.length%2==1&&(e="0"+e),t<128?e:(128+e.length/2).toString(16)+e},t.prototype.getValue=function(){return""},t}(),h=function(t){function e(r){s(this,e);var n=i(this,t.call(this));return n.t="02",r&&(n.v=function(t){var e=t.toString(16);if("-"!==e[0])e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var r=(e=e.substr(1)).length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var i="",n=0;n=e?t:new Array(e-t.length+1).join("0")+t}t.exports={getGlobalCurve:function(){return u},generateEcparam:c,generateKeyPairHex:function(t,e,r){var i=(t?new n(t,e,r):new n(f.bitLength(),a)).mod(f.subtract(n.ONE)).add(n.ONE),s=d(i.toString(16),64),o=l.multiply(i);return{privateKey:s,publicKey:"04"+d(o.getX().toBigInteger().toString(16),64)+d(o.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(t){if(130!==t.length)throw new Error("Invalid public key to compress");var e=(t.length-2)/2,r=t.substr(2,e),i="03";return new n(t.substr(e+2,e),16).mod(new n("2")).equals(n.ZERO)&&(i="02"),i+r},utf8ToHex:function(t){for(var e=(t=unescape(encodeURIComponent(t))).length,r=[],i=0;i>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;for(var n=[],s=0;s>>2]>>>24-s%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},leftPad:d,arrayToHex:function(t){return t.map(function(t){return 1===(t=t.toString(16)).length?"0"+t:t}).join("")},arrayToUtf8:function(t){for(var e=[],r=0,i=0;i<2*t.length;i+=2)e[i>>>3]|=parseInt(t[r],10)<<24-i%8*4,r++;try{for(var n=[],s=0;s>>2]>>>24-s%4*8&255;n.push(String.fromCharCode(o))}return decodeURIComponent(escape(n.join("")))}catch(a){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){var e=[],r=t.length;r%2!=0&&(t=d(t,r+1)),r=t.length;for(var i=0;i0;n--){i=i.twice();var s=e.testBit(n);s!==t.testBit(n)&&(i=i.add(s?this:r))}return i},t}(),u=function(){function t(e,r,n){i(this,t),this.q=e,this.a=this.fromBigInteger(r),this.b=this.fromBigInteger(n),this.infinity=new h(this,null,null)}return t.prototype.equals=function(t){return t===this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},t.prototype.fromBigInteger=function(t){return new a(this.q,t)},t.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var e=this.fromBigInteger(new n(t.substr(2),16)),r=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new n("4")).add(n.ONE),this.q));return r.toBigInteger().mod(s).equals(new n(t.substr(0,2),16).subtract(s))||(r=r.negate()),new h(this,e,r);case 4:case 6:case 7:var i=(t.length-2)/2,o=t.substr(2,i),a=t.substr(i+2,i);return new h(this,this.fromBigInteger(new n(o,16)),this.fromBigInteger(new n(a,16)));default:return null}},t}();t.exports={ECPointFp:h,ECCurveFp:u}},function(t,e,r){var i=r(1),n=i.sm3,s=i.hmac;function o(t){return t.map(function(t){return 1===(t=t.toString(16)).length?"0"+t:t}).join("")}function a(t){var e,r,i=[],n=t.length;n%2!=0&&(r=n+1,t=(e=t).length>=r?e:new Array(r-e.length+1).join("0")+e),n=t.length;for(var s=0;s>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}(t):Array.prototype.slice.call(t),e){if("hmac"!==(e.mode||"hmac"))throw new Error("invalid mode");var r=e.key;if(!r)throw new Error("invalid key");return r="string"==typeof r?a(r):Array.prototype.slice.call(r),o(s(t,r))}return o(n(t))}},function(t,e,r){var i=0,n=32,s=16,o=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],a=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function h(t){for(var e=[],r=0,i=t.length;r>>32-r}function l(t){return(255&o[t>>>24&255])<<24|(255&o[t>>>16&255])<<16|(255&o[t>>>8&255])<<8|255&o[255&t]}function f(t){return t^u(t,2)^u(t,10)^u(t,18)^u(t,24)}function c(t){return t^u(t,13)^u(t,23)}function d(t,e,r){for(var i=new Array(4),n=new Array(4),s=0;s<4;s++)n[0]=255&t[4*s],n[1]=255&t[4*s+1],n[2]=255&t[4*s+2],n[3]=255&t[4*s+3],i[s]=n[0]<<24|n[1]<<16|n[2]<<8|n[3];for(var o,a=0;a<32;a+=4)o=i[1]^i[2]^i[3]^r[a+0],i[0]^=f(l(o)),o=i[2]^i[3]^i[0]^r[a+1],i[1]^=f(l(o)),o=i[3]^i[0]^i[1]^r[a+2],i[2]^=f(l(o)),o=i[0]^i[1]^i[2]^r[a+3],i[3]^=f(l(o));for(var h=0;h<16;h+=4)e[h]=i[3-h/4]>>>24&255,e[h+1]=i[3-h/4]>>>16&255,e[h+2]=i[3-h/4]>>>8&255,e[h+3]=255&i[3-h/4]}function p(t,e,r){var o=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},u=o.padding,f=u===undefined?"pkcs#7":u,p=o.mode,_=o.iv,g=_===undefined?[]:_,m=o.output,v=m===undefined?"string":m;if("cbc"===p&&("string"==typeof g&&(g=h(g)),16!==g.length))throw new Error("iv is invalid");if("string"==typeof e&&(e=h(e)),16!==e.length)throw new Error("key is invalid");if(t="string"==typeof t?r!==i?function(t){for(var e=[],r=0,i=t.length;r>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}(t):h(t):[].concat(t),("pkcs#5"===f||"pkcs#7"===f)&&r!==i)for(var y=s-t.length%s,w=0;w=s;){var E=t.slice(S,S+16),B=new Array(16);if("cbc"===p)for(var k=0;k=240&&t[r]<=247?(e.push(String.fromCodePoint(((7&t[r])<<18)+((63&t[r+1])<<12)+((63&t[r+2])<<6)+(63&t[r+3]))),r+=3):t[r]>=224&&t[r]<=239?(e.push(String.fromCodePoint(((15&t[r])<<12)+((63&t[r+1])<<6)+(63&t[r+2]))),r+=2):t[r]>=192&&t[r]<=223?(e.push(String.fromCodePoint(((31&t[r])<<6)+(63&t[r+1]))),r++):e.push(String.fromCodePoint(t[r]));return e.join("")}(T):T}t.exports={encrypt:function(t,e,r){return p(t,e,1,r)},decrypt:function(t,e,r){return p(t,e,0,r)}}}]};function buildSMModule(){return sm(getSmBuildArgs())}function getPako(){function t(t){for(var e=t.length;--e>=0;)t[e]=0}var e=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),r=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);var o=new Array(60);t(o);var a=new Array(512);t(a);var h=new Array(256);t(h);var u=new Array(29);t(u);var l,f,c,d=new Array(30);function p(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function _(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);var g=function(t){return t<256?a[t]:a[256+(t>>>7)]},m=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},v=function(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1}while(--e>0);return r>>>1},b=function(t,e,r){var i,n,s=new Array(16),o=0;for(i=1;i<=15;i++)o=o+r[i-1]<<1,s[i]=o;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=w(s[a]++,a))}},T=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},x=function(t){t.bi_valid>8?m(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},F=function(t,e,r,i){var n=2*e,s=2*r;return t[n]>1;r>=1;r--)S(t,s,r);n=h;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,S(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,s,o,a,h=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,c=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,_=0;for(s=0;s<=15;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)(s=h[2*h[2*(i=t.heap[r])+1]+1]+1)>p&&(s=p,_++),h[2*i+1]=s,i>u||(t.bl_count[s]++,o=0,i>=d&&(o=c[i-d]),a=h[2*i],t.opt_len+=a*(s+o),f&&(t.static_len+=a*(l[2*i+1]+o)));if(0!==_){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,_-=2}while(_>0);for(s=p;0!==s;s--)for(i=t.bl_count[s];0!==i;)(n=t.heap[--r])>u||(h[2*n+1]!==s&&(t.opt_len+=(s-h[2*n+1])*h[2*n],h[2*n+1]=s),i--)}}(t,e),b(s,u,t.bl_count)},k=function(t,e,r){var i,n,s=-1,o=e[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=o,o=e[2*(i+1)+1],++a>=7;g<30;g++)for(d[g]=m<<7,t=0;t<1<0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),u=function(t){var e;for(k(t,t.dyn_ltree,t.l_desc.max_code),k(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*n[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),a=t.opt_len+3+7>>>3,(h=t.static_len+3+7>>>3)<=a&&(a=h)):a=h=r+5,r+4<=a&&-1!==e?D(t,e,r,i):4===t.strategy||h===a?(v(t,2+(i?1:0),3),E(t,s,o)):(v(t,4+(i?1:0),3),function(t,e,r,i){var s;for(v(t,e-257,5),v(t,r-1,5),v(t,i-4,4),s=0;s>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(h[r]+256+1)]++,t.dyn_dtree[2*g(e)]++),t.sym_next===t.sym_end},_tr_align:function(t){v(t,2,3),y(t,256,s),function(t){16===t.bi_valid?(m(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},R=function(t,e,r,i){for(var n=65535&t|0,s=t>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{s=s+(n=n+e[i++]|0)|0}while(--o);n%=65521,s%=65521}return n|s<<16|0},O=new Uint32Array(function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}()),q=function(t,e,r,i){var n=O,s=i+r;t^=-1;for(var o=i;o>>8^n[255&(t^e[o])];return-1^t},P={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},M={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},Z=I._tr_init,C=I._tr_stored_block,U=I._tr_flush_block,L=I._tr_tally,N=I._tr_align,H=M.Z_NO_FLUSH,K=M.Z_PARTIAL_FLUSH,j=M.Z_FULL_FLUSH,V=M.Z_FINISH,Y=M.Z_BLOCK,X=M.Z_OK,G=M.Z_STREAM_END,J=M.Z_STREAM_ERROR,W=M.Z_DATA_ERROR,$=M.Z_BUF_ERROR,Q=M.Z_DEFAULT_COMPRESSION,tt=M.Z_FILTERED,et=M.Z_HUFFMAN_ONLY,rt=M.Z_RLE,it=M.Z_FIXED,nt=M.Z_DEFAULT_STRATEGY,st=M.Z_UNKNOWN,ot=M.Z_DEFLATED,at=286,ht=30,ut=19,lt=2*at+1,ft=15,ct=function(t,e){return t.msg=P[e],e},dt=function(t){return 2*t-(t>4?9:0)},pt=function(t){for(var e=t.length;--e>=0;)t[e]=0},_t=function(t){var e,r,i,n=t.w_size;i=e=t.hash_size;do{r=t.head[--i],t.head[i]=r>=n?r-n:0}while(--e);i=e=n;do{r=t.prev[--i],t.prev[i]=r>=n?r-n:0}while(--e)},gt=function(t,e,r){return(e<t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},vt=function(t,e){U(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,mt(t.strm)},yt=function(t,e){t.pending_buf[t.pending++]=e},wt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=function(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),r),1===t.state.wrap?t.adler=R(t.adler,e,n,r):2===t.state.wrap&&(t.adler=q(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)},Tt=function(t,e){var r,i,n=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,u=t.window,l=t.w_mask,f=t.prev,c=t.strstart+258,d=u[s+o-1],p=u[s+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(r=e)+o]===p&&u[r+o-1]===d&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&so){if(t.match_start=e,o=i,i>=a)break;d=u[s+o-1],p=u[s+o]}}}while((e=f[e&l])>h&&0!=--n);return o<=t.lookahead?o:t.lookahead},xt=function(t){var e,r,i,n=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=n+(n-262)&&(t.window.set(t.window.subarray(n,n+n-r),0),t.match_start-=n,t.strstart-=n,t.block_start-=n,t.insert>t.strstart&&(t.insert=t.strstart),_t(t),r+=n),0===t.strm.avail_in)break;if(e=bt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=e,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=gt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=gt(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},Ft=function(t,e){var r,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,o=0,a=t.strm.avail_in;do{if(r=65535,n=t.bi_valid+42>>3,t.strm.avail_out(i=t.strstart-t.block_start)+t.strm.avail_in&&(r=i+t.strm.avail_in),r>n&&(r=n),r>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,mt(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(bt(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===o);return(a-=t.strm.avail_in)&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_watern&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(bt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water>3,s=(n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n)>t.w_size?t.w_size:n,((i=t.strstart-t.block_start)>=s||(i||e===V)&&e!==H&&0===t.strm.avail_in&&i<=n)&&(r=i>n?n:i,o=e===V&&0===t.strm.avail_in&&r===i?1:0,C(t,t.block_start,r,o),t.block_start+=r,mt(t.strm)),o?3:1)},St=function(t,e){for(var r,i;;){if(t.lookahead<262){if(xt(t),t.lookahead<262&&e===H)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=gt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-262&&(t.match_length=Tt(t,r)),t.match_length>=3)if(i=L(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=gt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=gt(t,t.ins_h,t.window[t.strstart+1]);else i=L(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===V?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2},Et=function(t,e){for(var r,i,n;;){if(t.lookahead<262){if(xt(t),t.lookahead<262&&e===H)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=gt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=L(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=gt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(vt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=L(t,0,t.window[t.strstart-1]))&&vt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=L(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===V?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2};function Bt(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}var kt=[new Bt(0,0,0,0,Ft),new Bt(4,4,8,4,St),new Bt(4,5,16,8,St),new Bt(4,6,32,32,St),new Bt(4,4,16,16,Et),new Bt(8,16,32,32,Et),new Bt(8,16,128,128,Et),new Bt(8,32,128,256,Et),new Bt(32,128,258,1024,Et),new Bt(32,258,258,4096,Et)];function At(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ot,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*lt),this.dyn_dtree=new Uint16Array(2*(2*ht+1)),this.bl_tree=new Uint16Array(2*(2*ut+1)),pt(this.dyn_ltree),pt(this.dyn_dtree),pt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(ft+1),this.heap=new Uint16Array(2*at+1),pt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*at+1),pt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var zt=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},Dt=function(t){if(zt(t))return ct(t,J);t.total_in=t.total_out=0,t.data_type=st;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,Z(e),X},It=function(t){var e,r=Dt(t);return r===X&&((e=t.state).window_size=2*e.w_size,pt(e.head),e.max_lazy_match=kt[e.level].max_lazy,e.good_match=kt[e.level].good_length,e.nice_match=kt[e.level].nice_length,e.max_chain_length=kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),r},Rt=function(t,e,r,i,n,s){if(!t)return J;var o=1;if(e===Q&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>9||r!==ot||i<8||i>15||e<0||e>9||s<0||s>it||8===i&&1!==o)return ct(t,J);8===i&&(i=9);var a=new At;return t.state=a,a.strm=t,a.status=42,a.wrap=o,a.gzhead=null,a.w_bits=i,a.w_size=1<Y||e<0)return t?ct(t,J):J;var r=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===r.status&&e!==V)return ct(t,0===t.avail_out?$:J);var i=r.last_flush;if(r.last_flush=e,0!==r.pending){if(mt(t),0===t.avail_out)return r.last_flush=-1,X}else if(0===t.avail_in&&dt(e)<=dt(i)&&e!==V)return ct(t,$);if(666===r.status&&0!==t.avail_in)return ct(t,$);if(42===r.status&&0===r.wrap&&(r.status=113),42===r.status){var n=ot+(r.w_bits-8<<4)<<8;if(n|=(r.strategy>=et||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(n|=32),wt(r,n+=31-n%31),0!==r.strstart&&(wt(r,t.adler>>>16),wt(r,65535&t.adler)),t.adler=1,r.status=113,mt(t),0!==r.pending)return r.last_flush=-1,X}if(57===r.status)if(t.adler=0,yt(r,31),yt(r,139),yt(r,8),r.gzhead)yt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),yt(r,255&r.gzhead.time),yt(r,r.gzhead.time>>8&255),yt(r,r.gzhead.time>>16&255),yt(r,r.gzhead.time>>24&255),yt(r,9===r.level?2:r.strategy>=et||r.level<2?4:0),yt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(yt(r,255&r.gzhead.extra.length),yt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=q(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(yt(r,0),yt(r,0),yt(r,0),yt(r,0),yt(r,0),yt(r,9===r.level?2:r.strategy>=et||r.level<2?4:0),yt(r,3),r.status=113,mt(t),0!==r.pending)return r.last_flush=-1,X;if(69===r.status){if(r.gzhead.extra){for(var s=r.pending,o=(65535&r.gzhead.extra.length)-r.gzindex;r.pending+o>r.pending_buf_size;){var a=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>s&&(t.adler=q(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex+=a,mt(t),0!==r.pending)return r.last_flush=-1,X;s=0,o-=a}var h=new Uint8Array(r.gzhead.extra);r.pending_buf.set(h.subarray(r.gzindex,r.gzindex+o),r.pending),r.pending+=o,r.gzhead.hcrc&&r.pending>s&&(t.adler=q(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){var u,l=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>l&&(t.adler=q(t.adler,r.pending_buf,r.pending-l,l)),mt(t),0!==r.pending)return r.last_flush=-1,X;l=0}u=r.gzindexl&&(t.adler=q(t.adler,r.pending_buf,r.pending-l,l)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){var f,c=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>c&&(t.adler=q(t.adler,r.pending_buf,r.pending-c,c)),mt(t),0!==r.pending)return r.last_flush=-1,X;c=0}f=r.gzindexc&&(t.adler=q(t.adler,r.pending_buf,r.pending-c,c))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(mt(t),0!==r.pending))return r.last_flush=-1,X;yt(r,255&t.adler),yt(r,t.adler>>8&255),t.adler=0}if(r.status=113,mt(t),0!==r.pending)return r.last_flush=-1,X}if(0!==t.avail_in||0!==r.lookahead||e!==H&&666!==r.status){var d=0===r.level?Ft(r,e):r.strategy===et?function(t,e){for(var r;;){if(0===t.lookahead&&(xt(t),0===t.lookahead)){if(e===H)return 1;break}if(t.match_length=0,r=L(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===rt?function(t,e){for(var r,i,n,s,o=t.window;;){if(t.lookahead<=258){if(xt(t),t.lookahead<=258&&e===H)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=o[n=t.strstart-1])===o[++n]&&i===o[++n]&&i===o[++n]){s=t.strstart+258;do{}while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=L(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=L(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2}(r,e):kt[r.level].func(r,e);if(3!==d&&4!==d||(r.status=666),1===d||3===d)return 0===t.avail_out&&(r.last_flush=-1),X;if(2===d&&(e===K?N(r):e!==Y&&(C(r,0,0,!1),e===j&&(pt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),mt(t),0===t.avail_out))return r.last_flush=-1,X}return e!==V?X:r.wrap<=0?G:(2===r.wrap?(yt(r,255&t.adler),yt(r,t.adler>>8&255),yt(r,t.adler>>16&255),yt(r,t.adler>>24&255),yt(r,255&t.total_in),yt(r,t.total_in>>8&255),yt(r,t.total_in>>16&255),yt(r,t.total_in>>24&255)):(wt(r,t.adler>>>16),wt(r,65535&t.adler)),mt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?X:G)},deflateEnd:function(t){if(zt(t))return J;var e=t.state.status;return t.state=null,113===e?ct(t,W):X},deflateSetDictionary:function(t,e){var r=e.length;if(zt(t))return J;var i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return J;if(1===n&&(t.adler=R(t.adler,e,r,0)),i.wrap=0,r>=i.w_size){0===n&&(pt(i.head),i.strstart=0,i.block_start=0,i.insert=0);var s=new Uint8Array(i.w_size);s.set(e.subarray(r-i.w_size,r),0),e=s,r=i.w_size}var o=t.avail_in,a=t.next_in,h=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,xt(i);i.lookahead>=3;){var u=i.strstart,l=i.lookahead-2;do{i.ins_h=gt(i,i.ins_h,i.window[u+3-1]),i.prev[u&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=u,u++}while(--l);i.strstart=u,i.lookahead=2,xt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=a,t.input=h,t.avail_in=o,i.wrap=n,X},deflateInfo:"pako deflate (from Nodeca project)"};function qt(t){return(qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Pt=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Mt={assign:function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!==qt(r))throw new TypeError(r+"must be non-object");for(var i in r)Pt(r,i)&&(t[i]=r[i])}}return t},flattenChunks:function(t){for(var e=0,r=0,i=t.length;r=252?6:Ut>=248?5:Ut>=240?4:Ut>=224?3:Ut>=192?2:1;Ct[254]=Ct[254]=1;var Lt={string2buf:function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,r,i,n,s,o=t.length,a=0;for(n=0;n>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e},buf2string:function(t,e){var r,i,n=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));var s=new Array(2*n);for(i=0,r=0;r4)s[i++]=65533,r+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&r1?s[i++]=65533:o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|1023&o)}}}return function(t,e){if(e<65534&&t.subarray&&Zt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var r="",i=0;it.length&&(e=t.length);for(var r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0?e:0===r?e:r+Ct[t[r]]>e?r:e}};var Nt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Ht=Object.prototype.toString,Kt=M.Z_NO_FLUSH,jt=M.Z_SYNC_FLUSH,Vt=M.Z_FULL_FLUSH,Yt=M.Z_FINISH,Xt=M.Z_OK,Gt=M.Z_STREAM_END,Jt=M.Z_DEFAULT_COMPRESSION,Wt=M.Z_DEFAULT_STRATEGY,$t=M.Z_DEFLATED;function Qt(t){this.options=Mt.assign({level:Jt,method:$t,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Nt,this.strm.avail_out=0;var r=Ot.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Xt)throw new Error(P[r]);if(e.header&&Ot.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(i="string"==typeof e.dictionary?Lt.string2buf(e.dictionary):"[object ArrayBuffer]"===Ht.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(r=Ot.deflateSetDictionary(this.strm,i))!==Xt)throw new Error(P[r]);this._dict_set=!0}}function te(t,e){var r=new Qt(e);if(r.push(t,!0),r.err)throw r.msg||P[r.err];return r.result}return Qt.prototype.push=function(t,e){var r,i,n=this.strm,s=this.options.chunkSize;if(this.ended)return!1;for(i=e===~~e?e:!0===e?Yt:Kt,"string"==typeof t?n.input=Lt.string2buf(t):"[object ArrayBuffer]"===Ht.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(s),n.next_out=0,n.avail_out=s),(i===jt||i===Vt)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if((r=Ot.deflate(n,i))===Gt)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=Ot.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Xt;if(0!==n.avail_out){if(i>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},Qt.prototype.onData=function(t){this.chunks.push(t)},Qt.prototype.onEnd=function(t){t===Xt&&(this.result=Mt.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},{Deflate:Qt,deflate:te,deflateRaw:function(t,e){return(e=e||{}).raw=!0,te(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,te(t,e)},constants:M}}var sm2,sm4,hexToArray,sm4key,encryptedSm4Key,iv,oldEncoder,_this,_sa,_config,pako,sdkversion_placeholder="1.26.8";function wrapPluginInitFn(t,e,r){if(e&&(t.plugin_name=e),r&&t.init){var i=t.init;t.init=function(n,s){if(wrapLogFn(n,t,e),n.readyState&&n.readyState.state>=3||!n.on)return o();function o(){i.call(t,n,s)}n.on(r,o)}}return t}function wrapLogFn(t,e,r){function i(e,i){t.logger?t.logger.msg.apply(t.logger,i).module(r+""||"").level(e).log():t.log&&t.log.apply(t,i)}e.log=function(){i("log",arguments)},e.warn=function(){i("warn",arguments)},e.error=function(){i("error",arguments)}}function createPlugin(t,e,r){return wrapPluginInitFn(t,e,r),t.plugin_version=sdkversion_placeholder,t}function get128RandomByte(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(255*_sa._.getRandom()).toString(16);e+=2===r.length?r:"0"+r}return e}function matchType(t,e,r){return typeof t===r||(_this.error(e+" must be "+r),!1)}function isTruthy(t,e){return!!t||(_this.error(e+" cant not be null"),!1)}function isSupportSMEncryption(){try{var t=new Uint8Array(1);return t[0]=1,1===t[0]}catch(e){return!1}}function hexToBase64(t){return btoa(String.fromCharCode.apply(null,t.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")))}function encryptData(t){t=JSON.stringify(t),t=Array.prototype.slice.call(pako.gzip(t));var e=sm4.encrypt(t,sm4key,{mode:"cbc",iv:iv});return hexToBase64(iv+e)}function encodeTrackData(t){try{var e,r=encryptData(t);e={pkv:_config.pkv,ekey:encryptedSm4Key,flush_time:_sa._.now(),payloads:[r]};var i=JSON.stringify(e),n="crc="+_sa._.hashCode(i);return"data="+encodeURIComponent(i)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(s){_this.error("SM encryption error, data will not be encrypted")}return oldEncoder.call(_sa.kit,t)}function doEncryptSM4Key(t,e){for(var r=0;r<10;){r++;var i=sm2.doEncrypt(hexToArray(t).slice(),e,1);if("0"!==i[0]||"4"!==i[1])return hexToBase64(i)}throw"generate SM4 ekey failed"}var SmEncryption={init:function(t,e){try{if(!isSupportSMEncryption())return void this.warn("browser incompatible, data send will not be encrypted");if(!t||!t.kit||!t.kit.encodeTrackData)return void this.error("SMEncryption init failed, SDK version incompatible.");_sa=t,_config=e,_this=this;var r=buildSMModule();pako=getPako(),sm2=r.sm2,sm4=r.sm4,hexToArray=sm2.hexToArray,isTruthy(e,"init config")&&matchType(e.pkv,"pkv","number")&&isTruthy(e.pub_key,"pub_key")&&matchType(e.pub_key,"pub_key","string")?(iv=get128RandomByte(),sm4key=get128RandomByte(),encryptedSm4Key=doEncryptSM4Key(sm4key,_config.pub_key),oldEncoder=t.kit.encodeTrackData,t.kit.encodeTrackData=encodeTrackData,_this.log("SMEncryption init succeed")):_this.error("SMEncryption init failed")}catch(i){_this.error("SMEncryption init exception: "+i)}}},index=createPlugin(SmEncryption,"SMEncryption","sdkAfterInitPara");export default index; \ No newline at end of file +function sm(t){var e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=t,r.c=e,r.d=function(t,e,i){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)r.d(i,n,function(e){return t[e]}.bind(null,n));return i},r.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=2)}var getSmBuildArgs=function(){var t;function e(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function r(){return new e(null)}var i="undefined"!=typeof navigator;i&&"Microsoft Internet Explorer"==navigator.appName?(e.prototype.am=function(t,e,r,i,n,s){for(var o=32767&e,a=e>>15;--s>=0;){var h=32767&this[t],u=this[t++]>>15,l=a*h+u*o;n=((h=o*h+((32767&l)<<15)+r[i]+(1073741823&n))>>>30)+(l>>>15)+a*u+(n>>>30),r[i++]=1073741823&h}return n},t=30):i&&"Netscape"!=navigator.appName?(e.prototype.am=function(t,e,r,i,n,s){for(;--s>=0;){var o=e*this[t++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n},t=26):(e.prototype.am=function(t,e,r,i,n,s){for(var o=16383&e,a=e>>14;--s>=0;){var h=16383&this[t],u=this[t++]>>14,l=a*h+u*o;n=((h=o*h+((16383&l)<<14)+r[i]+n)>>28)+(l>>14)+a*u,r[i++]=268435455&h}return n},t=28),e.prototype.DB=t,e.prototype.DM=(1<>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function c(t){this.m=t}function d(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function y(t){for(var e=0;0!=t;)t&=t-1,++e;return e}function w(){}function b(t){return t}function T(t){this.r2=r(),this.q3=r(),e.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t),this.m=t}c.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},c.prototype.revert=function(t){return t},c.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},c.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},c.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},d.prototype.convert=function(t){var i=r();return t.abs().dlShiftTo(this.m.t,i),i.divRemTo(this.m,null,i),t.s<0&&i.compareTo(e.ZERO)>0&&this.m.subTo(i,i),i},d.prototype.revert=function(t){var e=r();return t.copyTo(e),this.reduce(e),e},d.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(t[r=e+this.m.t]+=this.m.am(0,i,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},d.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},d.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},e.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},e.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},e.prototype.fromString=function(t,r){if(!r&&t.length>=2&&"0"===t[0]){var i=!0;switch(t[1]){case"x":r=16;break;case"b":r=2;break;case"o":r=8;break;default:i=!1}i&&(t=t.substr(2))}var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(t,r);n=2}this.t=0,this.s=0;for(var s=t.length,o=!1,a=0;--s>=0;){var h=8==n?255&t[s]:u(t,s);h<0?"-"==t.charAt(s)&&(o=!0):(o=!1,0==a?this[this.t++]=h:a+n>this.DB?(this[this.t-1]|=(h&(1<>this.DB-a):this[this.t-1]|=h<=this.DB&&(a-=this.DB))}8==n&&0!=(128&t[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t},e.prototype.dlShiftTo=function(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s},e.prototype.drShiftTo=function(t,e){for(var r=t;r=0;--r)e[r+o+1]=this[r]>>n|a,a=(this[r]&s)<=0;--r)e[r]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()},e.prototype.rShiftTo=function(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)e.t=0;else{var i=t%this.DB,n=this.DB-i,s=(1<>i;for(var o=r+1;o>i;i>0&&(e[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[r++]=this.DV+i:i>0&&(e[r++]=i),e.t=r,e.clamp()},e.prototype.multiplyTo=function(t,r){var i=this.abs(),n=t.abs(),s=i.t;for(r.t=s+n.t;--s>=0;)r[s]=0;for(s=0;s=0;)t[r]=0;for(r=0;r=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()},e.prototype.divRemTo=function(t,i,n){var s=t.abs();if(!(s.t<=0)){var o=this.abs();if(o.t0?(s.lShiftTo(l,a),o.lShiftTo(l,n)):(s.copyTo(a),o.copyTo(n));var c=a.t,d=a[c-1];if(0!=d){var p=d*(1<1?a[c-2]>>this.F2:0),_=this.FV/p,g=(1<=0&&(n[n.t++]=1,n.subTo(w,n)),e.ONE.dlShiftTo(c,w),w.subTo(a,a);a.t=0;){var b=n[--v]==d?this.DM:Math.floor(n[v]*_+(n[v-1]+m)*g);if((n[v]+=a.am(0,b,n,y,0,c))0&&n.rShiftTo(l,n),h<0&&e.ZERO.subTo(n,n)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return(e=(e=(e=(e=e*(2-(15&t)*e)&15)*(2-(255&t)*e)&255)*(2-((65535&t)*e&65535))&65535)*(2-t*e%this.DV)%this.DV)>0?this.DV-e:-e},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,i){if(t>4294967295||t<1)return e.ONE;var n=r(),s=r(),o=i.convert(this),a=f(t)-1;for(o.copyTo(n);--a>=0;)if(i.sqrTo(n,s),(t&1<0)i.mulTo(s,o,n);else{var h=n;n=s,s=h}return i.revert(n)},e.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,i=(1<0)for(a>a)>0&&(n=!0,s=h(r));o>=0;)a>(a+=this.DB-e)):(r=this[o]>>(a-=e)&i,a<=0&&(a+=this.DB,--o)),r>0&&(n=!0),n&&(s+=h(r));return n?s:"0"},e.prototype.negate=function(){var t=r();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(0!=(e=r-t.t))return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+f(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var i=r();return this.abs().divRemTo(t,null,i),this.s<0&&i.compareTo(e.ZERO)>0&&t.subTo(i,i),i},e.prototype.modPowInt=function(t,e){var r;return r=t<256||e.isEven()?new c(e):new d(e),this.exp(t,r)},e.ZERO=l(0),e.ONE=l(1),w.prototype.convert=b,w.prototype.revert=b,w.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r)},w.prototype.sqrTo=function(t,e){t.squareTo(e)},T.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=r();return t.copyTo(e),this.reduce(e),e},T.prototype.revert=function(t){return t},T.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},T.prototype.mulTo=function(t,e,r){t.multiplyTo(e,r),this.reduce(r)},T.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)};var x,F,S,E=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],B=(1<<26)/E[E.length-1];function k(){var t;t=(new Date).getTime(),F[S++]^=255&t,F[S++]^=t>>8&255,F[S++]^=t>>16&255,F[S++]^=t>>24&255,S>=q&&(S-=q)}if(e.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},e.prototype.toRadix=function(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var e=this.chunkSize(t),i=Math.pow(t,e),n=l(i),s=r(),o=r(),a="";for(this.divRemTo(n,s,o);s.signum()>0;)a=(i+o.intValue()).toString(t).substr(1)+a,s.divRemTo(n,s,o);return o.intValue().toString(t)+a},e.prototype.fromRadix=function(t,r){this.fromInt(0),null==r&&(r=10);for(var i=this.chunkSize(r),n=Math.pow(r,i),s=!1,o=0,a=0,h=0;h=i&&(this.dMultiply(n),this.dAddOffset(a,0),o=0,a=0))}o>0&&(this.dMultiply(Math.pow(r,o)),this.dAddOffset(a,0)),s&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,r,i){if("number"==typeof r)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),_,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var n=new Array,s=7&t;n.length=1+(t>>3),r.nextBytes(n),s>0?n[0]&=(1<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e[r++]=i:i<-1&&(e[r++]=this.DV+i),e.t=r,e.clamp()},e.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},e.prototype.multiplyLowerTo=function(t,e,r){var i,n=Math.min(this.t+t.t,e);for(r.s=0,r.t=n;n>0;)r[--n]=0;for(i=r.t-this.t;n=0;)r[i]=0;for(i=Math.max(e-this.t,0);i0)if(0==e)r=this[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this[i])%t;return r},e.prototype.millerRabin=function(t){var i=this.subtract(e.ONE),n=i.getLowestSetBit();if(n<=0)return!1;var s=i.shiftRight(n);(t=t+1>>1)>E.length&&(t=E.length);for(var o=r(),a=0;a>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var t=this.t,e=new Array;e[0]=this.s;var r,i=this.DB-t*this.DB%8,n=0;if(t-- >0)for(i>i)!=(this.s&this.DM)>>i&&(e[n++]=r|this.s<=0;)i<8?(r=(this[t]&(1<>(i+=this.DB-8)):(r=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(e[n++]=r);return e},e.prototype.equals=function(t){return 0==this.compareTo(t)},e.prototype.min=function(t){return this.compareTo(t)<0?this:t},e.prototype.max=function(t){return this.compareTo(t)>0?this:t},e.prototype.and=function(t){var e=r();return this.bitwiseTo(t,p,e),e},e.prototype.or=function(t){var e=r();return this.bitwiseTo(t,_,e),e},e.prototype.xor=function(t){var e=r();return this.bitwiseTo(t,g,e),e},e.prototype.andNot=function(t){var e=r();return this.bitwiseTo(t,m,e),e},e.prototype.not=function(){for(var t=r(),e=0;e=this.t?0!=this.s:0!=(this[e]&1<1){var _=r();for(n.sqrTo(a[1],_);h<=p;)a[h]=r(),n.mulTo(_,a[h-2],a[h]),h+=2}var g,m,v=t.t-1,y=!0,w=r();for(s=f(t[v])-1;v>=0;){for(s>=u?g=t[v]>>s-u&p:(g=(t[v]&(1<0&&(g|=t[v-1]>>this.DB+s-u)),h=i;0==(1&g);)g>>=1,--h;if((s-=h)<0&&(s+=this.DB,--v),y)a[g].copyTo(o),y=!1;else{for(;h>1;)n.sqrTo(o,w),n.sqrTo(w,o),h-=2;h>0?n.sqrTo(o,w):(m=o,o=w,w=m),n.mulTo(w,a[g],o)}for(;v>=0&&0==(t[v]&1<=0?(i.subTo(n,i),r&&s.subTo(a,s),o.subTo(h,o)):(n.subTo(i,n),r&&a.subTo(s,a),h.subTo(o,h))}return 0!=n.compareTo(e.ONE)?e.ZERO:h.compareTo(t)>=0?h.subtract(t):h.signum()<0?(h.addTo(t,h),h.signum()<0?h.add(t):h):h},e.prototype.pow=function(t){return this.exp(t,new w)},e.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),r=t.s<0?t.negate():t.clone();if(e.compareTo(r)<0){var i=e;e=r,r=i}var n=e.getLowestSetBit(),s=r.getLowestSetBit();if(s<0)return e;for(n0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r},e.prototype.isProbablePrime=function(t){var e,r=this.abs();if(1==r.t&&r[0]<=E[E.length-1]){for(e=0;e>>8,F[S++]=255&A;S=0,k()}function I(){if(null==x){for(k(),(x=new O).init(F),S=0;S>>32-r}function o(t,e){for(var r=[],i=t.length-1;i>=0;i--)r[i]=255&(t[i]^e[i]);return r}function a(t){return t^s(t,9)^s(t,17)}function h(t){var e=8*t.length,r=e%512;r=r>=448?512-r%448-1:448-r-1;for(var o=new Array((r-7)/8),h=new Array(8),u=0,l=o.length;u=0;d--)if(e.length>8){var p=e.length-8;h[d]=parseInt(e.substr(p),2),e=e.substr(0,p)}else e.length>0&&(h[d]=parseInt(e,2),e="");for(var _,g=new Uint8Array([].concat(t,[128],o,h)),m=new DataView(g.buffer,0),v=g.length/64,y=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]),w=0;w=0&&Z<=15?2043430169:2055708042,q=(Z>=0&&Z<=15?E^B^k:E&B|E&k|B&k)+A+((O=s(s(E,12)+z+s(M,Z),7))^s(E,12))+n[Z],P=(Z>=0&&Z<=15?z^D^I:z&D|~z&I)+R+O+i[Z],A=k,k=s(B,9),B=E,E=q,R=I,I=s(D,19),D=z,z=a(P);y[0]^=E,y[1]^=B,y[2]^=k,y[3]^=A,y[4]^=z,y[5]^=D,y[6]^=I,y[7]^=R}for(var C=[],U=0,L=y.length;U>>24,(16711680&N)>>>16,(65280&N)>>>8,255&N)}return C}for(var u=64,l=new Uint8Array(u),f=new Uint8Array(u),c=0;cu&&(e=h(e));e.length2&&arguments[2]!==undefined?arguments[2]:"1234567812345678";r=a.utf8ToHex(r);var i=a.leftPad(l.curve.a.toBigInteger().toRadix(16),64),n=a.leftPad(l.curve.b.toBigInteger().toRadix(16),64),s=a.leftPad(l.getX().toBigInteger().toRadix(16),64),o=a.leftPad(l.getY().toBigInteger().toRadix(16),64),u=void 0,f=void 0;if(128===e.length)u=e.substr(0,64),f=e.substr(64,64);else{var c=l.curve.decodePointHex(e);u=a.leftPad(c.getX().toBigInteger().toRadix(16),64),f=a.leftPad(c.getY().toBigInteger().toRadix(16),64)}var d=a.hexToArray(r+i+n+s+o+u+f),p=4*r.length;d.unshift(255&p),d.unshift(p>>8&255);var _=h(d);return a.arrayToHex(h(_.concat(a.hexToArray(t))))}function _(){var t=a.generateKeyPairHex(),e=f.decodePointHex(t.publicKey);return t.k=new i(t.privateKey,16),t.x1=e.getX().toBigInteger(),t}t.exports={generateKeyPairHex:a.generateKeyPairHex,compressPublicKeyHex:a.compressPublicKeyHex,comparePublicKeyHex:a.comparePublicKeyHex,doEncrypt:function(t,e){var r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;t="string"==typeof t?a.hexToArray(a.utf8ToHex(t)):Array.prototype.slice.call(t),e=a.getGlobalCurve().decodePointHex(e);var n=a.generateKeyPairHex(),s=new i(n.privateKey,16),o=n.publicKey;o.length>128&&(o=o.substr(o.length-128));var u=e.multiply(s),l=a.hexToArray(a.leftPad(u.getX().toBigInteger().toRadix(16),64)),f=a.hexToArray(a.leftPad(u.getY().toBigInteger().toRadix(16),64)),c=a.arrayToHex(h([].concat(l,t,f))),p=1,_=0,g=[],m=[].concat(l,f),v=function(){g=h([].concat(m,[p>>24&255,p>>16&255,p>>8&255,255&p])),p++,_=0};v();for(var y=0,w=t.length;y2&&arguments[2]!==undefined?arguments[2]:1,n=(arguments.length>3&&arguments[3]!==undefined?arguments[3]:{}).output,s=n===undefined?"string":n;e=new i(e,16);var o=t.substr(128,64),u=t.substr(192);r===d&&(o=t.substr(t.length-64),u=t.substr(128,t.length-128-64));var l=a.hexToArray(u),f=a.getGlobalCurve().decodePointHex("04"+t.substr(0,128)).multiply(e),c=a.hexToArray(a.leftPad(f.getX().toBigInteger().toRadix(16),64)),p=a.hexToArray(a.leftPad(f.getY().toBigInteger().toRadix(16),64)),_=1,g=0,m=[],v=[].concat(c,p),y=function(){m=h([].concat(v,[_>>24&255,_>>16&255,_>>8&255,255&_])),_++,g=0};y();for(var w=0,b=l.length;w2&&arguments[2]!==undefined?arguments[2]:{},n=r.pointPool,o=r.der,h=r.hash,u=r.publicKey,f=r.userId,d="string"==typeof t?a.utf8ToHex(t):a.arrayToHex(t);h&&(d=p(d,u=u||function(t){var e=l.multiply(new i(t,16)),r=a.leftPad(e.getX().toBigInteger().toString(16),64),n=a.leftPad(e.getY().toBigInteger().toString(16),64);return"04"+r+n}(e),f));var g=new i(e,16),m=new i(d,16),v=null,y=null,w=null;do{do{var b=void 0;v=(b=n&&n.length?n.pop():_()).k,y=m.add(b.x1).mod(c)}while(y.equals(i.ZERO)||y.add(v).equals(c));w=g.add(i.ONE).modInverse(c).multiply(v.subtract(y.multiply(g))).mod(c)}while(w.equals(i.ZERO));return o?s(y,w):a.leftPad(y.toString(16),64)+a.leftPad(w.toString(16),64)},doVerifySignature:function(t,e,r){var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},s=n.der,h=n.hash,u=n.userId,d="string"==typeof t?a.utf8ToHex(t):a.arrayToHex(t);h&&(d=p(d,r,u));var _=void 0,g=void 0;if(s){var m=o(e);_=m.r,g=m.s}else _=new i(e.substring(0,64),16),g=new i(e.substring(64),16);var v=f.decodePointHex(r),y=new i(d,16),w=_.add(g).mod(c);if(w.equals(i.ZERO))return!1;var b=l.multiply(g).add(v.multiply(w)),T=y.add(b.getX().toBigInteger()).mod(c);return _.equals(T)},getPoint:_,verifyPublicKey:a.verifyPublicKey,hexToArray:a.hexToArray}},function(t,e,r){function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var o=r(0).BigInteger;var a=function(){function t(){s(this,t),this.tlv=null,this.t="00",this.l="00",this.v=""}return t.prototype.getEncodedHex=function(){return this.tlv||(this.v=this.getValue(),this.l=this.getLength(),this.tlv=this.t+this.l+this.v),this.tlv},t.prototype.getLength=function(){var t=this.v.length/2,e=t.toString(16);return e.length%2==1&&(e="0"+e),t<128?e:(128+e.length/2).toString(16)+e},t.prototype.getValue=function(){return""},t}(),h=function(t){function e(r){s(this,e);var n=i(this,t.call(this));return n.t="02",r&&(n.v=function(t){var e=t.toString(16);if("-"!==e[0])e.length%2==1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{var r=(e=e.substr(1)).length;r%2==1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var i="",n=0;n=e?t:new Array(e-t.length+1).join("0")+t}t.exports={getGlobalCurve:function(){return u},generateEcparam:c,generateKeyPairHex:function(t,e,r){var i=(t?new n(t,e,r):new n(f.bitLength(),a)).mod(f.subtract(n.ONE)).add(n.ONE),s=d(i.toString(16),64),o=l.multiply(i);return{privateKey:s,publicKey:"04"+d(o.getX().toBigInteger().toString(16),64)+d(o.getY().toBigInteger().toString(16),64)}},compressPublicKeyHex:function(t){if(130!==t.length)throw new Error("Invalid public key to compress");var e=(t.length-2)/2,r=t.substr(2,e),i="03";return new n(t.substr(e+2,e),16).mod(new n("2")).equals(n.ZERO)&&(i="02"),i+r},utf8ToHex:function(t){for(var e=(t=unescape(encodeURIComponent(t))).length,r=[],i=0;i>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;for(var n=[],s=0;s>>2]>>>24-s%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},leftPad:d,arrayToHex:function(t){return t.map(function(t){return 1===(t=t.toString(16)).length?"0"+t:t}).join("")},arrayToUtf8:function(t){for(var e=[],r=0,i=0;i<2*t.length;i+=2)e[i>>>3]|=parseInt(t[r],10)<<24-i%8*4,r++;try{for(var n=[],s=0;s>>2]>>>24-s%4*8&255;n.push(String.fromCharCode(o))}return decodeURIComponent(escape(n.join("")))}catch(a){throw new Error("Malformed UTF-8 data")}},hexToArray:function(t){var e=[],r=t.length;r%2!=0&&(t=d(t,r+1)),r=t.length;for(var i=0;i0;n--){i=i.twice();var s=e.testBit(n);s!==t.testBit(n)&&(i=i.add(s?this:r))}return i},t}(),u=function(){function t(e,r,n){i(this,t),this.q=e,this.a=this.fromBigInteger(r),this.b=this.fromBigInteger(n),this.infinity=new h(this,null,null)}return t.prototype.equals=function(t){return t===this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},t.prototype.fromBigInteger=function(t){return new a(this.q,t)},t.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var e=this.fromBigInteger(new n(t.substr(2),16)),r=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new n("4")).add(n.ONE),this.q));return r.toBigInteger().mod(s).equals(new n(t.substr(0,2),16).subtract(s))||(r=r.negate()),new h(this,e,r);case 4:case 6:case 7:var i=(t.length-2)/2,o=t.substr(2,i),a=t.substr(i+2,i);return new h(this,this.fromBigInteger(new n(o,16)),this.fromBigInteger(new n(a,16)));default:return null}},t}();t.exports={ECPointFp:h,ECCurveFp:u}},function(t,e,r){var i=r(1),n=i.sm3,s=i.hmac;function o(t){return t.map(function(t){return 1===(t=t.toString(16)).length?"0"+t:t}).join("")}function a(t){var e,r,i=[],n=t.length;n%2!=0&&(r=n+1,t=(e=t).length>=r?e:new Array(r-e.length+1).join("0")+e),n=t.length;for(var s=0;s>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}(t):Array.prototype.slice.call(t),e){if("hmac"!==(e.mode||"hmac"))throw new Error("invalid mode");var r=e.key;if(!r)throw new Error("invalid key");return r="string"==typeof r?a(r):Array.prototype.slice.call(r),o(s(t,r))}return o(n(t))}},function(t,e,r){var i=0,n=32,s=16,o=[214,144,233,254,204,225,61,183,22,182,20,194,40,251,44,5,43,103,154,118,42,190,4,195,170,68,19,38,73,134,6,153,156,66,80,244,145,239,152,122,51,84,11,67,237,207,172,98,228,179,28,169,201,8,232,149,128,223,148,250,117,143,63,166,71,7,167,252,243,115,23,186,131,89,60,25,230,133,79,168,104,107,129,178,113,100,218,139,248,235,15,75,112,86,157,53,30,36,14,94,99,88,209,162,37,34,124,59,1,33,120,135,212,0,70,87,159,211,39,82,76,54,2,231,160,196,200,158,234,191,138,210,64,199,56,181,163,247,242,206,249,97,21,161,224,174,93,164,155,52,26,85,173,147,50,48,245,140,177,227,29,246,226,46,130,102,202,96,192,41,35,171,13,83,78,111,213,219,55,69,222,253,142,47,3,255,106,114,109,108,91,81,141,27,175,146,187,221,188,127,17,217,92,65,31,16,90,216,10,193,49,136,165,205,123,189,45,116,208,18,184,229,180,176,137,105,151,74,12,150,119,126,101,185,241,9,197,110,198,132,24,240,125,236,58,220,77,32,121,238,95,62,215,203,57,72],a=[462357,472066609,943670861,1415275113,1886879365,2358483617,2830087869,3301692121,3773296373,4228057617,404694573,876298825,1347903077,1819507329,2291111581,2762715833,3234320085,3705924337,4177462797,337322537,808926789,1280531041,1752135293,2223739545,2695343797,3166948049,3638552301,4110090761,269950501,741554753,1213159005,1684763257];function h(t){for(var e=[],r=0,i=t.length;r>>32-r}function l(t){return(255&o[t>>>24&255])<<24|(255&o[t>>>16&255])<<16|(255&o[t>>>8&255])<<8|255&o[255&t]}function f(t){return t^u(t,2)^u(t,10)^u(t,18)^u(t,24)}function c(t){return t^u(t,13)^u(t,23)}function d(t,e,r){for(var i=new Array(4),n=new Array(4),s=0;s<4;s++)n[0]=255&t[4*s],n[1]=255&t[4*s+1],n[2]=255&t[4*s+2],n[3]=255&t[4*s+3],i[s]=n[0]<<24|n[1]<<16|n[2]<<8|n[3];for(var o,a=0;a<32;a+=4)o=i[1]^i[2]^i[3]^r[a+0],i[0]^=f(l(o)),o=i[2]^i[3]^i[0]^r[a+1],i[1]^=f(l(o)),o=i[3]^i[0]^i[1]^r[a+2],i[2]^=f(l(o)),o=i[0]^i[1]^i[2]^r[a+3],i[3]^=f(l(o));for(var h=0;h<16;h+=4)e[h]=i[3-h/4]>>>24&255,e[h+1]=i[3-h/4]>>>16&255,e[h+2]=i[3-h/4]>>>8&255,e[h+3]=255&i[3-h/4]}function p(t,e,r){var o=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{},u=o.padding,f=u===undefined?"pkcs#7":u,p=o.mode,_=o.iv,g=_===undefined?[]:_,m=o.output,v=m===undefined?"string":m;if("cbc"===p&&("string"==typeof g&&(g=h(g)),16!==g.length))throw new Error("iv is invalid");if("string"==typeof e&&(e=h(e)),16!==e.length)throw new Error("key is invalid");if(t="string"==typeof t?r!==i?function(t){for(var e=[],r=0,i=t.length;r>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}(t):h(t):[].concat(t),("pkcs#5"===f||"pkcs#7"===f)&&r!==i)for(var y=s-t.length%s,w=0;w=s;){var E=t.slice(S,S+16),B=new Array(16);if("cbc"===p)for(var k=0;k=240&&t[r]<=247?(e.push(String.fromCodePoint(((7&t[r])<<18)+((63&t[r+1])<<12)+((63&t[r+2])<<6)+(63&t[r+3]))),r+=3):t[r]>=224&&t[r]<=239?(e.push(String.fromCodePoint(((15&t[r])<<12)+((63&t[r+1])<<6)+(63&t[r+2]))),r+=2):t[r]>=192&&t[r]<=223?(e.push(String.fromCodePoint(((31&t[r])<<6)+(63&t[r+1]))),r++):e.push(String.fromCodePoint(t[r]));return e.join("")}(T):T}t.exports={encrypt:function(t,e,r){return p(t,e,1,r)},decrypt:function(t,e,r){return p(t,e,0,r)}}}]};function buildSMModule(){return sm(getSmBuildArgs())}function getPako(){function t(t){for(var e=t.length;--e>=0;)t[e]=0}var e=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),r=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),n=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);t(s);var o=new Array(60);t(o);var a=new Array(512);t(a);var h=new Array(256);t(h);var u=new Array(29);t(u);var l,f,c,d=new Array(30);function p(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function _(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}t(d);var g=function(t){return t<256?a[t]:a[256+(t>>>7)]},m=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},v=function(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<>>=1,r<<=1}while(--e>0);return r>>>1},b=function(t,e,r){var i,n,s=new Array(16),o=0;for(i=1;i<=15;i++)o=o+r[i-1]<<1,s[i]=o;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=w(s[a]++,a))}},T=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},x=function(t){t.bi_valid>8?m(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},F=function(t,e,r,i){var n=2*e,s=2*r;return t[n]>1;r>=1;r--)S(t,s,r);n=h;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],S(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,S(t,s,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,i,n,s,o,a,h=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,c=e.stat_desc.extra_bits,d=e.stat_desc.extra_base,p=e.stat_desc.max_length,_=0;for(s=0;s<=15;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)(s=h[2*h[2*(i=t.heap[r])+1]+1]+1)>p&&(s=p,_++),h[2*i+1]=s,i>u||(t.bl_count[s]++,o=0,i>=d&&(o=c[i-d]),a=h[2*i],t.opt_len+=a*(s+o),f&&(t.static_len+=a*(l[2*i+1]+o)));if(0!==_){do{for(s=p-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[p]--,_-=2}while(_>0);for(s=p;0!==s;s--)for(i=t.bl_count[s];0!==i;)(n=t.heap[--r])>u||(h[2*n+1]!==s&&(t.opt_len+=(s-h[2*n+1])*h[2*n],h[2*n+1]=s),i--)}}(t,e),b(s,u,t.bl_count)},k=function(t,e,r){var i,n,s=-1,o=e[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=o,o=e[2*(i+1)+1],++a>=7;g<30;g++)for(d[g]=m<<7,t=0;t<1<0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),B(t,t.l_desc),B(t,t.d_desc),u=function(t){var e;for(k(t,t.dyn_ltree,t.l_desc.max_code),k(t,t.dyn_dtree,t.d_desc.max_code),B(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*n[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),a=t.opt_len+3+7>>>3,(h=t.static_len+3+7>>>3)<=a&&(a=h)):a=h=r+5,r+4<=a&&-1!==e?D(t,e,r,i):4===t.strategy||h===a?(v(t,2+(i?1:0),3),E(t,s,o)):(v(t,4+(i?1:0),3),function(t,e,r,i){var s;for(v(t,e-257,5),v(t,r-1,5),v(t,i-4,4),s=0;s>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(h[r]+256+1)]++,t.dyn_dtree[2*g(e)]++),t.sym_next===t.sym_end},_tr_align:function(t){v(t,2,3),y(t,256,s),function(t){16===t.bi_valid?(m(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},R=function(t,e,r,i){for(var n=65535&t|0,s=t>>>16&65535|0,o=0;0!==r;){r-=o=r>2e3?2e3:r;do{s=s+(n=n+e[i++]|0)|0}while(--o);n%=65521,s%=65521}return n|s<<16|0},O=new Uint32Array(function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}()),q=function(t,e,r,i){var n=O,s=i+r;t^=-1;for(var o=i;o>>8^n[255&(t^e[o])];return-1^t},P={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},M={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},Z=I._tr_init,C=I._tr_stored_block,U=I._tr_flush_block,L=I._tr_tally,N=I._tr_align,H=M.Z_NO_FLUSH,K=M.Z_PARTIAL_FLUSH,j=M.Z_FULL_FLUSH,V=M.Z_FINISH,Y=M.Z_BLOCK,X=M.Z_OK,G=M.Z_STREAM_END,J=M.Z_STREAM_ERROR,W=M.Z_DATA_ERROR,$=M.Z_BUF_ERROR,Q=M.Z_DEFAULT_COMPRESSION,tt=M.Z_FILTERED,et=M.Z_HUFFMAN_ONLY,rt=M.Z_RLE,it=M.Z_FIXED,nt=M.Z_DEFAULT_STRATEGY,st=M.Z_UNKNOWN,ot=M.Z_DEFLATED,at=286,ht=30,ut=19,lt=2*at+1,ft=15,ct=function(t,e){return t.msg=P[e],e},dt=function(t){return 2*t-(t>4?9:0)},pt=function(t){for(var e=t.length;--e>=0;)t[e]=0},_t=function(t){var e,r,i,n=t.w_size;i=e=t.hash_size;do{r=t.head[--i],t.head[i]=r>=n?r-n:0}while(--e);i=e=n;do{r=t.prev[--i],t.prev[i]=r>=n?r-n:0}while(--e)},gt=function(t,e,r){return(e<t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},vt=function(t,e){U(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,mt(t.strm)},yt=function(t,e){t.pending_buf[t.pending++]=e},wt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},bt=function(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),r),1===t.state.wrap?t.adler=R(t.adler,e,n,r):2===t.state.wrap&&(t.adler=q(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)},Tt=function(t,e){var r,i,n=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-262?t.strstart-(t.w_size-262):0,u=t.window,l=t.w_mask,f=t.prev,c=t.strstart+258,d=u[s+o-1],p=u[s+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do{if(u[(r=e)+o]===p&&u[r+o-1]===d&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do{}while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&so){if(t.match_start=e,o=i,i>=a)break;d=u[s+o-1],p=u[s+o]}}}while((e=f[e&l])>h&&0!=--n);return o<=t.lookahead?o:t.lookahead},xt=function(t){var e,r,i,n=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=n+(n-262)&&(t.window.set(t.window.subarray(n,n+n-r),0),t.match_start-=n,t.strstart-=n,t.block_start-=n,t.insert>t.strstart&&(t.insert=t.strstart),_t(t),r+=n),0===t.strm.avail_in)break;if(e=bt(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=e,t.lookahead+t.insert>=3)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=gt(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=gt(t,t.ins_h,t.window[i+3-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<262&&0!==t.strm.avail_in)},Ft=function(t,e){var r,i,n,s=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,o=0,a=t.strm.avail_in;do{if(r=65535,n=t.bi_valid+42>>3,t.strm.avail_out(i=t.strstart-t.block_start)+t.strm.avail_in&&(r=i+t.strm.avail_in),r>n&&(r=n),r>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,mt(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(bt(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===o);return(a-=t.strm.avail_in)&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_watern&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(bt(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water>3,s=(n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n)>t.w_size?t.w_size:n,((i=t.strstart-t.block_start)>=s||(i||e===V)&&e!==H&&0===t.strm.avail_in&&i<=n)&&(r=i>n?n:i,o=e===V&&0===t.strm.avail_in&&r===i?1:0,C(t,t.block_start,r,o),t.block_start+=r,mt(t.strm)),o?3:1)},St=function(t,e){for(var r,i;;){if(t.lookahead<262){if(xt(t),t.lookahead<262&&e===H)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=gt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-262&&(t.match_length=Tt(t,r)),t.match_length>=3)if(i=L(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=gt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=gt(t,t.ins_h,t.window[t.strstart+1]);else i=L(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===V?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2},Et=function(t,e){for(var r,i,n;;){if(t.lookahead<262){if(xt(t),t.lookahead<262&&e===H)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=gt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-3,i=L(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=n&&(t.ins_h=gt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,i&&(vt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((i=L(t,0,t.window[t.strstart-1]))&&vt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=L(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===V?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2};function Bt(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}var kt=[new Bt(0,0,0,0,Ft),new Bt(4,4,8,4,St),new Bt(4,5,16,8,St),new Bt(4,6,32,32,St),new Bt(4,4,16,16,Et),new Bt(8,16,32,32,Et),new Bt(8,16,128,128,Et),new Bt(8,32,128,256,Et),new Bt(32,128,258,1024,Et),new Bt(32,258,258,4096,Et)];function At(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ot,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*lt),this.dyn_dtree=new Uint16Array(2*(2*ht+1)),this.bl_tree=new Uint16Array(2*(2*ut+1)),pt(this.dyn_ltree),pt(this.dyn_dtree),pt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(ft+1),this.heap=new Uint16Array(2*at+1),pt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*at+1),pt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var zt=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||42!==e.status&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&113!==e.status&&666!==e.status?1:0},Dt=function(t){if(zt(t))return ct(t,J);t.total_in=t.total_out=0,t.data_type=st;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?42:113,t.adler=2===e.wrap?0:1,e.last_flush=-2,Z(e),X},It=function(t){var e,r=Dt(t);return r===X&&((e=t.state).window_size=2*e.w_size,pt(e.head),e.max_lazy_match=kt[e.level].max_lazy,e.good_match=kt[e.level].good_length,e.nice_match=kt[e.level].nice_length,e.max_chain_length=kt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),r},Rt=function(t,e,r,i,n,s){if(!t)return J;var o=1;if(e===Q&&(e=6),i<0?(o=0,i=-i):i>15&&(o=2,i-=16),n<1||n>9||r!==ot||i<8||i>15||e<0||e>9||s<0||s>it||8===i&&1!==o)return ct(t,J);8===i&&(i=9);var a=new At;return t.state=a,a.strm=t,a.status=42,a.wrap=o,a.gzhead=null,a.w_bits=i,a.w_size=1<Y||e<0)return t?ct(t,J):J;var r=t.state;if(!t.output||0!==t.avail_in&&!t.input||666===r.status&&e!==V)return ct(t,0===t.avail_out?$:J);var i=r.last_flush;if(r.last_flush=e,0!==r.pending){if(mt(t),0===t.avail_out)return r.last_flush=-1,X}else if(0===t.avail_in&&dt(e)<=dt(i)&&e!==V)return ct(t,$);if(666===r.status&&0!==t.avail_in)return ct(t,$);if(42===r.status&&0===r.wrap&&(r.status=113),42===r.status){var n=ot+(r.w_bits-8<<4)<<8;if(n|=(r.strategy>=et||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(n|=32),wt(r,n+=31-n%31),0!==r.strstart&&(wt(r,t.adler>>>16),wt(r,65535&t.adler)),t.adler=1,r.status=113,mt(t),0!==r.pending)return r.last_flush=-1,X}if(57===r.status)if(t.adler=0,yt(r,31),yt(r,139),yt(r,8),r.gzhead)yt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),yt(r,255&r.gzhead.time),yt(r,r.gzhead.time>>8&255),yt(r,r.gzhead.time>>16&255),yt(r,r.gzhead.time>>24&255),yt(r,9===r.level?2:r.strategy>=et||r.level<2?4:0),yt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(yt(r,255&r.gzhead.extra.length),yt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=q(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(yt(r,0),yt(r,0),yt(r,0),yt(r,0),yt(r,0),yt(r,9===r.level?2:r.strategy>=et||r.level<2?4:0),yt(r,3),r.status=113,mt(t),0!==r.pending)return r.last_flush=-1,X;if(69===r.status){if(r.gzhead.extra){for(var s=r.pending,o=(65535&r.gzhead.extra.length)-r.gzindex;r.pending+o>r.pending_buf_size;){var a=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>s&&(t.adler=q(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex+=a,mt(t),0!==r.pending)return r.last_flush=-1,X;s=0,o-=a}var h=new Uint8Array(r.gzhead.extra);r.pending_buf.set(h.subarray(r.gzindex,r.gzindex+o),r.pending),r.pending+=o,r.gzhead.hcrc&&r.pending>s&&(t.adler=q(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){var u,l=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>l&&(t.adler=q(t.adler,r.pending_buf,r.pending-l,l)),mt(t),0!==r.pending)return r.last_flush=-1,X;l=0}u=r.gzindexl&&(t.adler=q(t.adler,r.pending_buf,r.pending-l,l)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){var f,c=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>c&&(t.adler=q(t.adler,r.pending_buf,r.pending-c,c)),mt(t),0!==r.pending)return r.last_flush=-1,X;c=0}f=r.gzindexc&&(t.adler=q(t.adler,r.pending_buf,r.pending-c,c))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(mt(t),0!==r.pending))return r.last_flush=-1,X;yt(r,255&t.adler),yt(r,t.adler>>8&255),t.adler=0}if(r.status=113,mt(t),0!==r.pending)return r.last_flush=-1,X}if(0!==t.avail_in||0!==r.lookahead||e!==H&&666!==r.status){var d=0===r.level?Ft(r,e):r.strategy===et?function(t,e){for(var r;;){if(0===t.lookahead&&(xt(t),0===t.lookahead)){if(e===H)return 1;break}if(t.match_length=0,r=L(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2}(r,e):r.strategy===rt?function(t,e){for(var r,i,n,s,o=t.window;;){if(t.lookahead<=258){if(xt(t),t.lookahead<=258&&e===H)return 1;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=3&&t.strstart>0&&(i=o[n=t.strstart-1])===o[++n]&&i===o[++n]&&i===o[++n]){s=t.strstart+258;do{}while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=3?(r=L(t,1,t.match_length-3),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=L(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(vt(t,!1),0===t.strm.avail_out))return 1}return t.insert=0,e===V?(vt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(vt(t,!1),0===t.strm.avail_out)?1:2}(r,e):kt[r.level].func(r,e);if(3!==d&&4!==d||(r.status=666),1===d||3===d)return 0===t.avail_out&&(r.last_flush=-1),X;if(2===d&&(e===K?N(r):e!==Y&&(C(r,0,0,!1),e===j&&(pt(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),mt(t),0===t.avail_out))return r.last_flush=-1,X}return e!==V?X:r.wrap<=0?G:(2===r.wrap?(yt(r,255&t.adler),yt(r,t.adler>>8&255),yt(r,t.adler>>16&255),yt(r,t.adler>>24&255),yt(r,255&t.total_in),yt(r,t.total_in>>8&255),yt(r,t.total_in>>16&255),yt(r,t.total_in>>24&255)):(wt(r,t.adler>>>16),wt(r,65535&t.adler)),mt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?X:G)},deflateEnd:function(t){if(zt(t))return J;var e=t.state.status;return t.state=null,113===e?ct(t,W):X},deflateSetDictionary:function(t,e){var r=e.length;if(zt(t))return J;var i=t.state,n=i.wrap;if(2===n||1===n&&42!==i.status||i.lookahead)return J;if(1===n&&(t.adler=R(t.adler,e,r,0)),i.wrap=0,r>=i.w_size){0===n&&(pt(i.head),i.strstart=0,i.block_start=0,i.insert=0);var s=new Uint8Array(i.w_size);s.set(e.subarray(r-i.w_size,r),0),e=s,r=i.w_size}var o=t.avail_in,a=t.next_in,h=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,xt(i);i.lookahead>=3;){var u=i.strstart,l=i.lookahead-2;do{i.ins_h=gt(i,i.ins_h,i.window[u+3-1]),i.prev[u&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=u,u++}while(--l);i.strstart=u,i.lookahead=2,xt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,t.next_in=a,t.input=h,t.avail_in=o,i.wrap=n,X},deflateInfo:"pako deflate (from Nodeca project)"};function qt(t){return(qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var Pt=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},Mt={assign:function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!==qt(r))throw new TypeError(r+"must be non-object");for(var i in r)Pt(r,i)&&(t[i]=r[i])}}return t},flattenChunks:function(t){for(var e=0,r=0,i=t.length;r=252?6:Ut>=248?5:Ut>=240?4:Ut>=224?3:Ut>=192?2:1;Ct[254]=Ct[254]=1;var Lt={string2buf:function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,r,i,n,s,o=t.length,a=0;for(n=0;n>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e},buf2string:function(t,e){var r,i,n=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));var s=new Array(2*n);for(i=0,r=0;r4)s[i++]=65533,r+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&r1?s[i++]=65533:o<65536?s[i++]=o:(o-=65536,s[i++]=55296|o>>10&1023,s[i++]=56320|1023&o)}}}return function(t,e){if(e<65534&&t.subarray&&Zt)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var r="",i=0;it.length&&(e=t.length);for(var r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0?e:0===r?e:r+Ct[t[r]]>e?r:e}};var Nt=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0},Ht=Object.prototype.toString,Kt=M.Z_NO_FLUSH,jt=M.Z_SYNC_FLUSH,Vt=M.Z_FULL_FLUSH,Yt=M.Z_FINISH,Xt=M.Z_OK,Gt=M.Z_STREAM_END,Jt=M.Z_DEFAULT_COMPRESSION,Wt=M.Z_DEFAULT_STRATEGY,$t=M.Z_DEFLATED;function Qt(t){this.options=Mt.assign({level:Jt,method:$t,chunkSize:16384,windowBits:15,memLevel:8,strategy:Wt},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Nt,this.strm.avail_out=0;var r=Ot.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Xt)throw new Error(P[r]);if(e.header&&Ot.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(i="string"==typeof e.dictionary?Lt.string2buf(e.dictionary):"[object ArrayBuffer]"===Ht.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(r=Ot.deflateSetDictionary(this.strm,i))!==Xt)throw new Error(P[r]);this._dict_set=!0}}function te(t,e){var r=new Qt(e);if(r.push(t,!0),r.err)throw r.msg||P[r.err];return r.result}return Qt.prototype.push=function(t,e){var r,i,n=this.strm,s=this.options.chunkSize;if(this.ended)return!1;for(i=e===~~e?e:!0===e?Yt:Kt,"string"==typeof t?n.input=Lt.string2buf(t):"[object ArrayBuffer]"===Ht.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(s),n.next_out=0,n.avail_out=s),(i===jt||i===Vt)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if((r=Ot.deflate(n,i))===Gt)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=Ot.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Xt;if(0!==n.avail_out){if(i>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},Qt.prototype.onData=function(t){this.chunks.push(t)},Qt.prototype.onEnd=function(t){t===Xt&&(this.result=Mt.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},{Deflate:Qt,deflate:te,deflateRaw:function(t,e){return(e=e||{}).raw=!0,te(t,e)},gzip:function(t,e){return(e=e||{}).gzip=!0,te(t,e)},constants:M}}var sm2,sm4,hexToArray,sm4key,encryptedSm4Key,iv,oldEncoder,_this,_sa,_config,pako,sdkversion_placeholder="1.26.9";function wrapPluginInitFn(t,e,r){if(e&&(t.plugin_name=e),r&&t.init){var i=t.init;t.init=function(n,s){if(wrapLogFn(n,t,e),n.readyState&&n.readyState.state>=3||!n.on)return o();function o(){i.call(t,n,s)}n.on(r,o)}}return t}function wrapLogFn(t,e,r){function i(e,i){t.logger?t.logger.msg.apply(t.logger,i).module(r+""||"").level(e).log():t.log&&t.log.apply(t,i)}e.log=function(){i("log",arguments)},e.warn=function(){i("warn",arguments)},e.error=function(){i("error",arguments)}}function createPlugin(t,e,r){return wrapPluginInitFn(t,e,r),t.plugin_version=sdkversion_placeholder,t}function get128RandomByte(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(255*_sa._.getRandom()).toString(16);e+=2===r.length?r:"0"+r}return e}function matchType(t,e,r){return typeof t===r||(_this.error(e+" must be "+r),!1)}function isTruthy(t,e){return!!t||(_this.error(e+" cant not be null"),!1)}function isSupportSMEncryption(){try{var t=new Uint8Array(1);return t[0]=1,1===t[0]}catch(e){return!1}}function hexToBase64(t){return btoa(String.fromCharCode.apply(null,t.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")))}function encryptData(t){t=JSON.stringify(t),t=Array.prototype.slice.call(pako.gzip(t));var e=sm4.encrypt(t,sm4key,{mode:"cbc",iv:iv});return hexToBase64(iv+e)}function encodeTrackData(t){try{var e,r=encryptData(t);e={pkv:_config.pkv,ekey:encryptedSm4Key,flush_time:_sa._.now(),payloads:[r]};var i=JSON.stringify(e),n="crc="+_sa._.hashCode(i);return"data="+encodeURIComponent(i)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(s){_this.error("SM encryption error, data will not be encrypted")}return oldEncoder.call(_sa.kit,t)}function doEncryptSM4Key(t,e){for(var r=0;r<10;){r++;var i=sm2.doEncrypt(hexToArray(t).slice(),e,1);if("0"!==i[0]||"4"!==i[1])return hexToBase64(i)}throw"generate SM4 ekey failed"}var SmEncryption={init:function(t,e){try{if(!isSupportSMEncryption())return void this.warn("browser incompatible, data send will not be encrypted");if(!t||!t.kit||!t.kit.encodeTrackData)return void this.error("SMEncryption init failed, SDK version incompatible.");_sa=t,_config=e,_this=this;var r=buildSMModule();pako=getPako(),sm2=r.sm2,sm4=r.sm4,hexToArray=sm2.hexToArray,isTruthy(e,"init config")&&matchType(e.pkv,"pkv","number")&&isTruthy(e.pub_key,"pub_key")&&matchType(e.pub_key,"pub_key","string")?(iv=get128RandomByte(),sm4key=get128RandomByte(),encryptedSm4Key=doEncryptSM4Key(sm4key,_config.pub_key),oldEncoder=t.kit.encodeTrackData,t.kit.encodeTrackData=encodeTrackData,_this.log("SMEncryption init succeed")):_this.error("SMEncryption init failed")}catch(i){_this.error("SMEncryption init exception: "+i)}}},index=createPlugin(SmEncryption,"SMEncryption","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/sm-encryption/index.js b/dist/web/plugin/sm-encryption/index.js index 822df28a..10bdef52 100644 --- a/dist/web/plugin/sm-encryption/index.js +++ b/dist/web/plugin/sm-encryption/index.js @@ -1,3 +1,3 @@ (window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).SMEncryption=function(){"use strict";function t(t){function e(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return t[i].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var r={};return e.m=t,e.c=r,e.d=function(t,r,i){e.o(t,r)||Object.defineProperty(t,r,{enumerable:!0,get:i})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,r){if(1&r&&(t=e(t)),8&r)return t;if(4&r&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(e.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&r&&"string"!=typeof t)for(var n in t)e.d(i,n,function(e){return t[e]}.bind(null,n));return i},e.n=function(t){var r=t&&t.__esModule?function(){return t["default"]}:function(){return t};return e.d(r,"a",r),r},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=2)}function e(){return t(S())}function r(){function t(t){for(var e=t.length;--e>=0;)t[e]=0}function e(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}function r(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function i(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}function n(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ee,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(2*le),this.dyn_dtree=new Uint16Array(2*(2*he+1)),this.bl_tree=new Uint16Array(2*(2*ue+1)),De(this.dyn_ltree),De(this.dyn_dtree),De(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(fe+1),this.heap=new Uint16Array(2*ae+1),De(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*ae+1),De(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function s(t){"@babel/helpers - typeof";return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function a(t){this.options=vr.assign({level:qr,method:Zr,chunkSize:16384,windowBits:15,memLevel:8,strategy:Pr},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Br,this.strm.avail_out=0;var r=pr.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Rr)throw new Error(Dt[r]);if(e.header&&pr.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(i="string"==typeof e.dictionary?Er.string2buf(e.dictionary):"[object ArrayBuffer]"===zr.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,r=pr.deflateSetDictionary(this.strm,i),r!==Rr)throw new Error(Dt[r]);this._dict_set=!0}}function h(t,e){var r=new a(e);if(r.push(t,!0),r.err)throw r.msg||Dt[r.err];return r.result}function u(t,e){return e=e||{},e.raw=!0,h(t,e)}function l(t,e){return e=e||{},e.gzip=!0,h(t,e)}var f=4,c=0,p=1,d=2,_=0,g=1,v=2,m=3,y=258,w=29,b=256,T=b+1+w,x=30,F=19,S=2*T+1,E=15,B=16,z=7,A=256,k=16,D=17,I=18,R=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),O=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),q=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),P=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Z=512,M=new Array(2*(T+2));t(M);var C=new Array(2*x);t(C);var U=new Array(Z);t(U);var L=new Array(y-m+1);t(L);var N=new Array(w);t(N);var H=new Array(x);t(H);var j,K,V,Y=function(t){return t<256?U[t]:U[256+(t>>>7)]},X=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},G=function(t,e,r){t.bi_valid>B-r?(t.bi_buf|=e<>B-t.bi_valid,t.bi_valid+=r-B):(t.bi_buf|=e<>>=1,r<<=1;while(--e>0);return r>>>1},$=function(t){16===t.bi_valid?(X(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)},Q=function(t,e){var r,i,n,s,o,a,h=e.dyn_tree,u=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,c=e.stat_desc.extra_bits,p=e.stat_desc.extra_base,d=e.stat_desc.max_length,_=0;for(s=0;s<=E;s++)t.bl_count[s]=0;for(h[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;rd&&(s=d,_++),h[2*i+1]=s,i>u||(t.bl_count[s]++,o=0,i>=p&&(o=c[i-p]),a=h[2*i],t.opt_len+=a*(s+o),f&&(t.static_len+=a*(l[2*i+1]+o)));if(0!==_){do{for(s=d-1;0===t.bl_count[s];)s--;t.bl_count[s]--,t.bl_count[s+1]+=2,t.bl_count[d]--,_-=2}while(_>0);for(s=d;0!==s;s--)for(i=t.bl_count[s];0!==i;)n=t.heap[--r],n>u||(h[2*n+1]!==s&&(t.opt_len+=(s-h[2*n+1])*h[2*n],h[2*n+1]=s),i--)}},tt=function(t,e,r){var i,n,s=new Array(E+1),o=0;for(i=1;i<=E;i++)o=o+r[i-1]<<1,s[i]=o;for(n=0;n<=e;n++){var a=t[2*n+1];0!==a&&(t[2*n]=W(s[a]++,a))}},et=function(){var t,r,i,n,s,o=new Array(E+1);for(i=0,n=0;n>=7;n8?X(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},nt=function(t,e,r,i){var n=2*e,s=2*r;return t[n]>1;r>=1;r--)st(t,s,r);n=h;do r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],st(t,s,1),i=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=i,s[2*n]=s[2*r]+s[2*i],t.depth[n]=(t.depth[r]>=t.depth[i]?t.depth[r]:t.depth[i])+1,s[2*r+1]=s[2*i+1]=n,t.heap[1]=n++,st(t,s,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],Q(t,e),tt(s,u,t.bl_count)},ht=function(t,e,r){var i,n,s=-1,o=e[1],a=0,h=7,u=4;for(0===o&&(h=138,u=3),e[2*(r+1)+1]=65535,i=0;i<=r;i++)n=o,o=e[2*(i+1)+1],++a=3&&0===t.bl_tree[2*P[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e},ft=function(t,e,r,i){var n;for(G(t,e-257,5),G(t,r-1,5),G(t,i-4,4),n=0;n>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return c;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return p;for(e=32;e0?(t.strm.data_type===d&&(t.strm.data_type=ct(t)),at(t,t.l_desc),at(t,t.d_desc),o=lt(t),n=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=n&&(n=s)):n=s=r+5,r+4<=n&&e!==-1?_t(t,e,r,i):t.strategy===f||s===n?(G(t,(g<<1)+(i?1:0),3),ot(t,M,C)):(G(t,(v<<1)+(i?1:0),3),ft(t,t.l_desc.max_code+1,t.d_desc.max_code+1,o+1),ot(t,t.dyn_ltree,t.dyn_dtree)),rt(t),i&&it(t)},mt=function(t,e,r){return t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(L[r]+b+1)]++,t.dyn_dtree[2*Y(e)]++),t.sym_next===t.sym_end},yt=dt,wt=_t,bt=vt,Tt=mt,xt=gt,Ft={_tr_init:yt,_tr_stored_block:wt,_tr_flush_block:bt,_tr_tally:Tt,_tr_align:xt},St=function(t,e,r,i){for(var n=65535&t|0,s=t>>>16&65535|0,o=0;0!==r;){o=r>2e3?2e3:r,r-=o;do n=n+e[i++]|0,s=s+n|0;while(--o);n%=65521,s%=65521}return n|s<<16|0},Et=St,Bt=function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e},zt=new Uint32Array(Bt()),At=function(t,e,r,i){var n=zt,s=i+r;t^=-1;for(var o=i;o>>8^n[255&(t^e[o])];return t^-1},kt=At,Dt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},It={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},Rt=Ft._tr_init,Ot=Ft._tr_stored_block,qt=Ft._tr_flush_block,Pt=Ft._tr_tally,Zt=Ft._tr_align,Mt=It.Z_NO_FLUSH,Ct=It.Z_PARTIAL_FLUSH,Ut=It.Z_FULL_FLUSH,Lt=It.Z_FINISH,Nt=It.Z_BLOCK,Ht=It.Z_OK,jt=It.Z_STREAM_END,Kt=It.Z_STREAM_ERROR,Vt=It.Z_DATA_ERROR,Yt=It.Z_BUF_ERROR,Xt=It.Z_DEFAULT_COMPRESSION,Gt=It.Z_FILTERED,Jt=It.Z_HUFFMAN_ONLY,Wt=It.Z_RLE,$t=It.Z_FIXED,Qt=It.Z_DEFAULT_STRATEGY,te=It.Z_UNKNOWN,ee=It.Z_DEFLATED,re=9,ie=15,ne=8,se=29,oe=256,ae=oe+1+se,he=30,ue=19,le=2*ae+1,fe=15,ce=3,pe=258,de=pe+ce+1,_e=32,ge=42,ve=57,me=69,ye=73,we=91,be=103,Te=113,xe=666,Fe=1,Se=2,Ee=3,Be=4,ze=3,Ae=function(t,e){return t.msg=Dt[e],e},ke=function(t){return 2*t-(t>4?9:0)},De=function(t){for(var e=t.length;--e>=0;)t[e]=0},Ie=function(t){var e,r,i,n=t.w_size;e=t.hash_size,i=e;do r=t.head[--i],t.head[i]=r>=n?r-n:0;while(--e);e=n,i=e;do r=t.prev[--i],t.prev[i]=r>=n?r-n:0;while(--e)},Re=function(t,e,r){return(e<t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},Pe=function(t,e){qt(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,qe(t.strm)},Ze=function(t,e){t.pending_buf[t.pending++]=e},Me=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},Ce=function(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),0===n?0:(t.avail_in-=n,e.set(t.input.subarray(t.next_in,t.next_in+n),r),1===t.state.wrap?t.adler=Et(t.adler,e,n,r):2===t.state.wrap&&(t.adler=kt(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)},Ue=function(t,e){var r,i,n=t.max_chain_length,s=t.strstart,o=t.prev_length,a=t.nice_match,h=t.strstart>t.w_size-de?t.strstart-(t.w_size-de):0,u=t.window,l=t.w_mask,f=t.prev,c=t.strstart+pe,p=u[s+o-1],d=u[s+o];t.prev_length>=t.good_match&&(n>>=2),a>t.lookahead&&(a=t.lookahead);do if(r=e,u[r+o]===d&&u[r+o-1]===p&&u[r]===u[s]&&u[++r]===u[s+1]){s+=2,r++;do;while(u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&u[++s]===u[++r]&&so){if(t.match_start=e,o=i,i>=a)break;p=u[s+o-1],d=u[s+o]}}while((e=f[e&l])>h&&0!==--n);return o<=t.lookahead?o:t.lookahead},Le=function(t){var e,r,i,n=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=n+(n-de)&&(t.window.set(t.window.subarray(n,n+n-r),0),t.match_start-=n,t.strstart-=n,t.block_start-=n,t.insert>t.strstart&&(t.insert=t.strstart),Ie(t),r+=n),0===t.strm.avail_in)break;if(e=Ce(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=e,t.lookahead+t.insert>=ce)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=Oe(t,t.ins_h,t.window[i+1]);t.insert&&(t.ins_h=Oe(t,t.ins_h,t.window[i+ce-1]),t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insertt.w_size?t.w_size:t.pending_buf_size-5,o=0,a=t.strm.avail_in;do{if(r=65535,n=t.bi_valid+42>>3,t.strm.avail_outi+t.strm.avail_in&&(r=i+t.strm.avail_in),r>n&&(r=n),r>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,qe(t.strm),i&&(i>r&&(i=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+i),t.strm.next_out),t.strm.next_out+=i,t.strm.avail_out-=i,t.strm.total_out+=i,t.block_start+=i,r-=i),r&&(Ce(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===o);return a-=t.strm.avail_in,a&&(a>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=a&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-a,t.strm.next_in),t.strstart),t.strstart+=a,t.insert+=a>t.w_size-t.insert?t.w_size-t.insert:a),t.block_start=t.strstart),t.high_watern&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,n+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),n>t.strm.avail_in&&(n=t.strm.avail_in),n&&(Ce(t.strm,t.window,t.strstart,n),t.strstart+=n,t.insert+=n>t.w_size-t.insert?t.w_size-t.insert:n),t.high_water>3,n=t.pending_buf_size-n>65535?65535:t.pending_buf_size-n,s=n>t.w_size?t.w_size:n,i=t.strstart-t.block_start,(i>=s||(i||e===Lt)&&e!==Mt&&0===t.strm.avail_in&&i<=n)&&(r=i>n?n:i,o=e===Lt&&0===t.strm.avail_in&&r===i?1:0,Ot(t,t.block_start,r,o),t.block_start+=r,qe(t.strm)),o?Ee:Fe)},He=function(t,e){for(var r,i;;){if(t.lookahead=ce&&(t.ins_h=Oe(t,t.ins_h,t.window[t.strstart+ce-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-de&&(t.match_length=Ue(t,r)),t.match_length>=ce)if(i=Pt(t,t.strstart-t.match_start,t.match_length-ce),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=ce){t.match_length--;do t.strstart++,t.ins_h=Oe(t,t.ins_h,t.window[t.strstart+ce-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(0!==--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=Oe(t,t.ins_h,t.window[t.strstart+1]);else i=Pt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&(Pe(t,!1),0===t.strm.avail_out))return Fe}return t.insert=t.strstart=ce&&(t.ins_h=Oe(t,t.ins_h,t.window[t.strstart+ce-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=ce-1,0!==r&&t.prev_length4096)&&(t.match_length=ce-1)),t.prev_length>=ce&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-ce,i=Pt(t,t.strstart-1-t.prev_match,t.prev_length-ce),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=Oe(t,t.ins_h,t.window[t.strstart+ce-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(0!==--t.prev_length);if(t.match_available=0,t.match_length=ce-1,t.strstart++,i&&(Pe(t,!1),0===t.strm.avail_out))return Fe}else if(t.match_available){if(i=Pt(t,0,t.window[t.strstart-1]),i&&Pe(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return Fe}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=Pt(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart=ce&&t.strstart>0&&(n=t.strstart-1,i=o[n],i===o[++n]&&i===o[++n]&&i===o[++n])){s=t.strstart+pe;do;while(i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&i===o[++n]&&nt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=ce?(r=Pt(t,1,t.match_length-ce),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Pt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(Pe(t,!1),0===t.strm.avail_out))return Fe}return t.insert=0,e===Lt?(Pe(t,!0),0===t.strm.avail_out?Ee:Be):t.sym_next&&(Pe(t,!1),0===t.strm.avail_out)?Fe:Se},Ve=function(t,e){for(var r;;){if(0===t.lookahead&&(Le(t),0===t.lookahead)){if(e===Mt)return Fe;break}if(t.match_length=0,r=Pt(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(Pe(t,!1),0===t.strm.avail_out))return Fe}return t.insert=0,e===Lt?(Pe(t,!0),0===t.strm.avail_out?Ee:Be):t.sym_next&&(Pe(t,!1),0===t.strm.avail_out)?Fe:Se},Ye=[new i(0,0,0,0,Ne),new i(4,4,8,4,He),new i(4,5,16,8,He),new i(4,6,32,32,He),new i(4,4,16,16,je),new i(8,16,32,32,je),new i(8,16,128,128,je),new i(8,32,128,256,je),new i(32,128,258,1024,je),new i(32,258,258,4096,je)],Xe=function(t){t.window_size=2*t.w_size,De(t.head),t.max_lazy_match=Ye[t.level].max_lazy,t.good_match=Ye[t.level].good_length,t.nice_match=Ye[t.level].nice_length,t.max_chain_length=Ye[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=ce-1,t.match_available=0,t.ins_h=0},Ge=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||e.status!==ge&&e.status!==ve&&e.status!==me&&e.status!==ye&&e.status!==we&&e.status!==be&&e.status!==Te&&e.status!==xe?1:0},Je=function(t){if(Ge(t))return Ae(t,Kt);t.total_in=t.total_out=0,t.data_type=te;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?ve:e.wrap?ge:Te,t.adler=2===e.wrap?0:1,e.last_flush=-2,Rt(e),Ht},We=function(t){var e=Je(t);return e===Ht&&Xe(t.state),e},$e=function(t,e){return Ge(t)||2!==t.state.wrap?Kt:(t.state.gzhead=e,Ht)},Qe=function(t,e,r,i,s,o){if(!t)return Kt;var a=1;if(e===Xt&&(e=6),i<0?(a=0,i=-i):i>15&&(a=2,i-=16),s<1||s>re||r!==ee||i<8||i>15||e<0||e>9||o<0||o>$t||8===i&&1!==a)return Ae(t,Kt);8===i&&(i=9);var h=new n;return t.state=h,h.strm=t,h.status=ge,h.wrap=a,h.gzhead=null,h.w_bits=i,h.w_size=1<Nt||e<0)return t?Ae(t,Kt):Kt;var r=t.state;if(!t.output||0!==t.avail_in&&!t.input||r.status===xe&&e!==Lt)return Ae(t,0===t.avail_out?Yt:Kt);var i=r.last_flush;if(r.last_flush=e,0!==r.pending){if(qe(t),0===t.avail_out)return r.last_flush=-1,Ht}else if(0===t.avail_in&&ke(e)<=ke(i)&&e!==Lt)return Ae(t,Yt);if(r.status===xe&&0!==t.avail_in)return Ae(t,Yt);if(r.status===ge&&0===r.wrap&&(r.status=Te),r.status===ge){var n=ee+(r.w_bits-8<<4)<<8,s=-1;if(s=r.strategy>=Jt||r.level<2?0:r.level<6?1:6===r.level?2:3,n|=s<<6,0!==r.strstart&&(n|=_e),n+=31-n%31,Me(r,n),0!==r.strstart&&(Me(r,t.adler>>>16),Me(r,65535&t.adler)),t.adler=1,r.status=Te,qe(t),0!==r.pending)return r.last_flush=-1,Ht}if(r.status===ve)if(t.adler=0,Ze(r,31),Ze(r,139),Ze(r,8),r.gzhead)Ze(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Ze(r,255&r.gzhead.time),Ze(r,r.gzhead.time>>8&255),Ze(r,r.gzhead.time>>16&255),Ze(r,r.gzhead.time>>24&255),Ze(r,9===r.level?2:r.strategy>=Jt||r.level<2?4:0),Ze(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Ze(r,255&r.gzhead.extra.length),Ze(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=kt(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=me;else if(Ze(r,0),Ze(r,0),Ze(r,0),Ze(r,0),Ze(r,0),Ze(r,9===r.level?2:r.strategy>=Jt||r.level<2?4:0),Ze(r,ze),r.status=Te,qe(t),0!==r.pending)return r.last_flush=-1,Ht;if(r.status===me){if(r.gzhead.extra){for(var o=r.pending,a=(65535&r.gzhead.extra.length)-r.gzindex;r.pending+a>r.pending_buf_size;){var h=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+h),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>o&&(t.adler=kt(t.adler,r.pending_buf,r.pending-o,o)),r.gzindex+=h,qe(t),0!==r.pending)return r.last_flush=-1,Ht;o=0,a-=h}var u=new Uint8Array(r.gzhead.extra);r.pending_buf.set(u.subarray(r.gzindex,r.gzindex+a),r.pending),r.pending+=a,r.gzhead.hcrc&&r.pending>o&&(t.adler=kt(t.adler,r.pending_buf,r.pending-o,o)),r.gzindex=0}r.status=ye}if(r.status===ye){if(r.gzhead.name){var l,f=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>f&&(t.adler=kt(t.adler,r.pending_buf,r.pending-f,f)),qe(t),0!==r.pending)return r.last_flush=-1,Ht;f=0}l=r.gzindexf&&(t.adler=kt(t.adler,r.pending_buf,r.pending-f,f)),r.gzindex=0}r.status=we}if(r.status===we){if(r.gzhead.comment){var c,p=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>p&&(t.adler=kt(t.adler,r.pending_buf,r.pending-p,p)),qe(t),0!==r.pending)return r.last_flush=-1,Ht;p=0}c=r.gzindexp&&(t.adler=kt(t.adler,r.pending_buf,r.pending-p,p))}r.status=be}if(r.status===be){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(qe(t),0!==r.pending))return r.last_flush=-1,Ht;Ze(r,255&t.adler),Ze(r,t.adler>>8&255),t.adler=0}if(r.status=Te,qe(t),0!==r.pending)return r.last_flush=-1,Ht}if(0!==t.avail_in||0!==r.lookahead||e!==Mt&&r.status!==xe){var d=0===r.level?Ne(r,e):r.strategy===Jt?Ve(r,e):r.strategy===Wt?Ke(r,e):Ye[r.level].func(r,e);if(d!==Ee&&d!==Be||(r.status=xe),d===Fe||d===Ee)return 0===t.avail_out&&(r.last_flush=-1),Ht;if(d===Se&&(e===Ct?Zt(r):e!==Nt&&(Ot(r,0,0,!1),e===Ut&&(De(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),qe(t),0===t.avail_out))return r.last_flush=-1,Ht}return e!==Lt?Ht:r.wrap<=0?jt:(2===r.wrap?(Ze(r,255&t.adler),Ze(r,t.adler>>8&255),Ze(r,t.adler>>16&255),Ze(r,t.adler>>24&255),Ze(r,255&t.total_in),Ze(r,t.total_in>>8&255),Ze(r,t.total_in>>16&255),Ze(r,t.total_in>>24&255)):(Me(r,t.adler>>>16),Me(r,65535&t.adler)),qe(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Ht:jt)},rr=function(t){if(Ge(t))return Kt;var e=t.state.status;return t.state=null,e===Te?Ae(t,Vt):Ht},ir=function(t,e){var r=e.length;if(Ge(t))return Kt;var i=t.state,n=i.wrap;if(2===n||1===n&&i.status!==ge||i.lookahead)return Kt;if(1===n&&(t.adler=Et(t.adler,e,r,0)),i.wrap=0,r>=i.w_size){0===n&&(De(i.head),i.strstart=0,i.block_start=0,i.insert=0);var s=new Uint8Array(i.w_size);s.set(e.subarray(r-i.w_size,r),0),e=s,r=i.w_size}var o=t.avail_in,a=t.next_in,h=t.input;for(t.avail_in=r,t.next_in=0,t.input=e,Le(i);i.lookahead>=ce;){var u=i.strstart,l=i.lookahead-(ce-1);do i.ins_h=Oe(i,i.ins_h,i.window[u+ce-1]),i.prev[u&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=u,u++;while(--l);i.strstart=u,i.lookahead=ce-1,Le(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=ce-1,i.match_available=0,t.next_in=a,t.input=h,t.avail_in=o,i.wrap=n,Ht},nr=tr,sr=Qe,or=We,ar=Je,hr=$e,ur=er,lr=rr,fr=ir,cr="pako deflate (from Nodeca project)",pr={deflateInit:nr,deflateInit2:sr,deflateReset:or,deflateResetKeep:ar,deflateSetHeader:hr,deflate:ur,deflateEnd:lr,deflateSetDictionary:fr,deflateInfo:cr},dr=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},_r=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!==s(r))throw new TypeError(r+"must be non-object");for(var i in r)dr(r,i)&&(t[i]=r[i])}}return t},gr=function(t){for(var e=0,r=0,i=t.length;r=252?6:br>=248?5:br>=240?4:br>=224?3:br>=192?2:1;wr[254]=wr[254]=1;var Tr=function(t){if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);var e,r,i,n,s,o=t.length,a=0;for(n=0;n>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e},xr=function(t,e){if(e<65534&&t.subarray&&mr)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));for(var r="",i=0;i4)s[n++]=65533,i+=a-1;else{for(o&=2===a?31:3===a?15:7;a>1&&i1?s[n++]=65533:o<65536?s[n++]=o:(o-=65536,s[n++]=55296|o>>10&1023,s[n++]=56320|1023&o)}}}return xr(s,n)},Sr=function(t,e){e=e||t.length,e>t.length&&(e=t.length);for(var r=e-1;r>=0&&128===(192&t[r]);)r--;return r<0?e:0===r?e:r+wr[t[r]]>e?r:e},Er={string2buf:Tr,buf2string:Fr,utf8border:Sr},Br=o,zr=Object.prototype.toString,Ar=It.Z_NO_FLUSH,kr=It.Z_SYNC_FLUSH,Dr=It.Z_FULL_FLUSH,Ir=It.Z_FINISH,Rr=It.Z_OK,Or=It.Z_STREAM_END,qr=It.Z_DEFAULT_COMPRESSION,Pr=It.Z_DEFAULT_STRATEGY,Zr=It.Z_DEFLATED;a.prototype.push=function(t,e){var r,i,n=this.strm,s=this.options.chunkSize;if(this.ended)return!1;for(i=e===~~e?e:e===!0?Ir:Ar,"string"==typeof t?n.input=Er.string2buf(t):"[object ArrayBuffer]"===zr.call(t)?n.input=new Uint8Array(t):n.input=t,n.next_in=0,n.avail_in=n.input.length;;)if(0===n.avail_out&&(n.output=new Uint8Array(s),n.next_out=0,n.avail_out=s),(i===kr||i===Dr)&&n.avail_out<=6)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else{if(r=pr.deflate(n,i),r===Or)return n.next_out>0&&this.onData(n.output.subarray(0,n.next_out)),r=pr.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Rr;if(0!==n.avail_out){if(i>0&&n.next_out>0)this.onData(n.output.subarray(0,n.next_out)),n.avail_out=0;else if(0===n.avail_in)break}else this.onData(n.output)}return!0},a.prototype.onData=function(t){this.chunks.push(t)},a.prototype.onEnd=function(t){t===Rr&&(this.result=vr.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var Mr=a,Cr=h,Ur=u,Lr=l,Nr=It,Hr={Deflate:Mr,deflate:Cr,deflateRaw:Ur,gzip:Lr,constants:Nr};return Hr}function i(t,e,r){if(e&&(t.plugin_name=e),r&&t.init){var i=t.init;t.init=function(s,o){function a(){i.call(t,s,o)}return n(s,t,e),s.readyState&&s.readyState.state>=3||!s.on?a():void s.on(r,a)}}return t}function n(t,e,r){function i(e,i){t.logger?t.logger.msg.apply(t.logger,i).module(r+""||"").level(e).log():t.log&&t.log.apply(t,i)}e.log=function(){i("log",arguments)},e.warn=function(){i("warn",arguments)},e.error=function(){i("error",arguments)}}function s(t,e,r){return i(t,e,r),t.plugin_version=E,t}function o(t){t=t||16;for(var e="";t-- >0;){var r=Math.ceil(255*T._.getRandom()).toString(16);e+=2===r.length?r:"0"+r}return e}function a(t,e,r){return typeof t===r||(b.error(e+" must be "+r),!1)}function h(t,e){return!!t||(b.error(e+" cant not be null"),!1)}function u(){try{var t=new Uint8Array(1);return t[0]=1,1===t[0]}catch(e){return!1}}function l(t){return btoa(String.fromCharCode.apply(null,t.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")))}function f(t){t=JSON.stringify(t),t=Array.prototype.slice.call(F.gzip(t));var e=_.encrypt(t,v,{mode:"cbc",iv:y});return l(y+e)}function c(t){try{var e="",r=f(t);e={pkv:x.pkv,ekey:m,flush_time:T._.now(),payloads:[r]};var i=JSON.stringify(e),n="crc="+T._.hashCode(i);return"data="+encodeURIComponent(i)+"&ext="+encodeURIComponent(n)+"&gzip=9"}catch(s){b.error("SM encryption error, data will not be encrypted"); }return w.call(T.kit,t)}function p(t,e){for(var r=0;r<10;){r++;var i=d.doEncrypt(g(t).slice(),e,1);if("0"!==i[0]||"4"!==i[1])return l(i)}throw"generate SM4 ekey failed"}var d,_,g,v,m,y,w,b,T,x,F,S=function(){function t(t,e,r){null!=t&&("number"==typeof t?this.fromNumber(t,e,r):null==e&&"string"!=typeof t?this.fromString(t,256):this.fromString(t,e))}function e(){return new t(null)}function r(t,e,r,i,n,s){for(;--s>=0;){var o=e*this[t++]+r[i]+n;n=Math.floor(o/67108864),r[i++]=67108863&o}return n}function i(t,e,r,i,n,s){for(var o=32767&e,a=e>>15;--s>=0;){var h=32767&this[t],u=this[t++]>>15,l=a*h+u*o;h=o*h+((32767&l)<<15)+r[i]+(1073741823&n),n=(h>>>30)+(l>>>15)+a*u+(n>>>30),r[i++]=1073741823&h}return n}function n(t,e,r,i,n,s){for(var o=16383&e,a=e>>14;--s>=0;){var h=16383&this[t],u=this[t++]>>14,l=a*h+u*o;h=o*h+((16383&l)<<14)+r[i]+n,n=(h>>28)+(l>>14)+a*u,r[i++]=268435455&h}return n}function s(t){return de.charAt(t)}function o(t,e){var r=_e[t.charCodeAt(e)];return null==r?-1:r}function a(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s}function h(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0}function u(t){var r=e();return r.fromInt(t),r}function l(e,r){if(!r&&e.length>=2&&"0"===e[0]){var i=!0;switch(e[1]){case"x":r=16;break;case"b":r=2;break;case"o":r=8;break;default:i=!1}i&&(e=e.substr(2))}var n;if(16==r)n=4;else if(8==r)n=3;else if(256==r)n=8;else if(2==r)n=1;else if(32==r)n=5;else{if(4!=r)return void this.fromRadix(e,r);n=2}this.t=0,this.s=0;for(var s=e.length,a=!1,h=0;--s>=0;){var u=8==n?255&e[s]:o(e,s);u<0?"-"==e.charAt(s)&&(a=!0):(a=!1,0==h?this[this.t++]=u:h+n>this.DB?(this[this.t-1]|=(u&(1<>this.DB-h):this[this.t-1]|=u<=this.DB&&(h-=this.DB))}8==n&&0!=(128&e[0])&&(this.s=-1,h>0&&(this[this.t-1]|=(1<0&&this[this.t-1]==t;)--this.t}function c(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(16==t)e=4;else if(8==t)e=3;else if(2==t)e=1;else if(32==t)e=5;else{if(4!=t)return this.toRadix(t);e=2}var r,i=(1<0)for(h>h)>0&&(n=!0,o=s(r));a>=0;)h>(h+=this.DB-e)):(r=this[a]>>(h-=e)&i,h<=0&&(h+=this.DB,--a)),r>0&&(n=!0),n&&(o+=s(r));return n?o:"0"}function p(){var r=e();return t.ZERO.subTo(this,r),r}function d(){return this.s<0?this.negate():this}function _(t){var e=this.s-t.s;if(0!=e)return e;var r=this.t;if(e=r-t.t,0!=e)return this.s<0?-e:e;for(;--r>=0;)if(0!=(e=this[r]-t[r]))return e;return 0}function g(t){var e,r=1;return 0!=(e=t>>>16)&&(t=e,r+=16),0!=(e=t>>8)&&(t=e,r+=8),0!=(e=t>>4)&&(t=e,r+=4),0!=(e=t>>2)&&(t=e,r+=2),0!=(e=t>>1)&&(t=e,r+=1),r}function v(){return this.t<=0?0:this.DB*(this.t-1)+g(this[this.t-1]^this.s&this.DM)}function m(t,e){var r;for(r=this.t-1;r>=0;--r)e[r+t]=this[r];for(r=t-1;r>=0;--r)e[r]=0;e.t=this.t+t,e.s=this.s}function y(t,e){for(var r=t;r=0;--r)e[r+o+1]=this[r]>>n|a,a=(this[r]&s)<=0;--r)e[r]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()}function b(t,e){e.s=this.s;var r=Math.floor(t/this.DB);if(r>=this.t)return void(e.t=0);var i=t%this.DB,n=this.DB-i,s=(1<>i;for(var o=r+1;o>i;i>0&&(e[this.t-r-1]|=(this.s&s)<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i-=t.s}e.s=i<0?-1:0,i<-1?e[r++]=this.DV+i:i>0&&(e[r++]=i),e.t=r,e.clamp()}function x(e,r){var i=this.abs(),n=e.abs(),s=i.t;for(r.t=s+n.t;--s>=0;)r[s]=0;for(s=0;s=0;)t[r]=0;for(r=0;r=e.DV&&(t[r+e.t]-=e.DV,t[r+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(r,e[r],t,2*r,0,1)),t.s=0,t.clamp()}function S(r,i,n){var s=r.abs();if(!(s.t<=0)){var o=this.abs();if(o.t0?(s.lShiftTo(l,a),o.lShiftTo(l,n)):(s.copyTo(a),o.copyTo(n));var f=a.t,c=a[f-1];if(0!=c){var p=c*(1<1?a[f-2]>>this.F2:0),d=this.FV/p,_=(1<=0&&(n[n.t++]=1,n.subTo(w,n)),t.ONE.dlShiftTo(f,w),w.subTo(a,a);a.t=0;){var b=n[--m]==c?this.DM:Math.floor(n[m]*d+(n[m-1]+v)*_);if((n[m]+=a.am(0,b,n,y,0,f))0&&n.rShiftTo(l,n),h<0&&t.ZERO.subTo(n,n)}}}function E(r){var i=e();return this.abs().divRemTo(r,null,i),this.s<0&&i.compareTo(t.ZERO)>0&&r.subTo(i,i),i}function B(t){this.m=t}function z(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t}function A(t){return t}function k(t){t.divRemTo(this.m,null,t)}function D(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function I(t,e){t.squareTo(e),this.reduce(e)}function R(){if(this.t<1)return 0;var t=this[0];if(0==(1&t))return 0;var e=3&t;return e=e*(2-(15&t)*e)&15,e=e*(2-(255&t)*e)&255,e=e*(2-((65535&t)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e}function O(t){this.m=t,this.mp=t.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<0&&this.m.subTo(i,i),i}function P(t){var r=e();return t.copyTo(r),this.reduce(r),r}function Z(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e>15)*this.mpl&this.um)<<15)&t.DM;for(r=e+this.m.t,t[r]+=this.m.am(0,i,t,e,0,this.m.t);t[r]>=t.DV;)t[r]-=t.DV,t[++r]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)}function M(t,e){t.squareTo(e),this.reduce(e)}function C(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function U(){return 0==(this.t>0?1&this[0]:this.s)}function L(r,i){if(r>4294967295||r<1)return t.ONE;var n=e(),s=e(),o=i.convert(this),a=g(r)-1;for(o.copyTo(n);--a>=0;)if(i.sqrTo(n,s),(r&1<0)i.mulTo(s,o,n);else{var h=n;n=s,s=h}return i.revert(n)}function N(t,e){var r;return r=t<256||e.isEven()?new B(e):new O(e),this.exp(t,r)}function H(){var t=e();return this.copyTo(t),t}function j(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<>24}function V(){return 0==this.t?this.s:this[0]<<16>>16}function Y(t){return Math.floor(Math.LN2*this.DB/Math.log(t))}function X(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1}function G(t){if(null==t&&(t=10),0==this.signum()||t<2||t>36)return"0";var r=this.chunkSize(t),i=Math.pow(t,r),n=u(i),s=e(),o=e(),a="";for(this.divRemTo(n,s,o);s.signum()>0;)a=(i+o.intValue()).toString(t).substr(1)+a,s.divRemTo(n,s,o);return o.intValue().toString(t)+a}function J(e,r){this.fromInt(0),null==r&&(r=10);for(var i=this.chunkSize(r),n=Math.pow(r,i),s=!1,a=0,h=0,u=0;u=i&&(this.dMultiply(n),this.dAddOffset(h,0),a=0,h=0))}a>0&&(this.dMultiply(Math.pow(r,a)),this.dAddOffset(h,0)),s&&t.ZERO.subTo(this,this)}function W(e,r,i){if("number"==typeof r)if(e<2)this.fromInt(1);else for(this.fromNumber(e,i),this.testBit(e-1)||this.bitwiseTo(t.ONE.shiftLeft(e-1),st,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(r);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(t.ONE.shiftLeft(e-1),this);else{var n=new Array,s=7&e;n.length=(e>>3)+1,r.nextBytes(n),s>0?n[0]&=(1<0)for(i>i)!=(this.s&this.DM)>>i&&(e[n++]=r|this.s<=0;)i<8?(r=(this[t]&(1<>(i+=this.DB-8)):(r=this[t]>>(i-=8)&255,i<=0&&(i+=this.DB,--t)),0!=(128&r)&&(r|=-256),0==n&&(128&this.s)!=(128&r)&&++n,(n>0||r!=this.s)&&(e[n++]=r);return e}function Q(t){return 0==this.compareTo(t)}function tt(t){return this.compareTo(t)<0?this:t}function et(t){return this.compareTo(t)>0?this:t}function rt(t,e,r){var i,n,s=Math.min(t.t,this.t);for(i=0;i>=16,e+=16),0==(255&t)&&(t>>=8,e+=8),0==(15&t)&&(t>>=4,e+=4),0==(3&t)&&(t>>=2,e+=2),0==(1&t)&&++e,e}function _t(){for(var t=0;t=this.t?0!=this.s:0!=(this[e]&1<>=this.DB;if(t.t>=this.DB;i+=this.s}else{for(i+=this.s;r>=this.DB;i+=t.s}e.s=i<0?-1:0,i>0?e[r++]=i:i<-1&&(e[r++]=this.DV+i),e.t=r,e.clamp()}function Ft(t){var r=e();return this.addTo(t,r),r}function St(t){var r=e();return this.subTo(t,r),r}function Et(t){var r=e();return this.multiplyTo(t,r),r}function Bt(){var t=e();return this.squareTo(t),t}function zt(t){var r=e();return this.divRemTo(t,r,null),r}function At(t){var r=e();return this.divRemTo(t,null,r),r}function kt(t){var r=e(),i=e();return this.divRemTo(t,r,i),new Array(r,i)}function Dt(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()}function It(t,e){if(0!=t){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}}function Rt(){}function Ot(t){return t}function qt(t,e,r){t.multiplyTo(e,r)}function Pt(t,e){t.squareTo(e)}function Zt(t){return this.exp(t,new Rt)}function Mt(t,e,r){var i=Math.min(this.t+t.t,e);for(r.s=0,r.t=i;i>0;)r[--i]=0;var n;for(n=r.t-this.t;i=0;)r[i]=0;for(i=Math.max(e-this.t,0);i2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var r=e();return t.copyTo(r),this.reduce(r),r}function Nt(t){return t}function Ht(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)}function jt(t,e){t.squareTo(e),this.reduce(e)}function Kt(t,e,r){t.multiplyTo(e,r),this.reduce(r)}function Vt(t,r){var i,n,s=t.bitLength(),o=u(1);if(s<=0)return o;i=s<18?1:s<48?3:s<144?4:s<768?5:6,n=s<8?new B(r):r.isEven()?new Ut(r):new O(r);var a=new Array,h=3,l=i-1,f=(1<1){var c=e();for(n.sqrTo(a[1],c);h<=f;)a[h]=e(),n.mulTo(c,a[h-2],a[h]),h+=2}var p,d,_=t.t-1,v=!0,m=e();for(s=g(t[_])-1;_>=0;){for(s>=l?p=t[_]>>s-l&f:(p=(t[_]&(1<0&&(p|=t[_-1]>>this.DB+s-l)),h=i;0==(1&p);)p>>=1,--h;if((s-=h)<0&&(s+=this.DB,--_),v)a[p].copyTo(o),v=!1;else{for(;h>1;)n.sqrTo(o,m),n.sqrTo(m,o),h-=2;h>0?n.sqrTo(o,m):(d=o,o=m,m=d),n.mulTo(m,a[p],o)}for(;_>=0&&0==(t[_]&1<0&&(e.rShiftTo(s,e),r.rShiftTo(s,r));e.signum()>0;)(n=e.getLowestSetBit())>0&&e.rShiftTo(n,e),(n=r.getLowestSetBit())>0&&r.rShiftTo(n,r),e.compareTo(r)>=0?(e.subTo(r,e),e.rShiftTo(1,e)):(r.subTo(e,r),r.rShiftTo(1,r));return s>0&&r.lShiftTo(s,r),r}function Xt(t){if(t<=0)return 0;var e=this.DV%t,r=this.s<0?t-1:0;if(this.t>0)if(0==e)r=this[0]%t;else for(var i=this.t-1;i>=0;--i)r=(e*r+this[i])%t;return r}function Gt(e){var r=e.isEven();if(this.isEven()&&r||0==e.signum())return t.ZERO;for(var i=e.clone(),n=this.clone(),s=u(1),o=u(0),a=u(0),h=u(1);0!=i.signum();){for(;i.isEven();)i.rShiftTo(1,i),r?(s.isEven()&&o.isEven()||(s.addTo(this,s),o.subTo(e,o)),s.rShiftTo(1,s)):o.isEven()||o.subTo(e,o),o.rShiftTo(1,o);for(;n.isEven();)n.rShiftTo(1,n),r?(a.isEven()&&h.isEven()||(a.addTo(this,a),h.subTo(e,h)),a.rShiftTo(1,a)):h.isEven()||h.subTo(e,h),h.rShiftTo(1,h);i.compareTo(n)>=0?(i.subTo(n,i),r&&s.subTo(a,s),o.subTo(h,o)):(n.subTo(i,n),r&&a.subTo(s,a),h.subTo(o,h))}return 0!=n.compareTo(t.ONE)?t.ZERO:h.compareTo(e)>=0?h.subtract(e):h.signum()<0?(h.addTo(e,h),h.signum()<0?h.add(e):h):h}function Jt(t){var e,r=this.abs();if(1==r.t&&r[0]<=ge[ge.length-1]){for(e=0;e>1,r>ge.length&&(r=ge.length);for(var o=e(),a=0;a>8&255,ye[we++]^=t>>16&255,ye[we++]^=t>>24&255,we>=Fe&&(we-=Fe)}function Qt(){$t((new Date).getTime())}function te(){if(null==me){for(Qt(),me=oe(),me.init(ye),we=0;we>>8,ye[we++]=255&be;we=0,Qt()}re.prototype.nextBytes=ee,ie.prototype.init=ne,ie.prototype.next=se;var Fe=256,Se={BigInteger:t,SecureRandom:re};return[function(t,e){t.exports=Se},function(t,e,r){function i(t,e){var r=31&e;return t<>>32-r}function n(t,e){for(var r=[],i=t.length-1;i>=0;i--)r[i]=255&(t[i]^e[i]);return r}function s(t){return t^i(t,9)^i(t,17)}function o(t){return t^i(t,15)^i(t,23)}function a(t){var e=8*t.length,r=e%512;r=r>=448?512-r%448-1:448-r-1;for(var n=new Array((r-7)/8),a=new Array(8),h=0,f=n.length;h=0;d--)if(e.length>8){var _=e.length-8;a[d]=parseInt(e.substr(_),2),e=e.substr(0,_)}else e.length>0&&(a[d]=parseInt(e,2),e="");for(var g=new Uint8Array([].concat(t,[128],n,a)),v=new DataView(g.buffer,0),m=g.length/64,y=new Uint32Array([1937774191,1226093241,388252375,3666478592,2842636476,372324522,3817729613,2969243214]),w=0;w=0&&L<=15?E:B,P=i(i(z,12)+I+i(U,L),7),Z=P^i(z,12),M=(L>=0&&L<=15?z^A^k:z&A|z&k|A&k)+D+Z+l[L],C=(L>=0&&L<=15?I^R^O:I&R|~I&O)+q+P+u[L],D=k,k=i(A,9),A=z,z=M,q=O,O=i(R,19),R=I,I=s(C);y[0]^=z,y[1]^=A,y[2]^=k,y[3]^=D,y[4]^=I,y[5]^=R,y[6]^=O,y[7]^=q}for(var N=[],H=0,j=y.length;H>>24,(16711680&K)>>>16,(65280&K)>>>8,255&K)}return N}function h(t,e){for(e.length>f&&(e=a(e));e.length2&&void 0!==arguments[2]?arguments[2]:1;t="string"==typeof t?_.hexToArray(_.utf8ToHex(t)):Array.prototype.slice.call(t),e=_.getGlobalCurve().decodePointHex(e);var i=_.generateKeyPairHex(),n=new f(i.privateKey,16),s=i.publicKey;s.length>128&&(s=s.substr(s.length-128));var o=e.multiply(n),a=_.hexToArray(_.leftPad(o.getX().toBigInteger().toRadix(16),64)),h=_.hexToArray(_.leftPad(o.getY().toBigInteger().toRadix(16),64)),u=_.arrayToHex(g([].concat(a,t,h))),l=1,c=0,p=[],d=[].concat(a,h),v=function(){p=g([].concat(d,[l>>24&255,l>>16&255,l>>8&255,255&l])),l++,c=0};v();for(var m=0,y=t.length;m2&&void 0!==arguments[2]?arguments[2]:1,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i.output,s=void 0===n?"string":n;e=new f(e,16);var o=t.substr(128,64),a=t.substr(192);r===b&&(o=t.substr(t.length-64),a=t.substr(128,t.length-128-64));var h=_.hexToArray(a),u=_.getGlobalCurve().decodePointHex("04"+t.substr(0,128)),l=u.multiply(e),c=_.hexToArray(_.leftPad(l.getX().toBigInteger().toRadix(16),64)),p=_.hexToArray(_.leftPad(l.getY().toBigInteger().toRadix(16),64)),d=1,v=0,m=[],y=[].concat(c,p),w=function(){m=g([].concat(y,[d>>24&255,d>>16&255,d>>8&255,255&d])),d++,v=0};w();for(var T=0,x=h.length;T2&&void 0!==arguments[2]?arguments[2]:{},i=r.pointPool,n=r.der,s=r.hash,o=r.publicKey,l=r.userId,c="string"==typeof t?_.utf8ToHex(t):_.arrayToHex(t);s&&(o=o||h(e),c=a(c,o,l));var d=new f(e,16),g=new f(c,16),v=null,m=null,y=null;do{do{var b=void 0;b=i&&i.length?i.pop():u(),v=b.k,m=g.add(b.x1).mod(w)}while(m.equals(f.ZERO)||m.add(v).equals(w));y=d.add(f.ONE).modInverse(w).multiply(v.subtract(m.multiply(d))).mod(w)}while(y.equals(f.ZERO));return n?p(m,y):_.leftPad(m.toString(16),64)+_.leftPad(y.toString(16),64)}function o(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i.der,s=i.hash,o=i.userId,h="string"==typeof t?_.utf8ToHex(t):_.arrayToHex(t);s&&(h=a(h,r,o));var u=void 0,l=void 0;if(n){var c=d(e);u=c.r,l=c.s}else u=new f(e.substring(0,64),16),l=new f(e.substring(64),16);var p=y.decodePointHex(r),g=new f(h,16),v=u.add(l).mod(w);if(v.equals(f.ZERO))return!1;var b=m.multiply(l).add(p.multiply(v)),T=g.add(b.getX().toBigInteger()).mod(w);return u.equals(T)}function a(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"1234567812345678";r=_.utf8ToHex(r);var i=_.leftPad(m.curve.a.toBigInteger().toRadix(16),64),n=_.leftPad(m.curve.b.toBigInteger().toRadix(16),64),s=_.leftPad(m.getX().toBigInteger().toRadix(16),64),o=_.leftPad(m.getY().toBigInteger().toRadix(16),64),a=void 0,h=void 0;if(128===e.length)a=e.substr(0,64),h=e.substr(64,64);else{var u=m.curve.decodePointHex(e);a=_.leftPad(u.getX().toBigInteger().toRadix(16),64),h=_.leftPad(u.getY().toBigInteger().toRadix(16),64)}var l=_.hexToArray(r+i+n+s+o+a+h),f=4*r.length;l.unshift(255&f),l.unshift(f>>8&255);var c=g(l);return _.arrayToHex(g(c.concat(_.hexToArray(t))))}function h(t){var e=m.multiply(new f(t,16)),r=_.leftPad(e.getX().toBigInteger().toString(16),64),i=_.leftPad(e.getY().toBigInteger().toString(16),64);return"04"+r+i}function u(){var t=_.generateKeyPairHex(),e=y.decodePointHex(t.publicKey);return t.k=new f(t.privateKey,16),t.x1=e.getX().toBigInteger(),t}var l=r(0),f=l.BigInteger,c=r(4),p=c.encodeDer,d=c.decodeDer,_=r(5),g=r(1).sm3,v=_.generateEcparam(),m=v.G,y=v.curve,w=v.n,b=0;t.exports={generateKeyPairHex:_.generateKeyPairHex,compressPublicKeyHex:_.compressPublicKeyHex,comparePublicKeyHex:_.comparePublicKeyHex,doEncrypt:i,doDecrypt:n,doSignature:s,doVerifySignature:o,getPoint:u,verifyPublicKey:_.verifyPublicKey,hexToArray:_.hexToArray}},function(t,e,r){function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function n(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t){var e=t.toString(16);if("-"!==e[0])e.length%2===1?e="0"+e:e.match(/^[0-7]/)||(e="00"+e);else{e=e.substr(1);var r=e.length;r%2===1?r+=1:e.match(/^[0-7]/)||(r+=2);for(var i="",n=0;n>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;for(var n=[],s=0;s>>2]>>>24-s%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")}function h(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t}function u(t){return t.map(function(t){return t=t.toString(16),1===t.length?"0"+t:t}).join("")}function l(t){for(var e=[],r=0,i=0;i<2*t.length;i+=2)e[i>>>3]|=parseInt(t[r],10)<<24-i%8*4,r++;try{for(var n=[],s=0;s>>2]>>>24-s%4*8&255;n.push(String.fromCharCode(o))}return decodeURIComponent(escape(n.join("")))}catch(a){throw new Error("Malformed UTF-8 data")}}function f(t){var e=[],r=t.length;r%2!==0&&(t=h(t,r+1)),r=t.length;for(var i=0;i0;n--){i=i.twice();var s=e.testBit(n),o=t.testBit(n);s!==o&&(i=i.add(s?this:r))}return i},t}(),l=function(){function t(e,r,n){i(this,t),this.q=e,this.a=this.fromBigInteger(r),this.b=this.fromBigInteger(n),this.infinity=new u(this,null,null)}return t.prototype.equals=function(t){return t===this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},t.prototype.fromBigInteger=function(t){return new h(this.q,t)},t.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var e=this.fromBigInteger(new s(t.substr(2),16)),r=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new s("4")).add(s.ONE),this.q));return r.toBigInteger().mod(o).equals(new s(t.substr(0,2),16).subtract(o))||(r=r.negate()),new u(this,e,r);case 4:case 6:case 7:var i=(t.length-2)/2,n=t.substr(2,i),a=t.substr(i+2,i);return new u(this,this.fromBigInteger(new s(n,16)),this.fromBigInteger(new s(a,16)));default:return null}},t}();t.exports={ECPointFp:u,ECCurveFp:l}},function(t,e,r){function i(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t}function n(t){return t.map(function(t){return t=t.toString(16),1===t.length?"0"+t:t}).join("")}function s(t){var e=[],r=t.length;r%2!==0&&(t=i(t,r+1)),r=t.length;for(var n=0;n>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}var a=r(1),h=a.sm3,u=a.hmac;t.exports=function(t,e){if(t="string"==typeof t?o(t):Array.prototype.slice.call(t),e){var r=e.mode||"hmac";if("hmac"!==r)throw new Error("invalid mode");var i=e.key;if(!i)throw new Error("invalid key");return i="string"==typeof i?s(i):Array.prototype.slice.call(i),n(u(t,i))}return n(h(t))}},function(t,e,r){function i(t){for(var e=[],r=0,i=t.length;r>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}function o(t){for(var e=[],r=0,i=t.length;r=240&&t[r]<=247?(e.push(String.fromCodePoint(((7&t[r])<<18)+((63&t[r+1])<<12)+((63&t[r+2])<<6)+(63&t[r+3]))),r+=3):t[r]>=224&&t[r]<=239?(e.push(String.fromCodePoint(((15&t[r])<<12)+((63&t[r+1])<<6)+(63&t[r+2]))),r+=2):t[r]>=192&&t[r]<=223?(e.push(String.fromCodePoint(((31&t[r])<<6)+(63&t[r+1]))),r++):e.push(String.fromCodePoint(t[r]));return e.join("")}function a(t,e){var r=31&e;return t<>>32-r}function h(t){return(255&v[t>>>24&255])<<24|(255&v[t>>>16&255])<<16|(255&v[t>>>8&255])<<8|255&v[255&t]}function u(t){return t^a(t,2)^a(t,10)^a(t,18)^a(t,24)}function l(t){return t^a(t,13)^a(t,23)}function f(t,e,r){for(var i=new Array(4),n=new Array(4),s=0;s<4;s++)n[0]=255&t[4*s],n[1]=255&t[4*s+1],n[2]=255&t[4*s+2],n[3]=255&t[4*s+3],i[s]=n[0]<<24|n[1]<<16|n[2]<<8|n[3];for(var o,a=0;a<32;a+=4)o=i[1]^i[2]^i[3]^r[a+0],i[0]^=u(h(o)),o=i[2]^i[3]^i[0]^r[a+1],i[1]^=u(h(o)),o=i[3]^i[0]^i[1]^r[a+2],i[2]^=u(h(o)),o=i[0]^i[1]^i[2]^r[a+3],i[3]^=u(h(o));for(var l=0;l<16;l+=4)e[l]=i[3-l/4]>>>24&255,e[l+1]=i[3-l/4]>>>16&255,e[l+2]=i[3-l/4]>>>8&255,e[l+3]=255&i[3-l/4]}function c(t,e,r){for(var i=new Array(4),n=new Array(4),s=0;s<4;s++)n[0]=255&t[0+4*s],n[1]=255&t[1+4*s],n[2]=255&t[2+4*s],n[3]=255&t[3+4*s],i[s]=n[0]<<24|n[1]<<16|n[2]<<8|n[3];i[0]^=2746333894,i[1]^=1453994832,i[2]^=1736282519,i[3]^=2993693404;for(var o,a=0;a<32;a+=4)o=i[1]^i[2]^i[3]^m[a+0],e[a+0]=i[0]^=l(h(o)),o=i[2]^i[3]^i[0]^m[a+1],e[a+1]=i[1]^=l(h(o)),o=i[3]^i[0]^i[1]^m[a+2],e[a+2]=i[2]^=l(h(o)),o=i[0]^i[1]^i[2]^m[a+3],e[a+3]=i[3]^=l(h(o));if(r===d)for(var u,f=0;f<16;f++)u=e[f],e[f]=e[31-f],e[31-f]=u}function p(t,e,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},h=a.padding,u=void 0===h?"pkcs#7":h,l=a.mode,p=a.iv,v=void 0===p?[]:p,m=a.output,y=void 0===m?"string":m;if("cbc"===l&&("string"==typeof v&&(v=i(v)),16!==v.length))throw new Error("iv is invalid");if("string"==typeof e&&(e=i(e)),16!==e.length)throw new Error("key is invalid");if(t="string"==typeof t?r!==d?s(t):i(t):[].concat(t),("pkcs#5"===u||"pkcs#7"===u)&&r!==d)for(var w=g-t.length%g,b=0;b=g;){var B=t.slice(E,E+16),z=new Array(16);if("cbc"===l)for(var A=0;A0;n--){i=i.twice();var s=e.testBit(n),o=t.testBit(n);s!==o&&(i=i.add(s?this:r))}return i},t}(),l=function(){function t(e,r,n){i(this,t),this.q=e,this.a=this.fromBigInteger(r),this.b=this.fromBigInteger(n),this.infinity=new u(this,null,null)}return t.prototype.equals=function(t){return t===this||this.q.equals(t.q)&&this.a.equals(t.a)&&this.b.equals(t.b)},t.prototype.fromBigInteger=function(t){return new h(this.q,t)},t.prototype.decodePointHex=function(t){switch(parseInt(t.substr(0,2),16)){case 0:return this.infinity;case 2:case 3:var e=this.fromBigInteger(new s(t.substr(2),16)),r=this.fromBigInteger(e.multiply(e.square()).add(e.multiply(this.a)).add(this.b).toBigInteger().modPow(this.q.divide(new s("4")).add(s.ONE),this.q));return r.toBigInteger().mod(o).equals(new s(t.substr(0,2),16).subtract(o))||(r=r.negate()),new u(this,e,r);case 4:case 6:case 7:var i=(t.length-2)/2,n=t.substr(2,i),a=t.substr(i+2,i);return new u(this,this.fromBigInteger(new s(n,16)),this.fromBigInteger(new s(a,16)));default:return null}},t}();t.exports={ECPointFp:u,ECCurveFp:l}},function(t,e,r){function i(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t}function n(t){return t.map(function(t){return t=t.toString(16),1===t.length?"0"+t:t}).join("")}function s(t){var e=[],r=t.length;r%2!==0&&(t=i(t,r+1)),r=t.length;for(var n=0;n>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}var a=r(1),h=a.sm3,u=a.hmac;t.exports=function(t,e){if(t="string"==typeof t?o(t):Array.prototype.slice.call(t),e){var r=e.mode||"hmac";if("hmac"!==r)throw new Error("invalid mode");var i=e.key;if(!i)throw new Error("invalid key");return i="string"==typeof i?s(i):Array.prototype.slice.call(i),n(u(t,i))}return n(h(t))}},function(t,e,r){function i(t){for(var e=[],r=0,i=t.length;r>>6),e.push(128|63&n);else if(n<=55295||n>=57344&&n<=65535)e.push(224|n>>>12),e.push(128|n>>>6&63),e.push(128|63&n);else{if(!(n>=65536&&n<=1114111))throw e.push(n),new Error("input is not supported");r++,e.push(240|n>>>18&28),e.push(128|n>>>12&63),e.push(128|n>>>6&63),e.push(128|63&n)}}return e}function o(t){for(var e=[],r=0,i=t.length;r=240&&t[r]<=247?(e.push(String.fromCodePoint(((7&t[r])<<18)+((63&t[r+1])<<12)+((63&t[r+2])<<6)+(63&t[r+3]))),r+=3):t[r]>=224&&t[r]<=239?(e.push(String.fromCodePoint(((15&t[r])<<12)+((63&t[r+1])<<6)+(63&t[r+2]))),r+=2):t[r]>=192&&t[r]<=223?(e.push(String.fromCodePoint(((31&t[r])<<6)+(63&t[r+1]))),r++):e.push(String.fromCodePoint(t[r]));return e.join("")}function a(t,e){var r=31&e;return t<>>32-r}function h(t){return(255&v[t>>>24&255])<<24|(255&v[t>>>16&255])<<16|(255&v[t>>>8&255])<<8|255&v[255&t]}function u(t){return t^a(t,2)^a(t,10)^a(t,18)^a(t,24)}function l(t){return t^a(t,13)^a(t,23)}function f(t,e,r){for(var i=new Array(4),n=new Array(4),s=0;s<4;s++)n[0]=255&t[4*s],n[1]=255&t[4*s+1],n[2]=255&t[4*s+2],n[3]=255&t[4*s+3],i[s]=n[0]<<24|n[1]<<16|n[2]<<8|n[3];for(var o,a=0;a<32;a+=4)o=i[1]^i[2]^i[3]^r[a+0],i[0]^=u(h(o)),o=i[2]^i[3]^i[0]^r[a+1],i[1]^=u(h(o)),o=i[3]^i[0]^i[1]^r[a+2],i[2]^=u(h(o)),o=i[0]^i[1]^i[2]^r[a+3],i[3]^=u(h(o));for(var l=0;l<16;l+=4)e[l]=i[3-l/4]>>>24&255,e[l+1]=i[3-l/4]>>>16&255,e[l+2]=i[3-l/4]>>>8&255,e[l+3]=255&i[3-l/4]}function c(t,e,r){for(var i=new Array(4),n=new Array(4),s=0;s<4;s++)n[0]=255&t[0+4*s],n[1]=255&t[1+4*s],n[2]=255&t[2+4*s],n[3]=255&t[3+4*s],i[s]=n[0]<<24|n[1]<<16|n[2]<<8|n[3];i[0]^=2746333894,i[1]^=1453994832,i[2]^=1736282519,i[3]^=2993693404;for(var o,a=0;a<32;a+=4)o=i[1]^i[2]^i[3]^m[a+0],e[a+0]=i[0]^=l(h(o)),o=i[2]^i[3]^i[0]^m[a+1],e[a+1]=i[1]^=l(h(o)),o=i[3]^i[0]^i[1]^m[a+2],e[a+2]=i[2]^=l(h(o)),o=i[0]^i[1]^i[2]^m[a+3],e[a+3]=i[3]^=l(h(o));if(r===d)for(var u,f=0;f<16;f++)u=e[f],e[f]=e[31-f],e[31-f]=u}function p(t,e,r){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},h=a.padding,u=void 0===h?"pkcs#7":h,l=a.mode,p=a.iv,v=void 0===p?[]:p,m=a.output,y=void 0===m?"string":m;if("cbc"===l&&("string"==typeof v&&(v=i(v)),16!==v.length))throw new Error("iv is invalid");if("string"==typeof e&&(e=i(e)),16!==e.length)throw new Error("key is invalid");if(t="string"==typeof t?r!==d?s(t):i(t):[].concat(t),("pkcs#5"===u||"pkcs#7"===u)&&r!==d)for(var w=g-t.length%g,b=0;b=g;){var B=t.slice(E,E+16),z=new Array(16);if("cbc"===l)for(var A=0;A=3||!u.on?f():void u.on(r,f)}}return n}function t(n,t,e){function r(t,r){n.logger?n.logger.msg.apply(n.logger,r).module(e+""||"").level(t).log():n.log&&n.log.apply(n,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function e(t,e,i){return n(t,e,i),t.plugin_version=r,t}var r="1.26.8",i={init:function(n){var t=n._.isString,e=n._.rot13defs,r=n._.dfmapping,i="data:enc;",u="dfm-enc-";n.ee.sdk.on("afterInitPara",function(){n.kit.userEncrypt=function(n){return u+r(n)},n.kit.userDecrypt=function(n){return 0===n.indexOf(i)?(n=n.substring(i.length),n=e(n)):0===n.indexOf(u)&&(n=n.substring(u.length),n=r(n)),n},n.kit.userDecryptIfNeeded=function(e){return!t(e)||0!==e.indexOf(i)&&0!==e.indexOf(u)||(e=n.kit.userDecrypt(e)),e}})},plugin_name:"UserEncryptDefault"},u=e(i);return u}(); \ No newline at end of file +!function(){"use strict";function n(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var i=n.init;n.init=function(u,o){function f(){i.call(n,u,o)}return t(u,n,e),u.readyState&&u.readyState.state>=3||!u.on?f():void u.on(r,f)}}return n}function t(n,t,e){function r(t,r){n.logger?n.logger.msg.apply(n.logger,r).module(e+""||"").level(t).log():n.log&&n.log.apply(n,r)}t.log=function(){r("log",arguments)},t.warn=function(){r("warn",arguments)},t.error=function(){r("error",arguments)}}function e(t,e,i){return n(t,e,i),t.plugin_version=r,t}var r="1.26.9",i={init:function(n){var t=n._.isString,e=n._.rot13defs,r=n._.dfmapping,i="data:enc;",u="dfm-enc-";n.ee.sdk.on("afterInitPara",function(){n.kit.userEncrypt=function(n){return u+r(n)},n.kit.userDecrypt=function(n){return 0===n.indexOf(i)?(n=n.substring(i.length),n=e(n)):0===n.indexOf(u)&&(n=n.substring(u.length),n=r(n)),n},n.kit.userDecryptIfNeeded=function(e){return!t(e)||0!==e.indexOf(i)&&0!==e.indexOf(u)||(e=n.kit.userDecrypt(e)),e}})},plugin_name:"UserEncryptDefault"},u=e(i);return u}(); \ No newline at end of file diff --git a/dist/web/plugin/user-encrypt-default/index.es6.js b/dist/web/plugin/user-encrypt-default/index.es6.js index b8ce567b..193e5cb4 100644 --- a/dist/web/plugin/user-encrypt-default/index.es6.js +++ b/dist/web/plugin/user-encrypt-default/index.es6.js @@ -1 +1 @@ -var sdkversion_placeholder="1.26.8";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(i,u){if(wrapLogFn(i,n,e),i.readyState&&i.readyState.state>=3||!i.on)return o();function o(){t.call(n,i,u)}i.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}var userEncryptDefault={init:function(n){var e=n._.isString,r=n._.rot13defs,t=n._.dfmapping,i="data:enc;";n.ee.sdk.on("afterInitPara",function(){n.kit.userEncrypt=function(n){return"dfm-enc-"+t(n)},n.kit.userDecrypt=function(n){return 0===n.indexOf(i)?(n=n.substring(i.length),n=r(n)):0===n.indexOf("dfm-enc-")&&(n=n.substring("dfm-enc-".length),n=t(n)),n},n.kit.userDecryptIfNeeded=function(r){return!e(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=n.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault);export default index; \ No newline at end of file +var sdkversion_placeholder="1.26.9";function wrapPluginInitFn(n,e,r){if(e&&(n.plugin_name=e),r&&n.init){var t=n.init;n.init=function(i,u){if(wrapLogFn(i,n,e),i.readyState&&i.readyState.state>=3||!i.on)return o();function o(){t.call(n,i,u)}i.on(r,o)}}return n}function wrapLogFn(n,e,r){function t(e,t){n.logger?n.logger.msg.apply(n.logger,t).module(r+""||"").level(e).log():n.log&&n.log.apply(n,t)}e.log=function(){t("log",arguments)},e.warn=function(){t("warn",arguments)},e.error=function(){t("error",arguments)}}function createPlugin(n,e,r){return wrapPluginInitFn(n,e,r),n.plugin_version=sdkversion_placeholder,n}var userEncryptDefault={init:function(n){var e=n._.isString,r=n._.rot13defs,t=n._.dfmapping,i="data:enc;";n.ee.sdk.on("afterInitPara",function(){n.kit.userEncrypt=function(n){return"dfm-enc-"+t(n)},n.kit.userDecrypt=function(n){return 0===n.indexOf(i)?(n=n.substring(i.length),n=r(n)):0===n.indexOf("dfm-enc-")&&(n=n.substring("dfm-enc-".length),n=t(n)),n},n.kit.userDecryptIfNeeded=function(r){return!e(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=n.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault);export default index; \ No newline at end of file diff --git a/dist/web/plugin/utm/index.closure.js b/dist/web/plugin/utm/index.closure.js index 70048682..ddcdbb8a 100644 --- a/dist/web/plugin/utm/index.closure.js +++ b/dist/web/plugin/utm/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function n(n,r,e){if(r&&(n.plugin_name=r),e&&n.init){var i=n.init;n.init=function(o,u){function a(){i.call(n,o,u)}return t(o,n,r),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(e,a)}}return n}function t(n,t,r){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(r+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function r(t,r,e){return n(t,r,e),t.plugin_version=o,t}var e,i="utm_source utm_medium utm_campaign utm_content utm_term",o="1.26.8",u={init:function(n){function t(){var n=i.split(" "),t="",r={};return e._.isArray(e.para.source_channel)&&e.para.source_channel.length>0&&(n=n.concat(e.para.source_channel),n=e._.unique(n)),e._.each(n,function(n){t=e._.getQueryParam(location.href,n),t.length&&(r[n]=t)}),r}n&&!e&&(e=n,e.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},a=r(u,"Utm","sdkAfterInitPara");return a}(); \ No newline at end of file +!function(){"use strict";function n(n,r,e){if(r&&(n.plugin_name=r),e&&n.init){var i=n.init;n.init=function(o,u){function a(){i.call(n,o,u)}return t(o,n,r),o.readyState&&o.readyState.state>=3||!o.on?a():void o.on(e,a)}}return n}function t(n,t,r){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(r+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function r(t,r,e){return n(t,r,e),t.plugin_version=o,t}var e,i="utm_source utm_medium utm_campaign utm_content utm_term",o="1.26.9",u={init:function(n){function t(){var n=i.split(" "),t="",r={};return e._.isArray(e.para.source_channel)&&e.para.source_channel.length>0&&(n=n.concat(e.para.source_channel),n=e._.unique(n)),e._.each(n,function(n){t=e._.getQueryParam(location.href,n),t.length&&(r[n]=t)}),r}n&&!e&&(e=n,e.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},a=r(u,"Utm","sdkAfterInitPara");return a}(); \ No newline at end of file diff --git a/dist/web/plugin/utm/index.es6.js b/dist/web/plugin/utm/index.es6.js index afdb66df..ff74be45 100644 --- a/dist/web/plugin/utm/index.es6.js +++ b/dist/web/plugin/utm/index.es6.js @@ -1 +1 @@ -var sd,source_channel_standard="utm_source utm_medium utm_campaign utm_content utm_term",sdkversion_placeholder="1.26.8";function wrapPluginInitFn(n,r,e){if(r&&(n.plugin_name=r),e&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,r),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(e,o)}}return n}function wrapLogFn(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function createPlugin(n,r,e){return wrapPluginInitFn(n,r,e),n.plugin_version=sdkversion_placeholder,n}var utm={init:function(n){n&&!sd&&(sd=n).registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return function(){var n=source_channel_standard.split(" "),r="",e={};sd._.isArray(sd.para.source_channel)&&sd.para.source_channel.length>0&&(n=n.concat(sd.para.source_channel),n=sd._.unique(n));return sd._.each(n,function(n){(r=sd._.getQueryParam(location.href,n)).length&&(e[n]=r)}),e}()}}})}},index=createPlugin(utm,"Utm","sdkAfterInitPara");export default index; \ No newline at end of file +var sd,source_channel_standard="utm_source utm_medium utm_campaign utm_content utm_term",sdkversion_placeholder="1.26.9";function wrapPluginInitFn(n,r,e){if(r&&(n.plugin_name=r),e&&n.init){var t=n.init;n.init=function(a,i){if(wrapLogFn(a,n,r),a.readyState&&a.readyState.state>=3||!a.on)return o();function o(){t.call(n,a,i)}a.on(e,o)}}return n}function wrapLogFn(n,r,e){function t(r,t){n.logger?n.logger.msg.apply(n.logger,t).module(e+""||"").level(r).log():n.log&&n.log.apply(n,t)}r.log=function(){t("log",arguments)},r.warn=function(){t("warn",arguments)},r.error=function(){t("error",arguments)}}function createPlugin(n,r,e){return wrapPluginInitFn(n,r,e),n.plugin_version=sdkversion_placeholder,n}var utm={init:function(n){n&&!sd&&(sd=n).registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return function(){var n=source_channel_standard.split(" "),r="",e={};sd._.isArray(sd.para.source_channel)&&sd.para.source_channel.length>0&&(n=n.concat(sd.para.source_channel),n=sd._.unique(n));return sd._.each(n,function(n){(r=sd._.getQueryParam(location.href,n)).length&&(e[n]=r)}),e}()}}})}},index=createPlugin(utm,"Utm","sdkAfterInitPara");export default index; \ No newline at end of file diff --git a/dist/web/plugin/utm/index.js b/dist/web/plugin/utm/index.js index 9803ce90..d8ea2b5f 100644 --- a/dist/web/plugin/utm/index.js +++ b/dist/web/plugin/utm/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Utm=function(){"use strict";function n(n,r,e){if(r&&(n.plugin_name=r),e&&n.init){var i=n.init;n.init=function(o,a){function u(){i.call(n,o,a)}return t(o,n,r),o.readyState&&o.readyState.state>=3||!o.on?u():void o.on(e,u)}}return n}function t(n,t,r){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(r+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function r(t,r,e){return n(t,r,e),t.plugin_version=o,t}var e,i="utm_source utm_medium utm_campaign utm_content utm_term",o="1.26.8",a={init:function(n){function t(){var n=i.split(" "),t="",r={};return e._.isArray(e.para.source_channel)&&e.para.source_channel.length>0&&(n=n.concat(e.para.source_channel),n=e._.unique(n)),e._.each(n,function(n){t=e._.getQueryParam(location.href,n),t.length&&(r[n]=t)}),r}n&&!e&&(e=n,e.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},u=r(a,"Utm","sdkAfterInitPara");return u}(); \ No newline at end of file +(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).Utm=function(){"use strict";function n(n,r,e){if(r&&(n.plugin_name=r),e&&n.init){var i=n.init;n.init=function(o,a){function u(){i.call(n,o,a)}return t(o,n,r),o.readyState&&o.readyState.state>=3||!o.on?u():void o.on(e,u)}}return n}function t(n,t,r){function e(t,e){n.logger?n.logger.msg.apply(n.logger,e).module(r+""||"").level(t).log():n.log&&n.log.apply(n,e)}t.log=function(){e("log",arguments)},t.warn=function(){e("warn",arguments)},t.error=function(){e("error",arguments)}}function r(t,r,e){return n(t,r,e),t.plugin_version=o,t}var e,i="utm_source utm_medium utm_campaign utm_content utm_term",o="1.26.9",a={init:function(n){function t(){var n=i.split(" "),t="",r={};return e._.isArray(e.para.source_channel)&&e.para.source_channel.length>0&&(n=n.concat(e.para.source_channel),n=e._.unique(n)),e._.each(n,function(n){t=e._.getQueryParam(location.href,n),t.length&&(r[n]=t)}),r}n&&!e&&(e=n,e.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},u=r(a,"Utm","sdkAfterInitPara");return u}(); \ No newline at end of file diff --git a/dist/web/plugin/wechat-webview-channel/index.closure.js b/dist/web/plugin/wechat-webview-channel/index.closure.js index 667d96ca..3b5329ec 100644 --- a/dist/web/plugin/wechat-webview-channel/index.closure.js +++ b/dist/web/plugin/wechat-webview-channel/index.closure.js @@ -1 +1 @@ -!function(){"use strict";function e(e,i,n){if(i&&(e.plugin_name=i),n&&e.init){var a=e.init;e.init=function(r,s){function o(){a.call(e,r,s)}return t(r,e,i),r.readyState&&r.readyState.state>=3||!r.on?o():void r.on(n,o)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=d,t}var n={};n.getPart=function(e){var t=!1,i=this.option.length;if(i)for(var n=0;n-1)return!0;return t},n.getPartHash=function(e){var t=this.option.length,i=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!i},n.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var i=t?"f"+e:"d"+e;return encodeURIComponent(i)},n.rewriteUrl=function(e,t){var i=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,a=n.exec(e),r="";if(a){var s,o=a[1]||"",l=a[2]||"",d=a[3]||"",u="_sasdk="+this.getCurrenId(),_=function(e){var t=e.split("&"),n=[];return i._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(u):n.push(e)}),n.join("&")};if(this.getPartHash(e)){s=d.indexOf("_sasdk");var c=d.indexOf("?");r=c>-1?s>-1?o+l+"#"+d.substring(1,s)+_(d.substring(s,d.length)):o+l+d+"&"+u:o+l+"#"+d.substring(1)+"?"+u}else{s=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);r=f?s>-1?o+"?"+_(l.substring(1))+d:o+l+"&"+u+d:o+"?"+u+d}return t&&(t.href=r),r}},n.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},n.setRefferId=function(e){var t=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var n="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==t&&(n?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(i))}},n.addListen=function(){var e=this,t=function(t){var i,n,a=t.target,r=a.tagName.toLowerCase(),s=a.parentNode;if("a"===r&&a.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===r&&a.href?(i=a.href,n=a):(i=s.href,n=s);var o=e._.URL(i),l=o.protocol;"http:"!==l&&"https:"!==l||e.getPart(i)&&e.rewriteUrl(i,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},n.init=function(e,t){function i(t){for(var i=t.length,n=[],a=0;a0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=i(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var a,r,s,o,l={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function i(){return a=r._,s=r.store,!!a.localStorage.isSupport()&&(r.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(r||!e)return!1;t=t||{},o=t.cookie_name||"sensorsdata2015jssdkchannel",r=e;var n=this;i()},addIsChannelCallbackEvent:function(){r.registerPage({$is_channel_callback_event:function(e){if(a.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!l.eventList.hasEvent(e.event)&&(l.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(a.isReferralTraffic(document.referrer)){var i=a.getQueryParam(location.href,"sat_cf");a.isString(i)&&i.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),l.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?r.registerPage(t):r.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){r.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=r.kit.userDecryptIfNeeded(a.cookie.get(o));return e=a.safeJSONParse(e),!(!a.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},i=JSON.stringify(t);r.para.encrypt_cookie&&(i=r.kit.userEncrypt(i)),a.cookie.set(o,i)}},channelLinkHandler:function(){this.eventList.reset(),r.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=a.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&a.isNumber(e.latest_event_initial_time)&&a.isArray(e.eventList)){var i=t-e.latest_event_initial_time;i>0&&i=3||!r.on?o():void r.on(n,o)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=d,t}var n={};n.getPart=function(e){var t=!1,i=this.option.length;if(i)for(var n=0;n-1)return!0;return t},n.getPartHash=function(e){var t=this.option.length,i=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!i},n.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var i=t?"f"+e:"d"+e;return encodeURIComponent(i)},n.rewriteUrl=function(e,t){var i=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,a=n.exec(e),r="";if(a){var s,o=a[1]||"",l=a[2]||"",d=a[3]||"",u="_sasdk="+this.getCurrenId(),_=function(e){var t=e.split("&"),n=[];return i._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(u):n.push(e)}),n.join("&")};if(this.getPartHash(e)){s=d.indexOf("_sasdk");var c=d.indexOf("?");r=c>-1?s>-1?o+l+"#"+d.substring(1,s)+_(d.substring(s,d.length)):o+l+d+"&"+u:o+l+"#"+d.substring(1)+"?"+u}else{s=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);r=f?s>-1?o+"?"+_(l.substring(1))+d:o+l+"&"+u+d:o+"?"+u+d}return t&&(t.href=r),r}},n.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},n.setRefferId=function(e){var t=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var n="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==t&&(n?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(i))}},n.addListen=function(){var e=this,t=function(t){var i,n,a=t.target,r=a.tagName.toLowerCase(),s=a.parentNode;if("a"===r&&a.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===r&&a.href?(i=a.href,n=a):(i=s.href,n=s);var o=e._.URL(i),l=o.protocol;"http:"!==l&&"https:"!==l||e.getPart(i)&&e.rewriteUrl(i,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},n.init=function(e,t){function i(t){for(var i=t.length,n=[],a=0;a0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=i(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var a,r,s,o,l={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function i(){return a=r._,s=r.store,!!a.localStorage.isSupport()&&(r.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(r||!e)return!1;t=t||{},o=t.cookie_name||"sensorsdata2015jssdkchannel",r=e;var n=this;i()},addIsChannelCallbackEvent:function(){r.registerPage({$is_channel_callback_event:function(e){if(a.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!l.eventList.hasEvent(e.event)&&(l.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(a.isReferralTraffic(document.referrer)){var i=a.getQueryParam(location.href,"sat_cf");a.isString(i)&&i.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),l.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?r.registerPage(t):r.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){r.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=r.kit.userDecryptIfNeeded(a.cookie.get(o));return e=a.safeJSONParse(e),!(!a.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},i=JSON.stringify(t);r.para.encrypt_cookie&&(i=r.kit.userEncrypt(i)),a.cookie.set(o,i)}},channelLinkHandler:function(){this.eventList.reset(),r.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=a.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&a.isNumber(e.latest_event_initial_time)&&a.isArray(e.eventList)){var i=t-e.latest_event_initial_time;i>0&&i-1)return!0;return!1},siteLinker.getPartHash=function(e){var t=this.option.length;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!1},siteLinker.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)},siteLinker.rewriteUrl=function(e,t){var n=this,i=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),a="";if(i){var s,r=i[1]||"",o=i[2]||"",l=i[3]||"",_="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),i=[];return n._.each(t,function(e){e.indexOf("_sasdk=")>-1?i.push(_):i.push(e)}),i.join("&")};if(this.getPartHash(e))s=l.indexOf("_sasdk"),a=l.indexOf("?")>-1?s>-1?r+o+"#"+l.substring(1,s)+d(l.substring(s,l.length)):r+o+l+"&"+_:r+o+"#"+l.substring(1)+"?"+_;else s=o.indexOf("_sasdk"),a=/^\?(\w)+/.test(o)?s>-1?r+"?"+d(o.substring(1))+l:r+o+"&"+_+l:r+"?"+_+l;return t&&(t.href=a),a}},siteLinker.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},siteLinker.setRefferId=function(e){var t=this.store.getDistinctId(),n=this.getUrlId();if(n&&""!==n){var i="a"===n.substring(0,1)||"d"===n.substring(0,1);(n=n.substring(1))!==t&&(i?(this.sd.identify(n,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:n,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(n))}},siteLinker.addListen=function(){var e=this,t=function(t){var n,i,a=t.target,s=a.tagName.toLowerCase(),r=a.parentNode;if("a"===s&&a.href||r&&r.tagName&&"a"===r.tagName.toLowerCase()&&r.href){"a"===s&&a.href?(n=a.href,i=a):(n=r.href,i=r);var o=e._.URL(n).protocol;"http:"!==o&&"https:"!==o||e.getPart(n)&&e.rewriteUrl(n,i)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},siteLinker.init=function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var n=t.length,i=[],a=0;a0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd.registerPage(t):sd.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd.kit.userDecryptIfNeeded(_.cookie.get(cookie_name));return e=_.safeJSONParse(e),!(!_.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},n=JSON.stringify(t);sd.para.encrypt_cookie&&(n=sd.kit.userEncrypt(n)),_.cookie.set(cookie_name,n)}},channelLinkHandler:function(){this.eventList.reset(),sd.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_.isNumber(e.latest_event_initial_time)&&_.isArray(e.eventList)){var n=t-e.latest_event_initial_time;n>0&&n=3||!a.on)return r();function r(){i.call(e,a,s)}a.on(n,r)}}return e}function wrapLogFn(e,t,n){function i(t,i){e.logger?e.logger.msg.apply(e.logger,i).module(n+""||"").level(t).log():e.log&&e.log.apply(e,i)}t.log=function(){i("log",arguments)},t.warn=function(){i("warn",arguments)},t.error=function(){i("error",arguments)}}function createPlugin(e,t,n){return wrapPluginInitFn(e,t,n),e.plugin_version=sdkversion_placeholder,e}var sa={},url_obj={},_$1={};siteLinker.init=function(e){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this.setRefferId()},siteLinker.getUrlId=function(){return url_obj.prefix+url_obj.did},Channel.addLatestChannelUrl=function(){},Channel.saveProp=function(){Channel.registerAndSave({$app_id:url_obj.aid,$ad_custom_data_type:url_obj.adt})},Channel.getProp=function(){var e=this.cookie.getChannel();_$1.isObject(e)&&e.$app_id&&e.$ad_custom_data_type&&sa.registerPage({$app_id:e.$app_id,$ad_custom_data_type:e.$ad_custom_data_type})};var wwc={getWechatWebViewPara:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(sa._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)?t=[t.substring(0,1),t.substring(1)]:sa._.urlSafeBase64&&sa._.urlSafeBase64.isUrlSafeBase64&&sa._.urlSafeBase64.isUrlSafeBase64(t)?t=[t.substring(0,1),sa._.base64Decode(sa._.urlSafeBase64.decode(t.substring(1)))]:sa._.rot13defs&&(t=[t.substring(0,1),sa._.rot13defs(t.substring(1))]);var n=sa._.safeJSONParse(t[1]);if(sa._.isObject(n)&&n.did&&n.aid&&n.adt)return{prefix:t[0],did:n.did,aid:n.aid,adt:n.adt}}return""},init:function(e){sa=e,_$1=e._,url_obj=this.getWechatWebViewPara(),Channel.init(e,{cookie_name:"sas2015-ad-ww"}),sa._.isObject(url_obj)&&url_obj.did&&url_obj.aid&&url_obj.adt?(siteLinker.init(e),Channel.saveProp()):Channel.getProp()}},index=createPlugin(wwc,"WechatWebviewChannel","sdkReady");export default index; \ No newline at end of file +var _,sd,store,cookie_name,siteLinker={};siteLinker.getPart=function(e){var t=this.option.length;if(t)for(var n=0;n-1)return!0;return!1},siteLinker.getPartHash=function(e){var t=this.option.length;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!1},siteLinker.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)},siteLinker.rewriteUrl=function(e,t){var n=this,i=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),a="";if(i){var s,r=i[1]||"",o=i[2]||"",l=i[3]||"",_="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),i=[];return n._.each(t,function(e){e.indexOf("_sasdk=")>-1?i.push(_):i.push(e)}),i.join("&")};if(this.getPartHash(e))s=l.indexOf("_sasdk"),a=l.indexOf("?")>-1?s>-1?r+o+"#"+l.substring(1,s)+d(l.substring(s,l.length)):r+o+l+"&"+_:r+o+"#"+l.substring(1)+"?"+_;else s=o.indexOf("_sasdk"),a=/^\?(\w)+/.test(o)?s>-1?r+"?"+d(o.substring(1))+l:r+o+"&"+_+l:r+"?"+_+l;return t&&(t.href=a),a}},siteLinker.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},siteLinker.setRefferId=function(e){var t=this.store.getDistinctId(),n=this.getUrlId();if(n&&""!==n){var i="a"===n.substring(0,1)||"d"===n.substring(0,1);(n=n.substring(1))!==t&&(i?(this.sd.identify(n,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:n,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(n))}},siteLinker.addListen=function(){var e=this,t=function(t){var n,i,a=t.target,s=a.tagName.toLowerCase(),r=a.parentNode;if("a"===s&&a.href||r&&r.tagName&&"a"===r.tagName.toLowerCase()&&r.href){"a"===s&&a.href?(n=a.href,i=a):(n=r.href,i=r);var o=e._.URL(n).protocol;"http:"!==o&&"https:"!==o||e.getPart(n)&&e.rewriteUrl(n,i)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},siteLinker.init=function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var n=t.length,i=[],a=0;a0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd.registerPage(t):sd.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd.kit.userDecryptIfNeeded(_.cookie.get(cookie_name));return e=_.safeJSONParse(e),!(!_.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},n=JSON.stringify(t);sd.para.encrypt_cookie&&(n=sd.kit.userEncrypt(n)),_.cookie.set(cookie_name,n)}},channelLinkHandler:function(){this.eventList.reset(),sd.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_.isNumber(e.latest_event_initial_time)&&_.isArray(e.eventList)){var n=t-e.latest_event_initial_time;n>0&&n=3||!a.on)return r();function r(){i.call(e,a,s)}a.on(n,r)}}return e}function wrapLogFn(e,t,n){function i(t,i){e.logger?e.logger.msg.apply(e.logger,i).module(n+""||"").level(t).log():e.log&&e.log.apply(e,i)}t.log=function(){i("log",arguments)},t.warn=function(){i("warn",arguments)},t.error=function(){i("error",arguments)}}function createPlugin(e,t,n){return wrapPluginInitFn(e,t,n),e.plugin_version=sdkversion_placeholder,e}var sa={},url_obj={},_$1={};siteLinker.init=function(e){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this.setRefferId()},siteLinker.getUrlId=function(){return url_obj.prefix+url_obj.did},Channel.addLatestChannelUrl=function(){},Channel.saveProp=function(){Channel.registerAndSave({$app_id:url_obj.aid,$ad_custom_data_type:url_obj.adt})},Channel.getProp=function(){var e=this.cookie.getChannel();_$1.isObject(e)&&e.$app_id&&e.$ad_custom_data_type&&sa.registerPage({$app_id:e.$app_id,$ad_custom_data_type:e.$ad_custom_data_type})};var wwc={getWechatWebViewPara:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(sa._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)?t=[t.substring(0,1),t.substring(1)]:sa._.urlSafeBase64&&sa._.urlSafeBase64.isUrlSafeBase64&&sa._.urlSafeBase64.isUrlSafeBase64(t)?t=[t.substring(0,1),sa._.base64Decode(sa._.urlSafeBase64.decode(t.substring(1)))]:sa._.rot13defs&&(t=[t.substring(0,1),sa._.rot13defs(t.substring(1))]);var n=sa._.safeJSONParse(t[1]);if(sa._.isObject(n)&&n.did&&n.aid&&n.adt)return{prefix:t[0],did:n.did,aid:n.aid,adt:n.adt}}return""},init:function(e){sa=e,_$1=e._,url_obj=this.getWechatWebViewPara(),Channel.init(e,{cookie_name:"sas2015-ad-ww"}),sa._.isObject(url_obj)&&url_obj.did&&url_obj.aid&&url_obj.adt?(siteLinker.init(e),Channel.saveProp()):Channel.getProp()}},index=createPlugin(wwc,"WechatWebviewChannel","sdkReady");export default index; \ No newline at end of file diff --git a/dist/web/plugin/wechat-webview-channel/index.js b/dist/web/plugin/wechat-webview-channel/index.js index 6bc515e9..2f2d0ce9 100644 --- a/dist/web/plugin/wechat-webview-channel/index.js +++ b/dist/web/plugin/wechat-webview-channel/index.js @@ -1 +1 @@ -(window.SensorsDataWebJSSDKPlugin=window.SensorsDataWebJSSDKPlugin||{}).WechatWebViewChannel=function(){"use strict";function e(e,i,n){if(i&&(e.plugin_name=i),n&&e.init){var a=e.init;e.init=function(r,s){function o(){a.call(e,r,s)}return t(r,e,i),r.readyState&&r.readyState.state>=3||!r.on?o():void r.on(n,o)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=d,t}var n={};n.getPart=function(e){var t=!1,i=this.option.length;if(i)for(var n=0;n-1)return!0;return t},n.getPartHash=function(e){var t=this.option.length,i=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!i},n.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var i=t?"f"+e:"d"+e;return encodeURIComponent(i)},n.rewriteUrl=function(e,t){var i=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,a=n.exec(e),r="";if(a){var s,o=a[1]||"",l=a[2]||"",d=a[3]||"",u="_sasdk="+this.getCurrenId(),_=function(e){var t=e.split("&"),n=[];return i._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(u):n.push(e)}),n.join("&")};if(this.getPartHash(e)){s=d.indexOf("_sasdk");var c=d.indexOf("?");r=c>-1?s>-1?o+l+"#"+d.substring(1,s)+_(d.substring(s,d.length)):o+l+d+"&"+u:o+l+"#"+d.substring(1)+"?"+u}else{s=l.indexOf("_sasdk");var h=/^\?(\w)+/.test(l);r=h?s>-1?o+"?"+_(l.substring(1))+d:o+l+"&"+u+d:o+"?"+u+d}return t&&(t.href=r),r}},n.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},n.setRefferId=function(e){var t=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var n="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==t&&(n?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(i))}},n.addListen=function(){var e=this,t=function(t){var i,n,a=t.target,r=a.tagName.toLowerCase(),s=a.parentNode;if("a"===r&&a.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===r&&a.href?(i=a.href,n=a):(i=s.href,n=s);var o=e._.URL(i),l=o.protocol;"http:"!==l&&"https:"!==l||e.getPart(i)&&e.rewriteUrl(i,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},n.init=function(e,t){function i(t){for(var i=t.length,n=[],a=0;a0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=i(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var a,r,s,o,l={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function i(){return a=r._,s=r.store,!!a.localStorage.isSupport()&&(r.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(r||!e)return!1;t=t||{},o=t.cookie_name||"sensorsdata2015jssdkchannel",r=e;var n=this;i()},addIsChannelCallbackEvent:function(){r.registerPage({$is_channel_callback_event:function(e){if(a.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!l.eventList.hasEvent(e.event)&&(l.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(a.isReferralTraffic(document.referrer)){var i=a.getQueryParam(location.href,"sat_cf");a.isString(i)&&i.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),l.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?r.registerPage(t):r.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){r.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=r.kit.userDecryptIfNeeded(a.cookie.get(o));return e=a.safeJSONParse(e),!(!a.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},i=JSON.stringify(t);r.para.encrypt_cookie&&(i=r.kit.userEncrypt(i)),a.cookie.set(o,i)}},channelLinkHandler:function(){this.eventList.reset(),r.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=a.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&a.isNumber(e.latest_event_initial_time)&&a.isArray(e.eventList)){var i=t-e.latest_event_initial_time;i>0&&i=3||!r.on?o():void r.on(n,o)}}return e}function t(e,t,i){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(i+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function i(t,i,n){return e(t,i,n),t.plugin_version=d,t}var n={};n.getPart=function(e){var t=!1,i=this.option.length;if(i)for(var n=0;n-1)return!0;return t},n.getPartHash=function(e){var t=this.option.length,i=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!i},n.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var i=t?"f"+e:"d"+e;return encodeURIComponent(i)},n.rewriteUrl=function(e,t){var i=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,a=n.exec(e),r="";if(a){var s,o=a[1]||"",l=a[2]||"",d=a[3]||"",u="_sasdk="+this.getCurrenId(),_=function(e){var t=e.split("&"),n=[];return i._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(u):n.push(e)}),n.join("&")};if(this.getPartHash(e)){s=d.indexOf("_sasdk");var c=d.indexOf("?");r=c>-1?s>-1?o+l+"#"+d.substring(1,s)+_(d.substring(s,d.length)):o+l+d+"&"+u:o+l+"#"+d.substring(1)+"?"+u}else{s=l.indexOf("_sasdk");var h=/^\?(\w)+/.test(l);r=h?s>-1?o+"?"+_(l.substring(1))+d:o+l+"&"+u+d:o+"?"+u+d}return t&&(t.href=r),r}},n.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},n.setRefferId=function(e){var t=this.store.getDistinctId(),i=this.getUrlId();if(i&&""!==i){var n="a"===i.substring(0,1)||"d"===i.substring(0,1);i=i.substring(1),i!==t&&(n?(this.sd.identify(i,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:i,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(i))}},n.addListen=function(){var e=this,t=function(t){var i,n,a=t.target,r=a.tagName.toLowerCase(),s=a.parentNode;if("a"===r&&a.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===r&&a.href?(i=a.href,n=a):(i=s.href,n=s);var o=e._.URL(i),l=o.protocol;"http:"!==l&&"https:"!==l||e.getPart(i)&&e.rewriteUrl(i,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},n.init=function(e,t){function i(t){for(var i=t.length,n=[],a=0;a0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=i(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var a,r,s,o,l={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function i(){return a=r._,s=r.store,!!a.localStorage.isSupport()&&(r.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(r||!e)return!1;t=t||{},o=t.cookie_name||"sensorsdata2015jssdkchannel",r=e;var n=this;i()},addIsChannelCallbackEvent:function(){r.registerPage({$is_channel_callback_event:function(e){if(a.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!l.eventList.hasEvent(e.event)&&(l.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(a.isReferralTraffic(document.referrer)){var i=a.getQueryParam(location.href,"sat_cf");a.isString(i)&&i.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),l.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?r.registerPage(t):r.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){r.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=r.kit.userDecryptIfNeeded(a.cookie.get(o));return e=a.safeJSONParse(e),!(!a.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},i=JSON.stringify(t);r.para.encrypt_cookie&&(i=r.kit.userEncrypt(i)),a.cookie.set(o,i)}},channelLinkHandler:function(){this.eventList.reset(),r.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=a.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&a.isNumber(e.latest_event_initial_time)&&a.isArray(e.eventList)){var i=t-e.latest_event_initial_time;i>0&&i Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("https://www.sensorsdata.cn/"),"https://www.sensorsdata.cn/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{d(e)||(e=String(e)),e=p(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void zi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new Qi(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement||a.target;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(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){zi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(ea&&e.forEach===ea)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText),i.status):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){zi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(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 j(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}function I(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(p){zi.log(p)}n&&d()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function T(e){return k(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 A(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function D(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,document.cookie.indexOf(t+"=true")!==-1){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function J(e){function t(e,t){e=p(e);var r;if("body"===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 o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){zi.log(o)}return i&&_(i)?r(i):null}if(!d(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=p(e.textContent):e.innerText&&(r=p(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 q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){zi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function V(e,t){var r=g(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i){var a=F(i);n=a[t]||""}}return n}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){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(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){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 Z(e){return d(e)?(e=p(e),A(e)):A(location.href)}function G(e){return d(e)?(e=p(e),A(e)):A(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function pe(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!d(t.callbackName))return zi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(n.defer="defer",i.appendChild(n),ce(t.timeout)){var s=Math.min(t.timeout,3e5);a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){zi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},s)}if(window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){zi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var l=[];k(t.data,function(e,t){l.push(t+"="+e)}),t.data=l.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){zi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=encodeURI(t.url)}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.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;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.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 he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,d)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else d(i)||ce(i)||$(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function it(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function at(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function ot(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))ot(e[a]);else if(d(i)){if(re(n,a)>-1)return;e[a]=it(i,re(t,a)>-1?1024:pa.max_string_length)}})}function st(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function lt(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};rt({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};rt({item_id:n},i)}}function ut(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&rt({propertyKey:n},i)})}function ct(e){var t=e.properties;ye(e),r(t)?(nt(t),at(t),st(e),ut(t),ot(t)):"properties"in e&&(e.properties={}),lt(e)}function dt(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function pt(e,t){try{var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,xa.getIdentities());var a={identities:i,distinct_id:xa.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,xa.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),"$UnbindID"===a.event&&(a.login_id&&delete a.login_id,a.anonymous_id&&delete a.anonymous_id),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},wa.properties(),xa.getProps(),xa.getSessionProps(),wa.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!d(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!d(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&d(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&d(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!d(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!d(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!d(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),d(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&$(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ha.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=qa.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),ka.checkIsAddSign(a),ka.checkIsFirstTime(a),Fe(a),Ve(a),a}catch(o){return{_debug_web_msg:String(o)}}}function ft(e){return Fa.stage.process("basicProps",e)}function gt(e){return Fa.stage.process("formatData",e)}function _t(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&Be(e.ele,"click",function(e){i(e)}))))}function ht(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function mt(e){return Wa.stage.process("webClickEvent",e)}function vt(e){return Wa.stage.process("webStayEvent",e)}function yt(){var e=wa.campaignParams(),t={};return k(e,function(e,r,n){(" "+Vi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function bt(e,t,r){if(Vi.is_first_visitor&&r){var n={};Vi.para.preset_properties.search_keyword_baidu&&xe(document.referrer)&&Te()&&(n.$search_keyword_id=ya.id(),n.$search_keyword_id_type=ya.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=$e(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:d(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:d(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:He(),$first_search_keyword:Ee()},yt(),n)),Vi.is_first_visitor=!1}}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=xa.getFirstId(),s=xa.getOriginDistinctId();if(!rt({distinct_id:n}))return je("login id is invalid"),!1;if(n===xa.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"), -!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(a)&&n===xa._state.first_id)return!1;var l=xa._state.history_login_id.name!==a||n!==xa._state.history_login_id.value;if(l){xa._state.identities[a]=n,xa.set("history_login_id",{name:a,value:n}),o||xa.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:xa._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];xa._state.identities=t,xa.save()}function kt(e,t){if(!rt({unbindKey:e,bindValue:t}))return!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(e)&&xa._state.identities[e]===t){var n=xa.getUnionId().login_id;n&&e+"+"+t===n&&(xa._state.distinct_id=xa._state.first_id,xa._state.first_id="",xa.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete xa._state.identities[e],xa.save())}var i={};return i[e]=t,i}function Pt(){Vi._t=Vi._t||1*new Date,Vi.is_first_visitor=!1,Vi.source_channel_standard=ga}function Ct(e){P(pa,e||Vi.para||{}),Vi.para=pa;var t={};if(r(Vi.para.is_track_latest))for(var n in Vi.para.is_track_latest)t["latest_"+n]=Vi.para.is_track_latest[n];Vi.para.preset_properties=P({},fa.preset_properties,t,Vi.para.preset_properties||{});var i;for(i in fa)void 0===Vi.para[i]&&(Vi.para[i]=fa[i]);"string"!=typeof Vi.para.web_url||"://"!==Vi.para.web_url.slice(0,3)&&"//"!==Vi.para.web_url.slice(0,2)||("://"===Vi.para.web_url.slice(0,3)?Vi.para.web_url=location.protocol.slice(0,-1)+Vi.para.web_url:Vi.para.web_url=location.protocol+Vi.para.web_url),ba.protocol.serverUrl(),Vi.bridge&&Vi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Vi.para.source_type&&(Vi.para.source_type.utm=v(Vi.para.source_type.utm)?Vi.para.source_type.utm.concat(a):a,Vi.para.source_type.search=v(Vi.para.source_type.search)?Vi.para.source_type.search.concat(o):o,Vi.para.source_type.social=v(Vi.para.source_type.social)?Vi.para.source_type.social.concat(s):s,Vi.para.source_type.keyword=r(Vi.para.source_type.keyword)?P(l,Vi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Vi.para.heatmap&&!r(Vi.para.heatmap)&&(Vi.para.heatmap={}),r(Vi.para.heatmap)){Vi.para.heatmap.clickmap=Vi.para.heatmap.clickmap||"default",Vi.para.heatmap.scroll_notice_map=Vi.para.heatmap.scroll_notice_map||"default",Vi.para.heatmap.scroll_delay_time=Vi.para.heatmap.scroll_delay_time||4e3,Vi.para.heatmap.scroll_event_duration=Vi.para.heatmap.scroll_event_duration||18e3,Vi.para.heatmap.renderRefreshTime=Vi.para.heatmap.renderRefreshTime||1e3,Vi.para.heatmap.loadTimeout=Vi.para.heatmap.loadTimeout||1e3,Vi.para.heatmap.get_vtrack_config!==!0&&(Vi.para.heatmap.get_vtrack_config=!1);var d=v(Vi.para.heatmap.track_attr)?U(Vi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),Vi.para.heatmap.track_attr=d,r(Vi.para.heatmap.collect_tags))if(Vi.para.heatmap.collect_tags.div===!0)Vi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Vi.para.heatmap.collect_tags.div)){if(Vi.para.heatmap.collect_tags.div.ignore_tags?v(Vi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Vi.para.heatmap.collect_tags.div.ignore_tags=c):Vi.para.heatmap.collect_tags.div.ignore_tags=c,Vi.para.heatmap.collect_tags.div.max_level){var p=[1,2,3];re(p,Vi.para.heatmap.collect_tags.div.max_level)===-1&&(Vi.para.heatmap.collect_tags.div.max_level=1)}}else Vi.para.heatmap.collect_tags.div=!1;else Vi.para.heatmap.collect_tags=u}Vi.para.server_url=Ge(Vi.para.server_url),Vi.para.noCache===!0?Vi.para.noCache="?"+(new Date).getTime():Vi.para.noCache="",Vi.para.callback_timeout>Vi.para.datasend_timeout&&(Vi.para.datasend_timeout=Vi.para.callback_timeout),Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&r(Vi.para.heatmap.collect_tags)&&k(Vi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Vi.heatmap.otherTags.push(t)}),Vi.para.heatmap&&"default"===Vi.para.heatmap.clickmap&&Vi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Za[t]?Za[t].apply(Za,r):void("function"==typeof t?t.apply(Vi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Vi,n),a.plugin_is_init=!0,Vi.modules=Vi.modules||{},Vi.modules[a.plugin_name||"unnamed_"+Qa++]=a,a}if(!d(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Vi.modules&&Vi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return d(t)&&(r(Vi.modules)&&r(Vi.modules[t])?a=Vi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Vi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){rt({event:e,properties:t})&&Va.send({type:"track",event:e,properties:t},r)}function It(e,t){return!!rt({bindKey:e,bindValue:t})&&(xa._state.identities[e]=t,xa.save(),void Va.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function Tt(e,t){var r=kt(e,t);r&&Va.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function At(e,t,r){"object"==typeof e&&e.tagName?_t({ele:e},t,r,Vi.track):"object"==typeof e&&e.target&&e.event&&_t(e,t,r,Vi.track)}function Dt(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void Be(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Vi.track(t,r,i)}))}function $t(e,t,r){rt({item_type:e,item_id:t,properties:r})&&Va.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){rt({item_type:e,item_id:t})&&Va.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set",properties:e},t)}function Lt(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){rt({propertiesMust:e})&&(k(e,function(t,r){d(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Va.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;d(e)&&(e={},e[n]=1),rt({propertiesMust:e})&&(r(e)?Va.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Bt(e){Va.send({type:"profile_delete"},e),xa.set("distinct_id",Gi()),xa.set("first_id","")}function Ht(e,t){var r=e,n={};d(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){d(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Va.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e){"number"==typeof e&&(e=String(e));var t=xa.getFirstId();if("undefined"==typeof e){var r=Gi();t?xa.set("first_id",r):xa.set("distinct_id",r)}else rt({distinct_id:e})&&(t?xa.set("first_id",e):xa.set("distinct_id",e))}function Mt(e){var t=xa.getFirstId();if(t)return je("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),"undefined"==typeof e){var r=Gi();xa._state.identities.$identity_cookie_id=r,xa.set("distinct_id",r)}else rt({distinct_id:e})&&(xa._state.identities.$identity_cookie_id=e,xa.set("distinct_id",e))}function qt(e,t,r,n){var i=xa.getFirstId()||xa.getDistinctId();xa.set("distinct_id",e),Va.send({original_id:i,distinct_id:xa.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function Kt(e,t,r,n){"number"==typeof e&&(e=String(e)),rt({distinct_id:e,event:t,properties:r})&&qt(e,t,r,n)}function Ft(e){rt({properties:e})?P(wa.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Vt(e){xa.clearAllProps(e)}function Wt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Vi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vapph5define.min.js"})}else t();else t()}function cr(t){Vi.para.is_track_single_page&&Oa.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){wa.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Vi.quick&&Vi.quick("autoTrack",i)}};if("boolean"==typeof Vi.para.is_track_single_page)i();else if("function"==typeof Vi.para.is_track_single_page){var a=Vi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function dr(){Vi._q&&v(Vi._q)&&Vi._q.length>0&&k(Vi._q,function(e){Vi[e[0]].apply(Vi,Array.prototype.slice.call(e[1]))}),r(Vi.para.heatmap)&&(Xa.initHeatmap(),Xa.initScrollmap())}function pr(){Vi.readyState.setState(3),new Vi.SDKJSBridge("visualized").onAppNotify(function(){ur("undefined"!=typeof sa_jssdk_app_define_mode?!0:!1)}),ur(!1),Vi.bridge.app_js_bridge_v1(),wa.initPage(),cr(),xa.init(),sr(),gr(),Vi.readyState.setState(4),dr()}function fr(){ro.isSeachHasKeyword()?ro.hasKeywordHandle():window.parent!==self&&no.isSearchHasKeyword()?no.verifyVtrackMode():ro.isWindowNameHasKeyword()?ro.windowNameHasKeywordHandle():ro.isStorageHasKeyword()?ro.storageHasKeywordHandle():window.parent!==self&&no.isStorageHasKeyword()?no.verifyVtrackMode():(pr(),no.notifyUser())}function gr(){qa.init(),"success"===Vi.bridge.bridge_info.verify_success&&Ha.init()}function _r(){k(io,function(t){var r=Vi[t];Vi[t]=function(){if(Vi.readyState.state<3)return v(Vi._q)||(Vi._q=[]),Ne("calling sdk api before init is deprecated."),Vi._q.push([t,arguments]),!1;if(!e(Vi.getDisabled)||!Vi.getDisabled())return Vi.readyState.getState()?r.apply(Vi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function hr(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 mr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new hr,this.sensors=r}function vr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function yr(e){e&&e.buildDataStage&&so.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&po.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&uo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&go.registerStageImplementation(e.viewStage)}function br(e,t){_o[e]&&_o[e](t)}function wr(){return ho.stage&&ho.stage.process("getUtmData")}function Sr(e){return mo.stage.process("send",e)}function kr(e){e.kit=vo,e.saEvent=Va,this.buildDataStage=Fa,this.sendDataStage=mo,this.businessStage=ho}function Pr(e){e.heatmap=Xa,this.viewStage=Wa}function Cr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};br("buildDataStage",r)}function Or(e){e&&(Vi.events=$a,Vi.bridge=to,Vi.SDKJSBridge=nr,Vi.JSBridge=or,Vi.store=xa,Vi.unlimitedDiv=Ja,Vi.customProp=Ma,Vi.vtrackcollect=qa,Vi.vapph5collect=Ha,Vi.detectMode=fr,Vi.registerFeature=yr,Vi.registerInterceptor=br,Vi.commonWays=Za,yr(new kr(Vi)),yr(new Pr(Vi)),br("viewStage",yo));var t=e?Ya:ao;for(var r in t)Vi[r]=t[r];Vi.logger=da,Vi.log=Oe,Vi._=eo,Vi.on=et,Vi.ee=Ca,Vi.use=Nt,Vi.lib_version=_a,Vi.registerPropertyPlugin=Cr}function Nr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ir(e,t,r){return Nr(e,t,r),e.plugin_version=Ho,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ar(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ar(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dr(e,t,r){return Tr(e,t,r),e.plugin_version=qo,e}function $r(e){return zo&&zo.call(Vo,JSON.stringify(e))}function xr(e){return Wo.call(Vo)&&Xo&&Xo.call(Vo,JSON.stringify(e))}function Er(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Lr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ur(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ur(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rr(e,t,r){return Lr(e,t,r),e.plugin_version=Go,e}function Br(){if(So=window.SensorsData_APP_New_H5_Bridge,ko=So&&So.sensorsdata_track,Po=ko&&So.sensorsdata_get_server_url&&So.sensorsdata_get_server_url(),No("---test---fail---",!Co,Co.bridge.activeBridge,!Po),Co&&!Co.bridge.activeBridge&&Po)return Co.bridge.activeBridge=Qo,Co.para.app_js_bridge&&!Co.para.app_js_bridge.is_mui&&(Co.bridge.is_verify_success=Po&&Co.bridge.validateAppUrl(Po),No("---test---bridge-verify-",Co.bridge.is_verify_success)),Co.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:Co.bridge.is_verify_success?"success":"fail",support_two_way_call:!!So.sensorsdata_js_call_app},Co.para.app_js_bridge?void Co.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}):void No("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function Hr(e,t){if(No("---test---datasend-",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return Co.bridge.is_verify_success?(No("---test---bridge-verify-success---",e.data),ko&&ko.call(So,JSON.stringify(Oo.extend({server_url:Co.para.server_url},e.data))),Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(No("---test---bridge-verify-fail-----",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_send?(Co.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e))}function Jr(e){var t=e.callType;return t in Zo.commands?Zo.commands[t](e,So):void(So&&Oo.isFunction(So.sensorsdata_js_call_app)&&So.sensorsdata_js_call_app(JSON.stringify(e)))}function Mr(e){return rs&&rs.call(es,JSON.stringify(e))}function qr(e){return ts.call(es)&&ns&&ns.call(es,JSON.stringify(e))}function Kr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Fr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wr(e,t,r){return Fr(e,t,r),e.plugin_version=as,e}function zr(){if(xo("ObsoleteBridge---test---init---"),jo=window.SensorsData_APP_JS_Bridge,Io=jo&&jo.sensorsdata_track,To=jo&&jo.sensorsdata_verify,Ao=jo&&jo.sensorsdata_visual_verify,xo("ObsoleteBridge-",Do.bridge.activeBridge,To,Io,Ao),Do&&!Do.bridge.activeBridge&&(To||Io||Ao)){Do.bridge.activeBridge=os;var e=To||Io;if(Ao&&(e=!!Ao.call(jo,JSON.stringify({server_url:Do.para.server_url})),xo("ObsoleteBridge---called-return",e)),Do.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Do.para.app_js_bridge)return void xo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Do.registerInterceptor("sendDataStage",{send:{priority:80,entry:Xr}}),xo("Android obsolete bridge inits succeed.")}}function Xr(e,t){if(xo("ObsoleteBridge---senddata"),Do.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(To){var n=To&&To.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data)));return xo("ObsoleteBridge---anVerify-success",n),n?($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Do.para.app_js_bridge.is_send?(Do.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return xo("ObsoleteBridge---is-send-old-way",Do.para.app_js_bridge.is_send),Io&&Io.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data))),$o.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Zr(e){xo("ObsoleteBridge---handleCommadn");var t=e.callType;return t in is.commands?(xo("ObsoleteBridge---",t,is.commands),is.commands[t](e,jo)):jo&&$o.isFunction(jo.sensorsdata_js_call_app)?(xo("ObsoleteBridge---handleCommadn-abridge"),jo.sensorsdata_js_call_app(JSON.stringify(e))):void 0}function Gr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Qr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Qr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Yr(e,t,r){return Gr(e,t,r),e.plugin_version=ls,e}function en(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return tn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function tn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function rn(e,t,r){return en(e,t,r),e.plugin_version=ds,e}function nn(){return"undefined"!=typeof Bo&&document[Bo]}function an(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return on(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function on(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function sn(e,t,r){return an(e,t,r),e.plugin_version=Ds,e}function ln(){if(fs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,gs=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},_s&&!_s.bridge.activeBridge&&gs()&&gs().postMessage){if(_s.bridge.activeBridge=$s,_s.para.app_js_bridge&&!_s.para.app_js_bridge.is_mui&&(_s.bridge.is_verify_success=fs&&_s.bridge.validateAppUrl(fs)),_s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_s.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!_s.para.app_js_bridge)return void ms("app_js_bridge is not configured, data will not be sent by iOS bridge.");_s.registerInterceptor("sendDataStage",{send:{priority:70,entry:un}}),ms("IOS bridge inits succeed.")}}function un(e,t){if(_s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return _s.bridge.is_verify_success?(gs()&&gs().postMessage(JSON.stringify({callType:"app_h5_track",data:hs.extend({server_url:_s.para.server_url},e.data)})),hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e):_s.para.app_js_bridge.is_send?(_s.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function cn(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||_s.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?hs.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:gs()&&gs().postMessage(JSON.stringify(e)):null}function dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fn(e,t,r){return dn(e,t,r),e.plugin_version=Es,e}function gn(){if(vs&&!vs.bridge.activeBridge&&_n()){if(vs.bridge.activeBridge=Ls,vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:hn()?"success":"fail"},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:90,entry:mn}}),bs("IOS obsolete bridge inits succeed.")}}function _n(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function hn(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=ys.URL(vs.para.server_url).hostname,r=ys.URL(vs.para.server_url).searchParams.get("project")||"default"}catch(n){vs.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function mn(e,t){function r(e){var t=JSON.stringify(ys.extend({server_url:vs.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(vs.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,ys.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(ys.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bn(e,t,r){return vn(e,t,r),e.plugin_version=Rs,e}function wn(){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=Hs}function Sn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return kn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o); -}}return e}function kn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Pn(e,t,r){return Sn(e,t,r),e.plugin_version=qs,e}function Cn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function On(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function In(e,t,r){return Nn(e,t,r),e.plugin_version=Ws,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return An(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function An(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dn(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function $n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function xn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return En(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function En(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ln(e,t,r){return xn(e,t,r),e.plugin_version=rl,e}function Un(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Rn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Rn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Bn(e,t,r){return Un(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Mn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function qn(){kl=!0}function Kn(){kl=!1}function Fn(){return kl}function Vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zn(e,t,r){return Vn(e,t,r),e.plugin_version=Nl,e}function Xn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Zn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback;Xn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Gn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Qn(){al.on("sdkInitPara",function(){Gn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Zn}})})}function Yn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ei(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ei(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ti(e,t,r){return Yn(e,t,r),e.plugin_version=Tl,e}function ri(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ni(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ii),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ri}})})}function ii(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function si(e,t,r){return ai(e,t,r),e.plugin_version=$l,e}function li(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fi(e,t,r){return di(e,t,r),e.plugin_version=Ul,e}function gi(e){var t=new pl.BeaconSend(e);t.start()}function _i(e,t){var r=null,n=null;pl.isObject(e.config)&&(r=e.config.send_type,n=pl.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===dl.para.send_type;if(i&&pl.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=dl.kit.encodeTrackData(e.data),pl.isArray(a)&&a.length?pl.each(a,function(t){e.callback=null,e.server_url=t,gi(e)}):"string"==typeof a&&""!==a?gi(e):dl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function hi(){"beacon"!==dl.para.send_type||pl.isSupportBeaconSend()||(dl.para.send_type="image")}function mi(){dl.on("sdkInitPara",function(){hi()}),dl.on("sdkAfterInitPara",function(){dl.registerInterceptor("sendDataStage",{send:{priority:110,entry:_i}})})}function vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bi(e,t,r){return vi(e,t,r),e.plugin_version=Hl,e}function wi(e){var t=new gl.AjaxSend(e);t.start()}function Si(e,t){var r=null,n=null;gl.isObject(e.config)&&(r=e.config.send_type,n=gl.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===fl.para.send_type;if(i&&gl.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=fl.kit.encodeTrackData(e.data),gl.isArray(a)&&a.length?gl.each(a,function(t){e.callback=null,e.server_url=t,wi(e)}):"string"==typeof a&&""!==a?wi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function ki(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function Pi(){fl.on("sdkInitPara",function(){ki()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:Si}})})}function Ci(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ni(e,t,r){return Ci(e,t,r),e.plugin_version=ql,e}function ji(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function Ii(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=null;hl.isObject(e.config)&&(r=hl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,hl.isArray(n)&&n.length?hl.each(n,function(t){t&&(e.data=ji(t,i),e.callback=null,e.server_url=t,Ii(e))}):"string"==typeof n&&""!==n?(e.data=ji(n,i),Ii(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ai(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function Di(){_l.on("sdkInitPara",function(){Ai()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function $i(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ei(e,t,r){return $i(e,t,r),e.plugin_version=_a,e}function Li(e){return null===zl?void Ui(e):void zl.push(e)}function Ui(e){try{if("log"===e.level&&Ri())return void Ji(e);if("warn"===e.level&&Bi())return void Ji(e);if("error"===e.level&&Hi())return void Ji(e)}catch(t){}}function Ri(){return!!Fi()||(Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level)}function Bi(){return!!Fi()||(Ri()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level)}function Hi(){return!!Fi()||(!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level)}function Ji(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Mi(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Mi(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function Ki(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Fi(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Vi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new d((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new d((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new d((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var p,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),p=5==n.a.length&&1===n.a[0],p&&(a(function(){p=!f('"\t"')}),p&&a(function(){p=1!==f("01")}),p&&a(function(){p=1!==f("1.")})))},function(){p=!1}),t=p}}return o[e]=!!t}function s(e){return D(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,d=n.Date||r.Date,p=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new d((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T="000000",A=function(e,t){return(T+(t||0)).slice(-e)},D=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],p=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;p(r+1,0)<=i;r++);for(n=c((i-p(r,0))/30.42);p(r,n+1)<=i;n++);i=1+i-p(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(D=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+A(6,r<0?-r:r):A(4,r))+"-"+A(2,n+1)+"-"+A(2,i)+"T"+A(2,o)+":"+A(2,s)+":"+A(2,l)+"."+A(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var $=i.stringify;i.stringify=function(e,t,r){var n=d.prototype.toJSON;d.prototype.toJSON=s;var i=$(e,t,r);return d.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=I[t];return r?r:x+A(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,p,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===d.prototype.toJSON?l=D(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),p=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,B));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++B);e+=a.slice(t,B)}if(34==a.charCodeAt(B))return B++,e;q();default:if(t=B,45==i&&(n=!0,i=a.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(B+1),i>=48&&i<=57)&&q(),n=!1;B=48&&i<=57);B++);if(46==a.charCodeAt(B)){for(r=++B;r57));r++);r==B&&q(),B=r}if(i=a.charCodeAt(B),101==i||69==i){for(i=a.charCodeAt(++B),43!=i&&45!=i||B++,r=B;r57));r++);r==B&&q(),B=r}return+a.slice(t,B)}n&&q();var s=a.slice(B,B+4);if("true"==s)return B+=4,!0;if("fals"==s&&101==a.charCodeAt(B+4))return B+=5,!1;if("null"==s)return B+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return B=0,H=""+e,r=F(K()),"$"!=K()&&q(),B=H=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Wi,zi={setup:function(e){Wi=e},log:function(){(Wi||console&&console.log||function(){}).apply(null,arguments)}},Xi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Xi.get(e))||null}catch(r){zi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){zi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Xi.set(t,r),Xi.get(t)!==r&&(e=!1),Xi.remove(t)}catch(n){e=!1}return e}},Zi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Xi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Xi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Xi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Xi.get(e)),Xi.remove(e),Xi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Xi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Xi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Xi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Xi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.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=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Qi=function(e){this.ele=e},Yi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Qi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){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),y(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||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=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 Yi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Yi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},ka={checkIsAddSign:function(e){"track"===e.type&&(Re()?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,n=va.get("sensorsdata2015jssdkcross"+Vi.para.sdk_id);n=Vi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Vi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Vi.para.encrypt_cookie&&(i=Vi.kit.userEncrypt(i)),va.set("sensorsdata2015jssdkcross"+Vi.para.sdk_id,i,null,!0)),Vi.para.is_track_device_id&&(wa.currentProps.$device_id=r)},storeInitCheck:function(){if(Vi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};va.isSupport()?va.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):Sa.set(Sa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(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)}}},Pa=function(){this._events=[],this.pendingEvents=[]};Pa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(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():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Ca={},Oa=new l;Ca.spa=Oa,Ca.sdk=new l,Ca.data=new l,Ca.initSystemEvent=function(){Ye(function(e){Oa.emit("switch",e)})},Ca.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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var Na=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};Na.prototype.start=function(){var e=this,t=new Date;Ze({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(r,n){Ca.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){Ca.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},Na.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var ja="sawebjssdk-",Ia="tab-sawebjssdk-";tt.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()},pa.batch_send.send_interval)},getServerUrl:function(){return d(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),Xi.remove(e[n])}r=Ce(r),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=ja+String(n()),a=Xi.get(this.tabKey);null===a?(this.tabKey=Ia+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,Xi.set(this.tabKey,JSON.stringify(a)),Vi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Ia+String(n()),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var d=new a(n);d.get(s,r,1e3,function(e){if(e){null===Xi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Xi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Xi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var p=i(Xi.get(s))||{expireTime:0};t()-p.expireTime>r&&Xi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!d(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!d(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=xa._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},Ua={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ea[n])&&Ea[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ea[n])&&Ea[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ea[n])&&Ea[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){rt({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ea[i])&&Ea[i](n)),!0};rt({propertyValue:t},n)}):La.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ea[n])&&Ea[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ea[n])&&Ea[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=p(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ra.configIsMatchNew=function(e,t){if(d(e.$element_selector)&&d(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 e.$element_selector.indexOf(t.element_selector)>-1}if(d(e.$element_path)&&d(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 e.$element_path.indexOf(t.element_path)>-1}return!1},Ra.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"]?Ra.configIsMatchNew(e,t):Ra.configIsMatchOldVersion(e,t)))},Ra.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(Ra.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},Ra.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ra.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ra.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ra.getPropElInLi=function(e,t){if(!(e&&_(e)&&d(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Vi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ra.getProp=function(e,t){if(!r(e))return!1;if(!(d(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(d(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!d(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Vi.heatmap.getClosestLi(s);o=Ra.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!d(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ra.getAssignConfigs=function(e,t){var n=Ra.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ba={events:[],getAssignConfigs:Ra.getAssignConfigs,filterConfig:Ra.filterConfig,getProp:Ra.getProp,initUrl:Ra.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),d(a.event_name)&&n.push(a.event_name))}),Vi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Vi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Vi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ha={events:[],customProp:Ba,getAssignConfigs:Ra.getAssignConfigs,initUrl:Ra.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Vi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Vi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ja={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=qa.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Vi.heatmap.getEleDetail(e);if(!r(t)||!d(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,qa.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ra.getProp,getPropElInLi:Ra.getPropElInLi,filterConfig:Ra.filterConfig},qa={unlimitedDiv:Ja,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ma,initUrl:function(){var e=Ra.initUrl();if(e){var t;try{t=new f(Vi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Vi.para.heatmap)||!Vi.para.heatmap.get_vtrack_config)return!1;if(Xi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=xa.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Vi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Vi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Xa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Xa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(!d(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){var t=function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&d(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null};return t(e,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Vi.heatmap.getClosestLi(e);if(!i||!_(e)||!d(e.tagName))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Vi.is_heatmap_render_mode=!0,Vi.para.heatmap||(Vi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Vi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Vi.para.heatmap_url||(Vi.para.heatmap_url=ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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=We({target:e});r.$element_selector=t?t:"",r.$element_path=Vi.heatmap.getElementPath(e,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);var n=Vi.heatmap.getElementPosition(e,r.$element_path,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Vi.para.heatmap)&&e(Vi.para.heatmap.collect_element)&&!Vi.para.heatmap.collect_element(n))return!1;var s=Xa.getBasicEleInfo(t,n,i,a,o);mt(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Vi.para.heatmap&&Vi.para.heatmap.custom_property){var c=Vi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div?!!(r(Vi.para.heatmap)&&r(Vi.para.heatmap.collect_tags)&&r(Vi.para.heatmap.collect_tags.div)&&v(Vi.para.heatmap.collect_tags.div.ignore_tags)&&re(Vi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Vi.para&&Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Vi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.scroll_notice_map)return!1;var t=!0;Vi.para.scrollmap&&e(Vi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Vi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Vi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Vi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,vt(e)),this.current_time=n}});i.current_time=new Date,Be(window,"scroll",function(){return!!t&&void i.go()}),Be(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.clickmap)&&(e(Vi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Vi.para.heatmap.collect_url()}),"all"===Vi.para.heatmap.collect_elements?Vi.para.heatmap.collect_elements="all":Vi.para.heatmap.collect_elements="interact",void("all"===Vi.para.heatmap.collect_elements?Be(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=d(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):Be(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Vi.heatmap.getTargetElement(a,e);return!(!_(o)&&!d(a.tagName))&&void(_(o)&&d(o.tagName)?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Vi.para.heatmap)&&Vi.para.heatmap.get_vtrack_config&&Ja.events.length>0&&Ja.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"}))})))}},Za={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Vi.log("error: isReady callback must be function")},getUtm:function(){return wa.campaignParams()},getStayTime:function(){return(new Date-Vi._t)/1e3},setProfileLocal:function(e){if(!Xi.isSupport())return Vi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=xa.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(xa.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Vi.setProfile(e))}else xa.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Vi.setProfile(e)},setInitReferrer:function(){var e=$e();Vi.setOnceProfile({_init_referrer:e,_init_referrer_host:wa.pageProp.referrer_host})},setSessionReferrer:function(){var e=$e();xa.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:wa.pageProp.referrer_host})},setDefaultAttr:function(){wa.register({_current_url:location.href,_referrer:$e(),_referring_host:wa.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Vi.para.heatmap&&Vi.para.heatmap.track_attr?Vi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Xa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Xa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Vi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,yt()),t),i=Z()}var i;i=this.autoTrackIsUsed?wa.pageProp.url:wa.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,bt(Vi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=yt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Vi.para.is_single_page&&w(function(){var r=$e(a,!0);Vi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Vi.track("$pageview",P({$referrer:$e(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),bt(Vi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(xa._state)?"SDK is not initialized.":xa.getAnonymousId()},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Vi.modules)&&Vi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Vi.use.apply(Vi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:It,unbind:Tt,trackLink:At,trackLinks:Dt,setItem:$t,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Bt,unsetProfile:Ht,identify:Jt,resetAnonymousIdentity:Mt,trackSignup:Kt,registerPage:Ft,clearAllRegister:Vt,clearPageRegister:Wt,register:zt,registerOnce:Xt,registerSession:Zt,registerSessionOnce:Gt,login:Qt,loginWithKey:Yt,logout:er,getPresetProperties:tr,readyState:Ga,debug:ba,on:et,log:Oe};zi.setup(Oe);var eo=P({},ua,Da),to={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:Vi.para.use_app_track_is_send!==!1&&"only"!==Vi.para.use_app_track,white_list:[],is_mui:"mui"===Vi.para.use_app_track};"object"==typeof Vi.para.app_js_bridge?Vi.para.app_js_bridge=P({},e,Vi.para.app_js_bridge):Vi.para.use_app_track!==!0&&Vi.para.app_js_bridge!==!0&&"only"!==Vi.para.use_app_track&&"mui"!==Vi.para.use_app_track||(Vi.para.app_js_bridge=P({},e)),Vi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Vi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ar};nr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),ir(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},nr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},nr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),ir(r)},or.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Vi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==V(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=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Xa.setNotice(n),aa.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Vi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Vi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Vi.heatmap_version&&Vi.heatmap_version===Vi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Vi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Xa.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=d(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&d(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return d(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Xa.setNotice(i),aa.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(lr("sa-visual-mode")===!0||"true"===lr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Vi.para.vtrack_url?Vi.para.vtrack_url:ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vtrack.min.js"})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(aa.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var t=e.data.data.userURL;d(t)&&(window.location.href=encodeURI(t.replace(/javascript:/i,"")))}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:_a}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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){}};vr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new mr(t,n,Vi),a=0;a=2)&&(wo&&(Or(!0),_r()),Ca.initSystemEvent(),Vi.setInitVar(),Vi.readyState.setState(2),Vi.initPara(e),Ca.sdk.emit("initPara"),Ca.sdk.emit("afterInitPara"),Ca.sdk.emit("initAPI"),Ca.sdk.emit("afterInitAPI"),Vi.detectMode(),rr(),Ca.sdk.emit("afterInit"),void Ca.sdk.emit("ready"))},wo?Or(!1):(Or(!0),_r());var So,ko,Po,Co,Oo,No,jo,Io,To,Ao,Do,$o,xo,Eo,Lo,Uo,Ro,Bo,Ho="1.26.8",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=Ir(Jo),qo="1.26.8",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=Dr(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:$r,visualized_track:xr,page_info:xr,sensorsdata_get_app_visual_config:Er}},Go="1.26.8",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Br()},handleCommand:Jr},Yo=Rr(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Mr,visualized_track:qr,page_info:qr,sensorsdata_get_app_visual_config:Kr}},as="1.26.8",os={init:function(e){Do=e,$o=Do&&Do._,xo=Do&&Do.log||console&&console.log||function(){},zr()},handleCommand:Zr},ss=Wr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.26.8",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Ts.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Ts.data=e,Ts.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Ts.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Is(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(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=ps().visibilityChange,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},As=rn(Ts,"Deeplink","sdkReady"),Ds="1.26.8",$s={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},ln()},handleCommand:cn},xs=sn($s,"IOSBridge","sdkAfterInitPara"),Es="1.26.8",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},gn()}},Us=fn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.26.8",Bs=5e3,Hs=432e3;wn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},wn.prototype.log=function(e){this.sd&&this.sd.log(e)},wn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Bs)},wn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},wn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},wn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&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()}},wn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},wn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},wn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},wn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},wn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},wn.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()}})},wn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},wn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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()},wn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},wn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},wn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},wn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},wn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new wn,Ms=bn(Js,"PageLeave","sdkReady"),qs="1.26.8",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=Pn(Fs,"PageLoad","sdkReady");On.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Cn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.26.8";On.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new On,Gs=In(Zs),Qs="1.26.8",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=$n,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=Dn(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.26.8",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var p=u.indexOf("?");a=p>-1?o>-1?s+l+"#"+u.substring(1,o)+d(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+d(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,dl,pl,fl,gl,_l,hl,ml=Ln(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.26.8",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Bn(bl,"Utm","sdkAfterInitPara"),Sl="1.26.8",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=qn,Pl.enableSDK=Kn,Pl.getDisabled=Fn}},Ol=Mn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.26.8",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Qn()}},Il=zn(jl),Tl="1.26.8",Al={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ni()}},Dl=ti(Al),$l="1.26.8",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ci()}},Ll=si(El),Ul="1.26.8",Rl={plugin_name:"BeaconSender",init:function(e){dl=e,pl=dl._,mi()}},Bl=fi(Rl),Hl="1.26.8",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,Pi()}},Ml=bi(Jl),ql="1.26.8",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,Di()}},Fl=Ni(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Li),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("http://modernizr.com/"),"http://modernizr.com/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{d(e)||(e=String(e)),e=p(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void zi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new Qi(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(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){zi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(ea&&e.forEach===ea)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){zi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(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 j(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}function I(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(p){zi.log(p)}n&&d()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function T(e){return k(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 A(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function D(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=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,na.set(t,"true",0,null,r,"; domain="+a),document.cookie.indexOf(t+"=true")!==-1)return na.set(t,"true","-1s",null,r,"; domain="+a),a;return""}function J(e){function t(e,t){e=p(e);var r;if("body"===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 o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){zi.log(o)}return i&&_(i)?r(i):null}if(!d(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=p(e.textContent):e.innerText&&(r=p(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 q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){zi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=u(e);var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);return null===i||i&&"string"!=typeof i[1]&&i[1].length?"":u(i[1])}function V(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){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(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){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 Z(e){return d(e)?(e=p(e),A(e)):A(location.href)}function G(e){return d(e)?(e=p(e),A(e)):A(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function pe(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!d(t.callbackName))return zi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(i.appendChild(n),ce(t.timeout)&&(a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){zi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){zi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var s=[];k(t.data,function(e,t){s.push(t+"="+e)}),t.data=s.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){zi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=t.url}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.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;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.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 he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,d)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else d(i)||ce(i)||$(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function it(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function at(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function ot(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))ot(e[a]);else if(d(i)){if(re(n,a)>-1)return;e[a]=it(i,re(t,a)>-1?1024:pa.max_string_length)}})}function st(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function lt(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};rt({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};rt({item_id:n},i)}}function ut(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&rt({propertyKey:n},i)})}function ct(e){var t=e.properties;ye(e),r(t)?(nt(t),at(t),st(e),ut(t),ot(t)):"properties"in e&&(e.properties={}),lt(e)}function dt(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function pt(e,t){try{var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,xa.getIdentities());var a={identities:i,distinct_id:xa.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,xa.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),"$UnbindID"===a.event&&(a.login_id&&delete a.login_id,a.anonymous_id&&delete a.anonymous_id),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},Pa.properties(),xa.getProps(),xa.getSessionProps(),Pa.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!d(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!d(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&d(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&d(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!d(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!d(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!d(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),d(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&$(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ha.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=qa.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),ba.checkIsAddSign(a),ba.checkIsFirstTime(a),Fe(a),Ve(a),a}catch(o){return{_debug_web_msg:String(o)}}}function ft(e){return Fa.stage.process("basicProps",e)}function gt(e){return Fa.stage.process("formatData",e)}function _t(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&De(e.ele,"click",function(e){i(e)}))))}function ht(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function mt(e){return Wa.stage.process("webClickEvent",e)}function vt(e){return Wa.stage.process("webStayEvent",e)}function yt(){var e=Pa.campaignParams(),t={};return k(e,function(e,r,n){(" "+Vi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function bt(e,t,r){if(Vi.is_first_visitor&&r){var n={};Vi.para.preset_properties.search_keyword_baidu&&Ue(document.referrer)&&$e()&&(n.$search_keyword_id=Sa.id(),n.$search_keyword_id_type=Sa.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=Le(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:d(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:d(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:He(),$first_search_keyword:Re()},yt(),n)),Vi.is_first_visitor=!1}}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=xa.getFirstId(),s=xa.getOriginDistinctId();if(!rt({distinct_id:n}))return je("login id is invalid"),!1;if(n===xa.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"),!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(a)&&n===xa._state.first_id)return!1; +var l=xa._state.history_login_id.name!==a||n!==xa._state.history_login_id.value;if(l){xa._state.identities[a]=n,xa.set("history_login_id",{name:a,value:n}),o||xa.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:xa._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];xa._state.identities=t,xa.save()}function kt(e,t){if(!rt({unbindKey:e,bindValue:t}))return!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(e)&&xa._state.identities[e]===t){var n=xa.getUnionId().login_id;n&&e+"+"+t===n&&(xa._state.distinct_id=xa._state.first_id,xa._state.first_id="",xa.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete xa._state.identities[e],xa.save())}var i={};return i[e]=t,i}function Pt(){Vi._t=Vi._t||1*new Date,Vi.is_first_visitor=!1,Vi.source_channel_standard=ga}function Ct(e){P(pa,e||Vi.para||{}),Vi.para=pa;var t={};if(r(Vi.para.is_track_latest))for(var n in Vi.para.is_track_latest)t["latest_"+n]=Vi.para.is_track_latest[n];Vi.para.preset_properties=P({},fa.preset_properties,t,Vi.para.preset_properties||{});var i;for(i in fa)void 0===Vi.para[i]&&(Vi.para[i]=fa[i]);"string"!=typeof Vi.para.web_url||"://"!==Vi.para.web_url.slice(0,3)&&"//"!==Vi.para.web_url.slice(0,2)||("://"===Vi.para.web_url.slice(0,3)?Vi.para.web_url=location.protocol.slice(0,-1)+Vi.para.web_url:Vi.para.web_url=location.protocol+Vi.para.web_url),ka.protocol.serverUrl(),Vi.bridge&&Vi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Vi.para.source_type&&(Vi.para.source_type.utm=v(Vi.para.source_type.utm)?Vi.para.source_type.utm.concat(a):a,Vi.para.source_type.search=v(Vi.para.source_type.search)?Vi.para.source_type.search.concat(o):o,Vi.para.source_type.social=v(Vi.para.source_type.social)?Vi.para.source_type.social.concat(s):s,Vi.para.source_type.keyword=r(Vi.para.source_type.keyword)?P(l,Vi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Vi.para.heatmap&&!r(Vi.para.heatmap)&&(Vi.para.heatmap={}),r(Vi.para.heatmap)){Vi.para.heatmap.clickmap=Vi.para.heatmap.clickmap||"default",Vi.para.heatmap.scroll_notice_map=Vi.para.heatmap.scroll_notice_map||"default",Vi.para.heatmap.scroll_delay_time=Vi.para.heatmap.scroll_delay_time||4e3,Vi.para.heatmap.scroll_event_duration=Vi.para.heatmap.scroll_event_duration||18e3,Vi.para.heatmap.renderRefreshTime=Vi.para.heatmap.renderRefreshTime||1e3,Vi.para.heatmap.loadTimeout=Vi.para.heatmap.loadTimeout||1e3,Vi.para.heatmap.get_vtrack_config!==!0&&(Vi.para.heatmap.get_vtrack_config=!1);var d=v(Vi.para.heatmap.track_attr)?U(Vi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),Vi.para.heatmap.track_attr=d,r(Vi.para.heatmap.collect_tags))if(Vi.para.heatmap.collect_tags.div===!0)Vi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Vi.para.heatmap.collect_tags.div)){if(Vi.para.heatmap.collect_tags.div.ignore_tags?v(Vi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Vi.para.heatmap.collect_tags.div.ignore_tags=c):Vi.para.heatmap.collect_tags.div.ignore_tags=c,Vi.para.heatmap.collect_tags.div.max_level){var p=[1,2,3];re(p,Vi.para.heatmap.collect_tags.div.max_level)===-1&&(Vi.para.heatmap.collect_tags.div.max_level=1)}}else Vi.para.heatmap.collect_tags.div=!1;else Vi.para.heatmap.collect_tags=u}Vi.para.server_url=Ge(Vi.para.server_url),Vi.para.noCache===!0?Vi.para.noCache="?"+(new Date).getTime():Vi.para.noCache="",Vi.para.callback_timeout>Vi.para.datasend_timeout&&(Vi.para.datasend_timeout=Vi.para.callback_timeout),Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&r(Vi.para.heatmap.collect_tags)&&k(Vi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Vi.heatmap.otherTags.push(t)}),Vi.para.heatmap&&"default"===Vi.para.heatmap.clickmap&&Vi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Za[t]?Za[t].apply(Za,r):void("function"==typeof t?t.apply(Vi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Vi,n),a.plugin_is_init=!0,Vi.modules=Vi.modules||{},Vi.modules[a.plugin_name||"unnamed_"+Qa++]=a,a}if(!d(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Vi.modules&&Vi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return d(t)&&(r(Vi.modules)&&r(Vi.modules[t])?a=Vi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Vi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){rt({event:e,properties:t})&&Va.send({type:"track",event:e,properties:t},r)}function It(e,t){return!!rt({bindKey:e,bindValue:t})&&(xa._state.identities[e]=t,xa.save(),void Va.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function Tt(e,t){var r=kt(e,t);r&&Va.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function At(e,t,r){"object"==typeof e&&e.tagName?_t({ele:e},t,r,Vi.track):"object"==typeof e&&e.target&&e.event&&_t(e,t,r,Vi.track)}function Dt(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void De(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Vi.track(t,r,i)}))}function $t(e,t,r){rt({item_type:e,item_id:t,properties:r})&&Va.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){rt({item_type:e,item_id:t})&&Va.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set",properties:e},t)}function Lt(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){rt({propertiesMust:e})&&(k(e,function(t,r){d(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Va.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;d(e)&&(e={},e[n]=1),rt({propertiesMust:e})&&(r(e)?Va.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Bt(e){Va.send({type:"profile_delete"},e),xa.set("distinct_id",Gi()),xa.set("first_id","")}function Ht(e,t){var r=e,n={};d(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){d(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Va.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e){"number"==typeof e&&(e=String(e));var t=xa.getFirstId();if("undefined"==typeof e){var r=Gi();t?xa.set("first_id",r):xa.set("distinct_id",r)}else rt({distinct_id:e})&&(t?xa.set("first_id",e):xa.set("distinct_id",e))}function Mt(e){var t=xa.getFirstId();if(t)return je("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),"undefined"==typeof e){var r=Gi();xa._state.identities.$identity_cookie_id=r,xa.set("distinct_id",r)}else rt({distinct_id:e})&&(xa._state.identities.$identity_cookie_id=e,xa.set("distinct_id",e))}function qt(e,t,r,n){var i=xa.getFirstId()||xa.getDistinctId();xa.set("distinct_id",e),Va.send({original_id:i,distinct_id:xa.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function Kt(e,t,r,n){"number"==typeof e&&(e=String(e)),rt({distinct_id:e,event:t,properties:r})&&qt(e,t,r,n)}function Ft(e){rt({properties:e})?P(Pa.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Vt(e){xa.clearAllProps(e)}function Wt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Vi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vapph5define.min.js"})}else t();else t()}function cr(t){Vi.para.is_track_single_page&&Oa.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){Pa.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Vi.quick&&Vi.quick("autoTrack",i)}};if("boolean"==typeof Vi.para.is_track_single_page)i();else if("function"==typeof Vi.para.is_track_single_page){var a=Vi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function dr(){Vi._q&&v(Vi._q)&&Vi._q.length>0&&k(Vi._q,function(e){Vi[e[0]].apply(Vi,Array.prototype.slice.call(e[1]))}),r(Vi.para.heatmap)&&(Xa.initHeatmap(),Xa.initScrollmap())}function pr(){Vi.readyState.setState(3),new Vi.SDKJSBridge("visualized").onAppNotify(function(){ur("undefined"!=typeof sa_jssdk_app_define_mode?!0:!1)}),ur(!1),Vi.bridge.app_js_bridge_v1(),Pa.initPage(),cr(),xa.init(),sr(),gr(),Vi.readyState.setState(4),dr()}function fr(){ro.isSeachHasKeyword()?ro.hasKeywordHandle():window.parent!==self&&no.isSearchHasKeyword()?no.verifyVtrackMode():ro.isWindowNameHasKeyword()?ro.windowNameHasKeywordHandle():ro.isStorageHasKeyword()?ro.storageHasKeywordHandle():window.parent!==self&&no.isStorageHasKeyword()?no.verifyVtrackMode():(pr(),no.notifyUser())}function gr(){qa.init(),"success"===Vi.bridge.bridge_info.verify_success&&Ha.init()}function _r(){k(io,function(t){var r=Vi[t];Vi[t]=function(){if(Vi.readyState.state<3)return v(Vi._q)||(Vi._q=[]),Ne("calling sdk api before init is deprecated."),Vi._q.push([t,arguments]),!1;if(!e(Vi.getDisabled)||!Vi.getDisabled())return Vi.readyState.getState()?r.apply(Vi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function hr(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 mr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new hr,this.sensors=r}function vr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function yr(e){e&&e.buildDataStage&&so.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&po.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&uo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&go.registerStageImplementation(e.viewStage)}function br(e,t){_o[e]&&_o[e](t)}function wr(){return ho.stage&&ho.stage.process("getUtmData")}function Sr(e){return mo.stage.process("send",e)}function kr(e){e.kit=vo,e.saEvent=Va,this.buildDataStage=Fa,this.sendDataStage=mo,this.businessStage=ho}function Pr(e){e.heatmap=Xa,this.viewStage=Wa}function Cr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};br("buildDataStage",r)}function Or(e){e&&(Vi.events=$a,Vi.bridge=to,Vi.SDKJSBridge=nr,Vi.JSBridge=or,Vi.store=xa,Vi.unlimitedDiv=Ja,Vi.customProp=Ma,Vi.vtrackcollect=qa,Vi.vapph5collect=Ha,Vi.detectMode=fr,Vi.registerFeature=yr,Vi.registerInterceptor=br,Vi.commonWays=Za,yr(new kr(Vi)),yr(new Pr(Vi)),br("viewStage",yo));var t=e?Ya:ao;for(var r in t)Vi[r]=t[r];Vi.logger=da,Vi.log=Oe,Vi._=eo,Vi.on=et,Vi.ee=Ca,Vi.use=Nt,Vi.lib_version=_a,Vi.registerPropertyPlugin=Cr}function Nr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ir(e,t,r){return Nr(e,t,r),e.plugin_version=Ho,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ar(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ar(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dr(e,t,r){return Tr(e,t,r),e.plugin_version=qo,e}function $r(e){return zo&&zo.call(Vo,JSON.stringify(e))}function xr(e){return Wo.call(Vo)&&Xo&&Xo.call(Vo,JSON.stringify(e))}function Er(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Lr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ur(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ur(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rr(e,t,r){return Lr(e,t,r),e.plugin_version=Go,e}function Br(){if(So=window.SensorsData_APP_New_H5_Bridge,ko=So&&So.sensorsdata_track,Po=ko&&So.sensorsdata_get_server_url&&So.sensorsdata_get_server_url(),No("---test---fail---",!Co,Co.bridge.activeBridge,!Po),Co&&!Co.bridge.activeBridge&&Po)return Co.bridge.activeBridge=Qo,Co.para.app_js_bridge&&!Co.para.app_js_bridge.is_mui&&(Co.bridge.is_verify_success=Po&&Co.bridge.validateAppUrl(Po),No("---test---bridge-verify-",Co.bridge.is_verify_success)),Co.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:Co.bridge.is_verify_success?"success":"fail",support_two_way_call:!!So.sensorsdata_js_call_app},Co.para.app_js_bridge?void Co.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}):void No("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function Hr(e,t){if(No("---test---datasend-",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return Co.bridge.is_verify_success?(No("---test---bridge-verify-success---",e.data),ko&&ko.call(So,JSON.stringify(Oo.extend({server_url:Co.para.server_url},e.data))),Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(No("---test---bridge-verify-fail-----",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_send?(Co.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e))}function Jr(e){var t=e.callType;return t in Zo.commands?Zo.commands[t](e,So):void(So&&Oo.isFunction(So.sensorsdata_js_call_app)&&So.sensorsdata_js_call_app(JSON.stringify(e)))}function Mr(e){return rs&&rs.call(es,JSON.stringify(e))}function qr(e){return ts.call(es)&&ns&&ns.call(es,JSON.stringify(e))}function Kr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Fr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wr(e,t,r){return Fr(e,t,r),e.plugin_version=as,e}function zr(){if(xo("ObsoleteBridge---test---init---"),jo=window.SensorsData_APP_JS_Bridge,Io=jo&&jo.sensorsdata_track,To=jo&&jo.sensorsdata_verify,Ao=jo&&jo.sensorsdata_visual_verify,xo("ObsoleteBridge-",Do.bridge.activeBridge,To,Io,Ao),Do&&!Do.bridge.activeBridge&&(To||Io||Ao)){Do.bridge.activeBridge=os;var e=To||Io;if(Ao&&(e=!!Ao.call(jo,JSON.stringify({server_url:Do.para.server_url})),xo("ObsoleteBridge---called-return",e)),Do.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Do.para.app_js_bridge)return void xo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Do.registerInterceptor("sendDataStage",{send:{priority:80,entry:Xr}}),xo("Android obsolete bridge inits succeed.")}}function Xr(e,t){if(xo("ObsoleteBridge---senddata"),Do.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(To){var n=To&&To.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data)));return xo("ObsoleteBridge---anVerify-success",n),n?($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Do.para.app_js_bridge.is_send?(Do.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return xo("ObsoleteBridge---is-send-old-way",Do.para.app_js_bridge.is_send),Io&&Io.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data))),$o.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Zr(e){xo("ObsoleteBridge---handleCommadn");var t=e.callType;return t in is.commands?(xo("ObsoleteBridge---",t,is.commands),is.commands[t](e,jo)):jo&&$o.isFunction(jo.sensorsdata_js_call_app)?(xo("ObsoleteBridge---handleCommadn-abridge"),jo.sensorsdata_js_call_app(JSON.stringify(e))):void 0}function Gr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Qr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Qr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Yr(e,t,r){return Gr(e,t,r),e.plugin_version=ls,e}function en(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return tn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function tn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function rn(e,t,r){return en(e,t,r),e.plugin_version=ds,e}function nn(){return"undefined"!=typeof Bo&&document[Bo]}function an(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return on(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function on(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function sn(e,t,r){return an(e,t,r),e.plugin_version=Ds,e}function ln(){if(fs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,gs=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},_s&&!_s.bridge.activeBridge&&gs()&&gs().postMessage){if(_s.bridge.activeBridge=$s,_s.para.app_js_bridge&&!_s.para.app_js_bridge.is_mui&&(_s.bridge.is_verify_success=fs&&_s.bridge.validateAppUrl(fs)),_s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_s.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!_s.para.app_js_bridge)return void ms("app_js_bridge is not configured, data will not be sent by iOS bridge.");_s.registerInterceptor("sendDataStage",{send:{priority:70,entry:un}}),ms("IOS bridge inits succeed.")}}function un(e,t){if(_s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return _s.bridge.is_verify_success?(gs()&&gs().postMessage(JSON.stringify({callType:"app_h5_track",data:hs.extend({server_url:_s.para.server_url},e.data)})),hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e):_s.para.app_js_bridge.is_send?(_s.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function cn(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||_s.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?hs.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:gs()&&gs().postMessage(JSON.stringify(e)):null}function dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fn(e,t,r){return dn(e,t,r),e.plugin_version=Es,e}function gn(){if(vs&&!vs.bridge.activeBridge&&_n()){if(vs.bridge.activeBridge=Ls,vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:hn()?"success":"fail"},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:90,entry:mn}}),bs("IOS obsolete bridge inits succeed.")}}function _n(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function hn(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=ys.URL(vs.para.server_url).hostname,r=ys.URL(vs.para.server_url).searchParams.get("project")||"default"}catch(n){vs.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function mn(e,t){function r(e){var t=JSON.stringify(ys.extend({server_url:vs.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(vs.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,ys.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(ys.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bn(e,t,r){return vn(e,t,r),e.plugin_version=Rs,e}function wn(){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=Hs}function Sn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return kn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function kn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n); +}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Pn(e,t,r){return Sn(e,t,r),e.plugin_version=qs,e}function Cn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function On(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function In(e,t,r){return Nn(e,t,r),e.plugin_version=Ws,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return An(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function An(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dn(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function $n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function xn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return En(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function En(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ln(e,t,r){return xn(e,t,r),e.plugin_version=rl,e}function Un(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Rn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Rn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Bn(e,t,r){return Un(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Mn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function qn(){kl=!0}function Kn(){kl=!1}function Fn(){return kl}function Vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zn(e,t,r){return Vn(e,t,r),e.plugin_version=Nl,e}function Xn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Zn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback;Xn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Gn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Qn(){al.on("sdkInitPara",function(){Gn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Zn}})})}function Yn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ei(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ei(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ti(e,t,r){return Yn(e,t,r),e.plugin_version=Tl,e}function ri(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ni(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ii),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ri}})})}function ii(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function si(e,t,r){return ai(e,t,r),e.plugin_version=$l,e}function li(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fi(e,t,r){return di(e,t,r),e.plugin_version=Ul,e}function gi(e){var t=new pl.BeaconSend(e);t.start()}function _i(e,t){var r=null,n=null;pl.isObject(e.config)&&(r=e.config.send_type,n=pl.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===dl.para.send_type;if(i&&pl.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=dl.kit.encodeTrackData(e.data),pl.isArray(a)&&a.length?pl.each(a,function(t){e.callback=null,e.server_url=t,gi(e)}):"string"==typeof a&&""!==a?gi(e):dl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function hi(){"beacon"!==dl.para.send_type||pl.isSupportBeaconSend()||(dl.para.send_type="image")}function mi(){dl.on("sdkInitPara",function(){hi()}),dl.on("sdkAfterInitPara",function(){dl.registerInterceptor("sendDataStage",{send:{priority:110,entry:_i}})})}function vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bi(e,t,r){return vi(e,t,r),e.plugin_version=Hl,e}function wi(e){var t=new gl.AjaxSend(e);t.start()}function Si(e,t){var r=null,n=null;gl.isObject(e.config)&&(r=e.config.send_type,n=gl.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===fl.para.send_type;if(i&&gl.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=fl.kit.encodeTrackData(e.data),gl.isArray(a)&&a.length?gl.each(a,function(t){e.callback=null,e.server_url=t,wi(e)}):"string"==typeof a&&""!==a?wi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function ki(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function Pi(){fl.on("sdkInitPara",function(){ki()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:Si}})})}function Ci(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ni(e,t,r){return Ci(e,t,r),e.plugin_version=ql,e}function ji(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function Ii(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=null;hl.isObject(e.config)&&(r=hl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,hl.isArray(n)&&n.length?hl.each(n,function(t){t&&(e.data=ji(t,i),e.callback=null,e.server_url=t,Ii(e))}):"string"==typeof n&&""!==n?(e.data=ji(n,i),Ii(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ai(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function Di(){_l.on("sdkInitPara",function(){Ai()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function $i(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ei(e,t,r){return $i(e,t,r),e.plugin_version=_a,e}function Li(e){return null===zl?void Ui(e):void zl.push(e)}function Ui(e){try{if("log"===e.level&&Ri())return void Ji(e);if("warn"===e.level&&Bi())return void Ji(e);if("error"===e.level&&Hi())return void Ji(e)}catch(t){}}function Ri(){return!!Fi()||(Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level)}function Bi(){return!!Fi()||(Ri()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level)}function Hi(){return!!Fi()||(!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level)}function Ji(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Mi(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Mi(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function Ki(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Fi(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Vi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new d((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new d((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new d((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var p,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),p=5==n.a.length&&1===n.a[0],p&&(a(function(){p=!f('"\t"')}),p&&a(function(){p=1!==f("01")}),p&&a(function(){p=1!==f("1.")})))},function(){p=!1}),t=p}}return o[e]=!!t}function s(e){return D(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,d=n.Date||r.Date,p=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new d((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T="000000",A=function(e,t){return(T+(t||0)).slice(-e)},D=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],p=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;p(r+1,0)<=i;r++);for(n=c((i-p(r,0))/30.42);p(r,n+1)<=i;n++);i=1+i-p(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(D=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+A(6,r<0?-r:r):A(4,r))+"-"+A(2,n+1)+"-"+A(2,i)+"T"+A(2,o)+":"+A(2,s)+":"+A(2,l)+"."+A(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var $=i.stringify;i.stringify=function(e,t,r){var n=d.prototype.toJSON;d.prototype.toJSON=s;var i=$(e,t,r);return d.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=I[t];return r?r:x+A(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,p,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===d.prototype.toJSON?l=D(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),p=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,B));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++B);e+=a.slice(t,B)}if(34==a.charCodeAt(B))return B++,e;q();default:if(t=B,45==i&&(n=!0,i=a.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(B+1),i>=48&&i<=57)&&q(),n=!1;B=48&&i<=57);B++);if(46==a.charCodeAt(B)){for(r=++B;r57));r++);r==B&&q(),B=r}if(i=a.charCodeAt(B),101==i||69==i){for(i=a.charCodeAt(++B),43!=i&&45!=i||B++,r=B;r57));r++);r==B&&q(),B=r}return+a.slice(t,B)}n&&q();var s=a.slice(B,B+4);if("true"==s)return B+=4,!0;if("fals"==s&&101==a.charCodeAt(B+4))return B+=5,!1;if("null"==s)return B+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return B=0,H=""+e,r=F(K()),"$"!=K()&&q(),B=H=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Wi,zi={setup:function(e){Wi=e},log:function(){(Wi||console&&console.log||function(){}).apply(null,arguments)}},Xi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Xi.get(e))||null}catch(r){zi.log(r)}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){zi.log(r)}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Xi.set(t,r),Xi.get(t)!==r&&(e=!1),Xi.remove(t)}catch(n){e=!1}return e}},Zi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Xi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Xi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Xi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Xi.get(e)),Xi.remove(e),Xi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Xi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Xi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Xi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Xi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.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=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Qi=function(e){this.ele=e},Yi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Qi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(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,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.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),y(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||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=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 Yi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Yi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},ba={checkIsAddSign:function(e){"track"===e.type&&(Ae()?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(Vi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};va.isSupport()?va.set(Te("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):ya.set(ya.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Ae()||(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)}}},wa=function(){this._events=[],this.pendingEvents=[]};wa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(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():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Sa={data:{},id:function(){return this.data.id?this.data.id:(this.data.id=Ee(),this.data.id)},type:function(){return this.data.type?this.data.type:(this.data.type=xe(),this.data.type)}},ka={distinct_id:function(){},jssdkDebug:function(){},_sendDebug:function(e){},apph5:function(e){var t="app_h5\u6253\u901a\u5931\u8d25-",n={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"},i=e.output,a=e.step,o=e.data||"";"all"!==i&&"console"!==i||Oe(n[a]),("all"===i||"code"===i)&&r(pa.is_debug)&&pa.is_debug.apph5&&(o.type&&"profile"===o.type.slice(0,7)||(o.properties._jssdk_debug_info="apph5-"+String(a)))},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(g(e).protocol!==g(t).protocol)return!1}catch(r){return Ne("\u4e0d\u652f\u6301 _.URL \u65b9\u6cd5"),!1}return!0},serverUrl:function(){d(pa.server_url)&&""!==pa.server_url&&!this.protocolIsSame(pa.server_url,location.href)&&Ne("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){return e!==pa.server_url&&void(d(e)&&""!==e&&!this.protocolIsSame(e,location.href)&&Ne("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"))}}},Pa={initPage:function(){var e=Le(),t=Z(),r=Ie(t);r||ka.jssdkDebug("url_domain\u5f02\u5e38_"+t+"_"+r),this.pageProp={referrer:e,referrer_host:e?q(e):"",url:t,url_host:q(t,"url_host\u53d6\u503c\u5f02\u5e38"),url_domain:r}},pageProp:{},campaignParams:function(){return Vi.kit.getUtmData()},campaignParamsStandard:function(e,t){e=e||"",t=t||"";var r=Pa.campaignParams(),n={},i={};return k(r,function(r,a,o){(" "+ga+" ").indexOf(" "+a+" ")!==-1?n[e+a]=o[a]:i[t+a]=o[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,r={$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:_a};return r},currentProps:{},register:function(e){P(Pa.currentProps,e)}},Ca={},Oa=new l;Ca.spa=Oa,Ca.sdk=new l,Ca.data=new l,Ca.initSystemEvent=function(){Ye(function(e){Oa.emit("switch",e)})},Ca.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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var Na=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};Na.prototype.start=function(){var e=this,t=new Date;Ze({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(r,n){Ca.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){Ca.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},Na.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var ja="sawebjssdk-",Ia="tab-sawebjssdk-";tt.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()},pa.batch_send.send_interval)},getServerUrl:function(){return d(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),Xi.remove(e[n])}r=Ce(r),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=ja+String(n()),a=Xi.get(this.tabKey);null===a?(this.tabKey=Ia+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,Xi.set(this.tabKey,JSON.stringify(a)),Vi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Ia+String(n()),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var d=new a(n);d.get(s,r,1e3,function(e){if(e){null===Xi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Xi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Xi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var p=i(Xi.get(s))||{expireTime:0};t()-p.expireTime>r&&Xi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!d(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!d(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=xa._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},Ua={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ea[n])&&Ea[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ea[n])&&Ea[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ea[n])&&Ea[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){rt({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ea[i])&&Ea[i](n)),!0};rt({propertyValue:t},n)}):La.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ea[n])&&Ea[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ea[n])&&Ea[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=p(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ra.configIsMatchNew=function(e,t){if(d(e.$element_selector)&&d(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 e.$element_selector.indexOf(t.element_selector)>-1}if(d(e.$element_path)&&d(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 e.$element_path.indexOf(t.element_path)>-1}return!1},Ra.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"]?Ra.configIsMatchNew(e,t):Ra.configIsMatchOldVersion(e,t)))},Ra.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(Ra.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},Ra.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ra.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ra.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ra.getPropElInLi=function(e,t){if(!(e&&_(e)&&d(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Vi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ra.getProp=function(e,t){if(!r(e))return!1;if(!(d(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(d(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!d(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Vi.heatmap.getClosestLi(s);o=Ra.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!d(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ra.getAssignConfigs=function(e,t){var n=Ra.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ba={events:[],getAssignConfigs:Ra.getAssignConfigs,filterConfig:Ra.filterConfig,getProp:Ra.getProp,initUrl:Ra.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),d(a.event_name)&&n.push(a.event_name))}),Vi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Vi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Vi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ha={events:[],customProp:Ba,getAssignConfigs:Ra.getAssignConfigs,initUrl:Ra.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Vi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Vi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ja={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=qa.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Vi.heatmap.getEleDetail(e);if(!r(t)||!d(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,qa.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ra.getProp,getPropElInLi:Ra.getPropElInLi,filterConfig:Ra.filterConfig},qa={unlimitedDiv:Ja,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ma,initUrl:function(){var e=Ra.initUrl();if(e){var t;try{t=new f(Vi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Vi.para.heatmap)||!Vi.para.heatmap.get_vtrack_config)return!1;if(Xi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=xa.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Vi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Vi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Xa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Xa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(!d(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){var t=function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&d(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null};return t(e,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Vi.heatmap.getClosestLi(e);if(!i||!_(e)||!d(e.tagName))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Vi.is_heatmap_render_mode=!0,Vi.para.heatmap||(Vi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Vi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Vi.para.heatmap_url||(Vi.para.heatmap_url=ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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=We({target:e});r.$element_selector=t?t:"",r.$element_path=Vi.heatmap.getElementPath(e,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);var n=Vi.heatmap.getElementPosition(e,r.$element_path,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Vi.para.heatmap)&&e(Vi.para.heatmap.collect_element)&&!Vi.para.heatmap.collect_element(n))return!1;var s=Xa.getBasicEleInfo(t,n,i,a,o);mt(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Vi.para.heatmap&&Vi.para.heatmap.custom_property){var c=Vi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div?!!(r(Vi.para.heatmap)&&r(Vi.para.heatmap.collect_tags)&&r(Vi.para.heatmap.collect_tags.div)&&v(Vi.para.heatmap.collect_tags.div.ignore_tags)&&re(Vi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Vi.para&&Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Vi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.scroll_notice_map)return!1;var t=!0;Vi.para.scrollmap&&e(Vi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Vi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Vi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Vi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,vt(e)),this.current_time=n}});i.current_time=new Date,De(window,"scroll",function(){return!!t&&void i.go()}),De(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.clickmap)&&(e(Vi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Vi.para.heatmap.collect_url()}),"all"===Vi.para.heatmap.collect_elements?Vi.para.heatmap.collect_elements="all":Vi.para.heatmap.collect_elements="interact",void("all"===Vi.para.heatmap.collect_elements?De(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=d(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):De(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Vi.heatmap.getTargetElement(a,e);return!(!_(o)&&!d(a.tagName))&&void(_(o)&&d(o.tagName)?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Vi.para.heatmap)&&Vi.para.heatmap.get_vtrack_config&&Ja.events.length>0&&Ja.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"}))})))}},Za={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Vi.log("error: isReady callback must be function")},getUtm:function(){return Pa.campaignParams()},getStayTime:function(){return(new Date-Vi._t)/1e3},setProfileLocal:function(e){if(!Xi.isSupport())return Vi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=xa.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(xa.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Vi.setProfile(e))}else xa.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Vi.setProfile(e)},setInitReferrer:function(){var e=Le();Vi.setOnceProfile({_init_referrer:e,_init_referrer_host:Pa.pageProp.referrer_host})},setSessionReferrer:function(){var e=Le();xa.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:Pa.pageProp.referrer_host})},setDefaultAttr:function(){Pa.register({_current_url:location.href,_referrer:Le(),_referring_host:Pa.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Vi.para.heatmap&&Vi.para.heatmap.track_attr?Vi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Xa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Xa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Vi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,yt()),t),i=Z()}var i;i=this.autoTrackIsUsed?Pa.pageProp.url:Pa.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,bt(Vi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=yt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Vi.para.is_single_page&&w(function(){var r=Le(a,!0);Vi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Vi.track("$pageview",P({$referrer:Le(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),bt(Vi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(xa._state)?"SDK is not initialized.":xa.getAnonymousId()},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Vi.modules)&&Vi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Vi.use.apply(Vi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:It,unbind:Tt,trackLink:At,trackLinks:Dt,setItem:$t,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Bt,unsetProfile:Ht,identify:Jt,resetAnonymousIdentity:Mt,trackSignup:Kt,registerPage:Ft,clearAllRegister:Vt,clearPageRegister:Wt,register:zt,registerOnce:Xt,registerSession:Zt,registerSessionOnce:Gt,login:Qt,loginWithKey:Yt,logout:er,getPresetProperties:tr,readyState:Ga,debug:ka,on:et,log:Oe};zi.setup(Oe);var eo=P({},ua,Da),to={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:Vi.para.use_app_track_is_send!==!1&&"only"!==Vi.para.use_app_track,white_list:[],is_mui:"mui"===Vi.para.use_app_track};"object"==typeof Vi.para.app_js_bridge?Vi.para.app_js_bridge=P({},e,Vi.para.app_js_bridge):Vi.para.use_app_track!==!0&&Vi.para.app_js_bridge!==!0&&"only"!==Vi.para.use_app_track&&"mui"!==Vi.para.use_app_track||(Vi.para.app_js_bridge=P({},e)),Vi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Vi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ar};nr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),ir(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},nr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},nr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),ir(r)},or.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Vi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==F(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=F(e,"sa-request-id")||null,r=F(e,"sa-request-type")||null,n=F(e,"sa-request-url")||null;if(Xa.setNotice(n),aa.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Vi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Vi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Vi.heatmap_version&&Vi.heatmap_version===Vi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Vi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Xa.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=d(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&d(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return d(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Xa.setNotice(i),aa.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(lr("sa-visual-mode")===!0||"true"===lr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Vi.para.vtrack_url?Vi.para.vtrack_url:ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vtrack.min.js"})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(aa.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var t=e.data.data.userURL;d(t)&&(window.location.href=encodeURI(t.replace(/javascript:/i,"")))}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:_a}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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){}};vr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new mr(t,n,Vi),a=0;a=2)&&(wo&&(Or(!0),_r()),Ca.initSystemEvent(),Vi.setInitVar(),Vi.readyState.setState(2),Vi.initPara(e),Ca.sdk.emit("initPara"),Ca.sdk.emit("afterInitPara"),Ca.sdk.emit("initAPI"),Ca.sdk.emit("afterInitAPI"),Vi.detectMode(),rr(),Ca.sdk.emit("afterInit"),void Ca.sdk.emit("ready"))},wo?Or(!1):(Or(!0),_r());var So,ko,Po,Co,Oo,No,jo,Io,To,Ao,Do,$o,xo,Eo,Lo,Uo,Ro,Bo,Ho="1.26.9",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=Ir(Jo),qo="1.26.9",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=Dr(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:$r,visualized_track:xr,page_info:xr,sensorsdata_get_app_visual_config:Er}},Go="1.26.9",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Br()},handleCommand:Jr},Yo=Rr(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Mr,visualized_track:qr,page_info:qr,sensorsdata_get_app_visual_config:Kr}},as="1.26.9",os={init:function(e){Do=e,$o=Do&&Do._,xo=Do&&Do.log||console&&console.log||function(){},zr()},handleCommand:Zr},ss=Wr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.26.9",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"), +!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Ts.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Ts.data=e,Ts.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Ts.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Is(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(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=ps().visibilityChange,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},As=rn(Ts,"Deeplink","sdkReady"),Ds="1.26.9",$s={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},ln()},handleCommand:cn},xs=sn($s,"IOSBridge","sdkAfterInitPara"),Es="1.26.9",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},gn()}},Us=fn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.26.9",Bs=5e3,Hs=432e3;wn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},wn.prototype.log=function(e){this.sd&&this.sd.log(e)},wn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Bs)},wn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},wn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},wn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&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()}},wn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},wn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},wn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},wn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},wn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},wn.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()}})},wn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},wn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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()},wn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},wn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},wn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},wn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},wn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new wn,Ms=bn(Js,"PageLeave","sdkReady"),qs="1.26.9",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=Pn(Fs,"PageLoad","sdkReady");On.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Cn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.26.9";On.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new On,Gs=In(Zs),Qs="1.26.9",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=$n,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=Dn(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.26.9",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var p=u.indexOf("?");a=p>-1?o>-1?s+l+"#"+u.substring(1,o)+d(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+d(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,dl,pl,fl,gl,_l,hl,ml=Ln(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.26.9",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Bn(bl,"Utm","sdkAfterInitPara"),Sl="1.26.9",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=qn,Pl.enableSDK=Kn,Pl.getDisabled=Fn}},Ol=Mn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.26.9",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Qn()}},Il=zn(jl),Tl="1.26.9",Al={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ni()}},Dl=ti(Al),$l="1.26.9",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ci()}},Ll=si(El),Ul="1.26.9",Rl={plugin_name:"BeaconSender",init:function(e){dl=e,pl=dl._,mi()}},Bl=fi(Rl),Hl="1.26.9",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,Pi()}},Ml=bi(Jl),ql="1.26.9",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,Di()}},Fl=Ni(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Li),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e1)))/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;g(r+1,0)<=i;r++);for(n=c((i-g(r,0))/30.42);g(r,n+1)<=i;n++);i=1+i-g(r,n),s=c((a=(e%864e5+864e5)%864e5)/36e5)%24,o=c(a/6e4)%60,l=c(a/1e3)%60,d=a%1e3}}return(k=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+w(6,r<0?-r:r):w(4,r))+"-"+w(2,n+1)+"-"+w(2,i)+"T"+w(2,s)+":"+w(2,o)+":"+w(2,l)+"."+w(3,d)+"Z",r=n=i=s=o=l=d=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function P(e){return k(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=P;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var I=function(e){var t=e.charCodeAt(0),r=$[t];return r||"\\u00"+w(2,t.toString(16))},j=/[\x00-\x1f\x22\x5c]/g,C=function(e){return j.lastIndex=0,'"'+(j.test(e)?e.replace(j,I):e)+'"'},L=function(e,t,r,n,i,a,s){var o,d,u,p,f,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=k(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==g)return o===g?o:"null";switch("object"==(d=typeof o)&&(u=_.call(o)),u||d){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 C(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw c();if(s.push(o),p=[],y=a,a+=i,"[object Array]"==u){for(h=0,v=o.length;h0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||N();e+=x("0x"+a.slice(t,D));break;default:N()}else{if(34==i)break;for(i=a.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++D);e+=a.slice(t,D)}if(34==a.charCodeAt(D))return D++,e;N();default:if(t=D,45==i&&(n=!0,i=a.charCodeAt(++D)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(D+1))>=48&&i<=57&&N(),n=!1;D=48&&i<=57;D++);if(46==a.charCodeAt(D)){for(r=++D;r57);r++);r==D&&N(),D=r}if(101==(i=a.charCodeAt(D))||69==i){for(43!=(i=a.charCodeAt(++D))&&45!=i||D++,r=D;r57);r++);r==D&&N(),D=r}return+a.slice(t,D)}n&&N();var o=a.slice(D,D+4);if("true"==o)return D+=4,!0;if("fals"==o&&101==a.charCodeAt(D+4))return D+=5,!1;if("null"==o)return D+=4,null;N()}return"$"},U=function(e){var t,r;if("$"==e&&N(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=T());)r?","==e?"]"==(e=T())&&N():N():r=!0,","==e&&N(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=T());)r?","==e?"}"==(e=T())&&N():N():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==T()||N(),t[e.slice(1)]=U(T());return t}N()}return e},R=function(e,t,r){var n=B(e,t,r);n===g?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(_,S,i);else S(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return D=0,E=""+e,r=U(T()),"$"!=T()&&N(),D=E=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){e=String(e);for(var t,r,i,a,s="",o=0,l=e.length%3;o255||(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>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 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(r){logger.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){logger.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";_localStorage.set(t,r),_localStorage.get(t)!==r&&(e=!1),_localStorage.remove(t)}catch(n){e=!1}return e}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function getRandom(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),isObject(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(r){}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(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),n=0;n Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");for(var a in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function _URL(e){var t,r={};if("function"==typeof window.URL&&function(){try{return"https://www.sensorsdata.cn/"===new URL("https://www.sensorsdata.cn/").href}catch(e){return!1}}())(r=new URL(e)).searchParams||(r.searchParams=(t=getURLSearchParams(r.search),{get:function(e){return t[e]}}));else{isString(e)||(e=String(e)),e=trim(e);if(!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");var n=urlParse(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=getURLSearchParams("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}ConcurrentStorage.prototype.get=function(e,t,r,n){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,n=n||function(){};var i=this.lockGetPrefix+e,a=_localStorage.get(i),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return n(null);_localStorage.set(i,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(i))||{randomNum:0,expireTime:0})&&a.randomNum===s?(n(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(i)):n(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,n,i){if(!e||!t)throw new Error("key and val is must");r=r||1e4,n=n||1e3,i=i||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 i({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)&&i({status:"success"}):i({status:"fail",reason:"This key is locked"})},n)},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 n=0,i=r.length;n=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+t+"-"+e();return r||(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,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()||ry(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||a.target;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 addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(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){logger.log(t)}}}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(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument.documentElement;return{top:e.top+window.pageYOffset-t.clientTop,left:e.left+window.pageXOffset-t.clientLeft}}catch(r){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),ry(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||!isArray(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 siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return ry(e=e&&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(),n=[],i=0;i=200&&r.status<300||304==r.status?e.success(t(r.responseText),r.status):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),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(s){logger.log(s)}r.send(e.data||null)}function map(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(each(e,function(e,n,i){r.push(t(e,n,i))}),r)}function base64Decode(e){var t=[];try{t=map(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 base64Encode(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}function bindReady(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,s=i.addEventListener,o=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",d=s?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](d+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},u=function(){try{a.doScroll("left")}catch(e){return void setTimeout(u,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!s&&a.doScroll){try{n=!t.frameElement}catch(p){logger.log(p)}n&&u()}i[o](d+"DOMContentLoaded",c,!1),i[o](d+"readystatechange",c,!1),t[o](d+"load",c,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,-1!==document.cookie.indexOf(t+"=true")){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function getDomBySelector(e){if(!isString(e))return null;var t,r=e.split(">");return(t=function n(e){var t,i=r.shift();if(!i)return e;try{t=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(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(!(isElement(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l0)return null}return r||null}(i,e)}catch(a){logger.log(a)}return t&&isElement(t)?n(t):null}())&&isElement(t)?t:null}function getElementContent(e,t){var r="",n="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(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 getHostname(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=_URL(e).hostname}catch(n){logger.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}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(t){return""}}function getQueryParamsFromUrl(e){var t={},r=e.split("?")[1]||"";return r&&(t=getURLSearchParams("?"+r)),t}function getQueryParam(e,t){var r=_URL(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i)n=getQueryParamsFromUrl(i)[t]||""}return n}function mediaQueriesSupported(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function getScreenOrientation(){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(mediaQueriesSupported()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return 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,n=0;n0)for(var i=e.split(""),a=0;at)for(n=r+n;(o=31*n+s)t;)n=n/2+s;n=31*n+s}return n}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function isSupportCors(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(e){if(!isObject(e)||!isString(e.callbackName))return logger.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=isFunction(e.success)?e.success:function(){},e.error=isFunction(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),r=document.getElementsByTagName("head")[0],n=null,i=!1;if(t.defer="defer",r.appendChild(t),isNumber(e.timeout)){var a=Math.min(e.timeout,3e5);n=setTimeout(function(){if(i)return!1;e.error("timeout"),window[e.callbackName]=function(){logger.log("call jsonp error")},n=null,r.removeChild(t),i=!0},a)}if(window[e.callbackName]=function(){clearTimeout(n),n=null,e.success.apply(null,arguments),window[e.callbackName]=function(){logger.log("call jsonp error")},r.removeChild(t)},e.url.indexOf("?")>-1?e.url+="&callbackName="+e.callbackName:e.url+="?callbackName="+e.callbackName,isObject(e.data)){var s=[];each(e.data,function(e,t){s.push(t+"="+e)}),e.data=s.join("&"),e.url+="&"+e.data}t.onerror=function(a){if(i)return!1;window[e.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(n),n=null,r.removeChild(t),e.error(a),i=!0},t.src=encodeURI(e.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"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;addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else 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(""),n=0,i=r.length;nt?(s&&(clearTimeout(s),s=null),o=d,a=e.apply(n,i),s||(n=i=null)):s||!1===r.trailing||(s=setTimeout(l,c)),a}}function values(e){var t=[];return null==e?t:(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=[],n={},i=0;it._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_"+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,n=saCookie.get("sensorsdata2015jssdkcross"+sd.para.sdk_id),i={};null!=(n=sd.kit.userDecryptIfNeeded(n))&&isJSONString(n)&&(i=JSON.parse(n)).$device_id&&(r=i.$device_id),r=r||e,!0===sd.para.cross_subdomain?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),sd.para.encrypt_cookie&&(i=sd.kit.userEncrypt(i)),saCookie.set("sensorsdata2015jssdkcross"+sd.para.sdk_id,i,null,!0)),sd.para.is_track_device_id&&(pageInfo.currentProps.$device_id=r)},storeInitCheck:function(){if(sd.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else 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 n=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t&&(n=!0),addEvent(e,t,r,n)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function getSourceFromReferrer(){function e(e,t){for(var r=0;r20&&this.pendingEvents.shift()},on:function(e,t,r,n){isFunction(t)&&(this._events.push({type:e,callback:t,context:r||this}),n=!1!==n,this.pendingEvents.length>0&&n&&each(this.pendingEvents,function(n){n.type===e&&t.apply(r,n.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var ee={},spa=new EventEmitter;function eventEmitterFacade(e,t){var r=[];"string"==typeof e&&e in ee.EVENT_LIST&&(r=ee.EVENT_LIST[e],ee[r[0]].on(r[1],t))}ee.spa=spa,ee.sdk=new EventEmitter,ee.data=new EventEmitter,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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var AjaxSend=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};AjaxSend.prototype.start=function(){var e=this,t=new Date;ajax$1({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:sdPara.datasend_timeout,cors:!0,success:function(r,n){ee.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:sdPara.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){ee.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:sdPara.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},AjaxSend.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 dataStoragePrefix="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.server_url)&&""!==sdPara.server_url||isArray(sdPara.server_url)&&sdPara.server_url.length))return sdError("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01");this.serverUrl=isArray(sdPara.server_url)?sdPara.server_url[0]:sdPara.server_url},send:function(){if(this.sendTimeStamp&&now()-this.sendTimeStamp-1&&r.splice(i,1),_localStorage.remove(e[n])}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);null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),r=this.generateTabStorageVal()):r=safeJSONParse(r)||this.generateTabStorageVal(),r.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=0;ti.expireTime&&this.serverUrl===i.serverUrl)new ConcurrentStorage("sajssdk-lock-get-").get(r,1e4,1e3,function(e){if(e){null===_localStorage.get(n.tabKey)&&n.generateTabStorage();var t=safeJSONParse(e)||n.generateTabStorageVal(),r=safeJSONParse(_localStorage.get(n.tabKey))||n.generateTabStorageVal();r.data=unique(r.data.concat(t.data)),_localStorage.set(n.tabKey,JSON.stringify(r))}})}else if(0===r.indexOf("sajssdk-lock-get-")){var s=safeJSONParse(_localStorage.get(r))||{expireTime:0};now()-s.expireTime>1e4&&_localStorage.remove(r)}}for(var o=0;o0)for(t=0;tsdPara.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!(indexOf(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(indexOf(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=store._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(indexOf(this.bindReservedNames,e)>-1)}},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||("Property Value",isFunction(checkLog[r])&&checkLog[r]("Property Value")),!0}},properties:function(e){return isObject(e)?each(e,function(e,t){check({propertyKey:t});check({propertyValue:e},function(e,r,n){return e||(r=t+"'s Value",isFunction(checkLog[n])&&checkLog[n](r)),!0})}):ruleOption.voidZero(e)&&sdWarn("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return e!==undefined&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdWarn("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!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 n=this[e];if(isFunction(n))return n.call(this,t);if(!n)return!1;for(var i=0;i-1;if(isObject(r)&&"$option"!==n&&!a)try{e[n]=JSON.stringify(r)}catch(s){delete e[n],sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else isString(r)||isNumber(r)||isDate(r)||isBoolean(r)||isArray(r)||isFunction(r)||"$option"===n||a||(sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete e[n])}),e):e}function formatString(e,t){return isNumber(t)&&e.length>t?(sdWarn("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function filterReservedProperties(e,t){isObject(e)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(r,n){r in e&&(indexOf(t||[],r)>-1||(n<3?(delete e[r],sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function searchObjString(e){var t=["$element_selector","$element_path"],r=["sensorsdata_app_visual_properties"];isObject(e)&&each(e,function(n,i){if(isObject(n))searchObjString(e[i]);else if(isString(n)){if(indexOf(r,i)>-1)return;e[i]=formatString(n,indexOf(t,i)>-1?1024:sdPara.max_string_length)}})}function searchZZAppStyle(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(e){if("item_type"in e){check({item_type:e.item_type},function(t){return t||delete e.item_type,!0})}if("item_id"in e){check({item_id:e.item_id},function(t,r,n){return t||"string"!==n||delete e.item_id,!0})}}function formatProperties(e,t){each(e,function(r,n){-1===indexOf(t||[],n)&&check({propertyKey:n},function(t,r,i){return t||"keyLength"===i||delete e[n],!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){var r=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(),r.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={server_url:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.server_url))return sdError("----vcollect---server_url\u5fc5\u987b\u4e3a\u6709\u6548 URL \u5b57\u7b26\u4e32"),!1;try{e=_URL(sd.para.server_url),r.server_url.project=e.searchParams.get("project")||"default",r.server_url.host=e.host}catch(n){return sdError("----vcollect---server_url\u89e3\u6790\u5f02\u5e38",n),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(n){return sdError("----vcollect---\u9875\u9762\u5730\u5740\u89e3\u6790\u5f02\u5e38",n),!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 e.$element_selector.indexOf(t.element_selector)>-1}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 e.$element_path.indexOf(t.element_path)>-1}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(e.$element_position!==undefined){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(e,t,r){var n=[];if(!r){var i=vtrackBase.initUrl();if(!i)return[];r=i.page_url}return"$WebClick"===e.event&&each(t,function(t){isObject(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&isObject(t.event)&&t.event.url_host===r.host&&t.event.url_path===r.pathname&&vtrackBase.configIsMatch(e.properties,t.event)&&n.push(t)}),n},getPropElInLi:function(e,t){if(!(e&&isElement(e)&&isString(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r=sd.heatmap.getDomSelector(e);if(r){var n=getDomBySelector(r+t);return n||null}return sdWarn("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",r,t),null},getProp:function(e,t){if(!isObject(e))return!1;if(!(isString(e.name)&&e.name.length>0))return sdWarn("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var r,n,i={};if("content"===e.method){var a;if(isString(e.element_selector)&&e.element_selector.length>0)a=getDomBySelector(e.element_selector);else{if(!t||!isString(e.list_selector))return sdWarn("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=getDomBySelector(t.properties.$element_selector);if(!s)return sdWarn("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var o=sd.heatmap.getClosestLi(s);a=vtrackBase.getPropElInLi(o,e.list_selector)}if(!a||!isElement(a))return sdWarn("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===a.tagName.toLowerCase())r=a.value||"";else if("select"===a.tagName.toLowerCase()){var l=a.selectedIndex;isNumber(l)&&isElement(a[l])&&(r=getElementContent$1(a[l],"select"))}else r=getElementContent$1(a,a.tagName.toLowerCase());if(e.regular){try{n=new RegExp(e.regular).exec(r)}catch(d){return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===n)return sdWarn("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!isArray(n)||!isString(n[0]))return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;r=n[0]}if("STRING"===e.type)i[e.name]=r;else if("NUMBER"===e.type){if(r.length<1)return sdWarn("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;if(isNaN(Number(r)))return sdWarn("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;i[e.name]=Number(r)}return i}return sdError("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},getAssignConfigs:function(e,t){var r=vtrackBase.initUrl();if(!r||!r.page_url)return[];if(!isObject(t))return[];var n=[];return t.events=t.events||t.eventList,isArray(t.events)&&t.events.length>0?(each(t.events,function(t){isObject(t)&&isObject(t.event)&&t.event.url_host===r.page_url.host&&t.event.url_path===r.page_url.pathname&&e(t)&&n.push(t)}),n):[]}},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(e){var t={},r=[],n=this;if(!this.events.length)return{};if("$WebClick"===e.event){var i=this.filterConfig(e,this.events);if(!i.length)return{};each(i,function(i){isObject(i)&&(isArray(i.properties)&&i.properties.length>0&&each(i.properties,function(r){if(isObject(r))if(!1===r.h5)isArray(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(r);else{var i=n.getProp(r,e);isObject(i)&&(t=extend(t,i))}}),isString(i.event_name)&&r.push(i.event_name))}),sd.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=r)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new sd.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(r){var n={};try{r=JSON.parse(base64Decode(r))}catch(s){sdError("getJSVisualProperties data parse error!")}if(isObject(r)){var i=r.sensorsdata_js_visual_properties,a=e.initUrl();a&&(a=a.page_url,isArray(i)&&i.length>0&&each(i,function(t){if(isObject(t)&&t.url_host===a.host&&t.url_path===a.pathname&&t.h5){var r=e.getProp(t);isObject(r)&&(n=extend(n,r))}}))}return"android"===sd.bridge.bridge_info.platform&&t.notifyApp({data:n},r.message_id),n}),t}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(base64Decode(t))}catch(r){return void sdError("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(base64Decode(e))}catch(t){e=null,sdError("getAppVisualConfig result parse error\uff01")}return e},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))return!1;for(var r=0;r0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,r){var n=this;r=r||this.filterConfig(e,t,vtrackcollect.url_info.page_url);var i={};return r.length?(each(r,function(t){isArray(t.properties)&&t.properties.length>0&&each(t.properties,function(t){var r=n.getProp(t,e);isObject(r)&&extend(i,r)})}),i):{}},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=vtrackBase.initUrl();if(e){var t;try{(t=new urlParse(sd.para.server_url))._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return sdError("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)return!1;if(_localStorage.isSupport()||(this.storageEnable=!1),!this.initUrl())return sdError("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=store.readObjectVal(this.storage_name);if(isObject(e)&&isObject(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime()-this.update_time;if(isNumber(t)&&t>0&&t0&&t-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===i&&sd.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)&&((sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1)>1||r.isCollectableDiv(n)))return n;if(r.isStyleTag(i)&&sd.para.heatmap.collect_tags.div){var o=r.getCollectableParent(n);if(o&&r.isDivLevelValid(o))return o}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var r=heatmap.getElementPath(e,!0,t).split(" > "),n=0;return each(r,function(e){"div"===e&&n++}),n},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(heatmap.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&isElement(e);){if(!isString(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){return function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&isString(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null}(e,"li")},getElementPosition:function(e,t,r){var n=sd.heatmap.getClosestLi(e);if(!n||!isElement(e)||!isString(e.tagName))return null;var i=e.tagName.toLowerCase(),a=n.getElementsByTagName(i),s=a.length,o=[];if(s>1){for(var l=0;l1)return indexOf(o,e)}return function(e){if(!e.parentNode)return"";if(1===ry(e).getSameTypeSiblings().length)return 0;for(var t=0,r=e;ry(r).previousElementSibling().ele;r=ry(r).previousElementSibling().ele,t++);return t}(n)},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),sd.para.heatmap_url||(sd.para.heatmap_url=getSafeHttpProtocol()+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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});r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);var n=sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);return isNumber(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){if(!e)return{};function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}return function(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,s=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(s)}}(e)},start:function(e,t,r,n,i){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collect_element)&&!sd.para.heatmap.collect_element(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,n,i))},getBasicEleInfo:function(e,t,r,n,i){var a=isObject(n)?n:{},s=isFunction(i)?i:isFunction(n)?n:undefined,o=this.getEleDetail(t);if(sd.para.heatmap&&sd.para.heatmap.custom_property){var l=sd.para.heatmap.custom_property(t);isObject(l)&&(o=extend(o,l))}return{event:e,target:t,props:o=extend(o,this.getPointerEventProp(e,t),a),tagName:r,callback:s}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=ry(e.element).getParents());if(r&&isArray(r)&&r.length>0)for(var i=0;i-1)&&(!t||sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collect_tags)&&isObject(sd.para.heatmap.collect_tags.div)&&isArray(sd.para.heatmap.collect_tags.div.ignore_tags)&&indexOf(sd.para.heatmap.collect_tags.div.ignore_tags,e)>-1):indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){sdError("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=sd.para&&sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){sdError("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.scroll_notice_map)return!1;var e=!0;sd.para.scrollmap&&isFunction(sd.para.scrollmap.collect_url)&&this.listenUrlChange(function(){e=!!sd.para.scrollmap.collect_url()});var t=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t}({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>sd.para.heatmap.scroll_delay_time&&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.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=n}});t.current_time=new Date,saAddEvent(window,"scroll",function(){if(!e)return!1;t.go()}),saAddEvent(window,"unload",function(){if(!e)return!1;t.go("notime")})},initHeatmap:function(){var e=this,t=!0;if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)return!1;isFunction(sd.para.heatmap.collect_url)&&this.listenUrlChange(function(){t=!!sd.para.heatmap.collect_url()}),"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(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var s=isString(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===s||"button"===s?e.start(n,i.parentNode,s):e.start(n,i,a)}):saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement,a=sd.heatmap.getTargetElement(i,r);if(!isElement(a)&&!isString(i.tagName))return!1;isElement(a)&&isString(a.tagName)?e.start(n,a,a.tagName.toLowerCase()):isElement(i)&&"div"===i.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&unlimitedDiv.events.length>0&&unlimitedDiv.isTargetEle(i)&&e.start(n,i,i.tagName.toLowerCase(),{$lib_method:"vtrack"})})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),t={};return each(e,function(e,r,n){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+r+" ")?t["$"+r]=n[r]:t[r]=n[r]}),t}function sendFirstProfile(e,t,r){if(sd.is_first_visitor&&r){var n={};sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(n.$search_keyword_id=getBaiduKeyword.id(),n.$search_keyword_id_type=getBaiduKeyword.type(),n.$search_keyword_id_hash=hashCode53(n.$search_keyword_id));var i=getReferrer(null,t);e(extend({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?getHostname(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),n)),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.setProfile(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("sensorsdata_2015_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var n in e)!(n in t&&t[n]!==e[n])&&n in t||(t[n]=e[n],r=!0);r&&(store.saveObjectVal("sensorsdata_2015_jssdk_profile",t),sd.setProfile(e))}else store.saveObjectVal("sensorsdata_2015_jssdk_profile",e),sd.setProfile(e)},setInitReferrer:function(){var e=getReferrer();sd.setOnceProfile({_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){if("object"==typeof e&&e.tagName&&isElement(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||hasAttributes(e,a)||heatmap.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();heatmap.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){var r;r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer;var n=!(e=isObject(e)?e:{}).not_set_profile;function i(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,i(e,t),this.autoTrackSinglePage=i,sendFirstProfile(sd.setOnceProfile,!1,n)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=isObject(e)?e:{};var r=getClassifiedUtms(),n=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var i=location.href;sd.para.is_single_page&&addHashEvent(function(){var n=getReferrer(i,!0);sd.track("$pageview",extend({$referrer:n,$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),i=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),sendFirstProfile(sd.setOnceProfile,!0,n),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store.getAnonymousId()},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]?e(window.SensorsDataWebJSSDKPlugin[t]):isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sdWarn(t+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function loginBody(e,t){var r=e.id,n=e.callback,i=e.name,a=store.getFirstId(),s=store.getOriginDistinctId();if(!check({distinct_id:r}))return sdError("login id is invalid"),!1;if(r===store.getOriginDistinctId()&&!a)return sdError("login id is equal to distinct_id"),!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(i)&&r===store._state.first_id)return!1;if(store._state.history_login_id.name!==i||r!==store._state.history_login_id.value){store._state.identities[i]=r,store.set("history_login_id",{name:i,value:r}),a||store.set("first_id",s),t(r,"$SignUp",{},n);var o={$identity_cookie_id:store._state.identities.$identity_cookie_id};return o[i]=r,resetIdentities(o),!0}return!1}function resetIdentities(e){var t={};for(var r in e)t[r]=e[r];store._state.identities=t,store.save()}function deleteBindIDData(e,t){if(!check({unbindKey:e,bindValue:t}))return!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t){var r=store.getUnionId().login_id;r&&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())}var n={};return n[e]=t,n}function setInitVar(){sd._t=sd._t||1*new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var n in sd.para.is_track_latest)r["latest_"+n]=sd.para.is_track_latest[n];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 i=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],o={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof sd.para.source_type&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(i):i,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(a):a,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(s):s,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(o,sd.para.source_type.keyword):o);var l=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)){sd.para.heatmap.clickmap=sd.para.heatmap.clickmap||"default",sd.para.heatmap.scroll_notice_map=sd.para.heatmap.scroll_notice_map||"default",sd.para.heatmap.scroll_delay_time=sd.para.heatmap.scroll_delay_time||4e3,sd.para.heatmap.scroll_event_duration=sd.para.heatmap.scroll_event_duration||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);var d=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),sd.para.heatmap.track_attr=d,isObject(sd.para.heatmap.collect_tags))if(!0===sd.para.heatmap.collect_tags.div)sd.para.heatmap.collect_tags.div={ignore_tags:l,max_level:1};else if(isObject(sd.para.heatmap.collect_tags.div)){if(sd.para.heatmap.collect_tags.div.ignore_tags?isArray(sd.para.heatmap.collect_tags.div.ignore_tags)||(sdWarn("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),sd.para.heatmap.collect_tags.div.ignore_tags=l):sd.para.heatmap.collect_tags.div.ignore_tags=l,sd.para.heatmap.collect_tags.div.max_level){-1===indexOf([1,2,3],sd.para.heatmap.collect_tags.div.max_level)&&(sd.para.heatmap.collect_tags.div.max_level=1)}}else sd.para.heatmap.collect_tags.div=!1;else sd.para.heatmap.collect_tags={div:!1}}sd.para.server_url=optimizeServerUrl(sd.para.server_url),!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.collect_tags&&isObject(sd.para.heatmap.collect_tags)&&each(sd.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&"default"===sd.para.heatmap.clickmap&&sd.heatmap.initUnlimitedTags()}var readyState={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},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):sdWarn("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0])}var nonameCount=1;function use(e,t){if(isString(e)||isObject(e)){var r;if(isObject(e)){var n=sd.modules&&sd.modules[e.plugin_name];n&&n!==e&&sdWarn(e.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),r=n||e}return 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.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[e]&&(r=window.sensorsDataAnalytic201505.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||sdWarn("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&sdWarn("warning: plugin version not match SDK version. plugin may not work correctly. "):sdWarn("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,r):(sdWarn((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),r)}sdError("use's first arguments must be string or object.")}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){var r=deleteBindIDData(e,t);r&&saEvent.send({identities:r,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(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void saAddEvent(e,"click",function(n){n.preventDefault();var i=!1;function a(){i||(i=!0,location.href=e.href)}setTimeout(a,1e3),sd.track(t,r,a)}))}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 setProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function setOnceProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function appendProfile(e,t){check({propertiesMust:e})&&(each(e,function(t,r){isString(t)?e[r]=[t]:isArray(t)?e[r]=t:(delete e[r],sdWarn("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),isEmptyObject(e)||saEvent.send({type:"profile_append",properties:e},t))}function incrementProfile(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!1;return!0}(e)?sdError("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"):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,n={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?n[e]=!0:sdWarn("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),saEvent.send({type:"profile_unset",properties:n},t)):sdError("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function identify(e){"number"==typeof e&&(e=String(e));var t=store.getFirstId();if(void 0===e){var r=UUID();t?store.set("first_id",r):store.set("distinct_id",r)}else check({distinct_id:e})&&(t?store.set("first_id",e):store.set("distinct_id",e))}function resetAnonymousIdentity(e){if(store.getFirstId())return sdError("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),void 0===e){var t=UUID();store._state.identities.$identity_cookie_id=t,store.set("distinct_id",t)}else check({distinct_id:e})&&(store._state.identities.$identity_cookie_id=e,store.set("distinct_id",e))}function sendSignup(e,t,r,n){var i=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:i,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function trackSignup(e,t,r,n){"number"==typeof e&&(e=String(e)),check({distinct_id:e,event:t,properties:r})&&sendSignup(e,t,r,n)}function registerPage(e){check({properties:e})?extend(pageInfo.currentProps,e):sdError("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){var t;if(isArray(e)&&e.length>0)for(t=0;t-1?n:"https:")+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/vapph5define.min.js"})}else r();else r()}function listenSinglePage(e){sd.para.is_track_single_page&&spa.on("switch",function(t){var r=function(r){if(r=r||{},t!==location.href){pageInfo.pageProp.referrer=getURL(t);var n=extend({$url:getURL(),$referrer:getURL(t)},r);isFunction(e)?e(n):sd.quick&&sd.quick("autoTrack",n)}};if("boolean"==typeof sd.para.is_track_single_page)r();else if("function"==typeof sd.para.is_track_single_page){var n=sd.para.is_track_single_page();isObject(n)?r(n):!0===n&&r()}})}function enterFullTrack(){sd._q&&isArray(sd._q)&&sd._q.length>0&&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","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","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=[]),sdWarn("calling sdk api before init is deprecated."),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);sdError("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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 n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},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)&&r.length>0)for(var n={current:0,total:r.length},i=new InterceptorContext(t,n,sd),a=0;a=2)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="1.26.8";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return"dfm-enc-"+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf("dfm-enc-")&&(e=e.substring("dfm-enc-".length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="1.26.8";function wrapPluginInitFn$1(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$1(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$1(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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 t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),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="1.26.8";function wrapPluginInitFn$2(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$2(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$2(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(),log("---test---fail---",!sd$1,sd$1.bridge.activeBridge,!anServerUrl),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),log("---test---bridge-verify-",sd$1.bridge.is_verify_success)),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("---test---app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){if(log("---test---datasend-",sd$1.bridge.is_verify_success),sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$1.bridge.is_verify_success?(log("---test---bridge-verify-success---",e.data),anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({server_url:sd$1.para.server_url},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(log("---test---bridge-verify-fail-----",sd$1.bridge.is_verify_success),sd$1.para.app_js_bridge.is_send?(sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_$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="1.26.8";function wrapPluginInitFn$3(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$3(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$3(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(){if(log$1("ObsoleteBridge---test---init---"),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,log$1("ObsoleteBridge-",sd$2.bridge.activeBridge,anVerify,anTrack$1,anVisualVerify),sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)){sd$2.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack$1;anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({server_url:sd$2.para.server_url})),log$1("ObsoleteBridge---called-return",e)),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){if(log$1("ObsoleteBridge---senddata"),sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(anVerify){var n=anVerify&&anVerify.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data)));return log$1("ObsoleteBridge---anVerify-success",n),n?(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$2.para.app_js_bridge.is_send?(sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return log$1("ObsoleteBridge---is-send-old-way",sd$2.para.app_js_bridge.is_send),anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function handleCommand$1(e){log$1("ObsoleteBridge---handleCommadn");var t=e.callType;return t in vbridge$1$1.commands?(log$1("ObsoleteBridge---",t,vbridge$1$1.commands),vbridge$1$1.commands[t](e,anBridge$1)):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?(log$1("ObsoleteBridge---handleCommadn-abridge"),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="1.26.8";function wrapPluginInitFn$4(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$4(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$4(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var hidden,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||"sensorsdata2015jssdkchannel",sd$3=e;var r=this;!function(){if(_$3=sd$3._,store$1=sd$3.store,!_$3.localStorage.isSupport())return!1;sd$3.para.max_string_length=1024,r.eventList.init(),r.addLatestChannelUrl(),r.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd$3.registerPage({$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();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_$3.isReferralTraffic(document.referrer)){var r=_$3.getQueryParam(location.href,"sat_cf");_$3.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd$3.registerPage(t):sd$3.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd$3.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name));return e=_$3.safeJSONParse(e),!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);sd$3.para.encrypt_cookie&&(r=sd$3.kit.userEncrypt(r)),_$3.cookie.set(cookie_name,r)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$5(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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"undefined"!=typeof document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var iosServerUrl,iosTracker,sd$4,_$4,log$2,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){var t=e._.URL(e.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},handleAndroidLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=t;e.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,e.timer=setTimeout(function(){var t=isPageHidden();if(e.log("hide:"+hidden+":"+document[hidden]),t)return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=r},e.timeout)},handleIOSLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 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\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),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){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=e,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&isObject$1(arguments[0])?t=arguments[0]:arguments.length>=2&&isObject$1(arguments[1])&&(t=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=parseShortURL(n);if(!i)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f 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,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="1.26.8";function wrapPluginInitFn$6(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$6(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$6(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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){if(sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({server_url:sd$4.para.server_url},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$4.para.app_js_bridge.is_send?(sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_$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="1.26.8";function wrapPluginInitFn$7(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$7(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$7(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=_$5.URL(sd$5.para.server_url).hostname,r=_$5.URL(sd$5.para.server_url).searchParams.get("project")||"default"}catch(n){sd$5.log(n)}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)return e;var r,n,i=e.callback;if(sd$5.bridge.bridge_info.verify_success){var a=document.createElement("iframe"),s=(r=e.data,n=(n=JSON.stringify(_$5.extend({server_url:sd$5.para.server_url},r))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return a.setAttribute("src",s),document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null,_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),!0}return sd$5.para.app_js_bridge.is_send?(sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),e)}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="1.26.8";function wrapPluginInitFn$8(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$8(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$8(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}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\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},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(){if(!0!==this.page_hidden_status){var 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 e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.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;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},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;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var r=this.sd.store.readObjectVal(t);this._.isObject(r)&&1*new Date-r.time>r.heartbeat_interval_time+5e3&&(delete r.heartbeat_interval_time,r._flush_time=(new Date).getTime(),this.sd.kit.sendData(r),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="1.26.8";function wrapPluginInitFn$9(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$9(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$9(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){function r(){var n=0,i=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,a={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(i?(n=function(t){var r=0;return e._.isFunction(t.getEntriesByType)&&(r=((t.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),r}(i)||function(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}(i),function(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}(i,a)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),n>0){var s=e._.isObject(t)&&t.max_duration||1800;n=Number((n/1e3).toFixed(3)),(!e._.isNumber(s)||s<=0||n<=s)&&(a.event_duration=n)}eventSent||(e.track("$WebPageLoad",a),eventSent=!0),window.removeEventListener?window.removeEventListener("load",r):window.detachEvent&&window.detachEvent("onload",r)}"complete"==document.readyState?r():window.addEventListener?window.addEventListener("load",r):window.attachEvent&&window.attachEvent("onload",r)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),s=t.customRegister,o=a.properties,l=a.event,d={};return n.each(s,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(d=n.extend(d,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:o,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(d=n.extend(d,t))}}),e.properties=n.extend(o,d),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder$b="1.26.8";function wrapPluginInitFn$a(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$a(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$a(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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="1.26.8";function wrapPluginInitFn$b(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$b(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$b(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(i){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}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 \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="1.26.8";function wrapPluginInitFn$c(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$c(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$c(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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-1)return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r-1)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=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),i="";if(n){var a,s=n[1]||"",o=n[2]||"",l=n[3]||"",d="_sasdk="+this.getCurrenId(),c=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(d):n.push(e)}),n.join("&")};if(this.getPartHash(e))a=l.indexOf("_sasdk"),i=l.indexOf("?")>-1?a>-1?s+o+"#"+l.substring(1,a)+c(l.substring(a,l.length)):s+o+l+"&"+d:s+o+"#"+l.substring(1)+"?"+d;else a=o.indexOf("_sasdk"),i=/^\?(\w)+/.test(o)?a>-1?s+"?"+c(o.substring(1))+l:s+o+"&"+d+l:s+"?"+d+l;return t&&(t.href=i),i}},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},setRefferId:function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);(r=r.substring(1))!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},addListen:function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),s=i.parentNode;if("a"===a&&i.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===a&&i.href?(r=i.href,n=i):(r=s.href,n=s);var o=e._.URL(r).protocol;"http:"!==o&&"https:"!==o||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},init:function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var r=t.length,n=[],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$d(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(){return function(){var e=source_channel_standard$1.split(" "),t="",r={};sd$6._.isArray(sd$6.para.source_channel)&&sd$6.para.source_channel.length>0&&(e=e.concat(sd$6.para.source_channel),e=sd$6._.unique(e));return 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="1.26.8";function wrapPluginInitFn$e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$e(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$e(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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="1.26.8";function wrapPluginInitFn$f(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$f(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$f(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData$4(e,t){if(!0===sd$8.para.debug_mode){var r=e.data;e.callback;debugPath(JSON.stringify(r)),t.cancellationToken.stop()}return 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.server_url)?sd$8.para.debug_mode_url=sd$8.para.server_url.replace("sa.gif","debug"):_$6.isArray(sd$8.para.server_url)&&_$6.isString(sd$8.para.server_url[0])?sd$8.para.debug_mode_url=sd$8.para.server_url[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="1.26.8";function wrapPluginInitFn$g(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$g(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$g(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){if(_$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()}return 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){if(!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData){sd$9.para.jsapp.isOnline=!0;var t=sd$9.para.jsapp.getData();_$7.isArray(t)&&t.length>0&&_$7.each(t,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})}else 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="1.26.8";function wrapPluginInitFn$h(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$h(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$h(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$i(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){var r=null,n=null;if(_$9.isObject(e.config)&&(r=e.config.send_type,n=_$9.optimizeServerUrl(e.config.server_url)),("beacon"===r||!r&&"beacon"===sd$b.para.send_type)&&_$9.isSupportBeaconSend()){var i=n||e.server_url;e.server_url=i,e.data=sd$b.kit.encodeTrackData(e.data),_$9.isArray(i)&&i.length?_$9.each(i,function(t){e.callback=null,e.server_url=t,sendData$7(e)}):"string"==typeof i&&""!==i?sendData$7(e):sd$b.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$3(){"beacon"!==sd$b.para.send_type||_$9.isSupportBeaconSend()||(sd$b.para.send_type="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="1.26.8";function wrapPluginInitFn$j(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$j(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$j(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){var r=null,n=null;if(_$a.isObject(e.config)&&(r=e.config.send_type,n=_$a.optimizeServerUrl(e.config.server_url)),("ajax"===r||!r&&"ajax"===sd$c.para.send_type)&&_$a.isSupportCors()){var i=n||e.server_url;e.server_url=i,e.data=sd$c.kit.encodeTrackData(e.data),_$a.isArray(i)&&i.length?_$a.each(i,function(t){e.callback=null,e.server_url=t,sendData$8(e)}):"string"==typeof i&&""!==i?sendData$8(e):sd$c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$4(){"ajax"!==sd$c.para.send_type||_$a.isSupportCors()||(sd$c.para.send_type="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="1.26.8";function wrapPluginInitFn$k(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$k(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$k(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){var r=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+r:e+"?"+r}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(e,t){var r=null;_$b.isObject(e.config)&&(r=_$b.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,_$b.isArray(n)&&n.length?_$b.each(n,function(t){t&&(e.data=getSendUrl(t,i),e.callback=null,e.server_url=t,sendData$9(e))}):"string"==typeof n&&""!==n?(e.data=getSendUrl(n,i),sendData$9(e)):sd$d.logger&&sd$d.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.send_type&&"ajax"!==sd$d.para.send_type&&"beacon"!==sd$d.para.send_type&&(sd$d.para.send_type="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}})})}var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender);function wrapPluginInitFn$l(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$l(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$l(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$l(e,t,r){return wrapPluginInitFn$l(e,t,r),e.plugin_version=sdkversion_placeholder,e}var _sd$1=null,_$c=null,_cacheLogs=[],ConsoleLogger={init:function(e){e&&(_$c=(_sd$1=e)._,_sd$1.logger&&_sd$1.logger.appendWriter(logWriter),_sd$1.on&&_sd$1.on("sdkAfterInitPara",function(){for(var e=0;e<_cacheLogs.length;e++)printLog(_cacheLogs[e]);_cacheLogs=null}),_sd$1.on&&_sd$1.on("sdkInitAPI",function(){_sd$1.enableLocalLog=enableLocalLog,_sd$1.disableLocalLog=disableLocalLog}))}},consoleLogger=createPlugin$l(ConsoleLogger,"ConsoleLogger");function logWriter(e){null!==_cacheLogs?_cacheLogs.push(e):printLog(e)}function printLog(e){try{if("log"===e.level&&canLog())return void writeLog(e);if("warn"===e.level&&canWarn())return void writeLog(e);if("error"===e.level&&canError())return void writeLog(e)}catch(t){}}function canLog(){return!!isLocalLogEnabled()||(!0===_sd$1.para.show_log||_$c.isObject(_sd$1.para.show_log)&&"log"===_sd$1.para.show_log.level)}function canWarn(){return!!isLocalLogEnabled()||(canLog()||_$c.isObject(_sd$1.para.show_log)&&"warn"===_sd$1.para.show_log.level)}function canError(){return!!isLocalLogEnabled()||(!_$c.isObject(_sd$1.para.show_log)||"none"!==_sd$1.para.show_log.level)}function writeLog(e){var t=e.content,r=_$c.isObject(t[0])?_$c.formatJsonString(t[0]):t[0],n=getLogHead(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(_$c.isFunction(console[e.level])?console[e.level].apply(console,t):_$c.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function getLogHead(e){var t="",r="",n=_sd$1.para.show_log;return _$c.isObject(n)&&!1===n.show_brand||(t+=e.brand),_$c.isObject(n)&&!1===n.show_level||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),_$c.isObject(n)&&!1===n.show_module||(r=e.module),t+r}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _$c.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}sd.modules=sd.modules||{};for(var builtinPlugins=[consoleLogger,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=[consoleLogger,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;i1)))/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;g(r+1,0)<=i;r++);for(n=c((i-g(r,0))/30.42);g(r,n+1)<=i;n++);i=1+i-g(r,n),s=c((a=(e%864e5+864e5)%864e5)/36e5)%24,o=c(a/6e4)%60,l=c(a/1e3)%60,d=a%1e3}}return(k=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+w(6,r<0?-r:r):w(4,r))+"-"+w(2,n+1)+"-"+w(2,i)+"T"+w(2,s)+":"+w(2,o)+":"+w(2,l)+"."+w(3,d)+"Z",r=n=i=s=o=l=d=null):e=null,e})(e)};if(y("json-stringify")&&!y("date-serialization")){function P(e){return k(this)}var O=n.stringify;n.stringify=function(e,t,r){var n=l.prototype.toJSON;l.prototype.toJSON=P;var i=O(e,t,r);return l.prototype.toJSON=n,i}}else{var I=function(e){var t=e.charCodeAt(0),r=$[t];return r||"\\u00"+w(2,t.toString(16))},j=/[\x00-\x1f\x22\x5c]/g,C=function(e){return j.lastIndex=0,'"'+(j.test(e)?e.replace(j,I):e)+'"'},L=function(e,t,r,n,i,a,s){var o,d,u,p,f,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=k(o):"function"==typeof o.toJSON&&(o=o.toJSON(e))),r&&(o=r.call(t,e,o)),o==g)return o===g?o:"null";switch("object"==(d=typeof o)&&(u=_.call(o)),u||d){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 C(""+o)}if("object"==typeof o){for(v=s.length;v--;)if(s[v]===o)throw c();if(s.push(o),p=[],y=a,a+=i,"[object Array]"==u){for(h=0,v=o.length;h0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||N();e+=x("0x"+a.slice(t,D));break;default:N()}else{if(34==i)break;for(i=a.charCodeAt(D),t=D;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++D);e+=a.slice(t,D)}if(34==a.charCodeAt(D))return D++,e;N();default:if(t=D,45==i&&(n=!0,i=a.charCodeAt(++D)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(D+1))>=48&&i<=57&&N(),n=!1;D=48&&i<=57;D++);if(46==a.charCodeAt(D)){for(r=++D;r57);r++);r==D&&N(),D=r}if(101==(i=a.charCodeAt(D))||69==i){for(43!=(i=a.charCodeAt(++D))&&45!=i||D++,r=D;r57);r++);r==D&&N(),D=r}return+a.slice(t,D)}n&&N();var o=a.slice(D,D+4);if("true"==o)return D+=4,!0;if("fals"==o&&101==a.charCodeAt(D+4))return D+=5,!1;if("null"==o)return D+=4,null;N()}return"$"},U=function(e){var t,r;if("$"==e&&N(),"string"==typeof e){if("@"==(b?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];"]"!=(e=T());)r?","==e?"]"==(e=T())&&N():N():r=!0,","==e&&N(),t.push(U(e));return t}if("{"==e){for(t={};"}"!=(e=T());)r?","==e?"}"==(e=T())&&N():N():r=!0,","!=e&&"string"==typeof e&&"@"==(b?e.charAt(0):e[0])&&":"==T()||N(),t[e.slice(1)]=U(T());return t}N()}return e},R=function(e,t,r){var n=B(e,t,r);n===g?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(_,S,i);else S(i,function(e){R(i,e,r)});return r.call(e,t,i)};n.parse=function(e,t){var r,n;return D=0,E=""+e,r=U(T()),"$"!=T()&&N(),D=E=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){e=String(e);for(var t,r,i,a,s="",o=0,l=e.length%3;o255||(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>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 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(r){logger.log(r)}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){logger.log(r)}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";_localStorage.set(t,r),_localStorage.get(t)!==r&&(e=!1),_localStorage.remove(t)}catch(n){e=!1}return e}};function isObject(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)}var getRandomBasic=function(){var e=(new Date).getTime();return function(t){return Math.ceil((e=(9301*e+49297)%233280)/233280*t)}}();function getRandom(){if("function"==typeof Uint32Array){var e="";if("undefined"!=typeof crypto?e=crypto:"undefined"!=typeof msCrypto&&(e=msCrypto),isObject(e)&&e.getRandomValues){var t=new Uint32Array(1);return e.getRandomValues(t)[0]/Math.pow(2,32)}}return getRandomBasic(1e19)/1e19}function safeJSONParse(e){var t=null;try{t=JSON.parse(e)}catch(r){}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(e){var t=e;try{t=decodeURIComponent(e)}catch(r){t=e}return t}function getURLSearchParams(e){for(var t={},r=(e=e||"").substring(1).split("&"),n=0;n Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");for(var a in t=this._regex.exec(n),this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function _URL(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=getURLSearchParams(r.search),{get:function(e){return t[e]}}));else{isString(e)||(e=String(e)),e=trim(e);if(!1===/^https?:\/\/.+/.test(e))return void logger.log("Invalid URL");var n=urlParse(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=getURLSearchParams("?"+n._values.QueryString);return{get:function(t){return e[t]}}}()}return r}ConcurrentStorage.prototype.get=function(e,t,r,n){if(!e)throw new Error("key is must");t=t||1e4,r=r||1e3,n=n||function(){};var i=this.lockGetPrefix+e,a=_localStorage.get(i),s=String(getRandom());if(a&&(a=safeJSONParse(a)||{randomNum:0,expireTime:0}).expireTime>now())return n(null);_localStorage.set(i,JSON.stringify({randomNum:s,expireTime:now()+t})),setTimeout(function(){(a=safeJSONParse(_localStorage.get(i))||{randomNum:0,expireTime:0})&&a.randomNum===s?(n(_localStorage.get(e)),_localStorage.remove(e),_localStorage.remove(i)):n(null)},r)},ConcurrentStorage.prototype.set=function(e,t,r,n,i){if(!e||!t)throw new Error("key and val is must");r=r||1e4,n=n||1e3,i=i||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 i({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)&&i({status:"success"}):i({status:"fail",reason:"This key is locked"})},n)},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 n=0,i=r.length;n=4&&(i=a(i,n),n=[]);return n.length>0&&(i=a(i,n)),i.toString(16)}()+"-"+t+"-"+e();return r||(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,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()||ry(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 addHashEvent(e){var t="pushState"in window.history?"popstate":"hashchange";addEvent(window,t,e)}function xhr(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){logger.log(t)}}}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=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),ry(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||!isArray(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 siblings((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return siblings(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return ry(e=e&&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(),n=[],i=0;i=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),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(s){logger.log(s)}r.send(e.data||null)}function map(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(each(e,function(e,n,i){r.push(t(e,n,i))}),r)}function base64Decode(e){var t=[];try{t=map(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 base64Encode(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}function bindReady(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,s=i.addEventListener,o=s?"addEventListener":"attachEvent",l=s?"removeEventListener":"detachEvent",d=s?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](d+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},u=function(){try{a.doScroll("left")}catch(e){return void setTimeout(u,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!s&&a.doScroll){try{n=!t.frameElement}catch(p){logger.log(p)}n&&u()}i[o](d+"DOMContentLoaded",c,!1),i[o](d+"readystatechange",c,!1),t[o](d+"load",c,!1)}}var cookie={get:function(e){for(var t=e+"=",r=document.cookie.split(";"),n=0;n=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,cookie.set(t,"true",0,null,r,"; domain="+a),-1!==document.cookie.indexOf(t+"=true"))return cookie.set(t,"true","-1s",null,r,"; domain="+a),a;return""}function getDomBySelector(e){if(!isString(e))return null;var t,r=e.split(">");return(t=function n(e){var t,i=r.shift();if(!i)return e;try{t=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(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(!(isElement(t)&&t.children&&t.children.length>0))return null;for(var o=t.children,l=0;l0)return null}return r||null}(i,e)}catch(a){logger.log(a)}return t&&isElement(t)?n(t):null}())&&isElement(t)?t:null}function getElementContent(e,t){var r="",n="";return e.textContent?r=trim(e.textContent):e.innerText&&(r=trim(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 getHostname(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=_URL(e).hostname}catch(n){logger.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}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(t){return""}}function getQueryParam(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=_decodeURIComponent(e);var r=new RegExp("[\\?&]"+t+"=([^&#]*)").exec(e);return null===r||r&&"string"!=typeof r[1]&&r[1].length?"":_decodeURIComponent(r[1])}function getQueryParamsFromUrl(e){var t={},r=e.split("?")[1]||"";return r&&(t=getURLSearchParams("?"+r)),t}function mediaQueriesSupported(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function getScreenOrientation(){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(mediaQueriesSupported()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return 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,n=0;n0)for(var i=e.split(""),a=0;at)for(n=r+n;(o=31*n+s)t;)n=n/2+s;n=31*n+s}return n}function indexOf(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function isSupportCors(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function jsonp(e){if(!isObject(e)||!isString(e.callbackName))return logger.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;e.success=isFunction(e.success)?e.success:function(){},e.error=isFunction(e.error)?e.error:function(){},e.data=e.data||"";var t=document.createElement("script"),r=document.getElementsByTagName("head")[0],n=null,i=!1;if(r.appendChild(t),isNumber(e.timeout)&&(n=setTimeout(function(){if(i)return!1;e.error("timeout"),window[e.callbackName]=function(){logger.log("call jsonp error")},n=null,r.removeChild(t),i=!0},e.timeout)),window[e.callbackName]=function(){clearTimeout(n),n=null,e.success.apply(null,arguments),window[e.callbackName]=function(){logger.log("call jsonp error")},r.removeChild(t)},e.url.indexOf("?")>-1?e.url+="&callbackName="+e.callbackName:e.url+="?callbackName="+e.callbackName,isObject(e.data)){var a=[];each(e.data,function(e,t){a.push(t+"="+e)}),e.data=a.join("&"),e.url+="&"+e.data}t.onerror=function(a){if(i)return!1;window[e.callbackName]=function(){logger.log("call jsonp error")},clearTimeout(n),n=null,r.removeChild(t),e.error(a),i=!0},t.src=e.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"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;addEvent(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else 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(""),n=0,i=r.length;nt?(s&&(clearTimeout(s),s=null),o=d,a=e.apply(n,i),s||(n=i=null)):s||!1===r.trailing||(s=setTimeout(l,c)),a}}function values(e){var t=[];return null==e?t:(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=[],n={},i=0;it._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_"+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(){},storeInitCheck:function(){if(sd.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};saCookie.isSupport()?saCookie.set(getNewUserFlagKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):memory.set(memory.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else 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 n=!(!isObject(sdPara.heatmap)||!sdPara.heatmap.useCapture);return isObject(sdPara.heatmap)&&isUndefined(sdPara.heatmap.useCapture)&&"click"===t&&(n=!0),addEvent(e,t,r,n)}var EventEmitterSa=function(){this._events=[],this.pendingEvents=[]};function isBaiduTraffic(){var e=document.referrer;if(!e)return!1;try{var t=_URL(e).hostname;return t&&"baidu.com"===t.substring(t.length-"baidu.com".length)}catch(r){return!1}}EventEmitterSa.prototype={emit:function(e){var t=[].slice.call(arguments,1);each(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,r,n){isFunction(t)&&(this._events.push({type:e,callback:t,context:r||this}),n=!1!==n,this.pendingEvents.length>0&&n&&each(this.pendingEvents,function(n){n.type===e&&t.apply(r,n.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var getBaiduKeyword={data:{},id:function(){return this.data.id?this.data.id:(this.data.id=getReferrerEqid(),this.data.id)},type:function(){return this.data.type?this.data.type:(this.data.type=getReferrerEqidType(),this.data.type)}};function getReferrerEqidType(){var e=getQueryParamsFromUrl(document.referrer);if(isEmptyObject(e)||!e.eqid){var t=getQueryParamsFromUrl(location.href);return e.ck||t.utm_source?"baidu_sem_keyword_id":"baidu_other_keyword_id"}return"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)?(0!==(e=_decodeURI(e=trim(e))).indexOf("https://www.baidu.com/")||t||(e=e.split("?")[0]),isString(e=e.slice(0,sdPara.max_referrer_string_length))?e:""):"\u53d6\u503c\u5f02\u5e38_referrer\u5f02\u5e38_"+String(e)}function isReferralTraffic(e){if(""===(e=e||document.referrer))return!0;var t=getCookieTopLevelDomain(null,domain_test_key,sdPara.is_secure_cookie),r=getHostname(e);return-1===(r="."+r).indexOf(t)&&""!==t}function getKeywordFromReferrer(e,t){e=e||document.referrer;var r=sdPara.source_type.keyword;if(document&&isString(e)){if(0===e.indexOf("http")){var n=getReferSearchEngine(e),i=getQueryParamsFromUrl(e);if(isEmptyObject(i))return sdPara.preset_properties.search_keyword_baidu&&isBaiduTraffic()?void 0:"\u672a\u53d6\u5230\u503c";var a=null;for(var s in r)if(n===s&&isObject(i))if(isArray(a=r[s]))for(s=0;s-1&&r.splice(i,1),_localStorage.remove(e[n])}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);null===r?(this.tabKey=tabStoragePrefix+String(getRandom()),r=this.generateTabStorageVal()):r=safeJSONParse(r)||this.generateTabStorageVal(),r.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=0;ti.expireTime&&this.serverUrl===i.serverUrl)new ConcurrentStorage("sajssdk-lock-get-").get(r,1e4,1e3,function(e){if(e){null===_localStorage.get(n.tabKey)&&n.generateTabStorage();var t=safeJSONParse(e)||n.generateTabStorageVal(),r=safeJSONParse(_localStorage.get(n.tabKey))||n.generateTabStorageVal();r.data=unique(r.data.concat(t.data)),_localStorage.set(n.tabKey,JSON.stringify(r))}})}else if(0===r.indexOf("sajssdk-lock-get-")){var s=safeJSONParse(_localStorage.get(r))||{expireTime:0};now()-s.expireTime>1e4&&_localStorage.remove(r)}}for(var o=0;o0)for(t=0;tsdPara.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!(indexOf(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(indexOf(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=store._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(indexOf(this.bindReservedNames,e)>-1)}},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||("Property Value",isFunction(checkLog[r])&&checkLog[r]("Property Value")),!0}},properties:function(e){return isObject(e)?each(e,function(e,t){check({propertyKey:t});check({propertyValue:e},function(e,r,n){return e||(r=t+"'s Value",isFunction(checkLog[n])&&checkLog[n](r)),!0})}):ruleOption.voidZero(e)&&sdWarn("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return e!==undefined&&isObject(e)&&!isEmptyObject(e)?this.properties.call(this,e):sdWarn("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!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 n=this[e];if(isFunction(n))return n.call(this,t);if(!n)return!1;for(var i=0;i-1;if(isObject(r)&&"$option"!==n&&!a)try{e[n]=JSON.stringify(r)}catch(s){delete e[n],sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else isString(r)||isNumber(r)||isDate(r)||isBoolean(r)||isArray(r)||isFunction(r)||"$option"===n||a||(sdWarn("\u60a8\u7684\u6570\u636e-",n,r,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete e[n])}),e):e}function formatString(e,t){return isNumber(t)&&e.length>t?(sdWarn("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function filterReservedProperties(e,t){isObject(e)&&each(["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"],function(r,n){r in e&&(indexOf(t||[],r)>-1||(n<3?(delete e[r],sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):sdWarn("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function searchObjString(e){var t=["$element_selector","$element_path"],r=["sensorsdata_app_visual_properties"];isObject(e)&&each(e,function(n,i){if(isObject(n))searchObjString(e[i]);else if(isString(n)){if(indexOf(r,i)>-1)return;e[i]=formatString(n,indexOf(t,i)>-1?1024:sdPara.max_string_length)}})}function searchZZAppStyle(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function formatItem(e){if("item_type"in e){check({item_type:e.item_type},function(t){return t||delete e.item_type,!0})}if("item_id"in e){check({item_id:e.item_id},function(t,r,n){return t||"string"!==n||delete e.item_id,!0})}}function formatProperties(e,t){each(e,function(r,n){-1===indexOf(t||[],n)&&check({propertyKey:n},function(t,r,i){return t||"keyLength"===i||delete e[n],!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){var r=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(),r.events.tempAdd("send",e),e}var vtrackBase={initUrl:function(){var e,t,r={server_url:{project:"",host:""},page_url:{host:"",pathname:""}};if(!isHttpUrl(sd.para.server_url))return sdError("----vcollect---server_url\u5fc5\u987b\u4e3a\u6709\u6548 URL \u5b57\u7b26\u4e32"),!1;try{e=_URL(sd.para.server_url),r.server_url.project=e.searchParams.get("project")||"default",r.server_url.host=e.host}catch(n){return sdError("----vcollect---server_url\u89e3\u6790\u5f02\u5e38",n),!1}try{t=_URL(location.href),r.page_url.host=t.hostname,r.page_url.pathname=t.pathname}catch(n){return sdError("----vcollect---\u9875\u9762\u5730\u5740\u89e3\u6790\u5f02\u5e38",n),!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 e.$element_selector.indexOf(t.element_selector)>-1}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 e.$element_path.indexOf(t.element_path)>-1}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(e.$element_position!==undefined){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(e,t,r){var n=[];if(!r){var i=vtrackBase.initUrl();if(!i)return[];r=i.page_url}return"$WebClick"===e.event&&each(t,function(t){isObject(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&isObject(t.event)&&t.event.url_host===r.host&&t.event.url_path===r.pathname&&vtrackBase.configIsMatch(e.properties,t.event)&&n.push(t)}),n},getPropElInLi:function(e,t){if(!(e&&isElement(e)&&isString(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r=sd.heatmap.getDomSelector(e);if(r){var n=getDomBySelector(r+t);return n||null}return sdWarn("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",r,t),null},getProp:function(e,t){if(!isObject(e))return!1;if(!(isString(e.name)&&e.name.length>0))return sdWarn("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var r,n,i={};if("content"===e.method){var a;if(isString(e.element_selector)&&e.element_selector.length>0)a=getDomBySelector(e.element_selector);else{if(!t||!isString(e.list_selector))return sdWarn("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=getDomBySelector(t.properties.$element_selector);if(!s)return sdWarn("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var o=sd.heatmap.getClosestLi(s);a=vtrackBase.getPropElInLi(o,e.list_selector)}if(!a||!isElement(a))return sdWarn("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===a.tagName.toLowerCase())r=a.value||"";else if("select"===a.tagName.toLowerCase()){var l=a.selectedIndex;isNumber(l)&&isElement(a[l])&&(r=getElementContent$1(a[l],"select"))}else r=getElementContent$1(a,a.tagName.toLowerCase());if(e.regular){try{n=new RegExp(e.regular).exec(r)}catch(d){return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===n)return sdWarn("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!isArray(n)||!isString(n[0]))return sdWarn("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;r=n[0]}if("STRING"===e.type)i[e.name]=r;else if("NUMBER"===e.type){if(r.length<1)return sdWarn("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;if(isNaN(Number(r)))return sdWarn("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,r),!1;i[e.name]=Number(r)}return i}return sdError("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},getAssignConfigs:function(e,t){var r=vtrackBase.initUrl();if(!r||!r.page_url)return[];if(!isObject(t))return[];var n=[];return t.events=t.events||t.eventList,isArray(t.events)&&t.events.length>0?(each(t.events,function(t){isObject(t)&&isObject(t.event)&&t.event.url_host===r.page_url.host&&t.event.url_path===r.page_url.pathname&&e(t)&&n.push(t)}),n):[]}},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(e){var t={},r=[],n=this;if(!this.events.length)return{};if("$WebClick"===e.event){var i=this.filterConfig(e,this.events);if(!i.length)return{};each(i,function(i){isObject(i)&&(isArray(i.properties)&&i.properties.length>0&&each(i.properties,function(r){if(isObject(r))if(!1===r.h5)isArray(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(r);else{var i=n.getProp(r,e);isObject(i)&&(t=extend(t,i))}}),isString(i.event_name)&&r.push(i.event_name))}),sd.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=r)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=base64Encode(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new sd.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(r){var n={};try{r=JSON.parse(base64Decode(r))}catch(s){sdError("getJSVisualProperties data parse error!")}if(isObject(r)){var i=r.sensorsdata_js_visual_properties,a=e.initUrl();a&&(a=a.page_url,isArray(i)&&i.length>0&&each(i,function(t){if(isObject(t)&&t.url_host===a.host&&t.url_path===a.pathname&&t.h5){var r=e.getProp(t);isObject(r)&&(n=extend(n,r))}}))}return"android"===sd.bridge.bridge_info.platform&&t.notifyApp({data:n},r.message_id),n}),t}},vapph5collect={events:[],customProp:vapph5CustomProp,getAssignConfigs:vtrackBase.getAssignConfigs,initUrl:vtrackBase.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new sd.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(base64Decode(t))}catch(r){return void sdError("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new sd.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(base64Decode(e))}catch(t){e=null,sdError("getAppVisualConfig result parse error\uff01")}return e},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))return!1;for(var r=0;r0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,r){var n=this;r=r||this.filterConfig(e,t,vtrackcollect.url_info.page_url);var i={};return r.length?(each(r,function(t){isArray(t.properties)&&t.properties.length>0&&each(t.properties,function(t){var r=n.getProp(t,e);isObject(r)&&extend(i,r)})}),i):{}},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=vtrackBase.initUrl();if(e){var t;try{(t=new urlParse(sd.para.server_url))._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return sdError("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!isObject(sd.para.heatmap)||!sd.para.heatmap.get_vtrack_config)return!1;if(_localStorage.isSupport()||(this.storageEnable=!1),!this.initUrl())return sdError("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=store.readObjectVal(this.storage_name);if(isObject(e)&&isObject(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime()-this.update_time;if(isNumber(t)&&t>0&&t0&&t-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&ry(a).prev().tagName&&"img"===ry(a).prev().tagName.toLowerCase())return ry(a).prev();if("div"===i&&sd.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)&&((sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1)>1||r.isCollectableDiv(n)))return n;if(r.isStyleTag(i)&&sd.para.heatmap.collect_tags.div){var o=r.getCollectableParent(n);if(o&&r.isDivLevelValid(o))return o}return r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)})||null},getDivLevels:function(e,t){var r=heatmap.getElementPath(e,!0,t).split(" > "),n=0;return each(r,function(e){"div"===e&&n++}),n},isDivLevelValid:function(e){for(var t=sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(heatmap.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&isElement(e);){if(!isString(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){return function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&isString(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null}(e,"li")},getElementPosition:function(e,t,r){var n=sd.heatmap.getClosestLi(e);if(!n||!isElement(e)||!isString(e.tagName))return null;var i=e.tagName.toLowerCase(),a=n.getElementsByTagName(i),s=a.length,o=[];if(s>1){for(var l=0;l1)return indexOf(o,e)}return function(e){if(!e.parentNode)return"";if(1===ry(e).getSameTypeSiblings().length)return 0;for(var t=0,r=e;ry(r).previousElementSibling().ele;r=ry(r).previousElementSibling().ele,t++);return t}(n)},setNotice:function(e){sd.is_heatmap_render_mode=!0,sd.para.heatmap||(sd.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(sd.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),sd.para.heatmap_url||(sd.para.heatmap_url=getSafeHttpProtocol()+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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});r.$element_selector=t||"",r.$element_path=sd.heatmap.getElementPath(e,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);var n=sd.heatmap.getElementPosition(e,r.$element_path,sd.para.heatmap&&"not_use_id"===sd.para.heatmap.element_selector);return isNumber(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){if(!e)return{};function r(){return{scrollLeft:document.body.scrollLeft||document.documentElement.scrollLeft||0,scrollTop:document.body.scrollTop||document.documentElement.scrollTop||0}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}return function(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,s=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(s)}}(e)},start:function(e,t,r,n,i){if(isObject(sd.para.heatmap)&&isFunction(sd.para.heatmap.collect_element)&&!sd.para.heatmap.collect_element(t))return!1;processWebClickEvent(heatmap.getBasicEleInfo(e,t,r,n,i))},getBasicEleInfo:function(e,t,r,n,i){var a=isObject(n)?n:{},s=isFunction(i)?i:isFunction(n)?n:undefined,o=this.getEleDetail(t);if(sd.para.heatmap&&sd.para.heatmap.custom_property){var l=sd.para.heatmap.custom_property(t);isObject(l)&&(o=extend(o,l))}return{event:e,target:t,props:o=extend(o,this.getPointerEventProp(e,t),a),tagName:r,callback:s}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=ry(e.element).getParents());if(r&&isArray(r)&&r.length>0)for(var i=0;i-1)&&(!t||sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div?!!(isObject(sd.para.heatmap)&&isObject(sd.para.heatmap.collect_tags)&&isObject(sd.para.heatmap.collect_tags.div)&&isArray(sd.para.heatmap.collect_tags.div.ignore_tags)&&indexOf(sd.para.heatmap.collect_tags.div.ignore_tags,e)>-1):indexOf(["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){sdError("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=sd.para&&sd.para.heatmap&&sd.para.heatmap.collect_tags&&sd.para.heatmap.collect_tags.div&&sd.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){sdError("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),sd.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.scroll_notice_map)return!1;var e=!0;sd.para.scrollmap&&isFunction(sd.para.scrollmap.collect_url)&&this.listenUrlChange(function(){e=!!sd.para.scrollmap.collect_url()});var t=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t}({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>sd.para.heatmap.scroll_delay_time&&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.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,processWebStayEvent(e)),this.current_time=n}});t.current_time=new Date,saAddEvent(window,"scroll",function(){if(!e)return!1;t.go()}),saAddEvent(window,"unload",function(){if(!e)return!1;t.go("notime")})},initHeatmap:function(){var e=this,t=!0;if(!isObject(sd.para.heatmap)||"default"!==sd.para.heatmap.clickmap)return!1;isFunction(sd.para.heatmap.collect_url)&&this.listenUrlChange(function(){t=!!sd.para.heatmap.collect_url()}),"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(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var s=isString(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===s||"button"===s?e.start(n,i.parentNode,s):e.start(n,i,a)}):saAddEvent(document,"click",function(r){if(!t)return!1;var n=r||window.event;if(!n)return!1;var i=n.target||n.srcElement,a=sd.heatmap.getTargetElement(i,r);if(!isElement(a)&&!isString(i.tagName))return!1;isElement(a)&&isString(a.tagName)?e.start(n,a,a.tagName.toLowerCase()):isElement(i)&&"div"===i.tagName.toLowerCase()&&isObject(sd.para.heatmap)&&sd.para.heatmap.get_vtrack_config&&unlimitedDiv.events.length>0&&unlimitedDiv.isTargetEle(i)&&e.start(n,i,i.tagName.toLowerCase(),{$lib_method:"vtrack"})})}};function getClassifiedUtms(){var e=pageInfo.campaignParams(),t={};return each(e,function(e,r,n){-1!==(" "+sd.source_channel_standard+" ").indexOf(" "+r+" ")?t["$"+r]=n[r]:t[r]=n[r]}),t}function sendFirstProfile(e,t,r){if(sd.is_first_visitor&&r){var n={};sd.para.preset_properties.search_keyword_baidu&&isReferralTraffic(document.referrer)&&isBaiduTraffic()&&(n.$search_keyword_id=getBaiduKeyword.id(),n.$search_keyword_id_type=getBaiduKeyword.type(),n.$search_keyword_id_hash=hashCode53(n.$search_keyword_id));var i=getReferrer(null,t);e(extend({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?getHostname(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:isString(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:isString(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:getSourceFromReferrer(),$first_search_keyword:getKeywordFromReferrer()},getClassifiedUtms(),n)),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.setProfile(e),!1;if(!isObject(e)||isEmptyObject(e))return!1;var t=store.readObjectVal("sensorsdata_2015_jssdk_profile"),r=!1;if(isObject(t)&&!isEmptyObject(t)){for(var n in e)!(n in t&&t[n]!==e[n])&&n in t||(t[n]=e[n],r=!0);r&&(store.saveObjectVal("sensorsdata_2015_jssdk_profile",t),sd.setProfile(e))}else store.saveObjectVal("sensorsdata_2015_jssdk_profile",e),sd.setProfile(e)},setInitReferrer:function(){var e=getReferrer();sd.setOnceProfile({_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){if("object"==typeof e&&e.tagName&&isElement(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=sd.para.heatmap&&sd.para.heatmap.track_attr?sd.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||hasAttributes(e,a)||heatmap.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();heatmap.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){var r;r=this.autoTrackIsUsed?pageInfo.pageProp.url:pageInfo.pageProp.referrer;var n=!(e=isObject(e)?e:{}).not_set_profile;function i(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,i(e,t),this.autoTrackSinglePage=i,sendFirstProfile(sd.setOnceProfile,!1,n)},autoTrackWithoutProfile:function(e,t){e=isObject(e)?e:{},this.autoTrack(extend(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=isObject(e)?e:{};var r=getClassifiedUtms(),n=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var i=location.href;sd.para.is_single_page&&addHashEvent(function(){var n=getReferrer(i,!0);sd.track("$pageview",extend({$referrer:n,$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),i=getURL()}),sd.track("$pageview",extend({$referrer:getReferrer(null,!0),$url:getURL(),$url_path:getURLPath(),$title:document.title},r,e),t),sendFirstProfile(sd.setOnceProfile,!0,n),this.autoTrackIsUsed=!0},getAnonymousID:function(){return isEmptyObject(store._state)?"SDK is not initialized.":store.getAnonymousId()},setPlugin:function(e){if(!isObject(e))return!1;each(e,function(e,t){isFunction(e)&&(isObject(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[t]?e(window.SensorsDataWebJSSDKPlugin[t]):isObject(sd.modules)&&sd.modules[t]?e(window.SensorsDataWebJSSDKPlugin[t]):sdWarn(t+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){sd.use.apply(sd,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}};function loginBody(e,t){var r=e.id,n=e.callback,i=e.name,a=store.getFirstId(),s=store.getOriginDistinctId();if(!check({distinct_id:r}))return sdError("login id is invalid"),!1;if(r===store.getOriginDistinctId()&&!a)return sdError("login id is equal to distinct_id"),!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(i)&&r===store._state.first_id)return!1;if(store._state.history_login_id.name!==i||r!==store._state.history_login_id.value){store._state.identities[i]=r,store.set("history_login_id",{name:i,value:r}),a||store.set("first_id",s),t(r,"$SignUp",{},n);var o={$identity_cookie_id:store._state.identities.$identity_cookie_id};return o[i]=r,resetIdentities(o),!0}return!1}function resetIdentities(e){var t={};for(var r in e)t[r]=e[r];store._state.identities=t,store.save()}function deleteBindIDData(e,t){if(!check({unbindKey:e,bindValue:t}))return!1;if(isObject(store._state.identities)&&store._state.identities.hasOwnProperty(e)&&store._state.identities[e]===t){var r=store.getUnionId().login_id;r&&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())}var n={};return n[e]=t,n}function setInitVar(){sd._t=sd._t||1*new Date,sd.is_first_visitor=!1,sd.source_channel_standard=source_channel_standard}function initPara(e){extend(sdPara,e||sd.para||{}),sd.para=sdPara;var t,r={};if(isObject(sd.para.is_track_latest))for(var n in sd.para.is_track_latest)r["latest_"+n]=sd.para.is_track_latest[n];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 i=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],a=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],o={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof sd.para.source_type&&(sd.para.source_type.utm=isArray(sd.para.source_type.utm)?sd.para.source_type.utm.concat(i):i,sd.para.source_type.search=isArray(sd.para.source_type.search)?sd.para.source_type.search.concat(a):a,sd.para.source_type.social=isArray(sd.para.source_type.social)?sd.para.source_type.social.concat(s):s,sd.para.source_type.keyword=isObject(sd.para.source_type.keyword)?extend(o,sd.para.source_type.keyword):o);var l=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(sd.para.heatmap&&!isObject(sd.para.heatmap)&&(sd.para.heatmap={}),isObject(sd.para.heatmap)){sd.para.heatmap.clickmap=sd.para.heatmap.clickmap||"default",sd.para.heatmap.scroll_notice_map=sd.para.heatmap.scroll_notice_map||"default",sd.para.heatmap.scroll_delay_time=sd.para.heatmap.scroll_delay_time||4e3,sd.para.heatmap.scroll_event_duration=sd.para.heatmap.scroll_event_duration||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);var d=isArray(sd.para.heatmap.track_attr)?filter(sd.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),sd.para.heatmap.track_attr=d,isObject(sd.para.heatmap.collect_tags))if(!0===sd.para.heatmap.collect_tags.div)sd.para.heatmap.collect_tags.div={ignore_tags:l,max_level:1};else if(isObject(sd.para.heatmap.collect_tags.div)){if(sd.para.heatmap.collect_tags.div.ignore_tags?isArray(sd.para.heatmap.collect_tags.div.ignore_tags)||(sdWarn("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),sd.para.heatmap.collect_tags.div.ignore_tags=l):sd.para.heatmap.collect_tags.div.ignore_tags=l,sd.para.heatmap.collect_tags.div.max_level){-1===indexOf([1,2,3],sd.para.heatmap.collect_tags.div.max_level)&&(sd.para.heatmap.collect_tags.div.max_level=1)}}else sd.para.heatmap.collect_tags.div=!1;else sd.para.heatmap.collect_tags={div:!1}}sd.para.server_url=optimizeServerUrl(sd.para.server_url),!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.collect_tags&&isObject(sd.para.heatmap.collect_tags)&&each(sd.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&sd.heatmap.otherTags.push(t)}),sd.para.heatmap&&"default"===sd.para.heatmap.clickmap&&sd.heatmap.initUnlimitedTags()}var readyState={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},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):sdWarn("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0])}var nonameCount=1;function use(e,t){if(isString(e)||isObject(e)){var r;if(isObject(e)){var n=sd.modules&&sd.modules[e.plugin_name];n&&n!==e&&sdWarn(e.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),r=n||e}return 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.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[e]&&(r=window.sensorsDataAnalytic201505.modules[e])),r&&isFunction(r.init)?r.plugin_is_init?r:(r.plugin_name||sdWarn("warning: invalid plugin, plugin_name required."),r.plugin_version?r.plugin_version!==sd.lib_version&&sdWarn("warning: plugin version not match SDK version. plugin may not work correctly. "):sdWarn("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,r):(sdWarn((e.plugin_name||e)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),r)}sdError("use's first arguments must be string or object.")}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){var r=deleteBindIDData(e,t);r&&saEvent.send({identities:r,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(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void saAddEvent(e,"click",function(n){n.preventDefault();var i=!1;function a(){i||(i=!0,location.href=e.href)}setTimeout(a,1e3),sd.track(t,r,a)}))}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 setProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set",properties:e},t)}function setOnceProfile(e,t){check({propertiesMust:e})&&saEvent.send({type:"profile_set_once",properties:e},t)}function appendProfile(e,t){check({propertiesMust:e})&&(each(e,function(t,r){isString(t)?e[r]=[t]:isArray(t)?e[r]=t:(delete e[r],sdWarn("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),isEmptyObject(e)||saEvent.send({type:"profile_append",properties:e},t))}function incrementProfile(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!1;return!0}(e)?sdError("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"):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,n={};isString(e)&&(e=[]).push(r),isArray(e)?(each(e,function(e){isString(e)?n[e]=!0:sdWarn("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),saEvent.send({type:"profile_unset",properties:n},t)):sdError("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function identify(e){"number"==typeof e&&(e=String(e));var t=store.getFirstId();if(void 0===e){var r=UUID();t?store.set("first_id",r):store.set("distinct_id",r)}else check({distinct_id:e})&&(t?store.set("first_id",e):store.set("distinct_id",e))}function resetAnonymousIdentity(e){if(store.getFirstId())return sdError("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),void 0===e){var t=UUID();store._state.identities.$identity_cookie_id=t,store.set("distinct_id",t)}else check({distinct_id:e})&&(store._state.identities.$identity_cookie_id=e,store.set("distinct_id",e))}function sendSignup(e,t,r,n){var i=store.getFirstId()||store.getDistinctId();store.set("distinct_id",e),saEvent.send({original_id:i,distinct_id:store.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function trackSignup(e,t,r,n){"number"==typeof e&&(e=String(e)),check({distinct_id:e,event:t,properties:r})&&sendSignup(e,t,r,n)}function registerPage(e){check({properties:e})?extend(pageInfo.currentProps,e):sdError("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function clearAllRegister(e){store.clearAllProps(e)}function clearPageRegister(e){var t;if(isArray(e)&&e.length>0)for(t=0;t-1?n:"https:")+"//static.sensorsdata.cn/sdk/"+sd.lib_version+"/vapph5define.min.js"})}else r();else r()}function listenSinglePage(e){sd.para.is_track_single_page&&spa.on("switch",function(t){var r=function(r){if(r=r||{},t!==location.href){pageInfo.pageProp.referrer=getURL(t);var n=extend({$url:getURL(),$referrer:getURL(t)},r);isFunction(e)?e(n):sd.quick&&sd.quick("autoTrack",n)}};if("boolean"==typeof sd.para.is_track_single_page)r();else if("function"==typeof sd.para.is_track_single_page){var n=sd.para.is_track_single_page();isObject(n)?r(n):!0===n&&r()}})}function enterFullTrack(){sd._q&&isArray(sd._q)&&sd._q.length>0&&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","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","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=[]),sdWarn("calling sdk api before init is deprecated."),sd._q.push([e,arguments]),!1;if(!isFunction(sd.getDisabled)||!sd.getDisabled()){if(sd.readyState.getState())return t.apply(sd,arguments);sdError("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}}})}var saEmpty={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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 n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},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)&&r.length>0)for(var n={current:0,total:r.length},i=new InterceptorContext(t,n,sd),a=0;a=2)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="1.26.9";function wrapPluginInitFn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin(e,t,r){return wrapPluginInitFn(e,t,r),e.plugin_version=sdkversion_placeholder$1,e}var userEncryptDefault={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return"dfm-enc-"+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf("dfm-enc-")&&(e=e.substring("dfm-enc-".length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf("dfm-enc-")||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},index=createPlugin(userEncryptDefault),sdkversion_placeholder$2="1.26.9";function wrapPluginInitFn$1(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$1(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$1(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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 t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),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="1.26.9";function wrapPluginInitFn$2(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$2(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$2(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(),log("---test---fail---",!sd$1,sd$1.bridge.activeBridge,!anServerUrl),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),log("---test---bridge-verify-",sd$1.bridge.is_verify_success)),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("---test---app_js_bridge is not configured, data will not be sent by android bridge."))}function sendData(e,t){if(log("---test---datasend-",sd$1.bridge.is_verify_success),sd$1.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$1.bridge.is_verify_success?(log("---test---bridge-verify-success---",e.data),anTrack&&anTrack.call(anBridge,JSON.stringify(_$1.extend({server_url:sd$1.para.server_url},e.data))),_$1.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(log("---test---bridge-verify-fail-----",sd$1.bridge.is_verify_success),sd$1.para.app_js_bridge.is_send?(sd$1.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(_$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="1.26.9";function wrapPluginInitFn$3(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$3(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$3(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(){if(log$1("ObsoleteBridge---test---init---"),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,log$1("ObsoleteBridge-",sd$2.bridge.activeBridge,anVerify,anTrack$1,anVisualVerify),sd$2&&!sd$2.bridge.activeBridge&&(anVerify||anTrack$1||anVisualVerify)){sd$2.bridge.activeBridge=AndroidObsoleteBridge;var e=anVerify||anTrack$1;anVisualVerify&&(e=!!anVisualVerify.call(anBridge$1,JSON.stringify({server_url:sd$2.para.server_url})),log$1("ObsoleteBridge---called-return",e)),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){if(log$1("ObsoleteBridge---senddata"),sd$2.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(anVerify){var n=anVerify&&anVerify.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data)));return log$1("ObsoleteBridge---anVerify-success",n),n?(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$2.para.app_js_bridge.is_send?(sd$2.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):(_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return log$1("ObsoleteBridge---is-send-old-way",sd$2.para.app_js_bridge.is_send),anTrack$1&&anTrack$1.call(anBridge$1,JSON.stringify(_$2.extend({server_url:sd$2.para.server_url},e.data))),_$2.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function handleCommand$1(e){log$1("ObsoleteBridge---handleCommadn");var t=e.callType;return t in vbridge$1$1.commands?(log$1("ObsoleteBridge---",t,vbridge$1$1.commands),vbridge$1$1.commands[t](e,anBridge$1)):anBridge$1&&_$2.isFunction(anBridge$1.sensorsdata_js_call_app)?(log$1("ObsoleteBridge---handleCommadn-abridge"),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="1.26.9";function wrapPluginInitFn$4(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$4(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$4(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$4(e,t,r){return wrapPluginInitFn$4(e,t,r),e.plugin_version=sdkversion_placeholder$5,e}var hidden,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||"sensorsdata2015jssdkchannel",sd$3=e;var r=this;!function(){if(_$3=sd$3._,store$1=sd$3.store,!_$3.localStorage.isSupport())return!1;sd$3.para.max_string_length=1024,r.eventList.init(),r.addLatestChannelUrl(),r.addIsChannelCallbackEvent()}()},addIsChannelCallbackEvent:function(){sd$3.registerPage({$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();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(_$3.isReferralTraffic(document.referrer)){var r=_$3.getQueryParam(location.href,"sat_cf");_$3.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),Channel.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?sd$3.registerPage(t):sd$3.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){sd$3.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=sd$3.kit.userDecryptIfNeeded(_$3.cookie.get(cookie_name));return e=_$3.safeJSONParse(e),!(!_$3.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);sd$3.para.encrypt_cookie&&(r=sd$3.kit.userEncrypt(r)),_$3.cookie.set(cookie_name,r)}},channelLinkHandler:function(){this.eventList.reset(),sd$3.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=_$3.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&_$3.isNumber(e.latest_event_initial_time)&&_$3.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$5(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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"undefined"!=typeof document.hidden?(e.hidden="hidden",e.visibilityChange="visibilitychange"):"undefined"!=typeof document.msHidden?(e.hidden="msHidden",e.visibilityChange="msvisibilitychange"):"undefined"!=typeof document.webkitHidden&&(e.hidden="webkitHidden",e.visibilityChange="webkitvisibilitychange"),e};function isPageHidden(){return void 0!==hidden&&document[hidden]}hidden=getSupportedProperty().hidden;var iosServerUrl,iosTracker,sd$4,_$4,log$2,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){var t=e._.URL(e.para.server_url);return{origin:t.origin,project:t.searchParams.get("project")||"default"}},handleAndroidLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 android app");var n=t;e.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+n),window.location=n,e.timer=setTimeout(function(){var t=isPageHidden();if(e.log("hide:"+hidden+":"+document[hidden]),t)return e.log("The page is hidden, stop navigating to download page"),!1;e.log("App\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),window.location=r},e.timeout)},handleIOSLinks=function(e,t,r){e.log("\u5c1d\u8bd5\u5524\u8d77 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\u53ef\u80fd\u672a\u5b89\u88c5\uff0c\u8df3\u8f6c\u5230\u4e0b\u8f7d\u5730\u5740"),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){if(this.sd)return this.log("deeplink\u5df2\u7ecf\u521d\u59cb\u5316"),!1;if(this.sd=e,this.log("deeplink init called"),null===this.sd)return this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165"),!1;var t={};if(arguments.length>0&&(1===arguments.length&&isObject$1(arguments[0])?t=arguments[0]:arguments.length>=2&&isObject$1(arguments[1])&&(t=arguments[1])),!isSupportedOS())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(isObject$1(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=parseAPIURL(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=parseShortURL(n);if(!i)return this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1;this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){if(e.errorMsg)return SADeepLink.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1;SADeepLink.data=e,SADeepLink.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))}.bind(this),error:function(){SADeepLink.log("API\u67e5\u8be2\u51fa\u9519")}}),this.addListeners()},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===currentOS){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),handleIOSLinks(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f 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,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},index$5=createPlugin$5(SADeepLink,"Deeplink","sdkReady"),sdkversion_placeholder$7="1.26.9";function wrapPluginInitFn$6(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$6(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$6(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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){if(sd$4.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return sd$4.bridge.is_verify_success?(iosTracker()&&iosTracker().postMessage(JSON.stringify({callType:"app_h5_track",data:_$4.extend({server_url:sd$4.para.server_url},e.data)})),_$4.isFunction(r)&&r(),t.cancellationToken.cancel(),e):sd$4.para.app_js_bridge.is_send?(sd$4.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(_$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="1.26.9";function wrapPluginInitFn$7(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$7(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$7(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=_$5.URL(sd$5.para.server_url).hostname,r=_$5.URL(sd$5.para.server_url).searchParams.get("project")||"default"}catch(n){sd$5.log(n)}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)return e;var r,n,i=e.callback;if(sd$5.bridge.bridge_info.verify_success){var a=document.createElement("iframe"),s=(r=e.data,n=(n=JSON.stringify(_$5.extend({server_url:sd$5.para.server_url},r))).replace(/\r\n/g,""),"sensorsanalytics://trackEvent?event="+(n=encodeURIComponent(n)));return a.setAttribute("src",s),document.documentElement.appendChild(a),a.parentNode.removeChild(a),a=null,_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),!0}return sd$5.para.app_js_bridge.is_send?(sd$5.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(_$5.isFunction(i)&&i(),t.cancellationToken.cancel(),e)}var index$7=createPlugin$7(IOSObsoleteBridge,"IOSObsoleteBridge","sdkAfterInitPara"),sdkversion_placeholder$9="1.26.9";function wrapPluginInitFn$8(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$8(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$8(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}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\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},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(){if(!0!==this.page_hidden_status){var 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 e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},PageLeave.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.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;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},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;e>=0;e--){var t=window.localStorage.key(e);if(t&&t!==this.storage_name+"-"+this.page_id&&0===t.indexOf(this.storage_name+"-")){var r=this.sd.store.readObjectVal(t);this._.isObject(r)&&1*new Date-r.time>r.heartbeat_interval_time+5e3&&(delete r.heartbeat_interval_time,r._flush_time=(new Date).getTime(),this.sd.kit.sendData(r),this.delHeartBeatData(t))}}},PageLeave.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var pageLeave=new PageLeave,index$8=createPlugin$8(pageLeave,"PageLeave","sdkReady"),sdkversion_placeholder$a="1.26.9";function wrapPluginInitFn$9(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$9(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$9(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){function r(){var n=0,i=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,a={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(i?(n=function(t){var r=0;return e._.isFunction(t.getEntriesByType)&&(r=((t.getEntriesByType("navigation")||[{}])[0]||{}).domContentLoadedEventEnd||0),r}(i)||function(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}(i),function(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}(i,a)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),n>0){var s=e._.isObject(t)&&t.max_duration||1800;n=Number((n/1e3).toFixed(3)),(!e._.isNumber(s)||s<=0||n<=s)&&(a.event_duration=n)}eventSent||(e.track("$WebPageLoad",a),eventSent=!0),window.removeEventListener?window.removeEventListener("load",r):window.detachEvent&&window.detachEvent("onload",r)}"complete"==document.readyState?r():window.addEventListener?window.addEventListener("load",r):window.attachEvent&&window.attachEvent("onload",r)}},index$9=createPlugin$9(PageLoad,"PageLoad","sdkReady");function addProperties(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),s=t.customRegister,o=a.properties,l=a.event,d={};return n.each(s,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(d=n.extend(d,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:o,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(d=n.extend(d,t))}}),e.properties=n.extend(o,d),e}function RegisterProperties(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}RegisterProperties.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return addProperties(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.register=function(e){this.sd?this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},RegisterProperties.prototype.hookRegister=function(e){this.sd?this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef"):this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var sdkversion_placeholder$b="1.26.9";function wrapPluginInitFn$a(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$a(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$a(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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="1.26.9";function wrapPluginInitFn$b(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$b(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$b(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=_sd._.extend(e.properties||{},n)}}catch(i){_log("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}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 \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):_log("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},index$b=createPlugin$b(RegisterPropertyPageHeight,"RegisterPropertyPageHeight","sdkReady"),sdkversion_placeholder$d="1.26.9";function wrapPluginInitFn$c(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$c(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$c(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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-1)return!0;return!1},getPartHash:function(e){var t=this.option.length;if(t)for(var r=0;r-1)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=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(e),i="";if(n){var a,s=n[1]||"",o=n[2]||"",l=n[3]||"",d="_sasdk="+this.getCurrenId(),c=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(d):n.push(e)}),n.join("&")};if(this.getPartHash(e))a=l.indexOf("_sasdk"),i=l.indexOf("?")>-1?a>-1?s+o+"#"+l.substring(1,a)+c(l.substring(a,l.length)):s+o+l+"&"+d:s+o+"#"+l.substring(1)+"?"+d;else a=o.indexOf("_sasdk"),i=/^\?(\w)+/.test(o)?a>-1?s+"?"+c(o.substring(1))+l:s+o+"&"+d+l:s+"?"+d+l;return t&&(t.href=i),i}},getUrlId:function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},setRefferId:function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);(r=r.substring(1))!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},addListen:function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),s=i.parentNode;if("a"===a&&i.href||s&&s.tagName&&"a"===s.tagName.toLowerCase()&&s.href){"a"===a&&i.href?(r=i.href,n=i):(r=s.href,n=s);var o=e._.URL(r).protocol;"http:"!==o&&"https:"!==o||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},init:function(e,t){this.sd=e,this._=e._,this.store=e.store,this.para=e.para,this._.isObject(t)&&this._.isArray(t.linker)&&t.linker.length>0?(this.setRefferId(t),this.addListen(),this.option=t.linker,this.option=function(t){for(var r=t.length,n=[],i=0;i=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$d(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(){return function(){var e=source_channel_standard$1.split(" "),t="",r={};sd$6._.isArray(sd$6.para.source_channel)&&sd$6.para.source_channel.length>0&&(e=e.concat(sd$6.para.source_channel),e=sd$6._.unique(e));return 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="1.26.9";function wrapPluginInitFn$e(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$e(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$e(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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="1.26.9";function wrapPluginInitFn$f(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$f(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$f(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function sendData$4(e,t){if(!0===sd$8.para.debug_mode){var r=e.data;e.callback;debugPath(JSON.stringify(r)),t.cancellationToken.stop()}return 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.server_url)?sd$8.para.debug_mode_url=sd$8.para.server_url.replace("sa.gif","debug"):_$6.isArray(sd$8.para.server_url)&&_$6.isString(sd$8.para.server_url[0])?sd$8.para.debug_mode_url=sd$8.para.server_url[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="1.26.9";function wrapPluginInitFn$g(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$g(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$g(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$g(e,t,r){return wrapPluginInitFn$g(e,t,r),e.plugin_version=sdkversion_placeholder$h,e}function sendData$5(e,t){if(_$7.isObject(sd$9.para.jsapp)&&!sd$9.para.jsapp.isOnline&&"function"==typeof sd$9.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sd$9.para.jsapp.setData(r),t.cancellationToken.stop()}return 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){if(!0===e&&_$7.isObject(sd$9.para.jsapp)&&"function"==typeof sd$9.para.jsapp.getData){sd$9.para.jsapp.isOnline=!0;var t=sd$9.para.jsapp.getData();_$7.isArray(t)&&t.length>0&&_$7.each(t,function(e){_$7.isJSONString(e)&&sd$9.kit.sendData(JSON.parse(e))})}else 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="1.26.9";function wrapPluginInitFn$h(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$h(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$h(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$i(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){var r=null,n=null;if(_$9.isObject(e.config)&&(r=e.config.send_type,n=_$9.optimizeServerUrl(e.config.server_url)),("beacon"===r||!r&&"beacon"===sd$b.para.send_type)&&_$9.isSupportBeaconSend()){var i=n||e.server_url;e.server_url=i,e.data=sd$b.kit.encodeTrackData(e.data),_$9.isArray(i)&&i.length?_$9.each(i,function(t){e.callback=null,e.server_url=t,sendData$7(e)}):"string"==typeof i&&""!==i?sendData$7(e):sd$b.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$3(){"beacon"!==sd$b.para.send_type||_$9.isSupportBeaconSend()||(sd$b.para.send_type="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="1.26.9";function wrapPluginInitFn$j(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$j(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$j(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}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(e,t){var r=null,n=null;if(_$a.isObject(e.config)&&(r=e.config.send_type,n=_$a.optimizeServerUrl(e.config.server_url)),("ajax"===r||!r&&"ajax"===sd$c.para.send_type)&&_$a.isSupportCors()){var i=n||e.server_url;e.server_url=i,e.data=sd$c.kit.encodeTrackData(e.data),_$a.isArray(i)&&i.length?_$a.each(i,function(t){e.callback=null,e.server_url=t,sendData$8(e)}):"string"==typeof i&&""!==i?sendData$8(e):sd$c.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function initPara$4(){"ajax"!==sd$c.para.send_type||_$a.isSupportCors()||(sd$c.para.send_type="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="1.26.9";function wrapPluginInitFn$k(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$k(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$k(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$k(e,t,r){return wrapPluginInitFn$k(e,t,r),e.plugin_version=sdkversion_placeholder$l,e}function getSendUrl(e,t){var r=sd$d.kit.encodeTrackData(t);return-1!==e.indexOf("?")?e+"&"+r:e+"?"+r}function sendData$9(e){new _$b.ImageSend(e).start()}function sendInterceptor$2(e,t){var r=null;_$b.isObject(e.config)&&(r=_$b.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,_$b.isArray(n)&&n.length?_$b.each(n,function(t){t&&(e.data=getSendUrl(t,i),e.callback=null,e.server_url=t,sendData$9(e))}):"string"==typeof n&&""!==n?(e.data=getSendUrl(n,i),sendData$9(e)):sd$d.logger&&sd$d.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function initPara$5(){"image"!==sd$d.para.send_type&&"ajax"!==sd$d.para.send_type&&"beacon"!==sd$d.para.send_type&&(sd$d.para.send_type="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}})})}var ImageSender={plugin_name:"ImageSender",init:function(e){_$b=(sd$d=e)._,senderInit$5()}},index$k=createPlugin$k(ImageSender);function wrapPluginInitFn$l(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){if(wrapLogFn$l(i,e,t),i.readyState&&i.readyState.state>=3||!i.on)return s();function s(){n.call(e,i,a)}i.on(r,s)}}return e}function wrapLogFn$l(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function createPlugin$l(e,t,r){return wrapPluginInitFn$l(e,t,r),e.plugin_version=sdkversion_placeholder,e}var _sd$1=null,_$c=null,_cacheLogs=[],ConsoleLogger={init:function(e){e&&(_$c=(_sd$1=e)._,_sd$1.logger&&_sd$1.logger.appendWriter(logWriter),_sd$1.on&&_sd$1.on("sdkAfterInitPara",function(){for(var e=0;e<_cacheLogs.length;e++)printLog(_cacheLogs[e]);_cacheLogs=null}),_sd$1.on&&_sd$1.on("sdkInitAPI",function(){_sd$1.enableLocalLog=enableLocalLog,_sd$1.disableLocalLog=disableLocalLog}))}},consoleLogger=createPlugin$l(ConsoleLogger,"ConsoleLogger");function logWriter(e){null!==_cacheLogs?_cacheLogs.push(e):printLog(e)}function printLog(e){try{if("log"===e.level&&canLog())return void writeLog(e);if("warn"===e.level&&canWarn())return void writeLog(e);if("error"===e.level&&canError())return void writeLog(e)}catch(t){}}function canLog(){return!!isLocalLogEnabled()||(!0===_sd$1.para.show_log||_$c.isObject(_sd$1.para.show_log)&&"log"===_sd$1.para.show_log.level)}function canWarn(){return!!isLocalLogEnabled()||(canLog()||_$c.isObject(_sd$1.para.show_log)&&"warn"===_sd$1.para.show_log.level)}function canError(){return!!isLocalLogEnabled()||(!_$c.isObject(_sd$1.para.show_log)||"none"!==_sd$1.para.show_log.level)}function writeLog(e){var t=e.content,r=_$c.isObject(t[0])?_$c.formatJsonString(t[0]):t[0],n=getLogHead(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(_$c.isFunction(console[e.level])?console[e.level].apply(console,t):_$c.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function getLogHead(e){var t="",r="",n=_sd$1.para.show_log;return _$c.isObject(n)&&!1===n.show_brand||(t+=e.brand),_$c.isObject(n)&&!1===n.show_level||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),_$c.isObject(n)&&!1===n.show_module||(r=e.module),t+r}var debugTag="sensorsdata_jssdk_debug";function enableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.setItem(debugTag,"true")}function disableLocalLog(){_$c.sessionStorage.isSupport()&&sessionStorage.removeItem(debugTag)}function isLocalLogEnabled(){return _$c.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(debugTag)}sd.modules=sd.modules||{};for(var builtinPlugins=[consoleLogger,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=[consoleLogger,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 Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("https://www.sensorsdata.cn/"),"https://www.sensorsdata.cn/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{d(e)||(e=String(e)),e=p(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void zi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new Qi(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement||a.target;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(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){zi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(ea&&e.forEach===ea)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText),i.status):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){zi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(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 j(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}function I(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(p){zi.log(p)}n&&d()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function T(e){return k(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 A(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function D(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=2&&!/^(\d+\.)+\d+$/.test(r))for(var i="."+n.splice(n.length-1,1);n.length>0;)if(i="."+n.splice(n.length-1,1)+i,document.cookie=t+"=true; path=/; domain="+i,document.cookie.indexOf(t+"=true")!==-1){var a=new Date;return a.setTime(a.getTime()-1e3),document.cookie=t+"=true; expires="+a.toGMTString()+"; path=/; SameSite=Lax; domain="+i,i}return""}function J(e){function t(e,t){e=p(e);var r;if("body"===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 o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){zi.log(o)}return i&&_(i)?r(i):null}if(!d(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=p(e.textContent):e.innerText&&(r=p(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 q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){zi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function V(e,t){var r=g(e),n=r.searchParams.get(t)||"";if(!n){var i=r.hash;if(i){var a=F(i);n=a[t]||""}}return n}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){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(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){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 Z(e){return d(e)?(e=p(e),A(e)):A(location.href)}function G(e){return d(e)?(e=p(e),A(e)):A(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function pe(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!d(t.callbackName))return zi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(n.defer="defer",i.appendChild(n),ce(t.timeout)){var s=Math.min(t.timeout,3e5);a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){zi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},s)}if(window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){zi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var l=[];k(t.data,function(e,t){l.push(t+"="+e)}),t.data=l.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){zi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=encodeURI(t.url)}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.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;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.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 he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,d)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else d(i)||ce(i)||$(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function it(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function at(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function ot(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))ot(e[a]);else if(d(i)){if(re(n,a)>-1)return;e[a]=it(i,re(t,a)>-1?1024:pa.max_string_length)}})}function st(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function lt(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};rt({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};rt({item_id:n},i)}}function ut(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&rt({propertyKey:n},i)})}function ct(e){var t=e.properties;ye(e),r(t)?(nt(t),at(t),st(e),ut(t),ot(t)):"properties"in e&&(e.properties={}),lt(e)}function dt(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function pt(e,t){try{var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,xa.getIdentities());var a={identities:i,distinct_id:xa.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,xa.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),"$UnbindID"===a.event&&(a.login_id&&delete a.login_id,a.anonymous_id&&delete a.anonymous_id),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},wa.properties(),xa.getProps(),xa.getSessionProps(),wa.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!d(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!d(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&d(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&d(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!d(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!d(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!d(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),d(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&$(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ha.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=qa.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),ka.checkIsAddSign(a),ka.checkIsFirstTime(a),Fe(a),Ve(a),a}catch(o){return{_debug_web_msg:String(o)}}}function ft(e){return Fa.stage.process("basicProps",e)}function gt(e){return Fa.stage.process("formatData",e)}function _t(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&Be(e.ele,"click",function(e){i(e)}))))}function ht(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function mt(e){return Wa.stage.process("webClickEvent",e)}function vt(e){return Wa.stage.process("webStayEvent",e)}function yt(){var e=wa.campaignParams(),t={};return k(e,function(e,r,n){(" "+Vi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function bt(e,t,r){if(Vi.is_first_visitor&&r){var n={};Vi.para.preset_properties.search_keyword_baidu&&xe(document.referrer)&&Te()&&(n.$search_keyword_id=ya.id(),n.$search_keyword_id_type=ya.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=$e(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:d(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:d(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:He(),$first_search_keyword:Ee()},yt(),n)),Vi.is_first_visitor=!1}}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=xa.getFirstId(),s=xa.getOriginDistinctId();if(!rt({distinct_id:n}))return je("login id is invalid"),!1;if(n===xa.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"), -!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(a)&&n===xa._state.first_id)return!1;var l=xa._state.history_login_id.name!==a||n!==xa._state.history_login_id.value;if(l){xa._state.identities[a]=n,xa.set("history_login_id",{name:a,value:n}),o||xa.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:xa._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];xa._state.identities=t,xa.save()}function kt(e,t){if(!rt({unbindKey:e,bindValue:t}))return!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(e)&&xa._state.identities[e]===t){var n=xa.getUnionId().login_id;n&&e+"+"+t===n&&(xa._state.distinct_id=xa._state.first_id,xa._state.first_id="",xa.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete xa._state.identities[e],xa.save())}var i={};return i[e]=t,i}function Pt(){Vi._t=Vi._t||1*new Date,Vi.is_first_visitor=!1,Vi.source_channel_standard=ga}function Ct(e){P(pa,e||Vi.para||{}),Vi.para=pa;var t={};if(r(Vi.para.is_track_latest))for(var n in Vi.para.is_track_latest)t["latest_"+n]=Vi.para.is_track_latest[n];Vi.para.preset_properties=P({},fa.preset_properties,t,Vi.para.preset_properties||{});var i;for(i in fa)void 0===Vi.para[i]&&(Vi.para[i]=fa[i]);"string"!=typeof Vi.para.web_url||"://"!==Vi.para.web_url.slice(0,3)&&"//"!==Vi.para.web_url.slice(0,2)||("://"===Vi.para.web_url.slice(0,3)?Vi.para.web_url=location.protocol.slice(0,-1)+Vi.para.web_url:Vi.para.web_url=location.protocol+Vi.para.web_url),ba.protocol.serverUrl(),Vi.bridge&&Vi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Vi.para.source_type&&(Vi.para.source_type.utm=v(Vi.para.source_type.utm)?Vi.para.source_type.utm.concat(a):a,Vi.para.source_type.search=v(Vi.para.source_type.search)?Vi.para.source_type.search.concat(o):o,Vi.para.source_type.social=v(Vi.para.source_type.social)?Vi.para.source_type.social.concat(s):s,Vi.para.source_type.keyword=r(Vi.para.source_type.keyword)?P(l,Vi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Vi.para.heatmap&&!r(Vi.para.heatmap)&&(Vi.para.heatmap={}),r(Vi.para.heatmap)){Vi.para.heatmap.clickmap=Vi.para.heatmap.clickmap||"default",Vi.para.heatmap.scroll_notice_map=Vi.para.heatmap.scroll_notice_map||"default",Vi.para.heatmap.scroll_delay_time=Vi.para.heatmap.scroll_delay_time||4e3,Vi.para.heatmap.scroll_event_duration=Vi.para.heatmap.scroll_event_duration||18e3,Vi.para.heatmap.renderRefreshTime=Vi.para.heatmap.renderRefreshTime||1e3,Vi.para.heatmap.loadTimeout=Vi.para.heatmap.loadTimeout||1e3,Vi.para.heatmap.get_vtrack_config!==!0&&(Vi.para.heatmap.get_vtrack_config=!1);var d=v(Vi.para.heatmap.track_attr)?U(Vi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),Vi.para.heatmap.track_attr=d,r(Vi.para.heatmap.collect_tags))if(Vi.para.heatmap.collect_tags.div===!0)Vi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Vi.para.heatmap.collect_tags.div)){if(Vi.para.heatmap.collect_tags.div.ignore_tags?v(Vi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Vi.para.heatmap.collect_tags.div.ignore_tags=c):Vi.para.heatmap.collect_tags.div.ignore_tags=c,Vi.para.heatmap.collect_tags.div.max_level){var p=[1,2,3];re(p,Vi.para.heatmap.collect_tags.div.max_level)===-1&&(Vi.para.heatmap.collect_tags.div.max_level=1)}}else Vi.para.heatmap.collect_tags.div=!1;else Vi.para.heatmap.collect_tags=u}Vi.para.server_url=Ge(Vi.para.server_url),Vi.para.noCache===!0?Vi.para.noCache="?"+(new Date).getTime():Vi.para.noCache="",Vi.para.callback_timeout>Vi.para.datasend_timeout&&(Vi.para.datasend_timeout=Vi.para.callback_timeout),Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&r(Vi.para.heatmap.collect_tags)&&k(Vi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Vi.heatmap.otherTags.push(t)}),Vi.para.heatmap&&"default"===Vi.para.heatmap.clickmap&&Vi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Za[t]?Za[t].apply(Za,r):void("function"==typeof t?t.apply(Vi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Vi,n),a.plugin_is_init=!0,Vi.modules=Vi.modules||{},Vi.modules[a.plugin_name||"unnamed_"+Qa++]=a,a}if(!d(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Vi.modules&&Vi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return d(t)&&(r(Vi.modules)&&r(Vi.modules[t])?a=Vi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Vi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){rt({event:e,properties:t})&&Va.send({type:"track",event:e,properties:t},r)}function It(e,t){return!!rt({bindKey:e,bindValue:t})&&(xa._state.identities[e]=t,xa.save(),void Va.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function Tt(e,t){var r=kt(e,t);r&&Va.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function At(e,t,r){"object"==typeof e&&e.tagName?_t({ele:e},t,r,Vi.track):"object"==typeof e&&e.target&&e.event&&_t(e,t,r,Vi.track)}function Dt(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void Be(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Vi.track(t,r,i)}))}function $t(e,t,r){rt({item_type:e,item_id:t,properties:r})&&Va.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){rt({item_type:e,item_id:t})&&Va.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set",properties:e},t)}function Lt(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){rt({propertiesMust:e})&&(k(e,function(t,r){d(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Va.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;d(e)&&(e={},e[n]=1),rt({propertiesMust:e})&&(r(e)?Va.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Bt(e){Va.send({type:"profile_delete"},e),xa.set("distinct_id",Gi()),xa.set("first_id","")}function Ht(e,t){var r=e,n={};d(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){d(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Va.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e){"number"==typeof e&&(e=String(e));var t=xa.getFirstId();if("undefined"==typeof e){var r=Gi();t?xa.set("first_id",r):xa.set("distinct_id",r)}else rt({distinct_id:e})&&(t?xa.set("first_id",e):xa.set("distinct_id",e))}function Mt(e){var t=xa.getFirstId();if(t)return je("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),"undefined"==typeof e){var r=Gi();xa._state.identities.$identity_cookie_id=r,xa.set("distinct_id",r)}else rt({distinct_id:e})&&(xa._state.identities.$identity_cookie_id=e,xa.set("distinct_id",e))}function qt(e,t,r,n){var i=xa.getFirstId()||xa.getDistinctId();xa.set("distinct_id",e),Va.send({original_id:i,distinct_id:xa.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function Kt(e,t,r,n){"number"==typeof e&&(e=String(e)),rt({distinct_id:e,event:t,properties:r})&&qt(e,t,r,n)}function Ft(e){rt({properties:e})?P(wa.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Vt(e){xa.clearAllProps(e)}function Wt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Vi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vapph5define.min.js"})}else t();else t()}function cr(t){Vi.para.is_track_single_page&&Oa.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){wa.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Vi.quick&&Vi.quick("autoTrack",i)}};if("boolean"==typeof Vi.para.is_track_single_page)i();else if("function"==typeof Vi.para.is_track_single_page){var a=Vi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function dr(){Vi._q&&v(Vi._q)&&Vi._q.length>0&&k(Vi._q,function(e){Vi[e[0]].apply(Vi,Array.prototype.slice.call(e[1]))}),r(Vi.para.heatmap)&&(Xa.initHeatmap(),Xa.initScrollmap())}function pr(){Vi.readyState.setState(3),new Vi.SDKJSBridge("visualized").onAppNotify(function(){ur("undefined"!=typeof sa_jssdk_app_define_mode?!0:!1)}),ur(!1),Vi.bridge.app_js_bridge_v1(),wa.initPage(),cr(),xa.init(),sr(),gr(),Vi.readyState.setState(4),dr()}function fr(){ro.isSeachHasKeyword()?ro.hasKeywordHandle():window.parent!==self&&no.isSearchHasKeyword()?no.verifyVtrackMode():ro.isWindowNameHasKeyword()?ro.windowNameHasKeywordHandle():ro.isStorageHasKeyword()?ro.storageHasKeywordHandle():window.parent!==self&&no.isStorageHasKeyword()?no.verifyVtrackMode():(pr(),no.notifyUser())}function gr(){qa.init(),"success"===Vi.bridge.bridge_info.verify_success&&Ha.init()}function _r(){k(io,function(t){var r=Vi[t];Vi[t]=function(){if(Vi.readyState.state<3)return v(Vi._q)||(Vi._q=[]),Ne("calling sdk api before init is deprecated."),Vi._q.push([t,arguments]),!1;if(!e(Vi.getDisabled)||!Vi.getDisabled())return Vi.readyState.getState()?r.apply(Vi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function hr(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 mr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new hr,this.sensors=r}function vr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function yr(e){e&&e.buildDataStage&&so.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&po.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&uo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&go.registerStageImplementation(e.viewStage)}function br(e,t){_o[e]&&_o[e](t)}function wr(){return ho.stage&&ho.stage.process("getUtmData")}function Sr(e){return mo.stage.process("send",e)}function kr(e){e.kit=vo,e.saEvent=Va,this.buildDataStage=Fa,this.sendDataStage=mo,this.businessStage=ho}function Pr(e){e.heatmap=Xa,this.viewStage=Wa}function Cr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};br("buildDataStage",r)}function Or(e){e&&(Vi.events=$a,Vi.bridge=to,Vi.SDKJSBridge=nr,Vi.JSBridge=or,Vi.store=xa,Vi.unlimitedDiv=Ja,Vi.customProp=Ma,Vi.vtrackcollect=qa,Vi.vapph5collect=Ha,Vi.detectMode=fr,Vi.registerFeature=yr,Vi.registerInterceptor=br,Vi.commonWays=Za,yr(new kr(Vi)),yr(new Pr(Vi)),br("viewStage",yo));var t=e?Ya:ao;for(var r in t)Vi[r]=t[r];Vi.logger=da,Vi.log=Oe,Vi._=eo,Vi.on=et,Vi.ee=Ca,Vi.use=Nt,Vi.lib_version=_a,Vi.registerPropertyPlugin=Cr}function Nr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ir(e,t,r){return Nr(e,t,r),e.plugin_version=Ho,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ar(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ar(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dr(e,t,r){return Tr(e,t,r),e.plugin_version=qo,e}function $r(e){return zo&&zo.call(Vo,JSON.stringify(e))}function xr(e){return Wo.call(Vo)&&Xo&&Xo.call(Vo,JSON.stringify(e))}function Er(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Lr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ur(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ur(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rr(e,t,r){return Lr(e,t,r),e.plugin_version=Go,e}function Br(){if(So=window.SensorsData_APP_New_H5_Bridge,ko=So&&So.sensorsdata_track,Po=ko&&So.sensorsdata_get_server_url&&So.sensorsdata_get_server_url(),No("---test---fail---",!Co,Co.bridge.activeBridge,!Po),Co&&!Co.bridge.activeBridge&&Po)return Co.bridge.activeBridge=Qo,Co.para.app_js_bridge&&!Co.para.app_js_bridge.is_mui&&(Co.bridge.is_verify_success=Po&&Co.bridge.validateAppUrl(Po),No("---test---bridge-verify-",Co.bridge.is_verify_success)),Co.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:Co.bridge.is_verify_success?"success":"fail",support_two_way_call:!!So.sensorsdata_js_call_app},Co.para.app_js_bridge?void Co.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}):void No("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function Hr(e,t){if(No("---test---datasend-",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return Co.bridge.is_verify_success?(No("---test---bridge-verify-success---",e.data),ko&&ko.call(So,JSON.stringify(Oo.extend({server_url:Co.para.server_url},e.data))),Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(No("---test---bridge-verify-fail-----",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_send?(Co.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e))}function Jr(e){var t=e.callType;return t in Zo.commands?Zo.commands[t](e,So):void(So&&Oo.isFunction(So.sensorsdata_js_call_app)&&So.sensorsdata_js_call_app(JSON.stringify(e)))}function Mr(e){return rs&&rs.call(es,JSON.stringify(e))}function qr(e){return ts.call(es)&&ns&&ns.call(es,JSON.stringify(e))}function Kr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Fr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wr(e,t,r){return Fr(e,t,r),e.plugin_version=as,e}function zr(){if(xo("ObsoleteBridge---test---init---"),jo=window.SensorsData_APP_JS_Bridge,Io=jo&&jo.sensorsdata_track,To=jo&&jo.sensorsdata_verify,Ao=jo&&jo.sensorsdata_visual_verify,xo("ObsoleteBridge-",Do.bridge.activeBridge,To,Io,Ao),Do&&!Do.bridge.activeBridge&&(To||Io||Ao)){Do.bridge.activeBridge=os;var e=To||Io;if(Ao&&(e=!!Ao.call(jo,JSON.stringify({server_url:Do.para.server_url})),xo("ObsoleteBridge---called-return",e)),Do.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Do.para.app_js_bridge)return void xo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Do.registerInterceptor("sendDataStage",{send:{priority:80,entry:Xr}}),xo("Android obsolete bridge inits succeed.")}}function Xr(e,t){if(xo("ObsoleteBridge---senddata"),Do.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(To){var n=To&&To.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data)));return xo("ObsoleteBridge---anVerify-success",n),n?($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Do.para.app_js_bridge.is_send?(Do.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return xo("ObsoleteBridge---is-send-old-way",Do.para.app_js_bridge.is_send),Io&&Io.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data))),$o.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Zr(e){xo("ObsoleteBridge---handleCommadn");var t=e.callType;return t in is.commands?(xo("ObsoleteBridge---",t,is.commands),is.commands[t](e,jo)):jo&&$o.isFunction(jo.sensorsdata_js_call_app)?(xo("ObsoleteBridge---handleCommadn-abridge"),jo.sensorsdata_js_call_app(JSON.stringify(e))):void 0}function Gr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Qr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Qr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Yr(e,t,r){return Gr(e,t,r),e.plugin_version=ls,e}function en(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return tn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function tn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function rn(e,t,r){return en(e,t,r),e.plugin_version=ds,e}function nn(){return"undefined"!=typeof Bo&&document[Bo]}function an(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return on(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function on(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function sn(e,t,r){return an(e,t,r),e.plugin_version=Ds,e}function ln(){if(fs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,gs=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},_s&&!_s.bridge.activeBridge&&gs()&&gs().postMessage){if(_s.bridge.activeBridge=$s,_s.para.app_js_bridge&&!_s.para.app_js_bridge.is_mui&&(_s.bridge.is_verify_success=fs&&_s.bridge.validateAppUrl(fs)),_s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_s.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!_s.para.app_js_bridge)return void ms("app_js_bridge is not configured, data will not be sent by iOS bridge.");_s.registerInterceptor("sendDataStage",{send:{priority:70,entry:un}}),ms("IOS bridge inits succeed.")}}function un(e,t){if(_s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return _s.bridge.is_verify_success?(gs()&&gs().postMessage(JSON.stringify({callType:"app_h5_track",data:hs.extend({server_url:_s.para.server_url},e.data)})),hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e):_s.para.app_js_bridge.is_send?(_s.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function cn(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||_s.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?hs.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:gs()&&gs().postMessage(JSON.stringify(e)):null}function dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fn(e,t,r){return dn(e,t,r),e.plugin_version=Es,e}function gn(){if(vs&&!vs.bridge.activeBridge&&_n()){if(vs.bridge.activeBridge=Ls,vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:hn()?"success":"fail"},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:90,entry:mn}}),bs("IOS obsolete bridge inits succeed.")}}function _n(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function hn(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=ys.URL(vs.para.server_url).hostname,r=ys.URL(vs.para.server_url).searchParams.get("project")||"default"}catch(n){vs.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function mn(e,t){function r(e){var t=JSON.stringify(ys.extend({server_url:vs.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(vs.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,ys.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(ys.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bn(e,t,r){return vn(e,t,r),e.plugin_version=Rs,e}function wn(){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=Hs}function Sn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return kn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o); -}}return e}function kn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Pn(e,t,r){return Sn(e,t,r),e.plugin_version=qs,e}function Cn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function On(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function In(e,t,r){return Nn(e,t,r),e.plugin_version=Ws,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return An(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function An(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dn(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function $n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function xn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return En(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function En(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ln(e,t,r){return xn(e,t,r),e.plugin_version=rl,e}function Un(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Rn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Rn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Bn(e,t,r){return Un(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Mn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function qn(){kl=!0}function Kn(){kl=!1}function Fn(){return kl}function Vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zn(e,t,r){return Vn(e,t,r),e.plugin_version=Nl,e}function Xn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Zn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback;Xn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Gn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Qn(){al.on("sdkInitPara",function(){Gn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Zn}})})}function Yn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ei(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ei(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ti(e,t,r){return Yn(e,t,r),e.plugin_version=Tl,e}function ri(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ni(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ii),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ri}})})}function ii(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function si(e,t,r){return ai(e,t,r),e.plugin_version=$l,e}function li(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fi(e,t,r){return di(e,t,r),e.plugin_version=Ul,e}function gi(e){var t=new pl.BeaconSend(e);t.start()}function _i(e,t){var r=null,n=null;pl.isObject(e.config)&&(r=e.config.send_type,n=pl.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===dl.para.send_type;if(i&&pl.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=dl.kit.encodeTrackData(e.data),pl.isArray(a)&&a.length?pl.each(a,function(t){e.callback=null,e.server_url=t,gi(e)}):"string"==typeof a&&""!==a?gi(e):dl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function hi(){"beacon"!==dl.para.send_type||pl.isSupportBeaconSend()||(dl.para.send_type="image")}function mi(){dl.on("sdkInitPara",function(){hi()}),dl.on("sdkAfterInitPara",function(){dl.registerInterceptor("sendDataStage",{send:{priority:110,entry:_i}})})}function vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bi(e,t,r){return vi(e,t,r),e.plugin_version=Hl,e}function wi(e){var t=new gl.AjaxSend(e);t.start()}function Si(e,t){var r=null,n=null;gl.isObject(e.config)&&(r=e.config.send_type,n=gl.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===fl.para.send_type;if(i&&gl.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=fl.kit.encodeTrackData(e.data),gl.isArray(a)&&a.length?gl.each(a,function(t){e.callback=null,e.server_url=t,wi(e)}):"string"==typeof a&&""!==a?wi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function ki(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function Pi(){fl.on("sdkInitPara",function(){ki()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:Si}})})}function Ci(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ni(e,t,r){return Ci(e,t,r),e.plugin_version=ql,e}function ji(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function Ii(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=null;hl.isObject(e.config)&&(r=hl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,hl.isArray(n)&&n.length?hl.each(n,function(t){t&&(e.data=ji(t,i),e.callback=null,e.server_url=t,Ii(e))}):"string"==typeof n&&""!==n?(e.data=ji(n,i),Ii(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ai(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function Di(){_l.on("sdkInitPara",function(){Ai()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function $i(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ei(e,t,r){return $i(e,t,r),e.plugin_version=_a,e}function Li(e){return null===zl?void Ui(e):void zl.push(e)}function Ui(e){try{if("log"===e.level&&Ri())return void Ji(e);if("warn"===e.level&&Bi())return void Ji(e);if("error"===e.level&&Hi())return void Ji(e)}catch(t){}}function Ri(){return!!Fi()||(Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level)}function Bi(){return!!Fi()||(Ri()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level)}function Hi(){return!!Fi()||(!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level)}function Ji(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Mi(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Mi(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function Ki(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Fi(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Vi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new d((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new d((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new d((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var p,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),p=5==n.a.length&&1===n.a[0],p&&(a(function(){p=!f('"\t"')}),p&&a(function(){p=1!==f("01")}),p&&a(function(){p=1!==f("1.")})))},function(){p=!1}),t=p}}return o[e]=!!t}function s(e){return D(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,d=n.Date||r.Date,p=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new d((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T="000000",A=function(e,t){return(T+(t||0)).slice(-e)},D=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],p=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;p(r+1,0)<=i;r++);for(n=c((i-p(r,0))/30.42);p(r,n+1)<=i;n++);i=1+i-p(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(D=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+A(6,r<0?-r:r):A(4,r))+"-"+A(2,n+1)+"-"+A(2,i)+"T"+A(2,o)+":"+A(2,s)+":"+A(2,l)+"."+A(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var $=i.stringify;i.stringify=function(e,t,r){var n=d.prototype.toJSON;d.prototype.toJSON=s;var i=$(e,t,r);return d.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=I[t];return r?r:x+A(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,p,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===d.prototype.toJSON?l=D(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),p=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,B));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++B);e+=a.slice(t,B)}if(34==a.charCodeAt(B))return B++,e;q();default:if(t=B,45==i&&(n=!0,i=a.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(B+1),i>=48&&i<=57)&&q(),n=!1;B=48&&i<=57);B++);if(46==a.charCodeAt(B)){for(r=++B;r57));r++);r==B&&q(),B=r}if(i=a.charCodeAt(B),101==i||69==i){for(i=a.charCodeAt(++B),43!=i&&45!=i||B++,r=B;r57));r++);r==B&&q(),B=r}return+a.slice(t,B)}n&&q();var s=a.slice(B,B+4);if("true"==s)return B+=4,!0;if("fals"==s&&101==a.charCodeAt(B+4))return B+=5,!1;if("null"==s)return B+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return B=0,H=""+e,r=F(K()),"$"!=K()&&q(),B=H=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Wi,zi={setup:function(e){Wi=e},log:function(){(Wi||console&&console.log||function(){}).apply(null,arguments)}},Xi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Xi.get(e))||null}catch(r){zi.log("parse localStorage failed")}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){zi.log("localStorage is not support")}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Xi.set(t,r),Xi.get(t)!==r&&(e=!1),Xi.remove(t)}catch(n){e=!1}return e}},Zi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Xi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Xi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Xi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Xi.get(e)),Xi.remove(e),Xi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Xi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Xi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Xi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Xi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.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=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Qi=function(e){this.ele=e},Yi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Qi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(t)?this.ele.getAttribute(e):("string"==typeof e&&(t=String(t),this.ele.setAttribute(e,t)),this)},offset:function(){try{var e=this.ele.getBoundingClientRect(),t=this.ele.ownerDocument,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.clientLeft}}catch(n){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),y(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||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=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 Yi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Yi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},ka={checkIsAddSign:function(e){"track"===e.type&&(Re()?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,n=va.get("sensorsdata2015jssdkcross"+Vi.para.sdk_id);n=Vi.kit.userDecryptIfNeeded(n);var i={};null!=n&&ue(n)&&(i=JSON.parse(n),i.$device_id&&(r=i.$device_id)),r=r||e,Vi.para.cross_subdomain===!0?t.set("$device_id",r):(i.$device_id=r,i=JSON.stringify(i),Vi.para.encrypt_cookie&&(i=Vi.kit.userEncrypt(i)),va.set("sensorsdata2015jssdkcross"+Vi.para.sdk_id,i,null,!0)),Vi.para.is_track_device_id&&(wa.currentProps.$device_id=r)},storeInitCheck:function(){if(Vi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};va.isSupport()?va.set(Ue("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):Sa.set(Sa.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Re()||(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)}}},Pa=function(){this._events=[],this.pendingEvents=[]};Pa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(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():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Ca={},Oa=new l;Ca.spa=Oa,Ca.sdk=new l,Ca.data=new l,Ca.initSystemEvent=function(){Ye(function(e){Oa.emit("switch",e)})},Ca.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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var Na=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};Na.prototype.start=function(){var e=this,t=new Date;Ze({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(r,n){Ca.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){Ca.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},Na.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var ja="sawebjssdk-",Ia="tab-sawebjssdk-";tt.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()},pa.batch_send.send_interval)},getServerUrl:function(){return d(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),Xi.remove(e[n])}r=Ce(r),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=ja+String(n()),a=Xi.get(this.tabKey);null===a?(this.tabKey=Ia+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,Xi.set(this.tabKey,JSON.stringify(a)),Vi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Ia+String(n()),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var d=new a(n);d.get(s,r,1e3,function(e){if(e){null===Xi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Xi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Xi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var p=i(Xi.get(s))||{expireTime:0};t()-p.expireTime>r&&Xi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!d(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!d(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=xa._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},Ua={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ea[n])&&Ea[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ea[n])&&Ea[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ea[n])&&Ea[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){rt({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ea[i])&&Ea[i](n)),!0};rt({propertyValue:t},n)}):La.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ea[n])&&Ea[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ea[n])&&Ea[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=p(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ra.configIsMatchNew=function(e,t){if(d(e.$element_selector)&&d(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 e.$element_selector.indexOf(t.element_selector)>-1}if(d(e.$element_path)&&d(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 e.$element_path.indexOf(t.element_path)>-1}return!1},Ra.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"]?Ra.configIsMatchNew(e,t):Ra.configIsMatchOldVersion(e,t)))},Ra.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(Ra.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},Ra.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ra.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ra.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ra.getPropElInLi=function(e,t){if(!(e&&_(e)&&d(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Vi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ra.getProp=function(e,t){if(!r(e))return!1;if(!(d(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(d(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!d(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Vi.heatmap.getClosestLi(s);o=Ra.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!d(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ra.getAssignConfigs=function(e,t){var n=Ra.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ba={events:[],getAssignConfigs:Ra.getAssignConfigs,filterConfig:Ra.filterConfig,getProp:Ra.getProp,initUrl:Ra.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),d(a.event_name)&&n.push(a.event_name))}),Vi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Vi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Vi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ha={events:[],customProp:Ba,getAssignConfigs:Ra.getAssignConfigs,initUrl:Ra.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Vi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Vi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ja={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=qa.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Vi.heatmap.getEleDetail(e);if(!r(t)||!d(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,qa.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ra.getProp,getPropElInLi:Ra.getPropElInLi,filterConfig:Ra.filterConfig},qa={unlimitedDiv:Ja,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ma,initUrl:function(){var e=Ra.initUrl();if(e){var t;try{t=new f(Vi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Vi.para.heatmap)||!Vi.para.heatmap.get_vtrack_config)return!1;if(Xi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=xa.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Vi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Vi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Xa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Xa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(!d(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){var t=function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&d(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null};return t(e,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Vi.heatmap.getClosestLi(e);if(!i||!_(e)||!d(e.tagName))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Vi.is_heatmap_render_mode=!0,Vi.para.heatmap||(Vi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Vi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Vi.para.heatmap_url||(Vi.para.heatmap_url=ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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=We({target:e});r.$element_selector=t?t:"",r.$element_path=Vi.heatmap.getElementPath(e,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);var n=Vi.heatmap.getElementPosition(e,r.$element_path,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Vi.para.heatmap)&&e(Vi.para.heatmap.collect_element)&&!Vi.para.heatmap.collect_element(n))return!1;var s=Xa.getBasicEleInfo(t,n,i,a,o);mt(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Vi.para.heatmap&&Vi.para.heatmap.custom_property){var c=Vi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div?!!(r(Vi.para.heatmap)&&r(Vi.para.heatmap.collect_tags)&&r(Vi.para.heatmap.collect_tags.div)&&v(Vi.para.heatmap.collect_tags.div.ignore_tags)&&re(Vi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Vi.para&&Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Vi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.scroll_notice_map)return!1;var t=!0;Vi.para.scrollmap&&e(Vi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Vi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Vi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Vi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,vt(e)),this.current_time=n}});i.current_time=new Date,Be(window,"scroll",function(){return!!t&&void i.go()}),Be(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.clickmap)&&(e(Vi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Vi.para.heatmap.collect_url()}),"all"===Vi.para.heatmap.collect_elements?Vi.para.heatmap.collect_elements="all":Vi.para.heatmap.collect_elements="interact",void("all"===Vi.para.heatmap.collect_elements?Be(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=d(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):Be(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Vi.heatmap.getTargetElement(a,e);return!(!_(o)&&!d(a.tagName))&&void(_(o)&&d(o.tagName)?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Vi.para.heatmap)&&Vi.para.heatmap.get_vtrack_config&&Ja.events.length>0&&Ja.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"}))})))}},Za={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Vi.log("error: isReady callback must be function")},getUtm:function(){return wa.campaignParams()},getStayTime:function(){return(new Date-Vi._t)/1e3},setProfileLocal:function(e){if(!Xi.isSupport())return Vi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=xa.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(xa.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Vi.setProfile(e))}else xa.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Vi.setProfile(e)},setInitReferrer:function(){var e=$e();Vi.setOnceProfile({_init_referrer:e,_init_referrer_host:wa.pageProp.referrer_host})},setSessionReferrer:function(){var e=$e();xa.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:wa.pageProp.referrer_host})},setDefaultAttr:function(){wa.register({_current_url:location.href,_referrer:$e(),_referring_host:wa.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Vi.para.heatmap&&Vi.para.heatmap.track_attr?Vi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Xa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Xa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Vi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,yt()),t),i=Z()}var i;i=this.autoTrackIsUsed?wa.pageProp.url:wa.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,bt(Vi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=yt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Vi.para.is_single_page&&w(function(){var r=$e(a,!0);Vi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Vi.track("$pageview",P({$referrer:$e(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),bt(Vi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(xa._state)?"SDK is not initialized.":xa.getAnonymousId()},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Vi.modules)&&Vi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Vi.use.apply(Vi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:It,unbind:Tt,trackLink:At,trackLinks:Dt,setItem:$t,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Bt,unsetProfile:Ht,identify:Jt,resetAnonymousIdentity:Mt,trackSignup:Kt,registerPage:Ft,clearAllRegister:Vt,clearPageRegister:Wt,register:zt,registerOnce:Xt,registerSession:Zt,registerSessionOnce:Gt,login:Qt,loginWithKey:Yt,logout:er,getPresetProperties:tr,readyState:Ga,debug:ba,on:et,log:Oe};zi.setup(Oe);var eo=P({},ua,Da),to={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:Vi.para.use_app_track_is_send!==!1&&"only"!==Vi.para.use_app_track,white_list:[],is_mui:"mui"===Vi.para.use_app_track};"object"==typeof Vi.para.app_js_bridge?Vi.para.app_js_bridge=P({},e,Vi.para.app_js_bridge):Vi.para.use_app_track!==!0&&Vi.para.app_js_bridge!==!0&&"only"!==Vi.para.use_app_track&&"mui"!==Vi.para.use_app_track||(Vi.para.app_js_bridge=P({},e)),Vi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Vi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ar};nr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),ir(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},nr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},nr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),ir(r)},or.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Vi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==V(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=V(e,"sa-request-id")||null,r=V(e,"sa-request-type")||null,n=V(e,"sa-request-url")||null;if(Xa.setNotice(n),aa.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Vi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Vi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Vi.heatmap_version&&Vi.heatmap_version===Vi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Vi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Xa.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=d(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&d(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return d(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Xa.setNotice(i),aa.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(lr("sa-visual-mode")===!0||"true"===lr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Vi.para.vtrack_url?Vi.para.vtrack_url:ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vtrack.min.js"})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(aa.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var t=e.data.data.userURL;d(t)&&(window.location.href=encodeURI(t.replace(/javascript:/i,"")))}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:_a}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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){}};vr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new mr(t,n,Vi),a=0;a=2)&&(wo&&(Or(!0),_r()),Ca.initSystemEvent(),Vi.setInitVar(),Vi.readyState.setState(2),Vi.initPara(e),Ca.sdk.emit("initPara"),Ca.sdk.emit("afterInitPara"),Ca.sdk.emit("initAPI"),Ca.sdk.emit("afterInitAPI"),Vi.detectMode(),rr(),Ca.sdk.emit("afterInit"),void Ca.sdk.emit("ready"))},wo?Or(!1):(Or(!0),_r());var So,ko,Po,Co,Oo,No,jo,Io,To,Ao,Do,$o,xo,Eo,Lo,Uo,Ro,Bo,Ho="1.26.8",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=Ir(Jo),qo="1.26.8",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=Dr(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:$r,visualized_track:xr,page_info:xr,sensorsdata_get_app_visual_config:Er}},Go="1.26.8",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Br()},handleCommand:Jr},Yo=Rr(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Mr,visualized_track:qr,page_info:qr,sensorsdata_get_app_visual_config:Kr}},as="1.26.8",os={init:function(e){Do=e,$o=Do&&Do._,xo=Do&&Do.log||console&&console.log||function(){},zr()},handleCommand:Zr},ss=Wr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.26.8",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"),!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Ts.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Ts.data=e,Ts.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Ts.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Is(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(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=ps().visibilityChange,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},As=rn(Ts,"Deeplink","sdkReady"),Ds="1.26.8",$s={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},ln()},handleCommand:cn},xs=sn($s,"IOSBridge","sdkAfterInitPara"),Es="1.26.8",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},gn()}},Us=fn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.26.8",Bs=5e3,Hs=432e3;wn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},wn.prototype.log=function(e){this.sd&&this.sd.log(e)},wn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Bs)},wn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},wn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},wn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&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()}},wn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},wn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},wn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},wn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},wn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},wn.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()}})},wn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},wn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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()},wn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},wn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},wn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},wn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},wn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new wn,Ms=bn(Js,"PageLeave","sdkReady"),qs="1.26.8",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=Pn(Fs,"PageLoad","sdkReady");On.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Cn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.26.8";On.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new On,Gs=In(Zs),Qs="1.26.8",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=$n,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=Dn(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.26.8",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var p=u.indexOf("?");a=p>-1?o>-1?s+l+"#"+u.substring(1,o)+d(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+d(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,dl,pl,fl,gl,_l,hl,ml=Ln(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.26.8",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Bn(bl,"Utm","sdkAfterInitPara"),Sl="1.26.8",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=qn,Pl.enableSDK=Kn,Pl.getDisabled=Fn}},Ol=Mn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.26.8",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Qn()}},Il=zn(jl),Tl="1.26.8",Al={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ni()}},Dl=ti(Al),$l="1.26.8",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ci()}},Ll=si(El),Ul="1.26.8",Rl={plugin_name:"BeaconSender",init:function(e){dl=e,pl=dl._,mi()}},Bl=fi(Rl),Hl="1.26.8",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,Pi()}},Ml=bi(Jl),ql="1.26.8",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,Di()}},Fl=Ni(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Li),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e Invalid URL");var r=e.split("#"),n=r[0],i=r.slice(1).join("#");t=this._regex.exec(n);for(var a in this._fields)"undefined"!=typeof t[this._fields[a]]&&(this._values[a]=t[this._fields[a]]);this._values.Hostname=this._values.Host.replace(/:\d+$/,""),this._values.Origin=this._values.Protocol+"://"+this._values.Hostname,this._values.Fragment=i},new t(e)}function g(e){var t={},r=function(){var e;try{return e=new URL("http://modernizr.com/"),"http://modernizr.com/"===e.href}catch(t){return!1}};if("function"==typeof window.URL&&r())t=new URL(e),t.searchParams||(t.searchParams=function(){var e=c(t.search);return{get:function(t){return e[t]}}}());else{d(e)||(e=String(e)),e=p(e);var n=/^https?:\/\/.+/;if(n.test(e)===!1)return void zi.log("Invalid URL");var i=f(e);t.hash=i._values.Fragment,t.host=i._values.Host?i._values.Host+(i._values.Port?":"+i._values.Port:""):"",t.href=i._values.URL,t.password=i._values.Password,t.pathname=i._values.Path,t.port=i._values.Port,t.search=i._values.QueryString?"?"+i._values.QueryString:"",t.username=i._values.Username,t.hostname=i._values.Hostname,t.protocol=i._values.Protocol?i._values.Protocol+":":"",t.origin=i._values.Origin?i._values.Origin+(i._values.Port?":"+i._values.Port:""):"",t.searchParams=function(){var e=c("?"+i._values.QueryString);return{get:function(t){return e[t]}}}()}return t}function _(e){return!(!e||1!==e.nodeType)}function h(e){return void 0===e}function v(t){return Array.isArray&&e(v)?Array.isArray(t):"[object Array]"===Object.prototype.toString.call(t)}function y(e){return new Qi(e)}function b(e,t,r,n){function i(e){return e&&(e.preventDefault=i.preventDefault,e.stopPropagation=i.stopPropagation,e._getPath=i._getPath),e}function a(e,t,r,n){var a=function(a){if(a=a||i(window.event)){a.target=a.srcElement;var o,s,l=!0;return"function"==typeof r&&(o=r(a)),s=t.call(e,a),"beforeunload"!==n?(!1!==o&&!1!==s||(l=!1),l):void 0}};return a}i._getPath=function(){var e=this;return this.path||this.composedPath&&this.composedPath()||y(e.target).getParents()},i.preventDefault=function(){this.returnValue=!1},i.stopPropagation=function(){this.cancelBubble=!0};var o=function(e,t,r){if(void 0===n&&"click"===t&&(n=!0),e&&e.addEventListener)e.addEventListener(t,function(e){e._getPath=i._getPath,r.call(this,e)},n);else{var o="on"+t,s=e[o];e[o]=a(e,r,s,t)}};o.apply(null,arguments)}function w(e){var t="pushState"in window.history?"popstate":"hashchange";b(window,t,e)}function S(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){zi.log(t)}}}function k(e,t,r){if(null==e)return!1;if(ea&&e.forEach===ea)e.forEach(t,r);else if(v(e))for(var n=0,i=e.length;n=200&&i.status<300||304==i.status?e.success(t(i.responseText)):e.error(t(i.responseText),i.status),i.onreadystatechange=null,i.onload=null)}catch(r){i.onreadystatechange=null,i.onload=null}},i.open(e.type,e.url,!0);try{e.credentials&&(i.withCredentials=!0),r(e.header)&&k(e.header,function(e,t){i.setRequestHeader&&i.setRequestHeader(t,e)}),e.data&&(e.cors||i.setRequestHeader&&i.setRequestHeader("X-Requested-With","XMLHttpRequest"),"application/json"===e.contentType?i.setRequestHeader&&i.setRequestHeader("Content-type","application/json; charset=UTF-8"):i.setRequestHeader&&i.setRequestHeader("Content-type","application/x-www-form-urlencoded"))}catch(l){zi.log(l)}i.send(e.data||null)}function O(e,t){var r=[];return null==e?r:Array.prototype.map&&e.map===Array.prototype.map?e.map(t):(k(e,function(e,n,i){r.push(t(e,n,i))}),r)}function N(e){var t=[];try{t=O(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 j(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}function I(e,t){t=t||window;var r=!1,n=!0,i=t.document,a=i.documentElement,o=i.addEventListener,s=o?"addEventListener":"attachEvent",l=o?"removeEventListener":"detachEvent",u=o?"":"on",c=function(n){"readystatechange"==n.type&&"complete"!=i.readyState||(("load"==n.type?t:i)[l](u+n.type,c,!1),!r&&(r=!0)&&e.call(t,n.type||n))},d=function(){try{a.doScroll("left")}catch(e){return void setTimeout(d,50)}c("poll")};if("complete"==i.readyState)e.call(t,"lazy");else{if(!o&&a.doScroll){try{n=!t.frameElement}catch(p){zi.log(p)}n&&d()}i[s](u+"DOMContentLoaded",c,!1),i[s](u+"readystatechange",c,!1),t[s](u+"load",c,!1)}}function T(e){return k(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 A(e){var t=e;try{t=decodeURI(e)}catch(r){t=e}return t}function D(e){var t="t6KJCZa5pDdQ9khoEM3Tj70fbP2eLSyc4BrsYugARqFIw1mzlGNVXOHiWvxUn8",r=t.length-1,n={},i=0;for(i=0;i=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,na.set(t,"true",0,null,r,"; domain="+a),document.cookie.indexOf(t+"=true")!==-1)return na.set(t,"true","-1s",null,r,"; domain="+a),a;return""}function J(e){function t(e,t){e=p(e);var r;if("body"===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 o=Number(a[1]);if(!(_(t)&&t.children&&t.children.length>0))return null;for(var s=t.children,l=0;l0)return null}return r?r:null}function r(e){var i,a=n.shift();if(!a)return e;try{i=t(a,e)}catch(o){zi.log(o)}return i&&_(i)?r(i):null}if(!d(e))return null;var n=e.split(">"),i=null;return i=r(),i&&_(i)?i:null}function M(e,t){var r="",n="";return e.textContent?r=p(e.textContent):e.innerText&&(r=p(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 q(e,t){t&&"string"==typeof t||(t="hostname\u89e3\u6790\u5f02\u5e38");var r=null;try{r=g(e).hostname}catch(n){zi.log("getHostname\u4f20\u5165\u7684url\u53c2\u6570\u4e0d\u5408\u6cd5\uff01")}return r||t}function K(){try{var e=navigator.appVersion.match(/OS (\d+)[._](\d+)[._]?(\d+)?/);return e&&e[1]?Number.parseInt(e[1],10):""}catch(t){return""}}function F(e,t){t=t.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),e=u(e);var r="[\\?&]"+t+"=([^&#]*)",n=new RegExp(r),i=n.exec(e);return null===i||i&&"string"!=typeof i[1]&&i[1].length?"":u(i[1])}function V(e){var t={},r=e.split("?"),n=r[1]||"";return n&&(t=c("?"+n)),t}function W(){return"undefined"!=typeof window.matchMedia||"undefined"!=typeof window.msMatchMedia}function z(){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(W()){var r=window.matchMedia||window.msMatchMedia;r("(orientation: landscape)").matches?t="landscape":r("(orientation: portrait)").matches&&(t="portrait")}return t}function X(){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 Z(e){return d(e)?(e=p(e),A(e)):A(location.href)}function G(e){return d(e)?(e=p(e),A(e)):A(location.pathname)}function Q(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0}function Y(e,t){if("string"==typeof t)return Q(e,t);if(v(t)){for(var r=!1,n=0;n0)for(var a=e.split(""),o=0;ot)for(i=r+i;l=n*i+s,lt;)i=i/2+s;i=n*i+s}return i}function re(e,t){var r=e.indexOf;if(r)return r.call(e,t);for(var n=0;n41||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}function pe(){return"undefined"!=typeof window.XMLHttpRequest&&("withCredentials"in new XMLHttpRequest||"undefined"!=typeof XDomainRequest)}function fe(t){if(!r(t)||!d(t.callbackName))return zi.log("JSONP \u8bf7\u6c42\u7f3a\u5c11 callbackName"),!1;t.success=e(t.success)?t.success:function(){},t.error=e(t.error)?t.error:function(){},t.data=t.data||"";var n=document.createElement("script"),i=document.getElementsByTagName("head")[0],a=null,o=!1;if(i.appendChild(n),ce(t.timeout)&&(a=setTimeout(function(){return!o&&(t.error("timeout"),window[t.callbackName]=function(){zi.log("call jsonp error")},a=null,i.removeChild(n),void(o=!0))},t.timeout)),window[t.callbackName]=function(){clearTimeout(a),a=null,t.success.apply(null,arguments),window[t.callbackName]=function(){zi.log("call jsonp error")},i.removeChild(n)},t.url.indexOf("?")>-1?t.url+="&callbackName="+t.callbackName:t.url+="?callbackName="+t.callbackName,r(t.data)){var s=[];k(t.data,function(e,t){s.push(t+"="+e)}),t.data=s.join("&"),t.url+="&"+t.data}n.onerror=function(e){return!o&&(window[t.callbackName]=function(){zi.log("call jsonp error")},clearTimeout(a),a=null,i.removeChild(n),t.error(e),void(o=!0))},n.src=t.url}function ge(t){var r={visibleHandler:e(t.visible)?t.visible:function(){},hiddenHandler:e(t.hidden)?t.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;b(document,this.visibilityChange,function(){document[e.hidden]?e.hiddenHandler():e.visibleHandler()},1)}else b(window,"focus",this.visibleHandler),b(window,"blur",this.hiddenHandler)}};r.init()}function _e(e){e=P({success:function(){},error:function(){},appendCall:function(e){document.getElementsByTagName("head")[0].appendChild(e)}},e);var t=null;"css"===e.type&&(t=document.createElement("link"),t.rel="stylesheet",t.href=e.url),"js"===e.type&&(t=document.createElement("script"),t.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 he(e){if("string"!=typeof e)return"";for(var t=/^\s*javascript/i;t.test(e);)e=e.replace(t,"");return e}function me(e,t){e=String(e),t="number"==typeof t?t:13;for(var r=126,n=e.split(""),i=0,a=n.length;ir?(s&&(clearTimeout(s),s=null),l=c,o=e.apply(i,a),s||(i=a=null)):s||n.trailing===!1||(s=setTimeout(u,d)),o}}function ke(e){var t=[];return null==e?t:(k(e,function(e){t[t.length]=e}),t)}function Pe(e){return e?e.toArray?e.toArray():v(e)||ie(e)?Array.prototype.slice.call(e):ke(e):[]}function Ce(e){for(var t,r=[],n={},i=0;i-1;if(r(i)&&"$option"!==a&&!s)try{t[a]=JSON.stringify(i)}catch(l){delete t[a],Ne("\u60a8\u7684\u6570\u636e-",a,i,"\u6570\u636e\u503c\u6709\u9519\u8bef\uff0c\u5df2\u5c06\u5176\u5220\u9664")}else d(i)||ce(i)||$(i)||ae(i)||v(i)||e(i)||"$option"===a||s||(Ne("\u60a8\u7684\u6570\u636e-",a,i,"-\u683c\u5f0f\u4e0d\u6ee1\u8db3\u8981\u6c42\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664"),delete t[a])}),t):t}function it(e,t){return ce(t)&&e.length>t?(Ne("\u5b57\u7b26\u4e32\u957f\u5ea6\u8d85\u8fc7\u9650\u5236\uff0c\u5df2\u7ecf\u505a\u622a\u53d6--"+e),e.slice(0,t)):e}function at(e,t){var n=["distinct_id","user_id","id","date","datetime","event","events","first_id","original_id","device_id","properties","second_id","time","users"];r(e)&&k(n,function(r,n){r in e&&(re(t||[],r)>-1||(n<3?(delete e[r],Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u6211\u4eec\u5df2\u7ecf\u5c06\u5176\u5220\u9664")):Ne("\u60a8\u7684\u5c5e\u6027- "+r+"\u662f\u4fdd\u7559\u5b57\u6bb5\uff0c\u8bf7\u907f\u514d\u5176\u4f5c\u4e3a\u5c5e\u6027\u540d")))})}function ot(e){var t=["$element_selector","$element_path"],n=["sensorsdata_app_visual_properties"];r(e)&&k(e,function(i,a){if(r(i))ot(e[a]);else if(d(i)){if(re(n,a)>-1)return;e[a]=it(i,re(t,a)>-1?1024:pa.max_string_length)}})}function st(e){"undefined"!=typeof e.properties.$project&&(e.project=e.properties.$project,delete e.properties.$project),"undefined"!=typeof e.properties.$token&&(e.token=e.properties.$token,delete e.properties.$token)}function lt(e){if("item_type"in e){var t=e.item_type,r=function(t){return t||delete e.item_type,!0};rt({item_type:t},r)}if("item_id"in e){var n=e.item_id,i=function(t,r,n){return t||"string"!==n||delete e.item_id,!0};rt({item_id:n},i)}}function ut(e,t){k(e,function(r,n){var i=function(t,r,i){return t||"keyLength"===i||delete e[n],!0};re(t||[],n)===-1&&rt({propertyKey:n},i)})}function ct(e){var t=e.properties;ye(e),r(t)?(nt(t),at(t),st(e),ut(t),ot(t)):"properties"in e&&(e.properties={}),lt(e)}function dt(e,t){var r=t.sensors;return e._track_id=Number(String(n()).slice(2,5)+String(n()).slice(2,4)+String((new Date).getTime()).slice(-4)),e._flush_time=(new Date).getTime(),r.events.tempAdd("send",e),e}function pt(e,t){try{var n=t.sensors,i={};r(e)&&r(e.identities)&&!oe(e.identities)?P(i,e.identities):P(i,xa.getIdentities());var a={identities:i,distinct_id:xa.getDistinctId(),lib:{$lib:"js",$lib_method:"code",$lib_version:String(n.lib_version)},properties:{}};return r(e)&&r(e.properties)&&!oe(e.properties)&&(e.properties.$lib_detail&&(a.lib.$lib_detail=e.properties.$lib_detail,delete e.properties.$lib_detail),e.properties.$lib_method&&(a.lib.$lib_method=e.properties.$lib_method,delete e.properties.$lib_method)),L(a,xa.getUnionId(),e),r(e.properties)&&!oe(e.properties)&&P(a.properties,e.properties),"$UnbindID"===a.event&&(a.login_id&&delete a.login_id,a.anonymous_id&&delete a.anonymous_id),e.type&&"profile"===e.type.slice(0,7)||(a.properties=P({},Pa.properties(),xa.getProps(),xa.getSessionProps(),Pa.currentProps,a.properties),n.para.preset_properties.latest_referrer&&!d(a.properties.$latest_referrer)&&(a.properties.$latest_referrer="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_search_keyword&&!d(a.properties.$latest_search_keyword)&&(n.para.preset_properties.search_keyword_baidu&&d(a.properties.$search_keyword_id)&&ce(a.properties.$search_keyword_id_hash)&&d(a.properties.$search_keyword_id_type)||(a.properties.$latest_search_keyword="\u53d6\u503c\u5f02\u5e38")),n.para.preset_properties.latest_traffic_source_type&&!d(a.properties.$latest_traffic_source_type)&&(a.properties.$latest_traffic_source_type="\u53d6\u503c\u5f02\u5e38"),n.para.preset_properties.latest_landing_page&&!d(a.properties.$latest_landing_page)&&(a.properties.$latest_landing_page="\u53d6\u503c\u5f02\u5e38"),"not_collect"===n.para.preset_properties.latest_wx_ad_click_id?(delete a.properties._latest_wx_ad_click_id,delete a.properties._latest_wx_ad_hash_key,delete a.properties._latest_wx_ad_callbacks):n.para.preset_properties.latest_wx_ad_click_id&&!d(a.properties._latest_wx_ad_click_id)&&(a.properties._latest_wx_ad_click_id="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_hash_key="\u53d6\u503c\u5f02\u5e38",a.properties._latest_wx_ad_callbacks="\u53d6\u503c\u5f02\u5e38"),d(a.properties._latest_wx_ad_click_id)&&(a.properties.$url=Z())),a.properties.$time&&$(a.properties.$time)?(a.time=1*a.properties.$time,delete a.properties.$time):a.time=1*new Date,function(e){if(n.bridge&&"success"===n.bridge.bridge_info.verify_success){var t=Ha.customProp.geth5Props(JSON.parse(JSON.stringify(e)));r(t)&&!oe(t)&&(e.properties=P(e.properties,t))}var i=qa.customProp.getVtrackProps(JSON.parse(JSON.stringify(e)));r(i)&&!oe(i)&&(e.properties=P(e.properties,i))}(a),Me(a),ba.checkIsAddSign(a),ba.checkIsFirstTime(a),Fe(a),Ve(a),a}catch(o){return{_debug_web_msg:String(o)}}}function ft(e){return Fa.stage.process("basicProps",e)}function gt(e){return Fa.stage.process("formatData",e)}function _t(e,t,r,n){function i(e){function i(){o||(o=!0,location.href=a.href)}e.stopPropagation(),e.preventDefault();var o=!1;setTimeout(i,1e3),n(t,r,i)}e=e||{};var a=null;return e.ele&&(a=e.ele),e.event&&(a=e.target?e.target:e.event.target),r=r||{},!(!a||"object"!=typeof a)&&(!a.href||/^javascript/.test(a.href)||a.target||a.download||a.onclick?(n(t,r),!1):(e.event&&i(e.event),void(e.ele&&De(e.ele,"click",function(e){i(e)}))))}function ht(){var e=location.protocol;return"http:"===e||"https:"===e?e:"http:"}function mt(e){return Wa.stage.process("webClickEvent",e)}function vt(e){return Wa.stage.process("webStayEvent",e)}function yt(){var e=Pa.campaignParams(),t={};return k(e,function(e,r,n){(" "+Vi.source_channel_standard+" ").indexOf(" "+r+" ")!==-1?t["$"+r]=n[r]:t[r]=n[r]}),t}function bt(e,t,r){if(Vi.is_first_visitor&&r){var n={};Vi.para.preset_properties.search_keyword_baidu&&Ue(document.referrer)&&$e()&&(n.$search_keyword_id=Sa.id(),n.$search_keyword_id_type=Sa.type(),n.$search_keyword_id_hash=te(n.$search_keyword_id));var i=Le(null,t);e(P({$first_visit_time:new Date,$first_referrer:i,$first_referrer_host:i?q(i,"\u53d6\u503c\u5f02\u5e38"):"",$first_browser_language:d(navigator.language)?navigator.language.toLowerCase():"\u53d6\u503c\u5f02\u5e38",$first_browser_charset:d(document.charset)?document.charset.toUpperCase():"\u53d6\u503c\u5f02\u5e38",$first_traffic_source_type:He(),$first_search_keyword:Re()},yt(),n)),Vi.is_first_visitor=!1}}function wt(e,t){var n=e.id,i=e.callback,a=e.name,o=xa.getFirstId(),s=xa.getOriginDistinctId();if(!rt({distinct_id:n}))return je("login id is invalid"),!1;if(n===xa.getOriginDistinctId()&&!o)return je("login id is equal to distinct_id"),!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(a)&&n===xa._state.first_id)return!1; +var l=xa._state.history_login_id.name!==a||n!==xa._state.history_login_id.value;if(l){xa._state.identities[a]=n,xa.set("history_login_id",{name:a,value:n}),o||xa.set("first_id",s),t(n,"$SignUp",{},i);var u={$identity_cookie_id:xa._state.identities.$identity_cookie_id};return u[a]=n,St(u),!0}return!1}function St(e){var t={};for(var r in e)t[r]=e[r];xa._state.identities=t,xa.save()}function kt(e,t){if(!rt({unbindKey:e,bindValue:t}))return!1;if(r(xa._state.identities)&&xa._state.identities.hasOwnProperty(e)&&xa._state.identities[e]===t){var n=xa.getUnionId().login_id;n&&e+"+"+t===n&&(xa._state.distinct_id=xa._state.first_id,xa._state.first_id="",xa.set("history_login_id",{name:"",value:""})),"$identity_cookie_id"!==e&&(delete xa._state.identities[e],xa.save())}var i={};return i[e]=t,i}function Pt(){Vi._t=Vi._t||1*new Date,Vi.is_first_visitor=!1,Vi.source_channel_standard=ga}function Ct(e){P(pa,e||Vi.para||{}),Vi.para=pa;var t={};if(r(Vi.para.is_track_latest))for(var n in Vi.para.is_track_latest)t["latest_"+n]=Vi.para.is_track_latest[n];Vi.para.preset_properties=P({},fa.preset_properties,t,Vi.para.preset_properties||{});var i;for(i in fa)void 0===Vi.para[i]&&(Vi.para[i]=fa[i]);"string"!=typeof Vi.para.web_url||"://"!==Vi.para.web_url.slice(0,3)&&"//"!==Vi.para.web_url.slice(0,2)||("://"===Vi.para.web_url.slice(0,3)?Vi.para.web_url=location.protocol.slice(0,-1)+Vi.para.web_url:Vi.para.web_url=location.protocol+Vi.para.web_url),ka.protocol.serverUrl(),Vi.bridge&&Vi.bridge.initPara();var a=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],o=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],s=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],l={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"};"object"==typeof Vi.para.source_type&&(Vi.para.source_type.utm=v(Vi.para.source_type.utm)?Vi.para.source_type.utm.concat(a):a,Vi.para.source_type.search=v(Vi.para.source_type.search)?Vi.para.source_type.search.concat(o):o,Vi.para.source_type.social=v(Vi.para.source_type.social)?Vi.para.source_type.social.concat(s):s,Vi.para.source_type.keyword=r(Vi.para.source_type.keyword)?P(l,Vi.para.source_type.keyword):l);var u={div:!1},c=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"];if(Vi.para.heatmap&&!r(Vi.para.heatmap)&&(Vi.para.heatmap={}),r(Vi.para.heatmap)){Vi.para.heatmap.clickmap=Vi.para.heatmap.clickmap||"default",Vi.para.heatmap.scroll_notice_map=Vi.para.heatmap.scroll_notice_map||"default",Vi.para.heatmap.scroll_delay_time=Vi.para.heatmap.scroll_delay_time||4e3,Vi.para.heatmap.scroll_event_duration=Vi.para.heatmap.scroll_event_duration||18e3,Vi.para.heatmap.renderRefreshTime=Vi.para.heatmap.renderRefreshTime||1e3,Vi.para.heatmap.loadTimeout=Vi.para.heatmap.loadTimeout||1e3,Vi.para.heatmap.get_vtrack_config!==!0&&(Vi.para.heatmap.get_vtrack_config=!1);var d=v(Vi.para.heatmap.track_attr)?U(Vi.para.heatmap.track_attr,function(e){return e&&"string"==typeof e}):[];if(d.push("data-sensors-click"),Vi.para.heatmap.track_attr=d,r(Vi.para.heatmap.collect_tags))if(Vi.para.heatmap.collect_tags.div===!0)Vi.para.heatmap.collect_tags.div={ignore_tags:c,max_level:1};else if(r(Vi.para.heatmap.collect_tags.div)){if(Vi.para.heatmap.collect_tags.div.ignore_tags?v(Vi.para.heatmap.collect_tags.div.ignore_tags)||(Ne("ignore_tags \u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4\u683c\u5f0f"),Vi.para.heatmap.collect_tags.div.ignore_tags=c):Vi.para.heatmap.collect_tags.div.ignore_tags=c,Vi.para.heatmap.collect_tags.div.max_level){var p=[1,2,3];re(p,Vi.para.heatmap.collect_tags.div.max_level)===-1&&(Vi.para.heatmap.collect_tags.div.max_level=1)}}else Vi.para.heatmap.collect_tags.div=!1;else Vi.para.heatmap.collect_tags=u}Vi.para.server_url=Ge(Vi.para.server_url),Vi.para.noCache===!0?Vi.para.noCache="?"+(new Date).getTime():Vi.para.noCache="",Vi.para.callback_timeout>Vi.para.datasend_timeout&&(Vi.para.datasend_timeout=Vi.para.callback_timeout),Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&r(Vi.para.heatmap.collect_tags)&&k(Vi.para.heatmap.collect_tags,function(e,t){"div"!==t&&e&&Vi.heatmap.otherTags.push(t)}),Vi.para.heatmap&&"default"===Vi.para.heatmap.clickmap&&Vi.heatmap.initUnlimitedTags()}function Ot(){var e=Array.prototype.slice.call(arguments),t=e[0],r=e.slice(1);return"string"==typeof t&&Za[t]?Za[t].apply(Za,r):void("function"==typeof t?t.apply(Vi,r):Ne("quick\u65b9\u6cd5\u4e2d\u6ca1\u6709\u8fd9\u4e2a\u529f\u80fd"+e[0]))}function Nt(t,n){function i(){return!a.plugin_is_init&&a.init(Vi,n),a.plugin_is_init=!0,Vi.modules=Vi.modules||{},Vi.modules[a.plugin_name||"unnamed_"+Qa++]=a,a}if(!d(t)&&!r(t))return void je("use's first arguments must be string or object.");var a;if(r(t)){var o=Vi.modules&&Vi.modules[t.plugin_name];o&&o!==t&&Ne(t.name+" is conflict with builtin plugin, and sdk uses builtin plugin."),a=o||t}return d(t)&&(r(Vi.modules)&&r(Vi.modules[t])?a=Vi.modules[t]:r(window.SensorsDataWebJSSDKPlugin)&&r(window.SensorsDataWebJSSDKPlugin[t])?a=window.SensorsDataWebJSSDKPlugin[t]:window.sensorsDataAnalytic201505&&window.sensorsDataAnalytic201505.modules[t]&&(a=window.sensorsDataAnalytic201505.modules[t])),a&&e(a.init)?a.plugin_is_init?a:(a.plugin_name||Ne("warning: invalid plugin, plugin_name required."),a.plugin_version?a.plugin_version!==Vi.lib_version&&Ne("warning: plugin version not match SDK version. plugin may not work correctly. "):Ne("warning: invalid plugin, plugin version required."),i()):(Ne((t.plugin_name||t)+" is not found or it's not a standard plugin. Please check sensorsdata official documents."),a)}function jt(e,t,r){rt({event:e,properties:t})&&Va.send({type:"track",event:e,properties:t},r)}function It(e,t){return!!rt({bindKey:e,bindValue:t})&&(xa._state.identities[e]=t,xa.save(),void Va.send({type:"track_id_bind",event:"$BindID",properties:{}}))}function Tt(e,t){var r=kt(e,t);r&&Va.send({identities:r,type:"track_id_unbind",event:"$UnbindID",properties:{}})}function At(e,t,r){"object"==typeof e&&e.tagName?_t({ele:e},t,r,Vi.track):"object"==typeof e&&e.target&&e.event&&_t(e,t,r,Vi.track)}function Dt(e,t,r){return r=r||{},!(!e||"object"!=typeof e)&&(!(!e.href||/^javascript/.test(e.href)||e.target)&&void De(e,"click",function(n){function i(){a||(a=!0,location.href=e.href)}n.preventDefault();var a=!1;setTimeout(i,1e3),Vi.track(t,r,i)}))}function $t(e,t,r){rt({item_type:e,item_id:t,properties:r})&&Va.sendItem({type:"item_set",item_type:e,item_id:t,properties:r||{}})}function xt(e,t){rt({item_type:e,item_id:t})&&Va.sendItem({type:"item_delete",item_type:e,item_id:t})}function Et(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set",properties:e},t)}function Lt(e,t){rt({propertiesMust:e})&&Va.send({type:"profile_set_once",properties:e},t)}function Ut(e,t){rt({propertiesMust:e})&&(k(e,function(t,r){d(t)?e[r]=[t]:v(t)?e[r]=t:(delete e[r],Ne("appendProfile\u5c5e\u6027\u7684\u503c\u5fc5\u987b\u662f\u5b57\u7b26\u4e32\u6216\u8005\u6570\u7ec4"))}),oe(e)||Va.send({type:"profile_append",properties:e},t))}function Rt(e,t){function r(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&!/-*\d+/.test(String(e[t])))return!1;return!0}var n=e;d(e)&&(e={},e[n]=1),rt({propertiesMust:e})&&(r(e)?Va.send({type:"profile_increment",properties:e},t):je("profile_increment\u7684\u503c\u53ea\u80fd\u662f\u6570\u5b57"))}function Bt(e){Va.send({type:"profile_delete"},e),xa.set("distinct_id",Gi()),xa.set("first_id","")}function Ht(e,t){var r=e,n={};d(e)&&(e=[],e.push(r)),v(e)?(k(e,function(e){d(e)?n[e]=!0:Ne("profile_unset\u7ed9\u7684\u6570\u7ec4\u91cc\u9762\u7684\u503c\u5fc5\u987b\u65f6string,\u5df2\u7ecf\u8fc7\u6ee4\u6389",e)}),Va.send({type:"profile_unset",properties:n},t)):je("profile_unset\u7684\u53c2\u6570\u5fc5\u987b\u662f\u6570\u7ec4")}function Jt(e){"number"==typeof e&&(e=String(e));var t=xa.getFirstId();if("undefined"==typeof e){var r=Gi();t?xa.set("first_id",r):xa.set("distinct_id",r)}else rt({distinct_id:e})&&(t?xa.set("first_id",e):xa.set("distinct_id",e))}function Mt(e){var t=xa.getFirstId();if(t)return je("resetAnonymousIdentity must be used in a logout state \uff01"),!1;if("number"==typeof e&&(e=String(e)),"undefined"==typeof e){var r=Gi();xa._state.identities.$identity_cookie_id=r,xa.set("distinct_id",r)}else rt({distinct_id:e})&&(xa._state.identities.$identity_cookie_id=e,xa.set("distinct_id",e))}function qt(e,t,r,n){var i=xa.getFirstId()||xa.getDistinctId();xa.set("distinct_id",e),Va.send({original_id:i,distinct_id:xa.getDistinctId(),type:"track_signup",event:t,properties:r},n)}function Kt(e,t,r,n){"number"==typeof e&&(e=String(e)),rt({distinct_id:e,event:t,properties:r})&&qt(e,t,r,n)}function Ft(e){rt({properties:e})?P(Pa.currentProps,e):je("register\u8f93\u5165\u7684\u53c2\u6570\u6709\u8bef")}function Vt(e){xa.clearAllProps(e)}function Wt(e){var t;if(v(e)&&e.length>0)for(t=0;t-1?i:"https:",_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_app_define_mode&&window.sa_jssdk_app_define_mode(Vi,e)},0)},error:function(){},type:"js",url:i+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vapph5define.min.js"})}else t();else t()}function cr(t){Vi.para.is_track_single_page&&Oa.on("switch",function(n){var i=function(r){if(r=r||{},n!==location.href){Pa.pageProp.referrer=Z(n);var i=P({$url:Z(),$referrer:Z(n)},r);e(t)?t(i):Vi.quick&&Vi.quick("autoTrack",i)}};if("boolean"==typeof Vi.para.is_track_single_page)i();else if("function"==typeof Vi.para.is_track_single_page){var a=Vi.para.is_track_single_page();r(a)?i(a):a===!0&&i()}})}function dr(){Vi._q&&v(Vi._q)&&Vi._q.length>0&&k(Vi._q,function(e){Vi[e[0]].apply(Vi,Array.prototype.slice.call(e[1]))}),r(Vi.para.heatmap)&&(Xa.initHeatmap(),Xa.initScrollmap())}function pr(){Vi.readyState.setState(3),new Vi.SDKJSBridge("visualized").onAppNotify(function(){ur("undefined"!=typeof sa_jssdk_app_define_mode?!0:!1)}),ur(!1),Vi.bridge.app_js_bridge_v1(),Pa.initPage(),cr(),xa.init(),sr(),gr(),Vi.readyState.setState(4),dr()}function fr(){ro.isSeachHasKeyword()?ro.hasKeywordHandle():window.parent!==self&&no.isSearchHasKeyword()?no.verifyVtrackMode():ro.isWindowNameHasKeyword()?ro.windowNameHasKeywordHandle():ro.isStorageHasKeyword()?ro.storageHasKeywordHandle():window.parent!==self&&no.isStorageHasKeyword()?no.verifyVtrackMode():(pr(),no.notifyUser())}function gr(){qa.init(),"success"===Vi.bridge.bridge_info.verify_success&&Ha.init()}function _r(){k(io,function(t){var r=Vi[t];Vi[t]=function(){if(Vi.readyState.state<3)return v(Vi._q)||(Vi._q=[]),Ne("calling sdk api before init is deprecated."),Vi._q.push([t,arguments]),!1;if(!e(Vi.getDisabled)||!Vi.getDisabled())return Vi.readyState.getState()?r.apply(Vi,arguments):void je("\u8bf7\u5148\u521d\u59cb\u5316\u795e\u7b56JS SDK")}})}function hr(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 mr(e,t,r){var n=null;try{n=JSON.parse(JSON.stringify(e||null))}catch(i){}this.getOriginalData=function(){return n},this.getPosition=function(){return t},this.cancellationToken=new hr,this.sensors=r}function vr(e){if(!r(e))throw"error: Stage constructor requires arguments.";this.processDef=e,this.registeredInterceptors={}}function yr(e){e&&e.buildDataStage&&so.registerStageImplementation(e.buildDataStage),e&&e.businessStage&&po.registerStageImplementation(e.businessStage),e&&e.sendDataStage&&uo.registerStageImplementation(e.sendDataStage),e&&e.viewStage&&go.registerStageImplementation(e.viewStage)}function br(e,t){_o[e]&&_o[e](t)}function wr(){return ho.stage&&ho.stage.process("getUtmData")}function Sr(e){return mo.stage.process("send",e)}function kr(e){e.kit=vo,e.saEvent=Va,this.buildDataStage=Fa,this.sendDataStage=mo,this.businessStage=ho}function Pr(e){e.heatmap=Xa,this.viewStage=Wa}function Cr(t){if(!e(t.properties))return void je("registerPropertyPlugin arguments error, properties must be function");if(t.isMatchedWithFilter&&!e(t.isMatchedWithFilter))return void je("registerPropertyPlugin arguments error, isMatchedWithFilter must be function");var r={finalAdjustData:{priority:100,entry:function(r){try{if(e(t.isMatchedWithFilter))return t.isMatchedWithFilter(r)&&t.properties(r);t.properties(r)}catch(n){je("execute registerPropertyPlugin callback error:"+n)}}}};br("buildDataStage",r)}function Or(e){e&&(Vi.events=$a,Vi.bridge=to,Vi.SDKJSBridge=nr,Vi.JSBridge=or,Vi.store=xa,Vi.unlimitedDiv=Ja,Vi.customProp=Ma,Vi.vtrackcollect=qa,Vi.vapph5collect=Ha,Vi.detectMode=fr,Vi.registerFeature=yr,Vi.registerInterceptor=br,Vi.commonWays=Za,yr(new kr(Vi)),yr(new Pr(Vi)),br("viewStage",yo));var t=e?Ya:ao;for(var r in t)Vi[r]=t[r];Vi.logger=da,Vi.log=Oe,Vi._=eo,Vi.on=et,Vi.ee=Ca,Vi.use=Nt,Vi.lib_version=_a,Vi.registerPropertyPlugin=Cr}function Nr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ir(e,t,r){return Nr(e,t,r),e.plugin_version=Ho,e}function Tr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ar(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ar(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dr(e,t,r){return Tr(e,t,r),e.plugin_version=qo,e}function $r(e){return zo&&zo.call(Vo,JSON.stringify(e))}function xr(e){return Wo.call(Vo)&&Xo&&Xo.call(Vo,JSON.stringify(e))}function Er(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Lr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Ur(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Ur(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Rr(e,t,r){return Lr(e,t,r),e.plugin_version=Go,e}function Br(){if(So=window.SensorsData_APP_New_H5_Bridge,ko=So&&So.sensorsdata_track,Po=ko&&So.sensorsdata_get_server_url&&So.sensorsdata_get_server_url(),No("---test---fail---",!Co,Co.bridge.activeBridge,!Po),Co&&!Co.bridge.activeBridge&&Po)return Co.bridge.activeBridge=Qo,Co.para.app_js_bridge&&!Co.para.app_js_bridge.is_mui&&(Co.bridge.is_verify_success=Po&&Co.bridge.validateAppUrl(Po),No("---test---bridge-verify-",Co.bridge.is_verify_success)),Co.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:Co.bridge.is_verify_success?"success":"fail",support_two_way_call:!!So.sensorsdata_js_call_app},Co.para.app_js_bridge?void Co.registerInterceptor("sendDataStage",{send:{priority:60,entry:Hr}}):void No("---test---app_js_bridge is not configured, data will not be sent by android bridge.")}function Hr(e,t){if(No("---test---datasend-",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return Co.bridge.is_verify_success?(No("---test---bridge-verify-success---",e.data),ko&&ko.call(So,JSON.stringify(Oo.extend({server_url:Co.para.server_url},e.data))),Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e):(No("---test---bridge-verify-fail-----",Co.bridge.is_verify_success),Co.para.app_js_bridge.is_send?(Co.debug.apph5({data:e.data,step:"4.2",output:"all"}),e):(Oo.isFunction(r)&&r(),t.cancellationToken.cancel(),e))}function Jr(e){var t=e.callType;return t in Zo.commands?Zo.commands[t](e,So):void(So&&Oo.isFunction(So.sensorsdata_js_call_app)&&So.sensorsdata_js_call_app(JSON.stringify(e)))}function Mr(e){return rs&&rs.call(es,JSON.stringify(e))}function qr(e){return ts.call(es)&&ns&&ns.call(es,JSON.stringify(e))}function Kr(e,t){return t&&"function"==typeof t[e.callType]&&t[e.callType]()}function Fr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Vr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Vr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Wr(e,t,r){return Fr(e,t,r),e.plugin_version=as,e}function zr(){if(xo("ObsoleteBridge---test---init---"),jo=window.SensorsData_APP_JS_Bridge,Io=jo&&jo.sensorsdata_track,To=jo&&jo.sensorsdata_verify,Ao=jo&&jo.sensorsdata_visual_verify,xo("ObsoleteBridge-",Do.bridge.activeBridge,To,Io,Ao),Do&&!Do.bridge.activeBridge&&(To||Io||Ao)){Do.bridge.activeBridge=os;var e=To||Io;if(Ao&&(e=!!Ao.call(jo,JSON.stringify({server_url:Do.para.server_url})),xo("ObsoleteBridge---called-return",e)),Do.bridge.bridge_info={touch_app_bridge:!0,platform:"android",verify_success:e?"success":"fail"},!Do.para.app_js_bridge)return void xo("app_js_bridge is not configured, data will not be sent by android obsolete bridge.");Do.registerInterceptor("sendDataStage",{send:{priority:80,entry:Xr}}),xo("Android obsolete bridge inits succeed.")}}function Xr(e,t){if(xo("ObsoleteBridge---senddata"),Do.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;if(To){var n=To&&To.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data)));return xo("ObsoleteBridge---anVerify-success",n),n?($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e):Do.para.app_js_bridge.is_send?(Do.debug.apph5({data:e.data,step:"3.1",output:"all"}),e):($o.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}return xo("ObsoleteBridge---is-send-old-way",Do.para.app_js_bridge.is_send),Io&&Io.call(jo,JSON.stringify($o.extend({server_url:Do.para.server_url},e.data))),$o.isFunction(r)&&r(),t.cancellationToken.cancel(),e}function Zr(e){xo("ObsoleteBridge---handleCommadn");var t=e.callType;return t in is.commands?(xo("ObsoleteBridge---",t,is.commands),is.commands[t](e,jo)):jo&&$o.isFunction(jo.sensorsdata_js_call_app)?(xo("ObsoleteBridge---handleCommadn-abridge"),jo.sensorsdata_js_call_app(JSON.stringify(e))):void 0}function Gr(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Qr(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Qr(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Yr(e,t,r){return Gr(e,t,r),e.plugin_version=ls,e}function en(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return tn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function tn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function rn(e,t,r){return en(e,t,r),e.plugin_version=ds,e}function nn(){return"undefined"!=typeof Bo&&document[Bo]}function an(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return on(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function on(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function sn(e,t,r){return an(e,t,r),e.plugin_version=Ds,e}function ln(){if(fs=window.SensorsData_iOS_JS_Bridge&&window.SensorsData_iOS_JS_Bridge.sensorsdata_app_server_url,gs=function(){return window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.sensorsdataNativeTracker},_s&&!_s.bridge.activeBridge&&gs()&&gs().postMessage){if(_s.bridge.activeBridge=$s,_s.para.app_js_bridge&&!_s.para.app_js_bridge.is_mui&&(_s.bridge.is_verify_success=fs&&_s.bridge.validateAppUrl(fs)),_s.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:_s.bridge.is_verify_success?"success":"fail",support_two_way_call:!0},!_s.para.app_js_bridge)return void ms("app_js_bridge is not configured, data will not be sent by iOS bridge.");_s.registerInterceptor("sendDataStage",{send:{priority:70,entry:un}}),ms("IOS bridge inits succeed.")}}function un(e,t){if(_s.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var r=e.callback;return _s.bridge.is_verify_success?(gs()&&gs().postMessage(JSON.stringify({callType:"app_h5_track",data:hs.extend({server_url:_s.para.server_url},e.data)})),hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e):_s.para.app_js_bridge.is_send?(_s.debug.apph5({data:e.data,step:"4.1",output:"all"}),e):(hs.isFunction(r)&&r(),t.cancellationToken.cancel(),e)}function cn(e){var t=e.callType;return"page_info"!==t&&"visualized_track"!==t||_s.bridge.hasVisualModeBridge()?"sensorsdata_get_app_visual_config"===t?hs.isObject(window.SensorsData_APP_New_H5_Bridge)&&window.SensorsData_APP_New_H5_Bridge[t]:gs()&&gs().postMessage(JSON.stringify(e)):null}function dn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return pn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function pn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fn(e,t,r){return dn(e,t,r),e.plugin_version=Es,e}function gn(){if(vs&&!vs.bridge.activeBridge&&_n()){if(vs.bridge.activeBridge=Ls,vs.bridge.bridge_info={touch_app_bridge:!0,platform:"ios",verify_success:hn()?"success":"fail"},!vs.para.app_js_bridge)return void bs("app_js_bridge is not configured, data will not be sent by iOS obsolete bridge.");vs.registerInterceptor("sendDataStage",{send:{priority:90,entry:mn}}),bs("IOS obsolete bridge inits succeed.")}}function _n(){return(/sensors-verify/.test(navigator.userAgent)||/sa-sdk-ios/.test(navigator.userAgent))&&!window.MSStream}function hn(){if(/sensors-verify/.test(navigator.userAgent)){var e=navigator.userAgent.match(/sensors-verify\/([^\s]+)/);if(e&&e[0]&&"string"==typeof e[1]&&2===e[1].split("?").length){e=e[1].split("?");var t=null,r=null;try{t=ys.URL(vs.para.server_url).hostname,r=ys.URL(vs.para.server_url).searchParams.get("project")||"default"}catch(n){vs.log(n)}return!(!t||t!==e[0]||!r||r!==e[1])}return!1}return!!/sa-sdk-ios/.test(navigator.userAgent)}function mn(e,t){function r(e){var t=JSON.stringify(ys.extend({server_url:vs.para.server_url},e));return t=t.replace(/\r\n/g,""),t=encodeURIComponent(t),"sensorsanalytics://trackEvent?event="+t}if(vs.para.app_js_bridge.is_mui||"item_set"===e.data.type||"item_delete"===e.data.type)return e;var n=e.callback;if(vs.bridge.bridge_info.verify_success){var i=document.createElement("iframe"),a=r(e.data);return i.setAttribute("src",a),document.documentElement.appendChild(i),i.parentNode.removeChild(i),i=null,ys.isFunction(n)&&n(),t.cancellationToken.cancel(),!0}return vs.para.app_js_bridge.is_send?(vs.debug.apph5({data:e.data,step:"3.2",output:"all"}),e):(ys.isFunction(n)&&n(),t.cancellationToken.cancel(),e)}function vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bn(e,t,r){return vn(e,t,r),e.plugin_version=Rs,e}function wn(){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=Hs}function Sn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return kn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function kn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n); +}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Pn(e,t,r){return Sn(e,t,r),e.plugin_version=qs,e}function Cn(e,t){if("track"!==e.type)return e;var r=t.sd,n=r._,i=r.saEvent.check,a=n.extend2Lev({properties:{}},e),o=t.customRegister,s=a.properties,l=a.event,u={};return n.each(o,function(e){if(n.isObject(e))n.indexOf(e.events,l)>-1&&i({properties:e.properties})&&(u=n.extend(u,e.properties));else if(n.isFunction(e)){var t=e({event:l,properties:s,data:a});n.isObject(t)&&!n.isEmptyObject(t)&&i({properties:t})&&(u=n.extend(u,t))}}),e.properties=n.extend(s,u),e}function On(){this.sd=null,this.log=window.console&&window.console.log||function(){},this.customRegister=[]}function Nn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function In(e,t,r){return Nn(e,t,r),e.plugin_version=Ws,e}function Tn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return An(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function An(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Dn(e,t,r){return Tn(e,t,r),e.plugin_version=Qs,e}function $n(e){try{if("$pageview"!==e.event&&(!e.type||"profile"!==e.type.slice(0,7))){var t=window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,r=document.documentElement.scrollHeight||0,n={$page_height:Math.max(t,r)||0};e.properties=zs._.extend(e.properties||{},n)}}catch(i){Ys("\u9875\u9762\u9ad8\u5ea6\u83b7\u53d6\u5f02\u5e38\u3002")}return Xs.call(zs.kit,e)}function xn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return En(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function En(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ln(e,t,r){return xn(e,t,r),e.plugin_version=rl,e}function Un(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Rn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Rn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Bn(e,t,r){return Un(e,t,r),e.plugin_version=yl,e}function Hn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Jn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Jn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Mn(e,t,r){return Hn(e,t,r),e.plugin_version=Sl,e}function qn(){kl=!0}function Kn(){kl=!1}function Fn(){return kl}function Vn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Wn(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Wn(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function zn(e,t,r){return Vn(e,t,r),e.plugin_version=Nl,e}function Xn(e){var t=e,r="";r=al.para.debug_mode_url.indexOf("?")!==-1?al.para.debug_mode_url+"&"+al.kit.encodeTrackData(e):al.para.debug_mode_url+"?"+al.kit.encodeTrackData(e),ol.ajax({url:r,type:"GET",cors:!0,header:{"Dry-Run":String(al.para.debug_mode_upload)},success:function(e){ol.isEmptyObject(e)===!0?alert("debug\u6570\u636e\u53d1\u9001\u6210\u529f"+t):alert("debug\u5931\u8d25 \u9519\u8bef\u539f\u56e0"+JSON.stringify(e))}})}function Zn(e,t){if(al.para.debug_mode===!0){var r=e.data;e.callback;Xn(JSON.stringify(r)),t.cancellationToken.stop()}return e}function Gn(){al.para.debug_mode===!0&&(al.para.debug_mode_upload=al.para.debug_mode_upload||!1,ol.isString(al.para.debug_mode_url)||(ol.isString(al.para.server_url)?al.para.debug_mode_url=al.para.server_url.replace("sa.gif","debug"):ol.isArray(al.para.server_url)&&ol.isString(al.para.server_url[0])?al.para.debug_mode_url=al.para.server_url[0].replace("sa.gif","debug"):al.para.debug_mode=!1))}function Qn(){al.on("sdkInitPara",function(){Gn()}),al.on("sdkAfterInitPara",function(){al.registerInterceptor("sendDataStage",{send:{priority:30,entry:Zn}})})}function Yn(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return ei(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function ei(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function ti(e,t,r){return Yn(e,t,r),e.plugin_version=Tl,e}function ri(e,t){if(ll.isObject(sl.para.jsapp)&&!sl.para.jsapp.isOnline&&"function"==typeof sl.para.jsapp.setData){var r=e;delete r.callback,r=JSON.stringify(r),sl.para.jsapp.setData(r),t.cancellationToken.stop()}return e}function ni(){sl.on("sdkAfterInitAPI",function(){ll.isObject(sl.commonWays)&&(sl.commonWays.setOnlineState=ii),sl.registerInterceptor("sendDataStage",{send:{priority:40,entry:ri}})})}function ii(e){if(e===!0&&ll.isObject(sl.para.jsapp)&&"function"==typeof sl.para.jsapp.getData){sl.para.jsapp.isOnline=!0;var t=sl.para.jsapp.getData();ll.isArray(t)&&t.length>0&&ll.each(t,function(e){ll.isJSONString(e)&&sl.kit.sendData(JSON.parse(e))})}else sl.para.jsapp.isOnline=!1}function ai(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function si(e,t,r){return ai(e,t,r),e.plugin_version=$l,e}function li(e,t){return!ul.para.app_js_bridge&&ul.para.batch_send&&cl.localStorage.isSupport()&&localStorage.length=3||!i.on?o():void i.on(r,o)}}return e}function pi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function fi(e,t,r){return di(e,t,r),e.plugin_version=Ul,e}function gi(e){var t=new pl.BeaconSend(e);t.start()}function _i(e,t){var r=null,n=null;pl.isObject(e.config)&&(r=e.config.send_type,n=pl.optimizeServerUrl(e.config.server_url));var i="beacon"===r||!r&&"beacon"===dl.para.send_type;if(i&&pl.isSupportBeaconSend()){var a=n||e.server_url;e.server_url=a,e.data=dl.kit.encodeTrackData(e.data),pl.isArray(a)&&a.length?pl.each(a,function(t){e.callback=null,e.server_url=t,gi(e)}):"string"==typeof a&&""!==a?gi(e):dl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function hi(){"beacon"!==dl.para.send_type||pl.isSupportBeaconSend()||(dl.para.send_type="image")}function mi(){dl.on("sdkInitPara",function(){hi()}),dl.on("sdkAfterInitPara",function(){dl.registerInterceptor("sendDataStage",{send:{priority:110,entry:_i}})})}function vi(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return yi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function yi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function bi(e,t,r){return vi(e,t,r),e.plugin_version=Hl,e}function wi(e){var t=new gl.AjaxSend(e);t.start()}function Si(e,t){var r=null,n=null;gl.isObject(e.config)&&(r=e.config.send_type,n=gl.optimizeServerUrl(e.config.server_url));var i="ajax"===r||!r&&"ajax"===fl.para.send_type;if(i&&gl.isSupportCors()){var a=n||e.server_url;e.server_url=a,e.data=fl.kit.encodeTrackData(e.data),gl.isArray(a)&&a.length?gl.each(a,function(t){e.callback=null,e.server_url=t,wi(e)}):"string"==typeof a&&""!==a?wi(e):fl.log("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01"),t.cancellationToken.stop()}return e}function ki(){"ajax"!==fl.para.send_type||gl.isSupportCors()||(fl.para.send_type="image")}function Pi(){fl.on("sdkInitPara",function(){ki()}),fl.on("sdkAfterInitPara",function(){fl.registerInterceptor("sendDataStage",{send:{priority:120,entry:Si}})})}function Ci(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return Oi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function Oi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ni(e,t,r){return Ci(e,t,r),e.plugin_version=ql,e}function ji(e,t){var r=_l.kit.encodeTrackData(t);return e.indexOf("?")!==-1?e+"&"+r:e+"?"+r}function Ii(e){var t=new hl.ImageSend(e);t.start()}function Ti(e,t){var r=null;hl.isObject(e.config)&&(r=hl.optimizeServerUrl(e.config.server_url));var n=r||e.server_url,i=e.data;e.server_url=n,hl.isArray(n)&&n.length?hl.each(n,function(t){t&&(e.data=ji(t,i),e.callback=null,e.server_url=t,Ii(e))}):"string"==typeof n&&""!==n?(e.data=ji(n,i),Ii(e)):_l.logger&&_l.logger.msg("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01").level("warn").log(),t.cancellationToken.stop()}function Ai(){"image"!==_l.para.send_type&&"ajax"!==_l.para.send_type&&"beacon"!==_l.para.send_type&&(_l.para.send_type="image")}function Di(){_l.on("sdkInitPara",function(){Ai()}),_l.on("sdkAfterInitPara",function(){_l.registerInterceptor("sendDataStage",{send:{priority:130,entry:Ti}})})}function $i(e,t,r){if(t&&(e.plugin_name=t),r&&e.init){var n=e.init;e.init=function(i,a){function o(){n.call(e,i,a)}return xi(i,e,t),i.readyState&&i.readyState.state>=3||!i.on?o():void i.on(r,o)}}return e}function xi(e,t,r){function n(t,n){e.logger?e.logger.msg.apply(e.logger,n).module(r+""||"").level(t).log():e.log&&e.log.apply(e,n)}t.log=function(){n("log",arguments)},t.warn=function(){n("warn",arguments)},t.error=function(){n("error",arguments)}}function Ei(e,t,r){return $i(e,t,r),e.plugin_version=_a,e}function Li(e){return null===zl?void Ui(e):void zl.push(e)}function Ui(e){try{if("log"===e.level&&Ri())return void Ji(e);if("warn"===e.level&&Bi())return void Ji(e);if("error"===e.level&&Hi())return void Ji(e)}catch(t){}}function Ri(){return!!Fi()||(Vl.para.show_log===!0||Wl.isObject(Vl.para.show_log)&&"log"===Vl.para.show_log.level)}function Bi(){return!!Fi()||(Ri()||Wl.isObject(Vl.para.show_log)&&"warn"===Vl.para.show_log.level)}function Hi(){return!!Fi()||(!Wl.isObject(Vl.para.show_log)||"none"!==Vl.para.show_log.level)}function Ji(e){var t=e.content,r=Wl.isObject(t[0])?Wl.formatJsonString(t[0]):t[0],n=Mi(e);t[0]=n+(n.length>0?": ":"")+r;try{console&&(Wl.isFunction(console[e.level])?console[e.level].apply(console,t):Wl.isObject(console[e.level])&&console[e.level](t[0]))}catch(i){}}function Mi(e){var t="",r="",n=Vl.para.show_log;return Wl.isObject(n)&&n.show_brand===!1||(t+=e.brand),Wl.isObject(n)&&n.show_level===!1||(t+=(t.length>0?"-":"")+e.level),t.length>0&&(t="["+t+"]"),Wl.isObject(n)&&n.show_module===!1||(r=e.module),t+r}function qi(){Wl.sessionStorage.isSupport()&&sessionStorage.setItem(Gl,"true")}function Ki(){Wl.sessionStorage.isSupport()&&sessionStorage.removeItem(Gl)}function Fi(){return Wl.sessionStorage.isSupport()&&"true"===sessionStorage.getItem(Gl)}var Vi={};(function(){function e(n,i){function a(e,t){try{e()}catch(r){t&&t()}}function o(e){if(null!=o[e])return o[e];var t;if("bug-string-char-index"==e)t="a"!="a"[0];else if("json"==e)t=o("json-stringify")&&o("date-serialization")&&o("json-parse");else if("date-serialization"==e){if(t=o("json-stringify")&&b){var r=i.stringify;a(function(){t='"-271821-04-20T00:00:00.000Z"'==r(new d((-864e13)))&&'"+275760-09-13T00:00:00.000Z"'==r(new d(864e13))&&'"-000001-01-01T00:00:00.000Z"'==r(new d((-621987552e5)))&&'"1969-12-31T23:59:59.999Z"'==r(new d((-1)))})}}else{var n,s='{"a":[1,true,false,null,"\\u0000\\b\\n\\f\\r\\t"]}';if("json-stringify"==e){var r=i.stringify,c="function"==typeof r;c&&((n=function(){return 1}).toJSON=n,a(function(){c="0"===r(0)&&"0"===r(new l)&&'""'==r(new u)&&r(v)===h&&r(h)===h&&r()===h&&"1"===r(n)&&"[1]"==r([n])&&"[null]"==r([h])&&"null"==r(null)&&"[null,null,null]"==r([h,v,null])&&r({a:[n,!0,!1,null,"\0\b\n\f\r\t"]})==s&&"1"===r(null,n)&&"[\n 1,\n 2\n]"==r([1,2],null,1)},function(){c=!1})),t=c}if("json-parse"==e){var p,f=i.parse;"function"==typeof f&&a(function(){0!==f("0")||f(!1)||(n=f(s),p=5==n.a.length&&1===n.a[0],p&&(a(function(){p=!f('"\t"')}),p&&a(function(){p=1!==f("01")}),p&&a(function(){p=1!==f("1.")})))},function(){p=!1}),t=p}}return o[e]=!!t}function s(e){return D(this)}n||(n=r.Object()),i||(i=r.Object());var l=n.Number||r.Number,u=n.String||r.String,c=n.Object||r.Object,d=n.Date||r.Date,p=n.SyntaxError||r.SyntaxError,f=n.TypeError||r.TypeError,g=n.Math||r.Math,_=n.JSON||r.JSON;if("object"==typeof _&&_)return i.stringify=_.stringify,i.parse=_.parse,i.runInContext=e,i;var h,m=c.prototype,v=m.toString,y=m.hasOwnProperty,b=new d((-0xc782b5b800cec));if(a(function(){b=b.getUTCFullYear()==-109252&&0===b.getUTCMonth()&&1===b.getUTCDate()&&10==b.getUTCHours()&&37==b.getUTCMinutes()&&6==b.getUTCSeconds()&&708==b.getUTCMilliseconds()}),o["bug-string-char-index"]=o["date-serialization"]=o.json=o["json-stringify"]=o["json-parse"]=null,!o("json")){var w="[object Function]",S="[object Date]",k="[object Number]",P="[object String]",C="[object Array]",O="[object Boolean]",N=o("bug-string-char-index"),j=function(e,r){var n,i,a,o=0;(n=function(){this.valueOf=0}).prototype.valueOf=0,i=new n;for(a in i)y.call(i,a)&&o++;return n=i=null,o?j=function(e,t){var r,n,i=v.call(e)==w;for(r in e)i&&"prototype"==r||!y.call(e,r)||(n="constructor"===r)||t(r);(n||y.call(e,r="constructor"))&&t(r)}:(i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"],j=function(e,r){var n,a,o=v.call(e)==w,s=!o&&"function"!=typeof e.constructor&&t[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e)o&&"prototype"==n||!s.call(e,n)||r(n);for(a=i.length;n=i[--a];)s.call(e,n)&&r(n)}),j(e,r)};if(!o("json-stringify")&&!o("date-serialization")){var I={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"},T="000000",A=function(e,t){return(T+(t||0)).slice(-e)},D=function(e){var t,r,n,i,a,o,s,l,u;if(b)t=function(e){r=e.getUTCFullYear(),n=e.getUTCMonth(),i=e.getUTCDate(),o=e.getUTCHours(),s=e.getUTCMinutes(),l=e.getUTCSeconds(),u=e.getUTCMilliseconds()};else{var c=g.floor,d=[0,31,59,90,120,151,181,212,243,273,304,334],p=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;p(r+1,0)<=i;r++);for(n=c((i-p(r,0))/30.42);p(r,n+1)<=i;n++);i=1+i-p(r,n),a=(e%864e5+864e5)%864e5,o=c(a/36e5)%24,s=c(a/6e4)%60,l=c(a/1e3)%60,u=a%1e3}}return(D=function(e){return e>-1/0&&e<1/0?(t(e),e=(r<=0||r>=1e4?(r<0?"-":"+")+A(6,r<0?-r:r):A(4,r))+"-"+A(2,n+1)+"-"+A(2,i)+"T"+A(2,o)+":"+A(2,s)+":"+A(2,l)+"."+A(3,u)+"Z",r=n=i=o=s=l=u=null):e=null,e})(e)};if(o("json-stringify")&&!o("date-serialization")){var $=i.stringify;i.stringify=function(e,t,r){var n=d.prototype.toJSON;d.prototype.toJSON=s;var i=$(e,t,r);return d.prototype.toJSON=n,i}}else{var x="\\u00",E=function(e){var t=e.charCodeAt(0),r=I[t];return r?r:x+A(2,t.toString(16))},L=/[\x00-\x1f\x22\x5c]/g,U=function(e){return L.lastIndex=0,'"'+(L.test(e)?e.replace(L,E):e)+'"'},R=function(e,t,r,n,i,o,s){var l,u,c,p,g,_,m,y,b;if(a(function(){l=t[e]}),"object"==typeof l&&l&&(l.getUTCFullYear&&v.call(l)==S&&l.toJSON===d.prototype.toJSON?l=D(l):"function"==typeof l.toJSON&&(l=l.toJSON(e))),r&&(l=r.call(t,e,l)),l==h)return l===h?l:"null";switch(u=typeof l,"object"==u&&(c=v.call(l)),c||u){case"boolean":case O:return""+l;case"number":case k:return l>-1/0&&l<1/0?""+l:"null";case"string":case P:return U(""+l)}if("object"==typeof l){for(m=s.length;m--;)if(s[m]===l)throw f();if(s.push(l),p=[],y=o,o+=i,c==C){for(_=0,m=l.length;_0)for(n>10&&(n=10),i="";i.length=48&&i<=57||i>=97&&i<=102||i>=65&&i<=70||q();e+=J("0x"+a.slice(t,B));break;default:q()}else{if(34==i)break;for(i=a.charCodeAt(B),t=B;i>=32&&92!=i&&34!=i;)i=a.charCodeAt(++B);e+=a.slice(t,B)}if(34==a.charCodeAt(B))return B++,e;q();default:if(t=B,45==i&&(n=!0,i=a.charCodeAt(++B)),i>=48&&i<=57){for(48==i&&(i=a.charCodeAt(B+1),i>=48&&i<=57)&&q(),n=!1;B=48&&i<=57);B++);if(46==a.charCodeAt(B)){for(r=++B;r57));r++);r==B&&q(),B=r}if(i=a.charCodeAt(B),101==i||69==i){for(i=a.charCodeAt(++B),43!=i&&45!=i||B++,r=B;r57));r++);r==B&&q(),B=r}return+a.slice(t,B)}n&&q();var s=a.slice(B,B+4);if("true"==s)return B+=4,!0;if("fals"==s&&101==a.charCodeAt(B+4))return B+=5,!1;if("null"==s)return B+=4,null;q()}return"$"},F=function(e){var t,r;if("$"==e&&q(),"string"==typeof e){if("@"==(N?e.charAt(0):e[0]))return e.slice(1);if("["==e){for(t=[];e=K(),"]"!=e;)r?","==e?(e=K(),"]"==e&&q()):q():r=!0,","==e&&q(),t.push(F(e));return t}if("{"==e){for(t={};e=K(),"}"!=e;)r?","==e?(e=K(),"}"==e&&q()):q():r=!0,","!=e&&"string"==typeof e&&"@"==(N?e.charAt(0):e[0])&&":"==K()||q(),t[e.slice(1)]=F(K());return t}q()}return e},V=function(e,t,r){var n=W(e,t,r);n===h?delete e[t]:e[t]=n},W=function(e,t,r){var n,i=e[t];if("object"==typeof i&&i)if(v.call(i)==C)for(n=i.length;n--;)V(v,j,i,n,r);else j(i,function(e){V(i,e,r)});return r.call(e,t,i)};i.parse=function(e,t){var r,n;return B=0,H=""+e,r=F(K()),"$"!=K()&&q(),B=H=null,t&&v.call(t)==w?W((n={},n[""]=r,n),"",t):r}}}return i.runInContext=e,i}var t={"function":!0,object:!0},r=t[typeof window]&&window||this,n=r.JSON,i=r.JSON3,a=!1,o=e(r,r.JSON3={noConflict:function(){return a||(a=!0,r.JSON=n,r.JSON3=i,n=i=null),o}});r.JSON?(r.JSON.parse=o.parse,r.JSON.stringify=o.stringify):r.JSON={parse:o.parse,stringify:o.stringify}}).call(window),function(e,t){t(e)}(window,function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=function(e){var t=function(t){return e(String(t).replace(/[\t\n\f\r ]+/g,""))};return t.original=e,t}(e.atob)}else{var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(e){e=String(e);for(var t,n,i,a,o="",s=0,l=e.length%3;s255||(i=e.charCodeAt(s++))>255||(a=e.charCodeAt(s++))>255)return"";t=n<<16|i<<8|a,o+=r.charAt(t>>18&63)+r.charAt(t>>12&63)+r.charAt(t>>6&63)+r.charAt(63&t)}return l?o.slice(0,l-3)+"===".substring(l):o},e.atob=function(e){if(e=String(e).replace(/[\t\n\f\r ]+/g,""),!n.test(e))return"";e+="==".slice(2-(3&e.length));for(var t,i,a,o="",s=0;s>16&255):64===a?String.fromCharCode(t>>16&255,t>>8&255):String.fromCharCode(t>>16&255,t>>8&255,255&t);return o}}});var Wi,zi={setup:function(e){Wi=e},log:function(){(Wi||console&&console.log||function(){}).apply(null,arguments)}},Xi={get:function(e){return window.localStorage.getItem(e)},parse:function(e){var t;try{t=JSON.parse(Xi.get(e))||null}catch(r){zi.log(r)}return t},set:function(e,t){try{window.localStorage.setItem(e,t)}catch(r){zi.log(r)}},remove:function(e){window.localStorage.removeItem(e)},isSupport:function(){var e=!0;try{var t="__local_store_support__",r="testIsSupportStorage";Xi.set(t,r),Xi.get(t)!==r&&(e=!1),Xi.remove(t)}catch(n){e=!1}return e}},Zi=function(){function e(){return r=(9301*r+49297)%233280,r/233280}var t=new Date,r=t.getTime();return function(t){return Math.ceil(e()*t)}}();a.prototype.get=function(e,r,a,o){if(!e)throw new Error("key is must");r=r||1e4,a=a||1e3,o=o||function(){};var s=this.lockGetPrefix+e,l=Xi.get(s),u=String(n());return l&&(l=i(l)||{randomNum:0,expireTime:0},l.expireTime>t())?o(null):(Xi.set(s,JSON.stringify({randomNum:u,expireTime:t()+r})),void setTimeout(function(){l=i(Xi.get(s))||{randomNum:0,expireTime:0},l&&l.randomNum===u?(o(Xi.get(e)),Xi.remove(e),Xi.remove(s)):o(null)},a))},a.prototype.set=function(e,r,a,o,s){if(!e||!r)throw new Error("key and val is must");a=a||1e4,o=o||1e3,s=s||function(){};var l=this.lockSetPrefix+e,u=Xi.get(l),c=String(n());return u&&(u=i(u)||{randomNum:0,expireTime:0},u.expireTime>t())?s({status:"fail",reason:"This key is locked"}):(Xi.set(l,JSON.stringify({randomNum:c,expireTime:t()+a})),void setTimeout(function(){u=i(Xi.get(l))||{randomNum:0,expireTime:0},u.randomNum===c?Xi.set(e,r)&&s({status:"success"}):s({status:"fail",reason:"This key is locked"})},o))},l.prototype.on=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prepend=function(e,t){if(!e||!t)return!1;if(!s(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},l.prototype.prependOnce=function(e,t){return this.prepend(e,{listener:t,once:!0})},l.prototype.once=function(e,t){return this.on(e,{listener:t,once:!0})},l.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=4&&(a=e(a,i),i=[]);return i.length>0&&(a=e(a,i)),a.toString(16)};return function(){var i=String(screen.height*screen.width);i=i&&/\d{5,}/.test(i)?i.toString(16):String(31242*n()).replace(".","").slice(0,8);var a=e()+"-"+t()+"-"+r()+"-"+i+"-"+e();return a?a:(String(n())+String(n())+String(n())).slice(2,15)}}(),Qi=function(e){this.ele=e},Yi=function(e,t){for(var r=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&r.push(e);return r};Qi.prototype={addClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")===-1&&(this.ele.className=this.ele.className+(""===this.ele.className?"":" ")+e),this},removeClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1&&(this.ele.className=t.replace(" "+e+" "," ").slice(1,-1)),this},hasClass:function(e){var t=" "+this.ele.className+" ";return t.indexOf(" "+e+" ")!==-1},attr:function(e,t){return"string"==typeof e&&h(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,r=t.documentElement;return{top:e.top+window.pageYOffset-r.clientTop,left:e.left+window.pageXOffset-r.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),y(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||!v(r))return null;for(var n=r.length-1;n>=0;n--){var i=r[n];if(t=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 Yi((this.ele.parentNode||{}).firstChild,this.ele)},children:function(){return Yi(this.ele.firstChild)},parent:function(){var e=this.ele.parentNode;return e=e&&11!==e.nodeType?e:null,y(e)},previousElementSibling:function(){var e=this.ele;if("previousElementSibling"in document.documentElement)return y(e.previousElementSibling);for(;e=e.previousSibling;)if(1===e.nodeType)return y(e);return y(null)},getSameTypeSiblings:function(){for(var e=this.ele,t=e.parentNode,r=e.tagName.toLowerCase(),n=[],i=0;it._expirationTimestamp_?null:t.value:t},set:function(e,t,r){if(r){var n,i=new Date;n="s"===String(r).slice(-1)?i.getTime()+1e3*Number(String(r).slice(0,-1)):i.getTime()+24*r*60*60*1e3,t={value:t,_expirationTimestamp_:n}}this.data[e]=t},getNewUserFlagMemoryKey:function(e){return"sajssdk_2015_"+pa.sdk_id+e}},ba={checkIsAddSign:function(e){"track"===e.type&&(Ae()?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(Vi.is_first_visitor){var e=new Date,t={h:23-e.getHours(),m:59-e.getMinutes(),s:59-e.getSeconds()};va.isSupport()?va.set(Te("new_user"),"1",3600*t.h+60*t.m+t.s+"s"):ya.set(ya.getNewUserFlagMemoryKey("new_user"),"1",3600*t.h+60*t.m+t.s+"s"),this.is_first_visit_time=!0,this.is_page_first_visited=!0}else Ae()||(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)}}},wa=function(){this._events=[],this.pendingEvents=[]};wa.prototype={emit:function(e){var t=[].slice.call(arguments,1);k(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():null},on:function(t,r,n,i){e(r)&&(this._events.push({type:t,callback:r,context:n||this}),i=i!==!1,this.pendingEvents.length>0&&i&&k(this.pendingEvents,function(e){e.type===t&&r.apply(n,e.data)}))},tempAdd:function(e,t){if(t&&e)return this.emit(e,t)},isReady:function(){}};var Sa={data:{},id:function(){return this.data.id?this.data.id:(this.data.id=Ee(),this.data.id)},type:function(){return this.data.type?this.data.type:(this.data.type=xe(),this.data.type)}},ka={distinct_id:function(){},jssdkDebug:function(){},_sendDebug:function(e){},apph5:function(e){var t="app_h5\u6253\u901a\u5931\u8d25-",n={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"},i=e.output,a=e.step,o=e.data||"";"all"!==i&&"console"!==i||Oe(n[a]),("all"===i||"code"===i)&&r(pa.is_debug)&&pa.is_debug.apph5&&(o.type&&"profile"===o.type.slice(0,7)||(o.properties._jssdk_debug_info="apph5-"+String(a)))},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(g(e).protocol!==g(t).protocol)return!1}catch(r){return Ne("\u4e0d\u652f\u6301 _.URL \u65b9\u6cd5"),!1}return!0},serverUrl:function(){d(pa.server_url)&&""!==pa.server_url&&!this.protocolIsSame(pa.server_url,location.href)&&Ne("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){return e!==pa.server_url&&void(d(e)&&""!==e&&!this.protocolIsSame(e,location.href)&&Ne("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"))}}},Pa={initPage:function(){var e=Le(),t=Z(),r=Ie(t);r||ka.jssdkDebug("url_domain\u5f02\u5e38_"+t+"_"+r),this.pageProp={referrer:e,referrer_host:e?q(e):"",url:t,url_host:q(t,"url_host\u53d6\u503c\u5f02\u5e38"),url_domain:r}},pageProp:{},campaignParams:function(){return Vi.kit.getUtmData()},campaignParamsStandard:function(e,t){e=e||"",t=t||"";var r=Pa.campaignParams(),n={},i={};return k(r,function(r,a,o){(" "+ga+" ").indexOf(" "+a+" ")!==-1?n[e+a]=o[a]:i[t+a]=o[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,r={$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:_a};return r},currentProps:{},register:function(e){P(Pa.currentProps,e)}},Ca={},Oa=new l;Ca.spa=Oa,Ca.sdk=new l,Ca.data=new l,Ca.initSystemEvent=function(){Ye(function(e){Oa.emit("switch",e)})},Ca.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"],dataSendSuccess:["data","sendSuccess"],dataSendFail:["data","sendFail"]};var Na=function(e){this.callback=e.callback,this.server_url=e.server_url,this.data=e.data,this.origin_data=e.origin_data};Na.prototype.start=function(){var e=this,t=new Date;Ze({url:this.server_url,type:"POST",data:e.data,credentials:!1,timeout:pa.datasend_timeout,cors:!0,success:function(r,n){Ca.data.emit("sendSuccess",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()},error:function(r,n){Ca.data.emit("sendFail",{status:String(n),resText:r,type:"ajax_single",timeout_config:pa.datasend_timeout,request_timeout:new Date-t,data:e.origin_data}),e.end()}})},Na.prototype.end=function(){if(this.callback){if(Oe("warning: sdk callback is deprecated."),!e(this.callback))return void Oe("error: sdk callback must be function.");this.callback()}};var ja="sawebjssdk-",Ia="tab-sawebjssdk-";tt.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()},pa.batch_send.send_interval)},getServerUrl:function(){return d(pa.server_url)&&""!==pa.server_url||v(pa.server_url)&&pa.server_url.length?void(this.serverUrl=v(pa.server_url)?pa.server_url[0]:pa.server_url):je("\u5f53\u524d server_url \u4e3a\u7a7a\u6216\u4e0d\u6b63\u786e\uff0c\u53ea\u5728\u63a7\u5236\u53f0\u6253\u5370\u65e5\u5fd7\uff0cnetwork \u4e2d\u4e0d\u4f1a\u53d1\u6570\u636e\uff0c\u8bf7\u914d\u7f6e\u6b63\u786e\u7684 server_url\uff01")},send:function(){if(this.sendTimeStamp&&t()-this.sendTimeStamp-1&&r.splice(a,1),Xi.remove(e[n])}r=Ce(r),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal(r)))}},add:function(e){var r=ja+String(n()),a=Xi.get(this.tabKey);null===a?(this.tabKey=Ia+String(n()),a=this.generateTabStorageVal()):a=i(a)||this.generateTabStorageVal(),a.data.push(r),a.expireTime=t()+2*pa.batch_send.send_interval,Xi.set(this.tabKey,JSON.stringify(a)),Vi.store.saveObjectVal(r,e),"track_signup"!==e.type&&"$pageview"!==e.event||this.sendImmediately()},generateTabStorage:function(){this.tabKey=Ia+String(n()),Xi.set(this.tabKey,JSON.stringify(this.generateTabStorageVal()))},generateTabStorageVal:function(e){return e=e||[],{data:e,expireTime:t()+2*pa.batch_send.send_interval,serverUrl:this.serverUrl}},sendImmediately:function(){this.send()},recycle:function(){for(var e={},r=1e4,n="sajssdk-lock-get-",o=0;ou.expireTime&&this.serverUrl===u.serverUrl){var d=new a(n);d.get(s,r,1e3,function(e){if(e){null===Xi.get(l.tabKey)&&l.generateTabStorage();var t=i(e)||l.generateTabStorageVal(),r=i(Xi.get(l.tabKey))||l.generateTabStorageVal();r.data=Ce(r.data.concat(t.data)),Xi.set(l.tabKey,JSON.stringify(r))}})}}else if(0===s.indexOf(n)){var p=i(Xi.get(s))||{expireTime:0};t()-p.expireTime>r&&Xi.remove(s)}}for(var f=0;f0)for(t=0;tpa.max_id_length)},keyLength:function(e){return!(!d(e)||e.length>pa.max_key_length)},stringLength:function(e){return!(!d(e)||e.length>pa.max_string_length)},voidZero:function(e){return void 0!==e},reservedLoginId:function(e){return!(re(this.loginIDReservedNames,e)>-1)},reservedUnbind:function(e){return!(re(this.unbindReservedNames,e)>-1)},reservedBind:function(e){var t=xa._state.history_login_id;return(!t||!t.name||t.name!==e)&&!(re(this.bindReservedNames,e)>-1)}},Ua={distinct_id:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Id"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},event:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="eventName"),e(Ea[n])&&Ea[n](r)),!0}},propertyKey:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="Property key"),e(Ea[n])&&Ea[n](r)),!0}},propertyValue:{rules:["voidZero"],onComplete:function(t,r,n){return t||(r="Property Value",e(Ea[n])&&Ea[n](r)),!0}},properties:function(t){return r(t)?k(t,function(t,r){rt({propertyKey:r});var n=function(t,n,i){return t||(n=r+"'s Value",e(Ea[i])&&Ea[i](n)),!0};rt({propertyValue:t},n)}):La.voidZero(t)&&Ne("properties\u53ef\u4ee5\u6ca1\u6709\uff0c\u4f46\u6709\u7684\u8bdd\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},propertiesMust:function(e){return void 0!==e&&r(e)&&!oe(e)?this.properties.call(this,e):Ne("properties\u5fc5\u987b\u662f\u5bf9\u8c61"),!0},item_type:{rules:["string","emptyString","keyLength","regexTest"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_type"),e(Ea[n])&&Ea[n](r)),!0}},item_id:{rules:["string","emptyString","stringLength"],onComplete:function(t,r,n){return t||("emptyString"===n&&(r="item_id"),e(Ea[n])&&Ea[n](r)),!0}},loginIdKey:{rules:["string","emptyString","keyLength","regexTest","reservedLoginId"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="login_id_key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindKey:{rules:["string","emptyString","keyLength","regexTest","reservedBind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},unbindKey:{rules:["string","emptyString","keyLength","regexTest","reservedUnbind"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Key"),e(Ea[n])&&Ea[n](r),"keyLength"===n)||t}},bindValue:{rules:["string","emptyString","idLength"],onComplete:function(t,r,n){return!t&&("emptyString"===n&&(r="Value"),e(Ea[n])&&Ea[n](r),"idLength"===n)||t}},check:function(t,r,n){var i=this[t];if(e(i))return i.call(this,r);if(!i)return!1;for(var a=0;a"),r=p(t.pop());if("div"!==r.slice(0,3))return!1}return!0},Ra.configIsMatchNew=function(e,t){if(d(e.$element_selector)&&d(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 e.$element_selector.indexOf(t.element_selector)>-1}if(d(e.$element_path)&&d(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 e.$element_path.indexOf(t.element_path)>-1}return!1},Ra.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"]?Ra.configIsMatchNew(e,t):Ra.configIsMatchOldVersion(e,t)))},Ra.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(Ra.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},Ra.filterConfig=function(e,t,n){var i=[];if(!n){var a=Ra.initUrl();if(!a)return[];n=a.page_url}return"$WebClick"===e.event&&k(t,function(t){r(t)&&("webclick"===t.event_type||"appclick"===t.event_type)&&r(t.event)&&t.event.url_host===n.host&&t.event.url_path===n.pathname&&Ra.configIsMatch(e.properties,t.event)&&i.push(t)}),i},Ra.getPropElInLi=function(e,t){if(!(e&&_(e)&&d(t)))return null;if("li"!==e.tagName.toLowerCase())return null;var r,n=Vi.heatmap.getDomSelector(e);if(n){r=n+t;var i=J(r);return i?i:null}return Ne("----custom---\u83b7\u53d6\u540c\u7ea7\u5c5e\u6027\u5143\u7d20\u5931\u8d25\uff0cselector\u4fe1\u606f\u5f02\u5e38",n,t),null},Ra.getProp=function(e,t){if(!r(e))return!1;if(!(d(e.name)&&e.name.length>0))return Ne("----vcustom----\u5c5e\u6027\u540d\u4e0d\u5408\u6cd5,\u5c5e\u6027\u629b\u5f03",e.name),!1;var n,i,a={};if("content"===e.method){var o;if(d(e.element_selector)&&e.element_selector.length>0)o=J(e.element_selector);else{if(!t||!d(e.list_selector))return Ne("----vcustom----\u5c5e\u6027\u914d\u7f6e\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var s=J(t.properties.$element_selector);if(!s)return Ne("----vcustom----\u70b9\u51fb\u5143\u7d20\u83b7\u53d6\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;var l=Vi.heatmap.getClosestLi(s);o=Ra.getPropElInLi(l,e.list_selector)}if(!o||!_(o))return Ne("----vcustom----\u5c5e\u6027\u5143\u7d20\u83b7\u53d6\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1;if("input"===o.tagName.toLowerCase())n=o.value||"";else if("select"===o.tagName.toLowerCase()){var u=o.selectedIndex;ce(u)&&_(o[u])&&(n=Xe(o[u],"select"))}else n=Xe(o,o.tagName.toLowerCase());if(e.regular){try{i=new RegExp(e.regular).exec(n)}catch(c){return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name),!1}if(null===i)return Ne("----vcustom----\u5c5e\u6027\u89c4\u5219\u5904\u7406\uff0c\u672a\u5339\u914d\u5230\u7ed3\u679c,\u5c5e\u6027\u629b\u5f03",e.name),!1;if(!v(i)||!d(i[0]))return Ne("----vcustom----\u6b63\u5219\u5904\u7406\u5f02\u5e38\uff0c\u5c5e\u6027\u629b\u5f03",e.name,i),!1;n=i[0]}if("STRING"===e.type)a[e.name]=n;else if("NUMBER"===e.type){if(n.length<1)return Ne("----vcustom----\u672a\u83b7\u53d6\u5230\u6570\u5b57\u5185\u5bb9\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;if(isNaN(Number(n)))return Ne("----vcustom----\u6570\u5b57\u7c7b\u578b\u5c5e\u6027\u8f6c\u6362\u5931\u8d25\uff0c\u5c5e\u6027\u629b\u5f03",e.name,n),!1;a[e.name]=Number(n)}return a}return je("----vcustom----\u5c5e\u6027\u4e0d\u652f\u6301\u6b64\u83b7\u53d6\u65b9\u5f0f",e.name,e.method),!1},Ra.getAssignConfigs=function(e,t){var n=Ra.initUrl();if(!n||!n.page_url)return[];if(!r(t))return[];var i=[];return t.events=t.events||t.eventList,v(t.events)&&t.events.length>0?(k(t.events,function(t){r(t)&&r(t.event)&&t.event.url_host===n.page_url.host&&t.event.url_path===n.page_url.pathname&&e(t)&&i.push(t)}),i):[]};var Ba={events:[],getAssignConfigs:Ra.getAssignConfigs,filterConfig:Ra.filterConfig,getProp:Ra.getProp,initUrl:Ra.initUrl,updateEvents:function(e){v(e)&&(this.events=e)},init:function(){this.initAppGetPropsBridge()},geth5Props:function(e){var t={},n=[],i=this;if(!this.events.length)return{};if("$WebClick"===e.event){var a=this.filterConfig(e,this.events);if(!a.length)return{};k(a,function(a){r(a)&&(v(a.properties)&&a.properties.length>0&&k(a.properties,function(n){if(r(n))if(n.h5===!1)v(t.sensorsdata_app_visual_properties)||(t.sensorsdata_app_visual_properties=[]),t.sensorsdata_app_visual_properties.push(n);else{var a=i.getProp(n,e);r(a)&&(t=P(t,a))}}),d(a.event_name)&&n.push(a.event_name))}),Vi.bridge.hasVisualModeBridge()&&(t.sensorsdata_web_visual_eventName=n)}return t.sensorsdata_app_visual_properties&&(t.sensorsdata_app_visual_properties=j(JSON.stringify(t.sensorsdata_app_visual_properties))),t},initAppGetPropsBridge:function(){var e=this,t=new Vi.SDKJSBridge("getJSVisualProperties");return t.onAppNotify(function(n){var i={};try{n=JSON.parse(N(n))}catch(a){je("getJSVisualProperties data parse error!")}if(r(n)){var o=n.sensorsdata_js_visual_properties,s=e.initUrl();s&&(s=s.page_url,v(o)&&o.length>0&&k(o,function(t){if(r(t)&&t.url_host===s.host&&t.url_path===s.pathname&&t.h5){var n=e.getProp(t);r(n)&&(i=P(i,n))}}))}var l=Vi.bridge.bridge_info.platform;return"android"===l&&t.notifyApp({data:i},n.message_id),i}),t}},Ha={events:[],customProp:Ba,getAssignConfigs:Ra.getAssignConfigs,initUrl:Ra.initUrl,init:function(){if(this.initUrl()){var e=this.getConfigFromApp();e&&this.updateConfigs(e),this.customProp.init(),this.initAppUpdateConfigBridge()}},initAppUpdateConfigBridge:function(){var e=this;return new Vi.SDKJSBridge("updateH5VisualConfig").onAppNotify(function(t){if(t){try{t=JSON.parse(N(t))}catch(r){return void je("updateH5VisualConfig result parse error\uff01")}e.updateConfigs(t)}})},getConfigFromApp:function(){var e=new Vi.SDKJSBridge("sensorsdata_get_app_visual_config").notifyApp();if(e)try{e=JSON.parse(N(e))}catch(t){e=null,je("getAppVisualConfig result parse error\uff01")}return e},updateConfigs:function(e){this.events=this.filterConfigs(e),this.customProp.updateEvents(this.events)},filterConfigs:function(e){return this.getAssignConfigs(function(e){return!(!r(e)||e.h5===!1)},e)}},Ja={events:[],init:function(e){this.filterWebClickEvents(e)},filterWebClickEvents:function(e){this.events=qa.getAssignConfigs(function(e){return!(!r(e)||e.event.unlimited_div!==!0||"webclick"!==e.event_type)},e)},isTargetEle:function(e){var t=Vi.heatmap.getEleDetail(e);if(!r(t)||!d(t.$element_path))return!1;for(var n=0;n0)},e),this.events.length?this.configSwitch=!0:this.configSwitch=!1},getVtrackProps:function(e){var t={};return this.collectAble()?("$WebClick"===e.event&&(t=this.clickCustomPropMaker(e,this.events)),t):{}},clickCustomPropMaker:function(e,t,n){var i=this;n=n||this.filterConfig(e,t,qa.url_info.page_url);var a={};return n.length?(k(n,function(t){v(t.properties)&&t.properties.length>0&&k(t.properties,function(t){var n=i.getProp(t,e);r(n)&&P(a,n)})}),a):{}},getProp:Ra.getProp,getPropElInLi:Ra.getPropElInLi,filterConfig:Ra.filterConfig},qa={unlimitedDiv:Ja,config:{},storageEnable:!0,storage_name:"webjssdkvtrackcollect",para:{session_time:18e5,timeout:5e3,update_interval:18e5},url_info:{},timer:null,update_time:null,customProp:Ma,initUrl:function(){var e=Ra.initUrl();if(e){var t;try{t=new f(Vi.para.server_url),t._values.Path="/config/visualized/Web.conf",e.api_url=t.getUrl()}catch(r){return je("----vtrackcollect---API\u5730\u5740\u89e3\u6790\u5f02\u5e38",r),!1}this.url_info=e}return e},init:function(){if(!r(Vi.para.heatmap)||!Vi.para.heatmap.get_vtrack_config)return!1;if(Xi.isSupport()||(this.storageEnable=!1),!this.initUrl())return je("----vtrackcustom----\u521d\u59cb\u5316\u5931\u8d25\uff0curl\u4fe1\u606f\u89e3\u6790\u5931\u8d25"),!1;if(this.storageEnable){var e=xa.readObjectVal(this.storage_name);if(r(e)&&r(e.data))if(this.serverUrlIsSame(e.serverUrl)){this.config=e.data,this.update_time=e.updateTime,this.updateConfig(e.data);var t=(new Date).getTime(),n=t-this.update_time;if(ce(n)&&n>0&&n0&&r-1)return n;if("area"===i&&"map"===a.tagName.toLowerCase()&&y(a).prev().tagName&&"img"===y(a).prev().tagName.toLowerCase())return y(a).prev();if("div"===i&&Vi.para.heatmap.collect_tags.div&&r.isDivLevelValid(n)){var s=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1;if(s>1||r.isCollectableDiv(n))return n}if(r.isStyleTag(i)&&Vi.para.heatmap.collect_tags.div){var l=r.getCollectableParent(n);if(l&&r.isDivLevelValid(l))return l}var u=r.hasElement({event:t&&t.originalEvent||t,element:e},function(e){return r.isUnlimitedTag(e)});return u||null},getDivLevels:function(e,t){var r=Xa.getElementPath(e,!0,t),n=r.split(" > "),i=0;return k(n,function(e){"div"===e&&i++}),i},isDivLevelValid:function(e){for(var t=Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level||1,r=e.getElementsByTagName("div"),n=r.length-1;n>=0;n--)if(Xa.getDivLevels(r[n],e)>t)return!1;return!0},getElementPath:function(e,t,r){for(var n=[];e.parentNode&&_(e);){if(!d(e.tagName))return"unknown";if(e.id&&!t&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(e.id)){n.unshift(e.tagName.toLowerCase()+"#"+e.id);break}if(r&&e===r){n.unshift(e.tagName.toLowerCase());break}if(e===document.body){n.unshift("body");break}n.unshift(e.tagName.toLowerCase()),e=e.parentNode}return n.join(" > ")},getClosestLi:function(e){var t=function(e,t){for(;e&&e!==document&&1===e.nodeType;e=e.parentNode)if(e.tagName&&d(e.tagName)&&e.tagName.toLowerCase()===t)return e;return null};return t(e,"li")},getElementPosition:function(e,t,r){function n(e){var t=e.parentNode;if(!t)return"";var r=y(e).getSameTypeSiblings(),n=r.length;if(1===n)return 0;for(var i=0,a=e;y(a).previousElementSibling().ele;a=y(a).previousElementSibling().ele,i++);return i}var i=Vi.heatmap.getClosestLi(e);if(!i||!_(e)||!d(e.tagName))return null;var a=e.tagName.toLowerCase(),o=i.getElementsByTagName(a),s=o.length,l=[];if(s>1){for(var u=0;u1)return re(l,e)}return n(i)},setNotice:function(e){Vi.is_heatmap_render_mode=!0,Vi.para.heatmap||(Vi.errorMsg="\u60a8SDK\u6ca1\u6709\u914d\u7f6e\u5f00\u542f\u70b9\u51fb\u56fe\uff0c\u53ef\u80fd\u6ca1\u6709\u6570\u636e\uff01"),e&&"http:"===e.slice(0,5)&&"https:"===location.protocol&&(Vi.errorMsg="\u60a8\u7684\u5f53\u524d\u9875\u9762\u662fhttps\u7684\u5730\u5740\uff0c\u795e\u7b56\u5206\u6790\u73af\u5883\u4e5f\u5fc5\u987b\u662fhttps\uff01"),Vi.para.heatmap_url||(Vi.para.heatmap_url=ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/heatmap.min.js")},getDomIndex:function(e){if(!e.parentNode)return-1;for(var t=0,r=e.tagName,n=e.parentNode.children,i=0;i "):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 e=0;try{e=o.documentElement&&o.documentElement.scrollTop||m.pageYOffset,e=isNaN(e)?0:e}catch(t){e=0}return parseInt(e,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=We({target:e});r.$element_selector=t?t:"",r.$element_path=Vi.heatmap.getElementPath(e,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);var n=Vi.heatmap.getElementPosition(e,r.$element_path,Vi.para.heatmap&&"not_use_id"===Vi.para.heatmap.element_selector);return ce(n)&&(r.$element_position=n),r},getPointerEventProp:function(e,t){function r(){var e=document.body.scrollLeft||document.documentElement.scrollLeft||0,t=document.body.scrollTop||document.documentElement.scrollTop||0;return{scrollLeft:e,scrollTop:t}}function n(e){if(document.documentElement.getBoundingClientRect){var t=e.getBoundingClientRect();return{targetEleX:t.left+r().scrollLeft||0,targetEleY:t.top+r().scrollTop||0}}}function i(e){return Number(Number(e).toFixed(3))}function a(e){var a=e.pageX||e.clientX+r().scrollLeft||e.offsetX+n(t).targetEleX||0,o=e.pageY||e.clientY+r().scrollTop||e.offsetY+n(t).targetEleY||0;return{$page_x:i(a),$page_y:i(o)}}return e?a(e):{}},start:function(t,n,i,a,o){if(r(Vi.para.heatmap)&&e(Vi.para.heatmap.collect_element)&&!Vi.para.heatmap.collect_element(n))return!1;var s=Xa.getBasicEleInfo(t,n,i,a,o);mt(s)},getBasicEleInfo:function(t,n,i,a,o){var s=r(a)?a:{},l=e(o)?o:e(a)?a:void 0,u=this.getEleDetail(n);if(Vi.para.heatmap&&Vi.para.heatmap.custom_property){var c=Vi.para.heatmap.custom_property(n);r(c)&&(u=P(u,c))}return u=P(u,this.getPointerEventProp(t,n),s),{event:t,target:n,props:u,tagName:i,callback:l}},hasElement:function(e,t){var r;if(e.event){var n=e.event;r=n.path||n._getPath&&n._getPath()}else e.element&&(r=y(e.element).getParents());if(r&&v(r)&&r.length>0)for(var i=0;i-1)&&(!t||Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div?!!(r(Vi.para.heatmap)&&r(Vi.para.heatmap.collect_tags)&&r(Vi.para.heatmap.collect_tags.div)&&v(Vi.para.heatmap.collect_tags.div.ignore_tags)&&re(Vi.para.heatmap.collect_tags.div.ignore_tags,e)>-1):re(i,e)>-1)},isCollectableDiv:function(e,t){try{if(0===e.children.length)return!0;for(var r=0;r1||this.isStyleTag(n,t)))return!1;if(!this.isCollectableDiv(e.children[r],t))return!1}return!0}catch(a){je("isCollectableDiv:"+a)}return!1},getCollectableParent:function(e,t){try{var r=e.parentNode,n=r?r.tagName.toLowerCase():"";if("body"===n)return!1;var i=Vi.para&&Vi.para.heatmap&&Vi.para.heatmap.collect_tags&&Vi.para.heatmap.collect_tags.div&&Vi.para.heatmap.collect_tags.div.max_level;if(n&&"div"===n&&(i>1||this.isCollectableDiv(r,t)))return r;if(r&&this.isStyleTag(n,t))return this.getCollectableParent(r,t)}catch(a){je("getCollectableParent:"+a)}return!1},listenUrlChange:function(e){e(),Vi.ee.spa.on("switch",function(){e()})},initScrollmap:function(){if(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.scroll_notice_map)return!1;var t=!0;Vi.para.scrollmap&&e(Vi.para.scrollmap.collect_url)&&this.listenUrlChange(function(){t=!!Vi.para.scrollmap.collect_url()});var n=function(e){var t={};return t.timeout=e.timeout||1e3,t.func=e.func,t.hasInit=!1,t.inter=null,t.main=function(e,t){this.func(e,t),this.inter=null},t.go=function(e){var r={};this.inter||(r.$viewport_position=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,r.$viewport_position=Math.round(r.$viewport_position)||0,e?t.main(r,!0):this.inter=setTimeout(function(){t.main(r)},this.timeout))},t},i=n({timeout:1e3,func:function(e,t){var r=document.documentElement&&document.documentElement.scrollTop||window.pageYOffset||document.body.scrollTop||0,n=new Date,i=n-this.current_time;(i>Vi.para.heatmap.scroll_delay_time&&r-e.$viewport_position!==0||t)&&(e.$url=Z(),e.$title=document.title,e.$url_path=G(),e.event_duration=Math.min(Vi.para.heatmap.scroll_event_duration,parseInt(i)/1e3),e.event_duration=e.event_duration<0?0:e.event_duration,vt(e)),this.current_time=n}});i.current_time=new Date,De(window,"scroll",function(){return!!t&&void i.go()}),De(window,"unload",function(){return!!t&&void i.go("notime")})},initHeatmap:function(){var t=this,n=!0;return!(!r(Vi.para.heatmap)||"default"!==Vi.para.heatmap.clickmap)&&(e(Vi.para.heatmap.collect_url)&&this.listenUrlChange(function(){n=!!Vi.para.heatmap.collect_url()}),"all"===Vi.para.heatmap.collect_elements?Vi.para.heatmap.collect_elements="all":Vi.para.heatmap.collect_elements="interact",void("all"===Vi.para.heatmap.collect_elements?De(document,"click",function(e){if(!n)return!1;var r=e||window.event;if(!r)return!1;var i=r.target||r.srcElement;if("object"!=typeof i)return!1;if("string"!=typeof i.tagName)return!1;var a=i.tagName.toLowerCase();if("body"===a||"html"===a)return!1;if(!i||!i.parentNode||!i.parentNode.children)return!1;var o=d(i.parentNode.tagName)?i.parentNode.tagName.toLowerCase():"unknown";"a"===o||"button"===o?t.start(r,i.parentNode,o):t.start(r,i,a)}):De(document,"click",function(e){if(!n)return!1;var i=e||window.event;if(!i)return!1;var a=i.target||i.srcElement,o=Vi.heatmap.getTargetElement(a,e);return!(!_(o)&&!d(a.tagName))&&void(_(o)&&d(o.tagName)?t.start(i,o,o.tagName.toLowerCase()):_(a)&&"div"===a.tagName.toLowerCase()&&r(Vi.para.heatmap)&&Vi.para.heatmap.get_vtrack_config&&Ja.events.length>0&&Ja.isTargetEle(a)&&t.start(i,a,a.tagName.toLowerCase(),{$lib_method:"vtrack"}))})))}},Za={autoTrackIsUsed:!1,isReady:function(t){return e(t)?void t():void Vi.log("error: isReady callback must be function")},getUtm:function(){return Pa.campaignParams()},getStayTime:function(){return(new Date-Vi._t)/1e3},setProfileLocal:function(e){if(!Xi.isSupport())return Vi.setProfile(e),!1;if(!r(e)||oe(e))return!1;var t=xa.readObjectVal("sensorsdata_2015_jssdk_profile"),n=!1;if(r(t)&&!oe(t)){for(var i in e)!(i in t&&t[i]!==e[i])&&i in t||(t[i]=e[i],n=!0);n&&(xa.saveObjectVal("sensorsdata_2015_jssdk_profile",t),Vi.setProfile(e))}else xa.saveObjectVal("sensorsdata_2015_jssdk_profile",e),Vi.setProfile(e)},setInitReferrer:function(){var e=Le();Vi.setOnceProfile({_init_referrer:e,_init_referrer_host:Pa.pageProp.referrer_host})},setSessionReferrer:function(){var e=Le();xa.setSessionPropsOnce({_session_referrer:e,_session_referrer_host:Pa.pageProp.referrer_host})},setDefaultAttr:function(){Pa.register({_current_url:location.href,_referrer:Le(),_referring_host:Pa.pageProp.referrer_host})},trackHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName&&_(e.parentNode)){var n=e.tagName.toLowerCase(),i=e.parentNode.tagName.toLowerCase(),a=Vi.para.heatmap&&Vi.para.heatmap.track_attr?Vi.para.heatmap.track_attr:["data-sensors-click"];"button"===n||"a"===n||"a"===i||"button"===i||"input"===n||"textarea"===n||Y(e,a)||Xa.start(null,e,n,t,r)}},trackAllHeatMap:function(e,t,r){if("object"==typeof e&&e.tagName){var n=e.tagName.toLowerCase();Xa.start(null,e,n,t,r)}},autoTrackSinglePage:function(e,t){function n(e,t){Vi.track("$pageview",P({$referrer:i,$url:Z(),$url_path:G(),$title:document.title},e,yt()),t),i=Z()}var i;i=this.autoTrackIsUsed?Pa.pageProp.url:Pa.pageProp.referrer,e=r(e)?e:{};var a=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile,n(e,t),this.autoTrackSinglePage=n,bt(Vi.setOnceProfile,!1,a)},autoTrackWithoutProfile:function(e,t){e=r(e)?e:{},this.autoTrack(P(e,{not_set_profile:!0}),t)},autoTrack:function(e,t){e=r(e)?e:{};var n=yt(),i=!e.not_set_profile;e.not_set_profile&&delete e.not_set_profile;var a=location.href;Vi.para.is_single_page&&w(function(){var r=Le(a,!0);Vi.track("$pageview",P({$referrer:r,$url:Z(),$url_path:G(),$title:document.title},n,e),t),a=Z()}),Vi.track("$pageview",P({$referrer:Le(null,!0),$url:Z(),$url_path:G(),$title:document.title},n,e),t),bt(Vi.setOnceProfile,!0,i),this.autoTrackIsUsed=!0},getAnonymousID:function(){return oe(xa._state)?"SDK is not initialized.":xa.getAnonymousId()},setPlugin:function(t){return!!r(t)&&void k(t,function(t,n){e(t)&&(r(window.SensorsDataWebJSSDKPlugin)&&window.SensorsDataWebJSSDKPlugin[n]?t(window.SensorsDataWebJSSDKPlugin[n]):r(Vi.modules)&&Vi.modules[n]?t(window.SensorsDataWebJSSDKPlugin[n]):Ne(n+"is not found,please check sensorsdata documents."))})},useModulePlugin:function(){Vi.use.apply(Vi,arguments)},useAppPlugin:function(){this.setPlugin.apply(this,arguments)}},Ga={state:0,historyState:[],stateType:{1:"1-init\u672a\u5f00\u59cb",2:"2-init\u5f00\u59cb",3:"3-store\u5b8c\u6210"},getState:function(){return this.historyState.join("\n")},setState:function(e){String(e)in this.stateType&&(this.state=e),this.historyState.push(this.stateType[e])}},Qa=1,Ya={__proto__:null,setInitVar:Pt,initPara:Ct,quick:Ot,use:Nt,track:jt,bind:It,unbind:Tt,trackLink:At,trackLinks:Dt,setItem:$t,deleteItem:xt,setProfile:Et,setOnceProfile:Lt,appendProfile:Ut,incrementProfile:Rt,deleteProfile:Bt,unsetProfile:Ht,identify:Jt,resetAnonymousIdentity:Mt,trackSignup:Kt,registerPage:Ft,clearAllRegister:Vt,clearPageRegister:Wt,register:zt,registerOnce:Xt,registerSession:Zt,registerSessionOnce:Gt,login:Qt,loginWithKey:Yt,logout:er,getPresetProperties:tr,readyState:Ga,debug:ka,on:et,log:Oe};zi.setup(Oe);var eo=P({},ua,Da),to={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:Vi.para.use_app_track_is_send!==!1&&"only"!==Vi.para.use_app_track,white_list:[],is_mui:"mui"===Vi.para.use_app_track};"object"==typeof Vi.para.app_js_bridge?Vi.para.app_js_bridge=P({},e,Vi.para.app_js_bridge):Vi.para.use_app_track!==!0&&Vi.para.app_js_bridge!==!0&&"only"!==Vi.para.use_app_track&&"mui"!==Vi.para.use_app_track||(Vi.para.app_js_bridge=P({},e)),Vi.para.app_js_bridge.is_send===!1&&Ne("\u8bbe\u7f6e\u4e86 is_send:false,\u5982\u679c\u6253\u901a\u5931\u8d25\uff0c\u6570\u636e\u5c06\u88ab\u4e22\u5f03!")},app_js_bridge_v1:function(){function e(e){n=e,ue(n)&&(n=JSON.parse(n)),i&&(i(n),i=null,n=null)}function t(){"object"==typeof window.SensorsData_APP_JS_Bridge&&window.SensorsData_APP_JS_Bridge.sensorsdata_call_app&&(n=window.SensorsData_APP_JS_Bridge.sensorsdata_call_app(),ue(n)&&(n=JSON.parse(n)))}function r(){if(/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream){var e=document.createElement("iframe");e.setAttribute("src","sensorsanalytics://getAppInfo"),document.documentElement.appendChild(e),e.parentNode.removeChild(e),e=null}}var n=null,i=null;window.sensorsdata_app_js_bridge_call_js=function(t){e(t)},Vi.getAppStatus=function(e){return r(),t(),e?void(null===n?i=e:(e(n),n=null)):n}},hasVisualModeBridge:function(){var e=window.SensorsData_App_Visual_Bridge,t="sensorsdata_visualized_mode";return r(e)&&e[t]&&(e[t]===!0||e[t]())},validateAppUrl:ar};nr.prototype.call=function(e,t){var r=this,i=(new Date).getTime().toString(16)+String(n()).replace(".","").slice(1,8);this.resultCbs[i]=r.resultCbs[i]||{result:null,callbacks:[]},this.timeoutCbs[i]=r.timeoutCbs[i]||{isTimeout:!1,callbacks:[]},e=e.data?e:{data:e},e.data.message_id=i;var a=P({callType:this.type},e);return t&&(this.timerId=setTimeout(function(){r.timeoutCbs[i].isTimeout=!0;for(var e in r.timeoutCbs[i].callbacks)r.timeoutCbs[i].callbacks[e].call(null),r.timeoutCbs[i].callbacks.splice(e,1)},t)),ir(a),{onResult:function(e){return r.resultCbs[i].result?(e(r.resultCbs[i].result),this):(!r.timeoutCbs[i].isTimeout&&r.resultCbs[i].callbacks.push(e),this)},onTimeout:function(e){return r.timeoutCbs[i].isTimeout?(e(),this):(!r.resultCbs[i].result&&r.timeoutCbs[i].callbacks.push(e),this)}}},nr.prototype.onAppNotify=function(e){this.appCallJsCallback=e},nr.prototype.notifyApp=function(e,t){var r=P({callType:this.type},e);return t&&(r.message_id=t),ir(r)},or.prototype={"double":function(){},getAppData:function(){},hasAppBridge:function(){return Vi.bridge.bridge_info.support_two_way_call},init:function(){},jsCallApp:function(){},requestToApp:function(t){this.bridge.call(t,t.timeout.time).onResult(function(r){e(t.callback)&&t.callback(r)}).onTimeout(function(){e(t.timeout.callback)&&t.timeout.callback()})}};var ro={isSeachHasKeyword:function(){return""!==F(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=F(e,"sa-request-id")||null,r=F(e,"sa-request-type")||null,n=F(e,"sa-request-url")||null;if(Xa.setNotice(n),aa.isSupport())if(null!==n&&sessionStorage.setItem("sensors_heatmap_url",n),sessionStorage.setItem("sensors_heatmap_id",t),null!==r)"1"===r||"2"===r||"3"===r?sessionStorage.setItem("sensors_heatmap_type",r):r=null;else{var i=sessionStorage.getItem("sensors_heatmap_type");r=null!==i?i:null}this.isReady(t,r)},isReady:function(e,t,r){Vi.para.heatmap_url?_e({success:function(){setTimeout(function(){"undefined"!=typeof sa_jssdk_heatmap_render&&(sa_jssdk_heatmap_render(Vi,e,t,r),"object"==typeof console&&"function"==typeof console.log&&(Vi.heatmap_version&&Vi.heatmap_version===Vi.lib_version||Ne("heatmap.js\u4e0esensorsdata.js\u7248\u672c\u53f7\u4e0d\u4e00\u81f4\uff0c\u53ef\u80fd\u5b58\u5728\u98ce\u9669!")))},0)},error:function(){},type:"js",url:Vi.para.heatmap_url}):je("\u6ca1\u6709\u6307\u5b9aheatmap_url\u7684\u8def\u5f84")},isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors_heatmap_id")},storageHasKeywordHandle:function(){Xa.setNotice(),ro.isReady(sessionStorage.getItem("sensors_heatmap_id"),sessionStorage.getItem("sensors_heatmap_type"),location.href)},isWindowNameHasKeyword:function(){try{var e=JSON.parse(window.name),t=d(e["sa-request-page-url"])?u(e["sa-request-page-url"]):null;return e["sa-request-id"]&&d(e["sa-request-id"])&&t===location.href}catch(r){return!1}},windowNameHasKeywordHandle:function(){function e(e){var r=t[e];return d(r)?u(r):null}var t=JSON.parse(window.name),r=e("sa-request-id"),n=e("sa-request-type"),i=e("sa-request-url");Xa.setNotice(i),aa.isSupport()&&(null!==i&&sessionStorage.setItem("sensors_heatmap_url",i),sessionStorage.setItem("sensors_heatmap_id",r),null!==n?"1"===n||"2"===n||"3"===n?sessionStorage.setItem("sensors_heatmap_type",n):n=null:n=null!==sessionStorage.getItem("sensors_heatmap_type")?sessionStorage.getItem("sensors_heatmap_type"):null),ro.isReady(r,n)}},no={isStorageHasKeyword:function(){return aa.isSupport()&&"string"==typeof sessionStorage.getItem("sensors-visual-mode")},isSearchHasKeyword:function(){return(lr("sa-visual-mode")===!0||"true"===lr("sa-visual-mode"))&&("string"==typeof sessionStorage.getItem("sensors_heatmap_id")&&sessionStorage.removeItem("sensors_heatmap_id"),!0)},loadVtrack:function(){_e({success:function(){},error:function(){},type:"js",url:Vi.para.vtrack_url?Vi.para.vtrack_url:ht()+"//static.sensorsdata.cn/sdk/"+Vi.lib_version+"/vtrack.min.js"})},messageListener:function(e){if(!e||!e.data||"sa-fe"!==e.data.source)return!1;if("v-track-mode"===e.data.type){if(e.data.data&&e.data.data.isVtrack)if(aa.isSupport()&&sessionStorage.setItem("sensors-visual-mode","true"),e.data.data.userURL&&location.href.match(/sa-visual-mode=true/)){var t=e.data.data.userURL;d(t)&&(window.location.href=encodeURI(t.replace(/javascript:/i,"")))}else no.loadVtrack();window.removeEventListener("message",no.messageListener,!1)}},removeMessageHandle:function(){window.removeEventListener&&window.removeEventListener("message",no.messageListener,!1)},verifyVtrackMode:function(){window.addEventListener&&window.addEventListener("message",no.messageListener,!1),no.postMessage()},postMessage:function(){try{window.parent&&window.parent.postMessage&&window.parent.postMessage({source:"sa-web-sdk",type:"v-is-vtrack",data:{sdkversion:_a}},"*")}catch(e){je("\u6d4f\u89c8\u5668\u7248\u672c\u8fc7\u4f4e\uff0c\u4e0d\u652f\u6301 postMessage API")}},notifyUser:function(){var e=function(t){return!(!t||!t.data||"sa-fe"!==t.data.source)&&void("v-track-mode"===t.data.type&&(t.data.data&&t.data.data.isVtrack&&alert("\u5f53\u524d\u7248\u672c\u4e0d\u652f\u6301\uff0c\u8bf7\u5347\u7ea7\u90e8\u7f72\u795e\u7b56\u6570\u636e\u6cbb\u7406"),window.removeEventListener("message",e,!1)))};window.addEventListener&&window.addEventListener("message",e,!1),no.postMessage()}},io=["setItem","deleteItem","getAppStatus","track","quick","register","registerPage","registerOnce","trackSignup","setProfile","setOnceProfile","appendProfile","incrementProfile","deleteProfile","unsetProfile","identify","resetAnonymousIdentity","login","logout","trackLink","clearAllRegister","clearPageRegister","bind","unbind","loginWithKey"],ao={track:function(e,t,r){},quick:function(e,t,r,n){},register:function(e){},registerPage:function(e){},registerOnce:function(e){},clearAllRegister:function(e){},trackSignup:function(e,t,r,n){},setProfile:function(e,t){},setOnceProfile:function(e,t){},appendProfile:function(e,t){},incrementProfile:function(e,t){},deleteProfile:function(e){},unsetProfile:function(e,t){},identify:function(e,t){},resetAnonymousIdentity:function(e){},login: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){}};vr.prototype.process=function(e,t){if(!(e&&e in this.processDef))return void je("process ["+e+"] is not supported");var r=this.registeredInterceptors[e];if(r&&v(r)&&r.length>0)for(var n={current:0,total:r.length},i=new mr(t,n,Vi),a=0;a=2)&&(wo&&(Or(!0),_r()),Ca.initSystemEvent(),Vi.setInitVar(),Vi.readyState.setState(2),Vi.initPara(e),Ca.sdk.emit("initPara"),Ca.sdk.emit("afterInitPara"),Ca.sdk.emit("initAPI"),Ca.sdk.emit("afterInitAPI"),Vi.detectMode(),rr(),Ca.sdk.emit("afterInit"),void Ca.sdk.emit("ready"))},wo?Or(!1):(Or(!0),_r());var So,ko,Po,Co,Oo,No,jo,Io,To,Ao,Do,$o,xo,Eo,Lo,Uo,Ro,Bo,Ho="1.26.9",Jo={init:function(e){var t=e._.isString,r=e._.rot13defs,n=e._.dfmapping,i="data:enc;",a="dfm-enc-";e.ee.sdk.on("afterInitPara",function(){e.kit.userEncrypt=function(e){return a+n(e)},e.kit.userDecrypt=function(e){return 0===e.indexOf(i)?(e=e.substring(i.length),e=r(e)):0===e.indexOf(a)&&(e=e.substring(a.length),e=n(e)),e},e.kit.userDecryptIfNeeded=function(r){return!t(r)||0!==r.indexOf(i)&&0!==r.indexOf(a)||(r=e.kit.userDecrypt(r)),r}})},plugin_name:"UserEncryptDefault"},Mo=Ir(Jo),qo="1.26.9",Ko={sd:null,init:function(e){if(this.sd)return!1;if(this.sd=e,!this.sd||!this.sd._)return!1;var t=this.sd._.cookie.get("sensors_amp_id"),r=this.sd.store._state.distinct_id;if(t&&t.length>0){var n="amp-"===t.slice(0,4);if(t!==r){if(!n)return!1;this.sd.store._state.first_id?(this.sd.identify(t,!0),this.sd.saEvent.send({original_id:t,distinct_id:r,type:"track_signup",event:"$SignUp",properties:{}},null),this.setAmpId(r)):this.sd.identify(t,!0)}}else this.setAmpId(r);this.addListener()},addListener:function(){var e=this;this.sd.events.on("changeDistinctId",function(t){e.setAmpId(t)}),this.sd.events.isReady()},setAmpId:function(e){this.sd._.cookie.set("sensors_amp_id",e)}},Fo=Dr(Ko,"Amp","sdkReady"),Vo=window.SensorsData_App_Visual_Bridge,Wo=Vo&&Vo.sensorsdata_visualized_mode,zo=Vo&&Vo.sensorsdata_visualized_alert_info,Xo=Vo&&Vo.sensorsdata_hover_web_nodes,Zo={isVerify:function(){return Wo&&(Wo===!0||Wo.call(Vo))},commands:{app_alert:$r,visualized_track:xr,page_info:xr,sensorsdata_get_app_visual_config:Er}},Go="1.26.9",Qo={init:function(e){Co=e,Oo=Co&&Co._,No=Co&&Co.log||console&&console.log||function(){},Br()},handleCommand:Jr},Yo=Rr(Qo,"AndroidBridge","sdkAfterInitPara"),es=window.SensorsData_App_Visual_Bridge,ts=es&&es.sensorsdata_visualized_mode,rs=es&&es.sensorsdata_visualized_alert_info,ns=es&&es.sensorsdata_hover_web_nodes,is={isVerify:function(){return ts&&(ts===!0||ts.call(es))},commands:{app_alert:Mr,visualized_track:qr,page_info:qr,sensorsdata_get_app_visual_config:Kr}},as="1.26.9",os={init:function(e){Do=e,$o=Do&&Do._,xo=Do&&Do.log||console&&console.log||function(){},zr()},handleCommand:Zr},ss=Wr(os,"AndroidObsoleteBridge","sdkAfterInitPara"),ls="1.26.9",us={event_list:[],latest_event_initial_time:null,max_save_time:2592e6,init:function(e,t){function r(){return Eo=Lo._,Uo=Lo.store,!!Eo.localStorage.isSupport()&&(Lo.para.max_string_length=1024,n.eventList.init(),n.addLatestChannelUrl(),void n.addIsChannelCallbackEvent())}if(Lo||!e)return!1;t=t||{},Ro=t.cookie_name||"sensorsdata2015jssdkchannel",Lo=e;var n=this;r()},addIsChannelCallbackEvent:function(){Lo.registerPage({$is_channel_callback_event:function(e){if(Eo.isObject(e)&&e.event&&"$WebClick"!==e.event&&"$pageview"!==e.event&&"$WebStay"!==e.event&&"$SignUp"!==e.event)return!us.eventList.hasEvent(e.event)&&(us.eventList.add(e.event),!0)}})},addLatestChannelUrl:function(){var e=this.getUrlDomain(),t=this.cookie.getChannel();if("url\u89e3\u6790\u5931\u8d25"===e)this.registerAndSave({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"url\u7684domain\u89e3\u6790\u5931\u8d25"});else if(Eo.isReferralTraffic(document.referrer)){var r=Eo.getQueryParam(location.href,"sat_cf");Eo.isString(r)&&r.length>0?(this.registerAndSave({_sa_channel_landing_url:location.href}),us.channelLinkHandler()):this.registerAndSave({_sa_channel_landing_url:""})}else t?Lo.registerPage(t):Lo.registerPage({_sa_channel_landing_url:"",_sa_channel_landing_url_error:"\u53d6\u503c\u5f02\u5e38"})},registerAndSave:function(e){Lo.registerPage(e),this.cookie.saveChannel(e)},cookie:{getChannel:function(){var e=Lo.kit.userDecryptIfNeeded(Eo.cookie.get(Ro));return e=Eo.safeJSONParse(e),!(!Eo.isObject(e)||!e.prop)&&e.prop},saveChannel:function(e){var t={prop:e},r=JSON.stringify(t);Lo.para.encrypt_cookie&&(r=Lo.kit.userEncrypt(r)),Eo.cookie.set(Ro,r)}},channelLinkHandler:function(){this.eventList.reset(),Lo.track("$ChannelLinkReaching")},getUrlDomain:function(){var e=Eo.info.pageProp.url_domain;return""===e&&(e="url\u89e3\u6790\u5931\u8d25"),e},eventList:{init:function(){var e=this.get(),t=(new Date).getTime();if(e&&Eo.isNumber(e.latest_event_initial_time)&&Eo.isArray(e.eventList)){var r=t-e.latest_event_initial_time;r>0&&r0&&(1===arguments.length&&Cs(arguments[0])?t=arguments[0]:arguments.length>=2&&Cs(arguments[1])&&(t=arguments[1])),!Ps())return this.log("\u4e0d\u652f\u6301\u5f53\u524d\u7cfb\u7edf\uff0c\u76ee\u524d\u53ea\u652f\u6301Android\u548ciOS"), +!1;if(Cs(t)&&this.sd._.isNumber(t.timeout)&&t.timeout>=2500&&(this.timeout=t.timeout),!this.sd.para.server_url)return this.log("\u795e\u7b56JS SDK\u914d\u7f6e\u9879server_url\u672a\u6b63\u786e\u914d\u7f6e"),!1;var r=Ns(this.sd);this.apiURL=this.apiURL.replace("{origin}",r.origin).replace("{project}",r.project);var n=this.sd._.getQueryParam(window.location.href,"deeplink");if(!n)return this.log("\u5f53\u524d\u9875\u9762\u7f3a\u5c11deeplink\u53c2\u6570"),!1;n=window.decodeURIComponent(n);var i=Os(n);return i?(this.key=i[2],this.apiURL=this.apiURL.replace("{key}",window.encodeURIComponent(i[2])),this.sd._.ajax({url:this.apiURL,type:"GET",cors:!0,credentials:!1,success:function(e){return e.errorMsg?(Ts.log("API\u62a5\u9519\uff1a"+e.errorMsg),!1):(Ts.data=e,Ts.log("API\u67e5\u8be2\u6210\u529f\uff0c\u6570\u636e\uff1a"+JSON.stringify(e,null," ")),void(this.data.app_key&&(this.data.android_info&&this.data.android_info.url_schemes&&(this.data.android_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key),this.data.ios_info&&this.data.ios_info.url_schemes&&(this.data.ios_info.url_schemes+="://sensorsdata/sd/"+this.data.app_key+"/"+this.key))))}.bind(this),error:function(){Ts.log("API\u67e5\u8be2\u51fa\u9519")}}),void this.addListeners()):(this.log("\u5f53\u524d\u9875\u9762\u7684deeplink\u53c2\u6570\u65e0\u6548"),!1)},openDeepLink:function(){if(this.log("openDeeplink()"),!this.data)return this.log("\u6ca1\u6709Deep link\u6570\u636e!"),!1;if("iOS"===ks){this.log("\u5f53\u524d\u7cfb\u7edf\u662fiOS");var e=this.sd&&this.sd._&&this.sd._.getIOSVersion()>=9&&this.data.ios_info.ios_wake_url?this.data.ios_info.ios_wake_url:this.data.ios_info.url_schemes;this.log("\u5524\u8d77APP\u7684\u5730\u5740\uff1a"+e),Is(this,e,this.data.ios_info.download_url)}else this.log("\u5f53\u524d\u7cfb\u7edf\u662f android"),js(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=ps().visibilityChange,t=this;e&&document.addEventListener(e,function(){clearTimeout(t.timer),t.log("visibilitychange, clear timeout:"+t.timer)},!1),window.addEventListener("pagehide",function(){t.log("page hide, clear timeout:"+t.timer),clearTimeout(t.timer)},!1)}},As=rn(Ts,"Deeplink","sdkReady"),Ds="1.26.9",$s={init:function(e){_s=e,hs=_s&&_s._,ms=_s&&_s.log||console&&console.log||function(){},ln()},handleCommand:cn},xs=sn($s,"IOSBridge","sdkAfterInitPara"),Es="1.26.9",Ls={init:function(e){vs=e,ys=vs&&vs._,bs=vs&&vs.log||console&&console.log||function(){},gn()}},Us=fn(Ls,"IOSObsoleteBridge","sdkAfterInitPara"),Rs="1.26.9",Bs=5e3,Hs=432e3;wn.prototype.init=function(e,t){if(e){if(this.sd=e,this._=this.sd._,t){this.option=t;var r=t.heartbeat_interval_time;r&&(this._.isNumber(r)||this._.isNumber(1*r))&&1*r>0&&(this.heartbeat_interval_time=1e3*r);var n=t.max_duration;n&&(this._.isNumber(n)||this._.isNumber(1*n))&&1*n>0&&(this.max_duration=n)}this.page_id=Number(String(this._.getRandom()).slice(2,5)+String(this._.getRandom()).slice(2,4)+String((new Date).getTime()).slice(-4)),this.addEventListener(),document.hidden===!0?this.page_show_status=!1:this.addHeartBeatInterval(),this.log("PageLeave\u521d\u59cb\u5316\u5b8c\u6bd5")}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},wn.prototype.log=function(e){this.sd&&this.sd.log(e)},wn.prototype.refreshPageEndTimer=function(){var e=this;this.timer&&(clearTimeout(this.timer),this.timer=null),this.timer=setTimeout(function(){e.page_hidden_status=!1},Bs)},wn.prototype.hiddenStatusHandler=function(){clearTimeout(this.timer),this.timer=null,this.page_hidden_status=!1},wn.prototype.pageStartHandler=function(){this.start_time=+new Date,!document.hidden==!0?this.page_show_status=!0:this.page_show_status=!1,this.url=location.href,this.title=document.title},wn.prototype.pageEndHandler=function(){if(this.page_hidden_status!==!0){var e=this.getPageLeaveProperties();this.page_show_status===!1&&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()}},wn.prototype.addEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},wn.prototype.addPageStartListener=function(){var e=this;"onpageshow"in window&&this._.addEvent(window,"pageshow",function(){e.pageStartHandler(),e.hiddenStatusHandler()})},wn.prototype.isCollectUrl=function(e){return"function"!=typeof this.option.isCollectUrl||("string"!=typeof e||""===e||this.option.isCollectUrl(e))},wn.prototype.addSinglePageListener=function(){var e=this;this.sd.ee&&this.sd.ee.spa.prepend("switch",function(t){t!==location.href&&(e.url=t,e.pageEndHandler(),e.stopHeartBeatInterval(),e.current_page_url=e.url,e.pageStartHandler(),e.hiddenStatusHandler(),e.addHeartBeatInterval())})},wn.prototype.addPageEndListener=function(){var e=this;this._.each(["pagehide","beforeunload","unload"],function(t){"on"+t in window&&e._.addEvent(window,t,function(){e.pageEndHandler(),e.stopHeartBeatInterval()})})},wn.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()}})},wn.prototype.addHeartBeatInterval=function(){this._.localStorage.isSupport()&&this.startHeartBeatInterval()},wn.prototype.startHeartBeatInterval=function(){var e=this;this.heartbeat_interval_timer&&this.stopHeartBeatInterval();var t=!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()},wn.prototype.stopHeartBeatInterval=function(){clearInterval(this.heartbeat_interval_timer),this.heartbeat_interval_timer=null},wn.prototype.saveHeartBeatData=function(e){var t=this.getPageLeaveProperties(),r=new Date;t.$time=r,"is_first_heartbeat"===e&&(t.event_duration=3.14);var n=this.sd.kit.buildData({type:"track",event:"$WebPageLeave",properties:t});n.heartbeat_interval_time=this.heartbeat_interval_time,this.sd.store.saveObjectVal(this.storage_name+"-"+this.page_id,n)},wn.prototype.delHeartBeatData=function(e){this._.localStorage.isSupport()&&this._.localStorage.remove(e||this.storage_name+"-"+this.page_id)},wn.prototype.reissueHeartBeatData=function(){for(var e=window.localStorage.length,t=e-1;t>=0;t--){var r=window.localStorage.key(t);if(r&&r!==this.storage_name+"-"+this.page_id&&0===r.indexOf(this.storage_name+"-")){var n=this.sd.store.readObjectVal(r);this._.isObject(n)&&1*new Date-n.time>n.heartbeat_interval_time+5e3&&(delete n.heartbeat_interval_time,n._flush_time=(new Date).getTime(),this.sd.kit.sendData(n),this.delHeartBeatData(r))}}},wn.prototype.getPageLeaveProperties=function(){var e=(+new Date-this.start_time)/1e3;(isNaN(e)||e<0||e>this.max_duration)&&(e=0),e=Number(e.toFixed(3));var t=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;var n={$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&&(n.event_duration=e),n=this._.extend(n,this.option.custom_props)};var Js=new wn,Ms=bn(Js,"PageLeave","sdkReady"),qs="1.26.9",Ks=!1,Fs={init:function(e,t){function r(t,r){if(t.getEntries&&"function"==typeof t.getEntries){for(var n=t.getEntries(),i=null,a=0;a=0&&i<10737418240&&(r.$page_resource_size=Number((i/1024).toFixed(3)))}}function n(t){var r=0;if(t.timing){var n=t.timing;0!==n.fetchStart&&e._.isNumber(n.fetchStart)&&0!==n.domContentLoadedEventEnd&&e._.isNumber(n.domContentLoadedEventEnd)?r=n.domContentLoadedEventEnd-n.fetchStart:e.log("performance \u6570\u636e\u83b7\u53d6\u5f02\u5e38")}return r}function i(t){var r=0;if(e._.isFunction(t.getEntriesByType)){var n=t.getEntriesByType("navigation")||[{}];r=(n[0]||{}).domContentLoadedEventEnd||0}return r}function a(){var o=0,s=window.performance||window.webkitPerformance||window.msPerformance||window.mozPerformance,l={$url:e._.getURL(),$title:document.title,$url_path:e._.getURLPath(),$referrer:e._.getReferrer(null,!0)};if(s?(o=i(s)||n(s),r(s,l)):e.log("\u6d4f\u89c8\u5668\u672a\u652f\u6301 performance API."),o>0){var u=e._.isObject(t)&&t.max_duration||1800;o=Number((o/1e3).toFixed(3)),(!e._.isNumber(u)||u<=0||o<=u)&&(l.event_duration=o)}Ks||(e.track("$WebPageLoad",l),Ks=!0),window.removeEventListener?window.removeEventListener("load",a):window.detachEvent&&window.detachEvent("onload",a)}"complete"==document.readyState?a():window.addEventListener?window.addEventListener("load",a):window.attachEvent&&window.attachEvent("onload",a)}},Vs=Pn(Fs,"PageLoad","sdkReady");On.prototype.init=function(e){if(e){this.sd=e,this._=e._,this.log=e.log;var t=this;e.registerInterceptor("buildDataStage",{extendProps:{priority:0,entry:function(e){return Cn(e,t)}}})}else this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.register=function(e){return this.sd?void(this._.isObject(e)&&this._.isArray(e.events)&&e.events.length>0&&this._.isObject(e.properties)&&!this._.isEmptyObject(e.properties)?this.customRegister.push(e):this.log("RegisterProperties: register \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")},On.prototype.hookRegister=function(e){return this.sd?void(this._.isFunction(e)?this.customRegister.push(e):this.log("RegisterProperties: hookRegister \u53c2\u6570\u9519\u8bef")):void this.log("\u795e\u7b56JS SDK\u672a\u6210\u529f\u5f15\u5165")};var Ws="1.26.9";On.prototype.plugin_name="RegisterProperties";var zs,Xs,Zs=new On,Gs=In(Zs),Qs="1.26.9",Ys=window.console&&window.console.log||function(){},el={init:function(e){return zs=e,Ys=zs&&zs.log||Ys,e&&e.kit&&e.kit.buildData?(Xs=zs.kit.buildData,zs.kit.buildData=$n,void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5b8c\u6210")):void Ys("RegisterPropertyPageHeight \u63d2\u4ef6\u521d\u59cb\u5316\u5931\u8d25,\u5f53\u524d\u4e3bsdk\u4e0d\u652f\u6301 RegisterPropertyPageHeight \u63d2\u4ef6\uff0c\u8bf7\u5347\u7ea7\u4e3bsdk")}},tl=Dn(el,"RegisterPropertyPageHeight","sdkReady"),rl="1.26.9",nl={};nl.getPart=function(e){var t=!1,r=this.option.length;if(r)for(var n=0;n-1)return!0;return t},nl.getPartHash=function(e){var t=this.option.length,r=!1;if(t)for(var n=0;n-1)return this.option[n].after_hash;return!!r},nl.getCurrenId=function(){var e=this.store.getDistinctId()||"",t=this.store.getFirstId()||"";this._.urlSafeBase64&&this._.urlSafeBase64.encode?e=e?this._.urlSafeBase64.trim(this._.urlSafeBase64.encode(this._.base64Encode(e))):"":this._.rot13obfs&&(e=e?this._.rot13obfs(e):"");var r=t?"f"+e:"d"+e;return encodeURIComponent(r)},nl.rewriteUrl=function(e,t){var r=this,n=/([^?#]+)(\?[^#]*)?(#.*)?/,i=n.exec(e),a="";if(i){var o,s=i[1]||"",l=i[2]||"",u=i[3]||"",c="_sasdk="+this.getCurrenId(),d=function(e){var t=e.split("&"),n=[];return r._.each(t,function(e){e.indexOf("_sasdk=")>-1?n.push(c):n.push(e)}),n.join("&")};if(this.getPartHash(e)){o=u.indexOf("_sasdk");var p=u.indexOf("?");a=p>-1?o>-1?s+l+"#"+u.substring(1,o)+d(u.substring(o,u.length)):s+l+u+"&"+c:s+l+"#"+u.substring(1)+"?"+c}else{o=l.indexOf("_sasdk");var f=/^\?(\w)+/.test(l);a=f?o>-1?s+"?"+d(l.substring(1))+u:s+l+"&"+c+u:s+"?"+c+u}return t&&(t.href=a),a}},nl.getUrlId=function(){var e=location.href.match(/_sasdk=([aufd][^\?\#\&\=]+)/);if(this._.isArray(e)&&e[1]){var t=decodeURIComponent(e[1]);return!t||"f"!==t.substring(0,1)&&"d"!==t.substring(0,1)||(this._.urlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64&&this._.urlSafeBase64.isUrlSafeBase64(t)?t=t.substring(0,1)+this._.base64Decode(this._.urlSafeBase64.decode(t.substring(1))):this._.rot13defs&&(t=t.substring(0,1)+this._.rot13defs(t.substring(1)))),t}return""},nl.setRefferId=function(e){var t=this.store.getDistinctId(),r=this.getUrlId();if(r&&""!==r){var n="a"===r.substring(0,1)||"d"===r.substring(0,1);r=r.substring(1),r!==t&&(n?(this.sd.identify(r,!0),this.store.getFirstId()&&this.sd.saEvent.send({original_id:r,distinct_id:t,type:"track_signup",event:"$SignUp",properties:{}},null)):this.store.getFirstId()&&!e.re_login||this.sd.login(r))}},nl.addListen=function(){var e=this,t=function(t){var r,n,i=t.target,a=i.tagName.toLowerCase(),o=i.parentNode;if("a"===a&&i.href||o&&o.tagName&&"a"===o.tagName.toLowerCase()&&o.href){"a"===a&&i.href?(r=i.href,n=i):(r=o.href,n=o);var s=e._.URL(r),l=s.protocol;"http:"!==l&&"https:"!==l||e.getPart(r)&&e.rewriteUrl(r,n)}};e._.addEvent(document,"mousedown",t),window.PointerEvent&&"maxTouchPoints"in window.navigator&&window.navigator.maxTouchPoints>=0&&e._.addEvent(document,"pointerdown",t)},nl.init=function(e,t){function r(t){for(var r=t.length,n=[],i=0;i0?(this.setRefferId(t),this.addListen(),this.option=t.linker,void(this.option=r(this.option))):void e.log("\u8bf7\u914d\u7f6e\u6253\u901a\u57df\u540d\u53c2\u6570\uff01")};var il,al,ol,sl,ll,ul,cl,dl,pl,fl,gl,_l,hl,ml=Ln(nl,"SiteLinker","sdkReady"),vl="utm_source utm_medium utm_campaign utm_content utm_term",yl="1.26.9",bl={init:function(e){function t(){var e=vl.split(" "),t="",r={};return il._.isArray(il.para.source_channel)&&il.para.source_channel.length>0&&(e=e.concat(il.para.source_channel),e=il._.unique(e)),il._.each(e,function(e){t=il._.getQueryParam(location.href,e),t.length&&(r[e]=t)}),r}e&&!il&&(il=e,il.registerInterceptor("businessStage",{getUtmData:{priority:0,entry:function(){return t()}}}))}},wl=Bn(bl,"Utm","sdkAfterInitPara"),Sl="1.26.9",kl=!1,Pl=null,Cl={init:function(e){Pl=e,Pl.disableSDK=qn,Pl.enableSDK=Kn,Pl.getDisabled=Fn}},Ol=Mn(Cl,"DisableSDK","sdkInitAPI"),Nl="1.26.9",jl={plugin_name:"DebugSender",init:function(e){al=e,ol=al._,Qn()}},Il=zn(jl),Tl="1.26.9",Al={plugin_name:"JsappSender",init:function(e){sl=e,ll=sl._,ni()}},Dl=ti(Al),$l="1.26.9",xl=null,El={plugin_name:"BatchSender",init:function(e){ul=e,cl=ul._,ci()}},Ll=si(El),Ul="1.26.9",Rl={plugin_name:"BeaconSender",init:function(e){dl=e,pl=dl._,mi()}},Bl=fi(Rl),Hl="1.26.9",Jl={plugin_name:"AjaxSender",init:function(e){fl=e,gl=fl._,Pi()}},Ml=bi(Jl),ql="1.26.9",Kl={plugin_name:"ImageSender",init:function(e){_l=e,hl=_l._,Di()}},Fl=Ni(Kl),Vl=null,Wl=null,zl=[],Xl={init:function(e){e&&(Vl=e,Wl=Vl._,Vl.logger&&Vl.logger.appendWriter(Li),Vl.on&&Vl.on("sdkAfterInitPara",function(){for(var e=0;e1&&(De[e]||de.uniqueSort(i),Ae.test(e)&&i.reverse()),this.pushStack(i)}});var Se=/[^\x20\t\r\n\f]+/g;de.Callbacks=function(e){e="string"==typeof e?l(e):de.extend({},e);var t,r,i,o,a=[],s=[],u=-1,c=function(){for(o=o||e.once,i=t=!0;s.length;u=-1)for(r=s.shift();++u-1;)a.splice(n,1),n<=u&&u--}),this},has:function(e){return e?de.inArray(e,a)>-1:a.length>0},empty:function(){return a&&(a=[]),this},disable:function(){return o=s=[],a=r="",this},disabled:function(){return!a},lock:function(){return o=s=[],r||t||(a=r=""),this},locked:function(){return!!o},fireWith:function(e,n){return o||(n=n||[],n=[e,n.slice?n.slice():n],s.push(n),t||c()),this},fire:function(){return d.fireWith(this,arguments),this},fired:function(){return!!i}};return d},de.extend({Deferred:function(t){var n=[["notify","progress",de.Callbacks("memory"),de.Callbacks("memory"),2],["resolve","done",de.Callbacks("once memory"),de.Callbacks("once memory"),0,"resolved"],["reject","fail",de.Callbacks("once memory"),de.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},"catch":function(e){return i.then(null,e)},pipe:function(){var e=arguments;return de.Deferred(function(t){de.each(n,function(n,r){var i=oe(e[r[4]])&&e[r[4]];o[r[1]](function(){var e=i&&i.apply(this,arguments);e&&oe(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)})}),e=null}).promise()},then:function(t,r,i){function o(t,n,r,i){return function(){var s=this,l=arguments,d=function(){var e,d;if(!(t=a&&(r!==c&&(s=void 0,l=[e]),n.rejectWith(s,l))}};t?p():(de.Deferred.getErrorHook?p.error=de.Deferred.getErrorHook():de.Deferred.getStackHook&&(p.error=de.Deferred.getStackHook()),e.setTimeout(p))}}var a=0;return de.Deferred(function(e){n[0][3].add(o(0,e,oe(i)?i:u,e.notifyWith)),n[1][3].add(o(0,e,oe(t)?t:u)),n[2][3].add(o(0,e,oe(r)?r:c))}).promise()},promise:function(e){return null!=e?de.extend(e,i):i}},o={};return de.each(n,function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add(function(){r=s},n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith}),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),i=Y.call(arguments),o=de.Deferred(),a=function(e){return function(n){r[e]=this,i[e]=arguments.length>1?Y.call(arguments):n,--t||o.resolveWith(r,i)}};if(t<=1&&(d(e,o.done(a(n)).resolve,o.reject,!t),"pending"===o.state()||oe(i[n]&&i[n].then)))return o.then();for(;n--;)d(i[n],a(n),o.reject);return o.promise()}});var Le=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;de.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&Le.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},de.readyException=function(t){e.setTimeout(function(){throw t})};var Ne=de.Deferred();de.fn.ready=function(e){return Ne.then(e)["catch"](function(e){de.readyException(e)}),this},de.extend({isReady:!1,readyWait:1,ready:function(e){(e===!0?--de.readyWait:de.isReady)||(de.isReady=!0,e!==!0&&--de.readyWait>0||Ne.resolveWith(se,[de]))}}),de.ready.then=Ne.then,"complete"===se.readyState||"loading"!==se.readyState&&!se.documentElement.doScroll?e.setTimeout(de.ready):(se.addEventListener("DOMContentLoaded",p),e.addEventListener("load",p));var Pe=function(e,t,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===n(r)){o=!0;for(l in r)Pe(e,t,l,r[l],!0,a,s)}else if(void 0!==i&&(o=!0,oe(i)||(s=!0),c&&(s?(t.call(e,i),t=null):(c=t,t=function(e,t,n){return c.call(de(e),n)})),t))for(;l1,null,!0)},removeData:function(e){return this.each(function(){Oe.remove(this,e)})}}),de.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=He.get(e,t),n&&(!r||Array.isArray(n)?r=He.access(e,t,de.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=de.queue(e,t),r=n.length,i=n.shift(),o=de._queueHooks(e,t),a=function(){de.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return He.get(e,n)||He.access(e,n,{empty:de.Callbacks("once memory").add(function(){He.remove(e,[t+"queue",n])})})}}),de.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,Je=/^$|^module$|\/(?:java|ecma)script/i;!function(){var e=se.createDocumentFragment(),t=e.appendChild(se.createElement("div")),n=se.createElement("input");n.setAttribute("type","radio"),n.setAttribute("checked","checked"),n.setAttribute("name","t"),t.appendChild(n),ie.checkClone=t.cloneNode(!0).cloneNode(!0).lastChild.checked,t.innerHTML="",ie.noCloneChecked=!!t.cloneNode(!0).lastChild.defaultValue,t.innerHTML="",ie.option=!!t.lastChild}();var Ke={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Ke.tbody=Ke.tfoot=Ke.colgroup=Ke.caption=Ke.thead,Ke.th=Ke.td,ie.option||(Ke.optgroup=Ke.option=[1,""]);var Qe=/<|&#?\w+;/,Ze=/^([^.]*)(?:\.(.+)|)/;de.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,u,c,d,p,f,h,g,v=He.get(e);if(Be(e))for(n.handler&&(o=n,n=o.handler,i=o.selector),i&&de.find.matchesSelector(ze,i),n.guid||(n.guid=de.guid++),(l=v.events)||(l=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(t){return"undefined"!=typeof de&&de.event.triggered!==t.type?de.event.dispatch.apply(e,arguments):void 0}),t=(t||"").match(Se)||[""],u=t.length;u--;)s=Ze.exec(t[u])||[],f=g=s[1],h=(s[2]||"").split(".").sort(),f&&(d=de.event.special[f]||{},f=(i?d.delegateType:d.bindType)||f,d=de.event.special[f]||{},c=de.extend({type:f,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&de.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=l[f])||(p=l[f]=[],p.delegateCount=0,d.setup&&d.setup.call(e,r,h,a)!==!1||e.addEventListener&&e.addEventListener(f,a)),d.add&&(d.add.call(e,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),de.event.global[f]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,u,c,d,p,f,h,g,v=He.hasData(e)&&He.get(e);if(v&&(l=v.events)){for(t=(t||"").match(Se)||[""],u=t.length;u--;)if(s=Ze.exec(t[u])||[],f=g=s[1],h=(s[2]||"").split(".").sort(),f){for(d=de.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,p=l[f]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,d.remove&&d.remove.call(e,c));a&&!p.length&&(d.teardown&&d.teardown.call(e,h,v.handle)!==!1||de.removeEvent(e,f,v.handle),delete l[f])}else for(f in l)de.event.remove(e,f+t[u],n,r,!0);de.isEmptyObject(l)&&He.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),l=de.event.fix(e),u=(He.get(this,"events")||Object.create(null))[l.type]||[],c=de.event.special[l.type]||{};for(s[0]=l,t=1;t=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==e.type||u.disabled!==!0)){for(o=[],a={},n=0;n-1:de.find(i,this,null,[u]).length),a[i]&&o.push(r);o.length&&s.push({elem:u,handlers:o})}return u=this,l\s*$/g;de.extend({htmlPrefilter:function(e){return e},clone:function(e,t,n){var r,i,o,a,s=e.cloneNode(!0),l=We(e);if(!(ie.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||de.isXMLDoc(e)))for(a=w(s),o=w(e),r=0,i=o.length;r0&&_(a,!l&&w(e,"script")),s},cleanData:function(e){for(var t,n,r,i=de.event.special,o=0;void 0!==(n=e[o]);o++)if(Be(n)){if(t=n[He.expando]){if(t.events)for(r in t.events)i[r]?de.event.remove(n,r):de.removeEvent(n,r,t.handle);n[He.expando]=void 0}n[Oe.expando]&&(n[Oe.expando]=void 0)}}}),de.fn.extend({detach:function(e){return I(this,e,!0)},remove:function(e){return I(this,e)},text:function(e){return Pe(this,function(e){return void 0===e?de.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)})},null,e,arguments.length)},append:function(){return M(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=D(this,e);t.appendChild(e)}})},prepend:function(){return M(this,arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=D(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return M(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return M(this,arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(de.cleanData(w(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map(function(){return de.clone(this,e,t)})},html:function(e){return Pe(this,function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!et.test(e)&&!Ke[(Ye.exec(e)||["",""])[1].toLowerCase()]){e=de.htmlPrefilter(e);try{for(;n1)}}),de.fn.delay=function(t,n){return t=de.fx?de.fx.speeds[t]||t:t,n=n||"fx",this.queue(n,function(n,r){var i=e.setTimeout(n,t);r.stop=function(){e.clearTimeout(i)}})},function(){var e=se.createElement("input"),t=se.createElement("select"),n=t.appendChild(se.createElement("option"));e.type="checkbox",ie.checkOn=""!==e.value,ie.optSelected=n.selected,e=se.createElement("input"),e.value="t",e.type="radio",ie.radioValue="t"===e.value}();var ht,gt=de.expr.attrHandle;de.fn.extend({attr:function(e,t){return Pe(this,de.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){de.removeAttr(this,e)})}}),de.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return"undefined"==typeof e.getAttribute?de.prop(e,t,n):(1===o&&de.isXMLDoc(e)||(i=de.attrHooks[t.toLowerCase()]||(de.expr.match.bool.test(t)?ht:void 0)),void 0!==n?null===n?void de.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:(r=de.find.attr(e,t),null==r?void 0:r))},attrHooks:{type:{set:function(e,t){if(!ie.radioValue&&"radio"===t&&i(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(Se);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),ht={set:function(e,t,n){return t===!1?de.removeAttr(e,n):e.setAttribute(n,n),n}},de.each(de.expr.match.bool.source.match(/\w+/g),function(e,t){var n=gt[t]||de.find.attr;gt[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=gt[a],gt[a]=i,i=null!=n(e,t,r)?a:null,gt[a]=o),i}});var vt=/^(?:input|select|textarea|button)$/i,mt=/^(?:a|area)$/i;de.fn.extend({prop:function(e,t){return Pe(this,de.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each(function(){delete this[de.propFix[e]||e]})}}),de.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&de.isXMLDoc(e)||(t=de.propFix[t]||t,i=de.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=de.find.attr(e,"tabindex");return t?parseInt(t,10):vt.test(e.nodeName)||mt.test(e.nodeName)&&e.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),ie.optSelected||(de.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),de.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){de.propFix[this.toLowerCase()]=this}),de.fn.extend({addClass:function(e){var t,n,r,i,o,a;return oe(e)?this.each(function(t){de(this).addClass(e.call(this,t,z(this)))}):(t=W(e),t.length?this.each(function(){if(r=z(this),n=1===this.nodeType&&" "+U(r)+" "){for(o=0;o-1;)n=n.replace(" "+i+" "," ");a=U(n),r!==a&&this.setAttribute("class",a)}}):this):this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,a=typeof e,s="string"===a||Array.isArray(e);return oe(e)?this.each(function(n){de(this).toggleClass(e.call(this,n,z(this),t),t)}):"boolean"==typeof t&&s?t?this.addClass(e):this.removeClass(e):(n=W(e),this.each(function(){if(s)for(o=de(this),i=0;i-1)return!0;return!1}});var yt=/\r/g;de.fn.extend({val:function(e){var t,n,r,i=this[0];{if(arguments.length)return r=oe(e),this.each(function(n){var i;1===this.nodeType&&(i=r?e.call(this,n,de(this).val()):e,null==i?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=de.map(i,function(e){return null==e?"":e+""})),t=de.valHooks[this.type]||de.valHooks[this.nodeName.toLowerCase()],t&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))});if(i)return t=de.valHooks[i.type]||de.valHooks[i.nodeName.toLowerCase()],t&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:(n=i.value,"string"==typeof n?n.replace(yt,""):null==n?"":n)}}}),de.extend({valHooks:{option:{get:function(e){var t=de.find.attr(e,"value");return null!=t?t:U(de.text(e))}},select:{get:function(e){var t,n,r,o=e.options,a=e.selectedIndex,s="select-one"===e.type,l=s?null:[],u=s?a+1:o.length;for(r=a<0?u:s?a:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),de.each(["radio","checkbox"],function(){de.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=de.inArray(de(e).val(),t)>-1}},ie.checkOn||(de.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}),de.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(i){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||de.error("Invalid XML: "+(r?de.map(r.childNodes,function(e){return e.textContent}).join("\n"):t)),n};var xt=/^(?:focusinfocus|focusoutblur)$/,bt=function(e){e.stopPropagation()};de.extend(de.event,{trigger:function(t,n,r,i){var o,a,s,l,u,c,d,p,f=[r||se],h=te.call(t,"type")?t.type:t,g=te.call(t,"namespace")?t.namespace.split("."):[];if(a=p=s=r=r||se,3!==r.nodeType&&8!==r.nodeType&&!xt.test(h+de.event.triggered)&&(h.indexOf(".")>-1&&(g=h.split("."),h=g.shift(),g.sort()),u=h.indexOf(":")<0&&"on"+h,t=t[de.expando]?t:new de.Event(h,"object"==typeof t&&t),t.isTrigger=i?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:de.makeArray(n,[t]),d=de.event.special[h]||{},i||!d.trigger||d.trigger.apply(r,n)!==!1)){if(!i&&!d.noBubble&&!ae(r)){for(l=d.delegateType||h,xt.test(l+h)||(a=a.parentNode);a;a=a.parentNode)f.push(a),s=a;s===(r.ownerDocument||se)&&f.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=f[o++])&&!t.isPropagationStopped();)p=a,t.type=o>1?l:d.bindType||h,c=(He.get(a,"events")||Object.create(null))[t.type]&&He.get(a,"handle"),c&&c.apply(a,n),c=u&&a[u],c&&c.apply&&Be(a)&&(t.result=c.apply(a,n),t.result===!1&&t.preventDefault());return t.type=h,i||t.isDefaultPrevented()||d._default&&d._default.apply(f.pop(),n)!==!1||!Be(r)||u&&oe(r[h])&&!ae(r)&&(s=r[u],s&&(r[u]=null),de.event.triggered=h,t.isPropagationStopped()&&p.addEventListener(h,bt),r[h](),t.isPropagationStopped()&&p.removeEventListener(h,bt),de.event.triggered=void 0,s&&(r[u]=s)),t.result}},simulate:function(e,t,n){var r=de.extend(new de.Event,n,{type:e,isSimulated:!0});de.event.trigger(r,null,t)}}),de.fn.extend({trigger:function(e,t){return this.each(function(){de.event.trigger(e,t,this)})},triggerHandler:function(e,t){var n=this[0];if(n)return de.event.trigger(e,t,n,!0)}});var wt=/\[\]$/,_t=/\r?\n/g,kt=/^(?:submit|button|image|reset|file)$/i,Ct=/^(?:input|select|textarea|keygen)/i;de.param=function(e,t){var n,r=[],i=function(e,t){var n=oe(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return""; if(Array.isArray(e)||e.jquery&&!de.isPlainObject(e))de.each(e,function(){i(this.name,this.value)});else for(n in e)$(n,e[n],t,i);return r.join("&")},de.fn.extend({serialize:function(){return de.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=de.prop(this,"elements");return e?de.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!de(this).is(":disabled")&&Ct.test(this.nodeName)&&!kt.test(e)&&(this.checked||!Ge.test(e))}).map(function(e,t){var n=de(this).val();return null==n?null:Array.isArray(n)?de.map(n,function(e){return{name:t.name,value:e.replace(_t,"\r\n")}}):{name:t.name,value:n.replace(_t,"\r\n")}}).get()}}),de.fn.extend({wrapAll:function(e){var t;return this[0]&&(oe(e)&&(e=e.call(this[0])),t=de(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e}).append(this)),this},wrapInner:function(e){return oe(e)?this.each(function(t){de(this).wrapInner(e.call(this,t))}):this.each(function(){var t=de(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=oe(e);return this.each(function(n){de(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(e){return this.parent(e).not("body").each(function(){de(this).replaceWith(this.childNodes)}),this}}),de.expr.pseudos.hidden=function(e){return!de.expr.pseudos.visible(e)},de.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},ie.createHTMLDocument=function(){var e=se.implementation.createHTMLDocument("").body;return e.innerHTML="
",2===e.childNodes.length}(),de.parseHTML=function(e,t,n){if("string"!=typeof e)return[];"boolean"==typeof t&&(n=t,t=!1);var r,i,o;return t||(ie.createHTMLDocument?(t=se.implementation.createHTMLDocument(""),r=t.createElement("base"),r.href=se.location.href,t.head.appendChild(r)):t=se),i=ke.exec(e),o=!n&&[],i?[t.createElement(i[1])]:(i=k([e],t,o),o&&o.length&&de(o).remove(),de.merge([],i.childNodes))},de.offset={setOffset:function(e,t,n){var r,i,o,a,s,l,u,c=de.css(e,"position"),d=de(e),p={};"static"===c&&(e.style.position="relative"),s=d.offset(),o=de.css(e,"top"),l=de.css(e,"left"),u=("absolute"===c||"fixed"===c)&&(o+l).indexOf("auto")>-1,u?(r=d.position(),a=r.top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(l)||0),oe(t)&&(t=t.call(e,n,de.extend({},s))),null!=t.top&&(p.top=t.top-s.top+a),null!=t.left&&(p.left=t.left-s.left+i),"using"in t?t.using.call(e,p):d.css(p)}},de.fn.extend({offset:function(e){if(arguments.length)return void 0===e?this:this.each(function(t){de.offset.setOffset(this,e,t)});var t,n,r=this[0];if(r)return r.getClientRects().length?(t=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:t.top+n.pageYOffset,left:t.left+n.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===de.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===de.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&(i=de(e).offset(),i.top+=de.css(e,"borderTopWidth",!0),i.left+=de.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-de.css(r,"marginTop",!0),left:t.left-i.left-de.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===de.css(e,"position");)e=e.offsetParent;return e||ze})}}),de.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,t){var n="pageYOffset"===t;de.fn[e]=function(r){return Pe(this,function(e,r,i){var o;return ae(e)?o=e:9===e.nodeType&&(o=e.defaultView),void 0===i?o?o[t]:e[r]:void(o?o.scrollTo(n?o.pageXOffset:i,n?i:o.pageYOffset):e[r]=i)},e,r,arguments.length)}}),de.each(["top","left"],function(e,t){de.cssHooks[t]=H(ie.pixelPosition,function(e,n){if(n)return n=B(e,t),rt.test(n)?de(e).position()[t]+"px":n})}),de.each({Height:"height",Width:"width"},function(e,t){de.each({padding:"inner"+e,content:t,"":"outer"+e},function(n,r){de.fn[r]=function(i,o){var a=arguments.length&&(n||"boolean"!=typeof i),s=n||(i===!0||o===!0?"margin":"border");return Pe(this,function(t,n,i){var o;return ae(t)?0===r.indexOf("outer")?t["inner"+e]:t.document.documentElement["client"+e]:9===t.nodeType?(o=t.documentElement,Math.max(t.body["scroll"+e],o["scroll"+e],t.body["offset"+e],o["offset"+e],o["client"+e])):void 0===i?de.css(t,n,s):de.style(t,n,i,s)},t,a?i:void 0,a)}})}),de.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.on("mouseenter",e).on("mouseleave",t||e)}}),de.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,t){de.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}});var Tt=/^[\s\uFEFF\xA0]+|([^\s\uFEFF\xA0])[\s\uFEFF\xA0]+$/g;return de.proxy=function(e,t){var n,r,i;if("string"==typeof t&&(n=e[t],t=e,e=n),oe(e))return r=Y.call(arguments,2),i=function(){return e.apply(t||this,r.concat(Y.call(arguments)))},i.guid=e.guid=e.guid||de.guid++,i},de.holdReady=function(e){e?de.readyWait++:de.ready(!0)},de.isArray=Array.isArray,de.parseJSON=JSON.parse,de.nodeName=i,de.isFunction=oe,de.isWindow=ae,de.camelCase=h,de.type=n,de.now=Date.now,de.isNumeric=function(e){var t=de.type(e);return("number"===t||"string"===t)&&!isNaN(e-parseFloat(e))},de.trim=function(e){return null==e?"":(e+"").replace(Tt,"$1")},de}(window);!function(){function t(e){this.mode=c.MODE_8BIT_BYTE,this.data=e,this.parsedData=[];for(var t=0,n=this.data.length;t65536?(r[0]=240|(1835008&i)>>>18,r[1]=128|(258048&i)>>>12,r[2]=128|(4032&i)>>>6,r[3]=128|63&i):i>2048?(r[0]=224|(61440&i)>>>12,r[1]=128|(4032&i)>>>6,r[2]=128|63&i):i>128?(r[0]=192|(1984&i)>>>6,r[1]=128|63&i):r[0]=i,this.parsedData.push(r)}this.parsedData=Array.prototype.concat.apply([],this.parsedData),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}function n(e,t){this.typeNumber=e,this.errorCorrectLevel=t,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=[]}function r(e,t){if(void 0==e.length)throw new Error(e.length+"/"+t);for(var n=0;nv.length)throw new Error("Too long data");return n}function u(e){var t=encodeURI(e).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=e?3:0)}t.prototype={getLength:function(e){return this.parsedData.length},write:function(e){for(var t=0,n=this.parsedData.length;t=7&&this.setupTypeNumber(e),null==this.dataCache&&(this.dataCache=n.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,t)},setupPositionProbePattern:function(e,t){for(var n=-1;n<=7;n++)if(!(e+n<=-1||this.moduleCount<=e+n))for(var r=-1;r<=7;r++)t+r<=-1||this.moduleCount<=t+r||(0<=n&&n<=6&&(0==r||6==r)||0<=r&&r<=6&&(0==n||6==n)||2<=n&&n<=4&&2<=r&&r<=4?this.modules[e+n][t+r]=!0:this.modules[e+n][t+r]=!1)},getBestMaskPattern:function(){for(var e=0,t=0,n=0;n<8;n++){this.makeImpl(!0,n);var r=f.getLostPoint(this);(0==n||e>r)&&(e=r,t=n)}return t},createMovieClip:function(e,t,n){var r=e.createEmptyMovieClip(t,n),i=1;this.make();for(var o=0;o>n&1);this.modules[Math.floor(n/3)][n%3+this.moduleCount-8-3]=r}for(var n=0;n<18;n++){var r=!e&&1==(t>>n&1);this.modules[n%3+this.moduleCount-8-3][Math.floor(n/3)]=r}},setupTypeInfo:function(e,t){for(var n=this.errorCorrectLevel<<3|t,r=f.getBCHTypeInfo(n),i=0;i<15;i++){var o=!e&&1==(r>>i&1);i<6?this.modules[i][8]=o:i<8?this.modules[i+1][8]=o:this.modules[this.moduleCount-15+i][8]=o}for(var i=0;i<15;i++){var o=!e&&1==(r>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=o:i<9?this.modules[8][15-i-1+1]=o:this.modules[8][15-i-1]=o}this.modules[this.moduleCount-8][8]=!e},mapData:function(e,t){for(var n=-1,r=this.moduleCount-1,i=7,o=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(var s=0;s<2;s++)if(null==this.modules[r][a-s]){var l=!1;o>>i&1));var u=f.getMask(t,r,a-s);u&&(l=!l),this.modules[r][a-s]=l,i--,i==-1&&(o++,i=7)}if(r+=n,r<0||this.moduleCount<=r){r-=n,n=-n;break}}}},n.PAD0=236,n.PAD1=17,n.createData=function(e,t,r){for(var a=i.getRSBlocks(e,t),s=new o,l=0;l8*c)throw new Error("code length overflow. ("+s.getLengthInBits()+">"+8*c+")");for(s.getLengthInBits()+4<=8*c&&s.put(0,4);s.getLengthInBits()%8!=0;)s.putBit(!1);for(;;){if(s.getLengthInBits()>=8*c)break;if(s.put(n.PAD0,8),s.getLengthInBits()>=8*c)break;s.put(n.PAD1,8)}return n.createBytes(s,a)},n.createBytes=function(e,t){for(var n=0,i=0,o=0,a=new Array(t.length),s=new Array(t.length),l=0;l=0?g.get(v):0}}for(var m=0,d=0;d=0;)t^=f.G15<=0;)t^=f.G18<>>=1;return t},getPatternPosition:function(e){return f.PATTERN_POSITION_TABLE[e-1]},getMask:function(e,t,n){switch(e){case p.PATTERN000:return(t+n)%2==0;case p.PATTERN001:return t%2==0;case p.PATTERN010:return n%3==0;case p.PATTERN011:return(t+n)%3==0;case p.PATTERN100:return(Math.floor(t/2)+Math.floor(n/3))%2==0;case p.PATTERN101:return t*n%2+t*n%3==0;case p.PATTERN110:return(t*n%2+t*n%3)%2==0;case p.PATTERN111:return(t*n%3+(t+n)%2)%2==0;default:throw new Error("bad maskPattern:"+e)}},getErrorCorrectPolynomial:function(e){for(var t=new r([1],0),n=0;n5&&(n+=3+o-5)}for(var r=0;r=256;)e-=255;return h.EXP_TABLE[e]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},g=0;g<8;g++)h.EXP_TABLE[g]=1<>>7-e%8&1)},put:function(e,t){for(var n=0;n>>t-n-1&1))},getLengthInBits:function(){return this.length},putBit:function(e){var t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var v=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]],m=function(){var e=function(e,t){this._el=e,this._htOption=t};return e.prototype.draw=function(e){function t(e,t){var n=document.createElementNS("http://www.w3.org/2000/svg",e);for(var r in t)t.hasOwnProperty(r)&&n.setAttribute(r,t[r]);return n}var n=this._htOption,r=this._el,i=e.getModuleCount();Math.floor(n.width/i),Math.floor(n.height/i);this.clear();var o=t("svg",{viewBox:"0 0 "+String(i)+" "+String(i),width:"100%",height:"100%",fill:n.colorLight});o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"),r.appendChild(o),o.appendChild(t("rect",{fill:n.colorLight,width:"100%",height:"100%"})),o.appendChild(t("rect",{fill:n.colorDark,width:"1",height:"1",id:"template"}));for(var a=0;a=1;d--)arguments[d]=arguments[d]*n;else"undefined"==typeof u&&(arguments[1]*=n,arguments[2]*=n,arguments[3]*=n,arguments[4]*=n);r.apply(this,arguments)}}var i=function(e,t){this._bIsPainted=!1,this._android=s(),this._htOption=t,this._elCanvas=document.createElement("canvas"),this._elCanvas.width=t.width,this._elCanvas.height=t.height,e.appendChild(this._elCanvas),this._el=e,this._oContext=this._elCanvas.getContext("2d"),this._bIsPainted=!1,this._elImage=document.createElement("img"),this._elImage.alt="Scan me!",this._elImage.style.display="none",this._el.appendChild(this._elImage),this._bSupportDataURI=null};return i.prototype.draw=function(e){var t=this._elImage,n=this._oContext,r=this._htOption,i=e.getModuleCount(),o=r.width/i,a=r.height/i,s=Math.round(o),l=Math.round(a);t.style.display="none",this.clear();for(var u=0;u'],s=0;s");for(var l=0;l');a.push("")}a.push(""),n.innerHTML=a.join("");var u=n.childNodes[0],c=(t.width-u.offsetWidth)/2,d=(t.height-u.offsetHeight)/2;c>0&&d>0&&(u.style.margin=d+"px "+c+"px")},e.prototype.clear=function(){this._el.innerHTML=""},e}();return e=function(e,t){if(this._htOption={width:256,height:256,typeNumber:4,colorDark:"#000000",colorLight:"#ffffff",correctLevel:d.H},"string"==typeof t&&(t={text:t}),t)for(var n in t)this._htOption[n]=t[n];"string"==typeof e&&(e=document.getElementById(e)),this._htOption.useSVG&&(x=m),this._android=s(),this._el=e,this._oQRCode=null,this._oDrawing=new x(this._el,this._htOption),this._htOption.text&&this.makeCode(this._htOption.text)},e.prototype.makeCode=function(e){this._oQRCode=new n(l(e,this._htOption.correctLevel),this._htOption.correctLevel),this._oQRCode.addData(e),this._oQRCode.make(),this._el.title=e,this._oDrawing.draw(this._oQRCode),this.makeImage()},e.prototype.makeImage=function(){"function"==typeof this._oDrawing.makeImage&&(!this._android||this._android>=3)&&this._oDrawing.makeImage()},e.prototype.clear=function(){this._oDrawing.clear()},e.CorrectLevel=d,e}();var n=e;!function(){function e(){i.logger&&i.logger.msg.apply(i.logger,arguments).level("warn").log()}function r(){i.logger&&i.logger.msg.apply(i.logger,arguments).level("error").log()}var i=null,o=null,a="",s={originalHeatData:null,ajaxHeatData:null,heatDataElement:[],heatMapList:[],heatMode:1,getCurrentUrl:function(){var e=o.urlParse(location.href),n={};return n["sa-request-url"]=sessionStorage.getItem("sensors_heatmap_url"),n["sa-request-url"]=n["sa-request-url"]?encodeURIComponent(n["sa-request-url"]):"",n["sa-request-id"]=sessionStorage.getItem("sensors_heatmap_id"),n["sa-request-type"]=sessionStorage.getItem("sensors_heatmap_type")||"1",t.each(n,function(e,t){t||delete n[e]}),e.addQueryString(n),e.getUrl()},setHeatState:function(e,t,n,r){if(r)"1"===t?this.setClickMap(e,n):"2"===t?this.setScrollMap(e,n):"3"===t&&this.setNoticeMap(e,n);else{var a=i._.urlParse(location.href);if(!e)return!1;t||(t=1);var s={"sa-request-id":e,"sa-request-type":t,"sa-request-url":sessionStorage&&sessionStorage.getItem?sessionStorage.getItem("sensors_heatmap_url")||"":""};try{var l={};o.isJSONString(window.name)?(l=JSON.parse(window.name),window.name=JSON.stringify(o.extend(l,s))):""==window.name&&(window.name=JSON.stringify(s))}catch(u){}1==this.requestType?(a.addQueryString(s),location.href=encodeURI(a.getUrl())):(sessionStorage&&sessionStorage.setItem&&sessionStorage.setItem("sensors_heatmap_type",t),location.reload())}},setDropDown:function(e,n,r){function o(){var e=null,n=!1;return t(window).on("scroll.v2",function(){n||(t("#heatMapContainer").html(""),n=!0),clearTimeout(e),e=setTimeout(function(){s.refreshHeatData(s.heatMode),n=!1},i.para.heatmap.renderRefreshTime||1e3)}),t(window).on("resize.v2",function(){n||(t("#heatMapContainer").html(""),n=!0),clearTimeout(e),e=setTimeout(function(){s.refreshHeatData(s.heatMode),n=!1},i.para.heatmap.renderRefreshTime||1e3)}),function(){t(window).off("scroll.v2"),t(window).off("resize.v2"),e&&(clearTimeout(e),e=null,n=!1)}}function a(e){function n(t,n){r=t,e.click(t,n),"type"==i?f.text(u[r]):"version"==i&&f.text(c[r])}var r=e.init(),i=e.name,a=e.id,l=t(a+">div"),p=t(a+">ul"),f=l.find("span:first");l.on("click",function(e){e.preventDefault(),e.stopPropagation(),t(a+">ul:visible").is(":visible")?p.hide():(t(".sa-sdk-heatmap-toolbar-selectmap ul").css("display","none"),p.css("display","block"),t(document).on("click.sa-jssdk-dropdown",function(){p.hide(),t(document).off("click.sa-jssdk-dropdown")}))}),p.on("click","li",function(){var e=t(this).attr("data-state");r!==e&&n(e)}),e.init&&n(r,!0),"version"===i&&t(document).on("keypress",function(e){d&&(d(),d=null),114==e.keyCode&&s.refreshHeatData(s.heatMode),122==e.keyCode&&(t("#chooseVersion").find("span:first").text("\u65b9\u6848\u4e00"),s.refreshHeatData(1),r="1"),120==e.keyCode&&(t("#chooseVersion").find("span:first").text("\u65b9\u6848\u4e8c"),s.refreshHeatData(2),d=o(),r="2")})}n=n||"1";var l="1"===n?"1":"0",u={1:"\u70b9\u51fb\u56fe",2:"\u89e6\u8fbe\u7387\u56fe",3:"\u6ce8\u610f\u529b\u56fe"},c={1:"\u65b9\u6848\u4e00",2:"\u65b9\u6848\u4e8c"},d=null,p=this;a({init:function(){return n},id:"#chooseType",name:"type",click:function(n,i){p.setHeatState(e,n,r,i),t("#sa_sdk_heatmap_toolbar_filter").toggle("1"==n)}}),"1"===n&&a({init:function(){return t("#chooseVersion").css("display","block"),l},name:"version",id:"#chooseVersion",click:function(e,t){t||(d&&(d(),d=null),"1"===e?s.refreshHeatData(1):"2"===e&&(s.refreshHeatData(2),d=o()))}})},setScrollMap:function(e,n){var a=this;if("string"==typeof e&&i.para.web_url){var s=new o.urlParse(i.para.web_url);s._values.Path="/api/scroll_heat_map/report/"+e;var u=new o.urlParse(i.para.web_url);u._values.Path="/api/scroll_heat_map/report/"+e,u.addQueryString({pathUrl:encodeURIComponent(n)});var c=u.getUrl(),d=new o.urlParse(i.para.web_url);d._values.Path="/api/v2/sa/scroll_heat_maps/report/jsonp/"+e;var p=new o.urlParse(i.para.web_url);p._values.Path="/api/v2/sa/scroll_heat_maps/report/jsonp/"+e,p.addQueryString({pathUrl:encodeURIComponent(n)});var f=p.getUrl(),h=function(e){function n(n){var r=parseInt((n.pageY+15)/10),i=0;i=r<=e.detail.length&&e.detail[r]?Math.floor(e.detail[r]/e.total*100*100)/100:0,u&&u.remove(),u=t(l.replace("{{top}}",n.pageY+15).replace("{{percent}}",i+"%")),t(document.body).append(u)}if("object"!=typeof e||!o.isArray(e.result)||0===e.result.length)return a.showErrorInfo(2,{error:"\u672a\u53d6\u5230\u6570\u636e"}),!1;if(e.detail=e.result||[],!e.total||0===e.total||"number"!=typeof e.total||e.total<2)return a.showErrorInfo(2,{error:"\u6709\u6548\u7684\u89e6\u53d1\u7528\u6237\u6570\u5c11\u4e8e2\u4eba"}),!1;e.origin_total=e.total,e.total=e.result[0],e.percent={};var r={setData:function(e,t,n){e=String(e),this.data[e]=this.data[e]||{},this.data[e][t]=n},data:{},getData:function(){var e={},t=[],n=null;for(var r in this.data){t=[];for(var i in this.data[r])t.push([i,this.data[r][i]]);this.data[r]=t,n=this.data[r].sort(function(e,t){return Math.abs(e[0]-Number(r))-Math.abs(t[0]-Number(r))})[0],e[n[0]]=n[1]}return e}};o.each(e.result,function(t,n){t/e.total==1?e.percent[100]=10*(n+1):t/e.total>.7&&t/e.total<.8?r.setData(75,parseInt(t/e.total*100),10*(n+1)):t/e.total>.45&&t/e.total<.55?r.setData(50,parseInt(t/e.total*100),10*(n+1)):t/e.total>.2&&t/e.total<.3&&r.setData(25,parseInt(t/e.total*100),10*(n+1))}),o.extend(e.percent,r.getData());var i='
{{percent}}
';for(var s in e.percent)t(document.body).append(t(i.replace("{{top}}",e.percent[s]-2).replace("{{percent}}",s+"%")));var l='
{{percent}}\u7684\u7528\u6237\u6d4f\u89c8\u5230\u8fd9\u91cc
',u=null;t(document).on("mousemove",o.throttle(n,150))},g=function(e){o.isObject(e)&&e.error?a.showErrorInfo(2,{error:e.error}):a.showErrorInfo(2,{error:"\u670d\u52a1\u5f02\u5e38" }),sessionStorage.removeItem("sensors_heatmap_id")};n?this.requestType=3:this.requestType=1,l.getServerData.start({url:{ajax:3===this.requestType?c:s.getUrl(),jsonp:3===this.requestType?f:d.getUrl()},success:h,error:g})}else r("\u7f3a\u5c11web_url")},setNoticeMap:function(){},setContainer:function(e){if(!e)return!1;if(e.classList.add("saContainer"),e&&e.children)for(var t=e.children,n=0;ni:"lt"===e?tMath.min(i,o)&&t