webim-adapter 0.1.0 → 0.3.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 +877 -450
- package/build/webim-embed.js +10 -8
- package/build/webim-ssr.js +876 -449
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { Fragment as e, createContext as t, useContext as n, useEffect as r,
|
|
2
|
-
import { Fragment as
|
|
1
|
+
import { Fragment as e, createContext as t, useContext as n, useEffect as r, useMemo as i, useRef as a, useState as o } from "react";
|
|
2
|
+
import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
3
3
|
//#region ../ui/src/components/builder/styles.js
|
|
4
|
-
var
|
|
4
|
+
var u = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.top.right.bottom.left".split(".")), d = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, f = [
|
|
5
5
|
"borderWidth",
|
|
6
6
|
"borderStyle",
|
|
7
7
|
"borderColor",
|
|
8
8
|
"borderRadius",
|
|
9
9
|
"gap"
|
|
10
10
|
];
|
|
11
|
-
function
|
|
11
|
+
function p(e) {
|
|
12
12
|
let t = {};
|
|
13
|
-
for (let n of
|
|
13
|
+
for (let n of f) {
|
|
14
14
|
let r = e?.[n];
|
|
15
|
-
r != null && r !== "" && (t[n] =
|
|
15
|
+
r != null && r !== "" && (t[n] = u.has(n) ? d(r) : r);
|
|
16
16
|
}
|
|
17
|
-
for (let [n, r] of Object.entries(e || {})) r == null || r === "" ||
|
|
17
|
+
for (let [n, r] of Object.entries(e || {})) r == null || r === "" || f.includes(n) || (t[n] = u.has(n) ? d(r) : r);
|
|
18
18
|
let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
|
|
19
19
|
delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
|
|
20
|
-
let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur:
|
|
20
|
+
let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: p } = t;
|
|
21
21
|
delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
|
|
22
|
-
let m = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${
|
|
22
|
+
let m = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${d(e.x ?? 0)} ${d(e.y ?? 0)} ${d(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
|
|
23
23
|
[
|
|
24
24
|
s,
|
|
25
25
|
c,
|
|
26
|
-
|
|
26
|
+
l,
|
|
27
27
|
p
|
|
28
|
-
].some((e) => e !== void 0) && m.push(`${
|
|
29
|
-
let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${
|
|
28
|
+
].some((e) => e !== void 0) && m.push(`${d(s ?? 0)} ${d(c ?? 0)} ${d(l ?? 0)} ${p || "rgba(0, 0, 0, 0.35)"}`), m.length && (t.textShadow = m.join(", "));
|
|
29
|
+
let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${d(e.x ?? 0)}, ${d(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${h(e.a ?? 0)})` : e.type === "skew" ? `skew(${h(e.x ?? 0)}, ${h(e.y ?? 0)})` : null, { transforms: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY: C } = t;
|
|
30
30
|
delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
|
|
31
31
|
let w = (Array.isArray(_) ? _ : []).filter((e) => e && e.on !== !1).map(g).filter(Boolean);
|
|
32
|
-
(v !== void 0 || y !== void 0) && w.push(`translate(${
|
|
33
|
-
let T = (e) => `${e.inset ? "inset " : ""}${
|
|
32
|
+
(v !== void 0 || y !== void 0) && w.push(`translate(${d(v ?? 0)}, ${d(y ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), x !== void 0 && w.push(`rotate(${h(x)})`), (S !== void 0 || C !== void 0) && w.push(`skew(${h(S ?? 0)}, ${h(C ?? 0)})`), w.length && (t.transform = w.join(" "));
|
|
33
|
+
let T = (e) => `${e.inset ? "inset " : ""}${d(e.x ?? 0)} ${d(e.y ?? 0)} ${d(e.blur ?? 0)} ${d(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: E, boxShadowX: D, boxShadowY: O, boxShadowBlur: k, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
|
|
34
34
|
delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
|
|
35
35
|
let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
|
|
36
36
|
[
|
|
@@ -48,79 +48,110 @@ function f(e) {
|
|
|
48
48
|
color: j,
|
|
49
49
|
inset: M
|
|
50
50
|
})), N.length && (t.boxShadow = N.join(", "));
|
|
51
|
-
let ee = (e) => e.type === "blur" ? `blur(${
|
|
51
|
+
let ee = (e) => e.type === "blur" ? `blur(${d(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, P = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(ee), { filters: F, backdropFilters: te, filterBlur: I, filterGrayscale: L, filterBrightness: ne, filterContrast: re, filterSaturate: R } = t;
|
|
52
52
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
53
|
-
let z =
|
|
54
|
-
|
|
55
|
-
let
|
|
56
|
-
|
|
57
|
-
let { textStrokeWidth:
|
|
58
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
59
|
-
let { clipText:
|
|
60
|
-
delete t.clipText,
|
|
61
|
-
let { transitions:
|
|
53
|
+
let z = P(F);
|
|
54
|
+
I !== void 0 && z.push(`blur(${d(I)})`), L !== void 0 && z.push(`grayscale(${L}%)`), ne !== void 0 && z.push(`brightness(${ne}%)`), re !== void 0 && z.push(`contrast(${re}%)`), R !== void 0 && z.push(`saturate(${R}%)`), z.length && (t.filter = z.join(" "));
|
|
55
|
+
let B = P(te);
|
|
56
|
+
B.length && (t.backdropFilter = B.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
57
|
+
let { textStrokeWidth: V, textStrokeColor: H } = t;
|
|
58
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (V !== void 0 || H !== void 0) && (t.WebkitTextStroke = `${d(V ?? 1)} ${H || "currentColor"}`);
|
|
59
|
+
let { clipText: ie } = t;
|
|
60
|
+
delete t.clipText, ie && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
61
|
+
let { transitions: U, transitionDuration: W, transitionEasing: G, transitionProperty: ae } = t, K = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
62
62
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
63
|
-
let
|
|
64
|
-
if (
|
|
63
|
+
let q = (Array.isArray(U) ? U : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${K(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
64
|
+
if (W !== void 0 && q.push(`${ae || "all"} ${K(W)} ${G || "ease"}`), q.length && (t.transition = q.join(", ")), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
65
65
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
66
66
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
67
67
|
}
|
|
68
68
|
delete t.backgroundVideo;
|
|
69
|
-
let { overlayColor:
|
|
70
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
71
|
-
let e = `color-mix(in srgb, ${
|
|
69
|
+
let { overlayColor: J, overlayOpacity: oe } = t;
|
|
70
|
+
if (delete t.overlayColor, delete t.overlayOpacity, J) {
|
|
71
|
+
let e = `color-mix(in srgb, ${J} ${oe ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
72
72
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
73
73
|
}
|
|
74
74
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
75
|
-
let { backgroundLayers:
|
|
75
|
+
let { backgroundLayers: se } = t;
|
|
76
76
|
delete t.backgroundLayers;
|
|
77
|
-
let
|
|
78
|
-
if (
|
|
77
|
+
let Y = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1);
|
|
78
|
+
if (Y.length) {
|
|
79
79
|
let e = [], n = [], r = [], i = [], a = [];
|
|
80
|
-
for (let t of
|
|
80
|
+
for (let t of Y) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
81
81
|
else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
82
82
|
else {
|
|
83
83
|
if (!t.src) continue;
|
|
84
|
-
e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${
|
|
84
|
+
e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${d(t.w ?? "auto")} ${d(t.h ?? "auto")}` : t.size || "cover"), r.push(`${d(t.posX ?? 0)} ${d(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
|
|
85
85
|
}
|
|
86
86
|
e.length && (t.backgroundImage && (e.push(t.backgroundImage), n.push(t.backgroundSize || "cover"), r.push(t.backgroundPosition || "center"), i.push(t.backgroundRepeat || "no-repeat"), a.push("scroll")), t.backgroundImage = e.join(", "), t.backgroundSize = n.join(", "), t.backgroundPosition = r.join(", "), t.backgroundRepeat = i.join(", "), t.backgroundAttachment = a.join(", "));
|
|
87
87
|
}
|
|
88
88
|
return t;
|
|
89
89
|
}
|
|
90
|
-
var
|
|
90
|
+
var m = {
|
|
91
91
|
hover: ":hover",
|
|
92
92
|
pressed: ":active",
|
|
93
93
|
focused: ":focus"
|
|
94
|
-
},
|
|
94
|
+
}, h = /* @__PURE__ */ new Set([
|
|
95
95
|
"style",
|
|
96
96
|
"class",
|
|
97
97
|
"id",
|
|
98
98
|
"data-wb",
|
|
99
99
|
"data-wb-class",
|
|
100
100
|
"data-slot"
|
|
101
|
-
]),
|
|
102
|
-
function
|
|
101
|
+
]), g = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !h.has(e.toLowerCase());
|
|
102
|
+
function _(e, t, n = []) {
|
|
103
103
|
t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
|
|
104
104
|
for (let t of n) e.removeAttribute(t);
|
|
105
105
|
let r = [];
|
|
106
106
|
for (let n of t.attributes ?? []) {
|
|
107
107
|
let t = String(n?.name ?? "").trim();
|
|
108
|
-
|
|
108
|
+
g(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
|
|
109
109
|
}
|
|
110
110
|
return r;
|
|
111
111
|
}
|
|
112
|
-
var
|
|
113
|
-
function
|
|
114
|
-
let i = Object.entries(
|
|
112
|
+
var v = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
113
|
+
function y(e, t, n, r = !1) {
|
|
114
|
+
let i = Object.entries(p(t)).map(([e, t]) => `${v(e)}: ${t} !important;`).join(" ");
|
|
115
115
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
return Object.entries(
|
|
117
|
+
function b(e, t, n) {
|
|
118
|
+
return Object.entries(m).map(([r, i]) => y(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
119
119
|
}
|
|
120
|
-
|
|
120
|
+
var x = [
|
|
121
|
+
{
|
|
122
|
+
key: "tablet",
|
|
123
|
+
max: 991
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
key: "mobileLandscape",
|
|
127
|
+
max: 767
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
key: "mobile",
|
|
131
|
+
max: 478
|
|
132
|
+
}
|
|
133
|
+
], S = (e) => Object.entries(p(e)).map(([e, t]) => `${v(e)}: ${t} !important;`).join(" ");
|
|
134
|
+
function C(e, t) {
|
|
135
|
+
return x.map(({ key: n, max: r }) => {
|
|
136
|
+
let i = t?.[n] ? S(t[n]) : "";
|
|
137
|
+
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
138
|
+
}).filter(Boolean).join("\n");
|
|
139
|
+
}
|
|
140
|
+
function w(e, t) {
|
|
141
|
+
let n = [], r = (e) => {
|
|
142
|
+
for (let [t, r] of Object.entries(e || {})) {
|
|
143
|
+
let e = C(t, r.props);
|
|
144
|
+
e && n.push(e);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
r(e);
|
|
148
|
+
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
149
|
+
return n.join("\n");
|
|
150
|
+
}
|
|
151
|
+
function T(e, t) {
|
|
121
152
|
let n = [], r = (e) => {
|
|
122
153
|
for (let [t, r] of Object.entries(e || {})) {
|
|
123
|
-
let e =
|
|
154
|
+
let e = b(t, r.props);
|
|
124
155
|
e && n.push(e);
|
|
125
156
|
}
|
|
126
157
|
};
|
|
@@ -128,7 +159,7 @@ function b(e, t) {
|
|
|
128
159
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
129
160
|
return n.join("\n");
|
|
130
161
|
}
|
|
131
|
-
var
|
|
162
|
+
var E = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", D = {
|
|
132
163
|
light: {
|
|
133
164
|
background: "#ffffff",
|
|
134
165
|
text: "#111827",
|
|
@@ -165,23 +196,23 @@ var x = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
165
196
|
contrastText: "#052e2b"
|
|
166
197
|
}
|
|
167
198
|
}
|
|
168
|
-
},
|
|
199
|
+
}, O = {
|
|
169
200
|
font: "system",
|
|
170
201
|
headingFont: "inherit",
|
|
171
|
-
light:
|
|
172
|
-
dark:
|
|
173
|
-
},
|
|
202
|
+
light: D.light,
|
|
203
|
+
dark: D.dark
|
|
204
|
+
}, k = {
|
|
174
205
|
system: {
|
|
175
206
|
label: "System",
|
|
176
|
-
value:
|
|
207
|
+
value: E
|
|
177
208
|
},
|
|
178
209
|
inter: {
|
|
179
210
|
label: "Inter",
|
|
180
|
-
value: `"Inter", ${
|
|
211
|
+
value: `"Inter", ${E}`
|
|
181
212
|
},
|
|
182
213
|
outfit: {
|
|
183
214
|
label: "Outfit",
|
|
184
|
-
value: `"Outfit", ${
|
|
215
|
+
value: `"Outfit", ${E}`
|
|
185
216
|
},
|
|
186
217
|
serif: {
|
|
187
218
|
label: "Serif",
|
|
@@ -191,7 +222,7 @@ var x = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
191
222
|
label: "Mono",
|
|
192
223
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
193
224
|
}
|
|
194
|
-
},
|
|
225
|
+
}, A = (e, t) => k[e]?.value ?? t, j = (e, ...t) => {
|
|
195
226
|
let n = Object.assign({}, e, ...t);
|
|
196
227
|
return n.primary = {
|
|
197
228
|
...e.primary,
|
|
@@ -207,16 +238,16 @@ var x = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
207
238
|
}), {})
|
|
208
239
|
}, n;
|
|
209
240
|
};
|
|
210
|
-
function
|
|
241
|
+
function M(e) {
|
|
211
242
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
212
243
|
return {
|
|
213
|
-
font: r ??
|
|
214
|
-
headingFont: i ??
|
|
215
|
-
light:
|
|
216
|
-
dark:
|
|
244
|
+
font: r ?? O.font,
|
|
245
|
+
headingFont: i ?? O.headingFont,
|
|
246
|
+
light: j(D.light, a, t),
|
|
247
|
+
dark: j(D.dark, n)
|
|
217
248
|
};
|
|
218
249
|
}
|
|
219
|
-
function
|
|
250
|
+
function N(e) {
|
|
220
251
|
return {
|
|
221
252
|
"--page-bg": e.background,
|
|
222
253
|
"--page-text": e.text,
|
|
@@ -232,28 +263,28 @@ function O(e) {
|
|
|
232
263
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
233
264
|
};
|
|
234
265
|
}
|
|
235
|
-
function
|
|
236
|
-
let t =
|
|
266
|
+
function ee(e) {
|
|
267
|
+
let t = M(e);
|
|
237
268
|
return {
|
|
238
269
|
backgroundColor: "var(--page-bg)",
|
|
239
270
|
color: "var(--page-text)",
|
|
240
|
-
fontFamily:
|
|
241
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
271
|
+
fontFamily: A(t.font, E),
|
|
272
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : A(t.headingFont, "inherit")
|
|
242
273
|
};
|
|
243
274
|
}
|
|
244
|
-
function
|
|
245
|
-
let n =
|
|
275
|
+
function P(e, t = "light") {
|
|
276
|
+
let n = M(e);
|
|
246
277
|
return {
|
|
247
|
-
...
|
|
248
|
-
...
|
|
278
|
+
...ee(e),
|
|
279
|
+
...N(n[t] ?? n.light)
|
|
249
280
|
};
|
|
250
281
|
}
|
|
251
|
-
function
|
|
282
|
+
function F(e, t) {
|
|
252
283
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
253
284
|
}
|
|
254
285
|
//#endregion
|
|
255
286
|
//#region src/bundle.js
|
|
256
|
-
function
|
|
287
|
+
function te({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
257
288
|
let a = {
|
|
258
289
|
...t?.global ?? {},
|
|
259
290
|
...t?.tenant ?? {}
|
|
@@ -263,7 +294,7 @@ function M({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
263
294
|
title: e.title,
|
|
264
295
|
slug: e.slug,
|
|
265
296
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
266
|
-
theme:
|
|
297
|
+
theme: F(o, a.builder_themes?.themes),
|
|
267
298
|
components: a.builder_components?.components ?? {},
|
|
268
299
|
custom: o.custom,
|
|
269
300
|
seo: o.seo,
|
|
@@ -274,22 +305,26 @@ function M({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
274
305
|
}
|
|
275
306
|
//#endregion
|
|
276
307
|
//#region src/fetchPage.js
|
|
277
|
-
var
|
|
308
|
+
var I = async (e) => {
|
|
278
309
|
let t = await e.json().catch(() => null);
|
|
279
310
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
280
311
|
return t?.payload ?? t;
|
|
281
312
|
};
|
|
282
|
-
async function
|
|
313
|
+
async function L({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
|
|
283
314
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
284
315
|
if (!n) throw Error("fetchPage: slug is required");
|
|
285
|
-
let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(
|
|
286
|
-
return M({
|
|
316
|
+
let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(I), o(`${s}/settings/public`, { headers: c }).then(I)]), d = te({
|
|
287
317
|
page: l,
|
|
288
318
|
settings: u,
|
|
289
319
|
tenant: t,
|
|
290
320
|
apiUrl: s,
|
|
291
321
|
locale: r
|
|
292
|
-
});
|
|
322
|
+
}), f = [...new Set(Object.values(d.blocks ?? {}).filter((e) => e?.type?.resolvedName === "CollectionList" && e.props?.collection).map((e) => e.props.collection))];
|
|
323
|
+
if (f.length) {
|
|
324
|
+
let e = (e) => e.startsWith("api:") ? `${s}/data/${encodeURIComponent(e.slice(4))}` : `${s}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(f.map((t) => o(e(t), { headers: c }).then(I).then((e) => [t, Array.isArray(e) ? e : []]).catch(() => [t, []])));
|
|
325
|
+
d.datasets = Object.fromEntries(t);
|
|
326
|
+
}
|
|
327
|
+
return d;
|
|
293
328
|
}
|
|
294
329
|
new Map([
|
|
295
330
|
{
|
|
@@ -397,14 +432,14 @@ new Map([
|
|
|
397
432
|
fallback: "sans-serif"
|
|
398
433
|
}
|
|
399
434
|
].map((e) => [e.family, e]));
|
|
400
|
-
function
|
|
435
|
+
function ne(e) {
|
|
401
436
|
return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
|
|
402
437
|
}
|
|
403
|
-
var
|
|
438
|
+
var re = (e) => ne([e]), R = (e) => {
|
|
404
439
|
let t = typeof e == "string" && e.match(/^"([^"]+)"/);
|
|
405
440
|
return t ? t[1] : null;
|
|
406
441
|
};
|
|
407
|
-
function
|
|
442
|
+
function z(e, t) {
|
|
408
443
|
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
409
444
|
for (let t of Object.values(e || {})) for (let e of [
|
|
410
445
|
"style",
|
|
@@ -412,7 +447,7 @@ function P(e, t) {
|
|
|
412
447
|
"pressed",
|
|
413
448
|
"focused"
|
|
414
449
|
]) {
|
|
415
|
-
let r =
|
|
450
|
+
let r = R(t.props?.[e]?.fontFamily);
|
|
416
451
|
r && n.add(r);
|
|
417
452
|
}
|
|
418
453
|
};
|
|
@@ -422,30 +457,53 @@ function P(e, t) {
|
|
|
422
457
|
}
|
|
423
458
|
//#endregion
|
|
424
459
|
//#region ../ui/src/components/builder/views.jsx
|
|
425
|
-
var
|
|
460
|
+
var B = t({
|
|
426
461
|
tenant: "",
|
|
427
462
|
apiUrl: "/api"
|
|
428
|
-
}),
|
|
463
|
+
}), V = t(null), H = t(null), ie = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
464
|
+
function U(e, t) {
|
|
465
|
+
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
466
|
+
}
|
|
467
|
+
var W = (e) => {
|
|
468
|
+
let t = [];
|
|
469
|
+
for (let [n, r] of Object.entries(e ?? {})) {
|
|
470
|
+
if (!/^[\w-]+$/.test(n)) continue;
|
|
471
|
+
t.push(n);
|
|
472
|
+
let e = Array.isArray(r) ? r[0] : r, i = Array.isArray(r) ? `${n}.0` : n;
|
|
473
|
+
if (e && typeof e == "object" && !Array.isArray(e)) for (let n of Object.keys(e)) /^[\w-]+$/.test(n) && t.push(`${i}.${n}`);
|
|
474
|
+
}
|
|
475
|
+
return t;
|
|
476
|
+
};
|
|
477
|
+
function G(e) {
|
|
478
|
+
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : "").filter(Boolean).join(" ") : "";
|
|
479
|
+
}
|
|
480
|
+
function ae(e, t) {
|
|
481
|
+
let n = t?.data ?? {}, r = W(n);
|
|
482
|
+
if (!r.length) return e;
|
|
483
|
+
let i = RegExp(`:(${r.map(ie).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => G(U(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
484
|
+
return a(e);
|
|
485
|
+
}
|
|
486
|
+
var K = {
|
|
429
487
|
margin: 0,
|
|
430
488
|
fontWeight: 700,
|
|
431
489
|
lineHeight: 1.2,
|
|
432
490
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
433
|
-
},
|
|
491
|
+
}, q = { margin: 0 }, J = {
|
|
434
492
|
display: "inline-block",
|
|
435
493
|
textDecoration: "none",
|
|
436
494
|
cursor: "pointer",
|
|
437
495
|
backgroundColor: "var(--page-accent, #111827)",
|
|
438
496
|
color: "var(--page-accent-text, #ffffff)"
|
|
439
|
-
},
|
|
497
|
+
}, oe = {
|
|
440
498
|
flexGrow: 1,
|
|
441
499
|
display: "flex",
|
|
442
500
|
flexDirection: "column",
|
|
443
501
|
position: "relative"
|
|
444
|
-
},
|
|
502
|
+
}, se = {
|
|
445
503
|
display: "flex",
|
|
446
504
|
flexDirection: "column"
|
|
447
505
|
};
|
|
448
|
-
function
|
|
506
|
+
function Y({ style: e }) {
|
|
449
507
|
let t = e?.backgroundVideo;
|
|
450
508
|
if (!t) return null;
|
|
451
509
|
let n = {
|
|
@@ -456,7 +514,7 @@ function B({ style: e }) {
|
|
|
456
514
|
zIndex: -1,
|
|
457
515
|
pointerEvents: "none"
|
|
458
516
|
}, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
|
|
459
|
-
return /* @__PURE__ */
|
|
517
|
+
return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("video", {
|
|
460
518
|
src: t,
|
|
461
519
|
autoPlay: !0,
|
|
462
520
|
muted: !0,
|
|
@@ -466,93 +524,100 @@ function B({ style: e }) {
|
|
|
466
524
|
...n,
|
|
467
525
|
objectFit: "cover"
|
|
468
526
|
}
|
|
469
|
-
}), r && /* @__PURE__ */
|
|
527
|
+
}), r && /* @__PURE__ */ c("div", { style: {
|
|
470
528
|
...n,
|
|
471
529
|
background: r
|
|
472
530
|
} })] });
|
|
473
531
|
}
|
|
474
|
-
var
|
|
532
|
+
var ce = (e, t) => e?.backgroundVideo ? {
|
|
475
533
|
position: "relative",
|
|
476
534
|
...t,
|
|
477
|
-
...
|
|
535
|
+
...p(e)
|
|
478
536
|
} : {
|
|
479
537
|
...t,
|
|
480
|
-
...
|
|
538
|
+
...p(e)
|
|
481
539
|
};
|
|
482
|
-
function
|
|
483
|
-
return /* @__PURE__ */
|
|
540
|
+
function le({ style: e, nodeRef: t, children: n }) {
|
|
541
|
+
return /* @__PURE__ */ l("div", {
|
|
484
542
|
ref: t,
|
|
485
543
|
style: {
|
|
486
|
-
...
|
|
487
|
-
...
|
|
544
|
+
...oe,
|
|
545
|
+
...p(e)
|
|
488
546
|
},
|
|
489
|
-
children: [/* @__PURE__ */
|
|
547
|
+
children: [/* @__PURE__ */ c(Y, { style: e }), n]
|
|
490
548
|
});
|
|
491
549
|
}
|
|
492
|
-
function
|
|
493
|
-
return /* @__PURE__ */
|
|
550
|
+
function ue({ style: e, nodeRef: t, children: n }) {
|
|
551
|
+
return /* @__PURE__ */ l("section", {
|
|
494
552
|
ref: t,
|
|
495
|
-
style:
|
|
496
|
-
children: [/* @__PURE__ */
|
|
553
|
+
style: ce(e, se),
|
|
554
|
+
children: [/* @__PURE__ */ c(Y, { style: e }), n]
|
|
497
555
|
});
|
|
498
556
|
}
|
|
499
|
-
function
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
557
|
+
function de({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
558
|
+
let i = t ? {
|
|
559
|
+
position: "relative",
|
|
560
|
+
minHeight: 240
|
|
561
|
+
} : null;
|
|
562
|
+
return /* @__PURE__ */ l("div", {
|
|
563
|
+
ref: n,
|
|
564
|
+
style: i ? {
|
|
565
|
+
...i,
|
|
566
|
+
...ce(e)
|
|
567
|
+
} : ce(e),
|
|
568
|
+
children: [/* @__PURE__ */ c(Y, { style: e }), r]
|
|
504
569
|
});
|
|
505
570
|
}
|
|
506
|
-
function
|
|
507
|
-
return /* @__PURE__ */
|
|
571
|
+
function fe({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
572
|
+
return /* @__PURE__ */ c(n, {
|
|
508
573
|
ref: a,
|
|
509
574
|
style: {
|
|
510
|
-
...
|
|
511
|
-
...
|
|
575
|
+
...K,
|
|
576
|
+
...p(r)
|
|
512
577
|
},
|
|
513
|
-
children:
|
|
578
|
+
children: X(t, e, i)
|
|
514
579
|
});
|
|
515
580
|
}
|
|
516
|
-
var
|
|
517
|
-
fontFamily:
|
|
581
|
+
var pe = {
|
|
582
|
+
fontFamily: k.mono.value,
|
|
518
583
|
background: "rgba(148, 163, 184, 0.18)",
|
|
519
584
|
padding: "1px 5px",
|
|
520
585
|
borderRadius: 4,
|
|
521
586
|
fontSize: "0.9em"
|
|
522
587
|
};
|
|
523
|
-
function
|
|
588
|
+
function me(e, t = [], n) {
|
|
524
589
|
let r = e;
|
|
525
|
-
return t.includes("sup") ? r = /* @__PURE__ */
|
|
526
|
-
style:
|
|
590
|
+
return t.includes("sup") ? r = /* @__PURE__ */ c("sup", { children: r }) : t.includes("sub") && (r = /* @__PURE__ */ c("sub", { children: r })), t.includes("code") && (r = /* @__PURE__ */ c("code", {
|
|
591
|
+
style: pe,
|
|
527
592
|
children: r
|
|
528
|
-
})), t.includes("strike") && (r = /* @__PURE__ */
|
|
593
|
+
})), t.includes("strike") && (r = /* @__PURE__ */ c("s", { children: r })), t.includes("underline") && (r = /* @__PURE__ */ c("u", { children: r })), t.includes("italic") && (r = /* @__PURE__ */ c("em", { children: r })), t.includes("bold") && (r = /* @__PURE__ */ c("strong", { children: r })), n && (r = /* @__PURE__ */ c("a", {
|
|
529
594
|
href: n,
|
|
530
595
|
style: { color: "inherit" },
|
|
531
596
|
children: r
|
|
532
597
|
})), r;
|
|
533
598
|
}
|
|
534
|
-
function
|
|
599
|
+
function X(t, n, r) {
|
|
535
600
|
return t?.length ? t.map((t, n) => {
|
|
536
|
-
if (t.slot) return /* @__PURE__ */
|
|
537
|
-
if (t.parts) return /* @__PURE__ */
|
|
601
|
+
if (t.slot) return /* @__PURE__ */ c(e, { children: r?.[t.slot] ?? null }, n);
|
|
602
|
+
if (t.parts) return /* @__PURE__ */ c(e, { children: X(t.parts, "", r) }, n);
|
|
538
603
|
let i = t.text;
|
|
539
|
-
return t.sup ? i = /* @__PURE__ */
|
|
540
|
-
style:
|
|
604
|
+
return t.sup ? i = /* @__PURE__ */ c("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ c("sub", { children: i })), t.code && (i = /* @__PURE__ */ c("code", {
|
|
605
|
+
style: pe,
|
|
541
606
|
children: i
|
|
542
|
-
})), t.strike && (i = /* @__PURE__ */
|
|
607
|
+
})), t.strike && (i = /* @__PURE__ */ c("s", { children: i })), t.underline && (i = /* @__PURE__ */ c("u", { children: i })), t.italic && (i = /* @__PURE__ */ c("em", { children: i })), t.bold && (i = /* @__PURE__ */ c("strong", { children: i })), t.href && (i = /* @__PURE__ */ c("a", {
|
|
543
608
|
href: t.href,
|
|
544
609
|
style: { color: "inherit" },
|
|
545
610
|
children: i
|
|
546
|
-
})), /* @__PURE__ */
|
|
611
|
+
})), /* @__PURE__ */ c(e, { children: i }, n);
|
|
547
612
|
}) : n;
|
|
548
613
|
}
|
|
549
|
-
function
|
|
550
|
-
return /* @__PURE__ */
|
|
551
|
-
style:
|
|
552
|
-
children: e?.length ?
|
|
614
|
+
function he({ parts: e, text: t, marks: n, href: r, style: i }) {
|
|
615
|
+
return /* @__PURE__ */ c("span", {
|
|
616
|
+
style: p(i),
|
|
617
|
+
children: e?.length ? X(e, t) : me(t, n, r)
|
|
553
618
|
});
|
|
554
619
|
}
|
|
555
|
-
var
|
|
620
|
+
var ge = {
|
|
556
621
|
h1: 40,
|
|
557
622
|
h2: 32,
|
|
558
623
|
h3: 26,
|
|
@@ -560,7 +625,7 @@ var J = {
|
|
|
560
625
|
h5: 19,
|
|
561
626
|
h6: 16
|
|
562
627
|
};
|
|
563
|
-
function
|
|
628
|
+
function _e({ align: e = "center", width: t } = {}) {
|
|
564
629
|
let n = t ? `${t}%` : void 0;
|
|
565
630
|
return e === "full" ? { width: "100%" } : e === "left" ? {
|
|
566
631
|
float: "left",
|
|
@@ -583,8 +648,8 @@ function Y({ align: e = "center", width: t } = {}) {
|
|
|
583
648
|
marginRight: "auto"
|
|
584
649
|
};
|
|
585
650
|
}
|
|
586
|
-
function
|
|
587
|
-
let r = n ?? ((e, n) =>
|
|
651
|
+
function ve(e = [], t, n) {
|
|
652
|
+
let r = n ?? ((e, n) => X(e, n, t));
|
|
588
653
|
return e.map((t, n) => {
|
|
589
654
|
let i = {
|
|
590
655
|
marginTop: 0,
|
|
@@ -592,7 +657,7 @@ function X(e = [], t, n) {
|
|
|
592
657
|
};
|
|
593
658
|
if (t.type === "image") {
|
|
594
659
|
if (!t.src) return null;
|
|
595
|
-
let e = /* @__PURE__ */
|
|
660
|
+
let e = /* @__PURE__ */ c("img", {
|
|
596
661
|
src: t.src,
|
|
597
662
|
alt: t.alt || "",
|
|
598
663
|
style: {
|
|
@@ -601,18 +666,18 @@ function X(e = [], t, n) {
|
|
|
601
666
|
borderRadius: 6
|
|
602
667
|
}
|
|
603
668
|
});
|
|
604
|
-
return /* @__PURE__ */
|
|
669
|
+
return /* @__PURE__ */ l("figure", {
|
|
605
670
|
style: {
|
|
606
671
|
marginLeft: 0,
|
|
607
672
|
marginRight: 0,
|
|
608
673
|
...i,
|
|
609
|
-
...
|
|
674
|
+
..._e(t)
|
|
610
675
|
},
|
|
611
|
-
children: [t.href ? /* @__PURE__ */
|
|
676
|
+
children: [t.href ? /* @__PURE__ */ c("a", {
|
|
612
677
|
href: t.href,
|
|
613
678
|
style: { display: "block" },
|
|
614
679
|
children: e
|
|
615
|
-
}) : e, t.caption && /* @__PURE__ */
|
|
680
|
+
}) : e, t.caption && /* @__PURE__ */ c("figcaption", {
|
|
616
681
|
style: {
|
|
617
682
|
fontSize: 13,
|
|
618
683
|
opacity: .65,
|
|
@@ -623,15 +688,15 @@ function X(e = [], t, n) {
|
|
|
623
688
|
})]
|
|
624
689
|
}, n);
|
|
625
690
|
}
|
|
626
|
-
if (t.type === "video") return
|
|
691
|
+
if (t.type === "video") return ke(t.url) ? /* @__PURE__ */ c("div", {
|
|
627
692
|
style: {
|
|
628
693
|
...i,
|
|
629
|
-
...
|
|
694
|
+
..._e({
|
|
630
695
|
align: t.align,
|
|
631
696
|
width: t.width ?? 100
|
|
632
697
|
})
|
|
633
698
|
},
|
|
634
|
-
children: /* @__PURE__ */
|
|
699
|
+
children: /* @__PURE__ */ c(Ae, {
|
|
635
700
|
url: t.url,
|
|
636
701
|
autoplay: t.autoplay,
|
|
637
702
|
muted: t.muted,
|
|
@@ -640,147 +705,147 @@ function X(e = [], t, n) {
|
|
|
640
705
|
start: t.start
|
|
641
706
|
})
|
|
642
707
|
}, n) : null;
|
|
643
|
-
if (t.type === "divider") return /* @__PURE__ */
|
|
708
|
+
if (t.type === "divider") return /* @__PURE__ */ c("hr", { style: {
|
|
644
709
|
...i,
|
|
645
710
|
border: 0,
|
|
646
711
|
borderTop: "1px solid rgba(148, 163, 184, 0.4)"
|
|
647
712
|
} }, n);
|
|
648
713
|
if (t.type === "ul" || t.type === "ol") {
|
|
649
714
|
let e = t.type;
|
|
650
|
-
return /* @__PURE__ */
|
|
715
|
+
return /* @__PURE__ */ c(e, {
|
|
651
716
|
style: {
|
|
652
717
|
...i,
|
|
653
718
|
paddingLeft: 24
|
|
654
719
|
},
|
|
655
|
-
children: (t.items ?? []).map((e, t) => /* @__PURE__ */
|
|
720
|
+
children: (t.items ?? []).map((e, t) => /* @__PURE__ */ c("li", {
|
|
656
721
|
style: { marginBottom: 4 },
|
|
657
722
|
children: r(e.parts, e.text)
|
|
658
723
|
}, t))
|
|
659
724
|
}, n);
|
|
660
725
|
}
|
|
661
|
-
if (t.type === "quote") return /* @__PURE__ */
|
|
726
|
+
if (t.type === "quote") return /* @__PURE__ */ c("blockquote", {
|
|
662
727
|
style: {
|
|
663
|
-
...
|
|
728
|
+
...be,
|
|
664
729
|
...i
|
|
665
730
|
},
|
|
666
731
|
children: r(t.parts, t.text)
|
|
667
732
|
}, n);
|
|
668
|
-
if (
|
|
733
|
+
if (ge[t.type]) {
|
|
669
734
|
let e = t.type;
|
|
670
|
-
return /* @__PURE__ */
|
|
735
|
+
return /* @__PURE__ */ c(e, {
|
|
671
736
|
style: {
|
|
672
|
-
...
|
|
673
|
-
fontSize:
|
|
737
|
+
...K,
|
|
738
|
+
fontSize: ge[t.type],
|
|
674
739
|
...i
|
|
675
740
|
},
|
|
676
741
|
children: r(t.parts, t.text)
|
|
677
742
|
}, n);
|
|
678
743
|
}
|
|
679
|
-
return /* @__PURE__ */
|
|
744
|
+
return /* @__PURE__ */ c("p", {
|
|
680
745
|
style: {
|
|
681
|
-
...
|
|
746
|
+
...q,
|
|
682
747
|
...i
|
|
683
748
|
},
|
|
684
749
|
children: r(t.parts, t.text)
|
|
685
750
|
}, n);
|
|
686
751
|
});
|
|
687
752
|
}
|
|
688
|
-
function
|
|
689
|
-
return /* @__PURE__ */
|
|
753
|
+
function ye({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
754
|
+
return /* @__PURE__ */ c("div", {
|
|
690
755
|
ref: r,
|
|
691
756
|
style: {
|
|
692
757
|
display: "flow-root",
|
|
693
|
-
...
|
|
758
|
+
...p(t)
|
|
694
759
|
},
|
|
695
|
-
children:
|
|
760
|
+
children: ve(e, n)
|
|
696
761
|
});
|
|
697
762
|
}
|
|
698
|
-
var
|
|
763
|
+
var be = {
|
|
699
764
|
margin: 0,
|
|
700
765
|
padding: "8px 0 8px 20px",
|
|
701
766
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
702
767
|
};
|
|
703
|
-
function
|
|
704
|
-
return /* @__PURE__ */
|
|
768
|
+
function xe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
769
|
+
return /* @__PURE__ */ c("blockquote", {
|
|
705
770
|
ref: i,
|
|
706
771
|
style: {
|
|
707
|
-
...
|
|
708
|
-
...
|
|
772
|
+
...be,
|
|
773
|
+
...p(n)
|
|
709
774
|
},
|
|
710
|
-
children:
|
|
775
|
+
children: X(t, e, r)
|
|
711
776
|
});
|
|
712
777
|
}
|
|
713
|
-
function
|
|
714
|
-
return /* @__PURE__ */
|
|
778
|
+
function Se({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
779
|
+
return /* @__PURE__ */ c(e ? "ol" : "ul", {
|
|
715
780
|
ref: r,
|
|
716
781
|
style: {
|
|
717
782
|
margin: 0,
|
|
718
783
|
paddingLeft: 24,
|
|
719
|
-
...
|
|
784
|
+
...p(n)
|
|
720
785
|
},
|
|
721
|
-
children: t.map((e, t) => /* @__PURE__ */
|
|
786
|
+
children: t.map((e, t) => /* @__PURE__ */ c("li", {
|
|
722
787
|
style: { marginBottom: 4 },
|
|
723
|
-
children:
|
|
788
|
+
children: X(e.parts, e.text)
|
|
724
789
|
}, t))
|
|
725
790
|
});
|
|
726
791
|
}
|
|
727
|
-
function
|
|
728
|
-
return /* @__PURE__ */
|
|
792
|
+
function Ce({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
793
|
+
return /* @__PURE__ */ c("p", {
|
|
729
794
|
ref: i,
|
|
730
795
|
style: {
|
|
731
|
-
...
|
|
732
|
-
...
|
|
796
|
+
...q,
|
|
797
|
+
...p(n)
|
|
733
798
|
},
|
|
734
|
-
children:
|
|
799
|
+
children: X(t, e, r)
|
|
735
800
|
});
|
|
736
801
|
}
|
|
737
|
-
var
|
|
802
|
+
var we = {
|
|
738
803
|
color: "var(--page-accent, inherit)",
|
|
739
804
|
textDecoration: "underline",
|
|
740
805
|
textUnderlineOffset: 3,
|
|
741
806
|
cursor: "pointer"
|
|
742
807
|
};
|
|
743
|
-
function
|
|
744
|
-
return /* @__PURE__ */
|
|
808
|
+
function Te({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
809
|
+
return /* @__PURE__ */ c("a", {
|
|
745
810
|
ref: o,
|
|
746
811
|
href: n || "#",
|
|
747
812
|
target: r || void 0,
|
|
748
813
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
749
814
|
style: {
|
|
750
|
-
...
|
|
751
|
-
...
|
|
815
|
+
...we,
|
|
816
|
+
...p(i)
|
|
752
817
|
},
|
|
753
|
-
children:
|
|
818
|
+
children: X(t, e, a)
|
|
754
819
|
});
|
|
755
820
|
}
|
|
756
|
-
function
|
|
757
|
-
return /* @__PURE__ */
|
|
821
|
+
function Ee({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
822
|
+
return /* @__PURE__ */ c("a", {
|
|
758
823
|
ref: o,
|
|
759
824
|
href: n || "#",
|
|
760
825
|
target: r || void 0,
|
|
761
826
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
762
827
|
style: {
|
|
763
|
-
...
|
|
764
|
-
...
|
|
828
|
+
...J,
|
|
829
|
+
...p(i)
|
|
765
830
|
},
|
|
766
|
-
children:
|
|
831
|
+
children: X(t, e, a)
|
|
767
832
|
});
|
|
768
833
|
}
|
|
769
|
-
function
|
|
770
|
-
return e ? /* @__PURE__ */
|
|
834
|
+
function De({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
835
|
+
return e ? /* @__PURE__ */ c("img", {
|
|
771
836
|
ref: r,
|
|
772
837
|
src: e,
|
|
773
838
|
alt: t || "",
|
|
774
839
|
style: {
|
|
775
840
|
display: "block",
|
|
776
841
|
maxWidth: "100%",
|
|
777
|
-
...
|
|
842
|
+
...p(n)
|
|
778
843
|
}
|
|
779
844
|
}) : null;
|
|
780
845
|
}
|
|
781
|
-
function
|
|
782
|
-
return e ? /* @__PURE__ */
|
|
783
|
-
ref:
|
|
846
|
+
function Oe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
847
|
+
return e ? /* @__PURE__ */ c("video", {
|
|
848
|
+
ref: s,
|
|
784
849
|
src: e,
|
|
785
850
|
poster: t || void 0,
|
|
786
851
|
controls: n,
|
|
@@ -792,24 +857,24 @@ function ge({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
792
857
|
display: "block",
|
|
793
858
|
width: "100%",
|
|
794
859
|
maxWidth: "100%",
|
|
795
|
-
...
|
|
860
|
+
...p(o)
|
|
796
861
|
}
|
|
797
862
|
}) : null;
|
|
798
863
|
}
|
|
799
|
-
var
|
|
800
|
-
function
|
|
801
|
-
let l =
|
|
864
|
+
var ke = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
865
|
+
function Ae({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
866
|
+
let l = ke(e);
|
|
802
867
|
if (!l) return null;
|
|
803
868
|
let u = new URLSearchParams({ rel: "0" });
|
|
804
|
-
return t && u.set("autoplay", "1"), (n || t) && u.set("mute", "1"), i || u.set("controls", "0"), r && (u.set("loop", "1"), u.set("playlist", l)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */
|
|
805
|
-
ref:
|
|
869
|
+
return t && u.set("autoplay", "1"), (n || t) && u.set("mute", "1"), i || u.set("controls", "0"), r && (u.set("loop", "1"), u.set("playlist", l)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ c("div", {
|
|
870
|
+
ref: s,
|
|
806
871
|
style: {
|
|
807
872
|
position: "relative",
|
|
808
873
|
width: "100%",
|
|
809
874
|
paddingTop: "56.25%",
|
|
810
|
-
...
|
|
875
|
+
...p(o)
|
|
811
876
|
},
|
|
812
|
-
children: /* @__PURE__ */
|
|
877
|
+
children: /* @__PURE__ */ c("iframe", {
|
|
813
878
|
src: `https://www.youtube-nocookie.com/embed/${l}?${u}`,
|
|
814
879
|
title: "YouTube video",
|
|
815
880
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
@@ -824,8 +889,8 @@ function ve({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
824
889
|
})
|
|
825
890
|
});
|
|
826
891
|
}
|
|
827
|
-
function
|
|
828
|
-
return e ? /* @__PURE__ */
|
|
892
|
+
function je({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
893
|
+
return e ? /* @__PURE__ */ c("iframe", {
|
|
829
894
|
ref: i,
|
|
830
895
|
src: e,
|
|
831
896
|
title: t || "Embedded frame",
|
|
@@ -836,31 +901,31 @@ function ye({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
836
901
|
width: "100%",
|
|
837
902
|
height: 300,
|
|
838
903
|
border: 0,
|
|
839
|
-
...
|
|
904
|
+
...p(r)
|
|
840
905
|
}
|
|
841
906
|
}) : null;
|
|
842
907
|
}
|
|
843
|
-
function
|
|
844
|
-
let [
|
|
908
|
+
function Me({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
|
|
909
|
+
let [a, s] = o(null);
|
|
845
910
|
return r(() => {
|
|
846
|
-
|
|
911
|
+
a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
|
|
847
912
|
let t = document.createElement("script");
|
|
848
913
|
for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
|
|
849
914
|
t.text = e.textContent, e.replaceWith(t);
|
|
850
915
|
}));
|
|
851
916
|
}, [
|
|
852
|
-
|
|
917
|
+
a,
|
|
853
918
|
e,
|
|
854
919
|
t
|
|
855
|
-
]), /* @__PURE__ */
|
|
920
|
+
]), /* @__PURE__ */ c("div", {
|
|
856
921
|
ref: (e) => {
|
|
857
|
-
|
|
922
|
+
s(e), i && i(e);
|
|
858
923
|
},
|
|
859
|
-
style:
|
|
924
|
+
style: p(n)
|
|
860
925
|
});
|
|
861
926
|
}
|
|
862
|
-
function
|
|
863
|
-
return /* @__PURE__ */
|
|
927
|
+
function Ne({ height: e, nodeRef: t }) {
|
|
928
|
+
return /* @__PURE__ */ c("div", {
|
|
864
929
|
ref: t,
|
|
865
930
|
style: {
|
|
866
931
|
height: e || 32,
|
|
@@ -869,18 +934,18 @@ function xe({ height: e, nodeRef: t }) {
|
|
|
869
934
|
}
|
|
870
935
|
});
|
|
871
936
|
}
|
|
872
|
-
function
|
|
873
|
-
return /* @__PURE__ */
|
|
937
|
+
function Pe({ style: e, nodeRef: t }) {
|
|
938
|
+
return /* @__PURE__ */ c("div", {
|
|
874
939
|
ref: t,
|
|
875
940
|
style: {
|
|
876
941
|
height: 1,
|
|
877
942
|
alignSelf: "stretch",
|
|
878
943
|
flexShrink: 0,
|
|
879
|
-
...
|
|
944
|
+
...p(e)
|
|
880
945
|
}
|
|
881
946
|
});
|
|
882
947
|
}
|
|
883
|
-
var
|
|
948
|
+
var Fe = {
|
|
884
949
|
position: "absolute",
|
|
885
950
|
top: "50%",
|
|
886
951
|
transform: "translateY(-50%)",
|
|
@@ -897,7 +962,7 @@ var Ce = {
|
|
|
897
962
|
alignItems: "center",
|
|
898
963
|
justifyContent: "center",
|
|
899
964
|
padding: 0
|
|
900
|
-
},
|
|
965
|
+
}, Ie = {
|
|
901
966
|
bottom: {
|
|
902
967
|
inset: "auto 0 0 0",
|
|
903
968
|
padding: "40px 24px 20px",
|
|
@@ -916,9 +981,9 @@ var Ce = {
|
|
|
916
981
|
padding: 24,
|
|
917
982
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
918
983
|
}
|
|
919
|
-
},
|
|
920
|
-
function
|
|
921
|
-
let [m, h] =
|
|
984
|
+
}, Le = 48;
|
|
985
|
+
function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, height: a = 320, swipe: u = !0, style: d, nodeRef: f }) {
|
|
986
|
+
let [m, h] = o(0), [g, _] = o(!1), [v, y] = o(null), b = e ? Math.min(m, e - 1) : 0;
|
|
922
987
|
if (r(() => {
|
|
923
988
|
if (!n || g || v || e < 2) return;
|
|
924
989
|
let t = setInterval(() => h((t) => (t + 1) % e), Math.max(2, Number(i) || 5) * 1e3);
|
|
@@ -933,10 +998,10 @@ function Ee({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
933
998
|
let x = (t) => h((t + e) % e), S = () => {
|
|
934
999
|
if (!v) return;
|
|
935
1000
|
let { dx: e } = v;
|
|
936
|
-
y(null), e < -48 ? x(b + 1) : e >
|
|
1001
|
+
y(null), e < -48 ? x(b + 1) : e > Le && x(b - 1);
|
|
937
1002
|
};
|
|
938
|
-
return /* @__PURE__ */
|
|
939
|
-
ref:
|
|
1003
|
+
return /* @__PURE__ */ l("div", {
|
|
1004
|
+
ref: f,
|
|
940
1005
|
onMouseEnter: () => _(!0),
|
|
941
1006
|
onMouseLeave: () => _(!1),
|
|
942
1007
|
onPointerDown: u && e > 1 ? (e) => {
|
|
@@ -958,16 +1023,16 @@ function Ee({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
958
1023
|
touchAction: "pan-y",
|
|
959
1024
|
userSelect: v ? "none" : void 0,
|
|
960
1025
|
cursor: v ? "grabbing" : void 0,
|
|
961
|
-
...
|
|
1026
|
+
...p(d)
|
|
962
1027
|
},
|
|
963
|
-
children: [/* @__PURE__ */
|
|
1028
|
+
children: [/* @__PURE__ */ c("div", {
|
|
964
1029
|
style: {
|
|
965
1030
|
display: "flex",
|
|
966
|
-
height:
|
|
1031
|
+
height: a,
|
|
967
1032
|
transform: `translateX(calc(${-b * 100}% + ${v?.dx ?? 0}px))`,
|
|
968
1033
|
transition: v ? "none" : "transform 450ms ease"
|
|
969
1034
|
},
|
|
970
|
-
children: Array.from({ length: e }, (e, n) => /* @__PURE__ */
|
|
1035
|
+
children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ c("div", {
|
|
971
1036
|
style: {
|
|
972
1037
|
position: "relative",
|
|
973
1038
|
width: "100%",
|
|
@@ -976,28 +1041,28 @@ function Ee({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
976
1041
|
},
|
|
977
1042
|
children: t(n)
|
|
978
1043
|
}, n))
|
|
979
|
-
}), e > 1 && /* @__PURE__ */
|
|
980
|
-
/* @__PURE__ */
|
|
1044
|
+
}), e > 1 && /* @__PURE__ */ l(s, { children: [
|
|
1045
|
+
/* @__PURE__ */ c("button", {
|
|
981
1046
|
type: "button",
|
|
982
1047
|
"aria-label": "Previous slide",
|
|
983
1048
|
style: {
|
|
984
|
-
...
|
|
1049
|
+
...Fe,
|
|
985
1050
|
left: 12
|
|
986
1051
|
},
|
|
987
1052
|
onClick: () => x(b - 1),
|
|
988
1053
|
children: "‹"
|
|
989
1054
|
}),
|
|
990
|
-
/* @__PURE__ */
|
|
1055
|
+
/* @__PURE__ */ c("button", {
|
|
991
1056
|
type: "button",
|
|
992
1057
|
"aria-label": "Next slide",
|
|
993
1058
|
style: {
|
|
994
|
-
...
|
|
1059
|
+
...Fe,
|
|
995
1060
|
right: 12
|
|
996
1061
|
},
|
|
997
1062
|
onClick: () => x(b + 1),
|
|
998
1063
|
children: "›"
|
|
999
1064
|
}),
|
|
1000
|
-
/* @__PURE__ */
|
|
1065
|
+
/* @__PURE__ */ c("div", {
|
|
1001
1066
|
style: {
|
|
1002
1067
|
position: "absolute",
|
|
1003
1068
|
bottom: 10,
|
|
@@ -1007,7 +1072,7 @@ function Ee({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
1007
1072
|
justifyContent: "center",
|
|
1008
1073
|
gap: 6
|
|
1009
1074
|
},
|
|
1010
|
-
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */
|
|
1075
|
+
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ c("button", {
|
|
1011
1076
|
type: "button",
|
|
1012
1077
|
"aria-label": `Go to slide ${t + 1}`,
|
|
1013
1078
|
onClick: () => x(t),
|
|
@@ -1025,7 +1090,7 @@ function Ee({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
1025
1090
|
] })]
|
|
1026
1091
|
});
|
|
1027
1092
|
}
|
|
1028
|
-
var
|
|
1093
|
+
var ze = (e, t) => ({
|
|
1029
1094
|
position: "absolute",
|
|
1030
1095
|
inset: 0,
|
|
1031
1096
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1033,26 +1098,26 @@ var De = (e, t) => ({
|
|
|
1033
1098
|
backgroundSize: "cover",
|
|
1034
1099
|
backgroundPosition: "center"
|
|
1035
1100
|
});
|
|
1036
|
-
function
|
|
1037
|
-
return e.length ? /* @__PURE__ */
|
|
1101
|
+
function Be({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1102
|
+
return e.length ? /* @__PURE__ */ c(Re, {
|
|
1038
1103
|
...r,
|
|
1039
1104
|
count: e.length,
|
|
1040
1105
|
renderSlide: (r) => {
|
|
1041
1106
|
let i = e[r];
|
|
1042
|
-
return /* @__PURE__ */
|
|
1107
|
+
return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: ze(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
|
|
1043
1108
|
style: {
|
|
1044
1109
|
position: "absolute",
|
|
1045
1110
|
color: "#fff",
|
|
1046
1111
|
textAlign: n,
|
|
1047
|
-
...
|
|
1112
|
+
...Ie[t] ?? Ie.bottom
|
|
1048
1113
|
},
|
|
1049
|
-
children: [i.title && /* @__PURE__ */
|
|
1114
|
+
children: [i.title && /* @__PURE__ */ c("div", {
|
|
1050
1115
|
style: {
|
|
1051
1116
|
fontSize: 22,
|
|
1052
1117
|
fontWeight: 700
|
|
1053
1118
|
},
|
|
1054
1119
|
children: i.title
|
|
1055
|
-
}), i.text && /* @__PURE__ */
|
|
1120
|
+
}), i.text && /* @__PURE__ */ c("div", {
|
|
1056
1121
|
style: {
|
|
1057
1122
|
fontSize: 14,
|
|
1058
1123
|
opacity: .9,
|
|
@@ -1064,13 +1129,13 @@ function Oe({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1064
1129
|
}
|
|
1065
1130
|
}) : null;
|
|
1066
1131
|
}
|
|
1067
|
-
function
|
|
1068
|
-
return e.length ? /* @__PURE__ */
|
|
1132
|
+
function Ve({ slides: e = [], linked: t, ...n }) {
|
|
1133
|
+
return e.length ? /* @__PURE__ */ c(Re, {
|
|
1069
1134
|
...n,
|
|
1070
1135
|
count: e.length,
|
|
1071
1136
|
renderSlide: (n) => {
|
|
1072
1137
|
let r = e[n];
|
|
1073
|
-
return /* @__PURE__ */
|
|
1138
|
+
return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: ze(r.image, r.color) }), /* @__PURE__ */ c("div", {
|
|
1074
1139
|
style: {
|
|
1075
1140
|
position: "absolute",
|
|
1076
1141
|
inset: 0,
|
|
@@ -1087,28 +1152,28 @@ var Z = {
|
|
|
1087
1152
|
textDecoration: "none",
|
|
1088
1153
|
fontSize: 14,
|
|
1089
1154
|
opacity: .85
|
|
1090
|
-
},
|
|
1155
|
+
}, He = {
|
|
1091
1156
|
background: "var(--page-bg, #ffffff)",
|
|
1092
1157
|
color: "var(--page-text, #111827)",
|
|
1093
1158
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1094
1159
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1095
1160
|
zIndex: 60
|
|
1096
1161
|
};
|
|
1097
|
-
function
|
|
1098
|
-
let [
|
|
1162
|
+
function Ue({ brand: t, logo: n, links: i = [], style: a, nodeRef: s, menu: u = "auto", breakpoint: d = 768 }) {
|
|
1163
|
+
let [f, m] = o(null), [h, g] = o(!1), [_, v] = o(!1), [y, b] = o(null);
|
|
1099
1164
|
r(() => {
|
|
1100
|
-
if (!
|
|
1101
|
-
let e = new ResizeObserver(() => g(
|
|
1102
|
-
return e.observe(
|
|
1103
|
-
}, [
|
|
1104
|
-
let x = u === "hamburger" || u === "auto" && h, S = (e, t) => /* @__PURE__ */
|
|
1165
|
+
if (!f) return;
|
|
1166
|
+
let e = new ResizeObserver(() => g(f.offsetWidth < d));
|
|
1167
|
+
return e.observe(f), () => e.disconnect();
|
|
1168
|
+
}, [f, d]);
|
|
1169
|
+
let x = u === "hamburger" || u === "auto" && h, S = (e, t) => /* @__PURE__ */ l("a", {
|
|
1105
1170
|
href: e.href || "#",
|
|
1106
1171
|
style: {
|
|
1107
1172
|
...Z,
|
|
1108
1173
|
display: "block",
|
|
1109
1174
|
...t
|
|
1110
1175
|
},
|
|
1111
|
-
children: [e.label, e.desc && /* @__PURE__ */
|
|
1176
|
+
children: [e.label, e.desc && /* @__PURE__ */ c("span", {
|
|
1112
1177
|
style: {
|
|
1113
1178
|
display: "block",
|
|
1114
1179
|
fontSize: 12,
|
|
@@ -1118,9 +1183,9 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1118
1183
|
children: e.desc
|
|
1119
1184
|
})]
|
|
1120
1185
|
}, e.key);
|
|
1121
|
-
return /* @__PURE__ */
|
|
1186
|
+
return /* @__PURE__ */ l("nav", {
|
|
1122
1187
|
ref: (e) => {
|
|
1123
|
-
m(e),
|
|
1188
|
+
m(e), s && s(e);
|
|
1124
1189
|
},
|
|
1125
1190
|
style: {
|
|
1126
1191
|
display: "flex",
|
|
@@ -1130,10 +1195,10 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1130
1195
|
padding: "14px 24px",
|
|
1131
1196
|
width: "100%",
|
|
1132
1197
|
position: "relative",
|
|
1133
|
-
...
|
|
1198
|
+
...p(a)
|
|
1134
1199
|
},
|
|
1135
1200
|
children: [
|
|
1136
|
-
n && /* @__PURE__ */
|
|
1201
|
+
n && /* @__PURE__ */ c("img", {
|
|
1137
1202
|
src: n,
|
|
1138
1203
|
alt: t || "Logo",
|
|
1139
1204
|
style: {
|
|
@@ -1141,7 +1206,7 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1141
1206
|
display: "block"
|
|
1142
1207
|
}
|
|
1143
1208
|
}),
|
|
1144
|
-
t && /* @__PURE__ */
|
|
1209
|
+
t && /* @__PURE__ */ c("div", {
|
|
1145
1210
|
style: {
|
|
1146
1211
|
fontWeight: 700,
|
|
1147
1212
|
fontSize: 18,
|
|
@@ -1149,8 +1214,8 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1149
1214
|
},
|
|
1150
1215
|
children: t
|
|
1151
1216
|
}),
|
|
1152
|
-
/* @__PURE__ */
|
|
1153
|
-
x ? /* @__PURE__ */
|
|
1217
|
+
/* @__PURE__ */ c("div", { style: { flexGrow: 1 } }),
|
|
1218
|
+
x ? /* @__PURE__ */ c("button", {
|
|
1154
1219
|
type: "button",
|
|
1155
1220
|
"aria-label": _ ? "Close menu" : "Open menu",
|
|
1156
1221
|
onClick: () => v(!_),
|
|
@@ -1164,7 +1229,7 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1164
1229
|
padding: 4
|
|
1165
1230
|
},
|
|
1166
1231
|
children: _ ? "✕" : "☰"
|
|
1167
|
-
}) : /* @__PURE__ */
|
|
1232
|
+
}) : /* @__PURE__ */ c("div", {
|
|
1168
1233
|
style: {
|
|
1169
1234
|
display: "flex",
|
|
1170
1235
|
gap: 20,
|
|
@@ -1173,20 +1238,20 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1173
1238
|
},
|
|
1174
1239
|
children: i.map((e) => {
|
|
1175
1240
|
let t = e.children ?? [];
|
|
1176
|
-
if (!t.length) return /* @__PURE__ */
|
|
1241
|
+
if (!t.length) return /* @__PURE__ */ c("a", {
|
|
1177
1242
|
href: e.href || "#",
|
|
1178
1243
|
style: Z,
|
|
1179
1244
|
children: e.label
|
|
1180
1245
|
}, e.key);
|
|
1181
1246
|
let n = e.type === "mega";
|
|
1182
|
-
return /* @__PURE__ */
|
|
1247
|
+
return /* @__PURE__ */ l("span", {
|
|
1183
1248
|
style: {
|
|
1184
1249
|
position: n ? "static" : "relative",
|
|
1185
1250
|
display: "inline-flex"
|
|
1186
1251
|
},
|
|
1187
1252
|
onMouseEnter: () => b(e.key),
|
|
1188
1253
|
onMouseLeave: () => b(null),
|
|
1189
|
-
children: [/* @__PURE__ */
|
|
1254
|
+
children: [/* @__PURE__ */ l("a", {
|
|
1190
1255
|
href: e.href || "#",
|
|
1191
1256
|
style: {
|
|
1192
1257
|
...Z,
|
|
@@ -1195,7 +1260,7 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1195
1260
|
children: [
|
|
1196
1261
|
e.label,
|
|
1197
1262
|
" ",
|
|
1198
|
-
/* @__PURE__ */
|
|
1263
|
+
/* @__PURE__ */ c("span", {
|
|
1199
1264
|
style: {
|
|
1200
1265
|
fontSize: 9,
|
|
1201
1266
|
opacity: .6
|
|
@@ -1203,9 +1268,9 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1203
1268
|
children: "▼"
|
|
1204
1269
|
})
|
|
1205
1270
|
]
|
|
1206
|
-
}), y === e.key && (n ? /* @__PURE__ */
|
|
1271
|
+
}), y === e.key && (n ? /* @__PURE__ */ c("div", {
|
|
1207
1272
|
style: {
|
|
1208
|
-
...
|
|
1273
|
+
...He,
|
|
1209
1274
|
position: "absolute",
|
|
1210
1275
|
left: 0,
|
|
1211
1276
|
right: 0,
|
|
@@ -1219,9 +1284,9 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1219
1284
|
padding: "6px 8px",
|
|
1220
1285
|
borderRadius: 6
|
|
1221
1286
|
}))
|
|
1222
|
-
}) : /* @__PURE__ */
|
|
1287
|
+
}) : /* @__PURE__ */ c("div", {
|
|
1223
1288
|
style: {
|
|
1224
|
-
...
|
|
1289
|
+
...He,
|
|
1225
1290
|
position: "absolute",
|
|
1226
1291
|
top: "100%",
|
|
1227
1292
|
left: 0,
|
|
@@ -1239,7 +1304,7 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1239
1304
|
}, e.key);
|
|
1240
1305
|
})
|
|
1241
1306
|
}),
|
|
1242
|
-
x && _ && /* @__PURE__ */
|
|
1307
|
+
x && _ && /* @__PURE__ */ c("div", {
|
|
1243
1308
|
style: {
|
|
1244
1309
|
flexBasis: "100%",
|
|
1245
1310
|
width: "100%",
|
|
@@ -1247,7 +1312,7 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1247
1312
|
flexDirection: "column",
|
|
1248
1313
|
paddingTop: 10
|
|
1249
1314
|
},
|
|
1250
|
-
children: i.map((t) => /* @__PURE__ */
|
|
1315
|
+
children: i.map((t) => /* @__PURE__ */ l(e, { children: [/* @__PURE__ */ c("a", {
|
|
1251
1316
|
href: t.href || "#",
|
|
1252
1317
|
style: {
|
|
1253
1318
|
...Z,
|
|
@@ -1261,23 +1326,23 @@ function je({ brand: t, logo: n, links: i = [], style: o, nodeRef: l, menu: u =
|
|
|
1261
1326
|
]
|
|
1262
1327
|
});
|
|
1263
1328
|
}
|
|
1264
|
-
function
|
|
1265
|
-
let [i,
|
|
1266
|
-
return e.length ? /* @__PURE__ */
|
|
1329
|
+
function We({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1330
|
+
let [i, a] = o(0), s = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1331
|
+
return e.length ? /* @__PURE__ */ l("div", {
|
|
1267
1332
|
ref: r,
|
|
1268
1333
|
style: {
|
|
1269
1334
|
width: "100%",
|
|
1270
|
-
...
|
|
1335
|
+
...p(n)
|
|
1271
1336
|
},
|
|
1272
|
-
children: [/* @__PURE__ */
|
|
1337
|
+
children: [/* @__PURE__ */ c("div", {
|
|
1273
1338
|
style: {
|
|
1274
1339
|
display: "flex",
|
|
1275
1340
|
gap: 4,
|
|
1276
1341
|
borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
|
|
1277
1342
|
},
|
|
1278
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
1343
|
+
children: e.map((e, t) => /* @__PURE__ */ c("button", {
|
|
1279
1344
|
type: "button",
|
|
1280
|
-
onClick: () =>
|
|
1345
|
+
onClick: () => a(t),
|
|
1281
1346
|
style: {
|
|
1282
1347
|
background: "transparent",
|
|
1283
1348
|
border: 0,
|
|
@@ -1286,39 +1351,39 @@ function Me({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1286
1351
|
fontFamily: "inherit",
|
|
1287
1352
|
color: "inherit",
|
|
1288
1353
|
cursor: "pointer",
|
|
1289
|
-
opacity: t ===
|
|
1290
|
-
fontWeight: t ===
|
|
1291
|
-
boxShadow: t ===
|
|
1354
|
+
opacity: t === s ? 1 : .6,
|
|
1355
|
+
fontWeight: t === s ? 600 : 500,
|
|
1356
|
+
boxShadow: t === s ? "inset 0 -2px 0 var(--page-accent, #111827)" : "none"
|
|
1292
1357
|
},
|
|
1293
1358
|
children: e.label || `Tab ${t + 1}`
|
|
1294
1359
|
}, e.key))
|
|
1295
|
-
}), e.map((e, n) => /* @__PURE__ */
|
|
1360
|
+
}), e.map((e, n) => /* @__PURE__ */ c("div", {
|
|
1296
1361
|
style: {
|
|
1297
|
-
display: n ===
|
|
1362
|
+
display: n === s ? "flex" : "none",
|
|
1298
1363
|
flexDirection: "column"
|
|
1299
1364
|
},
|
|
1300
1365
|
children: t?.[e.key] ?? null
|
|
1301
1366
|
}, e.key))]
|
|
1302
1367
|
}) : null;
|
|
1303
1368
|
}
|
|
1304
|
-
function
|
|
1305
|
-
let [
|
|
1369
|
+
function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1370
|
+
let [a, s] = o(() => new Set(e.length ? [e[0].key] : []));
|
|
1306
1371
|
if (!e.length) return null;
|
|
1307
|
-
let u = (e) =>
|
|
1372
|
+
let u = (e) => s((t) => {
|
|
1308
1373
|
let r = new Set(n ? t : []);
|
|
1309
1374
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
1310
1375
|
});
|
|
1311
|
-
return /* @__PURE__ */
|
|
1376
|
+
return /* @__PURE__ */ c("div", {
|
|
1312
1377
|
ref: i,
|
|
1313
1378
|
style: {
|
|
1314
1379
|
width: "100%",
|
|
1315
|
-
...
|
|
1380
|
+
...p(r)
|
|
1316
1381
|
},
|
|
1317
1382
|
children: e.map((n, r) => {
|
|
1318
|
-
let i =
|
|
1319
|
-
return /* @__PURE__ */
|
|
1383
|
+
let i = a.has(n.key);
|
|
1384
|
+
return /* @__PURE__ */ l("div", {
|
|
1320
1385
|
style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
|
|
1321
|
-
children: [/* @__PURE__ */
|
|
1386
|
+
children: [/* @__PURE__ */ l("button", {
|
|
1322
1387
|
type: "button",
|
|
1323
1388
|
onClick: () => u(n.key),
|
|
1324
1389
|
style: {
|
|
@@ -1337,7 +1402,7 @@ function Ne({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1337
1402
|
textAlign: "left",
|
|
1338
1403
|
cursor: "pointer"
|
|
1339
1404
|
},
|
|
1340
|
-
children: [n.title || `Item ${r + 1}`, /* @__PURE__ */
|
|
1405
|
+
children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ c("span", {
|
|
1341
1406
|
"aria-hidden": !0,
|
|
1342
1407
|
style: {
|
|
1343
1408
|
fontSize: 12,
|
|
@@ -1347,7 +1412,7 @@ function Ne({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1347
1412
|
},
|
|
1348
1413
|
children: "▼"
|
|
1349
1414
|
})]
|
|
1350
|
-
}), /* @__PURE__ */
|
|
1415
|
+
}), /* @__PURE__ */ c("div", {
|
|
1351
1416
|
style: {
|
|
1352
1417
|
display: i ? "flex" : "none",
|
|
1353
1418
|
flexDirection: "column"
|
|
@@ -1358,11 +1423,11 @@ function Ne({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1358
1423
|
})
|
|
1359
1424
|
});
|
|
1360
1425
|
}
|
|
1361
|
-
var
|
|
1426
|
+
var Ke = {
|
|
1362
1427
|
display: "flex",
|
|
1363
1428
|
flexDirection: "column",
|
|
1364
1429
|
gap: "12px"
|
|
1365
|
-
},
|
|
1430
|
+
}, qe = {
|
|
1366
1431
|
fontSize: "14px",
|
|
1367
1432
|
fontWeight: 500,
|
|
1368
1433
|
color: "var(--page-text, #111827)"
|
|
@@ -1376,35 +1441,35 @@ var Pe = {
|
|
|
1376
1441
|
boxSizing: "border-box",
|
|
1377
1442
|
backgroundColor: "#ffffff",
|
|
1378
1443
|
color: "#111827"
|
|
1379
|
-
},
|
|
1444
|
+
}, Je = {
|
|
1380
1445
|
display: "flex",
|
|
1381
1446
|
alignItems: "center",
|
|
1382
1447
|
gap: "8px",
|
|
1383
1448
|
fontSize: "14px",
|
|
1384
1449
|
color: "var(--page-text, #111827)"
|
|
1385
|
-
},
|
|
1450
|
+
}, Ye = (e) => e ? {
|
|
1386
1451
|
readOnly: !0,
|
|
1387
1452
|
tabIndex: -1,
|
|
1388
1453
|
onMouseDown: (e) => e.preventDefault()
|
|
1389
1454
|
} : {};
|
|
1390
|
-
function
|
|
1391
|
-
let { tenant: g, apiUrl: _ } = n(
|
|
1392
|
-
return /* @__PURE__ */
|
|
1455
|
+
function Xe({ style: e, action: t, method: r, name: i, enctype: a, formSlug: s, nodeRef: u, inert: d, children: f, linked: m, show: h }) {
|
|
1456
|
+
let { tenant: g, apiUrl: _ } = n(B), [v, y] = o("form"), b = d ? h || "form" : v;
|
|
1457
|
+
return /* @__PURE__ */ l("div", {
|
|
1393
1458
|
ref: u,
|
|
1394
|
-
style:
|
|
1459
|
+
style: p(e),
|
|
1395
1460
|
children: [
|
|
1396
|
-
/* @__PURE__ */
|
|
1461
|
+
/* @__PURE__ */ c("form", {
|
|
1397
1462
|
action: t || void 0,
|
|
1398
1463
|
method: r || "post",
|
|
1399
1464
|
name: i || void 0,
|
|
1400
|
-
encType:
|
|
1465
|
+
encType: a || void 0,
|
|
1401
1466
|
onSubmit: async (e) => {
|
|
1402
1467
|
if (e.preventDefault(), !d) {
|
|
1403
|
-
if (
|
|
1468
|
+
if (s) {
|
|
1404
1469
|
let t = {};
|
|
1405
1470
|
for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
|
|
1406
1471
|
try {
|
|
1407
|
-
let e = await fetch(`${_ || "/api"}/forms/${
|
|
1472
|
+
let e = await fetch(`${_ || "/api"}/forms/${s}/submit`, {
|
|
1408
1473
|
method: "post",
|
|
1409
1474
|
headers: {
|
|
1410
1475
|
"content-type": "application/json",
|
|
@@ -1434,16 +1499,16 @@ function Re({ style: e, action: t, method: r, name: i, enctype: o, formSlug: l,
|
|
|
1434
1499
|
}
|
|
1435
1500
|
},
|
|
1436
1501
|
style: {
|
|
1437
|
-
...
|
|
1502
|
+
...Ke,
|
|
1438
1503
|
display: b === "success" ? "none" : "flex"
|
|
1439
1504
|
},
|
|
1440
|
-
children:
|
|
1505
|
+
children: f
|
|
1441
1506
|
}),
|
|
1442
|
-
/* @__PURE__ */
|
|
1507
|
+
/* @__PURE__ */ c("div", {
|
|
1443
1508
|
style: { display: b === "success" ? "block" : "none" },
|
|
1444
1509
|
children: m?.success ?? null
|
|
1445
1510
|
}),
|
|
1446
|
-
/* @__PURE__ */
|
|
1511
|
+
/* @__PURE__ */ c("div", {
|
|
1447
1512
|
style: {
|
|
1448
1513
|
display: b === "error" ? "block" : "none",
|
|
1449
1514
|
marginTop: 12
|
|
@@ -1453,18 +1518,18 @@ function Re({ style: e, action: t, method: r, name: i, enctype: o, formSlug: l,
|
|
|
1453
1518
|
]
|
|
1454
1519
|
});
|
|
1455
1520
|
}
|
|
1456
|
-
function
|
|
1457
|
-
return /* @__PURE__ */
|
|
1521
|
+
function Ze({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
1522
|
+
return /* @__PURE__ */ c("label", {
|
|
1458
1523
|
ref: r,
|
|
1459
1524
|
style: {
|
|
1460
|
-
...
|
|
1461
|
-
...
|
|
1525
|
+
...qe,
|
|
1526
|
+
...p(n)
|
|
1462
1527
|
},
|
|
1463
|
-
children:
|
|
1528
|
+
children: X(t, e, i)
|
|
1464
1529
|
});
|
|
1465
1530
|
}
|
|
1466
|
-
function
|
|
1467
|
-
return /* @__PURE__ */
|
|
1531
|
+
function Qe({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1532
|
+
return /* @__PURE__ */ c("input", {
|
|
1468
1533
|
ref: a,
|
|
1469
1534
|
type: e,
|
|
1470
1535
|
name: t || void 0,
|
|
@@ -1472,13 +1537,13 @@ function Be({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
1472
1537
|
required: !o && !!r,
|
|
1473
1538
|
style: {
|
|
1474
1539
|
...Q,
|
|
1475
|
-
...
|
|
1540
|
+
...p(i)
|
|
1476
1541
|
},
|
|
1477
|
-
...
|
|
1542
|
+
...Ye(o)
|
|
1478
1543
|
});
|
|
1479
1544
|
}
|
|
1480
|
-
function
|
|
1481
|
-
return /* @__PURE__ */
|
|
1545
|
+
function $e({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1546
|
+
return /* @__PURE__ */ c("textarea", {
|
|
1482
1547
|
ref: a,
|
|
1483
1548
|
name: e || void 0,
|
|
1484
1549
|
placeholder: t,
|
|
@@ -1487,25 +1552,25 @@ function Ve({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
1487
1552
|
style: {
|
|
1488
1553
|
...Q,
|
|
1489
1554
|
resize: "vertical",
|
|
1490
|
-
...
|
|
1555
|
+
...p(i)
|
|
1491
1556
|
},
|
|
1492
|
-
...
|
|
1557
|
+
...Ye(o)
|
|
1493
1558
|
});
|
|
1494
1559
|
}
|
|
1495
|
-
function
|
|
1496
|
-
return /* @__PURE__ */
|
|
1560
|
+
function et({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
1561
|
+
return /* @__PURE__ */ l("label", {
|
|
1497
1562
|
ref: o,
|
|
1498
1563
|
style: {
|
|
1499
|
-
...
|
|
1500
|
-
...
|
|
1564
|
+
...Je,
|
|
1565
|
+
...p(a)
|
|
1501
1566
|
},
|
|
1502
|
-
children: [/* @__PURE__ */
|
|
1567
|
+
children: [/* @__PURE__ */ c("input", {
|
|
1503
1568
|
type: e,
|
|
1504
1569
|
name: n || void 0,
|
|
1505
1570
|
value: r || void 0,
|
|
1506
|
-
required: !
|
|
1507
|
-
onClick:
|
|
1508
|
-
tabIndex:
|
|
1571
|
+
required: !s && !!i,
|
|
1572
|
+
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
1573
|
+
tabIndex: s ? -1 : void 0,
|
|
1509
1574
|
style: {
|
|
1510
1575
|
margin: 0,
|
|
1511
1576
|
accentColor: "var(--page-accent, #111827)"
|
|
@@ -1513,8 +1578,8 @@ function He({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
1513
1578
|
}), t]
|
|
1514
1579
|
});
|
|
1515
1580
|
}
|
|
1516
|
-
function
|
|
1517
|
-
return /* @__PURE__ */
|
|
1581
|
+
function tt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
1582
|
+
return /* @__PURE__ */ l("select", {
|
|
1518
1583
|
ref: a,
|
|
1519
1584
|
name: e || void 0,
|
|
1520
1585
|
required: !o && !!r,
|
|
@@ -1524,43 +1589,43 @@ function Ue({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
1524
1589
|
style: {
|
|
1525
1590
|
...Q,
|
|
1526
1591
|
appearance: "auto",
|
|
1527
|
-
...
|
|
1592
|
+
...p(i)
|
|
1528
1593
|
},
|
|
1529
|
-
children: [t !== "" && /* @__PURE__ */
|
|
1594
|
+
children: [t !== "" && /* @__PURE__ */ c("option", {
|
|
1530
1595
|
value: "",
|
|
1531
1596
|
disabled: !0,
|
|
1532
1597
|
children: t ?? "Select…"
|
|
1533
|
-
}), n.map((e, t) => /* @__PURE__ */
|
|
1598
|
+
}), n.map((e, t) => /* @__PURE__ */ c("option", {
|
|
1534
1599
|
value: e,
|
|
1535
1600
|
children: e
|
|
1536
1601
|
}, t))]
|
|
1537
1602
|
});
|
|
1538
1603
|
}
|
|
1539
|
-
function
|
|
1540
|
-
let [u, d] =
|
|
1541
|
-
return /* @__PURE__ */
|
|
1542
|
-
ref:
|
|
1604
|
+
function nt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
|
|
1605
|
+
let [u, d] = o(null);
|
|
1606
|
+
return /* @__PURE__ */ l("label", {
|
|
1607
|
+
ref: a,
|
|
1543
1608
|
style: {
|
|
1544
1609
|
...Q,
|
|
1545
1610
|
display: "flex",
|
|
1546
1611
|
alignItems: "center",
|
|
1547
1612
|
gap: "8px",
|
|
1548
|
-
cursor:
|
|
1613
|
+
cursor: s ? "default" : "pointer",
|
|
1549
1614
|
borderStyle: "dashed",
|
|
1550
1615
|
color: u ? "#111827" : "#6b7280",
|
|
1551
|
-
...
|
|
1616
|
+
...p(i)
|
|
1552
1617
|
},
|
|
1553
1618
|
children: [
|
|
1554
|
-
/* @__PURE__ */
|
|
1619
|
+
/* @__PURE__ */ c("input", {
|
|
1555
1620
|
type: "file",
|
|
1556
1621
|
name: e || void 0,
|
|
1557
1622
|
accept: t || void 0,
|
|
1558
|
-
required: !
|
|
1559
|
-
disabled: !!
|
|
1623
|
+
required: !s && !!n,
|
|
1624
|
+
disabled: !!s,
|
|
1560
1625
|
onChange: (e) => d(e.target.files?.[0]?.name ?? null),
|
|
1561
1626
|
style: { display: "none" }
|
|
1562
1627
|
}),
|
|
1563
|
-
/* @__PURE__ */
|
|
1628
|
+
/* @__PURE__ */ c("span", {
|
|
1564
1629
|
"aria-hidden": !0,
|
|
1565
1630
|
children: "📎"
|
|
1566
1631
|
}),
|
|
@@ -1568,165 +1633,527 @@ function We({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
1568
1633
|
]
|
|
1569
1634
|
});
|
|
1570
1635
|
}
|
|
1571
|
-
function
|
|
1572
|
-
return /* @__PURE__ */
|
|
1636
|
+
function rt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
1637
|
+
return /* @__PURE__ */ c("button", {
|
|
1573
1638
|
ref: n,
|
|
1574
1639
|
type: r ? "button" : "submit",
|
|
1575
1640
|
style: {
|
|
1576
|
-
...
|
|
1641
|
+
...J,
|
|
1577
1642
|
border: 0,
|
|
1578
1643
|
cursor: "pointer",
|
|
1579
1644
|
alignSelf: "flex-start",
|
|
1580
|
-
|
|
1645
|
+
padding: "10px 22px",
|
|
1646
|
+
borderRadius: 8,
|
|
1647
|
+
fontSize: 15,
|
|
1648
|
+
fontWeight: 600,
|
|
1649
|
+
lineHeight: 1.4,
|
|
1650
|
+
fontFamily: "inherit",
|
|
1651
|
+
...p(t)
|
|
1581
1652
|
},
|
|
1582
1653
|
children: e
|
|
1583
1654
|
});
|
|
1584
1655
|
}
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1656
|
+
function it({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
1657
|
+
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
1658
|
+
return /* @__PURE__ */ c("div", {
|
|
1659
|
+
ref: r,
|
|
1660
|
+
style: {
|
|
1661
|
+
display: "grid",
|
|
1662
|
+
gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
|
|
1663
|
+
gap: 16,
|
|
1664
|
+
width: "100%",
|
|
1665
|
+
...p(n)
|
|
1666
|
+
},
|
|
1667
|
+
children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ c("div", {
|
|
1668
|
+
style: { minWidth: 0 },
|
|
1669
|
+
children: i?.[`cell-${t}`] ?? null
|
|
1670
|
+
}, t))
|
|
1671
|
+
});
|
|
1672
|
+
}
|
|
1673
|
+
function at({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, imageField: s, titleField: u = "name", textField: d, custom: f, templateId: m, style: h, nodeRef: g }) {
|
|
1674
|
+
let { tenant: _, apiUrl: v } = n(B), y = n(H), b = n(V)?.[e], [x, S] = o(null);
|
|
1675
|
+
if (r(() => {
|
|
1676
|
+
if (!e || b) return;
|
|
1677
|
+
let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}`;
|
|
1678
|
+
return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => t && S(Array.isArray(e?.payload) ? e.payload : [])).catch(() => t && S([])), () => {
|
|
1679
|
+
t = !1;
|
|
1680
|
+
};
|
|
1681
|
+
}, [
|
|
1682
|
+
e,
|
|
1683
|
+
_,
|
|
1684
|
+
v,
|
|
1685
|
+
b
|
|
1686
|
+
]), !e) return null;
|
|
1687
|
+
let C = (b ?? x ?? []).slice(0, Math.max(1, Number(t) || 6)), w = Math.min(Math.max(Number(a) || 3, 1), 6), T = i === "list" ? {
|
|
1688
|
+
display: "flex",
|
|
1689
|
+
flexDirection: "column",
|
|
1690
|
+
gap: 20
|
|
1691
|
+
} : {
|
|
1692
|
+
display: "grid",
|
|
1693
|
+
gridTemplateColumns: `repeat(${w}, minmax(0, 1fr))`,
|
|
1694
|
+
gap: 24
|
|
1695
|
+
};
|
|
1696
|
+
return f && m && y?.render ? /* @__PURE__ */ c("div", {
|
|
1697
|
+
ref: g,
|
|
1698
|
+
style: {
|
|
1699
|
+
width: "100%",
|
|
1700
|
+
...T,
|
|
1701
|
+
...p(h)
|
|
1702
|
+
},
|
|
1703
|
+
children: C.map((e) => /* @__PURE__ */ c("div", {
|
|
1704
|
+
style: { minWidth: 0 },
|
|
1705
|
+
children: y.render(m, (t) => ae(t, e))
|
|
1706
|
+
}, e.id ?? e?.data?.slug))
|
|
1707
|
+
}) : /* @__PURE__ */ c("div", {
|
|
1708
|
+
ref: g,
|
|
1709
|
+
style: {
|
|
1710
|
+
width: "100%",
|
|
1711
|
+
...T,
|
|
1712
|
+
...p(h)
|
|
1713
|
+
},
|
|
1714
|
+
children: C.map((e) => {
|
|
1715
|
+
let t = s ? U(e?.data, s) : null, n = u ? G(U(e?.data, u)) : null, r = d ? U(e?.data, d) : null, a = Array.isArray(r) ? r : null, o = a || r == null ? null : G(r), f = i === "list";
|
|
1716
|
+
return /* @__PURE__ */ l("div", {
|
|
1717
|
+
style: {
|
|
1718
|
+
display: "flex",
|
|
1719
|
+
flexDirection: f ? "row" : "column",
|
|
1720
|
+
gap: f ? 20 : 12,
|
|
1721
|
+
alignItems: f ? "center" : "stretch",
|
|
1722
|
+
minWidth: 0
|
|
1723
|
+
},
|
|
1724
|
+
children: [t && /* @__PURE__ */ c("img", {
|
|
1725
|
+
src: t,
|
|
1726
|
+
alt: n ?? "",
|
|
1727
|
+
style: {
|
|
1728
|
+
width: f ? 160 : "100%",
|
|
1729
|
+
aspectRatio: "3 / 2",
|
|
1730
|
+
objectFit: "cover",
|
|
1731
|
+
borderRadius: 10,
|
|
1732
|
+
flexShrink: 0,
|
|
1733
|
+
display: "block"
|
|
1734
|
+
}
|
|
1735
|
+
}), /* @__PURE__ */ l("div", {
|
|
1736
|
+
style: { minWidth: 0 },
|
|
1737
|
+
children: [
|
|
1738
|
+
n && /* @__PURE__ */ c("h3", {
|
|
1739
|
+
style: {
|
|
1740
|
+
margin: 0,
|
|
1741
|
+
fontSize: 18,
|
|
1742
|
+
fontWeight: 700
|
|
1743
|
+
},
|
|
1744
|
+
children: n
|
|
1745
|
+
}),
|
|
1746
|
+
o && /* @__PURE__ */ c("p", {
|
|
1747
|
+
style: {
|
|
1748
|
+
margin: "6px 0 0",
|
|
1749
|
+
fontSize: 14,
|
|
1750
|
+
lineHeight: 1.55,
|
|
1751
|
+
opacity: .75
|
|
1752
|
+
},
|
|
1753
|
+
children: o
|
|
1754
|
+
}),
|
|
1755
|
+
a && /* @__PURE__ */ c("div", {
|
|
1756
|
+
style: {
|
|
1757
|
+
marginTop: 6,
|
|
1758
|
+
fontSize: 14,
|
|
1759
|
+
lineHeight: 1.55,
|
|
1760
|
+
opacity: .85
|
|
1761
|
+
},
|
|
1762
|
+
children: ve(a)
|
|
1763
|
+
})
|
|
1764
|
+
]
|
|
1765
|
+
})]
|
|
1766
|
+
}, e.id ?? e?.data?.slug);
|
|
1767
|
+
})
|
|
1768
|
+
});
|
|
1769
|
+
}
|
|
1770
|
+
function ot({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
1771
|
+
return e.length ? /* @__PURE__ */ c("nav", {
|
|
1772
|
+
ref: r,
|
|
1773
|
+
"aria-label": "Breadcrumb",
|
|
1774
|
+
style: { ...p(n) },
|
|
1775
|
+
children: /* @__PURE__ */ c("ol", {
|
|
1776
|
+
style: {
|
|
1777
|
+
display: "flex",
|
|
1778
|
+
flexWrap: "wrap",
|
|
1779
|
+
alignItems: "center",
|
|
1780
|
+
gap: 8,
|
|
1781
|
+
listStyle: "none",
|
|
1782
|
+
margin: 0,
|
|
1783
|
+
padding: 0,
|
|
1784
|
+
fontSize: 14
|
|
1785
|
+
},
|
|
1786
|
+
children: e.map((n, r) => {
|
|
1787
|
+
let i = r === e.length - 1;
|
|
1788
|
+
return /* @__PURE__ */ l("li", {
|
|
1789
|
+
style: {
|
|
1790
|
+
display: "flex",
|
|
1791
|
+
alignItems: "center",
|
|
1792
|
+
gap: 8,
|
|
1793
|
+
minWidth: 0
|
|
1794
|
+
},
|
|
1795
|
+
children: [r > 0 && /* @__PURE__ */ c("span", {
|
|
1796
|
+
style: { opacity: .4 },
|
|
1797
|
+
"aria-hidden": !0,
|
|
1798
|
+
children: t
|
|
1799
|
+
}), i || !n.href ? /* @__PURE__ */ c("span", {
|
|
1800
|
+
style: {
|
|
1801
|
+
fontWeight: i ? 600 : 400,
|
|
1802
|
+
opacity: i ? 1 : .7
|
|
1803
|
+
},
|
|
1804
|
+
"aria-current": i ? "page" : void 0,
|
|
1805
|
+
children: n.label
|
|
1806
|
+
}) : /* @__PURE__ */ c("a", {
|
|
1807
|
+
href: n.href,
|
|
1808
|
+
style: {
|
|
1809
|
+
color: "inherit",
|
|
1810
|
+
opacity: .7,
|
|
1811
|
+
textDecoration: "none"
|
|
1812
|
+
},
|
|
1813
|
+
children: n.label
|
|
1814
|
+
})]
|
|
1815
|
+
}, r);
|
|
1816
|
+
})
|
|
1817
|
+
})
|
|
1818
|
+
}) : null;
|
|
1819
|
+
}
|
|
1820
|
+
function st({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
|
|
1821
|
+
let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), u = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", d = (e) => ({
|
|
1822
|
+
display: "inline-flex",
|
|
1823
|
+
alignItems: "center",
|
|
1824
|
+
justifyContent: "center",
|
|
1825
|
+
minWidth: 36,
|
|
1826
|
+
height: 36,
|
|
1827
|
+
padding: "0 8px",
|
|
1828
|
+
borderRadius: 8,
|
|
1829
|
+
fontSize: 14,
|
|
1830
|
+
textDecoration: "none",
|
|
1831
|
+
color: e ? "var(--page-accent-text, #ffffff)" : "inherit",
|
|
1832
|
+
background: e ? "var(--page-accent, #111827)" : "transparent",
|
|
1833
|
+
border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
|
|
1834
|
+
});
|
|
1835
|
+
return /* @__PURE__ */ l("nav", {
|
|
1836
|
+
ref: a,
|
|
1837
|
+
"aria-label": "Pagination",
|
|
1838
|
+
style: {
|
|
1839
|
+
display: "flex",
|
|
1840
|
+
flexWrap: "wrap",
|
|
1841
|
+
gap: 8,
|
|
1842
|
+
alignItems: "center",
|
|
1843
|
+
...p(i)
|
|
1844
|
+
},
|
|
1845
|
+
children: [
|
|
1846
|
+
n && /* @__PURE__ */ c("a", {
|
|
1847
|
+
href: s > 1 ? u(s - 1) : "#",
|
|
1848
|
+
"aria-label": "Previous",
|
|
1849
|
+
style: {
|
|
1850
|
+
...d(!1),
|
|
1851
|
+
opacity: s > 1 ? 1 : .4
|
|
1852
|
+
},
|
|
1853
|
+
children: "‹"
|
|
1854
|
+
}),
|
|
1855
|
+
Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ c("a", {
|
|
1856
|
+
href: u(e),
|
|
1857
|
+
"aria-current": e === s ? "page" : void 0,
|
|
1858
|
+
style: d(e === s),
|
|
1859
|
+
children: e
|
|
1860
|
+
}, e)),
|
|
1861
|
+
n && /* @__PURE__ */ c("a", {
|
|
1862
|
+
href: s < o ? u(s + 1) : "#",
|
|
1863
|
+
"aria-label": "Next",
|
|
1864
|
+
style: {
|
|
1865
|
+
...d(!1),
|
|
1866
|
+
opacity: s < o ? 1 : .4
|
|
1867
|
+
},
|
|
1868
|
+
children: "›"
|
|
1869
|
+
})
|
|
1870
|
+
]
|
|
1871
|
+
});
|
|
1872
|
+
}
|
|
1873
|
+
function ct({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
1874
|
+
if (!t.length) return null;
|
|
1875
|
+
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
1876
|
+
width: 32,
|
|
1877
|
+
height: 32,
|
|
1878
|
+
borderRadius: "50%",
|
|
1879
|
+
display: "flex",
|
|
1880
|
+
alignItems: "center",
|
|
1881
|
+
justifyContent: "center",
|
|
1882
|
+
fontSize: 14,
|
|
1883
|
+
fontWeight: 600,
|
|
1884
|
+
flexShrink: 0,
|
|
1885
|
+
color: e === "todo" ? "inherit" : "var(--page-accent-text, #ffffff)",
|
|
1886
|
+
background: e === "todo" ? "transparent" : "var(--page-accent, #111827)",
|
|
1887
|
+
border: e === "todo" ? "1px solid rgba(148, 163, 184, 0.5)" : "1px solid transparent",
|
|
1888
|
+
opacity: e === "todo" ? .6 : 1,
|
|
1889
|
+
boxShadow: e === "active" ? "0 0 0 4px rgba(99, 102, 241, 0.2)" : "none"
|
|
1890
|
+
}), u = (e) => ({
|
|
1891
|
+
flexGrow: 1,
|
|
1892
|
+
alignSelf: "center",
|
|
1893
|
+
background: e ? "var(--page-accent, #111827)" : "rgba(148, 163, 184, 0.4)",
|
|
1894
|
+
...r ? {
|
|
1895
|
+
width: 2,
|
|
1896
|
+
minHeight: 24,
|
|
1897
|
+
marginLeft: 15,
|
|
1898
|
+
alignSelf: "auto"
|
|
1899
|
+
} : {
|
|
1900
|
+
height: 2,
|
|
1901
|
+
minWidth: 24
|
|
1902
|
+
}
|
|
1903
|
+
});
|
|
1904
|
+
return /* @__PURE__ */ c("div", {
|
|
1905
|
+
ref: a,
|
|
1906
|
+
style: {
|
|
1907
|
+
display: "flex",
|
|
1908
|
+
flexDirection: r ? "column" : "row",
|
|
1909
|
+
alignItems: r ? "stretch" : "flex-start",
|
|
1910
|
+
gap: r ? 4 : 8,
|
|
1911
|
+
...p(i)
|
|
1912
|
+
},
|
|
1913
|
+
children: t.map((t, n) => {
|
|
1914
|
+
let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
|
|
1915
|
+
return /* @__PURE__ */ l(e, { children: [n > 0 && /* @__PURE__ */ c("div", {
|
|
1916
|
+
style: u(i <= o),
|
|
1917
|
+
"aria-hidden": !0
|
|
1918
|
+
}), /* @__PURE__ */ l("div", {
|
|
1919
|
+
style: {
|
|
1920
|
+
display: "flex",
|
|
1921
|
+
flexDirection: r ? "row" : "column",
|
|
1922
|
+
alignItems: "center",
|
|
1923
|
+
gap: 8,
|
|
1924
|
+
minWidth: 0,
|
|
1925
|
+
textAlign: r ? "left" : "center"
|
|
1926
|
+
},
|
|
1927
|
+
children: [/* @__PURE__ */ c("div", {
|
|
1928
|
+
style: s(a),
|
|
1929
|
+
children: a === "done" ? "✓" : i
|
|
1930
|
+
}), /* @__PURE__ */ l("div", {
|
|
1931
|
+
style: { minWidth: 0 },
|
|
1932
|
+
children: [/* @__PURE__ */ c("div", {
|
|
1933
|
+
style: {
|
|
1934
|
+
fontSize: 13,
|
|
1935
|
+
fontWeight: a === "active" ? 700 : 500,
|
|
1936
|
+
opacity: a === "todo" ? .6 : 1
|
|
1937
|
+
},
|
|
1938
|
+
children: t.label
|
|
1939
|
+
}), t.description && /* @__PURE__ */ c("div", {
|
|
1940
|
+
style: {
|
|
1941
|
+
fontSize: 12,
|
|
1942
|
+
opacity: .6
|
|
1943
|
+
},
|
|
1944
|
+
children: t.description
|
|
1945
|
+
})]
|
|
1946
|
+
})]
|
|
1947
|
+
})] }, n);
|
|
1948
|
+
})
|
|
1949
|
+
});
|
|
1950
|
+
}
|
|
1951
|
+
function lt({ columns: e = [], rows: t = [], striped: n = !0, bordered: r = !1, compact: i = !1, style: a, nodeRef: o }) {
|
|
1952
|
+
if (!e.length) return null;
|
|
1953
|
+
let s = i ? "6px 10px" : "10px 14px", u = "1px solid rgba(148, 163, 184, 0.35)", d = r ? { border: u } : { borderBottom: u };
|
|
1954
|
+
return /* @__PURE__ */ c("div", {
|
|
1955
|
+
ref: o,
|
|
1956
|
+
style: {
|
|
1957
|
+
width: "100%",
|
|
1958
|
+
overflowX: "auto",
|
|
1959
|
+
...p(a)
|
|
1960
|
+
},
|
|
1961
|
+
children: /* @__PURE__ */ l("table", {
|
|
1962
|
+
style: {
|
|
1963
|
+
width: "100%",
|
|
1964
|
+
borderCollapse: "collapse",
|
|
1965
|
+
fontSize: 14,
|
|
1966
|
+
...r ? { border: u } : {}
|
|
1967
|
+
},
|
|
1968
|
+
children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: e.map((e, t) => /* @__PURE__ */ c("th", {
|
|
1969
|
+
style: {
|
|
1970
|
+
textAlign: "left",
|
|
1971
|
+
fontWeight: 600,
|
|
1972
|
+
padding: s,
|
|
1973
|
+
background: "rgba(148, 163, 184, 0.12)",
|
|
1974
|
+
...d
|
|
1975
|
+
},
|
|
1976
|
+
children: e.label ?? e
|
|
1977
|
+
}, t)) }) }), /* @__PURE__ */ c("tbody", { children: t.map((t, r) => /* @__PURE__ */ c("tr", {
|
|
1978
|
+
style: n && r % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
1979
|
+
children: e.map((e, n) => /* @__PURE__ */ c("td", {
|
|
1980
|
+
style: {
|
|
1981
|
+
padding: s,
|
|
1982
|
+
...d
|
|
1983
|
+
},
|
|
1984
|
+
children: t?.[n] ?? ""
|
|
1985
|
+
}, n))
|
|
1986
|
+
}, r)) })]
|
|
1987
|
+
})
|
|
1988
|
+
});
|
|
1989
|
+
}
|
|
1990
|
+
var ut = {
|
|
1991
|
+
PageRoot: le,
|
|
1992
|
+
Section: ue,
|
|
1993
|
+
Container: de,
|
|
1994
|
+
Heading: fe,
|
|
1995
|
+
TextBlock: Ce,
|
|
1996
|
+
ButtonBlock: Ee,
|
|
1997
|
+
ImageBlock: De,
|
|
1998
|
+
Spacer: Ne,
|
|
1999
|
+
Divider: Pe,
|
|
2000
|
+
SliderBlock: Be,
|
|
2001
|
+
CanvasSlider: Ve,
|
|
2002
|
+
TabsBlock: We,
|
|
2003
|
+
QuickStack: it,
|
|
2004
|
+
CollectionList: at,
|
|
2005
|
+
BreadcrumbsBlock: ot,
|
|
2006
|
+
PaginationBlock: st,
|
|
2007
|
+
StepperBlock: ct,
|
|
2008
|
+
TableBlock: lt,
|
|
2009
|
+
AccordionBlock: Ge,
|
|
2010
|
+
NavbarBlock: Ue,
|
|
2011
|
+
ListBlock: Se,
|
|
2012
|
+
TextSpan: he,
|
|
2013
|
+
QuoteBlock: xe,
|
|
2014
|
+
TextLink: Te,
|
|
2015
|
+
RichTextBlock: ye,
|
|
2016
|
+
RichContentBlock: ye,
|
|
2017
|
+
VideoBlock: Oe,
|
|
2018
|
+
YouTubeBlock: Ae,
|
|
2019
|
+
IframeBlock: je,
|
|
2020
|
+
EmbedBlock: Me,
|
|
2021
|
+
FormBlock: Xe,
|
|
2022
|
+
FormLabel: Ze,
|
|
2023
|
+
FormInput: Qe,
|
|
2024
|
+
FormTextarea: $e,
|
|
2025
|
+
FormCheckbox: (e) => /* @__PURE__ */ c(et, {
|
|
1615
2026
|
kind: "checkbox",
|
|
1616
2027
|
...e
|
|
1617
2028
|
}),
|
|
1618
|
-
FormRadio: (e) => /* @__PURE__ */
|
|
2029
|
+
FormRadio: (e) => /* @__PURE__ */ c(et, {
|
|
1619
2030
|
kind: "radio",
|
|
1620
2031
|
...e
|
|
1621
2032
|
}),
|
|
1622
|
-
FormSelect:
|
|
1623
|
-
FormFile:
|
|
1624
|
-
FormSubmit:
|
|
2033
|
+
FormSelect: tt,
|
|
2034
|
+
FormFile: nt,
|
|
2035
|
+
FormSubmit: rt
|
|
1625
2036
|
};
|
|
1626
2037
|
//#endregion
|
|
1627
2038
|
//#region ../ui/src/components/builder/render.jsx
|
|
1628
|
-
function $(t, n, r, i = /* @__PURE__ */ new Set()) {
|
|
1629
|
-
let
|
|
1630
|
-
if (!
|
|
1631
|
-
let
|
|
1632
|
-
if (
|
|
1633
|
-
let n =
|
|
1634
|
-
if (!
|
|
1635
|
-
let
|
|
1636
|
-
return /* @__PURE__ */
|
|
2039
|
+
function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
2040
|
+
let o = n[t];
|
|
2041
|
+
if (!o || o.hidden) return null;
|
|
2042
|
+
let s = o.type?.resolvedName, l = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
2043
|
+
if (s === "ComponentInstance") {
|
|
2044
|
+
let n = o.props?.componentId, s = r?.[n];
|
|
2045
|
+
if (!s?.template || i.has(n)) return null;
|
|
2046
|
+
let l = new Set(i).add(n);
|
|
2047
|
+
return /* @__PURE__ */ c(e, { children: $(s.template.rootId, s.template.nodes, r, l, a) }, t);
|
|
1637
2048
|
}
|
|
1638
|
-
let
|
|
1639
|
-
if (!
|
|
1640
|
-
let
|
|
1641
|
-
return /* @__PURE__ */
|
|
1642
|
-
...
|
|
1643
|
-
|
|
2049
|
+
let u = ut[s];
|
|
2050
|
+
if (!u) return null;
|
|
2051
|
+
let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0;
|
|
2052
|
+
return /* @__PURE__ */ c(u, {
|
|
2053
|
+
...l,
|
|
2054
|
+
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
2055
|
+
linked: p,
|
|
1644
2056
|
nodeRef: (e) => {
|
|
1645
|
-
e && (e.setAttribute("data-wb", t),
|
|
2057
|
+
e && (e.setAttribute("data-wb", t), _(e, l));
|
|
1646
2058
|
},
|
|
1647
|
-
children:
|
|
2059
|
+
children: d.length ? d : void 0
|
|
1648
2060
|
}, t);
|
|
1649
2061
|
}
|
|
1650
2062
|
//#endregion
|
|
1651
2063
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
1652
|
-
var
|
|
1653
|
-
function
|
|
1654
|
-
let
|
|
2064
|
+
var dt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
|
|
2065
|
+
function ft({ blocks: e, theme: t, components: n, mode: a = "auto", style: o, custom: s, tenant: u, apiUrl: d, datasets: f }) {
|
|
2066
|
+
let p = s?.js?.trim();
|
|
1655
2067
|
if (r(() => {
|
|
1656
|
-
if (!
|
|
2068
|
+
if (!p) return;
|
|
1657
2069
|
let e = document.createElement("script");
|
|
1658
|
-
return e.text =
|
|
1659
|
-
}, [
|
|
1660
|
-
let
|
|
2070
|
+
return e.text = p, document.body.appendChild(e), () => e.remove();
|
|
2071
|
+
}, [p]), !e?.ROOT) return null;
|
|
2072
|
+
let m = {
|
|
1661
2073
|
minHeight: "100%",
|
|
1662
2074
|
display: "flex",
|
|
1663
2075
|
flexDirection: "column"
|
|
1664
|
-
},
|
|
2076
|
+
}, h = $("ROOT", e, n), g = i(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), _ = T(e, n), v = w(e, n), y = s?.css?.trim(), b = z(e, n).map((e) => /* @__PURE__ */ c("link", {
|
|
1665
2077
|
rel: "stylesheet",
|
|
1666
2078
|
precedence: "default",
|
|
1667
|
-
href:
|
|
2079
|
+
href: re(e)
|
|
1668
2080
|
}, e));
|
|
1669
|
-
if (
|
|
2081
|
+
if (a !== "auto") return /* @__PURE__ */ c(B.Provider, {
|
|
1670
2082
|
value: {
|
|
1671
|
-
tenant:
|
|
1672
|
-
apiUrl:
|
|
2083
|
+
tenant: u || "",
|
|
2084
|
+
apiUrl: d || "/api"
|
|
1673
2085
|
},
|
|
1674
|
-
children: /* @__PURE__ */ c(
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
2086
|
+
children: /* @__PURE__ */ c(V.Provider, {
|
|
2087
|
+
value: f ?? null,
|
|
2088
|
+
children: /* @__PURE__ */ c(H.Provider, {
|
|
2089
|
+
value: g,
|
|
2090
|
+
children: /* @__PURE__ */ l("div", {
|
|
2091
|
+
style: {
|
|
2092
|
+
...m,
|
|
2093
|
+
...P(t, a),
|
|
2094
|
+
...o
|
|
2095
|
+
},
|
|
2096
|
+
children: [
|
|
2097
|
+
b,
|
|
2098
|
+
_ && /* @__PURE__ */ c("style", { children: _ }),
|
|
2099
|
+
v && /* @__PURE__ */ c("style", { children: v }),
|
|
2100
|
+
y && /* @__PURE__ */ c("style", { children: y }),
|
|
2101
|
+
h
|
|
2102
|
+
]
|
|
2103
|
+
})
|
|
2104
|
+
})
|
|
1686
2105
|
})
|
|
1687
2106
|
});
|
|
1688
|
-
let
|
|
1689
|
-
return /* @__PURE__ */
|
|
2107
|
+
let x = M(t);
|
|
2108
|
+
return /* @__PURE__ */ c(B.Provider, {
|
|
1690
2109
|
value: {
|
|
1691
|
-
tenant:
|
|
1692
|
-
apiUrl:
|
|
2110
|
+
tenant: u || "",
|
|
2111
|
+
apiUrl: d || "/api"
|
|
1693
2112
|
},
|
|
1694
|
-
children: /* @__PURE__ */ c(
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
2113
|
+
children: /* @__PURE__ */ c(V.Provider, {
|
|
2114
|
+
value: f ?? null,
|
|
2115
|
+
children: /* @__PURE__ */ c(H.Provider, {
|
|
2116
|
+
value: g,
|
|
2117
|
+
children: /* @__PURE__ */ l("div", {
|
|
2118
|
+
className: "webim-page",
|
|
2119
|
+
style: {
|
|
2120
|
+
...m,
|
|
2121
|
+
...ee(t),
|
|
2122
|
+
...o
|
|
2123
|
+
},
|
|
2124
|
+
children: [
|
|
2125
|
+
/* @__PURE__ */ c("style", { children: `.webim-page { ${dt(N(x.light))} }
|
|
2126
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${dt(N(x.dark))} } }` }),
|
|
2127
|
+
b,
|
|
2128
|
+
_ && /* @__PURE__ */ c("style", { children: _ }),
|
|
2129
|
+
v && /* @__PURE__ */ c("style", { children: v }),
|
|
2130
|
+
y && /* @__PURE__ */ c("style", { children: y }),
|
|
2131
|
+
h
|
|
2132
|
+
]
|
|
2133
|
+
})
|
|
2134
|
+
})
|
|
1709
2135
|
})
|
|
1710
2136
|
});
|
|
1711
2137
|
}
|
|
1712
2138
|
//#endregion
|
|
1713
2139
|
//#region src/WebimContent.jsx
|
|
1714
|
-
function
|
|
1715
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */
|
|
2140
|
+
function pt({ bundle: e, mode: t = "auto", style: n }) {
|
|
2141
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ c(ft, {
|
|
1716
2142
|
blocks: e.blocks,
|
|
1717
2143
|
theme: e.theme,
|
|
1718
2144
|
components: e.components,
|
|
1719
2145
|
custom: e.custom,
|
|
1720
2146
|
tenant: e.tenant,
|
|
1721
2147
|
apiUrl: e.apiUrl,
|
|
2148
|
+
datasets: e.datasets,
|
|
1722
2149
|
mode: t,
|
|
1723
2150
|
style: n
|
|
1724
2151
|
}) : null;
|
|
1725
2152
|
}
|
|
1726
2153
|
//#endregion
|
|
1727
2154
|
//#region src/WebimPage.jsx
|
|
1728
|
-
function
|
|
1729
|
-
let [h, g] =
|
|
2155
|
+
function mt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: s, mode: l = "auto", style: u, fallback: d = null, errorFallback: f = null, onLoad: p, onError: m }) {
|
|
2156
|
+
let [h, g] = o({ status: "loading" }), _ = a({
|
|
1730
2157
|
onLoad: p,
|
|
1731
2158
|
onError: m
|
|
1732
2159
|
});
|
|
@@ -1735,12 +2162,12 @@ function Xe({ apiUrl: e, tenant: t, slug: n, locale: o, preview: c, mode: l = "a
|
|
|
1735
2162
|
onError: m
|
|
1736
2163
|
}, r(() => {
|
|
1737
2164
|
let r = !0;
|
|
1738
|
-
return g({ status: "loading" }),
|
|
2165
|
+
return g({ status: "loading" }), L({
|
|
1739
2166
|
apiUrl: e,
|
|
1740
2167
|
tenant: t,
|
|
1741
2168
|
slug: n,
|
|
1742
|
-
locale:
|
|
1743
|
-
preview:
|
|
2169
|
+
locale: i,
|
|
2170
|
+
preview: s
|
|
1744
2171
|
}).then((e) => {
|
|
1745
2172
|
r && (g({
|
|
1746
2173
|
status: "ready",
|
|
@@ -1758,13 +2185,13 @@ function Xe({ apiUrl: e, tenant: t, slug: n, locale: o, preview: c, mode: l = "a
|
|
|
1758
2185
|
e,
|
|
1759
2186
|
t,
|
|
1760
2187
|
n,
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
]), h.status === "loading" ? d : h.status === "error" ? typeof f == "function" ? f(h.error) : f : /* @__PURE__ */
|
|
2188
|
+
i,
|
|
2189
|
+
s
|
|
2190
|
+
]), h.status === "loading" ? d : h.status === "error" ? typeof f == "function" ? f(h.error) : f : /* @__PURE__ */ c(pt, {
|
|
1764
2191
|
bundle: h.bundle,
|
|
1765
2192
|
mode: l,
|
|
1766
2193
|
style: u
|
|
1767
2194
|
});
|
|
1768
2195
|
}
|
|
1769
2196
|
//#endregion
|
|
1770
|
-
export {
|
|
2197
|
+
export { ft as PageRenderer, pt as WebimContent, mt as WebimPage, L as fetchPage, ve as renderRichContent, F as resolveTheme };
|