@levo-so/react 0.1.32 → 0.1.33

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 (32) hide show
  1. package/dist/{CheckboxWidget-Dedx-7Wy.js → CheckboxWidget-BrVNbP0R.js} +1 -1
  2. package/dist/{CollectionFormBuilder-BPzVyGLq.js → CollectionFormBuilder-CkD8uVKZ.js} +18 -18
  3. package/dist/{CurrencyWidget-CW3cMoYn.js → CurrencyWidget-D_q2AYWu.js} +1 -1
  4. package/dist/{DateTimeWidget-eKbj2Q86.js → DateTimeWidget-CsuCisSs.js} +1 -1
  5. package/dist/{DefaultFormVariant-DGecA_SF.js → DefaultFormVariant-rv38sBOZ.js} +2 -2
  6. package/dist/{DropdownWidget-DJ6rBFE0.js → DropdownWidget-CsTQ0Ojo.js} +1 -1
  7. package/dist/{EmailWidget-Bx3LTBSb.js → EmailWidget-Did2OUyB.js} +1 -1
  8. package/dist/{FormCaptcha-BVawlT6h.js → FormCaptcha-C_DxR2za.js} +2 -2
  9. package/dist/{GeocoderWidget-C_8wJijA.js → GeocoderWidget-CyzcaWxa.js} +9 -9
  10. package/dist/{MultiGeocoderWidget-0uUFNNoH.js → MultiGeocoderWidget-DgwiZ330.js} +2 -2
  11. package/dist/{MultiTextWidget-BluGgZVP.js → MultiTextWidget-Dic46WBU.js} +1 -1
  12. package/dist/{PhoneWidget-Mm6DmCsK.js → PhoneWidget-DKH-Wzgz.js} +1 -1
  13. package/dist/{RadioWidget-BkYAbg4o.js → RadioWidget-CTgWKCg2.js} +1 -1
  14. package/dist/{RichTextWidget-CbyT-y1E.js → RichTextWidget-C30H7mVF.js} +1 -1
  15. package/dist/{StepsFormVariant-Bk_rc3R7.js → StepsFormVariant-myT97AwJ.js} +2 -2
  16. package/dist/{SwitchWidget-DeCIh2Vm.js → SwitchWidget-BS-rmHiq.js} +1 -1
  17. package/dist/{TextWidget-Di_db2UE.js → TextWidget-aNB-0vc-.js} +1 -1
  18. package/dist/{TextareaWidget-CZqLQQAK.js → TextareaWidget-CEH-97Oj.js} +1 -1
  19. package/dist/{ToggleCheckboxWidget-Dynr-C0Y.js → ToggleCheckboxWidget-C0buyS29.js} +1 -1
  20. package/dist/{URLWidget-BvQvn0aZ.js → URLWidget-DrZlRAD7.js} +2 -2
  21. package/dist/{UploadWidget-mRgEWRVS.js → UploadWidget-Bw7urh-7.js} +2 -2
  22. package/dist/audience/hooks/usePerformanceMetrics.d.ts.map +1 -1
  23. package/dist/audience/index.js +1 -1
  24. package/dist/collection/index.js +1 -1
  25. package/dist/index.js +9 -9
  26. package/dist/membership/index.js +1 -1
  27. package/dist/{page-BjcgPmsH.js → page-BVeU7Dl9.js} +132 -132
  28. package/dist/providers/LevoProvider.d.ts.map +1 -1
  29. package/dist/providers/index.d.ts +2 -0
  30. package/dist/providers/index.js +169 -0
  31. package/package.json +6 -2
  32. package/dist/LevoProvider-BAZy7_tP.js +0 -223
