@datarangers/sdk-javascript 0.0.3-lite → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ "use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},e.apply(this,arguments)},t=function(e){return Array.isArray(e)};Date.now(),Number((""+Math.random()).slice(2,8));function n(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;if(e.hasAttribute&&s(e,"ss"))return!0}return!1}var i=function(e,t){return!!s(e,t)};function o(e){for(var t=e;t&&!n(t,"container");){if("HTML"===t.nodeName||"BODY"===t.nodeName)return e;t=t.parentElement}return t||e}function r(e){var t="";return 3===e.nodeType?t=e.textContent.trim():e.dataset&&e.dataset.hasOwnProperty("teaTitle")||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)}var a=function(e,t){return e.hasAttribute?e.hasAttribute(t):e.attributes?!(!e.attributes[t]||!e.attributes[t].specified):void 0},s=function(e,n){if("string"==typeof n)return a(e,n);if(t(n)){for(var i=!1,o=0;o<n.length;o++){if(a(e,n[o])){i=!0;break}}return i}};var c=function(){function t(t,o,r){var a=this;this.clickEvent=function(e){(function(e,t){if(1!==e.nodeType)return!1;if(!t.svg&&function(e){if("svg"===e.tagName.toLowerCase())return!0;for(var t=e.parentElement,n=!1;t;)"svg"===t.tagName.toLowerCase()?(t=null,n=!0):t=t.parentElement;return n}(e))return!1;if(["HTML","BODY"].includes(e.tagName.toUpperCase()))return!1;var o=e;return!!("none"!==o.style.display&&(n(o,"container")||t.track_attr&&i(o,t.track_attr)||function(e){if(e.children.length){var t=e.children;return![].slice.call(t).some((function(e){return e.children.length>0}))}return!0}(o)))})(e.target,a.options)&&a.eventHandel({eventType:"dom",eventName:"click"},e)},this.changeEvent=function(e){a.eventHandel({eventType:"dom",eventName:"change"},e)},this.submitEvent=function(e){a.eventHandel({eventType:"dom",eventName:"submit"},e)},this.getPageViewEvent=function(t,n){n&&"pushState"===n&&a.eventHandel({eventType:"dom",eventName:"beat"},e({beat_type:0},t)),a.eventHandel({eventType:"dom",eventName:"page_view"},t)},this.getPageLoadEvent=function(e){a.eventHandel({eventType:"dom",eventName:"page_statistics"},{lcp:e})},this.config=r.getConfig().eventConfig,this.collect=o,this.options=t,this.beatTime=t.beat,this.statistics=!1}return t.prototype.init=function(e){this.eventHandel=e;var t=this.config.mode;this.addListener(t)},t.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 n=e.config,i=e.name;t.getPageViewEvent(n,i)})),this.config.beat)){try{"complete"===document.readyState?this.beatEvent(this.beatTime):window.addEventListener("load",(function(){t.beatEvent(t.beatTime)}));var n=0,i=null;window.addEventListener("scroll",(function(){clearTimeout(i),i=setTimeout(o,500),n=document.documentElement.scrollTop||document.body.scrollTop}));var o=function(){(document.documentElement.scrollTop||document.body.scrollTop)==n&&t.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:1})}}catch(e){}try{var r=window.performance&&window.performance.getEntriesByType("paint");if(r&&r.length){var a=new PerformanceObserver((function(e){var n=e.getEntries(),i=n[n.length-1],o=i.renderTime||i.loadTime;t.statistics||(t.getPageLoadEvent(o),t.statistics=!0)}));a.observe({entryTypes:["largest-contentful-paint"]}),setTimeout((function(){t.statistics||(t.getPageLoadEvent(r[0].startTime||0),t.statistics=!0)}),2e3)}else this.getPageLoadEvent(0)}catch(e){this.getPageLoadEvent(0)}}},t.prototype.removeListener=function(){window.document.removeEventListener("click",this.clickEvent,!0),window.document.removeEventListener("change",this.changeEvent,!0),window.document.removeEventListener("submit",this.submitEvent,!0)},t.prototype.beatEvent=function(e){var t,n=this;try{var i;this.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:3}),this.beatTime&&(i=setInterval((function(){n.eventHandel({eventType:"dom",eventName:"beat"},{beat_type:2})}),e)),t=function(){n.eventHandel({eventType:"dom",eventName:"beat",eventSend:"becon"},{beat_type:0}),n.beatTime&&clearInterval(i)},navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",t,!1):window.addEventListener("beforeunload",t,!1)}catch(e){}},t}(),u={eventConfig:{mode:"proxy-capturing",submit:!1,click:!0,change:!1,pv:!0,beat:!0,hashTag:!1,impr:!1},scoutConfig:{mode:"xpath"}},d=function(){function e(e,t){this.config=e,this.config.eventConfig=Object.assign(this.config.eventConfig,t)}return e.prototype.getConfig=function(){return this.config},e.prototype.setConfig=function(e){return this.config=e},e}();function l(e){for(var t=[];null!==e.parentElement;)t.push(e),e=e.parentElement;var i=[],o=[];return t.forEach((function(e){var t=function(e){if(null===e)return{str:"",index:0};var t=0,i=e.parentElement;if(i)for(var o=i.children,r=0;r<o.length&&o[r]!==e;r++)o[r].nodeName===e.nodeName&&t++;return{str:[e.nodeName.toLowerCase(),n(e,"list")?"[]":""].join(""),index:t}}(e),r=t.str,a=t.index;i.unshift(r),o.unshift(a)})),{element_path:"/"+i.join("/"),positions:o}}function p(e,n,s,c){var u={},d=function(e){if(e){var t=e.getBoundingClientRect(),n=t.width,i=t.height;return{left:t.left,top:t.top,element_width:n,element_height:i}}}(n),p=function(e,t){void 0===e&&(e={}),void 0===t&&(t={});var n=e.clientX,i=e.clientY,o=t.left,r=t.top,a=n-o>=0?n-o:0,s=i-r>=0?i-r:0;return{touch_x:Math.floor(a),touch_y:Math.floor(s)}}(e,d),h=d.element_width,v=d.element_height,f=p.touch_x,g=p.touch_y,m=l(n),_=m.element_path,b=m.positions,y=function(e){var t=o(e),n=[];return function e(t){var i=r(t);if(i&&-1===n.indexOf(i)&&n.push(i),t.childNodes.length>0)for(var o=t.childNodes,a=0;a<o.length;a++)8!==o[a].nodeType&&e(o[a])}(t),n}(n),w=window.performance.timing.navigationStart,E=Date.now()-w,T=b.map((function(e){return""+e})),x=null;if(window.TEAVisualEditor.getOriginXpath&&(x=window.TEAVisualEditor.getOriginXpath({xpath:_,positions:T})),u.element_path=x&&x.xpath||_,u.positions=x&&x.positions||T,c&&!c.text&&(u.texts=y,u.element_title=function(e){var t=o(e),n="";return function e(t){var i=r(t);if(i&&(n+=i),t.childNodes.length>0)for(var o=t.childNodes,a=0;a<o.length;a++)3===o[a].nodeType&&e(o[a])}(t),n}(n)),u.element_id=n.getAttribute("id")||"",u.element_class_name=n.getAttribute("class")||"",u.element_type=n.nodeType,u.element_width=Math.floor(h),u.element_height=Math.floor(v),u.touch_x=f,u.touch_y=g,u.page_manual_key="",u.elememt_manual_key="",u.since_page_start_ms=E,u.page_start_ms=w,u.page_path=location.pathname,u.page_host=location.host,s.track_attr&&i(n,s.track_attr)){var A=function(e,n){var i={};if("string"==typeof n)a(e,n)&&(i.attrs=e.getAttribute(n));else if(t(n))for(var o=0;o<n.length;o++)a(e,n[o])&&(i[n[o]]=e.getAttribute(n[o]));return i}(n,s.track_attr);for(var k in A)u[k]=A[k]}var N=o(n);return"A"===N.tagName&&(u.href=N.getAttribute("href")),"IMG"===n.tagName&&(u.src=n.getAttribute("src")),u}var h=function(t,n,i,o,r){return e({event:t},p(n,i,o,r),{is_html:1,page_key:window.location.href,page_title:document.title})},v=function(){function t(e,t){this.ignore={text:!1},this.initConfig=e,this.options=t,this.eventName=t&&"tea"===t.custom?{click:"__bav_click",page:"__bav_page",beat:"__bav_beat",static:"__bav_page_statistics",exposure:"__bav_page_exposure"}:{click:"bav2b_click",page:"bav2b_page",beat:"bav2b_beat",static:"bav2b_page_statistics",exposure:"bav2b_exposure"},t&&!1===t.text&&(this.ignore.text=!0),t&&t.exposure&&t.exposure.eventName&&(this.eventName.exposure=t.exposure.eventName)}return t.prototype.handleEvent=function(t,n){try{if(function(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}(t.target))return null;var i="bav2b_click";switch(n){case"click":return i=this.eventName.click,h(i,t,t.target,this.options,this.ignore);case"exposure":return i=this.eventName.exposure,h(i,t,t.target,this.options,this.ignore);case"change":return e({},h(i="bav2b_change",t,t.target,this.options),function(e,t){try{if("bav2b_change"===e)return t.hasAttribute("data-tea-track")?{value:t.value}:{}}catch(e){return{}}}(i,t.target));case"submit":return h(i="bav2b_submit",t,t.target,this.options)}}catch(e){return console.error(e),null}},t.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 n=JSON.parse(t);e.refer_page_duration_ms=n?n.duration:""}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},t.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 n=e.lcp,i=window.performance.timing,o=i.loadEventEnd-i.navigationStart;t.page_init_cost_ms=parseInt(n||(o>0?o:0)),t.page_start_ms=i.navigationStart}catch(e){console.log("page_statistics event error "+JSON.stringify(e))}return t},t.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},t}(),f=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 n=e.eventSend,i=t.event;delete t.event,n&&"becon"===n?this.collect.beconEvent(i,t):this.collect.event(i,t)},e.prototype.get=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"GET"},t);fetch(e,n)},e.prototype.post=function(e,t){var n=Object.assign({headers:{"content-type":"application/json"},method:"POST"},t);fetch(e,n)},e}(),g={},m=[];function _(e,t,n,i){var o=e&&e.source||window.opener||window.parent,r=e&&e.origin||i||"*",a={type:t,payload:n};o.postMessage(JSON.stringify(a),r)}function b(e,t){g[e]=g[e]||[],g[e].push(t)}function y(e){if(m.some((function(e){return"*"===e}))||m.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 n=t.type,i=t.payload;g[n]&&g[n].forEach((function(t){"function"==typeof t&&t(e,i)}))}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var w=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e,t){e.exports=function(){function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)e[i]=n[i]}return e}function t(n,i){function o(t,o,r){if("undefined"!=typeof document){"number"==typeof(r=e({},i,r)).expires&&(r.expires=new Date(Date.now()+864e5*r.expires)),r.expires&&(r.expires=r.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var s in r)r[s]&&(a+="; "+s,!0!==r[s]&&(a+="="+r[s].split(";")[0]));return document.cookie=t+"="+n.write(o,t)+a}}function r(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],i={},o=0;o<t.length;o++){var r=t[o].split("="),a=r.slice(1).join("=");try{var s=decodeURIComponent(r[0]);if(i[s]=n.read(a,s),e===s)break}catch(e){}}return e?i[e]:i}}return Object.create({set:o,get:r,remove:function(t,n){o(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(i)},converter:{value:Object.freeze(n)}})}return t({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()})),E=w;function T(){try{var e=window.TEAVisualEditor.lang=window.TEAVisualEditor.lang||E.get("lang"),t=window.TEAVisualEditor.__editor_ajax_domain=window.TEAVisualEditor.__editor_ajax_domain||E.get("_TEA_VE_APIHOST"),n=window.TEAVisualEditor.__editor_verison=window.TEAVisualEditor.__editor_verison||E.get("_VISUAL_EDITOR_V"),i=window.TEAVisualEditor.__editor_url=window.TEAVisualEditor.__editor_url||E.get("_VISUAL_EDITOR_U"),o=+new Date,r=new Date(o+18e5);E.set("_TEA_VE_OPEN","1",{expires:r}),E.set("_TEA_VE_APIHOST",t,{expires:r}),E.set("_VISUAL_EDITOR_U",i,{expires:r}),E.set("lang",e,{expires:r}),E.set("_VISUAL_EDITOR_V",n||"",{expires:r})}catch(e){console.log("set cookie err")}}var x=!1;function A(e){var t,n,i,o,r=e.event,a=e.editorUrl,s=e.autoTrackInstance;x||(x=!0,t=a,n=function(){_(r,"editorScriptloadSuccess"),s.destroy()},i=function(){r&&_(r,"editorScriptloadError"),x=!1},(o=document.createElement("script")).src=t,o.onerror=function(){i(t)},o.onload=function(){n()},document.getElementsByTagName("head")[0].appendChild(o))}function k(t,n){window.TEAVisualEditor=window.TEAVisualEditor||{};var i="",o="https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/visual-editor-rangers.js?query="+Date.now();window.TEAVisualEditor.appId=n.app_id;var r,a,s,c=n.channel_domain,u="";if((r=["*"]).length&&r.forEach((function(e){m.push(e)})),c){var d,l="";try{var p=window.performance.getEntriesByType("resource");if(p&&p.length&&(p.forEach((function(e){"script"===e.initiatorType&&e.name&&-1!==e.name.indexOf("collect")&&(l=e.name)})),l||document.currentScript&&(l=document.currentScript.src),l&&(d=l.split("/"))&&d.length)){u="https:/";for(var h=2;h<d.length&&h!==d.length-1;h++)u=u+"/"+d[h];if(u&&u.indexOf("/5.0")){var v=u.split("/5.0");u=v[0]||u}}}catch(e){}}if(a="0.0.4",(s=e({},n)).filter&&delete s.filter,"object"==typeof s.autotrack&&s.autotrack.collect_url&&delete s.autotrack.collect_url,(window.opener||window.parent).postMessage({type:"tea:sdk:info",config:s,version:a},"*"),window.addEventListener("message",y,!1),"1"===E.get("_TEA_VE_OPEN")){var f=function(){var e=E.get("_TEA_VE_APIHOST");try{e=JSON.parse(e)}catch(e){}return e}(),g="";f&&(window.TEAVisualEditor.__editor_ajax_domain=f,g=E.get("_VISUAL_EDITOR_U")),A({event:null,editorUrl:g||o,autoTrackInstance:t}),T()}else try{b("tea:openVisualEditor",(function(e){var n=e.data;if("string"==typeof e.data)try{n=JSON.parse(e.data)}catch(e){n=void 0}if(n){var r=n.referrer,a=n.lang;if(r&&(window.TEAVisualEditor.__editor_ajax_domain=r),i=o,c){var s=n.version;i=u?""+u+(s?"/visual-editor-rangers-v"+s:"/visual-editor-rangers-v1.0.0")+".js":o,window.TEAVisualEditor.__editor_verison=s}window.TEAVisualEditor.__editor_url=i,window.TEAVisualEditor.lang=a,A({event:e,editorUrl:i,autoTrackInstance:t}),T()}})),window.TEAVisualEditor.openAutotrackEditor=function(){A({event:null,editorUrl:window.TEAVisualEditor.__editor_url,autoTrackInstance:t})}}catch(e){console.log("receive message error")}try{b("tea:openHeatMapCore",(function(e){A({event:e,editorUrl:"https://lf3-data.volccdn.com/obj/data-static/log-sdk/collect/heatmap-core.js?query="+Date.now(),autoTrackInstance:t})}))}catch(e){console.log("openHeatMapCore error")}}var N=function(){function e(e){this._instance=null,this._intersection=e,this._intersection&&this.init()}return e.prototype.init=function(){var e=this;MutationObserver?(this._instance=new MutationObserver((function(t){t.forEach((function(t){"attributes"===t.type&&e.attributeChangeObserve(t),"childList"===t.type&&e.modifyNodeObserve(t)}))})),this._instance.observe(document.body,{childList:!0,attributes:!0,subtree:!0,attributeOldValue:!1})):console.log("your browser cannot support MutationObserver")},e.prototype.attributeChangeObserve=function(e){e.target.hasAttribute("data-exposure")?this.exposureAdd(e,"mutation"):this.exposureRemove(e)},e.prototype.modifyNodeObserve=function(e){var t=this;Array.prototype.forEach.call(e.addedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureAdd(e,"intersect"),t.mapChild(e,t.exposureAdd)})),Array.prototype.forEach.call(e.removedNodes,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t.exposureRemove(e),t.mapChild(e,t.exposureRemove)}))},e.prototype.mapChild=function(e,t){var n=this;1===e.nodeType&&e.children.length&&Array.prototype.forEach.call(e.children,(function(e){1===e.nodeType&&e.hasAttribute("data-exposure")&&t(e),n.mapChild(e,t)}))},e.prototype.exposureAdd=function(e,t){try{this._intersection&&this._intersection.exposureAdd(e,t)}catch(e){console.log("intersection error",JSON.stringify(e.message))}},e.prototype.exposureRemove=function(e){try{this._intersection&&this._intersection.exposureRemove(e)}catch(e){console.log("intersection error",JSON.stringify(e.message))}},e._exposure_observer=null,e}(),O=function(){function e(t,n){this.count=1,this.instance=this.buildObserver(),this.observeMap=e._observer_map,t.autotrack.exposure.ratio?this.Ratio=t.autotrack.exposure.ratio:0===t.autotrack.exposure.ratio?this.Ratio=0:this.Ratio=.5,this.EventHandle=n}return e.prototype.buildObserver=function(){var t=this;return e._observer_instance?(console.log("your browser cannot support IntersectionObserver"),null):(IntersectionObserver&&(e._observer_instance=new IntersectionObserver((function(e){e.forEach((function(e){t.observeMap.get(e.target._observeId)&&t.exposureEvent(e)}))}),{threshold:[.01,.25,.5,.75,1]})),e._observer_instance)},e.prototype.exposureAdd=function(e,t){var n=e;"mutation"===t&&(n=e.target);var i=n._observeId;if(i||this.observeMap.has(i)){if(!1===n.visible){var o=n.getBoundingClientRect(),r=o.top,a=o.left,s=o.right,c=o.bottom;r>=0&&c<=window.innerHeight&&a>=0&&s<=window.innerWidth&&(n.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e))}}else n._observeId=this.count,n.visible=!1,this.observeMap.set(this.count,n),this.observe(n),this.count++},e.prototype.exposureRemove=function(e){this.observeMap.has(e._observeId)&&(this.observeMap.delete(e._observeId),this.unobserve(e))},e.prototype.exposureEvent=function(e){if(e.intersectionRatio>=this.Ratio&&e.isIntersecting){if("0"===e.target.style.opacity||"hidden"===e.target.style.visibility)return;if(!0===e.target.visible)return;e.target.visible=!0,this.EventHandle({eventType:"dom",eventName:"exposure"},e)}else e.target.visible=!1},e.prototype.observe=function(e){this.instance&&this.instance.observe(e)},e.prototype.unobserve=function(e){this.instance&&this.instance.unobserve(e)},e._observer_instance=null,e._observer_map=new Map,e}(),S=function(){function e(e,t){e.autotrack&&e.autotrack.exposure&&(this._intersection=new O(e,t),this._observer=new N(this._intersection),this._intersection&&this._observer?this.initObserver():console.log("your browser version cannot support exposure, please update~"))}return e.prototype.initObserver=function(){var e=this;Array.prototype.forEach.call(document.querySelectorAll("[data-exposure]"),(function(t){e._intersection.exposureAdd(t,"intersect")}))},e}(),I={hashTag:!1,impr:!1},C=function(){function e(){}return e.prototype.apply=function(e,t){if(this.autoTrackStart=!1,this.collect=e,this.config=t,t.autotrack){var n=e.Types;t.autotrack&&t.autotrack.collect_url&&!t.autotrack.collect_url()||(this.ready(n.Autotrack),this.collect.emit(n.AutotrackReady))}},e.prototype.ready=function(e){this.collect.set(e);var t=this.config.autotrack;t="object"==typeof t?t:{},t=Object.assign(I,t),this.destroyed=!1,this.options=t,this.Config=new d(u,this.options),this.Exposure=new S(this.config,this.handle.bind(this)),this.Listener=new c(t,this.collect,this.Config),this.EventHandle=new v(this.config,t),this.Request=new f(this.collect),this.autoTrackStart=!0,this.init(),k(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 n=e.eventName;if("click"===n||"exposure"===n||"change"===n||"submit"===n){var i=this.EventHandle.handleEvent(t,n);null!==i&&this.Request.send({eventType:"custom",eventName:"report_"+n+"_event",extra:{methods:"GET"}},i)}else if("page_view"===n||"page_statistics"===n){var o=void 0;o="page_view"===n?this.EventHandle.handleViewEvent(t):this.EventHandle.handleStatisticsEvent(t),this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"}},o)}else if("beat"===n){var r=this.EventHandle.handleBeadtEvent(t),a=e.eventSend;this.Request.send({eventType:"custom",eventName:"report_${eventName}_event",extra:{methods:"GET"},eventSend:a},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}();module.exports=C;
@@ -0,0 +1 @@
1
+ "use strict";var t=function(){function t(){}return t.prototype.apply=function(t,a){var e=this;this.collector=t,this.config=a;var r=t.Types;t.on(r.TrackDurationStart,(function(t){e.trackStart(t)})),t.on(r.TrackDurationEnd,(function(t){e.trackEnd(t)})),t.on(r.TrackDurationPause,(function(t){e.trackPause(t)})),t.on(r.TrackDurationResume,(function(t){e.trackResume(t)})),this.Types=r,this.TrackMap=new Map,this.ready(r.TrackDuration)},t.prototype.ready=function(t){var a=this;if(this.collector.set(t),this.collector.hook._hooksCache.hasOwnProperty(t)){var e=this.collector.hook._hooksCache[t];if(!Object.keys(e).length)return;var r=function(t){e[t].length&&e[t].forEach((function(e){a.collector.hook.emit(t,e)}))};for(var o in e)r(o)}},t.prototype.trackStart=function(t){this.TrackMap.set(t,{startTime:Date.now(),isPause:!1,pauseTime:0,resumeTime:0})},t.prototype.trackEnd=function(t){var a=t.eventName,e=t.params;if(this.TrackMap.has(a)){var r=this.TrackMap.get(a),o=0;o=r.isPause?r.pauseTime-r.startTime:r.resumeTime?r.pauseTime-r.startTime+(Date.now()-r.resumeTime):Date.now()-r.startTime;var i=Object.assign(e,{event_duration:o});this.collector.event(a,i),this.cleanTrack(a)}},t.prototype.trackPause=function(t){if(this.TrackMap.has(t)){var a=this.TrackMap.get(t);a.isPause||(a.isPause=!0,a.pauseTime=Date.now(),this.TrackMap.set(t,a))}},t.prototype.trackResume=function(t){if(this.TrackMap.has(t)){var a=this.TrackMap.get(t);a.isPause&&(a.isPause=!1,a.resumeTime=Date.now(),this.TrackMap.set(t,a))}},t.prototype.cleanTrack=function(t){this.TrackMap.delete(t)},t}();module.exports=t;
@@ -0,0 +1 @@
1
+ "use strict";function e(e,t){var a="function"==typeof Symbol&&e[Symbol.iterator];if(!a)return e;var o,r,n=a.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(a=n.return)&&a.call(n)}finally{if(r)throw r.error}}return i}function t(){for(var t=[],a=0;a<arguments.length;a++)t=t.concat(e(arguments[a]));return t}var a,o;!function(e){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.AnonymousId="anonymous-id",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.SubmitVerifyH="submit-verify-h5",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.AbTimeout="ab-timeout",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.TrackDuration="track-duration",e.TrackDurationStart="track-duration-start",e.TrackDurationEnd="track-duration-end",e.TrackDurationPause="track-duration-pause",e.TrackDurationResume="tracl-duration-resume",e.Autotrack="autotrack",e.AutotrackReady="autotrack-ready",e.CepReady="cep-ready",e.TracerReady="tracer-ready"}(a||(a={})),function(e){e.DEBUGGER_MESSAGE="debugger-message",e.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",e.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",e.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",e.DEBUGGER_MESSAGE_EVENT="debugger-message-event",e.DEVTOOL_WEB_READY="devtool-web-ready"}(o||(o={}));var r=function(){function e(){this.autotrack=!1,this.spa=!1,this.cache={},this.allowHash=!1}return e.prototype.apply=function(e,t){if(t.spa||t.autotrack){var a=e.Types;this.collect=e,this.config=t,this.appid=t.app_id,this.allowHash=t.allow_hash,this.fncArray=new Map,this.setKey(),this.setLocation(),this.hack(),this.init(),this.listener(),e.emit(a.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:"",refer_title:document.title||location.pathname,refer_manual_key:"",routeChange:!1},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,a=window.history.pushState;history.pushState=function(o){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];"function"==typeof history.onpushstate&&history.onpushstate({state:o});var i=a.call.apply(a,t([history,o],r));if(e.lastLocation!==location.href){var s=e.getPopStateChangeEventData();return e.setReferCache(e.lastLocation),e.lastLocation=location.href,e.sendPv(s,"pushState"),i}};var o=history.replaceState;history.replaceState=function(a){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];"function"==typeof history.onreplacestate&&history.onreplacestate({state:a});var i=o.call.apply(o,t([history,a],r));if(e.lastLocation!==location.href){var s=e.getPopStateChangeEventData();return e.setReferCache(e.lastLocation),e.lastLocation=location.href,e.sendPv(s),i}}},e.prototype.setLocation=function(){"undefined"!=typeof window&&(this.lastLocation=window.location.href)},e.prototype.getLocation=function(){return this.lastLocation},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(a){if(e.lastLocation!==window.location.href&&(clearTimeout(t),e.allowHash)){e.setReferCache(e.lastLocation),e.lastLocation=window.location.href;var o=e.getPopStateChangeEventData();e.sendPv(o)}})),window.addEventListener("popstate",(function(a){e.lastLocation!==window.location.href&&(t=setTimeout((function(){e.setReferCache(e.lastLocation),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=this.storage.getItem(this.cache_key)||{},t=!1,a=this.storage.getItem("__tea_cache_first_"+this.appid);return t=!a||1!=a,{is_html:1,url:location.href,referrer:this.handleRefer(),page_key:location.href,refer_page_key:this.handleRefer(),page_title:document.title||location.pathname,page_manual_key:this.config.autotrack&&this.config.autotrack.page_manual_key||"",refer_page_manual_key:e&&e.refer_manual_key||"",refer_page_title:e&&e.refer_title||"",page_path:location.pathname,page_host:location.host,is_first_time:""+t}}catch(e){return this.collect.emit(o.DEBUGGER_MESSAGE,{type:o.DEBUGGER_MESSAGE_SDK,info:"发生了异常",level:"error",time:Date.now(),data:e.message}),{}}},e.prototype.sendPv=function(e,t){this.collect.emit("route-change",{config:e,init:!1})},e.prototype.handleRefer=function(){var e="";try{var t=this.storage.getItem()||{};e=t.routeChange?t.refer_key:this.collect.configManager.get("referrer")}catch(t){e=document.referrer}return e},e.prototype.setReferCache=function(e){var t=this.storage.getItem(this.cache_key)||{};t.refer_key=e,t.routeChange=!0,this.storage.setItem(this.cache_key,t)},e}();module.exports=r;
@@ -0,0 +1 @@
1
+ "use strict";var t=function(){return t=Object.assign||function(t){for(var e,i=1,a=arguments.length;i<a;i++)for(var s in e=arguments[i])Object.prototype.hasOwnProperty.call(e,s)&&(t[s]=e[s]);return t},t.apply(this,arguments)},e=function(t){return null!=t&&"[object Object]"==Object.prototype.toString.call(t)};Date.now(),Number((""+Math.random()).slice(2,8));var i,a,s=function(){var t=0;return["hidden","msHidden","webkitHidden"].forEach((function(e){void 0!==document[e]&&(t=1)})),t},n=function(){function i(t,i){this.maxDuration=432e5,this.aliveDTime=6e4,this.options={aliveName:"predefine_page_alive",params:{}},this.collect=t,this.config=i,this.pageStartTime=Date.now(),this.sessionStartTime=this.pageStartTime,this.timerHandler=null,e(i.enable_stay_duration)&&(this.options=Object.assign(this.options,i.enable_stay_duration))}return i.prototype.setParams=function(t,e,i){this.set_path=t,this.set_url=i,this.set_title=e},i.prototype.resetParams=function(t,e,i){this.url_path=t,this.url=i,this.title=e},i.prototype.enable=function(t,e,i){this.url_path=t||this.url_path,this.url=i||this.url,this.title=e||this.title,this.disableCallback=this.enablePageAlive(),this.options.params instanceof Function?this.customParmas=this.options.params():this.customParmas=this.options.params},i.prototype.disable=function(){this.disableCallback(),this.pageStartTime=Date.now()},i.prototype.sendEvent=function(e,i){void 0===i&&(i=!1);var a=i?this.aliveDTime:Date.now()-this.sessionStartTime;a<0||a>this.aliveDTime||Date.now()-this.pageStartTime>this.maxDuration||(this.collect.beconEvent(this.options.aliveName,t({url_path:this.getParams("url_path"),title:this.getParams("title"),url:this.getParams("url"),duration:a,is_support_visibility_change:s(),startTime:this.sessionStartTime,hidden:document.visibilityState,leave:e},this.customParmas)),this.sessionStartTime=Date.now(),this.resetParams(location.pathname,document.title,location.href))},i.prototype.getParams=function(t){switch(t){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}},i.prototype.setUpTimer=function(){var t=this;return this.timerHandler&&clearInterval(this.timerHandler),setInterval((function(){Date.now()-t.sessionStartTime>t.aliveDTime&&t.sendEvent(!1,!0)}),1e3)},i.prototype.visibilitychange=function(){"hidden"===document.visibilityState?this.timerHandler&&(clearInterval(this.timerHandler),this.sendEvent(!1)):"visible"===document.visibilityState&&(this.sessionStartTime=Date.now(),this.timerHandler=this.setUpTimer())},i.prototype.beforeunload=function(){document.hidden||this.sendEvent(!0)},i.prototype.enablePageAlive=function(){var t=this;this.timerHandler=this.setUpTimer();var e=this.visibilitychange.bind(this),i=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",i),function(){t.beforeunload(),document.removeEventListener("visibilitychange",e),window.removeEventListener("beforeunload",i),window.removeEventListener("pagehide",i)}},i}(),o=function(){function i(t,i){var a=this;this.maxDuration=432e5,this.aliveDTime=6e4,this.options={closeName:"predefine_page_close",params:{}},this.visibilitychange=function(){"hidden"===document.visibilityState?a.activeEndTime=Date.now():"visible"===document.visibilityState&&(a.activeEndTime&&(a.totalTime+=a.activeEndTime-a.activeStartTime,a.activeTimes+=1),a.activeEndTime=void 0,a.activeStartTime=Date.now())},this.beforeunload=function(){if(a.totalTime+=(a.activeEndTime||Date.now())-a.activeStartTime,a.config.autotrack){try{window.sessionStorage.setItem("_tea_cache_duration",JSON.stringify({duration:a.totalTime,page_title:document.title||location.pathname}))}catch(t){}}a.sendEventPageClose()},this.collect=t,this.config=i,this.maxDuration=i.maxDuration||864e5,this.pageStartTime=Date.now(),e(i.enable_stay_duration)&&(this.options=Object.assign(this.options,i.enable_stay_duration)),this.resetData()}return i.prototype.setParams=function(t,e,i){this.set_path=t,this.set_url=i,this.set_title=e},i.prototype.resetParams=function(t,e,i){this.url_path=t,this.url=i,this.title=e},i.prototype.enable=function(t,e,i){this.url_path=t||this.url_path,this.url=i||this.url,this.title=e||this.title,this.disableCallback=this.enablePageClose()},i.prototype.disable=function(){this.disableCallback()},i.prototype.resetData=function(){this.activeStartTime=void 0===this.activeStartTime?this.pageStartTime:Date.now(),this.activeEndTime=void 0,this.activeTimes=1,this.totalTime=0,this.options.params instanceof Function?this.customParmas=this.options.params():this.customParmas=this.options.params,this.resetParams(location.pathname,document.title,location.href)},i.prototype.sendEventPageClose=function(){var e=Date.now()-this.pageStartTime;this.totalTime<0||e<0||this.totalTime>=this.maxDuration||(this.collect.beconEvent(this.options.closeName,t({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:s()},this.customParmas)),this.pageStartTime=Date.now(),this.resetData())},i.prototype.getParams=function(t){switch(t){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}},i.prototype.enablePageClose=function(){var t=this,e=this.visibilitychange.bind(this),i=this.beforeunload.bind(this);return document.addEventListener("visibilitychange",e),window.addEventListener("pagehide",i),function(){t.beforeunload(),document.removeEventListener("visibilitychange",e),window.removeEventListener("beforeunload",i),window.removeEventListener("pagehide",i)}},i}();!function(t){t.Init="init",t.Config="config",t.Start="start",t.Ready="ready",t.TokenComplete="token-complete",t.TokenStorage="token-storage",t.TokenFetch="token-fetch",t.TokenError="token-error",t.ConfigUuid="config-uuid",t.ConfigWebId="config-webid",t.ConfigDomain="config-domain",t.CustomWebId="custom-webid",t.AnonymousId="anonymous-id",t.TokenChange="token-change",t.TokenReset="token-reset",t.ConfigTransform="config-transform",t.EnvTransform="env-transform",t.SessionReset="session-reset",t.SessionResetTime="session-reset-time",t.Event="event",t.Events="events",t.EventNow="event-now",t.CleanEvents="clean-events",t.BeconEvent="becon-event",t.SubmitBefore="submit-before",t.SubmitScuess="submit-scuess",t.SubmitAfter="submit-after",t.SubmitError="submit-error",t.SubmitVerifyH="submit-verify-h5",t.Stay="stay",t.ResetStay="reset-stay",t.StayReady="stay-ready",t.SetStay="set-stay",t.RouteChange="route-change",t.RouteReady="route-ready",t.Ab="ab",t.AbVar="ab-var",t.AbAllVars="ab-all-vars",t.AbConfig="ab-config",t.AbExternalVersion="ab-external-version",t.AbVersionChangeOn="ab-version-change-on",t.AbVersionChangeOff="ab-version-change-off",t.AbOpenLayer="ab-open-layer",t.AbCloseLayer="ab-close-layer",t.AbReady="ab-ready",t.AbComplete="ab-complete",t.AbTimeout="ab-timeout",t.Profile="profile",t.ProfileSet="profile-set",t.ProfileSetOnce="profile-set-once",t.ProfileUnset="profile-unset",t.ProfileIncrement="profile-increment",t.ProfileAppend="profile-append",t.ProfileClear="profile-clear",t.TrackDuration="track-duration",t.TrackDurationStart="track-duration-start",t.TrackDurationEnd="track-duration-end",t.TrackDurationPause="track-duration-pause",t.TrackDurationResume="tracl-duration-resume",t.Autotrack="autotrack",t.AutotrackReady="autotrack-ready",t.CepReady="cep-ready",t.TracerReady="tracer-ready"}(i||(i={})),function(t){t.DEBUGGER_MESSAGE="debugger-message",t.DEBUGGER_MESSAGE_SDK="debugger-message-sdk",t.DEBUGGER_MESSAGE_FETCH="debugger-message-fetch",t.DEBUGGER_MESSAGE_FETCH_RESULT="debugger-message-fetch-result",t.DEBUGGER_MESSAGE_EVENT="debugger-message-event",t.DEVTOOL_WEB_READY="devtool-web-ready"}(a||(a={}));var r=function(){function t(){}return t.prototype.apply=function(t,e){var i=this;if(this.collect=t,this.config=e,this.config.enable_stay_duration){this.title=document.title||location.pathname,this.url=location.href,this.url_path=location.pathname,this.pageAlive=new n(t,e),this.pageClose=new o(t,e);var a=this.collect.Types;this.collect.on(a.ResetStay,(function(t){var e=t.url_path,a=t.title,s=t.url;i.resetStayDuration(e,a,s)})),this.collect.on(a.RouteChange,(function(t){t.init||e.disable_route_report||i.resetStayDuration()})),this.collect.on(a.SetStay,(function(t){var e=t.url_path,a=t.title,s=t.url;i.setStayParmas(e,a,s)})),this.enable(this.url_path,this.title,this.url),this.ready(a.Stay),this.collect.emit(a.StayReady)}},t.prototype.ready=function(t){var e=this;if(this.collect.set(t),this.collect.hook._hooksCache.hasOwnProperty(t)){var i=this.collect.hook._hooksCache[t];if(!Object.keys(i).length)return;var a=function(t){i[t].length&&i[t].forEach((function(i){e.collect.hook.emit(t,i)}))};for(var s in i)a(s)}},t.prototype.enable=function(t,e,i){this.pageAlive.enable(t,e,i),this.pageClose.enable(t,e,i)},t.prototype.disable=function(){this.pageAlive.disable(),this.pageClose.disable()},t.prototype.setStayParmas=function(t,e,i){void 0===t&&(t=""),void 0===e&&(e=""),void 0===i&&(i=""),this.pageAlive.setParams(t,e,i),this.pageClose.setParams(t,e,i),this.collect.emit(a.DEBUGGER_MESSAGE,{type:a.DEBUGGER_MESSAGE_SDK,info:"SDK 执行 resetStayParams",level:"info",time:Date.now(),data:{url_path:t,title:e,url:i}})},t.prototype.reset=function(t,e,i){this.disable(),this.enable(t,e,i)},t.prototype.resetStayDuration=function(t,e,i){this.reset(t,e,i),this.collect.emit(a.DEBUGGER_MESSAGE,{type:a.DEBUGGER_MESSAGE_SDK,info:"SDK 执行 resetStayDuration",level:"info",time:Date.now(),data:{url_path:t,title:e,url:i}})},t}();module.exports=r;
@@ -0,0 +1 @@
1
+ "use strict";var t=function(){function t(){this.retryWaitTime=3e3,this.retryStatus=!1,this.retryCacheStatus=!1}return t.prototype.apply=function(t,e){var r=this;if(e.enable_storage&&!e.disable_storage&&(this.collect=t,this.config=e,!this.collect.destroyInstance)){var a=t.Types,n=t.adapters,o=n.storage,i=n.fetch;this.storage=new o(!1),this.fetch=i,this.eventUrl=this.collect.configManager.getUrl("event"),this.eventKey="__tea_cache_events_"+e.app_id,this.storageNum=e.storage_num||50,this.retryNum=e.retry_num||3,this.retryInterval=1e3,t.on(a.SubmitError,(function(t){"f_data"===t.type&&r.storeData(t)})),t.on(a.Ready,(function(){r.checkStorage()}))}},t.prototype.retryRightNow=function(t){var e=this;if(this.retryStatus)this.errorCache.push(t);else{var r=0;this.retryStatus=!0;var a=setInterval((function(){if(3===r)return e.storeData(e.errorCache),e.retryStatus=!1,void clearInterval(a);var n=t.eventData;e.fetchData(n,(function(){e.retryStatus=!1,clearInterval(a),e.retryCacheStatus&&e.errorCache.splice(0,1),e.errorCache.length&&(e.retryCacheStatus=!0,e.retryRightNow(e.errorCache[0]))}),(function(){r++}))}),this.retryInterval)}},t.prototype.storeData=function(t){var e=this.storage.getItem(this.eventKey),r=t.eventData;Object.keys(e).length!==this.storageNum&&(e[Date.now()]=r,this.storage.setItem(this.eventKey,e))},t.prototype.checkStorage=function(){var t=this;try{if(!window.navigator.onLine)return;var e=this.storage.getItem(this.eventKey);if(!e||!Object.keys(e).length)return;var r={events:[{event:"ontest",params:{app_id:this.config.app_id},local_time_ms:Date.now()}],user:{user_unique_id:this.collect.configManager.get("web_id")},header:{}};this.fetchData([r],(function(){var r=JSON.parse(JSON.stringify(e)),a=function(a){t.fetchData(e[a],(function(){delete r[a],t.storage.setItem(t.eventKey,r)}),(function(){}),!1)};for(var n in e)a(n)}),(function(){}),!0)}catch(t){console.warn("error check storage")}},t.prototype.fetchData=function(t,e,r,a){this.fetch(this.eventUrl,t,3e4,!1,(function(){e&&e()}),(function(){r&&r(),console.log("network error,compensate report failk")}),a&&!this.config.channel_domain?"566f58151b0ed37e":"")},t}();module.exports=t;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarangers/sdk-javascript",
3
- "version": "0.0.3-lite",
3
+ "version": "0.0.4",
4
4
  "scripts": {
5
5
  "nclean": "rimraf es lib core",
6
6
  "build": "export NODE_ENV=production && npm run nclean && npx rollup -c rollup.config.js",
@@ -11,7 +11,8 @@
11
11
  "types": "./types/types.d.ts",
12
12
  "license": "ISC",
13
13
  "dependencies": {
14
- "js-cookie": "^3.0.1"
14
+ "js-cookie": "^3.0.1",
15
+ "sm-crypto": "^0.3.12"
15
16
  },
16
17
  "files": [
17
18
  "es",
package/types/types.d.ts CHANGED
@@ -46,19 +46,24 @@ export interface IInitParam {
46
46
  cookie_expire?: number;
47
47
  enable_custom_webid?: boolean;
48
48
  disable_track_event?: boolean;
49
- visual_container_id?: boolean;
50
- visual_domain?: string;
51
- exposure_limit?: number;
52
- ab_batch_time?: number;
53
49
  allow_hash?: boolean;
54
50
  enable_native?: boolean;
51
+ ab_cross?: boolean;
52
+ ab_cookie_domain?: string;
53
+ disable_ab_reset?: boolean;
54
+ enable_encryption?: boolean;
55
+ enable_anonymousid?: boolean
56
+ enable_debug?: boolean
57
+ crypto_publicKey?: string
58
+ encryption_type?: string
59
+ encryption_header?: string
55
60
  }
56
61
 
57
62
  export interface IConfigParam {
58
63
  _staging_flag?: 0 | 1;
59
64
  user_unique_id?: string;
60
- web_id?: string;
61
65
  disable_auto_pv?: boolean;
66
+ web_id?: string;
62
67
  user_type?: number;
63
68
  os_name?: string;
64
69
  os_version?: string;
@@ -172,7 +177,6 @@ export declare enum SdkHook {
172
177
  AbCloseLayer = 'ab-close-layer',
173
178
  AbReady = 'ab-ready',
174
179
  AbComplete = 'ab-complete',
175
- AbTimeout = 'ab-timeout',
176
180
 
177
181
  Profile = 'profile',
178
182
  ProfileSet = 'profile-set',
@@ -189,7 +193,11 @@ export declare enum SdkHook {
189
193
  TrackDurationResume = 'tracl-duration-resume',
190
194
 
191
195
  Autotrack = 'autotrack',
192
- AutotrackReady = 'autotrack-ready'
196
+ AutotrackReady = 'autotrack-ready',
197
+
198
+ CepReady = 'cep-ready',
199
+
200
+ TracerReady = 'tracer-ready'
193
201
  }
194
202
  interface SdkConstructor {
195
203
  new(name: string): Sdk;
@@ -206,8 +214,8 @@ interface Sdk {
206
214
 
207
215
  init(options: IInitParam): void;
208
216
  config(configs?: IConfigParam): void;
209
- setDomain(domain: string): void;
210
217
  getConfig(key?: string): Record<string, any>;
218
+ setDomain(domain: string): void;
211
219
  start(): void;
212
220
  send(): void;
213
221
  set(type: string): void;
@@ -217,7 +225,7 @@ interface Sdk {
217
225
  events:
218
226
  | Array<[string, EventParams] | [string, EventParams, number]>
219
227
  ): void;
220
- filterEvent(filter: any): void;
228
+
221
229
  predefinePageView(params: any): void;
222
230
  clearEventCache(): void;
223
231
  setWebIDviaUnionID(unionId: string): void;
@@ -225,7 +233,6 @@ interface Sdk {
225
233
  getToken(callback: (info: Record<string, string | number>) => void, timeout?: number): void;
226
234
 
227
235
  resetStayDuration(url_path?: string, title?: string, url?: string): void;
228
-
229
236
  resetStayParams(url_path?: string, title?: string, url?: string): void;
230
237
 
231
238
  profileSet(profile: any): void;
@@ -234,6 +241,11 @@ interface Sdk {
234
241
  profileUnset(key: string): void;
235
242
  profileAppend(profile: any): void;
236
243
 
244
+ startTrackEvent(eventName: string): void;
245
+ endTrackEvent(eventName: string, params: any): void;
246
+ pauseTrackEvent(eventName: string): void;
247
+ resumeTrackEvent(eventName: string): void;
248
+
237
249
  setExternalAbVersion(vids: string): void;
238
250
  getVar(name: string, defaultValue: any, callback: (value: any) => void): void;
239
251
  getAllVars(callback: (value: any) => void): void;
@@ -241,9 +253,12 @@ interface Sdk {
241
253
  onAbSdkVersionChange(callback: (vids: string) => void): () => void;
242
254
  offAbSdkVersionChange(callback: (vids: string) => void): void;
243
255
  setExternalAbVersion(vids: string | null): void;
244
- getABConfig(params: Record<string, any>, callback: (value: any) => void): void;
256
+ getABconfig(params: Record<string, any>, callback: (value: any) => void): void;
245
257
  openOverlayer(): void;
246
258
  closeOverlayer(): void;
259
+ autoInitializationRangers(
260
+ config: IInitParam & { onTokenReady: (webId: string) => void },
261
+ ): void;
247
262
  }
248
263
  declare const Sdk: Sdk;
249
264
  export const Collector: SdkConstructor;
@@ -1 +0,0 @@
1
- var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(e,t){return e(t={exports:{}},t.exports),t.exports}var n,r,i=function(e){return e&&e.Math==Math&&e},o=i("object"==typeof globalThis&&globalThis)||i("object"==typeof window&&window)||i("object"==typeof self&&self)||i("object"==typeof e&&e)||function(){return this}()||Function("return this")(),a=function(e){try{return!!e()}catch(e){return!0}},s=!a((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c=!a((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),u=Function.prototype.call,f=c?u.bind(u):function(){return u.apply(u,arguments)},l={}.propertyIsEnumerable,h=Object.getOwnPropertyDescriptor,p={f:h&&!l.call({1:2},1)?function(e){var t=h(this,e);return!!t&&t.enumerable}:l},d=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},g=Function.prototype,v=g.bind,m=g.call,y=c&&v.bind(m,m),b=c?function(e){return e&&y(e)}:function(e){return e&&function(){return m.apply(e,arguments)}},w=b({}.toString),_=b("".slice),x=function(e){return _(w(e),8,-1)},S=o.Object,O=b("".split),I=a((function(){return!S("z").propertyIsEnumerable(0)}))?function(e){return"String"==x(e)?O(e,""):S(e)}:S,E=o.TypeError,k=function(e){if(null==e)throw E("Can't call method on "+e);return e},T=function(e){return I(k(e))},j=function(e){return"function"==typeof e},M=function(e){return"object"==typeof e?null!==e:j(e)},P=function(e){return j(e)?e:void 0},R=function(e,t){return arguments.length<2?P(o[e]):o[e]&&o[e][t]},A=b({}.isPrototypeOf),C=R("navigator","userAgent")||"",z=o.process,N=o.Deno,D=z&&z.versions||N&&N.version,L=D&&D.v8;L&&(r=(n=L.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&C&&(!(n=C.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=C.match(/Chrome\/(\d+)/))&&(r=+n[1]);var U=r,F=!!Object.getOwnPropertySymbols&&!a((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&U&&U<41})),B=F&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,V=o.Object,q=B?function(e){return"symbol"==typeof e}:function(e){var t=R("Symbol");return j(t)&&A(t.prototype,V(e))},K=o.String,W=function(e){try{return K(e)}catch(e){return"Object"}},G=o.TypeError,J=function(e){if(j(e))return e;throw G(W(e)+" is not a function")},$=function(e,t){var n=e[t];return null==n?void 0:J(n)},X=o.TypeError,Q=Object.defineProperty,Y=function(e,t){try{Q(o,e,{value:t,configurable:!0,writable:!0})}catch(n){o[e]=t}return t},H=o["__core-js_shared__"]||Y("__core-js_shared__",{}),Z=t((function(e){(e.exports=function(e,t){return H[e]||(H[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.22.6",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.6/LICENSE",source:"https://github.com/zloirock/core-js"})})),ee=o.Object,te=function(e){return ee(k(e))},ne=b({}.hasOwnProperty),re=Object.hasOwn||function(e,t){return ne(te(e),t)},ie=0,oe=Math.random(),ae=b(1..toString),se=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ae(++ie+oe,36)},ce=Z("wks"),ue=o.Symbol,fe=ue&&ue.for,le=B?ue:ue&&ue.withoutSetter||se,he=function(e){if(!re(ce,e)||!F&&"string"!=typeof ce[e]){var t="Symbol."+e;F&&re(ue,e)?ce[e]=ue[e]:ce[e]=B&&fe?fe(t):le(t)}return ce[e]},pe=o.TypeError,de=he("toPrimitive"),ge=function(e,t){if(!M(e)||q(e))return e;var n,r=$(e,de);if(r){if(void 0===t&&(t="default"),n=f(r,e,t),!M(n)||q(n))return n;throw pe("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,r;if("string"===t&&j(n=e.toString)&&!M(r=f(n,e)))return r;if(j(n=e.valueOf)&&!M(r=f(n,e)))return r;if("string"!==t&&j(n=e.toString)&&!M(r=f(n,e)))return r;throw X("Can't convert object to primitive value")}(e,t)},ve=function(e){var t=ge(e,"string");return q(t)?t:t+""},me=o.document,ye=M(me)&&M(me.createElement),be=function(e){return ye?me.createElement(e):{}},we=!s&&!a((function(){return 7!=Object.defineProperty(be("div"),"a",{get:function(){return 7}}).a})),_e=Object.getOwnPropertyDescriptor,xe={f:s?_e:function(e,t){if(e=T(e),t=ve(t),we)try{return _e(e,t)}catch(e){}if(re(e,t))return d(!f(p.f,e,t),e[t])}},Se=s&&a((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Oe=o.String,Ie=o.TypeError,Ee=function(e){if(M(e))return e;throw Ie(Oe(e)+" is not an object")},ke=o.TypeError,Te=Object.defineProperty,je=Object.getOwnPropertyDescriptor,Me={f:s?Se?function(e,t,n){if(Ee(e),t=ve(t),Ee(n),"function"==typeof e&&"prototype"===t&&"value"in n&&"writable"in n&&!n.writable){var r=je(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return Te(e,t,n)}:Te:function(e,t,n){if(Ee(e),t=ve(t),Ee(n),we)try{return Te(e,t,n)}catch(e){}if("get"in n||"set"in n)throw ke("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},Pe=s?function(e,t,n){return Me.f(e,t,d(1,n))}:function(e,t,n){return e[t]=n,e},Re=Function.prototype,Ae=s&&Object.getOwnPropertyDescriptor,Ce=re(Re,"name"),ze={EXISTS:Ce,PROPER:Ce&&"something"===function(){}.name,CONFIGURABLE:Ce&&(!s||s&&Ae(Re,"name").configurable)},Ne=b(Function.toString);j(H.inspectSource)||(H.inspectSource=function(e){return Ne(e)});var De,Le,Ue,Fe=H.inspectSource,Be=o.WeakMap,Ve=j(Be)&&/native code/.test(Fe(Be)),qe=Z("keys"),Ke=function(e){return qe[e]||(qe[e]=se(e))},We={},Ge=o.TypeError,Je=o.WeakMap;if(Ve||H.state){var $e=H.state||(H.state=new Je),Xe=b($e.get),Qe=b($e.has),Ye=b($e.set);De=function(e,t){if(Qe($e,e))throw new Ge("Object already initialized");return t.facade=e,Ye($e,e,t),t},Le=function(e){return Xe($e,e)||{}},Ue=function(e){return Qe($e,e)}}else{var He=Ke("state");We[He]=!0,De=function(e,t){if(re(e,He))throw new Ge("Object already initialized");return t.facade=e,Pe(e,He,t),t},Le=function(e){return re(e,He)?e[He]:{}},Ue=function(e){return re(e,He)}}var Ze={set:De,get:Le,has:Ue,enforce:function(e){return Ue(e)?Le(e):De(e,{})},getterFor:function(e){return function(t){var n;if(!M(t)||(n=Le(t)).type!==e)throw Ge("Incompatible receiver, "+e+" required");return n}}},et=t((function(e){var t=ze.CONFIGURABLE,n=Ze.enforce,r=Ze.get,i=Object.defineProperty,o=s&&!a((function(){return 8!==i((function(){}),"length",{value:8}).length})),c=String(String).split("String"),u=e.exports=function(e,r,a){if("Symbol("===String(r).slice(0,7)&&(r="["+String(r).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),a&&a.getter&&(r="get "+r),a&&a.setter&&(r="set "+r),(!re(e,"name")||t&&e.name!==r)&&i(e,"name",{value:r,configurable:!0}),o&&a&&re(a,"arity")&&e.length!==a.arity&&i(e,"length",{value:a.arity}),a&&re(a,"constructor")&&a.constructor){if(s)try{i(e,"prototype",{writable:!1})}catch(e){}}else e.prototype=void 0;var u=n(e);return re(u,"source")||(u.source=c.join("string"==typeof r?r:"")),e};Function.prototype.toString=u((function(){return j(this)&&r(this).source||Fe(this)}),"toString")})),tt=function(e,t,n,r){r||(r={});var i=r.enumerable,o=void 0!==r.name?r.name:t;return j(n)&&et(n,o,r),r.global?i?e[t]=n:Y(t,n):(r.unsafe?e[t]&&(i=!0):delete e[t],i?e[t]=n:Pe(e,t,n)),e},nt=Math.ceil,rt=Math.floor,it=Math.trunc||function(e){var t=+e;return(t>0?rt:nt)(t)},ot=function(e){var t=+e;return t!=t||0===t?0:it(t)},at=Math.max,st=Math.min,ct=function(e,t){var n=ot(e);return n<0?at(n+t,0):st(n,t)},ut=Math.min,ft=function(e){return e>0?ut(ot(e),9007199254740991):0},lt=function(e){return ft(e.length)},ht=function(e){return function(t,n,r){var i,o=T(t),a=lt(o),s=ct(r,a);if(e&&n!=n){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},pt={includes:ht(!0),indexOf:ht(!1)},dt=pt.indexOf,gt=b([].push),vt=function(e,t){var n,r=T(e),i=0,o=[];for(n in r)!re(We,n)&&re(r,n)&&gt(o,n);for(;t.length>i;)re(r,n=t[i++])&&(~dt(o,n)||gt(o,n));return o},mt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],yt=mt.concat("length","prototype"),bt={f:Object.getOwnPropertyNames||function(e){return vt(e,yt)}},wt={f:Object.getOwnPropertySymbols},_t=b([].concat),xt=R("Reflect","ownKeys")||function(e){var t=bt.f(Ee(e)),n=wt.f;return n?_t(t,n(e)):t},St=function(e,t,n){for(var r=xt(t),i=Me.f,o=xe.f,a=0;a<r.length;a++){var s=r[a];re(e,s)||n&&re(n,s)||i(e,s,o(t,s))}},Ot=/#|\.prototype\./,It=function(e,t){var n=kt[Et(e)];return n==jt||n!=Tt&&(j(t)?a(t):!!t)},Et=It.normalize=function(e){return String(e).replace(Ot,".").toLowerCase()},kt=It.data={},Tt=It.NATIVE="N",jt=It.POLYFILL="P",Mt=It,Pt=xe.f,Rt=function(e,t){var n,r,i,a,s,c=e.target,u=e.global,f=e.stat;if(n=u?o:f?o[c]||Y(c,{}):(o[c]||{}).prototype)for(r in t){if(a=t[r],i=e.dontCallGetSet?(s=Pt(n,r))&&s.value:n[r],!Mt(u?r:c+(f?".":"#")+r,e.forced)&&void 0!==i){if(typeof a==typeof i)continue;St(a,i)}(e.sham||i&&i.sham)&&Pe(a,"sham",!0),tt(n,r,a,e)}},At=b(b.bind),Ct=function(e,t){return J(e),void 0===t?e:c?At(e,t):function(){return e.apply(t,arguments)}},zt=Array.isArray||function(e){return"Array"==x(e)},Nt={};Nt[he("toStringTag")]="z";var Dt="[object z]"===String(Nt),Lt=he("toStringTag"),Ut=o.Object,Ft="Arguments"==x(function(){return arguments}()),Bt=Dt?x:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=Ut(e),Lt))?n:Ft?x(t):"Object"==(r=x(t))&&j(t.callee)?"Arguments":r},Vt=function(){},qt=[],Kt=R("Reflect","construct"),Wt=/^\s*(?:class|function)\b/,Gt=b(Wt.exec),Jt=!Wt.exec(Vt),$t=function(e){if(!j(e))return!1;try{return Kt(Vt,qt,e),!0}catch(e){return!1}},Xt=function(e){if(!j(e))return!1;switch(Bt(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return Jt||!!Gt(Wt,Fe(e))}catch(e){return!0}};Xt.sham=!0;var Qt=!Kt||a((function(){var e;return $t($t.call)||!$t(Object)||!$t((function(){e=!0}))||e}))?Xt:$t,Yt=he("species"),Ht=o.Array,Zt=function(e,t){return new(function(e){var t;return zt(e)&&(t=e.constructor,(Qt(t)&&(t===Ht||zt(t.prototype))||M(t)&&null===(t=t[Yt]))&&(t=void 0)),void 0===t?Ht:t}(e))(0===t?0:t)},en=b([].push),tn=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,o=6==e,a=7==e,s=5==e||o;return function(c,u,f,l){for(var h,p,d=te(c),g=I(d),v=Ct(u,f),m=lt(g),y=0,b=l||Zt,w=t?b(c,m):n||a?b(c,0):void 0;m>y;y++)if((s||y in g)&&(p=v(h=g[y],y,d),e))if(t)w[y]=p;else if(p)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:en(w,h)}else switch(e){case 4:return!1;case 7:en(w,h)}return o?-1:r||i?i:w}},nn={forEach:tn(0),map:tn(1),filter:tn(2),some:tn(3),every:tn(4),find:tn(5),findIndex:tn(6),filterReject:tn(7)},rn=function(e,t){var n=[][e];return!!n&&a((function(){n.call(null,t||function(){return 1},1)}))},on=nn.forEach,an=rn("forEach")?[].forEach:function(e){return on(this,e,arguments.length>1?arguments[1]:void 0)};Rt({target:"Array",proto:!0,forced:[].forEach!=an},{forEach:an});var sn=pt.indexOf,cn=b([].indexOf),un=!!cn&&1/cn([1],1,-0)<0,fn=rn("indexOf");Rt({target:"Array",proto:!0,forced:un||!fn},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return un?cn(this,e,t)||0:sn(this,e,t)}}),Rt({target:"Array",stat:!0},{isArray:zt});var ln,hn=Object.keys||function(e){return vt(e,mt)},pn=s&&!Se?Object.defineProperties:function(e,t){Ee(e);for(var n,r=T(t),i=hn(t),o=i.length,a=0;o>a;)Me.f(e,n=i[a++],r[n]);return e},dn={f:pn},gn=R("document","documentElement"),vn=Ke("IE_PROTO"),mn=function(){},yn=function(e){return"<script>"+e+"<\/script>"},bn=function(e){e.write(yn("")),e.close();var t=e.parentWindow.Object;return e=null,t},wn=function(){try{ln=new ActiveXObject("htmlfile")}catch(e){}var e,t;wn="undefined"!=typeof document?document.domain&&ln?bn(ln):((t=be("iframe")).style.display="none",gn.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(yn("document.F=Object")),e.close(),e.F):bn(ln);for(var n=mt.length;n--;)delete wn.prototype[mt[n]];return wn()};We[vn]=!0;var _n=Object.create||function(e,t){var n;return null!==e?(mn.prototype=Ee(e),n=new mn,mn.prototype=null,n[vn]=e):n=wn(),void 0===t?n:dn.f(n,t)},xn=Me.f,Sn=he("unscopables"),On=Array.prototype;null==On[Sn]&&xn(On,Sn,{configurable:!0,value:_n(null)});var In,En,kn,Tn=function(e){On[Sn][e]=!0},jn={},Mn=!a((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Pn=Ke("IE_PROTO"),Rn=o.Object,An=Rn.prototype,Cn=Mn?Rn.getPrototypeOf:function(e){var t=te(e);if(re(t,Pn))return t[Pn];var n=t.constructor;return j(n)&&t instanceof n?n.prototype:t instanceof Rn?An:null},zn=he("iterator"),Nn=!1;[].keys&&("next"in(kn=[].keys())?(En=Cn(Cn(kn)))!==Object.prototype&&(In=En):Nn=!0);var Dn=null==In||a((function(){var e={};return In[zn].call(e)!==e}));Dn&&(In={}),j(In[zn])||tt(In,zn,(function(){return this}));var Ln={IteratorPrototype:In,BUGGY_SAFARI_ITERATORS:Nn},Un=Me.f,Fn=he("toStringTag"),Bn=function(e,t,n){e&&!n&&(e=e.prototype),e&&!re(e,Fn)&&Un(e,Fn,{configurable:!0,value:t})},Vn=Ln.IteratorPrototype,qn=function(){return this},Kn=o.String,Wn=o.TypeError,Gn=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=b(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return Ee(n),function(e){if("object"==typeof e||j(e))return e;throw Wn("Can't set "+Kn(e)+" as a prototype")}(r),t?e(n,r):n.__proto__=r,n}}():void 0),Jn=ze.PROPER,$n=ze.CONFIGURABLE,Xn=Ln.IteratorPrototype,Qn=Ln.BUGGY_SAFARI_ITERATORS,Yn=he("iterator"),Hn=function(){return this},Zn=function(e,t,n,r,i,o,a){!function(e,t,n,r){var i=t+" Iterator";e.prototype=_n(Vn,{next:d(+!r,n)}),Bn(e,i,!1),jn[i]=qn}(n,t,r);var s,c,u,l=function(e){if(e===i&&m)return m;if(!Qn&&e in g)return g[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},h=t+" Iterator",p=!1,g=e.prototype,v=g[Yn]||g["@@iterator"]||i&&g[i],m=!Qn&&v||l(i),y="Array"==t&&g.entries||v;if(y&&(s=Cn(y.call(new e)))!==Object.prototype&&s.next&&(Cn(s)!==Xn&&(Gn?Gn(s,Xn):j(s[Yn])||tt(s,Yn,Hn)),Bn(s,h,!0)),Jn&&"values"==i&&v&&"values"!==v.name&&($n?Pe(g,"name","values"):(p=!0,m=function(){return f(v,this)})),i)if(c={values:l("values"),keys:o?m:l("keys"),entries:l("entries")},a)for(u in c)(Qn||p||!(u in g))&&tt(g,u,c[u]);else Rt({target:t,proto:!0,forced:Qn||p},c);return g[Yn]!==m&&tt(g,Yn,m,{name:i}),jn[t]=m,c},er=Me.f,tr=Ze.set,nr=Ze.getterFor("Array Iterator"),rr=Zn(Array,"Array",(function(e,t){tr(this,{type:"Array Iterator",target:T(e),index:0,kind:t})}),(function(){var e=nr(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),ir=jn.Arguments=jn.Array;if(Tn("keys"),Tn("values"),Tn("entries"),s&&"values"!==ir.name)try{er(ir,"name",{value:"values"})}catch(e){}var or=function(e,t,n){var r=ve(t);r in e?Me.f(e,r,d(0,n)):e[r]=n},ar=he("species"),sr=function(e){return U>=51||!a((function(){var t=[];return(t.constructor={})[ar]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},cr=b([].slice),ur=sr("slice"),fr=he("species"),lr=o.Array,hr=Math.max;Rt({target:"Array",proto:!0,forced:!ur},{slice:function(e,t){var n,r,i,o=T(this),a=lt(o),s=ct(e,a),c=ct(void 0===t?a:t,a);if(zt(o)&&(n=o.constructor,(Qt(n)&&(n===lr||zt(n.prototype))||M(n)&&null===(n=n[fr]))&&(n=void 0),n===lr||void 0===n))return cr(o,s,c);for(r=new(void 0===n?lr:n)(hr(c-s,0)),i=0;s<c;s++,i++)s in o&&or(r,i,o[s]);return r.length=i,r}});var pr=o.Date,dr=b(pr.prototype.getTime);Rt({target:"Date",stat:!0},{now:function(){return dr(new pr)}});var gr=Date.prototype,vr=b(gr.toString),mr=b(gr.getTime);"Invalid Date"!=String(new Date(NaN))&&tt(gr,"toString",(function(){var e=mr(this);return e==e?vr(this):"Invalid Date"}));var yr=ze.EXISTS,br=Me.f,wr=Function.prototype,_r=b(wr.toString),xr=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Sr=b(xr.exec);s&&!yr&&br(wr,"name",{configurable:!0,get:function(){try{return Sr(xr,_r(this))[1]}catch(e){return""}}});var Or=Dt?{}.toString:function(){return"[object "+Bt(this)+"]"};Dt||tt(Object.prototype,"toString",Or,{unsafe:!0});var Ir,Er,kr,Tr,jr="process"==x(o.process),Mr=he("species"),Pr=function(e){var t=R(e),n=Me.f;s&&t&&!t[Mr]&&n(t,Mr,{configurable:!0,get:function(){return this}})},Rr=o.TypeError,Ar=o.TypeError,Cr=he("species"),zr=function(e,t){var n,r=Ee(e).constructor;return void 0===r||null==(n=Ee(r)[Cr])?t:function(e){if(Qt(e))return e;throw Ar(W(e)+" is not a constructor")}(n)},Nr=Function.prototype,Dr=Nr.apply,Lr=Nr.call,Ur="object"==typeof Reflect&&Reflect.apply||(c?Lr.bind(Dr):function(){return Lr.apply(Dr,arguments)}),Fr=o.TypeError,Br=function(e,t){if(e<t)throw Fr("Not enough arguments");return e},Vr=/(?:ipad|iphone|ipod).*applewebkit/i.test(C),qr=o.setImmediate,Kr=o.clearImmediate,Wr=o.process,Gr=o.Dispatch,Jr=o.Function,$r=o.MessageChannel,Xr=o.String,Qr=0,Yr={};try{Ir=o.location}catch(e){}var Hr=function(e){if(re(Yr,e)){var t=Yr[e];delete Yr[e],t()}},Zr=function(e){return function(){Hr(e)}},ei=function(e){Hr(e.data)},ti=function(e){o.postMessage(Xr(e),Ir.protocol+"//"+Ir.host)};qr&&Kr||(qr=function(e){Br(arguments.length,1);var t=j(e)?e:Jr(e),n=cr(arguments,1);return Yr[++Qr]=function(){Ur(t,void 0,n)},Er(Qr),Qr},Kr=function(e){delete Yr[e]},jr?Er=function(e){Wr.nextTick(Zr(e))}:Gr&&Gr.now?Er=function(e){Gr.now(Zr(e))}:$r&&!Vr?(Tr=(kr=new $r).port2,kr.port1.onmessage=ei,Er=Ct(Tr.postMessage,Tr)):o.addEventListener&&j(o.postMessage)&&!o.importScripts&&Ir&&"file:"!==Ir.protocol&&!a(ti)?(Er=ti,o.addEventListener("message",ei,!1)):Er="onreadystatechange"in be("script")?function(e){gn.appendChild(be("script")).onreadystatechange=function(){gn.removeChild(this),Hr(e)}}:function(e){setTimeout(Zr(e),0)});var ni,ri,ii,oi,ai,si,ci,ui,fi={set:qr,clear:Kr},li=/ipad|iphone|ipod/i.test(C)&&void 0!==o.Pebble,hi=/web0s(?!.*chrome)/i.test(C),pi=xe.f,di=fi.set,gi=o.MutationObserver||o.WebKitMutationObserver,vi=o.document,mi=o.process,yi=o.Promise,bi=pi(o,"queueMicrotask"),wi=bi&&bi.value;wi||(ni=function(){var e,t;for(jr&&(e=mi.domain)&&e.exit();ri;){t=ri.fn,ri=ri.next;try{t()}catch(e){throw ri?oi():ii=void 0,e}}ii=void 0,e&&e.enter()},Vr||jr||hi||!gi||!vi?!li&&yi&&yi.resolve?((ci=yi.resolve(void 0)).constructor=yi,ui=Ct(ci.then,ci),oi=function(){ui(ni)}):jr?oi=function(){mi.nextTick(ni)}:(di=Ct(di,o),oi=function(){di(ni)}):(ai=!0,si=vi.createTextNode(""),new gi(ni).observe(si,{characterData:!0}),oi=function(){si.data=ai=!ai}));var _i=wi||function(e){var t={fn:e,next:void 0};ii&&(ii.next=t),ri||(ri=t,oi()),ii=t},xi=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Si=function(){this.head=null,this.tail=null};Si.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var Oi=Si,Ii=o.Promise,Ei="object"==typeof window&&"object"!=typeof Deno;Ii&&Ii.prototype;var ki,Ti,ji,Mi=he("species"),Pi=!1,Ri=j(o.PromiseRejectionEvent),Ai=Mt("Promise",(function(){var e=Fe(Ii),t=e!==String(Ii);if(!t&&66===U)return!0;if(U>=51&&/native code/.test(e))return!1;var n=new Ii((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[Mi]=r,!(Pi=n.then((function(){}))instanceof r)||!t&&Ei&&!Ri})),Ci={CONSTRUCTOR:Ai,REJECTION_EVENT:Ri,SUBCLASSING:Pi},zi=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=J(t),this.reject=J(n)},Ni={f:function(e){return new zi(e)}},Di=fi.set,Li=Ci.CONSTRUCTOR,Ui=Ci.REJECTION_EVENT,Fi=Ci.SUBCLASSING,Bi=Ze.getterFor("Promise"),Vi=Ze.set,qi=Ii&&Ii.prototype,Ki=Ii,Wi=qi,Gi=o.TypeError,Ji=o.document,$i=o.process,Xi=Ni.f,Qi=Xi,Yi=!!(Ji&&Ji.createEvent&&o.dispatchEvent),Hi=function(e){var t;return!(!M(e)||!j(t=e.then))&&t},Zi=function(e,t){var n,r,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(a||(2===t.rejection&&io(t),t.rejection=1),!0===s?n=o:(l&&l.enter(),n=s(o),l&&(l.exit(),i=!0)),n===e.promise?u(Gi("Promise-chain cycle")):(r=Hi(n))?f(r,n,c,u):c(n)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},eo=function(e,t){e.notified||(e.notified=!0,_i((function(){for(var n,r=e.reactions;n=r.get();)Zi(n,e);e.notified=!1,t&&!e.rejection&&no(e)})))},to=function(e,t,n){var r,i;Yi?((r=Ji.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),o.dispatchEvent(r)):r={promise:t,reason:n},!Ui&&(i=o["on"+e])?i(r):"unhandledrejection"===e&&function(e,t){var n=o.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},no=function(e){f(Di,o,(function(){var t,n=e.facade,r=e.value;if(ro(e)&&(t=xi((function(){jr?$i.emit("unhandledRejection",r,n):to("unhandledrejection",n,r)})),e.rejection=jr||ro(e)?2:1,t.error))throw t.value}))},ro=function(e){return 1!==e.rejection&&!e.parent},io=function(e){f(Di,o,(function(){var t=e.facade;jr?$i.emit("rejectionHandled",t):to("rejectionhandled",t,e.value)}))},oo=function(e,t,n){return function(r){e(t,r,n)}},ao=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,eo(e,!0))},so=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw Gi("Promise can't be resolved itself");var r=Hi(t);r?_i((function(){var n={done:!1};try{f(r,t,oo(so,n,e),oo(ao,n,e))}catch(t){ao(n,t,e)}})):(e.value=t,e.state=1,eo(e,!1))}catch(t){ao({done:!1},t,e)}}};if(Li&&(Wi=(Ki=function(e){!function(e,t){if(A(t,e))return e;throw Rr("Incorrect invocation")}(this,Wi),J(e),f(ki,this);var t=Bi(this);try{e(oo(so,t),oo(ao,t))}catch(e){ao(t,e)}}).prototype,(ki=function(e){Vi(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new Oi,rejection:!1,state:0,value:void 0})}).prototype=tt(Wi,"then",(function(e,t){var n=Bi(this),r=Xi(zr(this,Ki));return n.parent=!0,r.ok=!j(e)||e,r.fail=j(t)&&t,r.domain=jr?$i.domain:void 0,0==n.state?n.reactions.add(r):_i((function(){Zi(r,n)})),r.promise})),Ti=function(){var e=new ki,t=Bi(e);this.promise=e,this.resolve=oo(so,t),this.reject=oo(ao,t)},Ni.f=Xi=function(e){return e===Ki||undefined===e?new Ti(e):Qi(e)},j(Ii)&&qi!==Object.prototype)){ji=qi.then,Fi||tt(qi,"then",(function(e,t){var n=this;return new Ki((function(e,t){f(ji,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete qi.constructor}catch(e){}Gn&&Gn(qi,Wi)}Rt({global:!0,constructor:!0,wrap:!0,forced:Li},{Promise:Ki}),Bn(Ki,"Promise",!1),Pr("Promise");var co=he("iterator"),uo=Array.prototype,fo=he("iterator"),lo=function(e){if(null!=e)return $(e,fo)||$(e,"@@iterator")||jn[Bt(e)]},ho=o.TypeError,po=function(e,t,n){var r,i;Ee(e);try{if(!(r=$(e,"return"))){if("throw"===t)throw n;return n}r=f(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return Ee(r),n},go=o.TypeError,vo=function(e,t){this.stopped=e,this.result=t},mo=vo.prototype,yo=function(e,t,n){var r,i,o,a,s,c,u,l,h=n&&n.that,p=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_ITERATOR),g=!(!n||!n.INTERRUPTED),v=Ct(t,h),m=function(e){return r&&po(r,"normal",e),new vo(!0,e)},y=function(e){return p?(Ee(e),g?v(e[0],e[1],m):v(e[0],e[1])):g?v(e,m):v(e)};if(d)r=e;else{if(!(i=lo(e)))throw go(W(e)+" is not iterable");if(void 0!==(l=i)&&(jn.Array===l||uo[co]===l)){for(o=0,a=lt(e);a>o;o++)if((s=y(e[o]))&&A(mo,s))return s;return new vo(!1)}r=function(e,t){var n=arguments.length<2?lo(e):t;if(J(n))return Ee(f(n,e));throw ho(W(e)+" is not iterable")}(e,i)}for(c=r.next;!(u=f(c,r)).done;){try{s=y(u.value)}catch(e){po(r,"throw",e)}if("object"==typeof s&&s&&A(mo,s))return s}return new vo(!1)},bo=he("iterator"),wo=!1;try{var _o=0,xo={next:function(){return{done:!!_o++}},return:function(){wo=!0}};xo[bo]=function(){return this},Array.from(xo,(function(){throw 2}))}catch(e){}var So=Ci.CONSTRUCTOR||!function(e,t){if(!t&&!wo)return!1;var n=!1;try{var r={};r[bo]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n}((function(e){Ii.all(e).then(void 0,(function(){}))}));Rt({target:"Promise",stat:!0,forced:So},{all:function(e){var t=this,n=Ni.f(t),r=n.resolve,i=n.reject,o=xi((function(){var n=J(t.resolve),o=[],a=0,s=1;yo(e,(function(e){var c=a++,u=!1;s++,f(n,t,e).then((function(e){u||(u=!0,o[c]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise}});var Oo=Ci.CONSTRUCTOR,Io=Ii&&Ii.prototype;if(Rt({target:"Promise",proto:!0,forced:Oo,real:!0},{catch:function(e){return this.then(void 0,e)}}),j(Ii)){var Eo=R("Promise").prototype.catch;Io.catch!==Eo&&tt(Io,"catch",Eo,{unsafe:!0})}Rt({target:"Promise",stat:!0,forced:So},{race:function(e){var t=this,n=Ni.f(t),r=n.reject,i=xi((function(){var i=J(t.resolve);yo(e,(function(e){f(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}}),Rt({target:"Promise",stat:!0,forced:Ci.CONSTRUCTOR},{reject:function(e){var t=Ni.f(this);return f(t.reject,void 0,e),t.promise}});var ko=Ci.CONSTRUCTOR;R("Promise"),Rt({target:"Promise",stat:!0,forced:ko},{resolve:function(e){return function(e,t){if(Ee(e),M(t)&&t.constructor===e)return t;var n=Ni.f(e);return(0,n.resolve)(t),n.promise}(this,e)}});var To=o.String,jo=function(e){if("Symbol"===Bt(e))throw TypeError("Cannot convert a Symbol value to a string");return To(e)},Mo=b("".charAt),Po=b("".charCodeAt),Ro=b("".slice),Ao=function(e){return function(t,n){var r,i,o=jo(k(t)),a=ot(n),s=o.length;return a<0||a>=s?e?"":void 0:(r=Po(o,a))<55296||r>56319||a+1===s||(i=Po(o,a+1))<56320||i>57343?e?Mo(o,a):r:e?Ro(o,a,a+2):i-56320+(r-55296<<10)+65536}},Co={codeAt:Ao(!1),charAt:Ao(!0)},zo=Co.charAt,No=Ze.set,Do=Ze.getterFor("String Iterator");Zn(String,"String",(function(e){No(this,{type:"String Iterator",string:jo(e),index:0})}),(function(){var e,t=Do(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=zo(n,r),t.index+=e.length,{value:e,done:!1})}));var Lo={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Uo=be("span").classList,Fo=Uo&&Uo.constructor&&Uo.constructor.prototype,Bo=Fo===Object.prototype?void 0:Fo,Vo=function(e){if(e&&e.forEach!==an)try{Pe(e,"forEach",an)}catch(t){e.forEach=an}};for(var qo in Lo)Lo[qo]&&Vo(o[qo]&&o[qo].prototype);Vo(Bo);var Ko=he("iterator"),Wo=he("toStringTag"),Go=rr.values,Jo=function(e,t){if(e){if(e[Ko]!==Go)try{Pe(e,Ko,Go)}catch(t){e[Ko]=Go}if(e[Wo]||Pe(e,Wo,t),Lo[t])for(var n in rr)if(e[n]!==rr[n])try{Pe(e,n,rr[n])}catch(t){e[n]=rr[n]}}};for(var $o in Lo)Jo(o[$o]&&o[$o].prototype,$o);Jo(Bo,"DOMTokenList");var Xo=function(){return Xo=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},Xo.apply(this,arguments)};function Qo(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function Yo(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Qo(arguments[t]));return e}var Ho=sr("splice"),Zo=o.TypeError,ea=Math.max,ta=Math.min;Rt({target:"Array",proto:!0,forced:!Ho},{splice:function(e,t){var n,r,i,o,a,s,c=te(this),u=lt(c),f=ct(e,u),l=arguments.length;if(0===l?n=r=0:1===l?(n=0,r=u-f):(n=l-2,r=ta(ea(ot(t),0),u-f)),u+n-r>9007199254740991)throw Zo("Maximum allowed length exceeded");for(i=Zt(c,r),o=0;o<r;o++)(a=f+o)in c&&or(i,o,c[a]);if(i.length=r,n<r){for(o=f;o<u-r;o++)s=o+n,(a=o+r)in c?c[s]=c[a]:delete c[s];for(o=u;o>u-r+n;o--)delete c[o-1]}else if(n>r)for(o=u-r;o>f;o--)s=o+n-1,(a=o+r-1)in c?c[s]=c[a]:delete c[s];for(o=0;o<n;o++)c[o+f]=arguments[o+2];return c.length=u-r+n,i}});var na=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 n=this;if(e&&t&&"function"==typeof t){this.on(e,(function r(i){t(i),n.off(e,r)}))}},e.prototype.off=function(e,t){if(e&&this._hooks[e]&&this._hooks[e].length)if(t){var n=this._hooks[e].indexOf(t);-1!==n&&this._hooks[e].splice(n,1)}else this._hooks[e]=[]},e.prototype.emit=function(e,t,n){if(n){if(!e)return;-1!==this._cache.indexOf(n)?this._emit(e,t):(this._hooksCache.hasOwnProperty(n)||(this._hooksCache[n]={}),this._hooksCache[n].hasOwnProperty(e)||(this._hooksCache[n][e]=[]),this._hooksCache[n][e].push(t))}else this._emit(e,t)},e.prototype._emit=function(e,t){e&&this._hooks[e]&&this._hooks[e].length&&Yo(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}(),ra=b([].join),ia=I!=Object,oa=rn("join",",");Rt({target:"Array",proto:!0,forced:ia||!oa},{join:function(e){return ra(T(this),void 0===e?",":e)}});var aa=nn.map,sa=sr("map");Rt({target:"Array",proto:!0,forced:!sa},{map:function(e){return aa(this,e,arguments.length>1?arguments[1]:void 0)}});var ca=function(e,t,n){var r,i;return Gn&&j(r=t.constructor)&&r!==n&&M(i=r.prototype)&&i!==n.prototype&&Gn(e,i),e},ua=b(1..valueOf),fa="\t\n\v\f\r                 \u2028\u2029\ufeff",la=b("".replace),ha="["+fa+"]",pa=RegExp("^"+ha+ha+"*"),da=RegExp(ha+ha+"*$"),ga=function(e){return function(t){var n=jo(k(t));return 1&e&&(n=la(n,pa,"")),2&e&&(n=la(n,da,"")),n}},va={start:ga(1),end:ga(2),trim:ga(3)},ma=bt.f,ya=xe.f,ba=Me.f,wa=va.trim,_a=o.Number,xa=_a.prototype,Sa=o.TypeError,Oa=b("".slice),Ia=b("".charCodeAt),Ea=function(e){var t=ge(e,"number");return"bigint"==typeof t?t:ka(t)},ka=function(e){var t,n,r,i,o,a,s,c,u=ge(e,"number");if(q(u))throw Sa("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=wa(u),43===(t=Ia(u,0))||45===t){if(88===(n=Ia(u,2))||120===n)return NaN}else if(48===t){switch(Ia(u,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+u}for(a=(o=Oa(u,2)).length,s=0;s<a;s++)if((c=Ia(o,s))<48||c>i)return NaN;return parseInt(o,r)}return+u};if(Mt("Number",!_a(" 0o1")||!_a("0b1")||_a("+0x1"))){for(var Ta,ja=function(e){var t=arguments.length<1?0:_a(Ea(e)),n=this;return A(xa,n)&&a((function(){ua(n)}))?ca(Object(t),n,ja):t},Ma=s?ma(_a):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),Pa=0;Ma.length>Pa;Pa++)re(_a,Ta=Ma[Pa])&&!re(ja,Ta)&&ba(ja,Ta,ya(_a,Ta));ja.prototype=xa,xa.constructor=ja,tt(o,"Number",ja,{constructor:!0})}var Ra=a((function(){hn(1)}));Rt({target:"Object",stat:!0,forced:Ra},{keys:function(e){return hn(te(e))}});var Aa=va.trim,Ca=o.parseInt,za=o.Symbol,Na=za&&za.iterator,Da=/^[+-]?0x/i,La=b(Da.exec),Ua=8!==Ca(fa+"08")||22!==Ca(fa+"0x16")||Na&&!a((function(){Ca(Object(Na))}))?function(e,t){var n=Aa(jo(e));return Ca(n,t>>>0||(La(Da,n)?16:10))}:Ca;Rt({global:!0,forced:parseInt!=Ua},{parseInt:Ua});var Fa=function(){var e=Ee(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},Ba=o.RegExp,Va=a((function(){var e=Ba("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),qa=Va||a((function(){return!Ba("a","y").sticky})),Ka={BROKEN_CARET:Va||a((function(){var e=Ba("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:qa,UNSUPPORTED_Y:Va},Wa=o.RegExp,Ga=a((function(){var e=Wa(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Ja=o.RegExp,$a=a((function(){var e=Ja("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Xa=Ze.get,Qa=Z("native-string-replace",String.prototype.replace),Ya=RegExp.prototype.exec,Ha=Ya,Za=b("".charAt),es=b("".indexOf),ts=b("".replace),ns=b("".slice),rs=function(){var e=/a/,t=/b*/g;return f(Ya,e,"a"),f(Ya,t,"a"),0!==e.lastIndex||0!==t.lastIndex}(),is=Ka.BROKEN_CARET,os=void 0!==/()??/.exec("")[1];(rs||os||is||Ga||$a)&&(Ha=function(e){var t,n,r,i,o,a,s,c=this,u=Xa(c),l=jo(e),h=u.raw;if(h)return h.lastIndex=c.lastIndex,t=f(Ha,h,l),c.lastIndex=h.lastIndex,t;var p=u.groups,d=is&&c.sticky,g=f(Fa,c),v=c.source,m=0,y=l;if(d&&(g=ts(g,"y",""),-1===es(g,"g")&&(g+="g"),y=ns(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Za(l,c.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,m++),n=new RegExp("^(?:"+v+")",g)),os&&(n=new RegExp("^"+v+"$(?!\\s)",g)),rs&&(r=c.lastIndex),i=f(Ya,d?n:c,y),d?i?(i.input=ns(i.input,m),i[0]=ns(i[0],m),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:rs&&i&&(c.lastIndex=c.global?i.index+i[0].length:r),os&&i&&i.length>1&&f(Qa,i[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&p)for(i.groups=a=_n(null),o=0;o<p.length;o++)a[(s=p[o])[0]]=i[s[1]];return i});var as=Ha;Rt({target:"RegExp",proto:!0,forced:/./.exec!==as},{exec:as});var ss=RegExp.prototype,cs=function(e){var t=e.flags;return void 0!==t||"flags"in ss||re(e,"flags")||!A(ss,e)?t:f(Fa,e)},us=ze.PROPER,fs=RegExp.prototype.toString,ls=a((function(){return"/a/b"!=fs.call({source:"a",flags:"b"})})),hs=us&&"toString"!=fs.name;(ls||hs)&&tt(RegExp.prototype,"toString",(function(){var e=Ee(this);return"/"+jo(e.source)+"/"+jo(cs(e))}),{unsafe:!0});var ps=he("species"),ds=RegExp.prototype,gs=function(e,t,n,r){var i=he(e),o=!a((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),s=o&&!a((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[ps]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!o||!s||n){var c=b(/./[i]),u=t(i,""[e],(function(e,t,n,r,i){var a=b(e),s=t.exec;return s===as||s===ds.exec?o&&!i?{done:!0,value:c(t,n,r)}:{done:!0,value:a(n,t,r)}:{done:!1}}));tt(String.prototype,e,u[0]),tt(ds,i,u[1])}r&&Pe(ds[i],"sham",!0)},vs=Co.charAt,ms=function(e,t,n){return t+(n?vs(e,t).length:1)},ys=o.TypeError,bs=function(e,t){var n=e.exec;if(j(n)){var r=f(n,e,t);return null!==r&&Ee(r),r}if("RegExp"===x(e))return f(as,e,t);throw ys("RegExp#exec called on incompatible receiver")};gs("match",(function(e,t,n){return[function(t){var n=k(this),r=null==t?void 0:$(t,e);return r?f(r,t,n):new RegExp(t)[e](jo(n))},function(e){var r=Ee(this),i=jo(e),o=n(t,r,i);if(o.done)return o.value;if(!r.global)return bs(r,i);var a=r.unicode;r.lastIndex=0;for(var s,c=[],u=0;null!==(s=bs(r,i));){var f=jo(s[0]);c[u]=f,""===f&&(r.lastIndex=ms(i,ft(r.lastIndex),a)),u++}return 0===u?null:c}]}));var ws=Math.floor,_s=b("".charAt),xs=b("".replace),Ss=b("".slice),Os=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Is=/\$([$&'`]|\d{1,2})/g,Es=function(e,t,n,r,i,o){var a=n+e.length,s=r.length,c=Is;return void 0!==i&&(i=te(i),c=Os),xs(o,c,(function(o,c){var u;switch(_s(c,0)){case"$":return"$";case"&":return e;case"`":return Ss(t,0,n);case"'":return Ss(t,a);case"<":u=i[Ss(c,1,-1)];break;default:var f=+c;if(0===f)return o;if(f>s){var l=ws(f/10);return 0===l?o:l<=s?void 0===r[l-1]?_s(c,1):r[l-1]+_s(c,1):o}u=r[f-1]}return void 0===u?"":u}))},ks=he("replace"),Ts=Math.max,js=Math.min,Ms=b([].concat),Ps=b([].push),Rs=b("".indexOf),As=b("".slice),Cs="$0"==="a".replace(/./,"$0"),zs=!!/./[ks]&&""===/./[ks]("a","$0");gs("replace",(function(e,t,n){var r=zs?"$":"$0";return[function(e,n){var r=k(this),i=null==e?void 0:$(e,ks);return i?f(i,e,r,n):f(t,jo(r),e,n)},function(e,i){var o=Ee(this),a=jo(e);if("string"==typeof i&&-1===Rs(i,r)&&-1===Rs(i,"$<")){var s=n(t,o,a,i);if(s.done)return s.value}var c=j(i);c||(i=jo(i));var u=o.global;if(u){var f=o.unicode;o.lastIndex=0}for(var l=[];;){var h=bs(o,a);if(null===h)break;if(Ps(l,h),!u)break;""===jo(h[0])&&(o.lastIndex=ms(a,ft(o.lastIndex),f))}for(var p,d="",g=0,v=0;v<l.length;v++){for(var m=jo((h=l[v])[0]),y=Ts(js(ot(h.index),a.length),0),b=[],w=1;w<h.length;w++)Ps(b,void 0===(p=h[w])?p:String(p));var _=h.groups;if(c){var x=Ms([m],b,y,a);void 0!==_&&Ps(x,_);var S=jo(Ur(i,void 0,x))}else S=Es(m,a,y,b,_,i);y>=g&&(d+=As(a,g,y)+S,g=y+m.length)}return d+As(a,g)}]}),!!a((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!Cs||zs);var Ns=Object.is||function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};gs("search",(function(e,t,n){return[function(t){var n=k(this),r=null==t?void 0:$(t,e);return r?f(r,t,n):new RegExp(t)[e](jo(n))},function(e){var r=Ee(this),i=jo(e),o=n(t,r,i);if(o.done)return o.value;var a=r.lastIndex;Ns(a,0)||(r.lastIndex=0);var s=bs(r,i);return Ns(r.lastIndex,a)||(r.lastIndex=a),null===s?-1:s.index}]}));var Ds=he("match"),Ls=function(e){var t;return M(e)&&(void 0!==(t=e[Ds])?!!t:"RegExp"==x(e))},Us=o.Array,Fs=Math.max,Bs=function(e,t,n){for(var r=lt(e),i=ct(t,r),o=ct(void 0===n?r:n,r),a=Us(Fs(o-i,0)),s=0;i<o;i++,s++)or(a,s,e[i]);return a.length=s,a},Vs=Ka.UNSUPPORTED_Y,qs=Math.min,Ks=[].push,Ws=b(/./.exec),Gs=b(Ks),Js=b("".slice);gs("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=jo(k(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!Ls(e))return f(t,r,e,i);for(var o,a,s,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,h=new RegExp(e.source,u+"g");(o=f(as,h,r))&&!((a=h.lastIndex)>l&&(Gs(c,Js(r,l,o.index)),o.length>1&&o.index<r.length&&Ur(Ks,c,Bs(o,1)),s=o[0].length,l=a,c.length>=i));)h.lastIndex===o.index&&h.lastIndex++;return l===r.length?!s&&Ws(h,"")||Gs(c,""):Gs(c,Js(r,l)),c.length>i?Bs(c,0,i):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:f(t,this,e,n)}:t,[function(t,n){var i=k(this),o=null==t?void 0:$(t,e);return o?f(o,t,i,n):f(r,jo(i),t,n)},function(e,i){var o=Ee(this),a=jo(e),s=n(r,o,a,i,r!==t);if(s.done)return s.value;var c=zr(o,RegExp),u=o.unicode,f=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Vs?"g":"y"),l=new c(Vs?"^(?:"+o.source+")":o,f),h=void 0===i?4294967295:i>>>0;if(0===h)return[];if(0===a.length)return null===bs(l,a)?[a]:[];for(var p=0,d=0,g=[];d<a.length;){l.lastIndex=Vs?0:d;var v,m=bs(l,Vs?Js(a,d):a);if(null===m||(v=qs(ft(l.lastIndex+(Vs?d:0)),a.length))===p)d=ms(a,d,u);else{if(Gs(g,Js(a,p,d)),g.length===h)return g;for(var y=1;y<=m.length-1;y++)if(Gs(g,m[y]),g.length===h)return g;d=p=v}}return Gs(g,Js(a,p)),g}]}),!!a((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Vs);var $s,Xs=function(e){return null!=e&&"[object Object]"==Object.prototype.toString.call(e)},Qs=($s=+Date.now()+Number((""+Math.random()).slice(2,8)),function(){return $s+=1}),Ys=function(e){return function(e,t,n){if("string"==typeof e&&"number"==typeof t&&"number"==typeof n){var r,i=[];n=n<=25?n:n%25;var o=String.fromCharCode(n+97);r=e.split(o);for(var a=0;a<r.length;a++){var s=parseInt(r[a],n);s=1*s^t;var c=String.fromCharCode(s);i.push(c)}return i.join("")}}(e,64,25)},Hs=function(e){var t=document.createElement("a");return t.href=e,t},Zs=va.trim,ec=b("".charAt),tc=o.parseFloat,nc=o.Symbol,rc=nc&&nc.iterator,ic=1/tc(fa+"-0")!=-1/0||rc&&!a((function(){tc(Object(rc))}))?function(e){var t=Zs(jo(e)),n=tc(t);return 0===n&&"-"==ec(t,0)?-0:n}:tc;Rt({global:!0,forced:parseFloat!=ic},{parseFloat:ic});var oc=Me.f,ac=function(e,t,n){n in e||oc(e,n,{configurable:!0,get:function(){return t[n]},set:function(e){t[n]=e}})},sc=bt.f,cc=Ze.enforce,uc=he("match"),fc=o.RegExp,lc=fc.prototype,hc=o.SyntaxError,pc=b(lc.exec),dc=b("".charAt),gc=b("".replace),vc=b("".indexOf),mc=b("".slice),yc=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,bc=/a/g,wc=/a/g,_c=new fc(bc)!==bc,xc=Ka.MISSED_STICKY,Sc=Ka.UNSUPPORTED_Y,Oc=s&&(!_c||xc||Ga||$a||a((function(){return wc[uc]=!1,fc(bc)!=bc||fc(wc)==wc||"/a/i"!=fc(bc,"i")})));if(Mt("RegExp",Oc)){for(var Ic=function(e,t){var n,r,i,o,a,s,c=A(lc,this),u=Ls(e),f=void 0===t,l=[],h=e;if(!c&&u&&f&&e.constructor===Ic)return e;if((u||A(lc,e))&&(e=e.source,f&&(t=cs(h))),e=void 0===e?"":jo(e),t=void 0===t?"":jo(t),h=e,Ga&&"dotAll"in bc&&(r=!!t&&vc(t,"s")>-1)&&(t=gc(t,/s/g,"")),n=t,xc&&"sticky"in bc&&(i=!!t&&vc(t,"y")>-1)&&Sc&&(t=gc(t,/y/g,"")),$a&&(o=function(e){for(var t,n=e.length,r=0,i="",o=[],a={},s=!1,c=!1,u=0,f="";r<=n;r++){if("\\"===(t=dc(e,r)))t+=dc(e,++r);else if("]"===t)s=!1;else if(!s)switch(!0){case"["===t:s=!0;break;case"("===t:pc(yc,mc(e,r+1))&&(r+=2,c=!0),i+=t,u++;continue;case">"===t&&c:if(""===f||re(a,f))throw new hc("Invalid capture group name");a[f]=!0,o[o.length]=[f,u],c=!1,f="";continue}c?f+=t:i+=t}return[i,o]}(e),e=o[0],l=o[1]),a=ca(fc(e,t),c?this:lc,Ic),(r||i||l.length)&&(s=cc(a),r&&(s.dotAll=!0,s.raw=Ic(function(e){for(var t,n=e.length,r=0,i="",o=!1;r<=n;r++)"\\"!==(t=dc(e,r))?o||"."!==t?("["===t?o=!0:"]"===t&&(o=!1),i+=t):i+="[\\s\\S]":i+=t+dc(e,++r);return i}(e),n)),i&&(s.sticky=!0),l.length&&(s.groups=l)),e!==h)try{Pe(a,"source",""===h?"(?:)":h)}catch(e){}return a},Ec=sc(fc),kc=0;Ec.length>kc;)ac(Ic,fc,Ec[kc++]);lc.constructor=Ic,Ic.prototype=lc,tt(o,"RegExp",Ic,{constructor:!0})}Pr("RegExp");var Tc,jc=ze.PROPER,Mc=va.trim;Rt({target:"String",proto:!0,forced:(Tc="trim",a((function(){return!!fa[Tc]()||"​…᠎"!=="​…᠎"[Tc]()||jc&&fa[Tc].name!==Tc})))},{trim:function(){return Mc(this)}});var Pc=function(){function e(e){this.appid=e,this.userAgent=window.navigator.userAgent,this.appVersion=window.navigator.appVersion}return e.prototype.init=function(){var e=window.navigator.userAgent,t=window.navigator.language,n=document.referrer,r=n?Hs(n).hostname:"";!function(e){var t={};try{var n=Hs(e).search;(n=n.slice(1)).split("&").forEach((function(e){var n,r,i=e.split("=");i.length&&(n=i[0],r=i[1]);try{t[n]=decodeURIComponent(void 0===r?"":r)}catch(e){t[n]=r}}))}catch(e){}}(window.location.href);var i=/Mobile|htc|mini|Android|iP(ad|od|hone)/.test(this.appVersion)?"wap":"web",o=this.browser(),a=this.os();return{browser:o.browser,browser_version:o.browser_version,platform:i,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:n,referrer_host:r}},e.prototype.browser=function(){var e,t,n="",r=""+parseFloat(this.appVersion),i=this.userAgent;return-1!==i.indexOf("Edge")||-1!==i.indexOf("Edg")?(n="Microsoft Edge",-1!==i.indexOf("Edge")?(e=i.indexOf("Edge"),r=i.substring(e+5)):(e=i.indexOf("Edg"),r=i.substring(e+4))):-1!==(e=i.indexOf("MSIE"))?(n="Microsoft Internet Explorer",r=i.substring(e+5)):-1!==(e=i.indexOf("Lark"))?(n="Lark",r=i.substring(e+5,e+11)):-1!==(e=i.indexOf("MetaSr"))?(n="sougoubrowser",r=i.substring(e+7,e+10)):-1!==i.indexOf("MQQBrowser")||-1!==i.indexOf("QQBrowser")?(n="qqbrowser",-1!==i.indexOf("MQQBrowser")?(e=i.indexOf("MQQBrowser"),r=i.substring(e+11,e+15)):-1!==i.indexOf("QQBrowser")&&(e=i.indexOf("QQBrowser"),r=i.substring(e+10,e+17))):-1!==i.indexOf("Chrome")?-1!==(e=i.indexOf("MicroMessenger"))?(n="weixin",r=i.substring(e+15,e+20)):-1!==(e=i.indexOf("360"))?(n="360browser",r=i.substring(i.indexOf("Chrome")+7)):-1!==i.indexOf("baidubrowser")||-1!==i.indexOf("BIDUBrowser")?(-1!==i.indexOf("baidubrowser")?(e=i.indexOf("baidubrowser"),r=i.substring(e+13,e+16)):-1!==i.indexOf("BIDUBrowser")&&(e=i.indexOf("BIDUBrowser"),r=i.substring(e+12,e+15)),n="baidubrowser"):-1!==(e=i.indexOf("xiaomi"))?-1!==i.indexOf("openlanguagexiaomi")?(n="openlanguage xiaomi",r=i.substring(e+7,e+13)):(n="xiaomi",r=i.substring(e-7,e-1)):-1!==(e=i.indexOf("TTWebView"))?(n="TTWebView",r=i.substring(e+10,e+23)):(-1!==(e=i.indexOf("Chrome"))||-1!==(e=i.indexOf("Chrome")))&&(n="Chrome",r=i.substring(e+7)):-1!==i.indexOf("Safari")?-1!==(e=i.indexOf("QQ"))?(n="qqbrowser",r=i.substring(e+10,e+16)):-1!==(e=i.indexOf("Safari"))&&(n="Safari",r=i.substring(e+7),-1!==(e=i.indexOf("Version"))&&(r=i.substring(e+8))):-1!==(e=i.indexOf("Firefox"))?(n="Firefox",r=i.substring(e+8)):-1!==(e=i.indexOf("MicroMessenger"))?(n="weixin",r=i.substring(e+15,e+20)):-1!==(e=i.indexOf("QQ"))?(n="qqbrowser",r=i.substring(e+3,e+8)):-1!==(e=i.indexOf("Opera"))&&(n="Opera",r=i.substring(e+6),-1!==(e=i.indexOf("Version"))&&(r=i.substring(e+8))),-1!==(t=r.indexOf(";"))&&(r=r.substring(0,t)),-1!==(t=r.indexOf(" "))&&(r=r.substring(0,t)),-1!==(t=r.indexOf(")"))&&(r=r.substring(0,t)),{browser:n,browser_version:r}},e.prototype.os=function(){for(var e="",t="",n=[{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)/}],r=0;r<n.length;r++){var i=n[r];if(i.r.test(this.userAgent)){"Mac OS X"===(e=i.s)&&this.isNewIpad()&&(e="iOS");break}}var o=function(e,t){var n=e.exec(t);return n&&n[1]?n[1]:""},a=function(e,t){var n=RegExp("(?:^|[^A-Z0-9-_]|[^A-Z0-9-]_|sprd-)(?:"+e+")","i").exec(t);return n?n.slice(1)[0]:""};/Windows/.test(e)&&(t=o(/Windows (.*)/,e),e="windows");switch(e){case"Mac OS X":t=a("Mac[ +]OS[ +]X(?:[ /](?:Version )?(\\d+(?:[_\\.]\\d+)+))?",this.userAgent),e="mac";break;case"Android":t=function(e){var t=o(/Android ([\.\_\d]+)/,e);return t||(t=o(/Android\/([\.\_\d]+)/,e)),t}(this.userAgent),e="android";break;case"iOS":t=this.isNewIpad()?a("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 n=navigator.userAgent.replace("Mozilla/5.0 (",""),r=n.indexOf(";");t=n.slice(0,r)}}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}(),Rc=t((function(e,t){e.exports=function(){function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}function t(n,r){function i(t,i,o){if("undefined"!=typeof document){"number"==typeof(o=e({},r,o)).expires&&(o.expires=new Date(Date.now()+864e5*o.expires)),o.expires&&(o.expires=o.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var a="";for(var s in o)o[s]&&(a+="; "+s,!0!==o[s]&&(a+="="+o[s].split(";")[0]));return document.cookie=t+"="+n.write(i,t)+a}}function o(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],r={},i=0;i<t.length;i++){var o=t[i].split("="),a=o.slice(1).join("=");try{var s=decodeURIComponent(o[0]);if(r[s]=n.read(a,s),e===s)break}catch(e){}}return e?r[e]:r}}return Object.create({set:i,get:o,remove:function(t,n){i(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(r)},converter:{value:Object.freeze(n)}})}return t({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}()})),Ac=Rc,Cc=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}();var zc,Nc={getItem:function(e){try{var t=localStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return n||{}}catch(e){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);localStorage.setItem(e,n)}catch(e){}},removeItem:function(e){try{localStorage.removeItem(e)}catch(e){}},getCookie:function(e,t){try{return Ac.get(e,{domain:t||document.domain})}catch(e){return""}},setCookie:function(e,t,n,r){try{var i=r||document.domain,o=+new Date+n;Ac.set(e,t,{expires:new Date(o),path:"/",domain:i})}catch(e){}},isSupportLS:function(){try{return localStorage.setItem("_ranger-test-key","hi"),localStorage.getItem("_ranger-test-key"),localStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},Dc={getItem:function(e){try{var t=sessionStorage.getItem(e),n=t;try{t&&"string"==typeof t&&(n=JSON.parse(t))}catch(e){}return n||{}}catch(e){}return{}},setItem:function(e,t){try{var n="string"==typeof t?t:JSON.stringify(t);sessionStorage.setItem(e,n)}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:function(){try{return sessionStorage.setItem("_ranger-test-key","hi"),sessionStorage.getItem("_ranger-test-key"),sessionStorage.removeItem("_ranger-test-key"),!0}catch(e){return!1}}()},Lc=function(){function e(e,t){this._storage=t&&"session"===t?Dc:!e&&Nc.isSupportLS?Nc:new Cc}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,n,r){this._storage.setCookie(e,t,n,r)},e.prototype.removeItem=function(e){this._storage.removeItem(e)},e}(),Uc={cn:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az24z1mz1jz1az1cz18z1nz1nz1jz1mz1ez4az1az1mz1k",va:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az1gz22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k",sg:"1fz22z22z1nz21z4mz4bz4bz1kz1az21z4az22z1mz19z21z1lz21z21z1bz1iz4az1az1mz1k"},Fc=void 0,Bc=(new Date).getTimezoneOffset(),Vc=parseInt(""+-Bc/60,10),qc=60*Bc,Kc=function(){function e(e,t){this.is_first_time=!0,this.initConfig=t,this.collect=e;var n=new Pc(t.app_id).init(),r="__tea_cache_first_"+t.app_id;this.configKey="__tea_cache_config_"+t.app_id,this.sessionStorage=new Lc(!1,"session"),this.localStorage=new Lc(!1,"local");var i=this.localStorage.getItem(r);i&&1==i?this.is_first_time=!1:(this.is_first_time=!0,this.localStorage.setItem(r,"1")),this.envInfo={user:{user_unique_id:Fc,user_type:Fc,user_id:Fc,user_is_auth:Fc,user_is_login:Fc,device_id:Fc,web_id:Fc,user_unique_id_type:Fc},header:{app_id:Fc,app_name:Fc,app_install_id:Fc,install_id:Fc,app_package:Fc,app_channel:Fc,app_version:Fc,ab_version:Fc,os_name:n.os_name,os_version:n.os_version,device_model:n.device_model,ab_client:Fc,traffic_type:Fc,client_ip:Fc,device_brand:Fc,os_api:Fc,access:Fc,language:n.language,region:Fc,app_language:Fc,app_region:Fc,creative_id:Fc,ad_id:Fc,campaign_id:Fc,log_type:Fc,rnd:Fc,platform:n.platform,sdk_version:"0.0.3-lite",sdk_lib:"js",province:Fc,city:Fc,timezone:Vc,tz_offset:qc,tz_name:Fc,sim_region:Fc,carrier:Fc,resolution:n.screen_width+"x"+n.screen_height,browser:n.browser,browser_version:n.browser_version,referrer:n.referrer,referrer_host:n.referrer_host,width:n.screen_width,height:n.screen_height,screen_width:n.screen_width,screen_height:n.screen_height,utm_term:Fc,utm_content:Fc,utm_source:Fc,utm_medium:Fc,utm_campaign:Fc,custom:{},wechat_unionid:Fc,wechat_openid:Fc}},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=Ys(Uc[t])}},e.prototype.setDomain=function(e){this.domain=e},e.prototype.getDomain=function(){return this.domain},e.prototype.getUrl=function(e){var t="";switch(e){case"event":t=this.initConfig.report_url||"/list";break;case"webid":t="/webid"}return""+this.getDomain()+t},e.prototype.set=function(e){var t=this;Object.keys(e).forEach((function(n){"evtParams"===n?t.evtParams=Xo({},t.evtParams||{},e.evtParams||{}):"_staging_flag"===n?t.evtParams=Xo({},t.evtParams||{},{_staging_flag:e._staging_flag}):"reportErrorCallback"===n&&"function"==typeof e[n]?t.reportErrorCallback=e[n]:Object.hasOwnProperty.call(t.envInfo.user,n)?["user_id","web_id","user_unique_id"].indexOf(n)>-1&&(t.envInfo.user[n]=e[n]?String(e[n]):e[n]):Object.hasOwnProperty.call(t.envInfo.header,n)?t.envInfo.header[n]=e[n]:t.envInfo.header.custom[n]=e[n]}))},e.prototype.get=function(e){try{return e?"evtParams"===e?this.evtParams:"reportErrorCallback"===e?this[e]:Object.hasOwnProperty.call(this.envInfo.user,e)?this.envInfo.user[e]:Object.hasOwnProperty.call(this.envInfo.header,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}();!function(e){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.TokenChange="token-change",e.TokenReset="token-reset",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"}(zc||(zc={}));var Wc=zc,Gc=/MSIE .\./.test(C),Jc=o.Function,$c=function(e){return Gc?function(t,n){var r=Br(arguments.length,1)>2,i=j(t)?t:Jc(t),o=r?cr(arguments,2):void 0;return e(r?function(){Ur(i,this,o)}:i,n)}:e},Xc={setTimeout:$c(o.setTimeout),setInterval:$c(o.setInterval)},Qc=Xc.setInterval;Rt({global:!0,bind:!0,forced:o.setInterval!==Qc},{setInterval:Qc});var Yc=Xc.setTimeout;Rt({global:!0,bind:!0,forced:o.setTimeout!==Yc},{setTimeout:Yc});var Hc=500,Zc=5005;function eu(e,t,n,r,i,o,a,s,c){try{var u=new XMLHttpRequest,f=s||"POST";u.open(f,""+e,!0),u.setRequestHeader("Content-Type","application/json; charset=utf-8"),n&&(u.timeout=n,u.ontimeout=function(){o&&o(t,Zc)}),u.onload=function(){if(i){var e=null;if(u.responseText){try{e=JSON.parse(u.responseText)}catch(t){e={}}i(e,t)}}},u.onerror=function(){u.abort(),o&&o(t,Hc)},c?u.send(t):u.send(JSON.stringify(t))}catch(e){}}var tu=4003,nu=function(){function e(){this.eventLimit=50,this.eventCache=[],this.beconEventCache=[]}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=e.configManager,this.cacheStorgae=new Lc(!0),this.localStorage=new Lc(!1),this.maxReport=t.max_report||20,this.reportTime=t.reportTime||30,this.timeout=t.timeout||1e5,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.collect.on(Wc.Ready,(function(){n.reportAll(!1)})),this.collect.on(Wc.Event,(function(e){n.event(e)})),this.collect.on(Wc.BeconEvent,(function(e){n.beconEvent(e)})),this.linster()},e.prototype.linster=function(){var e,t=this;window.addEventListener("unload",(function(){t.reportAll(!0)}),!1),e=function(){t.reportAll(!0)},navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)?window.addEventListener("pagehide",e,!1):window.addEventListener("beforeunload",e,!1),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t.reportAll(!0)}),!1)},e.prototype.reportAll=function(e){this.report(e),this.reportBecon()},e.prototype.event=function(e){var t=this;try{var n=Yo(e,this.cacheStorgae.getItem(this.eventKey)||[]);if(this.cacheStorgae.setItem(this.eventKey,n),this.reportTimeout&&clearTimeout(this.reportTimeout),n.length>=this.maxReport)this.report(!1);else{var r=this.reportTime;this.reportTimeout=setTimeout((function(){t.report(!1),t.reportTimeout=null}),r)}}catch(e){}},e.prototype.beconEvent=function(e){var t=Yo(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(){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 n=0;n<e.length;n+=this.eventLimit){var r;r=e.slice(n,n+this.eventLimit);var i=this.split(this.merge(r));this.send(i,t)}else{i=this.split(this.merge(e));this.send(i,t)}},e.prototype.merge=function(e){var t=this,n=this.configManager.get(),r=n.header,i=n.user;r.custom=JSON.stringify(r.custom);var o=this.configManager.get("evtParams"),a=e.map((function(e){try{return Object.keys(o).length&&(e.params=Xo({},o,e.params)),e.session_id=t.collect.sessionManager.getSessionId(),e.params=JSON.stringify(e.params),e}catch(t){return e}})),s=[];if(!Object.keys(i).length)return console.warn("user info error,cant report"),s;var c=JSON.parse(JSON.stringify({events:a,user:i,header:r}));return c.local_time=Math.floor(Date.now()/1e3),c.verbose=1,s.push(c),s},e.prototype.split=function(e){return e=e.map((function(e){var t=[];return t.push(e),t}))},e.prototype.send=function(e,t){var n=this;e.length&&e.forEach((function(e){try{if(!e.length)return;!function(e,t,n,r,i,o,a,s){a&&window.navigator&&window.navigator.sendBeacon?window.navigator.sendBeacon(e,JSON.stringify(t))?i():o(e,t,tu):eu(e,t,n,0,i,o,0,"",s)}(n.reportUrl,e,n.timeout,0,(function(e,t){}),(function(e,t){n.configManager.get("reportErrorCallback")(e,t)}),t,!1)}catch(e){console.warn("something error, "+JSON.stringify(e.stack))}}))},e}(),ru=function e(t){return t?(t^16*Math.random()>>t/4).toString(10):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e)},iu=function(){return ru().replace(/-/g,"").slice(0,19)},ou=function(){function e(){this.cacheToken={}}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.config=t,this.configManager=this.collect.configManager,this.storage=new Lc(!1),this.tokenKey="__tea_cache_tokens_"+t.app_id,this.collect.on(Wc.ConfigUuid,(function(e){n.setUuid(e)})),this.checkStorage()},e.prototype.checkStorage=function(){this.cacheToken=this.storage.getItem(this.tokenKey)||{},this.check()},e.prototype.check=function(){this.cacheToken&&this.cacheToken.web_id?this.complete(this.cacheToken):this.remoteWebid()},e.prototype.remoteWebid=function(){var e=this,t=this.configManager.getUrl("webid"),n={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:""},r=iu();eu(t,n,3e5,0,(function(t){var n;t&&0===t.e?n=t.web_id:(n=r,e.collect.configManager.set({localWebId:r}),e.collect.logger.warn("appid: "+e.config.app_id+" get webid error, use local webid~")),e.complete({web_id:e.configManager.get("web_id")||n,user_unique_id:e.configManager.get("user_unique_id")||n})}),(function(){e.complete({web_id:e.configManager.get("web_id")||r,user_unique_id:e.configManager.get("user_unique_id")||r}),e.collect.configManager.set({localWebId:r}),e.collect.logger.warn("appid: "+e.config.app_id+", get webid error, use local webid~")}))},e.prototype.complete=function(e){var t=e.web_id,n=e.user_unique_id;t||n?(e.timestamp=Date.now(),this.collect.configManager.set({web_id:t,user_unique_id:n}),this.setStorage(e),this.tokenReady=!0,this.collect.emit(Wc.TokenComplete)):console.warn("token error")},e.prototype.setUuid=function(e){if(e&&-1===["null","undefined","Null","None"].indexOf(e)){var t=String(e),n=this.configManager.get("user_unique_id"),r=this.cacheToken&&this.cacheToken.user_unique_id;if(t===n&&t===r)return;this.configManager.set({user_unique_id:t}),this.cacheToken||(this.cacheToken={}),this.cacheToken.user_unique_id=t,this.cacheToken.timestamp=Date.now(),this.setStorage(this.cacheToken)}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(Wc.TokenReset))},e.prototype.setStorage=function(e){e._type_="default",this.storage.setItem(this.tokenKey,e),this.cacheToken=e},e.prototype.getReady=function(){return this.tokenReady},e}(),au=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)}))},su=function(){function e(){}return e.prototype.apply=function(e,t){var n=this;this.collect=e,this.storage=new Lc(!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(Wc.SessionReset,(function(){n.resetSessionId()})),this.collect.on(Wc.SessionResetTime,(function(){n.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:au(),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:au(),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:au(),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:au(),timestamp:Date.now()},this.storage.setItem(this.sessionKey,e)))},e}(),cu=function(){function e(e){this.disableAutoPageView=!1,this.staging=!1,this.sended=!1,this.started=!1,this.adapters={},this.sdkReady=!1,this.name=e,this.hook=new na,this.Types=Wc,this.adapters.fetch=eu,this.adapters.storage=Lc}return e.prototype.init=function(e){var t,n=this;this.inited?console.log("init can be call only one time"):e&&Xs(e)?e.app_id&&("number"==typeof(t=e.app_id)&&!isNaN(t))?!e.app_key||function(e){return"string"==typeof e}(e.app_key)?(e.channel_domain||-1!==["cn","sg","va"].indexOf(e.channel)||(console.warn("channel must be `cn`, `sg`,`va` !!!"),e.channel="cn"),this.inited=!0,this.configManager=new Kc(this,e),this.initConfig=e,e.disable_auto_pv&&(this.disableAutoPageView=!0),this.configManager.set({app_id:e.app_id}),this.eventManager=new nu,this.tokenManager=new ou,this.sessionManager=new su,Promise.all([new Promise((function(e){n.once(Wc.TokenComplete,(function(){e(!0)}))})),new Promise((function(e){n.once(Wc.Start,(function(){e(!0)}))}))]).then((function(){n.sdkReady=!0,n.emit(Wc.Ready),console.info("appid: "+e.app_id+", userInfo:"+JSON.stringify(n.configManager.get("user"))),console.info("appid: "+e.app_id+", sdk is ready, version is 0.0.3-lite, you can report now !!!"),n.pageView()})),this.tokenManager.apply(this,e),this.eventManager.apply(this,e),this.sessionManager.apply(this,e),this.emit(Wc.Init)):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&&Xs(e)){e._staging_flag&&1===e._staging_flag&&(this.staging=!0),e.disable_auto_pv&&(this.disableAutoPageView=!0,delete e.disable_auto_pv);var t=Xo({},e);t.user_unique_id;var n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}(t,["user_unique_id"]);t.hasOwnProperty("user_unique_id")&&this.emit(Wc.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.getConfig=function(e){return this.configManager.get(e)},e.prototype.start=function(){this.inited&&!this.sended&&(this.sended=!0,this.emit(Wc.Start))},e.prototype.event=function(e,t){var n=this;try{var r=[];Array.isArray(e)?e.forEach((function(e){r.push(n.processEvent(e[0],e[1]||{}))})):r.push(this.processEvent(e,t)),r.length&&(this.emit(Wc.Event,r),this.emit(Wc.SessionResetTime))}catch(e){console.warn("something error, please check")}},e.prototype.beconEvent=function(e,t){if(Array.isArray(e))console.warn("beconEvent not support batch report, please check");else{var n=[];n.push(this.processEvent(e,t||{})),n.length&&(this.emit(Wc.BeconEvent,n),this.emit(Wc.SessionResetTime))}},e.prototype.processEvent=function(e,t){void 0===t&&(t={});try{var n=e;/^event\./.test(e)&&(n=e.slice(6));var r=t;"object"!=typeof r&&(r={}),r.event_index=Qs();var i=void 0;return r.local_ms?(i=r.local_ms,delete r.local_ms):i=+new Date,{event:n,params:r,local_time_ms:i}}catch(n){return{event:e,params:t}}},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,n){this.hook.emit(e,t,n)},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&&this.configManager.is_first_time)},n=Xo({},t,e);this.event("predefine_pageview",n)},e}(),uu=new cu("default"),fu=cu;export{fu as Collector,uu as default};