@levo-so/react 0.1.32 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{CheckboxWidget-Dedx-7Wy.js → CheckboxWidget-BrVNbP0R.js} +1 -1
- package/dist/{CollectionFormBuilder-BPzVyGLq.js → CollectionFormBuilder-CkD8uVKZ.js} +18 -18
- package/dist/{CurrencyWidget-CW3cMoYn.js → CurrencyWidget-D_q2AYWu.js} +1 -1
- package/dist/{DateTimeWidget-eKbj2Q86.js → DateTimeWidget-CsuCisSs.js} +1 -1
- package/dist/{DefaultFormVariant-DGecA_SF.js → DefaultFormVariant-rv38sBOZ.js} +2 -2
- package/dist/{DropdownWidget-DJ6rBFE0.js → DropdownWidget-CsTQ0Ojo.js} +1 -1
- package/dist/{EmailWidget-Bx3LTBSb.js → EmailWidget-Did2OUyB.js} +1 -1
- package/dist/{FormCaptcha-BVawlT6h.js → FormCaptcha-C_DxR2za.js} +2 -2
- package/dist/{GeocoderWidget-C_8wJijA.js → GeocoderWidget-CyzcaWxa.js} +9 -9
- package/dist/{MultiGeocoderWidget-0uUFNNoH.js → MultiGeocoderWidget-DgwiZ330.js} +2 -2
- package/dist/{MultiTextWidget-BluGgZVP.js → MultiTextWidget-Dic46WBU.js} +1 -1
- package/dist/{PhoneWidget-Mm6DmCsK.js → PhoneWidget-DKH-Wzgz.js} +1 -1
- package/dist/{RadioWidget-BkYAbg4o.js → RadioWidget-CTgWKCg2.js} +1 -1
- package/dist/{RichTextWidget-CbyT-y1E.js → RichTextWidget-C30H7mVF.js} +1 -1
- package/dist/{StepsFormVariant-Bk_rc3R7.js → StepsFormVariant-myT97AwJ.js} +2 -2
- package/dist/{SwitchWidget-DeCIh2Vm.js → SwitchWidget-BS-rmHiq.js} +1 -1
- package/dist/{TextWidget-Di_db2UE.js → TextWidget-aNB-0vc-.js} +1 -1
- package/dist/{TextareaWidget-CZqLQQAK.js → TextareaWidget-CEH-97Oj.js} +1 -1
- package/dist/{ToggleCheckboxWidget-Dynr-C0Y.js → ToggleCheckboxWidget-C0buyS29.js} +1 -1
- package/dist/{URLWidget-BvQvn0aZ.js → URLWidget-DrZlRAD7.js} +2 -2
- package/dist/{UploadWidget-mRgEWRVS.js → UploadWidget-Bw7urh-7.js} +2 -2
- package/dist/audience/components/page.d.ts.map +1 -1
- package/dist/audience/hooks/useDownloadSpeed.d.ts +3 -0
- package/dist/audience/hooks/useDownloadSpeed.d.ts.map +1 -0
- package/dist/audience/hooks/usePerformanceMetrics.d.ts +11 -5
- package/dist/audience/hooks/usePerformanceMetrics.d.ts.map +1 -1
- package/dist/audience/hooks/useScrollBehavior.d.ts +9 -0
- package/dist/audience/hooks/useScrollBehavior.d.ts.map +1 -0
- package/dist/audience/hooks/useTextSelection.d.ts +3 -0
- package/dist/audience/hooks/useTextSelection.d.ts.map +1 -0
- package/dist/audience/index.js +1 -1
- package/dist/audience/utils/autocapture.d.ts.map +1 -1
- package/dist/collection/index.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.js +9 -9
- package/dist/membership/index.js +1 -1
- package/dist/page-BaAkHGtG.js +562 -0
- package/dist/providers/LevoProvider.d.ts.map +1 -1
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.js +169 -0
- package/package.json +8 -4
- package/dist/LevoProvider-BAZy7_tP.js +0 -223
- package/dist/audience/hooks/useScrollDepth.d.ts +0 -6
- package/dist/audience/hooks/useScrollDepth.d.ts.map +0 -1
- package/dist/page-BjcgPmsH.js +0 -478
package/dist/page-BjcgPmsH.js
DELETED
|
@@ -1,478 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var nt = Object.defineProperty;
|
|
3
|
-
var rt = (t, n, e) => n in t ? nt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
4
|
-
var P = (t, n, e) => rt(t, typeof n != "symbol" ? n + "" : n, e);
|
|
5
|
-
import { j as ot } from "./jsx-runtime-B6kdoens.js";
|
|
6
|
-
import { useEffect as d, useState as b } from "react";
|
|
7
|
-
import { useInView as st } from "react-intersection-observer";
|
|
8
|
-
import { u as S } from "./LevoProvider-BAZy7_tP.js";
|
|
9
|
-
import { usePageLifecycle as it, LifecycleState as E } from "use-page-lifecycle";
|
|
10
|
-
const de = ({ id: t, properties: n = {} }) => {
|
|
11
|
-
const { audience: e } = S(), { ref: r, inView: o } = st({
|
|
12
|
-
triggerOnce: !0
|
|
13
|
-
});
|
|
14
|
-
return d(() => {
|
|
15
|
-
e != null && e.instance && o && (e == null || e.track("block.view", {
|
|
16
|
-
...n,
|
|
17
|
-
resource: "block",
|
|
18
|
-
identifier: t
|
|
19
|
-
}));
|
|
20
|
-
}, [o]), /* @__PURE__ */ ot.jsx("div", { ref: r, style: { height: "0px" } });
|
|
21
|
-
}, le = ({ event: t, properties: n }) => {
|
|
22
|
-
const { audience: e } = S();
|
|
23
|
-
return d(() => {
|
|
24
|
-
e != null && e.instance && (e == null || e.track(t, n));
|
|
25
|
-
}, [e == null ? void 0 : e.instance, t, n]), null;
|
|
26
|
-
};
|
|
27
|
-
function R(t) {
|
|
28
|
-
var n = typeof t;
|
|
29
|
-
return t != null && (n == "object" || n == "function");
|
|
30
|
-
}
|
|
31
|
-
var ct = typeof global == "object" && global && global.Object === Object && global, at = typeof self == "object" && self && self.Object === Object && self, W = ct || at || Function("return this")(), N = function() {
|
|
32
|
-
return W.Date.now();
|
|
33
|
-
}, ut = /\s/;
|
|
34
|
-
function ft(t) {
|
|
35
|
-
for (var n = t.length; n-- && ut.test(t.charAt(n)); )
|
|
36
|
-
;
|
|
37
|
-
return n;
|
|
38
|
-
}
|
|
39
|
-
var dt = /^\s+/;
|
|
40
|
-
function lt(t) {
|
|
41
|
-
return t && t.slice(0, ft(t) + 1).replace(dt, "");
|
|
42
|
-
}
|
|
43
|
-
var L = W.Symbol, G = Object.prototype, gt = G.hasOwnProperty, pt = G.toString, y = L ? L.toStringTag : void 0;
|
|
44
|
-
function mt(t) {
|
|
45
|
-
var n = gt.call(t, y), e = t[y];
|
|
46
|
-
try {
|
|
47
|
-
t[y] = void 0;
|
|
48
|
-
var r = !0;
|
|
49
|
-
} catch {
|
|
50
|
-
}
|
|
51
|
-
var o = pt.call(t);
|
|
52
|
-
return r && (n ? t[y] = e : delete t[y]), o;
|
|
53
|
-
}
|
|
54
|
-
var ht = Object.prototype, bt = ht.toString;
|
|
55
|
-
function wt(t) {
|
|
56
|
-
return bt.call(t);
|
|
57
|
-
}
|
|
58
|
-
var yt = "[object Null]", vt = "[object Undefined]", U = L ? L.toStringTag : void 0;
|
|
59
|
-
function St(t) {
|
|
60
|
-
return t == null ? t === void 0 ? vt : yt : U && U in Object(t) ? mt(t) : wt(t);
|
|
61
|
-
}
|
|
62
|
-
function Tt(t) {
|
|
63
|
-
return t != null && typeof t == "object";
|
|
64
|
-
}
|
|
65
|
-
var Et = "[object Symbol]";
|
|
66
|
-
function Lt(t) {
|
|
67
|
-
return typeof t == "symbol" || Tt(t) && St(t) == Et;
|
|
68
|
-
}
|
|
69
|
-
var F = NaN, xt = /^[-+]0x[0-9a-f]+$/i, Ct = /^0b[01]+$/i, _t = /^0o[0-7]+$/i, kt = parseInt;
|
|
70
|
-
function H(t) {
|
|
71
|
-
if (typeof t == "number")
|
|
72
|
-
return t;
|
|
73
|
-
if (Lt(t))
|
|
74
|
-
return F;
|
|
75
|
-
if (R(t)) {
|
|
76
|
-
var n = typeof t.valueOf == "function" ? t.valueOf() : t;
|
|
77
|
-
t = R(n) ? n + "" : n;
|
|
78
|
-
}
|
|
79
|
-
if (typeof t != "string")
|
|
80
|
-
return t === 0 ? t : +t;
|
|
81
|
-
t = lt(t);
|
|
82
|
-
var e = Ct.test(t);
|
|
83
|
-
return e || _t.test(t) ? kt(t.slice(2), e ? 2 : 8) : xt.test(t) ? F : +t;
|
|
84
|
-
}
|
|
85
|
-
var Nt = "Expected a function", Ot = Math.max, It = Math.min;
|
|
86
|
-
function Rt(t, n, e) {
|
|
87
|
-
var r, o, c, a, s, i, u = 0, g = !1, l = !1, p = !0;
|
|
88
|
-
if (typeof t != "function")
|
|
89
|
-
throw new TypeError(Nt);
|
|
90
|
-
n = H(n) || 0, R(e) && (g = !!e.leading, l = "maxWait" in e, c = l ? Ot(H(e.maxWait) || 0, n) : c, p = "trailing" in e ? !!e.trailing : p);
|
|
91
|
-
function _(f) {
|
|
92
|
-
var m = r, w = o;
|
|
93
|
-
return r = o = void 0, u = f, a = t.apply(w, m), a;
|
|
94
|
-
}
|
|
95
|
-
function q(f) {
|
|
96
|
-
return u = f, s = setTimeout(T, n), g ? _(f) : a;
|
|
97
|
-
}
|
|
98
|
-
function Q(f) {
|
|
99
|
-
var m = f - i, w = f - u, D = n - m;
|
|
100
|
-
return l ? It(D, c - w) : D;
|
|
101
|
-
}
|
|
102
|
-
function $(f) {
|
|
103
|
-
var m = f - i, w = f - u;
|
|
104
|
-
return i === void 0 || m >= n || m < 0 || l && w >= c;
|
|
105
|
-
}
|
|
106
|
-
function T() {
|
|
107
|
-
var f = N();
|
|
108
|
-
if ($(f))
|
|
109
|
-
return M(f);
|
|
110
|
-
s = setTimeout(T, Q(f));
|
|
111
|
-
}
|
|
112
|
-
function M(f) {
|
|
113
|
-
return s = void 0, p && r ? _(f) : (r = o = void 0, a);
|
|
114
|
-
}
|
|
115
|
-
function tt() {
|
|
116
|
-
s !== void 0 && clearTimeout(s), u = 0, r = i = o = s = void 0;
|
|
117
|
-
}
|
|
118
|
-
function et() {
|
|
119
|
-
return s === void 0 ? a : M(N());
|
|
120
|
-
}
|
|
121
|
-
function k() {
|
|
122
|
-
var f = N(), m = $(f);
|
|
123
|
-
if (r = arguments, o = this, i = f, m) {
|
|
124
|
-
if (s === void 0)
|
|
125
|
-
return q(i);
|
|
126
|
-
if (l)
|
|
127
|
-
return clearTimeout(s), s = setTimeout(T, n), _(i);
|
|
128
|
-
}
|
|
129
|
-
return s === void 0 && (s = setTimeout(T, n)), a;
|
|
130
|
-
}
|
|
131
|
-
return k.cancel = tt, k.flush = et, k;
|
|
132
|
-
}
|
|
133
|
-
const At = () => {
|
|
134
|
-
const [t, n] = b(0), [e, r] = b(0), o = Rt((c) => {
|
|
135
|
-
r(c), n(c);
|
|
136
|
-
}, 250);
|
|
137
|
-
return d(() => {
|
|
138
|
-
const c = () => {
|
|
139
|
-
const a = window.scrollY, s = document.documentElement.scrollHeight, i = window.innerHeight, u = Math.round(
|
|
140
|
-
a / (s - i) * 100
|
|
141
|
-
);
|
|
142
|
-
u % 10 === 0 && u > e && o(u);
|
|
143
|
-
};
|
|
144
|
-
return window.addEventListener("scroll", c), () => window.removeEventListener("scroll", c);
|
|
145
|
-
}, [e]), t;
|
|
146
|
-
}, v = "lv_insights_ot", jt = () => {
|
|
147
|
-
const [t, n] = b(0);
|
|
148
|
-
return d(() => {
|
|
149
|
-
const e = Number(localStorage.getItem(v)) || 0;
|
|
150
|
-
n(e), localStorage.setItem(v, (e + 1).toString());
|
|
151
|
-
const r = (c) => {
|
|
152
|
-
c.key === v && n(Number(c.newValue) || 0);
|
|
153
|
-
};
|
|
154
|
-
window.addEventListener("storage", r);
|
|
155
|
-
const o = () => {
|
|
156
|
-
const c = Number(localStorage.getItem(v)) || 0;
|
|
157
|
-
c > 0 && localStorage.setItem(v, (c - 1).toString());
|
|
158
|
-
};
|
|
159
|
-
return window.addEventListener("beforeunload", o), () => {
|
|
160
|
-
window.removeEventListener("storage", r), window.removeEventListener("beforeunload", o);
|
|
161
|
-
};
|
|
162
|
-
}, []), t;
|
|
163
|
-
}, B = "lv_insights_ct", O = "lv_insights_at", $t = () => {
|
|
164
|
-
const [t, n] = b(null);
|
|
165
|
-
return d(() => {
|
|
166
|
-
let e = sessionStorage.getItem(B);
|
|
167
|
-
const r = JSON.parse(
|
|
168
|
-
localStorage.getItem(O) || "[]"
|
|
169
|
-
);
|
|
170
|
-
e && r.includes(e) && (e = null), e || (e = `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, sessionStorage.setItem(B, e)), r.includes(e) || (r.push(e), localStorage.setItem(
|
|
171
|
-
O,
|
|
172
|
-
JSON.stringify(r)
|
|
173
|
-
)), n(e);
|
|
174
|
-
const o = () => {
|
|
175
|
-
const c = r.filter(
|
|
176
|
-
(a) => a !== e
|
|
177
|
-
);
|
|
178
|
-
localStorage.setItem(
|
|
179
|
-
O,
|
|
180
|
-
JSON.stringify(c)
|
|
181
|
-
);
|
|
182
|
-
};
|
|
183
|
-
return window.addEventListener("beforeunload", o), () => {
|
|
184
|
-
window.removeEventListener("beforeunload", o);
|
|
185
|
-
};
|
|
186
|
-
}, []), t;
|
|
187
|
-
}, x = (t) => Object.prototype.toString.call(t) == "[object String]", Mt = (t, n) => t.indexOf(n) !== -1, C = (t) => t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""), K = (t) => t === void 0, Dt = (t) => t === null, V = (t) => K(t) || Dt(t), Y = (t) => !!t && (t == null ? void 0 : t.nodeType) === 3;
|
|
188
|
-
function Pt(t) {
|
|
189
|
-
return !!t && (t == null ? void 0 : t.nodeType) === 1;
|
|
190
|
-
}
|
|
191
|
-
function Ut(t, n) {
|
|
192
|
-
return !!t && !!(t != null && t.tagName) && (t == null ? void 0 : t.tagName.toLowerCase()) === n.toLowerCase();
|
|
193
|
-
}
|
|
194
|
-
function Ft(t) {
|
|
195
|
-
return t ? C(t).split(/\s+/) : [];
|
|
196
|
-
}
|
|
197
|
-
function Ht(t) {
|
|
198
|
-
let n = "";
|
|
199
|
-
switch (typeof (t == null ? void 0 : t.className)) {
|
|
200
|
-
case "string":
|
|
201
|
-
n = t == null ? void 0 : t.className;
|
|
202
|
-
break;
|
|
203
|
-
case "object":
|
|
204
|
-
n = (t != null && t.className && "baseVal" in (t == null ? void 0 : t.className) ? (t == null ? void 0 : t.className).baseVal : null) || (t == null ? void 0 : t.getAttribute("class")) || "";
|
|
205
|
-
break;
|
|
206
|
-
default:
|
|
207
|
-
n = "";
|
|
208
|
-
}
|
|
209
|
-
return Ft(n);
|
|
210
|
-
}
|
|
211
|
-
const h = (t, n = 255) => V(t) ? "" : C(t).split(/(\s+)/).filter((e) => j(e)).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, n), A = (t) => {
|
|
212
|
-
let n = "";
|
|
213
|
-
if (Gt(t) && // !isSensitiveElement(el) &&
|
|
214
|
-
(t != null && t.childNodes) && (t != null && t.childNodes.length))
|
|
215
|
-
for (const e of t == null ? void 0 : t.childNodes)
|
|
216
|
-
Y(e) && e.textContent && (n += h(e.textContent) ?? "");
|
|
217
|
-
return C(n);
|
|
218
|
-
}, Bt = (t) => {
|
|
219
|
-
var n, e;
|
|
220
|
-
return K(t.target) ? (t == null ? void 0 : t.srcElement) || null : (n = t == null ? void 0 : t.target) != null && n.shadowRoot ? ((e = t == null ? void 0 : t.composedPath()) == null ? void 0 : e[0]) || null : (t == null ? void 0 : t.target) || null;
|
|
221
|
-
}, Wt = (t, n) => {
|
|
222
|
-
if (!window || !t || Ut(t, "html") || !Pt(t))
|
|
223
|
-
return !1;
|
|
224
|
-
const e = window.getComputedStyle(t);
|
|
225
|
-
if (e && e.getPropertyValue("cursor") === "pointer" && n.type === "click")
|
|
226
|
-
return !0;
|
|
227
|
-
switch (t == null ? void 0 : t.tagName.toLowerCase()) {
|
|
228
|
-
case "html":
|
|
229
|
-
return !1;
|
|
230
|
-
case "form":
|
|
231
|
-
return n.type === "submit";
|
|
232
|
-
case "input":
|
|
233
|
-
case "select":
|
|
234
|
-
case "textarea":
|
|
235
|
-
return ["change", "click"].includes(n.type);
|
|
236
|
-
default:
|
|
237
|
-
return n.type === "click";
|
|
238
|
-
}
|
|
239
|
-
};
|
|
240
|
-
function Gt(t) {
|
|
241
|
-
if (Mt(Ht(t), "ph-include"))
|
|
242
|
-
return !0;
|
|
243
|
-
const n = t.type || "";
|
|
244
|
-
if (x(n))
|
|
245
|
-
switch (n.toLowerCase()) {
|
|
246
|
-
case "hidden":
|
|
247
|
-
return !1;
|
|
248
|
-
case "password":
|
|
249
|
-
return !1;
|
|
250
|
-
}
|
|
251
|
-
const e = t.name || (t == null ? void 0 : t.id) || "";
|
|
252
|
-
return !(x(e) && /^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(e.replace(/[^a-zA-Z0-9]/g, "")));
|
|
253
|
-
}
|
|
254
|
-
const J = "(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})", Kt = new RegExp(`^(?:${J})$`), Vt = new RegExp(J), X = "\\d{3}-?\\d{2}-?\\d{4}", Yt = new RegExp(`^(${X})$`), Jt = new RegExp(`(${X})`), j = (t, n = !0) => !(V(t) || x(t) && (t = C(t), (n ? Kt : Vt).test((t || "").replace(/[- ]/g, "")) || (n ? Yt : Jt).test(t))), Xt = (t) => x(t) ? t.substring(0, 10) === "_ngcontent" || t.substring(0, 7) === "_nghost" : !1, zt = (t) => {
|
|
255
|
-
let n = A(t);
|
|
256
|
-
return n = `${n} ${z(t)}`.trim(), j(n) ? n : "";
|
|
257
|
-
};
|
|
258
|
-
function z(t) {
|
|
259
|
-
var e;
|
|
260
|
-
let n = "";
|
|
261
|
-
if (t != null && t.childNodes.length) {
|
|
262
|
-
for (const r of t.childNodes)
|
|
263
|
-
if (r && ((e = r.tagName) == null ? void 0 : e.toLowerCase()) === "span")
|
|
264
|
-
try {
|
|
265
|
-
const o = A(r);
|
|
266
|
-
n = `${n} ${o}`.trim(), r != null && r.childNodes.length && (n = `${n} ${z(r)}`.trim());
|
|
267
|
-
} catch {
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
return n;
|
|
271
|
-
}
|
|
272
|
-
const Zt = ["input", "textarea", "select"], Z = (t) => {
|
|
273
|
-
var o, c, a;
|
|
274
|
-
const n = t.tagName.toLowerCase(), e = {
|
|
275
|
-
element: n
|
|
276
|
-
};
|
|
277
|
-
n.toLowerCase() === "a" || n.toLowerCase() === "button" ? e.text = zt(t) : e.text = A(t);
|
|
278
|
-
const r = Array.from(t.attributes).reduce(
|
|
279
|
-
(s, i) => {
|
|
280
|
-
if (j(i.value) && !Xt(i.name)) {
|
|
281
|
-
if (i.name === "class")
|
|
282
|
-
return s;
|
|
283
|
-
s[i.name] = typeof (i == null ? void 0 : i.value) == "string" ? h(i.value) : i.value;
|
|
284
|
-
}
|
|
285
|
-
return s;
|
|
286
|
-
},
|
|
287
|
-
{}
|
|
288
|
-
);
|
|
289
|
-
if (e.attributes = r, Zt.includes(n) || (t == null ? void 0 : t.getAttribute("contenteditable")) === "true") {
|
|
290
|
-
let s;
|
|
291
|
-
t.matches('input[type="checkbox"], input[type="radio"]') ? s = t.checked : t.matches("input, select, textarea") && !t.matches('input[type="password"]') && (s = t.value), s !== void 0 && (e.value = typeof s == "string" || s === null ? h(s, 1024) : s);
|
|
292
|
-
let i = "";
|
|
293
|
-
e != null && e.attributes.id && (i = h(
|
|
294
|
-
((c = (o = document.querySelector(`label[for="${e == null ? void 0 : e.attributes.id}"]`)) == null ? void 0 : o.textContent) == null ? void 0 : c.trim()) || ""
|
|
295
|
-
));
|
|
296
|
-
const u = t.closest("label");
|
|
297
|
-
i || (i = h(((a = u == null ? void 0 : u.textContent) == null ? void 0 : a.trim()) || "")), i && (e.label = i);
|
|
298
|
-
}
|
|
299
|
-
return e;
|
|
300
|
-
}, qt = (t, n) => {
|
|
301
|
-
var o;
|
|
302
|
-
let e = Bt(t);
|
|
303
|
-
Y(e) && (e = e.parentNode || null);
|
|
304
|
-
const r = ["copy", "cut"].includes(n);
|
|
305
|
-
if (e && (Wt(e, t) || r)) {
|
|
306
|
-
const c = Z(e);
|
|
307
|
-
if (r) {
|
|
308
|
-
const a = h((o = window == null ? void 0 : window.getSelection()) == null ? void 0 : o.toString()), s = (t == null ? void 0 : t.type) || "clipboard";
|
|
309
|
-
c.copy_text = a ?? "", c.copy_type = s ?? "";
|
|
310
|
-
}
|
|
311
|
-
return c;
|
|
312
|
-
}
|
|
313
|
-
return null;
|
|
314
|
-
}, Qt = 30, te = 1e3, ee = 3;
|
|
315
|
-
class ne {
|
|
316
|
-
constructor() {
|
|
317
|
-
P(this, "clicks");
|
|
318
|
-
this.clicks = [];
|
|
319
|
-
}
|
|
320
|
-
isRageClick(n, e, r) {
|
|
321
|
-
const o = this.clicks[this.clicks.length - 1];
|
|
322
|
-
if (o && Math.abs(n - o.x) + Math.abs(e - o.y) < Qt && r - o.timestamp < te) {
|
|
323
|
-
if (this.clicks.push({ x: n, y: e, timestamp: r }), this.clicks.length === ee)
|
|
324
|
-
return !0;
|
|
325
|
-
} else
|
|
326
|
-
this.clicks = [{ x: n, y: e, timestamp: r }];
|
|
327
|
-
return !1;
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
|
-
const I = new ne(), re = () => {
|
|
331
|
-
const { audience: t } = S();
|
|
332
|
-
d(() => {
|
|
333
|
-
const n = (e) => {
|
|
334
|
-
try {
|
|
335
|
-
let r = {
|
|
336
|
-
hostname: window.location.hostname,
|
|
337
|
-
pathname: window.location.pathname,
|
|
338
|
-
page_title: document.title,
|
|
339
|
-
url: window.location.href,
|
|
340
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString(),
|
|
341
|
-
event_type: e.type,
|
|
342
|
-
button_type: e.button
|
|
343
|
-
};
|
|
344
|
-
if (e.target instanceof HTMLElement) {
|
|
345
|
-
const o = e.target;
|
|
346
|
-
r.rage_click = I == null ? void 0 : I.isRageClick(
|
|
347
|
-
e.clientX,
|
|
348
|
-
e.clientY,
|
|
349
|
-
(/* @__PURE__ */ new Date()).getTime()
|
|
350
|
-
), r = {
|
|
351
|
-
...r,
|
|
352
|
-
...Z(o)
|
|
353
|
-
};
|
|
354
|
-
let c = o == null ? void 0 : o.getAttribute("href");
|
|
355
|
-
if (!c) {
|
|
356
|
-
let a = o.parentNode, s = 0;
|
|
357
|
-
for (; a && s < 8; ) {
|
|
358
|
-
const i = a == null ? void 0 : a.getAttribute(
|
|
359
|
-
"href"
|
|
360
|
-
);
|
|
361
|
-
if (i) {
|
|
362
|
-
c = i;
|
|
363
|
-
break;
|
|
364
|
-
}
|
|
365
|
-
a = a.parentNode, s++;
|
|
366
|
-
}
|
|
367
|
-
}
|
|
368
|
-
t == null || t.track("page.click", {
|
|
369
|
-
...r,
|
|
370
|
-
href: c || void 0
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
} catch (r) {
|
|
374
|
-
console.error(r);
|
|
375
|
-
}
|
|
376
|
-
};
|
|
377
|
-
return document.addEventListener("click", n), () => {
|
|
378
|
-
document.removeEventListener("click", n);
|
|
379
|
-
};
|
|
380
|
-
}, [t]);
|
|
381
|
-
}, oe = (t) => {
|
|
382
|
-
const { audience: n } = S(), [, e] = b({
|
|
383
|
-
page_loaded_at: performance.timeOrigin,
|
|
384
|
-
script_load: performance.now(),
|
|
385
|
-
first_contentful_paint: null,
|
|
386
|
-
window_onload: null
|
|
387
|
-
}), [r, o] = b(
|
|
388
|
-
null
|
|
389
|
-
);
|
|
390
|
-
return d(() => {
|
|
391
|
-
let c = !0;
|
|
392
|
-
const a = (u) => {
|
|
393
|
-
c && e((g) => {
|
|
394
|
-
const l = { ...g, ...u };
|
|
395
|
-
return Object.values(l).every((p) => p !== null) && o(l), l;
|
|
396
|
-
});
|
|
397
|
-
}, s = new PerformanceObserver((u) => {
|
|
398
|
-
for (const g of u.getEntries())
|
|
399
|
-
g.name === "first-contentful-paint" && a({ first_contentful_paint: g.startTime });
|
|
400
|
-
});
|
|
401
|
-
s.observe({ type: "paint", buffered: !0 });
|
|
402
|
-
const i = () => a({ window_onload: performance.now() });
|
|
403
|
-
return document.readyState === "complete" ? i() : window.addEventListener("load", i), () => {
|
|
404
|
-
c = !1, s.disconnect(), window.removeEventListener("load", i);
|
|
405
|
-
};
|
|
406
|
-
}, [t]), d(() => {
|
|
407
|
-
r && n && (n == null || n.track("page.metrics", r));
|
|
408
|
-
}, [r, n]), r;
|
|
409
|
-
}, ge = ({ id: t, properties: n = {} }) => {
|
|
410
|
-
const e = typeof window < "u" ? window.location.href : "", { client: r, audience: o } = S();
|
|
411
|
-
d(() => {
|
|
412
|
-
r && typeof window < "u" && (window.levo_client = r);
|
|
413
|
-
}, [r]), d(() => {
|
|
414
|
-
o && typeof window < "u" && (window.levo_audience = o);
|
|
415
|
-
}, [o]), jt(), $t(), re();
|
|
416
|
-
const c = At();
|
|
417
|
-
d(() => {
|
|
418
|
-
o != null && o.instance && o.track("page.scroll", {
|
|
419
|
-
resource: "page",
|
|
420
|
-
identifier: t,
|
|
421
|
-
percent: c
|
|
422
|
-
});
|
|
423
|
-
}, [o == null ? void 0 : o.instance, c, t]), oe(e), d(() => {
|
|
424
|
-
const s = () => {
|
|
425
|
-
o == null || o.bounce({
|
|
426
|
-
resource: "page",
|
|
427
|
-
identifier: t
|
|
428
|
-
});
|
|
429
|
-
};
|
|
430
|
-
return window && window.addEventListener("beforeunload", s), () => {
|
|
431
|
-
window && window.removeEventListener("beforeunload", s);
|
|
432
|
-
};
|
|
433
|
-
}, [o, t]);
|
|
434
|
-
const [a] = it();
|
|
435
|
-
return d(() => {
|
|
436
|
-
(a === E.TERMINATED || a === E.HIDDEN || a === E.UNKNOWN || a === E.FROZEN) && (o == null || o.bounce({
|
|
437
|
-
resource: "page",
|
|
438
|
-
identifier: t,
|
|
439
|
-
state: a
|
|
440
|
-
}));
|
|
441
|
-
}, [a, o, t]), d(() => {
|
|
442
|
-
(() => {
|
|
443
|
-
r != null && r.insightsUrl && r.workspace && e && (o != null && o.instance ? o.instance.page({
|
|
444
|
-
resource: "page",
|
|
445
|
-
identifier: t
|
|
446
|
-
}) : o == null || o.initiate({
|
|
447
|
-
...n,
|
|
448
|
-
id: t,
|
|
449
|
-
created_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
450
|
-
}));
|
|
451
|
-
})();
|
|
452
|
-
}, [r == null ? void 0 : r.insightsUrl, r == null ? void 0 : r.workspace, e]), d(() => {
|
|
453
|
-
const s = {
|
|
454
|
-
change: "form.change",
|
|
455
|
-
submit: "form.submit",
|
|
456
|
-
copy: "page.copy",
|
|
457
|
-
cut: "page.copy"
|
|
458
|
-
}, i = (g) => (l) => {
|
|
459
|
-
const p = qt(l, g);
|
|
460
|
-
p && (o == null || o.track(s[g], p));
|
|
461
|
-
}, u = {
|
|
462
|
-
change: i("change"),
|
|
463
|
-
copy: i("copy"),
|
|
464
|
-
cut: i("cut"),
|
|
465
|
-
submit: i("submit")
|
|
466
|
-
};
|
|
467
|
-
return document.addEventListener("change", u.change), document.addEventListener("copy", u.copy), document.addEventListener("cut", u.cut), document.addEventListener("submit", u.submit), () => {
|
|
468
|
-
document.removeEventListener("change", u.change), document.removeEventListener("copy", u.copy), document.removeEventListener("cut", u.cut), document.removeEventListener("submit", u.submit);
|
|
469
|
-
};
|
|
470
|
-
}, []), (!(r != null && r.insightsUrl) || !r.workspace || !r.workspace.startsWith("W")) && console.error(
|
|
471
|
-
"[@levo-so/react] The utility could not be initialized, due to missing workspace, or endpoint for insights."
|
|
472
|
-
), null;
|
|
473
|
-
};
|
|
474
|
-
export {
|
|
475
|
-
de as L,
|
|
476
|
-
le as a,
|
|
477
|
-
ge as b
|
|
478
|
-
};
|