@levo-so/site-runtime 0.3.7 → 0.3.9

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 (45) hide show
  1. package/CollectionField-C-6a1ud4.js +270 -0
  2. package/{CollectionInput-B1qV4QEH.js → CollectionInput-BJ__qcbk.js} +40 -40
  3. package/DateTimeWidget-LfaosVVW.js +255 -0
  4. package/{Dialog-DVB4WpBS.js → Dialog-dT7y641z.js} +43 -43
  5. package/{KBChatWidget-Cnq0DCOQ.js → KBChatWidget-CuAtGhHT.js} +240 -239
  6. package/{LevoProvider-nmIbMlsk.js → LevoProvider-Bsjkcwc8.js} +8 -8
  7. package/PhoneWidget-D-CcDuie.js +99 -0
  8. package/{Popover-C7zZHBIc.js → Popover-BTdlOQP_.js} +20 -20
  9. package/{PopupBody-DZVwDLkg-yrot8Uqb.js → PopupBody-BI-MJqmd-C0qNyN7V.js} +299 -182
  10. package/PopupRenderer-D66Gx63H-C6RnOnl2.js +388 -0
  11. package/{RichTextWidget-BOrVIR2j.js → RichTextWidget-BFWVevY7.js} +140 -140
  12. package/ThemeProvider-DutrjSTF.js +116 -0
  13. package/{Tooltip-BIgrpetu.js → Tooltip-CQB0LyxK.js} +20 -20
  14. package/{VerifyButton-CA1GtEZJ.js → VerifyButton-BUT70lgz.js} +65 -65
  15. package/{dist-Cb6sb7nO.js → dist-Rjs__H25.js} +14 -14
  16. package/dist-orLT2eNz.js +3663 -0
  17. package/index.d.ts +1071 -3
  18. package/index.js +1365 -733
  19. package/inlineBaseTheme-BB9e6h5f.js +9 -0
  20. package/{inlineCollectionTheme-DYYMrmcE.js → inlineCollectionTheme-CWcMCUti.js} +1 -1
  21. package/{kbChat-DIb4AS7E.js → kbChat-L55effMi.js} +28 -28
  22. package/{nodeAlignment-D70kOcui.js → nodeAlignment-COvc-rIj.js} +1 -1
  23. package/package.json +37 -27
  24. package/popups.js +1 -1
  25. package/{react-6kO0cqgr.js → react-B9yvlbH0.js} +1 -1
  26. package/routes-CyKmkoRM.js +316 -0
  27. package/start.d.ts +38 -0
  28. package/start.js +19 -0
  29. package/styles.css +1 -1
  30. package/{generateRadiusScale-54mE9ikx.js → themeVars.cssm-ByhhC2Jm.js} +17 -17
  31. package/usePopupRedirect-CAAdcpaW-D9XoiVhG.js +82 -0
  32. package/CollectionField-C59pmeQw.js +0 -270
  33. package/DateTimeWidget-Cctsvcrs.js +0 -255
  34. package/PhoneWidget-J3VTMWJH.js +0 -99
  35. package/PopupRenderer-BjW1jg70-Biwj2bIc.js +0 -387
  36. package/ThemeProvider-BQmIB5tr.js +0 -116
  37. package/dist-C8gLeklT.js +0 -3559
  38. package/inlineBaseTheme-B6E9zzyp.js +0 -9
  39. package/usePopupRedirect-BThP_YPW-DoixMAB9.js +0 -80
  40. /package/{createThemeExtension-DhGk81nV.js → createThemeExtension-4AUn51iJ.js} +0 -0
  41. /package/{es-CztjLuNy.js → es-Bj3CsMJz.js} +0 -0
  42. /package/{pillChrome-BAu5AfCT.js → pillChrome-uieiq_SK.js} +0 -0
  43. /package/{popupState-JmpeKzgM-qhNTV79U.js → popupState-JmpeKzgM-D_77LiAa.js} +0 -0
  44. /package/{rteTheme.cssm-xg0gJ28J.js → rteTheme.cssm-CaRzrwtu.js} +0 -0
  45. /package/{theme.cssm-mkQwezuj.js → theme.cssm-DUzmx76l.js} +0 -0
