@rebilly/risk-data-collector 4.20.0 → 4.21.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [4.21.1](https://github.com/Rebilly/rebilly/compare/risk-data-collector-v4.21.0...risk-data-collector-v4.21.1) (2024-03-28)
2
+
3
+ ## [4.21.0](https://github.com/Rebilly/rebilly/compare/risk-data-collector-v4.20.0...risk-data-collector-v4.21.0) (2024-03-28)
4
+
5
+
6
+ ### Features
7
+
8
+ * **risk-data-collector:** add the isAdBlockEnabled property to browser data ([#4311](https://github.com/Rebilly/rebilly/issues/4311)) ([c6bc7b1](https://github.com/Rebilly/rebilly/commit/c6bc7b14b60696b0025c289b8dc3863d96488dac))
9
+
1
10
  ## [4.20.0](https://github.com/Rebilly/rebilly/compare/risk-data-collector-v4.19.0...risk-data-collector-v4.20.0) (2024-03-27)
2
11
 
3
12
 
@@ -1,9 +1,9 @@
1
1
  var N = function() {
2
2
  return N = Object.assign || function(e) {
3
- for (var t, n = 1, i = arguments.length; n < i; n++) {
3
+ for (var t, n = 1, o = arguments.length; n < o; n++) {
4
4
  t = arguments[n];
5
- for (var o in t)
6
- Object.prototype.hasOwnProperty.call(t, o) && (e[o] = t[o]);
5
+ for (var i in t)
6
+ Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
7
7
  }
8
8
  return e;
9
9
  }, N.apply(this, arguments);
@@ -13,49 +13,49 @@ function de(r, e) {
13
13
  for (var n in r)
14
14
  Object.prototype.hasOwnProperty.call(r, n) && e.indexOf(n) < 0 && (t[n] = r[n]);
15
15
  if (r != null && typeof Object.getOwnPropertySymbols == "function")
16
- for (var i = 0, n = Object.getOwnPropertySymbols(r); i < n.length; i++)
17
- e.indexOf(n[i]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[i]) && (t[n[i]] = r[n[i]]);
16
+ for (var o = 0, n = Object.getOwnPropertySymbols(r); o < n.length; o++)
17
+ e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(r, n[o]) && (t[n[o]] = r[n[o]]);
18
18
  return t;
19
19
  }
20
20
  function O(r, e, t, n) {
21
- function i(o) {
22
- return o instanceof t ? o : new t(function(a) {
23
- a(o);
21
+ function o(i) {
22
+ return i instanceof t ? i : new t(function(a) {
23
+ a(i);
24
24
  });
25
25
  }
26
- return new (t || (t = Promise))(function(o, a) {
26
+ return new (t || (t = Promise))(function(i, a) {
27
27
  function l(c) {
28
28
  try {
29
- d(n.next(c));
29
+ h(n.next(c));
30
30
  } catch (s) {
31
31
  a(s);
32
32
  }
33
33
  }
34
34
  function u(c) {
35
35
  try {
36
- d(n.throw(c));
36
+ h(n.throw(c));
37
37
  } catch (s) {
38
38
  a(s);
39
39
  }
40
40
  }
41
- function d(c) {
42
- c.done ? o(c.value) : i(c.value).then(l, u);
41
+ function h(c) {
42
+ c.done ? i(c.value) : o(c.value).then(l, u);
43
43
  }
44
- d((n = n.apply(r, e || [])).next());
44
+ h((n = n.apply(r, e || [])).next());
45
45
  });
46
46
  }
47
47
  function he(r, e, t) {
48
48
  if (t || arguments.length === 2)
49
- for (var n = 0, i = e.length, o; n < i; n++)
50
- (o || !(n in e)) && (o || (o = Array.prototype.slice.call(e, 0, n)), o[n] = e[n]);
51
- return r.concat(o || Array.prototype.slice.call(e));
49
+ for (var n = 0, o = e.length, i; n < o; n++)
50
+ (i || !(n in e)) && (i || (i = Array.prototype.slice.call(e, 0, n)), i[n] = e[n]);
51
+ return r.concat(i || Array.prototype.slice.call(e));
52
52
  }
53
53
  function Re(r, e) {
54
54
  return function(t, n) {
55
55
  return Object.prototype.hasOwnProperty.call(t, n);
56
56
  }(r, e) ? r[e] : void 0;
57
57
  }
58
- var D = { default: "endpoint" }, M = { default: "tlsEndpoint" };
58
+ var b = { default: "endpoint" }, j = { default: "tlsEndpoint" };
59
59
  function I(r) {
60
60
  for (var e = "", t = 0; t < r.length; ++t)
61
61
  if (t > 0) {
@@ -65,48 +65,48 @@ function I(r) {
65
65
  e += r[t].toUpperCase();
66
66
  return e;
67
67
  }
68
- var j = "Client timeout", k = "Network connection error", x = "Network request aborted", V = "Response cannot be parsed", T = "Blocked by CSP", A = "The endpoint parameter is not a valid URL", B = /* @__PURE__ */ I("WrongRegion"), q = /* @__PURE__ */ I("SubscriptionNotActive"), G = /* @__PURE__ */ I("UnsupportedVersion"), $ = /* @__PURE__ */ I("InstallationMethodRestricted"), H = /* @__PURE__ */ I("HostnameRestricted"), W = /* @__PURE__ */ I("IntegrationFailed"), P = "API key required", b = "API key not found", C = "API key expired", J = "Request cannot be parsed", Y = "Request failed", X = "Request failed to process", z = "Too many requests, rate limit exceeded", Q = "Not available for this origin", Z = "Not available with restricted header", ee = P, te = b, ne = C, fe = "3.9.0", S = "Failed to load the JS script of the agent", L = "9319";
68
+ var F = "Client timeout", M = "Network connection error", x = "Network request aborted", B = "Response cannot be parsed", T = "Blocked by CSP", A = "The endpoint parameter is not a valid URL", V = /* @__PURE__ */ I("WrongRegion"), q = /* @__PURE__ */ I("SubscriptionNotActive"), G = /* @__PURE__ */ I("UnsupportedVersion"), $ = /* @__PURE__ */ I("InstallationMethodRestricted"), H = /* @__PURE__ */ I("HostnameRestricted"), W = /* @__PURE__ */ I("IntegrationFailed"), P = "API key required", D = "API key not found", C = "API key expired", J = "Request cannot be parsed", Y = "Request failed", X = "Request failed to process", Q = "Too many requests, rate limit exceeded", z = "Not available for this origin", Z = "Not available with restricted header", ee = P, te = D, ne = C, fe = "3.9.0", S = "Failed to load the JS script of the agent", L = "9319";
69
69
  function Ee(r, e) {
70
- var t, n, i, o, a, l, u = [], d = (t = function(h) {
71
- var f = he([], h, !0);
70
+ var t, n, o, i, a, l, u = [], h = (t = function(R) {
71
+ var d = he([], R, !0);
72
72
  return { current: function() {
73
- return f[0];
73
+ return d[0];
74
74
  }, postpone: function() {
75
- var R = f.shift();
76
- R !== void 0 && f.push(R);
75
+ var f = d.shift();
76
+ f !== void 0 && d.push(f);
77
77
  }, exclude: function() {
78
- f.shift();
78
+ d.shift();
79
79
  } };
80
- }(r), o = 100, a = 3e3, l = 0, n = function() {
81
- return Math.random() * Math.min(a, o * Math.pow(2, l++));
82
- }, i = /* @__PURE__ */ new Set(), [t.current(), function(h, f) {
83
- var R, _ = f instanceof Error ? f.message : "";
84
- if (_ === T || _ === A)
85
- t.exclude(), R = 0;
86
- else if (_ === L)
80
+ }(r), i = 100, a = 3e3, l = 0, n = function() {
81
+ return Math.random() * Math.min(a, i * Math.pow(2, l++));
82
+ }, o = /* @__PURE__ */ new Set(), [t.current(), function(R, d) {
83
+ var f, p = d instanceof Error ? d.message : "";
84
+ if (p === T || p === A)
85
+ t.exclude(), f = 0;
86
+ else if (p === L)
87
87
  t.exclude();
88
- else if (_ === S) {
89
- var p = Date.now() - h.getTime() < 50, g = t.current();
90
- g && p && !i.has(g) && (i.add(g), R = 0), t.postpone();
88
+ else if (p === S) {
89
+ var _ = Date.now() - R.getTime() < 50, g = t.current();
90
+ g && _ && !o.has(g) && (o.add(g), f = 0), t.postpone();
91
91
  } else
92
92
  t.postpone();
93
93
  var m = t.current();
94
- return m === void 0 ? void 0 : [m, R ?? h.getTime() + n() - Date.now()];
95
- }]), c = d[0], s = d[1];
94
+ return m === void 0 ? void 0 : [m, f ?? R.getTime() + n() - Date.now()];
95
+ }]), c = h[0], s = h[1];
96
96
  if (c === void 0)
97
97
  return Promise.reject(new TypeError("The list of script URL patterns is empty"));
98
- var E = function(h) {
99
- var f = /* @__PURE__ */ new Date(), R = function(p) {
100
- return u.push({ url: h, startedAt: f, finishedAt: /* @__PURE__ */ new Date(), error: p });
101
- }, _ = e(h);
102
- return _.then(function() {
103
- return R();
104
- }, R), _.catch(function(p) {
98
+ var E = function(R) {
99
+ var d = /* @__PURE__ */ new Date(), f = function(_) {
100
+ return u.push({ url: R, startedAt: d, finishedAt: /* @__PURE__ */ new Date(), error: _ });
101
+ }, p = e(R);
102
+ return p.then(function() {
103
+ return f();
104
+ }, f), p.catch(function(_) {
105
105
  if (u.length >= 5)
106
- throw p;
107
- var g = s(f, p);
106
+ throw _;
107
+ var g = s(d, _);
108
108
  if (!g)
109
- throw p;
109
+ throw _;
110
110
  var m, se = g[0], le = g[1];
111
111
  return (m = le, new Promise(function(ue) {
112
112
  return setTimeout(ue, m);
@@ -115,65 +115,65 @@ function Ee(r, e) {
115
115
  });
116
116
  });
117
117
  };
118
- return E(c).then(function(h) {
119
- return [h, u];
118
+ return E(c).then(function(R) {
119
+ return [R, u];
120
120
  });
121
121
  }
122
122
  var re = "https://fpnpmcdn.net/v<version>/<apiKey>/loader_v<loaderVersion>.js", K = re;
123
- function ie(r) {
123
+ function oe(r) {
124
124
  var e;
125
125
  r.scriptUrlPattern;
126
- var t = r.token, n = r.apiKey, i = n === void 0 ? t : n, o = de(r, ["scriptUrlPattern", "token", "apiKey"]), a = (e = Re(r, "scriptUrlPattern")) !== null && e !== void 0 ? e : re, l = function() {
126
+ var t = r.token, n = r.apiKey, o = n === void 0 ? t : n, i = de(r, ["scriptUrlPattern", "token", "apiKey"]), a = (e = Re(r, "scriptUrlPattern")) !== null && e !== void 0 ? e : re, l = function() {
127
127
  var c = [], s = function() {
128
128
  c.push({ time: /* @__PURE__ */ new Date(), state: document.visibilityState });
129
- }, E = function(h, f, R, _) {
130
- return h.addEventListener(f, R, _), function() {
131
- return h.removeEventListener(f, R, _);
129
+ }, E = function(R, d, f, p) {
130
+ return R.addEventListener(d, f, p), function() {
131
+ return R.removeEventListener(d, f, p);
132
132
  };
133
133
  }(document, "visibilitychange", s);
134
134
  return s(), [c, E];
135
- }(), u = l[0], d = l[1];
135
+ }(), u = l[0], h = l[1];
136
136
  return Promise.resolve().then(function() {
137
- if (!i || typeof i != "string")
137
+ if (!o || typeof o != "string")
138
138
  throw new Error(P);
139
139
  var c = function(s, E) {
140
- return (Array.isArray(s) ? s : [s]).map(function(h) {
141
- return function(f, R) {
142
- var _ = encodeURIComponent;
143
- return f.replace(/<[^<>]+>/g, function(p) {
144
- return p === "<version>" ? "3" : p === "<apiKey>" ? _(R) : p === "<loaderVersion>" ? _(fe) : p;
140
+ return (Array.isArray(s) ? s : [s]).map(function(R) {
141
+ return function(d, f) {
142
+ var p = encodeURIComponent;
143
+ return d.replace(/<[^<>]+>/g, function(_) {
144
+ return _ === "<version>" ? "3" : _ === "<apiKey>" ? p(f) : _ === "<loaderVersion>" ? p(fe) : _;
145
145
  });
146
- }(String(h), E);
146
+ }(String(R), E);
147
147
  });
148
- }(a, i);
149
- return Ee(c, _e);
148
+ }(a, o);
149
+ return Ee(c, pe);
150
150
  }).catch(function(c) {
151
- throw d(), function(s) {
151
+ throw h(), function(s) {
152
152
  return s instanceof Error && s.message === L ? new Error(S) : s;
153
153
  }(c);
154
154
  }).then(function(c) {
155
155
  var s = c[0], E = c[1];
156
- return d(), s.load(N(N({}, o), { ldi: { attempts: E, visibilityStates: u } }));
156
+ return h(), s.load(N(N({}, i), { ldi: { attempts: E, visibilityStates: u } }));
157
157
  });
158
158
  }
159
- function _e(r) {
160
- return function(e, t, n, i) {
161
- var o, a = document, l = "securitypolicyviolation", u = function(c) {
159
+ function pe(r) {
160
+ return function(e, t, n, o) {
161
+ var i, a = document, l = "securitypolicyviolation", u = function(c) {
162
162
  var s = new URL(e, location.href), E = c.blockedURI;
163
- E !== s.href && E !== s.protocol.slice(0, -1) && E !== s.origin || (o = c, d());
163
+ E !== s.href && E !== s.protocol.slice(0, -1) && E !== s.origin || (i = c, h());
164
164
  };
165
165
  a.addEventListener(l, u);
166
- var d = function() {
166
+ var h = function() {
167
167
  return a.removeEventListener(l, u);
168
168
  };
169
- return i == null || i.then(d, d), Promise.resolve().then(t).then(function(c) {
170
- return d(), c;
169
+ return o == null || o.then(h, h), Promise.resolve().then(t).then(function(c) {
170
+ return h(), c;
171
171
  }, function(c) {
172
172
  return new Promise(function(s) {
173
173
  return setTimeout(s);
174
174
  }).then(function() {
175
- if (d(), o)
176
- return n(o);
175
+ if (h(), i)
176
+ return n(i);
177
177
  throw c;
178
178
  });
179
179
  });
@@ -191,50 +191,50 @@ function _e(r) {
191
191
  }
192
192
  }(e))
193
193
  throw new Error(A);
194
- var i = document.createElement("script"), o = function() {
194
+ var o = document.createElement("script"), i = function() {
195
195
  var l;
196
- return (l = i.parentNode) === null || l === void 0 ? void 0 : l.removeChild(i);
196
+ return (l = o.parentNode) === null || l === void 0 ? void 0 : l.removeChild(o);
197
197
  }, a = document.head || document.getElementsByTagName("head")[0];
198
- i.onload = function() {
199
- o(), t();
200
- }, i.onerror = function() {
201
- o(), n(new Error(S));
202
- }, i.async = !0, i.src = e, a.appendChild(i);
198
+ o.onload = function() {
199
+ i(), t();
200
+ }, o.onerror = function() {
201
+ i(), n(new Error(S));
202
+ }, o.async = !0, o.src = e, a.appendChild(o);
203
203
  });
204
204
  }(r);
205
205
  }, function() {
206
206
  throw new Error(T);
207
- }).then(pe);
207
+ }).then(_e);
208
208
  }
209
- function pe() {
209
+ function _e() {
210
210
  var r = window, e = "__fpjs_p_l_b", t = r[e];
211
- if (function(n, i) {
212
- var o, a = (o = Object.getOwnPropertyDescriptor) === null || o === void 0 ? void 0 : o.call(Object, n, i);
213
- a != null && a.configurable ? delete n[i] : a && !a.writable || (n[i] = void 0);
211
+ if (function(n, o) {
212
+ var i, a = (i = Object.getOwnPropertyDescriptor) === null || i === void 0 ? void 0 : i.call(Object, n, o);
213
+ a != null && a.configurable ? delete n[o] : a && !a.writable || (n[o] = void 0);
214
214
  }(r, e), typeof (t == null ? void 0 : t.load) != "function")
215
215
  throw new Error(L);
216
216
  return t;
217
217
  }
218
- var Oe = { load: ie, defaultScriptUrlPattern: K, ERROR_SCRIPT_LOAD_FAIL: S, ERROR_API_KEY_EXPIRED: C, ERROR_API_KEY_INVALID: b, ERROR_API_KEY_MISSING: P, ERROR_BAD_REQUEST_FORMAT: J, ERROR_BAD_RESPONSE_FORMAT: V, ERROR_CLIENT_TIMEOUT: j, ERROR_CSP_BLOCK: T, ERROR_FORBIDDEN_ENDPOINT: H, ERROR_FORBIDDEN_HEADER: Z, ERROR_FORBIDDEN_ORIGIN: Q, ERROR_GENERAL_SERVER_FAILURE: Y, ERROR_INSTALLATION_METHOD_RESTRICTED: $, ERROR_INTEGRATION_FAILURE: W, ERROR_INVALID_ENDPOINT: A, ERROR_NETWORK_ABORT: x, ERROR_NETWORK_CONNECTION: k, ERROR_RATE_LIMIT: z, ERROR_SERVER_TIMEOUT: X, ERROR_SUBSCRIPTION_NOT_ACTIVE: q, ERROR_TOKEN_EXPIRED: ne, ERROR_TOKEN_INVALID: te, ERROR_TOKEN_MISSING: ee, ERROR_UNSUPPORTED_VERSION: G, ERROR_WRONG_REGION: B, defaultEndpoint: D, defaultTlsEndpoint: M };
218
+ var Oe = { load: oe, defaultScriptUrlPattern: K, ERROR_SCRIPT_LOAD_FAIL: S, ERROR_API_KEY_EXPIRED: C, ERROR_API_KEY_INVALID: D, ERROR_API_KEY_MISSING: P, ERROR_BAD_REQUEST_FORMAT: J, ERROR_BAD_RESPONSE_FORMAT: B, ERROR_CLIENT_TIMEOUT: F, ERROR_CSP_BLOCK: T, ERROR_FORBIDDEN_ENDPOINT: H, ERROR_FORBIDDEN_HEADER: Z, ERROR_FORBIDDEN_ORIGIN: z, ERROR_GENERAL_SERVER_FAILURE: Y, ERROR_INSTALLATION_METHOD_RESTRICTED: $, ERROR_INTEGRATION_FAILURE: W, ERROR_INVALID_ENDPOINT: A, ERROR_NETWORK_ABORT: x, ERROR_NETWORK_CONNECTION: M, ERROR_RATE_LIMIT: Q, ERROR_SERVER_TIMEOUT: X, ERROR_SUBSCRIPTION_NOT_ACTIVE: q, ERROR_TOKEN_EXPIRED: ne, ERROR_TOKEN_INVALID: te, ERROR_TOKEN_MISSING: ee, ERROR_UNSUPPORTED_VERSION: G, ERROR_WRONG_REGION: V, defaultEndpoint: b, defaultTlsEndpoint: j };
219
219
  const ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
220
220
  __proto__: null,
221
221
  ERROR_API_KEY_EXPIRED: C,
222
- ERROR_API_KEY_INVALID: b,
222
+ ERROR_API_KEY_INVALID: D,
223
223
  ERROR_API_KEY_MISSING: P,
224
224
  ERROR_BAD_REQUEST_FORMAT: J,
225
- ERROR_BAD_RESPONSE_FORMAT: V,
226
- ERROR_CLIENT_TIMEOUT: j,
225
+ ERROR_BAD_RESPONSE_FORMAT: B,
226
+ ERROR_CLIENT_TIMEOUT: F,
227
227
  ERROR_CSP_BLOCK: T,
228
228
  ERROR_FORBIDDEN_ENDPOINT: H,
229
229
  ERROR_FORBIDDEN_HEADER: Z,
230
- ERROR_FORBIDDEN_ORIGIN: Q,
230
+ ERROR_FORBIDDEN_ORIGIN: z,
231
231
  ERROR_GENERAL_SERVER_FAILURE: Y,
232
232
  ERROR_INSTALLATION_METHOD_RESTRICTED: $,
233
233
  ERROR_INTEGRATION_FAILURE: W,
234
234
  ERROR_INVALID_ENDPOINT: A,
235
235
  ERROR_NETWORK_ABORT: x,
236
- ERROR_NETWORK_CONNECTION: k,
237
- ERROR_RATE_LIMIT: z,
236
+ ERROR_NETWORK_CONNECTION: M,
237
+ ERROR_RATE_LIMIT: Q,
238
238
  ERROR_SCRIPT_LOAD_FAIL: S,
239
239
  ERROR_SERVER_TIMEOUT: X,
240
240
  ERROR_SUBSCRIPTION_NOT_ACTIVE: q,
@@ -242,13 +242,13 @@ const ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
242
242
  ERROR_TOKEN_INVALID: te,
243
243
  ERROR_TOKEN_MISSING: ee,
244
244
  ERROR_UNSUPPORTED_VERSION: G,
245
- ERROR_WRONG_REGION: B,
245
+ ERROR_WRONG_REGION: V,
246
246
  default: Oe,
247
- defaultEndpoint: D,
247
+ defaultEndpoint: b,
248
248
  defaultScriptUrlPattern: K,
249
- defaultTlsEndpoint: M,
250
- load: ie
251
- }, Symbol.toStringTag, { value: "Module" })), oe = "@fpjs@client@", ge = 60 * 60 * 24, ae = 60 * 60, ye = () => Date.now();
249
+ defaultTlsEndpoint: j,
250
+ load: oe
251
+ }, Symbol.toStringTag, { value: "Module" })), ie = "@fpjs@client@", ge = 60 * 60 * 24, ae = 60 * 60, ye = () => Date.now();
252
252
  class Ie {
253
253
  constructor(e) {
254
254
  var t;
@@ -269,7 +269,7 @@ function ce(r, e) {
269
269
  return r.replace(`${e}__`, "");
270
270
  }
271
271
  class me {
272
- constructor(e = oe) {
272
+ constructor(e = ie) {
273
273
  this.prefix = e;
274
274
  }
275
275
  set(e, t) {
@@ -292,7 +292,7 @@ class me {
292
292
  }
293
293
  }
294
294
  class we {
295
- constructor(e = oe) {
295
+ constructor(e = ie) {
296
296
  this.prefix = e;
297
297
  }
298
298
  /**
@@ -346,8 +346,8 @@ class Se {
346
346
  const t = yield this.cache.get(e.toKey());
347
347
  if (!t)
348
348
  return;
349
- const n = yield this.nowProvider(), i = Math.floor(n / 1e3);
350
- if (t.expiresAt < i) {
349
+ const n = yield this.nowProvider(), o = Math.floor(n / 1e3);
350
+ if (t.expiresAt < o) {
351
351
  yield this.cache.remove(e.toKey());
352
352
  return;
353
353
  }
@@ -428,7 +428,7 @@ const Pe = {
428
428
  [v.LocalStorage]: (r) => new me(r),
429
429
  [v.SessionStorage]: (r) => new we(r),
430
430
  [v.NoCache]: () => new Te()
431
- }, De = (r) => {
431
+ }, be = (r) => {
432
432
  switch (r) {
433
433
  case v.SessionStorage:
434
434
  try {
@@ -447,7 +447,7 @@ const Pe = {
447
447
  default:
448
448
  return !0;
449
449
  }
450
- }, F = (r) => Pe[r];
450
+ }, k = (r) => Pe[r];
451
451
  class w {
452
452
  constructor(e) {
453
453
  var t;
@@ -460,14 +460,14 @@ class w {
460
460
  if (e != null && e.cache)
461
461
  n = e.cache;
462
462
  else {
463
- if (this.cacheLocation = (e == null ? void 0 : e.cacheLocation) || v.SessionStorage, !F(this.cacheLocation))
463
+ if (this.cacheLocation = (e == null ? void 0 : e.cacheLocation) || v.SessionStorage, !k(this.cacheLocation))
464
464
  throw new Error(`Invalid cache location "${this.cacheLocation}"`);
465
- De(this.cacheLocation) || (this.cacheLocation = v.Memory), n = F(this.cacheLocation)(e == null ? void 0 : e.cachePrefix);
465
+ be(this.cacheLocation) || (this.cacheLocation = v.Memory), n = k(this.cacheLocation)(e == null ? void 0 : e.cachePrefix);
466
466
  }
467
467
  if (e != null && e.cacheTimeInSeconds && e.cacheTimeInSeconds > ge)
468
468
  throw new Error("Cache time cannot exceed 86400 seconds (24 hours)");
469
- const i = (t = e == null ? void 0 : e.cacheTimeInSeconds) !== null && t !== void 0 ? t : ae;
470
- this.cacheManager = new Se(n, i);
469
+ const o = (t = e == null ? void 0 : e.cacheTimeInSeconds) !== null && t !== void 0 ? t : ae;
470
+ this.cacheManager = new Se(n, o);
471
471
  }
472
472
  /**
473
473
  * Loads FPJS JS agent with certain settings and stores the instance in memory
@@ -480,14 +480,14 @@ class w {
480
480
  return O(this, void 0, void 0, function* () {
481
481
  if (!this.loadOptions && !e)
482
482
  throw new TypeError("No load options provided");
483
- const i = Object.assign(Object.assign(Object.assign({}, this.loadOptions), e), { integrationInfo: [
483
+ const o = Object.assign(Object.assign(Object.assign({}, this.loadOptions), e), { integrationInfo: [
484
484
  ...((t = this.loadOptions) === null || t === void 0 ? void 0 : t.integrationInfo) || [],
485
485
  ...(e == null ? void 0 : e.integrationInfo) || [],
486
486
  `fingerprintjs-pro-spa/${Ae}`
487
487
  ] });
488
488
  if (!this.agentPromise) {
489
- const o = (n = this.customAgent) !== null && n !== void 0 ? n : ve;
490
- this.agentPromise = o.load(i).then((a) => (this.agent = a, a)).catch((a) => {
489
+ const i = (n = this.customAgent) !== null && n !== void 0 ? n : ve;
490
+ this.agentPromise = i.load(o).then((a) => (this.agent = a, a)).catch((a) => {
491
491
  throw this.agentPromise = null, a;
492
492
  });
493
493
  }
@@ -503,14 +503,14 @@ class w {
503
503
  */
504
504
  getVisitorData(e = {}, t = !1) {
505
505
  return O(this, void 0, void 0, function* () {
506
- const i = w.makeCacheKey(e).toKey();
507
- if (!this.inFlightRequests.has(i)) {
508
- const o = this._identify(e, t).finally(() => {
509
- this.inFlightRequests.delete(i);
506
+ const o = w.makeCacheKey(e).toKey();
507
+ if (!this.inFlightRequests.has(o)) {
508
+ const i = this._identify(e, t).finally(() => {
509
+ this.inFlightRequests.delete(o);
510
510
  });
511
- this.inFlightRequests.set(i, o);
511
+ this.inFlightRequests.set(o, i);
512
512
  }
513
- return yield this.inFlightRequests.get(i);
513
+ return yield this.inFlightRequests.get(o);
514
514
  });
515
515
  }
516
516
  /**
@@ -548,12 +548,12 @@ class w {
548
548
  return O(this, void 0, void 0, function* () {
549
549
  const n = w.makeCacheKey(e);
550
550
  if (!t) {
551
- const o = yield this.cacheManager.get(n);
552
- if (o)
553
- return Object.assign(Object.assign({}, o), { cacheHit: !0 });
551
+ const i = yield this.cacheManager.get(n);
552
+ if (i)
553
+ return Object.assign(Object.assign({}, i), { cacheHit: !0 });
554
554
  }
555
- const i = yield this.agent.get(e);
556
- return yield this.cacheManager.set(n, i), Object.assign(Object.assign({}, i), { cacheHit: !1 });
555
+ const o = yield this.agent.get(e);
556
+ return yield this.cacheManager.set(n, o), Object.assign(Object.assign({}, o), { cacheHit: !1 });
557
557
  });
558
558
  }
559
559
  }
@@ -562,15 +562,15 @@ async function U() {
562
562
  const r = typeof Cypress == "object", e = typeof process == "object" && process.env.NODE_ENV === "test";
563
563
  if (r || e)
564
564
  return "a-mock-visitor-id";
565
- const t = "https://d2hwnq6cq5q3pi.cloudfront.net", n = "wyr92st0i7", i = "ia1t65gn6i", o = "db4fuswrza", a = new w({
565
+ const t = "https://d2hwnq6cq5q3pi.cloudfront.net", n = "wyr92st0i7", o = "ia1t65gn6i", i = "db4fuswrza", a = new w({
566
566
  loadOptions: {
567
567
  apiKey: "hpFVJecm7Ni7AjSfvBIW",
568
568
  endpoint: [
569
- `${t}/${n}/${i}`,
570
- D
569
+ `${t}/${n}/${o}`,
570
+ b
571
571
  ],
572
572
  scriptUrlPattern: [
573
- `${t}/${n}/${o}?apiKey=<apiKey>&version=<version>&loaderVersion=<loaderVersion>`,
573
+ `${t}/${n}/${i}?apiKey=<apiKey>&version=<version>&loaderVersion=<loaderVersion>`,
574
574
  K
575
575
  ]
576
576
  }
@@ -580,7 +580,7 @@ async function U() {
580
580
  return console.log(r), "";
581
581
  }
582
582
  }
583
- async function be() {
583
+ async function De() {
584
584
  return new Promise((r) => {
585
585
  window.requestIdleCallback ? requestIdleCallback(async () => {
586
586
  const e = await U();
@@ -591,24 +591,24 @@ async function be() {
591
591
  }, 500);
592
592
  });
593
593
  }
594
- const Ce = "https://tst.kaptcha.com", Le = "https://ssl.kaptcha.com", Ke = (r) => r === "production", Fe = ({ env: r, kountAccountId: e, kountSessionId: t }) => {
595
- const n = Ke(r) ? Le : Ce, i = new URL(`${n}/collect/sdk`);
596
- i.searchParams.append("m", e), t && i.searchParams.append("m", t);
597
- const o = document.createElement("script");
598
- return o.setAttribute("class", "kaxsdc"), o.setAttribute("data-event", "load"), o.setAttribute("type", "text/javascript"), o.setAttribute("src", i.href), document.body.append(o), o;
594
+ const Ce = "https://tst.kaptcha.com", Le = "https://ssl.kaptcha.com", Ke = (r) => r === "production", ke = ({ env: r, kountAccountId: e, kountSessionId: t }) => {
595
+ const n = Ke(r) ? Le : Ce, o = new URL(`${n}/collect/sdk`);
596
+ o.searchParams.append("m", e), t && o.searchParams.append("m", t);
597
+ const i = document.createElement("script");
598
+ return i.setAttribute("class", "kaxsdc"), i.setAttribute("data-event", "load"), i.setAttribute("type", "text/javascript"), i.setAttribute("src", o.href), document.body.append(i), i;
599
599
  };
600
600
  async function Ue({
601
601
  env: r,
602
602
  kountAccountId: e,
603
603
  kountSessionId: t
604
604
  }) {
605
- return new Promise((n, i) => {
606
- const o = Fe({
605
+ return new Promise((n, o) => {
606
+ const i = ke({
607
607
  env: r,
608
608
  kountAccountId: e,
609
609
  kountSessionId: t
610
610
  });
611
- o.onload = () => {
611
+ i.onload = () => {
612
612
  const a = new ka.ClientSDK();
613
613
  a.setupCallback({
614
614
  "collect-begin": (l) => {
@@ -616,65 +616,78 @@ async function Ue({
616
616
  n(u);
617
617
  }
618
618
  }), a.autoLoadEvents();
619
- }, o.onerror = () => {
620
- i(new Error("Error attempting to mount Kount script"));
619
+ }, i.onerror = () => {
620
+ o(new Error("Error attempting to mount Kount script"));
621
621
  };
622
622
  });
623
623
  }
624
- async function Me({
624
+ const je = () => {
625
+ const r = document.createElement("script");
626
+ return r.src = "https://cdn.rebilly.com/risk-data-collector/@latest/google-adsense.js", new Promise((e) => {
627
+ r.onload = () => {
628
+ e(document.getElementById("fj2xFkdsoQIQna") === null);
629
+ }, r.onerror = () => e(!0), document.head.appendChild(r);
630
+ }).catch(() => !0);
631
+ };
632
+ async function Fe({
625
633
  env: r = null,
626
634
  screen: e,
627
635
  navigator: t,
628
636
  kountAccountId: n = null,
629
- kountSessionId: i = null,
630
- getFingerprint: o,
637
+ kountSessionId: o = null,
638
+ getFingerprint: i,
631
639
  getFraudSessionId: a
632
640
  }) {
633
- const { colorDepth: l, height: u, width: d } = e || {}, { javaEnabled: c, language: s } = t || {};
634
- let E, h;
641
+ const { colorDepth: l, height: u, width: h } = e || {}, { javaEnabled: c, language: s } = t || {};
642
+ let E, R, d;
635
643
  try {
636
- E = await o(), n && (h = await a({
637
- env: r,
638
- kountAccountId: n,
639
- kountSessionId: i
640
- }));
641
- } catch (R) {
642
- console.error(R);
644
+ [d, E, R] = await Promise.all([
645
+ je(),
646
+ i == null ? void 0 : i(),
647
+ n ? a({
648
+ env: r,
649
+ kountAccountId: n,
650
+ kountSessionId: o
651
+ }) : void 0
652
+ ]);
653
+ } catch (p) {
654
+ console.error(p);
643
655
  }
644
656
  return {
645
657
  riskMetadata: {
646
658
  fingerprint: E || null,
647
659
  extraData: {
648
- kountFraudSessionId: h || null
660
+ kountFraudSessionId: R || null
649
661
  },
650
662
  browserData: {
651
663
  colorDepth: l || null,
652
664
  isJavaEnabled: c ? c.call(t) : null,
653
665
  language: s || null,
654
666
  screenHeight: u || null,
655
- screenWidth: d || null,
656
- timeZoneOffset: (/* @__PURE__ */ new Date()).getTimezoneOffset()
667
+ screenWidth: h || null,
668
+ timeZoneOffset: (/* @__PURE__ */ new Date()).getTimezoneOffset(),
669
+ isAdBlockEnabled: d
657
670
  }
658
671
  }
659
672
  };
660
673
  }
661
- async function je({
674
+ async function Me({
662
675
  env: r = null,
663
676
  kountAccountId: e = null,
664
677
  kountSessionId: t = null
665
678
  } = {}) {
666
- return Me({
679
+ return Fe({
667
680
  env: r,
668
681
  screen,
669
682
  navigator,
670
683
  kountAccountId: e,
671
684
  kountSessionId: t,
672
- getFingerprint: be,
685
+ getFingerprint: De,
673
686
  getFraudSessionId: Ue
674
687
  });
675
688
  }
676
689
  export {
677
- je as collectData,
678
- Me as collectDataHelper
690
+ Me as collectData,
691
+ Fe as collectDataHelper
679
692
  };
680
693
  //# sourceMappingURL=data-collector.js.map