@levo-so/site-runtime 0.3.8 → 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.
- package/{DateTimeWidget-hFjcn3o6.js → DateTimeWidget-LfaosVVW.js} +1 -1
- package/{KBChatWidget-ClHFDgJ5.js → KBChatWidget-CuAtGhHT.js} +11 -10
- package/{PopupBody-DZVwDLkg-Cfy3lWGs.js → PopupBody-BI-MJqmd-C0qNyN7V.js} +285 -168
- package/PopupRenderer-D66Gx63H-C6RnOnl2.js +388 -0
- package/{RichTextWidget-DkKHEq4j.js → RichTextWidget-BFWVevY7.js} +3 -3
- package/{dist-DPmVG7VB.js → dist-Rjs__H25.js} +3 -3
- package/{dist-CRDgdAkQ.js → dist-orLT2eNz.js} +498 -466
- package/index.d.ts +511 -0
- package/index.js +925 -783
- package/{kbChat-C00LVlxP.js → kbChat-L55effMi.js} +2 -2
- package/package.json +37 -27
- package/popups.js +1 -1
- package/routes-CyKmkoRM.js +316 -0
- package/start.d.ts +38 -0
- package/start.js +19 -0
- package/styles.css +1 -1
- package/{usePopupRedirect-BThP_YPW-COUseDik.js → usePopupRedirect-CAAdcpaW-D9XoiVhG.js} +15 -13
- package/PopupRenderer-BjW1jg70-W2y-PEPH.js +0 -387
- /package/{PhoneWidget-BmBO-kvA.js → PhoneWidget-D-CcDuie.js} +0 -0
- /package/{Popover-3N88sRp4.js → Popover-BTdlOQP_.js} +0 -0
- /package/{es-CztjLuNy.js → es-Bj3CsMJz.js} +0 -0
- /package/{nodeAlignment-BnJljFlw.js → nodeAlignment-COvc-rIj.js} +0 -0
- /package/{pillChrome-BAu5AfCT.js → pillChrome-uieiq_SK.js} +0 -0
- /package/{popupState-JmpeKzgM-qhNTV79U.js → popupState-JmpeKzgM-D_77LiAa.js} +0 -0
- /package/{react-CV3jf2mc.js → react-B9yvlbH0.js} +0 -0
- /package/{rteTheme.cssm-xg0gJ28J.js → rteTheme.cssm-CaRzrwtu.js} +0 -0
|
@@ -0,0 +1,388 @@
|
|
|
1
|
+
import { n as e } from "./ThemeProvider-DutrjSTF.js";
|
|
2
|
+
import { i as t, t as n } from "./LevoProvider-Bsjkcwc8.js";
|
|
3
|
+
import { a as r, c as i, l as a, o, s, u as c } from "./Dialog-dT7y641z.js";
|
|
4
|
+
import { t as l } from "./theme.cssm-DUzmx76l.js";
|
|
5
|
+
import { d as u, f as d, l as f, n as p, o as m } from "./popupState-JmpeKzgM-D_77LiAa.js";
|
|
6
|
+
import { n as h, r as g, t as _ } from "./react-B9yvlbH0.js";
|
|
7
|
+
import { a as v, d as y, f as b, g as x, h as S, l as C, m as w, n as T, o as E, p as D, s as ee, t as te, u as O } from "./usePopupRedirect-CAAdcpaW-D9XoiVhG.js";
|
|
8
|
+
import { t as k } from "./rteTheme.cssm-CaRzrwtu.js";
|
|
9
|
+
import { c as A } from "react/compiler-runtime";
|
|
10
|
+
import j from "clsx";
|
|
11
|
+
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
12
|
+
import { Suspense as F, lazy as I, useEffect as L, useRef as R } from "react";
|
|
13
|
+
import { IconX as z } from "@tabler/icons-react";
|
|
14
|
+
import { $activity as B, $isIdentityContextReady as ne, $pageLifecycle as re, $scrollBehavior as V, $session as ie, getTabCount as H } from "@levo-so/insights/stores";
|
|
15
|
+
//#region ../../libraries/levocn/dist/theme/utils/googleFonts.js
|
|
16
|
+
var U = "wght@300;400;500;600;700;900", W = (e) => !!e && e !== "inherit" && !e.includes(",") && !e.includes("var("), G = (...e) => {
|
|
17
|
+
let t = Array.from(new Set(e.filter((e) => typeof e == "string").map((e) => e.trim()).filter(W)));
|
|
18
|
+
return t.length === 0 ? null : `https://fonts.googleapis.com/css2?${t.map((e) => `family=${e.replace(/ /g, "+")}:${U}`).join("&")}&display=swap`;
|
|
19
|
+
}, K = (e) => {
|
|
20
|
+
if (document.querySelector(`link[rel="preconnect"][href="${e}"]`)) return;
|
|
21
|
+
let t = document.createElement("link");
|
|
22
|
+
t.rel = "preconnect", t.href = e, t.crossOrigin = "anonymous", document.head.appendChild(t);
|
|
23
|
+
}, q = (e) => {
|
|
24
|
+
let t = `family=${e.replace(/ /g, "+")}:`;
|
|
25
|
+
return Array.from(document.querySelectorAll("link[rel=\"stylesheet\"][href*=\"fonts.googleapis.com\"]")).some((e) => e.href.includes(t));
|
|
26
|
+
}, J = (...e) => {
|
|
27
|
+
let t = A(5), n = e, r;
|
|
28
|
+
t[0] === n ? r = t[1] : (r = n.filter(Y).map(ae).join("|"), t[0] = n, t[1] = r);
|
|
29
|
+
let i = r, a, o;
|
|
30
|
+
t[2] === i ? (a = t[3], o = t[4]) : (a = () => {
|
|
31
|
+
let e = G(...(i ? i.split("|") : []).filter(oe));
|
|
32
|
+
if (!e) return;
|
|
33
|
+
K("https://fonts.googleapis.com"), K("https://fonts.gstatic.com");
|
|
34
|
+
let t = document.createElement("link");
|
|
35
|
+
t.rel = "stylesheet", t.href = e, t.crossOrigin = "anonymous", t.setAttribute("data-levo-fonts", e), document.head.appendChild(t);
|
|
36
|
+
}, o = [i], t[2] = i, t[3] = a, t[4] = o), L(a, o);
|
|
37
|
+
};
|
|
38
|
+
function Y(e) {
|
|
39
|
+
return typeof e == "string" && e.trim() !== "";
|
|
40
|
+
}
|
|
41
|
+
function ae(e) {
|
|
42
|
+
return e.trim();
|
|
43
|
+
}
|
|
44
|
+
function oe(e) {
|
|
45
|
+
return !q(e);
|
|
46
|
+
}
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region ../../libraries/popups/dist/PopupDialog-DeOpYgDM.js
|
|
49
|
+
var se = (e) => (e ?? "16:9").replace(":", " / "), ce = (e) => {
|
|
50
|
+
if (e.content.coverImage?.srcset) return Object.entries(e.content.coverImage.srcset).filter(([e]) => e !== "path").map(([e, t]) => `${t} ${e}`).join(", ");
|
|
51
|
+
}, le = (e) => {
|
|
52
|
+
let t = A(18), { popup: n, disableInteraction: r, children: i } = e, { content: a } = n, o = S(n), s = !!o && !r, c;
|
|
53
|
+
t[0] !== a.coverImage || t[1] !== a.coverImageFocus || t[2] !== n ? (c = a.coverImage && /* @__PURE__ */ N("img", {
|
|
54
|
+
src: a.coverImage.location,
|
|
55
|
+
srcSet: ce(n),
|
|
56
|
+
alt: "",
|
|
57
|
+
className: "_1gklkndl",
|
|
58
|
+
style: a.coverImageFocus ? { objectPosition: a.coverImageFocus.replace("-", " ") } : void 0
|
|
59
|
+
}), t[0] = a.coverImage, t[1] = a.coverImageFocus, t[2] = n, t[3] = c) : c = t[3];
|
|
60
|
+
let l = c, u;
|
|
61
|
+
t[4] === a.coverImageRatio ? u = t[5] : (u = se(a.coverImageRatio), t[4] = a.coverImageRatio, t[5] = u);
|
|
62
|
+
let d;
|
|
63
|
+
t[6] === u ? d = t[7] : (d = { aspectRatio: u }, t[6] = u, t[7] = d);
|
|
64
|
+
let f = d, p;
|
|
65
|
+
t[8] !== a.action || t[9] !== a.coverImage || t[10] !== s || t[11] !== l || t[12] !== f || t[13] !== o ? (p = a.coverImage && (s ? /* @__PURE__ */ N("button", {
|
|
66
|
+
type: "button",
|
|
67
|
+
className: j("_1gklkndj", "_1gklkndk"),
|
|
68
|
+
style: f,
|
|
69
|
+
onClick: o ?? void 0,
|
|
70
|
+
"aria-label": a.action?.type === "redirect" ? a.action.label : void 0,
|
|
71
|
+
children: l
|
|
72
|
+
}) : /* @__PURE__ */ N("div", {
|
|
73
|
+
className: "_1gklkndj",
|
|
74
|
+
style: f,
|
|
75
|
+
children: l
|
|
76
|
+
})), t[8] = a.action, t[9] = a.coverImage, t[10] = s, t[11] = l, t[12] = f, t[13] = o, t[14] = p) : p = t[14];
|
|
77
|
+
let m;
|
|
78
|
+
return t[15] !== i || t[16] !== p ? (m = /* @__PURE__ */ P("div", {
|
|
79
|
+
className: y,
|
|
80
|
+
children: [p, i]
|
|
81
|
+
}), t[15] = i, t[16] = p, t[17] = m) : m = t[17], m;
|
|
82
|
+
}, ue = (t) => {
|
|
83
|
+
let n = A(19), r, i, a, o, s;
|
|
84
|
+
n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4], s = n[5]) : ({children: r, popupTheme: i, siteTheme: o, style: s, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o, n[5] = s);
|
|
85
|
+
let c;
|
|
86
|
+
n[6] !== i || n[7] !== o ? (c = i ?? (o ? g(o) : null), n[6] = i, n[7] = o, n[8] = c) : c = n[8];
|
|
87
|
+
let u = c;
|
|
88
|
+
J(u?.fonts?.heading, u?.fonts?.body);
|
|
89
|
+
let d;
|
|
90
|
+
n[9] === Symbol.for("react.memo_cache_sentinel") ? (d = j(l, k), n[9] = d) : d = n[9];
|
|
91
|
+
let f;
|
|
92
|
+
n[10] === u ? f = n[11] : (f = h(u), n[10] = u, n[11] = f);
|
|
93
|
+
let p;
|
|
94
|
+
n[12] !== s || n[13] !== f ? (p = {
|
|
95
|
+
...f,
|
|
96
|
+
...s
|
|
97
|
+
}, n[12] = s, n[13] = f, n[14] = p) : p = n[14];
|
|
98
|
+
let m;
|
|
99
|
+
return n[15] !== r || n[16] !== a || n[17] !== p ? (m = /* @__PURE__ */ N(e, {
|
|
100
|
+
className: d,
|
|
101
|
+
cssReset: !0,
|
|
102
|
+
style: p,
|
|
103
|
+
...a,
|
|
104
|
+
children: r
|
|
105
|
+
}), n[15] = r, n[16] = a, n[17] = p, n[18] = m) : m = n[18], m;
|
|
106
|
+
}, de = I(() => import("./PopupBody-BI-MJqmd-C0qNyN7V.js").then((e) => e.n).then((e) => ({ default: e.PopupBody }))), fe = (e) => {
|
|
107
|
+
let t = A(7), { size: n } = e, r = n ?? "medium", i;
|
|
108
|
+
t[0] === r ? i = t[1] : (i = O({ size: r }), t[0] = r, t[1] = i);
|
|
109
|
+
let a, o, s;
|
|
110
|
+
t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ N("div", { className: D }), o = /* @__PURE__ */ N("div", { className: v }), s = /* @__PURE__ */ N("div", { className: T }), t[2] = a, t[3] = o, t[4] = s) : (a = t[2], o = t[3], s = t[4]);
|
|
111
|
+
let c;
|
|
112
|
+
return t[5] === i ? c = t[6] : (c = /* @__PURE__ */ P("div", {
|
|
113
|
+
className: i,
|
|
114
|
+
children: [
|
|
115
|
+
a,
|
|
116
|
+
o,
|
|
117
|
+
s
|
|
118
|
+
]
|
|
119
|
+
}), t[5] = i, t[6] = c), c;
|
|
120
|
+
}, X = () => {
|
|
121
|
+
let e = A(8), { popup: t } = w(), n;
|
|
122
|
+
e[0] === t.content.size ? n = e[1] : (n = /* @__PURE__ */ N(fe, { size: t.content.size }), e[0] = t.content.size, e[1] = n);
|
|
123
|
+
let r;
|
|
124
|
+
e[2] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ N(de, {}), e[2] = r) : r = e[2];
|
|
125
|
+
let i;
|
|
126
|
+
e[3] === n ? i = e[4] : (i = /* @__PURE__ */ N(F, {
|
|
127
|
+
fallback: n,
|
|
128
|
+
children: r
|
|
129
|
+
}), e[3] = n, e[4] = i);
|
|
130
|
+
let a;
|
|
131
|
+
return e[5] !== t || e[6] !== i ? (a = /* @__PURE__ */ N(le, {
|
|
132
|
+
popup: t,
|
|
133
|
+
children: i
|
|
134
|
+
}), e[5] = t, e[6] = i, e[7] = a) : a = e[7], a;
|
|
135
|
+
}, pe = (e) => e.content.position || "top-right", me = (e) => {
|
|
136
|
+
switch (e) {
|
|
137
|
+
case "close-press": return "close_button";
|
|
138
|
+
case "outside-press": return "outside_click";
|
|
139
|
+
case "escape-key": return "escape_key";
|
|
140
|
+
default: return "programmatic";
|
|
141
|
+
}
|
|
142
|
+
}, he = () => {
|
|
143
|
+
let e = A(32), { popup: t, callbacks: n } = w(), { placement: l, id: f } = t, p = _(u).active_popup_id === f, m = R(!1), h, g;
|
|
144
|
+
e[0] !== n || e[1] !== p || e[2] !== t ? (h = () => {
|
|
145
|
+
p && !m.current && (m.current = !0, n?.onPopupOpen?.(t, { trigger_type: d() })), p || (m.current = !1);
|
|
146
|
+
}, g = [
|
|
147
|
+
p,
|
|
148
|
+
t,
|
|
149
|
+
n
|
|
150
|
+
], e[0] = n, e[1] = p, e[2] = t, e[3] = h, e[4] = g) : (h = e[3], g = e[4]), L(h, g);
|
|
151
|
+
let v = te(), y, x, S, T, E, D, O, k;
|
|
152
|
+
if (e[5] !== v || e[6] !== p || e[7] !== l || e[8] !== t) {
|
|
153
|
+
let n = pe(t), u = l === "popup", d = l === "slide_in";
|
|
154
|
+
x = o, E = p, e[17] === v ? D = e[18] : (D = (e, t) => !e && v(me(t?.reason)), e[17] = v, e[18] = D), O = u, k = !u, y = i, e[19] === u ? S = e[20] : (S = u && /* @__PURE__ */ N(a, {}), e[19] = u, e[20] = S), T = u ? /* @__PURE__ */ N(c, {
|
|
155
|
+
className: ee,
|
|
156
|
+
children: /* @__PURE__ */ P(s.Popup, {
|
|
157
|
+
className: C({ placement: l }),
|
|
158
|
+
children: [/* @__PURE__ */ N(r, {
|
|
159
|
+
variant: "ghost",
|
|
160
|
+
size: "icon-xs",
|
|
161
|
+
className: b,
|
|
162
|
+
"aria-label": "Close popup",
|
|
163
|
+
children: /* @__PURE__ */ N(z, { size: 16 })
|
|
164
|
+
}), /* @__PURE__ */ N(X, {})]
|
|
165
|
+
})
|
|
166
|
+
}) : /* @__PURE__ */ P(s.Popup, {
|
|
167
|
+
className: j(C({
|
|
168
|
+
placement: l,
|
|
169
|
+
position: n
|
|
170
|
+
}), d && "_1gklkndd"),
|
|
171
|
+
children: [/* @__PURE__ */ N(r, {
|
|
172
|
+
variant: "ghost",
|
|
173
|
+
size: "icon-xs",
|
|
174
|
+
className: b,
|
|
175
|
+
"aria-label": "Close popup",
|
|
176
|
+
children: /* @__PURE__ */ N(z, { size: 16 })
|
|
177
|
+
}), /* @__PURE__ */ N(X, {})]
|
|
178
|
+
}), e[5] = v, e[6] = p, e[7] = l, e[8] = t, e[9] = y, e[10] = x, e[11] = S, e[12] = T, e[13] = E, e[14] = D, e[15] = O, e[16] = k;
|
|
179
|
+
} else y = e[9], x = e[10], S = e[11], T = e[12], E = e[13], D = e[14], O = e[15], k = e[16];
|
|
180
|
+
let M;
|
|
181
|
+
e[21] !== y || e[22] !== S || e[23] !== T ? (M = /* @__PURE__ */ P(y, { children: [S, T] }), e[21] = y, e[22] = S, e[23] = T, e[24] = M) : M = e[24];
|
|
182
|
+
let F;
|
|
183
|
+
return e[25] !== x || e[26] !== E || e[27] !== D || e[28] !== O || e[29] !== k || e[30] !== M ? (F = /* @__PURE__ */ N(x, {
|
|
184
|
+
open: E,
|
|
185
|
+
onOpenChange: D,
|
|
186
|
+
modal: O,
|
|
187
|
+
disablePointerDismissal: k,
|
|
188
|
+
children: M
|
|
189
|
+
}), e[25] = x, e[26] = E, e[27] = D, e[28] = O, e[29] = k, e[30] = M, e[31] = F) : F = e[31], F;
|
|
190
|
+
}, ge = 3e4, _e = 5e3, ve = 5e3, ye = 100, be = .5, xe = 5, Se = (e) => {
|
|
191
|
+
if (typeof document > "u") return () => {};
|
|
192
|
+
let t = !1, n = Date.now(), r = [], i = 0, a = null, o = () => Date.now() - n >= ge, s = () => {
|
|
193
|
+
t || (t = !0, c(), e());
|
|
194
|
+
}, c = () => {
|
|
195
|
+
a &&= (clearTimeout(a), null);
|
|
196
|
+
}, l = () => {
|
|
197
|
+
if (r.length < 2) return 0;
|
|
198
|
+
let e = r[0], t = r[r.length - 1], n = t.t - e.t;
|
|
199
|
+
return n === 0 ? 0 : (e.y - t.y) / n;
|
|
200
|
+
}, u = () => r.reduce((e, t) => t.y > e ? t.y : e, 0), d = (e) => {
|
|
201
|
+
r.push({
|
|
202
|
+
y: e.clientY,
|
|
203
|
+
t: Date.now()
|
|
204
|
+
}), r.length > xe && r.shift();
|
|
205
|
+
}, f = (e) => {
|
|
206
|
+
t || !o() || e.clientY > 0 || u() < ye || Date.now() - i < ve || l() < be || (c(), a = setTimeout(s, _e));
|
|
207
|
+
}, p = () => {
|
|
208
|
+
c();
|
|
209
|
+
}, m = () => {
|
|
210
|
+
i = Date.now();
|
|
211
|
+
}, h = re.listen((e) => {
|
|
212
|
+
o() && (e === "hidden" || e === "frozen") && s();
|
|
213
|
+
});
|
|
214
|
+
return document.addEventListener("mousemove", d, { passive: !0 }), document.addEventListener("mouseleave", f), document.addEventListener("mouseenter", p), window.addEventListener("scroll", m, { passive: !0 }), () => {
|
|
215
|
+
c(), document.removeEventListener("mousemove", d), document.removeEventListener("mouseleave", f), document.removeEventListener("mouseenter", p), window.removeEventListener("scroll", m), h();
|
|
216
|
+
};
|
|
217
|
+
}, Z = (e, t) => {
|
|
218
|
+
if (!e) return null;
|
|
219
|
+
let n = setTimeout(() => p(t, { trigger_type: "time_on_page" }), e);
|
|
220
|
+
return () => clearTimeout(n);
|
|
221
|
+
}, Ce = (e, t) => {
|
|
222
|
+
if (e === void 0) return null;
|
|
223
|
+
let n = !1;
|
|
224
|
+
return V.listen((r) => {
|
|
225
|
+
n || r.depth >= e && (n = !0, p(t, { trigger_type: "scroll_depth" }));
|
|
226
|
+
});
|
|
227
|
+
}, we = (e) => {
|
|
228
|
+
let t = !1;
|
|
229
|
+
return B.listen((n) => {
|
|
230
|
+
t || n.status === "idle" && (t = !0, p(e, { trigger_type: "inactivity" }));
|
|
231
|
+
});
|
|
232
|
+
}, Te = (e, t) => {
|
|
233
|
+
let n = A(11), r = t === void 0 ? !0 : t, { triggers: i, id: a } = e, o = _(ne), s;
|
|
234
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (s = [], n[0] = s) : s = n[0];
|
|
235
|
+
let c = R(s), l;
|
|
236
|
+
n[1] !== r || n[2] !== o || n[3] !== e || n[4] !== i ? (l = () => {
|
|
237
|
+
if (!r || !o || !i) return;
|
|
238
|
+
let t = [];
|
|
239
|
+
if (i.time_on_page.enabled) {
|
|
240
|
+
let n = Z(i.time_on_page.delay_ms, e);
|
|
241
|
+
n && t.push(n);
|
|
242
|
+
}
|
|
243
|
+
if (i.scroll_depth.enabled) {
|
|
244
|
+
let n = Ce(i.scroll_depth.percent, e);
|
|
245
|
+
n && t.push(n);
|
|
246
|
+
}
|
|
247
|
+
return i.exit_intent.enabled && t.push(Se(() => p(e, { trigger_type: "exit_intent" }))), i.inactivity.enabled && t.push(we(e)), c.current = t, () => {
|
|
248
|
+
t.forEach(Ee), c.current = [];
|
|
249
|
+
};
|
|
250
|
+
}, n[1] = r, n[2] = o, n[3] = e, n[4] = i, n[5] = l) : l = n[5];
|
|
251
|
+
let u;
|
|
252
|
+
n[6] !== r || n[7] !== o || n[8] !== a || n[9] !== i ? (u = [
|
|
253
|
+
r,
|
|
254
|
+
o,
|
|
255
|
+
a,
|
|
256
|
+
i
|
|
257
|
+
], n[6] = r, n[7] = o, n[8] = a, n[9] = i, n[10] = u) : u = n[10], L(l, u);
|
|
258
|
+
};
|
|
259
|
+
function Ee(e) {
|
|
260
|
+
return e();
|
|
261
|
+
}
|
|
262
|
+
var Q = (e, t) => {
|
|
263
|
+
switch (e.match_type) {
|
|
264
|
+
case "is_all_pages": return !0;
|
|
265
|
+
case "is": return e.page_id ? t.pageId === e.page_id ? e.value == null || e.value === t.path : !1 : e.value != null && e.value === t.path;
|
|
266
|
+
case "contains": return e.value != null && t.path.includes(e.value);
|
|
267
|
+
case "begins_with": return e.value != null && t.path.startsWith(e.value);
|
|
268
|
+
default: return !1;
|
|
269
|
+
}
|
|
270
|
+
}, $ = (e, t) => {
|
|
271
|
+
switch (e.match_type) {
|
|
272
|
+
case "exact": return t === e.value;
|
|
273
|
+
case "contains": return t.includes(e.value);
|
|
274
|
+
case "domain": try {
|
|
275
|
+
let n = new URL(t).hostname, r = e.value.toLowerCase();
|
|
276
|
+
return n === r || n.endsWith(`.${r}`);
|
|
277
|
+
} catch {
|
|
278
|
+
return !1;
|
|
279
|
+
}
|
|
280
|
+
default: return !1;
|
|
281
|
+
}
|
|
282
|
+
}, De = (e, t, n) => {
|
|
283
|
+
let r = e.pages?.exclude ?? [];
|
|
284
|
+
if (r.length > 0 && r.some((e) => Q(e, t))) return !1;
|
|
285
|
+
let i = e.pages?.include ?? [];
|
|
286
|
+
if (i.length > 0 && !i.some((e) => Q(e, t))) return !1;
|
|
287
|
+
let a = e.referrer?.include ?? [];
|
|
288
|
+
if (a.length > 0 && (!n || !a.some((e) => $(e, n)))) return !1;
|
|
289
|
+
let o = e.referrer?.exclude ?? [];
|
|
290
|
+
return !(o.length > 0 && n && o.some((e) => $(e, n)));
|
|
291
|
+
}, Oe = (e) => {
|
|
292
|
+
let t = A(4), { pageId: n } = e, { popup: r } = w(), i;
|
|
293
|
+
bb0: {
|
|
294
|
+
if (!r.target) {
|
|
295
|
+
i = !0;
|
|
296
|
+
break bb0;
|
|
297
|
+
}
|
|
298
|
+
if (typeof window > "u") {
|
|
299
|
+
i = !1;
|
|
300
|
+
break bb0;
|
|
301
|
+
}
|
|
302
|
+
let e;
|
|
303
|
+
if (t[0] !== n || t[1] !== r.target) {
|
|
304
|
+
let i = ie.get().identity?.referrer?.raw || document.referrer || null, a = new URL(window.location.href, window.location.origin);
|
|
305
|
+
e = De(r.target, {
|
|
306
|
+
pageId: n,
|
|
307
|
+
path: a.pathname
|
|
308
|
+
}, i), t[0] = n, t[1] = r.target, t[2] = e;
|
|
309
|
+
} else e = t[2];
|
|
310
|
+
i = e;
|
|
311
|
+
}
|
|
312
|
+
let a = i;
|
|
313
|
+
if (Te(r, a), !a) return null;
|
|
314
|
+
let o;
|
|
315
|
+
return t[3] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ N(he, {}), t[3] = o) : o = t[3], o;
|
|
316
|
+
}, ke = () => {
|
|
317
|
+
let e = V.get(), t = B.get();
|
|
318
|
+
return {
|
|
319
|
+
trigger_scroll_depth: e.depth,
|
|
320
|
+
trigger_scroll_speed: e.speedCategory,
|
|
321
|
+
trigger_scroll_direction: e.direction,
|
|
322
|
+
trigger_activity_status: t.status,
|
|
323
|
+
trigger_activity_seconds: t.seconds,
|
|
324
|
+
trigger_tab_count: H()
|
|
325
|
+
};
|
|
326
|
+
}, Ae = (e) => {
|
|
327
|
+
let r = A(18), { popups: i, pageId: a } = e, o = t(), s = n(), c, l;
|
|
328
|
+
r[0] === i ? (c = r[1], l = r[2]) : (c = () => {
|
|
329
|
+
m(i), f(!1);
|
|
330
|
+
}, l = [i], r[0] = i, r[1] = c, r[2] = l), L(c, l);
|
|
331
|
+
let u;
|
|
332
|
+
r[3] === o ? u = r[4] : (u = (e, t) => {
|
|
333
|
+
!o || typeof o.track != "function" || o?.track(e, t);
|
|
334
|
+
}, r[3] = o, r[4] = u);
|
|
335
|
+
let d = u, p = je, h;
|
|
336
|
+
r[5] === d ? h = r[6] : (h = {
|
|
337
|
+
onPopupOpen: (e, t) => {
|
|
338
|
+
d("popup.view", {
|
|
339
|
+
...p(e),
|
|
340
|
+
trigger_type: t.trigger_type,
|
|
341
|
+
language: e.language,
|
|
342
|
+
...ke()
|
|
343
|
+
});
|
|
344
|
+
},
|
|
345
|
+
onPopupClose: (e, t) => {
|
|
346
|
+
d("popup.close", {
|
|
347
|
+
...p(e),
|
|
348
|
+
trigger_type: t.trigger_type,
|
|
349
|
+
dismiss_reason: t.dismiss_reason,
|
|
350
|
+
time_shown_ms: t.time_shown_ms
|
|
351
|
+
});
|
|
352
|
+
},
|
|
353
|
+
onAction: (e, t) => {
|
|
354
|
+
d("popup.action", {
|
|
355
|
+
...p(e),
|
|
356
|
+
...t
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
}, r[5] = d, r[6] = h);
|
|
360
|
+
let g = h, _;
|
|
361
|
+
if (r[7] !== g || r[8] !== s || r[9] !== a || r[10] !== i) {
|
|
362
|
+
let e;
|
|
363
|
+
r[12] !== g || r[13] !== s || r[14] !== a ? (e = (e) => /* @__PURE__ */ N(ue, {
|
|
364
|
+
popupTheme: e.theme,
|
|
365
|
+
siteTheme: e.site?.theme,
|
|
366
|
+
children: /* @__PURE__ */ N(E, {
|
|
367
|
+
popup: e,
|
|
368
|
+
callbacks: g,
|
|
369
|
+
client: s,
|
|
370
|
+
children: /* @__PURE__ */ N(Oe, { pageId: a })
|
|
371
|
+
})
|
|
372
|
+
}, e.id), r[12] = g, r[13] = s, r[14] = a, r[15] = e) : e = r[15], _ = i.map(e), r[7] = g, r[8] = s, r[9] = a, r[10] = i, r[11] = _;
|
|
373
|
+
} else _ = r[11];
|
|
374
|
+
let v;
|
|
375
|
+
return r[16] === _ ? v = r[17] : (v = /* @__PURE__ */ N(M, { children: _ }), r[16] = _, r[17] = v), v;
|
|
376
|
+
};
|
|
377
|
+
function je(e) {
|
|
378
|
+
return {
|
|
379
|
+
resource: "builder.popup",
|
|
380
|
+
identifier: e.id,
|
|
381
|
+
popup_title: e.title,
|
|
382
|
+
placement: e.placement,
|
|
383
|
+
popup_action_kind: e.content.action?.type || "none"
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
var Me = /* @__PURE__ */ x({ PopupRenderer: () => Ae });
|
|
387
|
+
//#endregion
|
|
388
|
+
export { Me as t };
|
|
@@ -3,9 +3,9 @@ import { n as e, r as t, t as n } from "./CollectionField-C-6a1ud4.js";
|
|
|
3
3
|
import { n as r, r as i } from "./ThemeProvider-DutrjSTF.js";
|
|
4
4
|
import { i as a, n as o, r as s, t as c } from "./Tooltip-CQB0LyxK.js";
|
|
5
5
|
import { t as l } from "./theme.cssm-DUzmx76l.js";
|
|
6
|
-
import { n as u, r as d, t as f } from "./nodeAlignment-
|
|
7
|
-
import { t as p } from "./rteTheme.cssm-
|
|
8
|
-
import { a as m, i as h, n as g, o as _, r as v } from "./Popover-
|
|
6
|
+
import { n as u, r as d, t as f } from "./nodeAlignment-COvc-rIj.js";
|
|
7
|
+
import { t as p } from "./rteTheme.cssm-CaRzrwtu.js";
|
|
8
|
+
import { a as m, i as h, n as g, o as _, r as v } from "./Popover-BTdlOQP_.js";
|
|
9
9
|
import { useController as y } from "react-hook-form";
|
|
10
10
|
import { c as b } from "react/compiler-runtime";
|
|
11
11
|
import x from "clsx";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
|
|
2
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-
|
|
4
|
-
import { t as l } from "./react-
|
|
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
5
|
import { c as u } from "react/compiler-runtime";
|
|
6
6
|
import { jsx as d } from "react/jsx-runtime";
|
|
7
7
|
import { Suspense as f, lazy as p, useEffect as m, useRef as h, useState as g } from "react";
|
|
@@ -14,7 +14,7 @@ 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 = p(() => import("./PopupRenderer-
|
|
17
|
+
}, b = p(() => import("./PopupRenderer-D66Gx63H-C6RnOnl2.js").then((e) => e.t).then((e) => ({ default: e.PopupRenderer }))), x = (e) => {
|
|
18
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
20
|
if (p.current) return;
|