@rebilly/risk-data-collector 4.20.0 → 4.21.0
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 +7 -0
- package/dist/data-collector.js +171 -158
- package/dist/data-collector.js.map +1 -1
- package/dist/data-collector.min.js +1 -1
- package/dist/data-collector.min.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [4.21.0](https://github.com/Rebilly/rebilly/compare/risk-data-collector-v4.20.0...risk-data-collector-v4.21.0) (2024-03-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **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))
|
|
7
|
+
|
|
1
8
|
## [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
9
|
|
|
3
10
|
|
package/dist/data-collector.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
var N = function() {
|
|
2
2
|
return N = Object.assign || function(e) {
|
|
3
|
-
for (var t, n = 1,
|
|
3
|
+
for (var t, n = 1, o = arguments.length; n < o; n++) {
|
|
4
4
|
t = arguments[n];
|
|
5
|
-
for (var
|
|
6
|
-
Object.prototype.hasOwnProperty.call(t,
|
|
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
|
|
17
|
-
e.indexOf(n[
|
|
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
|
|
22
|
-
return
|
|
23
|
-
a(
|
|
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(
|
|
26
|
+
return new (t || (t = Promise))(function(i, a) {
|
|
27
27
|
function l(c) {
|
|
28
28
|
try {
|
|
29
|
-
|
|
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
|
-
|
|
36
|
+
h(n.throw(c));
|
|
37
37
|
} catch (s) {
|
|
38
38
|
a(s);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
c.done ?
|
|
41
|
+
function h(c) {
|
|
42
|
+
c.done ? i(c.value) : o(c.value).then(l, u);
|
|
43
43
|
}
|
|
44
|
-
|
|
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,
|
|
50
|
-
(
|
|
51
|
-
return r.concat(
|
|
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
|
|
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
|
|
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,
|
|
71
|
-
var
|
|
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
|
|
73
|
+
return d[0];
|
|
74
74
|
}, postpone: function() {
|
|
75
|
-
var
|
|
76
|
-
|
|
75
|
+
var f = d.shift();
|
|
76
|
+
f !== void 0 && d.push(f);
|
|
77
77
|
}, exclude: function() {
|
|
78
|
-
|
|
78
|
+
d.shift();
|
|
79
79
|
} };
|
|
80
|
-
}(r),
|
|
81
|
-
return Math.random() * Math.min(a,
|
|
82
|
-
},
|
|
83
|
-
var
|
|
84
|
-
if (
|
|
85
|
-
t.exclude(),
|
|
86
|
-
else if (
|
|
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 (
|
|
89
|
-
var
|
|
90
|
-
g &&
|
|
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,
|
|
95
|
-
}]), c =
|
|
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(
|
|
99
|
-
var
|
|
100
|
-
return u.push({ url:
|
|
101
|
-
},
|
|
102
|
-
return
|
|
103
|
-
return
|
|
104
|
-
},
|
|
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
|
|
107
|
-
var g = s(
|
|
106
|
+
throw _;
|
|
107
|
+
var g = s(d, _);
|
|
108
108
|
if (!g)
|
|
109
|
-
throw
|
|
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(
|
|
119
|
-
return [
|
|
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
|
|
123
|
+
function oe(r) {
|
|
124
124
|
var e;
|
|
125
125
|
r.scriptUrlPattern;
|
|
126
|
-
var t = r.token, n = r.apiKey,
|
|
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(
|
|
130
|
-
return
|
|
131
|
-
return
|
|
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],
|
|
135
|
+
}(), u = l[0], h = l[1];
|
|
136
136
|
return Promise.resolve().then(function() {
|
|
137
|
-
if (!
|
|
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(
|
|
141
|
-
return function(
|
|
142
|
-
var
|
|
143
|
-
return
|
|
144
|
-
return
|
|
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(
|
|
146
|
+
}(String(R), E);
|
|
147
147
|
});
|
|
148
|
-
}(a,
|
|
149
|
-
return Ee(c,
|
|
148
|
+
}(a, o);
|
|
149
|
+
return Ee(c, pe);
|
|
150
150
|
}).catch(function(c) {
|
|
151
|
-
throw
|
|
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
|
|
156
|
+
return h(), s.load(N(N({}, i), { ldi: { attempts: E, visibilityStates: u } }));
|
|
157
157
|
});
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
return function(e, t, n,
|
|
161
|
-
var
|
|
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 || (
|
|
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
|
|
166
|
+
var h = function() {
|
|
167
167
|
return a.removeEventListener(l, u);
|
|
168
168
|
};
|
|
169
|
-
return
|
|
170
|
-
return
|
|
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 (
|
|
176
|
-
return n(
|
|
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
|
|
194
|
+
var o = document.createElement("script"), i = function() {
|
|
195
195
|
var l;
|
|
196
|
-
return (l =
|
|
196
|
+
return (l = o.parentNode) === null || l === void 0 ? void 0 : l.removeChild(o);
|
|
197
197
|
}, a = document.head || document.getElementsByTagName("head")[0];
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
},
|
|
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(
|
|
207
|
+
}).then(_e);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
209
|
+
function _e() {
|
|
210
210
|
var r = window, e = "__fpjs_p_l_b", t = r[e];
|
|
211
|
-
if (function(n,
|
|
212
|
-
var
|
|
213
|
-
a != null && a.configurable ? delete n[
|
|
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:
|
|
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:
|
|
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:
|
|
226
|
-
ERROR_CLIENT_TIMEOUT:
|
|
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:
|
|
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:
|
|
237
|
-
ERROR_RATE_LIMIT:
|
|
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:
|
|
245
|
+
ERROR_WRONG_REGION: V,
|
|
246
246
|
default: Oe,
|
|
247
|
-
defaultEndpoint:
|
|
247
|
+
defaultEndpoint: b,
|
|
248
248
|
defaultScriptUrlPattern: K,
|
|
249
|
-
defaultTlsEndpoint:
|
|
250
|
-
load:
|
|
251
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
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 =
|
|
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 =
|
|
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(),
|
|
350
|
-
if (t.expiresAt <
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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, !
|
|
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
|
-
|
|
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
|
|
470
|
-
this.cacheManager = new Se(n,
|
|
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
|
|
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
|
|
490
|
-
this.agentPromise =
|
|
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
|
|
507
|
-
if (!this.inFlightRequests.has(
|
|
508
|
-
const
|
|
509
|
-
this.inFlightRequests.delete(
|
|
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(
|
|
511
|
+
this.inFlightRequests.set(o, i);
|
|
512
512
|
}
|
|
513
|
-
return yield this.inFlightRequests.get(
|
|
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
|
|
552
|
-
if (
|
|
553
|
-
return Object.assign(Object.assign({},
|
|
551
|
+
const i = yield this.cacheManager.get(n);
|
|
552
|
+
if (i)
|
|
553
|
+
return Object.assign(Object.assign({}, i), { cacheHit: !0 });
|
|
554
554
|
}
|
|
555
|
-
const
|
|
556
|
-
return yield this.cacheManager.set(n,
|
|
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",
|
|
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}/${
|
|
570
|
-
|
|
569
|
+
`${t}/${n}/${o}`,
|
|
570
|
+
b
|
|
571
571
|
],
|
|
572
572
|
scriptUrlPattern: [
|
|
573
|
-
`${t}/${n}/${
|
|
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
|
|
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",
|
|
595
|
-
const n = Ke(r) ? Le : Ce,
|
|
596
|
-
|
|
597
|
-
const
|
|
598
|
-
return
|
|
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,
|
|
606
|
-
const
|
|
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
|
-
|
|
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
|
-
},
|
|
620
|
-
|
|
619
|
+
}, i.onerror = () => {
|
|
620
|
+
o(new Error("Error attempting to mount Kount script"));
|
|
621
621
|
};
|
|
622
622
|
});
|
|
623
623
|
}
|
|
624
|
-
|
|
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:
|
|
630
|
-
getFingerprint:
|
|
637
|
+
kountSessionId: o = null,
|
|
638
|
+
getFingerprint: i,
|
|
631
639
|
getFraudSessionId: a
|
|
632
640
|
}) {
|
|
633
|
-
const { colorDepth: l, height: u, width:
|
|
634
|
-
let E,
|
|
641
|
+
const { colorDepth: l, height: u, width: h } = e || {}, { javaEnabled: c, language: s } = t || {};
|
|
642
|
+
let E, R, d;
|
|
635
643
|
try {
|
|
636
|
-
E
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
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:
|
|
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:
|
|
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
|
|
674
|
+
async function Me({
|
|
662
675
|
env: r = null,
|
|
663
676
|
kountAccountId: e = null,
|
|
664
677
|
kountSessionId: t = null
|
|
665
678
|
} = {}) {
|
|
666
|
-
return
|
|
679
|
+
return Fe({
|
|
667
680
|
env: r,
|
|
668
681
|
screen,
|
|
669
682
|
navigator,
|
|
670
683
|
kountAccountId: e,
|
|
671
684
|
kountSessionId: t,
|
|
672
|
-
getFingerprint:
|
|
685
|
+
getFingerprint: De,
|
|
673
686
|
getFraudSessionId: Ue
|
|
674
687
|
});
|
|
675
688
|
}
|
|
676
689
|
export {
|
|
677
|
-
|
|
678
|
-
|
|
690
|
+
Me as collectData,
|
|
691
|
+
Fe as collectDataHelper
|
|
679
692
|
};
|
|
680
693
|
//# sourceMappingURL=data-collector.js.map
|