@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
@@ -1,82 +1,7 @@
1
- import { t as e } from "./rolldown-runtime-CAFD8bLK.js";
2
- import { a as t, c as n, i as r, l as i, o as a, r as o, s, t as c, u as l } from "./Dialog-IrII0ugb.js";
3
- import { i as u, t as d } from "./Button-lUfKisu8.js";
4
- import { a as f, i as p, o as m, t as h } from "./nodeAlignment-DS9_DLGB.js";
5
- import { i as g, r as _, t as v } from "./inlineCollectionTheme-D2w17LHX.js";
6
- import { n as y, t as b } from "./theme.cssm-2YTdd8Yh.js";
7
- import { c as x } from "react/compiler-runtime";
8
- import { $activity as S, $isIdentityContextReady as C, $pageLifecycle as w, $scrollBehavior as T, $session as E, getTabCount as D } from "@levo-so/insights/stores";
9
- import { useLevo as ee, useLevoInsights as O } from "@levo-so/react";
10
- import { Suspense as te, createContext as k, lazy as A, useContext as j, useEffect as M, useMemo as ne, useRef as re, useState as ie } from "react";
11
- import { persistentAtom as ae } from "@nanostores/persistent";
12
- import { atom as N, computed as oe } from "nanostores";
13
- import { Fragment as se, jsx as P, jsxs as F } from "react/jsx-runtime";
14
- import I from "clsx";
15
- import { createRuntimeFn as ce } from "@vanilla-extract/recipes/createRuntimeFn";
16
- import { IconCheck as le, IconCopy as ue, IconX as de } from "@tabler/icons-react";
17
- import { generateJSON as fe } from "@tiptap/html";
18
- import { renderToReactElement as pe } from "@tiptap/static-renderer/pm/react";
19
- import { Bold as me } from "@tiptap/extension-bold";
20
- import { BulletList as he } from "@tiptap/extension-bullet-list";
21
- import { Code as ge } from "@tiptap/extension-code";
22
- import { Color as _e } from "@tiptap/extension-color";
23
- import { Document as ve } from "@tiptap/extension-document";
24
- import { HardBreak as ye } from "@tiptap/extension-hard-break";
25
- import { Heading as be } from "@tiptap/extension-heading";
26
- import { Highlight as xe } from "@tiptap/extension-highlight";
27
- import { Italic as Se } from "@tiptap/extension-italic";
28
- import { Link as Ce } from "@tiptap/extension-link";
29
- import { ListItem as we } from "@tiptap/extension-list-item";
30
- import { OrderedList as Te } from "@tiptap/extension-ordered-list";
31
- import { Paragraph as Ee } from "@tiptap/extension-paragraph";
32
- import { Strike as De } from "@tiptap/extension-strike";
33
- import { Subscript as Oe } from "@tiptap/extension-subscript";
34
- import { Superscript as ke } from "@tiptap/extension-superscript";
35
- import { Text as Ae } from "@tiptap/extension-text";
36
- import { TextStyle as je } from "@tiptap/extension-text-style";
37
- import { Typography as Me } from "@tiptap/extension-typography";
38
- import { Underline as Ne } from "@tiptap/extension-underline";
39
- import { UniqueID as Pe } from "@tiptap/extension-unique-id";
40
- import { Extension as Fe, Node as Ie, mergeAttributes as Le } from "@tiptap/core";
41
- import { useStore as Re } from "@nanostores/react";
42
- //#region ../../libraries/levocn/dist/theme/utils/googleFonts.js
43
- var ze = "wght@300;400;500;600;700;900", Be = (e) => !!e && e !== "inherit" && !e.includes(",") && !e.includes("var("), Ve = (...e) => {
44
- let t = Array.from(new Set(e.filter((e) => typeof e == "string").map((e) => e.trim()).filter(Be)));
45
- return t.length === 0 ? null : `https://fonts.googleapis.com/css2?${t.map((e) => `family=${e.replace(/ /g, "+")}:${ze}`).join("&")}&display=swap`;
46
- }, He = (e) => {
47
- if (document.querySelector(`link[rel="preconnect"][href="${e}"]`)) return;
48
- let t = document.createElement("link");
49
- t.rel = "preconnect", t.href = e, t.crossOrigin = "anonymous", document.head.appendChild(t);
50
- }, Ue = (e) => {
51
- let t = `family=${e.replace(/ /g, "+")}:`;
52
- return Array.from(document.querySelectorAll("link[rel=\"stylesheet\"][href*=\"fonts.googleapis.com\"]")).some((e) => e.href.includes(t));
53
- }, We = (...e) => {
54
- let t = x(5), n = e, r;
55
- t[0] === n ? r = t[1] : (r = n.filter(Ge).map(Ke).join("|"), t[0] = n, t[1] = r);
56
- let i = r, a, o;
57
- t[2] === i ? (a = t[3], o = t[4]) : (a = () => {
58
- let e = Ve(...(i ? i.split("|") : []).filter(qe));
59
- if (!e) return;
60
- He("https://fonts.googleapis.com"), He("https://fonts.gstatic.com");
61
- let t = document.createElement("link");
62
- t.rel = "stylesheet", t.href = e, t.crossOrigin = "anonymous", t.setAttribute("data-levo-fonts", e), document.head.appendChild(t);
63
- }, o = [i], t[2] = i, t[3] = a, t[4] = o), M(a, o);
64
- };
65
- function Ge(e) {
66
- return typeof e == "string" && e.trim() !== "";
67
- }
68
- function Ke(e) {
69
- return e.trim();
70
- }
71
- function qe(e) {
72
- return !Ue(e);
73
- }
74
- //#endregion
75
- //#region ../../libraries/levocn/dist/styles/inlineBaseTheme.js
76
- var Je = y(g), Ye = (e) => e ? e.radius && !e.radiusScale ? Je({
77
- ...e,
78
- radiusScale: _(e.radius)
79
- }) : Je(e) : {}, Xe = {
1
+ import { Extension as e, Node as t, mergeAttributes as n } from "@tiptap/core";
2
+ import "@tiptap/extension-text-style";
3
+ //#region ../../libraries/editor-core/dist/extensions/emoji/emojiMap.js
4
+ var r = {
80
5
  100: "1f4af",
81
6
  1234: "1f522",
82
7
  regional_indicator_a: "🇦",
@@ -2010,7 +1935,7 @@ var Je = y(g), Ye = (e) => e ? e.radius && !e.radiusScale ? Je({
2010
1935
  england: "1f3f4-e0067-e0062-e0065-e006e-e0067-e007f",
2011
1936
  scotland: "1f3f4-e0067-e0062-e0073-e0063-e0074-e007f",
2012
1937
  wales: "1f3f4-e0067-e0062-e0077-e006c-e0073-e007f"
2013
- }, Ze = "https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64", Qe = (e) => /^[A-Fa-f0-9-]+$/.test(e), $e = Ie.create({
1938
+ }, i = "https://cdn.jsdelivr.net/npm/emoji-datasource-apple/img/apple/64", a = (e) => /^[A-Fa-f0-9-]+$/.test(e), o = t.create({
2014
1939
  name: "emoji",
2015
1940
  inline: !0,
2016
1941
  group: "inline",
@@ -2027,28 +1952,28 @@ var Je = y(g), Ye = (e) => e ? e.radius && !e.radiusScale ? Je({
2027
1952
  return [{ tag: "span[data-type=\"emoji\"]" }];
2028
1953
  },
2029
1954
  renderHTML({ HTMLAttributes: e, node: t }) {
2030
- let n = Le(e, { "data-type": "emoji" }), r = t.attrs.name, i = r ? Xe[r] : void 0;
2031
- return i ? Qe(i) ? [
1955
+ let o = n(e, { "data-type": "emoji" }), s = t.attrs.name, c = s ? r[s] : void 0;
1956
+ return c ? a(c) ? [
2032
1957
  "span",
2033
- n,
1958
+ o,
2034
1959
  ["img", {
2035
- src: `${Ze}/${i}.png`,
1960
+ src: `${i}/${c}.png`,
2036
1961
  draggable: "false",
2037
1962
  loading: "lazy",
2038
1963
  align: "absmiddle",
2039
- alt: `${r} emoji`
1964
+ alt: `${s} emoji`
2040
1965
  }]
2041
1966
  ] : [
2042
1967
  "span",
2043
- n,
2044
- i
1968
+ o,
1969
+ c
2045
1970
  ] : [
2046
1971
  "span",
2047
- n,
2048
- `:${r || "emoji"}:`
1972
+ o,
1973
+ `:${s || "emoji"}:`
2049
1974
  ];
2050
1975
  }
2051
- }), et = Fe.create({
1976
+ }), s = e.create({
2052
1977
  name: "fontSize",
2053
1978
  addOptions() {
2054
1979
  return { types: ["textStyle"] };
@@ -2069,664 +1994,6 @@ var Je = y(g), Ye = (e) => e ? e.radius && !e.radiusScale ? Je({
2069
1994
  unsetFontSize: () => ({ chain: e }) => e().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run()
2070
1995
  };
2071
1996
  }
2072
- }), tt = /* @__PURE__ */ e({
2073
- _: () => U,
2074
- c: () => Z,
2075
- d: () => St,
2076
- f: () => yt,
2077
- g: () => V,
2078
- h: () => z,
2079
- i: () => Wt,
2080
- l: () => bt,
2081
- m: () => H,
2082
- n: () => fn,
2083
- o: () => Vt,
2084
- p: () => B,
2085
- r: () => Gt,
2086
- s: () => Q,
2087
- t: () => mn,
2088
- u: () => X,
2089
- v: () => _t,
2090
- y: () => J
2091
- }), nt = Object.defineProperty, rt = (e, t) => {
2092
- let n = {};
2093
- for (var r in e) nt(n, r, {
2094
- get: e[r],
2095
- enumerable: !0
2096
- });
2097
- return t || nt(n, Symbol.toStringTag, { value: "Module" }), n;
2098
- }, it = 6e4, at = "lv_popups_session", L = {
2099
- active_popup_id: null,
2100
- shown_popup_ids: [],
2101
- last_closed_at: null
2102
- }, R = ae("lv_popups_state", {}, {
2103
- encode: JSON.stringify,
2104
- decode: JSON.parse
2105
- }), ot = (e) => {
2106
- if (!e) return L;
2107
- try {
2108
- return {
2109
- ...JSON.parse(e),
2110
- active_popup_id: null
2111
- };
2112
- } catch {
2113
- return L;
2114
- }
2115
- }, z = N((() => {
2116
- if (typeof sessionStorage > "u") return L;
2117
- try {
2118
- return ot(sessionStorage.getItem(at));
2119
- } catch {
2120
- return L;
2121
- }
2122
- })()), st = z.set;
2123
- z.set = (e) => {
2124
- st(e);
2125
- try {
2126
- sessionStorage.setItem(at, JSON.stringify(e));
2127
- } catch {}
2128
- };
2129
- var ct = oe([z, R], (e, t) => ({
2130
- active_popup_id: e.active_popup_id,
2131
- shown_popup_ids: e.shown_popup_ids,
2132
- last_closed_at: e.last_closed_at,
2133
- previous_popups: t
2134
- })), B = N([]), V = (e) => {
2135
- B.set(e);
2136
- }, H = N(!0), U = (e) => {
2137
- H.set(e);
2138
- }, lt = () => ct.get(), ut = (e, t) => e.includes(t) ? e : [...e, t], W = "manual", dt = () => W, G = null, ft = () => G, K = [], q = null, pt = () => {
2139
- if (q) return;
2140
- let { last_closed_at: e } = z.get();
2141
- if (!e) return;
2142
- let t = it - (Date.now() - e);
2143
- if (t <= 0) {
2144
- mt();
2145
- return;
2146
- }
2147
- q = setTimeout(() => {
2148
- q = null, mt();
2149
- }, t);
2150
- }, mt = () => {
2151
- let e = z.get();
2152
- if (!e.active_popup_id) {
2153
- if (e.last_closed_at && Date.now() - e.last_closed_at < 6e4) {
2154
- pt();
2155
- return;
2156
- }
2157
- for (; K.length > 0;) {
2158
- let e = K.shift();
2159
- if (J(e.popup, { trigger_type: e.trigger_type })) return;
2160
- }
2161
- }
2162
- }, ht = (e, t) => {
2163
- K.some((t) => t.popup.id === e.id) || (K.push({
2164
- popup: e,
2165
- trigger_type: t
2166
- }), pt());
2167
- }, gt = (e, t) => {
2168
- let n = lt();
2169
- if (t?.type === "always") return !n.shown_popup_ids.includes(e);
2170
- let r = n.previous_popups[e];
2171
- return r ? !t || t.type === "once" ? !1 : t.type === "interval" && t.interval_ms ? Date.now() - r.triggered_at >= t.interval_ms : !0 : !0;
2172
- }, J = (e, t = {}) => {
2173
- let { force: n = !1, trigger_type: r = "manual" } = t, i = e.id, a = e.settings?.display_frequency, o = z.get();
2174
- return o.active_popup_id === i ? !0 : !n && (o.active_popup_id || o.last_closed_at && Date.now() - o.last_closed_at < 6e4 || !gt(i, a)) ? !1 : (q &&= (clearTimeout(q), null), W = r, G = Date.now(), z.set({
2175
- active_popup_id: i,
2176
- shown_popup_ids: ut(o.shown_popup_ids, i),
2177
- last_closed_at: o.last_closed_at
2178
- }), a?.type !== "always" && R.set({
2179
- ...R.get(),
2180
- [i]: { triggered_at: Date.now() }
2181
- }), !0);
2182
- }, Y = (e, t = {}) => {
2183
- let { trigger_type: n = "manual" } = t;
2184
- return J(e, { trigger_type: n }) ? !0 : (gt(e.id, e.settings?.display_frequency) && ht(e, n), !1);
2185
- }, _t = (e) => {
2186
- let t = z.get();
2187
- t.active_popup_id === e && (W = "manual", G = null, z.set({
2188
- ...t,
2189
- active_popup_id: null,
2190
- last_closed_at: Date.now()
2191
- }), setTimeout(mt, 0));
2192
- }, X = ce({
2193
- defaultClassName: "_1gklknd4",
2194
- variantClassNames: {
2195
- placement: {
2196
- popup: "_1gklknd5",
2197
- slide_in: "_1gklknd6"
2198
- },
2199
- position: {
2200
- "top-left": "_1gklknd7",
2201
- "top-right": "_1gklknd8",
2202
- "bottom-left": "_1gklknd9",
2203
- "bottom-right": "_1gklknda"
2204
- }
2205
- },
2206
- defaultVariants: { placement: "popup" },
2207
- compoundVariants: []
2208
- }), vt = "_1gklkndb", yt = "_1gklkndc", bt = "_1gklkndd", xt = ce({
2209
- defaultClassName: "_1gklknde",
2210
- variantClassNames: { size: {
2211
- small: "_1gklkndf",
2212
- medium: "_1gklkndg",
2213
- large: "_1gklkndh",
2214
- xlarge: "_1gklkndi"
2215
- } },
2216
- defaultVariants: { size: "medium" },
2217
- compoundVariants: []
2218
- }), St = "_1gklkndl", Z = "_1gklkndm", Ct = k(null), wt = (e) => {
2219
- let t = x(6), { popup: n, callbacks: r, children: i } = e, a;
2220
- t[0] !== r || t[1] !== n ? (a = {
2221
- popup: n,
2222
- callbacks: r
2223
- }, t[0] = r, t[1] = n, t[2] = a) : a = t[2];
2224
- let o;
2225
- return t[3] !== i || t[4] !== a ? (o = /* @__PURE__ */ P(Ct.Provider, {
2226
- value: a,
2227
- children: i
2228
- }), t[3] = i, t[4] = a, t[5] = o) : o = t[5], o;
2229
- }, Tt = () => {
2230
- let e = j(Ct);
2231
- if (!e) throw Error("usePopupContext must be used within a PopupProvider");
2232
- return e;
2233
- }, Et = () => j(Ct), Dt = () => {
2234
- let e = x(2), t = Et(), n;
2235
- return e[0] === t ? n = e[1] : (n = (e) => {
2236
- let n = e === void 0 ? "programmatic" : e;
2237
- if (!t || lt().active_popup_id !== t.popup.id) return;
2238
- let r = ft();
2239
- t.callbacks?.onPopupClose?.(t.popup, {
2240
- trigger_type: dt(),
2241
- dismiss_reason: n,
2242
- time_shown_ms: r ? Date.now() - r : null
2243
- }), _t(t.popup.id);
2244
- }, e[0] = t, e[1] = n), n;
2245
- }, Ot = "zv6sjd4", kt = "zv6sjd5", At = "zv6sjd6", jt = [
2246
- ve,
2247
- Ee,
2248
- Ae,
2249
- be,
2250
- me,
2251
- Se,
2252
- De,
2253
- ge,
2254
- he,
2255
- Te,
2256
- we,
2257
- ye,
2258
- Ne,
2259
- Ce.configure({ openOnClick: !1 }),
2260
- je,
2261
- et,
2262
- Me,
2263
- ke,
2264
- Oe,
2265
- _e,
2266
- xe.configure({ multicolor: !0 }),
2267
- $e,
2268
- h,
2269
- Pe.configure({ types: [
2270
- "paragraph",
2271
- "heading",
2272
- "bulletList",
2273
- "orderedList"
2274
- ] })
2275
- ], Mt = (e) => fe(e, jt), Nt = ({ content: e, className: t, ref: n, ...r }) => {
2276
- let i = ne(() => e ? typeof e == "string" ? e ? Mt(e) : null : e.json && Object.keys(e.json).length > 0 ? e.json : e.html ? Mt(e.html) : null : null, [e]), a = ne(() => i ? pe({
2277
- content: i,
2278
- extensions: jt
2279
- }) : null, [i]);
2280
- return a ? /* @__PURE__ */ P("div", {
2281
- ref: n,
2282
- className: I(m, t),
2283
- ...r,
2284
- children: a
2285
- }) : null;
2286
- }, Pt = A(() => import("./dist-Ckw19x6H.js").then((e) => e.t).then((e) => ({ default: e.CollectionFormBuilder }))), Ft = p({ baseSpacing: ".625rem" }), It = { style: v({ form: { gap: "1rem" } }) }, Lt = {
2287
- left: Ot,
2288
- center: kt,
2289
- right: At
2290
- }, Rt = (e) => (e ?? "16:9").replace(":", " / "), zt = (e) => {
2291
- if (e.content.coverImage?.srcset) return Object.entries(e.content.coverImage.srcset).filter(([e]) => e !== "path").map(([e, t]) => `${t} ${e}`).join(", ");
2292
- }, Q = (e) => {
2293
- let t = x(45), { popup: n, disableInteraction: i } = e, a = Et(), s = a?.popup ?? n, l = a?.callbacks?.onAction, u = Dt(), f = !a, { content: p } = s, { workspace: m } = ee(), [h, g] = ie(!1), _;
2294
- t[0] !== p.action || t[1] !== l || t[2] !== s ? (_ = () => {
2295
- if (p.action?.type !== "redirect" || !p.action.copyValue) return;
2296
- let e = p.action.copyValue;
2297
- navigator.clipboard.writeText(e).then(() => {
2298
- g(!0), setTimeout(() => g(!1), 2e3), l?.(s, {
2299
- action_type: "copy",
2300
- copy_value: e
2301
- });
2302
- });
2303
- }, t[0] = p.action, t[1] = l, t[2] = s, t[3] = _) : _ = t[3];
2304
- let v = _, y = p.align ?? "left", b;
2305
- t[4] === p.coverImageRatio ? b = t[5] : (b = Rt(p.coverImageRatio), t[4] = p.coverImageRatio, t[5] = b);
2306
- let S = b, C;
2307
- t[6] !== S || t[7] !== p.coverImage || t[8] !== p.coverImageFocus || t[9] !== s ? (C = p.coverImage && /* @__PURE__ */ P("div", {
2308
- className: "_1gklkndj",
2309
- style: { aspectRatio: S },
2310
- children: /* @__PURE__ */ P("img", {
2311
- src: p.coverImage.location,
2312
- srcSet: zt(s),
2313
- alt: "",
2314
- className: "_1gklkndk",
2315
- style: p.coverImageFocus ? { objectPosition: p.coverImageFocus.replace("-", " ") } : void 0
2316
- })
2317
- }), t[6] = S, t[7] = p.coverImage, t[8] = p.coverImageFocus, t[9] = s, t[10] = C) : C = t[10];
2318
- let w = p.size ?? "medium", T;
2319
- t[11] === w ? T = t[12] : (T = xt({ size: w }), t[11] = w, t[12] = T);
2320
- let E;
2321
- t[13] === i ? E = t[14] : (E = i ? { pointerEvents: "none" } : void 0, t[13] = i, t[14] = E);
2322
- let D;
2323
- t[15] !== y || t[16] !== p.description || t[17] !== p.heading ? (D = (p.heading || p.description) && /* @__PURE__ */ F(c, {
2324
- className: "zv6sjd0",
2325
- style: { textAlign: y },
2326
- children: [p.heading && /* @__PURE__ */ P(r, { children: p.heading }), p.description && /* @__PURE__ */ P(o, { children: p.description })]
2327
- }), t[15] = y, t[16] = p.description, t[17] = p.heading, t[18] = D) : D = t[18];
2328
- let O;
2329
- t[19] === p.body ? O = t[20] : (O = (p.body?.html || p.body?.json) && /* @__PURE__ */ P(Nt, {
2330
- className: "zv6sjd1",
2331
- style: Ft,
2332
- content: p.body
2333
- }), t[19] = p.body, t[20] = O);
2334
- let k;
2335
- t[21] !== y || t[22] !== p.action || t[23] !== f || t[24] !== l || t[25] !== s || t[26] !== m ? (k = p.action?.type === "form" && /* @__PURE__ */ P("div", {
2336
- className: "zv6sjd3",
2337
- children: /* @__PURE__ */ P(te, { children: /* @__PURE__ */ P(Pt, {
2338
- collection_id: p.action.collectionKey,
2339
- formVariant: p.action.formVariant,
2340
- theme: It,
2341
- uiConfig: {
2342
- hideFormHeading: !0,
2343
- hideSectionHeadings: !0
2344
- },
2345
- successConfig: p.action.successRedirectUrl ? { action: {
2346
- type: "redirect",
2347
- value: p.action.successRedirectUrl
2348
- } } : void 0,
2349
- submitButtonConfig: {
2350
- show: !0,
2351
- text: p.action.label || "Submit",
2352
- styles: p.action.fullWidth && (p.action.formVariant ?? "default") === "default" ? "zv6sjd7" : Lt[y]
2353
- },
2354
- workspace_id: m,
2355
- containerStyles: "zv6sjd2",
2356
- preview: f,
2357
- onSuccess: () => {
2358
- p.action?.type === "form" && l?.(s, {
2359
- action_type: "form_submit",
2360
- collection_key: p.action.collectionKey
2361
- });
2362
- }
2363
- }) })
2364
- }), t[21] = y, t[22] = p.action, t[23] = f, t[24] = l, t[25] = s, t[26] = m, t[27] = k) : k = t[27];
2365
- let A;
2366
- t[28] !== u || t[29] !== p.action || t[30] !== h || t[31] !== v || t[32] !== l || t[33] !== s ? (A = p.action?.type === "redirect" && /* @__PURE__ */ F(se, { children: [p.action.copyValue && /* @__PURE__ */ F("button", {
2367
- type: "button",
2368
- className: "zv6sjd9",
2369
- onClick: v,
2370
- children: [/* @__PURE__ */ P("span", {
2371
- className: "zv6sjda",
2372
- children: p.action.copyValue
2373
- }), P(h ? le : ue, {
2374
- size: 18,
2375
- className: "zv6sjdb"
2376
- })]
2377
- }), /* @__PURE__ */ P(d, {
2378
- className: "zv6sjd8",
2379
- onClick: () => {
2380
- p.action?.type === "redirect" && (l?.(s, {
2381
- action_type: "redirect",
2382
- redirect_url: p.action.url,
2383
- open_in_new_tab: !!p.action.openInNewTab
2384
- }), u("cta_click"), p.action.openInNewTab ? window.open(p.action.url, "_blank", "noopener,noreferrer") : window.location.href = p.action.url);
2385
- },
2386
- children: p.action.label || "Button"
2387
- })] }), t[28] = u, t[29] = p.action, t[30] = h, t[31] = v, t[32] = l, t[33] = s, t[34] = A) : A = t[34];
2388
- let j;
2389
- t[35] !== A || t[36] !== T || t[37] !== E || t[38] !== D || t[39] !== O || t[40] !== k ? (j = /* @__PURE__ */ F("div", {
2390
- className: T,
2391
- style: E,
2392
- children: [
2393
- D,
2394
- O,
2395
- k,
2396
- A
2397
- ]
2398
- }), t[35] = A, t[36] = T, t[37] = E, t[38] = D, t[39] = O, t[40] = k, t[41] = j) : j = t[41];
2399
- let M;
2400
- return t[42] !== j || t[43] !== C ? (M = /* @__PURE__ */ F("div", {
2401
- className: vt,
2402
- children: [C, j]
2403
- }), t[42] = j, t[43] = C, t[44] = M) : M = t[44], M;
2404
- }, $ = (e) => {
2405
- if (e == null) return;
2406
- if (typeof e == "string") return e;
2407
- if (typeof e != "object") return;
2408
- let t = e;
2409
- if (typeof t.l != "number" || typeof t.c != "number" || typeof t.h != "number") return;
2410
- let n = (e) => Math.round(e * 1e4) / 1e4, r = n(t.l), i = n(t.c), a = n(t.h), o = typeof t.alpha == "number" ? n(t.alpha) : 1;
2411
- return o < 1 ? `oklch(${r} ${i} ${a} / ${o})` : `oklch(${r} ${i} ${a})`;
2412
- }, Bt = (e) => {
2413
- let t = e.colors;
2414
- return !t || typeof t != "object" ? !1 : Object.values(t).some((e) => e != null);
2415
- }, Vt = (e) => {
2416
- if (!e || !Bt(e)) return null;
2417
- let t = e.colors, n = t?.brand ?? {}, r = e.fonts, i = e.sizes;
2418
- return {
2419
- colors: {
2420
- brand: {
2421
- main: $(n.main) ?? "",
2422
- foreground: $(n.foreground) ?? ""
2423
- },
2424
- text1: $(t.text1) ?? "",
2425
- text2: $(t.text2) ?? "",
2426
- page: $(t.page) ?? "",
2427
- border: $(t.border) ?? ""
2428
- },
2429
- fonts: {
2430
- heading: r?.heading ?? "inherit",
2431
- body: r?.body ?? "inherit"
2432
- },
2433
- sizes: { radius: i?.radius ?? "4px" }
2434
- };
2435
- }, Ht = (e) => {
2436
- if (e) return {
2437
- colors: {
2438
- primary: e.colors?.brand?.main,
2439
- primaryForeground: e.colors?.brand?.foreground,
2440
- foreground: e.colors?.text1,
2441
- text: e.colors?.text1,
2442
- heading: e.colors?.text1,
2443
- mutedForeground: e.colors?.text2,
2444
- background: e.colors?.page,
2445
- card: e.colors?.page,
2446
- cardForeground: e.colors?.text1,
2447
- popover: e.colors?.page,
2448
- popoverForeground: e.colors?.text1,
2449
- border: e.colors?.border,
2450
- input: e.colors?.page,
2451
- inputForeground: e.colors?.text1
2452
- },
2453
- fonts: e.fonts,
2454
- radius: e.sizes?.radius
2455
- };
2456
- }, Ut = (e) => Ye(Ht(e)), Wt = (e) => {
2457
- let t = x(19), n, r, i, a, o;
2458
- t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5]) : ({children: n, popupTheme: r, siteTheme: a, style: o, ...i} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o);
2459
- let s;
2460
- t[6] !== r || t[7] !== a ? (s = r ?? (a ? Vt(a) : null), t[6] = r, t[7] = a, t[8] = s) : s = t[8];
2461
- let c = s;
2462
- We(c?.fonts?.heading, c?.fonts?.body);
2463
- let l;
2464
- t[9] === Symbol.for("react.memo_cache_sentinel") ? (l = I(b, f), t[9] = l) : l = t[9];
2465
- let d;
2466
- t[10] === c ? d = t[11] : (d = Ut(c), t[10] = c, t[11] = d);
2467
- let p;
2468
- t[12] !== o || t[13] !== d ? (p = {
2469
- ...d,
2470
- ...o
2471
- }, t[12] = o, t[13] = d, t[14] = p) : p = t[14];
2472
- let m;
2473
- return t[15] !== n || t[16] !== i || t[17] !== p ? (m = /* @__PURE__ */ P(u, {
2474
- className: l,
2475
- cssReset: !0,
2476
- style: p,
2477
- ...i,
2478
- children: n
2479
- }), t[15] = n, t[16] = i, t[17] = p, t[18] = m) : m = t[18], m;
2480
- }, Gt = (e) => e.content.position || "top-right", Kt = (e) => {
2481
- switch (e) {
2482
- case "close-press": return "close_button";
2483
- case "outside-press": return "outside_click";
2484
- case "escape-key": return "escape_key";
2485
- default: return "programmatic";
2486
- }
2487
- }, qt = () => {
2488
- let e = x(32), { popup: r, callbacks: o } = Tt(), { placement: c, id: u } = r, d = Re(ct).active_popup_id === u, f = re(!1), p, m;
2489
- e[0] !== o || e[1] !== d || e[2] !== r ? (p = () => {
2490
- d && !f.current && (f.current = !0, o?.onPopupOpen?.(r, { trigger_type: dt() })), d || (f.current = !1);
2491
- }, m = [
2492
- d,
2493
- r,
2494
- o
2495
- ], e[0] = o, e[1] = d, e[2] = r, e[3] = p, e[4] = m) : (p = e[3], m = e[4]), M(p, m);
2496
- let h = Dt(), g, _, v, y, b, S, C, w;
2497
- if (e[5] !== h || e[6] !== d || e[7] !== c || e[8] !== r) {
2498
- let o = Gt(r), u = c === "popup", f = c === "slide_in";
2499
- _ = a, b = d, e[17] === h ? S = e[18] : (S = (e, t) => !e && h(Kt(t?.reason)), e[17] = h, e[18] = S), C = u, w = !u, g = n, e[19] === u ? v = e[20] : (v = u && /* @__PURE__ */ P(i, {}), e[19] = u, e[20] = v), y = u ? /* @__PURE__ */ P(l, {
2500
- className: yt,
2501
- children: /* @__PURE__ */ F(s.Popup, {
2502
- className: X({ placement: c }),
2503
- children: [/* @__PURE__ */ P(t, {
2504
- variant: "ghost",
2505
- size: "icon-xs",
2506
- className: Z,
2507
- "aria-label": "Close popup",
2508
- children: /* @__PURE__ */ P(de, { size: 16 })
2509
- }), /* @__PURE__ */ P(Q, {})]
2510
- })
2511
- }) : /* @__PURE__ */ F(s.Popup, {
2512
- className: I(X({
2513
- placement: c,
2514
- position: o
2515
- }), f && "_1gklkndd"),
2516
- children: [/* @__PURE__ */ P(t, {
2517
- variant: "ghost",
2518
- size: "icon-xs",
2519
- className: Z,
2520
- "aria-label": "Close popup",
2521
- children: /* @__PURE__ */ P(de, { size: 16 })
2522
- }), /* @__PURE__ */ P(Q, {})]
2523
- }), e[5] = h, e[6] = d, e[7] = c, e[8] = r, e[9] = g, e[10] = _, e[11] = v, e[12] = y, e[13] = b, e[14] = S, e[15] = C, e[16] = w;
2524
- } else g = e[9], _ = e[10], v = e[11], y = e[12], b = e[13], S = e[14], C = e[15], w = e[16];
2525
- let T;
2526
- e[21] !== g || e[22] !== v || e[23] !== y ? (T = /* @__PURE__ */ F(g, { children: [v, y] }), e[21] = g, e[22] = v, e[23] = y, e[24] = T) : T = e[24];
2527
- let E;
2528
- return e[25] !== _ || e[26] !== b || e[27] !== S || e[28] !== C || e[29] !== w || e[30] !== T ? (E = /* @__PURE__ */ P(_, {
2529
- open: b,
2530
- onOpenChange: S,
2531
- modal: C,
2532
- disablePointerDismissal: w,
2533
- children: T
2534
- }), e[25] = _, e[26] = b, e[27] = S, e[28] = C, e[29] = w, e[30] = T, e[31] = E) : E = e[31], E;
2535
- }, Jt = 3e4, Yt = 5e3, Xt = 5e3, Zt = 100, Qt = .5, $t = 5, en = (e) => {
2536
- if (typeof document > "u") return () => {};
2537
- let t = !1, n = Date.now(), r = [], i = 0, a = null, o = () => Date.now() - n >= Jt, s = () => {
2538
- t || (t = !0, c(), e());
2539
- }, c = () => {
2540
- a &&= (clearTimeout(a), null);
2541
- }, l = () => {
2542
- if (r.length < 2) return 0;
2543
- let e = r[0], t = r[r.length - 1], n = t.t - e.t;
2544
- return n === 0 ? 0 : (e.y - t.y) / n;
2545
- }, u = () => r.reduce((e, t) => t.y > e ? t.y : e, 0), d = (e) => {
2546
- r.push({
2547
- y: e.clientY,
2548
- t: Date.now()
2549
- }), r.length > $t && r.shift();
2550
- }, f = (e) => {
2551
- t || !o() || e.clientY > 0 || u() < Zt || Date.now() - i < Xt || l() < Qt || (c(), a = setTimeout(s, Yt));
2552
- }, p = () => {
2553
- c();
2554
- }, m = () => {
2555
- i = Date.now();
2556
- }, h = w.listen((e) => {
2557
- o() && (e === "hidden" || e === "frozen") && s();
2558
- });
2559
- return document.addEventListener("mousemove", d, { passive: !0 }), document.addEventListener("mouseleave", f), document.addEventListener("mouseenter", p), window.addEventListener("scroll", m, { passive: !0 }), () => {
2560
- c(), document.removeEventListener("mousemove", d), document.removeEventListener("mouseleave", f), document.removeEventListener("mouseenter", p), window.removeEventListener("scroll", m), h();
2561
- };
2562
- }, tn = (e, t) => {
2563
- if (!e) return null;
2564
- let n = setTimeout(() => Y(t, { trigger_type: "time_on_page" }), e);
2565
- return () => clearTimeout(n);
2566
- }, nn = (e, t) => {
2567
- if (e === void 0) return null;
2568
- let n = !1;
2569
- return T.listen((r) => {
2570
- n || r.depth >= e && (n = !0, Y(t, { trigger_type: "scroll_depth" }));
2571
- });
2572
- }, rn = (e) => {
2573
- let t = !1;
2574
- return S.listen((n) => {
2575
- t || n.status === "idle" && (t = !0, Y(e, { trigger_type: "inactivity" }));
2576
- });
2577
- }, an = (e, t) => {
2578
- let n = x(11), r = t === void 0 ? !0 : t, { triggers: i, id: a } = e, o = Re(C), s;
2579
- n[0] === Symbol.for("react.memo_cache_sentinel") ? (s = [], n[0] = s) : s = n[0];
2580
- let c = re(s), l;
2581
- n[1] !== r || n[2] !== o || n[3] !== e || n[4] !== i ? (l = () => {
2582
- if (!r || !o || !i) return;
2583
- let t = [];
2584
- if (i.time_on_page.enabled) {
2585
- let n = tn(i.time_on_page.delay_ms, e);
2586
- n && t.push(n);
2587
- }
2588
- if (i.scroll_depth.enabled) {
2589
- let n = nn(i.scroll_depth.percent, e);
2590
- n && t.push(n);
2591
- }
2592
- return i.exit_intent.enabled && t.push(en(() => Y(e, { trigger_type: "exit_intent" }))), i.inactivity.enabled && t.push(rn(e)), c.current = t, () => {
2593
- t.forEach(on), c.current = [];
2594
- };
2595
- }, n[1] = r, n[2] = o, n[3] = e, n[4] = i, n[5] = l) : l = n[5];
2596
- let u;
2597
- n[6] !== r || n[7] !== o || n[8] !== a || n[9] !== i ? (u = [
2598
- r,
2599
- o,
2600
- a,
2601
- i
2602
- ], n[6] = r, n[7] = o, n[8] = a, n[9] = i, n[10] = u) : u = n[10], M(l, u);
2603
- };
2604
- function on(e) {
2605
- return e();
2606
- }
2607
- var sn = (e, t) => {
2608
- switch (e.match_type) {
2609
- case "is_all_pages": return !0;
2610
- 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;
2611
- case "contains": return e.value != null && t.path.includes(e.value);
2612
- case "begins_with": return e.value != null && t.path.startsWith(e.value);
2613
- default: return !1;
2614
- }
2615
- }, cn = (e, t) => {
2616
- switch (e.match_type) {
2617
- case "exact": return t === e.value;
2618
- case "contains": return t.includes(e.value);
2619
- case "domain": try {
2620
- let n = new URL(t).hostname, r = e.value.toLowerCase();
2621
- return n === r || n.endsWith(`.${r}`);
2622
- } catch {
2623
- return !1;
2624
- }
2625
- default: return !1;
2626
- }
2627
- }, ln = (e, t, n) => {
2628
- let r = e.pages?.exclude ?? [];
2629
- if (r.length > 0 && r.some((e) => sn(e, t))) return !1;
2630
- let i = e.pages?.include ?? [];
2631
- if (i.length > 0 && !i.some((e) => sn(e, t))) return !1;
2632
- let a = e.referrer?.include ?? [];
2633
- if (a.length > 0 && (!n || !a.some((e) => cn(e, n)))) return !1;
2634
- let o = e.referrer?.exclude ?? [];
2635
- return !(o.length > 0 && n && o.some((e) => cn(e, n)));
2636
- }, un = (e) => {
2637
- let t = x(4), { pageId: n } = e, { popup: r } = Tt(), i;
2638
- bb0: {
2639
- if (!r.target) {
2640
- i = !0;
2641
- break bb0;
2642
- }
2643
- if (typeof window > "u") {
2644
- i = !1;
2645
- break bb0;
2646
- }
2647
- let e;
2648
- if (t[0] !== n || t[1] !== r.target) {
2649
- let i = E.get().identity?.referrer?.raw || document.referrer || null, a = new URL(window.location.href, window.location.origin);
2650
- e = ln(r.target, {
2651
- pageId: n,
2652
- path: a.pathname
2653
- }, i), t[0] = n, t[1] = r.target, t[2] = e;
2654
- } else e = t[2];
2655
- i = e;
2656
- }
2657
- let a = i;
2658
- if (an(r, a), !a) return null;
2659
- let o;
2660
- return t[3] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ P(qt, {}), t[3] = o) : o = t[3], o;
2661
- }, dn = () => {
2662
- let e = T.get(), t = S.get();
2663
- return {
2664
- trigger_scroll_depth: e.depth,
2665
- trigger_scroll_speed: e.speedCategory,
2666
- trigger_scroll_direction: e.direction,
2667
- trigger_activity_status: t.status,
2668
- trigger_activity_seconds: t.seconds,
2669
- trigger_tab_count: D()
2670
- };
2671
- }, fn = (e) => {
2672
- let t = x(16), { popups: n, pageId: r } = e, i = O(), a, o;
2673
- t[0] === n ? (a = t[1], o = t[2]) : (a = () => {
2674
- V(n), U(!1);
2675
- }, o = [n], t[0] = n, t[1] = a, t[2] = o), M(a, o);
2676
- let s;
2677
- t[3] === i ? s = t[4] : (s = (e, t) => {
2678
- !i || typeof i.track != "function" || i?.track(e, t);
2679
- }, t[3] = i, t[4] = s);
2680
- let c = s, l = pn, u;
2681
- t[5] === c ? u = t[6] : (u = {
2682
- onPopupOpen: (e, t) => {
2683
- c("popup.view", {
2684
- ...l(e),
2685
- trigger_type: t.trigger_type,
2686
- language: e.language,
2687
- ...dn()
2688
- });
2689
- },
2690
- onPopupClose: (e, t) => {
2691
- c("popup.close", {
2692
- ...l(e),
2693
- trigger_type: t.trigger_type,
2694
- dismiss_reason: t.dismiss_reason,
2695
- time_shown_ms: t.time_shown_ms
2696
- });
2697
- },
2698
- onAction: (e, t) => {
2699
- c("popup.action", {
2700
- ...l(e),
2701
- ...t
2702
- });
2703
- }
2704
- }, t[5] = c, t[6] = u);
2705
- let d = u, f;
2706
- if (t[7] !== d || t[8] !== r || t[9] !== n) {
2707
- let e;
2708
- t[11] !== d || t[12] !== r ? (e = (e) => /* @__PURE__ */ P(Wt, {
2709
- popupTheme: e.theme,
2710
- siteTheme: e.site?.theme,
2711
- children: /* @__PURE__ */ P(wt, {
2712
- popup: e,
2713
- callbacks: d,
2714
- children: /* @__PURE__ */ P(un, { pageId: r })
2715
- })
2716
- }, e.id), t[11] = d, t[12] = r, t[13] = e) : e = t[13], f = n.map(e), t[7] = d, t[8] = r, t[9] = n, t[10] = f;
2717
- } else f = t[10];
2718
- let p;
2719
- return t[14] === f ? p = t[15] : (p = /* @__PURE__ */ P(se, { children: f }), t[14] = f, t[15] = p), p;
2720
- };
2721
- function pn(e) {
2722
- return {
2723
- resource: "builder.popup",
2724
- identifier: e.id,
2725
- popup_title: e.title,
2726
- placement: e.placement,
2727
- popup_action_kind: e.content.action?.type || "none"
2728
- };
2729
- }
2730
- var mn = /* @__PURE__ */ rt({ PopupRenderer: () => fn });
1997
+ });
2731
1998
  //#endregion
2732
- export { $e as _, Q as a, H as c, Z as d, X as f, et as g, St as h, tt as i, V as l, J as m, Gt as n, _t as o, yt as p, B as r, Wt as s, z as t, U as u, Ye as v };
1999
+ export { o as n, s as t };