@@ -1,14 +1,14 @@
1
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";
2
+ var rt = Object.defineProperty;
3
+ var ot = (t, n, e) => n in t ? rt(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
4
+ var F = (t, n, e) => ot(t, typeof n != "symbol" ? n + "" : n, e);
5
+ import { j as st } from "./jsx-runtime-B6kdoens.js";
6
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({
7
+ import { useInView as it } from "react-intersection-observer";
8
+ import { useLevo as S } from "./providers/index.js";
9
+ import { usePageLifecycle as ct, LifecycleState as E } from "use-page-lifecycle";
10
+ const le = ({ id: t, properties: n = {} }) => {
11
+ const { audience: e } = S(), { ref: r, inView: o } = it({
12
12
  triggerOnce: !0
13
13
  });
14
14
  return d(() => {
@@ -17,121 +17,121 @@ const de = ({ id: t, properties: n = {} }) => {
17
17
  resource: "block",
18
18
  identifier: t
19
19
  }));
20
- }, [o]), /* @__PURE__ */ ot.jsx("div", { ref: r, style: { height: "0px" } });
21
- }, le = ({ event: t, properties: n }) => {
20
+ }, [o]), /* @__PURE__ */ st.jsx("div", { ref: r, style: { height: "0px" } });
21
+ }, ge = ({ event: t, properties: n }) => {
22
22
  const { audience: e } = S();
23
23
  return d(() => {
24
24
  e != null && e.instance && (e == null || e.track(t, n));
25
25
  }, [e == null ? void 0 : e.instance, t, n]), null;
26
26
  };
27
- function R(t) {
27
+ function A(t) {
28
28
  var n = typeof t;
29
29
  return t != null && (n == "object" || n == "function");
30
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)); )
31
+ var at = typeof global == "object" && global && global.Object === Object && global, ut = typeof self == "object" && self && self.Object === Object && self, G = at || ut || Function("return this")(), O = function() {
32
+ return G.Date.now();
33
+ }, ft = /\s/;
34
+ function dt(t) {
35
+ for (var n = t.length; n-- && ft.test(t.charAt(n)); )
36
36
  ;
37
37
  return n;
38
38
  }
