@seaverse/track-sdk 0.1.3 → 0.1.4

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/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";function t(t){var s=Object.create(null);return t&&Object.keys(t).forEach(function(r){if("default"!==r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(s,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}}),s.default=t,Object.freeze(s)}var s,r,i=t(require("sa-sdk-javascript"));function e(){var t=["FIREBASE","sensors","3427990UDPcfb","732221cCZylQ","610EesDrh","290166KRmVZn","SENSORS","767868FUFJoM","8yoeguU","280562POuZwM","firebase","134559xNtffz","1640610FJxxZv","2QLUlNw"];return(e=function(){return t})()}function n(t,s){return t-=130,e()[t]}!function(){for(var t=n,s=e();;)try{if(771052===-parseInt(t(132))/1*(-parseInt(t(136))/2)+-parseInt(t(142))/3+parseInt(t(130))/4+-parseInt(t(139))/5+parseInt(t(135))/6+parseInt(t(140))/7*(-parseInt(t(131))/8)+-parseInt(t(134))/9*(-parseInt(t(141))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}(),exports.TrackProvider=void 0,(s=exports.TrackProvider||(exports.TrackProvider={}))[(r=n)(137)]=r(133),s[r(143)]=r(138);const a=o;function o(t,s){t-=324;return c()[t]}function c(){const t=["initialized","firebase/app","1294996CTdGBw","117880piZAsY","13268690mThkxa","track","setUserId","initialize","499492ZIEozO","setUserProperties","7MYWKQW","1726578GAgBtl","323249EfbwRS","1431496auqJlP","analytics","firebase/analytics","3JFpzjR","clearUserId","config","firebase initialize failed:","156BDkgia"];return(c=function(){return t})()}!function(){const t=o,s=c();for(;;)try{if(329546===-parseInt(t(338))/1+parseInt(t(334))/2+-parseInt(t(342))/3*(parseInt(t(328))/4)+parseInt(t(329))/5*(-parseInt(t(325))/6)+parseInt(t(336))/7*(-parseInt(t(339))/8)+parseInt(t(337))/9+parseInt(t(330))/10)break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class l{constructor(t){const s=o;this[s(340)]=null,this[s(326)]=!1,this[s(344)]=t}async[a(333)](){const t=a;if(!this.initialized)try{const{initializeApp:s}=await import(t(327)),{getAnalytics:r}=await import(t(341)),i=s(this[t(344)]);this[t(340)]=r(i),this[t(326)]=!0}catch(s){throw console.error(t(324),s),s}}async[a(331)](t,s){}async[a(332)](t){}async[a(335)](t){}async[a(343)](){}}var p=f;function f(t,s){return t-=115,h()[t]}function h(){var t=["logout","3511144ZxjYLm","token","quick","5612CNvzaU","setUserId","sensors sdk track failed:","clearUserId","autoTrack","160655QQZKDa","sensors sdk setUserId failed:","sensors sdk not initialized, skip setUserProperties","2366274IZTaUy","10dUBJOI","?token=","warn","sensors sdk not found, please install it by running","error","1745MSAEoG","heatmap","sensors sdk not initialized, skip track","sensors sdk not initialized, skip setUserId","track","2142339RwGjZW","setProfile","initialized","19190160GIMdmP","setUserProperties","showLog","ajax","sensors","sensors sdk init failed:","initialize","7yLGEJX","config","990956RPlaKT","sensors sdk setUserProperties failed:"];return(h=function(){return t})()}!function(){for(var t=f,s=h();;)try{if(418369===-parseInt(t(144))/1+-parseInt(t(133))/2+-parseInt(t(121))/3+parseInt(t(139))/4*(parseInt(t(116))/5)+parseInt(t(147))/6*(-parseInt(t(131))/7)+-parseInt(t(136))/8+-parseInt(t(124))/9*(-parseInt(t(148))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class I{constructor(t,s){var r=f;this.sensors=null,this[r(123)]=!1,this[r(137)]=t,this.config=s}async[p(130)](){var t=p;if(!this.initialized)try{if(!i)throw new Error(t(151));this[t(128)]=i,this.sensors.init({server_url:this.config.serverUrl+(t(149)+this[t(137)]),show_log:this[t(132)][t(126)]??!1,heatmap:this.config[t(117)]??{},is_track_single_page:!0,send_type:t(127)}),this[t(123)]=!0,this.sensors[t(138)](t(143))}catch(s){throw console.error(t(129),s),s}}async[p(120)](t,s){var r=p;if(this.initialized&&this[r(128)])try{this[r(128)][r(120)](t,s??{})}catch(t){console[r(115)](r(141),t)}else console[r(150)](r(118))}async[p(140)](t){var s=p;if(this[s(123)]&&this[s(128)])try{this.sensors.login(t)}catch(t){console.error(s(145),t)}else console[s(150)](s(119))}async[p(125)](t){var s=p;if(this[s(123)]&&this.sensors)try{this.sensors[s(122)](t)}catch(t){console[s(115)](s(134),t)}else console[s(150)](s(146))}async[p(142)](){var t=p;if(this[t(123)]&&this[t(128)])try{this.sensors[t(135)]()}catch(t){console.error("sensors sdk clearUserId failed:",t)}}}function u(t,s){return t-=203,w()[t]}function d(t){var s=u;return typeof window!==s(210)&&window.btoa?window[s(211)](t):Buffer[s(209)](t,s(213))[s(203)](s(206))}function k(t){var s,r;return JSON[u(222)]((s=t,r=u,"undefined"!=typeof window&&window[r(204)]?window[r(204)](s):Buffer[r(209)](s,r(206))[r(203)](r(213))))}function w(){var t=["5924314IuEinC","1791170YtRuWg","9OHPToU","12dudggP","22872hHVHtE","13758890RkrFXf","parse","toString","atob","397034dVRKGj","base64","3297bcxZBZ","9LnLuZP","from","undefined","btoa","5840112kVBDgt","utf-8","721738dFfGcd","12IuQZan"];return(w=function(){return t})()}!function(){for(var t=u,s=w();;)try{if(706665===parseInt(t(214))/1+parseInt(t(205))/2*(parseInt(t(218))/3)+-parseInt(t(219))/4*(parseInt(t(217))/5)+parseInt(t(212))/6+parseInt(t(207))/7*(-parseInt(t(220))/8)+-parseInt(t(208))/9*(-parseInt(t(221))/10)+-parseInt(t(216))/11*(parseInt(t(215))/12))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const y=v;function z(){const t=["eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19","SENSORS","26621368Pugffv","1022312geglzp","FIREBASE","2363529WbTvYo","4010830HlUJSd","2243758JJZYtW","3CLfEqV","2608470MmAjIx","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjo2NmI2ZTNmNmEwZjM2MDkwNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctN0gySjFTQ05QRCJ9","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjpkMTQ4OGM3MzI0MWIyZWMzNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctR0gxNk1CQ1NOVyJ9","464221czTnMv"];return(z=function(){return t})()}function v(t,s){t-=394;return z()[t]}!function(){const t=v,s=z();for(;;)try{if(586729===-parseInt(t(401))/1+-parseInt(t(396))/2+-parseInt(t(397))/3*(parseInt(t(405))/4)+-parseInt(t(395))/5+-parseInt(t(398))/6+parseInt(t(394))/7+parseInt(t(404))/8)break;s.push(s.shift())}catch(t){s.push(s.shift())}}();const Z={"MDE5YjUzNTEyMWJhNzc1ZmIwYTQ1MzY3Njg1NzU1MTU=":{providers:[exports.TrackProvider.FIREBASE,exports.TrackProvider[y(403)]],firebaseConfig:k(y(399)),sensorsConfig:k(y(402))},"MDE5YjUzNTE3ZmFiN2YxZDkwNjg5OWVhMGQyMWJlZGI=":{providers:[exports.TrackProvider[y(406)],exports.TrackProvider[y(403)]],firebaseConfig:k(y(400)),sensorsConfig:k(y(402))}};function m(t,s){t-=256;return g()[t]}const b=m;function g(){const t=["Invalid token: ","values","FIREBASE","SENSORS","error","token","434IlxLix","[Track] Skip Firebase initialization (initializeFirebase = false)","initialize","allSettled","platformConfig","initialize ","[Track] Set User Properties:","initialized","21758530ScPFqr","validateConfig","Must provide a token","adapters","Track SDK initialized, enabled providers:","setUserProperties","4904053othnyg","clearUserId","debug"," adapter failed:","log","471950BcvnhH","track","unknown provider: ","9HvWPKX","initializeFirebase","2265836jRDolN","warn","[Track] Clear User ID","providers","[Track] Set User ID:","config","getInitializedProviders","889992nBqDuO","5gRTFdn","from","track SDK not initialized, please call initialize() first","push","sensorsConfig","4287FIamXn","set","keys","6813888HUrKVz"];return(g=function(){return t})()}!function(){const t=m,s=g();for(;;)try{if(632979===-parseInt(t(259))/1+parseInt(t(287))/2*(parseInt(t(277))/3)+parseInt(t(264))/4*(parseInt(t(272))/5)+-parseInt(t(280))/6+-parseInt(t(301))/7+-parseInt(t(271))/8+-parseInt(t(262))/9*(-parseInt(t(295))/10))break;s.push(s.shift())}catch(t){s.push(s.shift())}}();class TrackClient{constructor(t){const s=m;this[s(298)]=new Map,this[s(294)]=!1,this[s(269)]=t,this[s(296)](),this[s(291)]=function(t){const s=d(t),r=Z[s];if(!r)throw new Error("invalid token: "+t);return r}(t[s(286)])}[b(296)](){const t=b;if(!this[t(269)][t(286)])throw new Error(t(297));if(!(d(this[t(269)][t(286)])in Z))throw new Error(t(281)+this[t(269)][t(286)])}async[b(289)](){const t=b;if(this[t(294)])return;const s=[],r=!1!==this[t(269)][t(263)];for(const i of this[t(291)][t(267)])try{if(i===exports.TrackProvider[t(283)]&&!r){this[t(269)][t(256)]&&console[t(258)](t(288));continue}let e;switch(i){case exports.TrackProvider[t(283)]:e=new l(this[t(291)].firebaseConfig);break;case exports.TrackProvider[t(284)]:e=new I(this[t(269)][t(286)],this[t(291)][t(276)]);break;default:console[t(265)](t(261)+i);continue}this.adapters[t(278)](i,e),s[t(275)](e.initialize())}catch(s){console[t(285)](t(292)+i+t(257),s)}await Promise[t(290)](s),this[t(294)]=!0,this.config[t(256)]&&console.log(t(299),Array[t(273)](this.adapters[t(279)]()))}async[b(260)](t,s){const r=b;if(!this[r(294)])return void console.warn(r(274));this[r(269)][r(256)]&&console[r(258)]("[Track] "+t,s);const i=[];for(const e of this[r(298)][r(282)]())i[r(275)](e.track(t,s));await Promise[r(290)](i)}async setUserId(t){const s=b;if(!this[s(294)])return void console[s(265)](s(274));this[s(269)][s(256)]&&console[s(258)](s(268),t);const r=[];for(const i of this[s(298)][s(282)]())r.push(i.setUserId(t));await Promise[s(290)](r)}async setUserProperties(t){const s=b;if(!this.initialized)return void console[s(265)](s(274));this[s(269)][s(256)]&&console[s(258)](s(293),t);const r=[];for(const i of this.adapters[s(282)]())r.push(i[s(300)](t));await Promise[s(290)](r)}async[b(302)](){const t=b;if(!this[t(294)])return void console[t(265)]("track SDK not initialized, please call initialize() first");this[t(269)][t(256)]&&console[t(258)](t(266));const s=[];for(const r of this[t(298)][t(282)]())s[t(275)](r[t(302)]());await Promise[t(290)](s)}[b(270)](){const t=b;return Array[t(273)](this[t(298)][t(279)]())}}function W(t,s){return t-=313,J()[t]}function J(){var t=["4298IHpZxp","358508BbNENt","44889IjODWb","1501494SIAtKt","30maoPex","127900YwwWas","481854wvVbsV","4880646VKSrHS","1kszukf","2376CPwdiv"];return(J=function(){return t})()}!function(){for(var t=W,s=J();;)try{if(285597===parseInt(t(318))/1*(parseInt(t(316))/2)+-parseInt(t(322))/3+-parseInt(t(321))/4*(parseInt(t(314))/5)+parseInt(t(313))/6+-parseInt(t(320))/7*(parseInt(t(319))/8)+parseInt(t(317))/9+-parseInt(t(315))/10)break;s.push(s.shift())}catch(t){s.push(s.shift())}}(),exports.TrackClient=TrackClient;
1
+ "use strict";var t=require("firebase/app"),i=require("firebase/analytics");function r(t){var i=Object.create(null);return t&&Object.keys(t).forEach(function(r){if("default"!==r){var s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(i,r,s.get?s:{enumerable:!0,get:function(){return t[r]}})}}),i.default=t,Object.freeze(i)}var s,e,n=r(require("sa-sdk-javascript"));function a(t,i){return t-=399,o()[t]}function o(){var t=["FIREBASE","776HsCrGU","223815jCuPWJ","SENSORS","sensors","55773YTblbw","firebase","14576380cQPubj","4149tHAnFO","18ScHzcO","7387450mUmjRI","4436CPiLeE","597557vTTyxA","198186DykHID"];return(o=function(){return t})()}!function(){for(var t=a,i=o();;)try{if(947597===-parseInt(t(406))/1+parseInt(t(407))/2+parseInt(t(402))/3*(-parseInt(t(405))/4)+parseInt(t(410))/5*(-parseInt(t(403))/6)+parseInt(t(404))/7+parseInt(t(409))/8*(parseInt(t(399))/9)+parseInt(t(401))/10)break;i.push(i.shift())}catch(t){i.push(i.shift())}}(),exports.TrackProvider=void 0,(s=exports.TrackProvider||(exports.TrackProvider={}))[(e=a)(408)]=e(400),s[e(411)]=e(412);const c=f;function l(){const t=["82744DEbrnD","analytics","560FjYXIq","firebase initialize failed:","3088612pnEzZb","error","342940ZEnAPy","280315GxaehU","setUserProperties","2084WluNsm","setUserId","777009QlLfEy","config","806uKhcfK","initialize","initialized","3896328XwyYbk","207WgoaAp"];return(l=function(){return t})()}function f(t,i){t-=232;return l()[t]}!function(){const t=f,i=l();for(;;)try{if(442251===-parseInt(t(243))/1*(-parseInt(t(247))/2)+-parseInt(t(245))/3+parseInt(t(238))/4+parseInt(t(241))/5+parseInt(t(232))/6+parseInt(t(236))/7*(-parseInt(t(234))/8)+parseInt(t(233))/9*(-parseInt(t(240))/10))break;i.push(i.shift())}catch(t){i.push(i.shift())}}();class p{constructor(t){const i=f;this[i(235)]=null,this.initialized=!1,this[i(246)]=t}async[c(248)](){const r=c;if(!this[r(249)])try{const s=t.initializeApp(this.config);this[r(235)]=i.getAnalytics(s),this[r(249)]=!0}catch(t){throw console[r(239)](r(237),t),t}}async track(t,i){}async[c(244)](t){}async[c(242)](t){}async clearUserId(){}}var h=d;function I(){var t=["3142779iHUSNt","setUserId","initialized","13208536DxqFaK","error","1678705ibyJql","quick","1107730wffWxr","heatmap","27000IHRfMa","sensors","sensors sdk track failed:","setUserProperties","clearUserId","15182424VxRKap","sensors sdk not initialized, skip setUserId","config","460SEHirq","ajax","sensors sdk setUserId failed:","1763474AgNTir","logout","sensors sdk setUserProperties failed:","setProfile","track","sensors sdk clearUserId failed:","login","warn","6nQcNNS","initialize"];return(I=function(){return t})()}function d(t,i){return t-=229,I()[t]}!function(){for(var t=d,i=I();;)try{if(856532===parseInt(t(235))/1+-parseInt(t(248))/2+parseInt(t(258))/3+-parseInt(t(245))/4*(parseInt(t(237))/5)+parseInt(t(256))/6*(parseInt(t(233))/7)+parseInt(t(231))/8+-parseInt(t(242))/9)break;i.push(i.shift())}catch(t){i.push(i.shift())}}();class u{constructor(t,i){var r=d;this[r(238)]=null,this[r(230)]=!1,this.token=t,this[r(244)]=i}async[h(257)](){var t=h;if(!this[t(230)])try{if(!n)throw new Error("sensors sdk not found, please install it by running");this[t(238)]=n,this[t(238)].init({server_url:this.config.serverUrl+"?token="+this.token,show_log:this[t(244)].showLog??!1,heatmap:this[t(244)][t(236)]??{},is_track_single_page:!0,send_type:t(246)}),this.initialized=!0,this[t(238)][t(234)]("autoTrack")}catch(i){throw console[t(232)]("sensors sdk init failed:",i),i}}async[h(252)](t,i){var r=h;if(this[r(230)]&&this[r(238)])try{this[r(238)].track(t,i??{})}catch(t){console.error(r(239),t)}else console[r(255)]("sensors sdk not initialized, skip track")}async[h(229)](t){var i=h;if(this.initialized&&this[i(238)])try{this.sensors[i(254)](t)}catch(t){console[i(232)](i(247),t)}else console[i(255)](i(243))}async[h(240)](t){var i=h;if(this.initialized&&this.sensors)try{this[i(238)][i(251)](t)}catch(t){console.error(i(250),t)}else console[i(255)]("sensors sdk not initialized, skip setUserProperties")}async[h(241)](){var t=h;if(this[t(230)]&&this[t(238)])try{this[t(238)][t(249)]()}catch(i){console[t(232)](t(253),i)}}}function k(){var t=["1197609nXSHpR","3747532ElZanL","base64","parse","260aTWioN","undefined","utf-8","5033754fTyHDd","8YxFzgT","atob","52134ZwlgWT","btoa","22766571rWalqM","10991750QiiPzJ","toString","1174280AAlfUR","from"];return(k=function(){return t})()}function y(t){var i=z;return typeof window!==i(491)&&window[i(497)]?window[i(497)](t):Buffer[i(502)](t,"utf-8")[i(500)](i(488))}function z(t,i){return t-=488,k()[t]}function Z(t){var i,r;return JSON[z(489)]((i=t,r=z,typeof window!==r(491)&&window[r(495)]?window[r(495)](i):Buffer.from(i,r(488))[r(500)](r(492))))}!function(){for(var t=z,i=k();;)try{if(843963===parseInt(t(503))/1+-parseInt(t(501))/2+parseInt(t(493))/3+-parseInt(t(504))/4+-parseInt(t(490))/5*(-parseInt(t(496))/6)+parseInt(t(499))/7+parseInt(t(494))/8*(-parseInt(t(498))/9))break;i.push(i.shift())}catch(t){i.push(i.shift())}}();const w=v;function v(t,i){t-=381;return b()[t]}!function(){const t=v,i=b();for(;;)try{if(950768===parseInt(t(390))/1+parseInt(t(392))/2*(-parseInt(t(394))/3)+parseInt(t(388))/4*(parseInt(t(386))/5)+-parseInt(t(383))/6*(-parseInt(t(389))/7)+parseInt(t(385))/8*(parseInt(t(393))/9)+parseInt(t(381))/10*(-parseInt(t(384))/11)+-parseInt(t(391))/12)break;i.push(i.shift())}catch(t){i.push(i.shift())}}();const m={"MDE5YjUzNTEyMWJhNzc1ZmIwYTQ1MzY3Njg1NzU1MTU=":{providers:[exports.TrackProvider.FIREBASE,exports.TrackProvider.SENSORS],firebaseConfig:Z(w(396)),sensorsConfig:Z("eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19")},"MDE5YjUzNTE3ZmFiN2YxZDkwNjg5OWVhMGQyMWJlZGI=":{providers:[exports.TrackProvider.FIREBASE,exports.TrackProvider.SENSORS],firebaseConfig:Z(w(395)),sensorsConfig:Z(w(382))}};function b(){const t=["eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19","33498aoRzxo","55dqGHkS","624MZETDy","70195wNfvmq","invalid token: ","68ZZKVvM","511rAHzHe","688204DOtBBQ","8854644fCoIUf","3604DnGCOS","156879ZlokMk","591QpdTmO","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjpkMTQ4OGM3MzI0MWIyZWMzNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctR0gxNk1CQ1NOVyJ9","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjo2NmI2ZTNmNmEwZjM2MDkwNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctN0gySjFTQ05QRCJ9","1300790MGpQlB"];return(b=function(){return t})()}const W=J;function J(t,i){t-=210;return N()[t]}!function(){const t=J,i=N();for(;;)try{if(731907===parseInt(t(219))/1*(parseInt(t(220))/2)+parseInt(t(237))/3+-parseInt(t(226))/4+parseInt(t(248))/5*(parseInt(t(214))/6)+parseInt(t(225))/7*(parseInt(t(216))/8)+parseInt(t(222))/9+-parseInt(t(242))/10)break;i.push(i.shift())}catch(t){i.push(i.shift())}}();class TrackClient{constructor(t){const i=J;this[i(212)]=new Map,this[i(253)]=!1,this.config=t,this.validateConfig(),this[i(221)]=function(t){const i=w,r=y(t),s=m[r];if(!s)throw new Error(i(387)+t);return s}(t[i(250)])}[W(233)](){const t=W;if(!this[t(239)][t(250)])throw new Error(t(224));if(!(y(this[t(239)][t(250)])in m))throw new Error("Invalid token: "+this[t(239)].token)}async initialize(){const t=W;if(this[t(253)])return;const i=[],r=!1!==this.config[t(254)];for(const s of this.platformConfig[t(229)])try{if(s===exports.TrackProvider.FIREBASE&&!r){this.config[t(213)]&&console[t(231)](t(232));continue}let e;switch(s){case exports.TrackProvider[t(230)]:e=new p(this[t(221)][t(218)]);break;case exports.TrackProvider.SENSORS:e=new u(this.config[t(250)],this[t(221)][t(235)]);break;default:console[t(217)]("unknown provider: "+s);continue}this[t(212)][t(251)](s,e),i[t(223)](e[t(227)]())}catch(i){console[t(252)](t(247)+s+" adapter failed:",i)}await Promise.allSettled(i),this.initialized=!0,this[t(239)].debug&&console[t(231)](t(246),Array[t(245)](this[t(212)].keys()))}async[W(249)](t,i){const r=W;if(!this[r(253)])return void console.warn("track SDK not initialized, please call initialize() first");this[r(239)][r(213)]&&console.log(r(211)+t,i);const s=[];for(const e of this[r(212)][r(244)]())s[r(223)](e[r(249)](t,i));await Promise[r(243)](s)}async[W(240)](t){const i=W;if(!this.initialized)return void console.warn(i(236));this[i(239)][i(213)]&&console[i(231)](i(238),t);const r=[];for(const s of this[i(212)][i(244)]())r[i(223)](s[i(240)](t));await Promise[i(243)](r)}async[W(228)](t){const i=W;if(!this.initialized)return void console[i(217)](i(236));this[i(239)][i(213)]&&console[i(231)](i(215),t);const r=[];for(const s of this[i(212)][i(244)]())r[i(223)](s.setUserProperties(t));await Promise[i(243)](r)}async[W(210)](){const t=W;if(!this.initialized)return void console[t(217)](t(236));this[t(239)][t(213)]&&console[t(231)](t(234));const i=[];for(const r of this.adapters[t(244)]())i.push(r.clearUserId());await Promise[t(243)](i)}[W(241)](){const t=W;return Array.from(this[t(212)].keys())}}function N(){const t=["track","token","set","error","initialized","initializeFirebase","clearUserId","[Track] ","adapters","debug","6666AOMwAR","[Track] Set User Properties:","6784544fReUJd","warn","firebaseConfig","13UUYDbJ","148420vMAKet","platformConfig","13041306CpaEjZ","push","Must provide a token","7rBiMsQ","4515232ZhhccT","initialize","setUserProperties","providers","FIREBASE","log","[Track] Skip Firebase initialization (initializeFirebase = false)","validateConfig","[Track] Clear User ID","sensorsConfig","track SDK not initialized, please call initialize() first","648156QxgkmS","[Track] Set User ID:","config","setUserId","getInitializedProviders","25370770qagZjJ","allSettled","values","from","Track SDK initialized, enabled providers:","initialize ","4140FBwJLw"];return(N=function(){return t})()}function S(t,i){return t-=296,T()[t]}function T(){var t=["349175pfZSCn","5729392QCOjEm","64305LySNhW","343394syaxhD","49404uNwmQW","123godXmS","21euEGAn","539382jLlbzz","4pDYOiv","5599990iKWTJJ","22TnPbQW"];return(T=function(){return t})()}!function(){for(var t=S,i=T();;)try{if(450282===parseInt(t(297))/1*(-parseInt(t(303))/2)+-parseInt(t(305))/3*(parseInt(t(304))/4)+parseInt(t(300))/5+parseInt(t(296))/6*(-parseInt(t(306))/7)+parseInt(t(301))/8+parseInt(t(302))/9+parseInt(t(298))/10*(parseInt(t(299))/11))break;i.push(i.shift())}catch(t){i.push(i.shift())}}(),exports.TrackClient=TrackClient;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import*as s from"sa-sdk-javascript";function t(){var s=["FIREBASE","sensors","3427990UDPcfb","732221cCZylQ","610EesDrh","290166KRmVZn","SENSORS","767868FUFJoM","8yoeguU","280562POuZwM","firebase","134559xNtffz","1640610FJxxZv","2QLUlNw"];return(t=function(){return s})()}var i,n,r;function e(s,i){return s-=130,t()[s]}!function(){for(var s=e,i=t();;)try{if(771052===-parseInt(s(132))/1*(-parseInt(s(136))/2)+-parseInt(s(142))/3+parseInt(s(130))/4+-parseInt(s(139))/5+parseInt(s(135))/6+parseInt(s(140))/7*(-parseInt(s(131))/8)+-parseInt(s(134))/9*(-parseInt(s(141))/10))break;i.push(i.shift())}catch(s){i.push(i.shift())}}(),(n=i||(i={}))[(r=e)(137)]=r(133),n[r(143)]=r(138);const a=o;function o(s,t){s-=324;return c()[s]}function c(){const s=["initialized","firebase/app","1294996CTdGBw","117880piZAsY","13268690mThkxa","track","setUserId","initialize","499492ZIEozO","setUserProperties","7MYWKQW","1726578GAgBtl","323249EfbwRS","1431496auqJlP","analytics","firebase/analytics","3JFpzjR","clearUserId","config","firebase initialize failed:","156BDkgia"];return(c=function(){return s})()}!function(){const s=o,t=c();for(;;)try{if(329546===-parseInt(s(338))/1+parseInt(s(334))/2+-parseInt(s(342))/3*(parseInt(s(328))/4)+parseInt(s(329))/5*(-parseInt(s(325))/6)+parseInt(s(336))/7*(-parseInt(s(339))/8)+parseInt(s(337))/9+parseInt(s(330))/10)break;t.push(t.shift())}catch(s){t.push(t.shift())}}();class l{constructor(s){const t=o;this[t(340)]=null,this[t(326)]=!1,this[t(344)]=s}async[a(333)](){const s=a;if(!this.initialized)try{const{initializeApp:t}=await import(s(327)),{getAnalytics:i}=await import(s(341)),n=t(this[s(344)]);this[s(340)]=i(n),this[s(326)]=!0}catch(t){throw console.error(s(324),t),t}}async[a(331)](s,t){}async[a(332)](s){}async[a(335)](s){}async[a(343)](){}}var h=f;function f(s,t){return s-=115,p()[s]}function p(){var s=["logout","3511144ZxjYLm","token","quick","5612CNvzaU","setUserId","sensors sdk track failed:","clearUserId","autoTrack","160655QQZKDa","sensors sdk setUserId failed:","sensors sdk not initialized, skip setUserProperties","2366274IZTaUy","10dUBJOI","?token=","warn","sensors sdk not found, please install it by running","error","1745MSAEoG","heatmap","sensors sdk not initialized, skip track","sensors sdk not initialized, skip setUserId","track","2142339RwGjZW","setProfile","initialized","19190160GIMdmP","setUserProperties","showLog","ajax","sensors","sensors sdk init failed:","initialize","7yLGEJX","config","990956RPlaKT","sensors sdk setUserProperties failed:"];return(p=function(){return s})()}!function(){for(var s=f,t=p();;)try{if(418369===-parseInt(s(144))/1+-parseInt(s(133))/2+-parseInt(s(121))/3+parseInt(s(139))/4*(parseInt(s(116))/5)+parseInt(s(147))/6*(-parseInt(s(131))/7)+-parseInt(s(136))/8+-parseInt(s(124))/9*(-parseInt(s(148))/10))break;t.push(t.shift())}catch(s){t.push(t.shift())}}();class I{constructor(s,t){var i=f;this.sensors=null,this[i(123)]=!1,this[i(137)]=s,this.config=t}async[h(130)](){var t=h;if(!this.initialized)try{if(!s)throw new Error(t(151));this[t(128)]=s,this.sensors.init({server_url:this.config.serverUrl+(t(149)+this[t(137)]),show_log:this[t(132)][t(126)]??!1,heatmap:this.config[t(117)]??{},is_track_single_page:!0,send_type:t(127)}),this[t(123)]=!0,this.sensors[t(138)](t(143))}catch(s){throw console.error(t(129),s),s}}async[h(120)](s,t){var i=h;if(this.initialized&&this[i(128)])try{this[i(128)][i(120)](s,t??{})}catch(s){console[i(115)](i(141),s)}else console[i(150)](i(118))}async[h(140)](s){var t=h;if(this[t(123)]&&this[t(128)])try{this.sensors.login(s)}catch(s){console.error(t(145),s)}else console[t(150)](t(119))}async[h(125)](s){var t=h;if(this[t(123)]&&this.sensors)try{this.sensors[t(122)](s)}catch(s){console[t(115)](t(134),s)}else console[t(150)](t(146))}async[h(142)](){var s=h;if(this[s(123)]&&this[s(128)])try{this.sensors[s(135)]()}catch(s){console.error("sensors sdk clearUserId failed:",s)}}}function u(s,t){return s-=203,w()[s]}function d(s){var t=u;return typeof window!==t(210)&&window.btoa?window[t(211)](s):Buffer[t(209)](s,t(213))[t(203)](t(206))}function k(s){var t,i;return JSON[u(222)]((t=s,i=u,"undefined"!=typeof window&&window[i(204)]?window[i(204)](t):Buffer[i(209)](t,i(206))[i(203)](i(213))))}function w(){var s=["5924314IuEinC","1791170YtRuWg","9OHPToU","12dudggP","22872hHVHtE","13758890RkrFXf","parse","toString","atob","397034dVRKGj","base64","3297bcxZBZ","9LnLuZP","from","undefined","btoa","5840112kVBDgt","utf-8","721738dFfGcd","12IuQZan"];return(w=function(){return s})()}!function(){for(var s=u,t=w();;)try{if(706665===parseInt(s(214))/1+parseInt(s(205))/2*(parseInt(s(218))/3)+-parseInt(s(219))/4*(parseInt(s(217))/5)+parseInt(s(212))/6+parseInt(s(207))/7*(-parseInt(s(220))/8)+-parseInt(s(208))/9*(-parseInt(s(221))/10)+-parseInt(s(216))/11*(parseInt(s(215))/12))break;t.push(t.shift())}catch(s){t.push(t.shift())}}();const z=Z;function y(){const s=["eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19","SENSORS","26621368Pugffv","1022312geglzp","FIREBASE","2363529WbTvYo","4010830HlUJSd","2243758JJZYtW","3CLfEqV","2608470MmAjIx","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjo2NmI2ZTNmNmEwZjM2MDkwNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctN0gySjFTQ05QRCJ9","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjpkMTQ4OGM3MzI0MWIyZWMzNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctR0gxNk1CQ1NOVyJ9","464221czTnMv"];return(y=function(){return s})()}function Z(s,t){s-=394;return y()[s]}!function(){const s=Z,t=y();for(;;)try{if(586729===-parseInt(s(401))/1+-parseInt(s(396))/2+-parseInt(s(397))/3*(parseInt(s(405))/4)+-parseInt(s(395))/5+-parseInt(s(398))/6+parseInt(s(394))/7+parseInt(s(404))/8)break;t.push(t.shift())}catch(s){t.push(t.shift())}}();const m={"MDE5YjUzNTEyMWJhNzc1ZmIwYTQ1MzY3Njg1NzU1MTU=":{providers:[i.FIREBASE,i[z(403)]],firebaseConfig:k(z(399)),sensorsConfig:k(z(402))},"MDE5YjUzNTE3ZmFiN2YxZDkwNjg5OWVhMGQyMWJlZGI=":{providers:[i[z(406)],i[z(403)]],firebaseConfig:k(z(400)),sensorsConfig:k(z(402))}};function v(s,t){s-=256;return W()[s]}const b=v;function W(){const s=["Invalid token: ","values","FIREBASE","SENSORS","error","token","434IlxLix","[Track] Skip Firebase initialization (initializeFirebase = false)","initialize","allSettled","platformConfig","initialize ","[Track] Set User Properties:","initialized","21758530ScPFqr","validateConfig","Must provide a token","adapters","Track SDK initialized, enabled providers:","setUserProperties","4904053othnyg","clearUserId","debug"," adapter failed:","log","471950BcvnhH","track","unknown provider: ","9HvWPKX","initializeFirebase","2265836jRDolN","warn","[Track] Clear User ID","providers","[Track] Set User ID:","config","getInitializedProviders","889992nBqDuO","5gRTFdn","from","track SDK not initialized, please call initialize() first","push","sensorsConfig","4287FIamXn","set","keys","6813888HUrKVz"];return(W=function(){return s})()}!function(){const s=v,t=W();for(;;)try{if(632979===-parseInt(s(259))/1+parseInt(s(287))/2*(parseInt(s(277))/3)+parseInt(s(264))/4*(parseInt(s(272))/5)+-parseInt(s(280))/6+-parseInt(s(301))/7+-parseInt(s(271))/8+-parseInt(s(262))/9*(-parseInt(s(295))/10))break;t.push(t.shift())}catch(s){t.push(t.shift())}}();class TrackClient{constructor(s){const t=v;this[t(298)]=new Map,this[t(294)]=!1,this[t(269)]=s,this[t(296)](),this[t(291)]=function(s){const t=d(s),i=m[t];if(!i)throw new Error("invalid token: "+s);return i}(s[t(286)])}[b(296)](){const s=b;if(!this[s(269)][s(286)])throw new Error(s(297));if(!(d(this[s(269)][s(286)])in m))throw new Error(s(281)+this[s(269)][s(286)])}async[b(289)](){const s=b;if(this[s(294)])return;const t=[],n=!1!==this[s(269)][s(263)];for(const r of this[s(291)][s(267)])try{if(r===i[s(283)]&&!n){this[s(269)][s(256)]&&console[s(258)](s(288));continue}let e;switch(r){case i[s(283)]:e=new l(this[s(291)].firebaseConfig);break;case i[s(284)]:e=new I(this[s(269)][s(286)],this[s(291)][s(276)]);break;default:console[s(265)](s(261)+r);continue}this.adapters[s(278)](r,e),t[s(275)](e.initialize())}catch(t){console[s(285)](s(292)+r+s(257),t)}await Promise[s(290)](t),this[s(294)]=!0,this.config[s(256)]&&console.log(s(299),Array[s(273)](this.adapters[s(279)]()))}async[b(260)](s,t){const i=b;if(!this[i(294)])return void console.warn(i(274));this[i(269)][i(256)]&&console[i(258)]("[Track] "+s,t);const n=[];for(const r of this[i(298)][i(282)]())n[i(275)](r.track(s,t));await Promise[i(290)](n)}async setUserId(s){const t=b;if(!this[t(294)])return void console[t(265)](t(274));this[t(269)][t(256)]&&console[t(258)](t(268),s);const i=[];for(const n of this[t(298)][t(282)]())i.push(n.setUserId(s));await Promise[t(290)](i)}async setUserProperties(s){const t=b;if(!this.initialized)return void console[t(265)](t(274));this[t(269)][t(256)]&&console[t(258)](t(293),s);const i=[];for(const n of this.adapters[t(282)]())i.push(n[t(300)](s));await Promise[t(290)](i)}async[b(302)](){const s=b;if(!this[s(294)])return void console[s(265)]("track SDK not initialized, please call initialize() first");this[s(269)][s(256)]&&console[s(258)](s(266));const t=[];for(const i of this[s(298)][s(282)]())t[s(275)](i[s(302)]());await Promise[s(290)](t)}[b(270)](){const s=b;return Array[s(273)](this[s(298)][s(279)]())}}function g(s,t){return s-=313,J()[s]}function J(){var s=["4298IHpZxp","358508BbNENt","44889IjODWb","1501494SIAtKt","30maoPex","127900YwwWas","481854wvVbsV","4880646VKSrHS","1kszukf","2376CPwdiv"];return(J=function(){return s})()}!function(){for(var s=g,t=J();;)try{if(285597===parseInt(s(318))/1*(parseInt(s(316))/2)+-parseInt(s(322))/3+-parseInt(s(321))/4*(parseInt(s(314))/5)+parseInt(s(313))/6+-parseInt(s(320))/7*(parseInt(s(319))/8)+parseInt(s(317))/9+-parseInt(s(315))/10)break;t.push(t.shift())}catch(s){t.push(t.shift())}}();export{TrackClient,i as TrackProvider};
1
+ import{initializeApp as t}from"firebase/app";import{getAnalytics as i}from"firebase/analytics";import*as s from"sa-sdk-javascript";var n,r,e;function a(t,i){return t-=399,o()[t]}function o(){var t=["FIREBASE","776HsCrGU","223815jCuPWJ","SENSORS","sensors","55773YTblbw","firebase","14576380cQPubj","4149tHAnFO","18ScHzcO","7387450mUmjRI","4436CPiLeE","597557vTTyxA","198186DykHID"];return(o=function(){return t})()}!function(){for(var t=a,i=o();;)try{if(947597===-parseInt(t(406))/1+parseInt(t(407))/2+parseInt(t(402))/3*(-parseInt(t(405))/4)+parseInt(t(410))/5*(-parseInt(t(403))/6)+parseInt(t(404))/7+parseInt(t(409))/8*(parseInt(t(399))/9)+parseInt(t(401))/10)break;i.push(i.shift())}catch(t){i.push(i.shift())}}(),(r=n||(n={}))[(e=a)(408)]=e(400),r[e(411)]=e(412);const c=f;function l(){const t=["82744DEbrnD","analytics","560FjYXIq","firebase initialize failed:","3088612pnEzZb","error","342940ZEnAPy","280315GxaehU","setUserProperties","2084WluNsm","setUserId","777009QlLfEy","config","806uKhcfK","initialize","initialized","3896328XwyYbk","207WgoaAp"];return(l=function(){return t})()}function f(t,i){t-=232;return l()[t]}!function(){const t=f,i=l();for(;;)try{if(442251===-parseInt(t(243))/1*(-parseInt(t(247))/2)+-parseInt(t(245))/3+parseInt(t(238))/4+parseInt(t(241))/5+parseInt(t(232))/6+parseInt(t(236))/7*(-parseInt(t(234))/8)+parseInt(t(233))/9*(-parseInt(t(240))/10))break;i.push(i.shift())}catch(t){i.push(i.shift())}}();class h{constructor(t){const i=f;this[i(235)]=null,this.initialized=!1,this[i(246)]=t}async[c(248)](){const s=c;if(!this[s(249)])try{const n=t(this.config);this[s(235)]=i(n),this[s(249)]=!0}catch(t){throw console[s(239)](s(237),t),t}}async track(t,i){}async[c(244)](t){}async[c(242)](t){}async clearUserId(){}}var p=u;function I(){var t=["3142779iHUSNt","setUserId","initialized","13208536DxqFaK","error","1678705ibyJql","quick","1107730wffWxr","heatmap","27000IHRfMa","sensors","sensors sdk track failed:","setUserProperties","clearUserId","15182424VxRKap","sensors sdk not initialized, skip setUserId","config","460SEHirq","ajax","sensors sdk setUserId failed:","1763474AgNTir","logout","sensors sdk setUserProperties failed:","setProfile","track","sensors sdk clearUserId failed:","login","warn","6nQcNNS","initialize"];return(I=function(){return t})()}function u(t,i){return t-=229,I()[t]}!function(){for(var t=u,i=I();;)try{if(856532===parseInt(t(235))/1+-parseInt(t(248))/2+parseInt(t(258))/3+-parseInt(t(245))/4*(parseInt(t(237))/5)+parseInt(t(256))/6*(parseInt(t(233))/7)+parseInt(t(231))/8+-parseInt(t(242))/9)break;i.push(i.shift())}catch(t){i.push(i.shift())}}();class d{constructor(t,i){var s=u;this[s(238)]=null,this[s(230)]=!1,this.token=t,this[s(244)]=i}async[p(257)](){var t=p;if(!this[t(230)])try{if(!s)throw new Error("sensors sdk not found, please install it by running");this[t(238)]=s,this[t(238)].init({server_url:this.config.serverUrl+"?token="+this.token,show_log:this[t(244)].showLog??!1,heatmap:this[t(244)][t(236)]??{},is_track_single_page:!0,send_type:t(246)}),this.initialized=!0,this[t(238)][t(234)]("autoTrack")}catch(i){throw console[t(232)]("sensors sdk init failed:",i),i}}async[p(252)](t,i){var s=p;if(this[s(230)]&&this[s(238)])try{this[s(238)].track(t,i??{})}catch(t){console.error(s(239),t)}else console[s(255)]("sensors sdk not initialized, skip track")}async[p(229)](t){var i=p;if(this.initialized&&this[i(238)])try{this.sensors[i(254)](t)}catch(t){console[i(232)](i(247),t)}else console[i(255)](i(243))}async[p(240)](t){var i=p;if(this.initialized&&this.sensors)try{this[i(238)][i(251)](t)}catch(t){console.error(i(250),t)}else console[i(255)]("sensors sdk not initialized, skip setUserProperties")}async[p(241)](){var t=p;if(this[t(230)]&&this[t(238)])try{this[t(238)][t(249)]()}catch(i){console[t(232)](t(253),i)}}}function k(){var t=["1197609nXSHpR","3747532ElZanL","base64","parse","260aTWioN","undefined","utf-8","5033754fTyHDd","8YxFzgT","atob","52134ZwlgWT","btoa","22766571rWalqM","10991750QiiPzJ","toString","1174280AAlfUR","from"];return(k=function(){return t})()}function z(t){var i=y;return typeof window!==i(491)&&window[i(497)]?window[i(497)](t):Buffer[i(502)](t,"utf-8")[i(500)](i(488))}function y(t,i){return t-=488,k()[t]}function Z(t){var i,s;return JSON[y(489)]((i=t,s=y,typeof window!==s(491)&&window[s(495)]?window[s(495)](i):Buffer.from(i,s(488))[s(500)](s(492))))}!function(){for(var t=y,i=k();;)try{if(843963===parseInt(t(503))/1+-parseInt(t(501))/2+parseInt(t(493))/3+-parseInt(t(504))/4+-parseInt(t(490))/5*(-parseInt(t(496))/6)+parseInt(t(499))/7+parseInt(t(494))/8*(-parseInt(t(498))/9))break;i.push(i.shift())}catch(t){i.push(i.shift())}}();const w=m;function m(t,i){t-=381;return b()[t]}!function(){const t=m,i=b();for(;;)try{if(950768===parseInt(t(390))/1+parseInt(t(392))/2*(-parseInt(t(394))/3)+parseInt(t(388))/4*(parseInt(t(386))/5)+-parseInt(t(383))/6*(-parseInt(t(389))/7)+parseInt(t(385))/8*(parseInt(t(393))/9)+parseInt(t(381))/10*(-parseInt(t(384))/11)+-parseInt(t(391))/12)break;i.push(i.shift())}catch(t){i.push(i.shift())}}();const W={"MDE5YjUzNTEyMWJhNzc1ZmIwYTQ1MzY3Njg1NzU1MTU=":{providers:[n.FIREBASE,n.SENSORS],firebaseConfig:Z(w(396)),sensorsConfig:Z("eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19")},"MDE5YjUzNTE3ZmFiN2YxZDkwNjg5OWVhMGQyMWJlZGI=":{providers:[n.FIREBASE,n.SENSORS],firebaseConfig:Z(w(395)),sensorsConfig:Z(w(382))}};function b(){const t=["eyJzZXJ2ZXJVcmwiOiJodHRwczovL3N2LWFuYWx5dGljcy5zZy5zZWF2ZXJzZS5haS9zYSIsImhlYXRtYXAiOnsiY2xpY2ttYXAiOiJkZWZhdWx0Iiwic2Nyb2xsX25vdGljZV9tYXAiOiJkZWZhdWx0In19","33498aoRzxo","55dqGHkS","624MZETDy","70195wNfvmq","invalid token: ","68ZZKVvM","511rAHzHe","688204DOtBBQ","8854644fCoIUf","3604DnGCOS","156879ZlokMk","591QpdTmO","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjpkMTQ4OGM3MzI0MWIyZWMzNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctR0gxNk1CQ1NOVyJ9","eyJhcGlLZXkiOiJBSXphU3lBVVVEam5HdDJKQmdiNVFFYmFFMVFybENvMTdpVWxKWGsiLCJhdXRoRG9tYWluIjoic2VhdmVyc2UtcHJvZHVjdGlvbi5maXJlYmFzZWFwcC5jb20iLCJwcm9qZWN0SWQiOiJzZWF2ZXJzZS1wcm9kdWN0aW9uIiwic3RvcmFnZUJ1Y2tldCI6InNlYXZlcnNlLXByb2R1Y3Rpb24uZmlyZWJhc2VzdG9yYWdlLmFwcCIsIm1lc3NhZ2luZ1NlbmRlcklkIjoiMTAzMzk3MzA4MzE5OCIsImFwcElkIjoiMToxMDMzOTczMDgzMTk4OndlYjo2NmI2ZTNmNmEwZjM2MDkwNmY3NTZmIiwibWVhc3VyZW1lbnRJZCI6IkctN0gySjFTQ05QRCJ9","1300790MGpQlB"];return(b=function(){return t})()}const v=J;function J(t,i){t-=210;return N()[t]}!function(){const t=J,i=N();for(;;)try{if(731907===parseInt(t(219))/1*(parseInt(t(220))/2)+parseInt(t(237))/3+-parseInt(t(226))/4+parseInt(t(248))/5*(parseInt(t(214))/6)+parseInt(t(225))/7*(parseInt(t(216))/8)+parseInt(t(222))/9+-parseInt(t(242))/10)break;i.push(i.shift())}catch(t){i.push(i.shift())}}();class TrackClient{constructor(t){const i=J;this[i(212)]=new Map,this[i(253)]=!1,this.config=t,this.validateConfig(),this[i(221)]=function(t){const i=w,s=z(t),n=W[s];if(!n)throw new Error(i(387)+t);return n}(t[i(250)])}[v(233)](){const t=v;if(!this[t(239)][t(250)])throw new Error(t(224));if(!(z(this[t(239)][t(250)])in W))throw new Error("Invalid token: "+this[t(239)].token)}async initialize(){const t=v;if(this[t(253)])return;const i=[],s=!1!==this.config[t(254)];for(const r of this.platformConfig[t(229)])try{if(r===n.FIREBASE&&!s){this.config[t(213)]&&console[t(231)](t(232));continue}let e;switch(r){case n[t(230)]:e=new h(this[t(221)][t(218)]);break;case n.SENSORS:e=new d(this.config[t(250)],this[t(221)][t(235)]);break;default:console[t(217)]("unknown provider: "+r);continue}this[t(212)][t(251)](r,e),i[t(223)](e[t(227)]())}catch(i){console[t(252)](t(247)+r+" adapter failed:",i)}await Promise.allSettled(i),this.initialized=!0,this[t(239)].debug&&console[t(231)](t(246),Array[t(245)](this[t(212)].keys()))}async[v(249)](t,i){const s=v;if(!this[s(253)])return void console.warn("track SDK not initialized, please call initialize() first");this[s(239)][s(213)]&&console.log(s(211)+t,i);const n=[];for(const r of this[s(212)][s(244)]())n[s(223)](r[s(249)](t,i));await Promise[s(243)](n)}async[v(240)](t){const i=v;if(!this.initialized)return void console.warn(i(236));this[i(239)][i(213)]&&console[i(231)](i(238),t);const s=[];for(const n of this[i(212)][i(244)]())s[i(223)](n[i(240)](t));await Promise[i(243)](s)}async[v(228)](t){const i=v;if(!this.initialized)return void console[i(217)](i(236));this[i(239)][i(213)]&&console[i(231)](i(215),t);const s=[];for(const n of this[i(212)][i(244)]())s[i(223)](n.setUserProperties(t));await Promise[i(243)](s)}async[v(210)](){const t=v;if(!this.initialized)return void console[t(217)](t(236));this[t(239)][t(213)]&&console[t(231)](t(234));const i=[];for(const s of this.adapters[t(244)]())i.push(s.clearUserId());await Promise[t(243)](i)}[v(241)](){const t=v;return Array.from(this[t(212)].keys())}}function N(){const t=["track","token","set","error","initialized","initializeFirebase","clearUserId","[Track] ","adapters","debug","6666AOMwAR","[Track] Set User Properties:","6784544fReUJd","warn","firebaseConfig","13UUYDbJ","148420vMAKet","platformConfig","13041306CpaEjZ","push","Must provide a token","7rBiMsQ","4515232ZhhccT","initialize","setUserProperties","providers","FIREBASE","log","[Track] Skip Firebase initialization (initializeFirebase = false)","validateConfig","[Track] Clear User ID","sensorsConfig","track SDK not initialized, please call initialize() first","648156QxgkmS","[Track] Set User ID:","config","setUserId","getInitializedProviders","25370770qagZjJ","allSettled","values","from","Track SDK initialized, enabled providers:","initialize ","4140FBwJLw"];return(N=function(){return t})()}function S(t,i){return t-=296,M()[t]}function M(){var t=["349175pfZSCn","5729392QCOjEm","64305LySNhW","343394syaxhD","49404uNwmQW","123godXmS","21euEGAn","539382jLlbzz","4pDYOiv","5599990iKWTJJ","22TnPbQW"];return(M=function(){return t})()}!function(){for(var t=S,i=M();;)try{if(450282===parseInt(t(297))/1*(-parseInt(t(303))/2)+-parseInt(t(305))/3*(parseInt(t(304))/4)+parseInt(t(300))/5+parseInt(t(296))/6*(-parseInt(t(306))/7)+parseInt(t(301))/8+parseInt(t(302))/9+parseInt(t(298))/10*(parseInt(t(299))/11))break;i.push(i.shift())}catch(t){i.push(i.shift())}}();export{TrackClient,n as TrackProvider};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seaverse/track-sdk",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Unified analytics SDK for Firebase and Sensors Analytics",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -42,9 +42,9 @@
42
42
  },
43
43
  "author": "SeaVerse Team <support@seaverse.com>",
44
44
  "license": "MIT",
45
- "peerDependencies": {
46
- "firebase": "^11.0.0",
47
- "sa-sdk-javascript": "^1.27.0"
45
+ "dependencies": {
46
+ "firebase": "^11.2.0",
47
+ "sa-sdk-javascript": "^1.27.11"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@rollup/plugin-commonjs": "^29.0.0",