visual-buried-point-platform-uni 2.0.4-alpha.9 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _interopDefault(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var MD5=_interopDefault(require("md5")),name="visual-buried-point-platform-uni",version="2.0.4-alpha.9",lsi="8fbabc22c6ecb742a261e79f879e08ce#2.0.4-alpha.8",description="To make it easy for you to get started with GitLab, here's a list of recommended next steps.",main="dist/cjs/buried-point-uni.js",module$1="dist/esm/buried-point-uni.js",scripts={build:"rimraf dist && rollup -c --environment INCLUDE_DEPS,BUILD:production && node lsi-md5.cjs"},type="module",files=["dist"],repository={type:"git",url:""},keywords=[],author="",license="MIT",peerDependencies={"crypto-js":"4.2.0",md5:"2.3.0"},devDependencies={"@babel/core":"^7.26.10","@babel/preset-env":"^7.26.9","@rollup/plugin-json":"^6.0.1","babel-loader":"^10.0.0","babel-preset-es2015":"^6.24.1",rimraf:"^6.0.1",rollup:"^1.20.2","rollup-plugin-babel":"^4.3.3","rollup-plugin-commonjs":"^10.0.2","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-replace":"^2.2.0","rollup-plugin-uglify":"^6.0.2",webpack:"^5.72.1","webpack-cli":"^6.0.1",md5:"2.3.0"},pk={name:name,version:version,lsi:lsi,description:description,main:main,module:module$1,"umd:main":"dist/umd/buried-point-uni.js",scripts:scripts,type:type,files:files,repository:repository,keywords:keywords,author:author,license:license,peerDependencies:peerDependencies,devDependencies:devDependencies};let usrIdKey="v_userId",anonIdKey="v_anonId";function getWxMiniInfo(){var e=wx.getAccountInfoSync().miniProgram;return{name:"",packageName:e?e.appId:"",version:e?e.envVersion+e.version:"",carrier:"mini",ecology:"mini"}}function getWxMiniDeviceInfo(){var e=wx.getSystemInfoSync();let t={lang:e.language,brand:e.brand+" "+e.model,os:getOSNameFormat(e.platform),osVersion:e.system,resolution:e.screenWidth+"x"+e.screenHeight,browser:"",browserVersion:"",color:"",deviceId:"",deviceType:getWxMiniDeviceType(e.system),network:""};return wx.getNetworkType({success(e){t.network=e.networkType}}),t}function getWxMiniDeviceType(t){return["Windows","Linux","macOS"].every(e=>t.includes(e))?1:2}function randomUUID(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function getWxMiniUserId(){return wx.getStorageSync(usrIdKey)?wx.getStorageSync(usrIdKey):""}function getWxMiniAnonyMousId(){let e=wx.getStorageSync(anonIdKey);return e||(e=randomUUID(),wx.setStorageSync(anonIdKey,e)),e}let AUTOTRACKTYPE={ENTER:"enter",LOOP:"loop",LEAVE:"leave"},BPNPVUV="UNIBPNPVUVSrcData",BPNPVUVFail="UNIBPNPVUVFailData",BPNPVUVFailOnce="UBPNPVUVFailOnce",wxMini="wxMini",usrIdKey$1="v_userId",anonIdKey$1="v_anonId",Global={env:"",domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",appData:null,deviceData:null,distinctId:"",anonymousId:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[]},pagesArray=[],visPagesArr=[];function isWXMiniProgram(){try{return"undefined"!=typeof wx&&wx.env&&wx.canIUse}catch(e){return!1}}function initGetTrackId(){var e=Date.now().toString();Global.trackId=e,visPagesArr=[],console.log("tId ",e)}let sdkTrackIdVal=()=>{var e;return Global.trackId||(e=Date.now().toString(),Global.trackId=e,visPagesArr=[],e)};function randomUUID$1(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function timeToStr(e){e=new Date(e);return e.getFullYear()+`-${e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1}-${e.getDate()<10?"0"+e.getDate():e.getDate()} ${e.getHours()<10?"0"+e.getHours():e.getHours()}:${e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes()}:`+(e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds())}function getUniWebH5Info(e){var e=e.ua.toLowerCase(),t=window.location.hostname,n=document.title;/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e);return e.includes("alipay")||e.includes("unionPay")||e.includes("onbuygz")||e.includes("onetravel"),e.includes("micromessenger")&&e.includes("miniprogram"),{name:n||"",packageName:t||"",version:"",carrier:"H5",ecology:"h5"}}function getUniWXInfo(){var e=uni.getAccountInfoSync(),t=uni.getAppBaseInfo();return{name:t.appName||"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}function getUniAppInfo(t){var n=plus.runtime.version,n={name:t.appName,version:n||"",carrier:"unknown",packageName:"",ecology:""};if("android"===t.platform){let e=n.carrier="Android";var r=plus.android.runtimeMainActivity().getPackageName();t.romName.includes("HarmonyOS")&&(e="Harmony OS",n.carrier="Harmony OS"),n.packageName=r||"",n.ecology=e}else"ios"===t.platform?(r=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier(),n.packageName=r||"",n.carrier="iOS",n.ecology="iOS"):"harmonyos"===t.platform?(r=uni.getAppBaseInfo(),n.carrier="Harmony OS",n.ecology="Harmony OS",n.version=r.appVersion,n.packageName=r.packageName):n.ecology="unknown";return n}function getCurDeviceType(e){var t;return"web"===Global.platform?(t=e.ua.toLowerCase(),/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)):"pc"===e.deviceType?1:2}function getOSNameFormat(e){return"macos"===e.toLowerCase()?"macOS":"harmonyos"===e.toLowerCase()?"Harmony OS":"ios"===e.toLowerCase()?"iOS":"android"===e.toLowerCase()?"Android":"windows"===e.toLowerCase()?"Windows":"linux"===e.toLowerCase()?"Linux":"unknown"}function getDeviceInfo(e){return{lang:e.osLanguage||e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os:getOSNameFormat(e.osName),osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:getCurDeviceType(e),network:""}}function getDeviceInfoError(){return{lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}}function getTrackObj(e){var t=getCurrentPages(),n=t[t.length-1],r=Global.platform;let o="",a="",i="",l="";if("web"===r||"h5"===r?(o=window.location.href,a=window.location.hostname,document.referrer&&(r=new URL(document.referrer),i=r||"",l=r.hostname||"")):(o=n.route,i=(1<t.length?t[t.length-2]:n).route,a=Global.domain||n.route),n)return{path:n.route,busSegment:e.busSegment||0===e.busSegment?e.busSegment:"",module:e.module||0===e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title||"",domain:a,url:o,visitPage:t.length,sourceDomain:l,sourceUrl:i,sendMode:e.sendMode}}function uUpdatePageExtraArray(e){var t=getCurrentPages();let n=t[t.length-1];t=pagesArray.findIndex(e=>e.path===n.route),e={path:n.route,properties:e.properties?JSON.stringify(e.properties):"",busSegment:e.busSegment||"",module:e.module||"",title:e.title||""};-1!==t?pagesArray[t]=e:pagesArray.push(e)}function isValidURL(e){return/^(https?:\/\/[^\s$.?#].[^\s]*)$/i.test(e)}function getUtmObj(){if("web"===Global.platform){var e=window.location.href;if(e&&!e.includes("file://")&&isValidURL(e)){var e=window.location.href.split("?")[1];if(e)return{utmSource:(e=new URLSearchParams(e)).get("utmSource")||"",utmCampaign:e.get("utmCampaign")||"",utmTerm:e.get("utmTerm")||"",utmContent:e.get("utmContent")||"",ctk:e.get("ctk")||""}}}return null}function insertPVUVData(e,t){let n=null;var r,o=(n=(Global.platform===wxMini?wx:uni).getStorageSync(BPNPVUV))?JSON.parse(n):[];0<o.length&&-1!==(r=o.findIndex(e=>e.uid===t))?o[r]={...o[r],...e}:o.push(e),(Global.platform===wxMini?wx:uni).setStorageSync(BPNPVUV,JSON.stringify(o))}function getBaseicInfo(){isWXMiniProgram()?(Global.platform=wxMini,Global.appData=getWxMiniInfo(),Global.deviceData=getWxMiniDeviceInfo(),Global.distinctId=getWxMiniUserId(),Global.anonymousId=getWxMiniAnonyMousId()):(uni.getSystemInfo({success:function(e){Global.uAgent=e.ua;var t,n=e.uniPlatform;uni.showToast({title:n+"+"+e.osName,icon:"success"}),n.includes("app")?(Global.platform=e.osName,Global.appData=getUniAppInfo(e),Global.platform="Harmony OS"):n.includes("web")||n.includes("h5")?(Global.platform="web",t=getUniWebH5Info(e),Global.appData={...t,version:Global.version||"unknown"}):n.includes("weixin")?(Global.platform="weixin",Global.appData=getUniWXInfo()):console.log("uni get platform getBaseicInfo error "),Global.deviceData=getDeviceInfo(e)},fail:function(e){Global.deviceData=getDeviceInfoError()},complete:function(){uni.getNetworkType({success(e){Global.deviceData.network=e.networkType}})}}),Global.distinctId=uni.getStorageSync(usrIdKey$1)||"",Global.anonymousId=uni.getStorageSync(anonIdKey$1),Global.anonymousId||(Global.anonymousId=randomUUID$1()),uni.setStorageSync(anonIdKey$1,Global.anonymousId))}let localLsi=pk.lsi;function commonData(e){return{app:Global.appData,data:e,device:Global.deviceData,lsi:localLsi,projectId:Global.token,userAgent:Global.uAgent||"",anonymousId:Global.anonymousId,userId:Global.distinctId}}function reportTrackEventServer(e,t,n){var r;e?(r={...r=commonData(t),dataAbstract:MD5(JSON.stringify(r))},Global.platform===wxMini?wx.request({url:"event"===e?Global.upEventUrl:Global.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:Global.token,projectId:Global.token},data:r,success:function(e){e&&e.data?wx.setStorageSync(n,JSON.stringify(t)):wx.setStorageSync(n,"")},fail:function(e){console.error(e),wx.setStorageSync(n,JSON.stringify(t))}}):uni.request({url:"event"===e?Global.upEventUrl:Global.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:Global.token,projectId:Global.token},data:r,success:function(e){e&&e.data?uni.setStorageSync(n,JSON.stringify(t)):uni.setStorageSync(n,"")},fail:function(e){console.log("error: ",e),uni.setStorageSync(n,JSON.stringify(t))}})):console.error("please set upload data upType")}function queryTrackDataUpload(){let e=null,t=null,n=null;var r=[],o=((Global.platform===wxMini?(e=wx.getStorageSync(BPNPVUV),wx.setStorageSync(BPNPVUV,""),t=wx.getStorageSync(BPNPVUVFail),n=wx.getStorageSync(BPNPVUVFailOnce),wx):(e=uni.getStorageSync(BPNPVUV),uni.setStorageSync(BPNPVUV,""),t=uni.getStorageSync(BPNPVUVFail),n=uni.getStorageSync(BPNPVUVFailOnce),uni)).setStorageSync(BPNPVUVFailOnce,""),e?JSON.parse(e):[]),a=t?JSON.parse(t):[],i=n?JSON.parse(n):[];r.push(...o),r.push(...i),r.push(...a),r&&r.length&&(r.forEach(e=>{delete e.uid}),reportTrackEventServer("track",r,BPNPVUVFail))}function setReportUrl(e){return"test"!==e?{upEventApi:"https://buryingpoint.onebuygz.com/client/api/event",upTrackApi:"https://buryingpoint.onebuygz.com/client/api/track",eventListApi:"https://buryingpoint.onebuygz.com/api/event/query/eventList"}:{upEventApi:"https://buryingpoint.gcongo.com.cn/client/api/event",upTrackApi:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListApi:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}}let BPNEvent="UNIBPNEventSrcData",BPNEventFail="UNIBPNEventFailData",BPNEventFailOnce="UBPNEventFailOnce";function getCurPath(){var e=getCurrentPages(),e=e[e.length-1];return e?e.route:"/"}function eventCommonStore(e){var t=e.$page||"",n=t.path||getCurPath(),t={utm:e.$utm||getUtmObj(),duration:"",element:e.$element||null,eventId:e.$event_id||"",event:e.$event_code||"",groupId:"",busSegment:e.$busSegment||0===e.$busSegment?e.$busSegment:"",module:e.$module||0===e.$module?e.$module:"",page:{domain:t.domain||"",pageId:MD5(n),path:n||"",title:t.title||"",url:n||""},properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:sdkTrackIdVal(),triggerTime:timeToStr(Date.now())};1==e.$sendMode?reportTrackEventServer("event",[t],BPNEventFailOnce):insertEventData(t)}function insertEventData(e){let t;var n=(t=(Global.platform===wxMini?wx:uni).getStorageSync(BPNEvent))?JSON.parse(t):[];n.push(e),(Global.platform===wxMini?wx:uni).setStorageSync(BPNEvent,JSON.stringify(n))}function queryEventDataUpload(){let e=null,t=null,n=null;var r=[],o=((Global.platform===wxMini?(e=wx.getStorageSync(BPNEvent),wx.setStorageSync(BPNEvent,""),t=wx.getStorageSync(BPNEventFail),n=wx.getStorageSync(BPNEventFailOnce),wx):(e=uni.getStorageSync(BPNEvent),uni.setStorageSync(BPNEvent,""),t=uni.getStorageSync(BPNEventFail),n=uni.getStorageSync(BPNEventFailOnce),uni)).setStorageSync(BPNEventFailOnce,""),e?JSON.parse(e):[]),a=t?JSON.parse(t):[],i=n?JSON.parse(n):[];r.push(...o),r.push(...a),r.push(...i),r&&r.length&&reportTrackEventServer("event",r,BPNEventFail)}let startTime,enterTimeLong,loopTimeLong,umlInterval,cirtemp,mObj,cPUUId,sMode;function uStartTrackPVData(e){umlInterval&&uDestoryTrackPVData(),e&&(clearInterval(umlInterval),uTrackPVData(AUTOTRACKTYPE.ENTER,e),umlInterval=setInterval(()=>{uTrackPVData(AUTOTRACKTYPE.LOOP,null)},15e3))}function uDestoryTrackPVData(){mObj&&uTrackPVData(AUTOTRACKTYPE.LEAVE,null),clearInterval(umlInterval),umlInterval=null,sMode=null}function uTrackPVData(e,t){e===AUTOTRACKTYPE.ENTER?(mObj=null,cPUUId=0,cirtemp=1,startTime=0,enterTimeLong=-1,loopTimeLong=-1,enterTimeLong=Date.now(),loopTimeLong=enterTimeLong,cPUUId=randomUUID$1(),mObj=getTrackObj(t),sMode=mObj.sendMode,visPagesArr.push(mObj.path)):e===AUTOTRACKTYPE.LOOP?(cirtemp=2,startTime=15,loopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp=3,t=Math.max(1,(Date.now()-loopTimeLong)/1e3),startTime=Math.ceil(t));e={busSegment:mObj.busSegment,circulation:cirtemp,domain:mObj.domain,duration:startTime,module:mObj.module,path:mObj.path,properties:mObj.properties,sourceDomain:mObj.sourceDomain,sourceUrl:mObj.sourceUrl,title:mObj.title,traceId:"",trackId:sdkTrackIdVal(),url:mObj.url,visitPage:visPagesArr.length,visitTime:timeToStr(enterTimeLong),utm:getUtmObj(),uid:cPUUId};!0===sMode?reportTrackEventServer("track",[e],BPNPVUVFailOnce):insertPVUVData(e,cPUUId)}let uglInterval=null;function init(e){var t;e?(t=setReportUrl(e.env),Global.upEventUrl=t.upEventApi,Global.upTrackUrl=t.upTrackApi,initGetTrackId(),Object.assign(Global,e),getBaseicInfo(),startGlobalTime()):console.log("init config error, please check config!")}function startGlobalTime(){clearInterval(uglInterval),uglInterval=null,uglInterval=setInterval(()=>{queryEventDataUpload(),queryTrackDataUpload()},15e3)}function setUserId(e){e?(Global.distinctId=e,(Global.platform===wxMini?wx:uni).setStorageSync(usrIdKey$1,e)):(Global.distinctId="",Global.platform===wxMini?wx.setStorageSync(usrIdKey$1,e):uni.setStorageSync(usrIdKey$1,""))}function setCustomEvent(e){e&&eventCommonStore(e)}function onStartTrack(e){uStartTrackPVData(e)}function onDestroyTrack(){uDestoryTrackPVData()}function setPageExtraObj(e){uUpdatePageExtraArray(e)}exports.init=init,exports.onDestroyTrack=onDestroyTrack,exports.onStartTrack=onStartTrack,exports.setCustomEvent=setCustomEvent,exports.setPageExtraObj=setPageExtraObj,exports.setUserId=setUserId;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="v_userId",t="v_anonId";function n(e){return"macos"===e.toLowerCase()?"macOS":"harmonyos"===e.toLowerCase()?"Harmony OS":"ios"===e.toLowerCase()?"iOS":"android"===e.toLowerCase()?"Android":"windows"===e.toLowerCase()?"Windows":"linux"===e.toLowerCase()?"Linux":"unknown"}function r(e){return["Windows","Linux","macOS"].every((t=>e.includes(t)))?1:2}function o(){let e=wx.getStorageSync(t);return e||(e="xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),wx.setStorageSync(t,e)),e}const i="enter",a="loop",s="leave",u="UNIBPNPVUVSrcData",c="UNIBPNPVUVFailData",l="UNIBPNEventSrcData",p="UNIBPNEventFailData",f="UBPNOneEventData",d="UBPNOneTrackData",g="wxMini",m="v_userId",y="v_anonId";let h={env:"",domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",appData:null,deviceData:null,distinctId:"",anonymousId:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[],encryptType:2,utm:null,scene:""},S=[],w=[];const v=()=>{if(h.trackId)return h.trackId;const e=Date.now().toString();return h.trackId=e,w=[],e};function x(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function b(e){const t=new Date(e);return`${t.getFullYear()}-${t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1}-${t.getDate()<10?"0"+t.getDate():t.getDate()} ${t.getHours()<10?"0"+t.getHours():t.getHours()}:${t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes()}:${t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds()}`}function I(e){if("web"===h.platform){const t=e.ua.toLowerCase();return/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)}return"pc"===e.deviceType?1:2}function k(){if("web"===h.platform){let e=window.location.href;if(e&&!e.includes("file://")&&/^(https?:\/\/[^\s$.?#].[^\s]*)$/i.test(e)){const e=window.location.href.split("?")[1];if(e){const t=new URLSearchParams(e);let n={utmSource:t.get("utmSource")||"",utmCampaign:t.get("utmCampaign")||"",utmMedium:t.get("utmMedium")||"",utmTerm:t.get("utmTerm")||"",utmContent:t.get("utmContent")||"",ctk:t.get("ctk")||""};h.utm?Object.keys(n).forEach((e=>{n[e]&&(h.utm[e]=n[e])})):h.utm=n}}}return h.utm}function _(){!function(){try{return"undefined"!=typeof wx&&wx.env&&wx.canIUse}catch(e){return!1}}()?(uni.getSystemInfo({success:function(e){h.uAgent=e.ua;const t=e.uniPlatform;if(t.includes("app"))h.platform=e.osName,h.appData=function(e){let t=plus.runtime.version,n={name:e.appName,version:t||"",carrier:"unknown",packageName:"",ecology:""};if("android"===e.platform){n.carrier="Android";let t="Android",r=plus.android.runtimeMainActivity().getPackageName();e.romName.includes("HarmonyOS")&&(t="Harmony OS",n.carrier="Harmony OS"),n.packageName=r||"",n.ecology=t}else if("ios"===e.platform){let e=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier();n.packageName=e||"",n.carrier="iOS",n.ecology="iOS"}else if("harmonyos"===e.platform){let e=uni.getAppBaseInfo();n.carrier="Harmony OS",n.ecology="Harmony OS",n.version=e.appVersion,n.packageName=e.packageName}else n.ecology="unknown";return n}(e),h.platform="Harmony OS";else if(t.includes("web")||t.includes("h5")){h.platform="web";let t=function(e){let t=e.ua.toLowerCase(),n=window.location.hostname,r=document.title;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t),t.includes("alipay")||t.includes("unionPay")||t.includes("onbuygz")||t.includes("onetravel"),t.includes("micromessenger")&&t.includes("miniprogram"),{name:r||"",packageName:n||"",version:"",carrier:"H5",ecology:"h5"}}(e);h.appData={...t,version:h.version?h.version:"unknown"}}else t.includes("weixin")?(h.platform="weixin",h.appData=function(){const e=uni.getAccountInfoSync(),t=uni.getAppBaseInfo();return{name:t.appName?t.appName:"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}()):console.log("uni get platform getBaseicInfo error ");h.deviceData=function(e){var t;return{lang:e.osLanguage?e.osLanguage:e.hostLanguage,brand:e.deviceBrand?e.deviceBrand+" "+e.deviceModel:e.deviceModel,os:(t=e.osName,"macos"===t.toLowerCase()?"macOS":"harmonyos"===t.toLowerCase()?"Harmony OS":"ios"===t.toLowerCase()?"iOS":"android"===t.toLowerCase()?"Android":"windows"===t.toLowerCase()?"Windows":"linux"===t.toLowerCase()?"Linux":"unknown"),osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:I(e),network:""}}(e)},fail:function(e){h.deviceData={lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}},complete:function(){uni.getNetworkType({success(e){h.deviceData.network=e.networkType}})}}),h.distinctId=uni.getStorageSync(m)||"",h.anonymousId=uni.getStorageSync(y),h.anonymousId||(h.anonymousId=x()),uni.setStorageSync(y,h.anonymousId)):(h.platform=g,h.appData=function(){let e=wx.getAccountInfoSync().miniProgram;return{name:"",packageName:e?e.appId:"",version:e?e.envVersion+e.version:"",carrier:"mini",ecology:"mini"}}(),h.deviceData=function(){const e=wx.getSystemInfoSync();let t={lang:e.language,brand:e.brand+" "+e.model,os:n(e.platform),osVersion:e.system,resolution:e.screenWidth+"x"+e.screenHeight,browser:"",browserVersion:"",color:"",deviceId:"",deviceType:r(e.system),network:""};return wx.getNetworkType({success(e){t.network=e.networkType}}),t}(),h.distinctId=wx.getStorageSync(e)?wx.getStorageSync(e):"",h.anonymousId=o(),h.scene="WX"+wx.getLaunchOptionsSync().scene)}var T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function B(e,t){return e(t={exports:{}},t.exports),t.exports}var O,N=(O=Object.freeze({__proto__:null,default:{}}))&&O.default||O,A=B((function(e,t){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==T&&T.crypto&&(n=T.crypto),!n)try{n=N}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s<o;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new u.init(t,e)}}),c=i.enc={},l=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},p=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},f=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(p.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return p.parse(unescape(encodeURIComponent(e)))}},d=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*c,i);if(c){for(var p=0;p<c;p+=a)this._doProcessBlock(o,p);n=o.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=d.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=i.algo={};return i}(Math),n)})),C=(B((function(e,t){var n;e.exports=(n=A,function(e){var t=n,r=t.lib,o=r.WordArray,i=r.Hasher,a=t.algo,s=[],u=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(s[o]=n(e.pow(r,.5))),u[o]=n(e.pow(r,1/3)),o++),r++}();var c=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],l=n[5],p=n[6],f=n[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var g=c[d-15],m=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,y=c[d-2],h=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;c[d]=m+c[d-7]+h+c[d-16]}var S=r&o^r&i^o&i,w=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),v=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&p)+u[d]+c[d];f=p,p=l,l=s,s=a+v|0,a=i,i=o,o=r,r=v+(w+S)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+p|0,n[7]=n[7]+f|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),n.SHA256)})),B((function(e,t){var n,r,o;e.exports=(r=(n=A).lib.Base,o=n.enc.Utf8,void(n.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,u=a.words,c=0;c<n;c++)s[c]^=1549556828,u[c]^=909522486;i.sigBytes=a.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))})),B((function(e,t){e.exports=A.HmacSHA256}))),D=B((function(e){!function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var o=e[r]<<16|e[r+1]<<8|e[r+2],i=0;i<4;i++)8*r+6*i<=8*e.length?n.push(t.charAt(o>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,o=0;r<e.length;o=++r%4)0!=o&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|t.indexOf(e.charAt(r))>>>6-2*o);return n}};e.exports=n}()})),H={utf8:{stringToBytes:function(e){return H.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(H.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},U=H,P=function(e){return null!=e&&($(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&$(e.slice(0,0))}(e)||!!e._isBuffer)};function $(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var M=B((function(e){!function(){var t=D,n=U.utf8,r=P,o=U.bin,i=function(e,a){e.constructor==String?e=a&&"binary"===a.encoding?o.stringToBytes(e):n.stringToBytes(e):r(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var s=t.bytesToWords(e),u=8*e.length,c=1732584193,l=-271733879,p=-1732584194,f=271733878,d=0;d<s.length;d++)s[d]=16711935&(s[d]<<8|s[d]>>>24)|4278255360&(s[d]<<24|s[d]>>>8);s[u>>>5]|=128<<u%32,s[14+(u+64>>>9<<4)]=u;var g=i._ff,m=i._gg,y=i._hh,h=i._ii;for(d=0;d<s.length;d+=16){var S=c,w=l,v=p,x=f;c=g(c,l,p,f,s[d+0],7,-680876936),f=g(f,c,l,p,s[d+1],12,-389564586),p=g(p,f,c,l,s[d+2],17,606105819),l=g(l,p,f,c,s[d+3],22,-1044525330),c=g(c,l,p,f,s[d+4],7,-176418897),f=g(f,c,l,p,s[d+5],12,1200080426),p=g(p,f,c,l,s[d+6],17,-1473231341),l=g(l,p,f,c,s[d+7],22,-45705983),c=g(c,l,p,f,s[d+8],7,1770035416),f=g(f,c,l,p,s[d+9],12,-1958414417),p=g(p,f,c,l,s[d+10],17,-42063),l=g(l,p,f,c,s[d+11],22,-1990404162),c=g(c,l,p,f,s[d+12],7,1804603682),f=g(f,c,l,p,s[d+13],12,-40341101),p=g(p,f,c,l,s[d+14],17,-1502002290),c=m(c,l=g(l,p,f,c,s[d+15],22,1236535329),p,f,s[d+1],5,-165796510),f=m(f,c,l,p,s[d+6],9,-1069501632),p=m(p,f,c,l,s[d+11],14,643717713),l=m(l,p,f,c,s[d+0],20,-373897302),c=m(c,l,p,f,s[d+5],5,-701558691),f=m(f,c,l,p,s[d+10],9,38016083),p=m(p,f,c,l,s[d+15],14,-660478335),l=m(l,p,f,c,s[d+4],20,-405537848),c=m(c,l,p,f,s[d+9],5,568446438),f=m(f,c,l,p,s[d+14],9,-1019803690),p=m(p,f,c,l,s[d+3],14,-187363961),l=m(l,p,f,c,s[d+8],20,1163531501),c=m(c,l,p,f,s[d+13],5,-1444681467),f=m(f,c,l,p,s[d+2],9,-51403784),p=m(p,f,c,l,s[d+7],14,1735328473),c=y(c,l=m(l,p,f,c,s[d+12],20,-1926607734),p,f,s[d+5],4,-378558),f=y(f,c,l,p,s[d+8],11,-2022574463),p=y(p,f,c,l,s[d+11],16,1839030562),l=y(l,p,f,c,s[d+14],23,-35309556),c=y(c,l,p,f,s[d+1],4,-1530992060),f=y(f,c,l,p,s[d+4],11,1272893353),p=y(p,f,c,l,s[d+7],16,-155497632),l=y(l,p,f,c,s[d+10],23,-1094730640),c=y(c,l,p,f,s[d+13],4,681279174),f=y(f,c,l,p,s[d+0],11,-358537222),p=y(p,f,c,l,s[d+3],16,-722521979),l=y(l,p,f,c,s[d+6],23,76029189),c=y(c,l,p,f,s[d+9],4,-640364487),f=y(f,c,l,p,s[d+12],11,-421815835),p=y(p,f,c,l,s[d+15],16,530742520),c=h(c,l=y(l,p,f,c,s[d+2],23,-995338651),p,f,s[d+0],6,-198630844),f=h(f,c,l,p,s[d+7],10,1126891415),p=h(p,f,c,l,s[d+14],15,-1416354905),l=h(l,p,f,c,s[d+5],21,-57434055),c=h(c,l,p,f,s[d+12],6,1700485571),f=h(f,c,l,p,s[d+3],10,-1894986606),p=h(p,f,c,l,s[d+10],15,-1051523),l=h(l,p,f,c,s[d+1],21,-2054922799),c=h(c,l,p,f,s[d+8],6,1873313359),f=h(f,c,l,p,s[d+15],10,-30611744),p=h(p,f,c,l,s[d+6],15,-1560198380),l=h(l,p,f,c,s[d+13],21,1309151649),c=h(c,l,p,f,s[d+4],6,-145523070),f=h(f,c,l,p,s[d+11],10,-1120210379),p=h(p,f,c,l,s[d+2],15,718787259),l=h(l,p,f,c,s[d+9],21,-343485551),c=c+S>>>0,l=l+w>>>0,p=p+v>>>0,f=f+x>>>0}return t.endian([c,l,p,f])};i._ff=function(e,t,n,r,o,i,a){var s=e+(t&n|~t&r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._gg=function(e,t,n,r,o,i,a){var s=e+(t&r|n&~r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._hh=function(e,t,n,r,o,i,a){var s=e+(t^n^r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._ii=function(e,t,n,r,o,i,a){var s=e+(n^(t|~r))+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._blocksize=16,i._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(i(e,n));return n&&n.asBytes?r:n&&n.asString?o.bytesToString(r):t.bytesToHex(r)}}()}));function L(e,t){if(1===h.encryptType)return M(JSON.stringify(e));if(2===h.encryptType){let n="",r=e[0].trackId;n="event"===t?`&triggerTime=${e[0].triggerTime}`:`&visitTime=${e[0].visitTime}`;let o=`projectId=${h.token}&anonymousId=${h.anonymousId}&trackId=${r}${n}`;return C(o,"jCfeIQH52pMcgNUQoXYA").toString()}}function J(e,t,n){if(!e)return void console.error("please set upload data upType");var r;const o={...(r=t,{app:h.appData,data:r,device:h.deviceData,lsi:"f9b0b43338054e472866a63bd8da14a4#2.0.6",projectId:h.token,userAgent:h.uAgent||"",anonymousId:h.anonymousId,userId:h.distinctId}),dataAbstract:L(t,e)};h.platform===g?wx.request({url:"event"===e?h.upEventUrl:h.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:h.token,projectId:h.token},data:o,success:function(e){e&&e.data&&(n===f?z(t,p):n===d?z(t,c):wx.setStorageSync(n,JSON.stringify(t)))},fail:function(e){console.error(e),wx.setStorageSync(n,JSON.stringify(t))}}):uni.request({url:"event"===e?h.upEventUrl:h.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:h.token,projectId:h.token},data:o,success:function(e){e&&e.data&&(n===f?z(t,p):n===d?z(t,c):uni.setStorageSync(n,JSON.stringify(t)))},fail:function(e){console.log("error: ",e),uni.setStorageSync(n,JSON.stringify(t))}})}function z(e,t){if(h.platform===g){let n=wx.getStorageSync(t),r=(n?JSON.parse(n):[]).concat(e);wx.setStorageSync(t,JSON.stringify(r))}else{let n=uni.getStorageSync(t),r=(n?JSON.parse(n):[]).concat(e);uni.setStorageSync(t,JSON.stringify(r))}}function E(e){const t=e.$page?e.$page:"",n=t.path?t.path:function(){const e=getCurrentPages(),t=e[e.length-1];return t?t.route:"/"}();let r={busSegment:e.$busSegment||0===e.$busSegment?e.$busSegment:"",module:e.$module||0===e.$module?e.$module:"",properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:v(),sceneTag:h.scene,eventId:e.$event_id?e.$event_id:"",event:e.$event_code?e.$event_code:"",utm:k(),duration:null,element:e.$element?e.$element:null,triggerTime:b(Date.now()),page:{domain:t.domain?t.domain:"",url:n||"",path:n||"",title:t.title||"",pageId:M(n)}};r&&(!0===e.$sendMode||!0===e.$send?J("event",[r],f):function(e){let t;t=h.platform===g?wx.getStorageSync(l):uni.getStorageSync(l);let n=t?JSON.parse(t):[];n.push(e),h.platform===g?wx.setStorageSync(l,JSON.stringify(n)):uni.setStorageSync(l,JSON.stringify(n))}(r))}let j,V,R,W,F,K,q,Q;function X(){W&&K&&(Y(s,null),clearInterval(W),W=null,K=null,Q=null)}function Y(e,t){if(e===i)K=null,F=1,j=0,V=Date.now(),R=V,q=x(),K=function(e){const t=getCurrentPages(),n=t[t.length-1];let r=h.platform,o="",i="",a="",s="";if("web"===r||"h5"===r){if(o=window.location.href,i=window.location.hostname,document.referrer){let e=new URL(document.referrer);a=e||"",s=e.hostname||""}}else o=n.route,a=t.length>1?t[t.length-2].route:n.route,i=h.domain?h.domain:n.route;if(n)return{path:n.route,busSegment:e.busSegment||0===e.busSegment?e.busSegment:"",module:e.module||0===e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title?e.title:"",domain:i,url:o,visitPage:t.length,sourceDomain:s,sourceUrl:a,send:e.send||e.sendMode}}(t),Q=K.send,w.push(K.path);else if(e===a)F=2,j=15,R=Date.now();else if(e===s){F=3;let e=Math.max(1,(Date.now()-R)/1e3);j=Math.ceil(e)}let n={busSegment:K.busSegment,module:K.module,properties:K.properties,traceId:"",trackId:v(),sceneTag:h.scene,utm:k(),domain:K.domain,title:K.title,sourceDomain:K.sourceDomain,url:K.url,path:K.path,sourceUrl:K.sourceUrl,duration:j,circulation:F,visitPage:w.length,visitTime:b(V),uid:q};n&&(!0===Q?(delete n.uid,J("track",[n],d)):function(e,t){let n=null;n=h.platform===g?wx.getStorageSync(u):uni.getStorageSync(u);let r=n?JSON.parse(n):[];if(r.length>0){const n=r.findIndex((e=>e.uid===t));-1!==n?r[n]={...r[n],...e}:r.push(e)}else r.push(e);h.platform===g?wx.setStorageSync(u,JSON.stringify(r)):uni.setStorageSync(u,JSON.stringify(r))}(n,q))}let Z=null;exports.clearUtm=function(){h.utm=null},exports.getTrackId=function(){return v()},exports.init=function(e){if(e){const t="test"===e.env?{upEventApi:"https://buryingpoint.gcongo.com.cn/client/api/event",upTrackApi:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListApi:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}:{upEventApi:"https://buryingpoint.onebuygz.com/client/api/event",upTrackApi:"https://buryingpoint.onebuygz.com/client/api/track",eventListApi:"https://buryingpoint.onebuygz.com/api/event/query/eventList"};h.upEventUrl=t.upEventApi,h.upTrackUrl=t.upTrackApi,function(){const e=Date.now().toString();h.trackId=e,h.utm=null,w=[],console.log("tid ",e)}(),Object.assign(h,e),_(),clearInterval(Z),Z=null,Z=setInterval((()=>{!function(){let e=null,t=null,n=[];h.platform===g?(e=wx.getStorageSync(l),wx.setStorageSync(l,""),t=wx.getStorageSync(p),wx.setStorageSync(p,"")):(e=uni.getStorageSync(l),uni.setStorageSync(l,""),t=uni.getStorageSync(p),uni.setStorageSync(p,""));const r=e?JSON.parse(e):[],o=t?JSON.parse(t):[];n.push(...r),n.push(...o),n&&n.length&&J("event",n,p)}(),function(){let e=null,t=null,n=[];h.platform===g?(e=wx.getStorageSync(u),wx.setStorageSync(u,""),t=wx.getStorageSync(c),wx.setStorageSync(c,"")):(e=uni.getStorageSync(u),uni.setStorageSync(u,""),t=uni.getStorageSync(c),uni.setStorageSync(c,""));const r=e?JSON.parse(e):[],o=t?JSON.parse(t):[];n.push(...r),n.push(...o),n&&n.length&&(n.forEach((e=>{delete e.uid})),J("track",n,c))}()}),15e3),h.isCompatible||h.platform}else console.log("init config error, please check config!");"test"===e.env&&console.log("config: ",h)},exports.onDestroyTrack=function(){X()},exports.onStartTrack=function(e){var t;e&&(t=e,W&&K&&X(),clearInterval(W),Y(i,t),W=setInterval((()=>{Y(a,null)}),15e3))},exports.setCustomEvent=function(e){e&&E(e)},exports.setPageExtraObj=function(e){!function(e){const t=getCurrentPages();let n=t[t.length-1];const r=S.findIndex((e=>e.path===n.route));let o={path:n.route,properties:e.properties?JSON.stringify(e.properties):"",busSegment:e.busSegment?e.busSegment:"",module:e.module?e.module:"",title:e.title?e.title:""};-1!==r?S[r]=o:S.push(o)}(e)},exports.setUserId=function(e){e?(h.distinctId=e,h.platform===g?wx.setStorageSync(m,e):uni.setStorageSync(m,e)):(h.distinctId="",h.platform===g?wx.setStorageSync(m,e):uni.setStorageSync(m,""))},exports.setUtmData=function(e){var t;t=e,h.utm=t?{utmSource:t.utmSource||"",utmCampaign:t.utmCampaign||"",utmMedium:t.utmMedium||"",utmTerm:t.utmTerm||"",utmContent:t.utmContent||"",ctk:t.ctk||""}:null};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import MD5 from"md5";var name="visual-buried-point-platform-uni",version="2.0.4-alpha.9",lsi="8fbabc22c6ecb742a261e79f879e08ce#2.0.4-alpha.8",description="To make it easy for you to get started with GitLab, here's a list of recommended next steps.",main="dist/cjs/buried-point-uni.js",module="dist/esm/buried-point-uni.js",scripts={build:"rimraf dist && rollup -c --environment INCLUDE_DEPS,BUILD:production && node lsi-md5.cjs"},type="module",files=["dist"],repository={type:"git",url:""},keywords=[],author="",license="MIT",peerDependencies={"crypto-js":"4.2.0",md5:"2.3.0"},devDependencies={"@babel/core":"^7.26.10","@babel/preset-env":"^7.26.9","@rollup/plugin-json":"^6.0.1","babel-loader":"^10.0.0","babel-preset-es2015":"^6.24.1",rimraf:"^6.0.1",rollup:"^1.20.2","rollup-plugin-babel":"^4.3.3","rollup-plugin-commonjs":"^10.0.2","rollup-plugin-node-resolve":"^5.2.0","rollup-plugin-replace":"^2.2.0","rollup-plugin-uglify":"^6.0.2",webpack:"^5.72.1","webpack-cli":"^6.0.1",md5:"2.3.0"},pk={name:name,version:version,lsi:lsi,description:description,main:main,module:module,"umd:main":"dist/umd/buried-point-uni.js",scripts:scripts,type:type,files:files,repository:repository,keywords:keywords,author:author,license:license,peerDependencies:peerDependencies,devDependencies:devDependencies};let usrIdKey="v_userId",anonIdKey="v_anonId";function getWxMiniInfo(){var e=wx.getAccountInfoSync().miniProgram;return{name:"",packageName:e?e.appId:"",version:e?e.envVersion+e.version:"",carrier:"mini",ecology:"mini"}}function getWxMiniDeviceInfo(){var e=wx.getSystemInfoSync();let t={lang:e.language,brand:e.brand+" "+e.model,os:getOSNameFormat(e.platform),osVersion:e.system,resolution:e.screenWidth+"x"+e.screenHeight,browser:"",browserVersion:"",color:"",deviceId:"",deviceType:getWxMiniDeviceType(e.system),network:""};return wx.getNetworkType({success(e){t.network=e.networkType}}),t}function getWxMiniDeviceType(t){return["Windows","Linux","macOS"].every(e=>t.includes(e))?1:2}function randomUUID(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function getWxMiniUserId(){return wx.getStorageSync(usrIdKey)?wx.getStorageSync(usrIdKey):""}function getWxMiniAnonyMousId(){let e=wx.getStorageSync(anonIdKey);return e||(e=randomUUID(),wx.setStorageSync(anonIdKey,e)),e}let AUTOTRACKTYPE={ENTER:"enter",LOOP:"loop",LEAVE:"leave"},BPNPVUV="UNIBPNPVUVSrcData",BPNPVUVFail="UNIBPNPVUVFailData",BPNPVUVFailOnce="UBPNPVUVFailOnce",wxMini="wxMini",usrIdKey$1="v_userId",anonIdKey$1="v_anonId",Global={env:"",domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",appData:null,deviceData:null,distinctId:"",anonymousId:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[]},pagesArray=[],visPagesArr=[];function isWXMiniProgram(){try{return"undefined"!=typeof wx&&wx.env&&wx.canIUse}catch(e){return!1}}function initGetTrackId(){var e=Date.now().toString();Global.trackId=e,visPagesArr=[],console.log("tId ",e)}let sdkTrackIdVal=()=>{var e;return Global.trackId||(e=Date.now().toString(),Global.trackId=e,visPagesArr=[],e)};function randomUUID$1(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function timeToStr(e){e=new Date(e);return e.getFullYear()+`-${e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1}-${e.getDate()<10?"0"+e.getDate():e.getDate()} ${e.getHours()<10?"0"+e.getHours():e.getHours()}:${e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes()}:`+(e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds())}function getUniWebH5Info(e){var e=e.ua.toLowerCase(),t=window.location.hostname,n=document.title;/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(e);return e.includes("alipay")||e.includes("unionPay")||e.includes("onbuygz")||e.includes("onetravel"),e.includes("micromessenger")&&e.includes("miniprogram"),{name:n||"",packageName:t||"",version:"",carrier:"H5",ecology:"h5"}}function getUniWXInfo(){var e=uni.getAccountInfoSync(),t=uni.getAppBaseInfo();return{name:t.appName||"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}function getUniAppInfo(t){var n=plus.runtime.version,n={name:t.appName,version:n||"",carrier:"unknown",packageName:"",ecology:""};if("android"===t.platform){let e=n.carrier="Android";var r=plus.android.runtimeMainActivity().getPackageName();t.romName.includes("HarmonyOS")&&(e="Harmony OS",n.carrier="Harmony OS"),n.packageName=r||"",n.ecology=e}else"ios"===t.platform?(r=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier(),n.packageName=r||"",n.carrier="iOS",n.ecology="iOS"):"harmonyos"===t.platform?(r=uni.getAppBaseInfo(),n.carrier="Harmony OS",n.ecology="Harmony OS",n.version=r.appVersion,n.packageName=r.packageName):n.ecology="unknown";return n}function getCurDeviceType(e){var t;return"web"===Global.platform?(t=e.ua.toLowerCase(),/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)):"pc"===e.deviceType?1:2}function getOSNameFormat(e){return"macos"===e.toLowerCase()?"macOS":"harmonyos"===e.toLowerCase()?"Harmony OS":"ios"===e.toLowerCase()?"iOS":"android"===e.toLowerCase()?"Android":"windows"===e.toLowerCase()?"Windows":"linux"===e.toLowerCase()?"Linux":"unknown"}function getDeviceInfo(e){return{lang:e.osLanguage||e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os:getOSNameFormat(e.osName),osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:getCurDeviceType(e),network:""}}function getDeviceInfoError(){return{lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}}function getTrackObj(e){var t=getCurrentPages(),n=t[t.length-1],r=Global.platform;let o="",a="",i="",l="";if("web"===r||"h5"===r?(o=window.location.href,a=window.location.hostname,document.referrer&&(r=new URL(document.referrer),i=r||"",l=r.hostname||"")):(o=n.route,i=(1<t.length?t[t.length-2]:n).route,a=Global.domain||n.route),n)return{path:n.route,busSegment:e.busSegment||0===e.busSegment?e.busSegment:"",module:e.module||0===e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title||"",domain:a,url:o,visitPage:t.length,sourceDomain:l,sourceUrl:i,sendMode:e.sendMode}}function uUpdatePageExtraArray(e){var t=getCurrentPages();let n=t[t.length-1];t=pagesArray.findIndex(e=>e.path===n.route),e={path:n.route,properties:e.properties?JSON.stringify(e.properties):"",busSegment:e.busSegment||"",module:e.module||"",title:e.title||""};-1!==t?pagesArray[t]=e:pagesArray.push(e)}function isValidURL(e){return/^(https?:\/\/[^\s$.?#].[^\s]*)$/i.test(e)}function getUtmObj(){if("web"===Global.platform){var e=window.location.href;if(e&&!e.includes("file://")&&isValidURL(e)){var e=window.location.href.split("?")[1];if(e)return{utmSource:(e=new URLSearchParams(e)).get("utmSource")||"",utmCampaign:e.get("utmCampaign")||"",utmTerm:e.get("utmTerm")||"",utmContent:e.get("utmContent")||"",ctk:e.get("ctk")||""}}}return null}function insertPVUVData(e,t){let n=null;var r,o=(n=(Global.platform===wxMini?wx:uni).getStorageSync(BPNPVUV))?JSON.parse(n):[];0<o.length&&-1!==(r=o.findIndex(e=>e.uid===t))?o[r]={...o[r],...e}:o.push(e),(Global.platform===wxMini?wx:uni).setStorageSync(BPNPVUV,JSON.stringify(o))}function getBaseicInfo(){isWXMiniProgram()?(Global.platform=wxMini,Global.appData=getWxMiniInfo(),Global.deviceData=getWxMiniDeviceInfo(),Global.distinctId=getWxMiniUserId(),Global.anonymousId=getWxMiniAnonyMousId()):(uni.getSystemInfo({success:function(e){Global.uAgent=e.ua;var t,n=e.uniPlatform;uni.showToast({title:n+"+"+e.osName,icon:"success"}),n.includes("app")?(Global.platform=e.osName,Global.appData=getUniAppInfo(e),Global.platform="Harmony OS"):n.includes("web")||n.includes("h5")?(Global.platform="web",t=getUniWebH5Info(e),Global.appData={...t,version:Global.version||"unknown"}):n.includes("weixin")?(Global.platform="weixin",Global.appData=getUniWXInfo()):console.log("uni get platform getBaseicInfo error "),Global.deviceData=getDeviceInfo(e)},fail:function(e){Global.deviceData=getDeviceInfoError()},complete:function(){uni.getNetworkType({success(e){Global.deviceData.network=e.networkType}})}}),Global.distinctId=uni.getStorageSync(usrIdKey$1)||"",Global.anonymousId=uni.getStorageSync(anonIdKey$1),Global.anonymousId||(Global.anonymousId=randomUUID$1()),uni.setStorageSync(anonIdKey$1,Global.anonymousId))}let localLsi=pk.lsi;function commonData(e){return{app:Global.appData,data:e,device:Global.deviceData,lsi:localLsi,projectId:Global.token,userAgent:Global.uAgent||"",anonymousId:Global.anonymousId,userId:Global.distinctId}}function reportTrackEventServer(e,t,n){var r;e?(r={...r=commonData(t),dataAbstract:MD5(JSON.stringify(r))},Global.platform===wxMini?wx.request({url:"event"===e?Global.upEventUrl:Global.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:Global.token,projectId:Global.token},data:r,success:function(e){e&&e.data?wx.setStorageSync(n,JSON.stringify(t)):wx.setStorageSync(n,"")},fail:function(e){console.error(e),wx.setStorageSync(n,JSON.stringify(t))}}):uni.request({url:"event"===e?Global.upEventUrl:Global.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:Global.token,projectId:Global.token},data:r,success:function(e){e&&e.data?uni.setStorageSync(n,JSON.stringify(t)):uni.setStorageSync(n,"")},fail:function(e){console.log("error: ",e),uni.setStorageSync(n,JSON.stringify(t))}})):console.error("please set upload data upType")}function queryTrackDataUpload(){let e=null,t=null,n=null;var r=[],o=((Global.platform===wxMini?(e=wx.getStorageSync(BPNPVUV),wx.setStorageSync(BPNPVUV,""),t=wx.getStorageSync(BPNPVUVFail),n=wx.getStorageSync(BPNPVUVFailOnce),wx):(e=uni.getStorageSync(BPNPVUV),uni.setStorageSync(BPNPVUV,""),t=uni.getStorageSync(BPNPVUVFail),n=uni.getStorageSync(BPNPVUVFailOnce),uni)).setStorageSync(BPNPVUVFailOnce,""),e?JSON.parse(e):[]),a=t?JSON.parse(t):[],i=n?JSON.parse(n):[];r.push(...o),r.push(...i),r.push(...a),r&&r.length&&(r.forEach(e=>{delete e.uid}),reportTrackEventServer("track",r,BPNPVUVFail))}function setReportUrl(e){return"test"!==e?{upEventApi:"https://buryingpoint.onebuygz.com/client/api/event",upTrackApi:"https://buryingpoint.onebuygz.com/client/api/track",eventListApi:"https://buryingpoint.onebuygz.com/api/event/query/eventList"}:{upEventApi:"https://buryingpoint.gcongo.com.cn/client/api/event",upTrackApi:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListApi:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}}let BPNEvent="UNIBPNEventSrcData",BPNEventFail="UNIBPNEventFailData",BPNEventFailOnce="UBPNEventFailOnce";function getCurPath(){var e=getCurrentPages(),e=e[e.length-1];return e?e.route:"/"}function eventCommonStore(e){var t=e.$page||"",n=t.path||getCurPath(),t={utm:e.$utm||getUtmObj(),duration:"",element:e.$element||null,eventId:e.$event_id||"",event:e.$event_code||"",groupId:"",busSegment:e.$busSegment||0===e.$busSegment?e.$busSegment:"",module:e.$module||0===e.$module?e.$module:"",page:{domain:t.domain||"",pageId:MD5(n),path:n||"",title:t.title||"",url:n||""},properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:sdkTrackIdVal(),triggerTime:timeToStr(Date.now())};1==e.$sendMode?reportTrackEventServer("event",[t],BPNEventFailOnce):insertEventData(t)}function insertEventData(e){let t;var n=(t=(Global.platform===wxMini?wx:uni).getStorageSync(BPNEvent))?JSON.parse(t):[];n.push(e),(Global.platform===wxMini?wx:uni).setStorageSync(BPNEvent,JSON.stringify(n))}function queryEventDataUpload(){let e=null,t=null,n=null;var r=[],o=((Global.platform===wxMini?(e=wx.getStorageSync(BPNEvent),wx.setStorageSync(BPNEvent,""),t=wx.getStorageSync(BPNEventFail),n=wx.getStorageSync(BPNEventFailOnce),wx):(e=uni.getStorageSync(BPNEvent),uni.setStorageSync(BPNEvent,""),t=uni.getStorageSync(BPNEventFail),n=uni.getStorageSync(BPNEventFailOnce),uni)).setStorageSync(BPNEventFailOnce,""),e?JSON.parse(e):[]),a=t?JSON.parse(t):[],i=n?JSON.parse(n):[];r.push(...o),r.push(...a),r.push(...i),r&&r.length&&reportTrackEventServer("event",r,BPNEventFail)}let startTime,enterTimeLong,loopTimeLong,umlInterval,cirtemp,mObj,cPUUId,sMode;function uStartTrackPVData(e){umlInterval&&uDestoryTrackPVData(),e&&(clearInterval(umlInterval),uTrackPVData(AUTOTRACKTYPE.ENTER,e),umlInterval=setInterval(()=>{uTrackPVData(AUTOTRACKTYPE.LOOP,null)},15e3))}function uDestoryTrackPVData(){mObj&&uTrackPVData(AUTOTRACKTYPE.LEAVE,null),clearInterval(umlInterval),umlInterval=null,sMode=null}function uTrackPVData(e,t){e===AUTOTRACKTYPE.ENTER?(mObj=null,cPUUId=0,cirtemp=1,startTime=0,enterTimeLong=-1,loopTimeLong=-1,enterTimeLong=Date.now(),loopTimeLong=enterTimeLong,cPUUId=randomUUID$1(),mObj=getTrackObj(t),sMode=mObj.sendMode,visPagesArr.push(mObj.path)):e===AUTOTRACKTYPE.LOOP?(cirtemp=2,startTime=15,loopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp=3,t=Math.max(1,(Date.now()-loopTimeLong)/1e3),startTime=Math.ceil(t));e={busSegment:mObj.busSegment,circulation:cirtemp,domain:mObj.domain,duration:startTime,module:mObj.module,path:mObj.path,properties:mObj.properties,sourceDomain:mObj.sourceDomain,sourceUrl:mObj.sourceUrl,title:mObj.title,traceId:"",trackId:sdkTrackIdVal(),url:mObj.url,visitPage:visPagesArr.length,visitTime:timeToStr(enterTimeLong),utm:getUtmObj(),uid:cPUUId};!0===sMode?reportTrackEventServer("track",[e],BPNPVUVFailOnce):insertPVUVData(e,cPUUId)}let uglInterval=null;function init(e){var t;e?(t=setReportUrl(e.env),Global.upEventUrl=t.upEventApi,Global.upTrackUrl=t.upTrackApi,initGetTrackId(),Object.assign(Global,e),getBaseicInfo(),startGlobalTime()):console.log("init config error, please check config!")}function startGlobalTime(){clearInterval(uglInterval),uglInterval=null,uglInterval=setInterval(()=>{queryEventDataUpload(),queryTrackDataUpload()},15e3)}function setUserId(e){e?(Global.distinctId=e,(Global.platform===wxMini?wx:uni).setStorageSync(usrIdKey$1,e)):(Global.distinctId="",Global.platform===wxMini?wx.setStorageSync(usrIdKey$1,e):uni.setStorageSync(usrIdKey$1,""))}function setCustomEvent(e){e&&eventCommonStore(e)}function onStartTrack(e){uStartTrackPVData(e)}function onDestroyTrack(){uDestoryTrackPVData()}function setPageExtraObj(e){uUpdatePageExtraArray(e)}export{init,onDestroyTrack,onStartTrack,setCustomEvent,setPageExtraObj,setUserId};
|
|
1
|
+
const e="v_userId",t="v_anonId";function n(e){return"macos"===e.toLowerCase()?"macOS":"harmonyos"===e.toLowerCase()?"Harmony OS":"ios"===e.toLowerCase()?"iOS":"android"===e.toLowerCase()?"Android":"windows"===e.toLowerCase()?"Windows":"linux"===e.toLowerCase()?"Linux":"unknown"}function r(e){return["Windows","Linux","macOS"].every((t=>e.includes(t)))?1:2}function o(){let e=wx.getStorageSync(t);return e||(e="xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),wx.setStorageSync(t,e)),e}const i="enter",a="loop",s="leave",u="UNIBPNPVUVSrcData",c="UNIBPNPVUVFailData",l="UNIBPNEventSrcData",f="UNIBPNEventFailData",p="UBPNOneEventData",d="UBPNOneTrackData",g="wxMini",m="v_userId",y="v_anonId";let h={env:"",domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",appData:null,deviceData:null,distinctId:"",anonymousId:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[],encryptType:2,utm:null,scene:""},S=[],w=[];const v=()=>{if(h.trackId)return h.trackId;const e=Date.now().toString();return h.trackId=e,w=[],e};function x(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function b(e){const t=new Date(e);return`${t.getFullYear()}-${t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1}-${t.getDate()<10?"0"+t.getDate():t.getDate()} ${t.getHours()<10?"0"+t.getHours():t.getHours()}:${t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes()}:${t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds()}`}function I(e){if("web"===h.platform){const t=e.ua.toLowerCase();return/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)}return"pc"===e.deviceType?1:2}function k(){if("web"===h.platform){let e=window.location.href;if(e&&!e.includes("file://")&&/^(https?:\/\/[^\s$.?#].[^\s]*)$/i.test(e)){const e=window.location.href.split("?")[1];if(e){const t=new URLSearchParams(e);let n={utmSource:t.get("utmSource")||"",utmCampaign:t.get("utmCampaign")||"",utmMedium:t.get("utmMedium")||"",utmTerm:t.get("utmTerm")||"",utmContent:t.get("utmContent")||"",ctk:t.get("ctk")||""};h.utm?Object.keys(n).forEach((e=>{n[e]&&(h.utm[e]=n[e])})):h.utm=n}}}return h.utm}function _(){!function(){try{return"undefined"!=typeof wx&&wx.env&&wx.canIUse}catch(e){return!1}}()?(uni.getSystemInfo({success:function(e){h.uAgent=e.ua;const t=e.uniPlatform;if(t.includes("app"))h.platform=e.osName,h.appData=function(e){let t=plus.runtime.version,n={name:e.appName,version:t||"",carrier:"unknown",packageName:"",ecology:""};if("android"===e.platform){n.carrier="Android";let t="Android",r=plus.android.runtimeMainActivity().getPackageName();e.romName.includes("HarmonyOS")&&(t="Harmony OS",n.carrier="Harmony OS"),n.packageName=r||"",n.ecology=t}else if("ios"===e.platform){let e=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier();n.packageName=e||"",n.carrier="iOS",n.ecology="iOS"}else if("harmonyos"===e.platform){let e=uni.getAppBaseInfo();n.carrier="Harmony OS",n.ecology="Harmony OS",n.version=e.appVersion,n.packageName=e.packageName}else n.ecology="unknown";return n}(e),h.platform="Harmony OS";else if(t.includes("web")||t.includes("h5")){h.platform="web";let t=function(e){let t=e.ua.toLowerCase(),n=window.location.hostname,r=document.title;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t),t.includes("alipay")||t.includes("unionPay")||t.includes("onbuygz")||t.includes("onetravel"),t.includes("micromessenger")&&t.includes("miniprogram"),{name:r||"",packageName:n||"",version:"",carrier:"H5",ecology:"h5"}}(e);h.appData={...t,version:h.version?h.version:"unknown"}}else t.includes("weixin")?(h.platform="weixin",h.appData=function(){const e=uni.getAccountInfoSync(),t=uni.getAppBaseInfo();return{name:t.appName?t.appName:"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}()):console.log("uni get platform getBaseicInfo error ");h.deviceData=function(e){var t;return{lang:e.osLanguage?e.osLanguage:e.hostLanguage,brand:e.deviceBrand?e.deviceBrand+" "+e.deviceModel:e.deviceModel,os:(t=e.osName,"macos"===t.toLowerCase()?"macOS":"harmonyos"===t.toLowerCase()?"Harmony OS":"ios"===t.toLowerCase()?"iOS":"android"===t.toLowerCase()?"Android":"windows"===t.toLowerCase()?"Windows":"linux"===t.toLowerCase()?"Linux":"unknown"),osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:I(e),network:""}}(e)},fail:function(e){h.deviceData={lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}},complete:function(){uni.getNetworkType({success(e){h.deviceData.network=e.networkType}})}}),h.distinctId=uni.getStorageSync(m)||"",h.anonymousId=uni.getStorageSync(y),h.anonymousId||(h.anonymousId=x()),uni.setStorageSync(y,h.anonymousId)):(h.platform=g,h.appData=function(){let e=wx.getAccountInfoSync().miniProgram;return{name:"",packageName:e?e.appId:"",version:e?e.envVersion+e.version:"",carrier:"mini",ecology:"mini"}}(),h.deviceData=function(){const e=wx.getSystemInfoSync();let t={lang:e.language,brand:e.brand+" "+e.model,os:n(e.platform),osVersion:e.system,resolution:e.screenWidth+"x"+e.screenHeight,browser:"",browserVersion:"",color:"",deviceId:"",deviceType:r(e.system),network:""};return wx.getNetworkType({success(e){t.network=e.networkType}}),t}(),h.distinctId=wx.getStorageSync(e)?wx.getStorageSync(e):"",h.anonymousId=o(),h.scene="WX"+wx.getLaunchOptionsSync().scene)}var T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function B(e,t){return e(t={exports:{}},t.exports),t.exports}var N,O=(N=Object.freeze({__proto__:null,default:{}}))&&N.default||N,A=B((function(e,t){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==T&&T.crypto&&(n=T.crypto),!n)try{n=O}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s<o;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new u.init(t,e)}}),c=i.enc={},l=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},f=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},p=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},d=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*c,i);if(c){for(var f=0;f<c;f+=a)this._doProcessBlock(o,f);n=o.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=d.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=i.algo={};return i}(Math),n)})),C=(B((function(e,t){var n;e.exports=(n=A,function(e){var t=n,r=t.lib,o=r.WordArray,i=r.Hasher,a=t.algo,s=[],u=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(s[o]=n(e.pow(r,.5))),u[o]=n(e.pow(r,1/3)),o++),r++}();var c=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],l=n[5],f=n[6],p=n[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var g=c[d-15],m=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,y=c[d-2],h=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;c[d]=m+c[d-7]+h+c[d-16]}var S=r&o^r&i^o&i,w=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),v=p+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&f)+u[d]+c[d];p=f,f=l,l=s,s=a+v|0,a=i,i=o,o=r,r=v+(w+S)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+f|0,n[7]=n[7]+p|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),n.SHA256)})),B((function(e,t){var n,r,o;e.exports=(r=(n=A).lib.Base,o=n.enc.Utf8,void(n.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,u=a.words,c=0;c<n;c++)s[c]^=1549556828,u[c]^=909522486;i.sigBytes=a.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))})),B((function(e,t){e.exports=A.HmacSHA256}))),H=B((function(e){!function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var o=e[r]<<16|e[r+1]<<8|e[r+2],i=0;i<4;i++)8*r+6*i<=8*e.length?n.push(t.charAt(o>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,o=0;r<e.length;o=++r%4)0!=o&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|t.indexOf(e.charAt(r))>>>6-2*o);return n}};e.exports=n}()})),D={utf8:{stringToBytes:function(e){return D.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(D.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},$=D,U=function(e){return null!=e&&(M(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&M(e.slice(0,0))}(e)||!!e._isBuffer)};function M(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var P=B((function(e){!function(){var t=H,n=$.utf8,r=U,o=$.bin,i=function(e,a){e.constructor==String?e=a&&"binary"===a.encoding?o.stringToBytes(e):n.stringToBytes(e):r(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var s=t.bytesToWords(e),u=8*e.length,c=1732584193,l=-271733879,f=-1732584194,p=271733878,d=0;d<s.length;d++)s[d]=16711935&(s[d]<<8|s[d]>>>24)|4278255360&(s[d]<<24|s[d]>>>8);s[u>>>5]|=128<<u%32,s[14+(u+64>>>9<<4)]=u;var g=i._ff,m=i._gg,y=i._hh,h=i._ii;for(d=0;d<s.length;d+=16){var S=c,w=l,v=f,x=p;c=g(c,l,f,p,s[d+0],7,-680876936),p=g(p,c,l,f,s[d+1],12,-389564586),f=g(f,p,c,l,s[d+2],17,606105819),l=g(l,f,p,c,s[d+3],22,-1044525330),c=g(c,l,f,p,s[d+4],7,-176418897),p=g(p,c,l,f,s[d+5],12,1200080426),f=g(f,p,c,l,s[d+6],17,-1473231341),l=g(l,f,p,c,s[d+7],22,-45705983),c=g(c,l,f,p,s[d+8],7,1770035416),p=g(p,c,l,f,s[d+9],12,-1958414417),f=g(f,p,c,l,s[d+10],17,-42063),l=g(l,f,p,c,s[d+11],22,-1990404162),c=g(c,l,f,p,s[d+12],7,1804603682),p=g(p,c,l,f,s[d+13],12,-40341101),f=g(f,p,c,l,s[d+14],17,-1502002290),c=m(c,l=g(l,f,p,c,s[d+15],22,1236535329),f,p,s[d+1],5,-165796510),p=m(p,c,l,f,s[d+6],9,-1069501632),f=m(f,p,c,l,s[d+11],14,643717713),l=m(l,f,p,c,s[d+0],20,-373897302),c=m(c,l,f,p,s[d+5],5,-701558691),p=m(p,c,l,f,s[d+10],9,38016083),f=m(f,p,c,l,s[d+15],14,-660478335),l=m(l,f,p,c,s[d+4],20,-405537848),c=m(c,l,f,p,s[d+9],5,568446438),p=m(p,c,l,f,s[d+14],9,-1019803690),f=m(f,p,c,l,s[d+3],14,-187363961),l=m(l,f,p,c,s[d+8],20,1163531501),c=m(c,l,f,p,s[d+13],5,-1444681467),p=m(p,c,l,f,s[d+2],9,-51403784),f=m(f,p,c,l,s[d+7],14,1735328473),c=y(c,l=m(l,f,p,c,s[d+12],20,-1926607734),f,p,s[d+5],4,-378558),p=y(p,c,l,f,s[d+8],11,-2022574463),f=y(f,p,c,l,s[d+11],16,1839030562),l=y(l,f,p,c,s[d+14],23,-35309556),c=y(c,l,f,p,s[d+1],4,-1530992060),p=y(p,c,l,f,s[d+4],11,1272893353),f=y(f,p,c,l,s[d+7],16,-155497632),l=y(l,f,p,c,s[d+10],23,-1094730640),c=y(c,l,f,p,s[d+13],4,681279174),p=y(p,c,l,f,s[d+0],11,-358537222),f=y(f,p,c,l,s[d+3],16,-722521979),l=y(l,f,p,c,s[d+6],23,76029189),c=y(c,l,f,p,s[d+9],4,-640364487),p=y(p,c,l,f,s[d+12],11,-421815835),f=y(f,p,c,l,s[d+15],16,530742520),c=h(c,l=y(l,f,p,c,s[d+2],23,-995338651),f,p,s[d+0],6,-198630844),p=h(p,c,l,f,s[d+7],10,1126891415),f=h(f,p,c,l,s[d+14],15,-1416354905),l=h(l,f,p,c,s[d+5],21,-57434055),c=h(c,l,f,p,s[d+12],6,1700485571),p=h(p,c,l,f,s[d+3],10,-1894986606),f=h(f,p,c,l,s[d+10],15,-1051523),l=h(l,f,p,c,s[d+1],21,-2054922799),c=h(c,l,f,p,s[d+8],6,1873313359),p=h(p,c,l,f,s[d+15],10,-30611744),f=h(f,p,c,l,s[d+6],15,-1560198380),l=h(l,f,p,c,s[d+13],21,1309151649),c=h(c,l,f,p,s[d+4],6,-145523070),p=h(p,c,l,f,s[d+11],10,-1120210379),f=h(f,p,c,l,s[d+2],15,718787259),l=h(l,f,p,c,s[d+9],21,-343485551),c=c+S>>>0,l=l+w>>>0,f=f+v>>>0,p=p+x>>>0}return t.endian([c,l,f,p])};i._ff=function(e,t,n,r,o,i,a){var s=e+(t&n|~t&r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._gg=function(e,t,n,r,o,i,a){var s=e+(t&r|n&~r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._hh=function(e,t,n,r,o,i,a){var s=e+(t^n^r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._ii=function(e,t,n,r,o,i,a){var s=e+(n^(t|~r))+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._blocksize=16,i._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(i(e,n));return n&&n.asBytes?r:n&&n.asString?o.bytesToString(r):t.bytesToHex(r)}}()}));function L(e,t){if(1===h.encryptType)return P(JSON.stringify(e));if(2===h.encryptType){let n="",r=e[0].trackId;n="event"===t?`&triggerTime=${e[0].triggerTime}`:`&visitTime=${e[0].visitTime}`;let o=`projectId=${h.token}&anonymousId=${h.anonymousId}&trackId=${r}${n}`;return C(o,"jCfeIQH52pMcgNUQoXYA").toString()}}function J(e,t,n){if(!e)return void console.error("please set upload data upType");var r;const o={...(r=t,{app:h.appData,data:r,device:h.deviceData,lsi:"f9b0b43338054e472866a63bd8da14a4#2.0.6",projectId:h.token,userAgent:h.uAgent||"",anonymousId:h.anonymousId,userId:h.distinctId}),dataAbstract:L(t,e)};h.platform===g?wx.request({url:"event"===e?h.upEventUrl:h.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:h.token,projectId:h.token},data:o,success:function(e){e&&e.data&&(n===p?z(t,f):n===d?z(t,c):wx.setStorageSync(n,JSON.stringify(t)))},fail:function(e){console.error(e),wx.setStorageSync(n,JSON.stringify(t))}}):uni.request({url:"event"===e?h.upEventUrl:h.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:h.token,projectId:h.token},data:o,success:function(e){e&&e.data&&(n===p?z(t,f):n===d?z(t,c):uni.setStorageSync(n,JSON.stringify(t)))},fail:function(e){console.log("error: ",e),uni.setStorageSync(n,JSON.stringify(t))}})}function z(e,t){if(h.platform===g){let n=wx.getStorageSync(t),r=(n?JSON.parse(n):[]).concat(e);wx.setStorageSync(t,JSON.stringify(r))}else{let n=uni.getStorageSync(t),r=(n?JSON.parse(n):[]).concat(e);uni.setStorageSync(t,JSON.stringify(r))}}function E(e){const t=e.$page?e.$page:"",n=t.path?t.path:function(){const e=getCurrentPages(),t=e[e.length-1];return t?t.route:"/"}();let r={busSegment:e.$busSegment||0===e.$busSegment?e.$busSegment:"",module:e.$module||0===e.$module?e.$module:"",properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:v(),sceneTag:h.scene,eventId:e.$event_id?e.$event_id:"",event:e.$event_code?e.$event_code:"",utm:k(),duration:null,element:e.$element?e.$element:null,triggerTime:b(Date.now()),page:{domain:t.domain?t.domain:"",url:n||"",path:n||"",title:t.title||"",pageId:P(n)}};r&&(!0===e.$sendMode||!0===e.$send?J("event",[r],p):function(e){let t;t=h.platform===g?wx.getStorageSync(l):uni.getStorageSync(l);let n=t?JSON.parse(t):[];n.push(e),h.platform===g?wx.setStorageSync(l,JSON.stringify(n)):uni.setStorageSync(l,JSON.stringify(n))}(r))}let V,j,R,W,F,K,q,Q;function X(){W&&K&&(Y(s,null),clearInterval(W),W=null,K=null,Q=null)}function Y(e,t){if(e===i)K=null,F=1,V=0,j=Date.now(),R=j,q=x(),K=function(e){const t=getCurrentPages(),n=t[t.length-1];let r=h.platform,o="",i="",a="",s="";if("web"===r||"h5"===r){if(o=window.location.href,i=window.location.hostname,document.referrer){let e=new URL(document.referrer);a=e||"",s=e.hostname||""}}else o=n.route,a=t.length>1?t[t.length-2].route:n.route,i=h.domain?h.domain:n.route;if(n)return{path:n.route,busSegment:e.busSegment||0===e.busSegment?e.busSegment:"",module:e.module||0===e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title?e.title:"",domain:i,url:o,visitPage:t.length,sourceDomain:s,sourceUrl:a,send:e.send||e.sendMode}}(t),Q=K.send,w.push(K.path);else if(e===a)F=2,V=15,R=Date.now();else if(e===s){F=3;let e=Math.max(1,(Date.now()-R)/1e3);V=Math.ceil(e)}let n={busSegment:K.busSegment,module:K.module,properties:K.properties,traceId:"",trackId:v(),sceneTag:h.scene,utm:k(),domain:K.domain,title:K.title,sourceDomain:K.sourceDomain,url:K.url,path:K.path,sourceUrl:K.sourceUrl,duration:V,circulation:F,visitPage:w.length,visitTime:b(j),uid:q};n&&(!0===Q?(delete n.uid,J("track",[n],d)):function(e,t){let n=null;n=h.platform===g?wx.getStorageSync(u):uni.getStorageSync(u);let r=n?JSON.parse(n):[];if(r.length>0){const n=r.findIndex((e=>e.uid===t));-1!==n?r[n]={...r[n],...e}:r.push(e)}else r.push(e);h.platform===g?wx.setStorageSync(u,JSON.stringify(r)):uni.setStorageSync(u,JSON.stringify(r))}(n,q))}let Z=null;function G(e){if(e){const t="test"===e.env?{upEventApi:"https://buryingpoint.gcongo.com.cn/client/api/event",upTrackApi:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListApi:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}:{upEventApi:"https://buryingpoint.onebuygz.com/client/api/event",upTrackApi:"https://buryingpoint.onebuygz.com/client/api/track",eventListApi:"https://buryingpoint.onebuygz.com/api/event/query/eventList"};h.upEventUrl=t.upEventApi,h.upTrackUrl=t.upTrackApi,function(){const e=Date.now().toString();h.trackId=e,h.utm=null,w=[],console.log("tid ",e)}(),Object.assign(h,e),_(),clearInterval(Z),Z=null,Z=setInterval((()=>{!function(){let e=null,t=null,n=[];h.platform===g?(e=wx.getStorageSync(l),wx.setStorageSync(l,""),t=wx.getStorageSync(f),wx.setStorageSync(f,"")):(e=uni.getStorageSync(l),uni.setStorageSync(l,""),t=uni.getStorageSync(f),uni.setStorageSync(f,""));const r=e?JSON.parse(e):[],o=t?JSON.parse(t):[];n.push(...r),n.push(...o),n&&n.length&&J("event",n,f)}(),function(){let e=null,t=null,n=[];h.platform===g?(e=wx.getStorageSync(u),wx.setStorageSync(u,""),t=wx.getStorageSync(c),wx.setStorageSync(c,"")):(e=uni.getStorageSync(u),uni.setStorageSync(u,""),t=uni.getStorageSync(c),uni.setStorageSync(c,""));const r=e?JSON.parse(e):[],o=t?JSON.parse(t):[];n.push(...r),n.push(...o),n&&n.length&&(n.forEach((e=>{delete e.uid})),J("track",n,c))}()}),15e3),h.isCompatible||h.platform}else console.log("init config error, please check config!");"test"===e.env&&console.log("config: ",h)}function ee(e){e?(h.distinctId=e,h.platform===g?wx.setStorageSync(m,e):uni.setStorageSync(m,e)):(h.distinctId="",h.platform===g?wx.setStorageSync(m,e):uni.setStorageSync(m,""))}function te(e){e&&E(e)}function ne(e){var t;e&&(t=e,W&&K&&X(),clearInterval(W),Y(i,t),W=setInterval((()=>{Y(a,null)}),15e3))}function re(){X()}function oe(e){!function(e){const t=getCurrentPages();let n=t[t.length-1];const r=S.findIndex((e=>e.path===n.route));let o={path:n.route,properties:e.properties?JSON.stringify(e.properties):"",busSegment:e.busSegment?e.busSegment:"",module:e.module?e.module:"",title:e.title?e.title:""};-1!==r?S[r]=o:S.push(o)}(e)}function ie(){return v()}function ae(e){var t;t=e,h.utm=t?{utmSource:t.utmSource||"",utmCampaign:t.utmCampaign||"",utmMedium:t.utmMedium||"",utmTerm:t.utmTerm||"",utmContent:t.utmContent||"",ctk:t.ctk||""}:null}function se(){h.utm=null}export{se as clearUtm,ie as getTrackId,G as init,re as onDestroyTrack,ne as onStartTrack,te as setCustomEvent,oe as setPageExtraObj,ee as setUserId,ae as setUtmData};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("md5")):"function"==typeof define&&define.amd?define(["exports","md5"],t):t((e=e||self).BuriedPointUni={},e.MD5)})(this,function(e,r){r=r&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r;let t="v_userId",n="v_anonId";function o(){let e=wx.getStorageSync(n);return e||(e="xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}),wx.setStorageSync(n,e)),e}let i={ENTER:"enter",LOOP:"loop",LEAVE:"leave"},s="UNIBPNPVUVSrcData",u="UNIBPNPVUVFailData",c="UBPNPVUVFailOnce",l="wxMini",a="v_userId",g="v_anonId",p={env:"",domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",appData:null,deviceData:null,distinctId:"",anonymousId:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[]},d=[],m=[];let S=()=>{var e;return p.trackId||(e=Date.now().toString(),p.trackId=e,m=[],e)};function y(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function f(e){e=new Date(e);return e.getFullYear()+`-${e.getMonth()+1<10?"0"+(e.getMonth()+1):e.getMonth()+1}-${e.getDate()<10?"0"+e.getDate():e.getDate()} ${e.getHours()<10?"0"+e.getHours():e.getHours()}:${e.getMinutes()<10?"0"+e.getMinutes():e.getMinutes()}:`+(e.getSeconds()<10?"0"+e.getSeconds():e.getSeconds())}function v(e){return"macos"===e.toLowerCase()?"macOS":"harmonyos"===e.toLowerCase()?"Harmony OS":"ios"===e.toLowerCase()?"iOS":"android"===e.toLowerCase()?"Android":"windows"===e.toLowerCase()?"Windows":"linux"===e.toLowerCase()?"Linux":"unknown"}function w(e){var t;return{lang:e.osLanguage||e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os:v(e.osName),osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:(e=e,"web"===p.platform?(t=e.ua.toLowerCase(),/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)):"pc"===e.deviceType?1:2),network:""}}function x(){if("web"===p.platform){var e=window.location.href;if(e&&!e.includes("file://")&&/^(https?:\/\/[^\s$.?#].[^\s]*)$/i.test(e)){var e=window.location.href.split("?")[1];if(e)return{utmSource:(e=new URLSearchParams(e)).get("utmSource")||"",utmCampaign:e.get("utmCampaign")||"",utmTerm:e.get("utmTerm")||"",utmContent:e.get("utmContent")||"",ctk:e.get("ctk")||""}}}return null}function V(){var e;(()=>{try{return"undefined"!=typeof wx?wx.env&&wx.canIUse:void 0}catch(e){}})()?(p.platform=l,p.appData={name:"",packageName:(e=wx.getAccountInfoSync().miniProgram)?e.appId:"",version:e?e.envVersion+e.version:"",carrier:"mini",ecology:"mini"},p.deviceData=(()=>{var t,e=wx.getSystemInfoSync();let n={lang:e.language,brand:e.brand+" "+e.model,os:v(e.platform),osVersion:e.system,resolution:e.screenWidth+"x"+e.screenHeight,browser:"",browserVersion:"",color:"",deviceId:"",deviceType:(t=e.system,["Windows","Linux","macOS"].every(e=>t.includes(e))?1:2),network:""};return wx.getNetworkType({success(e){n.network=e.networkType}}),n})(),p.distinctId=wx.getStorageSync(t)?wx.getStorageSync(t):"",p.anonymousId=o()):(uni.getSystemInfo({success:function(e){p.uAgent=e.ua;var t,n,o,r=e.uniPlatform;uni.showToast({title:r+"+"+e.osName,icon:"success"}),r.includes("app")?(p.platform=e.osName,p.appData=(t=>{var n=plus.runtime.version,n={name:t.appName,version:n||"",carrier:"unknown",packageName:"",ecology:""};if("android"===t.platform){let e=n.carrier="Android";var o=plus.android.runtimeMainActivity().getPackageName();t.romName.includes("HarmonyOS")&&(e="Harmony OS",n.carrier="Harmony OS"),n.packageName=o||"",n.ecology=e}else"ios"===t.platform?(o=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier(),n.packageName=o||"",n.carrier="iOS",n.ecology="iOS"):"harmonyos"===t.platform?(o=uni.getAppBaseInfo(),n.carrier="Harmony OS",n.ecology="Harmony OS",n.version=o.appVersion,n.packageName=o.packageName):n.ecology="unknown";return n})(e),p.platform="Harmony OS"):r.includes("web")||r.includes("h5")?(p.platform="web",t=(t=e).ua.toLowerCase(),n=window.location.hostname,o=document.title,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t),t.includes("alipay")||t.includes("unionPay")||t.includes("onbuygz")||t.includes("onetravel"),t.includes("micromessenger")&&t.includes("miniprogram"),t={name:o||"",packageName:n||"",version:"",carrier:"H5",ecology:"h5"},p.appData={...t,version:p.version||"unknown"}):r.includes("weixin")?(p.platform="weixin",p.appData=(o=uni.getAccountInfoSync(),{name:uni.getAppBaseInfo().appName||"",packageName:o?o.miniProgram.appId:"",version:o?o.miniProgram.envVersion+o.miniProgram.version:"",carrier:"mini",ecology:"mini"})):console.log("uni get platform getBaseicInfo error "),p.deviceData=w(e)},fail:function(e){p.deviceData={lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}},complete:function(){uni.getNetworkType({success(e){p.deviceData.network=e.networkType}})}}),p.distinctId=uni.getStorageSync(a)||"",p.anonymousId=uni.getStorageSync(g),p.anonymousId||(p.anonymousId=y()),uni.setStorageSync(g,p.anonymousId))}let $="8fbabc22c6ecb742a261e79f879e08ce#2.0.4-alpha.8";function h(e,t,n){var o;e?(o=t,o={...o={app:p.appData,data:o,device:p.deviceData,lsi:$,projectId:p.token,userAgent:p.uAgent||"",anonymousId:p.anonymousId,userId:p.distinctId},dataAbstract:r(JSON.stringify(o))},p.platform===l?wx.request({url:"event"===e?p.upEventUrl:p.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:p.token,projectId:p.token},data:o,success:function(e){e&&e.data?wx.setStorageSync(n,JSON.stringify(t)):wx.setStorageSync(n,"")},fail:function(e){console.error(e),wx.setStorageSync(n,JSON.stringify(t))}}):uni.request({url:"event"===e?p.upEventUrl:p.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:p.token,projectId:p.token},data:o,success:function(e){e&&e.data?uni.setStorageSync(n,JSON.stringify(t)):uni.setStorageSync(n,"")},fail:function(e){console.log("error: ",e),uni.setStorageSync(n,JSON.stringify(t))}})):console.error("please set upload data upType")}let I="UNIBPNEventSrcData",b="UNIBPNEventFailData",k="UBPNEventFailOnce";function J(t){var n=t.$page||"",e=n.path||((e=(e=getCurrentPages())[e.length-1])?e.route:"/"),n={utm:t.$utm||x(),duration:"",element:t.$element||null,eventId:t.$event_id||"",event:t.$event_code||"",groupId:"",busSegment:t.$busSegment||0===t.$busSegment?t.$busSegment:"",module:t.$module||0===t.$module?t.$module:"",page:{domain:n.domain||"",pageId:r(e),path:e||"",title:n.title||"",url:e||""},properties:t.$extend_param?JSON.stringify(t.$extend_param):"",traceId:"",trackId:S(),triggerTime:f(Date.now())};if(1!=t.$sendMode){t=n;let e;var o=(e=(p.platform===l?wx:uni).getStorageSync(I))?JSON.parse(e):[];o.push(t),(p.platform===l?wx:uni).setStorageSync(I,JSON.stringify(o))}else h("event",[n],k)}let N,O,P,D,T,E,A,U;function L(){E&&M(i.LEAVE,null),clearInterval(D),D=null,U=null}function M(t,n){t===i.ENTER?(E=null,A=0,T=1,N=0,O=-1,P=-1,O=Date.now(),P=O,A=y(),E=(e=>{var t=getCurrentPages(),n=t[t.length-1],o=p.platform;let r="",a="",i="",s="";if("web"===o||"h5"===o?(r=window.location.href,a=window.location.hostname,document.referrer&&(o=new URL(document.referrer),i=o||"",s=o.hostname||"")):(r=n.route,i=(1<t.length?t[t.length-2]:n).route,a=p.domain||n.route),n)return{path:n.route,busSegment:e.busSegment||0===e.busSegment?e.busSegment:"",module:e.module||0===e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title||"",domain:a,url:r,visitPage:t.length,sourceDomain:s,sourceUrl:i,sendMode:e.sendMode}})(n),U=E.sendMode,m.push(E.path)):t===i.LOOP?(T=2,N=15,P=Date.now()):t===i.LEAVE&&(T=3,n=Math.max(1,(Date.now()-P)/1e3),N=Math.ceil(n));t={busSegment:E.busSegment,circulation:T,domain:E.domain,duration:N,module:E.module,path:E.path,properties:E.properties,sourceDomain:E.sourceDomain,sourceUrl:E.sourceUrl,title:E.title,traceId:"",trackId:S(),url:E.url,visitPage:m.length,visitTime:f(O),utm:x(),uid:A};if(!0!==U){n=t;var o=A;let e=null;var r,a=(e=(p.platform===l?wx:uni).getStorageSync(s))?JSON.parse(e):[];0<a.length&&-1!==(r=a.findIndex(e=>e.uid===o))?a[r]={...a[r],...n}:a.push(n),(p.platform===l?wx:uni).setStorageSync(s,JSON.stringify(a))}else h("track",[t],c)}let C=null;e.init=function(e){var t;e?(t="test"!==e.env?{upEventApi:"https://buryingpoint.onebuygz.com/client/api/event",upTrackApi:"https://buryingpoint.onebuygz.com/client/api/track",eventListApi:"https://buryingpoint.onebuygz.com/api/event/query/eventList"}:{upEventApi:"https://buryingpoint.gcongo.com.cn/client/api/event",upTrackApi:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListApi:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"},p.upEventUrl=t.upEventApi,p.upTrackUrl=t.upTrackApi,t=Date.now().toString(),p.trackId=t,m=[],console.log("tId ",t),Object.assign(p,e),V(),clearInterval(C),C=null,C=setInterval(()=>{{let e=null,t=null,n=null;var o=[],r=((p.platform===l?(e=wx.getStorageSync(I),wx.setStorageSync(I,""),t=wx.getStorageSync(b),n=wx.getStorageSync(k),wx):(e=uni.getStorageSync(I),uni.setStorageSync(I,""),t=uni.getStorageSync(b),n=uni.getStorageSync(k),uni)).setStorageSync(k,""),e?JSON.parse(e):[]),a=t?JSON.parse(t):[],i=n?JSON.parse(n):[];o.push(...r),o.push(...a),o.push(...i),o&&o.length&&h("event",o,b)}{let e=null,t=null,n=null;r=[],(p.platform===l?(e=wx.getStorageSync(s),wx.setStorageSync(s,""),t=wx.getStorageSync(u),n=wx.getStorageSync(c),wx):(e=uni.getStorageSync(s),uni.setStorageSync(s,""),t=uni.getStorageSync(u),n=uni.getStorageSync(c),uni)).setStorageSync(c,""),a=e?JSON.parse(e):[],i=t?JSON.parse(t):[],o=n?JSON.parse(n):[],r.push(...a),r.push(...o),r.push(...i),r&&r.length&&(r.forEach(e=>{delete e.uid}),h("track",r,u))}},15e3)):console.log("init config error, please check config!")},e.onDestroyTrack=function(){L()},e.onStartTrack=function(e){e=e,D&&L(),e&&(clearInterval(D),M(i.ENTER,e),D=setInterval(()=>{M(i.LOOP,null)},15e3))},e.setCustomEvent=function(e){e&&J(e)},e.setPageExtraObj=function(e){{var n=getCurrentPages();let t=n[n.length-1];n=d.findIndex(e=>e.path===t.route),e={path:t.route,properties:e.properties?JSON.stringify(e.properties):"",busSegment:e.busSegment||"",module:e.module||"",title:e.title||""},-1!==n?d[n]=e:d.push(e)}},e.setUserId=function(e){e?(p.distinctId=e,(p.platform===l?wx:uni).setStorageSync(a,e)):(p.distinctId="",p.platform===l?wx.setStorageSync(a,e):uni.setStorageSync(a,""))},Object.defineProperty(e,"__esModule",{value:!0})});
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).BuriedPointUni={})}(this,(function(e){"use strict";const t="v_userId",n="v_anonId";function r(e){return"macos"===e.toLowerCase()?"macOS":"harmonyos"===e.toLowerCase()?"Harmony OS":"ios"===e.toLowerCase()?"iOS":"android"===e.toLowerCase()?"Android":"windows"===e.toLowerCase()?"Windows":"linux"===e.toLowerCase()?"Linux":"unknown"}function o(e){return["Windows","Linux","macOS"].every((t=>e.includes(t)))?1:2}function i(){let e=wx.getStorageSync(n);return e||(e="xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})),wx.setStorageSync(n,e)),e}const a="enter",s="loop",u="leave",c="UNIBPNPVUVSrcData",l="UNIBPNPVUVFailData",f="UNIBPNEventSrcData",d="UNIBPNEventFailData",p="UBPNOneEventData",g="UBPNOneTrackData",m="wxMini",y="v_userId",h="v_anonId";let S={env:"",domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",appData:null,deviceData:null,distinctId:"",anonymousId:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[],encryptType:2,utm:null,scene:""},w=[],v=[];const x=()=>{if(S.trackId)return S.trackId;const e=Date.now().toString();return S.trackId=e,v=[],e};function b(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function I(e){const t=new Date(e);return`${t.getFullYear()}-${t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1}-${t.getDate()<10?"0"+t.getDate():t.getDate()} ${t.getHours()<10?"0"+t.getHours():t.getHours()}:${t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes()}:${t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds()}`}function k(e){if("web"===S.platform){const t=e.ua.toLowerCase();return/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)}return"pc"===e.deviceType?1:2}function _(){if("web"===S.platform){let e=window.location.href;if(e&&!e.includes("file://")&&/^(https?:\/\/[^\s$.?#].[^\s]*)$/i.test(e)){const e=window.location.href.split("?")[1];if(e){const t=new URLSearchParams(e);let n={utmSource:t.get("utmSource")||"",utmCampaign:t.get("utmCampaign")||"",utmMedium:t.get("utmMedium")||"",utmTerm:t.get("utmTerm")||"",utmContent:t.get("utmContent")||"",ctk:t.get("ctk")||""};S.utm?Object.keys(n).forEach((e=>{n[e]&&(S.utm[e]=n[e])})):S.utm=n}}}return S.utm}function T(){!function(){try{return"undefined"!=typeof wx&&wx.env&&wx.canIUse}catch(e){return!1}}()?(uni.getSystemInfo({success:function(e){S.uAgent=e.ua;const t=e.uniPlatform;if(t.includes("app"))S.platform=e.osName,S.appData=function(e){let t=plus.runtime.version,n={name:e.appName,version:t||"",carrier:"unknown",packageName:"",ecology:""};if("android"===e.platform){n.carrier="Android";let t="Android",r=plus.android.runtimeMainActivity().getPackageName();e.romName.includes("HarmonyOS")&&(t="Harmony OS",n.carrier="Harmony OS"),n.packageName=r||"",n.ecology=t}else if("ios"===e.platform){let e=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier();n.packageName=e||"",n.carrier="iOS",n.ecology="iOS"}else if("harmonyos"===e.platform){let e=uni.getAppBaseInfo();n.carrier="Harmony OS",n.ecology="Harmony OS",n.version=e.appVersion,n.packageName=e.packageName}else n.ecology="unknown";return n}(e),S.platform="Harmony OS";else if(t.includes("web")||t.includes("h5")){S.platform="web";let t=function(e){let t=e.ua.toLowerCase(),n=window.location.hostname,r=document.title;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(t),t.includes("alipay")||t.includes("unionPay")||t.includes("onbuygz")||t.includes("onetravel"),t.includes("micromessenger")&&t.includes("miniprogram"),{name:r||"",packageName:n||"",version:"",carrier:"H5",ecology:"h5"}}(e);S.appData={...t,version:S.version?S.version:"unknown"}}else t.includes("weixin")?(S.platform="weixin",S.appData=function(){const e=uni.getAccountInfoSync(),t=uni.getAppBaseInfo();return{name:t.appName?t.appName:"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}()):console.log("uni get platform getBaseicInfo error ");S.deviceData=function(e){var t;return{lang:e.osLanguage?e.osLanguage:e.hostLanguage,brand:e.deviceBrand?e.deviceBrand+" "+e.deviceModel:e.deviceModel,os:(t=e.osName,"macos"===t.toLowerCase()?"macOS":"harmonyos"===t.toLowerCase()?"Harmony OS":"ios"===t.toLowerCase()?"iOS":"android"===t.toLowerCase()?"Android":"windows"===t.toLowerCase()?"Windows":"linux"===t.toLowerCase()?"Linux":"unknown"),osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:k(e),network:""}}(e)},fail:function(e){S.deviceData={lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}},complete:function(){uni.getNetworkType({success(e){S.deviceData.network=e.networkType}})}}),S.distinctId=uni.getStorageSync(y)||"",S.anonymousId=uni.getStorageSync(h),S.anonymousId||(S.anonymousId=b()),uni.setStorageSync(h,S.anonymousId)):(S.platform=m,S.appData=function(){let e=wx.getAccountInfoSync().miniProgram;return{name:"",packageName:e?e.appId:"",version:e?e.envVersion+e.version:"",carrier:"mini",ecology:"mini"}}(),S.deviceData=function(){const e=wx.getSystemInfoSync();let t={lang:e.language,brand:e.brand+" "+e.model,os:r(e.platform),osVersion:e.system,resolution:e.screenWidth+"x"+e.screenHeight,browser:"",browserVersion:"",color:"",deviceId:"",deviceType:o(e.system),network:""};return wx.getNetworkType({success(e){t.network=e.networkType}}),t}(),S.distinctId=wx.getStorageSync(t)?wx.getStorageSync(t):"",S.anonymousId=i(),S.scene="WX"+wx.getLaunchOptionsSync().scene)}var B="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function O(e,t){return e(t={exports:{}},t.exports),t.exports}var N,A=(N=Object.freeze({__proto__:null,default:{}}))&&N.default||N,C=O((function(e,t){var n;e.exports=(n=n||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==B&&B.crypto&&(n=B.crypto),!n)try{n=A}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),i={},a=i.lib={},s=a.Base={extend:function(e){var t=o(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},u=a.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,o=e.sigBytes;if(this.clamp(),r%4)for(var i=0;i<o;i++){var a=n[i>>>2]>>>24-i%4*8&255;t[r+i>>>2]|=a<<24-(r+i)%4*8}else for(var s=0;s<o;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=o,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new u.init(t,e)}}),c=i.enc={},l=c.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push((i>>>4).toString(16)),r.push((15&i).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new u.init(n,t/2)}},f=c.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o++){var i=t[o>>>2]>>>24-o%4*8&255;r.push(String.fromCharCode(i))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new u.init(n,t)}},d=c.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},p=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,o=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*c,i);if(c){for(var f=0;f<c;f+=a)this._doProcessBlock(o,f);n=o.splice(0,c),r.sigBytes-=l}return new u.init(n,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new g.HMAC.init(e,n).finalize(t)}}});var g=i.algo={};return i}(Math),n)})),D=(O((function(e,t){var n;e.exports=(n=C,function(e){var t=n,r=t.lib,o=r.WordArray,i=r.Hasher,a=t.algo,s=[],u=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,o=0;o<64;)t(r)&&(o<8&&(s[o]=n(e.pow(r,.5))),u[o]=n(e.pow(r,1/3)),o++),r++}();var c=[],l=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],o=n[1],i=n[2],a=n[3],s=n[4],l=n[5],f=n[6],d=n[7],p=0;p<64;p++){if(p<16)c[p]=0|e[t+p];else{var g=c[p-15],m=(g<<25|g>>>7)^(g<<14|g>>>18)^g>>>3,y=c[p-2],h=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;c[p]=m+c[p-7]+h+c[p-16]}var S=r&o^r&i^o&i,w=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),v=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&f)+u[p]+c[p];d=f,f=l,l=s,s=a+v|0,a=i,i=o,o=r,r=v+(w+S)|0}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+i|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+f|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,o=8*t.sigBytes;return n[o>>>5]|=128<<24-o%32,n[14+(o+64>>>9<<4)]=e.floor(r/4294967296),n[15+(o+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=i._createHelper(l),t.HmacSHA256=i._createHmacHelper(l)}(Math),n.SHA256)})),O((function(e,t){var n,r,o;e.exports=(r=(n=C).lib.Base,o=n.enc.Utf8,void(n.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=o.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),a=this._iKey=t.clone(),s=i.words,u=a.words,c=0;c<n;c++)s[c]^=1549556828,u[c]^=909522486;i.sigBytes=a.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))})),O((function(e,t){e.exports=C.HmacSHA256}))),U=O((function(e){!function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var o=e[r]<<16|e[r+1]<<8|e[r+2],i=0;i<4;i++)8*r+6*i<=8*e.length?n.push(t.charAt(o>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,o=0;r<e.length;o=++r%4)0!=o&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|t.indexOf(e.charAt(r))>>>6-2*o);return n}};e.exports=n}()})),H={utf8:{stringToBytes:function(e){return H.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(H.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},P=H,$=function(e){return null!=e&&(M(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&M(e.slice(0,0))}(e)||!!e._isBuffer)};function M(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var L=O((function(e){!function(){var t=U,n=P.utf8,r=$,o=P.bin,i=function(e,a){e.constructor==String?e=a&&"binary"===a.encoding?o.stringToBytes(e):n.stringToBytes(e):r(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var s=t.bytesToWords(e),u=8*e.length,c=1732584193,l=-271733879,f=-1732584194,d=271733878,p=0;p<s.length;p++)s[p]=16711935&(s[p]<<8|s[p]>>>24)|4278255360&(s[p]<<24|s[p]>>>8);s[u>>>5]|=128<<u%32,s[14+(u+64>>>9<<4)]=u;var g=i._ff,m=i._gg,y=i._hh,h=i._ii;for(p=0;p<s.length;p+=16){var S=c,w=l,v=f,x=d;c=g(c,l,f,d,s[p+0],7,-680876936),d=g(d,c,l,f,s[p+1],12,-389564586),f=g(f,d,c,l,s[p+2],17,606105819),l=g(l,f,d,c,s[p+3],22,-1044525330),c=g(c,l,f,d,s[p+4],7,-176418897),d=g(d,c,l,f,s[p+5],12,1200080426),f=g(f,d,c,l,s[p+6],17,-1473231341),l=g(l,f,d,c,s[p+7],22,-45705983),c=g(c,l,f,d,s[p+8],7,1770035416),d=g(d,c,l,f,s[p+9],12,-1958414417),f=g(f,d,c,l,s[p+10],17,-42063),l=g(l,f,d,c,s[p+11],22,-1990404162),c=g(c,l,f,d,s[p+12],7,1804603682),d=g(d,c,l,f,s[p+13],12,-40341101),f=g(f,d,c,l,s[p+14],17,-1502002290),c=m(c,l=g(l,f,d,c,s[p+15],22,1236535329),f,d,s[p+1],5,-165796510),d=m(d,c,l,f,s[p+6],9,-1069501632),f=m(f,d,c,l,s[p+11],14,643717713),l=m(l,f,d,c,s[p+0],20,-373897302),c=m(c,l,f,d,s[p+5],5,-701558691),d=m(d,c,l,f,s[p+10],9,38016083),f=m(f,d,c,l,s[p+15],14,-660478335),l=m(l,f,d,c,s[p+4],20,-405537848),c=m(c,l,f,d,s[p+9],5,568446438),d=m(d,c,l,f,s[p+14],9,-1019803690),f=m(f,d,c,l,s[p+3],14,-187363961),l=m(l,f,d,c,s[p+8],20,1163531501),c=m(c,l,f,d,s[p+13],5,-1444681467),d=m(d,c,l,f,s[p+2],9,-51403784),f=m(f,d,c,l,s[p+7],14,1735328473),c=y(c,l=m(l,f,d,c,s[p+12],20,-1926607734),f,d,s[p+5],4,-378558),d=y(d,c,l,f,s[p+8],11,-2022574463),f=y(f,d,c,l,s[p+11],16,1839030562),l=y(l,f,d,c,s[p+14],23,-35309556),c=y(c,l,f,d,s[p+1],4,-1530992060),d=y(d,c,l,f,s[p+4],11,1272893353),f=y(f,d,c,l,s[p+7],16,-155497632),l=y(l,f,d,c,s[p+10],23,-1094730640),c=y(c,l,f,d,s[p+13],4,681279174),d=y(d,c,l,f,s[p+0],11,-358537222),f=y(f,d,c,l,s[p+3],16,-722521979),l=y(l,f,d,c,s[p+6],23,76029189),c=y(c,l,f,d,s[p+9],4,-640364487),d=y(d,c,l,f,s[p+12],11,-421815835),f=y(f,d,c,l,s[p+15],16,530742520),c=h(c,l=y(l,f,d,c,s[p+2],23,-995338651),f,d,s[p+0],6,-198630844),d=h(d,c,l,f,s[p+7],10,1126891415),f=h(f,d,c,l,s[p+14],15,-1416354905),l=h(l,f,d,c,s[p+5],21,-57434055),c=h(c,l,f,d,s[p+12],6,1700485571),d=h(d,c,l,f,s[p+3],10,-1894986606),f=h(f,d,c,l,s[p+10],15,-1051523),l=h(l,f,d,c,s[p+1],21,-2054922799),c=h(c,l,f,d,s[p+8],6,1873313359),d=h(d,c,l,f,s[p+15],10,-30611744),f=h(f,d,c,l,s[p+6],15,-1560198380),l=h(l,f,d,c,s[p+13],21,1309151649),c=h(c,l,f,d,s[p+4],6,-145523070),d=h(d,c,l,f,s[p+11],10,-1120210379),f=h(f,d,c,l,s[p+2],15,718787259),l=h(l,f,d,c,s[p+9],21,-343485551),c=c+S>>>0,l=l+w>>>0,f=f+v>>>0,d=d+x>>>0}return t.endian([c,l,f,d])};i._ff=function(e,t,n,r,o,i,a){var s=e+(t&n|~t&r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._gg=function(e,t,n,r,o,i,a){var s=e+(t&r|n&~r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._hh=function(e,t,n,r,o,i,a){var s=e+(t^n^r)+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._ii=function(e,t,n,r,o,i,a){var s=e+(n^(t|~r))+(o>>>0)+a;return(s<<i|s>>>32-i)+t},i._blocksize=16,i._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(i(e,n));return n&&n.asBytes?r:n&&n.asString?o.bytesToString(r):t.bytesToHex(r)}}()}));function J(e,t){if(1===S.encryptType)return L(JSON.stringify(e));if(2===S.encryptType){let n="",r=e[0].trackId;n="event"===t?`&triggerTime=${e[0].triggerTime}`:`&visitTime=${e[0].visitTime}`;let o=`projectId=${S.token}&anonymousId=${S.anonymousId}&trackId=${r}${n}`;return D(o,"jCfeIQH52pMcgNUQoXYA").toString()}}function z(e,t,n){if(!e)return void console.error("please set upload data upType");var r;const o={...(r=t,{app:S.appData,data:r,device:S.deviceData,lsi:"f9b0b43338054e472866a63bd8da14a4#2.0.6",projectId:S.token,userAgent:S.uAgent||"",anonymousId:S.anonymousId,userId:S.distinctId}),dataAbstract:J(t,e)};S.platform===m?wx.request({url:"event"===e?S.upEventUrl:S.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:S.token,projectId:S.token},data:o,success:function(e){e&&e.data&&(n===p?E(t,d):n===g?E(t,l):wx.setStorageSync(n,JSON.stringify(t)))},fail:function(e){console.error(e),wx.setStorageSync(n,JSON.stringify(t))}}):uni.request({url:"event"===e?S.upEventUrl:S.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:S.token,projectId:S.token},data:o,success:function(e){e&&e.data&&(n===p?E(t,d):n===g?E(t,l):uni.setStorageSync(n,JSON.stringify(t)))},fail:function(e){console.log("error: ",e),uni.setStorageSync(n,JSON.stringify(t))}})}function E(e,t){if(S.platform===m){let n=wx.getStorageSync(t),r=(n?JSON.parse(n):[]).concat(e);wx.setStorageSync(t,JSON.stringify(r))}else{let n=uni.getStorageSync(t),r=(n?JSON.parse(n):[]).concat(e);uni.setStorageSync(t,JSON.stringify(r))}}function j(e){const t=e.$page?e.$page:"",n=t.path?t.path:function(){const e=getCurrentPages(),t=e[e.length-1];return t?t.route:"/"}();let r={busSegment:e.$busSegment||0===e.$busSegment?e.$busSegment:"",module:e.$module||0===e.$module?e.$module:"",properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:x(),sceneTag:S.scene,eventId:e.$event_id?e.$event_id:"",event:e.$event_code?e.$event_code:"",utm:_(),duration:null,element:e.$element?e.$element:null,triggerTime:I(Date.now()),page:{domain:t.domain?t.domain:"",url:n||"",path:n||"",title:t.title||"",pageId:L(n)}};r&&(!0===e.$sendMode||!0===e.$send?z("event",[r],p):function(e){let t;t=S.platform===m?wx.getStorageSync(f):uni.getStorageSync(f);let n=t?JSON.parse(t):[];n.push(e),S.platform===m?wx.setStorageSync(f,JSON.stringify(n)):uni.setStorageSync(f,JSON.stringify(n))}(r))}let V,R,W,F,K,q,Q,X;function Y(){F&&q&&(Z(u,null),clearInterval(F),F=null,q=null,X=null)}function Z(e,t){if(e===a)q=null,K=1,V=0,R=Date.now(),W=R,Q=b(),q=function(e){const t=getCurrentPages(),n=t[t.length-1];let r=S.platform,o="",i="",a="",s="";if("web"===r||"h5"===r){if(o=window.location.href,i=window.location.hostname,document.referrer){let e=new URL(document.referrer);a=e||"",s=e.hostname||""}}else o=n.route,a=t.length>1?t[t.length-2].route:n.route,i=S.domain?S.domain:n.route;if(n)return{path:n.route,busSegment:e.busSegment||0===e.busSegment?e.busSegment:"",module:e.module||0===e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title?e.title:"",domain:i,url:o,visitPage:t.length,sourceDomain:s,sourceUrl:a,send:e.send||e.sendMode}}(t),X=q.send,v.push(q.path);else if(e===s)K=2,V=15,W=Date.now();else if(e===u){K=3;let e=Math.max(1,(Date.now()-W)/1e3);V=Math.ceil(e)}let n={busSegment:q.busSegment,module:q.module,properties:q.properties,traceId:"",trackId:x(),sceneTag:S.scene,utm:_(),domain:q.domain,title:q.title,sourceDomain:q.sourceDomain,url:q.url,path:q.path,sourceUrl:q.sourceUrl,duration:V,circulation:K,visitPage:v.length,visitTime:I(R),uid:Q};n&&(!0===X?(delete n.uid,z("track",[n],g)):function(e,t){let n=null;n=S.platform===m?wx.getStorageSync(c):uni.getStorageSync(c);let r=n?JSON.parse(n):[];if(r.length>0){const n=r.findIndex((e=>e.uid===t));-1!==n?r[n]={...r[n],...e}:r.push(e)}else r.push(e);S.platform===m?wx.setStorageSync(c,JSON.stringify(r)):uni.setStorageSync(c,JSON.stringify(r))}(n,Q))}let G=null;e.clearUtm=function(){S.utm=null},e.getTrackId=function(){return x()},e.init=function(e){if(e){const t="test"===e.env?{upEventApi:"https://buryingpoint.gcongo.com.cn/client/api/event",upTrackApi:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListApi:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}:{upEventApi:"https://buryingpoint.onebuygz.com/client/api/event",upTrackApi:"https://buryingpoint.onebuygz.com/client/api/track",eventListApi:"https://buryingpoint.onebuygz.com/api/event/query/eventList"};S.upEventUrl=t.upEventApi,S.upTrackUrl=t.upTrackApi,function(){const e=Date.now().toString();S.trackId=e,S.utm=null,v=[],console.log("tid ",e)}(),Object.assign(S,e),T(),clearInterval(G),G=null,G=setInterval((()=>{!function(){let e=null,t=null,n=[];S.platform===m?(e=wx.getStorageSync(f),wx.setStorageSync(f,""),t=wx.getStorageSync(d),wx.setStorageSync(d,"")):(e=uni.getStorageSync(f),uni.setStorageSync(f,""),t=uni.getStorageSync(d),uni.setStorageSync(d,""));const r=e?JSON.parse(e):[],o=t?JSON.parse(t):[];n.push(...r),n.push(...o),n&&n.length&&z("event",n,d)}(),function(){let e=null,t=null,n=[];S.platform===m?(e=wx.getStorageSync(c),wx.setStorageSync(c,""),t=wx.getStorageSync(l),wx.setStorageSync(l,"")):(e=uni.getStorageSync(c),uni.setStorageSync(c,""),t=uni.getStorageSync(l),uni.setStorageSync(l,""));const r=e?JSON.parse(e):[],o=t?JSON.parse(t):[];n.push(...r),n.push(...o),n&&n.length&&(n.forEach((e=>{delete e.uid})),z("track",n,l))}()}),15e3),S.isCompatible||S.platform}else console.log("init config error, please check config!");"test"===e.env&&console.log("config: ",S)},e.onDestroyTrack=function(){Y()},e.onStartTrack=function(e){var t;e&&(t=e,F&&q&&Y(),clearInterval(F),Z(a,t),F=setInterval((()=>{Z(s,null)}),15e3))},e.setCustomEvent=function(e){e&&j(e)},e.setPageExtraObj=function(e){!function(e){const t=getCurrentPages();let n=t[t.length-1];const r=w.findIndex((e=>e.path===n.route));let o={path:n.route,properties:e.properties?JSON.stringify(e.properties):"",busSegment:e.busSegment?e.busSegment:"",module:e.module?e.module:"",title:e.title?e.title:""};-1!==r?w[r]=o:w.push(o)}(e)},e.setUserId=function(e){e?(S.distinctId=e,S.platform===m?wx.setStorageSync(y,e):uni.setStorageSync(y,e)):(S.distinctId="",S.platform===m?wx.setStorageSync(y,e):uni.setStorageSync(y,""))},e.setUtmData=function(e){var t;t=e,S.utm=t?{utmSource:t.utmSource||"",utmCampaign:t.utmCampaign||"",utmMedium:t.utmMedium||"",utmTerm:t.utmTerm||"",utmContent:t.utmContent||"",ctk:t.ctk||""}:null},Object.defineProperty(e,"__esModule",{value:!0})}));
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visual-buried-point-platform-uni",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"lsi": "
|
|
3
|
+
"version": "2.0.6",
|
|
4
|
+
"lsi": "f9b0b43338054e472866a63bd8da14a4#2.0.6",
|
|
5
5
|
"description": "To make it easy for you to get started with GitLab, here's a list of recommended next steps.",
|
|
6
6
|
"main": "dist/cjs/buried-point-uni.js",
|
|
7
7
|
"module": "dist/esm/buried-point-uni.js",
|
|
8
8
|
"umd:main": "dist/umd/buried-point-uni.js",
|
|
9
9
|
"scripts": {
|
|
10
|
-
"build": "rimraf dist && rollup -c --environment INCLUDE_DEPS,BUILD:production
|
|
10
|
+
"build": "rimraf dist && node lsi-md5.js && rollup -c --environment INCLUDE_DEPS,BUILD:production"
|
|
11
11
|
},
|
|
12
12
|
"type": "module",
|
|
13
13
|
"files": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"peerDependencies": {
|
|
24
|
-
"crypto-js": "4.2.0",
|
|
24
|
+
"crypto-js": "^4.2.0",
|
|
25
25
|
"md5": "2.3.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
@@ -30,15 +30,17 @@
|
|
|
30
30
|
"@rollup/plugin-json": "^6.0.1",
|
|
31
31
|
"babel-loader": "^10.0.0",
|
|
32
32
|
"babel-preset-es2015": "^6.24.1",
|
|
33
|
+
"crypto-js": "^4.2.0",
|
|
34
|
+
"md5": "2.3.0",
|
|
33
35
|
"rimraf": "^6.0.1",
|
|
34
|
-
"rollup": "
|
|
36
|
+
"rollup": "2.79.2",
|
|
37
|
+
"rollup-plugin-analyzer": "^4.0.0",
|
|
35
38
|
"rollup-plugin-babel": "^4.3.3",
|
|
36
39
|
"rollup-plugin-commonjs": "^10.0.2",
|
|
37
40
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
38
41
|
"rollup-plugin-replace": "^2.2.0",
|
|
39
|
-
"rollup-plugin-
|
|
42
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
40
43
|
"webpack": "^5.72.1",
|
|
41
|
-
"webpack-cli": "^6.0.1"
|
|
42
|
-
"md5": "2.3.0"
|
|
44
|
+
"webpack-cli": "^6.0.1"
|
|
43
45
|
}
|
|
44
46
|
}
|