lf-rc1.yhgfb-cn-static.com Open in urlscan Pro
2602:ffe4:c4a:0:3::3f9  Public Scan

URL: https://lf-rc1.yhgfb-cn-static.com/obj/rc-client-security/secsdk-captcha/2.28.9/static/js/vendors~t.js
Submission: On June 16 via manual from SG — Scanned from SG

Form analysis 0 forms found in the DOM

Text Content

(window["bytedance_secsdk_captcha_jsonp_2.28.9"]=window["bytedance_secsdk_captcha_jsonp_2.28.9"]||[]).push([[3],{386:function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),function(global){__webpack_require__.d(__webpack_exports__,"Collector",function(){return Collector$1});var _assign=function(){return(_assign=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var o in t=arguments[i])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function __rest(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&(i[n[o]]=e[n[o]])}return i}function __values(e){var t="function"==typeof Symbol&&e[Symbol.iterator],i=0;return t?t.call(e):{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}}}function __read(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,o,r=i.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=r.next()).done;)s.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(i=r.return)&&i.call(r)}finally{if(o)throw o.error}}return s}function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}var Hook=function(){function e(){this._hooks={},this._cache=[],this._hooksCache={}}return e.prototype.on=function(e,t){e&&t&&"function"==typeof t&&(this._hooks[e]||(this._hooks[e]=[]),this._hooks[e].push(t))},e.prototype.once=function(e,t){var i=this;e&&t&&"function"==typeof t&&this.on(e,function n(o){t(o),i.off(e,n)})},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var i=this._hooks[e].indexOf(t);-1!==i&&this._hooks[e].splice(i,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,i){if(i){if(!e)return;-1!==this._cache.indexOf(i)?this._emit(e,t):(this._hooksCache.hasOwnProperty(i)||(this._hooksCache[i]={}),this._hooksCache[i].hasOwnProperty(e)||(this._hooksCache[i][e]=[]),this._hooksCache[i][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&__spread(this._hooks[e]).forEach(function(e){try{e(t)}catch(e){}})},e.prototype.set=function(e){e&&-1===this._cache.indexOf(e)&&this._cache.push(e)},e}(),isObject=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},isNumber=function(e){return"number"==typeof e&&!isNaN(e)},isString=function(e){return"string"==typeof e},isArray=function(e){return Array.isArray(e)},getIndex=(lastEventId=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return lastEventId+=1}),lastEventId,decrypto=function(e,t,i){if("string"==typeof e&&"number"==typeof t&&"number"==typeof i){var n,o=[];i=i<=25?i:i%25;var r=String.fromCharCode(i+97);n=e.split(r);for(var s=0;s<n.length;s++){var a=parseInt(n[s],i);a=1*a^t;var c=String.fromCharCode(a);o.push(c)}return o.join("")}},decodeUrl=function(e){return decrypto(e,64,25)},beforePageUnload=function(e){navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1)},getIframeUrl=function(){try{return JSON.parse(atob(window.name))||void 0}catch(e){return}},loadScript=function(e,t,i){var n=document.createElement("script");n.src=e,n.onerror=function(){i(e)},n.onload=function(){t()},document.getElementsByTagName("head")[0].appendChild(n)},isSupVisChange=function(){var e=0;return["hidden","msHidden","webkitHidden"].forEach(function(t){void 0!==document[t]&&(e=1)}),e},selfAdjust=function(e,t){void 0===e&&(e=function(){}),void 0===t&&(t=1e3);var i,n=Date.now()+t;return i=window.setTimeout(function o(){var r=Date.now()-n;e(),n+=t,i=window.setTimeout(o,Math.max(0,t-r))},t),function(){window.clearTimeout(i)}},stringify=function(e,t,i){void 0===t&&(t=""),void 0===i&&(i={});var n=e;"/"===(n=n.split("#")[0].split("?")[0])[e.length-1]&&(n=n.substr(0,e.length-1)),n="/"===t[0]?n.replace(/(https?:\/\/[\w-]+(\.[\w-]+){1,}(:[0-9]{1,5})?)(\/[.\w-]+)*\/?$/,"$1"+t):n.replace(/(https?:\/\/[\w-]+(\.[\w-]+){1,}(:[0-9]{1,5})?(\/[.\w-]+)*?)(\/[.\w-]+)?\/?$/,"$1/"+t);var o=Object.keys(i).map(function(e){return e+"="+i[e]}).join("&");return o.length>0?n+"?"+o:n},parseURL=function(e){var t=document.createElement("a");return t.href=e,t},parseUrlQuery=function(e){var t={};try{var i=parseURL(e).search;(i=i.slice(1)).split("&").forEach(function(e){var i,n,o=e.split("=");o.length&&(i=o[0],n=o[1]);try{t[i]=decodeURIComponent(void 0===n?"":n)}catch(e){t[i]=n}})}catch(e){}return t},hashCode=function(e){for(var t=0,i=0,n=(e+="").length,o=0;o<n;o++)((t=31*t+e.charCodeAt(i++))>0x7fffffffffff||t<-0x800000000000)&&(t&=0xffffffffffff);return t<0&&(t+=0x7ffffffffffff),t},commonjsGlobal="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var js_cookie=createCommonjsModule(function(e,t){var i;i=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var i=arguments[e];for(var n in i)t[n]=i[n]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function i(n){function o(){}function r(t,i,r){if("undefined"!=typeof document){"number"==typeof(r=e({path:"/"},o.defaults,r)).expires&&(r.expires=new Date(1*new Date+864e5*r.expires)),r.expires=r.expires?r.expires.toUTCString():"";try{var s=JSON.stringify(i);/^[\{\[]/.test(s)&&(i=s)}catch(e){}i=n.write?n.write(i,t):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var a="";for(var c in r)r[c]&&(a+="; "+c,!0!==r[c]&&(a+="="+r[c].split(";")[0]));return document.cookie=t+"="+i+a}}function s(e,i){if("undefined"!=typeof document){for(var o={},r=document.cookie?document.cookie.split("; "):[],s=0;s<r.length;s++){var a=r[s].split("="),c=a.slice(1).join("=");i||'"'!==c.charAt(0)||(c=c.slice(1,-1));try{var l=t(a[0]);if(c=(n.read||n)(c,l)||t(c),i)try{c=JSON.parse(c)}catch(e){}if(o[l]=c,e===l)break}catch(e){}}return e?o[e]:o}}return o.set=r,o.get=function(e){return s(e,!1)},o.getJSON=function(e){return s(e,!0)},o.remove=function(t,i){r(t,"",e(i,{expires:-1}))},o.defaults={},o.withConverter=i,o}(function(){})},e.exports=i()}),Memory=function(){function e(){this.cache={}}return e.prototype.setItem=function(e,t){this.cache[e]=t},e.prototype.getItem=function(e){return this.cache[e]},e.prototype.removeItem=function(e){this.cache[e]=void 0},e.prototype.getCookie=function(e){this.getItem(e)},e.prototype.setCookie=function(e,t){this.setItem(e,t)},e}();function isSupportLS(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}function isSupportSession(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}var local={getItem:function(e){try{var t=localStorage.getItem(e),i=t;try{t&&"string"==typeof t&&(i=JSON.parse(t))}catch(e){}return i||{}}catch(e){}return{}},setItem:function(e,t){try{var i="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,i)}catch(e){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(e){}},getCookie:function(e,t){try{return js_cookie.get(e,{domain:t||document.domain})}catch(e){return""}},setCookie:function(e,t,i,n){try{var o=n||document.domain,r=+new Date+i;js_cookie.set(e,t,{expires:new Date(r),path:"/",domain:o})}catch(e){}},isSupportLS:isSupportLS()},session={getItem:function(e){try{var t=sessionStorage.getItem(e),i=t;try{t&&"string"==typeof t&&(i=JSON.parse(t))}catch(e){}return i||{}}catch(e){}return{}},setItem:function(e,t){try{var i="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,i)}catch(e){}},removeItem:function(e){try{sessionStorage.removeItem(e)}catch(e){}},getCookie:function(e){this.getItem(e)},setCookie:function(e,t){this.setItem(e,t)},isSupportSession:isSupportSession()},Storage=function(){function e(e,t){this._storage=t&&"session"===t?session:!e&&local.isSupportLS?local:new Memory}return e.prototype.getItem=function(e){return this._storage.getItem(e)},e.prototype.setItem=function(e,t){this._storage.setItem(e,t)},e.prototype.getCookie=function(e,t){return this._storage.getCookie(e,t)},e.prototype.setCookie=function(e,t,i,n){this._storage.setCookie(e,t,i,n)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),UTM=function(e,t,i,n){var o=new Storage(!1),r=new Storage(!1,"session"),s=e?"_tea_utm_cache_"+e:"_tea_utm_cache",a=e?"_$utm_from_url_"+e:"_$utm_from_url",c={},l=["tr_shareuser","tr_admaster","tr_param1","tr_param2","tr_param3","tr_param4","$utm_from_url"],u={ad_id:Number(t.ad_id)||void 0,campaign_id:Number(t.campaign_id)||void 0,creative_id:Number(t.creative_id)||void 0,utm_source:t.utm_source,utm_medium:t.utm_medium,utm_campaign:t.utm_campaign,utm_term:t.utm_term,utm_content:t.utm_content,tr_shareuser:t.tr_shareuser,tr_admaster:t.tr_admaster,tr_param1:t.tr_param1,tr_param2:t.tr_param2,tr_param3:t.tr_param3,tr_param4:t.tr_param4};try{var h=!1;for(var p in u)u[p]&&(-1!==l.indexOf(p)?(c.hasOwnProperty("tracer_data")||(c.tracer_data={}),c.tracer_data[p]=u[p]):c[p]=u[p],h=!0);if(h)r.setItem(a,"1"),o.setCookie(s,JSON.stringify(c),n,i);else{var d=o.getCookie(s,i);d&&(c=JSON.parse(d))}r.getItem(a)&&(c.hasOwnProperty("tracer_data")||(c.tracer_data={}),c.tracer_data.$utm_from_url=1)}catch(e){return u}return c},Client=function(){function e(e,t,i){this.appid=e,this.domain=t,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion,this.cookie_expire=i}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,i=document.referrer,n=i?parseURL(i).hostname:"",o=parseUrlQuery(window.location.href),r=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web";this.utm=UTM(this.appid,o,this.domain,this.cookie_expire);var s=this.browser(),a=this.os();return{browser:s.browser,browser_version:s.browser_version,platform:r,os_name:a.os_name,os_version:a.os_version,userAgent:e,screen_width:window.screen&&window.screen.width,screen_height:window.screen&&window.screen.height,device_model:this.getDeviceModel(a.os_name),language:t,referrer:i,referrer_host:n,utm:this.utm,latest_data:this.last(i,n)}},e.prototype.last=function(e,t){var i="",n="",o="",r=location.hostname,s=!1;if(e&&t&&r!==t){i=e,n=t,s=!0;var a=parseUrlQuery(e);a.keyword&&(o=a.keyword)}return{$latest_referrer:i,$latest_referrer_host:n,$latest_search_keyword:o,isLast:s}},e.prototype.browser=function(){var e,t,i="",n=""+parseFloat(this.appVersion),o=this.userAgent;return-1!==o.indexOf("Edge")||-1!==o.indexOf("Edg")?(i="Microsoft Edge",-1!==o.indexOf("Edge")?(e=o.indexOf("Edge"),n=o.substring(e+5)):(e=o.indexOf("Edg"),n=o.substring(e+4))):-1!==(e=o.indexOf("MSIE"))?(i="Microsoft Internet Explorer",n=o.substring(e+5)):-1!==(e=o.indexOf("Lark"))?(i="Lark",n=o.substring(e+5,e+11)):-1!==(e=o.indexOf("MetaSr"))?(i="sougoubrowser",n=o.substring(e+7,e+10)):-1!==o.indexOf("MQQBrowser")||-1!==o.indexOf("QQBrowser")?(i="qqbrowser",-1!==o.indexOf("MQQBrowser")?(e=o.indexOf("MQQBrowser"),n=o.substring(e+11,e+15)):-1!==o.indexOf("QQBrowser")&&(e=o.indexOf("QQBrowser"),n=o.substring(e+10,e+17))):-1!==o.indexOf("Chrome")?-1!==(e=o.indexOf("MicroMessenger"))?(i="weixin",n=o.substring(e+15,e+20)):-1!==(e=o.indexOf("360"))?(i="360browser",n=o.substring(o.indexOf("Chrome")+7)):-1!==o.indexOf("baidubrowser")||-1!==o.indexOf("BIDUBrowser")?(-1!==o.indexOf("baidubrowser")?(e=o.indexOf("baidubrowser"),n=o.substring(e+13,e+16)):-1!==o.indexOf("BIDUBrowser")&&(e=o.indexOf("BIDUBrowser"),n=o.substring(e+12,e+15)),i="baidubrowser"):-1!==(e=o.indexOf("xiaomi"))?-1!==o.indexOf("openlanguagexiaomi")?(i="openlanguage xiaomi",n=o.substring(e+7,e+13)):(i="xiaomi",n=o.substring(e-7,e-1)):-1!==(e=o.indexOf("TTWebView"))?(i="TTWebView",n=o.substring(e+10,e+23)):-1!==(e=o.indexOf("Chrome"))?(i="Chrome",n=o.substring(e+7)):-1!==(e=o.indexOf("Chrome"))&&(i="Chrome",n=o.substring(e+7)):-1!==o.indexOf("Safari")?-1!==(e=o.indexOf("QQ"))?(i="qqbrowser",n=o.substring(e+10,e+16)):-1!==(e=o.indexOf("Safari"))&&(i="Safari",n=o.substring(e+7),-1!==(e=o.indexOf("Version"))&&(n=o.substring(e+8))):-1!==(e=o.indexOf("Firefox"))?(i="Firefox",n=o.substring(e+8)):-1!==(e=o.indexOf("MicroMessenger"))?(i="weixin",n=o.substring(e+15,e+20)):-1!==(e=o.indexOf("QQ"))&&(i="qqbrowser",n=o.substring(e+3,e+8)),-1!==(t=n.indexOf(";"))&&(n=n.substring(0,t)),-1!==(t=n.indexOf(" "))&&(n=n.substring(0,t)),-1!==(t=n.indexOf(")"))&&(n=n.substring(0,t)),{browser:i,browser_version:n}},e.prototype.os=function(){for(var e="",t="",i=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0|Windows NT 10.1)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Android",r:/Android/},{s:"Sun OS",r:/SunOS/},{s:"Linux",r:/(Linux|X11)/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(MacPPC|MacIntel|Mac_PowerPC|Macintosh)/}],n=0;n<i.length;n++){var o=i[n];if(o.r.test(this.userAgent)){"Mac OS X"===(e=o.s)&&this.isNewIpad()&&(e="iOS");break}}var r,s,a=function(e,t){var i=e.exec(t);return i&&i[1]?i[1]:""},c=function(e,t){var i=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return i?i.slice(1)[0]:""};switch(/Windows/.test(e)&&(t=a(/Windows (.*)/,e),e="windows"),e){case"Mac OS X":t=c("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":(s=a(/Android ([\.\_\d]+)/,r=this.userAgent))||(s=a(/Android\/([\.\_\d]+)/,r)),t=s,e="android";break;case"iOS":t=this.isNewIpad()?c("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent):(t=/OS (\d+)_(\d+)_?(\d+)?/.exec(this.appVersion))?t[1]+"."+t[2]+"."+(0|t[3]):"",e="ios"}return{os_name:e,os_version:t}},e.prototype.getDeviceModel=function(e){var t="";try{if("android"===e)navigator.userAgent.split(";").forEach(function(e){e.indexOf("Build/")>-1&&(t=e.slice(0,e.indexOf("Build/")))});else if("ios"===e||"mac"===e||"windows"===e)if(this.isNewIpad())t="iPad";else{var i=navigator.userAgent.replace("Mozilla/5.0 (",""),n=i.indexOf(";");t=i.slice(0,n)}}catch(e){return t.trim()}return t.trim()},e.prototype.isNewIpad=function(){return void 0!==this.userAgent&&"MacIntel"===navigator.platform&&"number"==typeof navigator.maxTouchPoints&&navigator.maxTouchPoints>1},e}(),LOG;LOG={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az28z1gz1hz1gz1cz18z1nz1gz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz21z1ez18z1jz1gz49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz18z1jz1gz24z18z49z1kz1az21z4az19z27z22z1cz1mz24z1cz20z21z1cz18z4az1az1mz1k"};var LOG_URL=LOG,SDK_VERSION="5.0.25",VISUAL_EDITOR_RANGERS="https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/visual-editor-rangers.js",VISUAL_AB_CORE="https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/visual-ab-core.js",VISUAL_AB_LOADER="https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/visual-ab-loader.js",HOT_PIC_URL="https://lf-cdn-tos.bytescm.com/obj/static/log-sdk/collect/heatmap-core",VISUAL_URL_INSPECTOR="https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/tester-event-inspector",undef=void 0,date=new Date,timeZoneMin=date.getTimezoneOffset(),timezone=parseInt(""+-timeZoneMin/60,10),tz_offset=60*timeZoneMin,WEBID_URL="/webid",TOB_URL="/tobid",REPORT_URL="/list",COOKIE_EXPIRE=6048e5,ConfigManager=function(){function e(e){this.is_first_time=!0,this.configPersist=!1,this.initConfig=e;var t=new Client(e.app_id,e.cookie_domain||"",e.cookie_expire||COOKIE_EXPIRE).init(),i="__tea_cache_first_"+e.app_id;this.configKey="__tea_cache_config_"+e.app_id,this.sessionStorage=new Storage(!1,"session"),this.localStorage=new Storage(!1,"local"),e.configPersist&&(this.configPersist=!0,this.storage=1===e.configPersist?this.sessionStorage:this.localStorage);var n=this.localStorage.getItem(i);n&&1==n?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(i,"1")),this.envInfo={user:{user_unique_id:undef,user_type:undef,user_id:undef,user_is_auth:undef,user_is_login:undef,device_id:undef,web_id:undef,ip_addr_id:undef},header:{app_id:undef,app_name:undef,app_install_id:undef,install_id:undef,app_package:undef,app_channel:undef,app_version:undef,os_name:t.os_name,os_version:t.os_version,device_model:t.device_model,ab_client:undef,traffic_type:undef,client_ip:undef,device_brand:undef,os_api:undef,access:undef,language:t.language,region:undef,app_language:undef,app_region:undef,ab_version:undef,creative_id:t.utm.creative_id,ad_id:t.utm.ad_id,campaign_id:t.utm.campaign_id,log_type:undef,rnd:undef,platform:t.platform,sdk_version:SDK_VERSION,sdk_lib:"js",province:undef,city:undef,timezone:timezone,tz_offset:tz_offset,tz_name:undef,sim_region:undef,carrier:undef,resolution:t.screen_width+"x"+t.screen_height,browser:t.browser,browser_version:t.browser_version,referrer:t.referrer,referrer_host:t.referrer_host,width:t.screen_width,height:t.screen_height,screen_width:t.screen_width,screen_height:t.screen_height,utm_term:t.utm.utm_term,utm_content:t.utm.utm_content,utm_source:t.utm.utm_source,utm_medium:t.utm.utm_medium,utm_campaign:t.utm.utm_campaign,tracer_data:JSON.stringify(t.utm.tracer_data),custom:{},wechat_unionid:undef,wechat_openid:undef}},this.ab_version="",this.evtParams={},this.reportErrorCallback=function(){},this.initDomain()}return e.prototype.initDomain=function(){var e=this.initConfig.channel_domain;if(e)this.domain=e;else{var t=this.initConfig.channel;this.domain=decodeUrl(LOG_URL[t])}},e.prototype.setDomain=function(e){this.domain=e},e.prototype.getDomain=function(){return this.domain},e.prototype.setAbVersion=function(e){this.ab_version=e},e.prototype.getAbVersion=function(){return this.ab_version},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t=this.initConfig.report_url||REPORT_URL;break;case"webid":t=WEBID_URL;break;case"tobid":t=TOB_URL}var i="";return this.initConfig.caller&&(i="?sdk_version="+SDK_VERSION+"&sdk_name=web&app_id="+this.initConfig.app_id+"&caller="+this.initConfig.caller),""+this.getDomain()+t+i},e.prototype.set=function(e){var t=this;Object.keys(e).forEach(function(i){if(void 0!==e[i]&&null!==e[i]||t.delete(i),"evtParams"===i)t.evtParams=_assign({},t.evtParams||{},e.evtParams||{});else if("_staging_flag"===i)t.evtParams=_assign({},t.evtParams||{},{_staging_flag:e._staging_flag});else if("reportErrorCallback"===i&&"function"==typeof e[i])t.reportErrorCallback=e[i];else{var n="",o="";if(i.indexOf(".")>-1){var r=i.split(".");n=r[0],o=r[1]}n?"user"===n||"header"===n?t.envInfo[n][o]=e[i]:t.envInfo.header.custom[o]=e[i]:t.envInfo.user.hasOwnProperty(i)?["user_type","ip_addr_id"].indexOf(i)>-1?t.envInfo.user[i]=e[i]?Number(e[i]):e[i]:["user_id","web_id","user_unique_id"].indexOf(i)>-1?t.envInfo.user[i]=e[i]?String(e[i]):e[i]:["user_is_auth","user_is_login"].indexOf(i)>-1?t.envInfo.user[i]=Boolean(e[i]):"device_id"===i&&(t.envInfo.user[i]=e[i]):t.envInfo.header.hasOwnProperty(i)?t.envInfo.header[i]=e[i]:t.envInfo.header.custom[i]=e[i]}})},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:this.envInfo.user.hasOwnProperty(e)?this.envInfo.user[e]:this.envInfo.header.hasOwnProperty(e)?this.envInfo.header[e]:JSON.parse(JSON.stringify(this.envInfo[e])):JSON.parse(JSON.stringify(this.envInfo))}catch(e){console.log("get config stringify error ")}},e.prototype.setStore=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey)||{};if(t&&Object.keys(e).length){var i=Object.assign(e,t);this.storage.setItem(this.configKey,i)}}catch(e){}},e.prototype.getStore=function(){try{if(!this.configPersist)return null;var e=this.storage.getItem(this.configKey);return e&&Object.keys(e).length?e:null}catch(e){return null}},e.prototype.delete=function(e){try{if(!this.configPersist)return;var t=this.storage.getItem(this.configKey);t&&t.hasOwnProperty(e)&&(delete t[e],this.storage.setItem(this.configKey,t))}catch(e){}},e}(),Logger=function(){function e(e,t){this.isLog=t||!1,this.name=e||""}return e.prototype.info=function(e){this.isLog&&console.log("[instance: "+this.name+"] "+e)},e.prototype.warn=function(e){this.isLog&&console.warn("[instance: "+this.name+"] "+e)},e.prototype.error=function(e){this.isLog&&console.error("[instance: "+this.name+"] "+e)},e.prototype.throw=function(e){throw this.error(this.name),new Error(e)},e}(),Types,e;e=Types||(Types={}),e.Init="init",e.Config="config",e.Start="start",e.Ready="ready",e.TokenComplete="token-complete",e.TokenStorage="token-storage",e.TokenFetch="token-fetch",e.TokenError="token-error",e.ConfigUuid="config-uuid",e.ConfigWebId="config-webid",e.ConfigDomain="config-domain",e.CustomWebId="custom-webid",e.TokenChange="token-change",e.TokenReset="token-reset",e.ConfigTransform="config-transform",e.EnvTransform="env-transform",e.SessionReset="session-reset",e.SessionResetTime="session-reset-time",e.Event="event",e.Events="events",e.EventNow="event-now",e.CleanEvents="clean-events",e.BeconEvent="becon-event",e.SubmitBefore="submit-before",e.SubmitScuess="submit-scuess",e.SubmitAfter="submit-after",e.SubmitError="submit-error",e.SubmitVerify="submit-verify",e.Stay="stay",e.ResetStay="reset-stay",e.StayReady="stay-ready",e.SetStay="set-stay",e.RouteChange="route-change",e.RouteReady="route-ready",e.Ab="ab",e.AbVar="ab-var",e.AbAllVars="ab-all-vars",e.AbConfig="ab-config",e.AbExternalVersion="ab-external-version",e.AbVersionChangeOn="ab-version-change-on",e.AbVersionChangeOff="ab-version-change-off",e.AbOpenLayer="ab-open-layer",e.AbCloseLayer="ab-close-layer",e.AbReady="ab-ready",e.AbComplete="ab-complete",e.Profile="profile",e.ProfileSet="profile-set",e.ProfileSetOnce="profile-set-once",e.ProfileUnset="profile-unset",e.ProfileIncrement="profile-increment",e.ProfileAppend="profile-append",e.ProfileClear="profile-clear",e.Autotrack="autotrack",e.AutotrackReady="autotrack-ready",e.CepReady="cep-ready",e.TracerReady="tracer-ready";var Types$1=Types,AppBridge=function(){function e(e){this.native=e}var t=e.prototype;return t.bridgeInject=function(){try{return!!this.native&&(AppLogBridge?(console.log("AppLogBridge is injected"),!0):(console.log("AppLogBridge is not inject"),!1))}catch(e){return console.log("AppLogBridge is not inject"),!1}},t.bridgeReady=function(){var e=this;return new Promise(function(t,i){try{e.bridgeInject()?AppLogBridge.hasStarted(function(e){console.log("AppLogBridge is started? : "+e),e?t(!0):i(!1)}):i(!1)}catch(e){console.log("AppLogBridge, error:"+JSON.stringify(e.stack)),i(!1)}})},t.setConfig=function(e){var t=this;try{Object.keys(e).forEach(function(i){"user_unique_id"===i?t.setUserUniqueId(e[i]):e[i]?t.addHeaderInfo(i,e[i]):t.removeHeaderInfo(i)})}catch(e){console.error("setConfig error")}},t.setUserUniqueId=function(e){try{AppLogBridge.setUserUniqueId(e)}catch(e){console.error("setUserUniqueId error")}},t.addHeaderInfo=function(e,t){try{AppLogBridge.addHeaderInfo(e,t)}catch(e){console.error("addHeaderInfo error")}},t.setHeaderInfo=function(e){try{AppLogBridge.setHeaderInfo(JSON.stringify(e))}catch(e){console.error("setHeaderInfo error")}},t.removeHeaderInfo=function(e){try{AppLogBridge.removeHeaderInfo(e)}catch(e){console.error("removeHeaderInfo error")}},t.reportPv=function(e){this.onEventV3("predefine_pageview",e)},t.onEventV3=function(e,t){try{AppLogBridge.onEventV3(e,t)}catch(e){console.error("onEventV3 error")}},t.profileSet=function(e){try{AppLogBridge.profileSet(e)}catch(e){console.error("profileSet error")}},t.profileSetOnce=function(e){try{AppLogBridge.profileSetOnce(e)}catch(e){console.error("profileSetOnce error")}},t.profileIncrement=function(e){try{AppLogBridge.profileIncrement(e)}catch(e){console.error("profileIncrement error")}},t.profileUnset=function(e){try{AppLogBridge.profileUnset(e)}catch(e){console.error("profileUnset error")}},t.profileAppend=function(e){try{AppLogBridge.profileAppend(e)}catch(e){console.error("profileAppend error")}},e}(),ERROR={NO_URL:4001,IMG_ON:4e3,IMG_CATCH:4002,BEACON_FALSE:4003,XHR_ON:500,RESPONSE:5001,TIMEOUT:5005};function fetch$1(e,t,i,n,o,r,s,a){try{var c=new XMLHttpRequest,l=a||"POST";c.open(l,""+e,!0),c.setRequestHeader("Content-Type","application/json; charset=utf-8"),s&&c.setRequestHeader("X-MCS-AppKey",""+s),n&&(c.withCredentials=!0),c.onload=function(){if(o){var e=null;if(c.responseText){try{e=JSON.parse(c.responseText)}catch(t){e={}}o(e,t)}}},i&&(c.timeout=i,c.ontimeout=function(){r&&r(t,ERROR.TIMEOUT)}),c.onerror=function(){c.abort(),r&&r(t,ERROR.XHR_ON)},c.send(JSON.stringify(t))}catch(e){}}var GIF_URL="/gif",ERROR$1={NO_URL:4001,IMG_ON:4e3,IMG_CATCH:4002,BEACON_FALSE:4003,XHR_ON:500,RESPONSE:5001,TIMEOUT:5005},isSupportBeacon=function(){return!(!window.navigator||!window.navigator.sendBeacon)},encodePayload=function(e){var t="";for(var i in e)e.hasOwnProperty(i)&&void 0!==e[i]&&(t+="&"+i+"="+encodeURIComponent(JSON.stringify(e[i])));return"&"===t[0]?t.slice(1):t},sendByImg=function(e,t,i,n){try{var o,r=e.match(/\/v\d\//);o=r?r[0]:-1!==e.indexOf("/v1/")?"/v1/":"/v2/";var s=e.split(o)[0];if(!s)return void n(e,t,ERROR$1.NO_URL);t.forEach(function(o){var r=encodePayload(o),a=new Image(1,1);a.onload=function(){a=null,i&&i()},a.onerror=function(){a=null,n&&n(e,t,ERROR$1.IMG_ON)},a.src=""+s+GIF_URL+"?"+r})}catch(i){n&&n(e,t,ERROR$1.IMG_CATCH,i.message)}},request=function(e,t,i,n,o,r,s){var a=window.navigator.userAgent;if(-1===window.navigator.appName.indexOf("Microsoft Internet Explorer")||-1===a.indexOf("MSIE 8.0")&&-1===a.indexOf("MSIE 9.0")){if(s)return isSupportBeacon()?void(window.navigator.sendBeacon(e,JSON.stringify(t))?o():r(e,t,ERROR$1.BEACON_FALSE)):void sendByImg(e,t,o,r)}else sendByImg(e,t,o,r);fetch$1(e,t,i,n,o,r)},Event=function(){function e(){this.eventLimit=50,this.enable_ttwebid=!1,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.cacheStorgae=new Storage(!0),this.localStorage=new Storage(!1),this.maxReport=t.max_report||10,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,this.enable_ttwebid=t.enable_ttwebid,this.reportUrl=this.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+this.configManager.get("app_id"),this.beconKey="__tea_cache_events_becon_"+this.configManager.get("app_id"),this.abKey="__tea_sdk_ab_version_"+this.configManager.get("app_id"),this.collect.on(Types$1.Ready,function(){i.reportAll(!1)}),this.collect.on(Types$1.ConfigDomain,function(){i.reportUrl=i.configManager.getUrl("event")}),this.collect.on(Types$1.Event,function(e){i.event(e)}),this.collect.on(Types$1.BeconEvent,function(e){i.beconEvent(e)}),this.collect.on(Types$1.CleanEvents,function(){i.reportAll(!1)}),this.linster()},e.prototype.linster=function(){var e=this;window.addEventListener("unload",function(){e.reportAll(!0)},!1),beforePageUnload(function(){e.reportAll(!0)}),document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e.reportAll(!0)},!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;try{var i=__spread(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,i),this.reportTimeout&&clearTimeout(this.reportTimeout),i.length>=this.maxReport)this.report(!1);else{var n=this.reportTime;this.reportTimeout=setTimeout(function(){t.report(!1),t.reportTimeout=null},n)}}catch(e){}},e.prototype.beconEvent=function(e){var t=__spread(e,this.cacheStorgae.getItem(this.beconKey)||[]);this.cacheStorgae.setItem(this.beconKey,t),this.collect.destroyInstance||this.collect.tokenManager.getReady()&&this.collect.sdkReady&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(t)),!0))},e.prototype.reportBecon=function(){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var e=this.cacheStorgae.getItem(this.beconKey)||[];e&&e.length&&(this.cacheStorgae.removeItem(this.beconKey),this.send(this.split(this.merge(e)),!0))}},e.prototype.report=function(e){if(!this.collect.destroyInstance&&this.collect.tokenManager.getReady()&&this.collect.sdkReady){var t=this.cacheStorgae.getItem(this.eventKey)||[];t.length&&(this.cacheStorgae.removeItem(this.eventKey),this.sliceEvent(t,e))}},e.prototype.sliceEvent=function(e,t){if(e.length>this.eventLimit)for(var i=0;i<e.length;i+=this.eventLimit){var n;n=e.slice(i,i+this.eventLimit);var o=this.split(this.merge(n));this.send(o,t)}else o=this.split(this.merge(e)),this.send(o,t)},e.prototype.merge=function(e){var t=this,i=this.configManager.get(),n=i.header,o=i.user;n.custom=JSON.stringify(n.custom);var r=this.configManager.get("evtParams"),s=e.map(function(e){try{Object.keys(r).length&&(e.params=_assign({},r,e.params));var i=t.localStorage.getItem(t.abKey);return i&&i.uuid&&i.uuid===o.user_unique_id&&t.configManager.getAbVersion()&&(e.ab_sdk_version=t.configManager.getAbVersion()),e.session_id=t.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(t){return e}}),a=JSON.parse(JSON.stringify({events:s,user:o,header:n}));a.local_time=Math.floor(Date.now()/1e3),a.user_unique_type=this.config.enable_ttwebid?this.config.user_unique_type:void 0;var c=[];return c.push(a),c},e.prototype.split=function(e){return e.map(function(e){var t=[];return t.push(e),t})},e.prototype.send=function(e,t){var i=this;e.length&&e.forEach(function(e){try{var n=JSON.parse(JSON.stringify(e));i.config.filter&&((n=i.config.filter(n))||console.warn("filter must return data !!")),i.collect.eventFilter&&n&&((n=i.collect.eventFilter(n))||console.warn("filterEvent api must return data !!"));var o=n||e;i.collect.emit(Types$1.SubmitBefore,o),i.collect.emit(Types$1.SubmitVerify,o),request(i.reportUrl,o,i.timeout,i.enable_ttwebid,function(e,t){e&&0!==e.e?i.collect.emit(Types$1.SubmitError,{type:"f_data",eventData:t,errorCode:e.e,response:e}):i.collect.emit(Types$1.SubmitScuess,{eventData:t,res:e})},function(e,t){i.configManager.get("reportErrorCallback")(e,t),i.collect.emit(Types$1.SubmitError,{type:"f_net",eventData:e,errorCode:t})},t),i.collect.emit(Types$1.SubmitAfter,o)}catch(e){console.warn("something error, "+JSON.stringify(e.stack))}})},e}(),b=function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)},localWebId=function(){return b().replace(/-/g,"").slice(0,19)},Token=function(){function e(){this.cacheToken={},this.enableCookie=!1,this.enable_ttwebid=!1,this.enableCustomWebid=!1}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new Storage(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.enable_ttwebid=t.enable_ttwebid,this.enableCustomWebid=t.enable_custom_webid,this.collect.on(Types$1.ConfigUuid,function(e){i.setUuid(e)}),this.collect.on(Types$1.ConfigWebId,function(e){i.setWebId(e)}),this.enableCookie=t.cross_subdomain,this.expiresTime=t.cookie_expire||6048e5,this.cookieDomain=t.cookie_domain||"",this.checkStorage()},e.prototype.checkStorage=function(){var e=this;if(this.enableCookie){var t=this.storage.getCookie(this.tokenKey,this.cookieDomain);this.cacheToken=t&&"string"==typeof t?JSON.parse(t):{}}else this.cacheToken=this.storage.getItem(this.tokenKey)||{};this.tokenType=this.cacheToken&&this.cacheToken._type_?this.cacheToken._type_:"default","custom"!==this.tokenType||this.enableCustomWebid?this.enableCustomWebid?this.collect.on(Types$1.CustomWebId,function(){e.tokenReady=!0,e.collect.emit(Types$1.TokenComplete)}):this.checkEnv()||(this.enable_ttwebid?this.completeTtWid(this.cacheToken):this.check()):this.remoteWebid()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.config.disable_webid?this.complete({web_id:localWebId(),user_unique_id:this.configManager.get("user_unique_id")||localWebId()}):this.remoteWebid()},e.prototype.checkEnv=function(){if(-1!==window.navigator.userAgent.indexOf("miniProgram")){var e=parseUrlQuery(window.location.href);return!(!e||!e.Web_ID)&&(this.complete({web_id:""+e.Web_ID,user_unique_id:this.configManager.get("user_unique_id")||""+e.Web_ID}),!0)}return!1},e.prototype.remoteWebid=function(){var e=this;fetch$1(this.configManager.getUrl("webid"),{app_key:this.config.app_key,app_id:this.config.app_id,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer,user_unique_id:""},3e3,!1,function(t){t&&0===t.e?e.complete({web_id:e.configManager.get("web_id")||t.web_id,user_unique_id:e.configManager.get("user_unique_id")||t.web_id}):(e.collect.emit(Types$1.TokenError),console.warn("[]appid: "+e.config.app_id+" webid error, init error~"))},function(){e.collect.emit(Types$1.TokenError),console.warn("[]appid: "+e.config.app_id+", get webid error, init error~")})},e.prototype.complete=function(e){var t=e.web_id,i=e.user_unique_id;e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:i}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(Types$1.TokenComplete)},e.prototype.completeTtWid=function(e){var t=e.user_unique_id||"",i=this.configManager.get("user_unique_id");(i||t)&&this.configManager.set({user_unique_id:i||t}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(Types$1.TokenComplete)},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),i=this.configManager.get("user_unique_id"),n=this.cacheToken&&this.cacheToken.user_unique_id;if(t===i&&t===n)return;this.configManager.set({user_unique_id:t}),this.cacheToken?this.cacheToken.user_unique_id=t:(this.cacheToken={},this.cacheToken.user_unique_id=t),this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken),this.collect.emit(Types$1.TokenChange,"uuid"),this.collect.emit(Types$1.SessionReset)}else this.clearUuid()},e.prototype.clearUuid=function(){this.config.enable_ttwebid||this.configManager.get("web_id")&&(this.configManager.set({user_unique_id:this.configManager.get("web_id")}),this.cacheToken&&this.cacheToken.web_id&&(this.cacheToken.user_unique_id=this.cacheToken.web_id,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)),this.collect.emit(Types$1.TokenReset))},e.prototype.setWebId=function(e){if(e&&!this.config.enable_ttwebid){this.cacheToken&&this.cacheToken.web_id?this.cacheToken.web_id!==e&&(this.cacheToken.user_unique_id=this.cacheToken.web_id===this.cacheToken.user_unique_id?e:this.cacheToken.user_unique_id,this.cacheToken.web_id=e):(this.cacheToken={},this.cacheToken.web_id=e,this.cacheToken.user_unique_id=e),this.cacheToken.timestamp=Date.now();var t=this.configManager.get("web_id"),i=this.configManager.get("user_unique_id");i&&i!==t||(this.configManager.set({user_unique_id:e}),this.collect.emit(Types$1.TokenChange,"uuid")),t!==e&&(this.configManager.set({web_id:e}),this.collect.emit(Types$1.TokenChange,"webid")),this.setStorage(this.cacheToken)}},e.prototype.setStorage=function(e){e._type_=this.enableCustomWebid?"custom":"default",delete e["diss".split("").reverse().join("")],this.enableCookie||this.enable_ttwebid?(this.storage.setCookie(this.tokenKey,e,this.expiresTime,this.cookieDomain),this.enable_ttwebid&&(delete e.web_id,this.storage.setItem(this.tokenKey,e))):this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e.prototype.getTobId=function(){var e=this,t=this.configManager.getUrl("tobid");return new Promise(function(i){fetch$1(t,{app_id:e.config.app_id,user_unique_id:e.configManager.get("user_unique_id"),web_id:e.configManager.get("web_id")},3e4,e.enable_ttwebid,function(e){e&&0===e.e?i(e.tobid):i("")},function(){i("")})})},e}(),sessionId=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})},Session=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.storage=new Storage(!1,"session"),this.sessionKey="__tea_session_id_"+t.app_id,this.expireTime=t.expireTime||18e5,this.disableSession=t.disable_session,this.disableSession||(this.setSessionId(),this.collect.on(Types$1.SessionReset,function(){i.resetSessionId()}),this.collect.on(Types$1.SessionResetTime,function(){i.updateSessionIdTime()}))},e.prototype.updateSessionIdTime=function(){var e=this.storage.getItem(this.sessionKey);if(e&&e.sessionId){var t=e.timestamp;Date.now()-t>this.expireTime?e={sessionId:sessionId(),timestamp:Date.now()}:e.timestamp=Date.now(),this.storage.setItem(this.sessionKey,e),this.resetExpTime()}},e.prototype.setSessionId=function(){var e=this,t=this.storage.getItem(this.sessionKey);t&&t.sessionId?t.timestamp=Date.now():t={sessionId:sessionId(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,t),this.sessionExp=setInterval(function(){e.checkEXp()},this.expireTime)},e.prototype.getSessionId=function(){var e=this.storage.getItem(this.sessionKey);return this.disableSession?"":e&&e.sessionId?e.sessionId:""},e.prototype.resetExpTime=function(){var e=this;this.sessionExp&&(clearInterval(this.sessionExp),this.sessionExp=setInterval(function(){e.checkEXp()},this.expireTime))},e.prototype.resetSessionId=function(){var e={sessionId:sessionId(),timestamp:Date.now()};this.storage.setItem(this.sessionKey,e)},e.prototype.checkEXp=function(){var e=this.storage.getItem(this.sessionKey);e&&e.sessionId&&Date.now()-e.timestamp+30>=this.expireTime&&(e={sessionId:sessionId(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e))},e}(),AutoBase=function(e){var t=e.app_id,i=e.channel,n=e.onTokenReady,o=LOG_URL[i]+"/webid",r=new Storage(!1),s="__tea_cache_tokens_"+t,a=r.getItem(s);a&&a.web_id?n(a.web_id):request(o,{app_key:"",app_id:t,url:location.href,user_agent:window.navigator.userAgent,referer:document.referrer},3e3,!1,function(e){if(e&&0===e.e){n(e.web_id);var t={web_id:e.web_id,user_unique_id:e.web_id,timestamp:Date.now()};r.setItem(s,t)}else n("")},function(){n("")},!0)},pluginExtendList={autotrack:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/autotrack.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/autotrack.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/autotrack.js"},object:"LogAutoTrack"},ab:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/ab.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/ab.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/ab.js"},object:"LogAb"},stay:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/stay.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/stay.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/stay.js"},object:"LogStay"},route:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/route.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/route.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/route.js"},object:"LogRoute"},cep:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/cep.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/cep.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/cep.js"},object:"LogCep"},tracer:{src:{cn:"https://lf3-cdn-tos.bytescm.com/obj/static/log-sdk/collect/5.0/plugin/tracer.js",sg:"https://sf16-scmcdn-sg.ibytedtos.com/obj/static-sg/log-sdk/collect/5.0/plugin/tracer.js",va:"https://sf16-scmcdn-va.ibytedtos.com/obj/static-us/log-sdk/collect/5.0/plugin/tracer.js"},object:"LogTracer"}},sdk_type="base";sdk_type="full";var Collector=function(){function e(e){this.disableAutoPageView=!1,this.bridgeReport=!1,this.staging=!1,this.pluginInstances=[],this.sended=!1,this.started=!1,this.destroyInstance=!1,this.sdkReady=!1,this.adapters={},this.name=e,this.hook=new Hook,this.remotePlugin=new Map,this.Types=Types$1,this.adapters.fetch=fetch$1,this.adapters.storage=Storage}return e.usePlugin=function(t,i,n){if(i){for(var o=!1,r=0,s=e.plugins.length;r<s;r++)if(e.plugins[r].name===i){e.plugins[r].plugin=t,e.plugins[r].options=n||{},o=!0;break}o||e.plugins.push({name:i,plugin:t,options:n})}else e.plugins.push({plugin:t})},e.prototype.usePlugin=function(e,t,i){e&&("full"===sdk_type&&pluginExtendList.hasOwnProperty(e)?console.info("your sdk version has "+e+" already ~"):t?"string"==typeof t?this.remotePlugin.get(e)||this.remotePlugin.set(e,{src:t,call:i}):this.remotePlugin.get(e)||this.remotePlugin.set(e,{instance:t}):this.remotePlugin.get(e)||this.remotePlugin.set(e,"sdk"))},e.prototype.init=function(t){var i=this;this.inited?console.warn("[instance: "+this.name+"], every instance's api: init,  can be call only one time!"):t&&isObject(t)?t.app_id&&isNumber(t.app_id)?!t.app_key||isString(t.app_key)?(t.channel_domain||-1!==["cn","sg","va"].indexOf(t.channel)||(console.warn("channel must be `cn`, `sg`,`va` !!!"),t.channel="cn"),this.logger=new Logger(this.name,t.log),this.appBridge=new AppBridge(t.Native),this.bridgeReport=this.appBridge.bridgeInject(),this.configManager=new ConfigManager(t),this.initConfig=t,this.bridgeReport||(this.configManager.set({app_id:t.app_id}),this.eventManager=new Event,this.tokenManager=new Token,this.sessionManager=new Session,Promise.all([new Promise(function(e){i.once(Types$1.TokenComplete,function(){e(!0)})}),new Promise(function(e){i.once(Types$1.Start,function(){e(!0)})})]).then(function(){try{e.plugins.reduce(function(e,t){var n=t.plugin,o=t.options,r=Object.assign(i.initConfig,o),s=new n;return s.apply(i,r),e.push(s),e},i.pluginInstances)}catch(e){console.log("load plugin error, "+e.message)}i.sdkReady=!0,i.emit(Types$1.Ready),i.logger.info("appid: "+t.app_id+", userInfo:"+JSON.stringify(i.configManager.get("user"))),i.logger.info("appid: "+t.app_id+", sdk is ready, version is "+SDK_VERSION+", you can report now !!!");try{(window.opener||window.parent).postMessage("[tea-sdk]ready","*")}catch(e){}t.disable_auto_pv&&(i.disableAutoPageView=!0),i.pageView(),i.on(Types$1.TokenChange,function(e){"webid"===e&&i.pageView(),i.logger.info("appid: "+t.app_id+" token change, new userInfo:"+JSON.stringify(i.configManager.get("user")))}),i.on(Types$1.TokenReset,function(){i.logger.info("appid: "+t.app_id+" token reset, new userInfo:"+JSON.stringify(i.configManager.get("user")))}),i.on(Types$1.RouteChange,function(e){e.init||t.disable_route_report||i.pageView()})}),this.tokenManager.apply(this,t),this.eventManager.apply(this,t),this.sessionManager.apply(this,t),this.emit(Types$1.Init)),this.inited=!0):console.warn("app_key param is error, must be string, please check!"):console.warn("app_id param is error, must be number, please check!"):console.warn("init params error,please check")},e.prototype.config=function(e){if(this.inited)if(e&&isObject(e))if(this.bridgeReport)this.appBridge.setConfig(e);else{e._staging_flag&&1===e._staging_flag&&(this.staging=!0),e.disable_auto_pv&&(this.disableAutoPageView=!0,delete e.disable_auto_pv);var t=_assign({},e);if(this.initConfig&&this.initConfig.configPersist){var i=this.configManager.getStore();i&&(t=Object.assign(i,e)),this.configManager.setStore(e)}t.web_id,t.user_unique_id;var n=__rest(t,["web_id","user_unique_id"]);t.hasOwnProperty("web_id")&&this.emit(Types$1.ConfigWebId,t.web_id),t.hasOwnProperty("user_unique_id")&&this.emit(Types$1.ConfigUuid,t.user_unique_id),this.configManager.set(n)}else console.warn("config params is error, please check");else console.warn("config must be use after function init")},e.prototype.setDomain=function(e){this.configManager&&this.configManager.setDomain(e),this.emit(Types$1.ConfigDomain)},e.prototype.getConfig=function(e){return this.configManager.get(e)},e.prototype.send=function(){this.start()},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.emit(Types$1.Start),this.bridgeReport&&this.pageView())},e.prototype.event=function(e,t){var i=this;try{if(this.initConfig&&this.initConfig.disable_track_event)return;var n=[];Array.isArray(e)?e.forEach(function(e){n.push(i.processEvent(e[0],e[1]||{}))}):n.push(this.processEvent(e,t)),this.bridgeReport?n.forEach(function(e){var t=e.event,n=e.params;i.appBridge.onEventV3(t,JSON.stringify(n))}):n.length&&(this.emit(Types$1.Event,n),this.emit(Types$1.SessionResetTime))}catch(e){console.warn("something error, please check")}},e.prototype.beconEvent=function(e,t){if(!this.initConfig||!this.initConfig.disable_track_event)if(Array.isArray(e))console.warn("beconEvent not support batch report, please check");else{var i=[];i.push(this.processEvent(e,t||{})),i.length&&(this.emit(Types$1.BeconEvent,i),this.emit(Types$1.SessionResetTime))}},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{var i=e;/^event\./.test(e)&&(i=e.slice(6));var n=t;"object"!=typeof n&&(n={}),n.profile?delete n.profile:n.event_index=getIndex();var o=void 0;return n.local_ms?(o=n.local_ms,delete n.local_ms):o=+new Date,{event:i,params:n,local_time_ms:o,is_bav:this.initConfig&&this.initConfig.autotrack?1:0}}catch(i){return{event:e,params:t}}},e.prototype.filterEvent=function(e){this.eventFilter=e},e.prototype.on=function(e,t){this.hook.on(e,t)},e.prototype.once=function(e,t){this.hook.once(e,t)},e.prototype.off=function(e,t){this.hook.off(e,t)},e.prototype.emit=function(e,t,i){this.hook.emit(e,t,i)},e.prototype.set=function(e){this.hook.set(e)},e.prototype.pageView=function(){this.disableAutoPageView||this.predefinePageView()},e.prototype.predefinePageView=function(e){void 0===e&&(e={});var t={title:document.title||location.pathname,url:location.href,url_path:location.pathname,time:Date.now(),referrer:window.document.referrer,$is_first_time:""+this.configManager.is_first_time},i=_assign({},t,e);this.event("predefine_pageview",i)},e.prototype.clearEventCache=function(){this.emit(Types$1.CleanEvents)},e.prototype.setWebIDviaUnionID=function(e){if(e){var t=hashCode(e);this.config({web_id:""+t,wechat_unionid:e}),this.emit(Types$1.CustomWebId)}},e.prototype.setWebIDviaOpenID=function(e){if(e){var t=hashCode(e);this.config({web_id:""+t,wechat_openid:e}),this.emit(Types$1.CustomWebId)}},e.prototype.resetStayDuration=function(e,t,i){void 0===e&&(e=""),void 0===t&&(t=""),void 0===i&&(i=""),this.emit(Types$1.ResetStay,{url_path:e,title:t,url:i},Types$1.Stay)},e.prototype.resetStayParams=function(e,t,i){void 0===e&&(e=""),void 0===t&&(t=""),void 0===i&&(i=""),this.emit(Types$1.SetStay,{url_path:e,title:t,url:i},Types$1.Stay)},e.prototype.getToken=function(e,t){var i=this,n=!1,o=function(t){if(!n){n=!0;var o=i.configManager.get().user;return t&&(o.tobid=t,o["diss".split("").reverse().join("")]=t),e(_assign({},o))}},r=function(){i.tokenManager.getTobId().then(function(e){o(e)})};this.sdkReady?r():(t&&setTimeout(function(){o()},t),this.on(Types$1.Ready,function(){r()}))},e.prototype.profileSet=function(e){this.bridgeReport?this.appBridge.profileSet(JSON.stringify(e)):this.emit(Types$1.ProfileSet,e,Types$1.Profile)},e.prototype.profileSetOnce=function(e){this.bridgeReport?this.appBridge.profileSetOnce(JSON.stringify(e)):this.emit(Types$1.ProfileSetOnce,e,Types$1.Profile)},e.prototype.profileIncrement=function(e){this.bridgeReport?this.appBridge.profileIncrement(JSON.stringify(e)):this.emit(Types$1.ProfileIncrement,e,Types$1.Profile)},e.prototype.profileUnset=function(e){this.bridgeReport?this.appBridge.profileUnset(e):this.emit(Types$1.ProfileUnset,e,Types$1.Profile)},e.prototype.profileAppend=function(e){this.bridgeReport?this.appBridge.profileAppend(JSON.stringify(e)):this.emit(Types$1.ProfileAppend,e,Types$1.Profile)},e.prototype.setExternalAbVersion=function(e){this.emit(Types$1.AbExternalVersion,"string"==typeof e&&e?(""+e).trim():null,Types$1.Ab)},e.prototype.getVar=function(e,t,i){this.emit(Types$1.AbVar,{name:e,defaultValue:t,callback:i},Types$1.Ab)},e.prototype.getABconfig=function(e,t){this.emit(Types$1.AbConfig,{params:e,callback:t},Types$1.Ab)},e.prototype.getAbSdkVersion=function(){return this.configManager.getAbVersion()},e.prototype.onAbSdkVersionChange=function(e){var t=this;return this.emit(Types$1.AbVersionChangeOn,e,Types$1.Ab),function(){t.emit(Types$1.AbVersionChangeOff,e,Types$1.Ab)}},e.prototype.offAbSdkVersionChange=function(e){this.emit(Types$1.AbVersionChangeOff,e,Types$1.Ab)},e.prototype.openOverlayer=function(){this.emit(Types$1.AbOpenLayer,"",Types$1.Ab)},e.prototype.closeOverlayer=function(){this.emit(Types$1.AbCloseLayer,"",Types$1.Ab)},e.prototype.getAllVars=function(e){this.emit(Types$1.AbAllVars,e,Types$1.Ab)},e.prototype.autoInitializationRangers=function(e){AutoBase(e)},e.prototype.destoryInstace=function(){this.destroyInstance||(this.destroyInstance=!0,this.off(Types$1.TokenComplete))},e.plugins=[],e}(),STYLE_ID="__rangers_ab_style__";function openOverlayer(){if(!document.getElementById(STYLE_ID)){var e="body { opacity: 0 !important; }",t=document.head||document.getElementsByTagName("head")[0],i=document.createElement("style");i.id=STYLE_ID,i.type="text/css",i.styleSheet?i.styleSheet.cssText=e:i.appendChild(document.createTextNode(e)),t.appendChild(i)}}function closeOverlayer(){var e=document.getElementById(STYLE_ID);e&&e.parentElement.removeChild(e)}var msgQueueMap={},allowdOrigins=[],addAllowdOrigin=function(e){e.length&&e.forEach(function(e){allowdOrigins.push(e)})};function dispatchMsg(e,t,i,n){var o=e&&e.source||window.opener||window.parent,r=e&&e.origin||n||"*",s={type:t,payload:i};o.postMessage(JSON.stringify(s),r)}function receiveMsg(e,t){msgQueueMap[e]=msgQueueMap[e]||[],msgQueueMap[e].push(t)}function processMsg(e){if(allowdOrigins.some(function(e){return"*"===e})||allowdOrigins.some(function(t){return e.origin.indexOf(t)>-1})){var t=e.data;if("string"==typeof e.data)try{t=JSON.parse(e.data)}catch(e){t=void 0}if(!t)return;var i=t.type,n=t.payload;msgQueueMap[i]&&msgQueueMap[i].forEach(function(t){"function"==typeof t&&t(e,n)})}}function init(e,t){var i=_assign({},e);delete i.filter,(window.opener||window.parent).postMessage({type:"tea:sdk:info",copyConfig:i,version:t},"*"),window.addEventListener("message",processMsg,!1)}var VISUAL_URL="",isLoaded=!1;function loadEditorScript(e){var t=e.event,i=e.editorUrl;e.collectInstance,e.fromSession,isLoaded||(isLoaded=!0,loadScript(i,function(){dispatchMsg(t,"abEditorScriptloadSuccess")},function(){t&&dispatchMsg(t,"abEditorScriptloadError"),isLoaded=!1}))}function readyToLoadEditor(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{},addAllowdOrigin(["*"]);var i,n="";init(t,SDK_VERSION);var o="";try{var r=window.performance.getEntriesByType("resource");if(r&&r.length&&(r.forEach(function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(o=e.name)}),o||document.currentScript&&(o=document.currentScript.src),o&&(i=o.split("/"))&&i.length)){n="https:/";for(var s=2;s<i.length&&s!==i.length-1;s++)n=n+"/"+i[s];n+="/visual-ab-core"}}catch(e){}receiveMsg("tea:openVisualABEditor",function(i){var o=i.data;if("string"==typeof i.data)try{o=JSON.parse(i.data)}catch(e){o=void 0}if(o){var r=o.lang;if(o.appId!==t.app_id)return dispatchMsg(i,"appIdError"),void console.error("abtest appid is not belong the page appid please check");var s=o.version;VISUAL_URL=s&&n?n+(s?"."+s:".1.0.1")+".js?query="+Date.now():VISUAL_AB_CORE+"?query="+Date.now(),window.TEAVisualEditor.lang=r,window.TEAVisualEditor.__ab_domin=t.channel_domain||"",loadEditorScript({event:i,editorUrl:VISUAL_URL,collectInstance:e})}})}var loadMuiltlink=function(e,t){window.TEAVisualEditor.appId=t.app_id,receiveMsg("tea:openTesterEventInspector",function(t){var i=t.data;if("string"==typeof t.data)try{i=JSON.parse(t.data)}catch(e){i=void 0}if(i){var n=i.referrer,o=i.lang,r=i.appId;window.TEAVisualEditor.__editor_ajax_domain=n||"",window.TEAVisualEditor.__ab_appId=r||"",window.TEAVisualEditor.lang=o||"",loadEditorScript({event:t,editorUrl:VISUAL_URL_INSPECTOR+".js?query="+Date.now(),collectInstance:e})}})},loadVisual=function(e){window.TEAVisualEditor.__ab_config=e,loadScript(VISUAL_AB_LOADER+"?query="+Date.now(),function(){console.log("load visual render success")},function(){console.log("load visual render fail")})},CallbackType;!function(e){e[e.Var=0]="Var",e[e.All=1]="All"}(CallbackType||(CallbackType={}));var STORAGE_EXPRIRE=2592e6,API="/service/2/abtest_config/",DOMAINS={cn:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz22z1mz19z1jz1mz1ez4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},Ab=function(){function e(){this.fetchStatus="no",this.refreshFetchStatus="complete",this.versions=[],this.extVersions=[],this.mulilinkVersions=[],this.enable_multilink=!1,this.enable_ab_visual=!1,this.editMode=!1,this.callbacks=[],this.data=null,this.changeListener=new Map,this.readyStatus=!1}return e.prototype.apply=function(e,t){var i=this;if(this.collect=e,this.config=t,this.config.enable_ab_test){var n=t.enable_multilink,o=t.ab_channel_domain,r=t.enable_ab_visual,s=o||decodeUrl(DOMAINS[t.channel||"cn"]),a=e.adapters,c=a.storage,l=a.fetch;this.cacheStorgae=new c(!1),this.fetch=l,this.enable_multilink=n,this.enable_ab_visual=r,this.abKey="__tea_sdk_ab_version_"+t.app_id,this.fetchUrl=""+s+API,this.reportUrl=""+e.configManager.getUrl("event");var u=this.collect.Types;this.types=u,this.collect.on(u.TokenChange,function(e){"uuid"===e&&i.readyStatus&&(i.clearCache(),i.fetchAB())}),this.collect.on(u.AbVar,function(e){var t=e.name,n=e.defaultValue,o=e.callback;i.getVar(t,n,o)}),this.collect.on(u.AbAllVars,function(e){i.getAllVars(e)}),this.collect.on(u.AbConfig,function(e){var t=e.params,n=e.callback;i.getABconfig(t,n)}),this.collect.on(u.AbExternalVersion,function(e){i.setExternalAbVersion(e)}),this.collect.on(u.AbVersionChangeOn,function(e){i.changeListener.set(e,e)}),this.collect.on(u.AbVersionChangeOff,function(e){i.changeListener.get(e)&&i.changeListener.delete(e)}),this.loadMode(),(this.enable_ab_visual||this.enable_multilink)&&this.openOverlayer(this.config.multilink_timeout_ms||500),this.checkLocal(),this.ready("ab"),this.readyStatus||(this.fetchAB(),this.readyStatus=!0),this.collect.emit(u.AbReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var i=this.collect.hook._hooksCache[e];if(!Object.keys(i).length)return;var n=function(e){i[e].length&&i[e].forEach(function(i){t.collect.hook.emit(e,i)})};for(var o in i)n(o)}},e.prototype.loadMode=function(){var e=getIframeUrl(),t="";if(e){var i=e.scenario,n=e.href;i?(this.editMode=!0,t=i):!n||-1===n.indexOf("datatester")&&-1===n.indexOf("visual-editor")||(this.editMode=!0,t="visual-editor")}this.enable_ab_visual&&(readyToLoadEditor(this.collect,this.config),"visual-editor"===t)?this.collect.destoryInstace():this.enable_multilink&&loadMuiltlink(this.collect,this.config)},e.prototype.checkLocal=function(){var e=this.getABCache(),t=e.ab_version,i=e.ab_ext_version,n=e.ab_version_multilink,o=e.data,r=this.checkFromUrl();r?this.mulilinkVersions.push(r):this.mulilinkVersions=n||[],this.extVersions=i||[],this.versions=t||[],this.data=o;var s=this.versions.concat(this.extVersions);this.enable_multilink&&(s=s.concat(this.mulilinkVersions)),this.configVersions(s.join(","))},e.prototype.checkFromUrl=function(){var e=parseUrlQuery(window.location.href);return e&&e.vid?e.vid:""},e.prototype.updateVersions=function(){var e=this.extVersions.length?this.versions.concat(this.extVersions):this.versions,t=e.concat(this.mulilinkVersions);this.configVersions(t.join(",")),this.updateABCache(),this.changeListener.size>0&&this.changeListener.forEach(function(t){"function"==typeof t&&t(e)})},e.prototype.configVersions=function(e){this.collect.configManager.setAbVersion(e)},e.prototype.getVar=function(e,t,i){if(!e)throw new Error("variable must not be empty");if(void 0===t)throw new Error("variable no default value");if("function"!=typeof i)throw new Error("callback must be a function");var n={name:e,defaultValue:t,callback:i,type:CallbackType.Var};"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealVar(n,e):this.callbacks.push(n)},e.prototype.getRealVar=function(e,t){var i=e.name,n=e.defaultValue,o=e.callback,r=this.data;if(r){if(isObject(r[i])){var s=r[i].vid;return"$ab_url"===t?this.mulilinkVersions.includes(s)||this.mulilinkVersions.push(s):this.versions.includes(s)||this.versions.push(s),this.updateVersions(),this.fechEvent(s,t,n),void o(r[i].val)}o(n)}else o(n)},e.prototype.getAllVars=function(e){if("function"!=typeof e)throw new Error("callback must be a function");var t={callback:e,type:CallbackType.All};"complete"===this.fetchStatus&&"complete"===this.refreshFetchStatus?this.getRealAllVars(t):this.callbacks.push(t)},e.prototype.getRealAllVars=function(e){(0,e.callback)(this.data?JSON.parse(JSON.stringify(this.data)):{})},e.prototype.fechEvent=function(e,t,i){var n=this;try{if(this.config.disable_track_event)return;if(!e)return;var o=this.collect.configManager.get(),r=o.header,s=o.user,a=this.getABCache();if(a&&a.uuid&&a.uuid!==s.user_unique_id)return;var c={event:"abtest_exposure",ab_sdk_version:""+e,params:JSON.stringify({app_id:this.config.appId,ab_url:"$ab_url"===t?i:window.location.href}),local_time_ms:Date.now()};r.custom=JSON.stringify(r.custom);var l={events:[c],user:s,header:r};"$ab_url"===t?window.navigator.sendBeacon?window.navigator.sendBeacon(this.reportUrl,JSON.stringify([l])):this.fetch(this.reportUrl,[l],2e4):setTimeout(function(){n.fetch(n.reportUrl,[l],2e4)},16)}catch(e){}},e.prototype.setExternalAbVersion=function(e){this.extVersions=[e],this.updateVersions()},e.prototype.getABconfig=function(e,t){var i=Object.keys(e);i&&i.length&&this.collect.configManager.set(e),this.fetchAB(t)},e.prototype.getABCache=function(e){var t={ab_version:[],ab_ext_version:[],ab_version_multilink:[],data:null,timestamp:+new Date,uuid:""};return t=this.cacheStorgae.getItem(this.abKey)||t,Date.now()-t.timestamp>=STORAGE_EXPRIRE?(this.cacheStorgae.removeItem(this.abKey),null):e?t[e]:t},e.prototype.updateABCache=function(){var e=this.getABCache();e.ab_version_multilink=this.mulilinkVersions,e.ab_ext_version=this.extVersions,e.ab_version=this.versions,e.timestamp=Date.now(),this.cacheStorgae.setItem(this.abKey,e)},e.prototype.setAbCache=function(e){var t=this.getABCache();t.data=this.data,t.uuid=e,t.timestamp=Date.now(),this.cacheStorgae.setItem(this.abKey,t)},e.prototype.clearCache=function(){this.refreshFetchStatus="ing",this.data={},this.extVersions=[],this.mulilinkVersions=[],this.versions=[]},e.prototype.openOverlayer=function(e){var t=this;if(openOverlayer(),e)var i=setTimeout(function(){t.closeOverlayer(),clearTimeout(i)},e)},e.prototype.closeOverlayer=function(){closeOverlayer()},e.prototype.fetchComplete=function(e,t){var i=this;if(e&&"[object Object]"==Object.prototype.toString.call(e)){this.data=e,this.setAbCache(t);var n=[];Object.keys(e).forEach(function(t){var i=e[t].vid;i&&n.push(i)}),this.versions=this.versions.filter(function(e){return n.includes(e)});var o=e.$ab_url,r=e.$ab_modification;if(r&&r.val&&this.enable_ab_visual){if(this.collect.destroyInstance)return;this.getVar("$ab_modification",window.location.href,function(){loadVisual(r.val)})}else if(o&&this.enable_multilink){this.mulilinkVersions=this.mulilinkVersions.filter(function(e){return n.includes(e)});var s=o.val,a=o.vid;s&&a&&this.getVar("$ab_url",s,function(){i.editMode||s!==window.location.href&&setTimeout(function(){if(!i.collect.destroyInstance){var e=""+s;e=-1===e.indexOf("http")?"https://"+e:e,parseURL(e).host!==location.host&&(e=e+"&vid="+a),window.location.href=e}},100)})}this.closeOverlayer(),this.updateVersions()}this.callbacks.forEach(function(e){return i[e.type===CallbackType.Var?"getRealVar":"getRealAllVars"](e,"")}),this.callbacks=[]},e.prototype.fetchAB=function(e){var t=this,i=window.location.href,n=this.collect.configManager.get();this.fetch(this.fetchUrl,{header:_assign({aid:this.config.app_id},n.user||{},n.header||{},{ab_sdk_version:this.collect.configManager.getAbVersion(),ab_url:i})},this.config.ab_timeout||3e3,!1,function(i){t.fetchStatus="complete",t.refreshFetchStatus;var o=i.data;"success"===i.message?(t.fetchComplete(o,n.user.user_unique_id),e&&e(o)):(t.fetchComplete(null,n.user.user_unique_id),e&&e(null)),t.collect.emit(t.types.AbComplete,o)},function(){t.fetchStatus="complete",t.refreshFetchStatus,t.fetchComplete(null,n.user.user_unique_id),e&&e(null),t.collect.emit(t.types.AbComplete,null)})},e.prototype.filterUrl=function(e){try{var t="";-1!==e.indexOf("&multilink=true")?t="&multilink=true[\0-\xff]*":-1!==e.indexOf("?multilink=true")&&(t="\\?multilink=true[\0-\xff]*");var i=new RegExp(t,"g");e=e.replace(i,"")}catch(e){}return e},e}(),Et=function(){function e(){}return e.prototype.apply=function(e,t){var i=this,n=e.adapters.fetch;if(t.event_verify_url)if("string"==typeof t.event_verify_url){if(this.url=t.event_verify_url+"/v1/list_test",this.url){var o=e.Types;e.on(o.SubmitBefore,function(e){n(i.url,e,3e4)})}}else console.log("please use correct et_test url")},e}(),Alive=function(){function e(e,t){this.maxDuration=432e5,this.aliveDTime=6e4,this.options={aliveName:"predefine_page_alive",params:{}},this.collect=e,this.config=t,this.pageStartTime=Date.now(),this.sessionStartTime=this.pageStartTime,this.timerHandler=null,isObject(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration))}return e.prototype.setParams=function(e,t,i){this.set_path=e,this.set_url=i,this.set_title=t},e.prototype.enable=function(e,t,i){this.url_path=e,this.url=i,this.title=t,this.disableCallback=this.enablePageAlive()},e.prototype.disable=function(){this.disableCallback(),this.pageStartTime=Date.now()},e.prototype.sendEvent=function(e){void 0===e&&(e=!1);var t=e?this.aliveDTime:Date.now()-this.sessionStartTime;t<0||Date.now()-this.pageStartTime>this.maxDuration||(this.collect.beconEvent(this.options.aliveName,_assign({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),duration:t,is_support_visibility_change:isSupVisChange(),startTime:this.sessionStartTime},this.options.params)),this.sessionStartTime=Date.now())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.setUpTimer=function(){var e=this;return this.timerHandler&&clearInterval(this.timerHandler),setInterval(function(){Date.now()-e.sessionStartTime>e.aliveDTime&&e.sendEvent(!0)},1e3)},e.prototype.visibilitychange=function(){"hidden"===document.visibilityState?this.timerHandler&&(clearInterval(this.timerHandler),this.sendEvent()):"visible"===document.visibilityState&&(this.sessionStartTime=Date.now(),this.timerHandler=this.setUpTimer())},e.prototype.beforeunload=function(){document.hidden||this.sendEvent()},e.prototype.enablePageAlive=function(){var e=this;this.timerHandler=this.setUpTimer();var t=this.visibilitychange.bind(this),i=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),beforePageUnload(i),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("beforeunload",i),window.removeEventListener("pagehide",i)}},e}(),Close=function(){function e(e,t){var i=this;this.maxDuration=432e5,this.aliveDTime=6e4,this.options={closeName:"predefine_page_close",params:{}},this.visibilitychange=function(){"hidden"===document.visibilityState?i.activeEndTime=Date.now():"visible"===document.visibilityState&&(i.activeEndTime&&(i.totalTime+=i.activeEndTime-i.activeStartTime,i.activeTimes+=1),i.activeEndTime=void 0,i.activeStartTime=Date.now())},this.beforeunload=function(){if(i.totalTime+=(i.activeEndTime||Date.now())-i.activeStartTime,i.config.autotrack)try{window.sessionStorage.setItem("_tea_cache_duration",JSON.stringify({duration:i.totalTime,page_title:document.title||location.pathname}))}catch(e){}i.sendEventPageClose()},this.collect=e,this.config=t,this.maxDuration=t.maxDuration||864e5,this.pageStartTime=Date.now(),isObject(t.enable_stay_duration)&&(this.options=Object.assign(this.options,t.enable_stay_duration)),this.resetData()}return e.prototype.setParams=function(e,t,i){this.set_path=e,this.set_url=i,this.set_title=t},e.prototype.enable=function(e,t,i){this.url_path=e,this.url=i,this.title=t,this.disableCallback=this.enablePageClose()},e.prototype.disable=function(){this.disableCallback()},e.prototype.resetData=function(){this.activeStartTime=void 0===this.activeStartTime?this.pageStartTime:Date.now(),this.activeEndTime=void 0,this.activeTimes=1,this.totalTime=0},e.prototype.sendEventPageClose=function(){var e=Date.now()-this.pageStartTime;this.totalTime<0||e<0||this.totalTime>=this.maxDuration||(this.collect.beconEvent(this.options.closeName,_assign({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),active_times:this.activeTimes,duration:this.totalTime,total_duration:e,is_support_visibility_change:isSupVisChange()},this.options.params)),this.pageStartTime=Date.now(),this.resetData())},e.prototype.getParams=function(e){switch(e){case"url_path":return this.set_path||this.url_path||location.pathname;case"title":return this.set_title||this.title||document.title||location.pathname;case"url":return this.set_url||this.url||location.href}},e.prototype.enablePageClose=function(){var e=this,t=this.visibilitychange.bind(this),i=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",t),beforePageUnload(i),function(){e.beforeunload(),document.removeEventListener("visibilitychange",t),window.removeEventListener("beforeunload",i),window.removeEventListener("pagehide",i)}},e}(),Stay=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;if(this.collect=e,this.config=t,this.config.enable_stay_duration){this.title=document.title||location.pathname,this.url=location.href,this.url_path=location.pathname,this.pageAlive=new Alive(e,t),this.pageClose=new Close(e,t);var n=this.collect.Types;this.collect.on(n.ResetStay,function(e){var t=e.url_path,n=e.title,o=e.url;i.resetStayDuration(t,n,o)}),this.collect.on(n.RouteChange,function(e){e.init||t.disable_route_report||i.resetStayDuration()}),this.collect.on(n.SetStay,function(e){var t=e.url_path,n=e.title,o=e.url;i.setStayParmas(t,n,o)}),this.enable(this.url_path,this.title,this.url),this.ready(n.Stay),this.collect.emit(n.StayReady)}},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var i=this.collect.hook._hooksCache[e];if(!Object.keys(i).length)return;var n=function(e){i[e].length&&i[e].forEach(function(i){t.collect.hook.emit(e,i)})};for(var o in i)n(o)}},e.prototype.enable=function(e,t,i){this.pageAlive.enable(e,t,i),this.pageClose.enable(e,t,i)},e.prototype.disable=function(){this.pageAlive.disable(),this.pageClose.disable()},e.prototype.setStayParmas=function(e,t,i){void 0===e&&(e=""),void 0===t&&(t=""),void 0===i&&(i=""),this.pageAlive.setParams(e,t,i),this.pageClose.setParams(e,t,i)},e.prototype.reset=function(e,t,i){this.disable(),this.enable(e,t,i)},e.prototype.resetStayDuration=function(e,t,i){this.reset(e,t,i)},e}(),Profile=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;this.collect=e,this.config=t,this.duration=6e4,this.reportUrl=e.configManager.getDomain()+"/profile/list";var n=e.Types,o=e.adapters.fetch;this.fetch=o,this.cache={},this.collect.on(n.ProfileSet,function(e){i.setProfile(e)}),this.collect.on(n.ProfileSetOnce,function(e){i.setOnceProfile(e)}),this.collect.on(n.ProfileUnset,function(e){i.unsetProfile(e)}),this.collect.on(n.ProfileIncrement,function(e){i.incrementProfile(e)}),this.collect.on(n.ProfileAppend,function(e){i.appendProfile(e)}),this.collect.on(n.ProfileClear,function(){i.cache={}}),this.ready(n.Profile)},e.prototype.ready=function(e){var t=this;if(this.collect.set(e),this.collect.hook._hooksCache.hasOwnProperty(e)){var i=this.collect.hook._hooksCache[e];if(!Object.keys(i).length)return;var n=function(e){i[e].length&&i[e].forEach(function(i){t.collect.hook.emit(e,i)})};for(var o in i)n(o)}},e.prototype.report=function(e,t){void 0===t&&(t={});try{if(this.config.disable_track_event)return;var i=[];i.push(this.collect.processEvent(e,t));var n=this.collect.eventManager.merge(i);this.fetch(this.reportUrl,n)}catch(e){}},e.prototype.setProfile=function(e){var t=this.formatParams(e);t&&Object.keys(t).length&&(this.pushCache(t),this.report("__profile_set",_assign({},t,{profile:!0})))},e.prototype.setOnceProfile=function(e){var t=this.formatParams(e,!0);t&&Object.keys(t).length&&(this.pushCache(t),this.report("__profile_set_once",_assign({},t,{profile:!0})))},e.prototype.incrementProfile=function(e){e?this.report("__profile_increment",_assign({},e,{profile:!0})):console.warn("please check the params, must be object!!!")},e.prototype.unsetProfile=function(e){if(e){var t={};t[e]="1",this.report("__profile_unset",_assign({},t,{profile:!0}))}else console.warn("please check the key, must be string!!!")},e.prototype.appendProfile=function(e){if(e){var t={};for(var i in e)"string"==typeof e[i]||"Array"===Object.prototype.toString.call(e[i]).slice(8,-1)?t[i]=e[i]:console.warn("please check the value of param: "+i+", must be string or array !!!");Object.keys(t).length&&this.report("__profile_append",_assign({},t,{profile:!0}))}else console.warn("please check the params, must be object!!!")},e.prototype.pushCache=function(e){var t=this;Object.keys(e).forEach(function(i){t.cache[i]={val:t.clone(e[i]),timestamp:Date.now()}})},e.prototype.formatParams=function(e,t){var i=this;void 0===t&&(t=!1);try{if(!e||"[object Object]"!==Object.prototype.toString.call(e))return void console.warn("please check the params type, must be object !!!");var n={};for(var o in e)"string"==typeof e[o]||"number"==typeof e[o]||"Array"===Object.prototype.toString.call(e[o]).slice(8,-1)?n[o]=e[o]:console.warn("please check the value of params:"+o+", must be string,number,Array !!!");var r=Object.keys(n);if(!r.length)return;var s=Date.now();return r.filter(function(n){var o=i.cache[n];return t?!o:!(o&&i.compare(o.val,e[n])&&s-o.timestamp<i.duration)}).reduce(function(e,t){return e[t]=n[t],e},{})}catch(e){console.log("error")}},e.prototype.compare=function(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch(e){return!1}},e.prototype.clone=function(e){try{return JSON.parse(JSON.stringify(e))}catch(t){return e}},e.prototype.unReady=function(){console.warn("sdk is not ready, please use this api after start")},e}(),HeartBeat=function(){function e(){var e=this;this.setInterval=function(){e.clearIntervalFunc=selfAdjust(function(){e.isSessionhasEvent&&e.endCurrentSession()},e.sessionInterval)},this.clearInterval=function(){e.clearIntervalFunc&&e.clearIntervalFunc()}}return e.prototype.apply=function(e,t){var i=this;if(this.collect=e,!t.disable_heartbeat){this.sessionInterval=6e4,this.startTime=0,this.lastTime=0,this.setInterval();var n=this.collect.Types;this.collect.on(n.SessionReset,function(){i.process()})}},e.prototype.endCurrentSession=function(){this.collect.event("_be_active",{start_time:this.startTime,end_time:this.lastTime,url:window.location.href,referrer:window.document.referrer,title:document.title||location.pathname}),this.isSessionhasEvent=!1,this.startTime=0},e.prototype.process=function(){this.isSessionhasEvent||(this.isSessionhasEvent=!0,this.startTime=+new Date);var e=this.lastTime||+new Date;this.lastTime=+new Date,this.lastTime-e>this.sessionInterval&&(this.clearInterval(),this.endCurrentSession(),this.setInterval())},e}(),SDK_USE_TYPE="npm",Monitor=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;if(this.collect=e,this.config=t,!this.config.channel_domain){var n=e.adapters.fetch;if(this.fetch=n,!t.disable_track_event&&!t.disable_sdk_monitor){this.url=e.configManager.getUrl("event");var o=this.collect.Types;this.collect.on(o.Ready,function(){i.sdkOnload()}),this.collect.on(o.SubmitError,function(e){var t=e.eventData,n=e.errorCode;i.sdkError(t,n)})}}},e.prototype.sdkOnload=function(){var e=this;try{var t=this.collect.configManager.get(),i=t.header,n=t.user,o=i.app_id,r=i.app_name,s=i.sdk_version,a=n.web_id,c={events:[{event:"onload",params:JSON.stringify({app_id:o,app_name:r||"",sdk_version:s,sdk_type:SDK_USE_TYPE,sdk_config:this.config,sdk_desc:"TOC"}),local_time_ms:Date.now()}],user:{user_unique_id:a},header:{}};setTimeout(function(){e.fetch(e.url,[c],3e4,!1,function(){},function(){},"566f58151b0ed37e")},16)}catch(e){}},e.prototype.sdkError=function(e,t){var i=this;try{var n=e[0],o=n.user,r=n.header,s=[];e.forEach(function(e){e.events.forEach(function(e){s.push(e)})});var a={events:s.map(function(e){return{event:"on_error",params:JSON.stringify({error_code:t,app_id:r.app_id,app_name:r.app_name||"",error_event:e.event,sdk_version:r.sdk_version,local_time_ms:e.local_time_ms,tea_event_index:Date.now(),params:e.params,header:JSON.stringify(r),user:JSON.stringify(o)}),local_time_ms:Date.now()}}),user:{user_unique_id:o.user_unique_id},header:{}};setTimeout(function(){i.fetch(i.url,[a],3e4,!1,function(){},function(){},"566f58151b0ed37e")},16)}catch(e){}},e}();function isNeedElement(e,t){if(void 0===t&&(t="list"),!e)return!1;if(t&&"list"===t){if(["LI","TR","DL"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaIdx"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-idx"))return!0}else{if(["A","BUTTON"].includes(e.nodeName))return!0;if(e.dataset&&e.dataset.hasOwnProperty("teaContainer"))return!0;if(e.hasAttribute&&e.hasAttribute("data-tea-container"))return!0}return!1}function getContainer(e){for(var t=e;t&&!isNeedElement(t,"container");){if("HTML"===t.nodeName||"BODY"===t.nodeName)return e;t=t.parentElement}return t||e}function getNodeText(e){var t="";return 3===e.nodeType?t=e.textContent.trim():e.dataset&&e.dataset.hasOwnProperty("teaTitle")?t=e.getAttribute("data-tea-title"):e.hasAttribute("ata-tea-title")?t=e.getAttribute("data-tea-title"):e.hasAttribute("title")?t=e.getAttribute("title"):"INPUT"===e.nodeName&&["button","submit"].includes(e.getAttribute("type"))?t=e.getAttribute("value"):"IMG"===e.nodeName&&e.getAttribute("alt")&&(t=e.getAttribute("alt")),t.slice(0,200)}function getText(e){var t=getContainer(e),i=[];return function e(t){var n=getNodeText(t);if(n&&-1===i.indexOf(n)&&i.push(n),t.childNodes.length>0)for(var o=t.childNodes,r=0;r<o.length;r++)8!==o[r].nodeType&&e(o[r])}(t),i}function getTextSingle(e){var t=getContainer(e),i="";return function e(t){var n=getNodeText(t);if(n&&(i+=n),t.childNodes.length>0)for(var o=t.childNodes,r=0;r<o.length;r++)3===o[r].nodeType&&e(o[r])}(t),i}function ignore(e){for(var t=e;t&&t.parentNode;){if(t.hasAttribute("data-tea-ignore"))return!0;if("HTML"===t.nodeName||"body"===t.nodeName)return!1;t=t.parentNode}return!1}var elementLevel=function(e){if(e.children.length){var t=e.children;return![].slice.call(t).some(function(e){return e.children.length>0})}return!0},isSVG=function(e){if("svg"===e.tagName.toLowerCase())return!0;for(var t=e.parentElement,i=!1;t;)"svg"===t.tagName.toLowerCase()?(t=null,i=!0):t=t.parentElement;return i};function isTrack(e,t){if(window.innerHeight,window.innerWidth,1!==e.nodeType)return!1;if(!t.svg&&isSVG(e))return!1;if(["HTML","BODY"].includes(e.tagName.toUpperCase()))return!1;var i=e;return"none"!==i.style.display&&(!!isNeedElement(i,"container")||!!elementLevel(i))}var Listener=function(){function e(e,t,i){var n=this;this.clickEvent=function(e){isTrack(e.target,n.options)&&n.eventHandel({eventType:"dom",eventName:"click"},e)},this.changeEvent=function(e){n.eventHandel({eventType:"dom",eventName:"change"},e)},this.submitEvent=function(e){n.eventHandel({eventType:"dom",eventName:"submit"},e)},this.getPageViewEvent=function(e,t){t&&"pushState"===t&&n.eventHandel({eventType:"dom",eventName:"beat"},_assign({beat_type:0},e)),n.eventHandel({eventType:"dom",eventName:"page_view"},e)},this.getPageLoadEvent=function(e){n.eventHandel({eventType:"dom",eventName:"page_statistics"},{lcp:e})},this.config=i.getConfig().eventConfig,this.collect=t,this.options=e,this.beatTime=e.beat,this.statistics=!1}return e.prototype.init=function(e){this.eventHandel=e;var t=this.config.mode;this.addListener(t)},e.prototype.addListener=function(e){var t=this;if("proxy-capturing"===e&&(this.config.click&&window.document.addEventListener("click",this.clickEvent,!0),this.config.change&&window.document.addEventListener("change",this.changeEvent,!0),this.config.submit&&window.document.addEventListener("submit",this.submitEvent,!0),this.config.pv&&this.collect.on("route-change",function(e){var i=e.config,n=e.name;t.getPageViewEvent(i,n)}),this.config.beat)){try{"complete"===document.readyState?this.beatEvent(this.beatTime):window.addEventListener("load",function(){t.beatEvent(t.beatTime)});var i=0,n=null;window.addEventListener("scroll",function(){clearTimeout(n),n=setTimeout(o,500),i=document.documentElement.scrollTop||document.body.scrollTop});var o=function(){(document.documentElement.scrollTop||document.body.scrollTop)==i&&t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:1})}}catch(e){}try{var r=window.performance&&window.performance.getEntriesByType("paint");r&&r.length?(new PerformanceObserver(function(e){var i=e.getEntries(),n=i[i.length-1],o=n.renderTime||n.loadTime;t.statistics||(t.getPageLoadEvent(o),t.statistics=!0)}).observe({entryTypes:["largest-contentful-paint"]}),setTimeout(function(){t.statistics||(t.getPageLoadEvent(r[0].startTime||0),t.statistics=!0)},2e3)):this.getPageLoadEvent(0)}catch(e){this.getPageLoadEvent(0)}}},e.prototype.removeListener=function(){window.document.removeEventListener("click",this.clickEvent,!0),window.document.removeEventListener("change",this.changeEvent,!0),window.document.removeEventListener("submit",this.submitEvent,!0)},e.prototype.beatEvent=function(e){var t=this;try{var i;this.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:3}),this.beatTime&&(i=setInterval(function(){t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:2})},e)),beforePageUnload(function(){t.eventHandel({eventType:"dom",eventName:"beat",eventSend:"becon"},{beat_type:0}),t.beatTime&&clearInterval(i)})}catch(e){}},e}(),defaultConfig={eventConfig:{mode:"proxy-capturing",submit:!1,click:!0,change:!1,pv:!0,beat:!0,hashTag:!1,impr:!1},scoutConfig:{mode:"xpath"}},Config=function(){function e(e){this.config=e}return e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(e){return this.config=e},e}();function getPositionData(e){if(e){var t=e.getBoundingClientRect(),i=t.width,n=t.height;return{left:t.left,top:t.top,element_width:i,element_height:n}}}function getEventData(e,t){void 0===e&&(e={}),void 0===t&&(t={});var i=e.clientX,n=e.clientY,o=t.left,r=t.top,s=i-o>=0?i-o:0,a=n-r>=0?n-r:0;return{touch_x:Math.floor(s),touch_y:Math.floor(a)}}function getXpath(e){for(var t=[];null!==e.parentElement;)t.push(e),e=e.parentElement;var i=[],n=[];return t.forEach(function(e){var t=getXpathIndex(e),o=t.str,r=t.index;i.unshift(o),n.unshift(r)}),{element_path:"/"+i.join("/"),positions:n}}function getXpathIndex(e){if(null===e)return{str:"",index:0};var t=0,i=e.parentElement;if(i)for(var n=i.children,o=0;o<n.length&&n[o]!==e;o++)n[o].nodeName===e.nodeName&&t++;return{str:[e.nodeName.toLowerCase(),isNeedElement(e,"list")?"[]":""].join(""),index:t}}function getElementData(e,t,i){var n={element_path:"",positions:[],texts:[]},o=getPositionData(t),r=getEventData(e,o),s=o.element_width,a=o.element_height,c=r.touch_x,l=r.touch_y,u=getXpath(t),h=u.element_path,p=u.positions,d=getText(t),f=window.performance.timing.navigationStart,g=Date.now()-f,m=p.map(function(e){return""+e}),_=null;window.TEAVisualEditor.getOriginXpath&&(_=window.TEAVisualEditor.getOriginXpath({xpath:h,positions:m})),n.element_path=_&&_.xpath||h,n.positions=_&&_.positions||m,i&&!i.text&&(n.texts=d,n.element_title=getTextSingle(t)),n.element_id=t.getAttribute("id")||"",n.element_class_name=t.getAttribute("class")||"",n.element_type=t.nodeType,n.element_width=Math.floor(s),n.element_height=Math.floor(a),n.touch_x=c,n.touch_y=l,n.page_manual_key="",n.elememt_manual_key="",n.since_page_start_ms=g,n.page_start_ms=f,n.page_path=location.pathname,n.page_host=location.host;var v=getContainer(t);return"A"===v.tagName&&(n.href=v.getAttribute("href")),"IMG"===t.tagName&&(n.src=t.getAttribute("src")),n}function getEventData$1(e,t,i,n){return _assign({event:e},getElementData(t,i,n),{is_html:1,page_key:window.location.href,page_title:document.title})}function getExtraEventData(e,t){try{if("bav2b_change"===e)return t.hasAttribute("data-tea-track")?{value:t.value}:{}}catch(e){return{}}}var EventHandle=function(){function e(e,t){this.ignore={text:!0},this.initConfig=e,this.eventName=t&&"tea"===t.custom?{click:"__bav_click",page:"__bav_page",beat:"__bav_beat",static:"__bav_page_statistics"}:{click:"bav2b_click",page:"bav2b_page",beat:"bav2b_beat",static:"bav2b_page_statistics"},t&&!0===t.text&&(this.ignore.text=!1)}return e.prototype.handleEvent=function(e,t){try{if(ignore(e.target))return null;var i="bav2b_click";switch(t){case"click":return getEventData$1(i=this.eventName.click,e,e.target,this.ignore);case"change":return _assign({},getEventData$1(i="bav2b_change",e,e.target),getExtraEventData(i,e.target));case"submit":return getEventData$1(i="bav2b_submit",e,e.target)}}catch(e){return console.error(e),null}},e.prototype.handleViewEvent=function(e){e.event=this.eventName.page,e.page_title=document.title,e.page_total_width=window.innerWidth,e.page_total_height=window.innerHeight;try{var t=window.sessionStorage.getItem("_tea_cache_duration");if(t){var i=JSON.parse(t);e.refer_page_duration_ms=i?i.duration:"",e.refer_page_title=i?i.page_title:""}else e.refer_page_duration_ms="",e.refer_page_title="";e.scroll_width=document.documentElement.scrollLeft?document.documentElement.scrollLeft+window.innerWidth:window.innerWidth,e.scroll_height=document.documentElement.scrollTop?document.documentElement.scrollTop+window.innerHeight:window.innerHeight,e.page_start_ms=window.performance.timing.navigationStart}catch(e){console.log("page event error "+JSON.stringify(e))}return e},e.prototype.handleStatisticsEvent=function(e){var t={};t.event=this.eventName.static,t.is_html=1,t.page_key=location.href,t.refer_page_key=document.referrer||"",t.page_title=document.title,t.page_manual_key=this.initConfig.autotrack.page_manual_key||"",t.refer_page_manual_key="";try{var i=e.lcp,n=window.performance.timing,o=n.loadEventEnd-n.navigationStart;t.page_init_cost_ms=parseInt(i||(o>0?o:0)),t.page_start_ms=n.navigationStart}catch(e){console.log("page_statistics event error "+JSON.stringify(e))}return t},e.prototype.handleBeadtEvent=function(e){e.event=this.eventName.beat,e.page_key=window.location.href,e.is_html=1,e.page_title=document.title,e.page_manual_key=this.initConfig.autotrack.page_manual_key||"";try{e.page_viewport_width=window.innerWidth,e.page_viewport_height=window.innerHeight,e.page_total_width=document.documentElement.scrollWidth,e.page_total_height=document.documentElement.scrollHeight,e.scroll_width=document.documentElement.scrollLeft+window.innerWidth,e.scroll_height=document.documentElement.scrollTop+window.innerHeight,e.since_page_start_ms=Date.now()-window.performance.timing.navigationStart,e.page_start_ms=window.performance.timing.navigationStart}catch(e){console.log("beat event error "+JSON.stringify(e))}return e},e}(),Request=function(){function e(e){this.collect=e,this.eventNameList=["report_click_event","report_change_event","report_submit_event","report_exposure_event","report_page_view_event","report_page_statistics_event","report_beat_event"]}return e.prototype.send=function(e,t){var i=e.eventSend,n=t.event;delete t.event,i&&"becon"===i?this.collect.beconEvent(n,t):this.collect.event(n,t)},e.prototype.get=function(e,t){var i=Object.assign({headers:{"content-type":"application/json"},method:"GET"},t);fetch(e,i)},e.prototype.post=function(e,t){var i=Object.assign({headers:{"content-type":"application/json"},method:"POST"},t);fetch(e,i)},e}(),COOKIE_KEY="_TEA_VE_OPEN",COOKIE_KEY_HOST="_TEA_VE_APIHOST",COOKIE_LANG="lang",COOKIE_EDIT_VERISON="_VISUAL_EDITOR_V",COOKIE_EDIT_URL="_VISUAL_EDITOR_U";function checkSession(){return"1"===js_cookie.get(COOKIE_KEY)}function checkSessionHost(){var e=js_cookie.get(COOKIE_KEY_HOST);try{e=JSON.parse(e)}catch(e){}return e}function checkEditUrl(){return js_cookie.get(COOKIE_EDIT_URL)}function setSession(){try{var e=window.TEAVisualEditor.lang=window.TEAVisualEditor.lang||js_cookie.get(COOKIE_LANG),t=window.TEAVisualEditor.__editor_ajax_domain=window.TEAVisualEditor.__editor_ajax_domain||js_cookie.get(COOKIE_KEY_HOST),i=window.TEAVisualEditor.__editor_verison=window.TEAVisualEditor.__editor_verison||js_cookie.get(COOKIE_EDIT_VERISON),n=window.TEAVisualEditor.__editor_url=window.TEAVisualEditor.__editor_url||js_cookie.get(COOKIE_EDIT_URL),o=+new Date,r=new Date(o+18e5);js_cookie.set(COOKIE_KEY,"1",{expires:r}),js_cookie.set(COOKIE_KEY_HOST,t,{expires:r}),js_cookie.set(COOKIE_EDIT_URL,n,{expires:r}),js_cookie.set(COOKIE_LANG,e,{expires:r}),js_cookie.set(COOKIE_EDIT_VERISON,i||"",{expires:r})}catch(e){console.log("set cookie err")}}var isLoaded$1=!1;function loadEditorScript$1(e){var t=e.event,i=e.editorUrl,n=e.autoTrackInstance;isLoaded$1||(isLoaded$1=!0,loadScript(i,function(){dispatchMsg(t,"editorScriptloadSuccess"),n.destroy()},function(){t&&dispatchMsg(t,"editorScriptloadError"),isLoaded$1=!1}))}function readyToLoadEditor$1(e,t){window.TEAVisualEditor=window.TEAVisualEditor||{};var i="",n=VISUAL_EDITOR_RANGERS+"?query="+Date.now();window.TEAVisualEditor.appId=t.app_id;var o=t.channel_domain,r="";if(addAllowdOrigin(["*"]),o){var s,a="";try{var c=window.performance.getEntriesByType("resource");if(c&&c.length&&(c.forEach(function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(a=e.name)}),a||document.currentScript&&(a=document.currentScript.src),a&&(s=a.split("/"))&&s.length)){r="https:/";for(var l=2;l<s.length&&l!==s.length-1;l++)r=r+"/"+s[l];if(r&&r.indexOf("/5.0")){var u=r.split("/5.0");r=u[0]||r}}}catch(e){}}if(init(t,SDK_VERSION),checkSession()){var h=checkSessionHost(),p="";h&&(window.TEAVisualEditor.__editor_ajax_domain=h,p=checkEditUrl()),loadEditorScript$1({event:null,editorUrl:p||n,autoTrackInstance:e}),setSession()}else try{receiveMsg("tea:openVisualEditor",function(t){var s=t.data;if("string"==typeof t.data)try{s=JSON.parse(t.data)}catch(e){s=void 0}if(s){var a=s.referrer,c=s.lang;if(a&&(window.TEAVisualEditor.__editor_ajax_domain=a),i=n,o){var l=s.version;i=r?r+(l?"/visual-editor-rangers-v"+l:"/visual-editor-rangers-v1.0.0")+".js":n,window.TEAVisualEditor.__editor_verison=l}window.TEAVisualEditor.__editor_url=i,window.TEAVisualEditor.lang=c,loadEditorScript$1({event:t,editorUrl:i,autoTrackInstance:e}),setSession()}}),window.TEAVisualEditor.openAutotrackEditor=function(){loadEditorScript$1({event:null,editorUrl:window.TEAVisualEditor.__editor_url,autoTrackInstance:e})}}catch(e){console.log("receive message error")}try{receiveMsg("tea:openHeatMapCore",function(t){loadEditorScript$1({event:t,editorUrl:HOT_PIC_URL+".js?query="+Date.now(),autoTrackInstance:e})})}catch(e){console.log("openHeatMapCore error")}}var defaultOpt={hashTag:!1,impr:!1},AutoTrack=function(){function e(){}return e.prototype.apply=function(e,t){if(this.autoTrackStart=!1,this.collect=e,this.config=t,t.autotrack){var i=e.Types;this.ready(i.Autotrack),this.collect.emit(i.AutotrackReady)}},e.prototype.ready=function(e){this.collect.set(e);var t=this.config.autotrack;t="object"==typeof t?t:{},t=Object.assign(defaultOpt,t),this.destroyed=!1,this.options=t,this.Config=new Config(defaultConfig),this.Listener=new Listener(t,this.collect,this.Config),this.EventHandle=new EventHandle(this.config,t),this.Request=new Request(this.collect),this.autoTrackStart=!0,this.init(),readyToLoadEditor$1(this,this.config)},e.prototype.init=function(){this.Listener.init(this.handle.bind(this))},e.prototype.handle=function(e,t){"dom"===e.eventType&&this.handleDom(e,t)},e.prototype.handleDom=function(e,t){try{var i=e.eventName;if("click"===i||"change"===i||"submit"===i){var n=this.EventHandle.handleEvent(t,i);null!==n&&this.Request.send({eventType:"custom",eventName:"report_"+i+"_event",extra:{methods:"GET"}},n)}else if("page_view"===i||"page_statistics"===i){var o;o="page_view"===i?this.EventHandle.handleViewEvent(t):this.EventHandle.handleStatisticsEvent(t),this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"}},o)}else if("beat"===i){var r=this.EventHandle.handleBeadtEvent(t),s=e.eventSend;this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"},eventSend:s},r)}}catch(e){console.log("handel dom event error "+JSON.stringify(e))}},e.prototype.destroy=function(){if(!this.autoTrackStart)return console.warn("engine is undefined, make sure you have called autoTrack.start()");this.autoTrackStart=!1,this.Listener.removeListener()},e}(),State;!function(e){e.Net="net",e.FailNet="f_net",e.FailData="f_data"}(State||(State={}));var EventList={pv:["predefine_pageview"],sdk:["_be_active","predefine_page_alive","predefine_page_close","__profile_set","__profile_set_once","__profile_increment","__profile_unset","__profile_append"],autotrack:["bav2b_click","bav2b_page","bav2b_beat","bav2b_page_statistics","__bav_click","__bav_page","__bav_beat","__bav_page_statistics"]},Tracer=function(){function e(){}return e.prototype.apply=function(e,t){var i=this;if(this.ready=t.app_id&&t.enable_tracer&&!t.disable_track_event,this.ready){this.limit={pv:1,sdk:3,autotrack:3,log:3},this.errorCode={f_net:0,f_data:0},this.tracerCache=new Map,this.collect=e,this.appid=t.app_id,this.reportUrl=e.configManager.getUrl("event");var n=this.collect.Types,o=e.adapters.fetch;this.fetch=o,this.collect.on(n.Event,function(){i.addCount("log")}),this.collect.on(n.SubmitError,function(e){var t=e.type,n=e.eventDate,o=e.errorCode,r=e.response;i.addErrorCount(n,t,o,r)}),this.listener(),this.collect.emit(n.TracerReady)}},e.prototype.addCount=function(e,t,i){void 0===t&&(t="net"),void 0===i&&(i=1);try{this.tracerCache||(this.tracerCache=new Map);var n=void 0;if(this.tracerCache.has(e))(o=this.tracerCache.get(e)).has(t)?(n=o.get(t).params.count,n++,o.set(t,this.processTracer(n,e,t))):(n=i,o.set(t,this.processTracer(i,e,t)));else{var o=new Map;n=i,o.set(t,this.processTracer(i,e,t)),this.tracerCache.set(e,o)}"net"===t&&n>=this.limit[e]&&this.report(!1)}catch(e){console.log(e)}},e.prototype.addErrorCount=function(e,t,i,n){var o=this;try{if(e&&e.length){var r=e[0].events;r&&r.length&&("f_data"===t?(n&&n.hasOwnProperty("sc")?this.addCount("log",t,r.length-n.sc):this.addCount("log",t,r.length),this.errorCode[t]=i):r.forEach(function(e){var n="log";for(var r in EventList)if(-1!==EventList[r].indexOf(e.event)){n=r;break}o.addCount(n,t,1),o.errorCode[t]=i}))}}catch(e){}},e.prototype.report=function(e){if(this.tracerCache){var t=[];this.tracerCache.forEach(function(e){console.log(e),e.forEach(function(e){t.push(e)})}),t&&t.length&&this.sendTracer(t,e)}},e.prototype.sendTracer=function(e,t){try{var i=this.collect.eventManager.merge(e);t&&window.navigator.sendBeacon?window.navigator.sendBeacon(this.reportUrl,JSON.stringify(i)):this.fetch(this.reportUrl,i),this.tracerCache=null}catch(e){}},e.prototype.processTracer=function(e,t,i){var n={count:e,state:i,key:t,params_for_special:"applog_trace",aid:this.appid,platform:"web",_staging_flag:1,sdk_version:SDK_VERSION};"f_net"!==i&&"f_data"!==i||(n.errorCode=this.errorCode[i]);var o=this.collect.processEvent("applog_trace",n);if(o&&o.event)return delete o.is_bav,o},e.prototype.listener=function(){var e=this;document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&e.leavePage()}),beforePageUnload(function(){e.leavePage()})},e.prototype.leavePage=function(){this.report(!0)},e}(),dayjs_min=createCommonjsModule(function(e,t){e.exports=function(){var e="millisecond",t="second",i="minute",n="hour",o="day",r="week",s="month",a="quarter",c="year",l="date",u="Invalid Date",h=/^(\d{4})[-\/]?(\d{1,2})?[-\/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},f=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},g={s:f,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),o=i%60;return(t<=0?"+":"-")+f(n,2,"0")+":"+f(o,2,"0")},m:function e(t,i){if(t.date()<i.date())return-e(i,t);var n=12*(i.year()-t.year())+(i.month()-t.month()),o=t.clone().add(n,s),r=i-o<0,a=t.clone().add(n+(r?-1:1),s);return+(-(n+(i-o)/(r?o-a:a-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(u){return{M:s,y:c,w:r,d:o,D:l,h:n,m:i,s:t,ms:e,Q:a}[u]||String(u||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},m="en",_={};_[m]=d;var v=function(e){return e instanceof k},y=function(e,t,i){var n;if(!e)return m;if("string"==typeof e)_[e]&&(n=e),t&&(_[e]=t,n=e);else{var o=e.name;_[o]=e,n=o}return!i&&n&&(m=n),n||!i&&m},b=function(e,t){if(v(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new k(i)},w=g;w.l=y,w.i=v,w.w=function(e,t){return b(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var k=function(){function d(e){this.$L=y(e.locale,null,!0),this.parse(e)}var f=d.prototype;return f.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(w.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(h);if(n){var o=n[2]-1||0,r=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,r)):new Date(n[1],o,n[3]||1,n[4]||0,n[5]||0,n[6]||0,r)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},f.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},f.$utils=function(){return w},f.isValid=function(){return!(this.$d.toString()===u)},f.isSame=function(e,t){var i=b(e);return this.startOf(t)<=i&&i<=this.endOf(t)},f.isAfter=function(e,t){return b(e)<this.startOf(t)},f.isBefore=function(e,t){return this.endOf(t)<b(e)},f.$g=function(e,t,i){return w.u(e)?this[t]:this.set(i,e)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(e,a){var u=this,h=!!w.u(a)||a,p=w.p(e),d=function(e,t){var i=w.w(u.$u?Date.UTC(u.$y,t,e):new Date(u.$y,t,e),u);return h?i:i.endOf(o)},f=function(e,t){return w.w(u.toDate()[e].apply(u.toDate("s"),(h?[0,0,0,0]:[23,59,59,999]).slice(t)),u)},g=this.$W,m=this.$M,_=this.$D,v="set"+(this.$u?"UTC":"");switch(p){case c:return h?d(1,0):d(31,11);case s:return h?d(1,m):d(0,m+1);case r:var y=this.$locale().weekStart||0,b=(g<y?g+7:g)-y;return d(h?_-b:_+(6-b),m);case o:case l:return f(v+"Hours",0);case n:return f(v+"Minutes",1);case i:return f(v+"Seconds",2);case t:return f(v+"Milliseconds",3);default:return this.clone()}},f.endOf=function(e){return this.startOf(e,!1)},f.$set=function(r,a){var u,h=w.p(r),p="set"+(this.$u?"UTC":""),d=(u={},u[o]=p+"Date",u[l]=p+"Date",u[s]=p+"Month",u[c]=p+"FullYear",u[n]=p+"Hours",u[i]=p+"Minutes",u[t]=p+"Seconds",u[e]=p+"Milliseconds",u)[h],f=h===o?this.$D+(a-this.$W):a;if(h===s||h===c){var g=this.clone().set(l,1);g.$d[d](f),g.init(),this.$d=g.set(l,Math.min(this.$D,g.daysInMonth())).$d}else d&&this.$d[d](f);return this.init(),this},f.set=function(e,t){return this.clone().$set(e,t)},f.get=function(e){return this[w.p(e)]()},f.add=function(e,a){var l,u=this;e=Number(e);var h=w.p(a),p=function(t){var i=b(u);return w.w(i.date(i.date()+Math.round(t*e)),u)};if(h===s)return this.set(s,this.$M+e);if(h===c)return this.set(c,this.$y+e);if(h===o)return p(1);if(h===r)return p(7);var d=(l={},l[i]=6e4,l[n]=36e5,l[t]=1e3,l)[h]||1,f=this.$d.getTime()+e*d;return w.w(f,this)},f.subtract=function(e,t){return this.add(-1*e,t)},f.format=function(e){var t=this,i=this.$locale();if(!this.isValid())return i.invalidDate||u;var n=e||"YYYY-MM-DDTHH:mm:ssZ",o=w.z(this),r=this.$H,s=this.$m,a=this.$M,c=i.weekdays,l=i.months,h=function(e,i,o,r){return e&&(e[i]||e(t,n))||o[i].substr(0,r)},d=function(e){return w.s(r%12||12,e,"0")},f=i.meridiem||function(e,t,i){var n=e<12?"AM":"PM";return i?n.toLowerCase():n},g={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:w.s(a+1,2,"0"),MMM:h(i.monthsShort,a,l,3),MMMM:h(l,a),D:this.$D,DD:w.s(this.$D,2,"0"),d:String(this.$W),dd:h(i.weekdaysMin,this.$W,c,2),ddd:h(i.weekdaysShort,this.$W,c,3),dddd:c[this.$W],H:String(r),HH:w.s(r,2,"0"),h:d(1),hh:d(2),a:f(r,s,!0),A:f(r,s,!1),m:String(s),mm:w.s(s,2,"0"),s:String(this.$s),ss:w.s(this.$s,2,"0"),SSS:w.s(this.$ms,3,"0"),Z:o};return n.replace(p,function(e,t){return t||g[e]||o.replace(":","")})},f.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},f.diff=function(e,l,u){var h,p=w.p(l),d=b(e),f=6e4*(d.utcOffset()-this.utcOffset()),g=this-d,m=w.m(this,d);return m=(h={},h[c]=m/12,h[s]=m,h[a]=m/3,h[r]=(g-f)/6048e5,h[o]=(g-f)/864e5,h[n]=g/36e5,h[i]=g/6e4,h[t]=g/1e3,h)[p]||g,u?m:w.a(m)},f.daysInMonth=function(){return this.endOf(s).$D},f.$locale=function(){return _[this.$L]},f.locale=function(e,t){if(!e)return this.$L;var i=this.clone(),n=y(e,t,!0);return n&&(i.$L=n),i},f.clone=function(){return w.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},d}(),S=k.prototype;return b.prototype=S,[["$ms",e],["$s",t],["$m",i],["$H",n],["$W",o],["$M",s],["$y",c],["$D",l]].forEach(function(e){S[e[1]]=function(t){return this.$g(t,e[0],e[1])}}),b.extend=function(e,t){return e.$i||(e(t,k,b),e.$i=!0),b},b.locale=y,b.isDayjs=v,b.unix=function(e){return b(1e3*e)},b.en=_[m],b.Ls=_,b.p={},b}()}),duration=createCommonjsModule(function(e,t){var i,n,o,r,s,a,c,l,u,h,p,d,f,g,m;e.exports=(o=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,a=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,c={years:r=31536e6,months:s=2592e6,days:864e5,hours:36e5,minutes:6e4,seconds:1e3,milliseconds:1,weeks:6048e5},l=function(e){return e instanceof m},u=function(e,t,i){return new m(e,i,t.$l)},h=function(e){return n.p(e)+"s"},p=function(e){return e<0},d=function(e){return p(e)?Math.ceil(e):Math.floor(e)},f=function(e){return Math.abs(e)},g=function(e,t){return e?p(e)?{negative:!0,format:""+f(e)+t}:{negative:!1,format:""+e+t}:{negative:!1,format:""}},m=function(){function e(e,t,i){var n=this;if(this.$d={},this.$l=i,void 0===e&&(this.$ms=0,this.parseFromMilliseconds()),t)return u(e*c[h(t)],this);if("number"==typeof e)return this.$ms=e,this.parseFromMilliseconds(),this;if("object"==typeof e)return Object.keys(e).forEach(function(t){n.$d[h(t)]=e[t]}),this.calMilliseconds(),this;if("string"==typeof e){var o=e.match(a);if(o){var r=o.slice(2).map(function(e){return Number(e)});return this.$d.years=r[0],this.$d.months=r[1],this.$d.weeks=r[2],this.$d.days=r[3],this.$d.hours=r[4],this.$d.minutes=r[5],this.$d.seconds=r[6],this.calMilliseconds(),this}}return this}var t=e.prototype;return t.calMilliseconds=function(){var e=this;this.$ms=Object.keys(this.$d).reduce(function(t,i){return t+(e.$d[i]||0)*c[i]},0)},t.parseFromMilliseconds=function(){var e=this.$ms;this.$d.years=d(e/r),e%=r,this.$d.months=d(e/s),e%=s,this.$d.days=d(e/864e5),e%=864e5,this.$d.hours=d(e/36e5),e%=36e5,this.$d.minutes=d(e/6e4),e%=6e4,this.$d.seconds=d(e/1e3),e%=1e3,this.$d.milliseconds=e},t.toISOString=function(){var e=g(this.$d.years,"Y"),t=g(this.$d.months,"M"),i=+this.$d.days||0;this.$d.weeks&&(i+=7*this.$d.weeks);var n=g(i,"D"),o=g(this.$d.hours,"H"),r=g(this.$d.minutes,"M"),s=this.$d.seconds||0;this.$d.milliseconds&&(s+=this.$d.milliseconds/1e3);var a=g(s,"S"),c=e.negative||t.negative||n.negative||o.negative||r.negative||a.negative,l=o.format||r.format||a.format?"T":"",u=(c?"-":"")+"P"+e.format+t.format+n.format+l+o.format+r.format+a.format;return"P"===u||"-P"===u?"P0D":u},t.toJSON=function(){return this.toISOString()},t.format=function(e){var t=e||"YYYY-MM-DDTHH:mm:ss",i={Y:this.$d.years,YY:n.s(this.$d.years,2,"0"),YYYY:n.s(this.$d.years,4,"0"),M:this.$d.months,MM:n.s(this.$d.months,2,"0"),D:this.$d.days,DD:n.s(this.$d.days,2,"0"),H:this.$d.hours,HH:n.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:n.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:n.s(this.$d.seconds,2,"0"),SSS:n.s(this.$d.milliseconds,3,"0")};return t.replace(o,function(e,t){return t||String(i[e])})},t.as=function(e){return this.$ms/c[h(e)]},t.get=function(e){var t=this.$ms,i=h(e);return"milliseconds"===i?t%=1e3:t="weeks"===i?d(t/c[i]):this.$d[i],0===t?0:t},t.add=function(e,t,i){var n;return n=t?e*c[h(t)]:l(e)?e.$ms:u(e,this).$ms,u(this.$ms+n*(i?-1:1),this)},t.subtract=function(e,t){return this.add(e,t,!0)},t.locale=function(e){var t=this.clone();return t.$l=e,t},t.clone=function(){return u(this.$ms,this)},t.humanize=function(e){return i().add(this.$ms,"ms").locale(this.$l).fromNow(!e)},t.milliseconds=function(){return this.get("milliseconds")},t.asMilliseconds=function(){return this.as("milliseconds")},t.seconds=function(){return this.get("seconds")},t.asSeconds=function(){return this.as("seconds")},t.minutes=function(){return this.get("minutes")},t.asMinutes=function(){return this.as("minutes")},t.hours=function(){return this.get("hours")},t.asHours=function(){return this.as("hours")},t.days=function(){return this.get("days")},t.asDays=function(){return this.as("days")},t.weeks=function(){return this.get("weeks")},t.asWeeks=function(){return this.as("weeks")},t.months=function(){return this.get("months")},t.asMonths=function(){return this.as("months")},t.years=function(){return this.get("years")},t.asYears=function(){return this.as("years")},e}(),function(e,t,o){i=o,n=o().$utils(),o.duration=function(e,t){var i=o.locale();return u(e,{$l:i},t)},o.isDuration=l;var r=t.prototype.add,s=t.prototype.subtract;t.prototype.add=function(e,t){return l(e)&&(e=e.asMilliseconds()),r.bind(this)(e,t)},t.prototype.subtract=function(e,t){return l(e)&&(e=e.asMilliseconds()),s.bind(this)(e,t)}})});dayjs_min.extend(duration);var ignoreList=["__cep_sdk_onboard","__cep_trigger_sdk","_be_active"],moreOP=["and","or","not"],CepRule=function(){function CepRule(){this.support=!0,this.currentPlan=1,this.shouldSendEvent=!1,this.staing=!1,this.test=!1,this.cepReady=!1,this.eventCache=[]}return CepRule.prototype.apply=function(e,t){var i=this;if(this.collect=e,this.config=t,this.config.cep){var n=e.adapters,o=n.fetch,r=n.storage,s=e.Types;this.types=s,this.storage=new r(!1),this.fetch=o,this.configManager=e.configManager,this.url=t.cep_url?""+t.cep_url:e.configManager.getDomain()+"/service/2/cep_settings/",this.reportUrl=e.configManager.getUrl("event"),this.key="__tea_cep_plan_"+t.app_id,this.quotasKey="__tea_cep_plan_quotas_"+t.app_id,this.isWait=!1,this.eventCache=[],this.test=e.configManager.staging,this.collect.on(s.SubmitAfter,function(e){i.matchEvent(e)}),this.init()}},CepRule.prototype.init=function(){var e=this,t=!0,i=0,n=0,o=0,r=!1,s=this.storage.getItem(this.key)||{};if(s&&Object.keys(s).length&&(r=!0,i=s.last_update_time,n=s.fetch_interval,o=s.config_version||0,t=Date.now()-i>1e3*n),t){var a=this.configManager.get(),c=a.header,l=a.user;this.fetch(this.url,{header:c,user:l,local_time:Date.now(),config_version:o},1e4,!1,function(t){t&&0===t.code?(s.fetch_interval=t.fetch_interval,s.data=t.data,s.last_update_time=Date.now(),s.config_version=t.config_version,e.clearQuotas(),e.initState(t.data),e.storage.setItem(e.key,s),t.data.forEach(function(t){e.event("__cep_sdk_onboard",t.plan_id)})):304!==t.code&&400!==t.code||!r?console.log("code: "+t.code+", request error\uff0cplease try leater"):(console.log("code: "+t.code+", use old rules~"),s.last_update_time=Date.now(),e.storage.setItem(e.key,s),e.initState(s.data))},function(){r?(e.planData=s.data,e.initState(s.data)):(e.support=!1,console.log("request error\uff0cplease try leater"))})}else s.last_update_time=Date.now(),this.storage.setItem(this.key,s),console.log("rule still work, use cache"),this.initState(s.data)},CepRule.prototype.initState=function(e){var t=this;e&&e.length&&(this.stateArray=new Map,this.waitArray=new Map,this.planData=e,e.forEach(function(e){var i=new Map;if(e.pattern&&e.pattern.events){var n=1===e.pattern.events.length;e.pattern.events.forEach(function(e){i.set(e.id,{id:e.id,isMatch:!1,event:null,after:e.after||null,connection:e.connection||null,window:e.window||null,matchTime:0,initTime:Date.now(),singleRule:n})}),t.stateArray.set(e.plan_id,{patternState:i,singleRule:n,pattern:{aid:e.aid,biz_id:e.biz_id,end_time:e.end_time,start_time:e.start_time,web_sdk_version:e.web_sdk_version,stage:e.stage},quotas:e.quotas})}}),this.cepReady=!0,this.dealCache(),this.collect.emit(this.types.CepReady))},CepRule.prototype.check=function(e){var t=Date.now();return Date.now()>1e3*e.end_time?(console.log("event rules:"+e.plan_id+" is over"),!1):t<1e3*e.start_time||t>1e3*e.end_time?(console.log("rule:"+e.plan_id+" time error"),!1):(this.staing="testing"===e.staing,!(SDK_VERSION<e.web_sdk_version)||(this.support=!1,console.log("you sdk version is old\uff0cplease update to "+e.web_sdk_version+" at least"),!1))},CepRule.prototype.dealCache=function(){var e=this;if(this.eventCache.length){var t=1;this.eventCache.forEach(function(i){e.matchEvent(i),t++}),t===this.eventCache.length&&(this.eventCache=[])}},CepRule.prototype.matchEvent=function(e){if(this.support&&(!this.staing||this.test)&&e&&e.length)try{if(!this.cepReady)return void this.eventCache.push(e);var t=e[0],i=t.header,n=t.user,o=t.events;o.length&&o.reverse();for(var r=0;r<o.length;r++){var s=o[r].event;if(-1!==ignoreList.indexOf(s))return!1;this.matchRule(i,n,o[r])}}catch(e){return void console.log(e.message)}},CepRule.prototype.matchRule=function(e,t,i){try{for(var n=0;n<this.planData.length;n++){var o=this.planData[n],r=o.plan_id;if(this.check(o)&&this.checkQuotas(r)&&o.pattern&&o.pattern.events)for(var s=o.pattern.events,a=0;a<s.length;a++)if(this.rule(e,t,i,s[a].condition)){var c=this.stateArray.get(r).patternState,l=c.get(s[a].id);if(this.stateArray.get(r).singleRule){this.changeStatus(r,s[a].id,i),this.publish([i],r,s[a].id);break}if(!l.isMatch){l.after&&c.get(l.after).isMatch?this.changeStatus(r,s[a].id,i):l.after||this.changeStatus(r,s[a].id,i);break}}}this.statusCheck()}catch(e){return void console.log(e.message)}},CepRule.prototype.changeStatus=function(e,t,i){var n=this.stateArray.get(e),o=n.patternState.get(t);o.isMatch=!0,o.event=i,o.matchTime=i.local_time_ms||Date.now(),n.patternState.set(t,o),this.stateArray.set(e,n)},CepRule.prototype.statusCheck=function(){var e,t,i,n;try{for(var o=__values(this.stateArray),r=o.next();!r.done;r=o.next()){var s=__read(r.value,2),a=s[0],c=s[1],l=c.patternState;if(c.isSingle)break;try{for(var u=__values(l),h=u.next();!h.done;h=u.next()){var p=__read(h.value,2),d=p[0],f=p[1];if(f.after&&(!f.after||l.get(f.after).isMatch)){if("NOT_FOLLOWED_BY"===f.connection){f.isMatch?this.reset(a,d):Date.now()-l.get(f.after).matchTime>f.window?this.publish([l.get(f.after).event,f.event],a,d):this.startWait(a,d,f);break}f.isMatch?f.matchTime-l.get(f.after).matchTime<=f.window?this.publish([l.get(f.after).event,f.event],a,d):this.reset(a,d):Date.now()-l.get(f.after).matchTime>f.window?this.reset(a,d):this.startWait(a,d,f);break}}}catch(e){i={error:e}}finally{try{h&&!h.done&&(n=u.return)&&n.call(u)}finally{if(i)throw i.error}}}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}},CepRule.prototype.startWait=function(e,t,i){var n=this;try{this.waitArray.get(e)||this.waitArray.set(e,new Map);var o=this.waitArray.get(e);if(!o.get(t)){var r=setTimeout(function(){var o=n.stateArray.get(e).patternState,r=o.get(t);if("NOT_FOLLOWED_BY"===r.connection)!r.isMatch&&o.get(r.after).isMatch||r.matchTime-o.get(r.after).matchTime>i.window?((s=n.waitArray.get(e).get(t)).triggerWait=!0,n.waitArray.set(e,n.waitArray.get(e).set(t,s)),n.publish([o.get(r.after).event],e,t)):n.reset(e,t);else if("FOLLOWED_BY"===r.connection){var s;r.isMatch&&o.get(r.after).isMatch?((s=n.waitArray.get(e).get(t)).triggerWait=!0,n.waitArray.set(e,n.waitArray.get(e).set(t,s)),n.publish([o.get(r.after).event],e,t)):n.reset(e,t)}},i.window);o.set(t,{waitFn:r,triggerWait:!1}),this.waitArray.set(e,o)}}catch(e){console.log(e.message,e.stack)}},CepRule.prototype.rule=function(e,t,i,n){var o=this;try{var r=i.event,s=i.params;if(s=JSON.parse(s),-1!==moreOP.indexOf(n.op)){if(n.conditions&&n.conditions.length){var a=n.conditions,c=0,l=new Map;l.set(c,{op:n.op,result:void 0,resultList:[],resultKey:[],resultLength:a.length}),function i(n,a){for(var u=0;u<n.length;u++)if(c++,-1!==moreOP.indexOf(n[u].op)&&n[u].hasOwnProperty("conditions"))l.set(c,{op:n[u].op,result:void 0,fatherKey:a,resultList:[],resultKey:[],resultLength:n[u].conditions.length}),i(n[u].conditions,c);else{var h=o.scope(n[u].key),p=h.scope,d=h.key,f=h.key2,g=p?"header"===p?f?JSON.parse(e[f])[d]:e[d]:"user"===p?t[d]:s[d]:r,m=o.calculate(n[u].op,g,n[u].value);l.set(c,{op:n[u].op,result:m,fatherKey:a})}}(a,c);for(var u=l.get(0);void 0===u.result||u.resultList.length<u.resultLength;)l.forEach(function(e,t){if(void 0!==e.result&&void 0!==e.fatherKey){var i=l.get(e.fatherKey);i.resultList.length<i.resultLength&&-1===i.resultKey.indexOf(t)&&(i.resultKey.push(t),i.resultList.push(e.result),l.set(e.fatherKey,i))}}),l.forEach(function(e){e.resultList&&e.resultList.length===e.resultLength&&("and"===e.op&&(e.result=-1===e.resultList.indexOf(!1)),"or"===e.op&&(e.result=-1!==e.resultList.indexOf(!0)))});return l.get(0).result}return!1}var h=this.scope(n.key),p=h.scope,d=h.key,f=h.key2,g=p?"header"===p?f?JSON.parse(e[f])[d]:e[d]:"user"===p?t[d]:s[d]:r;return this.calculate(n.op,g,n.value)}catch(e){return console.log(e.message),!1}},CepRule.prototype.publish=function(e,t,i){try{var n=this.configManager.get().user,o={biz_id:this.stateArray.get(t).pattern.biz_id,plan_id:t,uid:n.user_id||"",did:n.device_id||"",uuid:n.user_unique_id,events:e,extra:{url:window.location.href}};this.collect.emit("__cep_match",o),(window.opener||window.parent).postMessage({type:"__cep_match",data:o},"*"),this.event("__cep_trigger_sdk",t),this.addQuotas(t),this.reset(t,i),console.log(this.stateArray)}catch(e){return void console.log(e.message)}},CepRule.prototype.addQuotas=function(e){var t=this.stateArray.get(e).quotas;if(t&&t.length){var i=this.storage.getItem(this.quotasKey)||{};i[e]||(i[e]={value:0,lastTime:Date.now()});var n=i[e].value;0===n&&(i[e].lastTime=Date.now()),i[e].value=n+1,this.storage.setItem(this.quotasKey,i)}},CepRule.prototype.checkQuotas=function(e){var t=this.stateArray.get(e).quotas,i=this.storage.getItem(this.quotasKey)||{};if(i[e]||(i[e]={value:0,lastTime:Date.now()}),t&&t.length){var n=t[0].granularity,o=t[0].value;if("per_keyid"!==t[0].type)return!0;var r=this.release(n);return"all"===r?!(i[e].value>=o)||(console.log("plan:"+e+" limit"),!1):Date.now()-i[e].lastTime>=r?(i[e].value=0,i[e].lastTime=Date.now(),this.storage.setItem(this.quotasKey,i),!0):!(i[e].value>=o)||(console.log("plan:"+e+" limit"),!1)}return!0},CepRule.prototype.clearQuotas=function(){this.storage.setItem(this.quotasKey,null)},CepRule.prototype.release=function(e){if("all"===e)return e;var t=dayjs_min.duration(e);return t?t.asMilliseconds():"all"},CepRule.prototype.reset=function(e,t){var i=this.stateArray.get(e);if(i.singleRule){var n=i.patternState.get(t);n.isMatch=!1,n.event=null,n.matchTime=0,n.initTime=Date.now(),i.patternState.set(t,n)}else i.patternState.forEach(function(e){e.isMatch=!1,e.event=null,e.matchTime=0,e.initTime=Date.now()});this.stateArray.set(e,i);var o=this.waitArray.get(e);o&&o.get(t)&&(clearTimeout(o.get(t).waitFn),o.delete(t))},CepRule.prototype.event=function(e,t){try{var i={event:e,params:JSON.stringify({plan_id:t||"",biz_id:this.stateArray.get(t).pattern.biz_id}),local_time_ms:Date.now()},n=this.configManager.get(),o=n.header,r=n.user;o.custom=JSON.stringify(o.custom);var s={events:[i],user:r,header:o};this.fetch(this.reportUrl,[s])}catch(e){return void console.log(e.message)}},CepRule.prototype.scope=function(e){var t="",i="";if(e.indexOf(".")>-1){var n=e.split(".");t=n[0],e=n[1],"header"===t&&"custom"===e&&(e=n[2],i=n[1])}return{scope:t,key:e,key2:i}},CepRule.prototype.calculate=function(op,paramA,paramB){try{if("="===op)return paramA===paramB;if(-1!==["=","<",">",">=","<=","!="].indexOf(op))return eval(""+paramA+op+paramB);if(-1!==["in","contains"].indexOf(op))return-1!==paramB.indexOf(paramA);if(-1!==["is not null","is null"].indexOf(op))return"is null"===op?null==paramA:null!=paramA;if(-1!==["startswith","endswith"].indexOf(op)){if("startswith"===op)return 0===paramA.indexOf(paramB);var start=paramA.length-paramB.length,str=paramA.substr(start,paramB.length);return str===paramB}}catch(e){return console.log(e.message),!1}},CepRule}(),getLogPluginSpace=function(){return"undefined"!=typeof window?(window.LogPluginObject||(window.LogPluginObject={}),window.LogPluginObject):null},pluginObject=getLogPluginSpace(),PluginExtend=function(){function e(){}return e.prototype.apply=function(e,t){this._plugin={},this.config=t,this.collect=e,this.channel=t.channel||"cn",this.loadExtend()},e.prototype.loadExtend=function(){var e=this;try{this.collect.remotePlugin.forEach(function(t,i){if("sdk"===t)if(pluginExtendList.hasOwnProperty(i)){var n=pluginExtendList[i].object,o=pluginExtendList[i].src[e.channel]+"?query="+Date.now();e.exist(i,n,o)}else console.warn("your"+i+" is not exist\uff0cplease check plugin name");else"object"==typeof t&&(t.src?e.exist(i,t.call,t.src):e.process(i,t.instance,"INSTANCE"))})}catch(e){console.log("load extend error")}},e.prototype.exist=function(e,t,i){var n=this;pluginObject[t]?this.process(e,pluginObject[t]):this.loadPlugin(e,i,function(){n.process(e,pluginObject[t]),console.log("load "+e+" success")},function(){console.log("load "+e+" error")})},e.prototype.process=function(e,t,i){try{if(i){var n=new t;n.apply&&n.apply(this.collect,this.config),console.log("excude "+e+" success")}else t&&t(this.collect,this.config)}catch(t){console.log("excude "+e+" error, message:"+t.message)}},e.prototype.loadPlugin=function(e,t,i,n){var o=this;try{var r=document.createElement("script");r.src=t,this._plugin[e]||(this._plugin[e]=[]),this._plugin[e].push(i),r.onerror=function(){n(t)},r.onload=function(){o._plugin[e].forEach(function(e){e()})},document.getElementsByTagName("head")[0].appendChild(r)}catch(e){}},e}(),Verify=function(){function e(){this.verifyReady=!1,this.waitTime=5e3,this.cleanStatus=!1}return e.prototype.apply=function(e,t){var i=this;this.collector=e,this.config=t;var n=e.adapters.storage;this.cacheStorgae=new n(!1,"session"),this.eventStorage=[],this.collector.on("submit-verify",function(e){e&&e.length&&i.eventStore(e[0])}),this.checkCache()},e.prototype.checkCache=function(){var e=this;this.verifyCookieKey="__applog_verify_set_"+this.config.app_id,this.cacheStorgae.getCookie(this.verifyCookieKey);var t=this.cacheStorgae.getItem(this.verifyCookieKey);this.sign=t&&t.sign||"",this.origin=t&&t.origin||"*";var i=setTimeout(function(){e.cleanVerify(),clearTimeout(i),e.collector.off("submit-verify")},this.waitTime);window.addEventListener("message",function(t){t&&t.data&&"simulator:verify"===t.data.type&&(clearTimeout(i),e.receMessage(t))},!0)},e.prototype.receMessage=function(e){if(!this.cleanStatus){var t=e.data;this.verifyReady=!0,this.sign=t.sign,this.origin=e.origin,this.cacheStorgae.setItem(this.verifyCookieKey,JSON.stringify({sign:t.sign,origin:e.origin})),this.eventStorage.length&&this.postVerify(this.eventStorage,t.sign,e.origin)}},e.prototype.eventStore=function(e){this.cleanStatus||(this.verifyReady?this.postVerify(e,this.sign,this.origin):this.eventStorage.push(e))},e.prototype.cleanVerify=function(){this.cleanStatus=!0,this.eventStorage=[]},e.prototype.postVerify=function(e,t,i){try{var n=[];isArray(e)?e.forEach(function(e){n.push(e)}):n.push(e);var o={type:"simulator:verify:event",sign:t,pageUrl:window.location.href,events:n};(window.opener||window.parent).postMessage(o,i)}catch(e){console.log("web verify post message error ~")}},e}(),RuotePage=function(){function e(){this.autotrack=!1,this.spa=!1,this.cache={}}return e.prototype.apply=function(e,t){if(t.spa||t.autotrack){var i=e.Types;this.collect=e,this.config=t,this.appid=t.app_id,this.fncArray=new Map,this.setKey(),this.setLocation(),this.hack(),this.init(),this.listener(),e.emit(i.RouteReady)}},e.prototype.setKey=function(){var e=this.collect.adapters.storage;this.storage=new e(!1),this.cache_key="__tea_cache_refer_"+this.appid,this.cache={refer_key:location.href,refer_title:document.title||location.pathname,refer_manual_key:""},this.config.autotrack&&"object"==typeof this.config.autotrack&&this.config.autotrack.page_manual_key&&(this.cache.refer_manual_key=this.config.autotrack.page_manual_key),this.storage.setItem(this.cache_key,this.cache)},e.prototype.hack=function(){var e=this,t=window.history.pushState;history.pushState=function(i){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];"function"==typeof history.onpushstate&&history.onpushstate({state:i});var r=t.call.apply(t,__spread([history,i],n)),s=e.getPopStateChangeEventData();return e.lastLocation=stringify(location.href,n[1]),e.sendPv(s,"pushState"),r};var i=history.replaceState;history.replaceState=function(t){for(var n=[],o=1;o<arguments.length;o++)n[o-1]=arguments[o];"function"==typeof history.onreplacestate&&history.onreplacestate({state:t});var r=i.call.apply(i,__spread([history,t],n)),s=e.getPopStateChangeEventData();return e.lastLocation=stringify(location.href,n[1]),e.sendPv(s),r}},e.prototype.setLocation=function(){"undefined"!=typeof window&&(this.lastLocation=window.location.href)},e.prototype.init=function(){var e=this.getPopStateChangeEventData();this.collect.emit("route-change",{config:e,init:!0})},e.prototype.listener=function(){var e=this,t=null;window.addEventListener("hashchange",function(i){e.lastLocation!==window.location.href&&clearTimeout(t)}),window.addEventListener("popstate",function(i){e.lastLocation!==window.location.href&&(t=setTimeout(function(){e.lastLocation=window.location.href;var t=e.getPopStateChangeEventData();e.sendPv(t)},10))})},e.prototype.getPopStateChangeEventData=function(){var e=this.pageConfig();return e.is_back=0,e},e.prototype.pageConfig=function(){try{var e,t,i=this.storage.getItem(this.cache_key)||{};e=document.referrer?document.referrer:i&&i.refer_key||"";var n=this.storage.getItem("__tea_cache_first_"+this.appid);return t=!n||1!=n,{is_html:1,url:location.href,referrer:e,page_key:location.href,refer_page_key:e,page_title:document.title||location.pathname,page_manual_key:this.config.autotrack&&this.config.autotrack.page_manual_key||"",refer_page_manual_key:i&&i.refer_manual_key||"",refer_page_title:i&&i.refer_title||"",page_path:location.pathname,page_host:location.host,is_first_time:""+t}}catch(e){return{}}},e.prototype.sendPv=function(e,t){this.collect.emit("route-change",{config:e,init:!1})},e}();Collector.usePlugin(PluginExtend,"extend"),Collector.usePlugin(Ab,"ab"),Collector.usePlugin(Stay,"stay"),Collector.usePlugin(AutoTrack,"autotrack"),Collector.usePlugin(Verify,"verify"),Collector.usePlugin(Et,"et"),Collector.usePlugin(Profile,"profile"),Collector.usePlugin(CepRule,"cep"),Collector.usePlugin(HeartBeat,"heartbeat"),Collector.usePlugin(Monitor,"monitor"),Collector.usePlugin(RuotePage,"route"),Collector.usePlugin(Tracer,"tracer");var Tea=new Collector("default"),Collector$1=Collector;__webpack_exports__.default=Tea}.call(this,__webpack_require__(33))}}]);