visual-buried-point-platform-uni 2.0.4-alpha.10 → 2.0.4-alpha.11

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.
@@ -1 +1 @@
1
- var name="visual-buried-point-platform-uni",version="2.0.4-alpha.10",lsi="7c500d1dfad15a8f4f3db8e78978a6da#2.0.4-alpha.9",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 n={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){n.network=e.networkType}}),n}function getWxMiniDeviceType(n){return["Windows","Linux","macOS"].every(e=>n.includes(e))?1:2}function randomUUID(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var n=16*Math.random()|0;return("x"===e?n:3&n|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 n=16*Math.random()|0;return("x"===e?n:3&n|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(),n=window.location.hostname,t=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:t||"",packageName:n||"",version:"",carrier:"H5",ecology:"h5"}}function getUniWXInfo(){var e=uni.getAccountInfoSync(),n=uni.getAppBaseInfo();return{name:n.appName||"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}function getUniAppInfo(n){var t=plus.runtime.version,t={name:n.appName,version:t||"",carrier:"unknown",packageName:"",ecology:""};if("android"===n.platform){let e=t.carrier="Android";var r=plus.android.runtimeMainActivity().getPackageName();n.romName.includes("HarmonyOS")&&(e="Harmony OS",t.carrier="Harmony OS"),t.packageName=r||"",t.ecology=e}else"ios"===n.platform?(r=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier(),t.packageName=r||"",t.carrier="iOS",t.ecology="iOS"):"harmonyos"===n.platform?(r=uni.getAppBaseInfo(),t.carrier="Harmony OS",t.ecology="Harmony OS",t.version=r.appVersion,t.packageName=r.packageName):t.ecology="unknown";return t}function getCurDeviceType(e){var n;return"web"===Global.platform?(n=e.ua.toLowerCase(),/(windows|win32|win64|wow64)/.test(n)?1:(/(linux|android)/.test(n)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(n),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 n=getCurrentPages(),t=n[n.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=t.route,i=(1<n.length?n[n.length-2]:t).route,a=Global.domain||t.route),t)return{path:t.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:n.length,sourceDomain:l,sourceUrl:i,sendMode:e.sendMode}}function uUpdatePageExtraArray(e){var n=getCurrentPages();let t=n[n.length-1];n=pagesArray.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?pagesArray[n]=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,n){let t=null;var r,o=(t=(Global.platform===wxMini?wx:uni).getStorageSync(BPNPVUV))?JSON.parse(t):[];0<o.length&&-1!==(r=o.findIndex(e=>e.uid===n))?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 n,t=e.uniPlatform;uni.showToast({title:t+"+"+e.osName,icon:"success"}),t.includes("app")?(Global.platform=e.osName,Global.appData=getUniAppInfo(e),Global.platform="Harmony OS"):t.includes("web")||t.includes("h5")?(Global.platform="web",n=getUniWebH5Info(e),Global.appData={...n,version:Global.version||"unknown"}):t.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))}function createCommonjsModule(e,n){return e(n={exports:{}},n.exports),n.exports}var crypt=createCommonjsModule(function(e){var a,t;a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(e,n){return e<<n|e>>>32-n},rotr:function(e,n){return e<<32-n|e>>>n},endian:function(e){if(e.constructor==Number)return 16711935&t.rotl(e,8)|4278255360&t.rotl(e,24);for(var n=0;n<e.length;n++)e[n]=t.endian(e[n]);return e},randomBytes:function(e){for(var n=[];0<e;e--)n.push(Math.floor(256*Math.random()));return n},bytesToWords:function(e){for(var n=[],t=0,r=0;t<e.length;t++,r+=8)n[r>>>5]|=e[t]<<24-r%32;return n},wordsToBytes:function(e){for(var n=[],t=0;t<32*e.length;t+=8)n.push(e[t>>>5]>>>24-t%32&255);return n},bytesToHex:function(e){for(var n=[],t=0;t<e.length;t++)n.push((e[t]>>>4).toString(16)),n.push((15&e[t]).toString(16));return n.join("")},hexToBytes:function(e){for(var n=[],t=0;t<e.length;t+=2)n.push(parseInt(e.substr(t,2),16));return n},bytesToBase64:function(e){for(var n=[],t=0;t<e.length;t+=3)for(var r=e[t]<<16|e[t+1]<<8|e[t+2],o=0;o<4;o++)8*t+6*o<=8*e.length?n.push(a.charAt(r>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],t=0,r=0;t<e.length;r=++t%4)0!=r&&n.push((a.indexOf(e.charAt(t-1))&Math.pow(2,-2*r+8)-1)<<2*r|a.indexOf(e.charAt(t))>>>6-2*r);return n}},e.exports=t}),charenc={utf8:{stringToBytes:function(e){return charenc.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(charenc.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var n=[],t=0;t<e.length;t++)n.push(255&e.charCodeAt(t));return n},bytesToString:function(e){for(var n=[],t=0;t<e.length;t++)n.push(String.fromCharCode(e[t]));return n.join("")}}},charenc_1=charenc,isBuffer_1=function(e){return null!=e&&(isBuffer(e)||isSlowBuffer(e)||!!e._isBuffer)};function isBuffer(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&isBuffer(e.slice(0,0))}var md5=createCommonjsModule(function(e){function y(e,n){e.constructor==String?e=(n&&"binary"===n.encoding?I:S).stringToBytes(e):b(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var t=v.bytesToWords(e),n=8*e.length,r=1732584193,o=-271733879,a=-1732584194,i=271733878,l=0;l<t.length;l++)t[l]=16711935&(t[l]<<8|t[l]>>>24)|4278255360&(t[l]<<24|t[l]>>>8);t[n>>>5]|=128<<n%32,t[14+(64+n>>>9<<4)]=n;for(var s=y._ff,u=y._gg,c=y._hh,g=y._ii,l=0;l<t.length;l+=16){var p=r,d=o,m=a,f=i,r=s(r,o,a,i,t[l+0],7,-680876936),i=s(i,r,o,a,t[l+1],12,-389564586),a=s(a,i,r,o,t[l+2],17,606105819),o=s(o,a,i,r,t[l+3],22,-1044525330);r=s(r,o,a,i,t[l+4],7,-176418897),i=s(i,r,o,a,t[l+5],12,1200080426),a=s(a,i,r,o,t[l+6],17,-1473231341),o=s(o,a,i,r,t[l+7],22,-45705983),r=s(r,o,a,i,t[l+8],7,1770035416),i=s(i,r,o,a,t[l+9],12,-1958414417),a=s(a,i,r,o,t[l+10],17,-42063),o=s(o,a,i,r,t[l+11],22,-1990404162),r=s(r,o,a,i,t[l+12],7,1804603682),i=s(i,r,o,a,t[l+13],12,-40341101),a=s(a,i,r,o,t[l+14],17,-1502002290),r=u(r,o=s(o,a,i,r,t[l+15],22,1236535329),a,i,t[l+1],5,-165796510),i=u(i,r,o,a,t[l+6],9,-1069501632),a=u(a,i,r,o,t[l+11],14,643717713),o=u(o,a,i,r,t[l+0],20,-373897302),r=u(r,o,a,i,t[l+5],5,-701558691),i=u(i,r,o,a,t[l+10],9,38016083),a=u(a,i,r,o,t[l+15],14,-660478335),o=u(o,a,i,r,t[l+4],20,-405537848),r=u(r,o,a,i,t[l+9],5,568446438),i=u(i,r,o,a,t[l+14],9,-1019803690),a=u(a,i,r,o,t[l+3],14,-187363961),o=u(o,a,i,r,t[l+8],20,1163531501),r=u(r,o,a,i,t[l+13],5,-1444681467),i=u(i,r,o,a,t[l+2],9,-51403784),a=u(a,i,r,o,t[l+7],14,1735328473),r=c(r,o=u(o,a,i,r,t[l+12],20,-1926607734),a,i,t[l+5],4,-378558),i=c(i,r,o,a,t[l+8],11,-2022574463),a=c(a,i,r,o,t[l+11],16,1839030562),o=c(o,a,i,r,t[l+14],23,-35309556),r=c(r,o,a,i,t[l+1],4,-1530992060),i=c(i,r,o,a,t[l+4],11,1272893353),a=c(a,i,r,o,t[l+7],16,-155497632),o=c(o,a,i,r,t[l+10],23,-1094730640),r=c(r,o,a,i,t[l+13],4,681279174),i=c(i,r,o,a,t[l+0],11,-358537222),a=c(a,i,r,o,t[l+3],16,-722521979),o=c(o,a,i,r,t[l+6],23,76029189),r=c(r,o,a,i,t[l+9],4,-640364487),i=c(i,r,o,a,t[l+12],11,-421815835),a=c(a,i,r,o,t[l+15],16,530742520),r=g(r,o=c(o,a,i,r,t[l+2],23,-995338651),a,i,t[l+0],6,-198630844),i=g(i,r,o,a,t[l+7],10,1126891415),a=g(a,i,r,o,t[l+14],15,-1416354905),o=g(o,a,i,r,t[l+5],21,-57434055),r=g(r,o,a,i,t[l+12],6,1700485571),i=g(i,r,o,a,t[l+3],10,-1894986606),a=g(a,i,r,o,t[l+10],15,-1051523),o=g(o,a,i,r,t[l+1],21,-2054922799),r=g(r,o,a,i,t[l+8],6,1873313359),i=g(i,r,o,a,t[l+15],10,-30611744),a=g(a,i,r,o,t[l+6],15,-1560198380),o=g(o,a,i,r,t[l+13],21,1309151649),r=g(r,o,a,i,t[l+4],6,-145523070),i=g(i,r,o,a,t[l+11],10,-1120210379),a=g(a,i,r,o,t[l+2],15,718787259),o=g(o,a,i,r,t[l+9],21,-343485551),r=r+p>>>0,o=o+d>>>0,a=a+m>>>0,i=i+f>>>0}return v.endian([r,o,a,i])}var v,S,b,I;v=crypt,S=charenc_1.utf8,b=isBuffer_1,I=charenc_1.bin,y._ff=function(e,n,t,r,o,a,i){e=e+(n&t|~n&r)+(o>>>0)+i;return(e<<a|e>>>32-a)+n},y._gg=function(e,n,t,r,o,a,i){e=e+(n&r|t&~r)+(o>>>0)+i;return(e<<a|e>>>32-a)+n},y._hh=function(e,n,t,r,o,a,i){e=e+(n^t^r)+(o>>>0)+i;return(e<<a|e>>>32-a)+n},y._ii=function(e,n,t,r,o,a,i){e=e+(t^(n|~r))+(o>>>0)+i;return(e<<a|e>>>32-a)+n},y._blocksize=16,y._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);e=v.wordsToBytes(y(e,n));return n&&n.asBytes?e:n&&n.asString?I.bytesToString(e):v.bytesToHex(e)}});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,n,t){var r;e?(r={...r=commonData(n),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(t,JSON.stringify(n)):wx.setStorageSync(t,"")},fail:function(e){console.error(e),wx.setStorageSync(t,JSON.stringify(n))}}):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(t,JSON.stringify(n)):uni.setStorageSync(t,"")},fail:function(e){console.log("error: ",e),uni.setStorageSync(t,JSON.stringify(n))}})):console.error("please set upload data upType")}function queryTrackDataUpload(){let e=null,n=null,t=null;var r=[],o=((Global.platform===wxMini?(e=wx.getStorageSync(BPNPVUV),wx.setStorageSync(BPNPVUV,""),n=wx.getStorageSync(BPNPVUVFail),t=wx.getStorageSync(BPNPVUVFailOnce),wx):(e=uni.getStorageSync(BPNPVUV),uni.setStorageSync(BPNPVUV,""),n=uni.getStorageSync(BPNPVUVFail),t=uni.getStorageSync(BPNPVUVFailOnce),uni)).setStorageSync(BPNPVUVFailOnce,""),e?JSON.parse(e):[]),a=n?JSON.parse(n):[],i=t?JSON.parse(t):[];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 n=e.$page||"",t=n.path||getCurPath(),n={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:n.domain||"",pageId:md5(t),path:t||"",title:n.title||"",url:t||""},properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:sdkTrackIdVal(),triggerTime:timeToStr(Date.now())};1==e.$sendMode?reportTrackEventServer("event",[n],BPNEventFailOnce):insertEventData(n)}function insertEventData(e){let n;var t=(n=(Global.platform===wxMini?wx:uni).getStorageSync(BPNEvent))?JSON.parse(n):[];t.push(e),(Global.platform===wxMini?wx:uni).setStorageSync(BPNEvent,JSON.stringify(t))}function queryEventDataUpload(){let e=null,n=null,t=null;var r=[],o=((Global.platform===wxMini?(e=wx.getStorageSync(BPNEvent),wx.setStorageSync(BPNEvent,""),n=wx.getStorageSync(BPNEventFail),t=wx.getStorageSync(BPNEventFailOnce),wx):(e=uni.getStorageSync(BPNEvent),uni.setStorageSync(BPNEvent,""),n=uni.getStorageSync(BPNEventFail),t=uni.getStorageSync(BPNEventFailOnce),uni)).setStorageSync(BPNEventFailOnce,""),e?JSON.parse(e):[]),a=n?JSON.parse(n):[],i=t?JSON.parse(t):[];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,n){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(n),sMode=mObj.sendMode,visPagesArr.push(mObj.path)):e===AUTOTRACKTYPE.LOOP?(cirtemp=2,startTime=15,loopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp=3,n=Math.max(1,(Date.now()-loopTimeLong)/1e3),startTime=Math.ceil(n));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 n;e?(n=setReportUrl(e.env),Global.upEventUrl=n.upEventApi,Global.upTrackUrl=n.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
+ var name="visual-buried-point-platform-uni",version="2.0.4-alpha.11",lsi="86b99e09669cf6b01d95f06a8856db7c#2.0.4-alpha.10",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 n={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){n.network=e.networkType}}),n}function getWxMiniDeviceType(n){return["Windows","Linux","macOS"].every(e=>n.includes(e))?1:2}function randomUUID(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var n=16*Math.random()|0;return("x"===e?n:3&n|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 n=16*Math.random()|0;return("x"===e?n:3&n|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(),n=window.location.hostname,t=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:t||"",packageName:n||"",version:"",carrier:"H5",ecology:"h5"}}function getUniWXInfo(){var e=uni.getAccountInfoSync(),n=uni.getAppBaseInfo();return{name:n.appName||"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}function getUniAppInfo(n){var t=plus.runtime.version,t={name:n.appName,version:t||"",carrier:"unknown",packageName:"",ecology:""};if("android"===n.platform){let e=t.carrier="Android";var r=plus.android.runtimeMainActivity().getPackageName();n.romName.includes("HarmonyOS")&&(e="Harmony OS",t.carrier="Harmony OS"),t.packageName=r||"",t.ecology=e}else"ios"===n.platform?(r=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier(),t.packageName=r||"",t.carrier="iOS",t.ecology="iOS"):"harmonyos"===n.platform?(r=uni.getAppBaseInfo(),t.carrier="Harmony OS",t.ecology="Harmony OS",t.version=r.appVersion,t.packageName=r.packageName):t.ecology="unknown";return t}function getCurDeviceType(e){var n;return"web"===Global.platform?(n=e.ua.toLowerCase(),/(windows|win32|win64|wow64)/.test(n)?1:(/(linux|android)/.test(n)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(n),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 n=getCurrentPages(),t=n[n.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=t.route,i=(1<n.length?n[n.length-2]:t).route,a=Global.domain||t.route),t)return{path:t.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:n.length,sourceDomain:l,sourceUrl:i,sendMode:e.sendMode}}function uUpdatePageExtraArray(e){var n=getCurrentPages();let t=n[n.length-1];n=pagesArray.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?pagesArray[n]=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,n){let t=null;var r,o=(t=(Global.platform===wxMini?wx:uni).getStorageSync(BPNPVUV))?JSON.parse(t):[];0<o.length&&-1!==(r=o.findIndex(e=>e.uid===n))?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 n,t=e.uniPlatform;t.includes("app")?(Global.platform=e.osName,Global.appData=getUniAppInfo(e),Global.platform="Harmony OS"):t.includes("web")||t.includes("h5")?(Global.platform="web",n=getUniWebH5Info(e),Global.appData={...n,version:Global.version||"unknown"}):t.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))}function createCommonjsModule(e,n){return e(n={exports:{}},n.exports),n.exports}var crypt=createCommonjsModule(function(e){var a,t;a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t={rotl:function(e,n){return e<<n|e>>>32-n},rotr:function(e,n){return e<<32-n|e>>>n},endian:function(e){if(e.constructor==Number)return 16711935&t.rotl(e,8)|4278255360&t.rotl(e,24);for(var n=0;n<e.length;n++)e[n]=t.endian(e[n]);return e},randomBytes:function(e){for(var n=[];0<e;e--)n.push(Math.floor(256*Math.random()));return n},bytesToWords:function(e){for(var n=[],t=0,r=0;t<e.length;t++,r+=8)n[r>>>5]|=e[t]<<24-r%32;return n},wordsToBytes:function(e){for(var n=[],t=0;t<32*e.length;t+=8)n.push(e[t>>>5]>>>24-t%32&255);return n},bytesToHex:function(e){for(var n=[],t=0;t<e.length;t++)n.push((e[t]>>>4).toString(16)),n.push((15&e[t]).toString(16));return n.join("")},hexToBytes:function(e){for(var n=[],t=0;t<e.length;t+=2)n.push(parseInt(e.substr(t,2),16));return n},bytesToBase64:function(e){for(var n=[],t=0;t<e.length;t+=3)for(var r=e[t]<<16|e[t+1]<<8|e[t+2],o=0;o<4;o++)8*t+6*o<=8*e.length?n.push(a.charAt(r>>>6*(3-o)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],t=0,r=0;t<e.length;r=++t%4)0!=r&&n.push((a.indexOf(e.charAt(t-1))&Math.pow(2,-2*r+8)-1)<<2*r|a.indexOf(e.charAt(t))>>>6-2*r);return n}},e.exports=t}),charenc={utf8:{stringToBytes:function(e){return charenc.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(charenc.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var n=[],t=0;t<e.length;t++)n.push(255&e.charCodeAt(t));return n},bytesToString:function(e){for(var n=[],t=0;t<e.length;t++)n.push(String.fromCharCode(e[t]));return n.join("")}}},charenc_1=charenc,isBuffer_1=function(e){return null!=e&&(isBuffer(e)||isSlowBuffer(e)||!!e._isBuffer)};function isBuffer(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function isSlowBuffer(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&isBuffer(e.slice(0,0))}var md5=createCommonjsModule(function(e){function y(e,n){e.constructor==String?e=(n&&"binary"===n.encoding?I:S).stringToBytes(e):b(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var t=v.bytesToWords(e),n=8*e.length,r=1732584193,o=-271733879,a=-1732584194,i=271733878,l=0;l<t.length;l++)t[l]=16711935&(t[l]<<8|t[l]>>>24)|4278255360&(t[l]<<24|t[l]>>>8);t[n>>>5]|=128<<n%32,t[14+(64+n>>>9<<4)]=n;for(var s=y._ff,u=y._gg,c=y._hh,g=y._ii,l=0;l<t.length;l+=16){var p=r,d=o,m=a,f=i,r=s(r,o,a,i,t[l+0],7,-680876936),i=s(i,r,o,a,t[l+1],12,-389564586),a=s(a,i,r,o,t[l+2],17,606105819),o=s(o,a,i,r,t[l+3],22,-1044525330);r=s(r,o,a,i,t[l+4],7,-176418897),i=s(i,r,o,a,t[l+5],12,1200080426),a=s(a,i,r,o,t[l+6],17,-1473231341),o=s(o,a,i,r,t[l+7],22,-45705983),r=s(r,o,a,i,t[l+8],7,1770035416),i=s(i,r,o,a,t[l+9],12,-1958414417),a=s(a,i,r,o,t[l+10],17,-42063),o=s(o,a,i,r,t[l+11],22,-1990404162),r=s(r,o,a,i,t[l+12],7,1804603682),i=s(i,r,o,a,t[l+13],12,-40341101),a=s(a,i,r,o,t[l+14],17,-1502002290),r=u(r,o=s(o,a,i,r,t[l+15],22,1236535329),a,i,t[l+1],5,-165796510),i=u(i,r,o,a,t[l+6],9,-1069501632),a=u(a,i,r,o,t[l+11],14,643717713),o=u(o,a,i,r,t[l+0],20,-373897302),r=u(r,o,a,i,t[l+5],5,-701558691),i=u(i,r,o,a,t[l+10],9,38016083),a=u(a,i,r,o,t[l+15],14,-660478335),o=u(o,a,i,r,t[l+4],20,-405537848),r=u(r,o,a,i,t[l+9],5,568446438),i=u(i,r,o,a,t[l+14],9,-1019803690),a=u(a,i,r,o,t[l+3],14,-187363961),o=u(o,a,i,r,t[l+8],20,1163531501),r=u(r,o,a,i,t[l+13],5,-1444681467),i=u(i,r,o,a,t[l+2],9,-51403784),a=u(a,i,r,o,t[l+7],14,1735328473),r=c(r,o=u(o,a,i,r,t[l+12],20,-1926607734),a,i,t[l+5],4,-378558),i=c(i,r,o,a,t[l+8],11,-2022574463),a=c(a,i,r,o,t[l+11],16,1839030562),o=c(o,a,i,r,t[l+14],23,-35309556),r=c(r,o,a,i,t[l+1],4,-1530992060),i=c(i,r,o,a,t[l+4],11,1272893353),a=c(a,i,r,o,t[l+7],16,-155497632),o=c(o,a,i,r,t[l+10],23,-1094730640),r=c(r,o,a,i,t[l+13],4,681279174),i=c(i,r,o,a,t[l+0],11,-358537222),a=c(a,i,r,o,t[l+3],16,-722521979),o=c(o,a,i,r,t[l+6],23,76029189),r=c(r,o,a,i,t[l+9],4,-640364487),i=c(i,r,o,a,t[l+12],11,-421815835),a=c(a,i,r,o,t[l+15],16,530742520),r=g(r,o=c(o,a,i,r,t[l+2],23,-995338651),a,i,t[l+0],6,-198630844),i=g(i,r,o,a,t[l+7],10,1126891415),a=g(a,i,r,o,t[l+14],15,-1416354905),o=g(o,a,i,r,t[l+5],21,-57434055),r=g(r,o,a,i,t[l+12],6,1700485571),i=g(i,r,o,a,t[l+3],10,-1894986606),a=g(a,i,r,o,t[l+10],15,-1051523),o=g(o,a,i,r,t[l+1],21,-2054922799),r=g(r,o,a,i,t[l+8],6,1873313359),i=g(i,r,o,a,t[l+15],10,-30611744),a=g(a,i,r,o,t[l+6],15,-1560198380),o=g(o,a,i,r,t[l+13],21,1309151649),r=g(r,o,a,i,t[l+4],6,-145523070),i=g(i,r,o,a,t[l+11],10,-1120210379),a=g(a,i,r,o,t[l+2],15,718787259),o=g(o,a,i,r,t[l+9],21,-343485551),r=r+p>>>0,o=o+d>>>0,a=a+m>>>0,i=i+f>>>0}return v.endian([r,o,a,i])}var v,S,b,I;v=crypt,S=charenc_1.utf8,b=isBuffer_1,I=charenc_1.bin,y._ff=function(e,n,t,r,o,a,i){e=e+(n&t|~n&r)+(o>>>0)+i;return(e<<a|e>>>32-a)+n},y._gg=function(e,n,t,r,o,a,i){e=e+(n&r|t&~r)+(o>>>0)+i;return(e<<a|e>>>32-a)+n},y._hh=function(e,n,t,r,o,a,i){e=e+(n^t^r)+(o>>>0)+i;return(e<<a|e>>>32-a)+n},y._ii=function(e,n,t,r,o,a,i){e=e+(t^(n|~r))+(o>>>0)+i;return(e<<a|e>>>32-a)+n},y._blocksize=16,y._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);e=v.wordsToBytes(y(e,n));return n&&n.asBytes?e:n&&n.asString?I.bytesToString(e):v.bytesToHex(e)}});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,n,t){var r;e?(r={...r=commonData(n),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(t,JSON.stringify(n)):wx.setStorageSync(t,"")},fail:function(e){console.error(e),wx.setStorageSync(t,JSON.stringify(n))}}):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(t,JSON.stringify(n)):uni.setStorageSync(t,"")},fail:function(e){console.log("error: ",e),uni.setStorageSync(t,JSON.stringify(n))}})):console.error("please set upload data upType")}function queryTrackDataUpload(){let e=null,n=null,t=null;var r=[],o=((Global.platform===wxMini?(e=wx.getStorageSync(BPNPVUV),wx.setStorageSync(BPNPVUV,""),n=wx.getStorageSync(BPNPVUVFail),t=wx.getStorageSync(BPNPVUVFailOnce),wx):(e=uni.getStorageSync(BPNPVUV),uni.setStorageSync(BPNPVUV,""),n=uni.getStorageSync(BPNPVUVFail),t=uni.getStorageSync(BPNPVUVFailOnce),uni)).setStorageSync(BPNPVUVFailOnce,""),e?JSON.parse(e):[]),a=n?JSON.parse(n):[],i=t?JSON.parse(t):[];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 n=e.$page||"",t=n.path||getCurPath(),n={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:n.domain||"",pageId:md5(t),path:t||"",title:n.title||"",url:t||""},properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:sdkTrackIdVal(),triggerTime:timeToStr(Date.now())};1==e.$sendMode?reportTrackEventServer("event",[n],BPNEventFailOnce):insertEventData(n)}function insertEventData(e){let n;var t=(n=(Global.platform===wxMini?wx:uni).getStorageSync(BPNEvent))?JSON.parse(n):[];t.push(e),(Global.platform===wxMini?wx:uni).setStorageSync(BPNEvent,JSON.stringify(t))}function queryEventDataUpload(){let e=null,n=null,t=null;var r=[],o=((Global.platform===wxMini?(e=wx.getStorageSync(BPNEvent),wx.setStorageSync(BPNEvent,""),n=wx.getStorageSync(BPNEventFail),t=wx.getStorageSync(BPNEventFailOnce),wx):(e=uni.getStorageSync(BPNEvent),uni.setStorageSync(BPNEvent,""),n=uni.getStorageSync(BPNEventFail),t=uni.getStorageSync(BPNEventFailOnce),uni)).setStorageSync(BPNEventFailOnce,""),e?JSON.parse(e):[]),a=n?JSON.parse(n):[],i=t?JSON.parse(t):[];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,n){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(n),sMode=mObj.sendMode,visPagesArr.push(mObj.path)):e===AUTOTRACKTYPE.LOOP?(cirtemp=2,startTime=15,loopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp=3,n=Math.max(1,(Date.now()-loopTimeLong)/1e3),startTime=Math.ceil(n));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 n;e?(n=setReportUrl(e.env),Global.upEventUrl=n.upEventApi,Global.upTrackUrl=n.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};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "visual-buried-point-platform-uni",
3
- "version": "2.0.4-alpha.10",
4
- "lsi": "86b99e09669cf6b01d95f06a8856db7c#2.0.4-alpha.10",
3
+ "version": "2.0.4-alpha.11",
4
+ "lsi": "e7be6adc3c2456e6c2b5eb8ae3ef57c9#2.0.4-alpha.11",
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",