@picked/analytics 0.0.1-dev.1756875690387 → 0.0.1-dev.1762750479117

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