webim-adapter 0.10.0 → 0.12.0
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/build/webim-adapter.js +463 -352
- package/build/webim-embed.js +2 -2
- package/build/webim-ssr.js +252 -141
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -1156,14 +1156,14 @@ var qe = {
|
|
|
1156
1156
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1157
1157
|
zIndex: 60
|
|
1158
1158
|
};
|
|
1159
|
-
function Ye({ brand: e, logo: n,
|
|
1160
|
-
let [
|
|
1159
|
+
function Ye({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], style: s, nodeRef: c, menu: p = "auto", breakpoint: m = 768 }) {
|
|
1160
|
+
let [h, g] = l(null), [_, v] = l(!1), [y, b] = l(!1), [x, S] = l(null);
|
|
1161
1161
|
a(() => {
|
|
1162
|
-
if (!
|
|
1163
|
-
let e = new ResizeObserver(() => h
|
|
1164
|
-
return e.observe(
|
|
1165
|
-
}, [
|
|
1166
|
-
let
|
|
1162
|
+
if (!h) return;
|
|
1163
|
+
let e = new ResizeObserver(() => v(h.offsetWidth < m));
|
|
1164
|
+
return e.observe(h), () => e.disconnect();
|
|
1165
|
+
}, [h, m]);
|
|
1166
|
+
let w = p === "hamburger" || p === "auto" && _, T = (e, t) => /* @__PURE__ */ f("a", {
|
|
1167
1167
|
href: e.href || "#",
|
|
1168
1168
|
style: {
|
|
1169
1169
|
...qe,
|
|
@@ -1182,7 +1182,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1182
1182
|
}, e.key);
|
|
1183
1183
|
return /* @__PURE__ */ f("nav", {
|
|
1184
1184
|
ref: (e) => {
|
|
1185
|
-
|
|
1185
|
+
g(e), c && c(e);
|
|
1186
1186
|
},
|
|
1187
1187
|
style: {
|
|
1188
1188
|
display: "flex",
|
|
@@ -1192,30 +1192,47 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1192
1192
|
padding: "14px 24px",
|
|
1193
1193
|
width: "100%",
|
|
1194
1194
|
position: "relative",
|
|
1195
|
-
...C(
|
|
1195
|
+
...C(s)
|
|
1196
1196
|
},
|
|
1197
1197
|
children: [
|
|
1198
|
-
n
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1198
|
+
(n || e) && (() => {
|
|
1199
|
+
let t = /* @__PURE__ */ f(u, { children: [n && /* @__PURE__ */ d("img", {
|
|
1200
|
+
src: n,
|
|
1201
|
+
alt: e || "Logo",
|
|
1202
|
+
style: {
|
|
1203
|
+
height: 28,
|
|
1204
|
+
display: "block"
|
|
1205
|
+
}
|
|
1206
|
+
}), e && /* @__PURE__ */ d("span", {
|
|
1207
|
+
style: {
|
|
1208
|
+
fontWeight: 700,
|
|
1209
|
+
fontSize: 18,
|
|
1210
|
+
fontFamily: "var(--page-heading-font, inherit)"
|
|
1211
|
+
},
|
|
1212
|
+
children: e
|
|
1213
|
+
})] }), a = {
|
|
1214
|
+
display: "flex",
|
|
1215
|
+
alignItems: "center",
|
|
1216
|
+
gap: 10,
|
|
1217
|
+
color: "inherit",
|
|
1218
|
+
textDecoration: "none"
|
|
1219
|
+
};
|
|
1220
|
+
return r ? /* @__PURE__ */ d("a", {
|
|
1221
|
+
href: r,
|
|
1222
|
+
target: i || void 0,
|
|
1223
|
+
rel: i === "_blank" ? "noopener noreferrer" : void 0,
|
|
1224
|
+
style: a,
|
|
1225
|
+
children: t
|
|
1226
|
+
}) : /* @__PURE__ */ d("div", {
|
|
1227
|
+
style: a,
|
|
1228
|
+
children: t
|
|
1229
|
+
});
|
|
1230
|
+
})(),
|
|
1214
1231
|
/* @__PURE__ */ d("div", { style: { flexGrow: 1 } }),
|
|
1215
|
-
|
|
1232
|
+
w ? /* @__PURE__ */ d("button", {
|
|
1216
1233
|
type: "button",
|
|
1217
|
-
"aria-label":
|
|
1218
|
-
onClick: () =>
|
|
1234
|
+
"aria-label": y ? "Close menu" : "Open menu",
|
|
1235
|
+
onClick: () => b(!y),
|
|
1219
1236
|
style: {
|
|
1220
1237
|
background: "transparent",
|
|
1221
1238
|
border: 0,
|
|
@@ -1225,7 +1242,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1225
1242
|
lineHeight: 1,
|
|
1226
1243
|
padding: 4
|
|
1227
1244
|
},
|
|
1228
|
-
children:
|
|
1245
|
+
children: y ? "✕" : "☰"
|
|
1229
1246
|
}) : /* @__PURE__ */ d("div", {
|
|
1230
1247
|
style: {
|
|
1231
1248
|
display: "flex",
|
|
@@ -1233,7 +1250,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1233
1250
|
alignItems: "center",
|
|
1234
1251
|
flexWrap: "wrap"
|
|
1235
1252
|
},
|
|
1236
|
-
children:
|
|
1253
|
+
children: o.map((e) => {
|
|
1237
1254
|
let t = e.children ?? [];
|
|
1238
1255
|
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
1239
1256
|
href: e.href || "#",
|
|
@@ -1246,8 +1263,8 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1246
1263
|
position: n ? "static" : "relative",
|
|
1247
1264
|
display: "inline-flex"
|
|
1248
1265
|
},
|
|
1249
|
-
onMouseEnter: () =>
|
|
1250
|
-
onMouseLeave: () =>
|
|
1266
|
+
onMouseEnter: () => S(e.key),
|
|
1267
|
+
onMouseLeave: () => S(null),
|
|
1251
1268
|
children: [/* @__PURE__ */ f("a", {
|
|
1252
1269
|
href: e.href || "#",
|
|
1253
1270
|
style: {
|
|
@@ -1265,7 +1282,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1265
1282
|
children: "▼"
|
|
1266
1283
|
})
|
|
1267
1284
|
]
|
|
1268
|
-
}),
|
|
1285
|
+
}), x === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
1269
1286
|
style: {
|
|
1270
1287
|
...Je,
|
|
1271
1288
|
position: "absolute",
|
|
@@ -1277,7 +1294,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1277
1294
|
gridTemplateColumns: "repeat(auto-fit, minmax(170px, 1fr))",
|
|
1278
1295
|
gap: 16
|
|
1279
1296
|
},
|
|
1280
|
-
children: t.map((e) =>
|
|
1297
|
+
children: t.map((e) => T(e, {
|
|
1281
1298
|
padding: "6px 8px",
|
|
1282
1299
|
borderRadius: 6
|
|
1283
1300
|
}))
|
|
@@ -1293,7 +1310,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1293
1310
|
display: "flex",
|
|
1294
1311
|
flexDirection: "column"
|
|
1295
1312
|
},
|
|
1296
|
-
children: t.map((e) =>
|
|
1313
|
+
children: t.map((e) => T(e, {
|
|
1297
1314
|
padding: "8px 12px",
|
|
1298
1315
|
borderRadius: 6
|
|
1299
1316
|
}))
|
|
@@ -1301,7 +1318,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1301
1318
|
}, e.key);
|
|
1302
1319
|
})
|
|
1303
1320
|
}),
|
|
1304
|
-
|
|
1321
|
+
w && y && /* @__PURE__ */ d("div", {
|
|
1305
1322
|
style: {
|
|
1306
1323
|
flexBasis: "100%",
|
|
1307
1324
|
width: "100%",
|
|
@@ -1309,7 +1326,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1309
1326
|
flexDirection: "column",
|
|
1310
1327
|
paddingTop: 10
|
|
1311
1328
|
},
|
|
1312
|
-
children:
|
|
1329
|
+
children: o.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
1313
1330
|
href: e.href || "#",
|
|
1314
1331
|
style: {
|
|
1315
1332
|
...qe,
|
|
@@ -1318,7 +1335,7 @@ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1318
1335
|
opacity: 1
|
|
1319
1336
|
},
|
|
1320
1337
|
children: e.label
|
|
1321
|
-
}), (e.children ?? []).map((e) =>
|
|
1338
|
+
}), (e.children ?? []).map((e) => T(e, { padding: "8px 4px 8px 22px" }))] }, e.key))
|
|
1322
1339
|
})
|
|
1323
1340
|
]
|
|
1324
1341
|
});
|
|
@@ -1686,7 +1703,7 @@ function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1686
1703
|
display: A === "success" ? "none" : "flex"
|
|
1687
1704
|
},
|
|
1688
1705
|
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
1689
|
-
P && /* @__PURE__ */ d(
|
|
1706
|
+
P && /* @__PURE__ */ d(bt, {
|
|
1690
1707
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
1691
1708
|
active: F + 1,
|
|
1692
1709
|
style: { marginBottom: 8 }
|
|
@@ -1772,7 +1789,97 @@ function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1772
1789
|
]
|
|
1773
1790
|
});
|
|
1774
1791
|
}
|
|
1775
|
-
|
|
1792
|
+
var ot = null, st = () => ot || (ot = new Promise((e) => {
|
|
1793
|
+
if (typeof window > "u") return;
|
|
1794
|
+
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
1795
|
+
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
1796
|
+
let t = document.createElement("script");
|
|
1797
|
+
t.src = "https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit", t.async = !0, document.head.appendChild(t);
|
|
1798
|
+
}), ot);
|
|
1799
|
+
function ct({ siteKey: e, theme: t, size: n, style: r, nodeRef: o, inert: s }) {
|
|
1800
|
+
let l = i(H), u = l?.settings && typeof l.settings == "object" ? l.settings["google.recaptchaKey"] : "", p = typeof e == "string" && e.trim() || (typeof u == "string" ? u.trim() : ""), m = c(null), h = c(!1);
|
|
1801
|
+
if (a(() => {
|
|
1802
|
+
if (s || !p || h.current || !m.current) return;
|
|
1803
|
+
let e = !0;
|
|
1804
|
+
return st().then((r) => {
|
|
1805
|
+
if (!(!e || h.current || !m.current || !r?.render)) {
|
|
1806
|
+
h.current = !0;
|
|
1807
|
+
try {
|
|
1808
|
+
r.render(m.current, {
|
|
1809
|
+
sitekey: p,
|
|
1810
|
+
theme: t === "dark" ? "dark" : "light",
|
|
1811
|
+
size: n === "compact" ? "compact" : "normal"
|
|
1812
|
+
});
|
|
1813
|
+
} catch {}
|
|
1814
|
+
}
|
|
1815
|
+
}), () => {
|
|
1816
|
+
e = !1;
|
|
1817
|
+
};
|
|
1818
|
+
}, [
|
|
1819
|
+
s,
|
|
1820
|
+
p,
|
|
1821
|
+
t,
|
|
1822
|
+
n
|
|
1823
|
+
]), s) {
|
|
1824
|
+
let e = t === "dark";
|
|
1825
|
+
return /* @__PURE__ */ f("div", {
|
|
1826
|
+
ref: o,
|
|
1827
|
+
style: C(r),
|
|
1828
|
+
children: [/* @__PURE__ */ f("div", {
|
|
1829
|
+
style: {
|
|
1830
|
+
width: n === "compact" ? 164 : 302,
|
|
1831
|
+
boxSizing: "border-box",
|
|
1832
|
+
padding: "12px 14px",
|
|
1833
|
+
display: "flex",
|
|
1834
|
+
alignItems: "center",
|
|
1835
|
+
gap: 12,
|
|
1836
|
+
borderRadius: 4,
|
|
1837
|
+
border: `1px solid ${e ? "#52565b" : "#d3d3d3"}`,
|
|
1838
|
+
background: e ? "#222528" : "#f9f9f9",
|
|
1839
|
+
color: e ? "#f1f1f1" : "#282828",
|
|
1840
|
+
fontSize: 14,
|
|
1841
|
+
fontFamily: "Roboto, Arial, sans-serif"
|
|
1842
|
+
},
|
|
1843
|
+
children: [
|
|
1844
|
+
/* @__PURE__ */ d("span", { style: {
|
|
1845
|
+
width: 24,
|
|
1846
|
+
height: 24,
|
|
1847
|
+
flexShrink: 0,
|
|
1848
|
+
borderRadius: 3,
|
|
1849
|
+
border: `2px solid ${e ? "#8a8f94" : "#c1c1c1"}`,
|
|
1850
|
+
background: e ? "#2f3337" : "#fff"
|
|
1851
|
+
} }),
|
|
1852
|
+
/* @__PURE__ */ d("span", {
|
|
1853
|
+
style: { flexGrow: 1 },
|
|
1854
|
+
children: "I'm not a robot"
|
|
1855
|
+
}),
|
|
1856
|
+
/* @__PURE__ */ d("span", {
|
|
1857
|
+
style: {
|
|
1858
|
+
fontSize: 9,
|
|
1859
|
+
opacity: .6,
|
|
1860
|
+
textAlign: "center",
|
|
1861
|
+
lineHeight: 1.3
|
|
1862
|
+
},
|
|
1863
|
+
children: "reCAPTCHA"
|
|
1864
|
+
})
|
|
1865
|
+
]
|
|
1866
|
+
}), !p && /* @__PURE__ */ d("div", {
|
|
1867
|
+
style: {
|
|
1868
|
+
marginTop: 6,
|
|
1869
|
+
fontSize: 11,
|
|
1870
|
+
color: "#b45309"
|
|
1871
|
+
},
|
|
1872
|
+
children: "Set the google.recaptchaKey tenant setting (or a site key in Settings) to activate it."
|
|
1873
|
+
})]
|
|
1874
|
+
});
|
|
1875
|
+
}
|
|
1876
|
+
return p ? /* @__PURE__ */ d("div", {
|
|
1877
|
+
ref: o,
|
|
1878
|
+
style: C(r),
|
|
1879
|
+
children: /* @__PURE__ */ d("div", { ref: m })
|
|
1880
|
+
}) : null;
|
|
1881
|
+
}
|
|
1882
|
+
function lt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
1776
1883
|
return /* @__PURE__ */ d("label", {
|
|
1777
1884
|
ref: r,
|
|
1778
1885
|
style: {
|
|
@@ -1782,7 +1889,7 @@ function ot({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
|
1782
1889
|
children: J(t, e, i)
|
|
1783
1890
|
});
|
|
1784
1891
|
}
|
|
1785
|
-
function
|
|
1892
|
+
function ut({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1786
1893
|
return /* @__PURE__ */ d("input", {
|
|
1787
1894
|
ref: a,
|
|
1788
1895
|
type: e,
|
|
@@ -1796,7 +1903,7 @@ function st({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
1796
1903
|
...Z(o)
|
|
1797
1904
|
});
|
|
1798
1905
|
}
|
|
1799
|
-
function
|
|
1906
|
+
function dt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1800
1907
|
return /* @__PURE__ */ d("textarea", {
|
|
1801
1908
|
ref: a,
|
|
1802
1909
|
name: e || void 0,
|
|
@@ -1811,7 +1918,7 @@ function ct({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
1811
1918
|
...Z(o)
|
|
1812
1919
|
});
|
|
1813
1920
|
}
|
|
1814
|
-
function
|
|
1921
|
+
function ft({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
1815
1922
|
return /* @__PURE__ */ f("label", {
|
|
1816
1923
|
ref: o,
|
|
1817
1924
|
style: {
|
|
@@ -1832,7 +1939,7 @@ function lt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
1832
1939
|
}), t]
|
|
1833
1940
|
});
|
|
1834
1941
|
}
|
|
1835
|
-
function
|
|
1942
|
+
function pt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
1836
1943
|
return /* @__PURE__ */ f("select", {
|
|
1837
1944
|
ref: a,
|
|
1838
1945
|
name: e || void 0,
|
|
@@ -1855,7 +1962,7 @@ function ut({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
1855
1962
|
}, t))]
|
|
1856
1963
|
});
|
|
1857
1964
|
}
|
|
1858
|
-
function
|
|
1965
|
+
function mt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
1859
1966
|
let [s, c] = l(null);
|
|
1860
1967
|
return /* @__PURE__ */ f("label", {
|
|
1861
1968
|
ref: a,
|
|
@@ -1887,7 +1994,7 @@ function dt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
1887
1994
|
]
|
|
1888
1995
|
});
|
|
1889
1996
|
}
|
|
1890
|
-
function
|
|
1997
|
+
function ht({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
1891
1998
|
return /* @__PURE__ */ d("button", {
|
|
1892
1999
|
ref: n,
|
|
1893
2000
|
type: r ? "button" : "submit",
|
|
@@ -1907,7 +2014,7 @@ function ft({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
1907
2014
|
children: e
|
|
1908
2015
|
});
|
|
1909
2016
|
}
|
|
1910
|
-
function
|
|
2017
|
+
function gt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
1911
2018
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
1912
2019
|
return /* @__PURE__ */ d("div", {
|
|
1913
2020
|
ref: r,
|
|
@@ -1924,7 +2031,7 @@ function pt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
1924
2031
|
}, t))
|
|
1925
2032
|
});
|
|
1926
2033
|
}
|
|
1927
|
-
function
|
|
2034
|
+
function _t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, style: m, nodeRef: h }) {
|
|
1928
2035
|
let { tenant: g, apiUrl: _, locale: v } = i(H), y = i(W), b = i(U)?.[e], [x, S] = l(null);
|
|
1929
2036
|
if (a(() => {
|
|
1930
2037
|
if (!e || b) return;
|
|
@@ -2025,7 +2132,7 @@ function mt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2025
2132
|
})
|
|
2026
2133
|
});
|
|
2027
2134
|
}
|
|
2028
|
-
function
|
|
2135
|
+
function vt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
2029
2136
|
return e.length ? /* @__PURE__ */ d("nav", {
|
|
2030
2137
|
ref: r,
|
|
2031
2138
|
"aria-label": "Breadcrumb",
|
|
@@ -2075,7 +2182,7 @@ function ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2075
2182
|
})
|
|
2076
2183
|
}) : null;
|
|
2077
2184
|
}
|
|
2078
|
-
function
|
|
2185
|
+
function yt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
|
|
2079
2186
|
let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), c = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", l = (e) => ({
|
|
2080
2187
|
display: "inline-flex",
|
|
2081
2188
|
alignItems: "center",
|
|
@@ -2128,7 +2235,7 @@ function gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2128
2235
|
]
|
|
2129
2236
|
});
|
|
2130
2237
|
}
|
|
2131
|
-
function
|
|
2238
|
+
function bt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
2132
2239
|
if (!e.length) return null;
|
|
2133
2240
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
2134
2241
|
width: 32,
|
|
@@ -2206,7 +2313,7 @@ function _t({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2206
2313
|
})
|
|
2207
2314
|
});
|
|
2208
2315
|
}
|
|
2209
|
-
var
|
|
2316
|
+
var xt = {
|
|
2210
2317
|
small: {
|
|
2211
2318
|
w: 132,
|
|
2212
2319
|
h: 46,
|
|
@@ -2228,10 +2335,10 @@ var vt = {
|
|
|
2228
2335
|
title: 12.5,
|
|
2229
2336
|
avatar: 46
|
|
2230
2337
|
}
|
|
2231
|
-
},
|
|
2232
|
-
|
|
2233
|
-
function
|
|
2234
|
-
let r =
|
|
2338
|
+
}, St = (e) => xt[e] ?? xt.medium;
|
|
2339
|
+
xt.medium.w, xt.medium.h;
|
|
2340
|
+
function Ct(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
2341
|
+
let r = St(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
|
|
2235
2342
|
for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
|
|
2236
2343
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
2237
2344
|
if (t.has(e.id)) return 0;
|
|
@@ -2283,18 +2390,18 @@ function bt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
2283
2390
|
horizontal: n
|
|
2284
2391
|
};
|
|
2285
2392
|
}
|
|
2286
|
-
var
|
|
2393
|
+
var wt = (e, t) => {
|
|
2287
2394
|
let n = String(e ?? "");
|
|
2288
2395
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
2289
|
-
},
|
|
2396
|
+
}, Tt = (e) => {
|
|
2290
2397
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
2291
2398
|
if (!t) return "#ffffff";
|
|
2292
2399
|
let n = t[1];
|
|
2293
2400
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
2294
2401
|
let r = parseInt(n, 16);
|
|
2295
2402
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
2296
|
-
},
|
|
2297
|
-
function
|
|
2403
|
+
}, Et = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
2404
|
+
function Dt(e, t = {}) {
|
|
2298
2405
|
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : K(e);
|
|
2299
2406
|
return n.map((e) => {
|
|
2300
2407
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
@@ -2309,11 +2416,11 @@ function wt(e, t = {}) {
|
|
|
2309
2416
|
};
|
|
2310
2417
|
});
|
|
2311
2418
|
}
|
|
2312
|
-
var
|
|
2419
|
+
var Ot = {
|
|
2313
2420
|
size: 36,
|
|
2314
2421
|
pad: 10
|
|
2315
2422
|
};
|
|
2316
|
-
function
|
|
2423
|
+
function kt({ node: e, onClose: t }) {
|
|
2317
2424
|
return a(() => {
|
|
2318
2425
|
let e = (e) => e.key === "Escape" && t();
|
|
2319
2426
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -2431,7 +2538,7 @@ function Et({ node: e, onClose: t }) {
|
|
|
2431
2538
|
})
|
|
2432
2539
|
});
|
|
2433
2540
|
}
|
|
2434
|
-
function
|
|
2541
|
+
function At({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
|
|
2435
2542
|
let b = o(), [x, S] = l(null), { tenant: w, apiUrl: T } = i(H), E = i(U)?.[t], [D, O] = l(null);
|
|
2436
2543
|
a(() => {
|
|
2437
2544
|
if (!t || E) return;
|
|
@@ -2448,14 +2555,14 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2448
2555
|
T,
|
|
2449
2556
|
E
|
|
2450
2557
|
]);
|
|
2451
|
-
let k = t ?
|
|
2558
|
+
let k = t ? Dt(E ?? D ?? [], {
|
|
2452
2559
|
nameField: n,
|
|
2453
2560
|
titleField: r,
|
|
2454
2561
|
photoField: s,
|
|
2455
2562
|
parentField: c,
|
|
2456
2563
|
cvField: p,
|
|
2457
2564
|
hrefField: m
|
|
2458
|
-
}) : e, A =
|
|
2565
|
+
}) : e, A = St(h), { boxes: j, links: M, width: N, height: P } = Ct(k, {
|
|
2459
2566
|
size: h,
|
|
2460
2567
|
horizontal: g
|
|
2461
2568
|
});
|
|
@@ -2501,7 +2608,7 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2501
2608
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
2502
2609
|
strokeWidth: "1.5"
|
|
2503
2610
|
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
2504
|
-
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ?
|
|
2611
|
+
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Tt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Tt(e.color2) : s, l = y && (Et(e) || e.href), p = () => Et(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Ot.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
2505
2612
|
return /* @__PURE__ */ f("g", {
|
|
2506
2613
|
onClick: l ? p : void 0,
|
|
2507
2614
|
style: l ? { cursor: "pointer" } : void 0,
|
|
@@ -2565,13 +2672,13 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2565
2672
|
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
2566
2673
|
id: `${b}-${e.id}`,
|
|
2567
2674
|
children: /* @__PURE__ */ d("circle", {
|
|
2568
|
-
cx: t +
|
|
2675
|
+
cx: t + Ot.pad + A.avatar / 2,
|
|
2569
2676
|
cy: n + A.h / 2,
|
|
2570
2677
|
r: A.avatar / 2
|
|
2571
2678
|
})
|
|
2572
2679
|
}), /* @__PURE__ */ d("image", {
|
|
2573
2680
|
href: e.photo,
|
|
2574
|
-
x: t +
|
|
2681
|
+
x: t + Ot.pad,
|
|
2575
2682
|
y: n + (A.h - A.avatar) / 2,
|
|
2576
2683
|
width: A.avatar,
|
|
2577
2684
|
height: A.avatar,
|
|
@@ -2585,7 +2692,7 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2585
2692
|
fontSize: A.title,
|
|
2586
2693
|
fontWeight: "600",
|
|
2587
2694
|
fill: s,
|
|
2588
|
-
children:
|
|
2695
|
+
children: wt(e.title, g + 4)
|
|
2589
2696
|
}), e.name && /* @__PURE__ */ d("text", {
|
|
2590
2697
|
x: m,
|
|
2591
2698
|
y: n + _ + _ / 2 + A.name * .35,
|
|
@@ -2593,7 +2700,7 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2593
2700
|
fontSize: A.name,
|
|
2594
2701
|
fontWeight: "600",
|
|
2595
2702
|
fill: c,
|
|
2596
|
-
children:
|
|
2703
|
+
children: wt(e.name, g)
|
|
2597
2704
|
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
2598
2705
|
x: m,
|
|
2599
2706
|
y: n + (v[1] ? A.h * .43 : A.h * .57),
|
|
@@ -2601,7 +2708,7 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2601
2708
|
fontSize: A.name,
|
|
2602
2709
|
fontWeight: "600",
|
|
2603
2710
|
fill: s,
|
|
2604
|
-
children:
|
|
2711
|
+
children: wt(v[0], g)
|
|
2605
2712
|
}), v[1] && /* @__PURE__ */ d("text", {
|
|
2606
2713
|
x: m,
|
|
2607
2714
|
y: n + A.h * .73,
|
|
@@ -2609,18 +2716,18 @@ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2609
2716
|
fontSize: A.title,
|
|
2610
2717
|
opacity: "0.7",
|
|
2611
2718
|
fill: s,
|
|
2612
|
-
children:
|
|
2719
|
+
children: wt(v[1], g + 4)
|
|
2613
2720
|
})] })
|
|
2614
2721
|
]
|
|
2615
2722
|
}, e.id);
|
|
2616
2723
|
})]
|
|
2617
|
-
}), x && /* @__PURE__ */ d(
|
|
2724
|
+
}), x && /* @__PURE__ */ d(kt, {
|
|
2618
2725
|
node: x,
|
|
2619
2726
|
onClose: () => S(null)
|
|
2620
2727
|
})]
|
|
2621
2728
|
});
|
|
2622
2729
|
}
|
|
2623
|
-
function
|
|
2730
|
+
function jt({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: c = !1, style: u, nodeRef: p }) {
|
|
2624
2731
|
let { tenant: m, apiUrl: h } = i(H), g = i(U)?.[n], [_, v] = l(null);
|
|
2625
2732
|
if (a(() => {
|
|
2626
2733
|
if (!n || g) return;
|
|
@@ -2671,7 +2778,7 @@ function Ot({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
|
|
|
2671
2778
|
})
|
|
2672
2779
|
});
|
|
2673
2780
|
}
|
|
2674
|
-
var
|
|
2781
|
+
var Mt = {
|
|
2675
2782
|
PageRoot: me,
|
|
2676
2783
|
Section: he,
|
|
2677
2784
|
Container: ge,
|
|
@@ -2684,13 +2791,13 @@ var kt = {
|
|
|
2684
2791
|
SliderBlock: Ge,
|
|
2685
2792
|
CanvasSlider: Ke,
|
|
2686
2793
|
TabsBlock: Xe,
|
|
2687
|
-
QuickStack:
|
|
2688
|
-
CollectionList:
|
|
2689
|
-
BreadcrumbsBlock:
|
|
2690
|
-
PaginationBlock:
|
|
2691
|
-
StepperBlock:
|
|
2692
|
-
OrgChartBlock:
|
|
2693
|
-
TableBlock:
|
|
2794
|
+
QuickStack: gt,
|
|
2795
|
+
CollectionList: _t,
|
|
2796
|
+
BreadcrumbsBlock: vt,
|
|
2797
|
+
PaginationBlock: yt,
|
|
2798
|
+
StepperBlock: bt,
|
|
2799
|
+
OrgChartBlock: At,
|
|
2800
|
+
TableBlock: jt,
|
|
2694
2801
|
AccordionBlock: Ze,
|
|
2695
2802
|
NavbarBlock: Ye,
|
|
2696
2803
|
ListBlock: De,
|
|
@@ -2704,40 +2811,41 @@ var kt = {
|
|
|
2704
2811
|
IframeBlock: Ie,
|
|
2705
2812
|
EmbedBlock: Le,
|
|
2706
2813
|
FormBlock: at,
|
|
2707
|
-
FormLabel:
|
|
2708
|
-
FormInput:
|
|
2709
|
-
FormTextarea:
|
|
2710
|
-
FormCheckbox: (e) => /* @__PURE__ */ d(
|
|
2814
|
+
FormLabel: lt,
|
|
2815
|
+
FormInput: ut,
|
|
2816
|
+
FormTextarea: dt,
|
|
2817
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(ft, {
|
|
2711
2818
|
kind: "checkbox",
|
|
2712
2819
|
...e
|
|
2713
2820
|
}),
|
|
2714
|
-
FormRadio: (e) => /* @__PURE__ */ d(
|
|
2821
|
+
FormRadio: (e) => /* @__PURE__ */ d(ft, {
|
|
2715
2822
|
kind: "radio",
|
|
2716
2823
|
...e
|
|
2717
2824
|
}),
|
|
2718
|
-
FormSelect:
|
|
2719
|
-
FormFile:
|
|
2720
|
-
|
|
2721
|
-
|
|
2825
|
+
FormSelect: pt,
|
|
2826
|
+
FormFile: mt,
|
|
2827
|
+
FormRecaptcha: ct,
|
|
2828
|
+
FormSubmit: ht
|
|
2829
|
+
}, Nt = {
|
|
2722
2830
|
id: "auth",
|
|
2723
2831
|
label: "Accounts",
|
|
2724
2832
|
category: "Apps",
|
|
2725
2833
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
2726
2834
|
ssr: "shell",
|
|
2727
2835
|
settings: ["apps.auth.redirect"]
|
|
2728
|
-
},
|
|
2836
|
+
}, Pt = n({
|
|
2729
2837
|
user: null,
|
|
2730
2838
|
status: "idle",
|
|
2731
2839
|
ensure: () => {},
|
|
2732
2840
|
refresh: () => {},
|
|
2733
2841
|
signOut: () => {}
|
|
2734
|
-
}),
|
|
2735
|
-
let e = i(
|
|
2842
|
+
}), Ft = () => {
|
|
2843
|
+
let e = i(Pt);
|
|
2736
2844
|
return a(() => {
|
|
2737
2845
|
e.ensure();
|
|
2738
2846
|
}, [e]), e;
|
|
2739
2847
|
};
|
|
2740
|
-
function
|
|
2848
|
+
function It({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o }) {
|
|
2741
2849
|
let u = i(H), f = a || u?.apiUrl || "/api", p = o || u?.tenant || "", [m, h] = l(t ?? null), [g, _] = l(t ? "user" : n ? "guest" : "idle"), v = c(!1), y = r((e, t) => fetch(`${f}${e}`, {
|
|
2742
2850
|
...t,
|
|
2743
2851
|
credentials: "include",
|
|
@@ -2770,18 +2878,18 @@ function Nt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o })
|
|
|
2770
2878
|
b,
|
|
2771
2879
|
x
|
|
2772
2880
|
]);
|
|
2773
|
-
return /* @__PURE__ */ d(
|
|
2881
|
+
return /* @__PURE__ */ d(Pt.Provider, {
|
|
2774
2882
|
value: C,
|
|
2775
2883
|
children: e
|
|
2776
2884
|
});
|
|
2777
2885
|
}
|
|
2778
|
-
function
|
|
2779
|
-
let { status: n } =
|
|
2886
|
+
function Lt({ when: e, children: t }) {
|
|
2887
|
+
let { status: n } = Ft();
|
|
2780
2888
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
2781
2889
|
}
|
|
2782
2890
|
//#endregion
|
|
2783
2891
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
2784
|
-
function
|
|
2892
|
+
function Rt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
|
|
2785
2893
|
let { tenant: h, apiUrl: g, settings: _ } = i(H), [v, y] = l("form"), [b, x] = l(""), [S, w] = l(!1), T = e === "register", E = u ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
|
|
2786
2894
|
if (e.preventDefault(), u) return;
|
|
2787
2895
|
let n = new FormData(e.currentTarget);
|
|
@@ -2905,8 +3013,8 @@ function Ft({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
2905
3013
|
]
|
|
2906
3014
|
});
|
|
2907
3015
|
}
|
|
2908
|
-
function
|
|
2909
|
-
let { user: c, status: l, signOut: u } =
|
|
3016
|
+
function zt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
3017
|
+
let { user: c, status: l, signOut: u } = Ft(), p = a ? s || "user" : l, m = a ? {
|
|
2910
3018
|
name: "Ada Lovelace",
|
|
2911
3019
|
email: "ada@example.com"
|
|
2912
3020
|
} : c;
|
|
@@ -2971,16 +3079,16 @@ function It({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
2971
3079
|
}
|
|
2972
3080
|
//#endregion
|
|
2973
3081
|
//#region ../ui/src/components/builder/apps/index.js
|
|
2974
|
-
var
|
|
2975
|
-
SiteLoginForm:
|
|
2976
|
-
SiteAccountMenu:
|
|
3082
|
+
var Bt = [Nt], Vt = {
|
|
3083
|
+
SiteLoginForm: Rt,
|
|
3084
|
+
SiteAccountMenu: zt
|
|
2977
3085
|
};
|
|
2978
|
-
new Set(
|
|
3086
|
+
new Set(Bt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
2979
3087
|
//#endregion
|
|
2980
3088
|
//#region ../ui/src/components/builder/render.jsx
|
|
2981
|
-
var
|
|
2982
|
-
...
|
|
2983
|
-
...
|
|
3089
|
+
var Ht = {
|
|
3090
|
+
...Mt,
|
|
3091
|
+
...Vt
|
|
2984
3092
|
};
|
|
2985
3093
|
function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
2986
3094
|
let o = n[e];
|
|
@@ -2992,7 +3100,7 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
2992
3100
|
let c = new Set(i).add(n);
|
|
2993
3101
|
return /* @__PURE__ */ d(t, { children: Q(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
2994
3102
|
}
|
|
2995
|
-
let l =
|
|
3103
|
+
let l = Ht[s];
|
|
2996
3104
|
if (!l) return null;
|
|
2997
3105
|
let u = (o.nodes ?? []).map((e) => Q(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Q(t, n, r, i)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
2998
3106
|
...c,
|
|
@@ -3003,15 +3111,15 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3003
3111
|
},
|
|
3004
3112
|
children: u.length ? u : void 0
|
|
3005
3113
|
}, e);
|
|
3006
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ d(
|
|
3114
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(Lt, {
|
|
3007
3115
|
when: c.when,
|
|
3008
3116
|
children: m
|
|
3009
3117
|
}, e) : m;
|
|
3010
3118
|
}
|
|
3011
3119
|
//#endregion
|
|
3012
3120
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
3013
|
-
var
|
|
3014
|
-
function
|
|
3121
|
+
var Ut = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
|
|
3122
|
+
function Wt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, tenant: c, apiUrl: l, datasets: u, locale: p, direction: m, settings: g, siteUser: v }) {
|
|
3015
3123
|
let b = o?.js?.trim();
|
|
3016
3124
|
if (a(() => {
|
|
3017
3125
|
if (!b) return;
|
|
@@ -3021,11 +3129,11 @@ function Vt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3021
3129
|
let x = {
|
|
3022
3130
|
lang: p || void 0,
|
|
3023
3131
|
dir: h(m, p)
|
|
3024
|
-
}, S = {
|
|
3132
|
+
}, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
|
|
3025
3133
|
minHeight: "100%",
|
|
3026
3134
|
display: "flex",
|
|
3027
3135
|
flexDirection: "column"
|
|
3028
|
-
},
|
|
3136
|
+
}, w = Q("ROOT", e, n), T = s(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = F(e, n), D = P(e, n), O = o?.css?.trim(), k = y(e, n).map((e) => /* @__PURE__ */ d("link", {
|
|
3029
3137
|
rel: "stylesheet",
|
|
3030
3138
|
precedence: "default",
|
|
3031
3139
|
href: _(e)
|
|
@@ -3037,32 +3145,34 @@ function Vt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3037
3145
|
locale: p || "",
|
|
3038
3146
|
settings: g ?? null
|
|
3039
3147
|
},
|
|
3040
|
-
children: /* @__PURE__ */ d(
|
|
3148
|
+
children: /* @__PURE__ */ d(It, {
|
|
3041
3149
|
initialUser: v,
|
|
3042
3150
|
children: /* @__PURE__ */ d(U.Provider, {
|
|
3043
3151
|
value: u ?? null,
|
|
3044
3152
|
children: /* @__PURE__ */ d(W.Provider, {
|
|
3045
|
-
value:
|
|
3153
|
+
value: T,
|
|
3046
3154
|
children: /* @__PURE__ */ f("div", {
|
|
3047
3155
|
...x,
|
|
3156
|
+
className: "webim-page",
|
|
3048
3157
|
style: {
|
|
3049
|
-
...
|
|
3158
|
+
...C,
|
|
3050
3159
|
...re(t, r),
|
|
3051
3160
|
...i
|
|
3052
3161
|
},
|
|
3053
3162
|
children: [
|
|
3054
|
-
|
|
3055
|
-
|
|
3163
|
+
k,
|
|
3164
|
+
/* @__PURE__ */ d("style", { children: S }),
|
|
3056
3165
|
E && /* @__PURE__ */ d("style", { children: E }),
|
|
3057
3166
|
D && /* @__PURE__ */ d("style", { children: D }),
|
|
3058
|
-
|
|
3167
|
+
O && /* @__PURE__ */ d("style", { children: O }),
|
|
3168
|
+
w
|
|
3059
3169
|
]
|
|
3060
3170
|
})
|
|
3061
3171
|
})
|
|
3062
3172
|
})
|
|
3063
3173
|
})
|
|
3064
3174
|
});
|
|
3065
|
-
let
|
|
3175
|
+
let A = B(t);
|
|
3066
3176
|
return /* @__PURE__ */ d(H.Provider, {
|
|
3067
3177
|
value: {
|
|
3068
3178
|
tenant: c || "",
|
|
@@ -3070,28 +3180,29 @@ function Vt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3070
3180
|
locale: p || "",
|
|
3071
3181
|
settings: g ?? null
|
|
3072
3182
|
},
|
|
3073
|
-
children: /* @__PURE__ */ d(
|
|
3183
|
+
children: /* @__PURE__ */ d(It, {
|
|
3074
3184
|
initialUser: v,
|
|
3075
3185
|
children: /* @__PURE__ */ d(U.Provider, {
|
|
3076
3186
|
value: u ?? null,
|
|
3077
3187
|
children: /* @__PURE__ */ d(W.Provider, {
|
|
3078
|
-
value:
|
|
3188
|
+
value: T,
|
|
3079
3189
|
children: /* @__PURE__ */ f("div", {
|
|
3080
3190
|
...x,
|
|
3081
3191
|
className: "webim-page",
|
|
3082
3192
|
style: {
|
|
3083
|
-
...
|
|
3193
|
+
...C,
|
|
3084
3194
|
...ne(t),
|
|
3085
3195
|
...i
|
|
3086
3196
|
},
|
|
3087
3197
|
children: [
|
|
3088
|
-
/* @__PURE__ */ d("style", { children: `.webim-page { ${
|
|
3089
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
3090
|
-
|
|
3091
|
-
|
|
3198
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${Ut(V(A.light))} }
|
|
3199
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Ut(V(A.dark))} } }` }),
|
|
3200
|
+
k,
|
|
3201
|
+
/* @__PURE__ */ d("style", { children: S }),
|
|
3092
3202
|
E && /* @__PURE__ */ d("style", { children: E }),
|
|
3093
3203
|
D && /* @__PURE__ */ d("style", { children: D }),
|
|
3094
|
-
|
|
3204
|
+
O && /* @__PURE__ */ d("style", { children: O }),
|
|
3205
|
+
w
|
|
3095
3206
|
]
|
|
3096
3207
|
})
|
|
3097
3208
|
})
|
|
@@ -3101,8 +3212,8 @@ function Vt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3101
3212
|
}
|
|
3102
3213
|
//#endregion
|
|
3103
3214
|
//#region src/WebimContent.jsx
|
|
3104
|
-
function
|
|
3105
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ d(
|
|
3215
|
+
function Gt({ bundle: e, mode: t = "auto", style: n }) {
|
|
3216
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(Wt, {
|
|
3106
3217
|
blocks: e.blocks,
|
|
3107
3218
|
theme: e.theme,
|
|
3108
3219
|
components: e.components,
|
|
@@ -3119,7 +3230,7 @@ function Ht({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
3119
3230
|
}
|
|
3120
3231
|
//#endregion
|
|
3121
3232
|
//#region src/bundle.js
|
|
3122
|
-
function
|
|
3233
|
+
function Kt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
3123
3234
|
let a = {
|
|
3124
3235
|
...t?.global ?? {},
|
|
3125
3236
|
...t?.tenant ?? {}
|
|
@@ -3143,18 +3254,18 @@ function Ut({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
3143
3254
|
}
|
|
3144
3255
|
//#endregion
|
|
3145
3256
|
//#region src/fetchPage.js
|
|
3146
|
-
var
|
|
3257
|
+
var qt = async (e) => {
|
|
3147
3258
|
let t = await e.json().catch(() => null);
|
|
3148
3259
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
3149
3260
|
return t?.payload ?? t;
|
|
3150
3261
|
};
|
|
3151
|
-
async function
|
|
3262
|
+
async function Jt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
|
|
3152
3263
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
3153
3264
|
if (!n) throw Error("fetchPage: slug is required");
|
|
3154
3265
|
let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
|
|
3155
3266
|
...t ? { "x-tenant": t } : {},
|
|
3156
3267
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
3157
|
-
}, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(
|
|
3268
|
+
}, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(qt), s(`${c}/settings/public`, { headers: l }).then(qt)]), f = Kt({
|
|
3158
3269
|
page: u,
|
|
3159
3270
|
settings: d,
|
|
3160
3271
|
tenant: t,
|
|
@@ -3162,7 +3273,7 @@ async function Gt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
3162
3273
|
locale: r
|
|
3163
3274
|
}), p = [...new Set(Object.values(f.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
|
|
3164
3275
|
if (p.length) {
|
|
3165
|
-
let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(
|
|
3276
|
+
let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(qt).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
|
|
3166
3277
|
f.datasets = Object.fromEntries(t);
|
|
3167
3278
|
}
|
|
3168
3279
|
return f;
|
|
@@ -3175,14 +3286,14 @@ var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
|
3175
3286
|
">": ">",
|
|
3176
3287
|
"\"": """
|
|
3177
3288
|
})[e]);
|
|
3178
|
-
function
|
|
3179
|
-
return e(/* @__PURE__ */ d(
|
|
3289
|
+
function Yt(t, { mode: n = "auto", style: r } = {}) {
|
|
3290
|
+
return e(/* @__PURE__ */ d(Gt, {
|
|
3180
3291
|
bundle: t,
|
|
3181
3292
|
mode: n,
|
|
3182
3293
|
style: r
|
|
3183
3294
|
}));
|
|
3184
3295
|
}
|
|
3185
|
-
function
|
|
3296
|
+
function Xt(e, { mode: t = "auto", lang: n } = {}) {
|
|
3186
3297
|
let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
|
|
3187
3298
|
"<meta charset=\"utf-8\"/>",
|
|
3188
3299
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
@@ -3199,10 +3310,10 @@ function qt(e, { mode: t = "auto", lang: n } = {}) {
|
|
|
3199
3310
|
${c}
|
|
3200
3311
|
</head>
|
|
3201
3312
|
<body>
|
|
3202
|
-
${
|
|
3313
|
+
${Yt(e, { mode: t })}
|
|
3203
3314
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
3204
3315
|
</body>
|
|
3205
3316
|
</html>`;
|
|
3206
3317
|
}
|
|
3207
3318
|
//#endregion
|
|
3208
|
-
export {
|
|
3319
|
+
export { Kt as assembleBundle, Jt as fetchPage, Yt as renderBundleHtml, Xt as renderPageDocument };
|