@jolibox/ads 1.4.13 → 1.4.14

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 +47 -47
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -1,21 +1,21 @@
1
1
  var ln = Object.defineProperty, un = Object.defineProperties;
2
2
  var cn = Object.getOwnPropertyDescriptors;
3
- var We = Object.getOwnPropertySymbols;
3
+ var Je = Object.getOwnPropertySymbols;
4
4
  var qt = Object.prototype.hasOwnProperty, zt = Object.prototype.propertyIsEnumerable;
5
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
7
  qt.call(e, i) && Kt(t, i, e[i]);
8
- if (We)
9
- for (var i of We(e))
8
+ if (Je)
9
+ for (var i of Je(e))
10
10
  zt.call(e, i) && Kt(t, i, e[i]);
11
11
  return t;
12
- }, Wt = (t, e) => un(t, cn(e));
13
- var Jt = (t, e) => {
12
+ }, Jt = (t, e) => un(t, cn(e));
13
+ var Wt = (t, e) => {
14
14
  var i = {};
15
15
  for (var n in t)
16
16
  qt.call(t, n) && e.indexOf(n) < 0 && (i[n] = t[n]);
17
- if (t != null && We)
18
- for (var n of We(t))
17
+ if (t != null && Je)
18
+ for (var n of Je(t))
19
19
  e.indexOf(n) < 0 && zt.call(t, n) && (i[n] = t[n]);
20
20
  return i;
21
21
  };
@@ -398,7 +398,7 @@ function zn(t, e) {
398
398
  return t((r) => e(r) && i.call(n, r), null);
399
399
  });
400
400
  }
