@orbit-software/sdk 1.93.6 → 1.93.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/dist/esm/sdk.mjs CHANGED
@@ -16,7 +16,7 @@ import * as React from "react";
16
16
  import React__default, { createContext, useContext, useState, useRef, useEffect, useCallback, useLayoutEffect, useMemo, forwardRef, isValidElement, useId as useId$1, useInsertionEffect, Children, Fragment, createElement, Component, version as version$1, memo as memo$1, Suspense } from "react";
17
17
  import * as ReactDOM from "react-dom";
18
18
  import ReactDOM__default, { createPortal } from "react-dom";
19
- const version = "1.93.6";
19
+ const version = "1.93.7";
20
20
  function getDefaultExportFromCjs$3(e) {
21
21
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
22
22
  }
@@ -11851,7 +11851,7 @@ function useAnimate() {
11851
11851
  e.animations.forEach((i) => i.stop()), e.animations.length = 0;
11852
11852
  }), [e, t];
11853
11853
  }
11854
- var define_process_env_default$7 = { NODE_ENV: "production", version: "1.93.6", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" };
11854
+ var define_process_env_default$7 = { NODE_ENV: "production", version: "1.93.7", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" };
11855
11855
  const ASSETS_BASE_URL = define_process_env_default$7.ASSETS_BASE_URL;
11856
11856
  function assetUrl(e) {
11857
11857
  return `${ASSETS_BASE_URL}/${e}`;
@@ -19474,7 +19474,7 @@ var Ot, jr, Removable = (jr = class {
19474
19474
  clearGcTimeout() {
19475
19475
  U(this, Ot) && (timeoutManager.clearTimeout(U(this, Ot)), ge(this, Ot, void 0));
19476
19476
  }
19477
- }, Ot = new WeakMap(), jr), define_process_env_default$6 = { NODE_ENV: "production", version: "1.93.6", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" }, kt, Gt, st, Lt, Xe, er, Dt, ot, dt, Br, Query = (Br = class extends Removable {
19477
+ }, Ot = new WeakMap(), jr), define_process_env_default$6 = { NODE_ENV: "production", version: "1.93.7", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" }, kt, Gt, st, Lt, Xe, er, Dt, ot, dt, Br, Query = (Br = class extends Removable {
19478
19478
  constructor(t) {
19479
19479
  super();
19480
19480
  we(this, ot);
@@ -35208,7 +35208,7 @@ function getAnalytics(e) {
35208
35208
  const s = resolveConfig(e), o = createInstance(s);
35209
35209
  return t[KEY] = { instance: o, config: s }, o;
35210
35210
  }
35211
- var define_process_env_default$5 = { NODE_ENV: "production", version: "1.93.6", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" }, win;
35211
+ var define_process_env_default$5 = { NODE_ENV: "production", version: "1.93.7", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" }, win;
35212
35212
  if (typeof window > "u") {
35213
35213
  var loc = {
35214
35214
  hostname: ""
@@ -47779,9 +47779,9 @@ function init_as_module(e) {
47779
47779
  function loadNoop(e, t) {
47780
47780
  t();
47781
47781
  }
47782
- var mixpanel = init_as_module(loadNoop), define_process_env_default$4 = { NODE_ENV: "production", version: "1.93.6", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" };
47782
+ var mixpanel = init_as_module(loadNoop), define_process_env_default$4 = { NODE_ENV: "production", version: "1.93.7", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" };
47783
47783
  const BASE_URL = define_process_env_default$4.BASE_URL;
47784
- var define_process_env_default$3 = { NODE_ENV: "production", version: "1.93.6", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" };
47784
+ var define_process_env_default$3 = { NODE_ENV: "production", version: "1.93.7", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" };
47785
47785
  const MIXPANEL_TOKEN = "b0d7c97039e244366388b9a210c0b15a", ANALYTICS_ENDPOINT = `${BASE_URL.replace(/\/sdk\/?$/, "")}/api/analytics/events`;
47786
47786
  function getBaseAnalyticsParams() {
47787
47787
  return {
@@ -50617,7 +50617,7 @@ const balance$4 = "Balance", topUp$4 = "Top Up", ads$4 = "Ads", adsOn$4 = "On",
50617
50617
  topUpModal,
50618
50618
  inventoryModal
50619
50619
  };
50620
- var define_process_env_default$2 = { NODE_ENV: "production", version: "1.93.6", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" };
50620
+ var define_process_env_default$2 = { NODE_ENV: "production", version: "1.93.7", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" };
50621
50621
  const resources = {
50622
50622
  en: {
50623
50623
  translation: en
@@ -51369,7 +51369,7 @@ async function showMonetagAd(e, t, i) {
51369
51369
  });
51370
51370
  });
51371
51371
  }
51372
- var define_process_env_default$1 = { NODE_ENV: "production", version: "1.93.6", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" };
51372
+ var define_process_env_default$1 = { NODE_ENV: "production", version: "1.93.7", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" };
51373
51373
  const log$1 = createAdLogger("Orbit");
51374
51374
  async function initOrbitAds() {
51375
51375
  log$1.group("Initialization"), log$1.time("init"), log$1.info("Loading script...");
@@ -51641,6 +51641,21 @@ function initSentry() {
51641
51641
  }
51642
51642
  });
51643
51643
  }
51644
+ const GAME_INITIALIZED_LAUNCH_KEY = "cs_game_initialized_launch", GAME_READY_LAUNCH_KEY = "cs_game_ready_launch";
51645
+ function getLaunchId() {
51646
+ var t, i, s;
51647
+ const e = (i = (t = window.Telegram) == null ? void 0 : t.WebApp) == null ? void 0 : i.initDataUnsafe;
51648
+ return (e == null ? void 0 : e.hash) || ((s = e == null ? void 0 : e.auth_date) == null ? void 0 : s.toString()) || "";
51649
+ }
51650
+ function shouldTrackOncePerLaunch(e) {
51651
+ const t = getLaunchId();
51652
+ if (!t) return !0;
51653
+ try {
51654
+ return sessionStorage.getItem(e) === t ? !1 : (sessionStorage.setItem(e, t), !0);
51655
+ } catch {
51656
+ return !0;
51657
+ }
51658
+ }
51644
51659
  function validateCloudStorageValue(e) {
51645
51660
  if (e == null)
51646
51661
  return {
@@ -51762,7 +51777,7 @@ function createIframeSdk() {
51762
51777
  }
51763
51778
  });
51764
51779
  }
51765
- var define_process_env_default = { NODE_ENV: "production", version: "1.93.6", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" }, qr, Kr;
51780
+ var define_process_env_default = { NODE_ENV: "production", version: "1.93.7", BASE_URL: "https://app.portalapp.games/sdk", ADS_SCRIPT_URL: "https://ads-sdk.portalapp.games/script.js", ASSETS_BASE_URL: "https://sdk.portalapp.games/assets" }, qr, Kr;
51766
51781
  const _isThirdPartyIframe = window.parent !== window && !((Kr = (qr = window.Telegram) == null ? void 0 : qr.WebApp) != null && Kr.initData);
51767
51782
  _isThirdPartyIframe || (ensureViewportMetaTag(), initSentry());
51768
51783
  const adLog = createAdLogger("SDK");
@@ -52047,10 +52062,10 @@ const CryptoSteamSDK = {
52047
52062
  }
52048
52063
  }), ReactGA.event("init", {
52049
52064
  gameId: c.game_id
52050
- }), gameInitializedAt = performance.now(), analytics.track("game_initialized", {
52065
+ }), shouldTrackOncePerLaunch(GAME_INITIALIZED_LAUNCH_KEY) && (gameInitializedAt = performance.now(), analytics.track("game_initialized", {
52051
52066
  game_id: c.game_id,
52052
52067
  game_title: u.title
52053
- }), !isPortal && !(t != null && t.disable_startup_ads) && CryptoSteamSDK.requestAd().catch((f) => {
52068
+ })), !isPortal && !(t != null && t.disable_startup_ads) && CryptoSteamSDK.requestAd().catch((f) => {
52054
52069
  adLog.error("Error requesting initial ad", f);
52055
52070
  });
52056
52071
  } catch (c) {
@@ -52352,13 +52367,13 @@ const CryptoSteamSDK = {
52352
52367
  console.error("Config not found");
52353
52368
  return;
52354
52369
  }
52355
- analytics.track("game_ready", {
52370
+ shouldTrackOncePerLaunch(GAME_READY_LAUNCH_KEY) && (analytics.track("game_ready", {
52356
52371
  game_id: e.game_id,
52357
52372
  game_title: t.title,
52358
52373
  time_to_load_ms: gameInitializedAt !== null ? Math.round(performance.now() - gameInitializedAt) : void 0
52359
52374
  }), ReactGA.event("game_loaded", {
52360
52375
  gameId: e.game_id
52361
- });
52376
+ }));
52362
52377
  },
52363
52378
  getWages: async () => await makeRequest("v1/wages", "GET"),
52364
52379
  claimWage: async (e) => await makeRequest(`v1/wages/${e}/claim`, "POST"),