@@ -0,0 +1,116 @@
1
+ import { c as e } from "react/compiler-runtime";
2
+ import t from "clsx";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ import { createRuntimeFn as r } from "@vanilla-extract/recipes/createRuntimeFn";
5
+ import { createContext as i, useContext as a, useEffect as o, useMemo as s, useRef as c } from "react";
6
+ //#region ../../libraries/levocn/dist/ui/button/Button.cssm.js
7
+ var l = r({
8
+ defaultClassName: "_1a7d0ek1 _1a7d0ek0",
9
+ variantClassNames: {
10
+ variant: {
11
+ default: "_1a7d0ek2",
12
+ outline: "_1a7d0ek3",
13
+ secondary: "_1a7d0ek4",
14
+ ghost: "_1a7d0ek5",
15
+ destructive: "_1a7d0ek6",
16
+ link: "_1a7d0ek7"
17
+ },
18
+ size: {
19
+ default: "_1a7d0ek8",
20
+ xs: "_1a7d0ek9",
21
+ sm: "_1a7d0eka",
22
+ lg: "_1a7d0ekb",
23
+ icon: "_1a7d0ekc",
24
+ "icon-xs": "_1a7d0ekd",
25
+ "icon-sm": "_1a7d0eke",
26
+ "icon-lg": "_1a7d0ekf"
27
+ }
28
+ },
29
+ defaultVariants: {
30
+ variant: "default",
31
+ size: "default"
32
+ },
33
+ compoundVariants: []
34
+ }), u = (r) => {
35
+ let i = e(14), a, o, s, c, u;
36
+ i[0] === r ? (a = i[1], o = i[2], s = i[3], c = i[4], u = i[5]) : ({className: a, variant: u, size: s, type: c, ...o} = r, i[0] = r, i[1] = a, i[2] = o, i[3] = s, i[4] = c, i[5] = u);
37
+ let d = c === void 0 ? "button" : c, f;
38
+ i[6] !== a || i[7] !== s || i[8] !== u ? (f = t(l({
39
+ variant: u,
40
+ size: s
41
+ }), a), i[6] = a, i[7] = s, i[8] = u, i[9] = f) : f = i[9];
42
+ let p;
43
+ return i[10] !== o || i[11] !== f || i[12] !== d ? (p = /* @__PURE__ */ n("button", {
44
+ "data-slot": "button",
45
+ type: d,
46
+ className: f,
47
+ ...o
48
+ }), i[10] = o, i[11] = f, i[12] = d, i[13] = p) : p = i[13], p;
49
+ }, d = "_1er5g5a0", f = /* @__PURE__ */ new Set(), p = {}, m = i(null), h = () => {
50
+ let t = e(1), n = a(m);
51
+ if (!n) {
52
+ let e;
53
+ return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = {
54
+ portalRef: { current: null },
55
+ classes: f,
56
+ overrides: p
57
+ }, t[0] = e) : e = t[0], e;
58
+ }
59
+ return n;
60
+ }, g = ({ children: e, cssReset: r, className: i, style: l, portalToThemeRoot: u, ...h }) => {
61
+ let g = a(m), _ = c(null), v = !g && r !== !1 ? d : "", y = g?.classes ?? f, b = g?.overrides ?? p, x = s(() => {
62
+ let e = i ? i.split(/\s+/).filter(Boolean) : [], t = new Set(y);
63
+ for (let n of e) t.add(n);
64
+ return {
65
+ portalRef: _,
66
+ classes: t,
67
+ overrides: {
68
+ ...b,
69
+ ...l
70
+ }
71
+ };
72
+ }, [
73
+ y,
74
+ i,
75
+ b,
76
+ l
77
+ ]);
78
+ o(() => {
79
+ if (u) return;
80
+ let e = document.createElement("div");
81
+ return document.body.appendChild(e), _.current = e, () => {
82
+ document.body.removeChild(e), _.current = null;
83
+ };
84
+ }, [u]), o(() => {
85
+ if (u) return;
86
+ let e = _.current;
87
+ if (!e) return;
88
+ e.className = t(v, ...x.classes), e.style.cssText = "";
89
+ let n = {
90
+ display: "contents",
91
+ ...x.overrides
92
+ };
93
+ for (let [t, r] of Object.entries(n)) r != null && e.style.setProperty(t, String(r));
94
+ }, [
95
+ x.classes,
96
+ x.overrides,
97
+ v,
98
+ u
99
+ ]);
100
+ let S = t(v, ...i ? i.split(/\s+/).filter((e) => e && !y.has(e)) : []);
101
+ return /* @__PURE__ */ n(m.Provider, {
102
+ value: x,
103
+ children: /* @__PURE__ */ n("div", {
104
+ ...u ? { ref: _ } : {},
105
+ ...S ? { className: S } : {},
106
+ style: {
107
+ display: "contents",
108
+ ...l
109
+ },
110
+ ...h,
111
+ children: e
112
+ })
113
+ });
114
+ };
115
+ //#endregion
116
+ export { l as i, g as n, u as r, h as t };
@@ -1,55 +1,55 @@
1
- import { i as e, t } from "./ThemeProvider-BQmIB5tr.js";
2
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
3
- import { c as i } from "react/compiler-runtime";
4
- import a from "clsx";
1
+ import { i as e, t } from "./ThemeProvider-DutrjSTF.js";
2
+ import { c as n } from "react/compiler-runtime";
3
+ import r from "clsx";
4
+ import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  import { Tooltip as o } from "@base-ui/react/tooltip";
6
6
  //#region ../../libraries/levocn/dist/ui/tooltip/Tooltip.cssm.js
