visual-buried-point-platform-uni 2.0.3 → 2.0.4-alpha.10
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 +23 -16
- package/dist/esm/buried-point-uni.js +1 -1
- package/package.json +10 -8
- package/dist/cjs/buried-point-uni.js +0 -1
- package/dist/umd/buried-point-uni.js +0 -1
package/README.md
CHANGED
|
@@ -6,12 +6,14 @@
|
|
|
6
6
|
- v1.0.0-alpha.35 调整SDK内部PVUV采集模式,分原有start方法采集及自动采集,支持获取埋点sdk内的跟踪id;
|
|
7
7
|
- v2.0.0 调整SDK内部PVUV采集模式,分原有start方法采集及自动采集,支持获取埋点sdk内的跟踪ID;
|
|
8
8
|
- v2.0.3 修复已知bug;
|
|
9
|
+
- v2.0.4-alpha.6 修复已知bug、调整立即上报参数、优化打包SDK;
|
|
9
10
|
|
|
10
11
|
### 1、引入方式
|
|
11
12
|
|
|
12
13
|
```js
|
|
13
14
|
//内网npm链接:http://verdaccio.gogdev.cn/
|
|
14
15
|
npm install visual-buried-point-platform-uni
|
|
16
|
+
|
|
15
17
|
```
|
|
16
18
|
|
|
17
19
|
### 2、初始化方式
|
|
@@ -78,13 +80,14 @@ setCustomEvent(data)
|
|
|
78
80
|
|
|
79
81
|
**配置:**
|
|
80
82
|
|
|
81
|
-
| 参数 | 必填 | 描述 |
|
|
82
|
-
| ------------- | ---- | ------------------------------ |
|
|
83
|
-
| $event_id | 是 | 对应创建的事件ID 【图2】 |
|
|
84
|
-
| $extend_param | 否 | 扩展字段,建议根据业务需求填上 |
|
|
85
|
-
| $busSegment | 否 | 业务板块 【表1】各自业务板块 |
|
|
86
|
-
| $module | 否 | 业务模块【表1】各自业务模块 |
|
|
87
|
-
| $event_code | 是 | 对应创建的事件标识符 |
|
|
83
|
+
| 参数 | 必填 | 类型 | 描述 |
|
|
84
|
+
| ------------- | ---- | ------- | ------------------------------ |
|
|
85
|
+
| $event_id | 是 | string | 对应创建的事件ID 【图2】 |
|
|
86
|
+
| $extend_param | 否 | string | 扩展字段,建议根据业务需求填上 |
|
|
87
|
+
| $busSegment | 否 | number | 业务板块 【表1】各自业务板块 |
|
|
88
|
+
| $module | 否 | number | 业务模块【表1】各自业务模块 |
|
|
89
|
+
| $event_code | 是 | string | 对应创建的事件标识符 |
|
|
90
|
+
| $sendMode | 否 | boolean | 此次上报数据是否立即上报 |
|
|
88
91
|
|
|
89
92
|
表1
|
|
90
93
|
|
|
@@ -110,6 +113,7 @@ data: JSON字符串
|
|
|
110
113
|
$event_code: 渠道推广编码 【非必填字段,建议根据业务填上, 否则数据统计可能出现缺失】
|
|
111
114
|
$duration: 停留时长 【非必填字段】
|
|
112
115
|
$event_code: 事件标识符 【必填字段,建议根据业务填上, 否则数据统计可能出现缺失】
|
|
116
|
+
$sendMode: 数据上报模式 【非必填,当前此次埋点数据是否立即上报】
|
|
113
117
|
$page: 当前页对象 【非必填字段,建议根据业务填上, 否则数据统计可能出现缺失】
|
|
114
118
|
}
|
|
115
119
|
import { setCustomEvent } from 'visual-buried-point-platform-uni'
|
|
@@ -119,6 +123,7 @@ const params = {
|
|
|
119
123
|
$event_code: "2139oNf0te6kf0DvltL",
|
|
120
124
|
$busSegment: 1,
|
|
121
125
|
$module: 1,
|
|
126
|
+
$sendMode: true
|
|
122
127
|
$extend_param: {
|
|
123
128
|
title: "自定义[点击事件]上报-点击_密码登录按钮",
|
|
124
129
|
clickContent: "密码登录",
|
|
@@ -142,15 +147,16 @@ setCustomEvent(params)
|
|
|
142
147
|
|
|
143
148
|
**配置:**【以下配置参数建议上报】
|
|
144
149
|
|
|
145
|
-
| 参数 | 必填 | 类型 | 描述
|
|
146
|
-
| ------------ | ---- | ----------- |
|
|
147
|
-
| domain | 否 | string | 域名
|
|
148
|
-
| busSegment | 否 | string | 业务板块 【表1】
|
|
149
|
-
| module | 否 | string | 业务模块 【表1】
|
|
150
|
-
| extend_param | 否 | JSON对象 {} | 扩展参数
|
|
151
|
-
| sourceDomain | 否 | string | 访问来源域名
|
|
152
|
-
| sourceUrl | 否 | string | 访问来源url
|
|
153
|
-
| title | 否 | string | 页面名称
|
|
150
|
+
| 参数 | 必填 | 类型 | 描述 |
|
|
151
|
+
| ------------ | ---- | ----------- | ------------------------ |
|
|
152
|
+
| domain | 否 | string | 域名 |
|
|
153
|
+
| busSegment | 否 | string | 业务板块 【表1】 |
|
|
154
|
+
| module | 否 | string | 业务模块 【表1】 |
|
|
155
|
+
| extend_param | 否 | JSON对象 {} | 扩展参数 |
|
|
156
|
+
| sourceDomain | 否 | string | 访问来源域名 |
|
|
157
|
+
| sourceUrl | 否 | string | 访问来源url |
|
|
158
|
+
| title | 否 | string | 页面名称 |
|
|
159
|
+
| sendMode | 否 | boolean | 此次上报数据是否立即上报 |
|
|
154
160
|
|
|
155
161
|
**示例:**
|
|
156
162
|
|
|
@@ -164,6 +170,7 @@ const params = {
|
|
|
164
170
|
module: 1,
|
|
165
171
|
title: "店铺详情",
|
|
166
172
|
sourceDomain: 'com.gzdzswy.onetravel',
|
|
173
|
+
sendMode: true,
|
|
167
174
|
extend_param: {
|
|
168
175
|
goods_id: 123456, //商品id 【根据业务确定】
|
|
169
176
|
store_id: 1111, //店铺id 【...】
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var name="visual-buried-point-platform-uni",version="2.0.3",lsi="a193bfce1bd38fc47486eae3b8935a52#2.0.3",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",dependencies={md5:"^2.3.0"},devDependencies={rimraf:"^6.0.1",webpack:"^5.72.1","webpack-cli":"^6.0.1","@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",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"},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,dependencies:dependencies,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$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 getWxMiniUserId(){return wx.getStorageSync(usrIdKey)?wx.getStorageSync(usrIdKey):""}function getWxMiniAnonyMousId(){let e=wx.getStorageSync(anonIdKey);return e||(e=randomUUID$1(),wx.setStorageSync(anonIdKey,e)),e}let AUTOTRACKTYPE={ENTER:"enter",LOOP:"loop",LEAVE:"leave"},BPNPVUV="UNIBPNPVUVSrcData",BPNPVUVFail="UNIBPNPVUVFailData",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(){return wx.env&&wx.canIUse}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$2(){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"):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||"",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}}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;n.includes("app")?(Global.platform=e.osName,Global.appData=getUniAppInfo(e)):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()),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$2()),uni.setStorageSync(anonIdKey$1,Global.anonymousId))}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var crypt=createCommonjsModule(function(e){var a,n;a="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=[];0<e;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 t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?t.push(a.charAt(r>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)0!=r&&t.push((a.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|a.indexOf(e.charAt(n))>>>6-2*r);return t}},e.exports=n}),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 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("")}}},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 v(e,t){e.constructor==String?e=(t&&"binary"===t.encoding?S:y).stringToBytes(e):T(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=b.bytesToWords(e),t=8*e.length,r=1732584193,o=-271733879,a=-1732584194,i=271733878,l=0;l<n.length;l++)n[l]=16711935&(n[l]<<8|n[l]>>>24)|4278255360&(n[l]<<24|n[l]>>>8);n[t>>>5]|=128<<t%32,n[14+(64+t>>>9<<4)]=t;for(var u=v._ff,s=v._gg,c=v._hh,p=v._ii,l=0;l<n.length;l+=16){var g=r,d=o,m=a,f=i,r=u(r,o,a,i,n[l+0],7,-680876936),i=u(i,r,o,a,n[l+1],12,-389564586),a=u(a,i,r,o,n[l+2],17,606105819),o=u(o,a,i,r,n[l+3],22,-1044525330);r=u(r,o,a,i,n[l+4],7,-176418897),i=u(i,r,o,a,n[l+5],12,1200080426),a=u(a,i,r,o,n[l+6],17,-1473231341),o=u(o,a,i,r,n[l+7],22,-45705983),r=u(r,o,a,i,n[l+8],7,1770035416),i=u(i,r,o,a,n[l+9],12,-1958414417),a=u(a,i,r,o,n[l+10],17,-42063),o=u(o,a,i,r,n[l+11],22,-1990404162),r=u(r,o,a,i,n[l+12],7,1804603682),i=u(i,r,o,a,n[l+13],12,-40341101),a=u(a,i,r,o,n[l+14],17,-1502002290),r=s(r,o=u(o,a,i,r,n[l+15],22,1236535329),a,i,n[l+1],5,-165796510),i=s(i,r,o,a,n[l+6],9,-1069501632),a=s(a,i,r,o,n[l+11],14,643717713),o=s(o,a,i,r,n[l+0],20,-373897302),r=s(r,o,a,i,n[l+5],5,-701558691),i=s(i,r,o,a,n[l+10],9,38016083),a=s(a,i,r,o,n[l+15],14,-660478335),o=s(o,a,i,r,n[l+4],20,-405537848),r=s(r,o,a,i,n[l+9],5,568446438),i=s(i,r,o,a,n[l+14],9,-1019803690),a=s(a,i,r,o,n[l+3],14,-187363961),o=s(o,a,i,r,n[l+8],20,1163531501),r=s(r,o,a,i,n[l+13],5,-1444681467),i=s(i,r,o,a,n[l+2],9,-51403784),a=s(a,i,r,o,n[l+7],14,1735328473),r=c(r,o=s(o,a,i,r,n[l+12],20,-1926607734),a,i,n[l+5],4,-378558),i=c(i,r,o,a,n[l+8],11,-2022574463),a=c(a,i,r,o,n[l+11],16,1839030562),o=c(o,a,i,r,n[l+14],23,-35309556),r=c(r,o,a,i,n[l+1],4,-1530992060),i=c(i,r,o,a,n[l+4],11,1272893353),a=c(a,i,r,o,n[l+7],16,-155497632),o=c(o,a,i,r,n[l+10],23,-1094730640),r=c(r,o,a,i,n[l+13],4,681279174),i=c(i,r,o,a,n[l+0],11,-358537222),a=c(a,i,r,o,n[l+3],16,-722521979),o=c(o,a,i,r,n[l+6],23,76029189),r=c(r,o,a,i,n[l+9],4,-640364487),i=c(i,r,o,a,n[l+12],11,-421815835),a=c(a,i,r,o,n[l+15],16,530742520),r=p(r,o=c(o,a,i,r,n[l+2],23,-995338651),a,i,n[l+0],6,-198630844),i=p(i,r,o,a,n[l+7],10,1126891415),a=p(a,i,r,o,n[l+14],15,-1416354905),o=p(o,a,i,r,n[l+5],21,-57434055),r=p(r,o,a,i,n[l+12],6,1700485571),i=p(i,r,o,a,n[l+3],10,-1894986606),a=p(a,i,r,o,n[l+10],15,-1051523),o=p(o,a,i,r,n[l+1],21,-2054922799),r=p(r,o,a,i,n[l+8],6,1873313359),i=p(i,r,o,a,n[l+15],10,-30611744),a=p(a,i,r,o,n[l+6],15,-1560198380),o=p(o,a,i,r,n[l+13],21,1309151649),r=p(r,o,a,i,n[l+4],6,-145523070),i=p(i,r,o,a,n[l+11],10,-1120210379),a=p(a,i,r,o,n[l+2],15,718787259),o=p(o,a,i,r,n[l+9],21,-343485551),r=r+g>>>0,o=o+d>>>0,a=a+m>>>0,i=i+f>>>0}return b.endian([r,o,a,i])}var b,y,T,S;b=crypt,y=charenc_1.utf8,T=isBuffer_1,S=charenc_1.bin,v._ff=function(e,t,n,r,o,a,i){e=e+(t&n|~t&r)+(o>>>0)+i;return(e<<a|e>>>32-a)+t},v._gg=function(e,t,n,r,o,a,i){e=e+(t&r|n&~r)+(o>>>0)+i;return(e<<a|e>>>32-a)+t},v._hh=function(e,t,n,r,o,a,i){e=e+(t^n^r)+(o>>>0)+i;return(e<<a|e>>>32-a)+t},v._ii=function(e,t,n,r,o,a,i){e=e+(n^(t|~r))+(o>>>0)+i;return(e<<a|e>>>32-a)+t},v._blocksize=16,v._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);e=b.wordsToBytes(v(e,t));return t&&t.asBytes?e:t&&t.asString?S.bytesToString(e):b.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,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")}let atDuration,atEnterTimeLong,atLoopTimeLong,cirtemp,atObj,atInterval,uid;function clearData(){clearInterval(atInterval),atInterval=null,uid=0,atObj=null,atEnterTimeLong=0,atLoopTimeLong=0}let uAutoStartTrackPVData=e=>{clearData(),atObj=e,autoTrackData(AUTOTRACKTYPE.ENTER),atInterval=setInterval(()=>{autoTrackData(AUTOTRACKTYPE.LOOP)},15e3)},uAutoStopTrackPVData=()=>{atObj&&autoTrackData(AUTOTRACKTYPE.LEAVE),clearData()};function autoTrackData(e){e===AUTOTRACKTYPE.ENTER?(cirtemp=1,atDuration=0,uid=randomUUID(),atEnterTimeLong=Date.now(),atLoopTimeLong=atEnterTimeLong):e===AUTOTRACKTYPE.LOOP?(cirtemp=2,atDuration=15,atLoopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp=3,e=Math.max(1,(Date.now()-atLoopTimeLong)/1e3),atDuration=Math.ceil(e));e={busSegment:atObj.busSegment||"",circulation:cirtemp,domain:atObj.domain,duration:atDuration,module:atObj.module||"",path:atObj.path,url:atObj.url,sourceDomain:atObj.sourceDomain,sourceUrl:atObj.sourceUrl,properties:atObj.properties,title:atObj.title,traceId:"",trackId:sdkTrackIdVal(),visitPage:atObj.visitPage,visitTime:timeToStr(atEnterTimeLong),uid:uid};insertPVUVData(e,uid)}function autoPageObj(t,e,n){var r=pagesArray.find(e=>e.path===t),o=Global.platform;let a="",i="",l="",u="";return o&&("web"===o||"h5"===o?(a=window.location.href,i=window.location.hostname,document.referrer&&(o=new URL(document.referrer),l=o||"",u=o.hostname||"")):(a=t,1<e&&(o=n[e-2],l=o.route),i=Global.domain||t)),{path:r&&r.path?r.path:t,busSegment:r&&r.busSegment?r.busSegment:Global.busSegment||"",module:r&&r.module?r.module:Global.module||"",properties:r&&r.properties?r.properties:"",domain:i,url:a,visitPage:e,sourceDomain:u,sourceUrl:l,title:r&&r.title?r.title:""}}function queryTrackDataUpload(){let e=null,t=null;var n=[],r=(t=(Global.platform===wxMini?(e=wx.getStorageSync(BPNPVUV),wx.setStorageSync(BPNPVUV,""),wx):(e=uni.getStorageSync(BPNPVUV),uni.setStorageSync(BPNPVUV,""),uni)).getStorageSync(BPNPVUVFail),e?JSON.parse(e):[]),o=t?JSON.parse(t):[];r.length&&n.push(...r),o.length&&(n.push(...o),n.forEach(e=>{delete e.pageUUId})),n&&n.length&&reportTrackEventServer("track",n,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";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||"",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())};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;var n=[],r=(t=(Global.platform===wxMini?(e=wx.getStorageSync(BPNEvent),wx.setStorageSync(BPNEvent,""),wx):(e=uni.getStorageSync(BPNEvent),uni.setStorageSync(BPNEvent,""),uni)).getStorageSync(BPNEventFail),e?JSON.parse(e):[]),o=t?JSON.parse(t):[];r.length&&n.push(...r),o.length&&n.push(...o),n&&n.length&&reportTrackEventServer("event",n,BPNEventFail)}let startTime,enterTimeLong,loopTimeLong,umlInterval,cirtemp$1,mObj,cPUUId;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}function uTrackPVData(e,t){e===AUTOTRACKTYPE.ENTER?(mObj=null,cPUUId=0,cirtemp$1=1,startTime=0,enterTimeLong=-1,loopTimeLong=-1,enterTimeLong=Date.now(),loopTimeLong=enterTimeLong,cPUUId=randomUUID$2(),mObj=getTrackObj(t),visPagesArr.push(mObj.path)):e===AUTOTRACKTYPE.LOOP?(cirtemp$1=2,startTime=15,loopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp$1=3,t=Math.max(1,(Date.now()-loopTimeLong)/1e3),startTime=Math.ceil(t));e={busSegment:mObj.busSegment,circulation:cirtemp$1,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};insertPVUVData(e,cPUUId)}function uniInterceptorListener(){uni.addInterceptor("navigateTo",{invoke(e){routerMsgHandler("leave")},success(e){routerMsgHandler("pv")}}),uni.addInterceptor("switchTab",{invoke(e){routerMsgHandler("leave")},success(e){routerMsgHandler("pv")}}),uni.addInterceptor("navigateBack",{invoke(e){routerMsgHandler("leave")},success(e){routerMsgHandler("pv")}})}let pathExist=!1;function routerMsgHandler(e){if(!Global.isCompatible)if("pv"===e){var n=getCurrentPages();let t=n[n.length-1];Global.signTrackArray&&Global.signTrackArray.length&&(pathExist=Global.signTrackArray.find(e=>e===t.route))?pathExist=!0:(pathExist=!1,n=autoPageObj(t.route,n.length,n),uAutoStartTrackPVData(n))}else"leave"!==e||pathExist||uAutoStopTrackPVData()}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(),Global.platform!==wxMini&&uniInterceptorListener()):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.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};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visual-buried-point-platform-uni",
|
|
3
|
-
"version": "2.0.
|
|
4
|
-
"lsi": "
|
|
3
|
+
"version": "2.0.4-alpha.10",
|
|
4
|
+
"lsi": "86b99e09669cf6b01d95f06a8856db7c#2.0.4-alpha.10",
|
|
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",
|
|
@@ -20,23 +20,25 @@
|
|
|
20
20
|
"keywords": [],
|
|
21
21
|
"author": "",
|
|
22
22
|
"license": "MIT",
|
|
23
|
-
"
|
|
24
|
-
"
|
|
23
|
+
"peerDependencies": {
|
|
24
|
+
"crypto-js": "4.2.0",
|
|
25
|
+
"md5": "2.3.0"
|
|
25
26
|
},
|
|
26
27
|
"devDependencies": {
|
|
27
|
-
"rimraf": "^6.0.1",
|
|
28
|
-
"webpack": "^5.72.1",
|
|
29
|
-
"webpack-cli": "^6.0.1",
|
|
30
28
|
"@babel/core": "^7.26.10",
|
|
31
29
|
"@babel/preset-env": "^7.26.9",
|
|
32
30
|
"@rollup/plugin-json": "^6.0.1",
|
|
33
31
|
"babel-loader": "^10.0.0",
|
|
34
32
|
"babel-preset-es2015": "^6.24.1",
|
|
33
|
+
"rimraf": "^6.0.1",
|
|
35
34
|
"rollup": "^1.20.2",
|
|
36
35
|
"rollup-plugin-babel": "^4.3.3",
|
|
37
36
|
"rollup-plugin-commonjs": "^10.0.2",
|
|
38
37
|
"rollup-plugin-node-resolve": "^5.2.0",
|
|
39
38
|
"rollup-plugin-replace": "^2.2.0",
|
|
40
|
-
"rollup-plugin-uglify": "^6.0.2"
|
|
39
|
+
"rollup-plugin-uglify": "^6.0.2",
|
|
40
|
+
"webpack": "^5.72.1",
|
|
41
|
+
"webpack-cli": "^6.0.1",
|
|
42
|
+
"md5": "2.3.0"
|
|
41
43
|
}
|
|
42
44
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports,"__esModule",{value:!0});var name="visual-buried-point-platform-uni",version="2.0.3",lsi="a193bfce1bd38fc47486eae3b8935a52#2.0.3",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",dependencies={md5:"^2.3.0"},devDependencies={rimraf:"^6.0.1",webpack:"^5.72.1","webpack-cli":"^6.0.1","@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",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"},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,dependencies:dependencies,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$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 getWxMiniUserId(){return wx.getStorageSync(usrIdKey)?wx.getStorageSync(usrIdKey):""}function getWxMiniAnonyMousId(){let e=wx.getStorageSync(anonIdKey);return e||(e=randomUUID$1(),wx.setStorageSync(anonIdKey,e)),e}let AUTOTRACKTYPE={ENTER:"enter",LOOP:"loop",LEAVE:"leave"},BPNPVUV="UNIBPNPVUVSrcData",BPNPVUVFail="UNIBPNPVUVFailData",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(){return wx.env&&wx.canIUse}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$2(){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"):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||"",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}}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;n.includes("app")?(Global.platform=e.osName,Global.appData=getUniAppInfo(e)):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()),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$2()),uni.setStorageSync(anonIdKey$1,Global.anonymousId))}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var crypt=createCommonjsModule(function(e){var a,n;a="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=[];0<e;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 t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?t.push(a.charAt(r>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)0!=r&&t.push((a.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|a.indexOf(e.charAt(n))>>>6-2*r);return t}},e.exports=n}),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 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("")}}},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 v(e,t){e.constructor==String?e=(t&&"binary"===t.encoding?S:y).stringToBytes(e):T(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=b.bytesToWords(e),t=8*e.length,r=1732584193,o=-271733879,a=-1732584194,i=271733878,l=0;l<n.length;l++)n[l]=16711935&(n[l]<<8|n[l]>>>24)|4278255360&(n[l]<<24|n[l]>>>8);n[t>>>5]|=128<<t%32,n[14+(64+t>>>9<<4)]=t;for(var u=v._ff,s=v._gg,c=v._hh,p=v._ii,l=0;l<n.length;l+=16){var g=r,d=o,m=a,f=i,r=u(r,o,a,i,n[l+0],7,-680876936),i=u(i,r,o,a,n[l+1],12,-389564586),a=u(a,i,r,o,n[l+2],17,606105819),o=u(o,a,i,r,n[l+3],22,-1044525330);r=u(r,o,a,i,n[l+4],7,-176418897),i=u(i,r,o,a,n[l+5],12,1200080426),a=u(a,i,r,o,n[l+6],17,-1473231341),o=u(o,a,i,r,n[l+7],22,-45705983),r=u(r,o,a,i,n[l+8],7,1770035416),i=u(i,r,o,a,n[l+9],12,-1958414417),a=u(a,i,r,o,n[l+10],17,-42063),o=u(o,a,i,r,n[l+11],22,-1990404162),r=u(r,o,a,i,n[l+12],7,1804603682),i=u(i,r,o,a,n[l+13],12,-40341101),a=u(a,i,r,o,n[l+14],17,-1502002290),r=s(r,o=u(o,a,i,r,n[l+15],22,1236535329),a,i,n[l+1],5,-165796510),i=s(i,r,o,a,n[l+6],9,-1069501632),a=s(a,i,r,o,n[l+11],14,643717713),o=s(o,a,i,r,n[l+0],20,-373897302),r=s(r,o,a,i,n[l+5],5,-701558691),i=s(i,r,o,a,n[l+10],9,38016083),a=s(a,i,r,o,n[l+15],14,-660478335),o=s(o,a,i,r,n[l+4],20,-405537848),r=s(r,o,a,i,n[l+9],5,568446438),i=s(i,r,o,a,n[l+14],9,-1019803690),a=s(a,i,r,o,n[l+3],14,-187363961),o=s(o,a,i,r,n[l+8],20,1163531501),r=s(r,o,a,i,n[l+13],5,-1444681467),i=s(i,r,o,a,n[l+2],9,-51403784),a=s(a,i,r,o,n[l+7],14,1735328473),r=c(r,o=s(o,a,i,r,n[l+12],20,-1926607734),a,i,n[l+5],4,-378558),i=c(i,r,o,a,n[l+8],11,-2022574463),a=c(a,i,r,o,n[l+11],16,1839030562),o=c(o,a,i,r,n[l+14],23,-35309556),r=c(r,o,a,i,n[l+1],4,-1530992060),i=c(i,r,o,a,n[l+4],11,1272893353),a=c(a,i,r,o,n[l+7],16,-155497632),o=c(o,a,i,r,n[l+10],23,-1094730640),r=c(r,o,a,i,n[l+13],4,681279174),i=c(i,r,o,a,n[l+0],11,-358537222),a=c(a,i,r,o,n[l+3],16,-722521979),o=c(o,a,i,r,n[l+6],23,76029189),r=c(r,o,a,i,n[l+9],4,-640364487),i=c(i,r,o,a,n[l+12],11,-421815835),a=c(a,i,r,o,n[l+15],16,530742520),r=p(r,o=c(o,a,i,r,n[l+2],23,-995338651),a,i,n[l+0],6,-198630844),i=p(i,r,o,a,n[l+7],10,1126891415),a=p(a,i,r,o,n[l+14],15,-1416354905),o=p(o,a,i,r,n[l+5],21,-57434055),r=p(r,o,a,i,n[l+12],6,1700485571),i=p(i,r,o,a,n[l+3],10,-1894986606),a=p(a,i,r,o,n[l+10],15,-1051523),o=p(o,a,i,r,n[l+1],21,-2054922799),r=p(r,o,a,i,n[l+8],6,1873313359),i=p(i,r,o,a,n[l+15],10,-30611744),a=p(a,i,r,o,n[l+6],15,-1560198380),o=p(o,a,i,r,n[l+13],21,1309151649),r=p(r,o,a,i,n[l+4],6,-145523070),i=p(i,r,o,a,n[l+11],10,-1120210379),a=p(a,i,r,o,n[l+2],15,718787259),o=p(o,a,i,r,n[l+9],21,-343485551),r=r+g>>>0,o=o+d>>>0,a=a+m>>>0,i=i+f>>>0}return b.endian([r,o,a,i])}var b,y,T,S;b=crypt,y=charenc_1.utf8,T=isBuffer_1,S=charenc_1.bin,v._ff=function(e,t,n,r,o,a,i){e=e+(t&n|~t&r)+(o>>>0)+i;return(e<<a|e>>>32-a)+t},v._gg=function(e,t,n,r,o,a,i){e=e+(t&r|n&~r)+(o>>>0)+i;return(e<<a|e>>>32-a)+t},v._hh=function(e,t,n,r,o,a,i){e=e+(t^n^r)+(o>>>0)+i;return(e<<a|e>>>32-a)+t},v._ii=function(e,t,n,r,o,a,i){e=e+(n^(t|~r))+(o>>>0)+i;return(e<<a|e>>>32-a)+t},v._blocksize=16,v._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);e=b.wordsToBytes(v(e,t));return t&&t.asBytes?e:t&&t.asString?S.bytesToString(e):b.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,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")}let atDuration,atEnterTimeLong,atLoopTimeLong,cirtemp,atObj,atInterval,uid;function clearData(){clearInterval(atInterval),atInterval=null,uid=0,atObj=null,atEnterTimeLong=0,atLoopTimeLong=0}let uAutoStartTrackPVData=e=>{clearData(),atObj=e,autoTrackData(AUTOTRACKTYPE.ENTER),atInterval=setInterval(()=>{autoTrackData(AUTOTRACKTYPE.LOOP)},15e3)},uAutoStopTrackPVData=()=>{atObj&&autoTrackData(AUTOTRACKTYPE.LEAVE),clearData()};function autoTrackData(e){e===AUTOTRACKTYPE.ENTER?(cirtemp=1,atDuration=0,uid=randomUUID(),atEnterTimeLong=Date.now(),atLoopTimeLong=atEnterTimeLong):e===AUTOTRACKTYPE.LOOP?(cirtemp=2,atDuration=15,atLoopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp=3,e=Math.max(1,(Date.now()-atLoopTimeLong)/1e3),atDuration=Math.ceil(e));e={busSegment:atObj.busSegment||"",circulation:cirtemp,domain:atObj.domain,duration:atDuration,module:atObj.module||"",path:atObj.path,url:atObj.url,sourceDomain:atObj.sourceDomain,sourceUrl:atObj.sourceUrl,properties:atObj.properties,title:atObj.title,traceId:"",trackId:sdkTrackIdVal(),visitPage:atObj.visitPage,visitTime:timeToStr(atEnterTimeLong),uid:uid};insertPVUVData(e,uid)}function autoPageObj(t,e,n){var r=pagesArray.find(e=>e.path===t),o=Global.platform;let a="",i="",l="",u="";return o&&("web"===o||"h5"===o?(a=window.location.href,i=window.location.hostname,document.referrer&&(o=new URL(document.referrer),l=o||"",u=o.hostname||"")):(a=t,1<e&&(o=n[e-2],l=o.route),i=Global.domain||t)),{path:r&&r.path?r.path:t,busSegment:r&&r.busSegment?r.busSegment:Global.busSegment||"",module:r&&r.module?r.module:Global.module||"",properties:r&&r.properties?r.properties:"",domain:i,url:a,visitPage:e,sourceDomain:u,sourceUrl:l,title:r&&r.title?r.title:""}}function queryTrackDataUpload(){let e=null,t=null;var n=[],r=(t=(Global.platform===wxMini?(e=wx.getStorageSync(BPNPVUV),wx.setStorageSync(BPNPVUV,""),wx):(e=uni.getStorageSync(BPNPVUV),uni.setStorageSync(BPNPVUV,""),uni)).getStorageSync(BPNPVUVFail),e?JSON.parse(e):[]),o=t?JSON.parse(t):[];r.length&&n.push(...r),o.length&&(n.push(...o),n.forEach(e=>{delete e.pageUUId})),n&&n.length&&reportTrackEventServer("track",n,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";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||"",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())};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;var n=[],r=(t=(Global.platform===wxMini?(e=wx.getStorageSync(BPNEvent),wx.setStorageSync(BPNEvent,""),wx):(e=uni.getStorageSync(BPNEvent),uni.setStorageSync(BPNEvent,""),uni)).getStorageSync(BPNEventFail),e?JSON.parse(e):[]),o=t?JSON.parse(t):[];r.length&&n.push(...r),o.length&&n.push(...o),n&&n.length&&reportTrackEventServer("event",n,BPNEventFail)}let startTime,enterTimeLong,loopTimeLong,umlInterval,cirtemp$1,mObj,cPUUId;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}function uTrackPVData(e,t){e===AUTOTRACKTYPE.ENTER?(mObj=null,cPUUId=0,cirtemp$1=1,startTime=0,enterTimeLong=-1,loopTimeLong=-1,enterTimeLong=Date.now(),loopTimeLong=enterTimeLong,cPUUId=randomUUID$2(),mObj=getTrackObj(t),visPagesArr.push(mObj.path)):e===AUTOTRACKTYPE.LOOP?(cirtemp$1=2,startTime=15,loopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp$1=3,t=Math.max(1,(Date.now()-loopTimeLong)/1e3),startTime=Math.ceil(t));e={busSegment:mObj.busSegment,circulation:cirtemp$1,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};insertPVUVData(e,cPUUId)}function uniInterceptorListener(){uni.addInterceptor("navigateTo",{invoke(e){routerMsgHandler("leave")},success(e){routerMsgHandler("pv")}}),uni.addInterceptor("switchTab",{invoke(e){routerMsgHandler("leave")},success(e){routerMsgHandler("pv")}}),uni.addInterceptor("navigateBack",{invoke(e){routerMsgHandler("leave")},success(e){routerMsgHandler("pv")}})}let pathExist=!1;function routerMsgHandler(e){if(!Global.isCompatible)if("pv"===e){var n=getCurrentPages();let t=n[n.length-1];Global.signTrackArray&&Global.signTrackArray.length&&(pathExist=Global.signTrackArray.find(e=>e===t.route))?pathExist=!0:(pathExist=!1,n=autoPageObj(t.route,n.length,n),uAutoStartTrackPVData(n))}else"leave"!==e||pathExist||uAutoStopTrackPVData()}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(),Global.platform!==wxMini&&uniInterceptorListener()):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 +0,0 @@
|
|
|
1
|
-
((e,t)=>{"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).BuriedPointUni={})})(this,function(e){var _="a193bfce1bd38fc47486eae3b8935a52#2.0.3";let t="v_userId",n="v_anonId";function M(){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 r={ENTER:"enter",LOOP:"loop",LEAVE:"leave"},a="UNIBPNPVUVSrcData",i="UNIBPNPVUVFailData",u="wxMini",o="v_userId",s="v_anonId",c={env:"",domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",appData:null,deviceData:null,distinctId:"",anonymousId:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[]},l=[],p=[];let g=()=>{var e;return c.trackId||(e=Date.now().toString(),c.trackId=e,p=[],e)};function d(){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 m(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 J(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"===c.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 $(){if("web"===c.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 j(e,t){let n=null;var r,o=(n=(c.platform===u?wx:uni).getStorageSync(a))?JSON.parse(n):[];0<o.length&&-1!==(r=o.findIndex(e=>e.uid===t))?o[r]={...o[r],...e}:o.push(e),(c.platform===u?wx:uni).setStorageSync(a,JSON.stringify(o))}function H(){var e;wx.env&&wx.canIUse?(c.platform=u,c.appData={name:"",packageName:(e=wx.getAccountInfoSync().miniProgram)?e.appId:"",version:e?e.envVersion+e.version:"",carrier:"mini",ecology:"mini"},c.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})(),c.distinctId=wx.getStorageSync(t)?wx.getStorageSync(t):"",c.anonymousId=M()):(uni.getSystemInfo({success:function(e){c.uAgent=e.ua;var t,n,r,o=e.uniPlatform;o.includes("app")?(c.platform=e.osName,c.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 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"):n.ecology="unknown";return n})(e)):o.includes("web")||o.includes("h5")?(c.platform="web",t=(t=e).ua.toLowerCase(),n=window.location.hostname,r=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:r||"",packageName:n||"",version:"",carrier:"H5",ecology:"h5"},c.appData={...t,version:c.version||"unknown"}):o.includes("weixin")&&(c.platform="weixin",c.appData=(r=uni.getAccountInfoSync(),{name:uni.getAppBaseInfo().appName||"",packageName:r?r.miniProgram.appId:"",version:r?r.miniProgram.envVersion+r.miniProgram.version:"",carrier:"mini",ecology:"mini"})),c.deviceData=J(e)},fail:function(e){c.deviceData={lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}},complete:function(){uni.getNetworkType({success(e){c.deviceData.network=e.networkType}})}}),c.distinctId=uni.getStorageSync(o)||"",c.anonymousId=uni.getStorageSync(s),c.anonymousId||(c.anonymousId=d()),uni.setStorageSync(s,c.anonymousId))}function R(e,t){return e(t={exports:{}},t.exports),t.exports}function z(e){return null!=e&&(F(e)||"function"==typeof(t=e).readFloatLE&&"function"==typeof t.slice&&F(t.slice(0,0))||!!e._isBuffer);var t}var W=R(function(e){var a,n;a="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=[];0<e;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 t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?t.push(a.charAt(r>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)0!=r&&t.push((a.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|a.indexOf(e.charAt(n))>>>6-2*r);return t}},e.exports=n}),f={utf8:{stringToBytes:function(e){return f.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(f.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("")}}},q=f;function F(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var K=R(function(e){function y(e,t){e.constructor==String?e=(t&&"binary"===t.encoding?w:S).stringToBytes(e):h(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var n=v.bytesToWords(e),t=8*e.length,r=1732584193,o=-271733879,a=-1732584194,i=271733878,u=0;u<n.length;u++)n[u]=16711935&(n[u]<<8|n[u]>>>24)|4278255360&(n[u]<<24|n[u]>>>8);n[t>>>5]|=128<<t%32,n[14+(64+t>>>9<<4)]=t;for(var s=y._ff,c=y._gg,l=y._hh,p=y._ii,u=0;u<n.length;u+=16){var g=r,d=o,m=a,f=i,r=s(r,o,a,i,n[u+0],7,-680876936),i=s(i,r,o,a,n[u+1],12,-389564586),a=s(a,i,r,o,n[u+2],17,606105819),o=s(o,a,i,r,n[u+3],22,-1044525330);r=s(r,o,a,i,n[u+4],7,-176418897),i=s(i,r,o,a,n[u+5],12,1200080426),a=s(a,i,r,o,n[u+6],17,-1473231341),o=s(o,a,i,r,n[u+7],22,-45705983),r=s(r,o,a,i,n[u+8],7,1770035416),i=s(i,r,o,a,n[u+9],12,-1958414417),a=s(a,i,r,o,n[u+10],17,-42063),o=s(o,a,i,r,n[u+11],22,-1990404162),r=s(r,o,a,i,n[u+12],7,1804603682),i=s(i,r,o,a,n[u+13],12,-40341101),a=s(a,i,r,o,n[u+14],17,-1502002290),r=c(r,o=s(o,a,i,r,n[u+15],22,1236535329),a,i,n[u+1],5,-165796510),i=c(i,r,o,a,n[u+6],9,-1069501632),a=c(a,i,r,o,n[u+11],14,643717713),o=c(o,a,i,r,n[u+0],20,-373897302),r=c(r,o,a,i,n[u+5],5,-701558691),i=c(i,r,o,a,n[u+10],9,38016083),a=c(a,i,r,o,n[u+15],14,-660478335),o=c(o,a,i,r,n[u+4],20,-405537848),r=c(r,o,a,i,n[u+9],5,568446438),i=c(i,r,o,a,n[u+14],9,-1019803690),a=c(a,i,r,o,n[u+3],14,-187363961),o=c(o,a,i,r,n[u+8],20,1163531501),r=c(r,o,a,i,n[u+13],5,-1444681467),i=c(i,r,o,a,n[u+2],9,-51403784),a=c(a,i,r,o,n[u+7],14,1735328473),r=l(r,o=c(o,a,i,r,n[u+12],20,-1926607734),a,i,n[u+5],4,-378558),i=l(i,r,o,a,n[u+8],11,-2022574463),a=l(a,i,r,o,n[u+11],16,1839030562),o=l(o,a,i,r,n[u+14],23,-35309556),r=l(r,o,a,i,n[u+1],4,-1530992060),i=l(i,r,o,a,n[u+4],11,1272893353),a=l(a,i,r,o,n[u+7],16,-155497632),o=l(o,a,i,r,n[u+10],23,-1094730640),r=l(r,o,a,i,n[u+13],4,681279174),i=l(i,r,o,a,n[u+0],11,-358537222),a=l(a,i,r,o,n[u+3],16,-722521979),o=l(o,a,i,r,n[u+6],23,76029189),r=l(r,o,a,i,n[u+9],4,-640364487),i=l(i,r,o,a,n[u+12],11,-421815835),a=l(a,i,r,o,n[u+15],16,530742520),r=p(r,o=l(o,a,i,r,n[u+2],23,-995338651),a,i,n[u+0],6,-198630844),i=p(i,r,o,a,n[u+7],10,1126891415),a=p(a,i,r,o,n[u+14],15,-1416354905),o=p(o,a,i,r,n[u+5],21,-57434055),r=p(r,o,a,i,n[u+12],6,1700485571),i=p(i,r,o,a,n[u+3],10,-1894986606),a=p(a,i,r,o,n[u+10],15,-1051523),o=p(o,a,i,r,n[u+1],21,-2054922799),r=p(r,o,a,i,n[u+8],6,1873313359),i=p(i,r,o,a,n[u+15],10,-30611744),a=p(a,i,r,o,n[u+6],15,-1560198380),o=p(o,a,i,r,n[u+13],21,1309151649),r=p(r,o,a,i,n[u+4],6,-145523070),i=p(i,r,o,a,n[u+11],10,-1120210379),a=p(a,i,r,o,n[u+2],15,718787259),o=p(o,a,i,r,n[u+9],21,-343485551),r=r+g>>>0,o=o+d>>>0,a=a+m>>>0,i=i+f>>>0}return v.endian([r,o,a,i])}var v,S,h,w;v=W,S=q.utf8,h=z,w=q.bin,y._ff=function(e,t,n,r,o,a,i){e=e+(t&n|~t&r)+(o>>>0)+i;return(e<<a|e>>>32-a)+t},y._gg=function(e,t,n,r,o,a,i){e=e+(t&r|n&~r)+(o>>>0)+i;return(e<<a|e>>>32-a)+t},y._hh=function(e,t,n,r,o,a,i){e=e+(t^n^r)+(o>>>0)+i;return(e<<a|e>>>32-a)+t},y._ii=function(e,t,n,r,o,a,i){e=e+(n^(t|~r))+(o>>>0)+i;return(e<<a|e>>>32-a)+t},y._blocksize=16,y._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);e=v.wordsToBytes(y(e,t));return t&&t.asBytes?e:t&&t.asString?w.bytesToString(e):v.bytesToHex(e)}});let Y=_;function Z(e,t,n){var r;e?(r=t,r={...r={app:c.appData,data:r,device:c.deviceData,lsi:Y,projectId:c.token,userAgent:c.uAgent||"",anonymousId:c.anonymousId,userId:c.distinctId},dataAbstract:K(JSON.stringify(r))},c.platform===u?wx.request({url:"event"===e?c.upEventUrl:c.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:c.token,projectId:c.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?c.upEventUrl:c.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:c.token,projectId:c.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")}let y,v,S,h,w,x,b;function G(){clearInterval(x),x=null,b=0,w=null,v=0,S=0}let Q=e=>{G(),w=e,I(r.ENTER),x=setInterval(()=>{I(r.LOOP)},15e3)},X=()=>{w&&I(r.LEAVE),G()};function I(e){e===r.ENTER?(h=1,y=0,b=randomUUID(),v=Date.now(),S=v):e===r.LOOP?(h=2,y=15,S=Date.now()):e===r.LEAVE&&(h=3,e=Math.max(1,(Date.now()-S)/1e3),y=Math.ceil(e));e={busSegment:w.busSegment||"",circulation:h,domain:w.domain,duration:y,module:w.module||"",path:w.path,url:w.url,sourceDomain:w.sourceDomain,sourceUrl:w.sourceUrl,properties:w.properties,title:w.title,traceId:"",trackId:g(),visitPage:w.visitPage,visitTime:m(v),uid:b};j(e,b)}let k="UNIBPNEventSrcData",ee="UNIBPNEventFailData";function te(t){var n=t.$page||"",e=n.path||((e=(e=getCurrentPages())[e.length-1])?e.route:"/"),n={utm:t.$utm||$(),duration:"",element:t.$element||null,eventId:t.$event_id||"",event:t.$event_code||"",groupId:"",busSegment:t.$busSegment||"",module:t.$module||"",page:{domain:n.domain||"",pageId:K(e),path:e||"",title:n.title||"",url:e||""},properties:t.$extend_param?JSON.stringify(t.$extend_param):"",traceId:"",trackId:g(),triggerTime:m(Date.now())};{t=n;let e;n=(e=(c.platform===u?wx:uni).getStorageSync(k))?JSON.parse(e):[];n.push(t),(c.platform===u?wx:uni).setStorageSync(k,JSON.stringify(n));return}}let T,N,O,A,D,P,E;function ne(){P&&U(r.LEAVE,null),clearInterval(A),A=null}function U(e,t){e===r.ENTER?(P=null,E=0,D=1,T=0,N=-1,O=-1,N=Date.now(),O=N,E=d(),P=(e=>{var t=getCurrentPages(),n=t[t.length-1],r=c.platform;let o="",a="",i="",u="";if("web"===r||"h5"===r?(o=window.location.href,a=window.location.hostname,document.referrer&&(r=new URL(document.referrer),i=r||"",u=r.hostname||"")):(o=n.route,i=(1<t.length?t[t.length-2]:n).route,a=c.domain||n.route),n)return{path:n.route,busSegment:e.busSegment||"",module:e.module||"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title||"",domain:a,url:o,visitPage:t.length,sourceDomain:u,sourceUrl:i}})(t),p.push(P.path)):e===r.LOOP?(D=2,T=15,O=Date.now()):e===r.LEAVE&&(D=3,t=Math.max(1,(Date.now()-O)/1e3),T=Math.ceil(t));e={busSegment:P.busSegment,circulation:D,domain:P.domain,duration:T,module:P.module,path:P.path,properties:P.properties,sourceDomain:P.sourceDomain,sourceUrl:P.sourceUrl,title:P.title,traceId:"",trackId:g(),url:P.url,visitPage:p.length,visitTime:m(N),utm:$(),uid:E};j(e,E)}let L=!1;function C(e){if(!c.isCompatible)if("pv"===e){var n=getCurrentPages();let t=n[n.length-1];c.signTrackArray&&c.signTrackArray.length&&(L=c.signTrackArray.find(e=>e===t.route))?L=!0:(L=!1,n=((t,e,n)=>{var r=l.find(e=>e.path===t),o=c.platform;let a="",i="",u="",s="";return o&&("web"===o||"h5"===o?(a=window.location.href,i=window.location.hostname,document.referrer&&(o=new URL(document.referrer),u=o||"",s=o.hostname||"")):(a=t,1<e&&(o=n[e-2],u=o.route),i=c.domain||t)),{path:r&&r.path?r.path:t,busSegment:r&&r.busSegment?r.busSegment:c.busSegment||"",module:r&&r.module?r.module:c.module||"",properties:r&&r.properties?r.properties:"",domain:i,url:a,visitPage:e,sourceDomain:s,sourceUrl:u,title:r&&r.title?r.title:""}})(t.route,n.length,n),Q(n))}else"leave"!==e||L||X()}let B=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"},c.upEventUrl=t.upEventApi,c.upTrackUrl=t.upTrackApi,t=Date.now().toString(),c.trackId=t,p=[],console.log("tId ",t),Object.assign(c,e),H(),clearInterval(B),B=null,B=setInterval(()=>{{let e=null,t=null;var n=[],r=(t=(c.platform===u?(e=wx.getStorageSync(k),wx.setStorageSync(k,""),wx):(e=uni.getStorageSync(k),uni.setStorageSync(k,""),uni)).getStorageSync(ee),e?JSON.parse(e):[]),o=t?JSON.parse(t):[];r.length&&n.push(...r),o.length&&n.push(...o),n&&n.length&&Z("event",n,ee)}{let e=null,t=null;r=[],t=(c.platform===u?(e=wx.getStorageSync(a),wx.setStorageSync(a,""),wx):(e=uni.getStorageSync(a),uni.setStorageSync(a,""),uni)).getStorageSync(i),o=e?JSON.parse(e):[],n=t?JSON.parse(t):[],o.length&&r.push(...o),n.length&&(r.push(...n),r.forEach(e=>{delete e.pageUUId})),r&&r.length&&Z("track",r,i)}},15e3),c.platform!==u&&(uni.addInterceptor("navigateTo",{invoke(e){C("leave")},success(e){C("pv")}}),uni.addInterceptor("switchTab",{invoke(e){C("leave")},success(e){C("pv")}}),uni.addInterceptor("navigateBack",{invoke(e){C("leave")},success(e){C("pv")}}))):console.log("init config error, please check config!")},e.onDestroyTrack=function(){ne()},e.onStartTrack=function(e){e=e,A&&ne(),e&&(clearInterval(A),U(r.ENTER,e),A=setInterval(()=>{U(r.LOOP,null)},15e3))},e.setCustomEvent=function(e){e&&te(e)},e.setPageExtraObj=function(e){{var n=getCurrentPages();let t=n[n.length-1];n=l.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?l[n]=e:l.push(e)}},e.setUserId=function(e){e?(c.distinctId=e,(c.platform===u?wx:uni).setStorageSync(o,e)):(c.distinctId="",c.platform===u?wx.setStorageSync(o,e):uni.setStorageSync(o,""))},Object.defineProperty(e,"__esModule",{value:!0})});
|