@jumio/websdk 0.3.8 → 0.3.10

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 (94) hide show
  1. package/README.md +10 -8
  2. package/assets/BRAZILIAN_ID.BychxTsM.webp +0 -0
  3. package/assets/BRAZILIAN_ID.COOwtpxb.js +5 -0
  4. package/assets/style.css +1 -388
  5. package/dd/profiler-DTWkT7Mn.js +235 -0
  6. package/dd/startRecording-DqW-BV0C.js +1494 -0
  7. package/{ar.6FvD271D.js → i18n/ar.ClpiOMp8.js} +18 -6
  8. package/{az.xV1CTm4w.js → i18n/az.Zjkmxx0W.js} +17 -5
  9. package/{bg.CCHtVJ8V.js → i18n/bg.TQ5gDhpN.js} +17 -5
  10. package/{bn.DDCfJGfy.js → i18n/bn.DqLfaDm8.js} +18 -6
  11. package/{ca.BmzzNtsu.js → i18n/ca.N1Ii2N6w.js} +17 -5
  12. package/{ceb.DP4PBOky.js → i18n/ceb.DGoxFAno.js} +17 -5
  13. package/{cs.CF_-gGCz.js → i18n/cs.B219Ze7G.js} +17 -5
  14. package/{da.BvNYfmLS.js → i18n/da.BmYd7JeC.js} +18 -6
  15. package/{de.ChoKs_Ih.js → i18n/de.4yYjZHjq.js} +17 -5
  16. package/{el.CmH9V0Yg.js → i18n/el.w7n6P_Tm.js} +17 -5
  17. package/{en._TYEyLHi.js → i18n/en.Ct44TlJ6.js} +15 -3
  18. package/{en_GB.0E4-hrRx.js → i18n/en_GB.DZfrkPbd.js} +15 -3
  19. package/{es.D__FE4D_.js → i18n/es.DcA3jLM9.js} +17 -5
  20. package/{es_MX.Db15FX9q.js → i18n/es_MX.ClqTjKZ-.js} +17 -5
  21. package/{et.Gn0z9Ivj.js → i18n/et.MMOd-uTo.js} +17 -5
  22. package/{fi.DzSyn__-.js → i18n/fi.CWbrDO4V.js} +17 -5
  23. package/{fil.DbXgzFds.js → i18n/fil.BJfPVW56.js} +17 -5
  24. package/{fr.Nad_Iv9w.js → i18n/fr.CjZ5cmiI.js} +17 -5
  25. package/{fr_CA.BqIhyqJg.js → i18n/fr_CA.CtHm7-qi.js} +19 -7
  26. package/{ga.DZftCvLf.js → i18n/ga.D6-1kfWr.js} +17 -5
  27. package/{he.D_Ot5G9X.js → i18n/he.Bi8juarT.js} +17 -5
  28. package/{hi.k1gL9P6R.js → i18n/hi.CFfDmSnf.js} +19 -7
  29. package/{hr.CFkMZjpr.js → i18n/hr.DZlUE7C8.js} +16 -4
  30. package/{hu.ChFZfAE3.js → i18n/hu.BpD-aMLX.js} +17 -5
  31. package/{hy.DNM9FTFD.js → i18n/hy.BaLqt_2N.js} +17 -5
  32. package/{id.CUwbO5IH.js → i18n/id.uRdF9gWF.js} +17 -5
  33. package/{is.hApbPYEY.js → i18n/is.BYQe-WHx.js} +17 -5
  34. package/{it.Bhegj4nF.js → i18n/it.CkU67L1U.js} +17 -5
  35. package/{ja.CJXtbCJw.js → i18n/ja.BH3qTT3H.js} +17 -5
  36. package/{jv.DQNROsUW.js → i18n/jv.B4fRWclO.js} +17 -5
  37. package/{ka_GE.DRQWZxDK.js → i18n/ka_GE.CTzSn9eo.js} +17 -5
  38. package/{kk.SmX8cO85.js → i18n/kk.C0siUu93.js} +17 -5
  39. package/{km_KH.tErSrUl8.js → i18n/km_KH.ZTbV01Qz.js} +17 -5
  40. package/{ko.BSuxjnwo.js → i18n/ko.Bb4J3kDH.js} +17 -5
  41. package/{lt.9xY-bF8b.js → i18n/lt.D3asVxYB.js} +16 -4
  42. package/{lv.KAJ3Th5c.js → i18n/lv.fkwne764.js} +17 -5
  43. package/{ms.B8ifUn3g.js → i18n/ms.DEHT6MDZ.js} +17 -5
  44. package/{my.46LpbgwX.js → i18n/my.CRVpYNLc.js} +17 -5
  45. package/{nl.jT_sFmTM.js → i18n/nl.DV_Z3712.js} +17 -5
  46. package/{no.C7sncEKD.js → i18n/no.C91-fx2t.js} +17 -5
  47. package/{pl.5XkGPjIZ.js → i18n/pl.deHkL4G-.js} +17 -5
  48. package/{pt.DgAAo08E.js → i18n/pt.D7DApQ_g.js} +17 -5
  49. package/{pt_BR.DEMIQWXD.js → i18n/pt_BR.DeWUm5I5.js} +17 -5
  50. package/{ro.O04ahCMK.js → i18n/ro.Bgy4hiF2.js} +17 -5
  51. package/{ru.58VavBFj.js → i18n/ru.Cn-5tOIR.js} +17 -5
  52. package/{sk.CKOgMaWx.js → i18n/sk.rlnyfpQR.js} +17 -5
  53. package/{sl.T6u4zQdv.js → i18n/sl.BHBnOa58.js} +21 -9
  54. package/{sq.DhxxMSD4.js → i18n/sq.qB--p25v.js} +17 -5
  55. package/{sr_Cyrl.ScPJhaK1.js → i18n/sr_Cyrl.CSBzkXjX.js} +16 -4
  56. package/{sr_Latn.ClgaYy2P.js → i18n/sr_Latn._nXdqCNI.js} +16 -4
  57. package/{sv.BqoHH9_Z.js → i18n/sv.exooz9wm.js} +17 -5
  58. package/{sw.ASoszWzl.js → i18n/sw.BrOra_jt.js} +16 -4
  59. package/{th.wQot4sEY.js → i18n/th.LZGAQSSx.js} +17 -5
  60. package/{tr.BgMiJg4a.js → i18n/tr.Dizt7E2M.js} +17 -5
  61. package/{uk.ODxwJ7HV.js → i18n/uk.xMYrw91N.js} +17 -5
  62. package/{ur.CE1x0LsE.js → i18n/ur.BmuWXUfh.js} +18 -6
  63. package/{uz.DBb8NWV6.js → i18n/uz.CzsxPnXQ.js} +21 -9
  64. package/{vi.DTsjGEnr.js → i18n/vi.B_KdJnMy.js} +17 -5
  65. package/{zh_CN.C898bOEl.js → i18n/zh_CN.BBdQPt4L.js} +17 -5
  66. package/{zh_HK.Bi_0oROP.js → i18n/zh_HK.BRzNtOzu.js} +17 -5
  67. package/index.BloC8BH6.js +64242 -0
  68. package/index.d.ts +3599 -1043
  69. package/index.html +41 -13
  70. package/index.js +24 -822
  71. package/index2.js +869 -0
  72. package/ml/assets_da_web_1_1_6.tar.D1WfMJyS.gz +0 -0
  73. package/ml/assets_da_web_1_1_6.tar.DmSCvmf5.js +5 -0
  74. package/ml/dac.D2xph-5h.js +5 -0
  75. package/ml/dac.DeLxs2vM.wasm +0 -0
  76. package/ml/dac_simd.2xjZJ5dE.js +5 -0
  77. package/ml/dac_simd.BHe9yV3l.wasm +0 -0
  78. package/package.json +8 -4
  79. package/pdfjs/pdf-U_mH0bJO.js +17500 -0
  80. package/pdfjs/pdf.worker.min-DFxVranA.js +5 -0
  81. package/third-party-licenses.txt +1684 -8532
  82. package/BRAZILIAN_ID.BmZRIYzL.js +0 -5
  83. package/CHANGELOG.md +0 -106
  84. package/assets/fonts/jumio-sdk-icomoon.svg +0 -117
  85. package/assets/fonts/jumio-sdk-icomoon.ttf +0 -0
  86. package/assets/fonts/jumio-sdk-icomoon.woff +0 -0
  87. package/assets_da_web_1_1_6.tar.CCpLQ2oJ.js +0 -5
  88. package/dac.C1nISBeT.js +0 -5
  89. package/dac_simd.CQrYamf5.js +0 -5
  90. package/index.C0rkfp1G.js +0 -60487
  91. package/pdfjs/pdf-DDTuoCrJ.js +0 -17532
  92. package/pdfjs/pdf.worker.min-BJaB4MSa.js +0 -5
  93. package/profiler.B7SF_C2Q.js +0 -278
  94. package/startRecording.BFOwOm6d.js +0 -1227
