visual-buried-point-platform-uni 1.0.0-alpha.23 → 1.0.0-alpha.25
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/dist/buried-point-uni.js +1 -1
- package/dist/cjs/buried-point-uni.js +1 -0
- package/dist/esm/buried-point-uni.js +1 -0
- package/dist/umd/buried-point-uni.js +1 -0
- package/package.json +17 -8
- package/index.js +0 -176
package/dist/buried-point-uni.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see buried-point-uni.js.LICENSE.txt */
|
|
2
|
-
var e={151:e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.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("")}}};e.exports=t},206:e=>{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},503:(e,t,n)=>{!function(){var t=n(939),r=n(151).utf8,o=n(206),i=n(151).bin,a=function(e,n){e.constructor==String?e=n&&"binary"===n.encoding?i.stringToBytes(e):r.stringToBytes(e):o(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var u=t.bytesToWords(e),s=8*e.length,c=1732584193,l=-271733879,g=-1732584194,p=271733878,d=0;d<u.length;d++)u[d]=16711935&(u[d]<<8|u[d]>>>24)|4278255360&(u[d]<<24|u[d]>>>8);u[s>>>5]|=128<<s%32,u[14+(s+64>>>9<<4)]=s;var m=a._ff,f=a._gg,h=a._hh,v=a._ii;for(d=0;d<u.length;d+=16){var y=c,S=l,b=g,I=p;c=m(c,l,g,p,u[d+0],7,-680876936),p=m(p,c,l,g,u[d+1],12,-389564586),g=m(g,p,c,l,u[d+2],17,606105819),l=m(l,g,p,c,u[d+3],22,-1044525330),c=m(c,l,g,p,u[d+4],7,-176418897),p=m(p,c,l,g,u[d+5],12,1200080426),g=m(g,p,c,l,u[d+6],17,-1473231341),l=m(l,g,p,c,u[d+7],22,-45705983),c=m(c,l,g,p,u[d+8],7,1770035416),p=m(p,c,l,g,u[d+9],12,-1958414417),g=m(g,p,c,l,u[d+10],17,-42063),l=m(l,g,p,c,u[d+11],22,-1990404162),c=m(c,l,g,p,u[d+12],7,1804603682),p=m(p,c,l,g,u[d+13],12,-40341101),g=m(g,p,c,l,u[d+14],17,-1502002290),c=f(c,l=m(l,g,p,c,u[d+15],22,1236535329),g,p,u[d+1],5,-165796510),p=f(p,c,l,g,u[d+6],9,-1069501632),g=f(g,p,c,l,u[d+11],14,643717713),l=f(l,g,p,c,u[d+0],20,-373897302),c=f(c,l,g,p,u[d+5],5,-701558691),p=f(p,c,l,g,u[d+10],9,38016083),g=f(g,p,c,l,u[d+15],14,-660478335),l=f(l,g,p,c,u[d+4],20,-405537848),c=f(c,l,g,p,u[d+9],5,568446438),p=f(p,c,l,g,u[d+14],9,-1019803690),g=f(g,p,c,l,u[d+3],14,-187363961),l=f(l,g,p,c,u[d+8],20,1163531501),c=f(c,l,g,p,u[d+13],5,-1444681467),p=f(p,c,l,g,u[d+2],9,-51403784),g=f(g,p,c,l,u[d+7],14,1735328473),c=h(c,l=f(l,g,p,c,u[d+12],20,-1926607734),g,p,u[d+5],4,-378558),p=h(p,c,l,g,u[d+8],11,-2022574463),g=h(g,p,c,l,u[d+11],16,1839030562),l=h(l,g,p,c,u[d+14],23,-35309556),c=h(c,l,g,p,u[d+1],4,-1530992060),p=h(p,c,l,g,u[d+4],11,1272893353),g=h(g,p,c,l,u[d+7],16,-155497632),l=h(l,g,p,c,u[d+10],23,-1094730640),c=h(c,l,g,p,u[d+13],4,681279174),p=h(p,c,l,g,u[d+0],11,-358537222),g=h(g,p,c,l,u[d+3],16,-722521979),l=h(l,g,p,c,u[d+6],23,76029189),c=h(c,l,g,p,u[d+9],4,-640364487),p=h(p,c,l,g,u[d+12],11,-421815835),g=h(g,p,c,l,u[d+15],16,530742520),c=v(c,l=h(l,g,p,c,u[d+2],23,-995338651),g,p,u[d+0],6,-198630844),p=v(p,c,l,g,u[d+7],10,1126891415),g=v(g,p,c,l,u[d+14],15,-1416354905),l=v(l,g,p,c,u[d+5],21,-57434055),c=v(c,l,g,p,u[d+12],6,1700485571),p=v(p,c,l,g,u[d+3],10,-1894986606),g=v(g,p,c,l,u[d+10],15,-1051523),l=v(l,g,p,c,u[d+1],21,-2054922799),c=v(c,l,g,p,u[d+8],6,1873313359),p=v(p,c,l,g,u[d+15],10,-30611744),g=v(g,p,c,l,u[d+6],15,-1560198380),l=v(l,g,p,c,u[d+13],21,1309151649),c=v(c,l,g,p,u[d+4],6,-145523070),p=v(p,c,l,g,u[d+11],10,-1120210379),g=v(g,p,c,l,u[d+2],15,718787259),l=v(l,g,p,c,u[d+9],21,-343485551),c=c+y>>>0,l=l+S>>>0,g=g+b>>>0,p=p+I>>>0}return t.endian([c,l,g,p])};a._ff=function(e,t,n,r,o,i,a){var u=e+(t&n|~t&r)+(o>>>0)+a;return(u<<i|u>>>32-i)+t},a._gg=function(e,t,n,r,o,i,a){var u=e+(t&r|n&~r)+(o>>>0)+a;return(u<<i|u>>>32-i)+t},a._hh=function(e,t,n,r,o,i,a){var u=e+(t^n^r)+(o>>>0)+a;return(u<<i|u>>>32-i)+t},a._ii=function(e,t,n,r,o,i,a){var u=e+(n^(t|~r))+(o>>>0)+a;return(u<<i|u>>>32-i)+t},a._blocksize=16,a._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(a(e,n));return n&&n.asBytes?r:n&&n.asString?i.bytesToString(r):t.bytesToHex(r)}}()},939:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var o=e[r]<<16|e[r+1]<<8|e[r+2],i=0;i<4;i++)8*r+6*i<=8*e.length?n.push(t.charAt(o>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,o=0;r<e.length;o=++r%4)0!=o&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|t.indexOf(e.charAt(r))>>>6-2*o);return n}},e.exports=n}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};n.d(r,{DU:()=>te,Ts:()=>X,p6:()=>oe,Pq:()=>re,Bm:()=>ae,Ex:()=>ne,dL:()=>ie,do:()=>ee});var o=n(503);let i={domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[]},a=[];const u=()=>{if(i.trackId)return i.trackId;const e=Date.now().toString();return i.trackId=e,e};function s(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,(function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function c(e){const t=new Date(e);return`${t.getFullYear()}-${t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1}-${t.getDate()<10?"0"+t.getDate():t.getDate()} ${t.getHours()<10?"0"+t.getHours():t.getHours()}:${t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes()}:${t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds()}`}function l(e){if("web"===i.platform||"h5"===i.platform){const t=e.ua.toLowerCase();return/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)}return"pc"===e.deviceType?1:2}function g(){if("web"===i.platform||"h5"===i.platform){let e={utmSource:"",utmCampaign:"",utmTerm:"",utmContent:"",ctk:""};if(window.location.href){const t=window.location.href.split("?")[1]||"";if(t){const n=new URLSearchParams(t);e.utmSource=n.get("utmSource")||"",e.utmCampaign=n.get("utmCampaign")||"",e.utmTerm=n.get("utmTerm")||"",e.utmContent=n.get("utmContent")||"",e.ctk=n.get("ctk")||""}}return e}return null}const p="enter",d="loop",m="leave",f="UNIBPNPVUVSrcData",h="UNIBPNPVUVFailData";let v,y,S,b,I,w=null,k=null;const T=e=>{w?U():(clearInterval(w),v=0,y=0,S=0,b=1,I=null,w=null,k=0,I=e,x(p),w=setInterval((()=>{x(d)}),15e3))},U=()=>{x(m),clearInterval(w)};function x(e){if(e===p?(b=1,v=0,y=Date.now(),S=y,k=s()):e===d?(b=2,v=15,S=Date.now()):e===m&&(b=3,v=Math.ceil((Date.now()-S)/1e3)),I){const e={busSegment:I.busSegment||"",circulation:b,domain:I.domain,duration:v,module:I.module||"",path:I.path,url:I.url,sourceDomain:I.sourceDomain,sourceUrl:I.sourceUrl,properties:I.properties,title:I.title,traceId:"",trackId:u(),visitPage:I.visitPage,visitTime:c(y),pageUUId:k};e&&N(e,k)}}function N(e,t){let n=uni.getStorageSync(f),r=n?JSON.parse(n):[];if(r.length>0){const n=r.findIndex((e=>e.pageUUId===t));-1!==n?r[n]={...r[n],...e}:r.push(e)}else r.push(e);uni.setStorageSync(f,JSON.stringify(r))}const P=e=>{if("object"==typeof e){const t=Array.isArray(e)?[]:{};for(const n in e)"object"==typeof e[n]?t[n]=P(e[n]):t[n]=e[n];return t}return e},B=[],O=e=>{B.push(e)},D=()=>P(B),A=()=>{B.length=0},_="UNIBPNEventSrcData",C="UNIBPNEventFailData";let $;let E=0,M=0,J=0,L=-1,j=null,V=null,H=0;const q=e=>{V?z():e&&(clearInterval(V),E=0,M=0,J=0,L=1,j=null,V=null,H=0,R(p,e),V=setInterval((()=>{R(d,null)}),15e3))},z=()=>{R(m,null),clearInterval(V)};function R(e,t){e===p?(H=s(),M=Date.now(),J=M,j=function(e){const t=getCurrentPages(),n=t[t.length-1];let r=i.platform,o="",a="",u="",s="";if(r)if("web"===r||"h5"===r){if(o=window.location.href,a=window.location.hostname,document.referrer){let e=new URL(document.referrer);u=e||"",s=e.hostname||""}}else o=n.route,t.length>1&&(u=t[t.length-2].route),a=i.domain?i.domain:n.route;if(n)return{path:n.route,busSegment:e.busSegment?e.busSegment:"",module:e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title?e.title:"",domain:a,url:o,visitPage:t.length,sourceDomain:s,sourceUrl:u}}(t)):e===d?(L=2,E=15,J=Date.now()):e===m&&(L=3,E=Math.ceil((Date.now()-J)/1e3));const n={busSegment:j.busSegment,circulation:L,domain:j.domain,duration:E,module:j.module,path:j.path,properties:j.properties,sourceDomain:j.sourceDomain,sourceUrl:j.sourceUrl,title:j.title,traceId:"",trackId:u(),url:j.url,visitPage:j.visitPage,visitTime:c(M),utm:g(),pageUUId:H};n&&(console.log("写入ml数据:",n),N(n,H))}let F=!1;function W(e){if(i.isCompatible);else if("pv"===e){const e=getCurrentPages(),t=e[e.length-1];if(i.signTrackArray&&i.signTrackArray.length&&(F=i.signTrackArray.find((e=>e===t.route)),F))return void(F=!0);F=!1;const n=function(e,t,n){let r=a.find((t=>t.path===e)),o=i.platform,u="",s="",c="",l="";if(o)if("web"===o||"h5"===o){if(u=window.location.href,s=window.location.hostname,document.referrer){let e=new URL(document.referrer);c=e||"",l=e.hostname||""}}else u=e,t>1&&(c=n[t-2].route),s=i.domain?i.domain:e;return{path:r&&r.path?r.path:e,busSegment:r&&r.busSegment?r.busSegment:i.busSegment||"",module:r&&r.module?r.module:i.module||"",properties:r&&r.properties?r.properties:"",domain:s,url:u,visitPage:t,sourceDomain:l,sourceUrl:c,title:r&&r.title?r.title:""}}(t.route,e.length,e);T(n)}else"leave"===e&&(F||U())}const K=JSON.parse('{"dr":"c3a3572a7a0facff92ab2afbbcd94dd6#1.0.0-alpha.22"}').dr;let Y={distinctId:"",anonymousId:""},Z={},G={},Q=null;function X(e){if(e){let t="test"===(e.env?e.env:"")?{reportUrl:"https://buryingpoint.gcongo.com.cn/client/api/event",reportTrackUrl:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListUrl:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}:{reportUrl:"https://buryingpoint.onebuygz.com/client/api/event",reportTrackUrl:"https://buryingpoint.onebuygz.com/client/api/track",eventListUrl:"https://buryingpoint.onebuygz.com/api/event/query/eventList"};i.upEventUrl=t.reportUrl,i.upTrackUrl=t.reportTrackUrl,Object.assign(i,e),uni.getSystemInfo({success:function(e){i.uAgent=e.ua;let t=e.uniPlatform;if(t.includes("app"))i.platform=e.osName,Z=function(e){let t=plus.runtime.version,n={name:e.appName,version:t||"",carrier:"app",packageName:"",ecology:""};if("android"===e.platform){let t="Android",r=plus.android.runtimeMainActivity().getPackageName();e.romName.includes("HarmonyOS")&&(t="Harmony OS"),n.packageName=r||"",n.ecology=t}else if("ios"===e.platform){let e=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier();n.packageName=e||"",n.ecology="iOS"}else n.ecology="unknown";return n}(e);else if(t.includes("web")||t.includes("h5")){i.platform=t;let n=function(e){let t="unknown",n=e.ua.toLowerCase(),r=window.location.hostname,o=document.title;return t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(n)?"app":"brower",n.includes("alipay")?t="alipay":n.includes("unionPay")?t="unionPay":n.includes("onbuygz")?t="onbuygz":n.includes("onetravel")&&(t="onetravel"),n.includes("micromessenger")&&(t=n.includes("miniprogram")?"wechat":"brower"),{name:o||"",packageName:r||"",version:"",carrier:"h5",ecology:"h5"}}(e);Z={...n,version:i.version?i.version:"unknown"}}else t.includes("weixin")&&(i.platform="weixin",Z=function(){const e=uni.getAccountInfoSync(),t=uni.getAppBaseInfo();return{name:t.appName?t.appName:"",packageName:e?e.miniProgram.appId:"",version:e?e.miniProgram.envVersion+e.miniProgram.version:"",carrier:"mini",ecology:"mini"}}());G=function(e){return{lang:e.osLanguage?e.osLanguage:e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os:e.osName,osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:l(e),network:""}}(e)},fail:function(e){G={lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}},complete:function(){uni.getNetworkType({success(e){G.network=e.networkType}})}}),Y.distinctId=uni.getStorageSync("v_userId")?uni.getStorageSync("v_userId"):"",Y.anonymousId=uni.getStorageSync("v_anonId"),Y.anonymousId||(Y.anonymousId=s(),uni.setStorageSync("v_anonId",Y.anonymousId)),u()}else console.log("init config error, please check config!");clearInterval(Q),Q=setInterval((()=>{!function(){let e=uni.getStorageSync(_);uni.setStorageSync(_,"");const t=e?JSON.parse(e):[];let n=[],r=uni.getStorageSync(C);const o=r?JSON.parse(r):[];t.length&&n.push(...t),o.length&&n.push(...o),n&&n.length&&(console.log("queryEventUpload:"),ae("event",n,C))}(),function(){let e=uni.getStorageSync(f);uni.setStorageSync(f,"");const t=e?JSON.parse(e):[];let n=[],r=uni.getStorageSync(h);const o=r?JSON.parse(r):[];t.length&&n.push(...t),o.length&&n.push(...o),n&&n.length&&(n.forEach((e=>{delete e.pageUUId})),console.log("queryTrackDataUpload"),ae("track",n,h))}()}),15e3),uni.addInterceptor("navigateTo",{invoke(e){W("leave")},success(e){W("pv")}}),uni.addInterceptor("switchTab",{invoke(e){W("leave")},success(e){W("pv")}}),uni.addInterceptor("navigateBack",{invoke(e){W("leave")},success(e){W("pv")}})}function ee(e){e?(Y.distinctId=e,uni.setStorageSync("v_userId",e)):(Y.distinctId="",uni.setStorageSync("v_userId",""))}function te(){return u()}function ne(e){!function(e){const t=e.$page?e.$page:"",n=t.path?t.path:function(){const e=getCurrentPages(),t=e[e.length-1];return t?t.route:"/"}(),r={utm:e.$utm?e.$utm:g(),duration:"",element:e.$element?e.$element:null,eventId:e.$event_id?e.$event_id:"",event:e.$event_code?e.$event_code:"",groupId:"",busSegment:e.$busSegment?e.$busSegment:"",module:e.$module?e.$module:"",page:{domain:t.domain?t.domain:"",pageId:o(n),path:n||"",title:t.title||"",url:n||""},properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:u(),triggerTime:c(Date.now())};r&&(O(r),clearTimeout($),$=setTimeout((()=>{const e=D();e.length&&(function(e){const t=uni.getStorageSync(_);let n=t?JSON.parse(t):[];e&&e.length&&(e.forEach((e=>{n.push(e)})),uni.setStorageSync(_,JSON.stringify(n)))}(e),A())}),2e3))}(e)}function re(e){q(e)}function oe(){z()}function ie(e){!function(e){const t=getCurrentPages();let n=t[t.length-1];const r=a.findIndex((e=>e.path===n.route));let o={path:n.route,properties:e.properties?JSON.stringify(e.properties):"",busSegment:e.busSegment?e.busSegment:"",module:e.module?e.module:"",title:e.title?e.title:""};-1!==r?a[r]=o:a.push(o)}(e)}function ae(e,t,n){if(!e)return void console.error("please set upload data upType");const r={app:Z,data:t,device:G,lsi:K,projectId:i.token,userAgent:i.uAgent||"",anonymousId:Y.anonymousId,userId:Y.distinctId},a={...r,dataAbstract:o(JSON.stringify(r))};uni.request({url:"event"===e?i.upEventUrl:i.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:i.token,projectId:i.token},data:a,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))}})}var ue=r.DU,se=r.Ts,ce=r.p6,le=r.Pq,ge=r.Bm,pe=r.Ex,de=r.dL,me=r.do;export{ue as getTrackId,se as init,ce as onDestroyTrack,le as onStartTrack,ge as reportTrackEventServer,pe as setCustomEvent,de as setPageExtraObj,me as setUserId};
|
|
2
|
+
var e={151:e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.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("")}}};e.exports=t},206:e=>{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))}(e)||!!e._isBuffer)}},503:(e,t,n)=>{!function(){var t=n(939),r=n(151).utf8,o=n(206),i=n(151).bin,a=function(e,n){e.constructor==String?e=n&&"binary"===n.encoding?i.stringToBytes(e):r.stringToBytes(e):o(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var u=t.bytesToWords(e),c=8*e.length,s=1732584193,l=-271733879,p=-1732584194,f=271733878,g=0;g<u.length;g++)u[g]=16711935&(u[g]<<8|u[g]>>>24)|4278255360&(u[g]<<24|u[g]>>>8);u[c>>>5]|=128<<c%32,u[14+(c+64>>>9<<4)]=c;var m=a._ff,d=a._gg,y=a._hh,v=a._ii;for(g=0;g<u.length;g+=16){var b=s,h=l,S=p,w=f;s=m(s,l,p,f,u[g+0],7,-680876936),f=m(f,s,l,p,u[g+1],12,-389564586),p=m(p,f,s,l,u[g+2],17,606105819),l=m(l,p,f,s,u[g+3],22,-1044525330),s=m(s,l,p,f,u[g+4],7,-176418897),f=m(f,s,l,p,u[g+5],12,1200080426),p=m(p,f,s,l,u[g+6],17,-1473231341),l=m(l,p,f,s,u[g+7],22,-45705983),s=m(s,l,p,f,u[g+8],7,1770035416),f=m(f,s,l,p,u[g+9],12,-1958414417),p=m(p,f,s,l,u[g+10],17,-42063),l=m(l,p,f,s,u[g+11],22,-1990404162),s=m(s,l,p,f,u[g+12],7,1804603682),f=m(f,s,l,p,u[g+13],12,-40341101),p=m(p,f,s,l,u[g+14],17,-1502002290),s=d(s,l=m(l,p,f,s,u[g+15],22,1236535329),p,f,u[g+1],5,-165796510),f=d(f,s,l,p,u[g+6],9,-1069501632),p=d(p,f,s,l,u[g+11],14,643717713),l=d(l,p,f,s,u[g+0],20,-373897302),s=d(s,l,p,f,u[g+5],5,-701558691),f=d(f,s,l,p,u[g+10],9,38016083),p=d(p,f,s,l,u[g+15],14,-660478335),l=d(l,p,f,s,u[g+4],20,-405537848),s=d(s,l,p,f,u[g+9],5,568446438),f=d(f,s,l,p,u[g+14],9,-1019803690),p=d(p,f,s,l,u[g+3],14,-187363961),l=d(l,p,f,s,u[g+8],20,1163531501),s=d(s,l,p,f,u[g+13],5,-1444681467),f=d(f,s,l,p,u[g+2],9,-51403784),p=d(p,f,s,l,u[g+7],14,1735328473),s=y(s,l=d(l,p,f,s,u[g+12],20,-1926607734),p,f,u[g+5],4,-378558),f=y(f,s,l,p,u[g+8],11,-2022574463),p=y(p,f,s,l,u[g+11],16,1839030562),l=y(l,p,f,s,u[g+14],23,-35309556),s=y(s,l,p,f,u[g+1],4,-1530992060),f=y(f,s,l,p,u[g+4],11,1272893353),p=y(p,f,s,l,u[g+7],16,-155497632),l=y(l,p,f,s,u[g+10],23,-1094730640),s=y(s,l,p,f,u[g+13],4,681279174),f=y(f,s,l,p,u[g+0],11,-358537222),p=y(p,f,s,l,u[g+3],16,-722521979),l=y(l,p,f,s,u[g+6],23,76029189),s=y(s,l,p,f,u[g+9],4,-640364487),f=y(f,s,l,p,u[g+12],11,-421815835),p=y(p,f,s,l,u[g+15],16,530742520),s=v(s,l=y(l,p,f,s,u[g+2],23,-995338651),p,f,u[g+0],6,-198630844),f=v(f,s,l,p,u[g+7],10,1126891415),p=v(p,f,s,l,u[g+14],15,-1416354905),l=v(l,p,f,s,u[g+5],21,-57434055),s=v(s,l,p,f,u[g+12],6,1700485571),f=v(f,s,l,p,u[g+3],10,-1894986606),p=v(p,f,s,l,u[g+10],15,-1051523),l=v(l,p,f,s,u[g+1],21,-2054922799),s=v(s,l,p,f,u[g+8],6,1873313359),f=v(f,s,l,p,u[g+15],10,-30611744),p=v(p,f,s,l,u[g+6],15,-1560198380),l=v(l,p,f,s,u[g+13],21,1309151649),s=v(s,l,p,f,u[g+4],6,-145523070),f=v(f,s,l,p,u[g+11],10,-1120210379),p=v(p,f,s,l,u[g+2],15,718787259),l=v(l,p,f,s,u[g+9],21,-343485551),s=s+b>>>0,l=l+h>>>0,p=p+S>>>0,f=f+w>>>0}return t.endian([s,l,p,f])};a._ff=function(e,t,n,r,o,i,a){var u=e+(t&n|~t&r)+(o>>>0)+a;return(u<<i|u>>>32-i)+t},a._gg=function(e,t,n,r,o,i,a){var u=e+(t&r|n&~r)+(o>>>0)+a;return(u<<i|u>>>32-i)+t},a._hh=function(e,t,n,r,o,i,a){var u=e+(t^n^r)+(o>>>0)+a;return(u<<i|u>>>32-i)+t},a._ii=function(e,t,n,r,o,i,a){var u=e+(n^(t|~r))+(o>>>0)+a;return(u<<i|u>>>32-i)+t},a._blocksize=16,a._digestsize=16,e.exports=function(e,n){if(null==e)throw new Error("Illegal argument "+e);var r=t.wordsToBytes(a(e,n));return n&&n.asBytes?r:n&&n.asString?i.bytesToString(r):t.bytesToHex(r)}}()},939:e=>{var t,n;t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&n.rotl(e,8)|4278255360&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var n=[],r=0;r<e.length;r+=3)for(var o=e[r]<<16|e[r+1]<<8|e[r+2],i=0;i<4;i++)8*r+6*i<=8*e.length?n.push(t.charAt(o>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var n=[],r=0,o=0;r<e.length;o=++r%4)0!=o&&n.push((t.indexOf(e.charAt(r-1))&Math.pow(2,-2*o+8)-1)<<2*o|t.indexOf(e.charAt(r))>>>6-2*o);return n}},e.exports=n}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var r={};n.d(r,{DU:()=>me,Ts:()=>fe,p6:()=>ve,Pq:()=>ye,Bm:()=>he,Ex:()=>de,dL:()=>be,do:()=>ge});var o=n(503),i={domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[]},a=[],u=function(){if(i.trackId)return i.trackId;var e=Date.now().toString();return i.trackId=e,e};function c(){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 s(e){var t=new Date(e),n=t.getFullYear(),r=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,o=t.getDate()<10?"0"+t.getDate():t.getDate(),i=t.getHours()<10?"0"+t.getHours():t.getHours(),a=t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes(),u=t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds();return"".concat(n,"-").concat(r,"-").concat(o," ").concat(i,":").concat(a,":").concat(u)}function l(e){if("web"===i.platform||"h5"===i.platform){var t=e.ua.toLowerCase();return/(windows|win32|win64|wow64)/.test(t)?1:(/(linux|android)/.test(t)||/(macintosh|mac os x|iphone|ipad|ipod)/.test(t),2)}return"pc"===e.deviceType?1:2}function p(){if("web"===i.platform||"h5"===i.platform){var e={utmSource:"",utmCampaign:"",utmTerm:"",utmContent:"",ctk:""};if(window.location.href){var t=window.location.href.split("?")[1]||"";if(t){var n=new URLSearchParams(t);e.utmSource=n.get("utmSource")||"",e.utmCampaign=n.get("utmCampaign")||"",e.utmTerm=n.get("utmTerm")||"",e.utmContent=n.get("utmContent")||"",e.ctk=n.get("ctk")||""}}return e}return null}function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function g(e){return function(e){if(Array.isArray(e))return m(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return m(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?m(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function m(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function v(e,t,n){return(t=function(e){var t=function(e){if("object"!=f(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==f(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var b,h,S,w,I,O="enter",T="loop",k="leave",P="UNIBPNPVUVSrcData",U="UNIBPNPVUVFailData",j=null,x=null,A=function(e){j?N():(clearInterval(j),b=0,h=0,S=0,w=1,I=null,j=null,x=0,I=e,D(O),j=setInterval((function(){D(T)}),15e3))},N=function(){D(k),clearInterval(j)};function D(e){if(e===O?(w=1,b=0,h=Date.now(),S=h,x=c()):e===T?(w=2,b=15,S=Date.now()):e===k&&(w=3,b=Math.ceil((Date.now()-S)/1e3)),I){var t={busSegment:I.busSegment||"",circulation:w,domain:I.domain,duration:b,module:I.module||"",path:I.path,url:I.url,sourceDomain:I.sourceDomain,sourceUrl:I.sourceUrl,properties:I.properties,title:I.title,traceId:"",trackId:u(),visitPage:I.visitPage,visitTime:s(h),pageUUId:x};t&&B(t,x)}}function B(e,t){var n=uni.getStorageSync(P),r=n?JSON.parse(n):[];if(r.length>0){var o=r.findIndex((function(e){return e.pageUUId===t}));-1!==o?r[o]=y(y({},r[o]),e):r.push(e)}else r.push(e);uni.setStorageSync(P,JSON.stringify(r))}function C(e){return C="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},C(e)}var E=function(e){if("object"===C(e)){var t=Array.isArray(e)?[]:{};for(var n in e)"object"==C(e[n])?t[n]=E(e[n]):t[n]=e[n];return t}return e},_=[],M=function(e){_.push(e)},$=function(){return E(_)},J=function(){_.length=0};function L(e){return function(e){if(Array.isArray(e))return V(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return V(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?V(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var H,q="UNIBPNEventSrcData",z="UNIBPNEventFailData";var R=0,F=0,W=0,K=-1,Y=null,Z=null,G=0,Q=function(e){Z?X():e&&(clearInterval(Z),R=0,F=0,W=0,K=1,Y=null,Z=null,G=0,ee(O,e),Z=setInterval((function(){ee(T,null)}),15e3))},X=function(){ee(k,null),clearInterval(Z)};function ee(e,t){e===O?(G=c(),F=Date.now(),W=F,Y=function(e){var t=getCurrentPages(),n=t[t.length-1],r=i.platform,o="",a="",u="",c="";if(r)if("web"===r||"h5"===r){if(o=window.location.href,a=window.location.hostname,document.referrer){var s=new URL(document.referrer);u=s||"",c=s.hostname||""}}else o=n.route,t.length>1&&(u=t[t.length-2].route),a=i.domain?i.domain:n.route;if(n)return{path:n.route,busSegment:e.busSegment?e.busSegment:"",module:e.module?e.module:"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title?e.title:"",domain:a,url:o,visitPage:t.length,sourceDomain:c,sourceUrl:u}}(t)):e===T?(K=2,R=15,W=Date.now()):e===k&&(K=3,R=Math.ceil((Date.now()-W)/1e3));var n={busSegment:Y.busSegment,circulation:K,domain:Y.domain,duration:R,module:Y.module,path:Y.path,properties:Y.properties,sourceDomain:Y.sourceDomain,sourceUrl:Y.sourceUrl,title:Y.title,traceId:"",trackId:u(),url:Y.url,visitPage:Y.visitPage,visitTime:s(F),utm:p(),pageUUId:G};n&&(console.log("写入ml数据:",n),B(n,G))}var te=!1;function ne(e){if(i.isCompatible);else if("pv"===e){var t=getCurrentPages(),n=t[t.length-1];if(i.signTrackArray&&i.signTrackArray.length&&(te=i.signTrackArray.find((function(e){return e===n.route}))))return void(te=!0);te=!1;var r=function(e,t,n){var r=a.find((function(t){return t.path===e})),o=i.platform,u="",c="",s="",l="";if(o)if("web"===o||"h5"===o){if(u=window.location.href,c=window.location.hostname,document.referrer){var p=new URL(document.referrer);s=p||"",l=p.hostname||""}}else u=e,t>1&&(s=n[t-2].route),c=i.domain?i.domain:e;return{path:r&&r.path?r.path:e,busSegment:r&&r.busSegment?r.busSegment:i.busSegment||"",module:r&&r.module?r.module:i.module||"",properties:r&&r.properties?r.properties:"",domain:c,url:u,visitPage:t,sourceDomain:l,sourceUrl:s,title:r&&r.title?r.title:""}}(n.route,t.length,t);A(r)}else"leave"===e&&(te||N())}function re(e){return re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},re(e)}function oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ie(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oe(Object(n),!0).forEach((function(t){ae(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oe(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ae(e,t,n){return(t=function(e){var t=function(e){if("object"!=re(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==re(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var ue=JSON.parse('{"dr":"5cd44ae734c98be777d389d6fac4a94b#1.0.0-alpha.24"}').dr,ce={distinctId:"",anonymousId:""},se={},le={},pe=null;function fe(e){if(e){var t="test"===(e.env?e.env:"")?{reportUrl:"https://buryingpoint.gcongo.com.cn/client/api/event",reportTrackUrl:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListUrl:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}:{reportUrl:"https://buryingpoint.onebuygz.com/client/api/event",reportTrackUrl:"https://buryingpoint.onebuygz.com/client/api/track",eventListUrl:"https://buryingpoint.onebuygz.com/api/event/query/eventList"};i.upEventUrl=t.reportUrl,i.upTrackUrl=t.reportTrackUrl,Object.assign(i,e),uni.getSystemInfo({success:function(e){i.uAgent=e.ua;var t,n,r,o,a,u=e.uniPlatform;if(u.includes("app"))i.platform=e.osName,se=function(e){var t=plus.runtime.version,n={name:e.appName,version:t||"",carrier:"app",packageName:"",ecology:""};if("android"===e.platform){var r="Android",o=plus.android.runtimeMainActivity().getPackageName();e.romName.includes("HarmonyOS")&&(r="Harmony OS"),n.packageName=o||"",n.ecology=r}else if("ios"===e.platform){var i=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier();n.packageName=i||"",n.ecology="iOS"}else n.ecology="unknown";return n}(e);else if(u.includes("web")||u.includes("h5")){i.platform=u;var c=(r=e.ua.toLowerCase(),o=window.location.hostname,a=document.title,/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(r),r.includes("alipay")||r.includes("unionPay")||r.includes("onbuygz")||r.includes("onetravel"),r.includes("micromessenger")&&r.includes("miniprogram"),{name:a||"",packageName:o||"",version:"",carrier:"h5",ecology:"h5"});se=ie(ie({},c),{},{version:i.version?i.version:"unknown"})}else u.includes("weixin")&&(i.platform="weixin",t=uni.getAccountInfoSync(),n=uni.getAppBaseInfo(),se={name:n.appName?n.appName:"",packageName:t?t.miniProgram.appId:"",version:t?t.miniProgram.envVersion+t.miniProgram.version:"",carrier:"mini",ecology:"mini"});le=function(e){return{lang:e.osLanguage?e.osLanguage:e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os:e.osName,osVersion:e.osVersion,resolution:e.screenWidth+"x"+e.screenHeight,browser:e.browserName,browserVersion:e.browserVersion,color:"",deviceId:e.deviceId,deviceType:l(e),network:""}}(e)},fail:function(e){le={lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}},complete:function(){uni.getNetworkType({success:function(e){le.network=e.networkType}})}}),ce.distinctId=uni.getStorageSync("v_userId")?uni.getStorageSync("v_userId"):"",ce.anonymousId=uni.getStorageSync("v_anonId"),ce.anonymousId||(ce.anonymousId=c(),uni.setStorageSync("v_anonId",ce.anonymousId)),u()}else console.log("init config error, please check config!");clearInterval(pe),pe=setInterval((function(){!function(){var e=uni.getStorageSync(q);uni.setStorageSync(q,"");var t=e?JSON.parse(e):[],n=[],r=uni.getStorageSync(z),o=r?JSON.parse(r):[];t.length&&n.push.apply(n,L(t)),o.length&&n.push.apply(n,L(o)),n&&n.length&&(console.log("queryEventUpload:"),he("event",n,z))}(),function(){var e=uni.getStorageSync(P);uni.setStorageSync(P,"");var t=e?JSON.parse(e):[],n=[],r=uni.getStorageSync(U),o=r?JSON.parse(r):[];t.length&&n.push.apply(n,g(t)),o.length&&n.push.apply(n,g(o)),n&&n.length&&(n.forEach((function(e){delete e.pageUUId})),console.log("queryTrackDataUpload"),he("track",n,U))}()}),15e3),uni.addInterceptor("navigateTo",{invoke:function(e){ne("leave")},success:function(e){ne("pv")}}),uni.addInterceptor("switchTab",{invoke:function(e){ne("leave")},success:function(e){ne("pv")}}),uni.addInterceptor("navigateBack",{invoke:function(e){ne("leave")},success:function(e){ne("pv")}})}function ge(e){e?(ce.distinctId=e,uni.setStorageSync("v_userId",e)):(ce.distinctId="",uni.setStorageSync("v_userId",""))}function me(){return u()}function de(e){var t,n,r,i,a,c;i=(t=e).$page?t.$page:"",a=i.path?i.path:(r=(n=getCurrentPages())[n.length-1])?r.route:"/",(c={utm:t.$utm?t.$utm:p(),duration:"",element:t.$element?t.$element:null,eventId:t.$event_id?t.$event_id:"",event:t.$event_code?t.$event_code:"",groupId:"",busSegment:t.$busSegment?t.$busSegment:"",module:t.$module?t.$module:"",page:{domain:i.domain?i.domain:"",pageId:o(a),path:a||"",title:i.title||"",url:a||""},properties:t.$extend_param?JSON.stringify(t.$extend_param):"",traceId:"",trackId:u(),triggerTime:s(Date.now())})&&(M(c),clearTimeout(H),H=setTimeout((function(){var e,t,n,r=$();r.length&&(e=r,t=uni.getStorageSync(q),n=t?JSON.parse(t):[],e&&e.length&&(e.forEach((function(e){n.push(e)})),uni.setStorageSync(q,JSON.stringify(n))),J())}),2e3))}function ye(e){Q(e)}function ve(){X()}function be(e){var t,n,r,o,i;t=e,n=getCurrentPages(),r=n[n.length-1],o=a.findIndex((function(e){return e.path===r.route})),i={path:r.route,properties:t.properties?JSON.stringify(t.properties):"",busSegment:t.busSegment?t.busSegment:"",module:t.module?t.module:"",title:t.title?t.title:""},-1!==o?a[o]=i:a.push(i)}function he(e,t,n){if(e){var r={app:se,data:t,device:le,lsi:ue,projectId:i.token,userAgent:i.uAgent||"",anonymousId:ce.anonymousId,userId:ce.distinctId},a=ie(ie({},r),{},{dataAbstract:o(JSON.stringify(r))});uni.request({url:"event"===e?i.upEventUrl:i.upTrackUrl,method:"POST",header:{"Content-Type":"application/json",appKey:i.token,projectId:i.token},data:a,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))}})}else console.error("please set upload data upType")}var Se=r.DU,we=r.Ts,Ie=r.p6,Oe=r.Pq,Te=r.Bm,ke=r.Ex,Pe=r.dL,Ue=r.do;export{Se as getTrackId,we as init,Ie as onDestroyTrack,Oe as onStartTrack,Te as reportTrackEventServer,ke as setCustomEvent,Pe as setPageExtraObj,Ue as setUserId};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}Object.defineProperty(exports,"__esModule",{value:!0});var crypt=createCommonjsModule(function(e){var a,r;a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={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&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=r.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=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(e){for(var t=[],r=0;r<e.length;r+=3)for(var n=e[r]<<16|e[r+1]<<8|e[r+2],o=0;o<4;o++)8*r+6*o<=8*e.length?t.push(a.charAt(n>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],r=0,n=0;r<e.length;n=++r%4)0!=n&&t.push((a.indexOf(e.charAt(r-1))&Math.pow(2,-2*n+8)-1)<<2*n|a.indexOf(e.charAt(r))>>>6-2*n);return t}},e.exports=r}),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=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));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?y:b).stringToBytes(e):h(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var r=T.bytesToWords(e),t=8*e.length,n=1732584193,o=-271733879,a=-1732584194,i=271733878,u=0;u<r.length;u++)r[u]=16711935&(r[u]<<8|r[u]>>>24)|4278255360&(r[u]<<24|r[u]>>>8);r[t>>>5]|=128<<t%32,r[14+(64+t>>>9<<4)]=t;for(var l=v._ff,c=v._gg,s=v._hh,p=v._ii,u=0;u<r.length;u+=16){var g=n,m=o,d=a,f=i,n=l(n,o,a,i,r[u+0],7,-680876936),i=l(i,n,o,a,r[u+1],12,-389564586),a=l(a,i,n,o,r[u+2],17,606105819),o=l(o,a,i,n,r[u+3],22,-1044525330);n=l(n,o,a,i,r[u+4],7,-176418897),i=l(i,n,o,a,r[u+5],12,1200080426),a=l(a,i,n,o,r[u+6],17,-1473231341),o=l(o,a,i,n,r[u+7],22,-45705983),n=l(n,o,a,i,r[u+8],7,1770035416),i=l(i,n,o,a,r[u+9],12,-1958414417),a=l(a,i,n,o,r[u+10],17,-42063),o=l(o,a,i,n,r[u+11],22,-1990404162),n=l(n,o,a,i,r[u+12],7,1804603682),i=l(i,n,o,a,r[u+13],12,-40341101),a=l(a,i,n,o,r[u+14],17,-1502002290),n=c(n,o=l(o,a,i,n,r[u+15],22,1236535329),a,i,r[u+1],5,-165796510),i=c(i,n,o,a,r[u+6],9,-1069501632),a=c(a,i,n,o,r[u+11],14,643717713),o=c(o,a,i,n,r[u+0],20,-373897302),n=c(n,o,a,i,r[u+5],5,-701558691),i=c(i,n,o,a,r[u+10],9,38016083),a=c(a,i,n,o,r[u+15],14,-660478335),o=c(o,a,i,n,r[u+4],20,-405537848),n=c(n,o,a,i,r[u+9],5,568446438),i=c(i,n,o,a,r[u+14],9,-1019803690),a=c(a,i,n,o,r[u+3],14,-187363961),o=c(o,a,i,n,r[u+8],20,1163531501),n=c(n,o,a,i,r[u+13],5,-1444681467),i=c(i,n,o,a,r[u+2],9,-51403784),a=c(a,i,n,o,r[u+7],14,1735328473),n=s(n,o=c(o,a,i,n,r[u+12],20,-1926607734),a,i,r[u+5],4,-378558),i=s(i,n,o,a,r[u+8],11,-2022574463),a=s(a,i,n,o,r[u+11],16,1839030562),o=s(o,a,i,n,r[u+14],23,-35309556),n=s(n,o,a,i,r[u+1],4,-1530992060),i=s(i,n,o,a,r[u+4],11,1272893353),a=s(a,i,n,o,r[u+7],16,-155497632),o=s(o,a,i,n,r[u+10],23,-1094730640),n=s(n,o,a,i,r[u+13],4,681279174),i=s(i,n,o,a,r[u+0],11,-358537222),a=s(a,i,n,o,r[u+3],16,-722521979),o=s(o,a,i,n,r[u+6],23,76029189),n=s(n,o,a,i,r[u+9],4,-640364487),i=s(i,n,o,a,r[u+12],11,-421815835),a=s(a,i,n,o,r[u+15],16,530742520),n=p(n,o=s(o,a,i,n,r[u+2],23,-995338651),a,i,r[u+0],6,-198630844),i=p(i,n,o,a,r[u+7],10,1126891415),a=p(a,i,n,o,r[u+14],15,-1416354905),o=p(o,a,i,n,r[u+5],21,-57434055),n=p(n,o,a,i,r[u+12],6,1700485571),i=p(i,n,o,a,r[u+3],10,-1894986606),a=p(a,i,n,o,r[u+10],15,-1051523),o=p(o,a,i,n,r[u+1],21,-2054922799),n=p(n,o,a,i,r[u+8],6,1873313359),i=p(i,n,o,a,r[u+15],10,-30611744),a=p(a,i,n,o,r[u+6],15,-1560198380),o=p(o,a,i,n,r[u+13],21,1309151649),n=p(n,o,a,i,r[u+4],6,-145523070),i=p(i,n,o,a,r[u+11],10,-1120210379),a=p(a,i,n,o,r[u+2],15,718787259),o=p(o,a,i,n,r[u+9],21,-343485551),n=n+g>>>0,o=o+m>>>0,a=a+d>>>0,i=i+f>>>0}return T.endian([n,o,a,i])}var T,b,h,y;T=crypt,b=charenc_1.utf8,h=isBuffer_1,y=charenc_1.bin,v._ff=function(e,t,r,n,o,a,i){e=e+(t&r|~t&n)+(o>>>0)+i;return(e<<a|e>>>32-a)+t},v._gg=function(e,t,r,n,o,a,i){e=e+(t&n|r&~n)+(o>>>0)+i;return(e<<a|e>>>32-a)+t},v._hh=function(e,t,r,n,o,a,i){e=e+(t^r^n)+(o>>>0)+i;return(e<<a|e>>>32-a)+t},v._ii=function(e,t,r,n,o,a,i){e=e+(r^(t|~n))+(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=T.wordsToBytes(v(e,t));return t&&t.asBytes?e:t&&t.asString?y.bytesToString(e):T.bytesToHex(e)}});let Global={domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[]},pagesArray=[],sdkTrackIdVal=()=>{var e;return Global.trackId||(e=Date.now().toString(),Global.trackId=e)};function randomUUID(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function 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 getWebH5Info(e){var e=e.ua.toLowerCase(),t=window.location.hostname,r=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:r||"",packageName:t||"",version:"",carrier:"h5",ecology:"h5"}}function getWXInfo(){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 getAppInfo(t){var r=plus.runtime.version,r={name:t.appName,version:r||"",carrier:"app",packageName:"",ecology:""};if("android"===t.platform){let e="Android";var n=plus.android.runtimeMainActivity().getPackageName();t.romName.includes("HarmonyOS")&&(e="Harmony OS"),r.packageName=n||"",r.ecology=e}else"ios"===t.platform?(n=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier(),r.packageName=n||"",r.ecology="iOS"):r.ecology="unknown";return r}function getCurDeviceType(e){var t;return"web"===Global.platform||"h5"===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 getDeviceInfo(e){return{lang:e.osLanguage||e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os: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(),r=t[t.length-1],n=Global.platform;let o="",a="",i="",u="";if(n&&("web"===n||"h5"===n?(o=window.location.href,a=window.location.hostname,document.referrer&&(n=new URL(document.referrer),i=n||"",u=n.hostname||"")):(o=r.route,1<t.length&&(n=t[t.length-2],i=n.route),a=Global.domain||r.route)),r)return{path:r.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}}function uUpdatePageExtraArray(e){var t=getCurrentPages();let r=t[t.length-1];t=pagesArray.findIndex(e=>e.path===r.route),e={path:r.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 getUtmObj(){var e,t;return"web"===Global.platform||"h5"===Global.platform?(e={utmSource:"",utmCampaign:"",utmTerm:"",utmContent:"",ctk:""},window.location.href&&(t=window.location.href.split("?")[1]||"")&&(t=new URLSearchParams(t),e.utmSource=t.get("utmSource")||"",e.utmCampaign=t.get("utmCampaign")||"",e.utmTerm=t.get("utmTerm")||"",e.utmContent=t.get("utmContent")||"",e.ctk=t.get("ctk")||""),e):null}let AUTOTRACKTYPE={ENTER:"enter",LOOP:"loop",LEAVE:"leave"},BPNPVUV="UNIBPNPVUVSrcData",BPNPVUVFail="UNIBPNPVUVFailData",atDuration,atEnterTimeLong,atLoopTimeLong,cirtemp,atObj,atInterval=null,cUUId=null;function clearUAData(){clearInterval(atInterval),atDuration=0,atEnterTimeLong=0,atLoopTimeLong=0,cirtemp=1,atObj=null,atInterval=null,cUUId=0}let uAutoStartTrackPVData=e=>{atInterval?autoStopTrackPVUV():(clearUAData(),atObj=e,autoTrackData(AUTOTRACKTYPE.ENTER),atInterval=setInterval(()=>{autoTrackData(AUTOTRACKTYPE.LOOP)},15e3))},autoStopTrackPVUV=()=>{autoTrackData(AUTOTRACKTYPE.LEAVE),clearInterval(atInterval)};function autoTrackData(e){e===AUTOTRACKTYPE.ENTER?(cirtemp=1,atDuration=0,atEnterTimeLong=Date.now(),atLoopTimeLong=atEnterTimeLong,cUUId=randomUUID()):e===AUTOTRACKTYPE.LOOP?(cirtemp=2,atDuration=15,atLoopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp=3,atDuration=Math.ceil((Date.now()-atLoopTimeLong)/1e3)),atObj&&insertPVUVData({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),pageUUId:cUUId},cUUId)}function insertPVUVData(e,t){var r,n=uni.getStorageSync(BPNPVUV),n=n?JSON.parse(n):[];0<n.length&&-1!==(r=n.findIndex(e=>e.pageUUId===t))?n[r]={...n[r],...e}:n.push(e),uni.setStorageSync(BPNPVUV,JSON.stringify(n))}function autoPageObj(t,e,r){var n=pagesArray.find(e=>e.path===t),o=Global.platform;let a="",i="",u="",l="";return o&&("web"===o||"h5"===o?(a=window.location.href,i=window.location.hostname,document.referrer&&(o=new URL(document.referrer),u=o||"",l=o.hostname||"")):(a=t,1<e&&(o=r[e-2],u=o.route),i=Global.domain||t)),{path:n&&n.path?n.path:t,busSegment:n&&n.busSegment?n.busSegment:Global.busSegment||"",module:n&&n.module?n.module:Global.module||"",properties:n&&n.properties?n.properties:"",domain:i,url:a,visitPage:e,sourceDomain:l,sourceUrl:u,title:n&&n.title?n.title:""}}function queryTrackDataUpload(){var e=uni.getStorageSync(BPNPVUV),e=(uni.setStorageSync(BPNPVUV,""),e?JSON.parse(e):[]),t=[],r=uni.getStorageSync(BPNPVUVFail),r=r?JSON.parse(r):[];e.length&&t.push(...e),r.length&&t.push(...r),t&&t.length&&(t.forEach(e=>{delete e.pageUUId}),console.log("queryTrackDataUpload"),reportTrackEventServer("track",t,BPNPVUVFail))}function setReportUrl(e){return"test"!==e?{reportUrl:"https://buryingpoint.onebuygz.com/client/api/event",reportTrackUrl:"https://buryingpoint.onebuygz.com/client/api/track",eventListUrl:"https://buryingpoint.onebuygz.com/api/event/query/eventList"}:{reportUrl:"https://buryingpoint.gcongo.com.cn/client/api/event",reportTrackUrl:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListUrl:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}}let deepCopy=e=>{if("object"!=typeof e)return e;var t,r=Array.isArray(e)?[]:{};for(t in e)"object"==typeof e[t]?r[t]=deepCopy(e[t]):r[t]=e[t];return r},cacheData=[],addCache=e=>{cacheData.push(e)},getCache=()=>deepCopy(cacheData),clearCache=()=>{cacheData.length=0},BPNEvent="UNIBPNEventSrcData",BPNEventFail="UNIBPNEventFailData",timerCustom;function getCurPath(){var e=getCurrentPages(),e=e[e.length-1];return e?e.route:"/"}function eventCommonStore(e){var t=e.$page||"",r=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(r),path:r||"",title:t.title||"",url:r||""},properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:sdkTrackIdVal(),triggerTime:timeToStr(Date.now())};addCache(t),clearTimeout(timerCustom),timerCustom=setTimeout(()=>{var e=getCache();e.length&&(insertEventData(e),clearCache())},2e3)}function insertEventData(e){var t=uni.getStorageSync(BPNEvent);let r=t?JSON.parse(t):[];e&&e.length&&(e.forEach(e=>{r.push(e)}),uni.setStorageSync(BPNEvent,JSON.stringify(r)))}function queryEventDataUpload(){var e=uni.getStorageSync(BPNEvent),e=(uni.setStorageSync(BPNEvent,""),e?JSON.parse(e):[]),t=[],r=uni.getStorageSync(BPNEventFail),r=r?JSON.parse(r):[];e.length&&t.push(...e),r.length&&t.push(...r),t&&t.length&&(console.log("queryEventUpload:"),reportTrackEventServer("event",t,BPNEventFail))}let startTime=0,enterTimeLong=0,loopTimeLong=0,cirtemp$1=-1,mObj=null,umlInterval=null,cUUId$1=0;function clearUMlData(){clearInterval(umlInterval),startTime=0,enterTimeLong=0,loopTimeLong=0,cirtemp$1=1,mObj=null,umlInterval=null,cUUId$1=0}let uStartTrackPVData=e=>{umlInterval?uDestoryTrackPVData():e&&(clearUMlData(),uTrackPVData(AUTOTRACKTYPE.ENTER,e),umlInterval=setInterval(()=>{uTrackPVData(AUTOTRACKTYPE.LOOP,null)},15e3))},uDestoryTrackPVData=()=>{uTrackPVData(AUTOTRACKTYPE.LEAVE,null),clearInterval(umlInterval)};function uTrackPVData(e,t){e===AUTOTRACKTYPE.ENTER?(cUUId$1=randomUUID(),enterTimeLong=Date.now(),loopTimeLong=enterTimeLong,mObj=getTrackObj(t)):e===AUTOTRACKTYPE.LOOP?(cirtemp$1=2,startTime=15,loopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp$1=3,startTime=Math.ceil((Date.now()-loopTimeLong)/1e3));t={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:mObj.visitPage,visitTime:timeToStr(enterTimeLong),utm:getUtmObj(),pageUUId:cUUId$1};console.log("写入ml数据:",t),insertPVUVData(t,cUUId$1)}var name="visual-buried-point-platform-uni",version="1.0.0-alpha.25",lsi="5cd44ae734c98be777d389d6fac4a94b#1.0.0-alpha.24",description="To make it easy for you to get started with GitLab, here's a list of recommended next steps.",main="dist/esm/buried-point-uni.js",module$1="dist/esm/buried-point-uni.js",scripts={test:'echo "Error: no test specified" && exit 1',build:"rollup -c --environment INCLUDE_DEPS,BUILD:production && node lsi-md5.js"},repository={type:"git",url:""},files=["dist"],keywords=[],author="",license="MIT",dependencies={md5:"^2.3.0"},devDependencies={webpack:"^5.72.1","webpack-cli":"^6.0.1","@babel/core":"^7.26.10","@babel/preset-env":"^7.26.9","babel-loader":"^10.0.0","@rollup/plugin-json":"^6.0.1","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,scripts:scripts,repository:repository,files:files,keywords:keywords,author:author,license:license,dependencies:dependencies,devDependencies:devDependencies};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 r=getCurrentPages();let t=r[r.length-1];Global.signTrackArray&&Global.signTrackArray.length&&(pathExist=Global.signTrackArray.find(e=>e===t.route))?pathExist=!0:(pathExist=!1,r=autoPageObj(t.route,r.length,r),uAutoStartTrackPVData(r))}else"leave"!==e||pathExist||autoStopTrackPVUV()}let localLsi=pk.lsi,_comInfo={distinctId:"",anonymousId:""},appData={},deviceData={},uglInterval=null;function init(e){var t;e?(t=setReportUrl(e.env||""),Global.upEventUrl=t.reportUrl,Global.upTrackUrl=t.reportTrackUrl,Object.assign(Global,e),getBaseicInfo(),_comInfo.distinctId=uni.getStorageSync("v_userId")?uni.getStorageSync("v_userId"):"",_comInfo.anonymousId=uni.getStorageSync("v_anonId"),_comInfo.anonymousId||(_comInfo.anonymousId=randomUUID(),uni.setStorageSync("v_anonId",_comInfo.anonymousId)),sdkTrackIdVal()):console.log("init config error, please check config!"),startGlobalTime(),uniInterceptorListener()}function startGlobalTime(){clearInterval(uglInterval),uglInterval=setInterval(()=>{queryEventDataUpload(),queryTrackDataUpload()},15e3)}function setUserId(e){e?(_comInfo.distinctId=e,uni.setStorageSync("v_userId",e)):(_comInfo.distinctId="",uni.setStorageSync("v_userId",""))}function getTrackId(){return sdkTrackIdVal()}function setCustomEvent(e){eventCommonStore(e)}function onStartTrack(e){uStartTrackPVData(e)}function onDestroyTrack(){uDestoryTrackPVData()}function setPageExtraObj(e){uUpdatePageExtraArray(e)}function reportTrackEventServer(e,t,r){var n;e?(n={...n=commonData(t),dataAbstract:md5(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:n,success:function(e){e&&e.data?uni.setStorageSync(r,JSON.stringify(t)):uni.setStorageSync(r,"")},fail:function(e){console.log("error: ",e),uni.setStorageSync(r,JSON.stringify(t))}})):console.error("please set upload data upType")}function commonData(e){return{app:appData,data:e,device:deviceData,lsi:localLsi,projectId:Global.token,userAgent:Global.uAgent||"",anonymousId:_comInfo.anonymousId,userId:_comInfo.distinctId}}function getBaseicInfo(){uni.getSystemInfo({success:function(e){Global.uAgent=e.ua;var t,r=e.uniPlatform;r.includes("app")?(Global.platform=e.osName,appData=getAppInfo(e)):r.includes("web")||r.includes("h5")?(Global.platform=r,t=getWebH5Info(e),appData={...t,version:Global.version||"unknown"}):r.includes("weixin")&&(Global.platform="weixin",appData=getWXInfo()),deviceData=getDeviceInfo(e)},fail:function(e){deviceData=getDeviceInfoError()},complete:function(){uni.getNetworkType({success(e){deviceData.network=e.networkType}})}})}exports.getTrackId=getTrackId,exports.init=init,exports.onDestroyTrack=onDestroyTrack,exports.onStartTrack=onStartTrack,exports.reportTrackEventServer=reportTrackEventServer,exports.setCustomEvent=setCustomEvent,exports.setPageExtraObj=setPageExtraObj,exports.setUserId=setUserId;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports}var crypt=createCommonjsModule(function(e){var o,r;o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={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&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=r.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=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(e){for(var t=[],r=0;r<e.length;r+=3)for(var n=e[r]<<16|e[r+1]<<8|e[r+2],a=0;a<4;a++)8*r+6*a<=8*e.length?t.push(o.charAt(n>>>6*(3-a)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],r=0,n=0;r<e.length;n=++r%4)0!=n&&t.push((o.indexOf(e.charAt(r-1))&Math.pow(2,-2*n+8)-1)<<2*n|o.indexOf(e.charAt(r))>>>6-2*n);return t}},e.exports=r}),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=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));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?y:b).stringToBytes(e):h(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var r=T.bytesToWords(e),t=8*e.length,n=1732584193,a=-271733879,o=-1732584194,i=271733878,u=0;u<r.length;u++)r[u]=16711935&(r[u]<<8|r[u]>>>24)|4278255360&(r[u]<<24|r[u]>>>8);r[t>>>5]|=128<<t%32,r[14+(64+t>>>9<<4)]=t;for(var l=v._ff,c=v._gg,s=v._hh,p=v._ii,u=0;u<r.length;u+=16){var g=n,m=a,d=o,f=i,n=l(n,a,o,i,r[u+0],7,-680876936),i=l(i,n,a,o,r[u+1],12,-389564586),o=l(o,i,n,a,r[u+2],17,606105819),a=l(a,o,i,n,r[u+3],22,-1044525330);n=l(n,a,o,i,r[u+4],7,-176418897),i=l(i,n,a,o,r[u+5],12,1200080426),o=l(o,i,n,a,r[u+6],17,-1473231341),a=l(a,o,i,n,r[u+7],22,-45705983),n=l(n,a,o,i,r[u+8],7,1770035416),i=l(i,n,a,o,r[u+9],12,-1958414417),o=l(o,i,n,a,r[u+10],17,-42063),a=l(a,o,i,n,r[u+11],22,-1990404162),n=l(n,a,o,i,r[u+12],7,1804603682),i=l(i,n,a,o,r[u+13],12,-40341101),o=l(o,i,n,a,r[u+14],17,-1502002290),n=c(n,a=l(a,o,i,n,r[u+15],22,1236535329),o,i,r[u+1],5,-165796510),i=c(i,n,a,o,r[u+6],9,-1069501632),o=c(o,i,n,a,r[u+11],14,643717713),a=c(a,o,i,n,r[u+0],20,-373897302),n=c(n,a,o,i,r[u+5],5,-701558691),i=c(i,n,a,o,r[u+10],9,38016083),o=c(o,i,n,a,r[u+15],14,-660478335),a=c(a,o,i,n,r[u+4],20,-405537848),n=c(n,a,o,i,r[u+9],5,568446438),i=c(i,n,a,o,r[u+14],9,-1019803690),o=c(o,i,n,a,r[u+3],14,-187363961),a=c(a,o,i,n,r[u+8],20,1163531501),n=c(n,a,o,i,r[u+13],5,-1444681467),i=c(i,n,a,o,r[u+2],9,-51403784),o=c(o,i,n,a,r[u+7],14,1735328473),n=s(n,a=c(a,o,i,n,r[u+12],20,-1926607734),o,i,r[u+5],4,-378558),i=s(i,n,a,o,r[u+8],11,-2022574463),o=s(o,i,n,a,r[u+11],16,1839030562),a=s(a,o,i,n,r[u+14],23,-35309556),n=s(n,a,o,i,r[u+1],4,-1530992060),i=s(i,n,a,o,r[u+4],11,1272893353),o=s(o,i,n,a,r[u+7],16,-155497632),a=s(a,o,i,n,r[u+10],23,-1094730640),n=s(n,a,o,i,r[u+13],4,681279174),i=s(i,n,a,o,r[u+0],11,-358537222),o=s(o,i,n,a,r[u+3],16,-722521979),a=s(a,o,i,n,r[u+6],23,76029189),n=s(n,a,o,i,r[u+9],4,-640364487),i=s(i,n,a,o,r[u+12],11,-421815835),o=s(o,i,n,a,r[u+15],16,530742520),n=p(n,a=s(a,o,i,n,r[u+2],23,-995338651),o,i,r[u+0],6,-198630844),i=p(i,n,a,o,r[u+7],10,1126891415),o=p(o,i,n,a,r[u+14],15,-1416354905),a=p(a,o,i,n,r[u+5],21,-57434055),n=p(n,a,o,i,r[u+12],6,1700485571),i=p(i,n,a,o,r[u+3],10,-1894986606),o=p(o,i,n,a,r[u+10],15,-1051523),a=p(a,o,i,n,r[u+1],21,-2054922799),n=p(n,a,o,i,r[u+8],6,1873313359),i=p(i,n,a,o,r[u+15],10,-30611744),o=p(o,i,n,a,r[u+6],15,-1560198380),a=p(a,o,i,n,r[u+13],21,1309151649),n=p(n,a,o,i,r[u+4],6,-145523070),i=p(i,n,a,o,r[u+11],10,-1120210379),o=p(o,i,n,a,r[u+2],15,718787259),a=p(a,o,i,n,r[u+9],21,-343485551),n=n+g>>>0,a=a+m>>>0,o=o+d>>>0,i=i+f>>>0}return T.endian([n,a,o,i])}var T,b,h,y;T=crypt,b=charenc_1.utf8,h=isBuffer_1,y=charenc_1.bin,v._ff=function(e,t,r,n,a,o,i){e=e+(t&r|~t&n)+(a>>>0)+i;return(e<<o|e>>>32-o)+t},v._gg=function(e,t,r,n,a,o,i){e=e+(t&n|r&~n)+(a>>>0)+i;return(e<<o|e>>>32-o)+t},v._hh=function(e,t,r,n,a,o,i){e=e+(t^r^n)+(a>>>0)+i;return(e<<o|e>>>32-o)+t},v._ii=function(e,t,r,n,a,o,i){e=e+(r^(t|~n))+(a>>>0)+i;return(e<<o|e>>>32-o)+t},v._blocksize=16,v._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);e=T.wordsToBytes(v(e,t));return t&&t.asBytes?e:t&&t.asString?y.bytesToString(e):T.bytesToHex(e)}});let Global={domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[]},pagesArray=[],sdkTrackIdVal=()=>{var e;return Global.trackId||(e=Date.now().toString(),Global.trackId=e)};function randomUUID(){return"xxxx-4xxx-yxxx-xxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function 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 getWebH5Info(e){var e=e.ua.toLowerCase(),t=window.location.hostname,r=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:r||"",packageName:t||"",version:"",carrier:"h5",ecology:"h5"}}function getWXInfo(){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 getAppInfo(t){var r=plus.runtime.version,r={name:t.appName,version:r||"",carrier:"app",packageName:"",ecology:""};if("android"===t.platform){let e="Android";var n=plus.android.runtimeMainActivity().getPackageName();t.romName.includes("HarmonyOS")&&(e="Harmony OS"),r.packageName=n||"",r.ecology=e}else"ios"===t.platform?(n=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier(),r.packageName=n||"",r.ecology="iOS"):r.ecology="unknown";return r}function getCurDeviceType(e){var t;return"web"===Global.platform||"h5"===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 getDeviceInfo(e){return{lang:e.osLanguage||e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os: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(),r=t[t.length-1],n=Global.platform;let a="",o="",i="",u="";if(n&&("web"===n||"h5"===n?(a=window.location.href,o=window.location.hostname,document.referrer&&(n=new URL(document.referrer),i=n||"",u=n.hostname||"")):(a=r.route,1<t.length&&(n=t[t.length-2],i=n.route),o=Global.domain||r.route)),r)return{path:r.route,busSegment:e.busSegment||"",module:e.module||"",properties:e.extend_param?JSON.stringify(e.extend_param):"",title:e.title||"",domain:o,url:a,visitPage:t.length,sourceDomain:u,sourceUrl:i}}function uUpdatePageExtraArray(e){var t=getCurrentPages();let r=t[t.length-1];t=pagesArray.findIndex(e=>e.path===r.route),e={path:r.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 getUtmObj(){var e,t;return"web"===Global.platform||"h5"===Global.platform?(e={utmSource:"",utmCampaign:"",utmTerm:"",utmContent:"",ctk:""},window.location.href&&(t=window.location.href.split("?")[1]||"")&&(t=new URLSearchParams(t),e.utmSource=t.get("utmSource")||"",e.utmCampaign=t.get("utmCampaign")||"",e.utmTerm=t.get("utmTerm")||"",e.utmContent=t.get("utmContent")||"",e.ctk=t.get("ctk")||""),e):null}let AUTOTRACKTYPE={ENTER:"enter",LOOP:"loop",LEAVE:"leave"},BPNPVUV="UNIBPNPVUVSrcData",BPNPVUVFail="UNIBPNPVUVFailData",atDuration,atEnterTimeLong,atLoopTimeLong,cirtemp,atObj,atInterval=null,cUUId=null;function clearUAData(){clearInterval(atInterval),atDuration=0,atEnterTimeLong=0,atLoopTimeLong=0,cirtemp=1,atObj=null,atInterval=null,cUUId=0}let uAutoStartTrackPVData=e=>{atInterval?autoStopTrackPVUV():(clearUAData(),atObj=e,autoTrackData(AUTOTRACKTYPE.ENTER),atInterval=setInterval(()=>{autoTrackData(AUTOTRACKTYPE.LOOP)},15e3))},autoStopTrackPVUV=()=>{autoTrackData(AUTOTRACKTYPE.LEAVE),clearInterval(atInterval)};function autoTrackData(e){e===AUTOTRACKTYPE.ENTER?(cirtemp=1,atDuration=0,atEnterTimeLong=Date.now(),atLoopTimeLong=atEnterTimeLong,cUUId=randomUUID()):e===AUTOTRACKTYPE.LOOP?(cirtemp=2,atDuration=15,atLoopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp=3,atDuration=Math.ceil((Date.now()-atLoopTimeLong)/1e3)),atObj&&insertPVUVData({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),pageUUId:cUUId},cUUId)}function insertPVUVData(e,t){var r,n=uni.getStorageSync(BPNPVUV),n=n?JSON.parse(n):[];0<n.length&&-1!==(r=n.findIndex(e=>e.pageUUId===t))?n[r]={...n[r],...e}:n.push(e),uni.setStorageSync(BPNPVUV,JSON.stringify(n))}function autoPageObj(t,e,r){var n=pagesArray.find(e=>e.path===t),a=Global.platform;let o="",i="",u="",l="";return a&&("web"===a||"h5"===a?(o=window.location.href,i=window.location.hostname,document.referrer&&(a=new URL(document.referrer),u=a||"",l=a.hostname||"")):(o=t,1<e&&(a=r[e-2],u=a.route),i=Global.domain||t)),{path:n&&n.path?n.path:t,busSegment:n&&n.busSegment?n.busSegment:Global.busSegment||"",module:n&&n.module?n.module:Global.module||"",properties:n&&n.properties?n.properties:"",domain:i,url:o,visitPage:e,sourceDomain:l,sourceUrl:u,title:n&&n.title?n.title:""}}function queryTrackDataUpload(){var e=uni.getStorageSync(BPNPVUV),e=(uni.setStorageSync(BPNPVUV,""),e?JSON.parse(e):[]),t=[],r=uni.getStorageSync(BPNPVUVFail),r=r?JSON.parse(r):[];e.length&&t.push(...e),r.length&&t.push(...r),t&&t.length&&(t.forEach(e=>{delete e.pageUUId}),console.log("queryTrackDataUpload"),reportTrackEventServer("track",t,BPNPVUVFail))}function setReportUrl(e){return"test"!==e?{reportUrl:"https://buryingpoint.onebuygz.com/client/api/event",reportTrackUrl:"https://buryingpoint.onebuygz.com/client/api/track",eventListUrl:"https://buryingpoint.onebuygz.com/api/event/query/eventList"}:{reportUrl:"https://buryingpoint.gcongo.com.cn/client/api/event",reportTrackUrl:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListUrl:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"}}let deepCopy=e=>{if("object"!=typeof e)return e;var t,r=Array.isArray(e)?[]:{};for(t in e)"object"==typeof e[t]?r[t]=deepCopy(e[t]):r[t]=e[t];return r},cacheData=[],addCache=e=>{cacheData.push(e)},getCache=()=>deepCopy(cacheData),clearCache=()=>{cacheData.length=0},BPNEvent="UNIBPNEventSrcData",BPNEventFail="UNIBPNEventFailData",timerCustom;function getCurPath(){var e=getCurrentPages(),e=e[e.length-1];return e?e.route:"/"}function eventCommonStore(e){var t=e.$page||"",r=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(r),path:r||"",title:t.title||"",url:r||""},properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:sdkTrackIdVal(),triggerTime:timeToStr(Date.now())};addCache(t),clearTimeout(timerCustom),timerCustom=setTimeout(()=>{var e=getCache();e.length&&(insertEventData(e),clearCache())},2e3)}function insertEventData(e){var t=uni.getStorageSync(BPNEvent);let r=t?JSON.parse(t):[];e&&e.length&&(e.forEach(e=>{r.push(e)}),uni.setStorageSync(BPNEvent,JSON.stringify(r)))}function queryEventDataUpload(){var e=uni.getStorageSync(BPNEvent),e=(uni.setStorageSync(BPNEvent,""),e?JSON.parse(e):[]),t=[],r=uni.getStorageSync(BPNEventFail),r=r?JSON.parse(r):[];e.length&&t.push(...e),r.length&&t.push(...r),t&&t.length&&(console.log("queryEventUpload:"),reportTrackEventServer("event",t,BPNEventFail))}let startTime=0,enterTimeLong=0,loopTimeLong=0,cirtemp$1=-1,mObj=null,umlInterval=null,cUUId$1=0;function clearUMlData(){clearInterval(umlInterval),startTime=0,enterTimeLong=0,loopTimeLong=0,cirtemp$1=1,mObj=null,umlInterval=null,cUUId$1=0}let uStartTrackPVData=e=>{umlInterval?uDestoryTrackPVData():e&&(clearUMlData(),uTrackPVData(AUTOTRACKTYPE.ENTER,e),umlInterval=setInterval(()=>{uTrackPVData(AUTOTRACKTYPE.LOOP,null)},15e3))},uDestoryTrackPVData=()=>{uTrackPVData(AUTOTRACKTYPE.LEAVE,null),clearInterval(umlInterval)};function uTrackPVData(e,t){e===AUTOTRACKTYPE.ENTER?(cUUId$1=randomUUID(),enterTimeLong=Date.now(),loopTimeLong=enterTimeLong,mObj=getTrackObj(t)):e===AUTOTRACKTYPE.LOOP?(cirtemp$1=2,startTime=15,loopTimeLong=Date.now()):e===AUTOTRACKTYPE.LEAVE&&(cirtemp$1=3,startTime=Math.ceil((Date.now()-loopTimeLong)/1e3));t={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:mObj.visitPage,visitTime:timeToStr(enterTimeLong),utm:getUtmObj(),pageUUId:cUUId$1};console.log("写入ml数据:",t),insertPVUVData(t,cUUId$1)}var name="visual-buried-point-platform-uni",version="1.0.0-alpha.25",lsi="5cd44ae734c98be777d389d6fac4a94b#1.0.0-alpha.24",description="To make it easy for you to get started with GitLab, here's a list of recommended next steps.",main="dist/esm/buried-point-uni.js",module="dist/esm/buried-point-uni.js",scripts={test:'echo "Error: no test specified" && exit 1',build:"rollup -c --environment INCLUDE_DEPS,BUILD:production && node lsi-md5.js"},repository={type:"git",url:""},files=["dist"],keywords=[],author="",license="MIT",dependencies={md5:"^2.3.0"},devDependencies={webpack:"^5.72.1","webpack-cli":"^6.0.1","@babel/core":"^7.26.10","@babel/preset-env":"^7.26.9","babel-loader":"^10.0.0","@rollup/plugin-json":"^6.0.1","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,scripts:scripts,repository:repository,files:files,keywords:keywords,author:author,license:license,dependencies:dependencies,devDependencies:devDependencies};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 r=getCurrentPages();let t=r[r.length-1];Global.signTrackArray&&Global.signTrackArray.length&&(pathExist=Global.signTrackArray.find(e=>e===t.route))?pathExist=!0:(pathExist=!1,r=autoPageObj(t.route,r.length,r),uAutoStartTrackPVData(r))}else"leave"!==e||pathExist||autoStopTrackPVUV()}let localLsi=pk.lsi,_comInfo={distinctId:"",anonymousId:""},appData={},deviceData={},uglInterval=null;function init(e){var t;e?(t=setReportUrl(e.env||""),Global.upEventUrl=t.reportUrl,Global.upTrackUrl=t.reportTrackUrl,Object.assign(Global,e),getBaseicInfo(),_comInfo.distinctId=uni.getStorageSync("v_userId")?uni.getStorageSync("v_userId"):"",_comInfo.anonymousId=uni.getStorageSync("v_anonId"),_comInfo.anonymousId||(_comInfo.anonymousId=randomUUID(),uni.setStorageSync("v_anonId",_comInfo.anonymousId)),sdkTrackIdVal()):console.log("init config error, please check config!"),startGlobalTime(),uniInterceptorListener()}function startGlobalTime(){clearInterval(uglInterval),uglInterval=setInterval(()=>{queryEventDataUpload(),queryTrackDataUpload()},15e3)}function setUserId(e){e?(_comInfo.distinctId=e,uni.setStorageSync("v_userId",e)):(_comInfo.distinctId="",uni.setStorageSync("v_userId",""))}function getTrackId(){return sdkTrackIdVal()}function setCustomEvent(e){eventCommonStore(e)}function onStartTrack(e){uStartTrackPVData(e)}function onDestroyTrack(){uDestoryTrackPVData()}function setPageExtraObj(e){uUpdatePageExtraArray(e)}function reportTrackEventServer(e,t,r){var n;e?(n={...n=commonData(t),dataAbstract:md5(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:n,success:function(e){e&&e.data?uni.setStorageSync(r,JSON.stringify(t)):uni.setStorageSync(r,"")},fail:function(e){console.log("error: ",e),uni.setStorageSync(r,JSON.stringify(t))}})):console.error("please set upload data upType")}function commonData(e){return{app:appData,data:e,device:deviceData,lsi:localLsi,projectId:Global.token,userAgent:Global.uAgent||"",anonymousId:_comInfo.anonymousId,userId:_comInfo.distinctId}}function getBaseicInfo(){uni.getSystemInfo({success:function(e){Global.uAgent=e.ua;var t,r=e.uniPlatform;r.includes("app")?(Global.platform=e.osName,appData=getAppInfo(e)):r.includes("web")||r.includes("h5")?(Global.platform=r,t=getWebH5Info(e),appData={...t,version:Global.version||"unknown"}):r.includes("weixin")&&(Global.platform="weixin",appData=getWXInfo()),deviceData=getDeviceInfo(e)},fail:function(e){deviceData=getDeviceInfoError()},complete:function(){uni.getNetworkType({success(e){deviceData.network=e.networkType}})}})}export{getTrackId,init,onDestroyTrack,onStartTrack,reportTrackEventServer,setCustomEvent,setPageExtraObj,setUserId};
|
|
@@ -0,0 +1 @@
|
|
|
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){function t(e,t){return e(t={exports:{}},t.exports),t.exports}function L(e){return null!=e&&(o(e)||"function"==typeof(t=e).readFloatLE&&"function"==typeof t.slice&&o(t.slice(0,0))||!!e._isBuffer);var t}var M=t(function(e){var i,n;i="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(i.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((i.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|i.indexOf(e.charAt(n))>>>6-2*r);return t}},e.exports=n}),n={utf8:{stringToBytes:function(e){return n.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(n.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("")}}},r=n;function o(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var V=t(function(e){function h(e,t){e.constructor==String?e=(t&&"binary"===t.encoding?b:y).stringToBytes(e):S(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,i=-1732584194,a=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=h._ff,c=h._gg,l=h._hh,g=h._ii,u=0;u<n.length;u+=16){var p=r,d=o,m=i,f=a,r=s(r,o,i,a,n[u+0],7,-680876936),a=s(a,r,o,i,n[u+1],12,-389564586),i=s(i,a,r,o,n[u+2],17,606105819),o=s(o,i,a,r,n[u+3],22,-1044525330);r=s(r,o,i,a,n[u+4],7,-176418897),a=s(a,r,o,i,n[u+5],12,1200080426),i=s(i,a,r,o,n[u+6],17,-1473231341),o=s(o,i,a,r,n[u+7],22,-45705983),r=s(r,o,i,a,n[u+8],7,1770035416),a=s(a,r,o,i,n[u+9],12,-1958414417),i=s(i,a,r,o,n[u+10],17,-42063),o=s(o,i,a,r,n[u+11],22,-1990404162),r=s(r,o,i,a,n[u+12],7,1804603682),a=s(a,r,o,i,n[u+13],12,-40341101),i=s(i,a,r,o,n[u+14],17,-1502002290),r=c(r,o=s(o,i,a,r,n[u+15],22,1236535329),i,a,n[u+1],5,-165796510),a=c(a,r,o,i,n[u+6],9,-1069501632),i=c(i,a,r,o,n[u+11],14,643717713),o=c(o,i,a,r,n[u+0],20,-373897302),r=c(r,o,i,a,n[u+5],5,-701558691),a=c(a,r,o,i,n[u+10],9,38016083),i=c(i,a,r,o,n[u+15],14,-660478335),o=c(o,i,a,r,n[u+4],20,-405537848),r=c(r,o,i,a,n[u+9],5,568446438),a=c(a,r,o,i,n[u+14],9,-1019803690),i=c(i,a,r,o,n[u+3],14,-187363961),o=c(o,i,a,r,n[u+8],20,1163531501),r=c(r,o,i,a,n[u+13],5,-1444681467),a=c(a,r,o,i,n[u+2],9,-51403784),i=c(i,a,r,o,n[u+7],14,1735328473),r=l(r,o=c(o,i,a,r,n[u+12],20,-1926607734),i,a,n[u+5],4,-378558),a=l(a,r,o,i,n[u+8],11,-2022574463),i=l(i,a,r,o,n[u+11],16,1839030562),o=l(o,i,a,r,n[u+14],23,-35309556),r=l(r,o,i,a,n[u+1],4,-1530992060),a=l(a,r,o,i,n[u+4],11,1272893353),i=l(i,a,r,o,n[u+7],16,-155497632),o=l(o,i,a,r,n[u+10],23,-1094730640),r=l(r,o,i,a,n[u+13],4,681279174),a=l(a,r,o,i,n[u+0],11,-358537222),i=l(i,a,r,o,n[u+3],16,-722521979),o=l(o,i,a,r,n[u+6],23,76029189),r=l(r,o,i,a,n[u+9],4,-640364487),a=l(a,r,o,i,n[u+12],11,-421815835),i=l(i,a,r,o,n[u+15],16,530742520),r=g(r,o=l(o,i,a,r,n[u+2],23,-995338651),i,a,n[u+0],6,-198630844),a=g(a,r,o,i,n[u+7],10,1126891415),i=g(i,a,r,o,n[u+14],15,-1416354905),o=g(o,i,a,r,n[u+5],21,-57434055),r=g(r,o,i,a,n[u+12],6,1700485571),a=g(a,r,o,i,n[u+3],10,-1894986606),i=g(i,a,r,o,n[u+10],15,-1051523),o=g(o,i,a,r,n[u+1],21,-2054922799),r=g(r,o,i,a,n[u+8],6,1873313359),a=g(a,r,o,i,n[u+15],10,-30611744),i=g(i,a,r,o,n[u+6],15,-1560198380),o=g(o,i,a,r,n[u+13],21,1309151649),r=g(r,o,i,a,n[u+4],6,-145523070),a=g(a,r,o,i,n[u+11],10,-1120210379),i=g(i,a,r,o,n[u+2],15,718787259),o=g(o,i,a,r,n[u+9],21,-343485551),r=r+p>>>0,o=o+d>>>0,i=i+m>>>0,a=a+f>>>0}return v.endian([r,o,i,a])}var v,y,S,b;v=M,y=r.utf8,S=L,b=r.bin,h._ff=function(e,t,n,r,o,i,a){e=e+(t&n|~t&r)+(o>>>0)+a;return(e<<i|e>>>32-i)+t},h._gg=function(e,t,n,r,o,i,a){e=e+(t&r|n&~r)+(o>>>0)+a;return(e<<i|e>>>32-i)+t},h._hh=function(e,t,n,r,o,i,a){e=e+(t^n^r)+(o>>>0)+a;return(e<<i|e>>>32-i)+t},h._ii=function(e,t,n,r,o,i,a){e=e+(n^(t|~r))+(o>>>0)+a;return(e<<i|e>>>32-i)+t},h._blocksize=16,h._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);e=v.wordsToBytes(h(e,t));return t&&t.asBytes?e:t&&t.asString?b.bytesToString(e):v.bytesToHex(e)}});let c={domain:"",busSegment:"",module:"",flushInterval:"",pageInterval:"",token:"",version:"",trackId:"",platform:"",uAgent:"",upEventUrl:"",upTrackUrl:"",isCompatible:!0,signTrackArray:[]},l=[],i=()=>{var e;return c.trackId||(e=Date.now().toString(),c.trackId=e)};function a(){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 u(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 J(e){var t;return{lang:e.osLanguage||e.hostLanguage,brand:e.deviceBrand+" "+e.deviceModel,os: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||"h5"===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 j(){var e,t;return"web"===c.platform||"h5"===c.platform?(e={utmSource:"",utmCampaign:"",utmTerm:"",utmContent:"",ctk:""},window.location.href&&(t=window.location.href.split("?")[1]||"")&&(t=new URLSearchParams(t),e.utmSource=t.get("utmSource")||"",e.utmCampaign=t.get("utmCampaign")||"",e.utmTerm=t.get("utmTerm")||"",e.utmContent=t.get("utmContent")||"",e.ctk=t.get("ctk")||""),e):null}let s={ENTER:"enter",LOOP:"loop",LEAVE:"leave"},g="UNIBPNPVUVSrcData",$="UNIBPNPVUVFailData",p,d,m,f,h,v=null,y=null;let R=e=>{v?H():(clearInterval(v),p=0,d=0,m=0,f=1,h=null,v=null,y=0,h=e,S(s.ENTER),v=setInterval(()=>{S(s.LOOP)},15e3))},H=()=>{S(s.LEAVE),clearInterval(v)};function S(e){e===s.ENTER?(f=1,p=0,d=Date.now(),m=d,y=a()):e===s.LOOP?(f=2,p=15,m=Date.now()):e===s.LEAVE&&(f=3,p=Math.ceil((Date.now()-m)/1e3)),h&&z({busSegment:h.busSegment||"",circulation:f,domain:h.domain,duration:p,module:h.module||"",path:h.path,url:h.url,sourceDomain:h.sourceDomain,sourceUrl:h.sourceUrl,properties:h.properties,title:h.title,traceId:"",trackId:i(),visitPage:h.visitPage,visitTime:u(d),pageUUId:y},y)}function z(e,t){var n,r=uni.getStorageSync(g),r=r?JSON.parse(r):[];0<r.length&&-1!==(n=r.findIndex(e=>e.pageUUId===t))?r[n]={...r[n],...e}:r.push(e),uni.setStorageSync(g,JSON.stringify(r))}let q=e=>{if("object"!=typeof e)return e;var t,n=Array.isArray(e)?[]:{};for(t in e)"object"==typeof e[t]?n[t]=q(e[t]):n[t]=e[t];return n},b=[],F=e=>{b.push(e)},W=()=>q(b),K=()=>{b.length=0},I="UNIBPNEventSrcData",Y="UNIBPNEventFailData",Z;function G(e){var t=e.$page||"",n=t.path||((n=(n=getCurrentPages())[n.length-1])?n.route:"/"),t={utm:e.$utm||j(),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:V(n),path:n||"",title:t.title||"",url:n||""},properties:e.$extend_param?JSON.stringify(e.$extend_param):"",traceId:"",trackId:i(),triggerTime:u(Date.now())};F(t),clearTimeout(Z),Z=setTimeout(()=>{var n=W();if(n.length){{let e=uni.getStorageSync(I),t=e?JSON.parse(e):[];n&&n.length&&(n.forEach(e=>{t.push(e)}),uni.setStorageSync(I,JSON.stringify(t)))}K()}},2e3)}let w=0,T=0,k=0,U=-1,N=null,x=null,O=0;let Q=e=>{x?X():e&&(clearInterval(x),w=0,T=0,k=0,U=1,N=null,x=null,O=0,P(s.ENTER,e),x=setInterval(()=>{P(s.LOOP,null)},15e3))},X=()=>{P(s.LEAVE,null),clearInterval(x)};function P(e,t){e===s.ENTER?(O=a(),T=Date.now(),k=T,N=(e=>{var t=getCurrentPages(),n=t[t.length-1],r=c.platform;let o="",i="",a="",u="";if(r&&("web"===r||"h5"===r?(o=window.location.href,i=window.location.hostname,document.referrer&&(r=new URL(document.referrer),a=r||"",u=r.hostname||"")):(o=n.route,1<t.length&&(r=t[t.length-2],a=r.route),i=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:i,url:o,visitPage:t.length,sourceDomain:u,sourceUrl:a}})(t)):e===s.LOOP?(U=2,w=15,k=Date.now()):e===s.LEAVE&&(U=3,w=Math.ceil((Date.now()-k)/1e3));t={busSegment:N.busSegment,circulation:U,domain:N.domain,duration:w,module:N.module,path:N.path,properties:N.properties,sourceDomain:N.sourceDomain,sourceUrl:N.sourceUrl,title:N.title,traceId:"",trackId:i(),url:N.url,visitPage:N.visitPage,visitTime:u(T),utm:j(),pageUUId:O};console.log("写入ml数据:",t),z(t,O)}let E=!1;function A(e){if(!c.isCompatible)if("pv"===e){var n=getCurrentPages();let t=n[n.length-1];c.signTrackArray&&c.signTrackArray.length&&(E=c.signTrackArray.find(e=>e===t.route))?E=!0:(E=!1,n=((t,e,n)=>{var r=l.find(e=>e.path===t),o=c.platform;let i="",a="",u="",s="";return o&&("web"===o||"h5"===o?(i=window.location.href,a=window.location.hostname,document.referrer&&(o=new URL(document.referrer),u=o||"",s=o.hostname||"")):(i=t,1<e&&(o=n[e-2],u=o.route),a=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:a,url:i,visitPage:e,sourceDomain:s,sourceUrl:u,title:r&&r.title?r.title:""}})(t.route,n.length,n),R(n))}else"leave"!==e||E||H()}let ee="5cd44ae734c98be777d389d6fac4a94b#1.0.0-alpha.24",B={distinctId:"",anonymousId:""},D={},_={},te=null;function C(e,t,n){var r;e?(r=t,r={...r={app:D,data:r,device:_,lsi:ee,projectId:c.token,userAgent:c.uAgent||"",anonymousId:B.anonymousId,userId:B.distinctId},dataAbstract:V(JSON.stringify(r))},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")}e.getTrackId=function(){return i()},e.init=function(e){var t;e?(t="test"!==(e.env||"")?{reportUrl:"https://buryingpoint.onebuygz.com/client/api/event",reportTrackUrl:"https://buryingpoint.onebuygz.com/client/api/track",eventListUrl:"https://buryingpoint.onebuygz.com/api/event/query/eventList"}:{reportUrl:"https://buryingpoint.gcongo.com.cn/client/api/event",reportTrackUrl:"https://buryingpoint.gcongo.com.cn/client/api/track",eventListUrl:"https://buryingpoint.gcongo.com.cn/api/event/query/eventList"},c.upEventUrl=t.reportUrl,c.upTrackUrl=t.reportTrackUrl,Object.assign(c,e),uni.getSystemInfo({success:function(e){c.uAgent=e.ua;var t,n,r,o=e.uniPlatform;o.includes("app")?(c.platform=e.osName,D=(t=>{var n=plus.runtime.version,n={name:t.appName,version:n||"",carrier:"app",packageName:"",ecology:""};if("android"===t.platform){let e="Android";var r=plus.android.runtimeMainActivity().getPackageName();t.romName.includes("HarmonyOS")&&(e="Harmony OS"),n.packageName=r||"",n.ecology=e}else"ios"===t.platform?(r=plus.ios.importClass("NSBundle").mainBundle().bundleIdentifier(),n.packageName=r||"",n.ecology="iOS"):n.ecology="unknown";return n})(e)):o.includes("web")||o.includes("h5")?(c.platform=o,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"},D={...t,version:c.version||"unknown"}):o.includes("weixin")&&(c.platform="weixin",D=(r=uni.getAccountInfoSync(),{name:uni.getAppBaseInfo().appName||"",packageName:r?r.miniProgram.appId:"",version:r?r.miniProgram.envVersion+r.miniProgram.version:"",carrier:"mini",ecology:"mini"})),_=J(e)},fail:function(e){_={lang:"",brand:"",os:"",osVersion:"",resolution:"",browser:"",browserVersion:"",color:"",deviceId:"",deviceType:"",network:""}},complete:function(){uni.getNetworkType({success(e){_.network=e.networkType}})}}),B.distinctId=uni.getStorageSync("v_userId")?uni.getStorageSync("v_userId"):"",B.anonymousId=uni.getStorageSync("v_anonId"),B.anonymousId||(B.anonymousId=a(),uni.setStorageSync("v_anonId",B.anonymousId)),i()):console.log("init config error, please check config!"),clearInterval(te),te=setInterval(()=>{var e,t,n;e=uni.getStorageSync(I),uni.setStorageSync(I,""),e=e?JSON.parse(e):[],n=[],t=(t=uni.getStorageSync(Y))?JSON.parse(t):[],e.length&&n.push(...e),t.length&&n.push(...t),n&&n.length&&(console.log("queryEventUpload:"),C("event",n,Y)),e=uni.getStorageSync(g),uni.setStorageSync(g,""),e=e?JSON.parse(e):[],t=[],n=(n=uni.getStorageSync($))?JSON.parse(n):[],e.length&&t.push(...e),n.length&&t.push(...n),t&&t.length&&(t.forEach(e=>{delete e.pageUUId}),console.log("queryTrackDataUpload"),C("track",t,$))},15e3),uni.addInterceptor("navigateTo",{invoke(e){A("leave")},success(e){A("pv")}}),uni.addInterceptor("switchTab",{invoke(e){A("leave")},success(e){A("pv")}}),uni.addInterceptor("navigateBack",{invoke(e){A("leave")},success(e){A("pv")}})},e.onDestroyTrack=function(){X()},e.onStartTrack=function(e){Q(e)},e.reportTrackEventServer=C,e.setCustomEvent=function(e){G(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?(B.distinctId=e,uni.setStorageSync("v_userId",e)):(B.distinctId="",uni.setStorageSync("v_userId",""))},Object.defineProperty(e,"__esModule",{value:!0})});
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visual-buried-point-platform-uni",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
4
|
-
"lsi": "
|
|
3
|
+
"version": "1.0.0-alpha.25",
|
|
4
|
+
"lsi": "6322141a7ada88d6a15196ccc454df57#1.0.0-alpha.25",
|
|
5
5
|
"description": "To make it easy for you to get started with GitLab, here's a list of recommended next steps.",
|
|
6
|
-
"main": "
|
|
6
|
+
"main": "dist/esm/buried-point-uni.js",
|
|
7
|
+
"module": "dist/esm/buried-point-uni.js",
|
|
7
8
|
"scripts": {
|
|
8
9
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
-
"build": "
|
|
10
|
-
"lsi-md5": "node lsi-md5.js"
|
|
10
|
+
"build": "rollup -c --environment INCLUDE_DEPS,BUILD:production && node lsi-md5.js"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
"files": [
|
|
17
17
|
"dist"
|
|
18
18
|
],
|
|
19
|
-
"type": "module",
|
|
20
19
|
"keywords": [],
|
|
21
20
|
"author": "",
|
|
22
21
|
"license": "MIT",
|
|
@@ -24,8 +23,18 @@
|
|
|
24
23
|
"md5": "^2.3.0"
|
|
25
24
|
},
|
|
26
25
|
"devDependencies": {
|
|
27
|
-
"rimraf": "^6.0.1",
|
|
28
26
|
"webpack": "^5.72.1",
|
|
29
|
-
"webpack-cli": "
|
|
27
|
+
"webpack-cli": "^6.0.1",
|
|
28
|
+
"@babel/core": "^7.26.10",
|
|
29
|
+
"@babel/preset-env": "^7.26.9",
|
|
30
|
+
"babel-loader": "^10.0.0",
|
|
31
|
+
"@rollup/plugin-json": "^6.0.1",
|
|
32
|
+
"babel-preset-es2015": "^6.24.1",
|
|
33
|
+
"rollup": "^1.20.2",
|
|
34
|
+
"rollup-plugin-babel": "^4.3.3",
|
|
35
|
+
"rollup-plugin-commonjs": "^10.0.2",
|
|
36
|
+
"rollup-plugin-node-resolve": "^5.2.0",
|
|
37
|
+
"rollup-plugin-replace": "^2.2.0",
|
|
38
|
+
"rollup-plugin-uglify": "^6.0.2"
|
|
30
39
|
}
|
|
31
40
|
}
|
package/index.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import MD5 from "md5";
|
|
2
|
-
import { queryTrackDataUpload } from "./autoutils.js";
|
|
3
|
-
import { setReportUrl } from "./config.js";
|
|
4
|
-
import { eventCommonStore, queryEventDataUpload } from "./eventutils.js";
|
|
5
|
-
import { uDestoryTrackPVData, uStartTrackPVData } from "./manualutils.js";
|
|
6
|
-
import pk from "./package.json";
|
|
7
|
-
import { uniInterceptorListener } from "./pageListener.js";
|
|
8
|
-
import {
|
|
9
|
-
getAppInfo,
|
|
10
|
-
getDeviceInfo,
|
|
11
|
-
getDeviceInfoError,
|
|
12
|
-
getWebH5Info,
|
|
13
|
-
getWXInfo,
|
|
14
|
-
Global,
|
|
15
|
-
randomUUID,
|
|
16
|
-
sdkTrackIdVal,
|
|
17
|
-
uUpdatePageExtraArray,
|
|
18
|
-
} from "./tools.js";
|
|
19
|
-
|
|
20
|
-
const localLsi = pk.lsi;
|
|
21
|
-
let _comInfo = { distinctId: "", anonymousId: "" };
|
|
22
|
-
let appData = {};
|
|
23
|
-
let deviceData = {};
|
|
24
|
-
//common global upload interval
|
|
25
|
-
let uglInterval = null;
|
|
26
|
-
export function init(config) {
|
|
27
|
-
if (config) {
|
|
28
|
-
let _cf = setReportUrl(config.env ? config.env : "");
|
|
29
|
-
Global.upEventUrl = _cf.reportUrl;
|
|
30
|
-
Global.upTrackUrl = _cf.reportTrackUrl;
|
|
31
|
-
Object.assign(Global, config);
|
|
32
|
-
getBaseicInfo();
|
|
33
|
-
_comInfo.distinctId = uni.getStorageSync("v_userId")
|
|
34
|
-
? uni.getStorageSync("v_userId")
|
|
35
|
-
: "";
|
|
36
|
-
_comInfo.anonymousId = uni.getStorageSync("v_anonId");
|
|
37
|
-
if (!_comInfo.anonymousId) {
|
|
38
|
-
_comInfo.anonymousId = randomUUID();
|
|
39
|
-
uni.setStorageSync("v_anonId", _comInfo.anonymousId);
|
|
40
|
-
}
|
|
41
|
-
sdkTrackIdVal();
|
|
42
|
-
} else {
|
|
43
|
-
console.log("init config error, please check config!");
|
|
44
|
-
}
|
|
45
|
-
// Enabling a global timer
|
|
46
|
-
startGlobalTime();
|
|
47
|
-
// Monitor page loading and unloading
|
|
48
|
-
uniInterceptorListener();
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
//the general custom reportCustom interval is enabled
|
|
52
|
-
function startGlobalTime() {
|
|
53
|
-
clearInterval(uglInterval);
|
|
54
|
-
uglInterval = setInterval(() => {
|
|
55
|
-
queryEventDataUpload();
|
|
56
|
-
queryTrackDataUpload();
|
|
57
|
-
}, 15000);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
//bind userID
|
|
61
|
-
export function setUserId(userId) {
|
|
62
|
-
if (userId) {
|
|
63
|
-
_comInfo.distinctId = userId;
|
|
64
|
-
uni.setStorageSync("v_userId", userId);
|
|
65
|
-
} else {
|
|
66
|
-
_comInfo.distinctId = "";
|
|
67
|
-
uni.setStorageSync("v_userId", "");
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// get trackId
|
|
72
|
-
export function getTrackId() {
|
|
73
|
-
return sdkTrackIdVal();
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// set custom event
|
|
77
|
-
export function setCustomEvent(tData) {
|
|
78
|
-
eventCommonStore(tData);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
//track upload-registry
|
|
82
|
-
export function onStartTrack(tData) {
|
|
83
|
-
uStartTrackPVData(tData);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
//track upload-Destroy
|
|
87
|
-
export function onDestroyTrack() {
|
|
88
|
-
uDestoryTrackPVData();
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
// auto track Preset attribute
|
|
92
|
-
export function setPageExtraObj(tData) {
|
|
93
|
-
uUpdatePageExtraArray(tData);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// data upload
|
|
97
|
-
export function reportTrackEventServer(upType, data, sFailKey) {
|
|
98
|
-
if (!upType) {
|
|
99
|
-
console.error("please set upload data upType");
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const comData = commonData(data);
|
|
103
|
-
const reportData = {
|
|
104
|
-
...comData,
|
|
105
|
-
dataAbstract: MD5(JSON.stringify(comData)),
|
|
106
|
-
};
|
|
107
|
-
uni.request({
|
|
108
|
-
url: upType === "event" ? Global.upEventUrl : Global.upTrackUrl,
|
|
109
|
-
method: "POST",
|
|
110
|
-
header: {
|
|
111
|
-
"Content-Type": "application/json",
|
|
112
|
-
appKey: Global.token,
|
|
113
|
-
projectId: Global.token,
|
|
114
|
-
},
|
|
115
|
-
data: reportData,
|
|
116
|
-
success: function (res) {
|
|
117
|
-
if (res && res.data) {
|
|
118
|
-
uni.setStorageSync(sFailKey, JSON.stringify(data));
|
|
119
|
-
} else {
|
|
120
|
-
uni.setStorageSync(sFailKey, "");
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
fail: function (error) {
|
|
124
|
-
console.log("error: ", error);
|
|
125
|
-
uni.setStorageSync(sFailKey, JSON.stringify(data));
|
|
126
|
-
},
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function commonData(allData) {
|
|
131
|
-
return {
|
|
132
|
-
app: appData,
|
|
133
|
-
data: allData,
|
|
134
|
-
device: deviceData,
|
|
135
|
-
lsi: localLsi,
|
|
136
|
-
projectId: Global.token,
|
|
137
|
-
userAgent: Global.uAgent || "",
|
|
138
|
-
anonymousId: _comInfo.anonymousId,
|
|
139
|
-
userId: _comInfo.distinctId,
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
// get baseInfo
|
|
144
|
-
function getBaseicInfo() {
|
|
145
|
-
uni.getSystemInfo({
|
|
146
|
-
success: function (res) {
|
|
147
|
-
Global.uAgent = res.ua;
|
|
148
|
-
let uniPlatform = res.uniPlatform;
|
|
149
|
-
if (uniPlatform.includes("app")) {
|
|
150
|
-
Global.platform = res.osName;
|
|
151
|
-
appData = getAppInfo(res);
|
|
152
|
-
} else if (uniPlatform.includes("web") || uniPlatform.includes("h5")) {
|
|
153
|
-
Global.platform = uniPlatform;
|
|
154
|
-
let wh5Info = getWebH5Info(res);
|
|
155
|
-
appData = {
|
|
156
|
-
...wh5Info,
|
|
157
|
-
version: Global.version ? Global.version : "unknown",
|
|
158
|
-
};
|
|
159
|
-
} else if (uniPlatform.includes("weixin")) {
|
|
160
|
-
Global.platform = "weixin";
|
|
161
|
-
appData = getWXInfo();
|
|
162
|
-
}
|
|
163
|
-
deviceData = getDeviceInfo(res);
|
|
164
|
-
},
|
|
165
|
-
fail: function (error) {
|
|
166
|
-
deviceData = getDeviceInfoError();
|
|
167
|
-
},
|
|
168
|
-
complete: function () {
|
|
169
|
-
uni.getNetworkType({
|
|
170
|
-
success(res) {
|
|
171
|
-
deviceData.network = res.networkType;
|
|
172
|
-
},
|
|
173
|
-
});
|
|
174
|
-
},
|
|
175
|
-
});
|
|
176
|
-
}
|