@levo-so/site-runtime 0.3.1 → 0.3.8
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/CollectionField-C-6a1ud4.js +270 -0
- package/{CollectionInput-B1qV4QEH.js → CollectionInput-BJ__qcbk.js} +40 -40
- package/DateTimeWidget-hFjcn3o6.js +255 -0
- package/Dialog-dT7y641z.js +130 -0
- package/KBChatWidget-ClHFDgJ5.js +1026 -0
- package/LevoProvider-Bsjkcwc8.js +20 -0
- package/PhoneWidget-BmBO-kvA.js +99 -0
- package/{Popover-q5dL7y0W.js → Popover-3N88sRp4.js} +20 -20
- package/{PopupRenderer-Bncp54gB-DuCULkBK.js → PopupBody-DZVwDLkg-Cfy3lWGs.js} +201 -910
- package/PopupRenderer-BjW1jg70-W2y-PEPH.js +387 -0
- package/{RichTextWidget-D-mGlES0.js → RichTextWidget-DkKHEq4j.js} +142 -141
- package/ThemeProvider-DutrjSTF.js +116 -0
- package/{Tooltip-BIgrpetu.js → Tooltip-CQB0LyxK.js} +20 -20
- package/VerifyButton-BUT70lgz.js +192 -0
- package/{theme.cssm-2YTdd8Yh.js → createThemeExtension-4AUn51iJ.js} +2 -2
- package/dist-CRDgdAkQ.js +3631 -0
- package/dist-DPmVG7VB.js +79 -0
- package/index.d.ts +575 -3
- package/index.js +1217 -722
- package/inlineBaseTheme-BB9e6h5f.js +9 -0
- package/inlineCollectionTheme-CWcMCUti.js +19 -0
- package/{kbChat-AUJxjURc.js → kbChat-C00LVlxP.js} +53 -48
- package/{nodeAlignment-Cn6xNtOP.js → nodeAlignment-BnJljFlw.js} +13 -13
- package/package.json +9 -9
- package/pillChrome-BAu5AfCT.js +30 -0
- package/popupState-JmpeKzgM-qhNTV79U.js +229 -0
- package/popups.js +1 -1
- package/react-CV3jf2mc.js +74 -0
- package/rteTheme.cssm-xg0gJ28J.js +4 -0
- package/styles.css +1 -1
- package/theme.cssm-DUzmx76l.js +4 -0
- package/{inlineCollectionTheme-D2w17LHX.js → themeVars.cssm-ByhhC2Jm.js} +18 -33
- package/usePopupRedirect-BThP_YPW-COUseDik.js +80 -0
- package/CollectionField-CzS-34zx.js +0 -270
- package/DateTimeWidget-C1jHOtz7.js +0 -255
- package/Dialog-CzVhHLEY.js +0 -145
- package/KBChatWidget-D7F9LRwI.js +0 -1078
- package/PhoneWidget-_nw97rkI.js +0 -99
- package/ThemeProvider-BQmIB5tr.js +0 -116
- package/VerifyButton-BkP98H17.js +0 -191
- package/dist-CJknSbJK.js +0 -80
- package/dist-DBbiX2ST.js +0 -3556
- package/inlineBaseTheme-DS-AfUHi.js +0 -9
- package/pillChrome-AhXOWXIb.js +0 -20
- /package/{es-iCqKQf1c.js → es-CztjLuNy.js} +0 -0
package/PhoneWidget-_nw97rkI.js
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { t as e } from "./VerifyButton-BkP98H17.js";
|
|
3
|
-
import { r as t, t as n } from "./CollectionField-CzS-34zx.js";
|
|
4
|
-
import { t as r } from "./CollectionInput-B1qV4QEH.js";
|
|
5
|
-
import { useState as i } from "react";
|
|
6
|
-
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
7
|
-
import s, { isSupportedCountry as c } from "react-phone-number-input";
|
|
8
|
-
import { useController as ee } from "react-hook-form";
|
|
9
|
-
import { c as te } from "react/compiler-runtime";
|
|
10
|
-
import { IconPencil as ne } from "@tabler/icons-react";
|
|
11
|
-
//#region ../../libraries/react-collection/dist/widgets/phoneWidget/PhoneWidget.cssm.js
|
|
12
|
-
var re = "_89f1hw0", l = "_89f1hw1", u = "_89f1hw2", ie = "_89f1hw4", d = (d) => {
|
|
13
|
-
let f = te(51), { field: p, settings: ae } = d, { key: m, label: h, helper_text: g, readonly: _, options: v } = p, y = m === void 0 ? "" : m, b = h === void 0 ? "" : h, x = g === void 0 ? "" : g, S = _ === void 0 ? !1 : _, C = y, w = !!v?.verification && !!ae?.enableVerification, [T, E] = i(null), [D, oe] = i(!1), O;
|
|
14
|
-
f[0] !== D || f[1] !== w || f[2] !== T ? (O = (e) => D ? !0 : w && (!T || T !== e) ? "Phone verification required" : !0, f[0] = D, f[1] = w, f[2] = T, f[3] = O) : O = f[3];
|
|
15
|
-
let k;
|
|
16
|
-
f[4] !== p || f[5] !== O ? (k = t(p, O), f[4] = p, f[5] = O, f[6] = k) : k = f[6];
|
|
17
|
-
let A = k, j;
|
|
18
|
-
f[7] !== C || f[8] !== A ? (j = {
|
|
19
|
-
name: C,
|
|
20
|
-
rules: A
|
|
21
|
-
}, f[7] = C, f[8] = A, f[9] = j) : j = f[9];
|
|
22
|
-
let { field: M, fieldState: se } = ee(j), N, P, F, I;
|
|
23
|
-
f[10] === M ? (N = f[11], P = f[12], F = f[13], I = f[14]) : ({value: I, onBlur: N, onChange: P, ...F} = M, f[10] = M, f[11] = N, f[12] = P, f[13] = F, f[14] = I);
|
|
24
|
-
let { error: ce } = se, L = !!p?.required, R = ce?.message, z = !!T && !!I && T === I, B;
|
|
25
|
-
f[15] === v?.country ? B = f[16] : (B = () => {
|
|
26
|
-
let e = v?.country;
|
|
27
|
-
if (e && typeof e == "string") {
|
|
28
|
-
let t = e?.toUpperCase();
|
|
29
|
-
if (c(t)) return t;
|
|
30
|
-
}
|
|
31
|
-
return "IN";
|
|
32
|
-
}, f[15] = v?.country, f[16] = B);
|
|
33
|
-
let V = B, H;
|
|
34
|
-
f[17] === P ? H = f[18] : (H = (e) => {
|
|
35
|
-
E(e), P(e);
|
|
36
|
-
}, f[17] = P, f[18] = H);
|
|
37
|
-
let U = H, W = I ?? "", G;
|
|
38
|
-
f[19] === V ? G = f[20] : (G = V(), f[19] = V, f[20] = G);
|
|
39
|
-
let K;
|
|
40
|
-
f[21] === P ? K = f[22] : (K = (e) => {
|
|
41
|
-
P?.(e ?? "");
|
|
42
|
-
}, f[21] = P, f[22] = K);
|
|
43
|
-
let q;
|
|
44
|
-
f[23] === N ? q = f[24] : (q = () => {
|
|
45
|
-
N?.();
|
|
46
|
-
}, f[23] = N, f[24] = q);
|
|
47
|
-
let J = S || z, Y;
|
|
48
|
-
f[25] === z ? Y = f[26] : (Y = z ? /* @__PURE__ */ a("button", {
|
|
49
|
-
type: "button",
|
|
50
|
-
onClick: () => E(null),
|
|
51
|
-
className: ie,
|
|
52
|
-
title: "Change phone number",
|
|
53
|
-
children: /* @__PURE__ */ a(ne, { size: 14 })
|
|
54
|
-
}) : null, f[25] = z, f[26] = Y);
|
|
55
|
-
let X;
|
|
56
|
-
f[27] !== F || f[28] !== W || f[29] !== G || f[30] !== K || f[31] !== q || f[32] !== J || f[33] !== Y ? (X = /* @__PURE__ */ a("div", {
|
|
57
|
-
className: u,
|
|
58
|
-
children: /* @__PURE__ */ a(s, {
|
|
59
|
-
value: W,
|
|
60
|
-
international: !0,
|
|
61
|
-
inputComponent: r,
|
|
62
|
-
defaultCountry: G,
|
|
63
|
-
onChange: K,
|
|
64
|
-
onBlur: q,
|
|
65
|
-
className: re,
|
|
66
|
-
readOnly: J,
|
|
67
|
-
rightIcon: Y,
|
|
68
|
-
...F
|
|
69
|
-
})
|
|
70
|
-
}), f[27] = F, f[28] = W, f[29] = G, f[30] = K, f[31] = q, f[32] = J, f[33] = Y, f[34] = X) : X = f[34];
|
|
71
|
-
let Z;
|
|
72
|
-
f[35] !== U || f[36] !== z || f[37] !== w || f[38] !== I ? (Z = w && /* @__PURE__ */ a("div", {
|
|
73
|
-
className: "_89f1hw3",
|
|
74
|
-
children: /* @__PURE__ */ a(e, {
|
|
75
|
-
value: I,
|
|
76
|
-
type: "phone",
|
|
77
|
-
isVerified: z,
|
|
78
|
-
onVerifySuccess: U,
|
|
79
|
-
onStateChange: oe
|
|
80
|
-
})
|
|
81
|
-
}), f[35] = U, f[36] = z, f[37] = w, f[38] = I, f[39] = Z) : Z = f[39];
|
|
82
|
-
let Q;
|
|
83
|
-
f[40] !== X || f[41] !== Z ? (Q = /* @__PURE__ */ o("div", {
|
|
84
|
-
className: l,
|
|
85
|
-
children: [X, Z]
|
|
86
|
-
}), f[40] = X, f[41] = Z, f[42] = Q) : Q = f[42];
|
|
87
|
-
let $;
|
|
88
|
-
return f[43] !== R || f[44] !== x || f[45] !== L || f[46] !== b || f[47] !== C || f[48] !== S || f[49] !== Q ? ($ = /* @__PURE__ */ a(n, {
|
|
89
|
-
error: R,
|
|
90
|
-
helperText: x,
|
|
91
|
-
readOnly: S,
|
|
92
|
-
label: b,
|
|
93
|
-
htmlFor: C,
|
|
94
|
-
isRequired: L,
|
|
95
|
-
children: Q
|
|
96
|
-
}), f[43] = R, f[44] = x, f[45] = L, f[46] = b, f[47] = C, f[48] = S, f[49] = Q, f[50] = $) : $ = f[50], $;
|
|
97
|
-
};
|
|
98
|
-
//#endregion
|
|
99
|
-
export { d as PhoneWidget, d as default };
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { createContext as e, useContext as t, useEffect as n, useMemo as r, useRef as i } from "react";
|
|
2
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import { c as o } from "react/compiler-runtime";
|
|
4
|
-
import s from "clsx";
|
|
5
|
-
import { createRuntimeFn as c } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
6
|
-
//#region ../../libraries/levocn/dist/styles/reset.cssm.js
|
|
7
|
-
var l = "_1er5g5a0", u = c({
|
|
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
|
-
}), d = (e) => {
|
|
35
|
-
let t = o(14), n, r, i, c, l;
|
|
36
|
-
t[0] === e ? (n = t[1], r = t[2], i = t[3], c = t[4], l = t[5]) : ({className: n, variant: l, size: i, type: c, ...r} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = c, t[5] = l);
|
|
37
|
-
let d = c === void 0 ? "button" : c, f;
|
|
38
|
-
t[6] !== n || t[7] !== i || t[8] !== l ? (f = s(u({
|
|
39
|
-
variant: l,
|
|
40
|
-
size: i
|
|
41
|
-
}), n), t[6] = n, t[7] = i, t[8] = l, t[9] = f) : f = t[9];
|
|
42
|
-
let p;
|
|
43
|
-
return t[10] !== r || t[11] !== f || t[12] !== d ? (p = /* @__PURE__ */ a("button", {
|
|
44
|
-
"data-slot": "button",
|
|
45
|
-
type: d,
|
|
46
|
-
className: f,
|
|
47
|
-
...r
|
|
48
|
-
}), t[10] = r, t[11] = f, t[12] = d, t[13] = p) : p = t[13], p;
|
|
49
|
-
}, f = /* @__PURE__ */ new Set(), p = {}, m = e(null), h = () => {
|
|
50
|
-
let e = o(1), n = t(m);
|
|
51
|
-
if (!n) {
|
|
52
|
-
let t;
|
|
53
|
-
return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = {
|
|
54
|
-
portalRef: { current: null },
|
|
55
|
-
classes: f,
|
|
56
|
-
overrides: p
|
|
57
|
-
}, e[0] = t) : t = e[0], t;
|
|
58
|
-
}
|
|
59
|
-
return n;
|
|
60
|
-
}, g = ({ children: e, cssReset: o, className: c, style: u, portalToThemeRoot: d, ...h }) => {
|
|
61
|
-
let g = t(m), _ = i(null), v = !g && o !== !1 ? l : "", y = g?.classes ?? f, b = g?.overrides ?? p, x = r(() => {
|
|
62
|
-
let e = c ? c.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
|
-
...u
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
}, [
|
|
73
|
-
y,
|
|
74
|
-
c,
|
|
75
|
-
b,
|
|
76
|
-
u
|
|
77
|
-
]);
|
|
78
|
-
n(() => {
|
|
79
|
-
if (d) return;
|
|
80
|
-
let e = document.createElement("div");
|
|
81
|
-
return document.body.appendChild(e), _.current = e, () => {
|
|
82
|
-
document.body.removeChild(e), _.current = null;
|
|
83
|
-
};
|
|
84
|
-
}, [d]), n(() => {
|
|
85
|
-
if (d) return;
|
|
86
|
-
let e = _.current;
|
|
87
|
-
if (!e) return;
|
|
88
|
-
e.className = s(v, ...x.classes), e.style.cssText = "";
|
|
89
|
-
let t = {
|
|
90
|
-
display: "contents",
|
|
91
|
-
...x.overrides
|
|
92
|
-
};
|
|
93
|
-
for (let [n, r] of Object.entries(t)) r != null && e.style.setProperty(n, String(r));
|
|
94
|
-
}, [
|
|
95
|
-
x.classes,
|
|
96
|
-
x.overrides,
|
|
97
|
-
v,
|
|
98
|
-
d
|
|
99
|
-
]);
|
|
100
|
-
let S = s(v, ...c ? c.split(/\s+/).filter((e) => e && !y.has(e)) : []);
|
|
101
|
-
return /* @__PURE__ */ a(m.Provider, {
|
|
102
|
-
value: x,
|
|
103
|
-
children: /* @__PURE__ */ a("div", {
|
|
104
|
-
...d ? { ref: _ } : {},
|
|
105
|
-
...S ? { className: S } : {},
|
|
106
|
-
style: {
|
|
107
|
-
display: "contents",
|
|
108
|
-
...u
|
|
109
|
-
},
|
|
110
|
-
...h,
|
|
111
|
-
children: e
|
|
112
|
-
})
|
|
113
|
-
});
|
|
114
|
-
};
|
|
115
|
-
//#endregion
|
|
116
|
-
export { u as i, g as n, d as r, h as t };
|
package/VerifyButton-BkP98H17.js
DELETED
|
@@ -1,191 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { d as e, i as t, n, o as r, t as i } from "./Dialog-CzVhHLEY.js";
|
|
3
|
-
import { r as a } from "./ThemeProvider-BQmIB5tr.js";
|
|
4
|
-
import { t as o } from "./CollectionInput-B1qV4QEH.js";
|
|
5
|
-
import { useEffect as s, useState as c } from "react";
|
|
6
|
-
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
-
import { toast as f } from "sonner";
|
|
8
|
-
import { c as p } from "react/compiler-runtime";
|
|
9
|
-
import m from "clsx";
|
|
10
|
-
import { IconCircleCheck as h, IconLoader as g } from "@tabler/icons-react";
|
|
11
|
-
//#region ../react/dist/components/Sonner.js
|
|
12
|
-
var _ = (e, t = "Error", n = {}) => {
|
|
13
|
-
f.error(t, {
|
|
14
|
-
description: e,
|
|
15
|
-
duration: 4e3,
|
|
16
|
-
position: "bottom-right",
|
|
17
|
-
...n
|
|
18
|
-
});
|
|
19
|
-
}, v = (e, t = "Success", n = {}) => {
|
|
20
|
-
n?.id && f.dismiss(n?.id), f.success(t, {
|
|
21
|
-
description: e,
|
|
22
|
-
duration: 4e3,
|
|
23
|
-
position: "bottom-right",
|
|
24
|
-
...n
|
|
25
|
-
});
|
|
26
|
-
}, y = "_1k4xirc1", b = (e) => {
|
|
27
|
-
let t = p(8), n, r;
|
|
28
|
-
t[0] === e ? (n = t[1], r = t[2]) : ({className: n, ...r} = e, t[0] = e, t[1] = n, t[2] = r);
|
|
29
|
-
let i;
|
|
30
|
-
t[3] === n ? i = t[4] : (i = m(y, n), t[3] = n, t[4] = i);
|
|
31
|
-
let a;
|
|
32
|
-
return t[5] !== r || t[6] !== i ? (a = /* @__PURE__ */ u(g, {
|
|
33
|
-
role: "status",
|
|
34
|
-
"aria-label": "Loading",
|
|
35
|
-
className: i,
|
|
36
|
-
...r
|
|
37
|
-
}), t[5] = r, t[6] = i, t[7] = a) : a = t[7], a;
|
|
38
|
-
}, 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 }) => {
|
|
39
|
-
let { membership: g } = e(), [y, b] = c(""), [k, A] = c(!1), [j, M] = c(!1), [N, P] = c(30);
|
|
40
|
-
return s(() => {
|
|
41
|
-
let e;
|
|
42
|
-
return l && N > 0 && (e = setInterval(() => {
|
|
43
|
-
P((e) => e - 1);
|
|
44
|
-
}, 1e3)), () => clearInterval(e);
|
|
45
|
-
}, [l, N]), s(() => {
|
|
46
|
-
l && (b(""), P(30), A(!1), M(!1));
|
|
47
|
-
}, [l]), /* @__PURE__ */ u(r, {
|
|
48
|
-
open: l,
|
|
49
|
-
onOpenChange: (e) => {
|
|
50
|
-
e || f();
|
|
51
|
-
},
|
|
52
|
-
children: /* @__PURE__ */ d(n, {
|
|
53
|
-
className: x,
|
|
54
|
-
children: [/* @__PURE__ */ u(i, { children: /* @__PURE__ */ u(t, { children: `Verify ${m === "email" ? "Email" : "Phone"}` }) }), /* @__PURE__ */ d("div", {
|
|
55
|
-
className: S,
|
|
56
|
-
children: [
|
|
57
|
-
/* @__PURE__ */ d("div", {
|
|
58
|
-
className: C,
|
|
59
|
-
children: [
|
|
60
|
-
"Enter the 4-digit code sent to ",
|
|
61
|
-
/* @__PURE__ */ u("strong", { children: p }),
|
|
62
|
-
".",
|
|
63
|
-
" ",
|
|
64
|
-
/* @__PURE__ */ u("button", {
|
|
65
|
-
onClick: () => f(),
|
|
66
|
-
className: w,
|
|
67
|
-
children: "Change?"
|
|
68
|
-
})
|
|
69
|
-
]
|
|
70
|
-
}),
|
|
71
|
-
/* @__PURE__ */ u("div", {
|
|
72
|
-
className: T,
|
|
73
|
-
children: /* @__PURE__ */ u(o, {
|
|
74
|
-
value: y,
|
|
75
|
-
onChange: (e) => {
|
|
76
|
-
b(e.target.value.replace(/\D/g, "").slice(0, 4));
|
|
77
|
-
},
|
|
78
|
-
placeholder: "0000",
|
|
79
|
-
maxLength: 4,
|
|
80
|
-
className: D
|
|
81
|
-
})
|
|
82
|
-
}),
|
|
83
|
-
/* @__PURE__ */ d("div", {
|
|
84
|
-
className: E,
|
|
85
|
-
children: [/* @__PURE__ */ u(a, {
|
|
86
|
-
onClick: async () => {
|
|
87
|
-
if (!(!y || y.length !== 4)) {
|
|
88
|
-
A(!0);
|
|
89
|
-
try {
|
|
90
|
-
await g?.signInWithOtp({
|
|
91
|
-
content: p,
|
|
92
|
-
code: y
|
|
93
|
-
}), v("Verification successful"), h(p), f();
|
|
94
|
-
} catch (e) {
|
|
95
|
-
let t = e;
|
|
96
|
-
_(t?.message || "Invalid OTP", t?.title || "Verification Failed");
|
|
97
|
-
} finally {
|
|
98
|
-
A(!1);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
disabled: y.length !== 4 || k,
|
|
103
|
-
className: "w-full",
|
|
104
|
-
children: k ? "Verifying..." : "Verify"
|
|
105
|
-
}), /* @__PURE__ */ u("div", {
|
|
106
|
-
className: O,
|
|
107
|
-
children: N > 0 ? /* @__PURE__ */ d("span", { children: [
|
|
108
|
-
"Resend code in ",
|
|
109
|
-
N,
|
|
110
|
-
"s"
|
|
111
|
-
] }) : /* @__PURE__ */ u("button", {
|
|
112
|
-
onClick: async () => {
|
|
113
|
-
if (!(N > 0)) {
|
|
114
|
-
M(!0);
|
|
115
|
-
try {
|
|
116
|
-
await g?.requestOtp({
|
|
117
|
-
content: p,
|
|
118
|
-
medium: m === "phone" ? "whatsapp" : "email"
|
|
119
|
-
}), v("OTP resent successfully"), P(30);
|
|
120
|
-
} catch (e) {
|
|
121
|
-
let t = e;
|
|
122
|
-
_(t?.message || "Failed to resend OTP", t?.title || "Error");
|
|
123
|
-
} finally {
|
|
124
|
-
M(!1);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
disabled: j,
|
|
129
|
-
className: w,
|
|
130
|
-
children: j ? "Resending..." : "Resend Code"
|
|
131
|
-
})
|
|
132
|
-
})]
|
|
133
|
-
})
|
|
134
|
-
]
|
|
135
|
-
})]
|
|
136
|
-
})
|
|
137
|
-
});
|
|
138
|
-
}, A = "jfrbe10", j = "jfrbe11", M = "jfrbe12", N = ({ value: t, type: n, isVerified: r, onVerifySuccess: i, onStateChange: o }) => {
|
|
139
|
-
let { membership: s } = e(), [f, p] = c(!1), [m, g] = c(!1), v = (e) => {
|
|
140
|
-
o && o(e);
|
|
141
|
-
}, y = async () => {
|
|
142
|
-
let e = t?.trim()?.toLowerCase();
|
|
143
|
-
if (!e) {
|
|
144
|
-
_(`Please enter a ${n}`);
|
|
145
|
-
return;
|
|
146
|
-
}
|
|
147
|
-
if (n === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e)) {
|
|
148
|
-
_("Please enter a valid email address");
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
g(!0), v(!0);
|
|
152
|
-
try {
|
|
153
|
-
await s?.requestOtp({
|
|
154
|
-
content: e,
|
|
155
|
-
medium: n === "phone" ? "whatsapp" : "email"
|
|
156
|
-
}), p(!0);
|
|
157
|
-
} catch (e) {
|
|
158
|
-
let t = e;
|
|
159
|
-
_(t?.message || "Failed to send OTP", t?.title || "Error"), v(!1);
|
|
160
|
-
} finally {
|
|
161
|
-
g(!1);
|
|
162
|
-
}
|
|
163
|
-
}, x = () => {
|
|
164
|
-
p(!1), v(!1);
|
|
165
|
-
};
|
|
166
|
-
return r ? /* @__PURE__ */ d("div", {
|
|
167
|
-
className: A,
|
|
168
|
-
children: [/* @__PURE__ */ u(h, { className: M }), /* @__PURE__ */ u("span", {
|
|
169
|
-
className: j,
|
|
170
|
-
children: "Verified"
|
|
171
|
-
})]
|
|
172
|
-
}) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(a, {
|
|
173
|
-
size: "default",
|
|
174
|
-
variant: "ghost",
|
|
175
|
-
onClick: y,
|
|
176
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
177
|
-
disabled: !t || m,
|
|
178
|
-
type: "button",
|
|
179
|
-
children: m ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(b, { size: 14 }), "Sending..."] }) : "Verify"
|
|
180
|
-
}), f && /* @__PURE__ */ u(k, {
|
|
181
|
-
isOpen: f,
|
|
182
|
-
onClose: x,
|
|
183
|
-
value: t?.trim()?.toLowerCase() || "",
|
|
184
|
-
type: n,
|
|
185
|
-
onVerifySuccess: (e) => {
|
|
186
|
-
i(e), x();
|
|
187
|
-
}
|
|
188
|
-
})] });
|
|
189
|
-
};
|
|
190
|
-
//#endregion
|
|
191
|
-
export { _ as a, v as i, x as n, b as r, N as t };
|
package/dist-CJknSbJK.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
|
|
2
|
-
import { d as t } from "./Dialog-CzVhHLEY.js";
|
|
3
|
-
import { a as n, c as r, g as i, h as a, l as o, n as s, r as c, t as l } from "./PopupRenderer-Bncp54gB-DuCULkBK.js";
|
|
4
|
-
import { Suspense as u, lazy as d, useEffect as f, useRef as p, useState as m } from "react";
|
|
5
|
-
import { jsx as h } from "react/jsx-runtime";
|
|
6
|
-
import { c as g } from "react/compiler-runtime";
|
|
7
|
-
import "clsx";
|
|
8
|
-
import "@tabler/icons-react";
|
|
9
|
-
import { $isIdentityContextReady as _ } from "@levo-so/insights/stores";
|
|
10
|
-
//#region ../../libraries/popups/dist/index.js
|
|
11
|
-
var v = /* @__PURE__ */ e({
|
|
12
|
-
PopupLoader: () => x,
|
|
13
|
-
fetchActivePopups: () => y,
|
|
14
|
-
usePopup: () => C
|
|
15
|
-
}), y = async (e, t) => {
|
|
16
|
-
let n = {};
|
|
17
|
-
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 ?? [];
|
|
18
|
-
}, b = d(() => import("./PopupRenderer-Bncp54gB-DuCULkBK.js").then((e) => e.o).then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), x = (e) => {
|
|
19
|
-
let n = g(9), { siteId: r, pageId: i } = e, { fetch: a, logger: o } = t(), [c, l] = m(null), d = p(!1), v, x;
|
|
20
|
-
if (n[0] !== a || n[1] !== o || n[2] !== r ? (v = () => {
|
|
21
|
-
if (d.current) return;
|
|
22
|
-
let e = () => {
|
|
23
|
-
d.current || (d.current = !0, y(a, r ? { site_id: r } : void 0).then((e) => {
|
|
24
|
-
s(e), l(e);
|
|
25
|
-
}).catch((e) => {
|
|
26
|
-
o?.error("Failed to fetch popups", { exception: e }), s([]), l([]);
|
|
27
|
-
}).finally(S));
|
|
28
|
-
};
|
|
29
|
-
if (_.get()) {
|
|
30
|
-
e();
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
let t = _.listen((n) => {
|
|
34
|
-
n && (t(), e());
|
|
35
|
-
});
|
|
36
|
-
return () => t();
|
|
37
|
-
}, x = [
|
|
38
|
-
a,
|
|
39
|
-
o,
|
|
40
|
-
r
|
|
41
|
-
], n[0] = a, n[1] = o, n[2] = r, n[3] = v, n[4] = x) : (v = n[3], x = n[4]), f(v, x), !c || c.length === 0) return null;
|
|
42
|
-
let C;
|
|
43
|
-
n[5] === Symbol.for("react.memo_cache_sentinel") ? (C = {
|
|
44
|
-
position: "relative",
|
|
45
|
-
zIndex: 99999
|
|
46
|
-
}, n[5] = C) : C = n[5];
|
|
47
|
-
let w;
|
|
48
|
-
return n[6] !== i || n[7] !== c ? (w = /* @__PURE__ */ h("div", {
|
|
49
|
-
style: C,
|
|
50
|
-
children: /* @__PURE__ */ h(u, { children: /* @__PURE__ */ h(b, {
|
|
51
|
-
popups: c,
|
|
52
|
-
pageId: i
|
|
53
|
-
}) })
|
|
54
|
-
}), n[6] = i, n[7] = c, n[8] = w) : w = n[8], w;
|
|
55
|
-
};
|
|
56
|
-
function S() {
|
|
57
|
-
return c(!1);
|
|
58
|
-
}
|
|
59
|
-
var C = () => {
|
|
60
|
-
let e = g(3), t = i(r), n = i(o), a = w, s = T, c;
|
|
61
|
-
return e[0] !== n || e[1] !== t ? (c = {
|
|
62
|
-
popups: t,
|
|
63
|
-
isLoading: n,
|
|
64
|
-
openPopup: a,
|
|
65
|
-
closePopup: s
|
|
66
|
-
}, e[0] = n, e[1] = t, e[2] = c) : c = e[2], c;
|
|
67
|
-
};
|
|
68
|
-
function w(e) {
|
|
69
|
-
let t = r.get().find((t) => t.id === e);
|
|
70
|
-
t && n(t, {
|
|
71
|
-
force: !0,
|
|
72
|
-
trigger_type: "manual"
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
function T() {
|
|
76
|
-
let e = a.get().active_popup_id;
|
|
77
|
-
e && l(e);
|
|
78
|
-
}
|
|
79
|
-
//#endregion
|
|
80
|
-
export { v as n, C as t };
|