@picked/analytics 0.0.12-next.2 → 0.0.12-next.4

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.
@@ -0,0 +1,1154 @@
1
+ import { trackSelfDescribingEvent as Nt, newTracker as wt, addGlobalContexts as Pt, enableActivityTracking as Vt, enableActivityTrackingCallback as St } from "@snowplow/browser-tracker";
2
+ import { ButtonClickTrackingPlugin as Yt, enableButtonClickTracking as Bt } from "@snowplow/browser-plugin-button-click-tracking";
3
+ import { PerformanceNavigationTimingPlugin as Ht } from "@snowplow/browser-plugin-performance-navigation-timing";
4
+ import { ErrorTrackingPlugin as qt, enableErrorTracking as At } from "@snowplow/browser-plugin-error-tracking";
5
+ import { WebVitalsPlugin as Ft } from "@snowplow/browser-plugin-web-vitals";
6
+ import { supportsDocument as X, supportsWindow as Rt, supportsCookies as jt } from "@picked/client";
7
+ function J(t, e) {
8
+ return `iglu:dev.pckd/${t}/jsonschema/${e}`;
9
+ }
10
+ function $(t, ...e) {
11
+ }
12
+ function L(t, ...e) {
13
+ }
14
+ function l(t, e, s = {}) {
15
+ return {
16
+ event: {
17
+ schema: J("event", "1-0-0"),
18
+ data: {
19
+ type: t,
20
+ meta: s
21
+ }
22
+ },
23
+ context: e.filter(
24
+ (i) => i !== void 0
25
+ )
26
+ };
27
+ }
28
+ function n(t, e, s) {
29
+ return {
30
+ schema: J(t, e),
31
+ data: s
32
+ };
33
+ }
34
+ function u(t, e) {
35
+ return (s, i) => {
36
+ const a = e(s, i);
37
+ Nt(a);
38
+ };
39
+ }
40
+ function _(t, e, s = { passive: !0 }) {
41
+ const i = /* @__PURE__ */ new WeakMap();
42
+ return (a, o) => {
43
+ let r = i.get(a);
44
+ if (r || (r = /* @__PURE__ */ new Set(), i.set(a, r)), r.has(t))
45
+ return;
46
+ function c(m) {
47
+ const C = o();
48
+ e({ event: m, analyticsContext: C });
49
+ }
50
+ a.addEventListener(t, c, s), r.add(t);
51
+ };
52
+ }
53
+ function Ot(t, e) {
54
+ const s = /* @__PURE__ */ new Set();
55
+ return (i) => {
56
+ if (s.has(t) || !X())
57
+ return;
58
+ function a(o) {
59
+ const r = i();
60
+ e({ event: o, analyticsContext: r });
61
+ }
62
+ document.addEventListener(t, a, { passive: !0 }), s.add(t);
63
+ };
64
+ }
65
+ function y(t, e) {
66
+ const s = /* @__PURE__ */ new Set();
67
+ return (i) => {
68
+ if (s.has(t) || !Rt())
69
+ return;
70
+ function a(o) {
71
+ const r = i();
72
+ e({ event: o, analyticsContext: r });
73
+ }
74
+ window.addEventListener(t, a, { passive: !0 }), s.add(t);
75
+ };
76
+ }
77
+ function f(t) {
78
+ var s;
79
+ return { items: ((s = t.features) == null ? void 0 : s.map(({ feature: i, name: a, key: o, bucket: r }) => ({
80
+ ab_feature: i,
81
+ ab_name: a,
82
+ ab_key: o,
83
+ ab_bucket: r
84
+ }))) || [] };
85
+ }
86
+ const D = "unknown";
87
+ function d(t) {
88
+ var i;
89
+ const e = Wt(), s = {
90
+ id: t.sessionId || null
91
+ };
92
+ return e && (s.gaid = e), (i = t.shopifySession) != null && i.clientId && (s.shopify_client_id = t.shopifySession.clientId), s;
93
+ }
94
+ function O(t) {
95
+ if (t.fields)
96
+ return {
97
+ items: t.fields.map(({ id: e, type: s, label: i, options: a }) => ({
98
+ id: e,
99
+ type: s,
100
+ label: i,
101
+ options: a
102
+ }))
103
+ };
104
+ }
105
+ function Q(t) {
106
+ if (t.responses)
107
+ return {
108
+ items: t.responses.map(
109
+ ({ fieldId: e, value: s }) => ({
110
+ field_id: e,
111
+ values: Array.isArray(s) ? s.map((i) => ({ value: i })) : [{ value: s }]
112
+ })
113
+ )
114
+ };
115
+ }
116
+ function x(t, e = !1) {
117
+ const { step: s } = t;
118
+ if (s)
119
+ return {
120
+ id: s.id,
121
+ title: s.label
122
+ };
123
+ if (e)
124
+ return L('"step" is required for this event', t), {
125
+ id: D,
126
+ title: D
127
+ };
128
+ }
129
+ function Hn(t, e = !1) {
130
+ const { productList: s } = t;
131
+ if (s) {
132
+ const i = {};
133
+ "title" in s && s.title && Object.assign(i, { title: s.title });
134
+ const a = "items" in s ? s.items : s;
135
+ return Object.assign(i, {
136
+ items: a.map((o) => ({
137
+ item_id: o.itemId,
138
+ item_name: o.itemName,
139
+ affiliation: o.affiliation,
140
+ coupon: o.coupon,
141
+ currency: o.currency,
142
+ creative_name: o.creativeName,
143
+ creative_slot: o.creativeSlot,
144
+ discount: h(o.discount),
145
+ index: h(o.index),
146
+ item_brand: o.itemBrand,
147
+ item_category: o.itemCategory,
148
+ item_category2: o.itemCategory2,
149
+ item_category3: o.itemCategory3,
150
+ item_category4: o.itemCategory4,
151
+ item_category5: o.itemCategory5,
152
+ item_list_id: o.itemListId,
153
+ item_list_name: o.itemListName,
154
+ item_variant: o.itemVariant,
155
+ location_id: o.locationId,
156
+ price: h(o.price),
157
+ promotion_id: o.promotionId,
158
+ promotion_name: o.promotionName,
159
+ quantity: h(o.quantity),
160
+ in_stock: o.inStock
161
+ }))
162
+ }), i;
163
+ }
164
+ if (e)
165
+ return L('"productList" is required for this event', t), {};
166
+ }
167
+ function p(t, e = !1) {
168
+ const { experience: s } = t;
169
+ if (s)
170
+ return {
171
+ id: s.id,
172
+ type: s.type,
173
+ title: s.title
174
+ };
175
+ if (e)
176
+ return L('"experience" is required for this event', t), {
177
+ id: D,
178
+ type: D,
179
+ title: D
180
+ };
181
+ }
182
+ function Z(t, e = !1) {
183
+ const { exception: s } = t;
184
+ if (s)
185
+ return typeof s == "string" ? { reason: s } : {
186
+ reason: s.systemMessage
187
+ };
188
+ if (e)
189
+ return L('"exception" is required for this event', t), {
190
+ reason: D
191
+ };
192
+ }
193
+ function w(t) {
194
+ const { form: e } = t;
195
+ return e ? {
196
+ id: e.id,
197
+ title: e.title
198
+ } : (L('"form" is required for this event', t), {
199
+ id: D,
200
+ title: D
201
+ });
202
+ }
203
+ function qn(t) {
204
+ const { modal: e } = t;
205
+ return e ? {
206
+ id: e.id,
207
+ title: e.title
208
+ } : (L('"modal" is required for this event', t), {
209
+ id: D,
210
+ title: D
211
+ });
212
+ }
213
+ function P(t, e = 300) {
214
+ let s;
215
+ return function(...i) {
216
+ clearTimeout(s), s = setTimeout(() => t.apply(this, i), e);
217
+ };
218
+ }
219
+ function h(t) {
220
+ if (typeof t == "number")
221
+ return t;
222
+ if (typeof t != "string")
223
+ return;
224
+ const e = parseFloat(t);
225
+ if (!isNaN(e))
226
+ return e;
227
+ }
228
+ function Wt() {
229
+ if (!X() || !jt())
230
+ return null;
231
+ const t = "_ga=", e = document.cookie ? document.cookie.split(";") : [];
232
+ for (const s of e) {
233
+ const i = s.trim();
234
+ if (i.startsWith(t)) {
235
+ const o = i.substring(t.length).split(".");
236
+ if (o.length > 2)
237
+ return o.slice(2).join(".");
238
+ }
239
+ }
240
+ }
241
+ function Mt(t) {
242
+ const e = [];
243
+ return t.trackErrors && ($(), e.push(qt())), t.trackVitals && ($(), e.push(Ft())), t.trackPerformance && ($(), e.push(Ht())), (t.trackButtonClickAllowList || t.trackButtonClickFilter) && e.push(Yt()), e;
244
+ }
245
+ function Gt(t) {
246
+ t.trackActivity && !t.trackActivityCallback && ($(), Vt({
247
+ minimumVisitLength: 30,
248
+ heartbeatDelay: 10
249
+ })), t.trackActivity && t.trackActivityCallback && ($(), St({
250
+ minimumVisitLength: 30,
251
+ heartbeatDelay: 10,
252
+ callback: t.trackActivityCallback
253
+ })), (t.trackButtonClickAllowList || t.trackButtonClickFilter) && ($(), Bt({
254
+ filter: t.trackButtonClickAllowList ? {
255
+ allowlist: t.trackButtonClickAllowList
256
+ } : t.trackButtonClickFilter
257
+ })), t.trackErrors && ($(), At());
258
+ }
259
+ function An({
260
+ organizationId: t,
261
+ projectId: e,
262
+ cvlyX: s,
263
+ collectorUrl: i = "evnts.pckd.dev",
264
+ appId: a = "picked-analytics",
265
+ trackVitals: o = !0,
266
+ trackPerformance: r = !0,
267
+ trackWebPage: c = !0,
268
+ trackSessions: m = !0,
269
+ trackBrowser: C = !0,
270
+ trackActivity: kt = !0,
271
+ trackErrors: $t = !0,
272
+ trackActivityCallback: gt,
273
+ trackButtonClickAllowList: Lt
274
+ }) {
275
+ $();
276
+ const W = {
277
+ trackVitals: o,
278
+ trackErrors: $t,
279
+ trackActivity: kt,
280
+ trackPerformance: r,
281
+ trackActivityCallback: gt,
282
+ trackButtonClickAllowList: Lt
283
+ }, yt = {
284
+ appId: a,
285
+ platform: "web",
286
+ contexts: {
287
+ webPage: c,
288
+ session: m,
289
+ browser: C || !1
290
+ },
291
+ plugins: Mt(W)
292
+ }, ht = wt(a, i, yt);
293
+ return Ut({
294
+ organizationId: t,
295
+ projectId: e,
296
+ cvlyX: s
297
+ }), Gt(W), ht;
298
+ }
299
+ function Ut({ organizationId: t, projectId: e, cvlyX: s }) {
300
+ if (!t || !e)
301
+ throw new Error("bindGlobalContext: Both organizationId and projectId are required");
302
+ const i = [];
303
+ i.push(
304
+ n("app", "1-0-0", {
305
+ organization_id: t,
306
+ project_id: e
307
+ })
308
+ ), s && i.push(
309
+ n("cvly_x", "1-0-1", {
310
+ vercel_deployment_id: s.vercelDeploymentId,
311
+ vercel_env: s.vercelEnv,
312
+ vercel_url: s.vercelUrl
313
+ })
314
+ ), Pt(i);
315
+ }
316
+ const tt = "app_close";
317
+ function zt(t, e) {
318
+ const s = f(t), i = d(t), a = p(t), o = x(t);
319
+ return l(
320
+ tt,
321
+ [
322
+ n("feature_list", "2-0-0", s),
323
+ n("session", "1-0-2", i),
324
+ o ? n("step", "1-0-0", o) : void 0,
325
+ a ? n("experience", "1-0-0", a) : void 0
326
+ ],
327
+ e
328
+ );
329
+ }
330
+ const Fn = u(tt, zt), et = "app_load";
331
+ function It(t, e) {
332
+ const s = f(t), i = d(t), a = p(t), o = x(t);
333
+ return l(
334
+ et,
335
+ [
336
+ n("feature_list", "2-0-0", s),
337
+ n("session", "1-0-2", i),
338
+ o ? n("step", "1-0-0", o) : void 0,
339
+ a ? n("experience", "1-0-0", a) : void 0
340
+ ],
341
+ e
342
+ );
343
+ }
344
+ const Rn = u(et, It), nt = "app_open";
345
+ function Kt(t, e) {
346
+ const s = f(t), i = d(t), a = p(t), o = x(t);
347
+ return l(
348
+ nt,
349
+ [
350
+ n("feature_list", "2-0-0", s),
351
+ n("session", "1-0-2", i),
352
+ o ? n("step", "1-0-0", o) : void 0,
353
+ a ? n("experience", "1-0-0", a) : void 0
354
+ ],
355
+ e
356
+ );
357
+ }
358
+ const jn = u(nt, Kt), st = "experience_load";
359
+ function Xt(t, e) {
360
+ const s = f(t), i = d(t), a = p(t, !0), o = x(t);
361
+ return l(
362
+ st,
363
+ [
364
+ n("feature_list", "2-0-0", s),
365
+ n("session", "1-0-2", i),
366
+ n("experience", "1-0-0", a),
367
+ o ? n("step", "1-0-0", o) : void 0
368
+ ],
369
+ e
370
+ );
371
+ }
372
+ const On = u(st, Xt), ot = "field_validation_error";
373
+ function Jt(t, e) {
374
+ const s = f(t), i = d(t), a = w(t), o = Z(t, !0), r = p(t), c = x(t);
375
+ return l(
376
+ ot,
377
+ [
378
+ n("feature_list", "2-0-0", s),
379
+ n("session", "1-0-2", i),
380
+ n("exception", "1-0-0", o),
381
+ n("form", "1-0-0", a),
382
+ r && n("experience", "1-0-0", r),
383
+ c && n("step", "1-0-0", c)
384
+ ],
385
+ e
386
+ );
387
+ }
388
+ const Wn = u(ot, Jt), at = "form_submit";
389
+ function Qt(t, e) {
390
+ const s = f(t), i = d(t), a = w(t), o = p(t), r = x(t);
391
+ return l(
392
+ at,
393
+ [
394
+ n("feature_list", "2-0-0", s),
395
+ n("session", "1-0-2", i),
396
+ n("form", "1-0-0", a),
397
+ o && n("experience", "1-0-0", o),
398
+ r && n("step", "1-0-0", r)
399
+ ],
400
+ e
401
+ );
402
+ }
403
+ const Mn = u(at, Qt), it = "form_submit_error";
404
+ function Zt(t, e) {
405
+ const s = f(t), i = d(t), a = w(t), o = Z(t, !0), r = p(t), c = x(t);
406
+ return l(
407
+ it,
408
+ [
409
+ n("feature_list", "2-0-0", s),
410
+ n("session", "1-0-2", i),
411
+ n("form", "1-0-0", a),
412
+ n("exception", "1-0-0", o),
413
+ r && n("experience", "1-0-0", r),
414
+ c && n("step", "1-0-0", c)
415
+ ],
416
+ e
417
+ );
418
+ }
419
+ const Gn = u(it, Zt), rt = "form_submit_success";
420
+ function te(t, e) {
421
+ const s = f(t), i = d(t), a = w(t), o = p(t), r = x(t);
422
+ return l(
423
+ rt,
424
+ [
425
+ n("feature_list", "2-0-0", s),
426
+ n("session", "1-0-2", i),
427
+ n("form", "1-0-0", a),
428
+ o && n("experience", "1-0-0", o),
429
+ r && n("step", "1-0-0", r)
430
+ ],
431
+ e
432
+ );
433
+ }
434
+ const Un = u(rt, te), ct = "step_enter";
435
+ function ee(t, e) {
436
+ const s = f(t), i = d(t), a = p(t), o = x(t, !0), r = O(t);
437
+ return l(
438
+ ct,
439
+ [
440
+ n("feature_list", "2-0-0", s),
441
+ n("session", "1-0-2", i),
442
+ n("step", "1-0-0", o),
443
+ r && n("field_list", "1-0-0", r),
444
+ a && n("experience", "1-0-0", a)
445
+ ],
446
+ e
447
+ );
448
+ }
449
+ const zn = u(ct, ee), lt = "step_submit";
450
+ function ne(t, e) {
451
+ const s = f(t), i = d(t), a = p(t), o = x(t, !0), r = Q(t), c = O(t);
452
+ return l(
453
+ lt,
454
+ [
455
+ n("feature_list", "2-0-0", s),
456
+ n("session", "1-0-2", i),
457
+ n("step", "1-0-0", o),
458
+ c && n("field_list", "1-0-0", c),
459
+ r && n("response_list", "1-0-0", r),
460
+ a && n("experience", "1-0-0", a)
461
+ ],
462
+ e
463
+ );
464
+ }
465
+ const In = u(lt, ne), ut = "step_submit_success";
466
+ function se(t, e) {
467
+ const s = f(t), i = d(t), a = p(t), o = x(t, !0), r = O(t), c = Q(t);
468
+ return l(
469
+ ut,
470
+ [
471
+ n("feature_list", "2-0-0", s),
472
+ n("session", "1-0-2", i),
473
+ n("step", "1-0-0", o),
474
+ r && n("field_list", "1-0-0", r),
475
+ c && n("response_list", "1-0-0", c),
476
+ a && n("experience", "1-0-0", a)
477
+ ],
478
+ e
479
+ );
480
+ }
481
+ const Kn = u(ut, se), ft = "feature_decide";
482
+ function oe(t, e) {
483
+ const s = f(t), i = d(t), a = p(t), o = x(t);
484
+ return l(
485
+ ft,
486
+ [
487
+ n("feature_list", "2-0-0", s),
488
+ n("session", "1-0-2", i),
489
+ o ? n("step", "1-0-0", o) : void 0,
490
+ a ? n("experience", "1-0-0", a) : void 0
491
+ ],
492
+ e
493
+ );
494
+ }
495
+ const Xn = u(ft, oe);
496
+ function b(t) {
497
+ return t instanceof Element;
498
+ }
499
+ function T(t) {
500
+ const e = [
501
+ "a",
502
+ "button",
503
+ "input",
504
+ "select",
505
+ "textarea",
506
+ "details",
507
+ "summary",
508
+ "label",
509
+ "form",
510
+ "fieldset",
511
+ "legend",
512
+ "optgroup",
513
+ "option",
514
+ "output",
515
+ "datalist",
516
+ "dialog",
517
+ "menu",
518
+ "menuitem",
519
+ "iframe",
520
+ "audio",
521
+ "video",
522
+ "embed",
523
+ "object",
524
+ "canvas"
525
+ ].join(", ");
526
+ return b(t) ? t.matches(e) ? t : t.closest(e) : null;
527
+ }
528
+ function v(t) {
529
+ if (t instanceof HTMLSelectElement) {
530
+ const e = t.selectedIndex || 0, s = t.options[e];
531
+ return (s == null ? void 0 : s.text) ?? "";
532
+ }
533
+ return "innerText" in t && typeof t.innerText == "string" ? t.innerText : t.textContent;
534
+ }
535
+ function k(t) {
536
+ const e = t.getAttribute("aria-label");
537
+ if (e)
538
+ return e;
539
+ const s = t.getAttribute("aria-labelledby");
540
+ if (s) {
541
+ const a = document.getElementById(s);
542
+ if (a) {
543
+ const o = v(a);
544
+ if (o)
545
+ return o;
546
+ }
547
+ }
548
+ if ("id" in t && t.id) {
549
+ const a = document.querySelector(`label[for="${t.id}"]`);
550
+ if (a) {
551
+ const o = v(a);
552
+ if (o)
553
+ return o;
554
+ }
555
+ }
556
+ let i = t.parentElement;
557
+ for (; i; ) {
558
+ if (i.tagName.toLowerCase() === "label") {
559
+ const a = v(i);
560
+ if (a)
561
+ return a;
562
+ }
563
+ i = i.parentElement;
564
+ }
565
+ if (t instanceof HTMLInputElement && "labels" in t && t.labels) {
566
+ const a = Array.from(t.labels).map((o) => v(o)).filter(Boolean).join(" ");
567
+ if (a)
568
+ return a;
569
+ }
570
+ return "placeholder" in t && typeof t.placeholder == "string" ? t.placeholder : null;
571
+ }
572
+ const ae = 255;
573
+ function E(t) {
574
+ return t ? t.slice(0, ae) : null;
575
+ }
576
+ const S = "rapid_scroll";
577
+ function ie(t, e) {
578
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
579
+ if (!b(r)) {
580
+ const C = {
581
+ node_type: "unknown"
582
+ };
583
+ return l(
584
+ S,
585
+ [
586
+ n("feature_list", "2-0-0", s),
587
+ n("session", "1-0-2", i),
588
+ o ? n("step", "1-0-0", o) : void 0,
589
+ a ? n("experience", "1-0-0", a) : void 0,
590
+ n("element", "1-0-0", C)
591
+ ],
592
+ e
593
+ );
594
+ }
595
+ const c = T(r) || r, m = {
596
+ id: c.id || null,
597
+ node_type: c.nodeName.toLowerCase(),
598
+ label: E(k(c)),
599
+ text: E(v(c))
600
+ };
601
+ return l(
602
+ S,
603
+ [
604
+ n("feature_list", "2-0-0", s),
605
+ n("session", "1-0-2", i),
606
+ o ? n("step", "1-0-0", o) : void 0,
607
+ a ? n("experience", "1-0-0", a) : void 0,
608
+ n("element", "1-0-0", m)
609
+ ],
610
+ e
611
+ );
612
+ }
613
+ const re = u(S, ie), ce = 100, le = 100, ue = 300;
614
+ let M = 0, G = 0;
615
+ const fe = P(
616
+ (t, e) => {
617
+ re(t, e);
618
+ },
619
+ ue
620
+ );
621
+ function de(t, e) {
622
+ const s = t.event.target || document.documentElement;
623
+ if (!(s instanceof HTMLElement))
624
+ return;
625
+ const i = s.scrollTop, a = Date.now() - G;
626
+ Math.abs(i - M) > ce && a < le && fe(t.event, e), M = i, G = Date.now();
627
+ }
628
+ const xe = _("scroll", de, !0), Y = "rapid_click";
629
+ function pe(t, e) {
630
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
631
+ if (!b(r)) {
632
+ const C = {
633
+ node_type: "unknown"
634
+ };
635
+ return l(
636
+ Y,
637
+ [
638
+ n("feature_list", "2-0-0", s),
639
+ n("session", "1-0-2", i),
640
+ n("element", "1-0-0", C),
641
+ o ? n("step", "1-0-0", o) : void 0,
642
+ a ? n("experience", "1-0-0", a) : void 0
643
+ ],
644
+ e
645
+ );
646
+ }
647
+ const c = T(r) || r, m = {
648
+ id: c.id || null,
649
+ node_type: c.nodeName.toLowerCase(),
650
+ label: E(k(c)),
651
+ text: E(v(c))
652
+ };
653
+ return l(
654
+ Y,
655
+ [
656
+ n("feature_list", "2-0-0", s),
657
+ n("session", "1-0-2", i),
658
+ n("element", "1-0-0", m),
659
+ o ? n("step", "1-0-0", o) : void 0,
660
+ a ? n("experience", "1-0-0", a) : void 0
661
+ ],
662
+ e
663
+ );
664
+ }
665
+ const me = u(Y, pe);
666
+ let N = 0, U = 0;
667
+ const Ee = 3, Ce = 500;
668
+ function ve(t, e) {
669
+ const s = (/* @__PURE__ */ new Date()).getTime();
670
+ s - U < Ce ? N++ : N = 1, U = s, N >= Ee && (me(t, e), N = 0);
671
+ }
672
+ const De = _("click", ve), B = "right_click";
673
+ function _e(t, e) {
674
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
675
+ if (!b(r)) {
676
+ const C = {
677
+ node_type: "unknown"
678
+ };
679
+ return l(B, [
680
+ n("feature_list", "2-0-0", s),
681
+ n("session", "1-0-2", i),
682
+ n("element", "1-0-0", C),
683
+ o ? n("step", "1-0-0", o) : void 0,
684
+ a ? n("experience", "1-0-0", a) : void 0
685
+ ]);
686
+ }
687
+ const c = T(r) || r, m = {
688
+ id: c.id || null,
689
+ node_type: c.nodeName.toLowerCase(),
690
+ label: E(k(c)),
691
+ text: E(v(c))
692
+ };
693
+ return l(
694
+ B,
695
+ [
696
+ n("feature_list", "2-0-0", s),
697
+ n("session", "1-0-2", i),
698
+ n("element", "1-0-0", m),
699
+ o ? n("step", "1-0-0", o) : void 0,
700
+ a ? n("experience", "1-0-0", a) : void 0
701
+ ],
702
+ e
703
+ );
704
+ }
705
+ const be = u(B, _e);
706
+ function Te(t, e) {
707
+ be(t, e);
708
+ }
709
+ const ke = _("contextmenu", Te), dt = "mouse_shake";
710
+ function $e(t, e) {
711
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
712
+ return l(
713
+ dt,
714
+ [
715
+ n("feature_list", "2-0-0", s),
716
+ n("session", "1-0-2", i),
717
+ o ? n("step", "1-0-0", o) : void 0,
718
+ a ? n("experience", "1-0-0", a) : void 0
719
+ ],
720
+ e
721
+ );
722
+ }
723
+ const ge = u(dt, $e), Le = 5, ye = 500, he = 500;
724
+ let z = { x: 0 }, g = [], I = 0;
725
+ const Ne = P(
726
+ (t, e) => {
727
+ ge(t, e);
728
+ },
729
+ ye
730
+ );
731
+ function we(t, e) {
732
+ const s = Date.now(), i = t.event.clientX - z.x, a = Math.sign(i);
733
+ s - I > he && (g = []), a !== 0 && (g.length === 0 || g[g.length - 1] !== a) && g.push(a), z = { x: t.event.clientX, y: t.event.clientY }, g.length >= Le && (Ne(t, e), g = []), I = s;
734
+ }
735
+ const Pe = _("mousemove", we), xt = "page_visible";
736
+ function Ve(t, e) {
737
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
738
+ return l(
739
+ xt,
740
+ [
741
+ n("feature_list", "2-0-0", s),
742
+ n("session", "1-0-2", i),
743
+ o ? n("step", "1-0-0", o) : void 0,
744
+ a ? n("experience", "1-0-0", a) : void 0
745
+ ],
746
+ e
747
+ );
748
+ }
749
+ const Se = u(xt, Ve), pt = "page_hidden";
750
+ function Ye(t, e) {
751
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
752
+ return l(
753
+ pt,
754
+ [
755
+ n("feature_list", "2-0-0", s),
756
+ n("session", "1-0-2", i),
757
+ o ? n("step", "1-0-0", o) : void 0,
758
+ a ? n("experience", "1-0-0", a) : void 0
759
+ ],
760
+ e
761
+ );
762
+ }
763
+ const Be = u(pt, Ye);
764
+ function He(t, e) {
765
+ if (document.visibilityState === "visible") {
766
+ Se(t, e);
767
+ return;
768
+ }
769
+ Be(t, e);
770
+ }
771
+ const qe = Ot("visibilitychange", He), H = "backspace";
772
+ function Ae(t, e) {
773
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
774
+ if (!b(r)) {
775
+ const C = {
776
+ node_type: "unknown"
777
+ };
778
+ return l(
779
+ H,
780
+ [
781
+ n("feature_list", "2-0-0", s),
782
+ n("session", "1-0-2", i),
783
+ n("element", "1-0-0", C),
784
+ o ? n("step", "1-0-0", o) : void 0,
785
+ a ? n("experience", "1-0-0", a) : void 0
786
+ ],
787
+ e
788
+ );
789
+ }
790
+ const c = T(r) || r, m = {
791
+ id: c.id || null,
792
+ node_type: c.nodeName.toLowerCase(),
793
+ label: E(k(c)),
794
+ text: E(v(c))
795
+ };
796
+ return l(
797
+ H,
798
+ [
799
+ n("feature_list", "2-0-0", s),
800
+ n("session", "1-0-2", i),
801
+ n("element", "1-0-0", m),
802
+ o ? n("step", "1-0-0", o) : void 0,
803
+ a ? n("experience", "1-0-0", a) : void 0
804
+ ],
805
+ e
806
+ );
807
+ }
808
+ const Fe = u(H, Ae);
809
+ function Re(t, e) {
810
+ t.event.key === "Backspace" && Fe(t, e);
811
+ }
812
+ const je = _("keydown", Re), mt = "page_hide";
813
+ function Oe(t, e) {
814
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
815
+ return l(
816
+ mt,
817
+ [
818
+ n("feature_list", "2-0-0", s),
819
+ n("session", "1-0-2", i),
820
+ o ? n("step", "1-0-0", o) : void 0,
821
+ a ? n("experience", "1-0-0", a) : void 0
822
+ ],
823
+ e
824
+ );
825
+ }
826
+ const We = u(mt, Oe);
827
+ function Me(t, e) {
828
+ We(t, e);
829
+ }
830
+ const Ge = y("pagehide", Me), Et = "page_show";
831
+ function Ue(t, e) {
832
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
833
+ return l(
834
+ Et,
835
+ [
836
+ n("feature_list", "2-0-0", s),
837
+ n("session", "1-0-2", i),
838
+ o ? n("step", "1-0-0", o) : void 0,
839
+ a ? n("experience", "1-0-0", a) : void 0
840
+ ],
841
+ e
842
+ );
843
+ }
844
+ const ze = u(Et, Ue);
845
+ function Ie(t, e) {
846
+ ze(t, e);
847
+ }
848
+ const Ke = y("pageshow", Ie), Ct = "offline";
849
+ function Xe(t, e) {
850
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
851
+ return l(
852
+ Ct,
853
+ [
854
+ n("feature_list", "2-0-0", s),
855
+ n("session", "1-0-2", i),
856
+ o ? n("step", "1-0-0", o) : void 0,
857
+ a ? n("experience", "1-0-0", a) : void 0
858
+ ],
859
+ e
860
+ );
861
+ }
862
+ const Je = u(Ct, Xe);
863
+ function Qe(t, e) {
864
+ Je(t, e);
865
+ }
866
+ const Ze = y("offline", Qe), q = "scroll";
867
+ function tn(t, e) {
868
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
869
+ if (!b(r))
870
+ return l(
871
+ q,
872
+ [
873
+ n("feature_list", "2-0-0", s),
874
+ n("session", "1-0-2", i),
875
+ o ? n("step", "1-0-0", o) : void 0,
876
+ a ? n("experience", "1-0-0", a) : void 0
877
+ ],
878
+ e
879
+ );
880
+ const c = T(r) || r, m = {
881
+ id: c.id || null,
882
+ node_type: c.nodeName.toLowerCase(),
883
+ label: E(k(c)),
884
+ text: E(v(c))
885
+ };
886
+ return l(
887
+ q,
888
+ [
889
+ n("feature_list", "2-0-0", s),
890
+ n("session", "1-0-2", i),
891
+ o ? n("step", "1-0-0", o) : void 0,
892
+ a ? n("experience", "1-0-0", a) : void 0,
893
+ n("element", "1-0-0", m)
894
+ ],
895
+ e
896
+ );
897
+ }
898
+ const en = u(q, tn), nn = P(
899
+ (t, e) => {
900
+ en(t, e);
901
+ },
902
+ 500
903
+ ), sn = _("scroll", nn, !0), vt = "online";
904
+ function on(t, e) {
905
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
906
+ return l(
907
+ vt,
908
+ [
909
+ n("feature_list", "2-0-0", s),
910
+ n("session", "1-0-2", i),
911
+ o ? n("step", "1-0-0", o) : void 0,
912
+ a ? n("experience", "1-0-0", a) : void 0
913
+ ],
914
+ e
915
+ );
916
+ }
917
+ const an = u(vt, on);
918
+ function rn(t, e) {
919
+ an(t, e);
920
+ }
921
+ const cn = y("online", rn), Dt = "resize";
922
+ function ln(t, e) {
923
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
924
+ return l(
925
+ Dt,
926
+ [
927
+ n("feature_list", "2-0-0", s),
928
+ n("session", "1-0-2", i),
929
+ o ? n("step", "1-0-0", o) : void 0,
930
+ a ? n("experience", "1-0-0", a) : void 0
931
+ ],
932
+ e
933
+ );
934
+ }
935
+ const K = u(Dt, ln);
936
+ let V = 0;
937
+ const un = P(
938
+ (t, e) => {
939
+ const s = window.innerWidth;
940
+ s !== V ? (K(t, e), V = s) : "ontouchstart" in window || K(t, e), V = s;
941
+ },
942
+ 300
943
+ ), fn = y("resize", un), _t = "unload";
944
+ function dn(t, e) {
945
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext);
946
+ return l(
947
+ _t,
948
+ [
949
+ n("feature_list", "2-0-0", s),
950
+ n("session", "1-0-2", i),
951
+ o ? n("step", "1-0-0", o) : void 0,
952
+ a ? n("experience", "1-0-0", a) : void 0
953
+ ],
954
+ e
955
+ );
956
+ }
957
+ const xn = u(_t, dn);
958
+ function pn(t, e) {
959
+ xn(t, e);
960
+ }
961
+ const mn = y("unload", pn), A = "click";
962
+ function En(t, e) {
963
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
964
+ if (!b(r)) {
965
+ const C = {
966
+ node_type: "unknown"
967
+ };
968
+ return l(
969
+ A,
970
+ [
971
+ n("feature_list", "2-0-0", s),
972
+ n("session", "1-0-2", i),
973
+ n("element", "1-0-0", C),
974
+ o ? n("step", "1-0-0", o) : void 0,
975
+ a ? n("experience", "1-0-0", a) : void 0
976
+ ],
977
+ e
978
+ );
979
+ }
980
+ const c = T(r) || r, m = {
981
+ id: c.id || null,
982
+ node_type: c.nodeName.toLowerCase(),
983
+ label: E(k(c)),
984
+ text: E(v(c))
985
+ };
986
+ return l(
987
+ A,
988
+ [
989
+ n("feature_list", "2-0-0", s),
990
+ n("session", "1-0-2", i),
991
+ n("element", "1-0-0", m),
992
+ o ? n("step", "1-0-0", o) : void 0,
993
+ a ? n("experience", "1-0-0", a) : void 0
994
+ ],
995
+ e
996
+ );
997
+ }
998
+ const Cn = u(A, En);
999
+ function vn(t, e) {
1000
+ Cn(t, e);
1001
+ }
1002
+ const Dn = _("click", vn), F = "paste";
1003
+ function _n(t, e) {
1004
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
1005
+ if (!b(r))
1006
+ return l(
1007
+ F,
1008
+ [
1009
+ n("feature_list", "2-0-0", s),
1010
+ n("session", "1-0-2", i),
1011
+ o ? n("step", "1-0-0", o) : void 0,
1012
+ a ? n("experience", "1-0-0", a) : void 0
1013
+ ],
1014
+ e
1015
+ );
1016
+ const c = T(r) || r, m = {
1017
+ id: c.id || null,
1018
+ node_type: c.nodeName.toLowerCase(),
1019
+ label: E(k(c)),
1020
+ text: E(v(c))
1021
+ };
1022
+ return l(
1023
+ F,
1024
+ [
1025
+ n("feature_list", "2-0-0", s),
1026
+ n("session", "1-0-2", i),
1027
+ o ? n("step", "1-0-0", o) : void 0,
1028
+ a ? n("experience", "1-0-0", a) : void 0,
1029
+ n("element", "1-0-0", m)
1030
+ ],
1031
+ e
1032
+ );
1033
+ }
1034
+ const bn = u(F, _n);
1035
+ function Tn(t, e) {
1036
+ bn(t, e);
1037
+ }
1038
+ const kn = _("paste", Tn), R = "copy";
1039
+ function $n(t, e) {
1040
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
1041
+ if (!b(r))
1042
+ return l(
1043
+ R,
1044
+ [
1045
+ n("feature_list", "2-0-0", s),
1046
+ n("session", "1-0-2", i),
1047
+ o ? n("step", "1-0-0", o) : void 0,
1048
+ a ? n("experience", "1-0-0", a) : void 0
1049
+ ],
1050
+ e
1051
+ );
1052
+ const c = T(r) || r, m = {
1053
+ id: c.id || null,
1054
+ node_type: c.nodeName.toLowerCase(),
1055
+ label: E(k(c)),
1056
+ text: E(v(c))
1057
+ };
1058
+ return l(
1059
+ R,
1060
+ [
1061
+ n("feature_list", "2-0-0", s),
1062
+ n("session", "1-0-2", i),
1063
+ o ? n("step", "1-0-0", o) : void 0,
1064
+ a ? n("experience", "1-0-0", a) : void 0,
1065
+ n("element", "1-0-0", m)
1066
+ ],
1067
+ e
1068
+ );
1069
+ }
1070
+ const gn = u(R, $n);
1071
+ function Ln(t, e) {
1072
+ gn(t, e);
1073
+ }
1074
+ const yn = _("copy", Ln), j = "drag";
1075
+ function hn(t, e) {
1076
+ const s = f(t.analyticsContext), i = d(t.analyticsContext), a = p(t.analyticsContext), o = x(t.analyticsContext), r = t.event.target || document.activeElement || t.event.currentTarget;
1077
+ if (!b(r))
1078
+ return l(
1079
+ j,
1080
+ [
1081
+ n("feature_list", "2-0-0", s),
1082
+ n("session", "1-0-2", i),
1083
+ o ? n("step", "1-0-0", o) : void 0,
1084
+ a ? n("experience", "1-0-0", a) : void 0
1085
+ ],
1086
+ e
1087
+ );
1088
+ const c = T(r) || r, m = {
1089
+ id: c.id || null,
1090
+ node_type: c.nodeName.toLowerCase(),
1091
+ label: E(k(c)),
1092
+ text: E(v(c))
1093
+ };
1094
+ return l(
1095
+ j,
1096
+ [
1097
+ n("feature_list", "2-0-0", s),
1098
+ n("session", "1-0-2", i),
1099
+ o ? n("step", "1-0-0", o) : void 0,
1100
+ a ? n("experience", "1-0-0", a) : void 0,
1101
+ n("element", "1-0-0", m)
1102
+ ],
1103
+ e
1104
+ );
1105
+ }
1106
+ const Nn = u(j, hn);
1107
+ function bt(t, e) {
1108
+ const s = t.event.currentTarget;
1109
+ if (!s || !(s instanceof HTMLElement))
1110
+ return;
1111
+ function i(a) {
1112
+ bt({ event: a, analyticsContext: t.analyticsContext });
1113
+ }
1114
+ s.removeEventListener("drag", i), s.addEventListener(
1115
+ "dragend",
1116
+ () => Tt(s, () => t.analyticsContext)
1117
+ ), Nn(t, e);
1118
+ }
1119
+ const Tt = _("drag", bt);
1120
+ function Jn(t, e) {
1121
+ e && (Dn(e, t), De(e, t), ke(e, t), yn(e, t), kn(e, t), Tt(e, t), je(e, t), sn(e, t), xe(e, t), Pe(e, t));
1122
+ }
1123
+ function Qn(t) {
1124
+ qe(t), Ge(t), Ke(t), Ze(t), cn(t), fn(t), mn(t);
1125
+ }
1126
+ export {
1127
+ Xn as A,
1128
+ d as a,
1129
+ Hn as b,
1130
+ u as c,
1131
+ p as d,
1132
+ x as e,
1133
+ f,
1134
+ l as g,
1135
+ n as h,
1136
+ qn as i,
1137
+ Q as j,
1138
+ O as k,
1139
+ Z as l,
1140
+ An as m,
1141
+ Jn as n,
1142
+ Qn as o,
1143
+ Rn as p,
1144
+ jn as q,
1145
+ On as r,
1146
+ Wn as s,
1147
+ Fn as t,
1148
+ Mn as u,
1149
+ Gn as v,
1150
+ Un as w,
1151
+ zn as x,
1152
+ In as y,
1153
+ Kn as z
1154
+ };