39
- var dt = /^\s+/;
40
- function lt(t) {
41
- return t && t.slice(0, ft(t) + 1).replace(dt, "");
39
+ var lt = /^\s+/;
40
+ function gt(t) {
41
+ return t && t.slice(0, dt(t) + 1).replace(lt, "");
42
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];
43
+ var x = G.Symbol, K = Object.prototype, pt = K.hasOwnProperty, mt = K.toString, y = x ? x.toStringTag : void 0;
44
+ function ht(t) {
45
+ var n = pt.call(t, y), e = t[y];
46
46
  try {
47
47
  t[y] = void 0;
48
48
  var r = !0;
49
49
  } catch {
50
50
  }
51
- var o = pt.call(t);
51
+ var o = mt.call(t);
52
52
  return r && (n ? t[y] = e : delete t[y]), o;
53
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);
54
+ var bt = Object.prototype, wt = bt.toString;
55
+ function yt(t) {
56
+ return wt.call(t);
61
57
  }
58
+ var vt = "[object Null]", St = "[object Undefined]", U = x ? x.toStringTag : void 0;
62
59
  function Tt(t) {
60
+ return t == null ? t === void 0 ? St : vt : U && U in Object(t) ? ht(t) : yt(t);
61
+ }
62
+ function Et(t) {
63
63
  return t != null && typeof t == "object";
64
64
  }
65
- var Et = "[object Symbol]";
66
- function Lt(t) {
67
- return typeof t == "symbol" || Tt(t) && St(t) == Et;
65
+ var Lt = "[object Symbol]";
66
+ function xt(t) {
67
+ return typeof t == "symbol" || Et(t) && Tt(t) == Lt;
68
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) {
69
+ var H = NaN, Ct = /^[-+]0x[0-9a-f]+$/i, _t = /^0b[01]+$/i, kt = /^0o[0-7]+$/i, Nt = parseInt;
70
+ function B(t) {
71
71
  if (typeof t == "number")
72
72
  return t;
73
- if (Lt(t))
74
- return F;
75
- if (R(t)) {
73
+ if (xt(t))
74
+ return H;
75
+ if (A(t)) {
76
76
  var n = typeof t.valueOf == "function" ? t.valueOf() : t;
77
- t = R(n) ? n + "" : n;
77
+ t = A(n) ? n + "" : n;
78
78
  }
79
79
  if (typeof t != "string")
80
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;
81
+ t = gt(t);
82
+ var e = _t.test(t);
83
+ return e || kt.test(t) ? Nt(t.slice(2), e ? 2 : 8) : Ct.test(t) ? H : +t;
84
84
  }
85
- var Nt = "Expected a function", Ot = Math.max, It = Math.min;
86
- function Rt(t, n, e) {
85
+ var Ot = "Expected a function", It = Math.max, Rt = Math.min;
86
+ function At(t, n, e) {
87
87
  var r, o, c, a, s, i, u = 0, g = !1, l = !1, p = !0;
88
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) {
89
+ throw new TypeError(Ot);
90
+ n = B(n) || 0, A(e) && (g = !!e.leading, l = "maxWait" in e, c = l ? It(B(e.maxWait) || 0, n) : c, p = "trailing" in e ? !!e.trailing : p);
91
+ function k(f) {
92
92
  var m = r, w = o;
93
93
  return r = o = void 0, u = f, a = t.apply(w, m), a;
94
94
  }
95
- function q(f) {
96
- return u = f, s = setTimeout(T, n), g ? _(f) : a;
97
- }
98
95
  function Q(f) {
99
- var m = f - i, w = f - u, D = n - m;
100
- return l ? It(D, c - w) : D;
96
+ return u = f, s = setTimeout(T, n), g ? k(f) : a;
101
97
  }
102
- function $(f) {
98
+ function tt(f) {
99
+ var m = f - i, w = f - u, P = n - m;
100
+ return l ? Rt(P, c - w) : P;
101
+ }
102
+ function M(f) {
103
103
  var m = f - i, w = f - u;
104
104
  return i === void 0 || m >= n || m < 0 || l && w >= c;
105
105
  }
106
106
  function T() {
107
- var f = N();
108
- if ($(f))
109
- return M(f);
110
- s = setTimeout(T, Q(f));
107
+ var f = O();
108
+ if (M(f))
109
+ return D(f);
110
+ s = setTimeout(T, tt(f));
111
111
  }
112
- function M(f) {
113
- return s = void 0, p && r ? _(f) : (r = o = void 0, a);
112
+ function D(f) {
113
+ return s = void 0, p && r ? k(f) : (r = o = void 0, a);
114
114
  }
115
- function tt() {
115
+ function et() {
116
116
  s !== void 0 && clearTimeout(s), u = 0, r = i = o = s = void 0;
117
117
  }
118
- function et() {
119
- return s === void 0 ? a : M(N());
118
+ function nt() {
119
+ return s === void 0 ? a : D(O());
120
120
  }
121
- function k() {
122
- var f = N(), m = $(f);
121
+ function N() {
122
+ var f = O(), m = M(f);
123
123
  if (r = arguments, o = this, i = f, m) {
124
124
  if (s === void 0)
125
- return q(i);
125
+ return Q(i);
126
126
  if (l)
127
- return clearTimeout(s), s = setTimeout(T, n), _(i);
127
+ return clearTimeout(s), s = setTimeout(T, n), k(i);
128
128
  }
129
129
  return s === void 0 && (s = setTimeout(T, n)), a;
130
130
  }
131
- return k.cancel = tt, k.flush = et, k;
131
+ return N.cancel = et, N.flush = nt, N;
132
132
  }
133
- const At = () => {
134
- const [t, n] = b(0), [e, r] = b(0), o = Rt((c) => {
133
+ const jt = () => {
134
+ const [t, n] = b(0), [e, r] = b(0), o = At((c) => {
135
135
  r(c), n(c);
136
136
  }, 250);
137
137
  return d(() => {
@@ -143,7 +143,7 @@ const At = () => {
143
143
  };
144
144
  return window.addEventListener("scroll", c), () => window.removeEventListener("scroll", c);
145
145
  }, [e]), t;
146
- }, v = "lv_insights_ot", jt = () => {
146
+ }, v = "lv_insights_ot", $t = () => {
147
147
  const [t, n] = b(0);
148
148
  return d(() => {
149
149
  const e = Number(localStorage.getItem(v)) || 0;
@@ -160,15 +160,15 @@ const At = () => {
160
160
  window.removeEventListener("storage", r), window.removeEventListener("beforeunload", o);
161
161
  };
162
162
  }, []), t;
163
- }, B = "lv_insights_ct", O = "lv_insights_at", $t = () => {
163
+ }, W = "lv_insights_ct", I = "lv_insights_at", Mt = () => {
164
164
  const [t, n] = b(null);
165
165
  return d(() => {
166
- let e = sessionStorage.getItem(B);
166
+ let e = sessionStorage.getItem(W);
167
167
  const r = JSON.parse(
168
- localStorage.getItem(O) || "[]"
168
+ localStorage.getItem(I) || "[]"
169
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,
170
+ e && r.includes(e) && (e = null), e || (e = `${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, sessionStorage.setItem(W, e)), r.includes(e) || (r.push(e), localStorage.setItem(
171
+ I,
172
172
  JSON.stringify(r)
173
173
  )), n(e);
174
174
  const o = () => {
@@ -176,7 +176,7 @@ const At = () => {
176
176
  (a) => a !== e
177
177
  );
178
178
  localStorage.setItem(
179
- O,
179
+ I,
180
180
  JSON.stringify(c)
181
181
  );
182
182
  };
@@ -184,17 +184,17 @@ const At = () => {
184
184
  window.removeEventListener("beforeunload", o);
185
185
  };
186
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) {
187
+ }, C = (t) => Object.prototype.toString.call(t) == "[object String]", Dt = (t, n) => t.indexOf(n) !== -1, _ = (t) => t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""), V = (t) => t === void 0, Pt = (t) => t === null, Y = (t) => V(t) || Pt(t), J = (t) => !!t && (t == null ? void 0 : t.nodeType) === 3;
188
+ function Ft(t) {
189
189
  return !!t && (t == null ? void 0 : t.nodeType) === 1;
190
190
  }
191
191
  function Ut(t, n) {
192
192
  return !!t && !!(t != null && t.tagName) && (t == null ? void 0 : t.tagName.toLowerCase()) === n.toLowerCase();
193
193
  }
194
- function Ft(t) {
195
- return t ? C(t).split(/\s+/) : [];
196
- }
197
194
  function Ht(t) {
195
+ return t ? _(t).split(/\s+/) : [];
196
+ }
197
+ function Bt(t) {
198
198
  let n = "";
199
199
  switch (typeof (t == null ? void 0 : t.className)) {
200
200
  case "string":
@@ -206,20 +206,20 @@ function Ht(t) {
206
206
  default:
207
207
  n = "";
208
208
  }
209
- return Ft(n);
209
+ return Ht(n);
210
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) => {
211
+ const h = (t, n = 255) => Y(t) ? "" : _(t).split(/(\s+)/).filter((e) => $(e)).join("").replace(/[\r\n]/g, " ").replace(/[ ]+/g, " ").substring(0, n), j = (t) => {
212
212
  let n = "";
213
- if (Gt(t) && // !isSensitiveElement(el) &&
213
+ if (Kt(t) && // !isSensitiveElement(el) &&
214
214
  (t != null && t.childNodes) && (t != null && t.childNodes.length))
215
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) => {
216
+ J(e) && e.textContent && (n += h(e.textContent) ?? "");
217
+ return _(n);
218
+ }, Wt = (t) => {
219
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))
220
+ return V(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
+ }, Gt = (t, n) => {
222
+ if (!window || !t || Ut(t, "html") || !Ft(t))
223
223
  return !1;
224
224
  const e = window.getComputedStyle(t);
225
225
  if (e && e.getPropertyValue("cursor") === "pointer" && n.type === "click")
@@ -237,11 +237,11 @@ const h = (t, n = 255) => V(t) ? "" : C(t).split(/(\s+)/).filter((e) => j(e)).jo
237
237
  return n.type === "click";
238
238
  }
239
239
  };
240
- function Gt(t) {
241
- if (Mt(Ht(t), "ph-include"))
240
+ function Kt(t) {
241
+ if (Dt(Bt(t), "ph-include"))
242
242
  return !0;
243
243
  const n = t.type || "";
244
- if (x(n))
244
+ if (C(n))
245
245
  switch (n.toLowerCase()) {
246
246
  case "hidden":
247
247
  return !1;
@@ -249,35 +249,35 @@ function Gt(t) {
249
249
  return !1;
250
250
  }
251
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, "")));
252
+ return !(C(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
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 : "";
254
+ const X = "(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})", Vt = new RegExp(`^(?:${X})$`), Yt = new RegExp(X), z = "\\d{3}-?\\d{2}-?\\d{4}", Jt = new RegExp(`^(${z})$`), Xt = new RegExp(`(${z})`), $ = (t, n = !0) => !(Y(t) || C(t) && (t = _(t), (n ? Vt : Yt).test((t || "").replace(/[- ]/g, "")) || (n ? Jt : Xt).test(t))), zt = (t) => C(t) ? t.substring(0, 10) === "_ngcontent" || t.substring(0, 7) === "_nghost" : !1, Zt = (t) => {
255
+ let n = j(t);
256
+ return n = `${n} ${Z(t)}`.trim(), $(n) ? n : "";
257
257
  };
258
- function z(t) {
258
+ function Z(t) {
259
259
  var e;
260
260
  let n = "";
261
261
  if (t != null && t.childNodes.length) {
262
262
  for (const r of t.childNodes)
263
263
  if (r && ((e = r.tagName) == null ? void 0 : e.toLowerCase()) === "span")
264
264
  try {
265
- const o = A(r);
266
- n = `${n} ${o}`.trim(), r != null && r.childNodes.length && (n = `${n} ${z(r)}`.trim());
265
+ const o = j(r);
266
+ n = `${n} ${o}`.trim(), r != null && r.childNodes.length && (n = `${n} ${Z(r)}`.trim());
267
267
  } catch {
268
268
  }
269
269
  }
270
270
  return n;
271
271
  }
272
- const Zt = ["input", "textarea", "select"], Z = (t) => {
272
+ const qt = ["input", "textarea", "select"], q = (t) => {
273
273
  var o, c, a;
274
274
  const n = t.tagName.toLowerCase(), e = {
275
275
  element: n
276
276
  };
277
- n.toLowerCase() === "a" || n.toLowerCase() === "button" ? e.text = zt(t) : e.text = A(t);
277
+ n.toLowerCase() === "a" || n.toLowerCase() === "button" ? e.text = Zt(t) : e.text = j(t);
278
278
  const r = Array.from(t.attributes).reduce(
279
279
  (s, i) => {
280
- if (j(i.value) && !Xt(i.name)) {
280
+ if ($(i.value) && !zt(i.name)) {
281
281
  if (i.name === "class")
282
282
  return s;
283
283
  s[i.name] = typeof (i == null ? void 0 : i.value) == "string" ? h(i.value) : i.value;
@@ -286,7 +286,7 @@ const Zt = ["input", "textarea", "select"], Z = (t) => {
286
286
  },
287
287
  {}
288
288
  );
289
- if (e.attributes = r, Zt.includes(n) || (t == null ? void 0 : t.getAttribute("contenteditable")) === "true") {
289
+ if (e.attributes = r, qt.includes(n) || (t == null ? void 0 : t.getAttribute("contenteditable")) === "true") {
290
290
  let s;
291
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
292
  let i = "";
@@ -297,13 +297,13 @@ const Zt = ["input", "textarea", "select"], Z = (t) => {
297
297
  i || (i = h(((a = u == null ? void 0 : u.textContent) == null ? void 0 : a.trim()) || "")), i && (e.label = i);
298
298
  }
299
299
  return e;
300
- }, qt = (t, n) => {
300
+ }, Qt = (t, n) => {
301
301
  var o;
302
- let e = Bt(t);
303
- Y(e) && (e = e.parentNode || null);
302
+ let e = Wt(t);
303
+ J(e) && (e = e.parentNode || null);
304
304
  const r = ["copy", "cut"].includes(n);
305
- if (e && (Wt(e, t) || r)) {
306
- const c = Z(e);
305
+ if (e && (Gt(e, t) || r)) {
306
+ const c = q(e);
307
307
  if (r) {
308
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
309
  c.copy_text = a ?? "", c.copy_type = s ?? "";
@@ -311,23 +311,23 @@ const Zt = ["input", "textarea", "select"], Z = (t) => {
311
311
  return c;
312
312
  }
313
313
  return null;
314
- }, Qt = 30, te = 1e3, ee = 3;
315
- class ne {
314
+ }, te = 30, ee = 1e3, ne = 3;
315
+ class re {
316
316
  constructor() {
317
- P(this, "clicks");
317
+ F(this, "clicks");
318
318
  this.clicks = [];
319
319
  }
320
320
  isRageClick(n, e, r) {
321
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)
322
+ if (o && Math.abs(n - o.x) + Math.abs(e - o.y) < te && r - o.timestamp < ee) {
323
+ if (this.clicks.push({ x: n, y: e, timestamp: r }), this.clicks.length === ne)
324
324
  return !0;
325
325
  } else
326
326
  this.clicks = [{ x: n, y: e, timestamp: r }];
327
327
  return !1;
328
328
  }
329
329
  }
330
- const I = new ne(), re = () => {
330
+ const R = new re(), oe = () => {
331
331
  const { audience: t } = S();
332
332
  d(() => {
333
333
  const n = (e) => {
@@ -343,13 +343,13 @@ const I = new ne(), re = () => {
343
343
  };
344
344
  if (e.target instanceof HTMLElement) {
345
345
  const o = e.target;
346
- r.rage_click = I == null ? void 0 : I.isRageClick(
346
+ r.rage_click = R == null ? void 0 : R.isRageClick(
347
347
  e.clientX,
348
348
  e.clientY,
349
349
  (/* @__PURE__ */ new Date()).getTime()
350
350
  ), r = {
351
351
  ...r,
352
- ...Z(o)
352
+ ...q(o)
353
353
  };
354
354
  let c = o == null ? void 0 : o.getAttribute("href");
355
355
  if (!c) {
@@ -378,10 +378,10 @@ const I = new ne(), re = () => {
378
378
  document.removeEventListener("click", n);
379
379
  };
380
380
  }, [t]);
381
- }, oe = (t) => {
381
+ }, L = (t) => Number(t.toFixed(0)), se = (t) => {
382
382
  const { audience: n } = S(), [, e] = b({
383
- page_loaded_at: performance.timeOrigin,
384
- script_load: performance.now(),
383
+ page_loaded_at: L(performance.timeOrigin),
384
+ script_load: L(performance.now()),
385
385
  first_contentful_paint: null,
386
386
  window_onload: null
387
387
  }), [r, o] = b(
@@ -396,31 +396,31 @@ const I = new ne(), re = () => {
396
396
  });
397
397
  }, s = new PerformanceObserver((u) => {
398
398
  for (const g of u.getEntries())
399
- g.name === "first-contentful-paint" && a({ first_contentful_paint: g.startTime });
399
+ g.name === "first-contentful-paint" && a({ first_contentful_paint: L(g.startTime) });
400
400
  });
401
401
  s.observe({ type: "paint", buffered: !0 });
402
- const i = () => a({ window_onload: performance.now() });
402
+ const i = () => a({ window_onload: L(performance.now()) });
403
403
  return document.readyState === "complete" ? i() : window.addEventListener("load", i), () => {
404
404
  c = !1, s.disconnect(), window.removeEventListener("load", i);
405
405
  };
406
406
  }, [t]), d(() => {
407
407
  r && n && (n == null || n.track("page.metrics", r));
408
408
  }, [r, n]), r;
409
- }, ge = ({ id: t, properties: n = {} }) => {
409
+ }, pe = ({ id: t, properties: n = {} }) => {
410
410
  const e = typeof window < "u" ? window.location.href : "", { client: r, audience: o } = S();
411
411
  d(() => {
412
412
  r && typeof window < "u" && (window.levo_client = r);
413
413
  }, [r]), d(() => {
414
414
  o && typeof window < "u" && (window.levo_audience = o);
415
- }, [o]), jt(), $t(), re();
416
- const c = At();
415
+ }, [o]), $t(), Mt(), oe();
416
+ const c = jt();
417
417
  d(() => {
418
418
  o != null && o.instance && o.track("page.scroll", {
419
419
  resource: "page",
420
420
  identifier: t,
421
421
  percent: c
422
422
  });
423
- }, [o == null ? void 0 : o.instance, c, t]), oe(e), d(() => {
423
+ }, [o == null ? void 0 : o.instance, c, t]), se(e), d(() => {
424
424
  const s = () => {
425
425
  o == null || o.bounce({
426
426
  resource: "page",
@@ -431,7 +431,7 @@ const I = new ne(), re = () => {
431
431
  window && window.removeEventListener("beforeunload", s);
432
432
  };
433
433
  }, [o, t]);
434
- const [a] = it();
434
+ const [a] = ct();
435
435
  return d(() => {
436
436
  (a === E.TERMINATED || a === E.HIDDEN || a === E.UNKNOWN || a === E.FROZEN) && (o == null || o.bounce({
437
437
  resource: "page",
@@ -456,7 +456,7 @@ const I = new ne(), re = () => {
456
456
  copy: "page.copy",
457
457
  cut: "page.copy"
458
458
  }, i = (g) => (l) => {
459
- const p = qt(l, g);
459
+ const p = Qt(l, g);
460
460
  p && (o == null || o.track(s[g], p));
461
461
  }, u = {
462
462
  change: i("change"),
@@ -472,7 +472,7 @@ const I = new ne(), re = () => {
472
472
  ), null;
473
473
  };
474
474
  export {
475
- de as L,
476
- le as a,
477
- ge as b
475
+ le as L,
476
+ ge as a,
477
+ pe as b
478
478
  };
@@ -1 +1 @@
1
- {"version":3,"file":"LevoProvider.d.ts","sourceRoot":"","sources":["../../src/providers/LevoProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,UAAU,YAAY;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;CACpB;AAID,UAAU,UAAW,SAAQ,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC1E,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAiB7C,CAAC;AAEF,eAAO,MAAM,OAAO,QAOS,YAC5B,CAAC"}
1
+ {"version":3,"file":"LevoProvider.d.ts","sourceRoot":"","sources":["../../src/providers/LevoProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,UAAU,YAAY;IACpB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC;CACpB;AAID,UAAU,UAAW,SAAQ,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;IAC1E,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAoB7C,CAAC;AAEF,eAAO,MAAM,OAAO,QAOS,YAC5B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './LevoProvider'
2
+ export {}