hina-cloud-js-sdk 3.1.7 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/hina.cjs.js +1 -0
- package/dist/hina.esm.full.js +1 -0
- package/dist/hina.esm.js +1 -0
- package/dist/hina.full.js +1 -0
- package/dist/hina.iife.js +1 -0
- package/dist/index.d.ts +411 -0
- package/package.json +28 -43
- package/readme.md +1 -0
- package/.eslintrc.js +0 -12
- package/.gitlab-ci.yml +0 -20
- package/.vscode/settings.json +0 -5
- package/build/hina.esm.min.js +0 -1
- package/build/hina.min.js +0 -4
- package/build/hotAnalyse.min.js +0 -1
- package/report.json +0 -101
- package/rollup.config.epm.js +0 -42
- package/rollup.config.sdk.js +0 -42
- package/sonar-project.properties +0 -3
@@ -0,0 +1 @@
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).hinaDataStatistic={})}(this,(function(t){"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},e(t,r)};function r(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}var o,i,n,a,s,c,u=function(){return u=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},u.apply(this,arguments)};function l(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],o=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,i,n=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function d(t,e,r){if(r||2===arguments.length)for(var o,i=0,n=e.length;i<n;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError,t.ConsoleTypes=void 0,(o=t.ConsoleTypes||(t.ConsoleTypes={})).LOG="log",o.INFO="info",o.WARN="warn",o.ERROR="error",o.ASSERT="assert",t.ReportTypes=void 0,(i=t.ReportTypes||(t.ReportTypes={})).BEACON="beacon",i.IMAGE="image",i.AJAX="ajax",t.PlatformTypes=void 0,(n=t.PlatformTypes||(t.PlatformTypes={})).WEB="web",n.MINI_APP="mini_app",t.ErrorTypes=void 0,(a=t.ErrorTypes||(t.ErrorTypes={})).JS_ERROR="JsError",a.RESOURCE_ERROR="ResourceError",a.FETCH_ERROR="FetchError",a.AJAX_ERROR="AjaxError",a.PROMISE_ERROR="PromiseError",a.WHITE_SCREEN_ERROR="WhiteScreenError",a.VUE_ERROR="VueError",a.REACT_ERROR="ReactError",a.CAPTURE_EVENT="CaptureEvent",a.CAPTURE_EXCEPTION="CaptureException",t.PerformanceFeat=void 0,(s=t.PerformanceFeat||(t.PerformanceFeat={})).BASIC="basic",s.VITALS="vitals",s.RESOURCE="resource",s.LONG_TASK="longtask",t.VariablesTypes=void 0,(c=t.VariablesTypes||(t.VariablesTypes={})).INTEGER="INTEGER",c.STRING="STRING",c.BOOLEAN="BOOLEAN";var f=function(t,e){this.options=t,this.context=e},h=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],g=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],v=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],m={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"},y="hinasdk_domain_test",_=Object.prototype.toString;function w(t){return"[object Object]"===_.call(t)}function b(t){return null!=t}function T(t){return Array.isArray(t)}function k(t){return"function"==typeof t}function S(t){return"string"==typeof t}function H(t){return"number"==typeof t}function R(t){return"boolean"==typeof t}function x(t){var e="";if(S(t))return t;if(null==t?void 0:t.stack)e=w(t.stack)?JSON.stringify(t.stack):t.stack;else{if(!t)return"未知js错误";e=w(t)?JSON.stringify(t):t.toString()}return e}function E(){}function C(t){try{return JSON.parse(t)}catch(t){}return t}function A(t){try{return JSON.stringify(t)}catch(e){return t}}function P(t){return 0===Object.keys(t).length}function L(){return Date.now&&k(Date.now)?Date.now():(new Date).getTime()}function I(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach((function(t){t&&Object.keys(t).forEach((function(e){var o=t[e];w(o)?w(r[e])?r[e]=I(r[e],o):r[e]=I(o):r[e]=o}))})),r}function N(t){return Object.keys(t).reduce((function(e,r){return b(t[r])&&""!==t[r]&&(e[r]=t[r]),e}),{})}function O(t){var e={};try{e=new URL(t)}catch(t){}return e}function D(t,e){if(void 0===e&&(e=3),!t)return t;var r=t.toString(),o=r.indexOf(".");return r=-1!==o?r.substring(0,o+e+1):r.substring(0),parseFloat(r)}function U(t){t=t||window.location.hostname,/^[a-zA-Z0-9\u4e00-\u9fa5\-\\.]+$/.exec(t)||(t="");var e=t.split(".");if(e.length>=2&&!/^(\d+\.)+\d+$/.test(t))for(var r=".".concat(e.splice(e.length-1,1));e.length>0;)if(r=".".concat(e.splice(e.length-1,1)).concat(r),document.cookie="".concat(y,"=true; path=/; domain=").concat(r),-1!==document.cookie.indexOf("".concat(y,"=true")))return document.cookie="".concat(y,"=true; path=/; domain=").concat(r,"; max-age=0"),r;return""}function q(){var t=U();return""===t?"url解析失败":t}function B(t){var e=t||document.referrer;return"string"!=typeof e?"referrer exception".concat(String(e)):(e.startsWith("https://www.baidu.com/")&&(e=e.split("?")[0]),"string"==typeof(e=e.slice(0,200))?e:"")}function j(t,e){return e&&"string"==typeof e||(e="hostname解析异常"),t&&(O(t).hostname||"")||e}function F(){var t=L(),e=Math.floor(1e6*Math.random());return"".concat(t,"_").concat(e)}function M(){var t=L(),e=Math.floor(1e6*Math.random());return Number(String(t).slice(-5)+String(e).slice(0,4))}function W(t){for(var e=5381,r=t.length;r;)e=33*e^t.charCodeAt(--r);return e>>>0}function z(t,e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),t=decodeURIComponent(t);var r=new RegExp("[\\?&]".concat(e,"=([^&#]*)")).exec(t);return null===r||r&&"string"!=typeof r[1]&&r[1].length?"":decodeURIComponent(r[1])}function V(t){try{return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x".concat(e)))})))}catch(e){return t}}function J(t,e,r,o){if(void 0!==t&&(e in t||o)){var i=r(t[e]);k(i)&&(t[e]=i)}}function K(t){if(!t)return"";var e=t.match(/\/([^/]+)$/);return e?e[1]:""}function G(t){if(void 0===(null==t?void 0:t.stack)||!(null==t?void 0:t.stack))return[];for(var e,r=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,o=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,i=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,n=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,a=t.stack.split("\n"),s=[],c=0;c<a.length;c++){var u=a[c];(e=r.exec(u))||(e=o.exec(u))?s.push({source:e[2],filename:K(e[2]),lineno:e[3]?+e[3]:null,colno:e[4]?+e[4]:null}):(e=i.exec(u))?s.push({source:e[3],filename:K(e[3]),lineno:e[4]?+e[4]:null,colno:e[5]?+e[5]:null}):(e=n.exec(u))&&s.push({source:e[5],filename:K(e[5]),lineno:e[1]?+e[1]:null,colno:e[2]?+e[2]:null})}return s.length>0?[s[0]]:s}var $=function(){function t(){this.name="CookieStorage"}return t.prototype.isSupport=function(t,e){var r=this;void 0===t&&(t="cookie_support_test"),void 0===e&&(e="1");return navigator.cookieEnabled&&(r.set(t,e),r.get(t)===e&&(r.remove(t),!0))},t.prototype.get=function(t){var e,r,o=document.cookie.split(";");try{for(var i=l(o),n=i.next();!n.done;n=i.next()){var a=n.value.split("=");if(a[0].trim()===t)return decodeURIComponent(a[1])}}catch(t){e={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return null},t.prototype.set=function(t,e,r,o,i,n,a){o=o||"/",t=t.trim(),e=e.trim();var s="".concat(t,"=").concat(encodeURIComponent(e),"; path=").concat(o,";");r=b(r)?r:63072e8,s+=" max-age=".concat(r,";"),a&&(s+=" secure;"),i&&(s+=" domain=".concat(i,";")),["Strict","Lax","None"].includes(n)&&(s+=" SameSite=".concat(n,";")),document.cookie=s},t.prototype.remove=function(t,e){void 0===e&&(e="/"),this.set(t,"1",0,e)},t.prototype.setDomain=function(t,e,r){var o=q();"url解析失败"===o&&(o=""),this.set(t,e,r,"/",o)},t}(),X=function(){function t(){this.name="LocalStorage"}return t.prototype.isSupport=function(){var t=!0;try{var e="__localStorageSupport__",r="testIsSupportStorage";this.set(e,r),this.get(e)!==r&&(t=!1),this.remove(e)}catch(e){t=!1}return t},t.prototype.key=function(t){return window.localStorage.key(t)},t.prototype.get=function(t){return window.localStorage.getItem(t)},t.prototype.length=function(){return window.localStorage.length},t.prototype.set=function(t,e){try{window.localStorage.setItem(t,e)}catch(t){}},t.prototype.remove=function(t){window.localStorage.removeItem(t)},t.prototype.parse=function(t){var e=this.get(t);try{e=JSON.parse(e)}catch(t){e=""}return e},t}(),Z=function(){function t(){this.name="MemoryStorage",this.data={}}return t.prototype.get=function(t){var e=this.data[t];return b(null==e?void 0:e.expireTime)?e.expireTime<L()?null:e.value:null==e?void 0:e.value},t.prototype.set=function(t,e,r){if(b(r)){var o=L()+1e3*r;this.data[t]={value:e,expireTime:o}}this.data[t]={value:e}},t.prototype.setDomain=function(t,e,r){this.set(t,e,r)},t}(),Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Q(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var tt={exports:{}};!function(t,e){!function(r,o){var i="function",n="undefined",a="object",s="string",c="major",u="model",l="name",p="type",d="vendor",f="version",h="architecture",g="console",v="mobile",m="tablet",y="smarttv",_="wearable",w="embedded",b="Amazon",T="Apple",k="ASUS",S="BlackBerry",H="Browser",R="Chrome",x="Firefox",E="Google",C="Huawei",A="LG",P="Microsoft",L="Motorola",I="Opera",N="Samsung",O="Sharp",D="Sony",U="Xiaomi",q="Zebra",B="Facebook",j="Chromium OS",F="Mac OS",M=" Browser",W=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},z=function(t,e){return typeof t===s&&-1!==V(e).indexOf(V(t))},V=function(t){return t.toLowerCase()},J=function(t,e){if(typeof t===s)return t=t.replace(/^\s\s*/,""),typeof e===n?t:t.substring(0,500)},K=function(t,e){for(var r,n,s,c,u,l,p=0;p<e.length&&!u;){var d=e[p],f=e[p+1];for(r=n=0;r<d.length&&!u&&d[r];)if(u=d[r++].exec(t))for(s=0;s<f.length;s++)l=u[++n],typeof(c=f[s])===a&&c.length>0?2===c.length?typeof c[1]==i?this[c[0]]=c[1].call(this,l):this[c[0]]=c[1]:3===c.length?typeof c[1]!==i||c[1].exec&&c[1].test?this[c[0]]=l?l.replace(c[1],c[2]):o:this[c[0]]=l?c[1].call(this,l,c[2]):o:4===c.length&&(this[c[0]]=l?c[3].call(this,l.replace(c[1],c[2])):o):this[c]=l||o;p+=2}},G=function(t,e){for(var r in e)if(typeof e[r]===a&&e[r].length>0){for(var i=0;i<e[r].length;i++)if(z(e[r][i],t))return"?"===r?o:r}else if(z(e[r],t))return"?"===r?o:r;return e.hasOwnProperty("*")?e["*"]:t},$={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},X={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,f],[/opios[\/ ]+([\w\.]+)/i],[f,[l,I+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[f,[l,I+" GX"]],[/\bopr\/([\w\.]+)/i],[f,[l,I]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[l,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[l,f],[/quark(?:pc)?\/([-\w\.]+)/i],[f,[l,"Quark"]],[/\bddg\/([\w\.]+)/i],[f,[l,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[l,"UC"+H]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[l,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[l,"Smart Lenovo "+H]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+H],f],[/\bfocus\/([\w\.]+)/i],[f,[l,x+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[l,I+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[l,I+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[l,"MIUI "+H]],[/fxios\/([-\w\.]+)/i],[f,[l,x]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360"+M]],[/\b(qq)\/([\w\.]+)/i],[[l,/(.+)/,"$1Browser"],f],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1"+M],f],[/samsungbrowser\/([\w\.]+)/i],[f,[l,N+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],f],[/metasr[\/ ]?([\d\.]+)/i],[f,[l,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[l,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[l,f],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,B],f],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[l,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[l,R+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,R+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[l,"Android "+H]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[f,G,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],f],[/(wolvic)\/([\w\.]+)/i],[l,f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[l,x+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,[f,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[l,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,V]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,N],[p,m]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,N],[p,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[d,T],[p,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,T],[p,m]],[/(macintosh);/i],[u,[d,T]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,O],[p,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,C],[p,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[d,C],[p,v]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[u,/_/g," "],[d,U],[p,v]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,U],[p,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[d,"OPPO"],[p,v]],[/\b(opd2\d{3}a?) bui/i],[u,[d,"OPPO"],[p,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[p,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[p,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,L],[p,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,L],[p,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,A],[p,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,A],[p,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[p,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[p,v]],[/(pixel c)\b/i],[u,[d,E],[p,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,E],[p,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,D],[p,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,D],[p,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[p,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,b],[p,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,b],[p,v]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[p,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,S],[p,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,k],[p,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,k],[p,v]],[/(nexus 9)/i],[u,[d,"HTC"],[p,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[p,v]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[u,[d,"TCL"],[p,m]],[/(itel) ((\w+))/i],[[d,V],u,[p,G,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[p,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[p,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[d,"Ulefone"],[p,v]],[/droid.+; (a(?:015|06[35]|142p?))/i],[u,[d,"Nothing"],[p,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[p,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[p,m]],[/(surface duo)/i],[u,[d,P],[p,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[p,v]],[/(u304aa)/i],[u,[d,"AT&T"],[p,v]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[p,v]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[p,m]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[p,m]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[p,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[p,m]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[p,m]],[/\b(k88) b/i],[u,[d,"ZTE"],[p,m]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[p,v]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[p,v]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[p,m]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[p,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[p,m]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[p,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[p,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[p,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[p,v]],[/\b(ph-1) /i],[u,[d,"Essential"],[p,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[p,m]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[p,m]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[p,m]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[p,m]],[/(sprint) (\w+)/i],[d,u,[p,v]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,P],[p,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,q],[p,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,q],[p,v]],[/smart-tv.+(samsung)/i],[d,[p,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,N],[p,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,A],[p,y]],[/(apple) ?tv/i],[d,[u,T+" TV"],[p,y]],[/crkey/i],[[u,R+"cast"],[d,E],[p,y]],[/droid.+aft(\w+)( bui|\))/i],[u,[d,b],[p,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[d,O],[p,y]],[/(bravia[\w ]+)( bui|\))/i],[u,[d,D],[p,y]],[/(mitv-\w{5}) bui/i],[u,[d,U],[p,y]],[/Hbbtv.*(technisat) (.*);/i],[d,u,[p,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,J],[u,J],[p,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[p,g]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[p,g]],[/(playstation [345portablevi]+)/i],[u,[d,D],[p,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,P],[p,g]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[u,[d,N],[p,_]],[/((pebble))app/i],[d,u,[p,_]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[d,T],[p,_]],[/droid.+; (glass) \d/i],[u,[d,E],[p,_]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,q],[p,_]],[/(quest( \d| pro)?)/i],[u,[d,B],[p,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[p,w]],[/(aeobc)\b/i],[u,[d,b],[p,w]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[u,[p,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[p,m]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,m]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,v]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,f],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[l,[f,G,$]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,G,$],[l,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,F],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,f],[/\(bb(10);/i],[f,[l,S]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[l,x+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[l,R+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,j],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,f],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,f]]},Z=function(t,e){if(typeof t===a&&(e=t,t=o),!(this instanceof Z))return new Z(t,e).getResult();var g=typeof r!==n&&r.navigator?r.navigator:o,y=t||(g&&g.userAgent?g.userAgent:""),_=g&&g.userAgentData?g.userAgentData:o,w=e?function(t,e){var r={};for(var o in t)e[o]&&e[o].length%2==0?r[o]=e[o].concat(t[o]):r[o]=t[o];return r}(X,e):X,b=g&&g.userAgent==y;return this.getBrowser=function(){var t={};return t[l]=o,t[f]=o,K.call(t,y,w.browser),t[c]=function(t){return typeof t===s?t.replace(/[^\d\.]/g,"").split(".")[0]:o}(t[f]),b&&g&&g.brave&&typeof g.brave.isBrave==i&&(t[l]="Brave"),t},this.getCPU=function(){var t={};return t[h]=o,K.call(t,y,w.cpu),t},this.getDevice=function(){var t={};return t[d]=o,t[u]=o,t[p]=o,K.call(t,y,w.device),b&&!t[p]&&_&&_.mobile&&(t[p]=v),b&&"Macintosh"==t[u]&&g&&typeof g.standalone!==n&&g.maxTouchPoints&&g.maxTouchPoints>2&&(t[u]="iPad",t[p]=m),t},this.getEngine=function(){var t={};return t[l]=o,t[f]=o,K.call(t,y,w.engine),t},this.getOS=function(){var t={};return t[l]=o,t[f]=o,K.call(t,y,w.os),b&&!t[l]&&_&&_.platform&&"Unknown"!=_.platform&&(t[l]=_.platform.replace(/chrome os/i,j).replace(/macos/i,F)),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return y},this.setUA=function(t){return y=typeof t===s&&t.length>500?J(t,500):t,this},this.setUA(y),this};Z.VERSION="1.0.39",Z.BROWSER=W([l,f,c]),Z.CPU=W([h]),Z.DEVICE=W([u,d,p,g,v,y,m,_,w]),Z.ENGINE=Z.OS=W([l,f]),t.exports&&(e=t.exports=Z),e.UAParser=Z;var Y=typeof r!==n&&(r.jQuery||r.Zepto);if(Y&&!Y.ua){var Q=new Z;Y.ua=Q.getResult(),Y.ua.get=function(){return Q.getUA()},Y.ua.set=function(t){Q.setUA(t);var e=Q.getResult();for(var r in e)Y.ua[r]=e[r]}}}("object"==typeof window?window:Y)}(tt,tt.exports);var et=new(Q(tt.exports));function rt(t){var e=et.getResult(),r=e.browser,o=e.device,i=e.os,n=e.ua,a={H_timezone_offset:(new Date).getTimezoneOffset(),H_viewport_width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0,H_viewport_height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,H_screen_width:window.screen.width,H_screen_height:window.screen.height,H_lib_version:t,H_lib:"js",H_lib_method:"code",H_browser:r.name.toLowerCase(),H_browser_version:r.version,H_os:i.name,H_os_version:i.version,H_browser_user_agent:n,H_language:S(navigator.language)?navigator.language.toLowerCase():"取值异常",H_network_type:it()};return"mobile"===o.type?a.H_model=o.vendor?o.model:"UnknownPhone":a.H_model=o.model,a}function ot(){return document.documentElement.scrollTop||document.body.scrollTop||0}function it(){if(void 0===navigator.connection)return"unknown";var t=navigator.connection;return t.effectiveType?t.effectiveType:t.type?t.type:"取值异常"}var nt=function(){function t(t){this.visibleHandler=function(){},this.hiddenHandler=function(){};var e=t.visible,r=t.hidden;k(e)&&(this.visibleHandler=e),k(r)&&(this.hiddenHandler=r),this.init()}return t.prototype.isSupport=function(){return void 0!==document.hidden},t.prototype.init=function(){var t=this;this.isSupport()?document.addEventListener("visibilitychange",(function(){document.hidden?t.hiddenHandler():t.visibleHandler()})):(window.addEventListener("focus",this.visibleHandler),window.addEventListener("blur",this.hiddenHandler))},t}();function at(){return"undefined"!=typeof console}function st(t){return 1===(null==t?void 0:t.nodeType)}function ct(t,e){var r;if("input"===(null===(r=t.tagName)||void 0===r?void 0:r.toLowerCase()))return(["button","submit"].includes(t.type)||e)&&t.value||"";var o="";return t.textContent?o=t.textContent.trim():t.innerText&&(o=t.innerText.trim()),o&&(o=o.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),o||""}function ut(){var t=B(),e=q(),r=Math.round(ot());return N({H_referrer:t,H_referrer_host:t?j(t):"",H_url:window.location.href,H_url_host:j(window.location.href,"url_host取值异常"),H_url_domain:e,H_url_path:window.location.pathname,H_url_hash:window.location.hash,H_title:document.title,H_viewport_position:r})}function lt(t,e){if(!t)return{};var r=document.documentElement.scrollLeft||document.body.scrollLeft||0,o=ot(),i=e.getBoundingClientRect(),n=t.pageX||t.clientX+r||t.offsetX+((null==i?void 0:i.left)||0)+r,a=t.pageY||t.clientY+o||t.offsetY+((null==i?void 0:i.top)||0)+o;return{H_page_x:D(n,3),H_page_y:D(a,3)}}var pt=function(){function t(){}return t.getSourceFromReferrer=function(){var t=function(t,e){for(var r=0;r<t.length;r++)if(-1!==e.split("?")[0].indexOf(t[r]))return!0},e="(".concat(h.join("|"),")\\=[^&]+"),r=document.referrer||"",o=window.location.href;if(o){var i=o.match(new RegExp(e));return i&&i[0]?"付费广告流量":t(g,r)?"自然搜索流量":t(v,r)?"社交网站流量":""===r?"直接流量":"引荐流量"}return"获取url异常"},t.getReferSearchEngine=function(t){var e,r,o=j(t);if(!o||"hostname解析异常"===o)return"";var i={baidu:[/^.*\.baidu\.com$/],bing:[/^.*\.bing\.com$/],google:[/^www\.google\.com$/,/^www\.google\.com\.[a-z]{2}$/,/^www\.google\.[a-z]{2}$/],sm:[/^m\.sm\.cn$/],so:[/^.+\.so\.com$/],sogou:[/^.*\.sogou\.com$/],yahoo:[/^.*\.yahoo\.com$/]};for(var n in i){var a=i[n];try{for(var s=(e=void 0,l(a)),c=s.next();!c.done;c=s.next()){if(c.value.test(o))return n}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}}return"未知搜索引擎"},t.getKeywordFromReferrer=function(){var t=document.referrer||"";if(0===t.indexOf("http")){var e=this.getReferSearchEngine(t),r=function(t){t=t||"";var e={};return new URLSearchParams(t).forEach((function(t,r){e[r]=t})),e}(O(t).search);if(P(r))return"未取到值";for(var o in m){var i=m[o];if(o===e)if(T(i))for(var n=0;n<i.length;n++){var a=r[i[n]];if(a)return a}else if(r[i])return r[i]}return"未取到值"}return""===t?"未取到值_直接打开":"未取到值_非http的url"},t}();function dt(t){void 0===t&&(t="");var e,r=(e={},h.forEach((function(t){var r=z(window.location.href,t);r.length&&(e[t]=r)})),e),o={};return Object.keys(r).forEach((function(e){o[t+e]=r[e]})),o}function ft(t,e){void 0===t&&(t=""),void 0===e&&(e=[]);var r={};return e.forEach((function(e){var o=z(window.location.href,e);o&&(r[e]=o,r["".concat(t).concat(e)]=o)})),r}var ht=function(t){this.options=t},gt=function(t){function e(e){var r=t.call(this,e)||this;return r.options=e,r}return r(e,t),e.prototype.run=function(){var t=this;return new Promise((function(e){var r=t.options,o=r.imgUseCrossOrigin,i=r.url,n=r.data,a=new Image;o&&(a.crossOrigin="anonymous");var s=-1===i.indexOf("?")?"?":"&";a.src="".concat(i).concat(s).concat(n);var c=function(t){a=null,e({type:t})};a.onload=function(){c("success")},a.onerror=function(){c("success")}}))},e}(ht),vt=function(t){function e(e){var r=t.call(this,e)||this;return r.options=e,r}return r(e,t),e.prototype.run=function(){var t=this;return new Promise((function(e){var r=t.options,o=r.url,i=r.data,n=r.timeout,a=r.credentials,s=r.contentType,c=r.customHeaders,u=void 0===c?{}:c,l=new XMLHttpRequest;l.open("POST",o,!0),l.timeout=n||2e4,l.isMonitor=!0,a&&(l.withCredentials=!0),l.setRequestHeader("Content-Type",s||"application/x-www-form-urlencoded"),w(u)&&!P(u)&&Object.keys(u).forEach((function(t){l.setRequestHeader(t,u[t])})),l.send(i||null),l.ontimeout=function(){l.abort()},l.onreadystatechange=function(){4===l.readyState&&(l.status>=200&&l.status<300||304===l.status?e({data:JSON.parse(l.responseText)||{},type:"success"}):e({type:"fail",msg:"网络异常, 请求失败,状态码=".concat(l.status)}))}}))},e}(ht),mt=function(t){function e(e){var r=t.call(this,e)||this;return r.options=e,r}return r(e,t),e.prototype.run=function(){var t=this;return new Promise((function(e){var r=t.options,o=r.url,i=r.data;navigator.sendBeacon&&e(navigator.sendBeacon(o,i)?{type:"success"}:{type:"fail",msg:"sendBeacon 请求失败"})}))},e}(ht);var yt,_t={all:yt=yt||new Map,on:function(t,e){var r=yt.get(t);r?r.push(e):yt.set(t,[e])},emit:function(t,e){var r=yt.get(t);r&&r.forEach((function(t){t(e)}))},off:function(t,e){var r=yt.get(t);if(r)if(e){var o=r.indexOf(e);o>=0&&r.splice(o,1)}else yt.set(t,[])}};function wt(e,r){void 0===r&&(r=t.ConsoleTypes.LOG);var o=console[r]||console.log;"function"==typeof o&&o(e)}var bt=function(){function e(t){this.options=t,this.storeName="hinasdk_crossdata",this.state=this.getDefaultState(),this.isFirstTime=!1,this.isFirstDay=!1,this.isSetFirstVisit=!0}return e.prototype.getDefaultState=function(){return{accountId:null,deviceId:null,anonymousId:null,sessionId:null,firstVisitTime:L(),props:{}}},e.prototype.log=function(e,r){void 0===r&&(r=t.ConsoleTypes.LOG);var o=this.options.showLog;at()&&o&&wt(e,r)},e.prototype.init=function(){var e,r=new $,o=new Z,i=new X;r.isSupport()?this.storage=r:(this.log("Cookie storage is not supported, SDK internal cache has been enabled",t.ConsoleTypes.WARN),this.storage=o),i.isSupport()?this.localStorage=i:this.log("localStorage is not supported, SDK internal cache has been enabled",t.ConsoleTypes.WARN),!(e=this.storage.get(this.storeName))&&this.localStorage&&(e=this.localStorage.get(this.storeName)),e&&function(t){try{JSON.parse(t)}catch(t){return!1}return!0}(e)&&(this.state=C(e)),e?(this.isSetFirstVisit=!1,this.save()):(this.isFirstDay=!0,this.isFirstTime=!0);var n=function(){var t=function(){for(var t=L(),e=0;t===L();)e++;return t.toString(16)+e.toString(16)},e=String(window.screen.height*window.screen.width);e=e&&/\d{5,}/.test(e)?e.toString(16):String(31242*Math.random()).replace(".","").slice(0,8);var r="".concat(t(),"-").concat(Math.random().toString(16).replace(".",""),"-").concat(function(){var t,e,r=navigator.userAgent,o=[],i=0;function n(t,e){var r,i=0;for(r=0;r<e.length;r++)i|=o[r]<<8*r;return t^i}for(t=0;t<r.length;t++)e=r.charCodeAt(t),o.unshift(255&e),o.length>=4&&(i=n(i,o),o=[]);return o.length>0&&(i=n(i,o)),i.toString(16)}(),"-").concat(e,"-").concat(t());return r||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}();this.getAnonymousId()||this.setAnonymousId(n),this.getDeviceId()||this.setDeviceId(n)},e.prototype.clear=function(){this.state={},this.save()},e.prototype.save=function(){this.storage.setDomain(this.storeName,JSON.stringify(this.state)),this.localStorage&&this.localStorage.set(this.storeName,JSON.stringify(this.state))},e.prototype.set=function(t,e){this.state[t]=e,this.save()},e.prototype.checkSetValue=function(e,r){return!(!H(r=null!=r?r:"")&&!S(r))||(this.log("".concat(e,": id must be string or number"),t.ConsoleTypes.WARN),!1)},e.prototype.setDeviceId=function(t){void 0===t&&(t=""),this.checkSetValue("deviceId",t)&&this.set("deviceId",t)},e.prototype.setAccountId=function(t){void 0===t&&(t=""),this.checkSetValue("accountId",t)&&this.set("accountId",t)},e.prototype.setAnonymousId=function(e){this.state.anonymousId?this.log("Current anonymousId is ".concat(this.getAnonymousId(),", it has been set"),t.ConsoleTypes.WARN):this.checkSetValue("anonymousId",e)&&this.set("anonymousId",e)},e.prototype.setSessionId=function(t){this.set("sessionId",t)},e.prototype.setProps=function(t){var e=I(this.state.props||{},t);for(var r in e)"string"==typeof e[r]&&(e[r]=e[r].slice(0,200));this.set("props",e)},e.prototype.getAnonymousId=function(){return this.state.anonymousId},e.prototype.getDeviceId=function(){return this.state.deviceId},e.prototype.getAccountId=function(){return this.state.accountId},e.prototype.getSessionId=function(){return this.state.sessionId||""},e.prototype.getSessionIdCreateTime=function(){var t=this.getSessionId().split("_")[0],e=Number(t);return Number.isNaN(e)?0:e},e.prototype.getCookie=function(){return this.storage.get(this.storeName)},e}(),Tt=function(){function e(t,e,r,o){void 0===r&&(r="hinasdk_tab"),void 0===o&&(o="hinasdk_data_"),this.options=t,this.platform=e,this.batchKey=r,this.batchDataKey=o,this.init()}return e.prototype.log=function(e,r){void 0===r&&(r=t.ConsoleTypes.LOG);var o=this.options.showLog;at()&&o&&wt(e,r)},e.prototype.init=function(){var e=new X;e.isSupport()?(this.localStorage=e,this.isSupport=!0):(this.isSupport=!1,this.log("批量发送功能需要使用localstorage存储数据,但是您的浏览器不支持localstorage,所以不能使用该功能",t.ConsoleTypes.WARN)),this.batchInterval()},e.prototype.getBatchConfig=function(){return this.options.batchSend},e.prototype.getStorageList=function(){if(!this.isSupport)return[];var t=[],e=this.localStorage.get(this.batchKey);return e&&(T(t=C(e))||(t=[])),t},e.prototype.batchInterval=function(){var t=this;if(this.isSupport){var e=this.getBatchConfig().sendInterval;setTimeout((function(){t.send().then((function(){t.batchInterval()}))}),e)}},e.prototype.send=function(){var t=this;return new Promise((function(e){var r=t.getStorageList();if(r.length>0&&t.isSupport){for(var o=t.getBatchConfig(),i=o.storageLimit,n=o.dataSendTimeout,a=L(),s=[],c={},u=r.length,l=0;l<u;l++){var p=r[l],d=p.dataKey,f=p.expireTime;if(f>=a)c[d]={dataKey:d,expireTime:f},(w=t.localStorage.get(d))&&s.push(C(w));else t.localStorage.remove(d),r.splice(l,1),u--,l--}if(t.localStorage.set(t.batchKey,JSON.stringify(r)),(s=s.filter(Boolean)).length>i&&(s=s.slice(0,i)),0===s.length)e();else{var h=t.options,g=h.serverUrl,v=h.customHeaders,m=h.credentials,y=h.globalCallback,_=JSON.stringify(s),w=encodeURIComponent(V(_));new vt({url:g,data:"data_list=".concat(w),timeout:n,credentials:m,customHeaders:v}).run().then((function(r){k(y)&&y(g,s,r.type,r.msg||""),"success"===r.type&&t.remove(c),e()}))}}else e()}))},e.prototype.remove=function(t){var e=this;if(this.isSupport){var r=this.getStorageList(),o=Object.keys(t);if(o.forEach((function(t){e.localStorage.remove(t)})),r.length===o.length)this.localStorage.set(this.batchKey,JSON.stringify([]));else{var i=r.filter((function(e){return!t[e.dataKey]}));this.localStorage.set(this.batchKey,JSON.stringify(i))}}},e.prototype.add=function(t){if(this.isSupport){var e=this.getBatchConfig(),r=e.sendInterval,o=e.storageLimit,i=this.batchDataKey+F(),n=this.getStorageList();n.unshift({dataKey:i,expireTime:L()+2*r}),this.localStorage.set(this.batchKey,JSON.stringify(n)),this.localStorage.set(i,JSON.stringify(t)),(n.length>o||"track_signup"===t.type||"H_pageview"===t.event)&&this.send()}},e}(),kt=function(){function e(t,e){void 0===e&&(e=!0),this.isReady=!1,this.consolePrefix="",this.useInstancing=!0,this.plugins=[],this.options=t,this.useInstancing=e}return e.prototype.log=function(e,r){void 0===r&&(r=t.ConsoleTypes.LOG);var o=this.options.showLog;at()&&o&&("string"==typeof e&&this.consolePrefix&&(e="".concat(this.consolePrefix,":").concat(e)),wt(e,r))},e.prototype.runPlugins=function(t){for(var e=this,r=function(r){var o=t[r];o.init((function(t){if(o.transform){var r=o.transform(t);r&&e.report(r)}}))},o=0;o<t.length;o++)r(o)},e.prototype.applyPlugins=function(e){var r=this;if(this.isReady){T(e)||(e=[e]);var o=[];e.forEach((function(t){var e=new t(r.options,r);r.plugins.push(e),o.push(e)})),this.runPlugins(o)}else this.log("请先初始化SDK实例",t.ConsoleTypes.WARN)},e}(),St=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return r(o,e),o.prototype.sendReportData=function(e,r,o){var i=this.options,n=i.batchSend,a=i.globalCallback,s=i.serverUrl,c=i.dataSendTimeout,u=i.sendType,l=i.customHeaders,p=i.credentials,d=i.imgUseCrossOrigin;if(u=o||u,s){if(w(e)&&!P(e))if(n)this.batchSender.add(e);else{var f=e;S(e)||(f=A(e));var h=V(f),g={data:"data=".concat(encodeURIComponent(h)),url:s,timeout:c,imgUseCrossOrigin:d,customHeaders:l,credentials:p};(u===t.ReportTypes.BEACON&&navigator.sendBeacon?new mt(g):u===t.ReportTypes.IMAGE&&g.data.length<2048?new gt(g):new vt(g)).run().then((function(t){return k(a)&&a(s,e,t.type,t.msg||""),k(r)&&r(s,e,t.type,t.msg||""),t}))}}else this.log("当前 serverUrl 为空,network 中不会发数据,请配置正确的 serverUrl!",t.ConsoleTypes.WARN)},o}(kt),Ht=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="JsErrorPlugin",o.isReady=!1,o}return r(o,e),o.prototype.init=function(e){this.isReady||(this.isReady=!0,window.onerror=function(r,o,i,n,a){if("ResizeObserver loop limit exceeded"!==r.toString()){var s=x(a);e({H_js_error_id:W(s),H_error_category:t.ErrorTypes.JS_ERROR,H_error_type:a.name||t.ErrorTypes.JS_ERROR,H_error_message:a.message,H_error_stack:JSON.stringify({details:G(a),errorStack:s})})}})},o.prototype.transform=function(t){return this.context.getReportData("H_performance_js",t)},o}(f),Rt=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="DomErrorPlugin",o.isReady=!1,o}return r(o,e),o.prototype.init=function(e){this.isReady||(this.isReady=!0,window.addEventListener("error",(function(r){if(r.target!==window){var o=r.target,i=o.src||o.href,n=(s=(a=o).tagName.toLowerCase(),c=a.getAttributeNames(),u="",c.forEach((function(t){u+=" ".concat(t,"='").concat(a.getAttribute(t),"'")})),"<".concat(s).concat(u,">"));e({H_js_error_id:W(n),H_error_category:t.ErrorTypes.RESOURCE_ERROR,H_error_type:t.ErrorTypes.RESOURCE_ERROR,H_error_message:n,H_source_element:n,H_source_src:i})}var a,s,c,u}),!0))},o.prototype.transform=function(t){return this.context.getReportData("H_performance_js",t)},o}(f);function xt(){if(void 0!==window.performance&&"function"==typeof window.performance.getEntriesByType){var t=performance.getEntriesByType("navigation")[0],e=t.startTime,r=t.redirectStart,o=t.redirectEnd,i=t.fetchStart,n=t.domainLookupStart,a=t.domainLookupEnd,s=t.connectStart,c=t.secureConnectionStart,u=t.connectEnd,l=t.requestStart,p=t.responseStart,d=t.responseEnd,f=t.domInteractive,h=t.domContentLoadedEventEnd,g=t.loadEventStart,v=t.loadEventEnd,m=t.redirectCount,y=t.duration,_=t.unloadEventEnd,w=t.unloadEventStart;return{H_first_byte_time:D(p-e),H_unload_time:D(_-w),H_redirect_time:D(o-r),H_redirect_count:m,H_cache_check_time:D(n-i),H_dns_time:D(a-n),H_tcp_time:D(u-s),H_ssl_time:D(u-c),H_first_byte_response_time:D(p-r),H_dom_ready_time:D(h-i),H_request_time:D(p-l),H_content_transfer_time:D(d-p),H_dom_parsing_time:D(f-d),H_page_load_time:D(v-e),H_resource_load_time:D(g-h),H_resource_duration:y,H_load_event_time:D(v-g)}}var b=performance.timing,T=b.navigationStart,k=b.responseStart,S=b.unloadEventEnd,H=b.unloadEventStart,R=b.requestStart,x=b.responseEnd,E=b.redirectStart,C=b.redirectEnd,A=b.domainLookupStart,P=b.fetchStart,L=b.domainLookupEnd,I=b.connectStart,N=b.connectEnd,O=b.secureConnectionStart,U=b.domContentLoadedEventEnd,q=b.domInteractive,B=b.loadEventStart,j=b.loadEventEnd;return{H_first_byte_time:D(k-T),H_unload_time:D(S-H),H_redirect_time:D(C-E),H_cache_check_time:D(A-P),H_dns_time:D(L-A),H_tcp_time:D(N-I),H_ssl_time:D(N-O),H_first_byte_response_time:D(k-E),H_dom_ready_time:D(U-P),H_request_time:D(k-R),H_content_transfer_time:D(x-k),H_dom_parsing_time:D(q-x),H_page_load_time:D(j-T),H_resource_load_time:D(B-U),H_load_event_time:D(j-B)}}var Et,Ct,At,Pt,Lt=-1,It=function(t){addEventListener("pageshow",(function(e){e.persisted&&(Lt=e.timeStamp,t(e))}),!0)},Nt=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ot=function(){var t=Nt();return t&&t.activationStart||0},Dt=function(t,e){var r=Nt(),o="navigate";return Lt>=0?o="back-forward-cache":r&&(document.prerendering||Ot()>0?o="prerender":document.wasDiscarded?o="restore":r.type&&(o=r.type.replace(/_/g,"-"))),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:o}},Ut=function(t,e,r){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var o=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return o.observe(Object.assign({type:t,buffered:!0},r||{})),o}}catch(t){}},qt=function(t,e,r,o){var i,n;return function(a){e.value>=0&&(a||o)&&((n=e.value-(i||0))||void 0===i)&&(i=e.value,e.delta=n,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,r),t(e))}},Bt=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},jt=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},Ft=function(t){var e=!1;return function(){e||(t(),e=!0)}},Mt=-1,Wt=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},zt=function(t){"hidden"===document.visibilityState&&Mt>-1&&(Mt="visibilitychange"===t.type?t.timeStamp:0,Jt())},Vt=function(){addEventListener("visibilitychange",zt,!0),addEventListener("prerenderingchange",zt,!0)},Jt=function(){removeEventListener("visibilitychange",zt,!0),removeEventListener("prerenderingchange",zt,!0)},Kt=function(){return Mt<0&&(Mt=Wt(),Vt(),It((function(){setTimeout((function(){Mt=Wt(),Vt()}),0)}))),{get firstHiddenTime(){return Mt}}},Gt=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},$t=[1800,3e3],Xt=function(t,e){e=e||{},Gt((function(){var r,o=Kt(),i=Dt("FCP"),n=Ut("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(n.disconnect(),t.startTime<o.firstHiddenTime&&(i.value=Math.max(t.startTime-Ot(),0),i.entries.push(t),r(!0)))}))}));n&&(r=qt(t,i,$t,e.reportAllChanges),It((function(o){i=Dt("FCP"),r=qt(t,i,$t,e.reportAllChanges),Bt((function(){i.value=performance.now()-o.timeStamp,r(!0)}))})))}))},Zt=[.1,.25],Yt=[2500,4e3],Qt={},te=function(t,e){e=e||{},Gt((function(){var r,o=Kt(),i=Dt("LCP"),n=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<o.firstHiddenTime&&(i.value=Math.max(t.startTime-Ot(),0),i.entries=[t],r())}))},a=Ut("largest-contentful-paint",n);if(a){r=qt(t,i,Yt,e.reportAllChanges);var s=Ft((function(){Qt[i.id]||(n(a.takeRecords()),a.disconnect(),Qt[i.id]=!0,r(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return function(t){var e=self.requestIdleCallback||self.setTimeout,r=-1;return t=Ft(t),"hidden"===document.visibilityState?t():(r=e(t),jt(t)),r}(s)}),!0)})),jt(s),It((function(o){i=Dt("LCP"),r=qt(t,i,Yt,e.reportAllChanges),Bt((function(){i.value=performance.now()-o.timeStamp,Qt[i.id]=!0,r(!0)}))}))}}))},ee=[800,1800],re=function t(e){document.prerendering?Gt((function(){return t(e)})):"complete"!==document.readyState?addEventListener("load",(function(){return t(e)}),!0):setTimeout(e,0)},oe=function(t,e){e=e||{};var r=Dt("TTFB"),o=qt(t,r,ee,e.reportAllChanges);re((function(){var i=Nt();i&&(r.value=Math.max(i.responseStart-Ot(),0),r.entries=[i],o(!0),It((function(){r=Dt("TTFB",0),(o=qt(t,r,ee,e.reportAllChanges))(!0)})))}))},ie={passive:!0,capture:!0},ne=new Date,ae=function(t,e){Et||(Et=e,Ct=t,At=new Date,ue(removeEventListener),se())},se=function(){if(Ct>=0&&Ct<At-ne){var t={entryType:"first-input",name:Et.type,target:Et.target,cancelable:Et.cancelable,startTime:Et.timeStamp,processingStart:Et.timeStamp+Ct};Pt.forEach((function(e){e(t)})),Pt=[]}},ce=function(t){if(t.cancelable){var e=(t.timeStamp>1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,e){var r=function(){ae(t,e),i()},o=function(){i()},i=function(){removeEventListener("pointerup",r,ie),removeEventListener("pointercancel",o,ie)};addEventListener("pointerup",r,ie),addEventListener("pointercancel",o,ie)}(e,t):ae(e,t)}},ue=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(e){return t(e,ce,ie)}))},le=[100,300];function pe(){return new Promise((function(t){!function(t,e){e=e||{},Gt((function(){var r,o=Kt(),i=Dt("FID"),n=function(t){t.startTime<o.firstHiddenTime&&(i.value=t.processingStart-t.startTime,i.entries.push(t),r(!0))},a=function(t){t.forEach(n)},s=Ut("first-input",a);r=qt(t,i,le,e.reportAllChanges),s&&(jt(Ft((function(){a(s.takeRecords()),s.disconnect()}))),It((function(){var o;i=Dt("FID"),r=qt(t,i,le,e.reportAllChanges),Pt=[],Ct=-1,Et=null,ue(addEventListener),o=n,Pt.push(o),se()})))}))}((function(e){t(e.value)}))}))}function de(){return new Promise((function(t){!function(t,e){e=e||{},Xt(Ft((function(){var r,o=Dt("CLS",0),i=0,n=[],a=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=n[0],r=n[n.length-1];i&&t.startTime-r.startTime<1e3&&t.startTime-e.startTime<5e3?(i+=t.value,n.push(t)):(i=t.value,n=[t])}})),i>o.value&&(o.value=i,o.entries=n,r())},s=Ut("layout-shift",a);s&&(r=qt(t,o,Zt,e.reportAllChanges),jt((function(){a(s.takeRecords()),r(!0)})),It((function(){i=0,o=Dt("CLS",0),r=qt(t,o,Zt,e.reportAllChanges),Bt((function(){return r()}))})),setTimeout(r,0))})))}((function(e){t(e.value)}),{reportAllChanges:!0})}))}var fe=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="PerformancePlugin",o.isReady=!1,o}return r(o,e),o.prototype.init=function(e){if(!this.isReady){this.isReady=!0;var r=this.options.performanceOff;r.includes(t.PerformanceFeat.VITALS)||Promise.all([new Promise((function(t){te((function(e){t(e.value)}))})),pe(),de(),new Promise((function(t){oe((function(e){t(e.value)}))})),new Promise((function(t){Xt((function(e){t(e.value)}))})),new Promise((function(t){"PerformanceObserver"in window?new PerformanceObserver((function(e){var r,o,i=e.getEntries();try{for(var n=l(i),a=n.next();!a.done;a=n.next()){var s=a.value;"first-paint"===s.name&&t(s.startTime)}}catch(t){r={error:t}}finally{try{a&&!a.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}})).observe({entryTypes:["paint"]}):t(0)}))]).then((function(t){var e=p(t,6),r=e[0],o=e[1],i=e[2],n=e[3],a=e[4];return{H_first_paint_time:D(e[5]),H_first_contentful_paint_time:D(a),H_largest_contentful_paint_time:D(r),H_time_to_first_byte:D(n),H_first_input_delay:D(o),H_cumulative_layout_shift:D(i)}})).then((function(r){e(u({event:"H_performance_page",H_category:t.PerformanceFeat.VITALS},r))})),r.includes(t.PerformanceFeat.LONG_TASK)||function(t){if("PerformanceObserver"in window){var e=new PerformanceObserver((function(e){var r=e.getEntries(),o=0,i=[];r.forEach((function(t){var e=t.duration,r=t.name,n=t.startTime;o+=e,i.push({duration:D(e),startTime:D(n),name:r})})),t({H_long_task_time:D(o),H_long_task:r.length,H_long_task_list:i})}));e.observe({entryTypes:["longtask"]})}}((function(r){e(u({event:"H_performance_page",H_category:t.PerformanceFeat.LONG_TASK,H_url:window.location.href},r))})),window.addEventListener("load",(function(){r.includes(t.PerformanceFeat.BASIC)||e(u({event:"H_performance_loading",H_category:t.PerformanceFeat.BASIC},xt()))}))}},o.prototype.transform=function(t){return this.context.getReportData(t.event,t)},o}(f),he=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="FetchPlugin",o.isReady=!1,o}return r(o,e),o.prototype.init=function(e){if(window.fetch&&!this.isReady){this.isReady=!0;var r=this;J(window,"fetch",(function(o){return function(i,n){void 0===n&&(n={});var a=L(),s=n||{},c=s.headers,l=s.signal,p=s.method;return o(i,n).then((function(o){if(!o.ok){var s=u(u({},r.context.getRequestHeaders()),c||{}),l=L();o.clone().text().then((function(r){e({H_js_error_id:W("url=".concat(i,"&method=").concat(p)),H_error_category:t.ErrorTypes.FETCH_ERROR,H_error_type:t.ErrorTypes.FETCH_ERROR,H_error_message:i,H_request_url:i,H_request_headers:A(s),H_request_method:n.method.toLowerCase(),H_request_params:S(n.body)?n.body:"",H_response_status:o.status,H_response_status_text:o.statusText,H_request_time:a,H_response_time:l,H_response_data:r})}))}return o})).catch((function(o){if(l&&l.aborted)throw o;var s="";s=(s=o instanceof Error?null==o?void 0:o.message:A(o))||"网络错误,或者无法连接";var d=u(u({},r.context.getRequestHeaders()),c||{});throw e({H_js_error_id:W("url=".concat(i,"&method=").concat(p)),H_error_category:t.ErrorTypes.FETCH_ERROR,H_error_type:t.ErrorTypes.FETCH_ERROR,H_error_message:i,H_request_url:i,H_request_headers:A(d),H_request_method:n.method.toLowerCase(),H_request_params:S(n.body)?n.body:"",H_response_status:0,H_response_status_text:s,H_request_time:a,H_response_time:L(),H_response_data:s}),o}))}}))}},o.prototype.transform=function(t){return this.context.getReportData("H_performance_js",t)},o}(f),ge=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="XhrPlugin",o.isReady=!1,o}return r(o,e),o.prototype.init=function(e){if(!this.isReady){this.isReady=!0;var r=this,o=XMLHttpRequest.prototype.open,i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.H_request_method=t[0],this.H_request_url=t[1],this.H_request_time=L(),o.apply(this,t)},XMLHttpRequest.prototype.send=function(o){var n=this;this.addEventListener("abort",(function(){n.H_response_status_text="abort"})),this.addEventListener("error",(function(){n.H_response_status_text="error"})),this.addEventListener("timeout",(function(){n.H_response_status_text="timeout"})),this.addEventListener("loadend",(function(){var i=n,a=i.status,s=i.statusText,c=i.responseType,u=i.responseText,l=i.response,p=i.H_request_method,d=i.H_request_url,f=i.H_request_time,h=i.H_response_status_text;if(!(a>=200&&a<300)&&"abort"!==h&&!n.isMonitor){var g=c&&"text"!==c?l:u,v=h||s;"error"===h?v="网络错误,或者无法连接":"timeout"===h&&(v="请求超时"),e({H_js_error_id:W("url=".concat(d,"&method=").concat(p)),H_error_category:t.ErrorTypes.AJAX_ERROR,H_error_type:t.ErrorTypes.AJAX_ERROR,H_error_message:d,H_request_url:d,H_request_headers:A(r.context.getRequestHeaders()),H_request_method:p,H_request_params:w(o)?A(o):S(o)?o:"",H_response_status:a,H_response_status_text:v,H_request_time:f,H_response_time:L(),H_response_data:g&&A(g)})}delete n.H_request_method,delete n.H_request_url,delete n.H_request_time,delete n.H_response_status_text}));try{i.call(this,o)}catch(t){}}}},o.prototype.transform=function(t){return this.context.getReportData("H_performance_js",t)},o}(f),ve=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="PromiseErrorPlugin",o.isReady=!1,o}return r(o,e),o.prototype.init=function(e){this.isReady||(this.isReady=!0,window.addEventListener("unhandledrejection",(function(r){var o=r.reason,i=t.ErrorTypes.PROMISE_ERROR,n="",a="";S(o)?n=o:void 0===o?n="undefined":(null==o?void 0:o.stack)?(i=o.name,n=o.message,a=JSON.stringify({errorStack:x(o),details:G(o)})):n=A(o);["axioserror","cancelederror","aborterror"].includes(i.toLowerCase())||e({H_js_error_id:W("message=".concat(n,"&stack=").concat(a)),H_error_category:t.ErrorTypes.PROMISE_ERROR,H_error_type:i||t.ErrorTypes.PROMISE_ERROR,H_error_message:n,H_error_stack:a})})))},o.prototype.transform=function(t){return this.context.getReportData("H_performance_js",t)},o}(f),me="4.0.0",ye=function(e){function o(t,r){void 0===r&&(r=!0);var o=e.call(this,t,r)||this;return o.consolePrefix="性能监控SDK",o.presetProps={},o.requestHeaders={},o.useInstancing&&o.init(t),o}return r(o,e),o.prototype.init=function(e){var r=this;if(this.isReady)this.log("Monitor has been initialized",t.ConsoleTypes.ERROR);else{var o={serverUrl:"",name:"",showLog:!1,errorCapture:!0,performance:!0,openPromiseCapture:!1,sendType:t.ReportTypes.BEACON,customHeaders:{},credentials:!1,dataSendTimeout:3e3,batchSend:!1,imgUseCrossOrigin:!1,performanceOff:[],plugins:[]};this.options=u(u({},o),e),this.initState(),this.normalizeConfig(),this.initPlugins(),this.isReady=!0,window.addEventListener("beforeunload",(function(){r.store.setSessionId("")}))}},o.prototype.initState=function(){this.store=new bt(this.options),this.store.init()},o.prototype.normalizeConfig=function(){var e=this.options,r=e.serverUrl,o=e.batchSend;""===(r=(r=r||"").trim())&&this.log("当前 serverUrl 为空,network 中不会发数据,请配置正确的 serverUrl!",t.ConsoleTypes.WARN),(!0===o||w(o)&&!P(o))&&(this.options.batchSend=u({dataSendTimeout:6e3,sendInterval:6e3,storageLimit:200},o),this.batchSender=new Tt(this.options,t.PlatformTypes.WEB,"hinaepm_tab","hinaepm_data_"))},o.prototype.initPlugins=function(){var t=this,e=this.options,r=e.errorCapture,o=e.performance,i=e.openPromiseCapture,n=e.plugins,a=void 0===n?[]:n;a=a||[];var s=[],c=[];if(r&&(s=[new Ht(this.options,this),new Rt(this.options,this),new he(this.options,this),new ge(this.options,this)],!0===i)){var u=new ve(this.options,this);s.push(u)}o&&(c=[new fe(this.options,this)]);this.plugins=d(d([],p(s),!1),p(c),!1),a.forEach((function(e){var r=new e(t.options,t);t.plugins.push(r)})),this.runPlugins(this.plugins)},o.prototype.report=function(t,e,r){var o=this.options.beforeSend,i=t;k(o)&&(i=o(i)),this.log(i),this.sendReportData(i,e,r)},o.prototype.getReportData=function(t,e){var r=this.options.sourcemapVersion;r||(r="1.0.0");var o=this.store.getAnonymousId(),i=this.store.getAccountId(),n=this.store.getSessionId(),a=L(),s=u(u(u({},this.getReportProperties()),{H_js_sourcemap_version:r}),e||{}),c={anonymous_id:o,type:"track",event:t,time:a,_track_id:M(),properties:s};(i&&(c.account_id=i),n)?L()-this.store.getSessionIdCreateTime()>18e5&&(n=F(),this.store.setSessionId(n)):(n=F(),this.store.setSessionId(n));return s.H_session_id=n,c.send_time=L(),c},o.prototype.getReportProperties=function(){return u(u(u({},rt(me)),this.getCommonProperties()),{H_url:window.location.href,H_title:document.title})},o.prototype.captureException=function(e,r,o){e instanceof Error||(e=new Error(e)),w(r)||(r={});var i=x(e),n=this.getReportData("H_performance_js",{H_js_error_id:W(i),H_error_category:t.ErrorTypes.CAPTURE_EXCEPTION,H_error_type:t.ErrorTypes.CAPTURE_EXCEPTION,H_error_message:e.message,H_error_stack:JSON.stringify({details:G(e),errorStack:i}),H_capture_extra:JSON.stringify(r)});this.report(n,o)},o.prototype.captureEvent=function(e,r){if(w(e)){var o=e.message,i=e.extra;w(i)||(i={});var n=this.getReportData("H_performance_js",{H_js_error_id:W(o||""),H_error_category:t.ErrorTypes.CAPTURE_EVENT,H_error_type:t.ErrorTypes.CAPTURE_EVENT,H_error_message:o||"",H_capture_message:o||"",H_capture_extra:JSON.stringify(i)});this.report(n,r)}else this.log("captureEvent event参数错误:event必须是一个对象")},o.prototype.setCommonProperties=function(t){w(t)&&!P(t)&&(this.presetProps=I(this.presetProps,t))},o.prototype.getCommonProperties=function(){return this.presetProps},o.prototype.clearCommonProperties=function(t){var e=this;void 0===t&&(t=!0),!0===t?this.presetProps={}:T(t)&&t.forEach((function(t){t in e.presetProps&&delete e.presetProps[t]}))},o.prototype.setRequestHeaders=function(t){void 0===t&&(t={}),w(t)&&!P(t)&&(this.requestHeaders=I(this.requestHeaders,t))},o.prototype.getRequestHeaders=function(){return this.requestHeaders},o.prototype.clearRequestHeaders=function(t){void 0===t&&(t=!0),!0===t?this.requestHeaders={}:T(t)&&t.forEach((function(t){}))},o}(St);new ye({},!1);var _e=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],we=["a","input","button","textarea"],be=["abtestExperimentId","paramName","valueType","defaultValue","callback","timeoutMilliseconds","customProperties","customIds"],Te=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="ClickTrackPlugin",o.isReady=!1,o.isTrackList={a:!0,button:!0},o}return r(o,e),o.prototype.init=function(e){var r=this,o=this.options.autoTrackConfig,i=o.clickAutoTrack,n=o.isCollectUrl,a=o.isCollectElement,s=o.addCustomProperty;!0===i&&(this.isReady?this.context.log("ClickTrack plugin:插件已经运行,无需重复执行",t.ConsoleTypes.WARN):(this.isReady=!0,document.addEventListener("click",(function(t){if(n()){var o=t||window.event;if(o){var i=o.target||o.srcElement,c=r.getTargetElement(i);if(c){if(k(a)&&!a(c))return!1;var u=r.getClickElementInfo(c),l=lt(o,c),p=l.H_page_x,d=l.H_page_y;if(u.H_page_x=p,u.H_page_y=d,k(s)){var f=s(c);w(f)&&(u=I(u,f))}e(u)}}}}),!0)))},o.prototype.transform=function(t){return this.context.getReportData("track","H_WebClick",t)},o.prototype.hasAttribute=function(t,e){var r;return t.hasAttribute?t.hasAttribute(e):t.attributes?!!(null===(r=t.attributes[e])||void 0===r?void 0:r.value):void 0},o.prototype.hasAttributes=function(t,e){if(T(e))for(var r=0;r<e.length;r++)if(this.hasAttribute(t,e[r]))return!0;return!1},o.prototype.hasElement=function(t){var e,r,o,i=function(t){var e=[t];try{if(!st(t))return e;if(null===t||null===t.parentElement)return e;for(;null!==t.parentElement;)t=t.parentElement,e.push(t);return e}catch(t){}return e}(t),n=this.options.autoTrackConfig.trackAttr||[];if(T(i)&&i.length>0)try{for(var a=l(i),s=a.next();!s.done;s=a.next()){var c=s.value,u=c.tagName&&(null===(o=c.tagName)||void 0===o?void 0:o.toLowerCase());if(st(c)&&(this.isTrackList[u]||this.hasAttributes(c,n)))return c}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}},o.prototype.getDivMaxLevel=function(){var t;return(null===(t=this.options.autoTrackConfig.collectTags.div)||void 0===t?void 0:t.maxLevel)||1},o.prototype.isStyleTag=function(t){var e,r=(null===(e=this.options.autoTrackConfig.collectTags.div)||void 0===e?void 0:e.ignoreTags)||[];return null==r?void 0:r.includes(t)},o.prototype.getCollectableParent=function(e){var r;try{var o=e.parentNode,i=o?null===(r=o.tagName)||void 0===r?void 0:r.toLowerCase():"";if("body"===i)return!1;var n=this.getDivMaxLevel();if("div"===i&&(n>1||this.isCollectableDiv(o)))return o;if(o&&this.isStyleTag(i))return this.getCollectableParent(o)}catch(e){this.context.log(e,t.ConsoleTypes.ERROR)}return!1},o.prototype.isCollectableDiv=function(e){var r;try{var o=e.children||[];if(0===o.length)return!0;for(var i=0;i<o.length;i++){var n=o[i];if(st(n)){var a=null===(r=n.tagName)||void 0===r?void 0:r.toLowerCase(),s=this.getDivMaxLevel();if(!("div"===a&&s>1||this.isStyleTag(a)))return!1;if(!this.isCollectableDiv(n))return!1}}return!0}catch(e){this.context.log(e,t.ConsoleTypes.ERROR)}return!1},o.prototype.isDivLevelValid=function(t){for(var e=this.getDivMaxLevel(),r=t.getElementsByTagName("div"),o=r.length-1;o>=0;o--)if(this.getDivLevels(r[o],t)>e)return!1;return!0},o.prototype.getElementPath=function(t,e,r){for(var o,i,n=[];st(t)&&t.parentNode;){if(t.id&&!e&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(t.id)){var a=t.tagName||"";n.unshift("".concat(a.toLowerCase(),"#").concat(t.id));break}if(r&&t===r){n.unshift(null===(o=t.tagName)||void 0===o?void 0:o.toLowerCase());break}if(t===document.body){n.unshift("body");break}n.unshift(null===(i=t.tagName)||void 0===i?void 0:i.toLowerCase()),t=t.parentNode}return n.join(" > ")},o.prototype.getDivLevels=function(t,e){var r=this.getElementPath(t,!0,e).split(" > "),o=0;return r.forEach((function(t){"div"===t&&o++})),o},o.prototype.getTargetElement=function(t){var e;if(!st(t))return null;var r=null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase();if(!S(r))return null;if(["body","html"].includes(r))return null;if(this.context.trackTags.includes(r)&&"div"!==r)return t;if("div"===r&&this.options.autoTrackConfig.collectTags.div&&(this.isDivLevelValid(t)&&(this.getDivMaxLevel()>1||this.isCollectableDiv(t))))return t;if(this.options.autoTrackConfig.collectTags.div&&this.isStyleTag(r)){var o=this.getCollectableParent(t);if(o&&this.isDivLevelValid(o))return o}return this.hasElement(t)||null},o.prototype.getClickElementInfo=function(t){var e=this.options.autoTrackConfig.isCollectInput,r=!1;k(e)&&(r=e(t));var o=this.getDomSelector(t),i=function(t,e){var r;return st(t)?N({H_element_type:null===(r=t.tagName)||void 0===r?void 0:r.toLowerCase(),H_element_name:t.getAttribute("name"),H_element_id:t.getAttribute("id"),H_element_target_url:t.getAttribute("href"),H_element_class_name:t.getAttribute("className"),H_element_content:ct(t,e)}):{}}(t,r);return i.H_element_selector=o,i.H_element_path=this.getElementPath(t,!1),i},o.prototype.getDomSelector=function(t){for(var e,r=[];t;){if("body"===(null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase())||!st(t)){r.unshift("body");break}if(r.unshift(this.getSelector(t)),(null==t?void 0:t.getAttribute("id"))&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(t.getAttribute("id")))break;t=t.parentNode}return r.join(" > ")},o.prototype.getSelector=function(t){var e,r,o=null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase(),i=-1;9!==(null===(r=t.parentNode)||void 0===r?void 0:r.nodeType)&&(i=this.getDomIndex(t));var n=t.getAttribute("id");return n&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(n)?"#".concat(n):o+(i>-1?":nth-of-type(".concat(i+1,")"):"")},o.prototype.getDomIndex=function(t){var e,r;if(t.parentNode)for(var o=0,i=null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase(),n=t.parentNode.children,a=0;a<n.length;a++){var s=n[a];if((null===(r=s.tagName)||void 0===r?void 0:r.toLowerCase())===i){if(s===t)return o;o++}}return-1},o}(f),ke=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="StayTrackPlugin",o.isReady=!1,o.timer=null,o.previousTime=L(),o.previousOffsetTop=0,o}return r(o,e),o.prototype.init=function(e){var r=this,o=this.options,i=o.autoTrackConfig,n=o.stayAutoTrackConfig;if(!0===i.stayAutoTrack)if(this.isReady)this.context.log("StayTrack plugin:插件已经运行,无需重复执行",t.ConsoleTypes.WARN);else{this.isReady=!0;var a=n.isCollectUrl;k(a)||(a=function(){return!0}),this.timer&&(clearTimeout(this.timer),this.timer=null),this.previousTime=L(),window.addEventListener("load",(function(){r.previousOffsetTop=ot()})),window.addEventListener("scroll",(function(){a()&&(r.timer||(r.timer=setTimeout((function(){r.run(e),clearTimeout(r.timer),r.timer=null}),1e3)))})),window.addEventListener("unload",(function(){a()&&r.run(e,!0)}))}},o.prototype.transform=function(t){return this.context.getReportData("track","H_WebStay",t)},o.prototype.run=function(t,e){void 0===e&&(e=!1);var r=this.options.autoTrackConfig,o=r.stayDelayTime,i=r.maxStayPageDuration,n=ot(),a=L(),s=a-this.previousTime;(e||s>o&&n!==this.previousOffsetTop)&&t({H_viewport_position:this.previousOffsetTop,event_duration:Math.min(s/1e3,i)});this.previousTime=a,this.previousOffsetTop=n},o}(f),Se=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="PageLeave",o.isReady=!1,o.pageId=M(),o.storageName="hinasdk_pageleave_",o.heartbeatIntervalTime=5e3,o.maxDuration=432e3,o.heartbeatIntervalTimer=null,o.startTime=L(),o.url=window.location.href,o.pageShowStatus=!0,o}return r(o,e),o.prototype.init=function(){if(this.options.autoTrackConfig.pageLeaveAutoTrack)if(this.context.store.localStorage)if(this.isReady)this.context.log("PageLeave plugin:插件已经运行,无需重复执行",t.ConsoleTypes.WARN);else{this.isReady=!0;var e=this.normalizePageLeaveAutoTrack(),r=e.heartbeat_interval_time,o=e.max_duration;r&&r>0&&(this.heartbeatIntervalTime=1e3*r),o&&o>0&&(this.maxDuration=Number(o)),this.startTime=L(),this.addPageLeaveEventListener(),document.hidden?this.pageShowStatus=!1:this.startHeartBeatInterval()}else this.context.log("PageLeave plugin需要使用localstorage存储数据,但是您的浏览器不支持localstorage,所以不能使用该功能",t.ConsoleTypes.WARN)},o.prototype.transform=function(){},o.prototype.normalizePageLeaveAutoTrack=function(){var t=this.options.autoTrackConfig.pageLeaveAutoTrack;return w(t)?t:{}},o.prototype.addPageLeaveEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},o.prototype.addPageStartListener=function(){var t=this;"onpageshow"in window&&window.addEventListener("pageshow",(function(){t.pageStartHandler()}))},o.prototype.addPageSwitchListener=function(){var t=this;new nt({visible:function(){t.pageStartHandler(),t.startHeartBeatInterval()},hidden:function(){t.url=window.location.href,t.pageEndHandler(),t.stopHeartBeatInterval()}})},o.prototype.addSinglePageListener=function(){var t=this;_t.on("urlChange",(function(e){var r=e.fromHref;r!==e.toHref&&(t.url=r,t.pageEndHandler(),t.stopHeartBeatInterval(),t.pageStartHandler(),t.startHeartBeatInterval())}))},o.prototype.addPageEndListener=function(){var t=this,e=["pagehide","beforeunload","unload"];e.forEach((function(r){"on".concat(e)in window&&window.addEventListener(r,(function(){t.pageEndHandler(),t.stopHeartBeatInterval()}))}))},o.prototype.pageStartHandler=function(){this.startTime=L(),this.pageShowStatus=!document.hidden,this.url=window.location.href},o.prototype.pageEndHandler=function(){if(this.pageShowStatus){if(this.pageShowStatus=!1,this.isCollectUrl()){var t=this.getPageLeaveProperties(),e=this.context.getReportData("track","H_WebPageLeave",t);this.context.report(e)}this.delHeartBeatData()}},o.prototype.startHeartBeatInterval=function(){var t=this;this.heartbeatIntervalTimer&&this.stopHeartBeatInterval(),this.isCollectUrl()&&(this.heartbeatIntervalTimer=setInterval((function(){t.saveHeartBeatData()}),this.heartbeatIntervalTime),this.saveHeartBeatData("first_heartbeat")),this.reissueHeartBeatData()},o.prototype.reissueHeartBeatData=function(){for(var t=this.context.store.localStorage,e=t.length(),r=0;r<e;r++){var o=t.key(r);if(o&&o!==this.storageName+this.pageId&&o.includes(this.storageName)){var i=C(t.get(o));w(i)&&L()-i.time>i.heartbeat_interval_time+5e3&&(delete i.heartbeat_interval_time,this.context.report(i)),this.delHeartBeatData(o)}}},o.prototype.stopHeartBeatInterval=function(){this.heartbeatIntervalTimer&&(clearInterval(this.heartbeatIntervalTimer),this.heartbeatIntervalTimer=null)},o.prototype.delHeartBeatData=function(t){this.context.store.localStorage.remove(t||this.storageName+this.pageId)},o.prototype.isCollectUrl=function(){var t=this.normalizePageLeaveAutoTrack().isCollectUrl;return!k(t)||t(this.url)},o.prototype.saveHeartBeatData=function(t){var e=this.getPageLeaveProperties();e.H_time=L(),"first_heartbeat"===t&&(e.event_duration=3);var r=this.context.getReportData("track","H_WebPageLeave",e);r.heartbeat_interval_time=this.heartbeatIntervalTime,this.context.store.localStorage.set(this.storageName+this.pageId,JSON.stringify(r))},o.prototype.getPageLeaveProperties=function(){var t=(L()-this.startTime)/1e3;t=t<=0||t>this.maxDuration?0:D(t,3);var e=O(this.url),r=e.pathname,o=e.hash,i={H_url:this.url,H_url_path:r,H_url_hash:o};t&&(i.event_duration=t);var n=this.normalizePageLeaveAutoTrack().custom_props;return w(n)&&(i=u(u({},i),n||{})),i},o}(f),He=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="SiteLinker",o.isReady=!1,o.linker=[],o}return r(o,e),o.prototype.init=function(){if(this.options.siteLinkerConfig){var e=this.getLinkerConfig().linker;T(e)&&e.length>0?this.isReady?this.context.log("SiteLinker plugin:插件已经运行,无需重复执行",t.ConsoleTypes.WARN):(this.isReady=!0,this.resolveOption(),this.setRefferId(),this.addClickListen()):this.context.log("siteLinker plugin: 请配置正确的linker参数",t.ConsoleTypes.WARN)}},o.prototype.transform=function(){},o.prototype.getLinkerConfig=function(){var t=this.options.siteLinkerConfig||{},e=t.linker;return{linker:(void 0===e?[]:e)||[],re_login:t.re_login}},o.prototype.resolveOption=function(){for(var e=this.getLinkerConfig().linker,r=e.length,o=[],i=0;i<r;i++){var n=e[i],a=n.part_url,s=n.after_hash;/[A-Za-z0-9]+\./.test(a)&&R(s)?o.push({part_url:a,after_hash:s}):this.context.log("The configuration of linker ".concat(i+1," is not supported.Please check format"),t.ConsoleTypes.WARN)}this.linker=o},o.prototype.setRefferId=function(){var t=this.getLinkerConfig().re_login,e=this.getUrlId(),r=e.startsWith("a");if(""!==(e=e.substring(1))){var o=this.context.store.getAnonymousId(),i=this.context.store.getAccountId();if(r){if(e!==o&&(this.context.store.state.anonymousId=e,this.context.store.save()),i){var n=this.context.getReportData("track_signup","H_SignUp",{});this.context.report(n)}}else(!i||t&&i!==e)&&this.context.setUserUId(e)}},o.prototype.getUrlId=function(){var t=window.location.href.match(/_hnsdk=([au][^\?\#\&\=]+)/);return T(t)&&t[1]?function(t){var e=t;try{e=decodeURIComponent(t)}catch(t){}return e}(t[1]):""},o.prototype.getPartUrl=function(t){for(var e=this.linker.length,r=0;r<e;r++)if(t.includes(this.linker[r].part_url))return!0;return!1},o.prototype.getPartHash=function(t){for(var e=this.linker.length,r=0;r<e;r++)if(t.includes(this.linker[r].part_url))return this.linker[r].after_hash;return!1},o.prototype.getCurrentId=function(){var t=this.context.store.getAccountId(),e=this.context.store.getAnonymousId();return function(t){var e=t;try{e=encodeURIComponent(t)}catch(t){}return e}(t?"u".concat(t):"a".concat(e))},o.prototype.rewriteUrl=function(t,e){var r=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(t),o="";if(r){var i=r[1]||"",n=r[2]||"",a=r[3]||"",s="_hnsdk=".concat(this.getCurrentId()),c=function(t){var e=t.split("&"),r=[];return e.forEach((function(t){t.includes("_hnsdk")?r.push(s):r.push(t)})),r.join("&")};if(this.getPartHash(t)){var u=a.includes("?"),l=a.indexOf("_hnsdk");o=u?l>=0?"".concat(i).concat(n,"#").concat(a.substring(1,l)).concat(c(a.substring(l,a.length))):"".concat(i).concat(n,"#").concat(a.substring(1),"&").concat(s):"".concat(i).concat(n,"#").concat(a.substring(1),"?").concat(s)}else{o=(u=/^\?(\w)+/.test(n))?n.includes("_hnsdk")?"".concat(i,"?").concat(c(n.substring(1))).concat(a):"".concat(i).concat(n,"&").concat(s).concat(a):"".concat(i,"?").concat(s).concat(a)}return e&&(e.href=o),o}},o.prototype.addClickListen=function(){var t=this,e=function(e){var r,o,i=e.target;if(i){var n=null===(r=i.tagName)||void 0===r?void 0:r.toLowerCase(),a=i.parentNode,s=null===(o=null==a?void 0:a.tagName)||void 0===o?void 0:o.toLowerCase();if("a"===n&&i.href||"a"===s&&a.href){var c=void 0,u=void 0;"a"===n&&i.href?(c=i.href,u=i):(c=a.href,u=a);var l=O(c).protocol;"http:"!==l&&"https:"!==l||t.getPartUrl(c)&&t.rewriteUrl(c,u)}}};"PointerEvent"in window?document.addEventListener("pointerdown",e):document.addEventListener("mousedown",e)},o}(f),Re=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="HistoryPlugin",o.isReady=!1,o.lastHref=window.location.href,o.lastPath=window.location.pathname,o}return r(o,e),o.prototype.init=function(){if(window&&window.history.pushState&&window.history.replaceState)if(this.isReady)this.context.log("History plugin:插件已经运行,无需重复执行",t.ConsoleTypes.WARN);else{this.isReady=!0;var e=this,r=window.onpopstate,o=function(t,r){var o={fromPath:e.lastPath,fromHref:e.lastHref,toPath:t,toHref:r};e.lastPath=t,e.lastHref=r,_t.emit("urlChange",u(u({},o),{mode:"history"}))};window.onpopstate=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=window.location.pathname,n=window.location.href;o(i,n),r&&r.apply(this,t)},J(window.history,"pushState",i),J(window.history,"replaceState",i)}function i(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.apply(this,e);var i=window.location.pathname,n=window.location.href;o(i,n)}}},o.prototype.transform=function(){},o}(f),xe=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="HashPlugin",o.isReady=!1,o.lastHref=window.location.href,o.lastPath=window.location.hash,o}return r(o,e),o.prototype.init=function(){var e=this;this.isReady?this.context.log("Hash plugin:插件已经运行,无需重复执行",t.ConsoleTypes.WARN):(this.isReady=!0,window.addEventListener("hashchange",(function(t){var r=t.newURL,o=O(r).hash,i={fromPath:e.lastPath,fromHref:e.lastHref,toPath:o,toHref:r};e.lastHref=r,e.lastPath=o,_t.emit("urlChange",u(u({},i),{mode:"hash"}))})))},o.prototype.transform=function(){},o}(f),Ee="4.0.0",Ce=function(e){function o(t,r){var o,i,n=e.call(this,t,r)||this;return n.options=t,n.context=r,n.name="HinaABTest",n.isReady=!1,n.platform=(i=null===(o=et.getUA())||void 0===o?void 0:o.toLowerCase(),/android|webos|iphone|ipod|blackberry/i.test(i)?"H5":"Web"),n.projectKey="",n.storageName="hina_webjs_sdk_abtest",n}return r(o,e),o.prototype.init=function(){var e=this;if(this.context.store.localStorage){var r=this.options.abTestingPluginConfig,o=null==r?void 0:r.url;if(S(o)){var i=z(o,"project-key");if(i){this.projectKey=i;var n=O(o).protocol,a=O(window.location.href).protocol;if(n&&n!==a)this.context.log("A/B Testing 初始化失败,".concat(a," 页面必须使用 ").concat(a," 的 URL"),t.ConsoleTypes.WARN);else if(this.isReady)this.context.log("A/B Testing 插件已经运行,无需重复执行",t.ConsoleTypes.WARN);else{var s=this.context.getUserUid();this.context.log("当前accountId为:".concat(s),t.ConsoleTypes.INFO),_t.on("changeAccountId",(function(){e.context.store.localStorage.set(e.storageName,"")})),this.isReady=!0}}else this.context.log("A/B Testing 初始化失败,请使用正确的 URL(必须包含 project-key)")}else this.context.log("A/B Testing 初始化失败,请使用正确的 URL!",t.ConsoleTypes.WARN)}else this.context.log("A/B Testing 初始化失败,浏览器不支持localStorage",t.ConsoleTypes.WARN)},o.prototype.transform=function(){},o.prototype.valueMatchType=function(e,r){switch(r){case t.VariablesTypes.INTEGER:return H(e);case t.VariablesTypes.STRING:return S(e);case t.VariablesTypes.BOOLEAN:return R(e);default:return!1}},o.prototype.normalizeParams=function(e,r,o){var i,n;void 0===o&&(o=be);var a={verify_success:!0,para:r};try{for(var s=l(o),c=s.next();!c.done;c=s.next()){var u=c.value;if(!a.verify_success)break;var p=r.customIds||{},d={};switch(u){case"abtestExperimentId":S(r.abtestExperimentId)&&r.abtestExperimentId.trim()||(this.context.log("".concat(e,"方法调用失败,").concat(u,"参数未正确配置!").concat(u,": ").concat(r.abtestExperimentId),t.ConsoleTypes.WARN),a.verify_success=!1);break;case"paramName":S(r.paramName)&&r.paramName.trim()||(this.context.log("".concat(e,"方法调用失败,").concat(u,"参数未正确配置!").concat(u,": ").concat(r.paramName),t.ConsoleTypes.WARN),a.verify_success=!1);break;case"valueType":[t.VariablesTypes.BOOLEAN,t.VariablesTypes.INTEGER,t.VariablesTypes.STRING].includes(r.valueType)||(this.context.log("".concat(e,"方法调用失败,").concat(u,"参数未正确配置!").concat(u,": ").concat(r.valueType),t.ConsoleTypes.WARN),a.verify_success=!1);break;case"defaultValue":this.valueMatchType(r.defaultValue,r.valueType)||(this.context.log("".concat(e,"方法调用失败,").concat(u,"类型必须与valueType一致!"),t.ConsoleTypes.WARN),a.verify_success=!1);break;case"callback":k(r.callback)||(this.context.log("".concat(e,"方法调用失败,").concat(u,"参数未正确配置")),r.callback=E,a.verify_success=!1);break;case"timeoutMilliseconds":(!H(r.timeoutMilliseconds)||r.timeoutMilliseconds<=0)&&(this.context.log("".concat(u,"参数错误:").concat(r.timeoutMilliseconds),t.ConsoleTypes.WARN),r.timeoutMilliseconds=3e3),r.timeoutMilliseconds<200&&(r.timeoutMilliseconds=200);break;case"customProperties":r.customProperties=w(r.customProperties)?r.customProperties:{};break;case"customIds":for(var f in p)(S(p[f])||H(p[f]))&&(d[f]=p[f]);r.customIds=d}}}catch(t){i={error:t}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return a},o.prototype.sendTriggerEvent=function(t){var e=t.abtest_experiment_group_id,r=t.abtest_experiment_id;this.context.track("H_ABTestTrigger",{H_abtest_experiment_id:r,H_abtest_experiment_group_id:e})},o.prototype.getExpResult=function(t,e){var r,o;void 0===e&&(e=[]);var i,n=t.abtestExperimentId,a=t.paramName,s=t.valueType;if(0===e.length){var c=this.getStorageData();w(c)&&(e=c.result||[])}try{for(var u=l(e),p=u.next();!p.done;p=u.next()){var d=p.value,f=d.abtest_experiment_id,h=d.abtest_experiment_group_id,g=d.is_white_list,v=d.variables;if(f===n){var m=v.find((function(t){return t.name===a&&t.type===s}));if(m){g||this.sendTriggerEvent({abtest_experiment_id:f,abtest_experiment_group_id:h}),i=m.value;break}}}}catch(t){r={error:t}}finally{try{p&&!p.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return i},o.prototype.getStorageData=function(){var t=this.context.store.localStorage.get(this.storageName);return b(t)?C(t):null},o.prototype.saveResponseData=function(t){var e=this.getStorageData(),r={updateTime:L()};if(e&&w(e)){var o=[],i=e.result||[];t.forEach((function(t){var e=t.abtest_experiment_group_id,r=t.abtest_experiment_id,n=t.variables,a=i.find((function(t){return t.abtest_experiment_id===r&&t.abtest_experiment_group_id===e}));if(a){var s=[];n.forEach((function(t){var e=t.name,r=t.type,o=a.variables.findIndex((function(t){return t.name===e&&t.type===r}));o>=0?a.variables[o]=t:s.push(t)})),a.variables=d(d([],p(a.variables),!1),p(s),!1)}else o.push(t)})),r.result=d(d([],p(i),!1),p(o),!1)}else r.result=t;this.context.store.localStorage.set(this.storageName,JSON.stringify(r))},o.prototype.createRequestData=function(t){var e=t.paramName,r=t.customProperties,o=t.customIds,i={anonymous_id:this.context.store.getAnonymousId(),platform:this.platform,abtest_lib_version:Ee,param_name:e,properties:this.context.getPresetProperties()};return w(r)&&!P(r)&&(i.custom_properties=r),w(o)&&!P(o)&&(i.custom_ids=o),this.context.getUserUid()&&(i.login_id=this.context.getUserUid()),i},o.prototype.getResultFromServer=function(t){var e=this;return new Promise((function(r,o){var i=e.createRequestData(t);new vt({url:e.options.abTestingPluginConfig.url,data:JSON.stringify(i),contentType:"application/json",customHeaders:{"project-key":e.projectKey},timeout:t.timeoutMilliseconds}).run().then((function(t){var i=t.data;"SUCCESS"===(null==i?void 0:i.status)?(e.saveResponseData(i.results),r(i)):o()}))}))},o.prototype.asyncFetch=function(t){var e=this;return new Promise((function(r){e.getResultFromServer(t).then((function(t){r(t)})).catch((function(){t.callback(t.defaultValue)}))}))},o.prototype.preFetch=function(e,r){return this.isReady?!!w(r)||(this.context.log("".concat(e," 方法参数必须是对象"),t.ConsoleTypes.WARN),!1):(this.context.log("A/B Testing 插件尚未运行,请先执行该插件",t.ConsoleTypes.WARN),!1)},o.prototype.asyncFetchABTest=function(t){var e=this;if(this.preFetch("asyncFetchABTest",t)){var r=this.normalizeParams("asyncFetchABTest",t),o=r.verify_success,i=r.para;o?this.asyncFetch(i).then((function(t){var r=e.getExpResult(i,t.results);i.callback(r||i.defaultValue)})):i.callback(i.defaultValue)}},o.prototype.fetchCacheABTest=function(t){if(this.preFetch("fetchCacheABTest",t)){var e=this.normalizeParams("fetchCacheABTest",t),r=e.verify_success,o=e.para;if(r){var i=this.getExpResult(o);o.callback(i||o.defaultValue)}else o.callback(o.defaultValue)}},o.prototype.fastFetchABTest=function(t){var e=this;if(this.preFetch("fastFetchABTest",t)){var r=this.normalizeParams("fastFetchABTest",t),o=r.verify_success,i=r.para;if(o){var n=this.getExpResult(i);b(n)?i.callback(n):this.asyncFetch(i).then((function(){var t=e.getExpResult(i);i.callback(t||i.defaultValue)}))}else i.callback(i.defaultValue)}},o}(f),Ae=function(e){function o(t,r){void 0===r&&(r=!0);var o=e.call(this,t,r)||this;return o.consolePrefix="埋点SDK",o.trackTags=we,o.presetProps={},o.useInstancing&&o.init(t),o}return r(o,e),o.prototype.init=function(e){if(this.isReady)this.log("hinaSDK has been initialized",t.ConsoleTypes.ERROR);else{var r={name:"",serverUrl:"",showLog:!1,autoTrackConfig:{clickAutoTrack:!0,stayAutoTrack:!0,isCollectUrl:function(){return!0},isCollectElement:function(){return!0},isCollectInput:function(){return!1},addCustomProperty:function(){},stayDelayTime:4e3,maxStayPageDuration:18e3,collectTags:{div:!1},trackAttr:["hn-click"],pageviewAutoTrack:!1,pageLeaveAutoTrack:!1},stayAutoTrackConfig:{isCollectUrl:function(){return!0}},maxStringLength:1024,imgUseCrossOrigin:!1,isSinglePage:!1,batchSend:!1,appJsBridge:!1,sendType:t.ReportTypes.BEACON,customHeaders:{},credentials:!1,dataSendTimeout:3e3,presetProperties:{latest_utm:!0,latest_traffic_source_type:!0,latest_search_keyword:!0,latest_referrer:!0,url:!0,title:!0},sourceChannel:[],plugins:[]},o=e.performanceErrorConfig,i=function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(r[o[i]]=t[o[i]])}return r}(e,["performanceErrorConfig"]);this.options=I(r,i),this.options=u(u({},this.options),{performanceErrorConfig:o}),this.initState(),this.normalizeConfig(),this.initAdvProps(),this.initPlugins(),this.isReady=!0}},o.prototype.initState=function(){this.store=new bt(this.options),this.store.init()},o.prototype.normalizeConfig=function(){var e=this,r=this.options,o=r.serverUrl,i=r.sendType,n=r.batchSend,a=r.maxStringLength,s=r.isSinglePage,c=r.autoTrackConfig,l=void 0===c?{}:c,p=l.trackAttr,d=void 0===p?[]:p,f=l.collectTags,h=l.pageLeaveAutoTrack,g=l.pageviewAutoTrack;if(""===(o=(o=o||"").trim()))this.log("当前 serverUrl 为空,network 中不会发数据,请配置正确的 serverUrl!",t.ConsoleTypes.WARN);else{var v=O(window.location.href).protocol||"";(O(o).protocol||"")!==v&&this.log("SDK 检测到您的数据发送地址和当前页面地址的协议不一致,建议您修改成一致的协议。因为:https 下面发送 http 的图片请求会失败。",t.ConsoleTypes.WARN)}[t.ReportTypes.IMAGE,t.ReportTypes.AJAX,t.ReportTypes.BEACON].includes(i)||this.setConfig({sendType:t.ReportTypes.AJAX});var m=a;if(!H(a)||a<0?m=1024:a>5120&&(m=5120),this.options.maxStringLength=m,(!0===h||w(h)&&P(h))&&(this.options.autoTrackConfig.pageLeaveAutoTrack={heartbeat_interval_time:5e3,max_duration:432e3}),T(d)?(d=d.filter((function(t){return S(t)})),d.includes("hn-click")||d.push("hn-click")):d=["hn-click"],this.options.autoTrackConfig.trackAttr=d,w(f))if(!0===f.div)this.options.autoTrackConfig.collectTags.div={ignoreTags:_e,maxLevel:1};else if(w(f.div)){var y=1,_=f.div;H(_.maxLevel)&&[1,2,3].includes(_.maxLevel)&&(y=_.maxLevel),this.options.autoTrackConfig.collectTags.div={ignoreTags:_e,maxLevel:y}}else this.options.autoTrackConfig.collectTags.div=!1;else this.options.autoTrackConfig.collectTags={div:!1};this.updateTrackTags(),(!0===n||w(n)&&!P(n))&&(this.options.batchSend=u({dataSendTimeout:6e3,sendInterval:6e3,storageLimit:200},n),this.batchSender=new Tt(this.options,t.PlatformTypes.WEB,"hinasdk_tab","hinasdk_data_")),"auto"===g?this.autoTrack():("singlePage"===g||s)&&(this.autoTrack(),_t.on("urlChange",(function(t){var r=t.fromHref;if(r!==t.toHref){if(k(s)){var o=s();w(o)&&(t=u(u({},t),o))}e.autoTrack(u(u({},t),{H_referrer:r}))}})))},o.prototype.updateTrackTags=function(){var t=this.options.autoTrackConfig.collectTags,e=d([],p(we),!1);Object.keys(t||{}).forEach((function(r){var o=t[r];!0!==o&&!w(o)||e.includes(r)||e.push(r)})),this.trackTags=e},o.prototype.initAdvProps=function(){var t={},e=this.options,r=e.presetProperties,o=e.sourceChannel;Object.keys(r||{}).forEach((function(e){var o,i=r[e];if(e.includes("latest_")&&(e=e.slice(7),i)){var n=q();if("utm"!==e&&"url解析失败"===n)t["H_latest_".concat(e)]="url的domain解析失败";else if(""===(o=o||document.referrer)||U(j(o))!==U())switch(e){case"traffic_source_type":t.H_latest_traffic_source_type=pt.getSourceFromReferrer();break;case"search_keyword":var a=pt.getKeywordFromReferrer();a&&(t.H_latest_search_keyword=a);break;case"referrer":t.H_latest_referrer=B()}}}));var i=this.store.state.props||{},n={};r.latest_utm&&(n=dt("H_latest_"));var a={};i.H_utm_source||(a=dt("H_"));var s={},c={};if(T(o)&&o.length>0){var l=o.filter((function(t){return!h.includes(t)}));l.length>0&&(i["H_".concat(l[0])]||(c=ft("H_",l)),s=ft("H_latest_",l))}this.store.state.props=u(u(u(u(u(u({},this.store.state.props),t),n),s),c),a),this.store.setProps(this.store.state.props)},o.prototype.initPlugins=function(){var t=this,e=this.options,r=e.serverUrl,o=e.name,i=e.showLog,n=e.sendType,a=e.customHeaders,s=e.credentials,c=e.dataSendTimeout,l=e.batchSend,p=e.imgUseCrossOrigin,d=e.globalCallback,f=e.plugins,h=void 0===f?[]:f,g=e.performanceErrorConfig,v=e.autoTrackConfig,m=e.siteLinkerConfig,y=e.abTestingPluginConfig;h=h||[];var _=v.pageLeaveAutoTrack,b=new Te(this.options,this),k=new ke(this.options,this),S=new Re(this.options,this),H=new xe(this.options,this);if(this.plugins=[b,k,S,H],w(_)&&!P(_)){var R=new Se(this.options,this);this.plugins.push(R)}var x=(m||{}).linker;if(T(x)&&x.length>0){var E=new He(this.options,this);this.plugins.push(E)}if(w(y)&&!P(y)){var C=new Ce(this.options,this);this.plugins.push(C)}if(h.forEach((function(e){var r=new e(t.options,t);t.plugins.push(r)})),w(g)&&!P(g)){var A=u({serverUrl:r,name:o,showLog:i,sendType:n,customHeaders:a,credentials:s,dataSendTimeout:c,batchSend:l,imgUseCrossOrigin:p,globalCallback:d},g);this.epmInstance=new ye(A,!0)}this.runPlugins(this.plugins)},o.prototype.use=function(e,r){var o=this,i=this.options,n=i.autoTrackConfig,a=i.siteLinkerConfig,s=i.abTestingPluginConfig,c=n.pageLeaveAutoTrack,u=function(t){var e=new t(o.options,o);o.plugins.push(e),e.init()};if(this.isReady){if(w(r))return"PageLeave"===e?w(c)&&!P(c)?this.log("PageLeave插件已运行,无需重复执行",t.ConsoleTypes.WARN):(this.options.autoTrackConfig.pageLeaveAutoTrack=r,u(Se)):"SiteLinker"===e?w(a)&&!P(a)?this.log("SiteLinker插件已插件已运行,无需重复执行",t.ConsoleTypes.WARN):(this.options.siteLinkerConfig=r,u(He)):"HinaABTest"===e&&(w(s)&&!P(s)?this.log("HinaABTest插件已运行,无需重复执行",t.ConsoleTypes.WARN):(this.options.abTestingPluginConfig=r,u(Ce))),this.getPluginInstance(e);this.log("".concat(e,"插件配置项必须是一个对象类型"),t.ConsoleTypes.WARN)}else this.log("请先初始化埋点SDK",t.ConsoleTypes.WARN)},o.prototype.getPluginInstance=function(t){return this.plugins.find((function(e){return e.name===t}))},o.prototype.setConfig=function(t){this.options=I(this.options,t),this.normalizeConfig()},o.prototype.getConfig=function(t){return t?this.options[t]:this.options},o.prototype.setUserUId=function(e,r){if(H(e=null!=e?e:"")||S(e))if(e=String(e).trim(),this.store.getAccountId()!==e){this.store.setAccountId(e);var o=this.getReportData("track_signup","H_SignUp",{});this.report(o,r),_t.emit("changeAccountId")}else this.log("setUserUId: uid is equal to account_id, , failed to execute setUserUId",t.ConsoleTypes.WARN);else this.log("setUserUId: uid must be string or number",t.ConsoleTypes.WARN)},o.prototype.getUserUid=function(){return this.store.state.accountId},o.prototype.setDeviceUId=function(t){this.store.setDeviceId(t)},o.prototype.getDeviceUId=function(){return this.store.getDeviceId()},o.prototype.userSet=function(t,e){if(w(t)&&!P(t)){var r=this.getReportData("user_set","",t);this.report(r,e)}},o.prototype.userSetOnce=function(t,e){if(w(t)&&!P(t)){var r=this.getReportData("user_setOnce","",t);this.report(r,e)}},o.prototype.userAdd=function(e,r){var o,i=this;S(e)&&((o={})[e]=1,e=o);if(w(e)&&!P(e)&&function(e){for(var r in e)if(!/-*\d+/.test(String(e[r])))return i.log("userAdd属性的值只能是数字",t.ConsoleTypes.WARN),!1;return!0}(e)){var n=this.getReportData("user_add","",e);this.report(n,r)}},o.prototype.userAppend=function(t,e){var r={};if(w(t)&&(Object.keys(t).forEach((function(e){var o=t[e];T(o)?r[e]=o:r[e]=[o]})),!P(r))){var o=this.getReportData("user_append","",r);this.report(o,e)}},o.prototype.userUnset=function(e,r){var o=this,i={};if(S(e)&&(e=[e]),T(e)){if(e.forEach((function(e){S(e)?i[e]=!0:o.log("userUnset参数数组里面的值必须时string,已经过滤掉".concat(e),t.ConsoleTypes.WARN)})),!P(i)){var n=this.getReportData("user_unset","",i);this.report(n,r)}}else this.log("userUnset参数必须是数组或字符串",t.ConsoleTypes.WARN)},o.prototype.userDelete=function(t){var e=this.getReportData("user_delete","",{});this.report(e,t),this.store.setAccountId("")},o.prototype.registerCommonProperties=function(t){this.presetProps=I(this.presetProps,t)},o.prototype.getPresetProperties=function(){return{H_is_first_day:this.store.isFirstDay,H_is_first_time:this.store.isFirstTime,device_id:this.store.getDeviceId(),anonymous_id:this.store.getAnonymousId(),account_id:this.store.getAccountId(),properties:u(u(u({},this.presetProps),ut()),rt(Ee))}},o.prototype.clearPageRegister=function(t){var e=this;void 0===t&&(t=!0),!0===t?this.presetProps={}:T(t)&&t.forEach((function(t){t in e.presetProps&&delete e.presetProps[t]}))},o.prototype.checkReportProperties=function(t){var e=this,r=this.options.maxStringLength;Object.keys(t).forEach((function(o){var i=t[o];if(S(i)&&i.length>r)e.log("属性 ".concat(o," 已经做截取")),t[o]=i.slice(0,r);else if(w(i))e.checkReportProperties(i);else if(k(i))try{t[o]=i(t),k(t[o])?(e.log("属性--".concat(o," 格式不满足要求, 已被删除")),delete t[o]):w(t[o])?e.checkReportProperties(t[o]):S(t[o])&&t[o].length>r&&(t[o]=t[o].slice(0,r))}catch(r){e.log("属性--".concat(o," 格式不满足要求, 已被删除")),delete t[o]}}))},o.prototype.track=function(e,r,o){if(o=o||function(){},S(e)){r=w(r)?r:{};var i=this.getReportData("track",e,r);this.report(i,o)}else this.log("track事件名必须是字符串,属性必须是是一个对象",t.ConsoleTypes.WARN)},o.prototype.quick=function(t,e,r){var o={};r=k(r)?r:E,w(e)?o=e:k(e)&&(r=e),this.autoTrack(o,r)},o.prototype.autoTrack=function(t,e){void 0===t&&(t={}),void 0===e&&(e=E);var r=this.getReportData("track","H_pageview",t);if(this.report(r,e),this.store.isSetFirstVisit){this.store.isSetFirstVisit=!1;var o=B();this.userSetOnce({H_first_referrer:o,H_first_referrer_host:o?j(o,"取值异常"):"",H_first_traffic_source_type:pt.getSourceFromReferrer(),H_first_search_keyword:pt.getKeywordFromReferrer(),H_first_visit_time:L(),H_first_browser_language:S(navigator.language)?navigator.language.toLowerCase():"取值异常"})}},o.prototype.report=function(e,r,o){var i,n,a=this.options,s=a.appJsBridge,c=a.serverUrl;if(this.log(e),s){var u=!0,l=null===window||void 0===window?void 0:window.Hina_Cloud_H5_Bridge;if(w(l)&&l.track)u=!1,l.track(e.event,e.type,JSON.stringify(e));else{var p=null===(n=null===(i=null===window||void 0===window?void 0:window.webkit)||void 0===i?void 0:i.messageHandlers)||void 0===n?void 0:n.hinaNativeTracker;if(null==p?void 0:p.postMessage){u=!1;var d=JSON.stringify({eventName:e.event,eventType:e.type,properties:e});p.postMessage(d)}}if(u)return void this.log("JSBridge 发送数据失败",t.ConsoleTypes.WARN);k(r)&&r(c,e)}else this.sendReportData(e,r,o)},o.prototype.getReportData=function(t,e,r){var o=this.store.getAnonymousId(),i=this.store.getAccountId(),n=L(),a=this.getReportProperties(t,e),s=u(u({},a),r||{});this.checkReportProperties(s);var c={anonymous_id:o,type:t,event:e,time:n,_track_id:M(),properties:s};return i&&(c.account_id=i),c.send_time=L(),c},o.prototype.getReportProperties=function(t,e){void 0===t&&(t=""),void 0===e&&(e="");var r=I(this.presetProps),o=u(u({device_id:this.store.getDeviceId()},this.store.state.props),r);return t&&"user"===t.slice(0,4)||(o=u(u(u({},o),ut()),rt(Ee))),"track"===t&&(o.H_is_first_day=this.store.isFirstDay,this.store.isFirstDay=!1,"H_pageview"===e&&(o.H_is_first_time=this.store.isFirstTime,this.store.isFirstTime=!1)),o},o}(St);var Pe=function(t){return new Ae(t,!1)}({});t.HinaTrack=Ae,t.PluginBase=f,t.default=Pe,Object.defineProperty(t,"__esModule",{value:!0})}));
|
@@ -0,0 +1 @@
|
|
1
|
+
var hinaDataStatistic=function(t){"use strict";var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},e(t,r)};function r(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function o(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(o.prototype=r.prototype,new o)}var o,i,n,a,s,c,u=function(){return u=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},u.apply(this,arguments)};function l(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],o=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&o>=t.length&&(t=void 0),{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function p(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var o,i,n=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(o=n.next()).done;)a.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function d(t,e,r){if(r||2===arguments.length)for(var o,i=0,n=e.length;i<n;i++)!o&&i in e||(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError,t.ConsoleTypes=void 0,(o=t.ConsoleTypes||(t.ConsoleTypes={})).LOG="log",o.INFO="info",o.WARN="warn",o.ERROR="error",o.ASSERT="assert",t.ReportTypes=void 0,(i=t.ReportTypes||(t.ReportTypes={})).BEACON="beacon",i.IMAGE="image",i.AJAX="ajax",t.PlatformTypes=void 0,(n=t.PlatformTypes||(t.PlatformTypes={})).WEB="web",n.MINI_APP="mini_app",t.ErrorTypes=void 0,(a=t.ErrorTypes||(t.ErrorTypes={})).JS_ERROR="JsError",a.RESOURCE_ERROR="ResourceError",a.FETCH_ERROR="FetchError",a.AJAX_ERROR="AjaxError",a.PROMISE_ERROR="PromiseError",a.WHITE_SCREEN_ERROR="WhiteScreenError",a.VUE_ERROR="VueError",a.REACT_ERROR="ReactError",a.CAPTURE_EVENT="CaptureEvent",a.CAPTURE_EXCEPTION="CaptureException",t.PerformanceFeat=void 0,(s=t.PerformanceFeat||(t.PerformanceFeat={})).BASIC="basic",s.VITALS="vitals",s.RESOURCE="resource",s.LONG_TASK="longtask",t.VariablesTypes=void 0,(c=t.VariablesTypes||(t.VariablesTypes={})).INTEGER="INTEGER",c.STRING="STRING",c.BOOLEAN="BOOLEAN";var f=function(t,e){this.options=t,this.context=e},h=["utm_source","utm_medium","utm_campaign","utm_content","utm_term"],g=["www.baidu.","m.baidu.","m.sm.cn","so.com","sogou.com","youdao.com","google.","yahoo.com/","bing.com/","ask.com/"],v=["weibo.com","renren.com","kaixin001.com","douban.com","qzone.qq.com","zhihu.com","tieba.baidu.com","weixin.qq.com"],m={baidu:["wd","word","kw","keyword"],google:"q",bing:"q",yahoo:"p",sogou:["query","keyword"],so:"q",sm:"q"},y="hinasdk_domain_test",_=Object.prototype.toString;function w(t){return"[object Object]"===_.call(t)}function b(t){return null!=t}function T(t){return Array.isArray(t)}function k(t){return"function"==typeof t}function S(t){return"string"==typeof t}function H(t){return"number"==typeof t}function R(t){return"boolean"==typeof t}function E(t){var e="";if(S(t))return t;if(null==t?void 0:t.stack)e=w(t.stack)?JSON.stringify(t.stack):t.stack;else{if(!t)return"未知js错误";e=w(t)?JSON.stringify(t):t.toString()}return e}function x(){}function C(t){try{return JSON.parse(t)}catch(t){}return t}function A(t){try{return JSON.stringify(t)}catch(e){return t}}function P(t){return 0===Object.keys(t).length}function L(){return Date.now&&k(Date.now)?Date.now():(new Date).getTime()}function I(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=Object.create(null);return t.forEach((function(t){t&&Object.keys(t).forEach((function(e){var o=t[e];w(o)?w(r[e])?r[e]=I(r[e],o):r[e]=I(o):r[e]=o}))})),r}function N(t){return Object.keys(t).reduce((function(e,r){return b(t[r])&&""!==t[r]&&(e[r]=t[r]),e}),{})}function O(t){var e={};try{e=new URL(t)}catch(t){}return e}function D(t,e){if(void 0===e&&(e=3),!t)return t;var r=t.toString(),o=r.indexOf(".");return r=-1!==o?r.substring(0,o+e+1):r.substring(0),parseFloat(r)}function U(t){t=t||window.location.hostname,/^[a-zA-Z0-9\u4e00-\u9fa5\-\\.]+$/.exec(t)||(t="");var e=t.split(".");if(e.length>=2&&!/^(\d+\.)+\d+$/.test(t))for(var r=".".concat(e.splice(e.length-1,1));e.length>0;)if(r=".".concat(e.splice(e.length-1,1)).concat(r),document.cookie="".concat(y,"=true; path=/; domain=").concat(r),-1!==document.cookie.indexOf("".concat(y,"=true")))return document.cookie="".concat(y,"=true; path=/; domain=").concat(r,"; max-age=0"),r;return""}function q(){var t=U();return""===t?"url解析失败":t}function B(t){var e=t||document.referrer;return"string"!=typeof e?"referrer exception".concat(String(e)):(e.startsWith("https://www.baidu.com/")&&(e=e.split("?")[0]),"string"==typeof(e=e.slice(0,200))?e:"")}function j(t,e){return e&&"string"==typeof e||(e="hostname解析异常"),t&&(O(t).hostname||"")||e}function F(){var t=L(),e=Math.floor(1e6*Math.random());return"".concat(t,"_").concat(e)}function M(){var t=L(),e=Math.floor(1e6*Math.random());return Number(String(t).slice(-5)+String(e).slice(0,4))}function W(t){for(var e=5381,r=t.length;r;)e=33*e^t.charCodeAt(--r);return e>>>0}function z(t,e){e=e.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"),t=decodeURIComponent(t);var r=new RegExp("[\\?&]".concat(e,"=([^&#]*)")).exec(t);return null===r||r&&"string"!=typeof r[1]&&r[1].length?"":decodeURIComponent(r[1])}function V(t){try{return btoa(encodeURIComponent(t).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x".concat(e)))})))}catch(e){return t}}function J(t,e,r,o){if(void 0!==t&&(e in t||o)){var i=r(t[e]);k(i)&&(t[e]=i)}}function K(t){if(!t)return"";var e=t.match(/\/([^/]+)$/);return e?e[1]:""}function G(t){if(void 0===(null==t?void 0:t.stack)||!(null==t?void 0:t.stack))return[];for(var e,r=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,o=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,i=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,n=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,a=t.stack.split("\n"),s=[],c=0;c<a.length;c++){var u=a[c];(e=r.exec(u))||(e=o.exec(u))?s.push({source:e[2],filename:K(e[2]),lineno:e[3]?+e[3]:null,colno:e[4]?+e[4]:null}):(e=i.exec(u))?s.push({source:e[3],filename:K(e[3]),lineno:e[4]?+e[4]:null,colno:e[5]?+e[5]:null}):(e=n.exec(u))&&s.push({source:e[5],filename:K(e[5]),lineno:e[1]?+e[1]:null,colno:e[2]?+e[2]:null})}return s.length>0?[s[0]]:s}var $=function(){function t(){this.name="CookieStorage"}return t.prototype.isSupport=function(t,e){var r=this;void 0===t&&(t="cookie_support_test"),void 0===e&&(e="1");return navigator.cookieEnabled&&(r.set(t,e),r.get(t)===e&&(r.remove(t),!0))},t.prototype.get=function(t){var e,r,o=document.cookie.split(";");try{for(var i=l(o),n=i.next();!n.done;n=i.next()){var a=n.value.split("=");if(a[0].trim()===t)return decodeURIComponent(a[1])}}catch(t){e={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return null},t.prototype.set=function(t,e,r,o,i,n,a){o=o||"/",t=t.trim(),e=e.trim();var s="".concat(t,"=").concat(encodeURIComponent(e),"; path=").concat(o,";");r=b(r)?r:63072e8,s+=" max-age=".concat(r,";"),a&&(s+=" secure;"),i&&(s+=" domain=".concat(i,";")),["Strict","Lax","None"].includes(n)&&(s+=" SameSite=".concat(n,";")),document.cookie=s},t.prototype.remove=function(t,e){void 0===e&&(e="/"),this.set(t,"1",0,e)},t.prototype.setDomain=function(t,e,r){var o=q();"url解析失败"===o&&(o=""),this.set(t,e,r,"/",o)},t}(),X=function(){function t(){this.name="LocalStorage"}return t.prototype.isSupport=function(){var t=!0;try{var e="__localStorageSupport__",r="testIsSupportStorage";this.set(e,r),this.get(e)!==r&&(t=!1),this.remove(e)}catch(e){t=!1}return t},t.prototype.key=function(t){return window.localStorage.key(t)},t.prototype.get=function(t){return window.localStorage.getItem(t)},t.prototype.length=function(){return window.localStorage.length},t.prototype.set=function(t,e){try{window.localStorage.setItem(t,e)}catch(t){}},t.prototype.remove=function(t){window.localStorage.removeItem(t)},t.prototype.parse=function(t){var e=this.get(t);try{e=JSON.parse(e)}catch(t){e=""}return e},t}(),Z=function(){function t(){this.name="MemoryStorage",this.data={}}return t.prototype.get=function(t){var e=this.data[t];return b(null==e?void 0:e.expireTime)?e.expireTime<L()?null:e.value:null==e?void 0:e.value},t.prototype.set=function(t,e,r){if(b(r)){var o=L()+1e3*r;this.data[t]={value:e,expireTime:o}}this.data[t]={value:e}},t.prototype.setDomain=function(t,e,r){this.set(t,e,r)},t}(),Y="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Q(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var tt={exports:{}};!function(t,e){!function(r,o){var i="function",n="undefined",a="object",s="string",c="major",u="model",l="name",p="type",d="vendor",f="version",h="architecture",g="console",v="mobile",m="tablet",y="smarttv",_="wearable",w="embedded",b="Amazon",T="Apple",k="ASUS",S="BlackBerry",H="Browser",R="Chrome",E="Firefox",x="Google",C="Huawei",A="LG",P="Microsoft",L="Motorola",I="Opera",N="Samsung",O="Sharp",D="Sony",U="Xiaomi",q="Zebra",B="Facebook",j="Chromium OS",F="Mac OS",M=" Browser",W=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},z=function(t,e){return typeof t===s&&-1!==V(e).indexOf(V(t))},V=function(t){return t.toLowerCase()},J=function(t,e){if(typeof t===s)return t=t.replace(/^\s\s*/,""),typeof e===n?t:t.substring(0,500)},K=function(t,e){for(var r,n,s,c,u,l,p=0;p<e.length&&!u;){var d=e[p],f=e[p+1];for(r=n=0;r<d.length&&!u&&d[r];)if(u=d[r++].exec(t))for(s=0;s<f.length;s++)l=u[++n],typeof(c=f[s])===a&&c.length>0?2===c.length?typeof c[1]==i?this[c[0]]=c[1].call(this,l):this[c[0]]=c[1]:3===c.length?typeof c[1]!==i||c[1].exec&&c[1].test?this[c[0]]=l?l.replace(c[1],c[2]):o:this[c[0]]=l?c[1].call(this,l,c[2]):o:4===c.length&&(this[c[0]]=l?c[3].call(this,l.replace(c[1],c[2])):o):this[c]=l||o;p+=2}},G=function(t,e){for(var r in e)if(typeof e[r]===a&&e[r].length>0){for(var i=0;i<e[r].length;i++)if(z(e[r][i],t))return"?"===r?o:r}else if(z(e[r],t))return"?"===r?o:r;return e.hasOwnProperty("*")?e["*"]:t},$={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},X={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,f],[/opios[\/ ]+([\w\.]+)/i],[f,[l,I+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[f,[l,I+" GX"]],[/\bopr\/([\w\.]+)/i],[f,[l,I]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[f,[l,"Baidu"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim)\s?(?:browser)?[\/ ]?([\w\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio)\/([-\w\.]+)/i,/(heytap|ovi)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[l,f],[/quark(?:pc)?\/([-\w\.]+)/i],[f,[l,"Quark"]],[/\bddg\/([\w\.]+)/i],[f,[l,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[l,"UC"+H]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[f,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[f,[l,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[f,[l,"Smart Lenovo "+H]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+H],f],[/\bfocus\/([\w\.]+)/i],[f,[l,E+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[l,I+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[l,I+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[l,"MIUI "+H]],[/fxios\/([-\w\.]+)/i],[f,[l,E]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360"+M]],[/\b(qq)\/([\w\.]+)/i],[[l,/(.+)/,"$1Browser"],f],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1"+M],f],[/samsungbrowser\/([\w\.]+)/i],[f,[l,N+" Internet"]],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],f],[/metasr[\/ ]?([\d\.]+)/i],[f,[l,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[l,"Sogou Mobile"],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345Explorer)[\/ ]?([\w\.]+)/i],[l,f],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,B],f],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[l,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[l,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[f,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[l,R+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,R+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[l,"Android "+H]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[f,G,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],f],[/(wolvic)\/([\w\.]+)/i],[l,f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[l,E+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,[f,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[l,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[h,"amd64"]],[/(ia32(?=;))/i],[[h,V]],[/((?:i[346]|x)86)[;\)]/i],[[h,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[h,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[h,"armhf"]],[/windows (ce|mobile); ppc;/i],[[h,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[h,/ower/,"",V]],[/(sun4\w)[;\)]/i],[[h,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[h,V]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[d,N],[p,m]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,N],[p,v]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[d,T],[p,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,T],[p,m]],[/(macintosh);/i],[u,[d,T]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,O],[p,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[d,C],[p,m]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[d,C],[p,v]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[u,/_/g," "],[d,U],[p,v]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[d,U],[p,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[d,"OPPO"],[p,v]],[/\b(opd2\d{3}a?) bui/i],[u,[d,"OPPO"],[p,m]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[p,v]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[p,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,L],[p,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,L],[p,m]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,A],[p,m]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,A],[p,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[d,"Lenovo"],[p,m]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[d,"Nokia"],[p,v]],[/(pixel c)\b/i],[u,[d,x],[p,m]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,x],[p,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[d,D],[p,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,D],[p,m]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,"OnePlus"],[p,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,b],[p,m]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,b],[p,v]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[p,m]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,S],[p,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,k],[p,m]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,k],[p,v]],[/(nexus 9)/i],[u,[d,"HTC"],[p,m]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[p,v]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[u,[d,"TCL"],[p,m]],[/(itel) ((\w+))/i],[[d,V],u,[p,G,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[p,m]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[p,v]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[d,"Ulefone"],[p,v]],[/droid.+; (a(?:015|06[35]|142p?))/i],[u,[d,"Nothing"],[p,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[p,v]],[/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[d,u,[p,m]],[/(surface duo)/i],[u,[d,P],[p,m]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[p,v]],[/(u304aa)/i],[u,[d,"AT&T"],[p,v]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[p,v]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[p,m]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[p,m]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[p,m]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[p,m]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[p,m]],[/\b(k88) b/i],[u,[d,"ZTE"],[p,m]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[p,v]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[p,v]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[p,m]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[p,m]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[p,m]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[p,m]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[p,m]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[p,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[p,v]],[/\b(ph-1) /i],[u,[d,"Essential"],[p,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[p,m]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[p,m]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[p,m]],[/(shield[\w ]+) b/i],[u,[d,"Nvidia"],[p,m]],[/(sprint) (\w+)/i],[d,u,[p,v]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,P],[p,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,q],[p,m]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,q],[p,v]],[/smart-tv.+(samsung)/i],[d,[p,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,N],[p,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,A],[p,y]],[/(apple) ?tv/i],[d,[u,T+" TV"],[p,y]],[/crkey/i],[[u,R+"cast"],[d,x],[p,y]],[/droid.+aft(\w+)( bui|\))/i],[u,[d,b],[p,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[d,O],[p,y]],[/(bravia[\w ]+)( bui|\))/i],[u,[d,D],[p,y]],[/(mitv-\w{5}) bui/i],[u,[d,U],[p,y]],[/Hbbtv.*(technisat) (.*);/i],[d,u,[p,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,J],[u,J],[p,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[p,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[p,g]],[/droid.+; (shield) bui/i],[u,[d,"Nvidia"],[p,g]],[/(playstation [345portablevi]+)/i],[u,[d,D],[p,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,P],[p,g]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[u,[d,N],[p,_]],[/((pebble))app/i],[d,u,[p,_]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[d,T],[p,_]],[/droid.+; (glass) \d/i],[u,[d,x],[p,_]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,q],[p,_]],[/(quest( \d| pro)?)/i],[u,[d,B],[p,_]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[p,w]],[/(aeobc)\b/i],[u,[d,b],[p,w]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[u,[p,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[p,m]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,m]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,v]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[l,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,f],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[l,[f,G,$]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[f,G,$],[l,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,F],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,f],[/\(bb(10);/i],[f,[l,S]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[l,E+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[f,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[f,[l,R+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,j],f],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,f],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,f]]},Z=function(t,e){if(typeof t===a&&(e=t,t=o),!(this instanceof Z))return new Z(t,e).getResult();var g=typeof r!==n&&r.navigator?r.navigator:o,y=t||(g&&g.userAgent?g.userAgent:""),_=g&&g.userAgentData?g.userAgentData:o,w=e?function(t,e){var r={};for(var o in t)e[o]&&e[o].length%2==0?r[o]=e[o].concat(t[o]):r[o]=t[o];return r}(X,e):X,b=g&&g.userAgent==y;return this.getBrowser=function(){var t={};return t[l]=o,t[f]=o,K.call(t,y,w.browser),t[c]=function(t){return typeof t===s?t.replace(/[^\d\.]/g,"").split(".")[0]:o}(t[f]),b&&g&&g.brave&&typeof g.brave.isBrave==i&&(t[l]="Brave"),t},this.getCPU=function(){var t={};return t[h]=o,K.call(t,y,w.cpu),t},this.getDevice=function(){var t={};return t[d]=o,t[u]=o,t[p]=o,K.call(t,y,w.device),b&&!t[p]&&_&&_.mobile&&(t[p]=v),b&&"Macintosh"==t[u]&&g&&typeof g.standalone!==n&&g.maxTouchPoints&&g.maxTouchPoints>2&&(t[u]="iPad",t[p]=m),t},this.getEngine=function(){var t={};return t[l]=o,t[f]=o,K.call(t,y,w.engine),t},this.getOS=function(){var t={};return t[l]=o,t[f]=o,K.call(t,y,w.os),b&&!t[l]&&_&&_.platform&&"Unknown"!=_.platform&&(t[l]=_.platform.replace(/chrome os/i,j).replace(/macos/i,F)),t},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return y},this.setUA=function(t){return y=typeof t===s&&t.length>500?J(t,500):t,this},this.setUA(y),this};Z.VERSION="1.0.39",Z.BROWSER=W([l,f,c]),Z.CPU=W([h]),Z.DEVICE=W([u,d,p,g,v,y,m,_,w]),Z.ENGINE=Z.OS=W([l,f]),t.exports&&(e=t.exports=Z),e.UAParser=Z;var Y=typeof r!==n&&(r.jQuery||r.Zepto);if(Y&&!Y.ua){var Q=new Z;Y.ua=Q.getResult(),Y.ua.get=function(){return Q.getUA()},Y.ua.set=function(t){Q.setUA(t);var e=Q.getResult();for(var r in e)Y.ua[r]=e[r]}}}("object"==typeof window?window:Y)}(tt,tt.exports);var et=new(Q(tt.exports));function rt(t){var e=et.getResult(),r=e.browser,o=e.device,i=e.os,n=e.ua,a={H_timezone_offset:(new Date).getTimezoneOffset(),H_viewport_width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0,H_viewport_height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0,H_screen_width:window.screen.width,H_screen_height:window.screen.height,H_lib_version:t,H_lib:"js",H_lib_method:"code",H_browser:r.name.toLowerCase(),H_browser_version:r.version,H_os:i.name,H_os_version:i.version,H_browser_user_agent:n,H_language:S(navigator.language)?navigator.language.toLowerCase():"取值异常",H_network_type:it()};return"mobile"===o.type?a.H_model=o.vendor?o.model:"UnknownPhone":a.H_model=o.model,a}function ot(){return document.documentElement.scrollTop||document.body.scrollTop||0}function it(){if(void 0===navigator.connection)return"unknown";var t=navigator.connection;return t.effectiveType?t.effectiveType:t.type?t.type:"取值异常"}var nt=function(){function t(t){this.visibleHandler=function(){},this.hiddenHandler=function(){};var e=t.visible,r=t.hidden;k(e)&&(this.visibleHandler=e),k(r)&&(this.hiddenHandler=r),this.init()}return t.prototype.isSupport=function(){return void 0!==document.hidden},t.prototype.init=function(){var t=this;this.isSupport()?document.addEventListener("visibilitychange",(function(){document.hidden?t.hiddenHandler():t.visibleHandler()})):(window.addEventListener("focus",this.visibleHandler),window.addEventListener("blur",this.hiddenHandler))},t}();function at(){return"undefined"!=typeof console}function st(t){return 1===(null==t?void 0:t.nodeType)}function ct(t,e){var r;if("input"===(null===(r=t.tagName)||void 0===r?void 0:r.toLowerCase()))return(["button","submit"].includes(t.type)||e)&&t.value||"";var o="";return t.textContent?o=t.textContent.trim():t.innerText&&(o=t.innerText.trim()),o&&(o=o.replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)),o||""}function ut(){var t=B(),e=q(),r=Math.round(ot());return N({H_referrer:t,H_referrer_host:t?j(t):"",H_url:window.location.href,H_url_host:j(window.location.href,"url_host取值异常"),H_url_domain:e,H_url_path:window.location.pathname,H_url_hash:window.location.hash,H_title:document.title,H_viewport_position:r})}function lt(t,e){if(!t)return{};var r=document.documentElement.scrollLeft||document.body.scrollLeft||0,o=ot(),i=e.getBoundingClientRect(),n=t.pageX||t.clientX+r||t.offsetX+((null==i?void 0:i.left)||0)+r,a=t.pageY||t.clientY+o||t.offsetY+((null==i?void 0:i.top)||0)+o;return{H_page_x:D(n,3),H_page_y:D(a,3)}}var pt=function(){function t(){}return t.getSourceFromReferrer=function(){var t=function(t,e){for(var r=0;r<t.length;r++)if(-1!==e.split("?")[0].indexOf(t[r]))return!0},e="(".concat(h.join("|"),")\\=[^&]+"),r=document.referrer||"",o=window.location.href;if(o){var i=o.match(new RegExp(e));return i&&i[0]?"付费广告流量":t(g,r)?"自然搜索流量":t(v,r)?"社交网站流量":""===r?"直接流量":"引荐流量"}return"获取url异常"},t.getReferSearchEngine=function(t){var e,r,o=j(t);if(!o||"hostname解析异常"===o)return"";var i={baidu:[/^.*\.baidu\.com$/],bing:[/^.*\.bing\.com$/],google:[/^www\.google\.com$/,/^www\.google\.com\.[a-z]{2}$/,/^www\.google\.[a-z]{2}$/],sm:[/^m\.sm\.cn$/],so:[/^.+\.so\.com$/],sogou:[/^.*\.sogou\.com$/],yahoo:[/^.*\.yahoo\.com$/]};for(var n in i){var a=i[n];try{for(var s=(e=void 0,l(a)),c=s.next();!c.done;c=s.next()){if(c.value.test(o))return n}}catch(t){e={error:t}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(e)throw e.error}}}return"未知搜索引擎"},t.getKeywordFromReferrer=function(){var t=document.referrer||"";if(0===t.indexOf("http")){var e=this.getReferSearchEngine(t),r=function(t){t=t||"";var e={};return new URLSearchParams(t).forEach((function(t,r){e[r]=t})),e}(O(t).search);if(P(r))return"未取到值";for(var o in m){var i=m[o];if(o===e)if(T(i))for(var n=0;n<i.length;n++){var a=r[i[n]];if(a)return a}else if(r[i])return r[i]}return"未取到值"}return""===t?"未取到值_直接打开":"未取到值_非http的url"},t}();function dt(t){void 0===t&&(t="");var e,r=(e={},h.forEach((function(t){var r=z(window.location.href,t);r.length&&(e[t]=r)})),e),o={};return Object.keys(r).forEach((function(e){o[t+e]=r[e]})),o}function ft(t,e){void 0===t&&(t=""),void 0===e&&(e=[]);var r={};return e.forEach((function(e){var o=z(window.location.href,e);o&&(r[e]=o,r["".concat(t).concat(e)]=o)})),r}var ht=function(t){this.options=t},gt=function(t){function e(e){var r=t.call(this,e)||this;return r.options=e,r}return r(e,t),e.prototype.run=function(){var t=this;return new Promise((function(e){var r=t.options,o=r.imgUseCrossOrigin,i=r.url,n=r.data,a=new Image;o&&(a.crossOrigin="anonymous");var s=-1===i.indexOf("?")?"?":"&";a.src="".concat(i).concat(s).concat(n);var c=function(t){a=null,e({type:t})};a.onload=function(){c("success")},a.onerror=function(){c("success")}}))},e}(ht),vt=function(t){function e(e){var r=t.call(this,e)||this;return r.options=e,r}return r(e,t),e.prototype.run=function(){var t=this;return new Promise((function(e){var r=t.options,o=r.url,i=r.data,n=r.timeout,a=r.credentials,s=r.contentType,c=r.customHeaders,u=void 0===c?{}:c,l=new XMLHttpRequest;l.open("POST",o,!0),l.timeout=n||2e4,l.isMonitor=!0,a&&(l.withCredentials=!0),l.setRequestHeader("Content-Type",s||"application/x-www-form-urlencoded"),w(u)&&!P(u)&&Object.keys(u).forEach((function(t){l.setRequestHeader(t,u[t])})),l.send(i||null),l.ontimeout=function(){l.abort()},l.onreadystatechange=function(){4===l.readyState&&(l.status>=200&&l.status<300||304===l.status?e({data:JSON.parse(l.responseText)||{},type:"success"}):e({type:"fail",msg:"网络异常, 请求失败,状态码=".concat(l.status)}))}}))},e}(ht),mt=function(t){function e(e){var r=t.call(this,e)||this;return r.options=e,r}return r(e,t),e.prototype.run=function(){var t=this;return new Promise((function(e){var r=t.options,o=r.url,i=r.data;navigator.sendBeacon&&e(navigator.sendBeacon(o,i)?{type:"success"}:{type:"fail",msg:"sendBeacon 请求失败"})}))},e}(ht);var yt,_t={all:yt=yt||new Map,on:function(t,e){var r=yt.get(t);r?r.push(e):yt.set(t,[e])},emit:function(t,e){var r=yt.get(t);r&&r.forEach((function(t){t(e)}))},off:function(t,e){var r=yt.get(t);if(r)if(e){var o=r.indexOf(e);o>=0&&r.splice(o,1)}else yt.set(t,[])}};function wt(e,r){void 0===r&&(r=t.ConsoleTypes.LOG);var o=console[r]||console.log;"function"==typeof o&&o(e)}var bt=function(){function e(t){this.options=t,this.storeName="hinasdk_crossdata",this.state=this.getDefaultState(),this.isFirstTime=!1,this.isFirstDay=!1,this.isSetFirstVisit=!0}return e.prototype.getDefaultState=function(){return{accountId:null,deviceId:null,anonymousId:null,sessionId:null,firstVisitTime:L(),props:{}}},e.prototype.log=function(e,r){void 0===r&&(r=t.ConsoleTypes.LOG);var o=this.options.showLog;at()&&o&&wt(e,r)},e.prototype.init=function(){var e,r=new $,o=new Z,i=new X;r.isSupport()?this.storage=r:(this.log("Cookie storage is not supported, SDK internal cache has been enabled",t.ConsoleTypes.WARN),this.storage=o),i.isSupport()?this.localStorage=i:this.log("localStorage is not supported, SDK internal cache has been enabled",t.ConsoleTypes.WARN),!(e=this.storage.get(this.storeName))&&this.localStorage&&(e=this.localStorage.get(this.storeName)),e&&function(t){try{JSON.parse(t)}catch(t){return!1}return!0}(e)&&(this.state=C(e)),e?(this.isSetFirstVisit=!1,this.save()):(this.isFirstDay=!0,this.isFirstTime=!0);var n=function(){var t=function(){for(var t=L(),e=0;t===L();)e++;return t.toString(16)+e.toString(16)},e=String(window.screen.height*window.screen.width);e=e&&/\d{5,}/.test(e)?e.toString(16):String(31242*Math.random()).replace(".","").slice(0,8);var r="".concat(t(),"-").concat(Math.random().toString(16).replace(".",""),"-").concat(function(){var t,e,r=navigator.userAgent,o=[],i=0;function n(t,e){var r,i=0;for(r=0;r<e.length;r++)i|=o[r]<<8*r;return t^i}for(t=0;t<r.length;t++)e=r.charCodeAt(t),o.unshift(255&e),o.length>=4&&(i=n(i,o),o=[]);return o.length>0&&(i=n(i,o)),i.toString(16)}(),"-").concat(e,"-").concat(t());return r||(String(Math.random())+String(Math.random())+String(Math.random())).slice(2,15)}();this.getAnonymousId()||this.setAnonymousId(n),this.getDeviceId()||this.setDeviceId(n)},e.prototype.clear=function(){this.state={},this.save()},e.prototype.save=function(){this.storage.setDomain(this.storeName,JSON.stringify(this.state)),this.localStorage&&this.localStorage.set(this.storeName,JSON.stringify(this.state))},e.prototype.set=function(t,e){this.state[t]=e,this.save()},e.prototype.checkSetValue=function(e,r){return!(!H(r=null!=r?r:"")&&!S(r))||(this.log("".concat(e,": id must be string or number"),t.ConsoleTypes.WARN),!1)},e.prototype.setDeviceId=function(t){void 0===t&&(t=""),this.checkSetValue("deviceId",t)&&this.set("deviceId",t)},e.prototype.setAccountId=function(t){void 0===t&&(t=""),this.checkSetValue("accountId",t)&&this.set("accountId",t)},e.prototype.setAnonymousId=function(e){this.state.anonymousId?this.log("Current anonymousId is ".concat(this.getAnonymousId(),", it has been set"),t.ConsoleTypes.WARN):this.checkSetValue("anonymousId",e)&&this.set("anonymousId",e)},e.prototype.setSessionId=function(t){this.set("sessionId",t)},e.prototype.setProps=function(t){var e=I(this.state.props||{},t);for(var r in e)"string"==typeof e[r]&&(e[r]=e[r].slice(0,200));this.set("props",e)},e.prototype.getAnonymousId=function(){return this.state.anonymousId},e.prototype.getDeviceId=function(){return this.state.deviceId},e.prototype.getAccountId=function(){return this.state.accountId},e.prototype.getSessionId=function(){return this.state.sessionId||""},e.prototype.getSessionIdCreateTime=function(){var t=this.getSessionId().split("_")[0],e=Number(t);return Number.isNaN(e)?0:e},e.prototype.getCookie=function(){return this.storage.get(this.storeName)},e}(),Tt=function(){function e(t,e,r,o){void 0===r&&(r="hinasdk_tab"),void 0===o&&(o="hinasdk_data_"),this.options=t,this.platform=e,this.batchKey=r,this.batchDataKey=o,this.init()}return e.prototype.log=function(e,r){void 0===r&&(r=t.ConsoleTypes.LOG);var o=this.options.showLog;at()&&o&&wt(e,r)},e.prototype.init=function(){var e=new X;e.isSupport()?(this.localStorage=e,this.isSupport=!0):(this.isSupport=!1,this.log("批量发送功能需要使用localstorage存储数据,但是您的浏览器不支持localstorage,所以不能使用该功能",t.ConsoleTypes.WARN)),this.batchInterval()},e.prototype.getBatchConfig=function(){return this.options.batchSend},e.prototype.getStorageList=function(){if(!this.isSupport)return[];var t=[],e=this.localStorage.get(this.batchKey);return e&&(T(t=C(e))||(t=[])),t},e.prototype.batchInterval=function(){var t=this;if(this.isSupport){var e=this.getBatchConfig().sendInterval;setTimeout((function(){t.send().then((function(){t.batchInterval()}))}),e)}},e.prototype.send=function(){var t=this;return new Promise((function(e){var r=t.getStorageList();if(r.length>0&&t.isSupport){for(var o=t.getBatchConfig(),i=o.storageLimit,n=o.dataSendTimeout,a=L(),s=[],c={},u=r.length,l=0;l<u;l++){var p=r[l],d=p.dataKey,f=p.expireTime;if(f>=a)c[d]={dataKey:d,expireTime:f},(w=t.localStorage.get(d))&&s.push(C(w));else t.localStorage.remove(d),r.splice(l,1),u--,l--}if(t.localStorage.set(t.batchKey,JSON.stringify(r)),(s=s.filter(Boolean)).length>i&&(s=s.slice(0,i)),0===s.length)e();else{var h=t.options,g=h.serverUrl,v=h.customHeaders,m=h.credentials,y=h.globalCallback,_=JSON.stringify(s),w=encodeURIComponent(V(_));new vt({url:g,data:"data_list=".concat(w),timeout:n,credentials:m,customHeaders:v}).run().then((function(r){k(y)&&y(g,s,r.type,r.msg||""),"success"===r.type&&t.remove(c),e()}))}}else e()}))},e.prototype.remove=function(t){var e=this;if(this.isSupport){var r=this.getStorageList(),o=Object.keys(t);if(o.forEach((function(t){e.localStorage.remove(t)})),r.length===o.length)this.localStorage.set(this.batchKey,JSON.stringify([]));else{var i=r.filter((function(e){return!t[e.dataKey]}));this.localStorage.set(this.batchKey,JSON.stringify(i))}}},e.prototype.add=function(t){if(this.isSupport){var e=this.getBatchConfig(),r=e.sendInterval,o=e.storageLimit,i=this.batchDataKey+F(),n=this.getStorageList();n.unshift({dataKey:i,expireTime:L()+2*r}),this.localStorage.set(this.batchKey,JSON.stringify(n)),this.localStorage.set(i,JSON.stringify(t)),(n.length>o||"track_signup"===t.type||"H_pageview"===t.event)&&this.send()}},e}(),kt=function(){function e(t,e){void 0===e&&(e=!0),this.isReady=!1,this.consolePrefix="",this.useInstancing=!0,this.plugins=[],this.options=t,this.useInstancing=e}return e.prototype.log=function(e,r){void 0===r&&(r=t.ConsoleTypes.LOG);var o=this.options.showLog;at()&&o&&("string"==typeof e&&this.consolePrefix&&(e="".concat(this.consolePrefix,":").concat(e)),wt(e,r))},e.prototype.runPlugins=function(t){for(var e=this,r=function(r){var o=t[r];o.init((function(t){if(o.transform){var r=o.transform(t);r&&e.report(r)}}))},o=0;o<t.length;o++)r(o)},e.prototype.applyPlugins=function(e){var r=this;if(this.isReady){T(e)||(e=[e]);var o=[];e.forEach((function(t){var e=new t(r.options,r);r.plugins.push(e),o.push(e)})),this.runPlugins(o)}else this.log("请先初始化SDK实例",t.ConsoleTypes.WARN)},e}(),St=function(e){function o(){return null!==e&&e.apply(this,arguments)||this}return r(o,e),o.prototype.sendReportData=function(e,r,o){var i=this.options,n=i.batchSend,a=i.globalCallback,s=i.serverUrl,c=i.dataSendTimeout,u=i.sendType,l=i.customHeaders,p=i.credentials,d=i.imgUseCrossOrigin;if(u=o||u,s){if(w(e)&&!P(e))if(n)this.batchSender.add(e);else{var f=e;S(e)||(f=A(e));var h=V(f),g={data:"data=".concat(encodeURIComponent(h)),url:s,timeout:c,imgUseCrossOrigin:d,customHeaders:l,credentials:p};(u===t.ReportTypes.BEACON&&navigator.sendBeacon?new mt(g):u===t.ReportTypes.IMAGE&&g.data.length<2048?new gt(g):new vt(g)).run().then((function(t){return k(a)&&a(s,e,t.type,t.msg||""),k(r)&&r(s,e,t.type,t.msg||""),t}))}}else this.log("当前 serverUrl 为空,network 中不会发数据,请配置正确的 serverUrl!",t.ConsoleTypes.WARN)},o}(kt),Ht=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="JsErrorPlugin",o.isReady=!1,o}return r(o,e),o.prototype.init=function(e){this.isReady||(this.isReady=!0,window.onerror=function(r,o,i,n,a){if("ResizeObserver loop limit exceeded"!==r.toString()){var s=E(a);e({H_js_error_id:W(s),H_error_category:t.ErrorTypes.JS_ERROR,H_error_type:a.name||t.ErrorTypes.JS_ERROR,H_error_message:a.message,H_error_stack:JSON.stringify({details:G(a),errorStack:s})})}})},o.prototype.transform=function(t){return this.context.getReportData("H_performance_js",t)},o}(f),Rt=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="DomErrorPlugin",o.isReady=!1,o}return r(o,e),o.prototype.init=function(e){this.isReady||(this.isReady=!0,window.addEventListener("error",(function(r){if(r.target!==window){var o=r.target,i=o.src||o.href,n=(s=(a=o).tagName.toLowerCase(),c=a.getAttributeNames(),u="",c.forEach((function(t){u+=" ".concat(t,"='").concat(a.getAttribute(t),"'")})),"<".concat(s).concat(u,">"));e({H_js_error_id:W(n),H_error_category:t.ErrorTypes.RESOURCE_ERROR,H_error_type:t.ErrorTypes.RESOURCE_ERROR,H_error_message:n,H_source_element:n,H_source_src:i})}var a,s,c,u}),!0))},o.prototype.transform=function(t){return this.context.getReportData("H_performance_js",t)},o}(f);function Et(){if(void 0!==window.performance&&"function"==typeof window.performance.getEntriesByType){var t=performance.getEntriesByType("navigation")[0],e=t.startTime,r=t.redirectStart,o=t.redirectEnd,i=t.fetchStart,n=t.domainLookupStart,a=t.domainLookupEnd,s=t.connectStart,c=t.secureConnectionStart,u=t.connectEnd,l=t.requestStart,p=t.responseStart,d=t.responseEnd,f=t.domInteractive,h=t.domContentLoadedEventEnd,g=t.loadEventStart,v=t.loadEventEnd,m=t.redirectCount,y=t.duration,_=t.unloadEventEnd,w=t.unloadEventStart;return{H_first_byte_time:D(p-e),H_unload_time:D(_-w),H_redirect_time:D(o-r),H_redirect_count:m,H_cache_check_time:D(n-i),H_dns_time:D(a-n),H_tcp_time:D(u-s),H_ssl_time:D(u-c),H_first_byte_response_time:D(p-r),H_dom_ready_time:D(h-i),H_request_time:D(p-l),H_content_transfer_time:D(d-p),H_dom_parsing_time:D(f-d),H_page_load_time:D(v-e),H_resource_load_time:D(g-h),H_resource_duration:y,H_load_event_time:D(v-g)}}var b=performance.timing,T=b.navigationStart,k=b.responseStart,S=b.unloadEventEnd,H=b.unloadEventStart,R=b.requestStart,E=b.responseEnd,x=b.redirectStart,C=b.redirectEnd,A=b.domainLookupStart,P=b.fetchStart,L=b.domainLookupEnd,I=b.connectStart,N=b.connectEnd,O=b.secureConnectionStart,U=b.domContentLoadedEventEnd,q=b.domInteractive,B=b.loadEventStart,j=b.loadEventEnd;return{H_first_byte_time:D(k-T),H_unload_time:D(S-H),H_redirect_time:D(C-x),H_cache_check_time:D(A-P),H_dns_time:D(L-A),H_tcp_time:D(N-I),H_ssl_time:D(N-O),H_first_byte_response_time:D(k-x),H_dom_ready_time:D(U-P),H_request_time:D(k-R),H_content_transfer_time:D(E-k),H_dom_parsing_time:D(q-E),H_page_load_time:D(j-T),H_resource_load_time:D(B-U),H_load_event_time:D(j-B)}}var xt,Ct,At,Pt,Lt=-1,It=function(t){addEventListener("pageshow",(function(e){e.persisted&&(Lt=e.timeStamp,t(e))}),!0)},Nt=function(){var t=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(t&&t.responseStart>0&&t.responseStart<performance.now())return t},Ot=function(){var t=Nt();return t&&t.activationStart||0},Dt=function(t,e){var r=Nt(),o="navigate";return Lt>=0?o="back-forward-cache":r&&(document.prerendering||Ot()>0?o="prerender":document.wasDiscarded?o="restore":r.type&&(o=r.type.replace(/_/g,"-"))),{name:t,value:void 0===e?-1:e,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:o}},Ut=function(t,e,r){try{if(PerformanceObserver.supportedEntryTypes.includes(t)){var o=new PerformanceObserver((function(t){Promise.resolve().then((function(){e(t.getEntries())}))}));return o.observe(Object.assign({type:t,buffered:!0},r||{})),o}}catch(t){}},qt=function(t,e,r,o){var i,n;return function(a){e.value>=0&&(a||o)&&((n=e.value-(i||0))||void 0===i)&&(i=e.value,e.delta=n,e.rating=function(t,e){return t>e[1]?"poor":t>e[0]?"needs-improvement":"good"}(e.value,r),t(e))}},Bt=function(t){requestAnimationFrame((function(){return requestAnimationFrame((function(){return t()}))}))},jt=function(t){document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&t()}))},Ft=function(t){var e=!1;return function(){e||(t(),e=!0)}},Mt=-1,Wt=function(){return"hidden"!==document.visibilityState||document.prerendering?1/0:0},zt=function(t){"hidden"===document.visibilityState&&Mt>-1&&(Mt="visibilitychange"===t.type?t.timeStamp:0,Jt())},Vt=function(){addEventListener("visibilitychange",zt,!0),addEventListener("prerenderingchange",zt,!0)},Jt=function(){removeEventListener("visibilitychange",zt,!0),removeEventListener("prerenderingchange",zt,!0)},Kt=function(){return Mt<0&&(Mt=Wt(),Vt(),It((function(){setTimeout((function(){Mt=Wt(),Vt()}),0)}))),{get firstHiddenTime(){return Mt}}},Gt=function(t){document.prerendering?addEventListener("prerenderingchange",(function(){return t()}),!0):t()},$t=[1800,3e3],Xt=function(t,e){e=e||{},Gt((function(){var r,o=Kt(),i=Dt("FCP"),n=Ut("paint",(function(t){t.forEach((function(t){"first-contentful-paint"===t.name&&(n.disconnect(),t.startTime<o.firstHiddenTime&&(i.value=Math.max(t.startTime-Ot(),0),i.entries.push(t),r(!0)))}))}));n&&(r=qt(t,i,$t,e.reportAllChanges),It((function(o){i=Dt("FCP"),r=qt(t,i,$t,e.reportAllChanges),Bt((function(){i.value=performance.now()-o.timeStamp,r(!0)}))})))}))},Zt=[.1,.25],Yt=[2500,4e3],Qt={},te=function(t,e){e=e||{},Gt((function(){var r,o=Kt(),i=Dt("LCP"),n=function(t){e.reportAllChanges||(t=t.slice(-1)),t.forEach((function(t){t.startTime<o.firstHiddenTime&&(i.value=Math.max(t.startTime-Ot(),0),i.entries=[t],r())}))},a=Ut("largest-contentful-paint",n);if(a){r=qt(t,i,Yt,e.reportAllChanges);var s=Ft((function(){Qt[i.id]||(n(a.takeRecords()),a.disconnect(),Qt[i.id]=!0,r(!0))}));["keydown","click"].forEach((function(t){addEventListener(t,(function(){return function(t){var e=self.requestIdleCallback||self.setTimeout,r=-1;return t=Ft(t),"hidden"===document.visibilityState?t():(r=e(t),jt(t)),r}(s)}),!0)})),jt(s),It((function(o){i=Dt("LCP"),r=qt(t,i,Yt,e.reportAllChanges),Bt((function(){i.value=performance.now()-o.timeStamp,Qt[i.id]=!0,r(!0)}))}))}}))},ee=[800,1800],re=function t(e){document.prerendering?Gt((function(){return t(e)})):"complete"!==document.readyState?addEventListener("load",(function(){return t(e)}),!0):setTimeout(e,0)},oe=function(t,e){e=e||{};var r=Dt("TTFB"),o=qt(t,r,ee,e.reportAllChanges);re((function(){var i=Nt();i&&(r.value=Math.max(i.responseStart-Ot(),0),r.entries=[i],o(!0),It((function(){r=Dt("TTFB",0),(o=qt(t,r,ee,e.reportAllChanges))(!0)})))}))},ie={passive:!0,capture:!0},ne=new Date,ae=function(t,e){xt||(xt=e,Ct=t,At=new Date,ue(removeEventListener),se())},se=function(){if(Ct>=0&&Ct<At-ne){var t={entryType:"first-input",name:xt.type,target:xt.target,cancelable:xt.cancelable,startTime:xt.timeStamp,processingStart:xt.timeStamp+Ct};Pt.forEach((function(e){e(t)})),Pt=[]}},ce=function(t){if(t.cancelable){var e=(t.timeStamp>1e12?new Date:performance.now())-t.timeStamp;"pointerdown"==t.type?function(t,e){var r=function(){ae(t,e),i()},o=function(){i()},i=function(){removeEventListener("pointerup",r,ie),removeEventListener("pointercancel",o,ie)};addEventListener("pointerup",r,ie),addEventListener("pointercancel",o,ie)}(e,t):ae(e,t)}},ue=function(t){["mousedown","keydown","touchstart","pointerdown"].forEach((function(e){return t(e,ce,ie)}))},le=[100,300];function pe(){return new Promise((function(t){!function(t,e){e=e||{},Gt((function(){var r,o=Kt(),i=Dt("FID"),n=function(t){t.startTime<o.firstHiddenTime&&(i.value=t.processingStart-t.startTime,i.entries.push(t),r(!0))},a=function(t){t.forEach(n)},s=Ut("first-input",a);r=qt(t,i,le,e.reportAllChanges),s&&(jt(Ft((function(){a(s.takeRecords()),s.disconnect()}))),It((function(){var o;i=Dt("FID"),r=qt(t,i,le,e.reportAllChanges),Pt=[],Ct=-1,xt=null,ue(addEventListener),o=n,Pt.push(o),se()})))}))}((function(e){t(e.value)}))}))}function de(){return new Promise((function(t){!function(t,e){e=e||{},Xt(Ft((function(){var r,o=Dt("CLS",0),i=0,n=[],a=function(t){t.forEach((function(t){if(!t.hadRecentInput){var e=n[0],r=n[n.length-1];i&&t.startTime-r.startTime<1e3&&t.startTime-e.startTime<5e3?(i+=t.value,n.push(t)):(i=t.value,n=[t])}})),i>o.value&&(o.value=i,o.entries=n,r())},s=Ut("layout-shift",a);s&&(r=qt(t,o,Zt,e.reportAllChanges),jt((function(){a(s.takeRecords()),r(!0)})),It((function(){i=0,o=Dt("CLS",0),r=qt(t,o,Zt,e.reportAllChanges),Bt((function(){return r()}))})),setTimeout(r,0))})))}((function(e){t(e.value)}),{reportAllChanges:!0})}))}var fe=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="PerformancePlugin",o.isReady=!1,o}return r(o,e),o.prototype.init=function(e){if(!this.isReady){this.isReady=!0;var r=this.options.performanceOff;r.includes(t.PerformanceFeat.VITALS)||Promise.all([new Promise((function(t){te((function(e){t(e.value)}))})),pe(),de(),new Promise((function(t){oe((function(e){t(e.value)}))})),new Promise((function(t){Xt((function(e){t(e.value)}))})),new Promise((function(t){"PerformanceObserver"in window?new PerformanceObserver((function(e){var r,o,i=e.getEntries();try{for(var n=l(i),a=n.next();!a.done;a=n.next()){var s=a.value;"first-paint"===s.name&&t(s.startTime)}}catch(t){r={error:t}}finally{try{a&&!a.done&&(o=n.return)&&o.call(n)}finally{if(r)throw r.error}}})).observe({entryTypes:["paint"]}):t(0)}))]).then((function(t){var e=p(t,6),r=e[0],o=e[1],i=e[2],n=e[3],a=e[4];return{H_first_paint_time:D(e[5]),H_first_contentful_paint_time:D(a),H_largest_contentful_paint_time:D(r),H_time_to_first_byte:D(n),H_first_input_delay:D(o),H_cumulative_layout_shift:D(i)}})).then((function(r){e(u({event:"H_performance_page",H_category:t.PerformanceFeat.VITALS},r))})),r.includes(t.PerformanceFeat.LONG_TASK)||function(t){if("PerformanceObserver"in window){var e=new PerformanceObserver((function(e){var r=e.getEntries(),o=0,i=[];r.forEach((function(t){var e=t.duration,r=t.name,n=t.startTime;o+=e,i.push({duration:D(e),startTime:D(n),name:r})})),t({H_long_task_time:D(o),H_long_task:r.length,H_long_task_list:i})}));e.observe({entryTypes:["longtask"]})}}((function(r){e(u({event:"H_performance_page",H_category:t.PerformanceFeat.LONG_TASK,H_url:window.location.href},r))})),window.addEventListener("load",(function(){r.includes(t.PerformanceFeat.BASIC)||e(u({event:"H_performance_loading",H_category:t.PerformanceFeat.BASIC},Et()))}))}},o.prototype.transform=function(t){return this.context.getReportData(t.event,t)},o}(f),he=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="FetchPlugin",o.isReady=!1,o}return r(o,e),o.prototype.init=function(e){if(window.fetch&&!this.isReady){this.isReady=!0;var r=this;J(window,"fetch",(function(o){return function(i,n){void 0===n&&(n={});var a=L(),s=n||{},c=s.headers,l=s.signal,p=s.method;return o(i,n).then((function(o){if(!o.ok){var s=u(u({},r.context.getRequestHeaders()),c||{}),l=L();o.clone().text().then((function(r){e({H_js_error_id:W("url=".concat(i,"&method=").concat(p)),H_error_category:t.ErrorTypes.FETCH_ERROR,H_error_type:t.ErrorTypes.FETCH_ERROR,H_error_message:i,H_request_url:i,H_request_headers:A(s),H_request_method:n.method.toLowerCase(),H_request_params:S(n.body)?n.body:"",H_response_status:o.status,H_response_status_text:o.statusText,H_request_time:a,H_response_time:l,H_response_data:r})}))}return o})).catch((function(o){if(l&&l.aborted)throw o;var s="";s=(s=o instanceof Error?null==o?void 0:o.message:A(o))||"网络错误,或者无法连接";var d=u(u({},r.context.getRequestHeaders()),c||{});throw e({H_js_error_id:W("url=".concat(i,"&method=").concat(p)),H_error_category:t.ErrorTypes.FETCH_ERROR,H_error_type:t.ErrorTypes.FETCH_ERROR,H_error_message:i,H_request_url:i,H_request_headers:A(d),H_request_method:n.method.toLowerCase(),H_request_params:S(n.body)?n.body:"",H_response_status:0,H_response_status_text:s,H_request_time:a,H_response_time:L(),H_response_data:s}),o}))}}))}},o.prototype.transform=function(t){return this.context.getReportData("H_performance_js",t)},o}(f),ge=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="XhrPlugin",o.isReady=!1,o}return r(o,e),o.prototype.init=function(e){if(!this.isReady){this.isReady=!0;var r=this,o=XMLHttpRequest.prototype.open,i=XMLHttpRequest.prototype.send;XMLHttpRequest.prototype.open=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.H_request_method=t[0],this.H_request_url=t[1],this.H_request_time=L(),o.apply(this,t)},XMLHttpRequest.prototype.send=function(o){var n=this;this.addEventListener("abort",(function(){n.H_response_status_text="abort"})),this.addEventListener("error",(function(){n.H_response_status_text="error"})),this.addEventListener("timeout",(function(){n.H_response_status_text="timeout"})),this.addEventListener("loadend",(function(){var i=n,a=i.status,s=i.statusText,c=i.responseType,u=i.responseText,l=i.response,p=i.H_request_method,d=i.H_request_url,f=i.H_request_time,h=i.H_response_status_text;if(!(a>=200&&a<300)&&"abort"!==h&&!n.isMonitor){var g=c&&"text"!==c?l:u,v=h||s;"error"===h?v="网络错误,或者无法连接":"timeout"===h&&(v="请求超时"),e({H_js_error_id:W("url=".concat(d,"&method=").concat(p)),H_error_category:t.ErrorTypes.AJAX_ERROR,H_error_type:t.ErrorTypes.AJAX_ERROR,H_error_message:d,H_request_url:d,H_request_headers:A(r.context.getRequestHeaders()),H_request_method:p,H_request_params:w(o)?A(o):S(o)?o:"",H_response_status:a,H_response_status_text:v,H_request_time:f,H_response_time:L(),H_response_data:g&&A(g)})}delete n.H_request_method,delete n.H_request_url,delete n.H_request_time,delete n.H_response_status_text}));try{i.call(this,o)}catch(t){}}}},o.prototype.transform=function(t){return this.context.getReportData("H_performance_js",t)},o}(f),ve=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="PromiseErrorPlugin",o.isReady=!1,o}return r(o,e),o.prototype.init=function(e){this.isReady||(this.isReady=!0,window.addEventListener("unhandledrejection",(function(r){var o=r.reason,i=t.ErrorTypes.PROMISE_ERROR,n="",a="";S(o)?n=o:void 0===o?n="undefined":(null==o?void 0:o.stack)?(i=o.name,n=o.message,a=JSON.stringify({errorStack:E(o),details:G(o)})):n=A(o);["axioserror","cancelederror","aborterror"].includes(i.toLowerCase())||e({H_js_error_id:W("message=".concat(n,"&stack=").concat(a)),H_error_category:t.ErrorTypes.PROMISE_ERROR,H_error_type:i||t.ErrorTypes.PROMISE_ERROR,H_error_message:n,H_error_stack:a})})))},o.prototype.transform=function(t){return this.context.getReportData("H_performance_js",t)},o}(f),me="4.0.0",ye=function(e){function o(t,r){void 0===r&&(r=!0);var o=e.call(this,t,r)||this;return o.consolePrefix="性能监控SDK",o.presetProps={},o.requestHeaders={},o.useInstancing&&o.init(t),o}return r(o,e),o.prototype.init=function(e){var r=this;if(this.isReady)this.log("Monitor has been initialized",t.ConsoleTypes.ERROR);else{var o={serverUrl:"",name:"",showLog:!1,errorCapture:!0,performance:!0,openPromiseCapture:!1,sendType:t.ReportTypes.BEACON,customHeaders:{},credentials:!1,dataSendTimeout:3e3,batchSend:!1,imgUseCrossOrigin:!1,performanceOff:[],plugins:[]};this.options=u(u({},o),e),this.initState(),this.normalizeConfig(),this.initPlugins(),this.isReady=!0,window.addEventListener("beforeunload",(function(){r.store.setSessionId("")}))}},o.prototype.initState=function(){this.store=new bt(this.options),this.store.init()},o.prototype.normalizeConfig=function(){var e=this.options,r=e.serverUrl,o=e.batchSend;""===(r=(r=r||"").trim())&&this.log("当前 serverUrl 为空,network 中不会发数据,请配置正确的 serverUrl!",t.ConsoleTypes.WARN),(!0===o||w(o)&&!P(o))&&(this.options.batchSend=u({dataSendTimeout:6e3,sendInterval:6e3,storageLimit:200},o),this.batchSender=new Tt(this.options,t.PlatformTypes.WEB,"hinaepm_tab","hinaepm_data_"))},o.prototype.initPlugins=function(){var t=this,e=this.options,r=e.errorCapture,o=e.performance,i=e.openPromiseCapture,n=e.plugins,a=void 0===n?[]:n;a=a||[];var s=[],c=[];if(r&&(s=[new Ht(this.options,this),new Rt(this.options,this),new he(this.options,this),new ge(this.options,this)],!0===i)){var u=new ve(this.options,this);s.push(u)}o&&(c=[new fe(this.options,this)]);this.plugins=d(d([],p(s),!1),p(c),!1),a.forEach((function(e){var r=new e(t.options,t);t.plugins.push(r)})),this.runPlugins(this.plugins)},o.prototype.report=function(t,e,r){var o=this.options.beforeSend,i=t;k(o)&&(i=o(i)),this.log(i),this.sendReportData(i,e,r)},o.prototype.getReportData=function(t,e){var r=this.options.sourcemapVersion;r||(r="1.0.0");var o=this.store.getAnonymousId(),i=this.store.getAccountId(),n=this.store.getSessionId(),a=L(),s=u(u(u({},this.getReportProperties()),{H_js_sourcemap_version:r}),e||{}),c={anonymous_id:o,type:"track",event:t,time:a,_track_id:M(),properties:s};(i&&(c.account_id=i),n)?L()-this.store.getSessionIdCreateTime()>18e5&&(n=F(),this.store.setSessionId(n)):(n=F(),this.store.setSessionId(n));return s.H_session_id=n,c.send_time=L(),c},o.prototype.getReportProperties=function(){return u(u(u({},rt(me)),this.getCommonProperties()),{H_url:window.location.href,H_title:document.title})},o.prototype.captureException=function(e,r,o){e instanceof Error||(e=new Error(e)),w(r)||(r={});var i=E(e),n=this.getReportData("H_performance_js",{H_js_error_id:W(i),H_error_category:t.ErrorTypes.CAPTURE_EXCEPTION,H_error_type:t.ErrorTypes.CAPTURE_EXCEPTION,H_error_message:e.message,H_error_stack:JSON.stringify({details:G(e),errorStack:i}),H_capture_extra:JSON.stringify(r)});this.report(n,o)},o.prototype.captureEvent=function(e,r){if(w(e)){var o=e.message,i=e.extra;w(i)||(i={});var n=this.getReportData("H_performance_js",{H_js_error_id:W(o||""),H_error_category:t.ErrorTypes.CAPTURE_EVENT,H_error_type:t.ErrorTypes.CAPTURE_EVENT,H_error_message:o||"",H_capture_message:o||"",H_capture_extra:JSON.stringify(i)});this.report(n,r)}else this.log("captureEvent event参数错误:event必须是一个对象")},o.prototype.setCommonProperties=function(t){w(t)&&!P(t)&&(this.presetProps=I(this.presetProps,t))},o.prototype.getCommonProperties=function(){return this.presetProps},o.prototype.clearCommonProperties=function(t){var e=this;void 0===t&&(t=!0),!0===t?this.presetProps={}:T(t)&&t.forEach((function(t){t in e.presetProps&&delete e.presetProps[t]}))},o.prototype.setRequestHeaders=function(t){void 0===t&&(t={}),w(t)&&!P(t)&&(this.requestHeaders=I(this.requestHeaders,t))},o.prototype.getRequestHeaders=function(){return this.requestHeaders},o.prototype.clearRequestHeaders=function(t){void 0===t&&(t=!0),!0===t?this.requestHeaders={}:T(t)&&t.forEach((function(t){}))},o}(St);new ye({},!1);var _e=["mark","/mark","strong","b","em","i","u","abbr","ins","del","s","sup"],we=["a","input","button","textarea"],be=["abtestExperimentId","paramName","valueType","defaultValue","callback","timeoutMilliseconds","customProperties","customIds"],Te=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="ClickTrackPlugin",o.isReady=!1,o.isTrackList={a:!0,button:!0},o}return r(o,e),o.prototype.init=function(e){var r=this,o=this.options.autoTrackConfig,i=o.clickAutoTrack,n=o.isCollectUrl,a=o.isCollectElement,s=o.addCustomProperty;!0===i&&(this.isReady?this.context.log("ClickTrack plugin:插件已经运行,无需重复执行",t.ConsoleTypes.WARN):(this.isReady=!0,document.addEventListener("click",(function(t){if(n()){var o=t||window.event;if(o){var i=o.target||o.srcElement,c=r.getTargetElement(i);if(c){if(k(a)&&!a(c))return!1;var u=r.getClickElementInfo(c),l=lt(o,c),p=l.H_page_x,d=l.H_page_y;if(u.H_page_x=p,u.H_page_y=d,k(s)){var f=s(c);w(f)&&(u=I(u,f))}e(u)}}}}),!0)))},o.prototype.transform=function(t){return this.context.getReportData("track","H_WebClick",t)},o.prototype.hasAttribute=function(t,e){var r;return t.hasAttribute?t.hasAttribute(e):t.attributes?!!(null===(r=t.attributes[e])||void 0===r?void 0:r.value):void 0},o.prototype.hasAttributes=function(t,e){if(T(e))for(var r=0;r<e.length;r++)if(this.hasAttribute(t,e[r]))return!0;return!1},o.prototype.hasElement=function(t){var e,r,o,i=function(t){var e=[t];try{if(!st(t))return e;if(null===t||null===t.parentElement)return e;for(;null!==t.parentElement;)t=t.parentElement,e.push(t);return e}catch(t){}return e}(t),n=this.options.autoTrackConfig.trackAttr||[];if(T(i)&&i.length>0)try{for(var a=l(i),s=a.next();!s.done;s=a.next()){var c=s.value,u=c.tagName&&(null===(o=c.tagName)||void 0===o?void 0:o.toLowerCase());if(st(c)&&(this.isTrackList[u]||this.hasAttributes(c,n)))return c}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}},o.prototype.getDivMaxLevel=function(){var t;return(null===(t=this.options.autoTrackConfig.collectTags.div)||void 0===t?void 0:t.maxLevel)||1},o.prototype.isStyleTag=function(t){var e,r=(null===(e=this.options.autoTrackConfig.collectTags.div)||void 0===e?void 0:e.ignoreTags)||[];return null==r?void 0:r.includes(t)},o.prototype.getCollectableParent=function(e){var r;try{var o=e.parentNode,i=o?null===(r=o.tagName)||void 0===r?void 0:r.toLowerCase():"";if("body"===i)return!1;var n=this.getDivMaxLevel();if("div"===i&&(n>1||this.isCollectableDiv(o)))return o;if(o&&this.isStyleTag(i))return this.getCollectableParent(o)}catch(e){this.context.log(e,t.ConsoleTypes.ERROR)}return!1},o.prototype.isCollectableDiv=function(e){var r;try{var o=e.children||[];if(0===o.length)return!0;for(var i=0;i<o.length;i++){var n=o[i];if(st(n)){var a=null===(r=n.tagName)||void 0===r?void 0:r.toLowerCase(),s=this.getDivMaxLevel();if(!("div"===a&&s>1||this.isStyleTag(a)))return!1;if(!this.isCollectableDiv(n))return!1}}return!0}catch(e){this.context.log(e,t.ConsoleTypes.ERROR)}return!1},o.prototype.isDivLevelValid=function(t){for(var e=this.getDivMaxLevel(),r=t.getElementsByTagName("div"),o=r.length-1;o>=0;o--)if(this.getDivLevels(r[o],t)>e)return!1;return!0},o.prototype.getElementPath=function(t,e,r){for(var o,i,n=[];st(t)&&t.parentNode;){if(t.id&&!e&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(t.id)){var a=t.tagName||"";n.unshift("".concat(a.toLowerCase(),"#").concat(t.id));break}if(r&&t===r){n.unshift(null===(o=t.tagName)||void 0===o?void 0:o.toLowerCase());break}if(t===document.body){n.unshift("body");break}n.unshift(null===(i=t.tagName)||void 0===i?void 0:i.toLowerCase()),t=t.parentNode}return n.join(" > ")},o.prototype.getDivLevels=function(t,e){var r=this.getElementPath(t,!0,e).split(" > "),o=0;return r.forEach((function(t){"div"===t&&o++})),o},o.prototype.getTargetElement=function(t){var e;if(!st(t))return null;var r=null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase();if(!S(r))return null;if(["body","html"].includes(r))return null;if(this.context.trackTags.includes(r)&&"div"!==r)return t;if("div"===r&&this.options.autoTrackConfig.collectTags.div&&(this.isDivLevelValid(t)&&(this.getDivMaxLevel()>1||this.isCollectableDiv(t))))return t;if(this.options.autoTrackConfig.collectTags.div&&this.isStyleTag(r)){var o=this.getCollectableParent(t);if(o&&this.isDivLevelValid(o))return o}return this.hasElement(t)||null},o.prototype.getClickElementInfo=function(t){var e=this.options.autoTrackConfig.isCollectInput,r=!1;k(e)&&(r=e(t));var o=this.getDomSelector(t),i=function(t,e){var r;return st(t)?N({H_element_type:null===(r=t.tagName)||void 0===r?void 0:r.toLowerCase(),H_element_name:t.getAttribute("name"),H_element_id:t.getAttribute("id"),H_element_target_url:t.getAttribute("href"),H_element_class_name:t.getAttribute("className"),H_element_content:ct(t,e)}):{}}(t,r);return i.H_element_selector=o,i.H_element_path=this.getElementPath(t,!1),i},o.prototype.getDomSelector=function(t){for(var e,r=[];t;){if("body"===(null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase())||!st(t)){r.unshift("body");break}if(r.unshift(this.getSelector(t)),(null==t?void 0:t.getAttribute("id"))&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(t.getAttribute("id")))break;t=t.parentNode}return r.join(" > ")},o.prototype.getSelector=function(t){var e,r,o=null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase(),i=-1;9!==(null===(r=t.parentNode)||void 0===r?void 0:r.nodeType)&&(i=this.getDomIndex(t));var n=t.getAttribute("id");return n&&/^[A-Za-z][-A-Za-z0-9_:.]*$/.test(n)?"#".concat(n):o+(i>-1?":nth-of-type(".concat(i+1,")"):"")},o.prototype.getDomIndex=function(t){var e,r;if(t.parentNode)for(var o=0,i=null===(e=t.tagName)||void 0===e?void 0:e.toLowerCase(),n=t.parentNode.children,a=0;a<n.length;a++){var s=n[a];if((null===(r=s.tagName)||void 0===r?void 0:r.toLowerCase())===i){if(s===t)return o;o++}}return-1},o}(f),ke=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="StayTrackPlugin",o.isReady=!1,o.timer=null,o.previousTime=L(),o.previousOffsetTop=0,o}return r(o,e),o.prototype.init=function(e){var r=this,o=this.options,i=o.autoTrackConfig,n=o.stayAutoTrackConfig;if(!0===i.stayAutoTrack)if(this.isReady)this.context.log("StayTrack plugin:插件已经运行,无需重复执行",t.ConsoleTypes.WARN);else{this.isReady=!0;var a=n.isCollectUrl;k(a)||(a=function(){return!0}),this.timer&&(clearTimeout(this.timer),this.timer=null),this.previousTime=L(),window.addEventListener("load",(function(){r.previousOffsetTop=ot()})),window.addEventListener("scroll",(function(){a()&&(r.timer||(r.timer=setTimeout((function(){r.run(e),clearTimeout(r.timer),r.timer=null}),1e3)))})),window.addEventListener("unload",(function(){a()&&r.run(e,!0)}))}},o.prototype.transform=function(t){return this.context.getReportData("track","H_WebStay",t)},o.prototype.run=function(t,e){void 0===e&&(e=!1);var r=this.options.autoTrackConfig,o=r.stayDelayTime,i=r.maxStayPageDuration,n=ot(),a=L(),s=a-this.previousTime;(e||s>o&&n!==this.previousOffsetTop)&&t({H_viewport_position:this.previousOffsetTop,event_duration:Math.min(s/1e3,i)});this.previousTime=a,this.previousOffsetTop=n},o}(f),Se=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="PageLeave",o.isReady=!1,o.pageId=M(),o.storageName="hinasdk_pageleave_",o.heartbeatIntervalTime=5e3,o.maxDuration=432e3,o.heartbeatIntervalTimer=null,o.startTime=L(),o.url=window.location.href,o.pageShowStatus=!0,o}return r(o,e),o.prototype.init=function(){if(this.options.autoTrackConfig.pageLeaveAutoTrack)if(this.context.store.localStorage)if(this.isReady)this.context.log("PageLeave plugin:插件已经运行,无需重复执行",t.ConsoleTypes.WARN);else{this.isReady=!0;var e=this.normalizePageLeaveAutoTrack(),r=e.heartbeat_interval_time,o=e.max_duration;r&&r>0&&(this.heartbeatIntervalTime=1e3*r),o&&o>0&&(this.maxDuration=Number(o)),this.startTime=L(),this.addPageLeaveEventListener(),document.hidden?this.pageShowStatus=!1:this.startHeartBeatInterval()}else this.context.log("PageLeave plugin需要使用localstorage存储数据,但是您的浏览器不支持localstorage,所以不能使用该功能",t.ConsoleTypes.WARN)},o.prototype.transform=function(){},o.prototype.normalizePageLeaveAutoTrack=function(){var t=this.options.autoTrackConfig.pageLeaveAutoTrack;return w(t)?t:{}},o.prototype.addPageLeaveEventListener=function(){this.addPageStartListener(),this.addPageSwitchListener(),this.addSinglePageListener(),this.addPageEndListener()},o.prototype.addPageStartListener=function(){var t=this;"onpageshow"in window&&window.addEventListener("pageshow",(function(){t.pageStartHandler()}))},o.prototype.addPageSwitchListener=function(){var t=this;new nt({visible:function(){t.pageStartHandler(),t.startHeartBeatInterval()},hidden:function(){t.url=window.location.href,t.pageEndHandler(),t.stopHeartBeatInterval()}})},o.prototype.addSinglePageListener=function(){var t=this;_t.on("urlChange",(function(e){var r=e.fromHref;r!==e.toHref&&(t.url=r,t.pageEndHandler(),t.stopHeartBeatInterval(),t.pageStartHandler(),t.startHeartBeatInterval())}))},o.prototype.addPageEndListener=function(){var t=this,e=["pagehide","beforeunload","unload"];e.forEach((function(r){"on".concat(e)in window&&window.addEventListener(r,(function(){t.pageEndHandler(),t.stopHeartBeatInterval()}))}))},o.prototype.pageStartHandler=function(){this.startTime=L(),this.pageShowStatus=!document.hidden,this.url=window.location.href},o.prototype.pageEndHandler=function(){if(this.pageShowStatus){if(this.pageShowStatus=!1,this.isCollectUrl()){var t=this.getPageLeaveProperties(),e=this.context.getReportData("track","H_WebPageLeave",t);this.context.report(e)}this.delHeartBeatData()}},o.prototype.startHeartBeatInterval=function(){var t=this;this.heartbeatIntervalTimer&&this.stopHeartBeatInterval(),this.isCollectUrl()&&(this.heartbeatIntervalTimer=setInterval((function(){t.saveHeartBeatData()}),this.heartbeatIntervalTime),this.saveHeartBeatData("first_heartbeat")),this.reissueHeartBeatData()},o.prototype.reissueHeartBeatData=function(){for(var t=this.context.store.localStorage,e=t.length(),r=0;r<e;r++){var o=t.key(r);if(o&&o!==this.storageName+this.pageId&&o.includes(this.storageName)){var i=C(t.get(o));w(i)&&L()-i.time>i.heartbeat_interval_time+5e3&&(delete i.heartbeat_interval_time,this.context.report(i)),this.delHeartBeatData(o)}}},o.prototype.stopHeartBeatInterval=function(){this.heartbeatIntervalTimer&&(clearInterval(this.heartbeatIntervalTimer),this.heartbeatIntervalTimer=null)},o.prototype.delHeartBeatData=function(t){this.context.store.localStorage.remove(t||this.storageName+this.pageId)},o.prototype.isCollectUrl=function(){var t=this.normalizePageLeaveAutoTrack().isCollectUrl;return!k(t)||t(this.url)},o.prototype.saveHeartBeatData=function(t){var e=this.getPageLeaveProperties();e.H_time=L(),"first_heartbeat"===t&&(e.event_duration=3);var r=this.context.getReportData("track","H_WebPageLeave",e);r.heartbeat_interval_time=this.heartbeatIntervalTime,this.context.store.localStorage.set(this.storageName+this.pageId,JSON.stringify(r))},o.prototype.getPageLeaveProperties=function(){var t=(L()-this.startTime)/1e3;t=t<=0||t>this.maxDuration?0:D(t,3);var e=O(this.url),r=e.pathname,o=e.hash,i={H_url:this.url,H_url_path:r,H_url_hash:o};t&&(i.event_duration=t);var n=this.normalizePageLeaveAutoTrack().custom_props;return w(n)&&(i=u(u({},i),n||{})),i},o}(f),He=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="SiteLinker",o.isReady=!1,o.linker=[],o}return r(o,e),o.prototype.init=function(){if(this.options.siteLinkerConfig){var e=this.getLinkerConfig().linker;T(e)&&e.length>0?this.isReady?this.context.log("SiteLinker plugin:插件已经运行,无需重复执行",t.ConsoleTypes.WARN):(this.isReady=!0,this.resolveOption(),this.setRefferId(),this.addClickListen()):this.context.log("siteLinker plugin: 请配置正确的linker参数",t.ConsoleTypes.WARN)}},o.prototype.transform=function(){},o.prototype.getLinkerConfig=function(){var t=this.options.siteLinkerConfig||{},e=t.linker;return{linker:(void 0===e?[]:e)||[],re_login:t.re_login}},o.prototype.resolveOption=function(){for(var e=this.getLinkerConfig().linker,r=e.length,o=[],i=0;i<r;i++){var n=e[i],a=n.part_url,s=n.after_hash;/[A-Za-z0-9]+\./.test(a)&&R(s)?o.push({part_url:a,after_hash:s}):this.context.log("The configuration of linker ".concat(i+1," is not supported.Please check format"),t.ConsoleTypes.WARN)}this.linker=o},o.prototype.setRefferId=function(){var t=this.getLinkerConfig().re_login,e=this.getUrlId(),r=e.startsWith("a");if(""!==(e=e.substring(1))){var o=this.context.store.getAnonymousId(),i=this.context.store.getAccountId();if(r){if(e!==o&&(this.context.store.state.anonymousId=e,this.context.store.save()),i){var n=this.context.getReportData("track_signup","H_SignUp",{});this.context.report(n)}}else(!i||t&&i!==e)&&this.context.setUserUId(e)}},o.prototype.getUrlId=function(){var t=window.location.href.match(/_hnsdk=([au][^\?\#\&\=]+)/);return T(t)&&t[1]?function(t){var e=t;try{e=decodeURIComponent(t)}catch(t){}return e}(t[1]):""},o.prototype.getPartUrl=function(t){for(var e=this.linker.length,r=0;r<e;r++)if(t.includes(this.linker[r].part_url))return!0;return!1},o.prototype.getPartHash=function(t){for(var e=this.linker.length,r=0;r<e;r++)if(t.includes(this.linker[r].part_url))return this.linker[r].after_hash;return!1},o.prototype.getCurrentId=function(){var t=this.context.store.getAccountId(),e=this.context.store.getAnonymousId();return function(t){var e=t;try{e=encodeURIComponent(t)}catch(t){}return e}(t?"u".concat(t):"a".concat(e))},o.prototype.rewriteUrl=function(t,e){var r=/([^?#]+)(\?[^#]*)?(#.*)?/.exec(t),o="";if(r){var i=r[1]||"",n=r[2]||"",a=r[3]||"",s="_hnsdk=".concat(this.getCurrentId()),c=function(t){var e=t.split("&"),r=[];return e.forEach((function(t){t.includes("_hnsdk")?r.push(s):r.push(t)})),r.join("&")};if(this.getPartHash(t)){var u=a.includes("?"),l=a.indexOf("_hnsdk");o=u?l>=0?"".concat(i).concat(n,"#").concat(a.substring(1,l)).concat(c(a.substring(l,a.length))):"".concat(i).concat(n,"#").concat(a.substring(1),"&").concat(s):"".concat(i).concat(n,"#").concat(a.substring(1),"?").concat(s)}else{o=(u=/^\?(\w)+/.test(n))?n.includes("_hnsdk")?"".concat(i,"?").concat(c(n.substring(1))).concat(a):"".concat(i).concat(n,"&").concat(s).concat(a):"".concat(i,"?").concat(s).concat(a)}return e&&(e.href=o),o}},o.prototype.addClickListen=function(){var t=this,e=function(e){var r,o,i=e.target;if(i){var n=null===(r=i.tagName)||void 0===r?void 0:r.toLowerCase(),a=i.parentNode,s=null===(o=null==a?void 0:a.tagName)||void 0===o?void 0:o.toLowerCase();if("a"===n&&i.href||"a"===s&&a.href){var c=void 0,u=void 0;"a"===n&&i.href?(c=i.href,u=i):(c=a.href,u=a);var l=O(c).protocol;"http:"!==l&&"https:"!==l||t.getPartUrl(c)&&t.rewriteUrl(c,u)}}};"PointerEvent"in window?document.addEventListener("pointerdown",e):document.addEventListener("mousedown",e)},o}(f),Re=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="HistoryPlugin",o.isReady=!1,o.lastHref=window.location.href,o.lastPath=window.location.pathname,o}return r(o,e),o.prototype.init=function(){if(window&&window.history.pushState&&window.history.replaceState)if(this.isReady)this.context.log("History plugin:插件已经运行,无需重复执行",t.ConsoleTypes.WARN);else{this.isReady=!0;var e=this,r=window.onpopstate,o=function(t,r){var o={fromPath:e.lastPath,fromHref:e.lastHref,toPath:t,toHref:r};e.lastPath=t,e.lastHref=r,_t.emit("urlChange",u(u({},o),{mode:"history"}))};window.onpopstate=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=window.location.pathname,n=window.location.href;o(i,n),r&&r.apply(this,t)},J(window.history,"pushState",i),J(window.history,"replaceState",i)}function i(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];t.apply(this,e);var i=window.location.pathname,n=window.location.href;o(i,n)}}},o.prototype.transform=function(){},o}(f),Ee=function(e){function o(t,r){var o=e.call(this,t,r)||this;return o.options=t,o.context=r,o.name="HashPlugin",o.isReady=!1,o.lastHref=window.location.href,o.lastPath=window.location.hash,o}return r(o,e),o.prototype.init=function(){var e=this;this.isReady?this.context.log("Hash plugin:插件已经运行,无需重复执行",t.ConsoleTypes.WARN):(this.isReady=!0,window.addEventListener("hashchange",(function(t){var r=t.newURL,o=O(r).hash,i={fromPath:e.lastPath,fromHref:e.lastHref,toPath:o,toHref:r};e.lastHref=r,e.lastPath=o,_t.emit("urlChange",u(u({},i),{mode:"hash"}))})))},o.prototype.transform=function(){},o}(f),xe="4.0.0",Ce=function(e){function o(t,r){var o,i,n=e.call(this,t,r)||this;return n.options=t,n.context=r,n.name="HinaABTest",n.isReady=!1,n.platform=(i=null===(o=et.getUA())||void 0===o?void 0:o.toLowerCase(),/android|webos|iphone|ipod|blackberry/i.test(i)?"H5":"Web"),n.projectKey="",n.storageName="hina_webjs_sdk_abtest",n}return r(o,e),o.prototype.init=function(){var e=this;if(this.context.store.localStorage){var r=this.options.abTestingPluginConfig,o=null==r?void 0:r.url;if(S(o)){var i=z(o,"project-key");if(i){this.projectKey=i;var n=O(o).protocol,a=O(window.location.href).protocol;if(n&&n!==a)this.context.log("A/B Testing 初始化失败,".concat(a," 页面必须使用 ").concat(a," 的 URL"),t.ConsoleTypes.WARN);else if(this.isReady)this.context.log("A/B Testing 插件已经运行,无需重复执行",t.ConsoleTypes.WARN);else{var s=this.context.getUserUid();this.context.log("当前accountId为:".concat(s),t.ConsoleTypes.INFO),_t.on("changeAccountId",(function(){e.context.store.localStorage.set(e.storageName,"")})),this.isReady=!0}}else this.context.log("A/B Testing 初始化失败,请使用正确的 URL(必须包含 project-key)")}else this.context.log("A/B Testing 初始化失败,请使用正确的 URL!",t.ConsoleTypes.WARN)}else this.context.log("A/B Testing 初始化失败,浏览器不支持localStorage",t.ConsoleTypes.WARN)},o.prototype.transform=function(){},o.prototype.valueMatchType=function(e,r){switch(r){case t.VariablesTypes.INTEGER:return H(e);case t.VariablesTypes.STRING:return S(e);case t.VariablesTypes.BOOLEAN:return R(e);default:return!1}},o.prototype.normalizeParams=function(e,r,o){var i,n;void 0===o&&(o=be);var a={verify_success:!0,para:r};try{for(var s=l(o),c=s.next();!c.done;c=s.next()){var u=c.value;if(!a.verify_success)break;var p=r.customIds||{},d={};switch(u){case"abtestExperimentId":S(r.abtestExperimentId)&&r.abtestExperimentId.trim()||(this.context.log("".concat(e,"方法调用失败,").concat(u,"参数未正确配置!").concat(u,": ").concat(r.abtestExperimentId),t.ConsoleTypes.WARN),a.verify_success=!1);break;case"paramName":S(r.paramName)&&r.paramName.trim()||(this.context.log("".concat(e,"方法调用失败,").concat(u,"参数未正确配置!").concat(u,": ").concat(r.paramName),t.ConsoleTypes.WARN),a.verify_success=!1);break;case"valueType":[t.VariablesTypes.BOOLEAN,t.VariablesTypes.INTEGER,t.VariablesTypes.STRING].includes(r.valueType)||(this.context.log("".concat(e,"方法调用失败,").concat(u,"参数未正确配置!").concat(u,": ").concat(r.valueType),t.ConsoleTypes.WARN),a.verify_success=!1);break;case"defaultValue":this.valueMatchType(r.defaultValue,r.valueType)||(this.context.log("".concat(e,"方法调用失败,").concat(u,"类型必须与valueType一致!"),t.ConsoleTypes.WARN),a.verify_success=!1);break;case"callback":k(r.callback)||(this.context.log("".concat(e,"方法调用失败,").concat(u,"参数未正确配置")),r.callback=x,a.verify_success=!1);break;case"timeoutMilliseconds":(!H(r.timeoutMilliseconds)||r.timeoutMilliseconds<=0)&&(this.context.log("".concat(u,"参数错误:").concat(r.timeoutMilliseconds),t.ConsoleTypes.WARN),r.timeoutMilliseconds=3e3),r.timeoutMilliseconds<200&&(r.timeoutMilliseconds=200);break;case"customProperties":r.customProperties=w(r.customProperties)?r.customProperties:{};break;case"customIds":for(var f in p)(S(p[f])||H(p[f]))&&(d[f]=p[f]);r.customIds=d}}}catch(t){i={error:t}}finally{try{c&&!c.done&&(n=s.return)&&n.call(s)}finally{if(i)throw i.error}}return a},o.prototype.sendTriggerEvent=function(t){var e=t.abtest_experiment_group_id,r=t.abtest_experiment_id;this.context.track("H_ABTestTrigger",{H_abtest_experiment_id:r,H_abtest_experiment_group_id:e})},o.prototype.getExpResult=function(t,e){var r,o;void 0===e&&(e=[]);var i,n=t.abtestExperimentId,a=t.paramName,s=t.valueType;if(0===e.length){var c=this.getStorageData();w(c)&&(e=c.result||[])}try{for(var u=l(e),p=u.next();!p.done;p=u.next()){var d=p.value,f=d.abtest_experiment_id,h=d.abtest_experiment_group_id,g=d.is_white_list,v=d.variables;if(f===n){var m=v.find((function(t){return t.name===a&&t.type===s}));if(m){g||this.sendTriggerEvent({abtest_experiment_id:f,abtest_experiment_group_id:h}),i=m.value;break}}}}catch(t){r={error:t}}finally{try{p&&!p.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return i},o.prototype.getStorageData=function(){var t=this.context.store.localStorage.get(this.storageName);return b(t)?C(t):null},o.prototype.saveResponseData=function(t){var e=this.getStorageData(),r={updateTime:L()};if(e&&w(e)){var o=[],i=e.result||[];t.forEach((function(t){var e=t.abtest_experiment_group_id,r=t.abtest_experiment_id,n=t.variables,a=i.find((function(t){return t.abtest_experiment_id===r&&t.abtest_experiment_group_id===e}));if(a){var s=[];n.forEach((function(t){var e=t.name,r=t.type,o=a.variables.findIndex((function(t){return t.name===e&&t.type===r}));o>=0?a.variables[o]=t:s.push(t)})),a.variables=d(d([],p(a.variables),!1),p(s),!1)}else o.push(t)})),r.result=d(d([],p(i),!1),p(o),!1)}else r.result=t;this.context.store.localStorage.set(this.storageName,JSON.stringify(r))},o.prototype.createRequestData=function(t){var e=t.paramName,r=t.customProperties,o=t.customIds,i={anonymous_id:this.context.store.getAnonymousId(),platform:this.platform,abtest_lib_version:xe,param_name:e,properties:this.context.getPresetProperties()};return w(r)&&!P(r)&&(i.custom_properties=r),w(o)&&!P(o)&&(i.custom_ids=o),this.context.getUserUid()&&(i.login_id=this.context.getUserUid()),i},o.prototype.getResultFromServer=function(t){var e=this;return new Promise((function(r,o){var i=e.createRequestData(t);new vt({url:e.options.abTestingPluginConfig.url,data:JSON.stringify(i),contentType:"application/json",customHeaders:{"project-key":e.projectKey},timeout:t.timeoutMilliseconds}).run().then((function(t){var i=t.data;"SUCCESS"===(null==i?void 0:i.status)?(e.saveResponseData(i.results),r(i)):o()}))}))},o.prototype.asyncFetch=function(t){var e=this;return new Promise((function(r){e.getResultFromServer(t).then((function(t){r(t)})).catch((function(){t.callback(t.defaultValue)}))}))},o.prototype.preFetch=function(e,r){return this.isReady?!!w(r)||(this.context.log("".concat(e," 方法参数必须是对象"),t.ConsoleTypes.WARN),!1):(this.context.log("A/B Testing 插件尚未运行,请先执行该插件",t.ConsoleTypes.WARN),!1)},o.prototype.asyncFetchABTest=function(t){var e=this;if(this.preFetch("asyncFetchABTest",t)){var r=this.normalizeParams("asyncFetchABTest",t),o=r.verify_success,i=r.para;o?this.asyncFetch(i).then((function(t){var r=e.getExpResult(i,t.results);i.callback(r||i.defaultValue)})):i.callback(i.defaultValue)}},o.prototype.fetchCacheABTest=function(t){if(this.preFetch("fetchCacheABTest",t)){var e=this.normalizeParams("fetchCacheABTest",t),r=e.verify_success,o=e.para;if(r){var i=this.getExpResult(o);o.callback(i||o.defaultValue)}else o.callback(o.defaultValue)}},o.prototype.fastFetchABTest=function(t){var e=this;if(this.preFetch("fastFetchABTest",t)){var r=this.normalizeParams("fastFetchABTest",t),o=r.verify_success,i=r.para;if(o){var n=this.getExpResult(i);b(n)?i.callback(n):this.asyncFetch(i).then((function(){var t=e.getExpResult(i);i.callback(t||i.defaultValue)}))}else i.callback(i.defaultValue)}},o}(f),Ae=function(e){function o(t,r){void 0===r&&(r=!0);var o=e.call(this,t,r)||this;return o.consolePrefix="埋点SDK",o.trackTags=we,o.presetProps={},o.useInstancing&&o.init(t),o}return r(o,e),o.prototype.init=function(e){if(this.isReady)this.log("hinaSDK has been initialized",t.ConsoleTypes.ERROR);else{var r={name:"",serverUrl:"",showLog:!1,autoTrackConfig:{clickAutoTrack:!0,stayAutoTrack:!0,isCollectUrl:function(){return!0},isCollectElement:function(){return!0},isCollectInput:function(){return!1},addCustomProperty:function(){},stayDelayTime:4e3,maxStayPageDuration:18e3,collectTags:{div:!1},trackAttr:["hn-click"],pageviewAutoTrack:!1,pageLeaveAutoTrack:!1},stayAutoTrackConfig:{isCollectUrl:function(){return!0}},maxStringLength:1024,imgUseCrossOrigin:!1,isSinglePage:!1,batchSend:!1,appJsBridge:!1,sendType:t.ReportTypes.BEACON,customHeaders:{},credentials:!1,dataSendTimeout:3e3,presetProperties:{latest_utm:!0,latest_traffic_source_type:!0,latest_search_keyword:!0,latest_referrer:!0,url:!0,title:!0},sourceChannel:[],plugins:[]},o=e.performanceErrorConfig,i=function(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(r[o[i]]=t[o[i]])}return r}(e,["performanceErrorConfig"]);this.options=I(r,i),this.options=u(u({},this.options),{performanceErrorConfig:o}),this.initState(),this.normalizeConfig(),this.initAdvProps(),this.initPlugins(),this.isReady=!0}},o.prototype.initState=function(){this.store=new bt(this.options),this.store.init()},o.prototype.normalizeConfig=function(){var e=this,r=this.options,o=r.serverUrl,i=r.sendType,n=r.batchSend,a=r.maxStringLength,s=r.isSinglePage,c=r.autoTrackConfig,l=void 0===c?{}:c,p=l.trackAttr,d=void 0===p?[]:p,f=l.collectTags,h=l.pageLeaveAutoTrack,g=l.pageviewAutoTrack;if(""===(o=(o=o||"").trim()))this.log("当前 serverUrl 为空,network 中不会发数据,请配置正确的 serverUrl!",t.ConsoleTypes.WARN);else{var v=O(window.location.href).protocol||"";(O(o).protocol||"")!==v&&this.log("SDK 检测到您的数据发送地址和当前页面地址的协议不一致,建议您修改成一致的协议。因为:https 下面发送 http 的图片请求会失败。",t.ConsoleTypes.WARN)}[t.ReportTypes.IMAGE,t.ReportTypes.AJAX,t.ReportTypes.BEACON].includes(i)||this.setConfig({sendType:t.ReportTypes.AJAX});var m=a;if(!H(a)||a<0?m=1024:a>5120&&(m=5120),this.options.maxStringLength=m,(!0===h||w(h)&&P(h))&&(this.options.autoTrackConfig.pageLeaveAutoTrack={heartbeat_interval_time:5e3,max_duration:432e3}),T(d)?(d=d.filter((function(t){return S(t)})),d.includes("hn-click")||d.push("hn-click")):d=["hn-click"],this.options.autoTrackConfig.trackAttr=d,w(f))if(!0===f.div)this.options.autoTrackConfig.collectTags.div={ignoreTags:_e,maxLevel:1};else if(w(f.div)){var y=1,_=f.div;H(_.maxLevel)&&[1,2,3].includes(_.maxLevel)&&(y=_.maxLevel),this.options.autoTrackConfig.collectTags.div={ignoreTags:_e,maxLevel:y}}else this.options.autoTrackConfig.collectTags.div=!1;else this.options.autoTrackConfig.collectTags={div:!1};this.updateTrackTags(),(!0===n||w(n)&&!P(n))&&(this.options.batchSend=u({dataSendTimeout:6e3,sendInterval:6e3,storageLimit:200},n),this.batchSender=new Tt(this.options,t.PlatformTypes.WEB,"hinasdk_tab","hinasdk_data_")),"auto"===g?this.autoTrack():("singlePage"===g||s)&&(this.autoTrack(),_t.on("urlChange",(function(t){var r=t.fromHref;if(r!==t.toHref){if(k(s)){var o=s();w(o)&&(t=u(u({},t),o))}e.autoTrack(u(u({},t),{H_referrer:r}))}})))},o.prototype.updateTrackTags=function(){var t=this.options.autoTrackConfig.collectTags,e=d([],p(we),!1);Object.keys(t||{}).forEach((function(r){var o=t[r];!0!==o&&!w(o)||e.includes(r)||e.push(r)})),this.trackTags=e},o.prototype.initAdvProps=function(){var t={},e=this.options,r=e.presetProperties,o=e.sourceChannel;Object.keys(r||{}).forEach((function(e){var o,i=r[e];if(e.includes("latest_")&&(e=e.slice(7),i)){var n=q();if("utm"!==e&&"url解析失败"===n)t["H_latest_".concat(e)]="url的domain解析失败";else if(""===(o=o||document.referrer)||U(j(o))!==U())switch(e){case"traffic_source_type":t.H_latest_traffic_source_type=pt.getSourceFromReferrer();break;case"search_keyword":var a=pt.getKeywordFromReferrer();a&&(t.H_latest_search_keyword=a);break;case"referrer":t.H_latest_referrer=B()}}}));var i=this.store.state.props||{},n={};r.latest_utm&&(n=dt("H_latest_"));var a={};i.H_utm_source||(a=dt("H_"));var s={},c={};if(T(o)&&o.length>0){var l=o.filter((function(t){return!h.includes(t)}));l.length>0&&(i["H_".concat(l[0])]||(c=ft("H_",l)),s=ft("H_latest_",l))}this.store.state.props=u(u(u(u(u(u({},this.store.state.props),t),n),s),c),a),this.store.setProps(this.store.state.props)},o.prototype.initPlugins=function(){var t=this,e=this.options,r=e.serverUrl,o=e.name,i=e.showLog,n=e.sendType,a=e.customHeaders,s=e.credentials,c=e.dataSendTimeout,l=e.batchSend,p=e.imgUseCrossOrigin,d=e.globalCallback,f=e.plugins,h=void 0===f?[]:f,g=e.performanceErrorConfig,v=e.autoTrackConfig,m=e.siteLinkerConfig,y=e.abTestingPluginConfig;h=h||[];var _=v.pageLeaveAutoTrack,b=new Te(this.options,this),k=new ke(this.options,this),S=new Re(this.options,this),H=new Ee(this.options,this);if(this.plugins=[b,k,S,H],w(_)&&!P(_)){var R=new Se(this.options,this);this.plugins.push(R)}var E=(m||{}).linker;if(T(E)&&E.length>0){var x=new He(this.options,this);this.plugins.push(x)}if(w(y)&&!P(y)){var C=new Ce(this.options,this);this.plugins.push(C)}if(h.forEach((function(e){var r=new e(t.options,t);t.plugins.push(r)})),w(g)&&!P(g)){var A=u({serverUrl:r,name:o,showLog:i,sendType:n,customHeaders:a,credentials:s,dataSendTimeout:c,batchSend:l,imgUseCrossOrigin:p,globalCallback:d},g);this.epmInstance=new ye(A,!0)}this.runPlugins(this.plugins)},o.prototype.use=function(e,r){var o=this,i=this.options,n=i.autoTrackConfig,a=i.siteLinkerConfig,s=i.abTestingPluginConfig,c=n.pageLeaveAutoTrack,u=function(t){var e=new t(o.options,o);o.plugins.push(e),e.init()};if(this.isReady){if(w(r))return"PageLeave"===e?w(c)&&!P(c)?this.log("PageLeave插件已运行,无需重复执行",t.ConsoleTypes.WARN):(this.options.autoTrackConfig.pageLeaveAutoTrack=r,u(Se)):"SiteLinker"===e?w(a)&&!P(a)?this.log("SiteLinker插件已插件已运行,无需重复执行",t.ConsoleTypes.WARN):(this.options.siteLinkerConfig=r,u(He)):"HinaABTest"===e&&(w(s)&&!P(s)?this.log("HinaABTest插件已运行,无需重复执行",t.ConsoleTypes.WARN):(this.options.abTestingPluginConfig=r,u(Ce))),this.getPluginInstance(e);this.log("".concat(e,"插件配置项必须是一个对象类型"),t.ConsoleTypes.WARN)}else this.log("请先初始化埋点SDK",t.ConsoleTypes.WARN)},o.prototype.getPluginInstance=function(t){return this.plugins.find((function(e){return e.name===t}))},o.prototype.setConfig=function(t){this.options=I(this.options,t),this.normalizeConfig()},o.prototype.getConfig=function(t){return t?this.options[t]:this.options},o.prototype.setUserUId=function(e,r){if(H(e=null!=e?e:"")||S(e))if(e=String(e).trim(),this.store.getAccountId()!==e){this.store.setAccountId(e);var o=this.getReportData("track_signup","H_SignUp",{});this.report(o,r),_t.emit("changeAccountId")}else this.log("setUserUId: uid is equal to account_id, , failed to execute setUserUId",t.ConsoleTypes.WARN);else this.log("setUserUId: uid must be string or number",t.ConsoleTypes.WARN)},o.prototype.getUserUid=function(){return this.store.state.accountId},o.prototype.setDeviceUId=function(t){this.store.setDeviceId(t)},o.prototype.getDeviceUId=function(){return this.store.getDeviceId()},o.prototype.userSet=function(t,e){if(w(t)&&!P(t)){var r=this.getReportData("user_set","",t);this.report(r,e)}},o.prototype.userSetOnce=function(t,e){if(w(t)&&!P(t)){var r=this.getReportData("user_setOnce","",t);this.report(r,e)}},o.prototype.userAdd=function(e,r){var o,i=this;S(e)&&((o={})[e]=1,e=o);if(w(e)&&!P(e)&&function(e){for(var r in e)if(!/-*\d+/.test(String(e[r])))return i.log("userAdd属性的值只能是数字",t.ConsoleTypes.WARN),!1;return!0}(e)){var n=this.getReportData("user_add","",e);this.report(n,r)}},o.prototype.userAppend=function(t,e){var r={};if(w(t)&&(Object.keys(t).forEach((function(e){var o=t[e];T(o)?r[e]=o:r[e]=[o]})),!P(r))){var o=this.getReportData("user_append","",r);this.report(o,e)}},o.prototype.userUnset=function(e,r){var o=this,i={};if(S(e)&&(e=[e]),T(e)){if(e.forEach((function(e){S(e)?i[e]=!0:o.log("userUnset参数数组里面的值必须时string,已经过滤掉".concat(e),t.ConsoleTypes.WARN)})),!P(i)){var n=this.getReportData("user_unset","",i);this.report(n,r)}}else this.log("userUnset参数必须是数组或字符串",t.ConsoleTypes.WARN)},o.prototype.userDelete=function(t){var e=this.getReportData("user_delete","",{});this.report(e,t),this.store.setAccountId("")},o.prototype.registerCommonProperties=function(t){this.presetProps=I(this.presetProps,t)},o.prototype.getPresetProperties=function(){return{H_is_first_day:this.store.isFirstDay,H_is_first_time:this.store.isFirstTime,device_id:this.store.getDeviceId(),anonymous_id:this.store.getAnonymousId(),account_id:this.store.getAccountId(),properties:u(u(u({},this.presetProps),ut()),rt(xe))}},o.prototype.clearPageRegister=function(t){var e=this;void 0===t&&(t=!0),!0===t?this.presetProps={}:T(t)&&t.forEach((function(t){t in e.presetProps&&delete e.presetProps[t]}))},o.prototype.checkReportProperties=function(t){var e=this,r=this.options.maxStringLength;Object.keys(t).forEach((function(o){var i=t[o];if(S(i)&&i.length>r)e.log("属性 ".concat(o," 已经做截取")),t[o]=i.slice(0,r);else if(w(i))e.checkReportProperties(i);else if(k(i))try{t[o]=i(t),k(t[o])?(e.log("属性--".concat(o," 格式不满足要求, 已被删除")),delete t[o]):w(t[o])?e.checkReportProperties(t[o]):S(t[o])&&t[o].length>r&&(t[o]=t[o].slice(0,r))}catch(r){e.log("属性--".concat(o," 格式不满足要求, 已被删除")),delete t[o]}}))},o.prototype.track=function(e,r,o){if(o=o||function(){},S(e)){r=w(r)?r:{};var i=this.getReportData("track",e,r);this.report(i,o)}else this.log("track事件名必须是字符串,属性必须是是一个对象",t.ConsoleTypes.WARN)},o.prototype.quick=function(t,e,r){var o={};r=k(r)?r:x,w(e)?o=e:k(e)&&(r=e),this.autoTrack(o,r)},o.prototype.autoTrack=function(t,e){void 0===t&&(t={}),void 0===e&&(e=x);var r=this.getReportData("track","H_pageview",t);if(this.report(r,e),this.store.isSetFirstVisit){this.store.isSetFirstVisit=!1;var o=B();this.userSetOnce({H_first_referrer:o,H_first_referrer_host:o?j(o,"取值异常"):"",H_first_traffic_source_type:pt.getSourceFromReferrer(),H_first_search_keyword:pt.getKeywordFromReferrer(),H_first_visit_time:L(),H_first_browser_language:S(navigator.language)?navigator.language.toLowerCase():"取值异常"})}},o.prototype.report=function(e,r,o){var i,n,a=this.options,s=a.appJsBridge,c=a.serverUrl;if(this.log(e),s){var u=!0,l=null===window||void 0===window?void 0:window.Hina_Cloud_H5_Bridge;if(w(l)&&l.track)u=!1,l.track(e.event,e.type,JSON.stringify(e));else{var p=null===(n=null===(i=null===window||void 0===window?void 0:window.webkit)||void 0===i?void 0:i.messageHandlers)||void 0===n?void 0:n.hinaNativeTracker;if(null==p?void 0:p.postMessage){u=!1;var d=JSON.stringify({eventName:e.event,eventType:e.type,properties:e});p.postMessage(d)}}if(u)return void this.log("JSBridge 发送数据失败",t.ConsoleTypes.WARN);k(r)&&r(c,e)}else this.sendReportData(e,r,o)},o.prototype.getReportData=function(t,e,r){var o=this.store.getAnonymousId(),i=this.store.getAccountId(),n=L(),a=this.getReportProperties(t,e),s=u(u({},a),r||{});this.checkReportProperties(s);var c={anonymous_id:o,type:t,event:e,time:n,_track_id:M(),properties:s};return i&&(c.account_id=i),c.send_time=L(),c},o.prototype.getReportProperties=function(t,e){void 0===t&&(t=""),void 0===e&&(e="");var r=I(this.presetProps),o=u(u({device_id:this.store.getDeviceId()},this.store.state.props),r);return t&&"user"===t.slice(0,4)||(o=u(u(u({},o),ut()),rt(xe))),"track"===t&&(o.H_is_first_day=this.store.isFirstDay,this.store.isFirstDay=!1,"H_pageview"===e&&(o.H_is_first_time=this.store.isFirstTime,this.store.isFirstTime=!1)),o},o}(St);var Pe=function(t){return new Ae(t,!1)}({});return t.HinaTrack=Ae,t.PluginBase=f,t.default=Pe,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|