@seaverse/track-sdk 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +50 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ const trackClient = new TrackClient({
|
|
|
33
33
|
version: '1.0.0',
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
//
|
|
36
|
+
// 初始化(如果平台配置包含 GTM ID,会自动注入)
|
|
37
37
|
await trackClient.initialize();
|
|
38
38
|
|
|
39
39
|
// 手动埋点
|
|
@@ -123,6 +123,16 @@ const providers = trackClient.getInitializedProviders();
|
|
|
123
123
|
console.log(providers); // 已初始化的埋点平台列表
|
|
124
124
|
```
|
|
125
125
|
|
|
126
|
+
##### `trackGTMEvent(eventName: string, parameters?: Record<string, any>): void`
|
|
127
|
+
|
|
128
|
+
追踪 GTM 自定义事件(仅 web 平台有效)。
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
trackClient.trackGTMEvent('log_login_accounts', {
|
|
132
|
+
loginType: 'seaart-auth',
|
|
133
|
+
});
|
|
134
|
+
```
|
|
135
|
+
|
|
126
136
|
## 使用示例
|
|
127
137
|
|
|
128
138
|
### React 应用
|
|
@@ -160,6 +170,14 @@ function App() {
|
|
|
160
170
|
});
|
|
161
171
|
};
|
|
162
172
|
|
|
173
|
+
const handleCustomGTMEvent = () => {
|
|
174
|
+
// 追踪 GTM 自定义事件
|
|
175
|
+
trackClient.trackGTMEvent('custom_button_click', {
|
|
176
|
+
button_id: 'cta_button',
|
|
177
|
+
page_name: 'home',
|
|
178
|
+
});
|
|
179
|
+
};
|
|
180
|
+
|
|
163
181
|
return <div>Your App</div>;
|
|
164
182
|
}
|
|
165
183
|
|
|
@@ -279,6 +297,37 @@ const trackClient = new TrackClient({
|
|
|
279
297
|
});
|
|
280
298
|
```
|
|
281
299
|
|
|
300
|
+
**Q: Google Tag Manager 会自动注入吗?**
|
|
301
|
+
|
|
302
|
+
是的,如果平台配置中包含 `gtmId`,SDK 会在 Firebase 初始化时自动注入 GTM 代码:
|
|
303
|
+
- 自动在 `<head>` 中插入 GTM script
|
|
304
|
+
- 自动在 `<body>` 最前面插入 noscript fallback
|
|
305
|
+
- 支持重复调用检测,避免重复注入
|
|
306
|
+
|
|
307
|
+
GTM ID 在 `src/config.ts` 的平台配置中设置,无需用户手动传入。
|
|
308
|
+
|
|
309
|
+
**Q: 如何追踪 GTM 自定义事件?**
|
|
310
|
+
|
|
311
|
+
使用 `trackGTMEvent` 方法:
|
|
312
|
+
|
|
313
|
+
```typescript
|
|
314
|
+
// 追踪登录事件
|
|
315
|
+
trackClient.trackGTMEvent('log_login_accounts', {
|
|
316
|
+
loginType: 'seaart-auth',
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
// 追踪按钮点击
|
|
320
|
+
trackClient.trackGTMEvent('custom_button_click', {
|
|
321
|
+
button_id: 'purchase_btn',
|
|
322
|
+
page: 'product_detail',
|
|
323
|
+
});
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
注意:
|
|
327
|
+
- 该方法仅在 web 平台有效,非 web 平台会输出日志但不执行
|
|
328
|
+
- 事件会推送到 GTM dataLayer,可在 GTM 后台配置触发器和标签
|
|
329
|
+
- 事件名称必须是有效的字符串
|
|
330
|
+
|
|
282
331
|
## License
|
|
283
332
|
|
|
284
333
|
MIT
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var t=require("firebase/app"),s=require("firebase/analytics");function r(t){var s=Object.create(null);return t&&Object.keys(t).forEach(function(r){if("default"!==r){var e=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,e.get?e:{enumerable:!0,get:function(){return t[r]}})}}),s.default=t,Object.freeze(s)}var e,n,i=r(require("sa-sdk-javascript"));function o(t,s){return t-=371,a()[t]}function a(){var t=["sensors","297tDQJxZ","163487LncWyn","1684045buxUfK","2428320IZTMRJ","2371179ljcPSQ","4vqhmKv","22YGBMeo","455odrInS","149958gkQzQA","6bTtEDm","SENSORS","firebase","6024496gXXvna","305710CCPtqR"];return(a=function(){return t})()}!function(){for(var t=o,s=a();;)try{if(829439===-parseInt(t(374))/1*(parseInt(t(382))/2)+-parseInt(t(377))/3+parseInt(t(378))/4*(parseInt(t(375))/5)+parseInt(t(381))/6*(parseInt(t(380))/7)+parseInt(t(385))/8+parseInt(t(373))/9*(-parseInt(t(371))/10)+-parseInt(t(379))/11*(-parseInt(t(376))/12))break;s.push(s.shift())}catch(t){s.push(s.shift())}}(),exports.TrackProvider=void 0,e=exports.TrackProvider||(exports.TrackProvider={}),n=o,e.FIREBASE=n(384),e[n(383)]=n(372);const c=l;function l(t,s){t-=112;return p()[t]}function p(){const t=["analytics","track","70EJcNND","108nQVMhI","firebase initialize failed:","error","setUserProperties","8424VnTBHs","setUserId","1687wrwdEo","154vPHpGa","631558cnPISb","initialized","2554428KKZBIe","config","20175AspqHN","306945kDtkwJ","610ZdiTle","7401vVaVdR","192996MJPuKB","clearUserId"];return(p=function(){return t})()}!function(){const t=l,s=p();for(;;)try{if(445436===-parseInt(t(117))/1+parseInt(t(123))/2*(parseInt(t(124))/3)+-parseInt(t(130))/4*(-parseInt(t(121))/5)+parseInt(t(119))/6+parseInt(t(115))/7*(parseInt(t(113))/8)+-parseInt(t(122))/9*(parseInt(t(129))/10)+-parseInt(t(116))/11*(parseInt(t(125))/12))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class f{constructor(t){const s=l;this.analytics=null,this[s(118)]=!1,this[s(120)]=t}async initialize(){const r=l;if(!this[r(118)])try{const e=t.initializeApp(this[r(120)]);this[r(127)]=s.getAnalytics(e),this[r(118)]=!0}catch(t){throw console[r(132)](r(131),t),t}}async[c(128)](t,s){}async[c(114)](t){}async[c(112)](t){}async[c(126)](){}}function h(t,s){t-=255;return d()[t]}const I=h;function d(){const t=["login","warn","4205148LagySc","quick","ajax","?t=","token","setUserProperties","sensors sdk init failed:","10000HGUIKT","36376dxXjRM","sensors sdk not initialized, skip setUserProperties","1395nYjOqU","2158800zPZZZU","serverUrl","setUserId","autoTrack","sensors sdk not initialized, skip setUserId","initialized","sensors sdk not found, please install it by running","sensors sdk track failed:","platform","sensors sdk setUserProperties failed:","1924gzmytc","showLog","10NtlfOT","sensors sdk clearUserId failed:","error","config","2558456mtgsyU","initialize","23677291PEKAMT","heatmap","93GLlCYA","&p=","&v=","version","5FnRYrA","sensors sdk not initialized, skip track","sensors sdk setUserId failed:","track","init","clearUserId","sensors"];return(d=function(){return t})()}!function(){const t=h,s=d();for(;;)try{if(455446===parseInt(t(271))/1+parseInt(t(285))/2*(parseInt(t(295))/3)+-parseInt(t(291))/4*(parseInt(t(255))/5)+-parseInt(t(264))/6+parseInt(t(275))/7+-parseInt(t(272))/8*(parseInt(t(274))/9)+-parseInt(t(287))/10*(-parseInt(t(293))/11))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class u{constructor(t,s,r,e){const n=h;this[n(261)]=null,this.initialized=!1,this[n(268)]=t,this[n(283)]=s,this[n(298)]=r,this[n(290)]=e}async[I(292)](){const t=I;if(!this[t(280)])try{if(!i)throw new Error(t(281));this[t(261)]=i;const s=encodeURIComponent(this[t(268)]),r=encodeURIComponent(this[t(283)]),e=encodeURIComponent(this[t(298)]);this[t(261)][t(259)]({server_url:this.config[t(276)]+(t(267)+s+t(296)+r+t(297)+e),show_log:this[t(290)][t(286)]??!1,heatmap:this[t(290)][t(294)]??{},is_track_single_page:!0,send_type:t(266)}),this[t(280)]=!0,this[t(261)][t(265)](t(278))}catch(s){throw console.error(t(270),s),s}}async[I(258)](t,s){const r=I;if(this[r(280)]&&this[r(261)])try{this[r(261)][r(258)](t,s??{})}catch(t){console[r(289)](r(282),t)}else console[r(263)](r(256))}async[I(277)](t){const s=I;if(this.initialized&&this[s(261)])try{this[s(261)][s(262)](t)}catch(t){console.error(s(257),t)}else console[s(263)](s(279))}async[I(269)](t){const s=I;if(this.initialized&&this[s(261)])try{this[s(261)].setProfile(t)}catch(t){console[s(289)](s(284),t)}else console[s(263)](s(273))}async[I(260)](){const t=I;if(this[t(280)]&&this[t(261)])try{this[t(261)].logout()}catch(s){console.error(t(288),s)}}}function k(){var t=["atob","3260qrbkko","from","14772ApEzQO","undefined","toString","base64","72575yVezWQ","1kfKYQU","utf-8","10EsMsFG","204VZMywi","3182553ClSoya","111377HkznwU","456970poanGf","1899MkhrjZ","1706023vNkSru","8WqMktq","btoa","169eJFqyd"];return(k=function(){return t})()}function y(t,s){return t-=445,k()[t]}function w(t){var s=y;return typeof window!==s(455)&&window[s(449)]?window[s(449)](t):Buffer[s(453)](t,s(460))[s(456)](s(457))}function z(t){return JSON.parse((s=t,r=y,typeof window!==r(455)&&window[r(451)]?window[r(451)](s):Buffer[r(453)](s,r(457))[r(456)](r(460))));var s,r}!function(){for(var t=y,s=k();;)try{if(285664===parseInt(t(459))/1*(-parseInt(t(445))/2)+-parseInt(t(446))/3*(-parseInt(t(452))/4)+parseInt(t(458))/5+parseInt(t(462))/6*(-parseInt(t(464))/7)+parseInt(t(448))/8*(parseInt(t(463))/9)+-parseInt(t(461))/10*(-parseInt(t(447))/11)+parseInt(t(454))/12*(parseInt(t(450))/13))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const Z=m;!function(){const t=m,s=b();for(;;)try{if(354492===parseInt(t(157))/1*(parseInt(t(146))/2)+parseInt(t(149))/3+parseInt(t(145))/4+-parseInt(t(156))/5*(-parseInt(t(151))/6)+-parseInt(t(144))/7+parseInt(t(148))/8+-parseInt(t(154))/9)break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const v={"MDE5YjUzNTEyMWJhNzc1ZmIwYTQ1MzY3Njg1NzU1MTU=":{providers:[exports.TrackProvider[Z(152)],exports.TrackProvider.SENSORS],firebaseConfig:z(Z(147)),sensorsConfig:z("eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19")},"MDE5YjUzNTE3ZmFiN2YxZDkwNjg5OWVhMGQyMWJlZGI=":{providers:[exports.TrackProvider[Z(152)],exports.TrackProvider[Z(153)]],firebaseConfig:z(Z(155)),sensorsConfig:z(Z(150))}};function m(t,s){t-=144;return b()[t]}function b(){const t=["85461vrkAAK","eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19","880494KCWboB","FIREBASE","SENSORS","6572673qrVjNM","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjpkMTQ4OGM3MzI0MWIyZWMzNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctR0gxNk1CQ1NOVyJ9","5TmlrZV","1knsfWw","3777865WWsdvf","1109532ptFHPd","1012358WAdnsG","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjo2NmI2ZTNmNmEwZjM2MDkwNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctN0gySjFTQ05QRCJ9","5325488pMKcVU"];return(b=function(){return t})()}const M=W;function W(t,s){t-=459;return g()[t]}function g(){const t=["values","config","Must provide a token","validateConfig"," adapter failed:","platform","[Track] Skip Firebase initialization (initializeFirebase = false)","providers","allSettled","clearUserId","FIREBASE","setUserId","605088WNrEsP","token","384yKwtET","[Track] ","32158fpmMNA","492UzBrao","setUserProperties","push","Must provide a version","61839MtUIkY","track SDK not initialized, please call initialize() first","Invalid token: ","[Track] Clear User ID","platformConfig","673916xMBCMM","83515TDlSkK","debug","initialized","set","warn","keys","420088DNJbVq","initialize","log","getInitializedProviders","initialize ","6081gtfkRB","initializeFirebase","70ZxbMFS","Must provide a platform","[Track] Set User Properties:","version","adapters","error","track"];return(g=function(){return t})()}!function(){const t=W,s=g();for(;;)try{if(219969===parseInt(t(479))/1+-parseInt(t(472))/2+parseInt(t(484))/3*(-parseInt(t(463))/4)+parseInt(t(473))/5+parseInt(t(505))/6+-parseInt(t(462))/7*(-parseInt(t(460))/8)+-parseInt(t(467))/9*(-parseInt(t(486))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class TrackClient{constructor(t){const s=W;this[s(490)]=new Map,this[s(475)]=!1,this[s(494)]=t,this[s(496)](),this.platformConfig=function(t){const s=w(t),r=v[s];if(!r)throw new Error("invalid token: "+t);return r}(t.token)}validateConfig(){const t=W;if(!this[t(494)][t(459)])throw new Error(t(495));if(!this.config[t(498)])throw new Error(t(487));if(!this.config[t(489)])throw new Error(t(466));if(!(w(this[t(494)][t(459)])in v))throw new Error(t(469)+this[t(494)][t(459)])}async[M(480)](){const t=M;if(this[t(475)])return;const s=[],r=!1!==this[t(494)][t(485)];for(const e of this[t(471)][t(500)])try{if(e===exports.TrackProvider[t(503)]&&!r){this[t(494)][t(474)]&&console.log(t(499));continue}let n;switch(e){case exports.TrackProvider[t(503)]:n=new f(this[t(471)].firebaseConfig);break;case exports.TrackProvider.SENSORS:n=new u(this[t(494)][t(459)],this[t(494)].platform,this[t(494)][t(489)],this[t(471)].sensorsConfig);break;default:console.warn("unknown provider: "+e);continue}this[t(490)][t(476)](e,n),s[t(465)](n.initialize())}catch(s){console[t(491)](t(483)+e+t(497),s)}await Promise.allSettled(s),this[t(475)]=!0,this[t(494)].debug&&console[t(481)]("Track SDK initialized, enabled providers:",Array.from(this[t(490)].keys()))}async[M(492)](t,s){const r=M;if(!this[r(475)])return void console[r(477)](r(468));this[r(494)][r(474)]&&console.log(r(461)+t,s);const e=[];for(const n of this.adapters[r(493)]())e[r(465)](n[r(492)](t,s));await Promise.allSettled(e)}async[M(504)](t){const s=M;if(!this[s(475)])return void console.warn(s(468));this.config[s(474)]&&console[s(481)]("[Track] Set User ID:",t);const r=[];for(const e of this[s(490)].values())r[s(465)](e.setUserId(t));await Promise[s(501)](r)}async[M(464)](t){const s=M;if(!this[s(475)])return void console[s(477)](s(468));this[s(494)][s(474)]&&console.log(s(488),t);const r=[];for(const e of this[s(490)][s(493)]())r[s(465)](e[s(464)](t));await Promise[s(501)](r)}async[M(502)](){const t=M;if(!this[t(475)])return void console[t(477)](t(468));this.config[t(474)]&&console.log(t(470));const s=[];for(const r of this[t(490)].values())s.push(r[t(502)]());await Promise[t(501)](s)}[M(482)](){const t=M;return Array.from(this[t(490)][t(478)]())}}function J(){var t=["32SgbGKg","13277sDXSua","6010DhxHtX","783710XdSXHe","97871pbrJYC","242604lBScki","30678fUxqQA","316cJoVjP","1766924BGaTQl","501bLqUoP","532ArrsRj"];return(J=function(){return t})()}function N(t,s){return t-=409,J()[t]}!function(){for(var t=N,s=J();;)try{if(225315===parseInt(t(416))/1+-parseInt(t(419))/2*(parseInt(t(410))/3)+parseInt(t(409))/4+parseInt(t(415))/5+-parseInt(t(418))/6*(-parseInt(t(411))/7)+-parseInt(t(412))/8*(parseInt(t(417))/9)+parseInt(t(414))/10*(-parseInt(t(413))/11))break;s.push(s.shift())}catch(t){s.push(s.shift())}}(),exports.TrackClient=TrackClient;
|
|
1
|
+
"use strict";var t=require("firebase/app"),e=require("firebase/analytics");function n(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var s,i,r=n(require("sa-sdk-javascript"));function o(t,e){return t-=487,a()[t]}function a(){var t=["SENSORS","1146654tyqhKq","10nlCwks","6YRrjUI","12039401HatPBV","72XvwdCb","10434uhteMd","firebase","44156RUyLGb","sensors","1213328lFGCjJ","583857SmdTeC","367678UKKoWY","1925czWzEC","FIREBASE"];return(a=function(){return t})()}function c(){const t=["https://www.googletagmanager.com/ns.html?id=","640618RtkATm","5771596YgzVZB","undefined","error","3mWjXTI","[GTM] GTM ID is empty, skip injection","noscript","DOMContentLoaded","[GTM] Injected successfully: ","head","insertBefore","1368xVdMEr","from","string","[GoogleTagManager] dataLayer not initialized","[GTM] Injection failed:","push","[GoogleTagManager] Invalid event name:","some","createElement","display","firstChild","7112346RRSoLx","gtm.js?id=","body","dataLayer","script","warn","1180fRRVLg","height","addEventListener","https://www.googletagmanager.com/gtm.js?id=","iframe","log","[GTM] Not in browser environment, skip injection","getElementsByTagName","3049958NkRDxS","visibility","appendChild","5AodEsl","getTime","src","includes","79576OEnzmY","[GTM] Already injected, skip","style","[GoogleTagManager] Error pushing to dataLayer:","async","5539044VErsko","querySelectorAll","1133644CGkfOH","none","parentNode"];return(c=function(){return t})()}function l(){return typeof window!==p(200)&&"undefined"!=typeof document}function p(t,e){t-=187;return c()[t]}function d(t){const e=p,n=document.createElement(e(204)),s=document[e(217)](e(230));s[e(239)]=e(197)+t,s[e(227)]="0",s.width="0",s[e(189)][e(218)]=e(195),s[e(189)][e(235)]="hidden",n[e(236)](s),document[e(222)][e(219)]?document[e(222)][e(208)](n,document[e(222)][e(219)]):document[e(222)].appendChild(n)}function f(t,e=!1){const n=p;if(l())if(t)if(function(t){const e=p;if(!l())return!1;const n=!!window[e(223)],s=document[e(193)](e(224)),i=Array[e(210)](s)[e(216)](n=>n[e(239)][e(240)](e(221)+t));return n&&i}(t))e&&console[n(231)](n(188));else try{(function(t){const e=p;window[e(223)]=window[e(223)]||[],window[e(223)][e(214)]({"gtm.start":(new Date)[e(238)](),event:"gtm.js"});const n=document[e(217)](e(224));n[e(191)]=!0,n[e(239)]=e(229)+t;const s=document[e(233)](e(224))[0];s&&s[e(196)]?s[e(196)][e(208)](n,s):document[e(207)][e(236)](n)})(t),document[n(222)]?d(t):document[n(228)](n(205),()=>{d(t)}),e&&console[n(231)](n(206)+t)}catch(t){console[n(201)](n(213),t)}else e&&console[n(225)](n(203));else e&&console[n(225)](n(232))}!function(){for(var t=o,e=a();;)try{if(582763===-parseInt(t(488))/1+-parseInt(t(489))/2*(-parseInt(t(495))/3)+parseInt(t(487))/4+parseInt(t(490))/5*(-parseInt(t(498))/6)+-parseInt(t(500))/7*(parseInt(t(497))/8)+parseInt(t(493))/9+-parseInt(t(494))/10*(-parseInt(t(496))/11))break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),exports.TrackProvider=void 0,(s=exports.TrackProvider||(exports.TrackProvider={}))[(i=o)(491)]=i(499),s[i(492)]=i(501),function(){const t=p,e=c();for(;;)try{if(864519===-parseInt(t(194))/1+parseInt(t(234))/2*(-parseInt(t(202))/3)+parseInt(t(199))/4*(-parseInt(t(237))/5)+-parseInt(t(220))/6+parseInt(t(192))/7+parseInt(t(187))/8*(-parseInt(t(209))/9)+parseInt(t(226))/10*(parseInt(t(198))/11))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const h=(t,e)=>{const n=p;if(!t||typeof t!==n(211))return void console[n(201)](n(215),t);(t=>{const e=p;if(typeof window!==e(200)&&window[e(223)])try{window[e(223)].push(t),console[e(231)]("[GoogleTagManager] Pushed to dataLayer:",t)}catch(t){console[e(201)](e(190),t)}else console.error(e(212))})({event:t,...e||{}})},u=m;function I(){const t=["18FZZtQY","debug","700bgNZwQ","error","2286tuPkXP","config","initialize","138120PWZQKy","206773GptbWp","gtmId","firebase initialize failed:","150HXAivI","2573968DFuAOj","track","setUserId","initialized","935CxswzO","1415SANPrR","analytics","14468QYfXpR","23632476ouRicX","2639868LReoTB","setUserProperties"];return(I=function(){return t})()}function m(t,e){t-=378;return I()[t]}!function(){const t=m,e=I();for(;;)try{if(942241===-parseInt(t(388))/1*(-parseInt(t(386))/2)+parseInt(t(382))/3+parseInt(t(380))/4*(parseInt(t(378))/5)+-parseInt(t(395))/6*(-parseInt(t(392))/7)+parseInt(t(396))/8*(parseInt(t(384))/9)+-parseInt(t(391))/10*(parseInt(t(400))/11)+-parseInt(t(381))/12)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class w{constructor(t,e,n=!1){const s=m;this[s(379)]=null,this.initialized=!1,this.config=t,this[s(393)]=e,this[s(385)]=n}async[u(390)](){const n=u;if(!this[n(399)])try{const s=t.initializeApp(this[n(389)]);this[n(379)]=e.getAnalytics(s),this[n(393)]&&f(this[n(393)],this[n(385)]),this[n(399)]=!0}catch(t){throw console[n(387)](n(394),t),t}}async[u(397)](t,e){}async[u(398)](t){}async[u(383)](t){}async clearUserId(){}}function k(){const t=["setProfile","config","11294sjMMdj","1978938nmWEDm","initialized","762160ojZOiE","3584zAhxXy","login","sensors sdk init failed:","ajax","sensors sdk clearUserId failed:","sensors sdk setUserProperties failed:","30FsDgRb","?t=","sensors sdk track failed:","showLog","sensors sdk not initialized, skip setUserProperties","sensors","platform","&v=","sensors sdk not initialized, skip setUserId","token","logout","1190484fKqUHH","clearUserId","serverUrl","144FSCrfE","version","autoTrack","track","2341889dLAaZa","warn","setUserProperties","sensors sdk not initialized, skip track","error","init","heatmap","3sRLQwu","29ucSzEm","sensors sdk not found, please install it by running","495642PTzYnZ"];return(k=function(){return t})()}const y=g;function g(t,e){t-=434;return k()[t]}!function(){const t=g,e=k();for(;;)try{if(152940===parseInt(t(455))/1*(-parseInt(t(460))/2)+parseInt(t(454))/3*(-parseInt(t(440))/4)+-parseInt(t(463))/5+-parseInt(t(457))/6+parseInt(t(464))/7*(-parseInt(t(443))/8)+parseInt(t(461))/9+-parseInt(t(470))/10*(-parseInt(t(447))/11))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class v{constructor(t,e,n,s){const i=g;this[i(434)]=null,this[i(462)]=!1,this[i(438)]=t,this[i(435)]=e,this[i(444)]=n,this[i(459)]=s}async initialize(){const t=g;if(!this[t(462)])try{if(!r)throw new Error(t(456));this[t(434)]=r;const e=encodeURIComponent(this[t(438)]),n=encodeURIComponent(this[t(435)]),s=encodeURIComponent(this.version);this[t(434)][t(452)]({server_url:this[t(459)][t(442)]+(t(471)+e+"&p=")+n+t(436)+s,show_log:this[t(459)][t(473)]??!1,heatmap:this[t(459)][t(453)]??{},is_track_single_page:!0,send_type:t(467)}),this[t(462)]=!0,this[t(434)].quick(t(445))}catch(e){throw console.error(t(466),e),e}}async track(t,e){const n=g;if(this[n(462)]&&this.sensors)try{this.sensors[n(446)](t,e??{})}catch(t){console[n(451)](n(472),t)}else console[n(448)](n(450))}async setUserId(t){const e=g;if(this.initialized&&this[e(434)])try{this[e(434)][e(465)](t)}catch(t){console[e(451)]("sensors sdk setUserId failed:",t)}else console[e(448)](e(437))}async[y(449)](t){const e=y;if(this[e(462)]&&this[e(434)])try{this[e(434)][e(458)](t)}catch(t){console[e(451)](e(469),t)}else console.warn(e(474))}async[y(441)](){const t=y;if(this[t(462)]&&this[t(434)])try{this[t(434)][t(439)]()}catch(e){console[t(451)](t(468),e)}}}function z(){var t=["354678dogvAx","btoa","359526ttsFxQ","from","21987130Tpiajt","664182NOyIiu","49xKmsyL","toString","utf-8","379490LZXEay","1100760TSqOmK","4ijpxah","undefined","537210ZXHEiG","atob","base64","48qWMHBu"];return(z=function(){return t})()}function Z(t,e){return t-=153,z()[t]}function b(t){var e=Z;return typeof window!==e(165)&&window.btoa?window[e(154)](t):Buffer.from(t,e(161))[e(160)](e(168))}function M(t){return JSON.parse((e=t,n=Z,"undefined"!=typeof window&&window[n(167)]?window[n(167)](e):Buffer[n(156)](e,n(168))[n(160)](n(161))));var e,n}!function(){for(var t=Z,e=z();;)try{if(291539===-parseInt(t(153))/1+-parseInt(t(158))/2+parseInt(t(163))/3*(-parseInt(t(164))/4)+-parseInt(t(162))/5+parseInt(t(155))/6*(-parseInt(t(159))/7)+-parseInt(t(169))/8*(parseInt(t(166))/9)+parseInt(t(157))/10)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const T=E;function W(){const t=["invalid token: ","384198pYPvQh","324372WilpbA","1340245cvYdnw","152754uuOaag","SENSORS","3PPXWTF","28NhXTrG","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjo2NmI2ZTNmNmEwZjM2MDkwNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctN0gySjFTQ05QRCJ9","473216CZJfaY","GTM-MJDRW2W4","eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19","2360610plEQbs","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjpkMTQ4OGM3MzI0MWIyZWMzNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctR0gxNk1CQ1NOVyJ9","301116rZpfFW","FIREBASE"];return(W=function(){return t})()}function E(t,e){t-=333;return W()[t]}!function(){const t=E,e=W();for(;;)try{if(227035===parseInt(t(340))/1+-parseInt(t(343))/2+-parseInt(t(348))/3*(-parseInt(t(344))/4)+-parseInt(t(345))/5+parseInt(t(346))/6*(parseInt(t(333))/7)+-parseInt(t(335))/8+parseInt(t(338))/9)break;e.push(e.shift())}catch(t){e.push(e.shift())}}();const Y={"MDE5YjUzNTEyMWJhNzc1ZmIwYTQ1MzY3Njg1NzU1MTU=":{providers:[exports.TrackProvider[T(341)],exports.TrackProvider.SENSORS],firebaseConfig:M(T(334)),sensorsConfig:M("eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19"),gtmId:T(336)},"MDE5YjUzNTE3ZmFiN2YxZDkwNjg5OWVhMGQyMWJlZGI=":{providers:[exports.TrackProvider[T(341)],exports.TrackProvider[T(347)]],firebaseConfig:M(T(339)),sensorsConfig:M(T(337))}};const N=R;function R(t,e){t-=143;return J()[t]}function J(){const t=["688465TpRXqg","platform","Must provide a version","firebaseConfig","gtmId","380181RHQacf","log","initializeFirebase","[Track] Clear User ID","FIREBASE"," adapter failed:","token","Track SDK initialized, enabled providers:","version","allSettled","unknown provider: ","20JCPGCX","keys","41433VwwrEk","push","initialize ","debug","platformConfig","initialize","setUserProperties","from","1289510udaYOk","track","Must provide a token","values","Invalid token: ","clearUserId","config","track SDK not initialized, please call initialize() first","warn","initialized","SENSORS","Must provide a platform","4352388KzorHn","1520001jpLeoe","set","50706IgcoHf","trackGTMEvent","validateConfig","providers","setUserId","sensorsConfig","1008JFOLfU","adapters"];return(J=function(){return t})()}!function(){const t=R,e=J();for(;;)try{if(369635===parseInt(t(184))/1+-parseInt(t(143))/2+parseInt(t(171))/3*(parseInt(t(182))/4)+parseInt(t(166))/5+-parseInt(t(155))/6+parseInt(t(156))/7+-parseInt(t(164))/8*(-parseInt(t(158))/9))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();class TrackClient{constructor(t){const e=R;this[e(165)]=new Map,this.initialized=!1,this[e(149)]=t,this[e(160)](),this.platformConfig=function(t){const e=T,n=b(t),s=Y[n];if(!s)throw new Error(e(342)+t);return s}(t[e(177)])}[N(160)](){const t=N;if(!this[t(149)][t(177)])throw new Error(t(145));if(!this.config[t(167)])throw new Error(t(154));if(!this[t(149)][t(179)])throw new Error(t(168));if(!(b(this[t(149)].token)in Y))throw new Error(t(147)+this[t(149)][t(177)])}async[N(189)](){const t=N;if(this[t(152)])return;const e=[],n=!1!==this[t(149)][t(173)];for(const s of this[t(188)][t(161)])try{if(s===exports.TrackProvider[t(175)]&&!n){this[t(149)][t(187)]&&console[t(172)]("[Track] Skip Firebase initialization (initializeFirebase = false)");continue}let i;switch(s){case exports.TrackProvider.FIREBASE:i=new w(this[t(188)][t(169)],this[t(188)][t(170)],this[t(149)][t(187)]);break;case exports.TrackProvider[t(153)]:i=new v(this[t(149)][t(177)],this[t(149)][t(167)],this.config[t(179)],this[t(188)][t(163)]);break;default:console[t(151)](t(181)+s);continue}this.adapters[t(157)](s,i),e[t(185)](i[t(189)]())}catch(e){console.error(t(186)+s+t(176),e)}await Promise[t(180)](e),this.initialized=!0,this[t(149)][t(187)]&&console[t(172)](t(178),Array[t(191)](this[t(165)][t(183)]()))}async[N(144)](t,e){const n=N;if(!this[n(152)])return void console.warn(n(150));this[n(149)].debug&&console[n(172)]("[Track] "+t,e);const s=[];for(const i of this[n(165)].values())s[n(185)](i.track(t,e));await Promise.allSettled(s)}async[N(162)](t){const e=N;if(!this[e(152)])return void console[e(151)](e(150));this[e(149)][e(187)]&&console[e(172)]("[Track] Set User ID:",t);const n=[];for(const s of this[e(165)][e(146)]())n.push(s[e(162)](t));await Promise[e(180)](n)}async[N(190)](t){const e=N;if(!this[e(152)])return void console[e(151)](e(150));this[e(149)][e(187)]&&console[e(172)]("[Track] Set User Properties:",t);const n=[];for(const s of this[e(165)][e(146)]())n[e(185)](s[e(190)](t));await Promise[e(180)](n)}async[N(148)](){const t=N;if(!this[t(152)])return void console[t(151)]("track SDK not initialized, please call initialize() first");this[t(149)][t(187)]&&console.log(t(174));const e=[];for(const n of this[t(165)][t(146)]())e[t(185)](n[t(148)]());await Promise[t(180)](e)}getInitializedProviders(){const t=N;return Array[t(191)](this[t(165)][t(183)]())}[N(159)](t,e){h(t,e)}}function j(t,e){return t-=329,S()[t]}function S(){var t=["6196705GwhpAJ","1426217cdUrKE","684760FfrYQM","4448580BvamqL","3871042YoPffK","1989099RgqctH","3322020sfEcMR","6ewsuwv"];return(S=function(){return t})()}!function(){for(var t=j,e=S();;)try{if(986249===parseInt(t(332))/1+-parseInt(t(329))/2+-parseInt(t(336))/3+parseInt(t(334))/4+parseInt(t(331))/5*(parseInt(t(330))/6)+-parseInt(t(335))/7+parseInt(t(333))/8)break;e.push(e.shift())}catch(t){e.push(e.shift())}}(),exports.TrackClient=TrackClient;
|
package/dist/index.d.ts
CHANGED
|
@@ -37,6 +37,11 @@ interface TrackConfig {
|
|
|
37
37
|
* 是否初始化 Firebase(默认 true)
|
|
38
38
|
*/
|
|
39
39
|
initializeFirebase?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Google Tag Manager ID(如:GTM-XXXXXXX)
|
|
42
|
+
* 如果提供,SDK 会自动注入 GTM 代码到页面
|
|
43
|
+
*/
|
|
44
|
+
gtmId?: string;
|
|
40
45
|
/**
|
|
41
46
|
* 是否启用调试模式
|
|
42
47
|
*/
|
|
@@ -84,6 +89,12 @@ declare class TrackClient {
|
|
|
84
89
|
* 获取已初始化的提供商列表
|
|
85
90
|
*/
|
|
86
91
|
getInitializedProviders(): TrackProvider[];
|
|
92
|
+
/**
|
|
93
|
+
* 追踪 GTM 自定义事件
|
|
94
|
+
* @param eventName 事件名称
|
|
95
|
+
* @param parameters 事件参数
|
|
96
|
+
*/
|
|
97
|
+
trackGTMEvent(eventName: string, parameters?: Record<string, any>): void;
|
|
87
98
|
}
|
|
88
99
|
|
|
89
100
|
export { TrackClient, TrackProvider };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{initializeApp as t}from"firebase/app";import{getAnalytics as s}from"firebase/analytics";import*as n from"sa-sdk-javascript";var i,r,e;function o(t,s){return t-=371,a()[t]}function a(){var t=["sensors","297tDQJxZ","163487LncWyn","1684045buxUfK","2428320IZTMRJ","2371179ljcPSQ","4vqhmKv","22YGBMeo","455odrInS","149958gkQzQA","6bTtEDm","SENSORS","firebase","6024496gXXvna","305710CCPtqR"];return(a=function(){return t})()}!function(){for(var t=o,s=a();;)try{if(829439===-parseInt(t(374))/1*(parseInt(t(382))/2)+-parseInt(t(377))/3+parseInt(t(378))/4*(parseInt(t(375))/5)+parseInt(t(381))/6*(parseInt(t(380))/7)+parseInt(t(385))/8+parseInt(t(373))/9*(-parseInt(t(371))/10)+-parseInt(t(379))/11*(-parseInt(t(376))/12))break;s.push(s.shift())}catch(t){s.push(s.shift())}}(),r=i||(i={}),e=o,r.FIREBASE=e(384),r[e(383)]=e(372);const c=l;function l(t,s){t-=112;return p()[t]}function p(){const t=["analytics","track","70EJcNND","108nQVMhI","firebase initialize failed:","error","setUserProperties","8424VnTBHs","setUserId","1687wrwdEo","154vPHpGa","631558cnPISb","initialized","2554428KKZBIe","config","20175AspqHN","306945kDtkwJ","610ZdiTle","7401vVaVdR","192996MJPuKB","clearUserId"];return(p=function(){return t})()}!function(){const t=l,s=p();for(;;)try{if(445436===-parseInt(t(117))/1+parseInt(t(123))/2*(parseInt(t(124))/3)+-parseInt(t(130))/4*(-parseInt(t(121))/5)+parseInt(t(119))/6+parseInt(t(115))/7*(parseInt(t(113))/8)+-parseInt(t(122))/9*(parseInt(t(129))/10)+-parseInt(t(116))/11*(parseInt(t(125))/12))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class h{constructor(t){const s=l;this.analytics=null,this[s(118)]=!1,this[s(120)]=t}async initialize(){const n=l;if(!this[n(118)])try{const i=t(this[n(120)]);this[n(127)]=s(i),this[n(118)]=!0}catch(t){throw console[n(132)](n(131),t),t}}async[c(128)](t,s){}async[c(114)](t){}async[c(112)](t){}async[c(126)](){}}function f(t,s){t-=255;return d()[t]}const I=f;function d(){const t=["login","warn","4205148LagySc","quick","ajax","?t=","token","setUserProperties","sensors sdk init failed:","10000HGUIKT","36376dxXjRM","sensors sdk not initialized, skip setUserProperties","1395nYjOqU","2158800zPZZZU","serverUrl","setUserId","autoTrack","sensors sdk not initialized, skip setUserId","initialized","sensors sdk not found, please install it by running","sensors sdk track failed:","platform","sensors sdk setUserProperties failed:","1924gzmytc","showLog","10NtlfOT","sensors sdk clearUserId failed:","error","config","2558456mtgsyU","initialize","23677291PEKAMT","heatmap","93GLlCYA","&p=","&v=","version","5FnRYrA","sensors sdk not initialized, skip track","sensors sdk setUserId failed:","track","init","clearUserId","sensors"];return(d=function(){return t})()}!function(){const t=f,s=d();for(;;)try{if(455446===parseInt(t(271))/1+parseInt(t(285))/2*(parseInt(t(295))/3)+-parseInt(t(291))/4*(parseInt(t(255))/5)+-parseInt(t(264))/6+parseInt(t(275))/7+-parseInt(t(272))/8*(parseInt(t(274))/9)+-parseInt(t(287))/10*(-parseInt(t(293))/11))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class u{constructor(t,s,n,i){const r=f;this[r(261)]=null,this.initialized=!1,this[r(268)]=t,this[r(283)]=s,this[r(298)]=n,this[r(290)]=i}async[I(292)](){const t=I;if(!this[t(280)])try{if(!n)throw new Error(t(281));this[t(261)]=n;const s=encodeURIComponent(this[t(268)]),i=encodeURIComponent(this[t(283)]),r=encodeURIComponent(this[t(298)]);this[t(261)][t(259)]({server_url:this.config[t(276)]+(t(267)+s+t(296)+i+t(297)+r),show_log:this[t(290)][t(286)]??!1,heatmap:this[t(290)][t(294)]??{},is_track_single_page:!0,send_type:t(266)}),this[t(280)]=!0,this[t(261)][t(265)](t(278))}catch(s){throw console.error(t(270),s),s}}async[I(258)](t,s){const n=I;if(this[n(280)]&&this[n(261)])try{this[n(261)][n(258)](t,s??{})}catch(t){console[n(289)](n(282),t)}else console[n(263)](n(256))}async[I(277)](t){const s=I;if(this.initialized&&this[s(261)])try{this[s(261)][s(262)](t)}catch(t){console.error(s(257),t)}else console[s(263)](s(279))}async[I(269)](t){const s=I;if(this.initialized&&this[s(261)])try{this[s(261)].setProfile(t)}catch(t){console[s(289)](s(284),t)}else console[s(263)](s(273))}async[I(260)](){const t=I;if(this[t(280)]&&this[t(261)])try{this[t(261)].logout()}catch(s){console.error(t(288),s)}}}function k(){var t=["atob","3260qrbkko","from","14772ApEzQO","undefined","toString","base64","72575yVezWQ","1kfKYQU","utf-8","10EsMsFG","204VZMywi","3182553ClSoya","111377HkznwU","456970poanGf","1899MkhrjZ","1706023vNkSru","8WqMktq","btoa","169eJFqyd"];return(k=function(){return t})()}function y(t,s){return t-=445,k()[t]}function w(t){var s=y;return typeof window!==s(455)&&window[s(449)]?window[s(449)](t):Buffer[s(453)](t,s(460))[s(456)](s(457))}function m(t){return JSON.parse((s=t,n=y,typeof window!==n(455)&&window[n(451)]?window[n(451)](s):Buffer[n(453)](s,n(457))[n(456)](n(460))));var s,n}!function(){for(var t=y,s=k();;)try{if(285664===parseInt(t(459))/1*(-parseInt(t(445))/2)+-parseInt(t(446))/3*(-parseInt(t(452))/4)+parseInt(t(458))/5+parseInt(t(462))/6*(-parseInt(t(464))/7)+parseInt(t(448))/8*(parseInt(t(463))/9)+-parseInt(t(461))/10*(-parseInt(t(447))/11)+parseInt(t(454))/12*(parseInt(t(450))/13))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const Z=M;!function(){const t=M,s=v();for(;;)try{if(354492===parseInt(t(157))/1*(parseInt(t(146))/2)+parseInt(t(149))/3+parseInt(t(145))/4+-parseInt(t(156))/5*(-parseInt(t(151))/6)+-parseInt(t(144))/7+parseInt(t(148))/8+-parseInt(t(154))/9)break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const z={"MDE5YjUzNTEyMWJhNzc1ZmIwYTQ1MzY3Njg1NzU1MTU=":{providers:[i[Z(152)],i.SENSORS],firebaseConfig:m(Z(147)),sensorsConfig:m("eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19")},"MDE5YjUzNTE3ZmFiN2YxZDkwNjg5OWVhMGQyMWJlZGI=":{providers:[i[Z(152)],i[Z(153)]],firebaseConfig:m(Z(155)),sensorsConfig:m(Z(150))}};function M(t,s){t-=144;return v()[t]}function v(){const t=["85461vrkAAK","eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19","880494KCWboB","FIREBASE","SENSORS","6572673qrVjNM","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjpkMTQ4OGM3MzI0MWIyZWMzNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctR0gxNk1CQ1NOVyJ9","5TmlrZV","1knsfWw","3777865WWsdvf","1109532ptFHPd","1012358WAdnsG","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjo2NmI2ZTNmNmEwZjM2MDkwNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctN0gySjFTQ05QRCJ9","5325488pMKcVU"];return(v=function(){return t})()}const b=W;function W(t,s){t-=459;return J()[t]}function J(){const t=["values","config","Must provide a token","validateConfig"," adapter failed:","platform","[Track] Skip Firebase initialization (initializeFirebase = false)","providers","allSettled","clearUserId","FIREBASE","setUserId","605088WNrEsP","token","384yKwtET","[Track] ","32158fpmMNA","492UzBrao","setUserProperties","push","Must provide a version","61839MtUIkY","track SDK not initialized, please call initialize() first","Invalid token: ","[Track] Clear User ID","platformConfig","673916xMBCMM","83515TDlSkK","debug","initialized","set","warn","keys","420088DNJbVq","initialize","log","getInitializedProviders","initialize ","6081gtfkRB","initializeFirebase","70ZxbMFS","Must provide a platform","[Track] Set User Properties:","version","adapters","error","track"];return(J=function(){return t})()}!function(){const t=W,s=J();for(;;)try{if(219969===parseInt(t(479))/1+-parseInt(t(472))/2+parseInt(t(484))/3*(-parseInt(t(463))/4)+parseInt(t(473))/5+parseInt(t(505))/6+-parseInt(t(462))/7*(-parseInt(t(460))/8)+-parseInt(t(467))/9*(-parseInt(t(486))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class TrackClient{constructor(t){const s=W;this[s(490)]=new Map,this[s(475)]=!1,this[s(494)]=t,this[s(496)](),this.platformConfig=function(t){const s=w(t),n=z[s];if(!n)throw new Error("invalid token: "+t);return n}(t.token)}validateConfig(){const t=W;if(!this[t(494)][t(459)])throw new Error(t(495));if(!this.config[t(498)])throw new Error(t(487));if(!this.config[t(489)])throw new Error(t(466));if(!(w(this[t(494)][t(459)])in z))throw new Error(t(469)+this[t(494)][t(459)])}async[b(480)](){const t=b;if(this[t(475)])return;const s=[],n=!1!==this[t(494)][t(485)];for(const r of this[t(471)][t(500)])try{if(r===i[t(503)]&&!n){this[t(494)][t(474)]&&console.log(t(499));continue}let e;switch(r){case i[t(503)]:e=new h(this[t(471)].firebaseConfig);break;case i.SENSORS:e=new u(this[t(494)][t(459)],this[t(494)].platform,this[t(494)][t(489)],this[t(471)].sensorsConfig);break;default:console.warn("unknown provider: "+r);continue}this[t(490)][t(476)](r,e),s[t(465)](e.initialize())}catch(s){console[t(491)](t(483)+r+t(497),s)}await Promise.allSettled(s),this[t(475)]=!0,this[t(494)].debug&&console[t(481)]("Track SDK initialized, enabled providers:",Array.from(this[t(490)].keys()))}async[b(492)](t,s){const n=b;if(!this[n(475)])return void console[n(477)](n(468));this[n(494)][n(474)]&&console.log(n(461)+t,s);const i=[];for(const r of this.adapters[n(493)]())i[n(465)](r[n(492)](t,s));await Promise.allSettled(i)}async[b(504)](t){const s=b;if(!this[s(475)])return void console.warn(s(468));this.config[s(474)]&&console[s(481)]("[Track] Set User ID:",t);const n=[];for(const i of this[s(490)].values())n[s(465)](i.setUserId(t));await Promise[s(501)](n)}async[b(464)](t){const s=b;if(!this[s(475)])return void console[s(477)](s(468));this[s(494)][s(474)]&&console.log(s(488),t);const n=[];for(const i of this[s(490)][s(493)]())n[s(465)](i[s(464)](t));await Promise[s(501)](n)}async[b(502)](){const t=b;if(!this[t(475)])return void console[t(477)](t(468));this.config[t(474)]&&console.log(t(470));const s=[];for(const n of this[t(490)].values())s.push(n[t(502)]());await Promise[t(501)](s)}[b(482)](){const t=b;return Array.from(this[t(490)][t(478)]())}}function N(){var t=["32SgbGKg","13277sDXSua","6010DhxHtX","783710XdSXHe","97871pbrJYC","242604lBScki","30678fUxqQA","316cJoVjP","1766924BGaTQl","501bLqUoP","532ArrsRj"];return(N=function(){return t})()}function S(t,s){return t-=409,N()[t]}!function(){for(var t=S,s=N();;)try{if(225315===parseInt(t(416))/1+-parseInt(t(419))/2*(parseInt(t(410))/3)+parseInt(t(409))/4+parseInt(t(415))/5+-parseInt(t(418))/6*(-parseInt(t(411))/7)+-parseInt(t(412))/8*(parseInt(t(417))/9)+parseInt(t(414))/10*(-parseInt(t(413))/11))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();export{TrackClient,i as TrackProvider};
|
|
1
|
+
import{initializeApp as t}from"firebase/app";import{getAnalytics as n}from"firebase/analytics";import*as s from"sa-sdk-javascript";var e,i,r;function o(t,n){return t-=487,a()[t]}function a(){var t=["SENSORS","1146654tyqhKq","10nlCwks","6YRrjUI","12039401HatPBV","72XvwdCb","10434uhteMd","firebase","44156RUyLGb","sensors","1213328lFGCjJ","583857SmdTeC","367678UKKoWY","1925czWzEC","FIREBASE"];return(a=function(){return t})()}function c(){const t=["https://www.googletagmanager.com/ns.html?id=","640618RtkATm","5771596YgzVZB","undefined","error","3mWjXTI","[GTM] GTM ID is empty, skip injection","noscript","DOMContentLoaded","[GTM] Injected successfully: ","head","insertBefore","1368xVdMEr","from","string","[GoogleTagManager] dataLayer not initialized","[GTM] Injection failed:","push","[GoogleTagManager] Invalid event name:","some","createElement","display","firstChild","7112346RRSoLx","gtm.js?id=","body","dataLayer","script","warn","1180fRRVLg","height","addEventListener","https://www.googletagmanager.com/gtm.js?id=","iframe","log","[GTM] Not in browser environment, skip injection","getElementsByTagName","3049958NkRDxS","visibility","appendChild","5AodEsl","getTime","src","includes","79576OEnzmY","[GTM] Already injected, skip","style","[GoogleTagManager] Error pushing to dataLayer:","async","5539044VErsko","querySelectorAll","1133644CGkfOH","none","parentNode"];return(c=function(){return t})()}function l(){return typeof window!==h(200)&&"undefined"!=typeof document}function h(t,n){t-=187;return c()[t]}function p(t){const n=h,s=document.createElement(n(204)),e=document[n(217)](n(230));e[n(239)]=n(197)+t,e[n(227)]="0",e.width="0",e[n(189)][n(218)]=n(195),e[n(189)][n(235)]="hidden",s[n(236)](e),document[n(222)][n(219)]?document[n(222)][n(208)](s,document[n(222)][n(219)]):document[n(222)].appendChild(s)}function f(t,n=!1){const s=h;if(l())if(t)if(function(t){const n=h;if(!l())return!1;const s=!!window[n(223)],e=document[n(193)](n(224)),i=Array[n(210)](e)[n(216)](s=>s[n(239)][n(240)](n(221)+t));return s&&i}(t))n&&console[s(231)](s(188));else try{(function(t){const n=h;window[n(223)]=window[n(223)]||[],window[n(223)][n(214)]({"gtm.start":(new Date)[n(238)](),event:"gtm.js"});const s=document[n(217)](n(224));s[n(191)]=!0,s[n(239)]=n(229)+t;const e=document[n(233)](n(224))[0];e&&e[n(196)]?e[n(196)][n(208)](s,e):document[n(207)][n(236)](s)})(t),document[s(222)]?p(t):document[s(228)](s(205),()=>{p(t)}),n&&console[s(231)](s(206)+t)}catch(t){console[s(201)](s(213),t)}else n&&console[s(225)](s(203));else n&&console[s(225)](s(232))}!function(){for(var t=o,n=a();;)try{if(582763===-parseInt(t(488))/1+-parseInt(t(489))/2*(-parseInt(t(495))/3)+parseInt(t(487))/4+parseInt(t(490))/5*(-parseInt(t(498))/6)+-parseInt(t(500))/7*(parseInt(t(497))/8)+parseInt(t(493))/9+-parseInt(t(494))/10*(-parseInt(t(496))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}(),(i=e||(e={}))[(r=o)(491)]=r(499),i[r(492)]=r(501),function(){const t=h,n=c();for(;;)try{if(864519===-parseInt(t(194))/1+parseInt(t(234))/2*(-parseInt(t(202))/3)+parseInt(t(199))/4*(-parseInt(t(237))/5)+-parseInt(t(220))/6+parseInt(t(192))/7+parseInt(t(187))/8*(-parseInt(t(209))/9)+parseInt(t(226))/10*(parseInt(t(198))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}();const d=(t,n)=>{const s=h;if(!t||typeof t!==s(211))return void console[s(201)](s(215),t);(t=>{const n=h;if(typeof window!==n(200)&&window[n(223)])try{window[n(223)].push(t),console[n(231)]("[GoogleTagManager] Pushed to dataLayer:",t)}catch(t){console[n(201)](n(190),t)}else console.error(n(212))})({event:t,...n||{}})},u=m;function I(){const t=["18FZZtQY","debug","700bgNZwQ","error","2286tuPkXP","config","initialize","138120PWZQKy","206773GptbWp","gtmId","firebase initialize failed:","150HXAivI","2573968DFuAOj","track","setUserId","initialized","935CxswzO","1415SANPrR","analytics","14468QYfXpR","23632476ouRicX","2639868LReoTB","setUserProperties"];return(I=function(){return t})()}function m(t,n){t-=378;return I()[t]}!function(){const t=m,n=I();for(;;)try{if(942241===-parseInt(t(388))/1*(-parseInt(t(386))/2)+parseInt(t(382))/3+parseInt(t(380))/4*(parseInt(t(378))/5)+-parseInt(t(395))/6*(-parseInt(t(392))/7)+parseInt(t(396))/8*(parseInt(t(384))/9)+-parseInt(t(391))/10*(parseInt(t(400))/11)+-parseInt(t(381))/12)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();class w{constructor(t,n,s=!1){const e=m;this[e(379)]=null,this.initialized=!1,this.config=t,this[e(393)]=n,this[e(385)]=s}async[u(390)](){const s=u;if(!this[s(399)])try{const e=t(this[s(389)]);this[s(379)]=n(e),this[s(393)]&&f(this[s(393)],this[s(385)]),this[s(399)]=!0}catch(t){throw console[s(387)](s(394),t),t}}async[u(397)](t,n){}async[u(398)](t){}async[u(383)](t){}async clearUserId(){}}function y(){const t=["setProfile","config","11294sjMMdj","1978938nmWEDm","initialized","762160ojZOiE","3584zAhxXy","login","sensors sdk init failed:","ajax","sensors sdk clearUserId failed:","sensors sdk setUserProperties failed:","30FsDgRb","?t=","sensors sdk track failed:","showLog","sensors sdk not initialized, skip setUserProperties","sensors","platform","&v=","sensors sdk not initialized, skip setUserId","token","logout","1190484fKqUHH","clearUserId","serverUrl","144FSCrfE","version","autoTrack","track","2341889dLAaZa","warn","setUserProperties","sensors sdk not initialized, skip track","error","init","heatmap","3sRLQwu","29ucSzEm","sensors sdk not found, please install it by running","495642PTzYnZ"];return(y=function(){return t})()}const k=g;function g(t,n){t-=434;return y()[t]}!function(){const t=g,n=y();for(;;)try{if(152940===parseInt(t(455))/1*(-parseInt(t(460))/2)+parseInt(t(454))/3*(-parseInt(t(440))/4)+-parseInt(t(463))/5+-parseInt(t(457))/6+parseInt(t(464))/7*(-parseInt(t(443))/8)+parseInt(t(461))/9+-parseInt(t(470))/10*(-parseInt(t(447))/11))break;n.push(n.shift())}catch(t){n.push(n.shift())}}();class z{constructor(t,n,s,e){const i=g;this[i(434)]=null,this[i(462)]=!1,this[i(438)]=t,this[i(435)]=n,this[i(444)]=s,this[i(459)]=e}async initialize(){const t=g;if(!this[t(462)])try{if(!s)throw new Error(t(456));this[t(434)]=s;const n=encodeURIComponent(this[t(438)]),e=encodeURIComponent(this[t(435)]),i=encodeURIComponent(this.version);this[t(434)][t(452)]({server_url:this[t(459)][t(442)]+(t(471)+n+"&p=")+e+t(436)+i,show_log:this[t(459)][t(473)]??!1,heatmap:this[t(459)][t(453)]??{},is_track_single_page:!0,send_type:t(467)}),this[t(462)]=!0,this[t(434)].quick(t(445))}catch(n){throw console.error(t(466),n),n}}async track(t,n){const s=g;if(this[s(462)]&&this.sensors)try{this.sensors[s(446)](t,n??{})}catch(t){console[s(451)](s(472),t)}else console[s(448)](s(450))}async setUserId(t){const n=g;if(this.initialized&&this[n(434)])try{this[n(434)][n(465)](t)}catch(t){console[n(451)]("sensors sdk setUserId failed:",t)}else console[n(448)](n(437))}async[k(449)](t){const n=k;if(this[n(462)]&&this[n(434)])try{this[n(434)][n(458)](t)}catch(t){console[n(451)](n(469),t)}else console.warn(n(474))}async[k(441)](){const t=k;if(this[t(462)]&&this[t(434)])try{this[t(434)][t(439)]()}catch(n){console[t(451)](t(468),n)}}}function Z(){var t=["354678dogvAx","btoa","359526ttsFxQ","from","21987130Tpiajt","664182NOyIiu","49xKmsyL","toString","utf-8","379490LZXEay","1100760TSqOmK","4ijpxah","undefined","537210ZXHEiG","atob","base64","48qWMHBu"];return(Z=function(){return t})()}function v(t,n){return t-=153,Z()[t]}function M(t){var n=v;return typeof window!==n(165)&&window.btoa?window[n(154)](t):Buffer.from(t,n(161))[n(160)](n(168))}function b(t){return JSON.parse((n=t,s=v,"undefined"!=typeof window&&window[s(167)]?window[s(167)](n):Buffer[s(156)](n,s(168))[s(160)](s(161))));var n,s}!function(){for(var t=v,n=Z();;)try{if(291539===-parseInt(t(153))/1+-parseInt(t(158))/2+parseInt(t(163))/3*(-parseInt(t(164))/4)+-parseInt(t(162))/5+parseInt(t(155))/6*(-parseInt(t(159))/7)+-parseInt(t(169))/8*(parseInt(t(166))/9)+parseInt(t(157))/10)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();const W=Y;function E(){const t=["invalid token: ","384198pYPvQh","324372WilpbA","1340245cvYdnw","152754uuOaag","SENSORS","3PPXWTF","28NhXTrG","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjo2NmI2ZTNmNmEwZjM2MDkwNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctN0gySjFTQ05QRCJ9","473216CZJfaY","GTM-MJDRW2W4","eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19","2360610plEQbs","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjpkMTQ4OGM3MzI0MWIyZWMzNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctR0gxNk1CQ1NOVyJ9","301116rZpfFW","FIREBASE"];return(E=function(){return t})()}function Y(t,n){t-=333;return E()[t]}!function(){const t=Y,n=E();for(;;)try{if(227035===parseInt(t(340))/1+-parseInt(t(343))/2+-parseInt(t(348))/3*(-parseInt(t(344))/4)+-parseInt(t(345))/5+parseInt(t(346))/6*(parseInt(t(333))/7)+-parseInt(t(335))/8+parseInt(t(338))/9)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();const N={"MDE5YjUzNTEyMWJhNzc1ZmIwYTQ1MzY3Njg1NzU1MTU=":{providers:[e[W(341)],e.SENSORS],firebaseConfig:b(W(334)),sensorsConfig:b("eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19"),gtmId:W(336)},"MDE5YjUzNTE3ZmFiN2YxZDkwNjg5OWVhMGQyMWJlZGI=":{providers:[e[W(341)],e[W(347)]],firebaseConfig:b(W(339)),sensorsConfig:b(W(337))}};const R=T;function T(t,n){t-=143;return J()[t]}function J(){const t=["688465TpRXqg","platform","Must provide a version","firebaseConfig","gtmId","380181RHQacf","log","initializeFirebase","[Track] Clear User ID","FIREBASE"," adapter failed:","token","Track SDK initialized, enabled providers:","version","allSettled","unknown provider: ","20JCPGCX","keys","41433VwwrEk","push","initialize ","debug","platformConfig","initialize","setUserProperties","from","1289510udaYOk","track","Must provide a token","values","Invalid token: ","clearUserId","config","track SDK not initialized, please call initialize() first","warn","initialized","SENSORS","Must provide a platform","4352388KzorHn","1520001jpLeoe","set","50706IgcoHf","trackGTMEvent","validateConfig","providers","setUserId","sensorsConfig","1008JFOLfU","adapters"];return(J=function(){return t})()}!function(){const t=T,n=J();for(;;)try{if(369635===parseInt(t(184))/1+-parseInt(t(143))/2+parseInt(t(171))/3*(parseInt(t(182))/4)+parseInt(t(166))/5+-parseInt(t(155))/6+parseInt(t(156))/7+-parseInt(t(164))/8*(-parseInt(t(158))/9))break;n.push(n.shift())}catch(t){n.push(n.shift())}}();class TrackClient{constructor(t){const n=T;this[n(165)]=new Map,this.initialized=!1,this[n(149)]=t,this[n(160)](),this.platformConfig=function(t){const n=W,s=M(t),e=N[s];if(!e)throw new Error(n(342)+t);return e}(t[n(177)])}[R(160)](){const t=R;if(!this[t(149)][t(177)])throw new Error(t(145));if(!this.config[t(167)])throw new Error(t(154));if(!this[t(149)][t(179)])throw new Error(t(168));if(!(M(this[t(149)].token)in N))throw new Error(t(147)+this[t(149)][t(177)])}async[R(189)](){const t=R;if(this[t(152)])return;const n=[],s=!1!==this[t(149)][t(173)];for(const i of this[t(188)][t(161)])try{if(i===e[t(175)]&&!s){this[t(149)][t(187)]&&console[t(172)]("[Track] Skip Firebase initialization (initializeFirebase = false)");continue}let r;switch(i){case e.FIREBASE:r=new w(this[t(188)][t(169)],this[t(188)][t(170)],this[t(149)][t(187)]);break;case e[t(153)]:r=new z(this[t(149)][t(177)],this[t(149)][t(167)],this.config[t(179)],this[t(188)][t(163)]);break;default:console[t(151)](t(181)+i);continue}this.adapters[t(157)](i,r),n[t(185)](r[t(189)]())}catch(n){console.error(t(186)+i+t(176),n)}await Promise[t(180)](n),this.initialized=!0,this[t(149)][t(187)]&&console[t(172)](t(178),Array[t(191)](this[t(165)][t(183)]()))}async[R(144)](t,n){const s=R;if(!this[s(152)])return void console.warn(s(150));this[s(149)].debug&&console[s(172)]("[Track] "+t,n);const e=[];for(const i of this[s(165)].values())e[s(185)](i.track(t,n));await Promise.allSettled(e)}async[R(162)](t){const n=R;if(!this[n(152)])return void console[n(151)](n(150));this[n(149)][n(187)]&&console[n(172)]("[Track] Set User ID:",t);const s=[];for(const e of this[n(165)][n(146)]())s.push(e[n(162)](t));await Promise[n(180)](s)}async[R(190)](t){const n=R;if(!this[n(152)])return void console[n(151)](n(150));this[n(149)][n(187)]&&console[n(172)]("[Track] Set User Properties:",t);const s=[];for(const e of this[n(165)][n(146)]())s[n(185)](e[n(190)](t));await Promise[n(180)](s)}async[R(148)](){const t=R;if(!this[t(152)])return void console[t(151)]("track SDK not initialized, please call initialize() first");this[t(149)][t(187)]&&console.log(t(174));const n=[];for(const s of this[t(165)][t(146)]())n[t(185)](s[t(148)]());await Promise[t(180)](n)}getInitializedProviders(){const t=R;return Array[t(191)](this[t(165)][t(183)]())}[R(159)](t,n){d(t,n)}}function S(t,n){return t-=329,F()[t]}function F(){var t=["6196705GwhpAJ","1426217cdUrKE","684760FfrYQM","4448580BvamqL","3871042YoPffK","1989099RgqctH","3322020sfEcMR","6ewsuwv"];return(F=function(){return t})()}!function(){for(var t=S,n=F();;)try{if(986249===parseInt(t(332))/1+-parseInt(t(329))/2+-parseInt(t(336))/3+parseInt(t(334))/4+parseInt(t(331))/5*(parseInt(t(330))/6)+-parseInt(t(335))/7+parseInt(t(333))/8)break;n.push(n.shift())}catch(t){n.push(n.shift())}}();export{TrackClient,e as TrackProvider};
|