401
- var wt = Symbol.for("Jolibox.hostEmitter"), Wn = () => {
401
+ var wt = Symbol.for("Jolibox.hostEmitter"), Jn = () => {
402
402
  let t = new Gn();
403
403
  return globalThis[wt] || (globalThis[wt] = {
404
404
  on: t.on.bind(t),
@@ -407,8 +407,8 @@ var wt = Symbol.for("Jolibox.hostEmitter"), Wn = () => {
407
407
  once: t.once.bind(t)
408
408
  }), globalThis[wt];
409
409
  };
410
- Wn();
411
- function Jn(t, e) {
410
+ Jn();
411
+ function Wn(t, e) {
412
412
  let i = Math.min(t.length, e.length);
413
413
  for (let n = 0; n < i; n++)
414
414
  Hn(t[n], e[n]);
@@ -443,7 +443,7 @@ var Tt = class {
443
443
  t.handler = function() {
444
444
  for (var r = arguments.length, o = new Array(r), s = 0; s < r; s++)
445
445
  o[s] = arguments[s];
446
- return Jn(o, i), n(...o);
446
+ return Wn(o, i), n(...o);
447
447
  };
448
448
  }
449
449
  let {
@@ -522,7 +522,7 @@ var ti = class {
522
522
  }
523
523
  };
524
524
  ti = Ei([ki], ti);
525
- function J(t, e, i) {
525
+ function W(t, e, i) {
526
526
  return (e = Yn(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
527
527
  }
528
528
  function Yn(t) {
@@ -554,7 +554,7 @@ const me = (t) => t ? function() {
554
554
  };
555
555
  class Qn {
556
556
  constructor(e) {
557
- J(this, "context", void 0), J(this, "continueCallback", void 0), J(this, "adIsShowingCallback", void 0), J(this, "isBeforeAdCalled", !1), J(this, "isBeforeRewardCalled", !1), J(this, "isAdDismissedCalled", !1), J(this, "isAdViewedCalled", !1), J(this, "isAfterAdCalled", !1), J(this, "currentProvider", void 0), J(this, "currentClientParams", void 0), J(this, "adsHasResponse", !1), J(this, "videoChecker", window.document.createElement("video")), J(this, "contextInfo", void 0), J(this, "wrapShowAdFn", (i) => () => {
557
+ W(this, "context", void 0), W(this, "continueCallback", void 0), W(this, "adIsShowingCallback", void 0), W(this, "isBeforeAdCalled", !1), W(this, "isBeforeRewardCalled", !1), W(this, "isAdDismissedCalled", !1), W(this, "isAdViewedCalled", !1), W(this, "isAfterAdCalled", !1), W(this, "currentProvider", void 0), W(this, "currentClientParams", void 0), W(this, "adsHasResponse", !1), W(this, "videoChecker", window.document.createElement("video")), W(this, "contextInfo", void 0), W(this, "wrapShowAdFn", (i) => () => {
558
558
  var o, s, a;
559
559
  this.adsHasResponse = !0;
560
560
  let n = !1;
@@ -728,7 +728,7 @@ class Qn {
728
728
  });
729
729
  }
730
730
  }
731
- function Je(t, e, i) {
731
+ function We(t, e, i) {
732
732
  return (e = Zn(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
733
733
  }
734
734
  function Zn(t) {
@@ -749,11 +749,11 @@ function er(t, e) {
749
749
  }
750
750
  class tr {
751
751
  constructor(e) {
752
- Je(this, "context", void 0), Je(this, "adBreakIsShowing", !1), Je(this, "reportPageJumpOut", () => {
752
+ We(this, "context", void 0), We(this, "adBreakIsShowing", !1), We(this, "reportPageJumpOut", () => {
753
753
  this.context.track("AdBreakJumpOut", {
754
754
  context: "AdsActionDetection"
755
755
  });
756
- }), Je(this, "reportPageHide", () => {
756
+ }), We(this, "reportPageHide", () => {
757
757
  this.context.track("AdBreakHide", {
758
758
  context: "AdsActionDetection"
759
759
  });
@@ -839,7 +839,7 @@ class ar {
839
839
  }), de(this, "adConfig", (n) => {
840
840
  const s = n, {
841
841
  onReady: r
842
- } = s, o = Jt(s, [
842
+ } = s, o = Wt(s, [
843
843
  "onReady"
844
844
  ]);
845
845
  this.context.track("CallAdConfig", o), this.configured ? console.warn("Ad config already set, skipping") : (this.configured = !0, this.push(n));
@@ -1759,16 +1759,16 @@ var qr = function(e) {
1759
1759
  }
1760
1760
  }
1761
1761
  return i;
1762
- }, Wr = qr({
1762
+ }, Jr = qr({
1763
1763
  key: "css"
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
- function Jr(t, e) {
1764
+ }), G = Jr.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
+ function Wr(t, e) {
1766
1766
  B.__h && B.__h(Q, t, ci || e), ci = 0;
1767
1767
  var i = Q.__H || (Q.__H = { __: [], __h: [] });
1768
1768
  return t >= i.__.length && i.__.push({}), i.__[t];
1769
1769
  }
1770
1770
  function Ui(t, e) {
1771
- var i = Jr(Dt++, 7);
1771
+ var i = Wr(Dt++, 7);
1772
1772
  return Xr(i.__H, e) && (i.__ = t(), i.__H = e, i.__h = t), i.__;
1773
1773
  }
1774
1774
  function Hr() {
@@ -2082,7 +2082,7 @@ function ze(t) {
2082
2082
  }
2083
2083
  return e.d.bind(e);
2084
2084
  }
2085
- var zi, _t, Wi = [];
2085
+ var zi, _t, Ji = [];
2086
2086
  ze(function() {
2087
2087
  zi = this.N;
2088
2088
  })();
@@ -2093,7 +2093,7 @@ function Ne(t, e) {
2093
2093
  function ut(t) {
2094
2094
  _t && _t(), _t = t && t.S();
2095
2095
  }
2096
- function Ji(t) {
2096
+ function Wi(t) {
2097
2097
  var e = this, i = t.data, n = Hi(i);
2098
2098
  n.value = i;
2099
2099
  var r = Ui(function() {
@@ -2119,8 +2119,8 @@ function Ji(t) {
2119
2119
  }, []), o = r[0], s = r[1];
2120
2120
  return o.value ? s.peek() : s.value;
2121
2121
  }
2122
- Ji.displayName = "_st";
2123
- Object.defineProperties(U.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Ji }, props: { configurable: !0, get: function() {
2122
+ Wi.displayName = "_st";
2123
+ Object.defineProperties(U.prototype, { constructor: { configurable: !0, value: void 0 }, type: { configurable: !0, value: Wi }, props: { configurable: !0, get: function() {
2124
2124
  return { data: this };
2125
2125
  } }, __b: { configurable: !0, value: 1 } });
2126
2126
  Ne("__b", function(t, e) {
@@ -2236,12 +2236,12 @@ var to = function(t) {
2236
2236
  };
2237
2237
  function io() {
2238
2238
  P(function() {
2239
- for (var t; t = Wi.shift(); )
2239
+ for (var t; t = Ji.shift(); )
2240
2240
  zi.call(t);
2241
2241
  });
2242
2242
  }
2243
2243
  function Yi() {
2244
- Wi.push(this) === 1 && (Te.requestAnimationFrame || to)(io);
2244
+ Ji.push(this) === 1 && (Te.requestAnimationFrame || to)(io);
2245
2245
  }
2246
2246
  const M = G`
2247
2247
  inset: 0;
@@ -2844,8 +2844,8 @@ const Ao = () => {
2844
2844
  visible: d,
2845
2845
  payload: l
2846
2846
  } = e, [u, c] = pe(!1), [h, f] = pe(0), [v, y] = pe(!1), [w, g] = pe(!1), [A, S] = pe("Loading next content..."), p = mi(null), _ = l.value, E = kt((L) => {
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);
2847
+ var C, J, K, I;
2848
+ c(!1), d.value = !1, L === "dismiss" ? (C = n.value) == null || C.call(n) : (J = r.value) == null || J.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);
@@ -2859,9 +2859,9 @@ const Ao = () => {
2859
2859
  const L = _.mode === "reward" ? 15 : 0, C = Math.max(Math.floor((I = _.countdown) != null ? I : L), 0);
2860
2860
  if (f(C), g(_.mode === "reward" ? C === 0 : !0), y(_.mode === "interstitial" ? C === 0 : !1), C === 0)
2861
2861
  return;
2862
- let W = C;
2862
+ let J = C;
2863
2863
  const K = window.setInterval(() => {
2864
- W -= 1, f(Math.max(W, 0)), W <= 0 && (window.clearInterval(K), _.mode === "reward" ? g(!0) : y(!0));
2864
+ J -= 1, f(Math.max(J, 0)), J <= 0 && (window.clearInterval(K), _.mode === "reward" ? g(!0) : y(!0));
2865
2865
  }, 1e3);
2866
2866
  return () => {
2867
2867
  window.clearInterval(K);
@@ -2884,12 +2884,12 @@ const Ao = () => {
2884
2884
  }
2885
2885
  const C = document.createElement("ins");
2886
2886
  C.className = "adsbygoogle", C.style.display = "block", C.style.width = "100%", C.style.height = "100%", C.setAttribute("data-ad-client", _.clientId), C.setAttribute("data-ad-slot", _.unitId), C.setAttribute("data-ad-format", "auto"), C.setAttribute("data-full-width-responsive", "true"), _.channelId && C.setAttribute("data-ad-channel", _.channelId), L.appendChild(C);
2887
- const W = new MutationObserver(() => {
2887
+ const J = new MutationObserver(() => {
2888
2888
  var X;
2889
2889
  const I = C.getAttribute("data-ad-status");
2890
- I === "filled" ? (c(!0), S(""), (X = s.value) == null || X.call(s), W.disconnect()) : I === "unfilled" && (S("Slot currently unavailable."), c(!1), W.disconnect());
2890
+ I === "filled" ? (c(!0), S(""), (X = s.value) == null || X.call(s), J.disconnect()) : I === "unfilled" && (S("Slot currently unavailable."), c(!1), J.disconnect());
2891
2891
  });
2892
- W.observe(C, {
2892
+ J.observe(C, {
2893
2893
  attributes: !0,
2894
2894
  attributeFilter: ["data-ad-status"]
2895
2895
  });
@@ -2897,10 +2897,10 @@ const Ao = () => {
2897
2897
  const I = window;
2898
2898
  I.adsbygoogle = I.adsbygoogle || [], I.adsbygoogle.push({});
2899
2899
  } catch (I) {
2900
- W.disconnect(), b();
2900
+ J.disconnect(), b();
2901
2901
  }
2902
2902
  return () => {
2903
- W.disconnect(), L.innerHTML = "";
2903
+ J.disconnect(), L.innerHTML = "";
2904
2904
  };
2905
2905
  }, [d.value, _, s, b]), !d.value || !_)
2906
2906
  return null;
@@ -3719,13 +3719,13 @@ class zo {
3719
3719
  }
3720
3720
  }
3721
3721
  function z(t, e, i) {
3722
- return (e = Wo(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
3722
+ return (e = Jo(e)) in t ? Object.defineProperty(t, e, { value: i, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = i, t;
3723
3723
  }
3724
- function Wo(t) {
3725
- var e = Jo(t, "string");
3724
+ function Jo(t) {
3725
+ var e = Wo(t, "string");
3726
3726
  return typeof e == "symbol" ? e : e + "";
3727
3727
  }
3728
- function Jo(t, e) {
3728
+ function Wo(t, e) {
3729
3729
  if (typeof t != "object" || !t)
3730
3730
  return t;
3731
3731
  var i = t[Symbol.toPrimitive];
@@ -4540,7 +4540,7 @@ class ea {
4540
4540
  var r, o, s, a, d, l, u, c, h, f, v, y, w, g, A, S;
4541
4541
  const i = Date.now();
4542
4542
  if (i - this.initializedTimeStamp < 3e3) {
4543
- (r = e.adBreakDone) == null || r.call(e, {
4543
+ console.log("[Jolibox SDK Ads] too soon"), (r = e.adBreakDone) == null || r.call(e, {
4544
4544
  breakType: e.type,
4545
4545
  breakName: e.type === "preroll" ? void 0 : e.name,
4546
4546
  breakFormat: e.type === "reward" ? "reward" : "interstitial",
@@ -4576,7 +4576,7 @@ class ea {
4576
4576
  return;
4577
4577
  }
4578
4578
  if (!this.context.checkNetwork() && !this.providers.NEWSBREAK) {
4579
- (d = e.adBreakDone) == null || d.call(e, {
4579
+ console.log("[Jolibox SDK Ads] net not ready"), (d = e.adBreakDone) == null || d.call(e, {
4580
4580
  breakType: e.type,
4581
4581
  breakName: e.type === "preroll" ? void 0 : e.name,
4582
4582
  breakFormat: e.type === "reward" ? "reward" : "interstitial",
@@ -4621,7 +4621,7 @@ class ea {
4621
4621
  return;
4622
4622
  }
4623
4623
  if (!_ || E !== "SUCCESS") {
4624
- (f = e.adBreakDone) == null || f.call(e, {
4624
+ console.log("[Jolibox SDK Ads] not SUCCESS"), (f = e.adBreakDone) == null || f.call(e, {
4625
4625
  breakType: e.type,
4626
4626
  breakName: e.type === "preroll" ? void 0 : e.name,
4627
4627
  breakFormat: e.type === "reward" ? "reward" : "interstitial",
@@ -4630,7 +4630,7 @@ class ea {
4630
4630
  return;
4631
4631
  } else {
4632
4632
  if (_.length === 0) {
4633
- (v = e.adBreakDone) == null || v.call(e, {
4633
+ console.log("[Jolibox SDK Ads] ads info empty"), (v = e.adBreakDone) == null || v.call(e, {
4634
4634
  breakType: e.type,
4635
4635
  breakName: e.type === "preroll" ? void 0 : e.name,
4636
4636
  breakFormat: e.type === "reward" ? "reward" : "interstitial",
@@ -4641,13 +4641,13 @@ class ea {
4641
4641
  let b = !0, ee = null;
4642
4642
  const _e = new Qn(this.context);
4643
4643
  this.adsActionDetection.adBreakIsShowing = !0;
4644
- const L = _.filter((I) => I.isNative).sort((I, X) => I.seq - X.seq), C = _.filter((I) => !I.isNative).sort((I, X) => I.seq - X.seq), W = {
4644
+ const L = _.filter((I) => I.isNative).sort((I, X) => I.seq - X.seq), C = _.filter((I) => !I.isNative).sort((I, X) => I.seq - X.seq), J = {
4645
4645
  seq: (w = (y = L[0]) == null ? void 0 : y.seq) != null ? w : 0,
4646
4646
  provider: "INTERNAL_NATIVE",
4647
4647
  params: L
4648
4648
  };
4649
4649
  let K;
4650
- 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), {
4650
+ for (L.length > 0 ? K = [J].concat(C) : K = C, K = K.sort((I, X) => I.seq - X.seq).map((I, X) => Jt(yt({}, I), {
4651
4651
  seq: X
4652
4652
  // re-assign seq
4653
4653
  })); K.length > 0; ) {
@@ -4671,7 +4671,7 @@ class ea {
4671
4671
  b && ee && ((g = e.adBreakDone) == null || g.call(e, ee));
4672
4672
  }
4673
4673
  } catch (p) {
4674
- (A = e.adBreakDone) == null || A.call(e, {
4674
+ console.log("[Jolibox SDK Ads] error:", p), (A = e.adBreakDone) == null || A.call(e, {
4675
4675
  breakType: e.type,
4676
4676
  breakFormat: e.type === "reward" ? "reward" : "interstitial",
4677
4677
  breakStatus: "noAdPreloaded"
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.13",
4
+ "version": "1.4.14",
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.13",
15
+ "@jolibox/common": "1.4.14",
16
16
  "@emotion/css": "11.13.5",
17
- "@jolibox/types": "1.4.13",
17
+ "@jolibox/types": "1.4.14",
18
18
  "preact": "10.26.4",
19
19
  "@preact/signals": "2.0.4",
20
- "@jolibox/native-bridge": "1.4.13"
20
+ "@jolibox/native-bridge": "1.4.14"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@babel/core": "7.23.3",