7
7
  var s = "_3zwjqd0", c = "_3zwjqd1", l = "_3zwjqd2", u = (e) => {
8
- let t = i(6), r, a;
8
+ let t = n(6), r, a;
9
9
  t[0] === e ? (r = t[1], a = t[2]) : ({delay: a, ...r} = e, t[0] = e, t[1] = r, t[2] = a);
10
10
  let s = a === void 0 ? 0 : a, c;
11
- return t[3] !== s || t[4] !== r ? (c = /* @__PURE__ */ n(o.Provider, {
11
+ return t[3] !== s || t[4] !== r ? (c = /* @__PURE__ */ i(o.Provider, {
12
12
  "data-slot": "tooltip-provider",
13
13
  delay: s,
14
14
  ...r
15
15
  }), t[3] = s, t[4] = r, t[5] = c) : c = t[5], c;
16
16
  }, d = (e) => {
17
- let t = i(4), r;
17
+ let t = n(4), r;
18
18
  t[0] === e ? r = t[1] : ({...r} = e, t[0] = e, t[1] = r);
19
19
  let a;
20
- return t[2] === r ? a = t[3] : (a = /* @__PURE__ */ n(o.Root, {
20
+ return t[2] === r ? a = t[3] : (a = /* @__PURE__ */ i(o.Root, {
21
21
  "data-slot": "tooltip",
22
22
  ...r
23
23
  }), t[2] = r, t[3] = a), a;
24
24
  }, f = (t) => {
25
- let r = i(12), s, c, l, u;
26
- r[0] === t ? (s = r[1], c = r[2], l = r[3], u = r[4]) : ({className: s, variant: u, size: l, ...c} = t, r[0] = t, r[1] = s, r[2] = c, r[3] = l, r[4] = u);
25
+ let a = n(12), s, c, l, u;
26
+ a[0] === t ? (s = a[1], c = a[2], l = a[3], u = a[4]) : ({className: s, variant: u, size: l, ...c} = t, a[0] = t, a[1] = s, a[2] = c, a[3] = l, a[4] = u);
27
27
  let d;
28
- r[5] !== s || r[6] !== l || r[7] !== u ? (d = a(e({
28
+ a[5] !== s || a[6] !== l || a[7] !== u ? (d = r(e({
29
29
  variant: u,
30
30
  size: l
31
- }), s), r[5] = s, r[6] = l, r[7] = u, r[8] = d) : d = r[8];
31
+ }), s), a[5] = s, a[6] = l, a[7] = u, a[8] = d) : d = a[8];
32
32
  let f;
33
- return r[9] !== c || r[10] !== d ? (f = /* @__PURE__ */ n(o.Trigger, {
33
+ return a[9] !== c || a[10] !== d ? (f = /* @__PURE__ */ i(o.Trigger, {
34
34
  className: d,
35
35
  ...c
36
- }), r[9] = c, r[10] = d, r[11] = f) : f = r[11], f;
36
+ }), a[9] = c, a[10] = d, a[11] = f) : f = a[11], f;
37
37
  }, p = (e) => {
38
- let u = i(24), d, f, p, m, h, g, _;
38
+ let u = n(24), d, f, p, m, h, g, _;
39
39
  u[0] === e ? (d = u[1], f = u[2], p = u[3], m = u[4], h = u[5], g = u[6], _ = u[7]) : ({className: f, side: m, sideOffset: h, align: g, alignOffset: _, children: d, ...p} = e, u[0] = e, u[1] = d, u[2] = f, u[3] = p, u[4] = m, u[5] = h, u[6] = g, u[7] = _);
40
40
  let v = m === void 0 ? "top" : m, y = h === void 0 ? 8 : h, b = g === void 0 ? "center" : g, x = _ === void 0 ? 0 : _, { portalRef: S } = t(), C;
41
- u[8] === f ? C = u[9] : (C = a(s, f), u[8] = f, u[9] = C);
41
+ u[8] === f ? C = u[9] : (C = r(s, f), u[8] = f, u[9] = C);
42
42
  let w;
43
- u[10] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ n(o.Arrow, { className: c }), u[10] = w) : w = u[10];
43
+ u[10] === Symbol.for("react.memo_cache_sentinel") ? (w = /* @__PURE__ */ i(o.Arrow, { className: c }), u[10] = w) : w = u[10];
44
44
  let T;
45
- u[11] !== d || u[12] !== p || u[13] !== C ? (T = /* @__PURE__ */ r(o.Popup, {
45
+ u[11] !== d || u[12] !== p || u[13] !== C ? (T = /* @__PURE__ */ a(o.Popup, {
46
46
  "data-slot": "tooltip-content",
47
47
  className: C,
48
48
  ...p,
49
49
  children: [d, w]
50
50
  }), u[11] = d, u[12] = p, u[13] = C, u[14] = T) : T = u[14];
51
51
  let E;
52
- u[15] !== b || u[16] !== x || u[17] !== v || u[18] !== y || u[19] !== T ? (E = /* @__PURE__ */ n(o.Positioner, {
52
+ u[15] !== b || u[16] !== x || u[17] !== v || u[18] !== y || u[19] !== T ? (E = /* @__PURE__ */ i(o.Positioner, {
53
53
  align: b,
54
54
  alignOffset: x,
55
55
  side: v,
@@ -58,7 +58,7 @@ var s = "_3zwjqd0", c = "_3zwjqd1", l = "_3zwjqd2", u = (e) => {
58
58
  children: T
59
59
  }), u[15] = b, u[16] = x, u[17] = v, u[18] = y, u[19] = T, u[20] = E) : E = u[20];
60
60
  let D;
61
- return u[21] !== S || u[22] !== E ? (D = /* @__PURE__ */ n(o.Portal, {
61
+ return u[21] !== S || u[22] !== E ? (D = /* @__PURE__ */ i(o.Portal, {
62
62
  container: S,
63
63
  children: E
64
64
  }), u[21] = S, u[22] = E, u[23] = D) : D = u[23], D;
@@ -1,54 +1,54 @@
1
1
  "use client";
2
- import { t as e } from "./LevoProvider-nmIbMlsk.js";
3
- import { r as t } from "./ThemeProvider-BQmIB5tr.js";
4
- import { t as n } from "./CollectionInput-B1qV4QEH.js";
5
- import { i as r, n as i, o as a, t as o } from "./Dialog-DVB4WpBS.js";
6
- import { useEffect as s, useState as c } from "react";
2
+ import { r as e } from "./ThemeProvider-DutrjSTF.js";
3
+ import { t } from "./LevoProvider-Bsjkcwc8.js";
4
+ import { t as n } from "./CollectionInput-BJ__qcbk.js";
5
+ import { i as r, n as i, o as a, t as o } from "./Dialog-dT7y641z.js";
6
+ import { c as s } from "react/compiler-runtime";
7
+ import c from "clsx";
7
8
  import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
8
- import { toast as f } from "sonner";
9
- import { c as p } from "react/compiler-runtime";
10
- import m from "clsx";
11
- import { IconCircleCheck as h, IconLoader as g } from "@tabler/icons-react";
12
- //#region ../react/dist/components/Sonner.js
13
- var _ = (e, t = "Error", n = {}) => {
14
- f.error(t, {
9
+ import { useEffect as f, useState as p } from "react";
10
+ import { IconCircleCheck as m, IconLoader as h } from "@tabler/icons-react";
11
+ import { toast as g } from "sonner";
12
+ //#region ../../libraries/levocn/dist/ui/spinner/Spinner.cssm.js
13
+ var _ = "_1k4xirc1", v = (e) => {
14
+ let t = s(8), n, r;
15
+ t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
16
+ let i;
17
+ t[3] === n ? i = t[4] : (i = c(_, n), t[3] = n, t[4] = i);
18
+ let a;
19
+ return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ u(h, {
20
+ role: "status",
21
+ "aria-label": "Loading",
22
+ className: i,
23
+ ...r
24
+ }), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
25
+ }, y = (e, t = "Error", n = {}) => {
26
+ g.error(t, {
15
27
  description: e,
16
28
  duration: 4e3,
17
29
  position: "bottom-right",
18
30
  ...n
19
31
  });
20
- }, v = (e, t = "Success", n = {}) => {
21
- n?.id && f.dismiss(n?.id), f.success(t, {
32
+ }, b = (e, t = "Success", n = {}) => {
33
+ n?.id && g.dismiss(n?.id), g.success(t, {
22
34
  description: e,
23
35
  duration: 4e3,
24
36
  position: "bottom-right",
25
37
  ...n
26
38
  });
27
- }, y = "_1k4xirc1", b = (e) => {
28
- let t = p(8), n, r;
29
- t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
30
- let i;
31
- t[3] === n ? i = t[4] : (i = m(y, n), t[3] = n, t[4] = i);
32
- let a;
33
- return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ u(g, {
34
- role: "status",
35
- "aria-label": "Loading",
36
- className: i,
37
- ...r
38
- }), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
39
- }, x = "_6o7s4x0", S = "qkytrb0", C = "qkytrb1", w = "qkytrb2", T = "qkytrb3", E = "qkytrb4", D = "qkytrb5", O = "qkytrb6", k = ({ isOpen: l, onClose: f, value: p, type: m = "email", onVerifySuccess: h }) => {
40
- let { membership: g } = e(), [y, b] = c(""), [k, A] = c(!1), [j, M] = c(!1), [N, P] = c(30);
41
- return s(() => {
39
+ }, x = "_6o7s4x0", S = "qkytrb0", C = "qkytrb1", w = "qkytrb2", T = "qkytrb3", E = "qkytrb4", D = "qkytrb5", O = "qkytrb6", k = ({ isOpen: s, onClose: c, value: l, type: m = "email", onVerifySuccess: h }) => {
40
+ let { membership: g } = t(), [_, v] = p(""), [k, A] = p(!1), [j, M] = p(!1), [N, P] = p(30);
41
+ return f(() => {
42
42
  let e;
43
- return l && N > 0 && (e = setInterval(() => {
43
+ return s && N > 0 && (e = setInterval(() => {
44
44
  P((e) => e - 1);
45
45
  }, 1e3)), () => clearInterval(e);
46
- }, [l, N]), s(() => {
47
- l && (b(""), P(30), A(!1), M(!1));
48
- }, [l]), /* @__PURE__ */ u(a, {
49
- open: l,
46
+ }, [s, N]), f(() => {
47
+ s && (v(""), P(30), A(!1), M(!1));
48
+ }, [s]), /* @__PURE__ */ u(a, {
49
+ open: s,
50
50
  onOpenChange: (e) => {
51
- e || f();
51
+ e || c();
52
52
  },
53
53
  children: /* @__PURE__ */ d(i, {
54
54
  className: x,
@@ -59,11 +59,11 @@ var _ = (e, t = "Error", n = {}) => {
59
59
  className: C,
60
60
  children: [
61
61
  "Enter the 4-digit code sent to ",
62
- /* @__PURE__ */ u("strong", { children: p }),
62
+ /* @__PURE__ */ u("strong", { children: l }),
63
63
  ".",
64
64
  " ",
65
65
  /* @__PURE__ */ u("button", {
66
- onClick: () => f(),
66
+ onClick: () => c(),
67
67
  className: w,
68
68
  children: "Change?"
69
69
  })
@@ -72,9 +72,9 @@ var _ = (e, t = "Error", n = {}) => {
72
72
  /* @__PURE__ */ u("div", {
73
73
  className: T,
74
74
  children: /* @__PURE__ */ u(n, {
75
- value: y,
75
+ value: _,
76
76
  onChange: (e) => {
77
- b(e.target.value.replace(/\D/g, "").slice(0, 4));
77
+ v(e.target.value.replace(/\D/g, "").slice(0, 4));
78
78
  },
79
79
  placeholder: "0000",
80
80
  maxLength: 4,
@@ -83,24 +83,24 @@ var _ = (e, t = "Error", n = {}) => {
83
83
  }),
84
84
  /* @__PURE__ */ d("div", {
85
85
  className: E,
86
- children: [/* @__PURE__ */ u(t, {
86
+ children: [/* @__PURE__ */ u(e, {
87
87
  onClick: async () => {
88
- if (!(!y || y.length !== 4)) {
88
+ if (!(!_ || _.length !== 4)) {
89
89
  A(!0);
90
90
  try {
91
91
  await g?.signInWithOtp({
92
- content: p,
93
- code: y
94
- }), v("Verification successful"), h(p), f();
92
+ content: l,
93
+ code: _
94
+ }), b("Verification successful"), h(l), c();
95
95
  } catch (e) {
96
96
  let t = e;
97
- _(t?.message || "Invalid OTP", t?.title || "Verification Failed");
97
+ y(t?.message || "Invalid OTP", t?.title || "Verification Failed");
98
98
  } finally {
99
99
  A(!1);
100
100
  }
101
101
  }
102
102
  },
103
- disabled: y.length !== 4 || k,
103
+ disabled: _.length !== 4 || k,
104
104
  className: "w-full",
105
105
  children: k ? "Verifying..." : "Verify"
106
106
  }), /* @__PURE__ */ u("div", {
@@ -115,12 +115,12 @@ var _ = (e, t = "Error", n = {}) => {
115
115
  M(!0);
116
116
  try {
117
117
  await g?.requestOtp({
118
- content: p,
118
+ content: l,
119
119
  medium: m === "phone" ? "whatsapp" : "email"
120
- }), v("OTP resent successfully"), P(30);
120
+ }), b("OTP resent successfully"), P(30);
121
121
  } catch (e) {
122
122
  let t = e;
123
- _(t?.message || "Failed to resend OTP", t?.title || "Error");
123
+ y(t?.message || "Failed to resend OTP", t?.title || "Error");
124
124
  } finally {
125
125
  M(!1);
126
126
  }
@@ -137,49 +137,49 @@ var _ = (e, t = "Error", n = {}) => {
137
137
  })
138
138
  });
139
139
  }, A = "jfrbe10", j = "jfrbe11", M = "jfrbe12", N = ({ value: n, type: r, isVerified: i, onVerifySuccess: a, onStateChange: o }) => {
140
- let { membership: s } = e(), [f, p] = c(!1), [m, g] = c(!1), v = (e) => {
140
+ let { membership: s } = t(), [c, f] = p(!1), [h, g] = p(!1), _ = (e) => {
141
141
  o && o(e);
142
- }, y = async () => {
142
+ }, b = async () => {
143
143
  let e = n?.trim()?.toLowerCase();
144
144
  if (!e) {
145
- _(`Please enter a ${r}`);
145
+ y(`Please enter a ${r}`);
146
146
  return;
147
147
  }
148
148
  if (r === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
149
- _("Please enter a valid email address");
149
+ y("Please enter a valid email address");
150
150
  return;
151
151
  }
152
- g(!0), v(!0);
152
+ g(!0), _(!0);
153
153
  try {
154
154
  await s?.requestOtp({
155
155
  content: e,
156
156
  medium: r === "phone" ? "whatsapp" : "email"
157
- }), p(!0);
157
+ }), f(!0);
158
158
  } catch (e) {
159
159
  let t = e;
160
- _(t?.message || "Failed to send OTP", t?.title || "Error"), v(!1);
160
+ y(t?.message || "Failed to send OTP", t?.title || "Error"), _(!1);
161
161
  } finally {
162
162
  g(!1);
163
163
  }
164
164
  }, x = () => {
165
- p(!1), v(!1);
165
+ f(!1), _(!1);
166
166
  };
167
167
  return i ? /* @__PURE__ */ d("div", {
168
168
  className: A,
169
- children: [/* @__PURE__ */ u(h, { className: M }), /* @__PURE__ */ u("span", {
169
+ children: [/* @__PURE__ */ u(m, { className: M }), /* @__PURE__ */ u("span", {
170
170
  className: j,
171
171
  children: "Verified"
172
172
  })]
173
- }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(t, {
173
+ }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(e, {
174
174
  size: "default",
175
175
  variant: "ghost",
176
- onClick: y,
176
+ onClick: b,
177
177
  onMouseDown: (e) => e.preventDefault(),
178
- disabled: !n || m,
178
+ disabled: !n || h,
179
179
  type: "button",
180
- children: m ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(b, { size: 14 }), "Sending..."] }) : "Verify"
181
- }), f && /* @__PURE__ */ u(k, {
182
- isOpen: f,
180
+ children: h ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(v, { size: 14 }), "Sending..."] }) : "Verify"
181
+ }), c && /* @__PURE__ */ u(k, {
182
+ isOpen: c,
183
183
  onClose: x,
184
184
  value: n?.trim()?.toLowerCase() || "",
185
185
  type: r,
@@ -189,4 +189,4 @@ var _ = (e, t = "Error", n = {}) => {
189
189
  })] });
190
190
  };
191
191
  //#endregion
192
- export { _ as a, v as i, x as n, b as r, N as t };
192
+ export { v as a, y as i, x as n, b as r, N as t };
@@ -1,10 +1,10 @@
1
1
  import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { t } from "./LevoProvider-nmIbMlsk.js";
3
- import { a as n, c as r, i, l as a, o, t as s, u as c } from "./popupState-JmpeKzgM-qhNTV79U.js";
4
- import { t as l } from "./react-6kO0cqgr.js";
5
- import { Suspense as u, lazy as d, useEffect as f, useRef as p, useState as m } from "react";
6
- import { jsx as h } from "react/jsx-runtime";
7
- import { c as g } from "react/compiler-runtime";
2
+ import { t } from "./LevoProvider-Bsjkcwc8.js";
3
+ import { a as n, c as r, i, l as a, o, t as s, u as c } from "./popupState-JmpeKzgM-D_77LiAa.js";
4
+ import { t as l } from "./react-B9yvlbH0.js";
5
+ import { c as u } from "react/compiler-runtime";
6
+ import { jsx as d } from "react/jsx-runtime";
7
+ import { Suspense as f, lazy as p, useEffect as m, useRef as h, useState as g } from "react";
8
8
  import { $isIdentityContextReady as _ } from "@levo-so/insights/stores";
9
9
  //#region ../../libraries/popups/dist/index.js
10
10
  var v = /* @__PURE__ */ e({
@@ -14,12 +14,12 @@ var v = /* @__PURE__ */ e({
14
14
  }), y = async (e, t) => {
15
15
  let n = {};
16
16
  return t?.site_id && (n.site_id = t.site_id), t?.locale && (n.locale = t.locale), t?.country && (n.country = t.country), (await e.url("/v1/studio/popup/list-active").query(n).get().json())?.content?.data ?? [];
17
- }, b = d(() => import("./PopupRenderer-BjW1jg70-Biwj2bIc.js").then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), x = (e) => {
18
- let n = g(9), { siteId: r, pageId: i } = e, { fetch: a, logger: s } = t(), [c, l] = m(null), d = p(!1), v, x;
17
+ }, b = p(() => import("./PopupRenderer-D66Gx63H-C6RnOnl2.js").then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), x = (e) => {
18
+ let n = u(9), { siteId: r, pageId: i } = e, { fetch: a, logger: s } = t(), [c, l] = g(null), p = h(!1), v, x;
19
19
  if (n[0] !== a || n[1] !== s || n[2] !== r ? (v = () => {
20
- if (d.current) return;
20
+ if (p.current) return;
21
21
  let e = () => {
22
- d.current || (d.current = !0, y(a, r ? { site_id: r } : void 0).then((e) => {
22
+ p.current || (p.current = !0, y(a, r ? { site_id: r } : void 0).then((e) => {
23
23
  o(e), l(e);
24
24
  }).catch((e) => {
25
25
  s?.error("Failed to fetch popups", { exception: e }), o([]), l([]);
@@ -37,16 +37,16 @@ var v = /* @__PURE__ */ e({
37
37
  a,
38
38
  s,
39
39
  r
40
- ], n[0] = a, n[1] = s, n[2] = r, n[3] = v, n[4] = x) : (v = n[3], x = n[4]), f(v, x), !c || c.length === 0) return null;
40
+ ], n[0] = a, n[1] = s, n[2] = r, n[3] = v, n[4] = x) : (v = n[3], x = n[4]), m(v, x), !c || c.length === 0) return null;
41
41
  let C;
42
42
  n[5] === Symbol.for("react.memo_cache_sentinel") ? (C = {
43
43
  position: "relative",
44
44
  zIndex: 99999
45
45
  }, n[5] = C) : C = n[5];
46
46
  let w;
47
- return n[6] !== i || n[7] !== c ? (w = /* @__PURE__ */ h("div", {
47
+ return n[6] !== i || n[7] !== c ? (w = /* @__PURE__ */ d("div", {
48
48
  style: C,
49
- children: /* @__PURE__ */ h(u, { children: /* @__PURE__ */ h(b, {
49
+ children: /* @__PURE__ */ d(f, { children: /* @__PURE__ */ d(b, {
50
50
  popups: c,
51
51
  pageId: i
52
52
  }) })
@@ -56,7 +56,7 @@ function S() {
56
56
  return a(!1);
57
57
  }
58
58
  var C = () => {
59
- let e = g(3), t = l(n), r = l(c), i = w, a = T, o;
59
+ let e = u(3), t = l(n), r = l(c), i = w, a = T, o;
60
60
  return e[0] !== r || e[1] !== t ? (o = {
61
61
  popups: t,
62
62
  isLoading: r,