@levo-so/studio 0.3.6 → 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.
Files changed (59) hide show
  1. package/{BillingStep-DhK0Mkjr.js → BillingStep-vBBLXLzk.js} +1 -1
  2. package/{Button-Ho7QJuCT.js → Button-BZDul09m.js} +29 -32
  3. package/{CollectionField-CD6ok1A3.js → CollectionField-BZmxRB5D.js} +68 -68
  4. package/DateTimeWidget-Bt1UcCnx.js +255 -0
  5. package/{Dialog-IrII0ugb.js → Dialog-CPE8yUqK.js} +10 -10
  6. package/{EntryCard-BfwGbFzQ.js → EntryCard-DLPs2PaP.js} +4 -4
  7. package/{KBChatWidget-0dtBwnDA.js → KBChatWidget-B-SNBtoX.js} +1 -1
  8. package/{LoginCard-CMeVif-w.js → LoginCard-EtzpuqYB.js} +3 -3
  9. package/{LoginForm-DhGQD4uI.js → LoginForm-kI_b_7Tc.js} +2 -2
  10. package/{LoginModal-Ui2GnSje.js → LoginModal-C-9BhmoO.js} +4 -4
  11. package/{MessageCard-CJltLT2a.js → MessageCard-Nsxr98n6.js} +2 -2
  12. package/{MessageFooter-CrhrI-su.js → MessageFooter-K4Zd_eFO.js} +2 -2
  13. package/{ModalManager-BW3Dol7F.js → ModalManager-CzH36UIk.js} +1 -1
  14. package/{PendingApprovalCard-BlyH59Vy.js → PendingApprovalCard-CCbhY8p3.js} +3 -3
  15. package/{PhoneWidget-BQEfbyV4.js → PhoneWidget-BkzFjfKW.js} +9 -9
  16. package/{Popover-V2O1gz6N.js → Popover-Iis-qOn1.js} +1 -1
  17. package/PopupBody-DZVwDLkg-PiECxgmc.js +171 -0
  18. package/PopupRenderer-BjW1jg70-C1UDgSfJ.js +388 -0
  19. package/{ProfileCard-DFgmQMUO.js → ProfileCard-DzEBPrax.js} +5 -5
  20. package/{RichTextWidget-CStx2PMn.js → RichTextWidget-C3Y-0pNy.js} +181 -181
  21. package/{RteThemeProvider-DxYOzcck.js → RteThemeProvider-owl5oajj.js} +4 -4
  22. package/{Spinner-HCqR1eGW.js → Spinner-D5spB_Mv.js} +1 -1
  23. package/{StripePaymentModal-Cw-AlxTS.js → StripePaymentModal-CiKqmQwK.js} +1 -1
  24. package/{Button-lUfKisu8.js → ThemeProvider-CqPHzkW9.js} +58 -58
  25. package/{Tooltip-DTnCNEcE.js → Tooltip-DHU1QD-n.js} +1 -1
  26. package/{VerifyButton-kdxRhJWI.js → VerifyButton-BwTbzSwS.js} +21 -21
  27. package/{bookingCard-DUMPxFp4.js → bookingCard-kEYdGZJ-.js} +5 -5
  28. package/collection.d.ts +171 -0
  29. package/collection.js +2 -0
  30. package/{theme.cssm-2YTdd8Yh.js → createThemeExtension-C0PSYy0J.js} +2 -2
  31. package/{dialog-RrTP-MGm.js → dialog-8LH_ihs4.js} +1 -1
  32. package/dist-2bXx8eVI.js +3657 -0
  33. package/{PopupRenderer-DBKtkdmH-Ws7F9GmP.js → fontSize-B-ba6pvx.js} +17 -750
  34. package/{inlineCollectionTheme-D2w17LHX.js → generateRadiusScale-RROt8ppa.js} +4 -19
  35. package/index.js +3921 -3918
  36. package/inlineCollectionTheme-uhBXoF1F.js +19 -0
  37. package/{nodeAlignment-DS9_DLGB.js → inlineRteTheme-BOAno9MG.js} +16 -19
  38. package/{kbChat-BuTZ4Ytf.js → kbChat-zJcrfsqJ.js} +2 -2
  39. package/package.json +9 -5
  40. package/popupState-JmpeKzgM-UECLsSbL.js +100 -0
  41. package/rteTheme.cssm-W4gTOijw.js +4 -0
  42. package/studio.css +1 -1
  43. package/theme.cssm-Czj9sF4X.js +4 -0
  44. package/themeMapping-Bi9Rcr5G-C7UXWE6o.js +61 -0
  45. package/{useLogin-BhysESLW.js → useLogin-CfnGrLdO.js} +1 -1
  46. package/usePopupRedirect-BThP_YPW-jXtfhYu6.js +80 -0
  47. package/DateTimeWidget-DHUmirf1.js +0 -255
  48. package/dist-Ckw19x6H.js +0 -3639
  49. package/rolldown-runtime-CAFD8bLK.js +0 -11
  50. /package/{AuthProvider-CFQqiIf1.js → AuthProvider-B5NfFwbG.js} +0 -0
  51. /package/{Beams-DVEhileN.js → Beams-WJN38XSv.js} +0 -0
  52. /package/{Dots-vp0H1Md3.js → Dots-DggLz5I7.js} +0 -0
  53. /package/{Gradient-_5G8Qm5s.js → Gradient-BSWJAu0a.js} +0 -0
  54. /package/{Grid-D694XUrO.js → Grid-BFKl0MUt.js} +0 -0
  55. /package/{Waves-DeNoq6Bo.js → Waves-BPEgTYoO.js} +0 -0
  56. /package/{authentication-TdyaDNTn.js → authentication-BXQbxiPP.js} +0 -0
  57. /package/{card-Cb4m0p4i.js → card-5ooLmYSr.js} +0 -0
  58. /package/{cn-BL52QQS4.js → cn-B6c1DjO_.js} +0 -0
  59. /package/{pillChrome-CrJ9a5vj.js → pillChrome-CYoMtUAv.js} +0 -0
