@jumio/websdk 0.6.1 → 0.6.3
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/LICENSE +3 -3
- package/README.md +17 -3
- package/assets/icons/error.svg +3 -0
- package/assets/icons/success.svg +3 -0
- package/assets/ml/dac.wasm +0 -0
- package/assets/ml/dac_simd.wasm +0 -0
- package/assets/style.css +1 -1
- package/index.html +2 -2
- package/index.js +799 -24
- package/index2.d.ts +1321 -2669
- package/js/da-system.CF4xYrOs.js +3311 -0
- package/js/i18n/{ar.DJCGXB2w.js → ar.G4YO_Y_p.js} +24 -4
- package/js/i18n/{az.COAR442z.js → az.-zT6np34.js} +24 -4
- package/js/i18n/{bg.BnAcaGp-.js → bg.DxM_GEeK.js} +24 -4
- package/js/i18n/{bn.D5TmwFpa.js → bn.CKeY4G7p.js} +24 -4
- package/js/i18n/{ca.BjwMAKvc.js → ca.BKTY9yUg.js} +24 -4
- package/js/i18n/{ceb.DVKMwSKX.js → ceb.JLohZjii.js} +24 -4
- package/js/i18n/{cs.D5cCPRuY.js → cs.BA2Vep8y.js} +24 -4
- package/js/i18n/{da.BuJNuhnR.js → da.B9agaK9h.js} +24 -4
- package/js/i18n/{de.rKIf4fAw.js → de.vUPfn2Oo.js} +24 -4
- package/js/i18n/{el.Bn--4b86.js → el.CZhNQ18R.js} +24 -4
- package/js/i18n/{en.D6Xcuaob.js → en.B9cSV95A.js} +24 -4
- package/js/i18n/{en_GB.uaf19-ht.js → en_GB.DjNAh_2o.js} +24 -4
- package/js/i18n/{es.Bh_iETUQ.js → es.Ch5DzQZa.js} +24 -4
- package/js/i18n/{es_MX.D2NQorYq.js → es_MX.DmW4rnyT.js} +24 -4
- package/js/i18n/{et.D2Q9r-3y.js → et.F6IvljwK.js} +24 -4
- package/js/i18n/{fi.CNjEK5fc.js → fi.CUS8RexX.js} +24 -4
- package/js/i18n/{fil.CLDV-3cS.js → fil.Z-e4hm0l.js} +24 -4
- package/js/i18n/{fr.CA8X8em9.js → fr.DwdzaTwF.js} +24 -4
- package/js/i18n/{fr_CA.CXGgnoAY.js → fr_CA.Bq8FNlJo.js} +24 -4
- package/js/i18n/{ga.C1hmAiav.js → ga.DBpKAZUR.js} +24 -4
- package/js/i18n/{he.-XKz2lD2.js → he.DMmA1ZqA.js} +24 -4
- package/js/i18n/{hi.C0KBwhQk.js → hi.Cy8wi17L.js} +24 -4
- package/js/i18n/{hr.uxoIGptt.js → hr.BZ6ug-jc.js} +24 -4
- package/js/i18n/{hu.BWv0c70l.js → hu.o-xDRGsO.js} +24 -4
- package/js/i18n/{hy.BXjLEn-o.js → hy.D32BUH4n.js} +24 -4
- package/js/i18n/{id.CAU6yYSa.js → id.C-UnIn3z.js} +24 -4
- package/js/i18n/{is.Dy4_ecmW.js → is.eMAflTw8.js} +24 -4
- package/js/i18n/{it.B3KUcD4q.js → it.CIBQ3ml4.js} +24 -4
- package/js/i18n/{ja.CaZYxC9B.js → ja.Bin9p7ZD.js} +24 -4
- package/js/i18n/{jv.CR72tAaT.js → jv.DSROGovC.js} +24 -4
- package/js/i18n/{ka_GE.Cr-1NYDP.js → ka_GE.CaM7IMJX.js} +24 -4
- package/js/i18n/{kk.Ca7tjmtN.js → kk.DcskzbbK.js} +24 -4
- package/js/i18n/{km_KH.5bzfX4fH.js → km_KH.DRNO5fkq.js} +24 -4
- package/js/i18n/{ko.BR7WjEVs.js → ko.DKRNCmSz.js} +24 -4
- package/js/i18n/{lt.DLxW84xt.js → lt.bPIia0iM.js} +24 -4
- package/js/i18n/{lv.CtzfObfK.js → lv.DIlk3g7N.js} +24 -4
- package/js/i18n/{ms.Bp0STOr5.js → ms.DEJX56Wa.js} +24 -4
- package/js/i18n/{my.-ro5sNON.js → my.DQY-gdZl.js} +24 -4
- package/js/i18n/{nl.D0LLWo_Y.js → nl.DqBWUrWI.js} +24 -4
- package/js/i18n/{no.BYKxbI4x.js → no.DIknVO0F.js} +24 -4
- package/js/i18n/{pl.DgKQ2UVD.js → pl.uacFwjGK.js} +24 -4
- package/js/i18n/{pt.BTA2Pv7x.js → pt.DnHAjNgx.js} +24 -4
- package/js/i18n/{pt_BR.BRF7M-ts.js → pt_BR.BzDKzZSl.js} +24 -4
- package/js/i18n/{ro.BPwxxMAK.js → ro.C_ugDPjB.js} +24 -4
- package/js/i18n/{ru.wspWsIPg.js → ru.CbHdcVyw.js} +24 -4
- package/js/i18n/{sk.CXAGCXtS.js → sk.DPjBeKJf.js} +24 -4
- package/js/i18n/{sl.DW87OtC8.js → sl.CXVM3eQd.js} +24 -4
- package/js/i18n/{sq.6JBP37Rr.js → sq.BwOb4h9N.js} +24 -4
- package/js/i18n/{sr_Cyrl.02dFN3jq.js → sr_Cyrl.BO2hYmw9.js} +24 -4
- package/js/i18n/{sr_Latn.BTAmz9Gv.js → sr_Latn.iMeB6lsy.js} +24 -4
- package/js/i18n/{sv.S9SZiw5h.js → sv.BElOZUsc.js} +24 -4
- package/js/i18n/{sw.VnsOTYda.js → sw.CzFrkmbC.js} +24 -4
- package/js/i18n/{th.BtdkMYDs.js → th.B8CnAYHf.js} +24 -4
- package/js/i18n/{tr.Bn9WaSgB.js → tr.CZbsef6a.js} +24 -4
- package/js/i18n/{uk.BWteiLoJ.js → uk.Di9VzU09.js} +24 -4
- package/js/i18n/{ur.Bvf95gqk.js → ur.F2L7rh71.js} +24 -4
- package/js/i18n/{uz.D8_cEsZg.js → uz.s6qLauh_.js} +25 -5
- package/js/i18n/{vi.BMi-BwuI.js → vi.vMJPCM9t.js} +24 -4
- package/js/i18n/{zh_CN.Dipv9Pqc.js → zh_CN.ConQ8v4P.js} +24 -4
- package/js/i18n/{zh_HK.DkyVCxyR.js → zh_HK.Ba4wmp5J.js} +24 -4
- package/js/logging/datadog.DrMNEV3y.js +10147 -0
- package/js/{loader.BMK4_g6C.js → pages/data.DhS_CSrV.js} +80 -3
- package/js/pages/document.CQ_B9GTj.js +1522 -0
- package/js/pages/facemap.C8DMARoY.js +3060 -0
- package/js/pages/id.CPQIHmLw.js +9485 -0
- package/js/pdfjs/{pdf-U_mH0bJO.js → pdf.U_mH0bJO.js} +1 -1
- package/js/pdfjs/{pdf.worker.min-DFxVranA.js → pdf.worker.DFxVranA.js} +1 -1
- package/js/runtime.BjZbWNSZ.js +47296 -0
- package/package.json +4 -4
- package/third-party-licenses.txt +0 -3546
- package/index2.js +0 -906
- package/js/BRAZILIAN_ID.BxztzOl2.js +0 -5
- package/js/assets_da_web_id_1_1_6.tar.B0wlC5WP.js +0 -5
- package/js/assets_da_web_liveness_1_1_6.tar.BMW6psZZ.js +0 -5
- package/js/dac.DkgyVAg0.js +0 -5
- package/js/dac_simd.CUDgtSoV.js +0 -5
- package/js/dd/datadogProfiler-5-Pwxhm7.js +0 -408
- package/js/dd/datadogRecorder-CexR-8pQ.js +0 -1218
- package/js/index.D9DhPHsY.js +0 -67358
package/js/dac.DkgyVAg0.js
DELETED
package/js/dac_simd.CUDgtSoV.js
DELETED
|
@@ -1,408 +0,0 @@
|
|
|
1
|
-
import { j as H, o as re, c as le, a as ce, b as de, g as ue, D as pe, d as fe, e as me, f as R, L as _, R as j, h as ve, i as I, S as V, V as w, k as z, l as _e, m as T, s as Y, n as be, p as F, q as b, r as B, t as x, u as ye, v as Ee, w as C, x as L, y as he, z as Te, A as Ie } from "../index.D9DhPHsY.js";
|
|
2
|
-
function ke(s, t, e, n) {
|
|
3
|
-
const l = (d) => {
|
|
4
|
-
t.notify(14, { error: d }), de("Error reported to customer", { "error.message": d.message });
|
|
5
|
-
}, c = le([ce(s, "profile")], l), a = e(n);
|
|
6
|
-
return { async send({ event: d, ...m }) {
|
|
7
|
-
const u = new FormData(), p = H(d);
|
|
8
|
-
if (!p) throw new Error("Failed to serialize event");
|
|
9
|
-
u.append("event", new Blob([p], { type: "application/json" }), "event.json");
|
|
10
|
-
let k = p.length;
|
|
11
|
-
for (const [g, o] of re(m)) {
|
|
12
|
-
const y = H(o);
|
|
13
|
-
if (!y) throw new Error("Failed to serialize attachment");
|
|
14
|
-
const E = await ge(a, y);
|
|
15
|
-
k += E.outputBytesCount, u.append(g, new Blob([E.output]), g);
|
|
16
|
-
}
|
|
17
|
-
c.send({
|
|
18
|
-
data: u,
|
|
19
|
-
bytesCount: k
|
|
20
|
-
});
|
|
21
|
-
} };
|
|
22
|
-
}
|
|
23
|
-
function ge(s, t) {
|
|
24
|
-
return new Promise((e) => {
|
|
25
|
-
s.write(t), s.finish((n) => {
|
|
26
|
-
e(n);
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function De() {
|
|
31
|
-
const s = ue();
|
|
32
|
-
return (t) => {
|
|
33
|
-
s.send("profile", t);
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function Ae(s, t, e) {
|
|
37
|
-
const n = ke(s, t, e, pe.PROFILING);
|
|
38
|
-
return ({ profile: l, trace: c }) => {
|
|
39
|
-
const a = {
|
|
40
|
-
event: l,
|
|
41
|
-
"wall-time.json": c
|
|
42
|
-
};
|
|
43
|
-
n.send(a);
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
const Se = /\/(?![vV]\d{1,2}\/)([^/\d?]*\d+[^/?]*)/g;
|
|
47
|
-
function Oe(s) {
|
|
48
|
-
return s ? s.replace(Se, "/?") : "/";
|
|
49
|
-
}
|
|
50
|
-
const G = (s, t) => s || Oe(t);
|
|
51
|
-
function Ne(s, t, e) {
|
|
52
|
-
const n = fe(t), l = Pe(s, t.applicationId, e), c = Re(n);
|
|
53
|
-
return {
|
|
54
|
-
...l,
|
|
55
|
-
attachments: ["wall-time.json"],
|
|
56
|
-
start: new Date(s.startClocks.timeStamp).toISOString(),
|
|
57
|
-
end: new Date(s.endClocks.timeStamp).toISOString(),
|
|
58
|
-
family: "chrome",
|
|
59
|
-
runtime: "chrome",
|
|
60
|
-
format: "json",
|
|
61
|
-
version: 4,
|
|
62
|
-
tags_profiler: c.join(","),
|
|
63
|
-
_dd: { clock_drift: me() }
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function Pe(s, t, e) {
|
|
67
|
-
const { ids: n, names: l } = we(s.views), c = s.longTasks.map((p) => p.id).filter((p) => p !== void 0), a = s.actions?.map((p) => p.id).filter((p) => p !== void 0) ?? [], { ids: d, labels: m } = Le(s.vitals), u = { application: { id: t } };
|
|
68
|
-
return e && (u.session = { id: e }), n.length && (u.view = {
|
|
69
|
-
id: n,
|
|
70
|
-
name: l
|
|
71
|
-
}), c.length && (u.long_task = { id: c }), a.length && (u.action = {
|
|
72
|
-
id: a,
|
|
73
|
-
label: []
|
|
74
|
-
}), d.length && (u.vital = {
|
|
75
|
-
id: d,
|
|
76
|
-
label: m
|
|
77
|
-
}), u;
|
|
78
|
-
}
|
|
79
|
-
function we(s) {
|
|
80
|
-
const t = {
|
|
81
|
-
ids: [],
|
|
82
|
-
names: []
|
|
83
|
-
};
|
|
84
|
-
for (const e of s)
|
|
85
|
-
t.ids.push(e.viewId), e.viewName && t.names.push(e.viewName);
|
|
86
|
-
return t.names = Array.from(new Set(t.names)), t;
|
|
87
|
-
}
|
|
88
|
-
function Le(s) {
|
|
89
|
-
const t = {
|
|
90
|
-
ids: [],
|
|
91
|
-
labels: []
|
|
92
|
-
};
|
|
93
|
-
if (!s) return t;
|
|
94
|
-
for (const e of s)
|
|
95
|
-
t.ids.push(e.id), t.labels.push(e.label);
|
|
96
|
-
return t.labels = Array.from(new Set(t.labels)), t;
|
|
97
|
-
}
|
|
98
|
-
function Re(s) {
|
|
99
|
-
return s.concat([
|
|
100
|
-
"language:javascript",
|
|
101
|
-
"runtime:chrome",
|
|
102
|
-
"family:chrome",
|
|
103
|
-
"host:browser"
|
|
104
|
-
]);
|
|
105
|
-
}
|
|
106
|
-
const Ve = V;
|
|
107
|
-
function Me(s) {
|
|
108
|
-
const t = R({ expireDelay: Ve });
|
|
109
|
-
return s.subscribe(_.RAW_RUM_EVENT_COLLECTED, ({ rawRumEvent: e, startClocks: n, duration: l }) => {
|
|
110
|
-
e.type === "long_task" && t.add({
|
|
111
|
-
id: e.long_task.id,
|
|
112
|
-
startClocks: n,
|
|
113
|
-
duration: l,
|
|
114
|
-
entryType: e.long_task.entry_type === ve.LONG_TASK ? j.LONG_TASK : j.LONG_ANIMATION_FRAME
|
|
115
|
-
}, n.relative).close(I(n.relative, l));
|
|
116
|
-
}), t;
|
|
117
|
-
}
|
|
118
|
-
const Ue = V;
|
|
119
|
-
function qe(s) {
|
|
120
|
-
const t = R({ expireDelay: Ue });
|
|
121
|
-
return s.subscribe(_.ACTION_STARTED, (e) => {
|
|
122
|
-
t.add({
|
|
123
|
-
id: e.id,
|
|
124
|
-
label: "",
|
|
125
|
-
startClocks: e.startClocks,
|
|
126
|
-
duration: void 0
|
|
127
|
-
}, e.startClocks.relative);
|
|
128
|
-
}), s.subscribe(_.RAW_RUM_EVENT_COLLECTED, ({ rawRumEvent: e, startClocks: n, duration: l }) => {
|
|
129
|
-
if (e.type === "action") {
|
|
130
|
-
const c = t.getEntries(n.relative).find((d) => d.value.id === e.action.id), a = l ?? 0;
|
|
131
|
-
c ? (c.value.duration = a, c.close(I(n.relative, a))) : t.add({
|
|
132
|
-
id: e.action.id,
|
|
133
|
-
label: "",
|
|
134
|
-
startClocks: n,
|
|
135
|
-
duration: l
|
|
136
|
-
}, n.relative).close(I(n.relative, a));
|
|
137
|
-
}
|
|
138
|
-
}), t;
|
|
139
|
-
}
|
|
140
|
-
const He = V;
|
|
141
|
-
function je(s) {
|
|
142
|
-
const t = R({ expireDelay: He });
|
|
143
|
-
return s.subscribe(_.DURATION_VITAL_STARTED, (e) => {
|
|
144
|
-
t.add({
|
|
145
|
-
id: e.id,
|
|
146
|
-
type: w.DURATION,
|
|
147
|
-
startClocks: e.startClocks,
|
|
148
|
-
duration: void 0,
|
|
149
|
-
label: e.name
|
|
150
|
-
}, e.startClocks.relative);
|
|
151
|
-
}), s.subscribe(_.RAW_RUM_EVENT_COLLECTED, ({ rawRumEvent: e, startClocks: n, duration: l }) => {
|
|
152
|
-
if (e.type !== "vital") return;
|
|
153
|
-
if (e.vital.type === w.OPERATION_STEP) {
|
|
154
|
-
if (e.vital.step_type === "start") t.add({
|
|
155
|
-
id: e.vital.id,
|
|
156
|
-
type: e.vital.type,
|
|
157
|
-
operationKey: e.vital.operation_key,
|
|
158
|
-
startClocks: n,
|
|
159
|
-
label: e.vital.name
|
|
160
|
-
}, n.relative);
|
|
161
|
-
else if (e.vital.step_type === "end") {
|
|
162
|
-
const a = t.findAllEntries().find((d) => d.value.type === w.OPERATION_STEP && d.value.label === e.vital.name && d.value.operationKey === e.vital.operation_key);
|
|
163
|
-
if (!a) return;
|
|
164
|
-
a.value.duration = z(a.value.startClocks.relative, n.relative), a.close(n.relative);
|
|
165
|
-
}
|
|
166
|
-
return;
|
|
167
|
-
}
|
|
168
|
-
const c = t.getEntries(n.relative).find((a) => a.value.id === e.vital.id);
|
|
169
|
-
if (c) {
|
|
170
|
-
c.value.duration = l, c.close(I(n.relative, l));
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
t.add({
|
|
174
|
-
id: e.vital.id,
|
|
175
|
-
type: e.vital.type,
|
|
176
|
-
operationKey: e.vital.operation_key,
|
|
177
|
-
startClocks: n,
|
|
178
|
-
duration: l,
|
|
179
|
-
label: e.vital.name
|
|
180
|
-
}, n.relative).close(I(n.relative, l));
|
|
181
|
-
}), t;
|
|
182
|
-
}
|
|
183
|
-
function Fe(s, t) {
|
|
184
|
-
const e = s?.data?.attributes;
|
|
185
|
-
if (!e || typeof e.admitted != "boolean" || typeof e.reason != "string") return t;
|
|
186
|
-
const n = e.reason === "backend_client_not_initialized" ? "backend_unavailable" : e.reason;
|
|
187
|
-
return {
|
|
188
|
-
decision: e.admitted ? "quota_ok" : "quota_ko",
|
|
189
|
-
reason: n
|
|
190
|
-
};
|
|
191
|
-
}
|
|
192
|
-
function Be(s, t) {
|
|
193
|
-
return be({
|
|
194
|
-
proxy: s.proxy,
|
|
195
|
-
site: s.site,
|
|
196
|
-
path: "/api/v2/profiling/quota",
|
|
197
|
-
parameters: `session_id=${t}`,
|
|
198
|
-
subdomain: "quota"
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
function xe(s, t, e = 5e3) {
|
|
202
|
-
const n = Be(s, t), l = new AbortController();
|
|
203
|
-
let c;
|
|
204
|
-
const a = _e(n, {
|
|
205
|
-
credentials: "omit",
|
|
206
|
-
signal: l.signal,
|
|
207
|
-
headers: new Headers({ "DD-CLIENT-TOKEN": s.clientToken })
|
|
208
|
-
}).then((m) => {
|
|
209
|
-
const u = m.status === 429 ? {
|
|
210
|
-
decision: "quota_ko",
|
|
211
|
-
reason: "quota_exceeded"
|
|
212
|
-
} : {
|
|
213
|
-
decision: "quota_ok",
|
|
214
|
-
reason: "api-error"
|
|
215
|
-
};
|
|
216
|
-
return m.json().then((p) => (T(c), Fe(p, u)), () => (T(c), u));
|
|
217
|
-
}).catch(() => (T(c), {
|
|
218
|
-
decision: "quota_ok",
|
|
219
|
-
reason: "api-error"
|
|
220
|
-
})), d = new Promise((m) => {
|
|
221
|
-
c = Y(() => {
|
|
222
|
-
l.abort(), m({
|
|
223
|
-
decision: "quota_ok",
|
|
224
|
-
reason: "timeout"
|
|
225
|
-
});
|
|
226
|
-
}, e);
|
|
227
|
-
});
|
|
228
|
-
return Promise.race([a, d]);
|
|
229
|
-
}
|
|
230
|
-
const Ce = {
|
|
231
|
-
sampleIntervalMs: 10,
|
|
232
|
-
collectIntervalMs: 6e4,
|
|
233
|
-
minProfileDurationMs: 5e3
|
|
234
|
-
};
|
|
235
|
-
function ze(s, t, e, n, l, c, a = Ce) {
|
|
236
|
-
const d = F() ? b(De)() : b(Ae)(s, t, l);
|
|
237
|
-
let m;
|
|
238
|
-
const u = [], p = b(Me)(t), k = b(qe)(t), g = b(je)(t);
|
|
239
|
-
let o = {
|
|
240
|
-
state: "stopped",
|
|
241
|
-
stateReason: "initializing"
|
|
242
|
-
}, y = 0;
|
|
243
|
-
t.subscribe(_.SESSION_EXPIRED, () => {
|
|
244
|
-
O("session-expired");
|
|
245
|
-
}), t.subscribe(_.SESSION_RENEWED, () => {
|
|
246
|
-
if (o.state === "stopped" && (o.stateReason === "session-expired" || o.stateReason === "quota_ko")) {
|
|
247
|
-
const i = e.findTrackedSession();
|
|
248
|
-
if (!i || !he(i.id, Te(s.sessionSampleRate, s.profilingSampleRate))) return;
|
|
249
|
-
E();
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
function E() {
|
|
253
|
-
if (o.state === "running") return;
|
|
254
|
-
const i = c.findView();
|
|
255
|
-
m = i ? {
|
|
256
|
-
startClocks: i.startClocks,
|
|
257
|
-
viewId: i.id,
|
|
258
|
-
viewName: G(i.name, document.location.pathname)
|
|
259
|
-
} : void 0, u.push(B(window, x.VISIBILITY_CHANGE, Z).stop, B(window, x.BEFORE_UNLOAD, ee).stop), h(), K();
|
|
260
|
-
}
|
|
261
|
-
function K() {
|
|
262
|
-
if (F()) return;
|
|
263
|
-
const i = ++y, r = e.findTrackedSession()?.id;
|
|
264
|
-
r && b(xe)(s, r).then((f) => {
|
|
265
|
-
i === y && (o.state !== "running" && o.state !== "paused" || f.decision === "quota_ko" && O("quota_ko", f.reason));
|
|
266
|
-
}).catch(L);
|
|
267
|
-
}
|
|
268
|
-
function W() {
|
|
269
|
-
O("stopped-by-user");
|
|
270
|
-
}
|
|
271
|
-
function O(i, r) {
|
|
272
|
-
X(i), u.forEach((f) => f()), u.length = 0, n.set({
|
|
273
|
-
status: "stopped",
|
|
274
|
-
error_reason: void 0,
|
|
275
|
-
quota_reason: r
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
function Q(i) {
|
|
279
|
-
if (i.state === "running") return { cleanupTasks: i.cleanupTasks };
|
|
280
|
-
const r = [], f = t.subscribe(_.VIEW_CREATED, (v) => {
|
|
281
|
-
const D = {
|
|
282
|
-
viewId: v.id,
|
|
283
|
-
viewName: G(v.name, document.location.pathname),
|
|
284
|
-
startClocks: v.startClocks
|
|
285
|
-
};
|
|
286
|
-
M(D), m = D;
|
|
287
|
-
});
|
|
288
|
-
return r.push(f.unsubscribe), { cleanupTasks: r };
|
|
289
|
-
}
|
|
290
|
-
function h() {
|
|
291
|
-
const i = ye.Profiler;
|
|
292
|
-
if (!i)
|
|
293
|
-
throw n.set({
|
|
294
|
-
status: "error",
|
|
295
|
-
error_reason: "not-supported-by-browser"
|
|
296
|
-
}), new Error("RUM Profiler is not supported in this browser.");
|
|
297
|
-
o.state === "running" && N(o);
|
|
298
|
-
const { cleanupTasks: r } = Q(o);
|
|
299
|
-
let f;
|
|
300
|
-
try {
|
|
301
|
-
f = new i({
|
|
302
|
-
sampleInterval: a.sampleIntervalMs,
|
|
303
|
-
maxBufferSize: Math.round(a.collectIntervalMs * 1.5 / a.sampleIntervalMs)
|
|
304
|
-
});
|
|
305
|
-
} catch (v) {
|
|
306
|
-
v instanceof Error && v.message.includes("disabled by Document Policy") ? (Ee.warn("[DD_RUM] Profiler startup failed. Ensure your server includes the `Document-Policy: js-profiling` response header when serving HTML pages.", v), n.set({
|
|
307
|
-
status: "error",
|
|
308
|
-
error_reason: "missing-document-policy-header"
|
|
309
|
-
})) : n.set({
|
|
310
|
-
status: "error",
|
|
311
|
-
error_reason: "unexpected-exception"
|
|
312
|
-
});
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
n.set({
|
|
316
|
-
status: "running",
|
|
317
|
-
error_reason: void 0
|
|
318
|
-
}), o = {
|
|
319
|
-
state: "running",
|
|
320
|
-
startClocks: C(),
|
|
321
|
-
profiler: f,
|
|
322
|
-
timeoutId: Y(h, a.collectIntervalMs),
|
|
323
|
-
views: [],
|
|
324
|
-
cleanupTasks: r,
|
|
325
|
-
longTasks: [],
|
|
326
|
-
sessionId: e.findTrackedSession()?.id
|
|
327
|
-
}, M(m), f.addEventListener("samplebufferfull", P);
|
|
328
|
-
}
|
|
329
|
-
function N(i) {
|
|
330
|
-
T(i.timeoutId), i.profiler.removeEventListener("samplebufferfull", P);
|
|
331
|
-
const { startClocks: r, views: f, sessionId: v } = i;
|
|
332
|
-
i.profiler.stop().then((D) => {
|
|
333
|
-
const U = C(), A = z(r.relative, U.relative), q = p.findAll(r.relative, A), ie = k.findAll(r.relative, A), oe = g.findAll(r.relative, A).map((S) => ({
|
|
334
|
-
id: S.id,
|
|
335
|
-
label: S.label,
|
|
336
|
-
startClocks: S.startClocks,
|
|
337
|
-
duration: S.duration
|
|
338
|
-
})), ae = A < a.minProfileDurationMs;
|
|
339
|
-
q.length === 0 && ae || J(Object.assign({}, D, {
|
|
340
|
-
startClocks: r,
|
|
341
|
-
endClocks: U,
|
|
342
|
-
clocksOrigin: Ie(),
|
|
343
|
-
longTasks: q,
|
|
344
|
-
actions: ie,
|
|
345
|
-
vitals: oe,
|
|
346
|
-
views: f,
|
|
347
|
-
sampleInterval: a.sampleIntervalMs
|
|
348
|
-
}), v);
|
|
349
|
-
}).catch(L);
|
|
350
|
-
}
|
|
351
|
-
function X(i) {
|
|
352
|
-
if (o.state !== "running") {
|
|
353
|
-
(o.state === "paused" || o.state === "stopped" && i === "stopped-by-user") && (o = {
|
|
354
|
-
state: "stopped",
|
|
355
|
-
stateReason: i
|
|
356
|
-
});
|
|
357
|
-
return;
|
|
358
|
-
}
|
|
359
|
-
const r = o;
|
|
360
|
-
o = {
|
|
361
|
-
state: "stopped",
|
|
362
|
-
stateReason: i
|
|
363
|
-
}, r.cleanupTasks.forEach((f) => f()), i === "quota_ko" ? (T(r.timeoutId), r.profiler.removeEventListener("samplebufferfull", P), r.profiler.stop().catch(L)) : N(r);
|
|
364
|
-
}
|
|
365
|
-
function $() {
|
|
366
|
-
if (o.state !== "running") return;
|
|
367
|
-
const i = o;
|
|
368
|
-
o = { state: "paused" }, i.cleanupTasks.forEach((r) => r()), N(i);
|
|
369
|
-
}
|
|
370
|
-
function M(i) {
|
|
371
|
-
o.state !== "running" || !i || o.views.push(i);
|
|
372
|
-
}
|
|
373
|
-
function J(i, r) {
|
|
374
|
-
d({
|
|
375
|
-
profile: Ne(i, s, r),
|
|
376
|
-
trace: i
|
|
377
|
-
});
|
|
378
|
-
}
|
|
379
|
-
function P() {
|
|
380
|
-
h();
|
|
381
|
-
}
|
|
382
|
-
function Z() {
|
|
383
|
-
document.visibilityState === "hidden" && o.state === "running" ? $() : document.visibilityState === "visible" && o.state === "paused" && h();
|
|
384
|
-
}
|
|
385
|
-
function ee() {
|
|
386
|
-
h();
|
|
387
|
-
}
|
|
388
|
-
function te() {
|
|
389
|
-
return o.state === "stopped";
|
|
390
|
-
}
|
|
391
|
-
function se() {
|
|
392
|
-
return o.state === "running";
|
|
393
|
-
}
|
|
394
|
-
function ne() {
|
|
395
|
-
return o.state === "paused";
|
|
396
|
-
}
|
|
397
|
-
return {
|
|
398
|
-
start: E,
|
|
399
|
-
stop: W,
|
|
400
|
-
isStopped: te,
|
|
401
|
-
isRunning: se,
|
|
402
|
-
isPaused: ne
|
|
403
|
-
};
|
|
404
|
-
}
|
|
405
|
-
export {
|
|
406
|
-
ze as createRumProfiler
|
|
407
|
-
};
|
|
408
|
-
//# sourceMappingURL=datadogProfiler-5-Pwxhm7.js.map
|