@picked/analytics 0.0.1-dev.1769111007589 → 0.0.1-dev.1769473835566

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