@@ -0,0 +1,388 @@
1
+ import { d as e, f as t, l as n, n as r, o as i } from "./popupState-JmpeKzgM-UECLsSbL.js";
2
+ import { n as a } from "./ThemeProvider-CqPHzkW9.js";
3
+ import { n as o, t as s } from "./themeMapping-Bi9Rcr5G-C7UXWE6o.js";
4
+ import { t as c } from "./theme.cssm-Czj9sF4X.js";
5
+ import { a as l, c as u, l as d, o as f, s as p, u as m } from "./Dialog-CPE8yUqK.js";
6
+ import { t as h } from "./rteTheme.cssm-W4gTOijw.js";
7
+ import { _ as g, c as _, d as v, f as y, g as b, h as x, m as S, n as C, o as w, p as T, s as E, t as D, u as O } from "./usePopupRedirect-BThP_YPW-jXtfhYu6.js";
8
+ import { c as k } from "react/compiler-runtime";
9
+ import { $activity as A, $isIdentityContextReady as j, $pageLifecycle as M, $scrollBehavior as N, $session as ee, getTabCount as te } from "@levo-so/insights/stores";
10
+ import { useLevoInsights as ne } from "@levo-so/react";
11
+ import { Suspense as re, lazy as ie, useEffect as P, useRef as F } from "react";
12
+ import { Fragment as I, jsx as L, jsxs as R } from "react/jsx-runtime";
13
+ import { useStore as z } from "@nanostores/react";
14
+ import B from "clsx";
15
+ import { IconX as V } from "@tabler/icons-react";
16
+ //#region ../../libraries/levocn/dist/theme/utils/googleFonts.js
17
+ var H = "wght@300;400;500;600;700;900", U = (e) => !!e && e !== "inherit" && !e.includes(",") && !e.includes("var("), W = (...e) => {
18
+ let t = Array.from(new Set(e.filter((e) => typeof e == "string").map((e) => e.trim()).filter(U)));
19
+ return t.length === 0 ? null : `https://fonts.googleapis.com/css2?${t.map((e) => `family=${e.replace(/ /g, "+")}:${H}`).join("&")}&display=swap`;
20
+ }, G = (e) => {
21
+ if (document.querySelector(`link[rel="preconnect"][href="${e}"]`)) return;
22
+ let t = document.createElement("link");
23
+ t.rel = "preconnect", t.href = e, t.crossOrigin = "anonymous", document.head.appendChild(t);
24
+ }, K = (e) => {
25
+ let t = `family=${e.replace(/ /g, "+")}:`;
26
+ return Array.from(document.querySelectorAll("link[rel=\"stylesheet\"][href*=\"fonts.googleapis.com\"]")).some((e) => e.href.includes(t));
27
+ }, q = (...e) => {
28
+ let t = k(5), n = e, r;
29
+ t[0] === n ? r = t[1] : (r = n.filter(J).map(Y).join("|"), t[0] = n, t[1] = r);
30
+ let i = r, a, o;
31
+ t[2] === i ? (a = t[3], o = t[4]) : (a = () => {
32
+ let e = W(...(i ? i.split("|") : []).filter(ae));
33
+ if (!e) return;
34
+ G("https://fonts.googleapis.com"), G("https://fonts.gstatic.com");
35
+ let t = document.createElement("link");
36
+ t.rel = "stylesheet", t.href = e, t.crossOrigin = "anonymous", t.setAttribute("data-levo-fonts", e), document.head.appendChild(t);
37
+ }, o = [i], t[2] = i, t[3] = a, t[4] = o), P(a, o);
38
+ };
39
+ function J(e) {
40
+ return typeof e == "string" && e.trim() !== "";
41
+ }
42
+ function Y(e) {
43
+ return e.trim();
44
+ }
45
+ function ae(e) {
46
+ return !K(e);
47
+ }
48
+ //#endregion
49
+ //#region ../../libraries/popups/dist/PopupDialog-ofRpHB1v.js
50
+ var oe = (e) => (e ?? "16:9").replace(":", " / "), se = (e) => {
51
+ if (e.content.coverImage?.srcset) return Object.entries(e.content.coverImage.srcset).filter(([e]) => e !== "path").map(([e, t]) => `${t} ${e}`).join(", ");
52
+ }, ce = (e) => {
53
+ let t = k(18), { popup: n, disableInteraction: r, children: i } = e, { content: a } = n, o = b(n), s = !!o && !r, c;
54
+ t[0] !== a.coverImage || t[1] !== a.coverImageFocus || t[2] !== n ? (c = a.coverImage && /* @__PURE__ */ L("img", {
55
+ src: a.coverImage.location,
56
+ srcSet: se(n),
57
+ alt: "",
58
+ className: "_1gklkndl",
59
+ style: a.coverImageFocus ? { objectPosition: a.coverImageFocus.replace("-", " ") } : void 0
60
+ }), t[0] = a.coverImage, t[1] = a.coverImageFocus, t[2] = n, t[3] = c) : c = t[3];
61
+ let l = c, u;
62
+ t[4] === a.coverImageRatio ? u = t[5] : (u = oe(a.coverImageRatio), t[4] = a.coverImageRatio, t[5] = u);
63
+ let d;
64
+ t[6] === u ? d = t[7] : (d = { aspectRatio: u }, t[6] = u, t[7] = d);
65
+ let f = d, p;
66
+ 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__ */ L("button", {
67
+ type: "button",
68
+ className: B("_1gklkndj", "_1gklkndk"),
69
+ style: f,
70
+ onClick: o ?? void 0,
71
+ "aria-label": a.action?.type === "redirect" ? a.action.label : void 0,
72
+ children: l
73
+ }) : /* @__PURE__ */ L("div", {
74
+ className: "_1gklkndj",
75
+ style: f,
76
+ children: l
77
+ })), 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];
78
+ let m;
79
+ return t[15] !== i || t[16] !== p ? (m = /* @__PURE__ */ R("div", {
80
+ className: y,
81
+ children: [p, i]
82
+ }), t[15] = i, t[16] = p, t[17] = m) : m = t[17], m;
83
+ }, le = (e) => {
84
+ let t = k(19), n, r, i, l, u;
85
+ t[0] === e ? (n = t[1], r = t[2], i = t[3], l = t[4], u = t[5]) : ({children: n, popupTheme: r, siteTheme: l, style: u, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = l, t[5] = u);
86
+ let d;
87
+ t[6] !== r || t[7] !== l ? (d = r ?? (l ? o(l) : null), t[6] = r, t[7] = l, t[8] = d) : d = t[8];
88
+ let f = d;
89
+ q(f?.fonts?.heading, f?.fonts?.body);
90
+ let p;
91
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (p = B(c, h), t[9] = p) : p = t[9];
92
+ let m;
93
+ t[10] === f ? m = t[11] : (m = s(f), t[10] = f, t[11] = m);
94
+ let g;
95
+ t[12] !== u || t[13] !== m ? (g = {
96
+ ...m,
97
+ ...u
98
+ }, t[12] = u, t[13] = m, t[14] = g) : g = t[14];
99
+ let _;
100
+ return t[15] !== n || t[16] !== i || t[17] !== g ? (_ = /* @__PURE__ */ L(a, {
101
+ className: p,
102
+ cssReset: !0,
103
+ style: g,
104
+ ...i,
105
+ children: n
106
+ }), t[15] = n, t[16] = i, t[17] = g, t[18] = _) : _ = t[18], _;
107
+ }, X = ie(() => import("./PopupBody-DZVwDLkg-PiECxgmc.js").then((e) => e.n).then((e) => ({ default: e.PopupBody }))), ue = (e) => {
108
+ let t = k(7), { size: n } = e, r = n ?? "medium", i;
109
+ t[0] === r ? i = t[1] : (i = v({ size: r }), t[0] = r, t[1] = i);
110
+ let a, o, s;
111
+ t[2] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ L("div", { className: S }), o = /* @__PURE__ */ L("div", { className: w }), s = /* @__PURE__ */ L("div", { className: C }), t[2] = a, t[3] = o, t[4] = s) : (a = t[2], o = t[3], s = t[4]);
112
+ let c;
113
+ return t[5] === i ? c = t[6] : (c = /* @__PURE__ */ R("div", {
114
+ className: i,
115
+ children: [
116
+ a,
117
+ o,
118
+ s
119
+ ]
120
+ }), t[5] = i, t[6] = c), c;
121
+ }, Z = () => {
122
+ let e = k(10), { popup: t } = x(), n;
123
+ e[0] === t.content.size ? n = e[1] : (n = /* @__PURE__ */ L(ue, { size: t.content.size }), e[0] = t.content.size, e[1] = n);
124
+ let r;
125
+ e[2] === t ? r = e[3] : (r = /* @__PURE__ */ L(X, { popup: t }), e[2] = t, e[3] = r);
126
+ let i;
127
+ e[4] !== n || e[5] !== r ? (i = /* @__PURE__ */ L(re, {
128
+ fallback: n,
129
+ children: r
130
+ }), e[4] = n, e[5] = r, e[6] = i) : i = e[6];
131
+ let a;
132
+ return e[7] !== t || e[8] !== i ? (a = /* @__PURE__ */ L(ce, {
133
+ popup: t,
134
+ children: i
135
+ }), e[7] = t, e[8] = i, e[9] = a) : a = e[9], a;
136
+ }, de = (e) => e.content.position || "top-right", fe = (e) => {
137
+ switch (e) {
138
+ case "close-press": return "close_button";
139
+ case "outside-press": return "outside_click";
140
+ case "escape-key": return "escape_key";
141
+ default: return "programmatic";
142
+ }
143
+ }, pe = () => {
144
+ let n = k(32), { popup: r, callbacks: i } = x(), { placement: a, id: o } = r, s = z(e).active_popup_id === o, c = F(!1), h, g;
145
+ n[0] !== i || n[1] !== s || n[2] !== r ? (h = () => {
146
+ s && !c.current && (c.current = !0, i?.onPopupOpen?.(r, { trigger_type: t() })), s || (c.current = !1);
147
+ }, g = [
148
+ s,
149
+ r,
150
+ i
151
+ ], n[0] = i, n[1] = s, n[2] = r, n[3] = h, n[4] = g) : (h = n[3], g = n[4]), P(h, g);
152
+ let v = D(), y, b, S, C, w, E, A, j;
153
+ if (n[5] !== v || n[6] !== s || n[7] !== a || n[8] !== r) {
154
+ let e = de(r), t = a === "popup", i = a === "slide_in";
155
+ b = f, w = s, n[17] === v ? E = n[18] : (E = (e, t) => !e && v(fe(t?.reason)), n[17] = v, n[18] = E), A = t, j = !t, y = u, n[19] === t ? S = n[20] : (S = t && /* @__PURE__ */ L(d, {}), n[19] = t, n[20] = S), C = t ? /* @__PURE__ */ L(m, {
156
+ className: _,
157
+ children: /* @__PURE__ */ R(p.Popup, {
158
+ className: O({ placement: a }),
159
+ children: [/* @__PURE__ */ L(l, {
160
+ variant: "ghost",
161
+ size: "icon-xs",
162
+ className: T,
163
+ "aria-label": "Close popup",
164
+ children: /* @__PURE__ */ L(V, { size: 16 })
165
+ }), /* @__PURE__ */ L(Z, {})]
166
+ })
167
+ }) : /* @__PURE__ */ R(p.Popup, {
168
+ className: B(O({
169
+ placement: a,
170
+ position: e
171
+ }), i && "_1gklkndd"),
172
+ children: [/* @__PURE__ */ L(l, {
173
+ variant: "ghost",
174
+ size: "icon-xs",
175
+ className: T,
176
+ "aria-label": "Close popup",
177
+ children: /* @__PURE__ */ L(V, { size: 16 })
178
+ }), /* @__PURE__ */ L(Z, {})]
179
+ }), n[5] = v, n[6] = s, n[7] = a, n[8] = r, n[9] = y, n[10] = b, n[11] = S, n[12] = C, n[13] = w, n[14] = E, n[15] = A, n[16] = j;
180
+ } else y = n[9], b = n[10], S = n[11], C = n[12], w = n[13], E = n[14], A = n[15], j = n[16];
181
+ let M;
182
+ n[21] !== y || n[22] !== S || n[23] !== C ? (M = /* @__PURE__ */ R(y, { children: [S, C] }), n[21] = y, n[22] = S, n[23] = C, n[24] = M) : M = n[24];
183
+ let N;
184
+ return n[25] !== b || n[26] !== w || n[27] !== E || n[28] !== A || n[29] !== j || n[30] !== M ? (N = /* @__PURE__ */ L(b, {
185
+ open: w,
186
+ onOpenChange: E,
187
+ modal: A,
188
+ disablePointerDismissal: j,
189
+ children: M
190
+ }), n[25] = b, n[26] = w, n[27] = E, n[28] = A, n[29] = j, n[30] = M, n[31] = N) : N = n[31], N;
191
+ }, me = 3e4, he = 5e3, ge = 5e3, _e = 100, ve = .5, ye = 5, be = (e) => {
192
+ if (typeof document > "u") return () => {};
193
+ let t = !1, n = Date.now(), r = [], i = 0, a = null, o = () => Date.now() - n >= me, s = () => {
194
+ t || (t = !0, c(), e());
195
+ }, c = () => {
196
+ a &&= (clearTimeout(a), null);
197
+ }, l = () => {
198
+ if (r.length < 2) return 0;
199
+ let e = r[0], t = r[r.length - 1], n = t.t - e.t;
200
+ return n === 0 ? 0 : (e.y - t.y) / n;
201
+ }, u = () => r.reduce((e, t) => t.y > e ? t.y : e, 0), d = (e) => {
202
+ r.push({
203
+ y: e.clientY,
204
+ t: Date.now()
205
+ }), r.length > ye && r.shift();
206
+ }, f = (e) => {
207
+ t || !o() || e.clientY > 0 || u() < _e || Date.now() - i < ge || l() < ve || (c(), a = setTimeout(s, he));
208
+ }, p = () => {
209
+ c();
210
+ }, m = () => {
211
+ i = Date.now();
212
+ }, h = M.listen((e) => {
213
+ o() && (e === "hidden" || e === "frozen") && s();
214
+ });
215
+ return document.addEventListener("mousemove", d, { passive: !0 }), document.addEventListener("mouseleave", f), document.addEventListener("mouseenter", p), window.addEventListener("scroll", m, { passive: !0 }), () => {
216
+ c(), document.removeEventListener("mousemove", d), document.removeEventListener("mouseleave", f), document.removeEventListener("mouseenter", p), window.removeEventListener("scroll", m), h();
217
+ };
218
+ }, xe = (e, t) => {
219
+ if (!e) return null;
220
+ let n = setTimeout(() => r(t, { trigger_type: "time_on_page" }), e);
221
+ return () => clearTimeout(n);
222
+ }, Se = (e, t) => {
223
+ if (e === void 0) return null;
224
+ let n = !1;
225
+ return N.listen((i) => {
226
+ n || i.depth >= e && (n = !0, r(t, { trigger_type: "scroll_depth" }));
227
+ });
228
+ }, Ce = (e) => {
229
+ let t = !1;
230
+ return A.listen((n) => {
231
+ t || n.status === "idle" && (t = !0, r(e, { trigger_type: "inactivity" }));
232
+ });
233
+ }, we = (e, t) => {
234
+ let n = k(11), i = t === void 0 ? !0 : t, { triggers: a, id: o } = e, s = z(j), c;
235
+ n[0] === Symbol.for("react.memo_cache_sentinel") ? (c = [], n[0] = c) : c = n[0];
236
+ let l = F(c), u;
237
+ n[1] !== i || n[2] !== s || n[3] !== e || n[4] !== a ? (u = () => {
238
+ if (!i || !s || !a) return;
239
+ let t = [];
240
+ if (a.time_on_page.enabled) {
241
+ let n = xe(a.time_on_page.delay_ms, e);
242
+ n && t.push(n);
243
+ }
244
+ if (a.scroll_depth.enabled) {
245
+ let n = Se(a.scroll_depth.percent, e);
246
+ n && t.push(n);
247
+ }
248
+ return a.exit_intent.enabled && t.push(be(() => r(e, { trigger_type: "exit_intent" }))), a.inactivity.enabled && t.push(Ce(e)), l.current = t, () => {
249
+ t.forEach(Te), l.current = [];
250
+ };
251
+ }, n[1] = i, n[2] = s, n[3] = e, n[4] = a, n[5] = u) : u = n[5];
252
+ let d;
253
+ n[6] !== i || n[7] !== s || n[8] !== o || n[9] !== a ? (d = [
254
+ i,
255
+ s,
256
+ o,
257
+ a
258
+ ], n[6] = i, n[7] = s, n[8] = o, n[9] = a, n[10] = d) : d = n[10], P(u, d);
259
+ };
260
+ function Te(e) {
261
+ return e();
262
+ }
263
+ var Q = (e, t) => {
264
+ switch (e.match_type) {
265
+ case "is_all_pages": return !0;
266
+ 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;
267
+ case "contains": return e.value != null && t.path.includes(e.value);
268
+ case "begins_with": return e.value != null && t.path.startsWith(e.value);
269
+ default: return !1;
270
+ }
271
+ }, $ = (e, t) => {
272
+ switch (e.match_type) {
273
+ case "exact": return t === e.value;
274
+ case "contains": return t.includes(e.value);
275
+ case "domain": try {
276
+ let n = new URL(t).hostname, r = e.value.toLowerCase();
277
+ return n === r || n.endsWith(`.${r}`);
278
+ } catch {
279
+ return !1;
280
+ }
281
+ default: return !1;
282
+ }
283
+ }, Ee = (e, t, n) => {
284
+ let r = e.pages?.exclude ?? [];
285
+ if (r.length > 0 && r.some((e) => Q(e, t))) return !1;
286
+ let i = e.pages?.include ?? [];
287
+ if (i.length > 0 && !i.some((e) => Q(e, t))) return !1;
288
+ let a = e.referrer?.include ?? [];
289
+ if (a.length > 0 && (!n || !a.some((e) => $(e, n)))) return !1;
290
+ let o = e.referrer?.exclude ?? [];
291
+ return !(o.length > 0 && n && o.some((e) => $(e, n)));
292
+ }, De = (e) => {
293
+ let t = k(4), { pageId: n } = e, { popup: r } = x(), i;
294
+ bb0: {
295
+ if (!r.target) {
296
+ i = !0;
297
+ break bb0;
298
+ }
299
+ if (typeof window > "u") {
300
+ i = !1;
301
+ break bb0;
302
+ }
303
+ let e;
304
+ if (t[0] !== n || t[1] !== r.target) {
305
+ let i = ee.get().identity?.referrer?.raw || document.referrer || null, a = new URL(window.location.href, window.location.origin);
306
+ e = Ee(r.target, {
307
+ pageId: n,
308
+ path: a.pathname
309
+ }, i), t[0] = n, t[1] = r.target, t[2] = e;
310
+ } else e = t[2];
311
+ i = e;
312
+ }
313
+ let a = i;
314
+ if (we(r, a), !a) return null;
315
+ let o;
316
+ return t[3] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ L(pe, {}), t[3] = o) : o = t[3], o;
317
+ }, Oe = () => {
318
+ let e = N.get(), t = A.get();
319
+ return {
320
+ trigger_scroll_depth: e.depth,
321
+ trigger_scroll_speed: e.speedCategory,
322
+ trigger_scroll_direction: e.direction,
323
+ trigger_activity_status: t.status,
324
+ trigger_activity_seconds: t.seconds,
325
+ trigger_tab_count: te()
326
+ };
327
+ }, ke = (e) => {
328
+ let t = k(16), { popups: r, pageId: a } = e, o = ne(), s, c;
329
+ t[0] === r ? (s = t[1], c = t[2]) : (s = () => {
330
+ i(r), n(!1);
331
+ }, c = [r], t[0] = r, t[1] = s, t[2] = c), P(s, c);
332
+ let l;
333
+ t[3] === o ? l = t[4] : (l = (e, t) => {
334
+ !o || typeof o.track != "function" || o?.track(e, t);
335
+ }, t[3] = o, t[4] = l);
336
+ let u = l, d = Ae, f;
337
+ t[5] === u ? f = t[6] : (f = {
338
+ onPopupOpen: (e, t) => {
339
+ u("popup.view", {
340
+ ...d(e),
341
+ trigger_type: t.trigger_type,
342
+ language: e.language,
343
+ ...Oe()
344
+ });
345
+ },
346
+ onPopupClose: (e, t) => {
347
+ u("popup.close", {
348
+ ...d(e),
349
+ trigger_type: t.trigger_type,
350
+ dismiss_reason: t.dismiss_reason,
351
+ time_shown_ms: t.time_shown_ms
352
+ });
353
+ },
354
+ onAction: (e, t) => {
355
+ u("popup.action", {
356
+ ...d(e),
357
+ ...t
358
+ });
359
+ }
360
+ }, t[5] = u, t[6] = f);
361
+ let p = f, m;
362
+ if (t[7] !== p || t[8] !== a || t[9] !== r) {
363
+ let e;
364
+ t[11] !== p || t[12] !== a ? (e = (e) => /* @__PURE__ */ L(le, {
365
+ popupTheme: e.theme,
366
+ siteTheme: e.site?.theme,
367
+ children: /* @__PURE__ */ L(E, {
368
+ popup: e,
369
+ callbacks: p,
370
+ children: /* @__PURE__ */ L(De, { pageId: a })
371
+ })
372
+ }, e.id), t[11] = p, t[12] = a, t[13] = e) : e = t[13], m = r.map(e), t[7] = p, t[8] = a, t[9] = r, t[10] = m;
373
+ } else m = t[10];
374
+ let h;
375
+ return t[14] === m ? h = t[15] : (h = /* @__PURE__ */ L(I, { children: m }), t[14] = m, t[15] = h), h;
376
+ };
377
+ function Ae(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 je = /* @__PURE__ */ g({ PopupRenderer: () => ke });
387
+ //#endregion
388
+ export { je as t };
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { r as e } from "./dist-Ckw19x6H.js";
3
- import { n as t } from "./AuthProvider-CFQqiIf1.js";
4
- import { t as n } from "./Spinner-HCqR1eGW.js";
5
- import { t as r } from "./card-Cb4m0p4i.js";
6
- import { t as i } from "./MessageFooter-CrhrI-su.js";
2
+ import { c as e } from "./dist-2bXx8eVI.js";
3
+ import { n as t } from "./AuthProvider-B5NfFwbG.js";
4
+ import { t as n } from "./Spinner-D5spB_Mv.js";
5
+ import { t as r } from "./card-5ooLmYSr.js";
6
+ import { t as i } from "./MessageFooter-K4Zd_eFO.js";
7
7
  import { useLevo as a } from "@levo-so/react";
8
8
  import { useEffect as o, useState as s } from "react";
9
9
  import { jsx as c, jsxs as l } from "react/jsx-runtime";