@jolibox/ads 1.4.10 → 1.4.12

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.
Files changed (2) hide show
  1. package/dist/index.js +58 -69
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  var ln = Object.defineProperty, un = Object.defineProperties;
2
2
  var cn = Object.getOwnPropertyDescriptors;
3
3
  var We = Object.getOwnPropertySymbols;
4
- var Kt = Object.prototype.hasOwnProperty, zt = Object.prototype.propertyIsEnumerable;
5
- var qt = (t, e, i) => e in t ? ln(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, yt = (t, e) => {
4
+ var qt = Object.prototype.hasOwnProperty, zt = Object.prototype.propertyIsEnumerable;
5
+ var Kt = (t, e, i) => e in t ? ln(t, e, { enumerable: !0, configurable: !0, writable: !0, value: i }) : t[e] = i, yt = (t, e) => {
6
6
  for (var i in e || (e = {}))
7
- Kt.call(e, i) && qt(t, i, e[i]);
7
+ qt.call(e, i) && Kt(t, i, e[i]);
8
8
  if (We)
9
9
  for (var i of We(e))
10
- zt.call(e, i) && qt(t, i, e[i]);
10
+ zt.call(e, i) && Kt(t, i, e[i]);
11
11
  return t;
12
12
  }, Wt = (t, e) => un(t, cn(e));
13
13
  var Jt = (t, e) => {
14
14
  var i = {};
15
15
  for (var n in t)
16
- Kt.call(t, n) && e.indexOf(n) < 0 && (i[n] = t[n]);
16
+ qt.call(t, n) && e.indexOf(n) < 0 && (i[n] = t[n]);
17
17
  if (t != null && We)
18
18
  for (var n of We(t))
19
19
  e.indexOf(n) < 0 && zt.call(t, n) && (i[n] = t[n]);
@@ -365,15 +365,15 @@ var D = It, jn = class {
365
365
  }
366
366
  }, Rt = {};
367
367
  kn(Rt, {
368
- None: () => qn,
368
+ None: () => Kn,
369
369
  filter: () => zn,
370
370
  once: () => Ti,
371
- toPromise: () => Kn
371
+ toPromise: () => qn
372
372
  });
373
- var qn = () => (console.log("[Jolibox SDK] None Event"), () => {
373
+ var Kn = () => (console.log("[Jolibox SDK] None Event"), () => {
374
374
  console.log("[Jolibox SDK] None Event dispose");
375
375
  });
376
- function Kn(t) {
376
+ function qn(t) {
377
377
  return new Promise((e) => Ti(t)(e));
378
378
  }
379
379
  function Ti(t) {
@@ -1002,7 +1002,7 @@ function ae() {
1002
1002
  function Ze() {
1003
1003
  return Y;
1004
1004
  }
1005
- function qe(t, e) {
1005
+ function Ke(t, e) {
1006
1006
  return Ve(De, t, e);
1007
1007
  }
1008
1008
  function Ge(t) {
@@ -1044,7 +1044,7 @@ function Li(t) {
1044
1044
  return De = "", t;
1045
1045
  }
1046
1046
  function et(t) {
1047
- return Di(qe(Y - 1, Ot(t === 91 ? t + 2 : t === 40 ? t + 1 : t)));
1047
+ return Di(Ke(Y - 1, Ot(t === 91 ? t + 2 : t === 40 ? t + 1 : t)));
1048
1048
  }
1049
1049
  function pr(t) {
1050
1050
  for (; (N = ae()) && N < 33; )
@@ -1054,7 +1054,7 @@ function pr(t) {
1054
1054
  function _r(t, e) {
1055
1055
  for (; --e && Z() && !(N < 48 || N > 102 || N > 57 && N < 65 || N > 70 && N < 97); )
1056
1056
  ;
1057
- return qe(t, Ze() + (e < 6 && ae() == 32 && Z() == 32));
1057
+ return Ke(t, Ze() + (e < 6 && ae() == 32 && Z() == 32));
1058
1058
  }
1059
1059
  function Ot(t) {
1060
1060
  for (; Z(); )
@@ -1078,12 +1078,12 @@ function mr(t, e) {
1078
1078
  for (; Z() && t + N !== 57; )
1079
1079
  if (t + N === 84 && ae() === 47)
1080
1080
  break;
1081
- return "/*" + qe(e, Y - 1) + "*" + ct(t === 47 ? t : Z());
1081
+ return "/*" + Ke(e, Y - 1) + "*" + ct(t === 47 ? t : Z());
1082
1082
  }
1083
1083
  function Sr(t) {
1084
1084
  for (; !Ge(ae()); )
1085
1085
  Z();
1086
- return qe(t, Y);
1086
+ return Ke(t, Y);
1087
1087
  }
1088
1088
  function Er(t) {
1089
1089
  return Li(tt("", null, null, null, [""], t = Ni(t), 0, [0], t));
@@ -1233,7 +1233,7 @@ function Tr(t) {
1233
1233
  var Cr = function(e, i, n) {
1234
1234
  for (var r = 0, o = 0; r = o, o = ae(), r === 38 && o === 12 && (i[n] = 1), !Ge(o); )
1235
1235
  Z();
1236
- return qe(e, Y);
1236
+ return Ke(e, Y);
1237
1237
  }, Or = function(e, i) {
1238
1238
  var n = -1, r = 44;
1239
1239
  do
@@ -1670,7 +1670,7 @@ var Gr = function(e, i, n) {
1670
1670
  // so we don't have to add it to registered cache.
1671
1671
  // this improves memory usage since we can avoid storing the whole style string
1672
1672
  e.registered[r] === void 0 && (e.registered[r] = i.styles);
1673
- }, qr = function(e, i, n) {
1673
+ }, Kr = function(e, i, n) {
1674
1674
  Gr(e, i);
1675
1675
  var r = e.key + "-" + i.name;
1676
1676
  if (e.inserted[i.name] === void 0) {
@@ -1688,7 +1688,7 @@ function li(t, e, i) {
1688
1688
  var n = [], r = $i(t, n, i);
1689
1689
  return n.length < 2 ? i : r + e(n);
1690
1690
  }
1691
- var Kr = function(e) {
1691
+ var qr = function(e) {
1692
1692
  var i = Mr(e);
1693
1693
  i.sheet.speedy = function(a) {
1694
1694
  this.isSpeedy = a;
@@ -1697,7 +1697,7 @@ var Kr = function(e) {
1697
1697
  for (var d = arguments.length, l = new Array(d), u = 0; u < d; u++)
1698
1698
  l[u] = arguments[u];
1699
1699
  var c = bt(l, i.registered, void 0);
1700
- return qr(i, c), i.key + "-" + c.name;
1700
+ return Kr(i, c), i.key + "-" + c.name;
1701
1701
  }, r = function() {
1702
1702
  for (var d = arguments.length, l = new Array(d), u = 0; u < d; u++)
1703
1703
  l[u] = arguments[u];
@@ -1759,7 +1759,7 @@ var Kr = function(e) {
1759
1759
  }
1760
1760
  }
1761
1761
  return i;
1762
- }, Wr = Kr({
1762
+ }, Wr = qr({
1763
1763
  key: "css"
1764
1764
  }), G = Wr.css, Dt, Q, pt, ui, ci = 0, Fi = [], B = Te, hi = B.__b, fi = B.__r, vi = B.diffed, yi = B.__c, gi = B.unmount, wi = B.__;
1765
1765
  function Jr(t, e) {
@@ -1961,7 +1961,7 @@ function Gi(t) {
1961
1961
  }
1962
1962
  }
1963
1963
  }
1964
- function qi(t) {
1964
+ function Ki(t) {
1965
1965
  for (var e = t.s, i = void 0; e !== void 0; ) {
1966
1966
  var n = e.p;
1967
1967
  e.i === -1 ? (e.S.U(e), n !== void 0 && (n.n = e.n), e.n !== void 0 && (e.n.p = n)) : i = e, e.S.n = e.r, e.r !== void 0 && (e.r = void 0), e = n;
@@ -1986,7 +1986,7 @@ function Pe(t) {
1986
1986
  } catch (i) {
1987
1987
  this.v = i, this.f |= 16, this.i++;
1988
1988
  }
1989
- return T = t, qi(this), this.f &= -2, !0;
1989
+ return T = t, Ki(this), this.f &= -2, !0;
1990
1990
  };
1991
1991
  Pe.prototype.S = function(t) {
1992
1992
  if (this.t === void 0) {
@@ -2021,7 +2021,7 @@ Object.defineProperty(Pe.prototype, "value", { get: function() {
2021
2021
  function Ue(t) {
2022
2022
  return new Pe(t);
2023
2023
  }
2024
- function Ki(t) {
2024
+ function qi(t) {
2025
2025
  var e = t.u;
2026
2026
  if (t.u = void 0, typeof e == "function") {
2027
2027
  be++;
@@ -2039,17 +2039,17 @@ function Ki(t) {
2039
2039
  function Ut(t) {
2040
2040
  for (var e = t.s; e !== void 0; e = e.n)
2041
2041
  e.S.U(e);
2042
- t.x = void 0, t.s = void 0, Ki(t);
2042
+ t.x = void 0, t.s = void 0, qi(t);
2043
2043
  }
2044
2044
  function Zr(t) {
2045
2045
  if (T !== this)
2046
2046
  throw new Error("Out-of-order effect");
2047
- qi(this), T = t, this.f &= -2, 8 & this.f && Ut(this), vt();
2047
+ Ki(this), T = t, this.f &= -2, 8 & this.f && Ut(this), vt();
2048
2048
  }
2049
- function Ke(t) {
2049
+ function qe(t) {
2050
2050
  this.x = t, this.u = void 0, this.s = void 0, this.o = void 0, this.f = 32;
2051
2051
  }
2052
- Ke.prototype.c = function() {
2052
+ qe.prototype.c = function() {
2053
2053
  var t = this.S();
2054
2054
  try {
2055
2055
  if (8 & this.f || this.x === void 0)
@@ -2060,21 +2060,21 @@ Ke.prototype.c = function() {
2060
2060
  t();
2061
2061
  }
2062
2062
  };
2063
- Ke.prototype.S = function() {
2063
+ qe.prototype.S = function() {
2064
2064
  if (1 & this.f)
2065
2065
  throw new Error("Cycle detected");
2066
- this.f |= 1, this.f &= -9, Ki(this), Gi(this), be++;
2066
+ this.f |= 1, this.f &= -9, qi(this), Gi(this), be++;
2067
2067
  var t = T;
2068
2068
  return T = this, Zr.bind(this, t);
2069
2069
  };
2070
- Ke.prototype.N = function() {
2070
+ qe.prototype.N = function() {
2071
2071
  2 & this.f || (this.f |= 2, this.o = Fe, Fe = this);
2072
2072
  };
2073
- Ke.prototype.d = function() {
2073
+ qe.prototype.d = function() {
2074
2074
  this.f |= 8, 1 & this.f || Ut(this);
2075
2075
  };
2076
2076
  function ze(t) {
2077
- var e = new Ke(t);
2077
+ var e = new qe(t);
2078
2078
  try {
2079
2079
  e.c();
2080
2080
  } catch (i) {
@@ -2844,8 +2844,8 @@ const Ao = () => {
2844
2844
  visible: d,
2845
2845
  payload: l
2846
2846
  } = e, [u, c] = _e(!1), [h, f] = _e(0), [v, y] = _e(!1), [w, g] = _e(!1), [A, S] = _e("Loading next content..."), p = mi(null), _ = l.value, E = kt((L) => {
2847
- var C, W, q, I;
2848
- c(!1), d.value = !1, L === "dismiss" ? (C = n.value) == null || C.call(n) : (W = r.value) == null || W.call(r), (q = i.value) == null || q.call(i), (I = o.value) == null || I.call(o);
2847
+ var C, W, K, I;
2848
+ c(!1), d.value = !1, L === "dismiss" ? (C = n.value) == null || C.call(n) : (W = r.value) == null || W.call(r), (K = i.value) == null || K.call(i), (I = o.value) == null || I.call(o);
2849
2849
  }, [d, n, r, i, o]), b = kt(() => {
2850
2850
  var L;
2851
2851
  c(!1), d.value = !1, (L = a.value) == null || L.call(a);
@@ -2860,14 +2860,14 @@ const Ao = () => {
2860
2860
  if (f(C), g(_.mode === "reward" ? C === 0 : !0), y(_.mode === "interstitial" ? C === 0 : !1), C === 0)
2861
2861
  return;
2862
2862
  let W = C;
2863
- const q = window.setInterval(() => {
2864
- W -= 1, f(Math.max(W, 0)), W <= 0 && (window.clearInterval(q), _.mode === "reward" ? g(!0) : y(!0));
2863
+ const K = window.setInterval(() => {
2864
+ W -= 1, f(Math.max(W, 0)), W <= 0 && (window.clearInterval(K), _.mode === "reward" ? g(!0) : y(!0));
2865
2865
  }, 1e3);
2866
2866
  return () => {
2867
- window.clearInterval(q);
2867
+ window.clearInterval(K);
2868
2868
  };
2869
2869
  }, [d.value, _, E]), Ce(() => {
2870
- var q;
2870
+ var K;
2871
2871
  if (!d.value || !_)
2872
2872
  return;
2873
2873
  const L = p.current;
@@ -2875,7 +2875,7 @@ const Ao = () => {
2875
2875
  return;
2876
2876
  if (L.innerHTML = "", S("Loading next content..."), c(!1), _.testMode) {
2877
2877
  const I = document.createElement("div");
2878
- I.className = bi, I.innerText = "Preview slot placeholder", L.appendChild(I), c(!0), (q = s.value) == null || q.call(s);
2878
+ I.className = bi, I.innerText = "Preview slot placeholder", L.appendChild(I), c(!0), (K = s.value) == null || K.call(s);
2879
2879
  return;
2880
2880
  }
2881
2881
  if (typeof window == "undefined") {
@@ -2943,7 +2943,7 @@ const Ao = () => {
2943
2943
  })
2944
2944
  });
2945
2945
  };
2946
- function K(t, e, i) {
2946
+ function q(t, e, i) {
2947
2947
  return (e = To(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
2948
2948
  }
2949
2949
  function To(t) {
@@ -2964,7 +2964,7 @@ function Co(t, e) {
2964
2964
  }
2965
2965
  class Oo {
2966
2966
  constructor(e, i) {
2967
- if (K(this, "name", "ADSENSE_BANNER_AS_AFG"), K(this, "initialized", !1), K(this, "initCompleter", null), K(this, "context", void 0), K(this, "contextInfo", void 0), K(this, "initParams", void 0), K(this, "defaultCountdown", 5), K(this, "adsOverlay", null), K(this, "adsIsShowing", !1), K(this, "lastUnDisplayedAdBreak", null), K(this, "requestCounter", 0), K(this, "scriptPromise", null), K(this, "scriptReady", !1), K(this, "scriptFailed", !1), K(this, "state", Ao()), this.context = e, this.contextInfo = this.context.getContextInfo(), this.initParams = i, typeof window != "undefined") {
2967
+ if (q(this, "name", "ADSENSE_BANNER_AS_AFG"), q(this, "initialized", !1), q(this, "initCompleter", null), q(this, "context", void 0), q(this, "contextInfo", void 0), q(this, "initParams", void 0), q(this, "defaultCountdown", 5), q(this, "adsOverlay", null), q(this, "adsIsShowing", !1), q(this, "lastUnDisplayedAdBreak", null), q(this, "requestCounter", 0), q(this, "scriptPromise", null), q(this, "scriptReady", !1), q(this, "scriptFailed", !1), q(this, "state", Ao()), this.context = e, this.contextInfo = this.context.getContextInfo(), this.initParams = i, typeof window != "undefined") {
2968
2968
  const n = window;
2969
2969
  n.adsbygoogle = n.adsbygoogle || [];
2970
2970
  }
@@ -3651,13 +3651,13 @@ class Go {
3651
3651
  }
3652
3652
  }
3653
3653
  function mt(t, e, i) {
3654
- return (e = qo(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
3654
+ return (e = Ko(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
3655
3655
  }
3656
- function qo(t) {
3657
- var e = Ko(t, "string");
3656
+ function Ko(t) {
3657
+ var e = qo(t, "string");
3658
3658
  return typeof e == "symbol" ? e : e + "";
3659
3659
  }
3660
- function Ko(t, e) {
3660
+ function qo(t, e) {
3661
3661
  if (typeof t != "object" || !t)
3662
3662
  return t;
3663
3663
  var i = t[Symbol.toPrimitive];
@@ -4336,7 +4336,7 @@ class fs {
4336
4336
  var i, n;
4337
4337
  this._isReady = !1, (n = (i = this.adsContext) == null ? void 0 : i.adBreakDone) == null || n.call(i, e), e !== "ignored" && (this.adsContext = null);
4338
4338
  }), ge(this, "reinit", async (e) => {
4339
- this.destroy(e), await this.init();
4339
+ console.log("[JoliboxSDK] NewsBreak reinit breakStatus:", e), this.destroy(e), await this.init();
4340
4340
  }), ge(this, "requestAds", async (e) => {
4341
4341
  if (console.log("[JoliboxSDK] NewsBreak newsbreak this.adsContext", this.adsContext), this.adsContext) {
4342
4342
  this.destroy("ignored");
@@ -4353,22 +4353,11 @@ class fs {
4353
4353
  return;
4354
4354
  }
4355
4355
  const n = await i.isRewardReady();
4356
- if (console.log("[JoliboxSDK] NewsBreak requestAds sdk.isRewardReady", n), n)
4357
- this._isReady = !0, this.showAd();
4358
- else {
4359
- const r = window.setTimeout(() => {
4360
- this._isReady || this.reinit("timeout");
4361
- }, 5e3);
4362
- i.createRewardAd({
4363
- platform: "jolibox"
4364
- }).then((o) => {
4365
- clearTimeout(r), o.success && o.ready ? (this._isReady = !0, this.showAd()) : this.reinit("noAdPreloaded");
4366
- }).catch(() => {
4367
- clearTimeout(r), this.reinit("noAdPreloaded");
4368
- });
4369
- }
4356
+ console.log("[JoliboxSDK] NewsBreak requestAds sdk.isRewardReady", n), n ? (this._isReady = !0, this.showAd()) : (await i.createRewardAd({
4357
+ platform: "jolibox"
4358
+ }), this.showAd());
4370
4359
  }), ge(this, "showAd", () => {
4371
- if (!this.adsContext) {
4360
+ if (console.log("[JoliboxSDK] NewsBreak showAd"), !this.adsContext) {
4372
4361
  this.destroy("error");
4373
4362
  return;
4374
4363
  }
@@ -4595,7 +4584,7 @@ class ea {
4595
4584
  });
4596
4585
  return;
4597
4586
  }
4598
- if (!this.context.checkNetwork()) {
4587
+ if (!this.context.checkNetwork() && !this.providers.NEWSBREAK) {
4599
4588
  (d = e.adBreakDone) == null || d.call(e, {
4600
4589
  breakType: e.type,
4601
4590
  breakName: e.type === "preroll" ? void 0 : e.name,
@@ -4666,12 +4655,12 @@ class ea {
4666
4655
  provider: "INTERNAL_NATIVE",
4667
4656
  params: L
4668
4657
  };
4669
- let q;
4670
- for (L.length > 0 ? q = [W].concat(C) : q = C, q = q.sort((I, X) => I.seq - X.seq).map((I, X) => Wt(yt({}, I), {
4658
+ let K;
4659
+ for (L.length > 0 ? K = [W].concat(C) : K = C, K = K.sort((I, X) => I.seq - X.seq).map((I, X) => Wt(yt({}, I), {
4671
4660
  seq: X
4672
4661
  // re-assign seq
4673
- })); q.length > 0; ) {
4674
- const I = q.shift(), X = this.providers[I.provider];
4662
+ })); K.length > 0; ) {
4663
+ const I = K.shift(), X = this.providers[I.provider];
4675
4664
  if (X) {
4676
4665
  const [an, dn] = await me.callAdBreakAndContinue(X, e, I, (Vt) => {
4677
4666
  var Gt;
@@ -5455,13 +5444,13 @@ class ve {
5455
5444
  oe(ve, "STORAGE_KEY_INIT", "jolibox_afv_init_data");
5456
5445
  oe(ve, "STORAGE_KEY_INFO", "jolibox_afv_info_data");
5457
5446
  function ke(t, e, i) {
5458
- return (e = qs(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
5447
+ return (e = Ks(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
5459
5448
  }
5460
- function qs(t) {
5461
- var e = Ks(t, "string");
5449
+ function Ks(t) {
5450
+ var e = qs(t, "string");
5462
5451
  return typeof e == "symbol" ? e : e + "";
5463
5452
  }
5464
- function Ks(t, e) {
5453
+ function qs(t, e) {
5465
5454
  if (typeof t != "object" || !t)
5466
5455
  return t;
5467
5456
  var i = t[Symbol.toPrimitive];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jolibox/ads",
3
3
  "description": "This project is for integrating Jolibox ads providers",
4
- "version": "1.4.10",
4
+ "version": "1.4.12",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
7
7
  "type": "module",
@@ -12,12 +12,12 @@
12
12
  ],
13
13
  "types": "./dist/index.d.ts",
14
14
  "dependencies": {
15
- "@jolibox/common": "1.4.10",
15
+ "@jolibox/common": "1.4.12",
16
16
  "@emotion/css": "11.13.5",
17
- "@jolibox/types": "1.4.10",
17
+ "@jolibox/types": "1.4.12",
18
18
  "preact": "10.26.4",
19
19
  "@preact/signals": "2.0.4",
20
- "@jolibox/native-bridge": "1.4.10"
20
+ "@jolibox/native-bridge": "1.4.12"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@babel/core": "7.23.3",