@@ -0,0 +1,1494 @@
1
+ import { n as D, C as Z, p as Me, N as g, q as ve, r as X, t as Re, u as _e, v as L, w as Q, x as ee, P as te, y as ne, z as De, A as P, B as k, D as xe, E as V, F, G as y, k as oe, H as Ae, I as se, J as ie, K as re, L as O, M as w, O as I, e as Oe, Q as ze, R as C, S as _, T as Le, U as Pe, V as v, W as ke, X as Ve, Y as Fe, Z as U, _ as Ue, $ as He, a0 as Be, a1 as Ge, a2 as Ye, a3 as $e, i as Xe, s as We, a4 as qe, a5 as Je, a6 as Ke, c as je, a7 as Ze, a as Qe } from "../index.BloC8BH6.js";
2
+ const m = {
3
+ FullSnapshot: 2,
4
+ IncrementalSnapshot: 3,
5
+ Meta: 4,
6
+ Focus: 6,
7
+ ViewEnd: 7,
8
+ VisualViewport: 8,
9
+ FrustrationRecord: 9,
10
+ Change: 12
11
+ }, b = {
12
+ Document: 0,
13
+ DocumentType: 1,
14
+ Element: 2,
15
+ Text: 3,
16
+ CDATA: 4,
17
+ DocumentFragment: 11
18
+ }, h = {
19
+ AddString: 0,
20
+ AddNode: 1,
21
+ RemoveNode: 2,
22
+ Attribute: 3,
23
+ Text: 4,
24
+ Size: 5,
25
+ ScrollPosition: 6,
26
+ AddStyleSheet: 7,
27
+ AttachedStyleSheets: 8,
28
+ MediaPlaybackState: 9,
29
+ VisualViewport: 10
30
+ }, S = {
31
+ Mutation: 0,
32
+ MouseMove: 1,
33
+ MouseInteraction: 2,
34
+ Scroll: 3,
35
+ ViewportResize: 4,
36
+ Input: 5,
37
+ TouchMove: 6,
38
+ MediaInteraction: 7,
39
+ StyleSheetRule: 8
40
+ // CanvasMutation : 9,
41
+ // Font : 10,
42
+ }, N = {
43
+ MouseUp: 0,
44
+ MouseDown: 1,
45
+ Click: 2,
46
+ ContextMenu: 3,
47
+ DblClick: 4,
48
+ Focus: 5,
49
+ Blur: 6,
50
+ TouchStart: 7,
51
+ TouchEnd: 9
52
+ }, x = {
53
+ Play: 0,
54
+ Pause: 1
55
+ };
56
+ function et(e) {
57
+ return tt(void 0, void 0, e);
58
+ }
59
+ function tt(e, t, n) {
60
+ let o = {
61
+ container: void 0,
62
+ parentId: e,
63
+ previousSiblingId: void 0,
64
+ nextSiblingId: t
65
+ };
66
+ const s = (i) => o.previousSiblingId === i - 1 ? 0 : o.nextSiblingId !== void 0 ? o.nextSiblingId - i : o.parentId !== void 0 ? i - o.parentId : null;
67
+ return {
68
+ advance(i) {
69
+ const r = n.getOrInsert(i), a = s(r);
70
+ return o.previousSiblingId = r, { nodeId: r, insertionPoint: a };
71
+ },
72
+ ascend() {
73
+ o.container && (o = o.container);
74
+ },
75
+ descend() {
76
+ o.previousSiblingId !== void 0 && (o = {
77
+ container: o,
78
+ parentId: o.previousSiblingId,
79
+ previousSiblingId: void 0,
80
+ nextSiblingId: void 0
81
+ });
82
+ }
83
+ };
84
+ }
85
+ function H(e, t) {
86
+ const n = e.tagName, o = e.value;
87
+ if (D(e, t)) {
88
+ const s = e.type;
89
+ return n === "INPUT" && (s === "button" || s === "submit" || s === "reset") ? o : !o || n === "OPTION" ? void 0 : Z;
90
+ }
91
+ if (n === "OPTION" || n === "SELECT")
92
+ return e.value;
93
+ if (!(n !== "INPUT" && n !== "TEXTAREA"))
94
+ return o;
95
+ }
96
+ const nt = /url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm, ot = /^[A-Za-z]+:|^\/\//, st = /^["']?data:.*,/i;
97
+ function it(e, t) {
98
+ return e.replace(nt, (n, o, s, i, r, a) => {
99
+ const u = s || r || a;
100
+ if (!t || !u || ot.test(u) || st.test(u))
101
+ return n;
102
+ const c = o || i || "";
103
+ return `url(${c}${rt(u, t)}${c})`;
104
+ });
105
+ }
106
+ function rt(e, t) {
107
+ try {
108
+ return Me(e, t).href;
109
+ } catch {
110
+ return e;
111
+ }
112
+ }
113
+ const at = /[^a-z1-6-_]/;
114
+ function ut(e) {
115
+ const t = e.toLowerCase().trim();
116
+ return at.test(t) ? "div" : t;
117
+ }
118
+ function ae(e) {
119
+ return e.tagName.toLowerCase();
120
+ }
121
+ function W(e, t) {
122
+ return `data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${e}' height='${t}' style='background-color:silver'%3E%3C/svg%3E`;
123
+ }
124
+ function ue(e, t) {
125
+ if (e === void 0 || e.length === 0)
126
+ return;
127
+ const n = (s) => {
128
+ const i = s.cssRules || s.rules, r = Array.from(i, (u) => u.cssText);
129
+ return t.addMetric("cssText", r.reduce((u, c) => u + c.length, 0)), {
130
+ cssRules: r,
131
+ disabled: s.disabled || void 0,
132
+ media: s.media.length > 0 ? Array.from(s.media) : void 0
133
+ };
134
+ }, o = [];
135
+ for (let s = 0; s < e.length; s++)
136
+ o.push(n(e[s]));
137
+ return o;
138
+ }
139
+ const ct = 1e6;
140
+ function ce(e, t, n, o) {
141
+ if (t === g.HIDDEN)
142
+ return null;
143
+ const s = e.getAttribute(n), i = e.tagName;
144
+ if (ve(i, n, s, t, o)) {
145
+ if (i === "IMG") {
146
+ const r = e;
147
+ if (r.naturalWidth > 0)
148
+ return W(r.naturalWidth, r.naturalHeight);
149
+ const { width: a, height: u } = e.getBoundingClientRect();
150
+ return a > 0 || u > 0 ? W(a, u) : X;
151
+ }
152
+ return i === "SOURCE" ? X : Z;
153
+ }
154
+ return s && Re(s, ct);
155
+ }
156
+ function dt(e, t, n) {
157
+ return {
158
+ ...de(e, t, n),
159
+ ...le(e, t, n)
160
+ };
161
+ }
162
+ function de(e, t, n) {
163
+ if (t === g.HIDDEN)
164
+ return {};
165
+ const o = {}, s = ae(e);
166
+ for (let r = 0; r < e.attributes.length; r += 1) {
167
+ const u = e.attributes.item(r).name, c = ce(e, t, u, n.scope.configuration);
168
+ c !== null && (o[u] = c);
169
+ }
170
+ if (e.value && (s === "textarea" || s === "select" || s === "option" || s === "input")) {
171
+ const r = H(e, t);
172
+ r !== void 0 && (o.value = r);
173
+ }
174
+ if (s === "option") {
175
+ const r = e;
176
+ r.selected && !D(r, t) ? o.selected = "" : delete o.selected;
177
+ }
178
+ const i = e;
179
+ return s === "input" && (i.type === "radio" || i.type === "checkbox") && (i.checked && !D(i, t) ? o.checked = "" : delete o.checked), o;
180
+ }
181
+ function le(e, t, n) {
182
+ if (t === g.HIDDEN)
183
+ return {};
184
+ const o = {}, s = e.ownerDocument, i = ae(e);
185
+ if (i === "link") {
186
+ const u = Array.from(s.styleSheets).find((l) => l.href === e.href), c = z(u);
187
+ c && u && (n.addMetric("cssText", c.length), o._cssText = c);
188
+ }
189
+ if (i === "style" && e.sheet) {
190
+ const u = z(e.sheet);
191
+ u && (n.addMetric("cssText", u.length), o._cssText = u);
192
+ }
193
+ if (i === "audio" || i === "video") {
194
+ const u = e;
195
+ o.rr_mediaState = u.paused ? "paused" : "played";
196
+ }
197
+ let r, a;
198
+ switch (n.kind) {
199
+ case 0:
200
+ r = Math.round(e.scrollTop), a = Math.round(e.scrollLeft), (r || a) && n.scope.elementsScrollPositions.set(e, { scrollTop: r, scrollLeft: a });
201
+ break;
202
+ case 1:
203
+ n.scope.elementsScrollPositions.has(e) && ({ scrollTop: r, scrollLeft: a } = n.scope.elementsScrollPositions.get(e));
204
+ break;
205
+ }
206
+ return a && (o.rr_scrollLeft = a), r && (o.rr_scrollTop = r), o;
207
+ }
208
+ function z(e) {
209
+ if (!e)
210
+ return null;
211
+ let t;
212
+ try {
213
+ t = e.rules || e.cssRules;
214
+ } catch {
215
+ }
216
+ if (!t)
217
+ return null;
218
+ const n = Array.from(t, _e() ? lt : fe).join("");
219
+ return it(n, e.href);
220
+ }
221
+ function lt(e) {
222
+ if (pt(e) && e.selectorText.includes(":")) {
223
+ const t = /(\[[\w-]+[^\\])(:[^\]]+\])/g;
224
+ return e.cssText.replace(t, "$1\\$2");
225
+ }
226
+ return fe(e);
227
+ }
228
+ function fe(e) {
229
+ return ft(e) && z(e.styleSheet) || e.cssText;
230
+ }
231
+ function ft(e) {
232
+ return "styleSheet" in e;
233
+ }
234
+ function pt(e) {
235
+ return "selectorText" in e;
236
+ }
237
+ function B(e, t, n) {
238
+ switch (e.nodeType) {
239
+ case e.DOCUMENT_NODE:
240
+ return ht(e, t, n);
241
+ case e.DOCUMENT_FRAGMENT_NODE:
242
+ return gt(e, t, n);
243
+ case e.DOCUMENT_TYPE_NODE:
244
+ return St(e, n);
245
+ case e.ELEMENT_NODE:
246
+ return mt(e, t, n);
247
+ case e.TEXT_NODE:
248
+ return Nt(e, t, n);
249
+ case e.CDATA_SECTION_NODE:
250
+ return Tt(e, n);
251
+ default:
252
+ return null;
253
+ }
254
+ }
255
+ function G(e, t, n) {
256
+ const o = [];
257
+ return k(e, (s) => {
258
+ const i = B(s, t, n);
259
+ i && o.push(i);
260
+ }), o;
261
+ }
262
+ function ht(e, t, n) {
263
+ return {
264
+ type: b.Document,
265
+ id: n.assignId(e),
266
+ childNodes: G(e, t, n),
267
+ adoptedStyleSheets: ue(e.adoptedStyleSheets, n)
268
+ };
269
+ }
270
+ function gt(e, t, n) {
271
+ const o = P(e);
272
+ return o && n.scope.shadowRootsController.addShadowRoot(e, n.scope), {
273
+ type: b.DocumentFragment,
274
+ id: n.assignId(e),
275
+ childNodes: G(e, t, n),
276
+ isShadowRoot: o,
277
+ adoptedStyleSheets: o ? ue(e.adoptedStyleSheets, n) : void 0
278
+ };
279
+ }
280
+ function St(e, t) {
281
+ return {
282
+ type: b.DocumentType,
283
+ id: t.assignId(e),
284
+ name: e.name,
285
+ publicId: e.publicId,
286
+ systemId: e.systemId
287
+ };
288
+ }
289
+ function mt(e, t, n) {
290
+ const o = ut(e.tagName), s = Et(e) || void 0, i = Q(ee(e), t);
291
+ if (i === g.HIDDEN) {
292
+ const { width: c, height: l } = e.getBoundingClientRect();
293
+ return {
294
+ type: b.Element,
295
+ id: n.assignId(e),
296
+ tagName: o,
297
+ attributes: {
298
+ rr_width: `${c}px`,
299
+ rr_height: `${l}px`,
300
+ [ne]: te
301
+ },
302
+ childNodes: [],
303
+ isSVG: s
304
+ };
305
+ }
306
+ if (i === g.IGNORE)
307
+ return null;
308
+ const r = n.assignId(e), a = dt(e, i, n);
309
+ let u = [];
310
+ return De(e) && // Do not serialize style children as the css rules are already in the _cssText attribute
311
+ o !== "style" && (u = G(e, i, n)), {
312
+ type: b.Element,
313
+ id: r,
314
+ tagName: o,
315
+ attributes: a,
316
+ childNodes: u,
317
+ isSVG: s
318
+ };
319
+ }
320
+ function Et(e) {
321
+ return e.tagName === "svg" || e instanceof SVGElement;
322
+ }
323
+ function Nt(e, t, n) {
324
+ const o = L(e, t);
325
+ return o === void 0 ? null : {
326
+ type: b.Text,
327
+ id: n.assignId(e),
328
+ textContent: o
329
+ };
330
+ }
331
+ function Tt(e, t) {
332
+ return {
333
+ type: b.CDATA,
334
+ id: t.assignId(e),
335
+ textContent: ""
336
+ };
337
+ }
338
+ function yt(e, t) {
339
+ const n = t.scope.configuration.defaultPrivacyLevel;
340
+ return B(e, n, t);
341
+ }
342
+ function pe(e, t, n, o) {
343
+ let s;
344
+ const i = ee(t);
345
+ if (i ? s = Q(i, n) : s = n, s === g.HIDDEN) {
346
+ Rt(e, t, o);
347
+ return;
348
+ }
349
+ if (s !== g.IGNORE) {
350
+ switch (t.nodeType) {
351
+ case t.CDATA_SECTION_NODE:
352
+ vt(e, t, o);
353
+ break;
354
+ case t.DOCUMENT_NODE:
355
+ It(e, t, o);
356
+ break;
357
+ case t.DOCUMENT_FRAGMENT_NODE:
358
+ Ct(e, t, o);
359
+ break;
360
+ case t.DOCUMENT_TYPE_NODE:
361
+ bt(e, t, o);
362
+ break;
363
+ case t.ELEMENT_NODE:
364
+ wt(e, t, s, o);
365
+ break;
366
+ case t.TEXT_NODE:
367
+ Mt(e, t, s, o);
368
+ break;
369
+ default:
370
+ return;
371
+ }
372
+ switch (t.nodeType) {
373
+ case t.CDATA_SECTION_NODE:
374
+ case t.DOCUMENT_TYPE_NODE:
375
+ case t.TEXT_NODE:
376
+ return;
377
+ }
378
+ t.nodeName !== "STYLE" && (e.descend(), k(t, (r) => {
379
+ pe(e, r, s, o);
380
+ }), e.ascend());
381
+ }
382
+ }
383
+ function It(e, t, n) {
384
+ const { nodeId: o, insertionPoint: s } = e.advance(t);
385
+ n.addNode(s, "#document"), n.setScrollPosition(o, V(), F()), he(t.adoptedStyleSheets, o, n);
386
+ }
387
+ function Ct(e, t, n) {
388
+ const { nodeId: o, insertionPoint: s } = e.advance(t);
389
+ if (!P(t)) {
390
+ n.addNode(s, "#document-fragment");
391
+ return;
392
+ }
393
+ n.addNode(s, "#shadow-root"), n.scope.shadowRootsController.addShadowRoot(t, n.scope), he(t.adoptedStyleSheets, o, n);
394
+ }
395
+ function bt(e, t, n) {
396
+ const { insertionPoint: o } = e.advance(t);
397
+ n.addNode(o, "#doctype", t.name, t.publicId, t.systemId);
398
+ }
399
+ function wt(e, t, n, o) {
400
+ const { nodeId: s, insertionPoint: i } = e.advance(t), r = Object.entries(de(t, n, o));
401
+ o.addNode(i, ge(t), ...r);
402
+ const { _cssText: a, rr_mediaState: u, rr_scrollLeft: c, rr_scrollTop: l } = le(t, n, o), d = t;
403
+ if (a !== void 0 && d.sheet) {
404
+ const f = o.scope.styleSheetIds.getOrInsert(d.sheet);
405
+ o.addStyleSheet(a), o.attachStyleSheets(s, [f]);
406
+ }
407
+ u === "played" ? o.setMediaPlaybackState(s, x.Play) : u === "paused" && o.setMediaPlaybackState(s, x.Pause), (c !== void 0 || l !== void 0) && o.setScrollPosition(s, c || 0, l || 0);
408
+ }
409
+ function Mt(e, t, n, o) {
410
+ const s = L(t, n);
411
+ if (s === void 0)
412
+ return;
413
+ const { insertionPoint: i } = e.advance(t);
414
+ o.addNode(i, "#text", s);
415
+ }
416
+ function vt(e, t, n) {
417
+ const { insertionPoint: o } = e.advance(t);
418
+ n.addNode(o, "#cdata-section");
419
+ }
420
+ function Rt(e, t, n) {
421
+ if (!xe(t))
422
+ return;
423
+ const { nodeId: o, insertionPoint: s } = e.advance(t);
424
+ n.addNode(s, ge(t), [ne, te]);
425
+ const { width: i, height: r } = t.getBoundingClientRect();
426
+ n.setSize(o, i, r);
427
+ }
428
+ function he(e, t, n) {
429
+ !e || e.length === 0 || n.attachStyleSheets(t, e.map((o) => _t(o, n)));
430
+ }
431
+ function _t(e, t) {
432
+ const n = Array.from(e.cssRules || e.rules, (s) => s.cssText), o = e.media.length > 0 ? Array.from(e.media) : void 0;
433
+ return t.addMetric("cssText", n.reduce((s, i) => s + i.length, 0)), t.addStyleSheet(n, o, e.disabled), t.scope.styleSheetIds.getOrInsert(e);
434
+ }
435
+ function ge(e) {
436
+ const t = e.nodeName;
437
+ return Dt(e) ? `svg>${t}` : t;
438
+ }
439
+ function Dt(e) {
440
+ return e.namespaceURI === "http://www.w3.org/2000/svg";
441
+ }
442
+ function Y() {
443
+ return {
444
+ cssText: {
445
+ count: 0,
446
+ max: 0,
447
+ sum: 0
448
+ },
449
+ serializationDuration: {
450
+ count: 0,
451
+ max: 0,
452
+ sum: 0
453
+ }
454
+ };
455
+ }
456
+ function A(e, t, n) {
457
+ e[t].count += 1, e[t].max = Math.max(e[t].max, n), e[t].sum += n;
458
+ }
459
+ function xt(e, t) {
460
+ for (const n of ["cssText", "serializationDuration"])
461
+ e[n].count += t[n].count, e[n].max = Math.max(e[n].max, t[n].max), e[n].sum += t[n].sum;
462
+ }
463
+ function At(e) {
464
+ let t = {};
465
+ const n = (i) => {
466
+ for (let r = 0, a = i.length; r < a; r++) {
467
+ const u = i[r];
468
+ if (typeof u == "string") {
469
+ const c = e.size;
470
+ i[r] = e.getOrInsert(u), e.size > c && o(h.AddString, u);
471
+ } else Array.isArray(u) && n(u);
472
+ }
473
+ }, o = (i, r) => {
474
+ i in t || (t[i] = [i]), i !== h.AddString && Array.isArray(r) && n(r), t[i].push(r);
475
+ };
476
+ return { add: o, flush: () => {
477
+ const i = [];
478
+ return [
479
+ h.AddString,
480
+ h.AddNode,
481
+ h.RemoveNode,
482
+ h.Attribute,
483
+ h.Text,
484
+ h.Size,
485
+ h.ScrollPosition,
486
+ h.AddStyleSheet,
487
+ h.AttachedStyleSheets,
488
+ h.MediaPlaybackState,
489
+ h.VisualViewport
490
+ ].forEach((r) => {
491
+ const a = t[r];
492
+ a && i.push(a);
493
+ }), t = {}, i;
494
+ } };
495
+ }
496
+ function Se(e, t, n, o, s) {
497
+ const i = [], r = Y(), a = {
498
+ add(c) {
499
+ i.push(c);
500
+ },
501
+ addMetric(c, l) {
502
+ A(r, c, l);
503
+ },
504
+ assignId(c) {
505
+ const l = o.nodeIds.getOrInsert(c);
506
+ return a.serializedNodeIds && a.serializedNodeIds.add(l), l;
507
+ },
508
+ kind: e,
509
+ scope: o
510
+ }, u = y();
511
+ s(a), A(r, "serializationDuration", oe(u, y()));
512
+ for (const c of i)
513
+ t(c);
514
+ n(r);
515
+ }
516
+ function Ot(e, t, n, o, s, i) {
517
+ const r = At(o.stringIds), a = Y(), u = {
518
+ addMetric(d, f) {
519
+ A(a, d, f);
520
+ },
521
+ addNode(...d) {
522
+ r.add(h.AddNode, d);
523
+ },
524
+ addStyleSheet(d, f, p) {
525
+ p ? r.add(h.AddStyleSheet, [d, f || [], p]) : f ? r.add(h.AddStyleSheet, [d, f]) : r.add(h.AddStyleSheet, [d]);
526
+ },
527
+ attachStyleSheets(d, f) {
528
+ const p = [d];
529
+ for (const E of f)
530
+ p.push(E);
531
+ r.add(h.AttachedStyleSheets, p);
532
+ },
533
+ setMediaPlaybackState(d, f) {
534
+ r.add(h.MediaPlaybackState, [d, f]);
535
+ },
536
+ setScrollPosition(d, f, p) {
537
+ r.add(h.ScrollPosition, [d, f, p]);
538
+ },
539
+ setSize(d, f, p) {
540
+ r.add(h.Size, [d, f, p]);
541
+ },
542
+ kind: e,
543
+ scope: o
544
+ }, c = y();
545
+ i(u), A(a, "serializationDuration", oe(c, y()));
546
+ const l = r.flush();
547
+ l.length > 0 && t({
548
+ data: l,
549
+ type: m.Change,
550
+ timestamp: s
551
+ }), n(a);
552
+ }
553
+ const q = 25;
554
+ function zt(e) {
555
+ return Math.abs(e.pageTop - e.offsetTop - window.scrollY) > q || Math.abs(e.pageLeft - e.offsetLeft - window.scrollX) > q;
556
+ }
557
+ const Lt = (e, t) => {
558
+ const n = window.visualViewport, o = {
559
+ layoutViewportX: e,
560
+ layoutViewportY: t,
561
+ visualViewportX: e,
562
+ visualViewportY: t
563
+ };
564
+ if (n)
565
+ zt(n) ? (o.layoutViewportX = Math.round(e + n.offsetLeft), o.layoutViewportY = Math.round(t + n.offsetTop)) : (o.visualViewportX = Math.round(e - n.offsetLeft), o.visualViewportY = Math.round(t - n.offsetTop));
566
+ else return o;
567
+ return o;
568
+ }, me = (e) => ({
569
+ scale: e.scale,
570
+ offsetLeft: e.offsetLeft,
571
+ offsetTop: e.offsetTop,
572
+ pageLeft: e.pageLeft,
573
+ pageTop: e.pageTop,
574
+ height: e.height,
575
+ width: e.width
576
+ });
577
+ function Pt(e, t, n, o, s) {
578
+ J(y(), 0, t, n, s);
579
+ const { unsubscribe: i } = e.subscribe(2, (r) => {
580
+ o(), J(r.startClocks.timeStamp, 1, t, n, s);
581
+ });
582
+ return {
583
+ stop: i
584
+ };
585
+ }
586
+ function J(e, t, n, o, s) {
587
+ const { width: i, height: r } = Ae();
588
+ n({
589
+ data: {
590
+ height: r,
591
+ href: window.location.href,
592
+ width: i
593
+ },
594
+ type: m.Meta,
595
+ timestamp: e
596
+ }), n({
597
+ data: {
598
+ has_focus: document.hasFocus()
599
+ },
600
+ type: m.Focus,
601
+ timestamp: e
602
+ }), se(ie.USE_CHANGE_RECORDS) ? (t === 1 && s.resetIds(), Ot(t, n, o, s, e, (a) => {
603
+ pe(et(s.nodeIds), document, s.configuration.defaultPrivacyLevel, a);
604
+ })) : Se(t, n, o, s, (a) => {
605
+ a.add(kt(e, a));
606
+ }), window.visualViewport && n({
607
+ data: me(window.visualViewport),
608
+ type: m.VisualViewport,
609
+ timestamp: e
610
+ });
611
+ }
612
+ function kt(e, t) {
613
+ return {
614
+ data: {
615
+ node: yt(document, t),
616
+ initialOffset: {
617
+ left: V(),
618
+ top: F()
619
+ }
620
+ },
621
+ type: m.FullSnapshot,
622
+ timestamp: e
623
+ };
624
+ }
625
+ function Vt() {
626
+ return $(
627
+ 1
628
+ /* EventIdConstants.FIRST_ID */
629
+ );
630
+ }
631
+ function Ft() {
632
+ return $(
633
+ 0
634
+ /* NodeIdConstants.FIRST_ID */
635
+ );
636
+ }
637
+ function Ut() {
638
+ return Bt(
639
+ 0
640
+ /* StringIdConstants.FIRST_ID */
641
+ );
642
+ }
643
+ function Ht() {
644
+ return $(
645
+ 0
646
+ /* StyleSheetIdConstants.FIRST_ID */
647
+ );
648
+ }
649
+ function Bt(e) {
650
+ return Ee(() => /* @__PURE__ */ new Map(), e);
651
+ }
652
+ function $(e) {
653
+ return Ee(() => /* @__PURE__ */ new WeakMap(), e);
654
+ }
655
+ function Ee(e, t) {
656
+ let n = e(), o = t;
657
+ const s = (i) => n.get(i);
658
+ return {
659
+ clear() {
660
+ n = e(), o = t;
661
+ },
662
+ get: s,
663
+ getOrInsert(i) {
664
+ let r = s(i);
665
+ return r === void 0 && (r = o++, n.set(i, r)), r;
666
+ },
667
+ get size() {
668
+ return o - t;
669
+ }
670
+ };
671
+ }
672
+ function Gt(e, t, n) {
673
+ const o = Vt(), s = Ft(), i = Ut(), r = Ht();
674
+ return {
675
+ resetIds() {
676
+ o.clear(), s.clear(), i.clear(), r.clear();
677
+ },
678
+ configuration: e,
679
+ elementsScrollPositions: t,
680
+ eventIds: o,
681
+ nodeIds: s,
682
+ shadowRootsController: n,
683
+ stringIds: i,
684
+ styleSheetIds: r
685
+ };
686
+ }
687
+ function Yt() {
688
+ const e = /* @__PURE__ */ new WeakMap();
689
+ return {
690
+ set(t, n) {
691
+ t === document && !document.scrollingElement || e.set(t === document ? document.scrollingElement : t, n);
692
+ },
693
+ get(t) {
694
+ return e.get(t);
695
+ },
696
+ has(t) {
697
+ return e.has(t);
698
+ }
699
+ };
700
+ }
701
+ function Ne(e) {
702
+ return !!e.changedTouches;
703
+ }
704
+ function R(e) {
705
+ return e.composed === !0 && re(e.target) ? e.composedPath()[0] : e.target;
706
+ }
707
+ function T(e, t) {
708
+ return {
709
+ data: {
710
+ source: e,
711
+ ...t
712
+ },
713
+ type: m.IncrementalSnapshot,
714
+ timestamp: y()
715
+ };
716
+ }
717
+ const $t = 50;
718
+ function Xt(e, t) {
719
+ const { throttled: n, cancel: o } = O((i) => {
720
+ const r = R(i), a = t.nodeIds.get(r);
721
+ if (a === void 0)
722
+ return;
723
+ const u = Te(i);
724
+ if (!u)
725
+ return;
726
+ const c = {
727
+ id: a,
728
+ timeOffset: 0,
729
+ x: u.x,
730
+ y: u.y
731
+ };
732
+ e(T(Ne(i) ? S.TouchMove : S.MouseMove, { positions: [c] }));
733
+ }, $t, {
734
+ trailing: !1
735
+ }), { stop: s } = w(t.configuration, document, [
736
+ "mousemove",
737
+ "touchmove"
738
+ /* DOM_EVENT.TOUCH_MOVE */
739
+ ], n, {
740
+ capture: !0,
741
+ passive: !0
742
+ });
743
+ return {
744
+ stop: () => {
745
+ s(), o();
746
+ }
747
+ };
748
+ }
749
+ function Te(e) {
750
+ let { clientX: t, clientY: n } = Ne(e) ? e.changedTouches[0] : e;
751
+ if (window.visualViewport) {
752
+ const { visualViewportX: o, visualViewportY: s } = Lt(t, n);
753
+ t = o, n = s;
754
+ }
755
+ if (!(!Number.isFinite(t) || !Number.isFinite(n)))
756
+ return { x: t, y: n };
757
+ }
758
+ const K = {
759
+ // Listen for pointerup DOM events instead of mouseup for MouseInteraction/MouseUp records. This
760
+ // allows to reference such records from Frustration records.
761
+ //
762
+ // In the context of supporting Mobile Session Replay, we introduced `PointerInteraction` records
763
+ // used by the Mobile SDKs in place of `MouseInteraction`. In the future, we should replace
764
+ // `MouseInteraction` by `PointerInteraction` in the Browser SDK so we have an uniform way to
765
+ // convey such interaction. This would cleanly solve the issue since we would have
766
+ // `PointerInteraction/Up` records that we could reference from `Frustration` records.
767
+ pointerup: N.MouseUp,
768
+ mousedown: N.MouseDown,
769
+ click: N.Click,
770
+ contextmenu: N.ContextMenu,
771
+ dblclick: N.DblClick,
772
+ focus: N.Focus,
773
+ blur: N.Blur,
774
+ touchstart: N.TouchStart,
775
+ touchend: N.TouchEnd
776
+ };
777
+ function Wt(e, t) {
778
+ const n = (o) => {
779
+ const s = R(o), i = t.nodeIds.get(s);
780
+ if (i === void 0 || I(s, t.configuration.defaultPrivacyLevel) === g.HIDDEN)
781
+ return;
782
+ const r = K[o.type];
783
+ let a;
784
+ if (r !== N.Blur && r !== N.Focus) {
785
+ const u = Te(o);
786
+ if (!u)
787
+ return;
788
+ a = { id: i, type: r, x: u.x, y: u.y };
789
+ } else
790
+ a = { id: i, type: r };
791
+ e({
792
+ id: t.eventIds.getOrInsert(o),
793
+ ...T(S.MouseInteraction, a)
794
+ });
795
+ };
796
+ return w(t.configuration, document, Object.keys(K), n, {
797
+ capture: !0,
798
+ passive: !0
799
+ });
800
+ }
801
+ const qt = 100;
802
+ function ye(e, t, n) {
803
+ const { throttled: o, cancel: s } = O((r) => {
804
+ const a = R(r);
805
+ if (!a)
806
+ return;
807
+ const u = n.nodeIds.get(a);
808
+ if (u === void 0 || I(a, n.configuration.defaultPrivacyLevel) === g.HIDDEN)
809
+ return;
810
+ const c = a === document ? {
811
+ scrollTop: F(),
812
+ scrollLeft: V()
813
+ } : {
814
+ scrollTop: Math.round(a.scrollTop),
815
+ scrollLeft: Math.round(a.scrollLeft)
816
+ };
817
+ n.elementsScrollPositions.set(a, c), t(T(S.Scroll, {
818
+ id: u,
819
+ x: c.scrollLeft,
820
+ y: c.scrollTop
821
+ }));
822
+ }, qt), { stop: i } = Oe(n.configuration, e, "scroll", o, {
823
+ capture: !0,
824
+ passive: !0
825
+ });
826
+ return {
827
+ stop: () => {
828
+ i(), s();
829
+ }
830
+ };
831
+ }
832
+ const Jt = 200;
833
+ function Kt(e, t) {
834
+ const n = ze(t.configuration).subscribe((o) => {
835
+ e(T(S.ViewportResize, o));
836
+ });
837
+ return {
838
+ stop: () => {
839
+ n.unsubscribe();
840
+ }
841
+ };
842
+ }
843
+ function jt(e, t) {
844
+ const n = window.visualViewport;
845
+ if (!n)
846
+ return { stop: C };
847
+ const { throttled: o, cancel: s } = O(() => {
848
+ e({
849
+ data: me(n),
850
+ type: m.VisualViewport,
851
+ timestamp: y()
852
+ });
853
+ }, Jt, {
854
+ trailing: !1
855
+ }), { stop: i } = w(t.configuration, n, [
856
+ "resize",
857
+ "scroll"
858
+ /* DOM_EVENT.SCROLL */
859
+ ], o, {
860
+ capture: !0,
861
+ passive: !0
862
+ });
863
+ return {
864
+ stop: () => {
865
+ i(), s();
866
+ }
867
+ };
868
+ }
869
+ function Zt(e, t) {
870
+ return w(t.configuration, document, [
871
+ "play",
872
+ "pause"
873
+ /* DOM_EVENT.PAUSE */
874
+ ], (n) => {
875
+ const o = R(n);
876
+ if (!o)
877
+ return;
878
+ const s = t.nodeIds.get(o);
879
+ s === void 0 || I(o, t.configuration.defaultPrivacyLevel) === g.HIDDEN || e(T(S.MediaInteraction, {
880
+ id: s,
881
+ type: n.type === "play" ? x.Play : x.Pause
882
+ }));
883
+ }, {
884
+ capture: !0,
885
+ passive: !0
886
+ });
887
+ }
888
+ function Qt(e, t) {
889
+ function n(i, r) {
890
+ if (!i || !i.ownerNode)
891
+ return;
892
+ const a = t.nodeIds.get(i.ownerNode);
893
+ a !== void 0 && r(a);
894
+ }
895
+ const o = [
896
+ _(CSSStyleSheet.prototype, "insertRule", ({ target: i, parameters: [r, a] }) => {
897
+ n(i, (u) => e(T(S.StyleSheetRule, {
898
+ id: u,
899
+ adds: [{ rule: r, index: a }]
900
+ })));
901
+ }),
902
+ _(CSSStyleSheet.prototype, "deleteRule", ({ target: i, parameters: [r] }) => {
903
+ n(i, (a) => e(T(S.StyleSheetRule, {
904
+ id: a,
905
+ removes: [{ index: r }]
906
+ })));
907
+ })
908
+ ];
909
+ typeof CSSGroupingRule < "u" ? s(CSSGroupingRule) : (s(CSSMediaRule), s(CSSSupportsRule));
910
+ function s(i) {
911
+ o.push(_(i.prototype, "insertRule", ({ target: r, parameters: [a, u] }) => {
912
+ n(r.parentStyleSheet, (c) => {
913
+ const l = j(r);
914
+ l && (l.push(u || 0), e(T(S.StyleSheetRule, {
915
+ id: c,
916
+ adds: [{ rule: a, index: l }]
917
+ })));
918
+ });
919
+ }), _(i.prototype, "deleteRule", ({ target: r, parameters: [a] }) => {
920
+ n(r.parentStyleSheet, (u) => {
921
+ const c = j(r);
922
+ c && (c.push(a), e(T(S.StyleSheetRule, {
923
+ id: u,
924
+ removes: [{ index: c }]
925
+ })));
926
+ });
927
+ }));
928
+ }
929
+ return {
930
+ stop: () => {
931
+ o.forEach((i) => i.stop());
932
+ }
933
+ };
934
+ }
935
+ function j(e) {
936
+ const t = [];
937
+ let n = e;
938
+ for (; n.parentRule; ) {
939
+ const r = Array.from(n.parentRule.cssRules).indexOf(n);
940
+ t.unshift(r), n = n.parentRule;
941
+ }
942
+ if (!n.parentStyleSheet)
943
+ return;
944
+ const s = Array.from(n.parentStyleSheet.cssRules).indexOf(n);
945
+ return t.unshift(s), t;
946
+ }
947
+ function en(e, t) {
948
+ return w(t.configuration, window, [
949
+ "focus",
950
+ "blur"
951
+ /* DOM_EVENT.BLUR */
952
+ ], () => {
953
+ e({
954
+ data: { has_focus: document.hasFocus() },
955
+ type: m.Focus,
956
+ timestamp: y()
957
+ });
958
+ });
959
+ }
960
+ function tn(e, t, n) {
961
+ const o = e.subscribe(12, (s) => {
962
+ var i, r;
963
+ s.rawRumEvent.type === Le.ACTION && s.rawRumEvent.action.type === Pe.CLICK && (!((r = (i = s.rawRumEvent.action.frustration) === null || i === void 0 ? void 0 : i.type) === null || r === void 0) && r.length) && "events" in s.domainContext && s.domainContext.events && s.domainContext.events.length && t({
964
+ timestamp: s.rawRumEvent.date,
965
+ type: m.FrustrationRecord,
966
+ data: {
967
+ frustrationTypes: s.rawRumEvent.action.frustration.type,
968
+ recordIds: s.domainContext.events.map((a) => n.eventIds.getOrInsert(a))
969
+ }
970
+ });
971
+ });
972
+ return {
973
+ stop: () => {
974
+ o.unsubscribe();
975
+ }
976
+ };
977
+ }
978
+ function nn(e, t, n) {
979
+ const o = e.subscribe(5, () => {
980
+ n(), t({
981
+ timestamp: y(),
982
+ type: m.ViewEnd
983
+ });
984
+ });
985
+ return {
986
+ stop: () => {
987
+ o.unsubscribe();
988
+ }
989
+ };
990
+ }
991
+ function Ie(e, t, n) {
992
+ const o = n.configuration.defaultPrivacyLevel, s = /* @__PURE__ */ new WeakMap(), i = e !== document, { stop: r } = w(
993
+ n.configuration,
994
+ e,
995
+ // The 'input' event bubbles across shadow roots, so we don't have to listen for it on shadow
996
+ // roots since it will be handled by the event listener that we did add to the document. Only
997
+ // the 'change' event is blocked and needs to be handled on shadow roots.
998
+ i ? [
999
+ "change"
1000
+ /* DOM_EVENT.CHANGE */
1001
+ ] : [
1002
+ "input",
1003
+ "change"
1004
+ /* DOM_EVENT.CHANGE */
1005
+ ],
1006
+ (l) => {
1007
+ const d = R(l);
1008
+ (d instanceof HTMLInputElement || d instanceof HTMLTextAreaElement || d instanceof HTMLSelectElement) && u(d);
1009
+ },
1010
+ {
1011
+ capture: !0,
1012
+ passive: !0
1013
+ }
1014
+ );
1015
+ let a;
1016
+ if (i)
1017
+ a = C;
1018
+ else {
1019
+ const l = [
1020
+ v(HTMLInputElement.prototype, "value", u),
1021
+ v(HTMLInputElement.prototype, "checked", u),
1022
+ v(HTMLSelectElement.prototype, "value", u),
1023
+ v(HTMLTextAreaElement.prototype, "value", u),
1024
+ v(HTMLSelectElement.prototype, "selectedIndex", u)
1025
+ ];
1026
+ a = () => {
1027
+ l.forEach((d) => d.stop());
1028
+ };
1029
+ }
1030
+ return {
1031
+ stop: () => {
1032
+ a(), r();
1033
+ }
1034
+ };
1035
+ function u(l) {
1036
+ const d = I(l, o);
1037
+ if (d === g.HIDDEN)
1038
+ return;
1039
+ const f = l.type;
1040
+ let p;
1041
+ if (f === "radio" || f === "checkbox") {
1042
+ if (D(l, d))
1043
+ return;
1044
+ p = { isChecked: l.checked };
1045
+ } else {
1046
+ const M = H(l, d);
1047
+ if (M === void 0)
1048
+ return;
1049
+ p = { text: M };
1050
+ }
1051
+ c(l, p);
1052
+ const E = l.name;
1053
+ f === "radio" && E && l.checked && document.querySelectorAll(`input[type="radio"][name="${CSS.escape(E)}"]`).forEach((M) => {
1054
+ M !== l && c(M, { isChecked: !1 });
1055
+ });
1056
+ }
1057
+ function c(l, d) {
1058
+ const f = n.nodeIds.get(l);
1059
+ if (f === void 0)
1060
+ return;
1061
+ const p = s.get(l);
1062
+ (!p || p.text !== d.text || p.isChecked !== d.isChecked) && (s.set(l, d), t(T(S.Input, {
1063
+ id: f,
1064
+ ...d
1065
+ })));
1066
+ }
1067
+ }
1068
+ const on = 100, sn = 16;
1069
+ function rn(e) {
1070
+ let t = C, n = [];
1071
+ function o() {
1072
+ t(), e(n), n = [];
1073
+ }
1074
+ const { throttled: s, cancel: i } = O(o, sn, {
1075
+ leading: !1
1076
+ });
1077
+ return {
1078
+ addMutations: (r) => {
1079
+ n.length === 0 && (t = ke(s, { timeout: on })), n.push(...r);
1080
+ },
1081
+ flush: o,
1082
+ stop: () => {
1083
+ t(), i();
1084
+ }
1085
+ };
1086
+ }
1087
+ function Ce(e, t, n, o) {
1088
+ const s = Ve();
1089
+ if (!s)
1090
+ return { stop: C, flush: C };
1091
+ const i = rn((a) => {
1092
+ Se(2, t, n, o, (u) => an(a.concat(r.takeRecords()), u));
1093
+ }), r = new s(Fe(i.addMutations));
1094
+ return r.observe(e, {
1095
+ attributeOldValue: !0,
1096
+ attributes: !0,
1097
+ characterData: !0,
1098
+ characterDataOldValue: !0,
1099
+ childList: !0,
1100
+ subtree: !0
1101
+ }), {
1102
+ stop: () => {
1103
+ r.disconnect(), i.stop();
1104
+ },
1105
+ flush: () => {
1106
+ i.flush();
1107
+ }
1108
+ };
1109
+ }
1110
+ function an(e, t) {
1111
+ const n = /* @__PURE__ */ new Map();
1112
+ e.filter((c) => c.type === "childList").forEach((c) => {
1113
+ c.removedNodes.forEach((l) => {
1114
+ be(l, t.scope.shadowRootsController.removeShadowRoot);
1115
+ });
1116
+ });
1117
+ const o = e.filter((c) => c.target.isConnected && fn(c.target, t.scope.nodeIds) && I(c.target, t.scope.configuration.defaultPrivacyLevel, n) !== g.HIDDEN), { adds: s, removes: i, hasBeenSerialized: r } = un(o.filter((c) => c.type === "childList"), n, t), a = cn(o.filter((c) => c.type === "characterData" && !r(c.target)), n, t), u = dn(o.filter((c) => c.type === "attributes" && !r(c.target)), n, t);
1118
+ !a.length && !u.length && !i.length && !s.length || t.add(T(S.Mutation, {
1119
+ adds: s,
1120
+ removes: i,
1121
+ texts: a,
1122
+ attributes: u
1123
+ }));
1124
+ }
1125
+ function un(e, t, n) {
1126
+ const o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Map();
1127
+ for (const l of e)
1128
+ l.addedNodes.forEach((d) => {
1129
+ o.add(d);
1130
+ }), l.removedNodes.forEach((d) => {
1131
+ o.has(d) || s.set(d, l.target), o.delete(d);
1132
+ });
1133
+ const i = Array.from(o);
1134
+ ln(i), n.serializedNodeIds = /* @__PURE__ */ new Set();
1135
+ const r = [];
1136
+ for (const l of i) {
1137
+ if (u(l))
1138
+ continue;
1139
+ const d = I(l.parentNode, n.scope.configuration.defaultPrivacyLevel, t);
1140
+ if (d === g.HIDDEN || d === g.IGNORE)
1141
+ continue;
1142
+ const f = B(l, d, n);
1143
+ if (!f)
1144
+ continue;
1145
+ const p = U(l);
1146
+ r.push({
1147
+ nextId: c(l),
1148
+ parentId: n.scope.nodeIds.get(p),
1149
+ node: f
1150
+ });
1151
+ }
1152
+ const a = [];
1153
+ return s.forEach((l, d) => {
1154
+ const f = n.scope.nodeIds.get(l), p = n.scope.nodeIds.get(d);
1155
+ f !== void 0 && p !== void 0 && a.push({ parentId: f, id: p });
1156
+ }), { adds: r, removes: a, hasBeenSerialized: u };
1157
+ function u(l) {
1158
+ var d;
1159
+ const f = n.scope.nodeIds.get(l);
1160
+ return f !== void 0 && ((d = n.serializedNodeIds) === null || d === void 0 ? void 0 : d.has(f));
1161
+ }
1162
+ function c(l) {
1163
+ let d = l.nextSibling;
1164
+ for (; d; ) {
1165
+ const f = n.scope.nodeIds.get(d);
1166
+ if (f !== void 0)
1167
+ return f;
1168
+ d = d.nextSibling;
1169
+ }
1170
+ return null;
1171
+ }
1172
+ }
1173
+ function cn(e, t, n) {
1174
+ var o;
1175
+ const s = [], i = /* @__PURE__ */ new Set(), r = e.filter((a) => i.has(a.target) ? !1 : (i.add(a.target), !0));
1176
+ for (const a of r) {
1177
+ if (a.target.textContent === a.oldValue)
1178
+ continue;
1179
+ const c = n.scope.nodeIds.get(a.target);
1180
+ if (c === void 0)
1181
+ continue;
1182
+ const l = I(U(a.target), n.scope.configuration.defaultPrivacyLevel, t);
1183
+ l === g.HIDDEN || l === g.IGNORE || s.push({
1184
+ id: c,
1185
+ value: (o = L(a.target, l)) !== null && o !== void 0 ? o : null
1186
+ });
1187
+ }
1188
+ return s;
1189
+ }
1190
+ function dn(e, t, n) {
1191
+ const o = [], s = /* @__PURE__ */ new Map(), i = e.filter((a) => {
1192
+ const u = s.get(a.target);
1193
+ return u && u.has(a.attributeName) ? !1 : (u ? u.add(a.attributeName) : s.set(a.target, /* @__PURE__ */ new Set([a.attributeName])), !0);
1194
+ }), r = /* @__PURE__ */ new Map();
1195
+ for (const a of i) {
1196
+ if (a.target.getAttribute(a.attributeName) === a.oldValue)
1197
+ continue;
1198
+ const c = n.scope.nodeIds.get(a.target);
1199
+ if (c === void 0)
1200
+ continue;
1201
+ const l = I(a.target, n.scope.configuration.defaultPrivacyLevel, t), d = ce(a.target, l, a.attributeName, n.scope.configuration);
1202
+ let f;
1203
+ if (a.attributeName === "value") {
1204
+ const E = H(a.target, l);
1205
+ if (E === void 0)
1206
+ continue;
1207
+ f = E;
1208
+ } else typeof d == "string" ? f = d : f = null;
1209
+ let p = r.get(a.target);
1210
+ p || (p = { id: c, attributes: {} }, o.push(p), r.set(a.target, p)), p.attributes[a.attributeName] = f;
1211
+ }
1212
+ return o;
1213
+ }
1214
+ function ln(e) {
1215
+ e.sort((t, n) => {
1216
+ const o = t.compareDocumentPosition(n);
1217
+ return o & Node.DOCUMENT_POSITION_CONTAINED_BY ? -1 : o & Node.DOCUMENT_POSITION_CONTAINS || o & Node.DOCUMENT_POSITION_FOLLOWING ? 1 : o & Node.DOCUMENT_POSITION_PRECEDING ? -1 : 0;
1218
+ });
1219
+ }
1220
+ function be(e, t) {
1221
+ re(e) && t(e.shadowRoot), k(e, (n) => be(n, t));
1222
+ }
1223
+ function fn(e, t) {
1224
+ let n = e;
1225
+ for (; n; ) {
1226
+ if (t.get(n) === void 0 && !P(n))
1227
+ return !1;
1228
+ n = U(n);
1229
+ }
1230
+ return !0;
1231
+ }
1232
+ const pn = (e, t) => {
1233
+ const n = /* @__PURE__ */ new Map();
1234
+ return {
1235
+ addShadowRoot: (s, i) => {
1236
+ if (n.has(s))
1237
+ return;
1238
+ const r = Ce(s, e, t, i), a = Ie(s, e, i), u = ye(s, e, i);
1239
+ n.set(s, {
1240
+ flush: () => r.flush(),
1241
+ stop: () => {
1242
+ r.stop(), a.stop(), u.stop();
1243
+ }
1244
+ });
1245
+ },
1246
+ removeShadowRoot: (s) => {
1247
+ const i = n.get(s);
1248
+ i && (i.stop(), n.delete(s));
1249
+ },
1250
+ stop: () => {
1251
+ n.forEach(({ stop: s }) => s());
1252
+ },
1253
+ flush: () => {
1254
+ n.forEach(({ flush: s }) => s());
1255
+ }
1256
+ };
1257
+ };
1258
+ function hn(e) {
1259
+ const { emitRecord: t, emitStats: n, configuration: o, lifeCycle: s } = e;
1260
+ if (!t || !n)
1261
+ throw new Error("emit functions are required");
1262
+ const i = (f) => {
1263
+ t(f), Ue("record", { record: f });
1264
+ const p = e.viewHistory.findView();
1265
+ He(p.id);
1266
+ }, r = pn(i, n), a = Gt(o, Yt(), r), { stop: u } = Pt(s, i, n, c, a);
1267
+ function c() {
1268
+ r.flush(), l.flush();
1269
+ }
1270
+ const l = Ce(document, i, n, a), d = [
1271
+ l,
1272
+ Xt(i, a),
1273
+ Wt(i, a),
1274
+ ye(document, i, a),
1275
+ Kt(i, a),
1276
+ Ie(document, i, a),
1277
+ Zt(i, a),
1278
+ Qt(i, a),
1279
+ en(i, a),
1280
+ jt(i, a),
1281
+ tn(s, i, a),
1282
+ nn(s, i, c)
1283
+ ];
1284
+ return {
1285
+ stop: () => {
1286
+ r.stop(), d.forEach((f) => f.stop()), u();
1287
+ },
1288
+ flushMutations: c,
1289
+ shadowRootsController: r
1290
+ };
1291
+ }
1292
+ function gn(e, t, n, o) {
1293
+ const s = new FormData();
1294
+ s.append("segment", new Blob([e], {
1295
+ type: "application/octet-stream"
1296
+ }), `${t.session.id}-${t.start}`);
1297
+ const i = {
1298
+ raw_segment_size: o,
1299
+ compressed_segment_size: e.byteLength,
1300
+ ...t
1301
+ }, r = JSON.stringify(i);
1302
+ return s.append("event", new Blob([r], { type: "application/json" })), {
1303
+ data: s,
1304
+ bytesCount: e.byteLength,
1305
+ cssText: n.cssText,
1306
+ isFullSnapshot: t.index_in_view === 0,
1307
+ rawSize: o,
1308
+ recordCount: t.records_count,
1309
+ serializationDuration: n.serializationDuration
1310
+ };
1311
+ }
1312
+ function Sn({ context: e, creationReason: t, encoder: n }) {
1313
+ let o = 0;
1314
+ const s = e.view.id, i = Be(s), r = {
1315
+ start: 1 / 0,
1316
+ end: -1 / 0,
1317
+ creation_reason: t,
1318
+ records_count: 0,
1319
+ has_full_snapshot: !1,
1320
+ index_in_view: i,
1321
+ source: "browser",
1322
+ ...e
1323
+ }, a = Y();
1324
+ Ge(s);
1325
+ function u(d, f) {
1326
+ r.start = Math.min(r.start, d.timestamp), r.end = Math.max(r.end, d.timestamp), r.records_count += 1, r.has_full_snapshot || (r.has_full_snapshot = d.type === m.FullSnapshot || d.type === m.Change && r.index_in_view === 0);
1327
+ const p = n.isEmpty ? '{"records":[' : ",";
1328
+ n.write(p + JSON.stringify(d), (E) => {
1329
+ o += E, f(o);
1330
+ });
1331
+ }
1332
+ function c(d) {
1333
+ xt(a, d);
1334
+ }
1335
+ function l(d) {
1336
+ if (n.isEmpty)
1337
+ throw new Error("Empty segment flushed");
1338
+ n.write(`],${JSON.stringify(r).slice(1)}
1339
+ `), n.finish((f) => {
1340
+ Ye(r.view.id, f.rawBytesCount), d(r, a, f);
1341
+ });
1342
+ }
1343
+ return { addRecord: u, addStats: c, flush: l };
1344
+ }
1345
+ const mn = 5 * qe;
1346
+ let we = 6e4;
1347
+ function En(e, t, n, o, s, i) {
1348
+ return Nn(e, () => Tn(t.applicationId, n, o), s, i);
1349
+ }
1350
+ function Nn(e, t, n, o) {
1351
+ let s = {
1352
+ status: 0,
1353
+ nextSegmentCreationReason: "init"
1354
+ };
1355
+ const { unsubscribe: i } = e.subscribe(2, () => {
1356
+ a("view_change");
1357
+ }), { unsubscribe: r } = e.subscribe(11, (u) => {
1358
+ a(u.reason);
1359
+ });
1360
+ function a(u) {
1361
+ s.status === 1 && (s.segment.flush((c, l, d) => {
1362
+ const f = gn(d.output, c, l, d.rawBytesCount);
1363
+ $e(u) ? n.sendOnExit(f) : n.send(f);
1364
+ }), Xe(s.expirationTimeoutId)), u !== "stop" ? s = {
1365
+ status: 0,
1366
+ nextSegmentCreationReason: u
1367
+ } : s = {
1368
+ status: 2
1369
+ };
1370
+ }
1371
+ return {
1372
+ addRecord: (u) => {
1373
+ if (s.status !== 2) {
1374
+ if (s.status === 0) {
1375
+ const c = t();
1376
+ if (!c)
1377
+ return;
1378
+ s = {
1379
+ status: 1,
1380
+ segment: Sn({ encoder: o, context: c, creationReason: s.nextSegmentCreationReason }),
1381
+ expirationTimeoutId: We(() => {
1382
+ a("segment_duration_limit");
1383
+ }, mn)
1384
+ };
1385
+ }
1386
+ s.segment.addRecord(u, (c) => {
1387
+ c > we && a("segment_bytes_limit");
1388
+ });
1389
+ }
1390
+ },
1391
+ addStats: (u) => {
1392
+ s.status === 1 && s.segment.addStats(u);
1393
+ },
1394
+ stop: () => {
1395
+ a("stop"), i(), r();
1396
+ }
1397
+ };
1398
+ }
1399
+ function Tn(e, t, n) {
1400
+ const o = t.findTrackedSession(), s = n.findView();
1401
+ if (!(!o || !s))
1402
+ return {
1403
+ application: {
1404
+ id: e
1405
+ },
1406
+ session: {
1407
+ id: o.id
1408
+ },
1409
+ view: {
1410
+ id: s.id
1411
+ }
1412
+ };
1413
+ }
1414
+ function yn(e, t) {
1415
+ if (!e.metricsEnabled)
1416
+ return { stop: C };
1417
+ const { unsubscribe: n } = t.subscribe((o) => {
1418
+ if (o.type === "failure" || o.type === "queue-full" || o.type === "success" && o.payload.isFullSnapshot) {
1419
+ const s = In(o.type, o.bandwidth, o.payload);
1420
+ Je("Segment network request metrics", { metrics: s });
1421
+ }
1422
+ });
1423
+ return {
1424
+ stop: n
1425
+ };
1426
+ }
1427
+ function In(e, t, n) {
1428
+ return {
1429
+ cssText: {
1430
+ count: n.cssText.count,
1431
+ max: n.cssText.max,
1432
+ sum: n.cssText.sum
1433
+ },
1434
+ encoding: {
1435
+ fullSnapshot: se(ie.USE_CHANGE_RECORDS) ? "change" : "v1",
1436
+ incrementalSnapshot: "v1"
1437
+ },
1438
+ isFullSnapshot: n.isFullSnapshot,
1439
+ ongoingRequests: {
1440
+ count: t.ongoingRequestCount,
1441
+ totalSize: t.ongoingByteCount
1442
+ },
1443
+ recordCount: n.recordCount,
1444
+ result: e,
1445
+ serializationDuration: {
1446
+ count: n.serializationDuration.count,
1447
+ max: n.serializationDuration.max,
1448
+ sum: n.serializationDuration.sum
1449
+ },
1450
+ size: {
1451
+ compressed: n.bytesCount,
1452
+ raw: n.rawSize
1453
+ }
1454
+ };
1455
+ }
1456
+ function Cn(e) {
1457
+ const t = Ke();
1458
+ return {
1459
+ addRecord: (n) => {
1460
+ const o = e.findView();
1461
+ t.send("record", n, o.id);
1462
+ }
1463
+ };
1464
+ }
1465
+ function wn(e, t, n, o, s, i, r) {
1466
+ const a = [], u = (p) => {
1467
+ e.notify(14, { error: p }), Qe("Error reported to customer", { "error.message": p.message });
1468
+ }, c = r || je([t.sessionReplayEndpointBuilder], u, we);
1469
+ let l, d;
1470
+ if (Ze())
1471
+ ({ addRecord: l } = Cn(o)), d = C;
1472
+ else {
1473
+ const p = En(e, t, n, o, c, s);
1474
+ l = p.addRecord, d = p.addStats, a.push(p.stop);
1475
+ const E = yn(i, c.observable);
1476
+ a.push(E.stop);
1477
+ }
1478
+ const { stop: f } = hn({
1479
+ emitRecord: l,
1480
+ emitStats: d,
1481
+ configuration: t,
1482
+ lifeCycle: e,
1483
+ viewHistory: o
1484
+ });
1485
+ return a.push(f), {
1486
+ stop: () => {
1487
+ a.forEach((p) => p());
1488
+ }
1489
+ };
1490
+ }
1491
+ export {
1492
+ wn as startRecording
1493
+ };
1494
+ //# sourceMappingURL=startRecording-DqW-BV0C.js.map