webim-adapter 0.8.0 → 0.9.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 +919 -650
- package/build/webim-embed.js +10 -10
- package/build/webim-ssr.js +855 -586
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { Fragment as e, createContext as t,
|
|
2
|
-
import { Fragment as
|
|
1
|
+
import { Fragment as e, createContext as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
|
|
2
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
3
3
|
//#region ../ui/src/components/builder/styles.js
|
|
4
|
-
var
|
|
4
|
+
var f = /* @__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.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), p = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, m = [
|
|
5
5
|
"borderWidth",
|
|
6
6
|
"borderStyle",
|
|
7
7
|
"borderColor",
|
|
8
8
|
"borderRadius",
|
|
9
9
|
"gap"
|
|
10
10
|
];
|
|
11
|
-
function
|
|
11
|
+
function h(e) {
|
|
12
12
|
let t = {};
|
|
13
|
-
for (let n of
|
|
13
|
+
for (let n of m) {
|
|
14
14
|
let r = e?.[n];
|
|
15
|
-
r != null && r !== "" && (t[n] =
|
|
15
|
+
r != null && r !== "" && (t[n] = f.has(n) ? p(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 === "" || m.includes(n) || (t[n] = f.has(n) ? p(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
20
|
let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
|
|
21
21
|
delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
|
|
22
|
-
let
|
|
22
|
+
let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${p(e.x ?? 0)} ${p(e.y ?? 0)} ${p(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
|
|
23
23
|
[
|
|
24
24
|
s,
|
|
25
25
|
c,
|
|
26
26
|
l,
|
|
27
27
|
u
|
|
28
|
-
].some((e) => e !== void 0) &&
|
|
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) && d.push(`${p(s ?? 0)} ${p(c ?? 0)} ${p(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
|
|
29
|
+
let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${p(e.x ?? 0)}, ${p(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(${p(v ?? 0)}, ${p(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 " : ""}${p(e.x ?? 0)} ${p(e.y ?? 0)} ${p(e.blur ?? 0)} ${p(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,76 +48,76 @@ function m(e) {
|
|
|
48
48
|
color: j,
|
|
49
49
|
inset: M
|
|
50
50
|
})), N.length && (t.boxShadow = N.join(", "));
|
|
51
|
-
let P = (e) => e.type === "blur" ? `blur(${
|
|
51
|
+
let P = (e) => e.type === "blur" ? `blur(${p(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: ee, filterBrightness: z, filterContrast: B, filterSaturate: te } = 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
|
|
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 V = F(I);
|
|
54
|
+
R !== void 0 && V.push(`blur(${p(R)})`), ee !== void 0 && V.push(`grayscale(${ee}%)`), z !== void 0 && V.push(`brightness(${z}%)`), B !== void 0 && V.push(`contrast(${B}%)`), te !== void 0 && V.push(`saturate(${te}%)`), V.length && (t.filter = V.join(" "));
|
|
55
|
+
let ne = F(L);
|
|
56
|
+
ne.length && (t.backdropFilter = ne.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
57
|
+
let { textStrokeWidth: re, textStrokeColor: ie } = t;
|
|
58
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (re !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${p(re ?? 1)} ${ie || "currentColor"}`);
|
|
59
|
+
let { clipText: ae } = t;
|
|
60
|
+
delete t.clipText, ae && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
61
|
+
let { transitions: oe, transitionDuration: H, transitionEasing: U, transitionProperty: W } = t, se = (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 G = (Array.isArray(
|
|
64
|
-
if (H !== void 0 && G.push(`${
|
|
63
|
+
let G = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${se(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
64
|
+
if (H !== void 0 && G.push(`${W || "all"} ${se(H)} ${U || "ease"}`), G.length && (t.transition = G.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), 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: ce, overlayOpacity: K } = t;
|
|
70
|
+
if (delete t.overlayColor, delete t.overlayOpacity, ce) {
|
|
71
|
+
let e = `color-mix(in srgb, ${ce} ${K ?? 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: le } = t;
|
|
76
76
|
delete t.backgroundLayers;
|
|
77
|
-
let
|
|
78
|
-
if (
|
|
77
|
+
let q = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
|
|
78
|
+
if (q.length) {
|
|
79
79
|
let e = [], n = [], r = [], i = [], a = [];
|
|
80
|
-
for (let t of
|
|
80
|
+
for (let t of q) 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" ? `${p(t.w ?? "auto")} ${p(t.h ?? "auto")}` : t.size || "cover"), r.push(`${p(t.posX ?? 0)} ${p(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 g = {
|
|
91
91
|
hover: ":hover",
|
|
92
92
|
pressed: ":active",
|
|
93
93
|
focused: ":focus"
|
|
94
|
-
},
|
|
94
|
+
}, _ = /* @__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
|
+
]), v = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !_.has(e.toLowerCase());
|
|
102
|
+
function y(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
|
+
v(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 b = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
113
|
+
function x(e, t, n, r = !1) {
|
|
114
|
+
let i = Object.entries(h(t)).map(([e, t]) => `${b(e)}: ${t} !important;`).join(" ");
|
|
115
115
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
return Object.entries(
|
|
117
|
+
function S(e, t, n) {
|
|
118
|
+
return Object.entries(g).map(([r, i]) => x(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
119
119
|
}
|
|
120
|
-
var
|
|
120
|
+
var C = [
|
|
121
121
|
{
|
|
122
122
|
key: "tablet",
|
|
123
123
|
max: 991
|
|
@@ -130,17 +130,17 @@ var S = [
|
|
|
130
130
|
key: "mobile",
|
|
131
131
|
max: 478
|
|
132
132
|
}
|
|
133
|
-
],
|
|
134
|
-
function
|
|
135
|
-
return
|
|
136
|
-
let i = t?.[n] ?
|
|
133
|
+
], w = (e) => Object.entries(h(e)).map(([e, t]) => `${b(e)}: ${t} !important;`).join(" ");
|
|
134
|
+
function T(e, t) {
|
|
135
|
+
return C.map(({ key: n, max: r }) => {
|
|
136
|
+
let i = t?.[n] ? w(t[n]) : "";
|
|
137
137
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
138
138
|
}).filter(Boolean).join("\n");
|
|
139
139
|
}
|
|
140
|
-
function
|
|
140
|
+
function E(e, t) {
|
|
141
141
|
let n = [], r = (e) => {
|
|
142
142
|
for (let [t, r] of Object.entries(e || {})) {
|
|
143
|
-
let e =
|
|
143
|
+
let e = T(t, r.props);
|
|
144
144
|
e && n.push(e);
|
|
145
145
|
}
|
|
146
146
|
};
|
|
@@ -148,10 +148,10 @@ function T(e, t) {
|
|
|
148
148
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
149
149
|
return n.join("\n");
|
|
150
150
|
}
|
|
151
|
-
function
|
|
151
|
+
function D(e, t) {
|
|
152
152
|
let n = [], r = (e) => {
|
|
153
153
|
for (let [t, r] of Object.entries(e || {})) {
|
|
154
|
-
let e =
|
|
154
|
+
let e = S(t, r.props);
|
|
155
155
|
e && n.push(e);
|
|
156
156
|
}
|
|
157
157
|
};
|
|
@@ -159,7 +159,7 @@ function E(e, t) {
|
|
|
159
159
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
160
160
|
return n.join("\n");
|
|
161
161
|
}
|
|
162
|
-
var
|
|
162
|
+
var O = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", k = {
|
|
163
163
|
light: {
|
|
164
164
|
background: "#ffffff",
|
|
165
165
|
text: "#111827",
|
|
@@ -196,23 +196,23 @@ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
196
196
|
contrastText: "#052e2b"
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
|
-
},
|
|
199
|
+
}, A = {
|
|
200
200
|
font: "system",
|
|
201
201
|
headingFont: "inherit",
|
|
202
|
-
light:
|
|
203
|
-
dark:
|
|
204
|
-
},
|
|
202
|
+
light: k.light,
|
|
203
|
+
dark: k.dark
|
|
204
|
+
}, j = {
|
|
205
205
|
system: {
|
|
206
206
|
label: "System",
|
|
207
|
-
value:
|
|
207
|
+
value: O
|
|
208
208
|
},
|
|
209
209
|
inter: {
|
|
210
210
|
label: "Inter",
|
|
211
|
-
value: `"Inter", ${
|
|
211
|
+
value: `"Inter", ${O}`
|
|
212
212
|
},
|
|
213
213
|
outfit: {
|
|
214
214
|
label: "Outfit",
|
|
215
|
-
value: `"Outfit", ${
|
|
215
|
+
value: `"Outfit", ${O}`
|
|
216
216
|
},
|
|
217
217
|
serif: {
|
|
218
218
|
label: "Serif",
|
|
@@ -222,7 +222,7 @@ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
222
222
|
label: "Mono",
|
|
223
223
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
224
224
|
}
|
|
225
|
-
},
|
|
225
|
+
}, M = (e, t) => j[e]?.value ?? t, N = (e, ...t) => {
|
|
226
226
|
let n = Object.assign({}, e, ...t);
|
|
227
227
|
return n.primary = {
|
|
228
228
|
...e.primary,
|
|
@@ -238,16 +238,16 @@ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
238
238
|
}), {})
|
|
239
239
|
}, n;
|
|
240
240
|
};
|
|
241
|
-
function
|
|
241
|
+
function P(e) {
|
|
242
242
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
243
243
|
return {
|
|
244
|
-
font: r ??
|
|
245
|
-
headingFont: i ??
|
|
246
|
-
light:
|
|
247
|
-
dark:
|
|
244
|
+
font: r ?? A.font,
|
|
245
|
+
headingFont: i ?? A.headingFont,
|
|
246
|
+
light: N(k.light, a, t),
|
|
247
|
+
dark: N(k.dark, n)
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function F(e) {
|
|
251
251
|
return {
|
|
252
252
|
"--page-bg": e.background,
|
|
253
253
|
"--page-text": e.text,
|
|
@@ -263,23 +263,23 @@ function P(e) {
|
|
|
263
263
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
let t =
|
|
266
|
+
function I(e) {
|
|
267
|
+
let t = P(e);
|
|
268
268
|
return {
|
|
269
269
|
backgroundColor: "var(--page-bg)",
|
|
270
270
|
color: "var(--page-text)",
|
|
271
|
-
fontFamily:
|
|
272
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
271
|
+
fontFamily: M(t.font, O),
|
|
272
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : M(t.headingFont, "inherit")
|
|
273
273
|
};
|
|
274
274
|
}
|
|
275
|
-
function
|
|
276
|
-
let n =
|
|
275
|
+
function L(e, t = "light") {
|
|
276
|
+
let n = P(e);
|
|
277
277
|
return {
|
|
278
|
-
...
|
|
279
|
-
...
|
|
278
|
+
...I(e),
|
|
279
|
+
...F(n[t] ?? n.light)
|
|
280
280
|
};
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function R(e, t) {
|
|
283
283
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
284
284
|
}
|
|
285
285
|
//#endregion
|
|
@@ -294,7 +294,7 @@ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
294
294
|
title: e.title,
|
|
295
295
|
slug: e.slug,
|
|
296
296
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
297
|
-
theme:
|
|
297
|
+
theme: R(o, a.builder_themes?.themes),
|
|
298
298
|
components: a.builder_components?.components ?? {},
|
|
299
299
|
custom: o.custom,
|
|
300
300
|
seo: o.seo,
|
|
@@ -302,23 +302,24 @@ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
302
302
|
locale: i || a.locales?.default,
|
|
303
303
|
locales: a.locales,
|
|
304
304
|
tenant: n ?? "",
|
|
305
|
-
apiUrl: r ?? ""
|
|
305
|
+
apiUrl: r ?? "",
|
|
306
|
+
settings: a
|
|
306
307
|
};
|
|
307
308
|
}
|
|
308
309
|
//#endregion
|
|
309
310
|
//#region src/fetchPage.js
|
|
310
|
-
var
|
|
311
|
+
var z = async (e) => {
|
|
311
312
|
let t = await e.json().catch(() => null);
|
|
312
313
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
313
314
|
return t?.payload ?? t;
|
|
314
315
|
};
|
|
315
|
-
async function
|
|
316
|
+
async function B({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
|
|
316
317
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
317
318
|
if (!n) throw Error("fetchPage: slug is required");
|
|
318
319
|
let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
|
|
319
320
|
...t ? { "x-tenant": t } : {},
|
|
320
321
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
321
|
-
}, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(
|
|
322
|
+
}, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(z), s(`${c}/settings/public`, { headers: l }).then(z)]), f = ee({
|
|
322
323
|
page: u,
|
|
323
324
|
settings: d,
|
|
324
325
|
tenant: t,
|
|
@@ -326,7 +327,7 @@ async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
326
327
|
locale: r
|
|
327
328
|
}), 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))];
|
|
328
329
|
if (p.length) {
|
|
329
|
-
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(
|
|
330
|
+
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(z).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
|
|
330
331
|
f.datasets = Object.fromEntries(t);
|
|
331
332
|
}
|
|
332
333
|
return f;
|
|
@@ -440,7 +441,7 @@ new Map([
|
|
|
440
441
|
function te(e) {
|
|
441
442
|
return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
|
|
442
443
|
}
|
|
443
|
-
var
|
|
444
|
+
var V = (e) => te([e]), ne = (e) => {
|
|
444
445
|
let t = typeof e == "string" && e.match(/^"([^"]+)"/);
|
|
445
446
|
return t ? t[1] : null;
|
|
446
447
|
};
|
|
@@ -452,7 +453,7 @@ function re(e, t) {
|
|
|
452
453
|
"pressed",
|
|
453
454
|
"focused"
|
|
454
455
|
]) {
|
|
455
|
-
let r =
|
|
456
|
+
let r = ne(t.props?.[e]?.fontFamily);
|
|
456
457
|
r && n.add(r);
|
|
457
458
|
}
|
|
458
459
|
};
|
|
@@ -473,15 +474,16 @@ var ie = /* @__PURE__ */ new Set([
|
|
|
473
474
|
"yi",
|
|
474
475
|
"dv",
|
|
475
476
|
"ckb"
|
|
476
|
-
]), ae = (e) => ie.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", oe = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ae(t) : void 0,
|
|
477
|
+
]), ae = (e) => ie.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", oe = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ae(t) : void 0, H = t({
|
|
477
478
|
tenant: "",
|
|
478
479
|
apiUrl: "/api",
|
|
479
|
-
locale: ""
|
|
480
|
-
|
|
481
|
-
|
|
480
|
+
locale: "",
|
|
481
|
+
settings: null
|
|
482
|
+
}), U = t(null), W = t(null), se = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
483
|
+
function G(e, t) {
|
|
482
484
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
483
485
|
}
|
|
484
|
-
var
|
|
486
|
+
var ce = (e) => {
|
|
485
487
|
let t = [];
|
|
486
488
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
487
489
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -494,10 +496,10 @@ var G = (e) => {
|
|
|
494
496
|
function K(e) {
|
|
495
497
|
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : 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(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
|
|
496
498
|
}
|
|
497
|
-
function
|
|
498
|
-
let n = t?.data ?? {}, r =
|
|
499
|
+
function le(e, t) {
|
|
500
|
+
let n = t?.data ?? {}, r = ce(n);
|
|
499
501
|
if (!r.length) return e;
|
|
500
|
-
let i = RegExp(`:(${r.map(se).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(
|
|
502
|
+
let i = RegExp(`:(${r.map(se).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(G(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
501
503
|
return a(e);
|
|
502
504
|
}
|
|
503
505
|
var q = {
|
|
@@ -505,22 +507,22 @@ var q = {
|
|
|
505
507
|
fontWeight: 700,
|
|
506
508
|
lineHeight: 1.2,
|
|
507
509
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
508
|
-
},
|
|
510
|
+
}, ue = { margin: 0 }, J = {
|
|
509
511
|
display: "inline-block",
|
|
510
512
|
textDecoration: "none",
|
|
511
513
|
cursor: "pointer",
|
|
512
514
|
backgroundColor: "var(--page-accent, #111827)",
|
|
513
515
|
color: "var(--page-accent-text, #ffffff)"
|
|
514
|
-
},
|
|
516
|
+
}, de = {
|
|
515
517
|
flexGrow: 1,
|
|
516
518
|
display: "flex",
|
|
517
519
|
flexDirection: "column",
|
|
518
520
|
position: "relative"
|
|
519
|
-
},
|
|
521
|
+
}, fe = {
|
|
520
522
|
display: "flex",
|
|
521
523
|
flexDirection: "column"
|
|
522
524
|
};
|
|
523
|
-
function
|
|
525
|
+
function pe({ style: e }) {
|
|
524
526
|
let t = e?.backgroundVideo;
|
|
525
527
|
if (!t) return null;
|
|
526
528
|
let n = {
|
|
@@ -531,7 +533,7 @@ function de({ style: e }) {
|
|
|
531
533
|
zIndex: -1,
|
|
532
534
|
pointerEvents: "none"
|
|
533
535
|
}, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
|
|
534
|
-
return /* @__PURE__ */
|
|
536
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("video", {
|
|
535
537
|
src: t,
|
|
536
538
|
autoPlay: !0,
|
|
537
539
|
muted: !0,
|
|
@@ -541,73 +543,73 @@ function de({ style: e }) {
|
|
|
541
543
|
...n,
|
|
542
544
|
objectFit: "cover"
|
|
543
545
|
}
|
|
544
|
-
}), r && /* @__PURE__ */
|
|
546
|
+
}), r && /* @__PURE__ */ u("div", { style: {
|
|
545
547
|
...n,
|
|
546
548
|
background: r
|
|
547
549
|
} })] });
|
|
548
550
|
}
|
|
549
|
-
var
|
|
551
|
+
var me = (e, t) => e?.backgroundVideo ? {
|
|
550
552
|
position: "relative",
|
|
551
553
|
...t,
|
|
552
|
-
...
|
|
554
|
+
...h(e)
|
|
553
555
|
} : {
|
|
554
556
|
...t,
|
|
555
|
-
...
|
|
557
|
+
...h(e)
|
|
556
558
|
};
|
|
557
|
-
function
|
|
558
|
-
return /* @__PURE__ */
|
|
559
|
+
function he({ style: e, nodeRef: t, children: n }) {
|
|
560
|
+
return /* @__PURE__ */ d("div", {
|
|
559
561
|
ref: t,
|
|
560
562
|
style: {
|
|
561
|
-
...
|
|
562
|
-
...
|
|
563
|
+
...de,
|
|
564
|
+
...h(e)
|
|
563
565
|
},
|
|
564
|
-
children: [/* @__PURE__ */
|
|
566
|
+
children: [/* @__PURE__ */ u(pe, { style: e }), n]
|
|
565
567
|
});
|
|
566
568
|
}
|
|
567
|
-
function
|
|
568
|
-
return /* @__PURE__ */
|
|
569
|
+
function ge({ style: e, nodeRef: t, children: n }) {
|
|
570
|
+
return /* @__PURE__ */ d("section", {
|
|
569
571
|
ref: t,
|
|
570
|
-
style:
|
|
571
|
-
children: [/* @__PURE__ */
|
|
572
|
+
style: me(e, fe),
|
|
573
|
+
children: [/* @__PURE__ */ u(pe, { style: e }), n]
|
|
572
574
|
});
|
|
573
575
|
}
|
|
574
|
-
function
|
|
576
|
+
function _e({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
575
577
|
let i = t ? {
|
|
576
578
|
position: "relative",
|
|
577
579
|
minHeight: 240
|
|
578
580
|
} : null;
|
|
579
|
-
return /* @__PURE__ */
|
|
581
|
+
return /* @__PURE__ */ d("div", {
|
|
580
582
|
ref: n,
|
|
581
583
|
style: i ? {
|
|
582
584
|
...i,
|
|
583
|
-
...
|
|
584
|
-
} :
|
|
585
|
-
children: [/* @__PURE__ */
|
|
585
|
+
...me(e)
|
|
586
|
+
} : me(e),
|
|
587
|
+
children: [/* @__PURE__ */ u(pe, { style: e }), r]
|
|
586
588
|
});
|
|
587
589
|
}
|
|
588
|
-
function
|
|
589
|
-
return /* @__PURE__ */
|
|
590
|
+
function ve({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
591
|
+
return /* @__PURE__ */ u(n, {
|
|
590
592
|
ref: a,
|
|
591
593
|
style: {
|
|
592
594
|
...q,
|
|
593
|
-
...
|
|
595
|
+
...h(r)
|
|
594
596
|
},
|
|
595
|
-
children:
|
|
597
|
+
children: Y(t, e, i)
|
|
596
598
|
});
|
|
597
599
|
}
|
|
598
|
-
var
|
|
599
|
-
fontFamily:
|
|
600
|
+
var ye = {
|
|
601
|
+
fontFamily: j.mono.value,
|
|
600
602
|
background: "rgba(148, 163, 184, 0.18)",
|
|
601
603
|
padding: "1px 5px",
|
|
602
604
|
borderRadius: 4,
|
|
603
605
|
fontSize: "0.9em"
|
|
604
606
|
};
|
|
605
|
-
function
|
|
607
|
+
function be(e, t = [], n, r) {
|
|
606
608
|
let i = e;
|
|
607
|
-
return t.includes("sup") ? i = /* @__PURE__ */
|
|
608
|
-
style:
|
|
609
|
+
return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
|
|
610
|
+
style: ye,
|
|
609
611
|
children: i
|
|
610
|
-
})), t.includes("strike") && (i = /* @__PURE__ */
|
|
612
|
+
})), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n && (i = /* @__PURE__ */ u("a", {
|
|
611
613
|
href: n,
|
|
612
614
|
target: r || void 0,
|
|
613
615
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
@@ -615,36 +617,36 @@ function ve(e, t = [], n, r) {
|
|
|
615
617
|
children: i
|
|
616
618
|
})), i;
|
|
617
619
|
}
|
|
618
|
-
function
|
|
620
|
+
function Y(t, n, r) {
|
|
619
621
|
return t?.length ? t.map((t, n) => {
|
|
620
|
-
if (t.slot) return /* @__PURE__ */
|
|
621
|
-
if (t.parts) return /* @__PURE__ */
|
|
622
|
+
if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
|
|
623
|
+
if (t.parts) return /* @__PURE__ */ u(e, { children: Y(t.parts, "", r) }, n);
|
|
622
624
|
let i = t.text;
|
|
623
|
-
return t.sup ? i = /* @__PURE__ */
|
|
624
|
-
style:
|
|
625
|
+
return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
|
|
626
|
+
style: ye,
|
|
625
627
|
children: i
|
|
626
|
-
})), t.strike && (i = /* @__PURE__ */
|
|
628
|
+
})), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
|
|
627
629
|
style: {
|
|
628
630
|
...t.color && { color: t.color },
|
|
629
631
|
...t.background && { backgroundColor: t.background }
|
|
630
632
|
},
|
|
631
633
|
children: i
|
|
632
|
-
})), t.href && (i = /* @__PURE__ */
|
|
634
|
+
})), t.href && (i = /* @__PURE__ */ u("a", {
|
|
633
635
|
href: t.href,
|
|
634
636
|
target: t.target || void 0,
|
|
635
637
|
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
636
638
|
style: { color: t.color ?? "inherit" },
|
|
637
639
|
children: i
|
|
638
|
-
})), /* @__PURE__ */
|
|
640
|
+
})), /* @__PURE__ */ u(e, { children: i }, n);
|
|
639
641
|
}) : n;
|
|
640
642
|
}
|
|
641
|
-
function
|
|
642
|
-
return /* @__PURE__ */
|
|
643
|
-
style:
|
|
644
|
-
children: e?.length ?
|
|
643
|
+
function xe({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
644
|
+
return /* @__PURE__ */ u("span", {
|
|
645
|
+
style: h(a),
|
|
646
|
+
children: e?.length ? Y(e, t) : be(t, n, r, i)
|
|
645
647
|
});
|
|
646
648
|
}
|
|
647
|
-
var
|
|
649
|
+
var Se = {
|
|
648
650
|
h1: 40,
|
|
649
651
|
h2: 32,
|
|
650
652
|
h3: 26,
|
|
@@ -652,7 +654,7 @@ var be = {
|
|
|
652
654
|
h5: 19,
|
|
653
655
|
h6: 16
|
|
654
656
|
};
|
|
655
|
-
function
|
|
657
|
+
function Ce({ align: e = "center", width: t, wrap: n } = {}) {
|
|
656
658
|
let r = t ? `${t}%` : void 0;
|
|
657
659
|
if (e === "full") return { width: "100%" };
|
|
658
660
|
let i = e === "left" || e === "right";
|
|
@@ -686,8 +688,8 @@ function xe({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
686
688
|
marginRight: "auto"
|
|
687
689
|
};
|
|
688
690
|
}
|
|
689
|
-
function
|
|
690
|
-
let r = n ?? ((e, n) =>
|
|
691
|
+
function we(e = [], t, n) {
|
|
692
|
+
let r = n ?? ((e, n) => Y(e, n, t));
|
|
691
693
|
return e.map((t, n) => {
|
|
692
694
|
let i = {
|
|
693
695
|
marginTop: 0,
|
|
@@ -695,7 +697,7 @@ function Se(e = [], t, n) {
|
|
|
695
697
|
};
|
|
696
698
|
if (t.type === "image") {
|
|
697
699
|
if (!t.src) return null;
|
|
698
|
-
let e = /* @__PURE__ */
|
|
700
|
+
let e = /* @__PURE__ */ u("img", {
|
|
699
701
|
src: t.src,
|
|
700
702
|
alt: t.alt || "",
|
|
701
703
|
style: {
|
|
@@ -704,20 +706,20 @@ function Se(e = [], t, n) {
|
|
|
704
706
|
borderRadius: 6
|
|
705
707
|
}
|
|
706
708
|
});
|
|
707
|
-
return /* @__PURE__ */
|
|
709
|
+
return /* @__PURE__ */ d("figure", {
|
|
708
710
|
style: {
|
|
709
711
|
marginLeft: 0,
|
|
710
712
|
marginRight: 0,
|
|
711
713
|
...i,
|
|
712
|
-
...
|
|
714
|
+
...Ce(t)
|
|
713
715
|
},
|
|
714
|
-
children: [t.href ? /* @__PURE__ */
|
|
716
|
+
children: [t.href ? /* @__PURE__ */ u("a", {
|
|
715
717
|
href: t.href,
|
|
716
718
|
target: t.target || void 0,
|
|
717
719
|
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
718
720
|
style: { display: "block" },
|
|
719
721
|
children: e
|
|
720
|
-
}) : e, t.caption && /* @__PURE__ */
|
|
722
|
+
}) : e, t.caption && /* @__PURE__ */ u("figcaption", {
|
|
721
723
|
style: {
|
|
722
724
|
fontSize: 13,
|
|
723
725
|
opacity: .65,
|
|
@@ -728,16 +730,16 @@ function Se(e = [], t, n) {
|
|
|
728
730
|
})]
|
|
729
731
|
}, n);
|
|
730
732
|
}
|
|
731
|
-
if (t.type === "video") return
|
|
733
|
+
if (t.type === "video") return Fe(t.url) ? /* @__PURE__ */ u("div", {
|
|
732
734
|
style: {
|
|
733
735
|
...i,
|
|
734
|
-
...
|
|
736
|
+
...Ce({
|
|
735
737
|
align: t.align,
|
|
736
738
|
wrap: t.wrap,
|
|
737
739
|
width: t.width ?? 100
|
|
738
740
|
})
|
|
739
741
|
},
|
|
740
|
-
children: /* @__PURE__ */
|
|
742
|
+
children: /* @__PURE__ */ u(Ie, {
|
|
741
743
|
url: t.url,
|
|
742
744
|
autoplay: t.autoplay,
|
|
743
745
|
muted: t.muted,
|
|
@@ -746,146 +748,146 @@ function Se(e = [], t, n) {
|
|
|
746
748
|
start: t.start
|
|
747
749
|
})
|
|
748
750
|
}, n) : null;
|
|
749
|
-
if (t.type === "divider") return /* @__PURE__ */
|
|
751
|
+
if (t.type === "divider") return /* @__PURE__ */ u("hr", { style: {
|
|
750
752
|
...i,
|
|
751
753
|
border: 0,
|
|
752
754
|
borderTop: "1px solid rgba(148, 163, 184, 0.4)"
|
|
753
755
|
} }, n);
|
|
754
756
|
if (t.type === "ul" || t.type === "ol") {
|
|
755
757
|
let e = t.type;
|
|
756
|
-
return /* @__PURE__ */
|
|
758
|
+
return /* @__PURE__ */ u(e, {
|
|
757
759
|
style: {
|
|
758
760
|
...i,
|
|
759
761
|
paddingLeft: 24
|
|
760
762
|
},
|
|
761
|
-
children: (t.items ?? []).map((e, t) => /* @__PURE__ */
|
|
763
|
+
children: (t.items ?? []).map((e, t) => /* @__PURE__ */ u("li", {
|
|
762
764
|
style: { marginBottom: 4 },
|
|
763
765
|
children: r(e.parts, e.text)
|
|
764
766
|
}, t))
|
|
765
767
|
}, n);
|
|
766
768
|
}
|
|
767
|
-
if (t.type === "quote") return /* @__PURE__ */
|
|
769
|
+
if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
|
|
768
770
|
style: {
|
|
769
|
-
...
|
|
771
|
+
...Ee,
|
|
770
772
|
...i
|
|
771
773
|
},
|
|
772
774
|
children: r(t.parts, t.text)
|
|
773
775
|
}, n);
|
|
774
|
-
if (
|
|
776
|
+
if (Se[t.type]) {
|
|
775
777
|
let e = t.type;
|
|
776
|
-
return /* @__PURE__ */
|
|
778
|
+
return /* @__PURE__ */ u(e, {
|
|
777
779
|
style: {
|
|
778
780
|
...q,
|
|
779
|
-
fontSize:
|
|
781
|
+
fontSize: Se[t.type],
|
|
780
782
|
...i
|
|
781
783
|
},
|
|
782
784
|
children: r(t.parts, t.text)
|
|
783
785
|
}, n);
|
|
784
786
|
}
|
|
785
|
-
return /* @__PURE__ */
|
|
787
|
+
return /* @__PURE__ */ u("p", {
|
|
786
788
|
style: {
|
|
787
|
-
...
|
|
789
|
+
...ue,
|
|
788
790
|
...i
|
|
789
791
|
},
|
|
790
792
|
children: r(t.parts, t.text)
|
|
791
793
|
}, n);
|
|
792
794
|
});
|
|
793
795
|
}
|
|
794
|
-
function
|
|
795
|
-
return /* @__PURE__ */
|
|
796
|
+
function Te({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
797
|
+
return /* @__PURE__ */ u("div", {
|
|
796
798
|
ref: r,
|
|
797
799
|
style: {
|
|
798
800
|
display: "flow-root",
|
|
799
|
-
...
|
|
801
|
+
...h(t)
|
|
800
802
|
},
|
|
801
|
-
children:
|
|
803
|
+
children: we(e, n)
|
|
802
804
|
});
|
|
803
805
|
}
|
|
804
|
-
var
|
|
806
|
+
var Ee = {
|
|
805
807
|
margin: 0,
|
|
806
808
|
padding: "8px 0 8px 20px",
|
|
807
809
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
808
810
|
};
|
|
809
|
-
function
|
|
810
|
-
return /* @__PURE__ */
|
|
811
|
+
function De({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
812
|
+
return /* @__PURE__ */ u("blockquote", {
|
|
811
813
|
ref: i,
|
|
812
814
|
style: {
|
|
813
|
-
...
|
|
814
|
-
...
|
|
815
|
+
...Ee,
|
|
816
|
+
...h(n)
|
|
815
817
|
},
|
|
816
|
-
children:
|
|
818
|
+
children: Y(t, e, r)
|
|
817
819
|
});
|
|
818
820
|
}
|
|
819
|
-
function
|
|
820
|
-
return /* @__PURE__ */
|
|
821
|
+
function Oe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
822
|
+
return /* @__PURE__ */ u(e ? "ol" : "ul", {
|
|
821
823
|
ref: r,
|
|
822
824
|
style: {
|
|
823
825
|
margin: 0,
|
|
824
826
|
paddingLeft: 24,
|
|
825
|
-
...
|
|
827
|
+
...h(n)
|
|
826
828
|
},
|
|
827
|
-
children: t.map((e, t) => /* @__PURE__ */
|
|
829
|
+
children: t.map((e, t) => /* @__PURE__ */ u("li", {
|
|
828
830
|
style: { marginBottom: 4 },
|
|
829
|
-
children:
|
|
831
|
+
children: Y(e.parts, e.text)
|
|
830
832
|
}, t))
|
|
831
833
|
});
|
|
832
834
|
}
|
|
833
|
-
function
|
|
834
|
-
return /* @__PURE__ */
|
|
835
|
+
function ke({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
836
|
+
return /* @__PURE__ */ u("p", {
|
|
835
837
|
ref: i,
|
|
836
838
|
style: {
|
|
837
|
-
...
|
|
838
|
-
...
|
|
839
|
+
...ue,
|
|
840
|
+
...h(n)
|
|
839
841
|
},
|
|
840
|
-
children:
|
|
842
|
+
children: Y(t, e, r)
|
|
841
843
|
});
|
|
842
844
|
}
|
|
843
|
-
var
|
|
845
|
+
var Ae = {
|
|
844
846
|
color: "var(--page-accent, inherit)",
|
|
845
847
|
textDecoration: "underline",
|
|
846
848
|
textUnderlineOffset: 3,
|
|
847
849
|
cursor: "pointer"
|
|
848
850
|
};
|
|
849
|
-
function
|
|
850
|
-
return /* @__PURE__ */
|
|
851
|
+
function je({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
852
|
+
return /* @__PURE__ */ u("a", {
|
|
851
853
|
ref: o,
|
|
852
854
|
href: n || "#",
|
|
853
855
|
target: r || void 0,
|
|
854
856
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
855
857
|
style: {
|
|
856
|
-
...
|
|
857
|
-
...
|
|
858
|
+
...Ae,
|
|
859
|
+
...h(i)
|
|
858
860
|
},
|
|
859
|
-
children:
|
|
861
|
+
children: Y(t, e, a)
|
|
860
862
|
});
|
|
861
863
|
}
|
|
862
|
-
function
|
|
863
|
-
return /* @__PURE__ */
|
|
864
|
+
function Me({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
865
|
+
return /* @__PURE__ */ u("a", {
|
|
864
866
|
ref: o,
|
|
865
867
|
href: n || "#",
|
|
866
868
|
target: r || void 0,
|
|
867
869
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
868
870
|
style: {
|
|
869
|
-
...
|
|
870
|
-
...
|
|
871
|
+
...J,
|
|
872
|
+
...h(i)
|
|
871
873
|
},
|
|
872
|
-
children:
|
|
874
|
+
children: Y(t, e, a)
|
|
873
875
|
});
|
|
874
876
|
}
|
|
875
|
-
function
|
|
876
|
-
return e ? /* @__PURE__ */
|
|
877
|
+
function Ne({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
878
|
+
return e ? /* @__PURE__ */ u("img", {
|
|
877
879
|
ref: r,
|
|
878
880
|
src: e,
|
|
879
881
|
alt: t || "",
|
|
880
882
|
style: {
|
|
881
883
|
display: "block",
|
|
882
884
|
maxWidth: "100%",
|
|
883
|
-
...
|
|
885
|
+
...h(n)
|
|
884
886
|
}
|
|
885
887
|
}) : null;
|
|
886
888
|
}
|
|
887
|
-
function
|
|
888
|
-
return e ? /* @__PURE__ */
|
|
889
|
+
function Pe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
890
|
+
return e ? /* @__PURE__ */ u("video", {
|
|
889
891
|
ref: s,
|
|
890
892
|
src: e,
|
|
891
893
|
poster: t || void 0,
|
|
@@ -898,25 +900,25 @@ function Me({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
898
900
|
display: "block",
|
|
899
901
|
width: "100%",
|
|
900
902
|
maxWidth: "100%",
|
|
901
|
-
...
|
|
903
|
+
...h(o)
|
|
902
904
|
}
|
|
903
905
|
}) : null;
|
|
904
906
|
}
|
|
905
|
-
var
|
|
906
|
-
function
|
|
907
|
-
let c =
|
|
907
|
+
var Fe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
908
|
+
function Ie({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
909
|
+
let c = Fe(e);
|
|
908
910
|
if (!c) return null;
|
|
909
|
-
let
|
|
910
|
-
return t &&
|
|
911
|
+
let l = new URLSearchParams({ rel: "0" });
|
|
912
|
+
return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ u("div", {
|
|
911
913
|
ref: s,
|
|
912
914
|
style: {
|
|
913
915
|
position: "relative",
|
|
914
916
|
width: "100%",
|
|
915
917
|
paddingTop: "56.25%",
|
|
916
|
-
...
|
|
918
|
+
...h(o)
|
|
917
919
|
},
|
|
918
|
-
children: /* @__PURE__ */
|
|
919
|
-
src: `https://www.youtube-nocookie.com/embed/${c}?${
|
|
920
|
+
children: /* @__PURE__ */ u("iframe", {
|
|
921
|
+
src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
|
|
920
922
|
title: "YouTube video",
|
|
921
923
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
922
924
|
allowFullScreen: !0,
|
|
@@ -930,8 +932,8 @@ function Pe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
930
932
|
})
|
|
931
933
|
});
|
|
932
934
|
}
|
|
933
|
-
function
|
|
934
|
-
return e ? /* @__PURE__ */
|
|
935
|
+
function Le({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
936
|
+
return e ? /* @__PURE__ */ u("iframe", {
|
|
935
937
|
ref: i,
|
|
936
938
|
src: e,
|
|
937
939
|
title: t || "Embedded frame",
|
|
@@ -942,13 +944,13 @@ function Fe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
942
944
|
width: "100%",
|
|
943
945
|
height: 300,
|
|
944
946
|
border: 0,
|
|
945
|
-
...
|
|
947
|
+
...h(r)
|
|
946
948
|
}
|
|
947
949
|
}) : null;
|
|
948
950
|
}
|
|
949
|
-
function
|
|
950
|
-
let [a, o] =
|
|
951
|
-
return
|
|
951
|
+
function Re({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
952
|
+
let [a, o] = c(null);
|
|
953
|
+
return i(() => {
|
|
952
954
|
a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
|
|
953
955
|
let t = document.createElement("script");
|
|
954
956
|
for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
|
|
@@ -958,15 +960,15 @@ function Ie({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
|
|
|
958
960
|
a,
|
|
959
961
|
e,
|
|
960
962
|
t
|
|
961
|
-
]), /* @__PURE__ */
|
|
963
|
+
]), /* @__PURE__ */ u("div", {
|
|
962
964
|
ref: (e) => {
|
|
963
|
-
o(e),
|
|
965
|
+
o(e), r && r(e);
|
|
964
966
|
},
|
|
965
|
-
style:
|
|
967
|
+
style: h(n)
|
|
966
968
|
});
|
|
967
969
|
}
|
|
968
|
-
function
|
|
969
|
-
return /* @__PURE__ */
|
|
970
|
+
function ze({ height: e, nodeRef: t }) {
|
|
971
|
+
return /* @__PURE__ */ u("div", {
|
|
970
972
|
ref: t,
|
|
971
973
|
style: {
|
|
972
974
|
height: e || 32,
|
|
@@ -975,18 +977,18 @@ function Le({ height: e, nodeRef: t }) {
|
|
|
975
977
|
}
|
|
976
978
|
});
|
|
977
979
|
}
|
|
978
|
-
function
|
|
979
|
-
return /* @__PURE__ */
|
|
980
|
+
function Be({ style: e, nodeRef: t }) {
|
|
981
|
+
return /* @__PURE__ */ u("div", {
|
|
980
982
|
ref: t,
|
|
981
983
|
style: {
|
|
982
984
|
height: 1,
|
|
983
985
|
alignSelf: "stretch",
|
|
984
986
|
flexShrink: 0,
|
|
985
|
-
...
|
|
987
|
+
...h(e)
|
|
986
988
|
}
|
|
987
989
|
});
|
|
988
990
|
}
|
|
989
|
-
var
|
|
991
|
+
var Ve = {
|
|
990
992
|
position: "absolute",
|
|
991
993
|
top: "50%",
|
|
992
994
|
transform: "translateY(-50%)",
|
|
@@ -1003,7 +1005,7 @@ var ze = {
|
|
|
1003
1005
|
alignItems: "center",
|
|
1004
1006
|
justifyContent: "center",
|
|
1005
1007
|
padding: 0
|
|
1006
|
-
},
|
|
1008
|
+
}, He = {
|
|
1007
1009
|
bottom: {
|
|
1008
1010
|
inset: "auto 0 0 0",
|
|
1009
1011
|
padding: "40px 24px 20px",
|
|
@@ -1022,26 +1024,26 @@ var ze = {
|
|
|
1022
1024
|
padding: 24,
|
|
1023
1025
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1024
1026
|
}
|
|
1025
|
-
},
|
|
1026
|
-
function
|
|
1027
|
-
let [p,
|
|
1028
|
-
if (
|
|
1027
|
+
}, Ue = 48;
|
|
1028
|
+
function We({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
|
|
1029
|
+
let [p, m] = c(0), [g, _] = c(!1), [v, y] = c(null), b = e ? Math.min(p, e - 1) : 0;
|
|
1030
|
+
if (i(() => {
|
|
1029
1031
|
if (!n || g || v || e < 2) return;
|
|
1030
|
-
let t = setInterval(() =>
|
|
1032
|
+
let t = setInterval(() => m((t) => (t + 1) % e), Math.max(2, Number(r) || 5) * 1e3);
|
|
1031
1033
|
return () => clearInterval(t);
|
|
1032
1034
|
}, [
|
|
1033
1035
|
n,
|
|
1034
1036
|
g,
|
|
1035
1037
|
v,
|
|
1036
|
-
|
|
1038
|
+
r,
|
|
1037
1039
|
e
|
|
1038
1040
|
]), !e) return null;
|
|
1039
|
-
let x = (t) =>
|
|
1041
|
+
let x = (t) => m((t + e) % e), S = () => {
|
|
1040
1042
|
if (!v) return;
|
|
1041
1043
|
let { dx: e } = v;
|
|
1042
|
-
y(null), e < -48 ? x(b + 1) : e >
|
|
1044
|
+
y(null), e < -48 ? x(b + 1) : e > Ue && x(b - 1);
|
|
1043
1045
|
};
|
|
1044
|
-
return /* @__PURE__ */
|
|
1046
|
+
return /* @__PURE__ */ d("div", {
|
|
1045
1047
|
ref: f,
|
|
1046
1048
|
onMouseEnter: () => _(!0),
|
|
1047
1049
|
onMouseLeave: () => _(!1),
|
|
@@ -1064,16 +1066,16 @@ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
1064
1066
|
touchAction: "pan-y",
|
|
1065
1067
|
userSelect: v ? "none" : void 0,
|
|
1066
1068
|
cursor: v ? "grabbing" : void 0,
|
|
1067
|
-
...
|
|
1069
|
+
...h(s)
|
|
1068
1070
|
},
|
|
1069
|
-
children: [/* @__PURE__ */
|
|
1071
|
+
children: [/* @__PURE__ */ u("div", {
|
|
1070
1072
|
style: {
|
|
1071
1073
|
display: "flex",
|
|
1072
1074
|
height: a,
|
|
1073
1075
|
transform: `translateX(calc(${-b * 100}% + ${v?.dx ?? 0}px))`,
|
|
1074
1076
|
transition: v ? "none" : "transform 450ms ease"
|
|
1075
1077
|
},
|
|
1076
|
-
children: Array.from({ length: e }, (e, n) => /* @__PURE__ */
|
|
1078
|
+
children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ u("div", {
|
|
1077
1079
|
style: {
|
|
1078
1080
|
position: "relative",
|
|
1079
1081
|
width: "100%",
|
|
@@ -1082,28 +1084,28 @@ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
1082
1084
|
},
|
|
1083
1085
|
children: t(n)
|
|
1084
1086
|
}, n))
|
|
1085
|
-
}), e > 1 && /* @__PURE__ */
|
|
1086
|
-
/* @__PURE__ */
|
|
1087
|
+
}), e > 1 && /* @__PURE__ */ d(l, { children: [
|
|
1088
|
+
/* @__PURE__ */ u("button", {
|
|
1087
1089
|
type: "button",
|
|
1088
1090
|
"aria-label": "Previous slide",
|
|
1089
1091
|
style: {
|
|
1090
|
-
...
|
|
1092
|
+
...Ve,
|
|
1091
1093
|
left: 12
|
|
1092
1094
|
},
|
|
1093
1095
|
onClick: () => x(b - 1),
|
|
1094
1096
|
children: "‹"
|
|
1095
1097
|
}),
|
|
1096
|
-
/* @__PURE__ */
|
|
1098
|
+
/* @__PURE__ */ u("button", {
|
|
1097
1099
|
type: "button",
|
|
1098
1100
|
"aria-label": "Next slide",
|
|
1099
1101
|
style: {
|
|
1100
|
-
...
|
|
1102
|
+
...Ve,
|
|
1101
1103
|
right: 12
|
|
1102
1104
|
},
|
|
1103
1105
|
onClick: () => x(b + 1),
|
|
1104
1106
|
children: "›"
|
|
1105
1107
|
}),
|
|
1106
|
-
/* @__PURE__ */
|
|
1108
|
+
/* @__PURE__ */ u("div", {
|
|
1107
1109
|
style: {
|
|
1108
1110
|
position: "absolute",
|
|
1109
1111
|
bottom: 10,
|
|
@@ -1113,7 +1115,7 @@ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
1113
1115
|
justifyContent: "center",
|
|
1114
1116
|
gap: 6
|
|
1115
1117
|
},
|
|
1116
|
-
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */
|
|
1118
|
+
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ u("button", {
|
|
1117
1119
|
type: "button",
|
|
1118
1120
|
"aria-label": `Go to slide ${t + 1}`,
|
|
1119
1121
|
onClick: () => x(t),
|
|
@@ -1131,7 +1133,7 @@ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
|
|
|
1131
1133
|
] })]
|
|
1132
1134
|
});
|
|
1133
1135
|
}
|
|
1134
|
-
var
|
|
1136
|
+
var Ge = (e, t) => ({
|
|
1135
1137
|
position: "absolute",
|
|
1136
1138
|
inset: 0,
|
|
1137
1139
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1139,26 +1141,26 @@ var Ue = (e, t) => ({
|
|
|
1139
1141
|
backgroundSize: "cover",
|
|
1140
1142
|
backgroundPosition: "center"
|
|
1141
1143
|
});
|
|
1142
|
-
function
|
|
1143
|
-
return e.length ? /* @__PURE__ */
|
|
1144
|
+
function Ke({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1145
|
+
return e.length ? /* @__PURE__ */ u(We, {
|
|
1144
1146
|
...r,
|
|
1145
1147
|
count: e.length,
|
|
1146
1148
|
renderSlide: (r) => {
|
|
1147
1149
|
let i = e[r];
|
|
1148
|
-
return /* @__PURE__ */
|
|
1150
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ge(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
|
|
1149
1151
|
style: {
|
|
1150
1152
|
position: "absolute",
|
|
1151
1153
|
color: "#fff",
|
|
1152
1154
|
textAlign: n,
|
|
1153
|
-
...
|
|
1155
|
+
...He[t] ?? He.bottom
|
|
1154
1156
|
},
|
|
1155
|
-
children: [i.title && /* @__PURE__ */
|
|
1157
|
+
children: [i.title && /* @__PURE__ */ u("div", {
|
|
1156
1158
|
style: {
|
|
1157
1159
|
fontSize: 22,
|
|
1158
1160
|
fontWeight: 700
|
|
1159
1161
|
},
|
|
1160
1162
|
children: i.title
|
|
1161
|
-
}), i.text && /* @__PURE__ */
|
|
1163
|
+
}), i.text && /* @__PURE__ */ u("div", {
|
|
1162
1164
|
style: {
|
|
1163
1165
|
fontSize: 14,
|
|
1164
1166
|
opacity: .9,
|
|
@@ -1170,13 +1172,13 @@ function We({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1170
1172
|
}
|
|
1171
1173
|
}) : null;
|
|
1172
1174
|
}
|
|
1173
|
-
function
|
|
1174
|
-
return e.length ? /* @__PURE__ */
|
|
1175
|
+
function qe({ slides: e = [], linked: t, ...n }) {
|
|
1176
|
+
return e.length ? /* @__PURE__ */ u(We, {
|
|
1175
1177
|
...n,
|
|
1176
1178
|
count: e.length,
|
|
1177
1179
|
renderSlide: (n) => {
|
|
1178
1180
|
let r = e[n];
|
|
1179
|
-
return /* @__PURE__ */
|
|
1181
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ge(r.image, r.color) }), /* @__PURE__ */ u("div", {
|
|
1180
1182
|
style: {
|
|
1181
1183
|
position: "absolute",
|
|
1182
1184
|
inset: 0,
|
|
@@ -1188,33 +1190,33 @@ function Ge({ slides: e = [], linked: t, ...n }) {
|
|
|
1188
1190
|
}
|
|
1189
1191
|
}) : null;
|
|
1190
1192
|
}
|
|
1191
|
-
var
|
|
1193
|
+
var Je = {
|
|
1192
1194
|
color: "inherit",
|
|
1193
1195
|
textDecoration: "none",
|
|
1194
1196
|
fontSize: 14,
|
|
1195
1197
|
opacity: .85
|
|
1196
|
-
},
|
|
1198
|
+
}, Ye = {
|
|
1197
1199
|
background: "var(--page-bg, #ffffff)",
|
|
1198
1200
|
color: "var(--page-text, #111827)",
|
|
1199
1201
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1200
1202
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1201
1203
|
zIndex: 60
|
|
1202
1204
|
};
|
|
1203
|
-
function
|
|
1204
|
-
let [f, p] =
|
|
1205
|
-
|
|
1205
|
+
function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s = "auto", breakpoint: l = 768 }) {
|
|
1206
|
+
let [f, p] = c(null), [m, g] = c(!1), [_, v] = c(!1), [y, b] = c(null);
|
|
1207
|
+
i(() => {
|
|
1206
1208
|
if (!f) return;
|
|
1207
|
-
let e = new ResizeObserver(() => g(f.offsetWidth <
|
|
1209
|
+
let e = new ResizeObserver(() => g(f.offsetWidth < l));
|
|
1208
1210
|
return e.observe(f), () => e.disconnect();
|
|
1209
|
-
}, [f,
|
|
1210
|
-
let x =
|
|
1211
|
+
}, [f, l]);
|
|
1212
|
+
let x = s === "hamburger" || s === "auto" && m, S = (e, t) => /* @__PURE__ */ d("a", {
|
|
1211
1213
|
href: e.href || "#",
|
|
1212
1214
|
style: {
|
|
1213
|
-
...
|
|
1215
|
+
...Je,
|
|
1214
1216
|
display: "block",
|
|
1215
1217
|
...t
|
|
1216
1218
|
},
|
|
1217
|
-
children: [e.label, e.desc && /* @__PURE__ */
|
|
1219
|
+
children: [e.label, e.desc && /* @__PURE__ */ u("span", {
|
|
1218
1220
|
style: {
|
|
1219
1221
|
display: "block",
|
|
1220
1222
|
fontSize: 12,
|
|
@@ -1224,7 +1226,7 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
|
|
|
1224
1226
|
children: e.desc
|
|
1225
1227
|
})]
|
|
1226
1228
|
}, e.key);
|
|
1227
|
-
return /* @__PURE__ */
|
|
1229
|
+
return /* @__PURE__ */ d("nav", {
|
|
1228
1230
|
ref: (e) => {
|
|
1229
1231
|
p(e), o && o(e);
|
|
1230
1232
|
},
|
|
@@ -1236,10 +1238,10 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
|
|
|
1236
1238
|
padding: "14px 24px",
|
|
1237
1239
|
width: "100%",
|
|
1238
1240
|
position: "relative",
|
|
1239
|
-
...
|
|
1241
|
+
...h(a)
|
|
1240
1242
|
},
|
|
1241
1243
|
children: [
|
|
1242
|
-
n && /* @__PURE__ */
|
|
1244
|
+
n && /* @__PURE__ */ u("img", {
|
|
1243
1245
|
src: n,
|
|
1244
1246
|
alt: t || "Logo",
|
|
1245
1247
|
style: {
|
|
@@ -1247,7 +1249,7 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
|
|
|
1247
1249
|
display: "block"
|
|
1248
1250
|
}
|
|
1249
1251
|
}),
|
|
1250
|
-
t && /* @__PURE__ */
|
|
1252
|
+
t && /* @__PURE__ */ u("div", {
|
|
1251
1253
|
style: {
|
|
1252
1254
|
fontWeight: 700,
|
|
1253
1255
|
fontSize: 18,
|
|
@@ -1255,8 +1257,8 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
|
|
|
1255
1257
|
},
|
|
1256
1258
|
children: t
|
|
1257
1259
|
}),
|
|
1258
|
-
/* @__PURE__ */
|
|
1259
|
-
x ? /* @__PURE__ */
|
|
1260
|
+
/* @__PURE__ */ u("div", { style: { flexGrow: 1 } }),
|
|
1261
|
+
x ? /* @__PURE__ */ u("button", {
|
|
1260
1262
|
type: "button",
|
|
1261
1263
|
"aria-label": _ ? "Close menu" : "Open menu",
|
|
1262
1264
|
onClick: () => v(!_),
|
|
@@ -1270,38 +1272,38 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
|
|
|
1270
1272
|
padding: 4
|
|
1271
1273
|
},
|
|
1272
1274
|
children: _ ? "✕" : "☰"
|
|
1273
|
-
}) : /* @__PURE__ */
|
|
1275
|
+
}) : /* @__PURE__ */ u("div", {
|
|
1274
1276
|
style: {
|
|
1275
1277
|
display: "flex",
|
|
1276
1278
|
gap: 20,
|
|
1277
1279
|
alignItems: "center",
|
|
1278
1280
|
flexWrap: "wrap"
|
|
1279
1281
|
},
|
|
1280
|
-
children:
|
|
1282
|
+
children: r.map((e) => {
|
|
1281
1283
|
let t = e.children ?? [];
|
|
1282
|
-
if (!t.length) return /* @__PURE__ */
|
|
1284
|
+
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
1283
1285
|
href: e.href || "#",
|
|
1284
|
-
style:
|
|
1286
|
+
style: Je,
|
|
1285
1287
|
children: e.label
|
|
1286
1288
|
}, e.key);
|
|
1287
1289
|
let n = e.type === "mega";
|
|
1288
|
-
return /* @__PURE__ */
|
|
1290
|
+
return /* @__PURE__ */ d("span", {
|
|
1289
1291
|
style: {
|
|
1290
1292
|
position: n ? "static" : "relative",
|
|
1291
1293
|
display: "inline-flex"
|
|
1292
1294
|
},
|
|
1293
1295
|
onMouseEnter: () => b(e.key),
|
|
1294
1296
|
onMouseLeave: () => b(null),
|
|
1295
|
-
children: [/* @__PURE__ */
|
|
1297
|
+
children: [/* @__PURE__ */ d("a", {
|
|
1296
1298
|
href: e.href || "#",
|
|
1297
1299
|
style: {
|
|
1298
|
-
...
|
|
1300
|
+
...Je,
|
|
1299
1301
|
cursor: "pointer"
|
|
1300
1302
|
},
|
|
1301
1303
|
children: [
|
|
1302
1304
|
e.label,
|
|
1303
1305
|
" ",
|
|
1304
|
-
/* @__PURE__ */
|
|
1306
|
+
/* @__PURE__ */ u("span", {
|
|
1305
1307
|
style: {
|
|
1306
1308
|
fontSize: 9,
|
|
1307
1309
|
opacity: .6
|
|
@@ -1309,9 +1311,9 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
|
|
|
1309
1311
|
children: "▼"
|
|
1310
1312
|
})
|
|
1311
1313
|
]
|
|
1312
|
-
}), y === e.key && (n ? /* @__PURE__ */
|
|
1314
|
+
}), y === e.key && (n ? /* @__PURE__ */ u("div", {
|
|
1313
1315
|
style: {
|
|
1314
|
-
...
|
|
1316
|
+
...Ye,
|
|
1315
1317
|
position: "absolute",
|
|
1316
1318
|
left: 0,
|
|
1317
1319
|
right: 0,
|
|
@@ -1325,9 +1327,9 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
|
|
|
1325
1327
|
padding: "6px 8px",
|
|
1326
1328
|
borderRadius: 6
|
|
1327
1329
|
}))
|
|
1328
|
-
}) : /* @__PURE__ */
|
|
1330
|
+
}) : /* @__PURE__ */ u("div", {
|
|
1329
1331
|
style: {
|
|
1330
|
-
...
|
|
1332
|
+
...Ye,
|
|
1331
1333
|
position: "absolute",
|
|
1332
1334
|
top: "100%",
|
|
1333
1335
|
left: 0,
|
|
@@ -1345,7 +1347,7 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
|
|
|
1345
1347
|
}, e.key);
|
|
1346
1348
|
})
|
|
1347
1349
|
}),
|
|
1348
|
-
x && _ && /* @__PURE__ */
|
|
1350
|
+
x && _ && /* @__PURE__ */ u("div", {
|
|
1349
1351
|
style: {
|
|
1350
1352
|
flexBasis: "100%",
|
|
1351
1353
|
width: "100%",
|
|
@@ -1353,10 +1355,10 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
|
|
|
1353
1355
|
flexDirection: "column",
|
|
1354
1356
|
paddingTop: 10
|
|
1355
1357
|
},
|
|
1356
|
-
children:
|
|
1358
|
+
children: r.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
1357
1359
|
href: t.href || "#",
|
|
1358
1360
|
style: {
|
|
1359
|
-
...
|
|
1361
|
+
...Je,
|
|
1360
1362
|
padding: "10px 4px",
|
|
1361
1363
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
1362
1364
|
opacity: 1
|
|
@@ -1367,21 +1369,21 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
|
|
|
1367
1369
|
]
|
|
1368
1370
|
});
|
|
1369
1371
|
}
|
|
1370
|
-
function
|
|
1371
|
-
let [i, a] =
|
|
1372
|
-
return e.length ? /* @__PURE__ */
|
|
1372
|
+
function Ze({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1373
|
+
let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1374
|
+
return e.length ? /* @__PURE__ */ d("div", {
|
|
1373
1375
|
ref: r,
|
|
1374
1376
|
style: {
|
|
1375
1377
|
width: "100%",
|
|
1376
|
-
...
|
|
1378
|
+
...h(n)
|
|
1377
1379
|
},
|
|
1378
|
-
children: [/* @__PURE__ */
|
|
1380
|
+
children: [/* @__PURE__ */ u("div", {
|
|
1379
1381
|
style: {
|
|
1380
1382
|
display: "flex",
|
|
1381
1383
|
gap: 4,
|
|
1382
1384
|
borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
|
|
1383
1385
|
},
|
|
1384
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
1386
|
+
children: e.map((e, t) => /* @__PURE__ */ u("button", {
|
|
1385
1387
|
type: "button",
|
|
1386
1388
|
onClick: () => a(t),
|
|
1387
1389
|
style: {
|
|
@@ -1398,7 +1400,7 @@ function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1398
1400
|
},
|
|
1399
1401
|
children: e.label || `Tab ${t + 1}`
|
|
1400
1402
|
}, e.key))
|
|
1401
|
-
}), e.map((e, n) => /* @__PURE__ */
|
|
1403
|
+
}), e.map((e, n) => /* @__PURE__ */ u("div", {
|
|
1402
1404
|
style: {
|
|
1403
1405
|
display: n === o ? "flex" : "none",
|
|
1404
1406
|
flexDirection: "column"
|
|
@@ -1407,26 +1409,26 @@ function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1407
1409
|
}, e.key))]
|
|
1408
1410
|
}) : null;
|
|
1409
1411
|
}
|
|
1410
|
-
function
|
|
1411
|
-
let [a, o] =
|
|
1412
|
+
function Qe({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1413
|
+
let [a, o] = c(() => new Set(e.length ? [e[0].key] : []));
|
|
1412
1414
|
if (!e.length) return null;
|
|
1413
|
-
let
|
|
1415
|
+
let s = (e) => o((t) => {
|
|
1414
1416
|
let r = new Set(n ? t : []);
|
|
1415
1417
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
1416
1418
|
});
|
|
1417
|
-
return /* @__PURE__ */
|
|
1419
|
+
return /* @__PURE__ */ u("div", {
|
|
1418
1420
|
ref: i,
|
|
1419
1421
|
style: {
|
|
1420
1422
|
width: "100%",
|
|
1421
|
-
...
|
|
1423
|
+
...h(r)
|
|
1422
1424
|
},
|
|
1423
1425
|
children: e.map((n, r) => {
|
|
1424
1426
|
let i = a.has(n.key);
|
|
1425
|
-
return /* @__PURE__ */
|
|
1427
|
+
return /* @__PURE__ */ d("div", {
|
|
1426
1428
|
style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
|
|
1427
|
-
children: [/* @__PURE__ */
|
|
1429
|
+
children: [/* @__PURE__ */ d("button", {
|
|
1428
1430
|
type: "button",
|
|
1429
|
-
onClick: () =>
|
|
1431
|
+
onClick: () => s(n.key),
|
|
1430
1432
|
style: {
|
|
1431
1433
|
width: "100%",
|
|
1432
1434
|
display: "flex",
|
|
@@ -1443,7 +1445,7 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1443
1445
|
textAlign: "left",
|
|
1444
1446
|
cursor: "pointer"
|
|
1445
1447
|
},
|
|
1446
|
-
children: [n.title || `Item ${r + 1}`, /* @__PURE__ */
|
|
1448
|
+
children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ u("span", {
|
|
1447
1449
|
"aria-hidden": !0,
|
|
1448
1450
|
style: {
|
|
1449
1451
|
fontSize: 12,
|
|
@@ -1453,7 +1455,7 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1453
1455
|
},
|
|
1454
1456
|
children: "▼"
|
|
1455
1457
|
})]
|
|
1456
|
-
}), /* @__PURE__ */
|
|
1458
|
+
}), /* @__PURE__ */ u("div", {
|
|
1457
1459
|
style: {
|
|
1458
1460
|
display: i ? "flex" : "none",
|
|
1459
1461
|
flexDirection: "column"
|
|
@@ -1464,15 +1466,15 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1464
1466
|
})
|
|
1465
1467
|
});
|
|
1466
1468
|
}
|
|
1467
|
-
var
|
|
1469
|
+
var $e = {
|
|
1468
1470
|
display: "flex",
|
|
1469
1471
|
flexDirection: "column",
|
|
1470
1472
|
gap: "12px"
|
|
1471
|
-
},
|
|
1473
|
+
}, X = {
|
|
1472
1474
|
fontSize: "14px",
|
|
1473
1475
|
fontWeight: 500,
|
|
1474
1476
|
color: "var(--page-text, #111827)"
|
|
1475
|
-
},
|
|
1477
|
+
}, Z = {
|
|
1476
1478
|
padding: "10px 12px",
|
|
1477
1479
|
border: "1px solid #d1d5db",
|
|
1478
1480
|
borderRadius: "6px",
|
|
@@ -1482,18 +1484,18 @@ var Xe = {
|
|
|
1482
1484
|
boxSizing: "border-box",
|
|
1483
1485
|
backgroundColor: "#ffffff",
|
|
1484
1486
|
color: "#111827"
|
|
1485
|
-
},
|
|
1487
|
+
}, et = {
|
|
1486
1488
|
display: "flex",
|
|
1487
1489
|
alignItems: "center",
|
|
1488
1490
|
gap: "8px",
|
|
1489
1491
|
fontSize: "14px",
|
|
1490
1492
|
color: "var(--page-text, #111827)"
|
|
1491
|
-
},
|
|
1493
|
+
}, Q = (e) => e ? {
|
|
1492
1494
|
readOnly: !0,
|
|
1493
1495
|
tabIndex: -1,
|
|
1494
1496
|
onMouseDown: (e) => e.preventDefault()
|
|
1495
1497
|
} : {};
|
|
1496
|
-
function
|
|
1498
|
+
function tt(e, t) {
|
|
1497
1499
|
if (!e) return !0;
|
|
1498
1500
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
1499
1501
|
switch (e.op) {
|
|
@@ -1507,11 +1509,11 @@ function et(e, t) {
|
|
|
1507
1509
|
default: return !1;
|
|
1508
1510
|
}
|
|
1509
1511
|
}
|
|
1510
|
-
var
|
|
1512
|
+
var nt = {
|
|
1511
1513
|
display: "flex",
|
|
1512
1514
|
flexDirection: "column",
|
|
1513
1515
|
gap: 6
|
|
1514
|
-
},
|
|
1516
|
+
}, rt = {
|
|
1515
1517
|
font: "inherit",
|
|
1516
1518
|
fontSize: 15,
|
|
1517
1519
|
padding: "10px 12px",
|
|
@@ -1522,16 +1524,16 @@ var tt = {
|
|
|
1522
1524
|
width: "100%",
|
|
1523
1525
|
boxSizing: "border-box"
|
|
1524
1526
|
};
|
|
1525
|
-
function
|
|
1527
|
+
function it(e, t) {
|
|
1526
1528
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
1527
1529
|
if (!e?.parentField) return n;
|
|
1528
1530
|
let r = t?.[e.parentField];
|
|
1529
1531
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
1530
1532
|
}
|
|
1531
|
-
function
|
|
1532
|
-
let a = /* @__PURE__ */
|
|
1533
|
+
function at({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
1534
|
+
let a = /* @__PURE__ */ d("span", {
|
|
1533
1535
|
style: {
|
|
1534
|
-
...
|
|
1536
|
+
...X,
|
|
1535
1537
|
fontSize: 14
|
|
1536
1538
|
},
|
|
1537
1539
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -1540,11 +1542,11 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1540
1542
|
required: e.required || void 0,
|
|
1541
1543
|
placeholder: e.placeholder || void 0,
|
|
1542
1544
|
disabled: r || void 0,
|
|
1543
|
-
style:
|
|
1545
|
+
style: rt,
|
|
1544
1546
|
value: t ?? "",
|
|
1545
1547
|
onChange: (t) => n(e.name, t.target.value)
|
|
1546
1548
|
};
|
|
1547
|
-
return e.type === "display" ? /* @__PURE__ */
|
|
1549
|
+
return e.type === "display" ? /* @__PURE__ */ u(e.variant && e.variant !== "p" ? e.variant : "p", {
|
|
1548
1550
|
style: {
|
|
1549
1551
|
margin: 0,
|
|
1550
1552
|
color: e.color || "inherit",
|
|
@@ -1561,7 +1563,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1561
1563
|
lineHeight: 1.35
|
|
1562
1564
|
},
|
|
1563
1565
|
children: e.label
|
|
1564
|
-
}) : e.type === "image" ? e.src ? /* @__PURE__ */
|
|
1566
|
+
}) : e.type === "image" ? e.src ? /* @__PURE__ */ u("img", {
|
|
1565
1567
|
src: e.src,
|
|
1566
1568
|
alt: e.label ?? "",
|
|
1567
1569
|
style: {
|
|
@@ -1569,10 +1571,10 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1569
1571
|
borderRadius: 8,
|
|
1570
1572
|
display: "block"
|
|
1571
1573
|
}
|
|
1572
|
-
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */
|
|
1574
|
+
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Ie, {
|
|
1573
1575
|
url: e.src,
|
|
1574
1576
|
style: { width: "100%" }
|
|
1575
|
-
}) : /* @__PURE__ */
|
|
1577
|
+
}) : /* @__PURE__ */ u("video", {
|
|
1576
1578
|
src: e.src,
|
|
1577
1579
|
controls: !0,
|
|
1578
1580
|
style: {
|
|
@@ -1580,28 +1582,28 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1580
1582
|
borderRadius: 8,
|
|
1581
1583
|
display: "block"
|
|
1582
1584
|
}
|
|
1583
|
-
}) : null : /* @__PURE__ */
|
|
1584
|
-
style:
|
|
1585
|
+
}) : null : /* @__PURE__ */ d("label", {
|
|
1586
|
+
style: nt,
|
|
1585
1587
|
children: [
|
|
1586
1588
|
a,
|
|
1587
|
-
e.type === "textarea" || e.multiline ? /* @__PURE__ */
|
|
1589
|
+
e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
|
|
1588
1590
|
...o,
|
|
1589
1591
|
rows: 4,
|
|
1590
1592
|
style: {
|
|
1591
|
-
...
|
|
1593
|
+
...rt,
|
|
1592
1594
|
resize: "vertical"
|
|
1593
1595
|
}
|
|
1594
|
-
}) : e.type === "select" ? /* @__PURE__ */
|
|
1596
|
+
}) : e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
1595
1597
|
...o,
|
|
1596
1598
|
disabled: o.disabled || !!e.parentField && !i?.[e.parentField],
|
|
1597
|
-
children: [/* @__PURE__ */
|
|
1599
|
+
children: [/* @__PURE__ */ u("option", {
|
|
1598
1600
|
value: "",
|
|
1599
1601
|
children: e.placeholder || "—"
|
|
1600
|
-
}),
|
|
1602
|
+
}), it(e, i).map((e, t) => /* @__PURE__ */ u("option", {
|
|
1601
1603
|
value: typeof e == "string" ? e : e.value,
|
|
1602
1604
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
1603
1605
|
}, t))]
|
|
1604
|
-
}) : e.type === "checkbox" ? /* @__PURE__ */
|
|
1606
|
+
}) : e.type === "checkbox" ? /* @__PURE__ */ u("input", {
|
|
1605
1607
|
type: "checkbox",
|
|
1606
1608
|
name: e.name,
|
|
1607
1609
|
required: e.required || void 0,
|
|
@@ -1612,7 +1614,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1612
1614
|
width: 18,
|
|
1613
1615
|
height: 18
|
|
1614
1616
|
}
|
|
1615
|
-
}) : e.type === "upload" ? /* @__PURE__ */
|
|
1617
|
+
}) : e.type === "upload" ? /* @__PURE__ */ u("input", {
|
|
1616
1618
|
type: "file",
|
|
1617
1619
|
name: e.name,
|
|
1618
1620
|
accept: e.accept || void 0,
|
|
@@ -1623,7 +1625,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1623
1625
|
font: "inherit",
|
|
1624
1626
|
fontSize: 14
|
|
1625
1627
|
}
|
|
1626
|
-
}) : /* @__PURE__ */
|
|
1628
|
+
}) : /* @__PURE__ */ u("input", {
|
|
1627
1629
|
...o,
|
|
1628
1630
|
type: {
|
|
1629
1631
|
email: "email",
|
|
@@ -1634,7 +1636,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1634
1636
|
link: "url"
|
|
1635
1637
|
}[e.type] ?? "text"
|
|
1636
1638
|
}),
|
|
1637
|
-
e.help && /* @__PURE__ */
|
|
1639
|
+
e.help && /* @__PURE__ */ u("span", {
|
|
1638
1640
|
style: {
|
|
1639
1641
|
fontSize: 12,
|
|
1640
1642
|
opacity: .65
|
|
@@ -1644,17 +1646,17 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1644
1646
|
]
|
|
1645
1647
|
});
|
|
1646
1648
|
}
|
|
1647
|
-
function
|
|
1648
|
-
let { tenant: b, apiUrl: x } =
|
|
1649
|
-
|
|
1650
|
-
if (!f || !
|
|
1649
|
+
function ot({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: g, children: _, linked: v, show: y }) {
|
|
1650
|
+
let { tenant: b, apiUrl: x } = r(H), [S, C] = c("form"), [w, T] = c(null), [E, D] = c({}), [O, k] = c(0), A = g ? y || "form" : S;
|
|
1651
|
+
i(() => {
|
|
1652
|
+
if (!f || !s) return;
|
|
1651
1653
|
let e = !0;
|
|
1652
|
-
return fetch(`${x || "/api"}/forms/${encodeURIComponent(
|
|
1654
|
+
return fetch(`${x || "/api"}/forms/${encodeURIComponent(s)}`, { headers: b ? { "x-tenant": b } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
|
|
1653
1655
|
e = !1;
|
|
1654
1656
|
};
|
|
1655
1657
|
}, [
|
|
1656
1658
|
f,
|
|
1657
|
-
|
|
1659
|
+
s,
|
|
1658
1660
|
b,
|
|
1659
1661
|
x
|
|
1660
1662
|
]);
|
|
@@ -1666,13 +1668,13 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
|
|
|
1666
1668
|
section: e,
|
|
1667
1669
|
fields: []
|
|
1668
1670
|
}) : j[j.length - 1].fields.push(e);
|
|
1669
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
1671
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || tt(e.section.condition, E)).map((e) => ({
|
|
1670
1672
|
...e,
|
|
1671
|
-
fields: e.fields.filter((e) =>
|
|
1673
|
+
fields: e.fields.filter((e) => tt(e.condition, E))
|
|
1672
1674
|
})), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
1673
1675
|
let t = E[e.name];
|
|
1674
1676
|
return e.required && (t == null || t === "" || t === !1);
|
|
1675
|
-
}),
|
|
1677
|
+
}), R = F >= N.length - 1, ee = (e, t) => D((n) => {
|
|
1676
1678
|
let r = {
|
|
1677
1679
|
...n,
|
|
1678
1680
|
[e]: t
|
|
@@ -1680,23 +1682,23 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
|
|
|
1680
1682
|
for (let t of Array.isArray(w?.fields) ? w.fields : []) t?.parentField === e && delete r[t.name];
|
|
1681
1683
|
return r;
|
|
1682
1684
|
});
|
|
1683
|
-
return /* @__PURE__ */
|
|
1684
|
-
ref:
|
|
1685
|
-
style:
|
|
1685
|
+
return /* @__PURE__ */ d("div", {
|
|
1686
|
+
ref: m,
|
|
1687
|
+
style: h(e),
|
|
1686
1688
|
children: [
|
|
1687
|
-
/* @__PURE__ */
|
|
1689
|
+
/* @__PURE__ */ u("form", {
|
|
1688
1690
|
action: t || void 0,
|
|
1689
|
-
method:
|
|
1691
|
+
method: n || "post",
|
|
1690
1692
|
name: a || void 0,
|
|
1691
1693
|
encType: o || void 0,
|
|
1692
1694
|
onSubmit: async (e) => {
|
|
1693
1695
|
if (e.preventDefault(), !g) {
|
|
1694
|
-
if (
|
|
1696
|
+
if (s) {
|
|
1695
1697
|
let t = {};
|
|
1696
1698
|
if (f) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
|
|
1697
1699
|
else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
|
|
1698
1700
|
try {
|
|
1699
|
-
let e = await fetch(`${x || "/api"}/forms/${
|
|
1701
|
+
let e = await fetch(`${x || "/api"}/forms/${s}/submit`, {
|
|
1700
1702
|
method: "post",
|
|
1701
1703
|
headers: {
|
|
1702
1704
|
"content-type": "application/json",
|
|
@@ -1715,27 +1717,27 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
|
|
|
1715
1717
|
return;
|
|
1716
1718
|
}
|
|
1717
1719
|
try {
|
|
1718
|
-
let
|
|
1719
|
-
method:
|
|
1720
|
+
let r = await fetch(t, {
|
|
1721
|
+
method: n || "post",
|
|
1720
1722
|
body: new FormData(e.currentTarget)
|
|
1721
1723
|
});
|
|
1722
|
-
C(
|
|
1724
|
+
C(r.ok ? "success" : "error");
|
|
1723
1725
|
} catch {
|
|
1724
1726
|
C("error");
|
|
1725
1727
|
}
|
|
1726
1728
|
}
|
|
1727
1729
|
},
|
|
1728
1730
|
style: {
|
|
1729
|
-
|
|
1731
|
+
...$e,
|
|
1730
1732
|
display: A === "success" ? "none" : "flex"
|
|
1731
1733
|
},
|
|
1732
|
-
children: f &&
|
|
1733
|
-
P && /* @__PURE__ */
|
|
1734
|
+
children: f && s ? /* @__PURE__ */ d(l, { children: [
|
|
1735
|
+
P && /* @__PURE__ */ u(vt, {
|
|
1734
1736
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
1735
1737
|
active: F + 1,
|
|
1736
1738
|
style: { marginBottom: 8 }
|
|
1737
1739
|
}),
|
|
1738
|
-
P && N[F]?.section?.help && /* @__PURE__ */
|
|
1740
|
+
P && N[F]?.section?.help && /* @__PURE__ */ u("p", {
|
|
1739
1741
|
style: {
|
|
1740
1742
|
margin: 0,
|
|
1741
1743
|
fontSize: 14,
|
|
@@ -1743,26 +1745,26 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
|
|
|
1743
1745
|
},
|
|
1744
1746
|
children: N[F].section.help
|
|
1745
1747
|
}),
|
|
1746
|
-
I.map((e) => /* @__PURE__ */
|
|
1748
|
+
I.map((e) => /* @__PURE__ */ u(at, {
|
|
1747
1749
|
field: e,
|
|
1748
1750
|
value: E[e.name],
|
|
1749
1751
|
values: E,
|
|
1750
|
-
onChange:
|
|
1752
|
+
onChange: ee,
|
|
1751
1753
|
inert: g
|
|
1752
1754
|
}, e.name)),
|
|
1753
|
-
/* @__PURE__ */
|
|
1755
|
+
/* @__PURE__ */ d("div", {
|
|
1754
1756
|
style: {
|
|
1755
1757
|
display: "flex",
|
|
1756
1758
|
gap: 10,
|
|
1757
1759
|
alignItems: "center",
|
|
1758
1760
|
marginTop: 4
|
|
1759
1761
|
},
|
|
1760
|
-
children: [P && F > 0 && /* @__PURE__ */
|
|
1762
|
+
children: [P && F > 0 && /* @__PURE__ */ u("button", {
|
|
1761
1763
|
type: "button",
|
|
1762
1764
|
disabled: g || void 0,
|
|
1763
1765
|
onClick: () => k(F - 1),
|
|
1764
1766
|
style: {
|
|
1765
|
-
...
|
|
1767
|
+
...J,
|
|
1766
1768
|
background: "transparent",
|
|
1767
1769
|
color: "inherit",
|
|
1768
1770
|
border: 0,
|
|
@@ -1770,12 +1772,12 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
|
|
|
1770
1772
|
cursor: "pointer"
|
|
1771
1773
|
},
|
|
1772
1774
|
children: "Back"
|
|
1773
|
-
}), P && !
|
|
1775
|
+
}), P && !R ? /* @__PURE__ */ u("button", {
|
|
1774
1776
|
type: "button",
|
|
1775
1777
|
disabled: g || L.length > 0,
|
|
1776
1778
|
onClick: () => k(F + 1),
|
|
1777
1779
|
style: {
|
|
1778
|
-
...
|
|
1780
|
+
...J,
|
|
1779
1781
|
border: 0,
|
|
1780
1782
|
padding: "10px 22px",
|
|
1781
1783
|
borderRadius: 8,
|
|
@@ -1785,11 +1787,11 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
|
|
|
1785
1787
|
opacity: L.length ? .5 : 1
|
|
1786
1788
|
},
|
|
1787
1789
|
children: "Next"
|
|
1788
|
-
}) : /* @__PURE__ */
|
|
1790
|
+
}) : /* @__PURE__ */ u("button", {
|
|
1789
1791
|
type: "submit",
|
|
1790
1792
|
disabled: g || void 0,
|
|
1791
1793
|
style: {
|
|
1792
|
-
...
|
|
1794
|
+
...J,
|
|
1793
1795
|
border: 0,
|
|
1794
1796
|
padding: "10px 22px",
|
|
1795
1797
|
borderRadius: 8,
|
|
@@ -1802,11 +1804,11 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
|
|
|
1802
1804
|
})
|
|
1803
1805
|
] }) : _
|
|
1804
1806
|
}),
|
|
1805
|
-
/* @__PURE__ */
|
|
1807
|
+
/* @__PURE__ */ u("div", {
|
|
1806
1808
|
style: { display: A === "success" ? "block" : "none" },
|
|
1807
1809
|
children: v?.success ?? null
|
|
1808
1810
|
}),
|
|
1809
|
-
/* @__PURE__ */
|
|
1811
|
+
/* @__PURE__ */ u("div", {
|
|
1810
1812
|
style: {
|
|
1811
1813
|
display: A === "error" ? "block" : "none",
|
|
1812
1814
|
marginTop: 12
|
|
@@ -1816,53 +1818,53 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
|
|
|
1816
1818
|
]
|
|
1817
1819
|
});
|
|
1818
1820
|
}
|
|
1819
|
-
function
|
|
1820
|
-
return /* @__PURE__ */
|
|
1821
|
+
function st({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
1822
|
+
return /* @__PURE__ */ u("label", {
|
|
1821
1823
|
ref: r,
|
|
1822
1824
|
style: {
|
|
1823
|
-
...
|
|
1824
|
-
...
|
|
1825
|
+
...X,
|
|
1826
|
+
...h(n)
|
|
1825
1827
|
},
|
|
1826
|
-
children:
|
|
1828
|
+
children: Y(t, e, i)
|
|
1827
1829
|
});
|
|
1828
1830
|
}
|
|
1829
|
-
function
|
|
1830
|
-
return /* @__PURE__ */
|
|
1831
|
+
function ct({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1832
|
+
return /* @__PURE__ */ u("input", {
|
|
1831
1833
|
ref: a,
|
|
1832
1834
|
type: e,
|
|
1833
1835
|
name: t || void 0,
|
|
1834
1836
|
placeholder: n,
|
|
1835
1837
|
required: !o && !!r,
|
|
1836
1838
|
style: {
|
|
1837
|
-
...
|
|
1838
|
-
...
|
|
1839
|
+
...Z,
|
|
1840
|
+
...h(i)
|
|
1839
1841
|
},
|
|
1840
|
-
|
|
1842
|
+
...Q(o)
|
|
1841
1843
|
});
|
|
1842
1844
|
}
|
|
1843
|
-
function
|
|
1844
|
-
return /* @__PURE__ */
|
|
1845
|
+
function lt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1846
|
+
return /* @__PURE__ */ u("textarea", {
|
|
1845
1847
|
ref: a,
|
|
1846
1848
|
name: e || void 0,
|
|
1847
1849
|
placeholder: t,
|
|
1848
1850
|
rows: n,
|
|
1849
1851
|
required: !o && !!r,
|
|
1850
1852
|
style: {
|
|
1851
|
-
...
|
|
1853
|
+
...Z,
|
|
1852
1854
|
resize: "vertical",
|
|
1853
|
-
...
|
|
1855
|
+
...h(i)
|
|
1854
1856
|
},
|
|
1855
|
-
|
|
1857
|
+
...Q(o)
|
|
1856
1858
|
});
|
|
1857
1859
|
}
|
|
1858
|
-
function
|
|
1859
|
-
return /* @__PURE__ */
|
|
1860
|
+
function ut({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
1861
|
+
return /* @__PURE__ */ d("label", {
|
|
1860
1862
|
ref: o,
|
|
1861
1863
|
style: {
|
|
1862
|
-
...
|
|
1863
|
-
...
|
|
1864
|
+
...et,
|
|
1865
|
+
...h(a)
|
|
1864
1866
|
},
|
|
1865
|
-
children: [/* @__PURE__ */
|
|
1867
|
+
children: [/* @__PURE__ */ u("input", {
|
|
1866
1868
|
type: e,
|
|
1867
1869
|
name: n || void 0,
|
|
1868
1870
|
value: r || void 0,
|
|
@@ -1876,8 +1878,8 @@ function lt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
1876
1878
|
}), t]
|
|
1877
1879
|
});
|
|
1878
1880
|
}
|
|
1879
|
-
function
|
|
1880
|
-
return /* @__PURE__ */
|
|
1881
|
+
function dt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
1882
|
+
return /* @__PURE__ */ d("select", {
|
|
1881
1883
|
ref: a,
|
|
1882
1884
|
name: e || void 0,
|
|
1883
1885
|
required: !o && !!r,
|
|
@@ -1885,58 +1887,58 @@ function ut({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
1885
1887
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
1886
1888
|
tabIndex: o ? -1 : void 0,
|
|
1887
1889
|
style: {
|
|
1888
|
-
...
|
|
1890
|
+
...Z,
|
|
1889
1891
|
appearance: "auto",
|
|
1890
|
-
...
|
|
1892
|
+
...h(i)
|
|
1891
1893
|
},
|
|
1892
|
-
children: [t !== "" && /* @__PURE__ */
|
|
1894
|
+
children: [t !== "" && /* @__PURE__ */ u("option", {
|
|
1893
1895
|
value: "",
|
|
1894
1896
|
disabled: !0,
|
|
1895
1897
|
children: t ?? "Select…"
|
|
1896
|
-
}), n.map((e, t) => /* @__PURE__ */
|
|
1898
|
+
}), n.map((e, t) => /* @__PURE__ */ u("option", {
|
|
1897
1899
|
value: e,
|
|
1898
1900
|
children: e
|
|
1899
1901
|
}, t))]
|
|
1900
1902
|
});
|
|
1901
1903
|
}
|
|
1902
|
-
function
|
|
1903
|
-
let [
|
|
1904
|
-
return /* @__PURE__ */
|
|
1904
|
+
function ft({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
1905
|
+
let [s, l] = c(null);
|
|
1906
|
+
return /* @__PURE__ */ d("label", {
|
|
1905
1907
|
ref: a,
|
|
1906
1908
|
style: {
|
|
1907
|
-
...
|
|
1909
|
+
...Z,
|
|
1908
1910
|
display: "flex",
|
|
1909
1911
|
alignItems: "center",
|
|
1910
1912
|
gap: "8px",
|
|
1911
1913
|
cursor: o ? "default" : "pointer",
|
|
1912
1914
|
borderStyle: "dashed",
|
|
1913
|
-
color:
|
|
1914
|
-
...
|
|
1915
|
+
color: s ? "#111827" : "#6b7280",
|
|
1916
|
+
...h(i)
|
|
1915
1917
|
},
|
|
1916
1918
|
children: [
|
|
1917
|
-
/* @__PURE__ */
|
|
1919
|
+
/* @__PURE__ */ u("input", {
|
|
1918
1920
|
type: "file",
|
|
1919
1921
|
name: e || void 0,
|
|
1920
1922
|
accept: t || void 0,
|
|
1921
1923
|
required: !o && !!n,
|
|
1922
1924
|
disabled: !!o,
|
|
1923
|
-
onChange: (e) =>
|
|
1925
|
+
onChange: (e) => l(e.target.files?.[0]?.name ?? null),
|
|
1924
1926
|
style: { display: "none" }
|
|
1925
1927
|
}),
|
|
1926
|
-
/* @__PURE__ */
|
|
1928
|
+
/* @__PURE__ */ u("span", {
|
|
1927
1929
|
"aria-hidden": !0,
|
|
1928
1930
|
children: "📎"
|
|
1929
1931
|
}),
|
|
1930
|
-
|
|
1932
|
+
s ?? r
|
|
1931
1933
|
]
|
|
1932
1934
|
});
|
|
1933
1935
|
}
|
|
1934
|
-
function
|
|
1935
|
-
return /* @__PURE__ */
|
|
1936
|
+
function pt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
1937
|
+
return /* @__PURE__ */ u("button", {
|
|
1936
1938
|
ref: n,
|
|
1937
1939
|
type: r ? "button" : "submit",
|
|
1938
1940
|
style: {
|
|
1939
|
-
...
|
|
1941
|
+
...J,
|
|
1940
1942
|
border: 0,
|
|
1941
1943
|
cursor: "pointer",
|
|
1942
1944
|
alignSelf: "flex-start",
|
|
@@ -1946,31 +1948,31 @@ function ft({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
1946
1948
|
fontWeight: 600,
|
|
1947
1949
|
lineHeight: 1.4,
|
|
1948
1950
|
fontFamily: "inherit",
|
|
1949
|
-
...
|
|
1951
|
+
...h(t)
|
|
1950
1952
|
},
|
|
1951
1953
|
children: e
|
|
1952
1954
|
});
|
|
1953
1955
|
}
|
|
1954
|
-
function
|
|
1956
|
+
function mt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
1955
1957
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
1956
|
-
return /* @__PURE__ */
|
|
1958
|
+
return /* @__PURE__ */ u("div", {
|
|
1957
1959
|
ref: r,
|
|
1958
1960
|
style: {
|
|
1959
1961
|
display: "grid",
|
|
1960
1962
|
gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
|
|
1961
1963
|
gap: 16,
|
|
1962
1964
|
width: "100%",
|
|
1963
|
-
...
|
|
1965
|
+
...h(n)
|
|
1964
1966
|
},
|
|
1965
|
-
children: Array.from({ length: a }, (e, t) => /* @__PURE__ */
|
|
1967
|
+
children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ u("div", {
|
|
1966
1968
|
style: { minWidth: 0 },
|
|
1967
1969
|
children: i?.[`cell-${t}`] ?? null
|
|
1968
1970
|
}, t))
|
|
1969
1971
|
});
|
|
1970
1972
|
}
|
|
1971
|
-
function
|
|
1972
|
-
let { tenant: _, apiUrl: v, locale: y } =
|
|
1973
|
-
if (
|
|
1973
|
+
function ht({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, style: m, nodeRef: g }) {
|
|
1974
|
+
let { tenant: _, apiUrl: v, locale: y } = r(H), b = r(W), x = r(U)?.[e], [S, C] = c(null);
|
|
1975
|
+
if (i(() => {
|
|
1974
1976
|
if (!e || x) return;
|
|
1975
1977
|
let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}${y ? `?locale=${encodeURIComponent(y)}` : ""}`;
|
|
1976
1978
|
return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => {
|
|
@@ -1986,7 +1988,7 @@ function mt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
|
|
|
1986
1988
|
y,
|
|
1987
1989
|
x
|
|
1988
1990
|
]), !e) return null;
|
|
1989
|
-
let w = (x ?? S ?? []).slice(0, Math.max(1, Number(t) || 6)), T = Math.min(Math.max(Number(a) || 3, 1), 6), E =
|
|
1991
|
+
let w = (x ?? S ?? []).slice(0, Math.max(1, Number(t) || 6)), T = Math.min(Math.max(Number(a) || 3, 1), 6), E = n === "list" ? {
|
|
1990
1992
|
display: "flex",
|
|
1991
1993
|
flexDirection: "column",
|
|
1992
1994
|
gap: 20
|
|
@@ -1995,27 +1997,27 @@ function mt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
|
|
|
1995
1997
|
gridTemplateColumns: `repeat(${T}, minmax(0, 1fr))`,
|
|
1996
1998
|
gap: 24
|
|
1997
1999
|
};
|
|
1998
|
-
return f && p && b?.render ? /* @__PURE__ */
|
|
2000
|
+
return f && p && b?.render ? /* @__PURE__ */ u("div", {
|
|
1999
2001
|
ref: g,
|
|
2000
2002
|
style: {
|
|
2001
2003
|
width: "100%",
|
|
2002
2004
|
...E,
|
|
2003
|
-
...m
|
|
2005
|
+
...h(m)
|
|
2004
2006
|
},
|
|
2005
|
-
children: w.map((e) => /* @__PURE__ */
|
|
2007
|
+
children: w.map((e) => /* @__PURE__ */ u("div", {
|
|
2006
2008
|
style: { minWidth: 0 },
|
|
2007
|
-
children: b.render(p, (t) =>
|
|
2009
|
+
children: b.render(p, (t) => le(t, e))
|
|
2008
2010
|
}, e.id ?? e?.data?.slug))
|
|
2009
|
-
}) : /* @__PURE__ */
|
|
2011
|
+
}) : /* @__PURE__ */ u("div", {
|
|
2010
2012
|
ref: g,
|
|
2011
2013
|
style: {
|
|
2012
2014
|
width: "100%",
|
|
2013
2015
|
...E,
|
|
2014
|
-
...m
|
|
2016
|
+
...h(m)
|
|
2015
2017
|
},
|
|
2016
2018
|
children: w.map((e) => {
|
|
2017
|
-
let t = o ?
|
|
2018
|
-
return /* @__PURE__ */
|
|
2019
|
+
let t = o ? G(e?.data, o) : null, r = s ? K(G(e?.data, s)) : null, i = l ? G(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : K(i), f = n === "list";
|
|
2020
|
+
return /* @__PURE__ */ d("div", {
|
|
2019
2021
|
style: {
|
|
2020
2022
|
display: "flex",
|
|
2021
2023
|
flexDirection: f ? "row" : "column",
|
|
@@ -2023,9 +2025,9 @@ function mt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
|
|
|
2023
2025
|
alignItems: f ? "center" : "stretch",
|
|
2024
2026
|
minWidth: 0
|
|
2025
2027
|
},
|
|
2026
|
-
children: [t && /* @__PURE__ */
|
|
2028
|
+
children: [t && /* @__PURE__ */ u("img", {
|
|
2027
2029
|
src: t,
|
|
2028
|
-
alt:
|
|
2030
|
+
alt: r ?? "",
|
|
2029
2031
|
style: {
|
|
2030
2032
|
width: f ? 160 : "100%",
|
|
2031
2033
|
aspectRatio: "3 / 2",
|
|
@@ -2034,34 +2036,34 @@ function mt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
|
|
|
2034
2036
|
flexShrink: 0,
|
|
2035
2037
|
display: "block"
|
|
2036
2038
|
}
|
|
2037
|
-
}), /* @__PURE__ */
|
|
2039
|
+
}), /* @__PURE__ */ d("div", {
|
|
2038
2040
|
style: { minWidth: 0 },
|
|
2039
2041
|
children: [
|
|
2040
|
-
|
|
2042
|
+
r && /* @__PURE__ */ u("h3", {
|
|
2041
2043
|
style: {
|
|
2042
2044
|
margin: 0,
|
|
2043
2045
|
fontSize: 18,
|
|
2044
2046
|
fontWeight: 700
|
|
2045
2047
|
},
|
|
2046
|
-
children:
|
|
2048
|
+
children: r
|
|
2047
2049
|
}),
|
|
2048
|
-
|
|
2050
|
+
c && /* @__PURE__ */ u("p", {
|
|
2049
2051
|
style: {
|
|
2050
2052
|
margin: "6px 0 0",
|
|
2051
2053
|
fontSize: 14,
|
|
2052
2054
|
lineHeight: 1.55,
|
|
2053
2055
|
opacity: .75
|
|
2054
2056
|
},
|
|
2055
|
-
children:
|
|
2057
|
+
children: c
|
|
2056
2058
|
}),
|
|
2057
|
-
a && /* @__PURE__ */
|
|
2059
|
+
a && /* @__PURE__ */ u("div", {
|
|
2058
2060
|
style: {
|
|
2059
2061
|
marginTop: 6,
|
|
2060
2062
|
fontSize: 14,
|
|
2061
2063
|
lineHeight: 1.55,
|
|
2062
2064
|
opacity: .85
|
|
2063
2065
|
},
|
|
2064
|
-
children:
|
|
2066
|
+
children: we(a)
|
|
2065
2067
|
})
|
|
2066
2068
|
]
|
|
2067
2069
|
})]
|
|
@@ -2069,12 +2071,12 @@ function mt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
|
|
|
2069
2071
|
})
|
|
2070
2072
|
});
|
|
2071
2073
|
}
|
|
2072
|
-
function
|
|
2073
|
-
return e.length ? /* @__PURE__ */
|
|
2074
|
+
function gt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
2075
|
+
return e.length ? /* @__PURE__ */ u("nav", {
|
|
2074
2076
|
ref: r,
|
|
2075
2077
|
"aria-label": "Breadcrumb",
|
|
2076
|
-
style: { ...
|
|
2077
|
-
children: /* @__PURE__ */
|
|
2078
|
+
style: { ...h(n) },
|
|
2079
|
+
children: /* @__PURE__ */ u("ol", {
|
|
2078
2080
|
style: {
|
|
2079
2081
|
display: "flex",
|
|
2080
2082
|
flexWrap: "wrap",
|
|
@@ -2087,25 +2089,25 @@ function ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2087
2089
|
},
|
|
2088
2090
|
children: e.map((n, r) => {
|
|
2089
2091
|
let i = r === e.length - 1;
|
|
2090
|
-
return /* @__PURE__ */
|
|
2092
|
+
return /* @__PURE__ */ d("li", {
|
|
2091
2093
|
style: {
|
|
2092
2094
|
display: "flex",
|
|
2093
2095
|
alignItems: "center",
|
|
2094
2096
|
gap: 8,
|
|
2095
2097
|
minWidth: 0
|
|
2096
2098
|
},
|
|
2097
|
-
children: [r > 0 && /* @__PURE__ */
|
|
2099
|
+
children: [r > 0 && /* @__PURE__ */ u("span", {
|
|
2098
2100
|
style: { opacity: .4 },
|
|
2099
2101
|
"aria-hidden": !0,
|
|
2100
2102
|
children: t
|
|
2101
|
-
}), i || !n.href ? /* @__PURE__ */
|
|
2103
|
+
}), i || !n.href ? /* @__PURE__ */ u("span", {
|
|
2102
2104
|
style: {
|
|
2103
2105
|
fontWeight: i ? 600 : 400,
|
|
2104
2106
|
opacity: i ? 1 : .7
|
|
2105
2107
|
},
|
|
2106
2108
|
"aria-current": i ? "page" : void 0,
|
|
2107
2109
|
children: n.label
|
|
2108
|
-
}) : /* @__PURE__ */
|
|
2110
|
+
}) : /* @__PURE__ */ u("a", {
|
|
2109
2111
|
href: n.href,
|
|
2110
2112
|
style: {
|
|
2111
2113
|
color: "inherit",
|
|
@@ -2119,8 +2121,8 @@ function ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2119
2121
|
})
|
|
2120
2122
|
}) : null;
|
|
2121
2123
|
}
|
|
2122
|
-
function
|
|
2123
|
-
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)) : "#",
|
|
2124
|
+
function _t({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
|
|
2125
|
+
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) => ({
|
|
2124
2126
|
display: "inline-flex",
|
|
2125
2127
|
alignItems: "center",
|
|
2126
2128
|
justifyContent: "center",
|
|
@@ -2134,7 +2136,7 @@ function gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2134
2136
|
background: e ? "var(--page-accent, #111827)" : "transparent",
|
|
2135
2137
|
border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
|
|
2136
2138
|
});
|
|
2137
|
-
return /* @__PURE__ */
|
|
2139
|
+
return /* @__PURE__ */ d("nav", {
|
|
2138
2140
|
ref: a,
|
|
2139
2141
|
"aria-label": "Pagination",
|
|
2140
2142
|
style: {
|
|
@@ -2142,29 +2144,29 @@ function gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2142
2144
|
flexWrap: "wrap",
|
|
2143
2145
|
gap: 8,
|
|
2144
2146
|
alignItems: "center",
|
|
2145
|
-
...
|
|
2147
|
+
...h(i)
|
|
2146
2148
|
},
|
|
2147
2149
|
children: [
|
|
2148
|
-
n && /* @__PURE__ */
|
|
2150
|
+
n && /* @__PURE__ */ u("a", {
|
|
2149
2151
|
href: s > 1 ? c(s - 1) : "#",
|
|
2150
2152
|
"aria-label": "Previous",
|
|
2151
2153
|
style: {
|
|
2152
|
-
...
|
|
2154
|
+
...l(!1),
|
|
2153
2155
|
opacity: s > 1 ? 1 : .4
|
|
2154
2156
|
},
|
|
2155
2157
|
children: "‹"
|
|
2156
2158
|
}),
|
|
2157
|
-
Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */
|
|
2159
|
+
Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
|
|
2158
2160
|
href: c(e),
|
|
2159
2161
|
"aria-current": e === s ? "page" : void 0,
|
|
2160
|
-
style:
|
|
2162
|
+
style: l(e === s),
|
|
2161
2163
|
children: e
|
|
2162
2164
|
}, e)),
|
|
2163
|
-
n && /* @__PURE__ */
|
|
2165
|
+
n && /* @__PURE__ */ u("a", {
|
|
2164
2166
|
href: s < o ? c(s + 1) : "#",
|
|
2165
2167
|
"aria-label": "Next",
|
|
2166
2168
|
style: {
|
|
2167
|
-
...
|
|
2169
|
+
...l(!1),
|
|
2168
2170
|
opacity: s < o ? 1 : .4
|
|
2169
2171
|
},
|
|
2170
2172
|
children: "›"
|
|
@@ -2172,7 +2174,7 @@ function gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2172
2174
|
]
|
|
2173
2175
|
});
|
|
2174
2176
|
}
|
|
2175
|
-
function
|
|
2177
|
+
function vt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
2176
2178
|
if (!t.length) return null;
|
|
2177
2179
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
2178
2180
|
width: 32,
|
|
@@ -2203,21 +2205,21 @@ function _t({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2203
2205
|
minWidth: 24
|
|
2204
2206
|
}
|
|
2205
2207
|
});
|
|
2206
|
-
return /* @__PURE__ */
|
|
2208
|
+
return /* @__PURE__ */ u("div", {
|
|
2207
2209
|
ref: a,
|
|
2208
2210
|
style: {
|
|
2209
2211
|
display: "flex",
|
|
2210
2212
|
flexDirection: r ? "column" : "row",
|
|
2211
2213
|
alignItems: r ? "stretch" : "flex-start",
|
|
2212
2214
|
gap: r ? 4 : 8,
|
|
2213
|
-
...
|
|
2215
|
+
...h(i)
|
|
2214
2216
|
},
|
|
2215
2217
|
children: t.map((t, n) => {
|
|
2216
2218
|
let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
|
|
2217
|
-
return /* @__PURE__ */
|
|
2219
|
+
return /* @__PURE__ */ d(e, { children: [n > 0 && /* @__PURE__ */ u("div", {
|
|
2218
2220
|
style: c(i <= o),
|
|
2219
2221
|
"aria-hidden": !0
|
|
2220
|
-
}), /* @__PURE__ */
|
|
2222
|
+
}), /* @__PURE__ */ d("div", {
|
|
2221
2223
|
style: {
|
|
2222
2224
|
display: "flex",
|
|
2223
2225
|
flexDirection: r ? "row" : "column",
|
|
@@ -2226,19 +2228,19 @@ function _t({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2226
2228
|
minWidth: 0,
|
|
2227
2229
|
textAlign: r ? "left" : "center"
|
|
2228
2230
|
},
|
|
2229
|
-
children: [/* @__PURE__ */
|
|
2231
|
+
children: [/* @__PURE__ */ u("div", {
|
|
2230
2232
|
style: s(a),
|
|
2231
2233
|
children: a === "done" ? "✓" : i
|
|
2232
|
-
}), /* @__PURE__ */
|
|
2234
|
+
}), /* @__PURE__ */ d("div", {
|
|
2233
2235
|
style: { minWidth: 0 },
|
|
2234
|
-
children: [/* @__PURE__ */
|
|
2236
|
+
children: [/* @__PURE__ */ u("div", {
|
|
2235
2237
|
style: {
|
|
2236
2238
|
fontSize: 13,
|
|
2237
2239
|
fontWeight: a === "active" ? 700 : 500,
|
|
2238
2240
|
opacity: a === "todo" ? .6 : 1
|
|
2239
2241
|
},
|
|
2240
2242
|
children: t.label
|
|
2241
|
-
}), t.description && /* @__PURE__ */
|
|
2243
|
+
}), t.description && /* @__PURE__ */ u("div", {
|
|
2242
2244
|
style: {
|
|
2243
2245
|
fontSize: 12,
|
|
2244
2246
|
opacity: .6
|
|
@@ -2250,7 +2252,7 @@ function _t({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2250
2252
|
})
|
|
2251
2253
|
});
|
|
2252
2254
|
}
|
|
2253
|
-
var
|
|
2255
|
+
var yt = {
|
|
2254
2256
|
small: {
|
|
2255
2257
|
w: 132,
|
|
2256
2258
|
h: 46,
|
|
@@ -2272,10 +2274,10 @@ var vt = {
|
|
|
2272
2274
|
title: 12.5,
|
|
2273
2275
|
avatar: 46
|
|
2274
2276
|
}
|
|
2275
|
-
},
|
|
2276
|
-
|
|
2277
|
-
function
|
|
2278
|
-
let r =
|
|
2277
|
+
}, bt = (e) => yt[e] ?? yt.medium;
|
|
2278
|
+
yt.medium.w, yt.medium.h;
|
|
2279
|
+
function xt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
2280
|
+
let r = bt(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 = [];
|
|
2279
2281
|
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);
|
|
2280
2282
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
2281
2283
|
if (t.has(e.id)) return 0;
|
|
@@ -2327,18 +2329,18 @@ function bt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
2327
2329
|
horizontal: n
|
|
2328
2330
|
};
|
|
2329
2331
|
}
|
|
2330
|
-
var
|
|
2332
|
+
var St = (e, t) => {
|
|
2331
2333
|
let n = String(e ?? "");
|
|
2332
2334
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
2333
|
-
},
|
|
2335
|
+
}, Ct = (e) => {
|
|
2334
2336
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
2335
2337
|
if (!t) return "#ffffff";
|
|
2336
2338
|
let n = t[1];
|
|
2337
2339
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
2338
2340
|
let r = parseInt(n, 16);
|
|
2339
2341
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
2340
|
-
},
|
|
2341
|
-
function
|
|
2342
|
+
}, wt = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
2343
|
+
function Tt(e, t = {}) {
|
|
2342
2344
|
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);
|
|
2343
2345
|
return n.map((e) => {
|
|
2344
2346
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
@@ -2353,15 +2355,15 @@ function wt(e, t = {}) {
|
|
|
2353
2355
|
};
|
|
2354
2356
|
});
|
|
2355
2357
|
}
|
|
2356
|
-
var
|
|
2358
|
+
var Et = {
|
|
2357
2359
|
size: 36,
|
|
2358
2360
|
pad: 10
|
|
2359
2361
|
};
|
|
2360
|
-
function
|
|
2361
|
-
return
|
|
2362
|
+
function Dt({ node: e, onClose: t }) {
|
|
2363
|
+
return i(() => {
|
|
2362
2364
|
let e = (e) => e.key === "Escape" && t();
|
|
2363
2365
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2364
|
-
}, [t]), /* @__PURE__ */
|
|
2366
|
+
}, [t]), /* @__PURE__ */ u("div", {
|
|
2365
2367
|
onClick: t,
|
|
2366
2368
|
role: "dialog",
|
|
2367
2369
|
"aria-modal": "true",
|
|
@@ -2376,7 +2378,7 @@ function Et({ node: e, onClose: t }) {
|
|
|
2376
2378
|
justifyContent: "center",
|
|
2377
2379
|
padding: 16
|
|
2378
2380
|
},
|
|
2379
|
-
children: /* @__PURE__ */
|
|
2381
|
+
children: /* @__PURE__ */ d("div", {
|
|
2380
2382
|
onClick: (e) => e.stopPropagation(),
|
|
2381
2383
|
style: {
|
|
2382
2384
|
background: "var(--page-bg, #ffffff)",
|
|
@@ -2391,7 +2393,7 @@ function Et({ node: e, onClose: t }) {
|
|
|
2391
2393
|
boxShadow: "0 24px 64px rgba(15, 23, 42, 0.35)"
|
|
2392
2394
|
},
|
|
2393
2395
|
children: [
|
|
2394
|
-
/* @__PURE__ */
|
|
2396
|
+
/* @__PURE__ */ u("button", {
|
|
2395
2397
|
type: "button",
|
|
2396
2398
|
"aria-label": "Close",
|
|
2397
2399
|
onClick: t,
|
|
@@ -2412,14 +2414,14 @@ function Et({ node: e, onClose: t }) {
|
|
|
2412
2414
|
},
|
|
2413
2415
|
children: "×"
|
|
2414
2416
|
}),
|
|
2415
|
-
/* @__PURE__ */
|
|
2417
|
+
/* @__PURE__ */ d("div", {
|
|
2416
2418
|
style: {
|
|
2417
2419
|
display: "flex",
|
|
2418
2420
|
alignItems: "center",
|
|
2419
2421
|
gap: 14,
|
|
2420
2422
|
marginBottom: e.cv ? 14 : 0
|
|
2421
2423
|
},
|
|
2422
|
-
children: [e.photo && /* @__PURE__ */
|
|
2424
|
+
children: [e.photo && /* @__PURE__ */ u("img", {
|
|
2423
2425
|
src: e.photo,
|
|
2424
2426
|
alt: "",
|
|
2425
2427
|
style: {
|
|
@@ -2429,15 +2431,15 @@ function Et({ node: e, onClose: t }) {
|
|
|
2429
2431
|
objectFit: "cover",
|
|
2430
2432
|
flexShrink: 0
|
|
2431
2433
|
}
|
|
2432
|
-
}), /* @__PURE__ */
|
|
2434
|
+
}), /* @__PURE__ */ d("div", {
|
|
2433
2435
|
style: { minWidth: 0 },
|
|
2434
|
-
children: [/* @__PURE__ */
|
|
2436
|
+
children: [/* @__PURE__ */ u("div", {
|
|
2435
2437
|
style: {
|
|
2436
2438
|
fontSize: 18,
|
|
2437
2439
|
fontWeight: 700
|
|
2438
2440
|
},
|
|
2439
2441
|
children: e.name
|
|
2440
|
-
}), e.title && /* @__PURE__ */
|
|
2442
|
+
}), e.title && /* @__PURE__ */ u("div", {
|
|
2441
2443
|
style: {
|
|
2442
2444
|
fontSize: 13,
|
|
2443
2445
|
opacity: .65
|
|
@@ -2446,7 +2448,7 @@ function Et({ node: e, onClose: t }) {
|
|
|
2446
2448
|
})]
|
|
2447
2449
|
})]
|
|
2448
2450
|
}),
|
|
2449
|
-
e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */
|
|
2451
|
+
e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ u("p", {
|
|
2450
2452
|
style: {
|
|
2451
2453
|
fontSize: 14,
|
|
2452
2454
|
lineHeight: 1.6,
|
|
@@ -2454,7 +2456,7 @@ function Et({ node: e, onClose: t }) {
|
|
|
2454
2456
|
},
|
|
2455
2457
|
children: e
|
|
2456
2458
|
}, t)),
|
|
2457
|
-
e.href && /* @__PURE__ */
|
|
2459
|
+
e.href && /* @__PURE__ */ u("a", {
|
|
2458
2460
|
href: e.href,
|
|
2459
2461
|
target: "_blank",
|
|
2460
2462
|
rel: "noopener noreferrer",
|
|
@@ -2475,9 +2477,9 @@ function Et({ node: e, onClose: t }) {
|
|
|
2475
2477
|
})
|
|
2476
2478
|
});
|
|
2477
2479
|
}
|
|
2478
|
-
function
|
|
2479
|
-
let x =
|
|
2480
|
-
|
|
2480
|
+
function Ot({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
|
|
2481
|
+
let x = a(), [S, C] = c(null), { tenant: w, apiUrl: T } = r(H), E = r(U)?.[t], [D, O] = c(null);
|
|
2482
|
+
i(() => {
|
|
2481
2483
|
if (!t || E) return;
|
|
2482
2484
|
let e = !0;
|
|
2483
2485
|
return fetch(`${T}/dynamic/${encodeURIComponent(t)}`, { headers: w ? { "x-tenant": w } : {} }).then((e) => e.json()).then((t) => {
|
|
@@ -2492,18 +2494,18 @@ function Dt({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
|
|
|
2492
2494
|
T,
|
|
2493
2495
|
E
|
|
2494
2496
|
]);
|
|
2495
|
-
let k = t ?
|
|
2496
|
-
nameField:
|
|
2497
|
+
let k = t ? Tt(E ?? D ?? [], {
|
|
2498
|
+
nameField: n,
|
|
2497
2499
|
titleField: o,
|
|
2498
|
-
photoField:
|
|
2500
|
+
photoField: s,
|
|
2499
2501
|
parentField: f,
|
|
2500
2502
|
cvField: p,
|
|
2501
|
-
hrefField:
|
|
2502
|
-
}) : e, A =
|
|
2503
|
+
hrefField: m
|
|
2504
|
+
}) : e, A = bt(g), { boxes: j, links: M, width: N, height: P } = xt(k, {
|
|
2503
2505
|
size: g,
|
|
2504
2506
|
horizontal: _
|
|
2505
2507
|
});
|
|
2506
|
-
if (!j.length) return !b && t ? /* @__PURE__ */
|
|
2508
|
+
if (!j.length) return !b && t ? /* @__PURE__ */ d("div", {
|
|
2507
2509
|
ref: y,
|
|
2508
2510
|
style: {
|
|
2509
2511
|
padding: 18,
|
|
@@ -2512,7 +2514,7 @@ function Dt({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
|
|
|
2512
2514
|
fontSize: 13,
|
|
2513
2515
|
opacity: .7,
|
|
2514
2516
|
textAlign: "center",
|
|
2515
|
-
...
|
|
2517
|
+
...h(v)
|
|
2516
2518
|
},
|
|
2517
2519
|
children: [
|
|
2518
2520
|
"Org Chart — no published entries in “",
|
|
@@ -2521,14 +2523,14 @@ function Dt({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
|
|
|
2521
2523
|
]
|
|
2522
2524
|
}) : null;
|
|
2523
2525
|
let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
|
|
2524
|
-
return /* @__PURE__ */
|
|
2526
|
+
return /* @__PURE__ */ d("div", {
|
|
2525
2527
|
ref: y,
|
|
2526
2528
|
style: {
|
|
2527
2529
|
maxWidth: "100%",
|
|
2528
2530
|
overflowX: "auto",
|
|
2529
|
-
...
|
|
2531
|
+
...h(v)
|
|
2530
2532
|
},
|
|
2531
|
-
children: [/* @__PURE__ */
|
|
2533
|
+
children: [/* @__PURE__ */ d("svg", {
|
|
2532
2534
|
viewBox: `0 0 ${N} ${P}`,
|
|
2533
2535
|
role: "img",
|
|
2534
2536
|
"aria-label": "Organization chart",
|
|
@@ -2539,64 +2541,64 @@ function Dt({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
|
|
|
2539
2541
|
height: "auto",
|
|
2540
2542
|
margin: "0 auto"
|
|
2541
2543
|
},
|
|
2542
|
-
children: [M.map((e, t) => /* @__PURE__ */
|
|
2544
|
+
children: [M.map((e, t) => /* @__PURE__ */ u("path", {
|
|
2543
2545
|
d: _ ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
|
|
2544
2546
|
fill: "none",
|
|
2545
2547
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
2546
2548
|
strokeWidth: "1.5"
|
|
2547
2549
|
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
2548
|
-
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 ?
|
|
2549
|
-
return /* @__PURE__ */
|
|
2550
|
+
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 ? Ct(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Ct(e.color2) : s, f = b && (wt(e) || e.href), p = () => wt(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Et.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);
|
|
2551
|
+
return /* @__PURE__ */ d("g", {
|
|
2550
2552
|
onClick: f ? p : void 0,
|
|
2551
2553
|
style: f ? { cursor: "pointer" } : void 0,
|
|
2552
2554
|
role: f ? "button" : void 0,
|
|
2553
2555
|
"aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
|
|
2554
2556
|
children: [
|
|
2555
|
-
i && e.gradient ? /* @__PURE__ */
|
|
2557
|
+
i && e.gradient ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("linearGradient", {
|
|
2556
2558
|
id: `${x}-${e.id}-grad`,
|
|
2557
2559
|
x1: "0",
|
|
2558
2560
|
y1: "0",
|
|
2559
2561
|
x2: "0",
|
|
2560
2562
|
y2: "1",
|
|
2561
|
-
children: [/* @__PURE__ */
|
|
2563
|
+
children: [/* @__PURE__ */ u("stop", {
|
|
2562
2564
|
offset: "0%",
|
|
2563
2565
|
stopColor: e.color || "var(--page-accent, #4f46e5)"
|
|
2564
|
-
}), /* @__PURE__ */
|
|
2566
|
+
}), /* @__PURE__ */ u("stop", {
|
|
2565
2567
|
offset: "100%",
|
|
2566
2568
|
stopColor: e.color2
|
|
2567
2569
|
})]
|
|
2568
|
-
}), /* @__PURE__ */
|
|
2570
|
+
}), /* @__PURE__ */ u("rect", {
|
|
2569
2571
|
x: t,
|
|
2570
2572
|
y: n,
|
|
2571
2573
|
width: A.w,
|
|
2572
2574
|
height: A.h,
|
|
2573
2575
|
rx: "10",
|
|
2574
2576
|
fill: `url(#${x}-${e.id}-grad)`
|
|
2575
|
-
})] }) : i ? /* @__PURE__ */
|
|
2577
|
+
})] }) : i ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
2576
2578
|
id: `${x}-${e.id}-box`,
|
|
2577
|
-
children: /* @__PURE__ */
|
|
2579
|
+
children: /* @__PURE__ */ u("rect", {
|
|
2578
2580
|
x: t,
|
|
2579
2581
|
y: n,
|
|
2580
2582
|
width: A.w,
|
|
2581
2583
|
height: A.h,
|
|
2582
2584
|
rx: "10"
|
|
2583
2585
|
})
|
|
2584
|
-
}), /* @__PURE__ */
|
|
2586
|
+
}), /* @__PURE__ */ d("g", {
|
|
2585
2587
|
clipPath: `url(#${x}-${e.id}-box)`,
|
|
2586
|
-
children: [/* @__PURE__ */
|
|
2588
|
+
children: [/* @__PURE__ */ u("rect", {
|
|
2587
2589
|
x: t,
|
|
2588
2590
|
y: n,
|
|
2589
2591
|
width: A.w,
|
|
2590
2592
|
height: _,
|
|
2591
2593
|
fill: o
|
|
2592
|
-
}), /* @__PURE__ */
|
|
2594
|
+
}), /* @__PURE__ */ u("rect", {
|
|
2593
2595
|
x: t,
|
|
2594
2596
|
y: n + _,
|
|
2595
2597
|
width: A.w,
|
|
2596
2598
|
height: A.h - _,
|
|
2597
2599
|
fill: e.color2
|
|
2598
2600
|
})]
|
|
2599
|
-
})] }) : /* @__PURE__ */
|
|
2601
|
+
})] }) : /* @__PURE__ */ u("rect", {
|
|
2600
2602
|
x: t,
|
|
2601
2603
|
y: n,
|
|
2602
2604
|
width: A.w,
|
|
@@ -2606,94 +2608,94 @@ function Dt({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
|
|
|
2606
2608
|
stroke: a ? "none" : "var(--page-accent, #4f46e5)",
|
|
2607
2609
|
strokeWidth: a ? 0 : 1.5
|
|
2608
2610
|
}),
|
|
2609
|
-
e.photo && /* @__PURE__ */
|
|
2611
|
+
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
2610
2612
|
id: `${x}-${e.id}`,
|
|
2611
|
-
children: /* @__PURE__ */
|
|
2612
|
-
cx: t +
|
|
2613
|
+
children: /* @__PURE__ */ u("circle", {
|
|
2614
|
+
cx: t + Et.pad + A.avatar / 2,
|
|
2613
2615
|
cy: n + A.h / 2,
|
|
2614
2616
|
r: A.avatar / 2
|
|
2615
2617
|
})
|
|
2616
|
-
}), /* @__PURE__ */
|
|
2618
|
+
}), /* @__PURE__ */ u("image", {
|
|
2617
2619
|
href: e.photo,
|
|
2618
|
-
x: t +
|
|
2620
|
+
x: t + Et.pad,
|
|
2619
2621
|
y: n + (A.h - A.avatar) / 2,
|
|
2620
2622
|
width: A.avatar,
|
|
2621
2623
|
height: A.avatar,
|
|
2622
2624
|
preserveAspectRatio: "xMidYMid slice",
|
|
2623
2625
|
clipPath: `url(#${x}-${e.id})`
|
|
2624
2626
|
})] }),
|
|
2625
|
-
i && !e.gradient ? /* @__PURE__ */
|
|
2627
|
+
i && !e.gradient ? /* @__PURE__ */ d(l, { children: [e.title && /* @__PURE__ */ u("text", {
|
|
2626
2628
|
x: m,
|
|
2627
2629
|
y: n + _ / 2 + A.title * .35,
|
|
2628
2630
|
textAnchor: h,
|
|
2629
2631
|
fontSize: A.title,
|
|
2630
2632
|
fontWeight: "600",
|
|
2631
2633
|
fill: s,
|
|
2632
|
-
children:
|
|
2633
|
-
}), e.name && /* @__PURE__ */
|
|
2634
|
+
children: St(e.title, g + 4)
|
|
2635
|
+
}), e.name && /* @__PURE__ */ u("text", {
|
|
2634
2636
|
x: m,
|
|
2635
2637
|
y: n + _ + _ / 2 + A.name * .35,
|
|
2636
2638
|
textAnchor: h,
|
|
2637
2639
|
fontSize: A.name,
|
|
2638
2640
|
fontWeight: "600",
|
|
2639
|
-
fill:
|
|
2640
|
-
children:
|
|
2641
|
-
})] }) : /* @__PURE__ */
|
|
2641
|
+
fill: c,
|
|
2642
|
+
children: St(e.name, g)
|
|
2643
|
+
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
2642
2644
|
x: m,
|
|
2643
2645
|
y: n + (v[1] ? A.h * .43 : A.h * .57),
|
|
2644
2646
|
textAnchor: h,
|
|
2645
2647
|
fontSize: A.name,
|
|
2646
2648
|
fontWeight: "600",
|
|
2647
2649
|
fill: s,
|
|
2648
|
-
children:
|
|
2649
|
-
}), v[1] && /* @__PURE__ */
|
|
2650
|
+
children: St(v[0], g)
|
|
2651
|
+
}), v[1] && /* @__PURE__ */ u("text", {
|
|
2650
2652
|
x: m,
|
|
2651
2653
|
y: n + A.h * .73,
|
|
2652
2654
|
textAnchor: h,
|
|
2653
2655
|
fontSize: A.title,
|
|
2654
2656
|
opacity: "0.7",
|
|
2655
2657
|
fill: s,
|
|
2656
|
-
children:
|
|
2658
|
+
children: St(v[1], g + 4)
|
|
2657
2659
|
})] })
|
|
2658
2660
|
]
|
|
2659
2661
|
}, e.id);
|
|
2660
2662
|
})]
|
|
2661
|
-
}), S && /* @__PURE__ */
|
|
2663
|
+
}), S && /* @__PURE__ */ u(Dt, {
|
|
2662
2664
|
node: S,
|
|
2663
2665
|
onClose: () => C(null)
|
|
2664
2666
|
})]
|
|
2665
2667
|
});
|
|
2666
2668
|
}
|
|
2667
|
-
function
|
|
2668
|
-
let { tenant:
|
|
2669
|
-
if (
|
|
2670
|
-
if (!
|
|
2671
|
-
let e = !0, t =
|
|
2672
|
-
return fetch(t, { headers:
|
|
2669
|
+
function kt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, style: f, nodeRef: p }) {
|
|
2670
|
+
let { tenant: m, apiUrl: g } = r(H), _ = r(U)?.[n], [v, y] = c(null);
|
|
2671
|
+
if (i(() => {
|
|
2672
|
+
if (!n || _) return;
|
|
2673
|
+
let e = !0, t = n.startsWith("api:") ? `${g}/data/${encodeURIComponent(n.slice(4))}` : `${g}/dynamic/${encodeURIComponent(n)}`;
|
|
2674
|
+
return fetch(t, { headers: m ? { "x-tenant": m } : {} }).then((e) => e.json()).then((t) => e && y(Array.isArray(t?.payload) ? t.payload : [])).catch(() => e && y([])), () => {
|
|
2673
2675
|
e = !1;
|
|
2674
2676
|
};
|
|
2675
2677
|
}, [
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
+
n,
|
|
2679
|
+
m,
|
|
2678
2680
|
g,
|
|
2679
2681
|
_
|
|
2680
2682
|
]), !e.length) return null;
|
|
2681
|
-
let b =
|
|
2682
|
-
return /* @__PURE__ */
|
|
2683
|
+
let b = n ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, S = l ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = s ? { border: C } : { borderBottom: C };
|
|
2684
|
+
return /* @__PURE__ */ u("div", {
|
|
2683
2685
|
ref: p,
|
|
2684
2686
|
style: {
|
|
2685
2687
|
width: "100%",
|
|
2686
2688
|
overflowX: "auto",
|
|
2687
|
-
...
|
|
2689
|
+
...h(f)
|
|
2688
2690
|
},
|
|
2689
|
-
children: /* @__PURE__ */
|
|
2691
|
+
children: /* @__PURE__ */ d("table", {
|
|
2690
2692
|
style: {
|
|
2691
2693
|
width: "100%",
|
|
2692
2694
|
borderCollapse: "collapse",
|
|
2693
2695
|
fontSize: 14,
|
|
2694
|
-
...
|
|
2696
|
+
...s ? { border: C } : {}
|
|
2695
2697
|
},
|
|
2696
|
-
children: [/* @__PURE__ */
|
|
2698
|
+
children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("th", {
|
|
2697
2699
|
style: {
|
|
2698
2700
|
textAlign: "left",
|
|
2699
2701
|
fontWeight: 600,
|
|
@@ -2702,9 +2704,9 @@ function Ot({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
|
|
|
2702
2704
|
...w
|
|
2703
2705
|
},
|
|
2704
2706
|
children: e.label ?? e
|
|
2705
|
-
}, t)) }) }), /* @__PURE__ */
|
|
2707
|
+
}, t)) }) }), /* @__PURE__ */ u("tbody", { children: x.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
2706
2708
|
style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
2707
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
2709
|
+
children: e.map((e, n) => /* @__PURE__ */ u("td", {
|
|
2708
2710
|
style: {
|
|
2709
2711
|
padding: S,
|
|
2710
2712
|
...w
|
|
@@ -2715,56 +2717,311 @@ function Ot({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
|
|
|
2715
2717
|
})
|
|
2716
2718
|
});
|
|
2717
2719
|
}
|
|
2718
|
-
var
|
|
2719
|
-
PageRoot:
|
|
2720
|
-
Section:
|
|
2721
|
-
Container:
|
|
2722
|
-
Heading:
|
|
2723
|
-
TextBlock:
|
|
2724
|
-
ButtonBlock:
|
|
2725
|
-
ImageBlock:
|
|
2726
|
-
Spacer:
|
|
2727
|
-
Divider:
|
|
2728
|
-
SliderBlock:
|
|
2729
|
-
CanvasSlider:
|
|
2730
|
-
TabsBlock:
|
|
2731
|
-
QuickStack:
|
|
2732
|
-
CollectionList:
|
|
2733
|
-
BreadcrumbsBlock:
|
|
2734
|
-
PaginationBlock:
|
|
2735
|
-
StepperBlock:
|
|
2736
|
-
OrgChartBlock:
|
|
2737
|
-
TableBlock:
|
|
2738
|
-
AccordionBlock:
|
|
2739
|
-
NavbarBlock:
|
|
2740
|
-
ListBlock:
|
|
2741
|
-
TextSpan:
|
|
2742
|
-
QuoteBlock:
|
|
2743
|
-
TextLink:
|
|
2744
|
-
RichTextBlock:
|
|
2745
|
-
RichContentBlock:
|
|
2746
|
-
VideoBlock:
|
|
2747
|
-
YouTubeBlock:
|
|
2748
|
-
IframeBlock:
|
|
2749
|
-
EmbedBlock:
|
|
2750
|
-
FormBlock:
|
|
2751
|
-
FormLabel:
|
|
2752
|
-
FormInput:
|
|
2753
|
-
FormTextarea:
|
|
2754
|
-
FormCheckbox: (e) => /* @__PURE__ */
|
|
2720
|
+
var At = {
|
|
2721
|
+
PageRoot: he,
|
|
2722
|
+
Section: ge,
|
|
2723
|
+
Container: _e,
|
|
2724
|
+
Heading: ve,
|
|
2725
|
+
TextBlock: ke,
|
|
2726
|
+
ButtonBlock: Me,
|
|
2727
|
+
ImageBlock: Ne,
|
|
2728
|
+
Spacer: ze,
|
|
2729
|
+
Divider: Be,
|
|
2730
|
+
SliderBlock: Ke,
|
|
2731
|
+
CanvasSlider: qe,
|
|
2732
|
+
TabsBlock: Ze,
|
|
2733
|
+
QuickStack: mt,
|
|
2734
|
+
CollectionList: ht,
|
|
2735
|
+
BreadcrumbsBlock: gt,
|
|
2736
|
+
PaginationBlock: _t,
|
|
2737
|
+
StepperBlock: vt,
|
|
2738
|
+
OrgChartBlock: Ot,
|
|
2739
|
+
TableBlock: kt,
|
|
2740
|
+
AccordionBlock: Qe,
|
|
2741
|
+
NavbarBlock: Xe,
|
|
2742
|
+
ListBlock: Oe,
|
|
2743
|
+
TextSpan: xe,
|
|
2744
|
+
QuoteBlock: De,
|
|
2745
|
+
TextLink: je,
|
|
2746
|
+
RichTextBlock: Te,
|
|
2747
|
+
RichContentBlock: Te,
|
|
2748
|
+
VideoBlock: Pe,
|
|
2749
|
+
YouTubeBlock: Ie,
|
|
2750
|
+
IframeBlock: Le,
|
|
2751
|
+
EmbedBlock: Re,
|
|
2752
|
+
FormBlock: ot,
|
|
2753
|
+
FormLabel: st,
|
|
2754
|
+
FormInput: ct,
|
|
2755
|
+
FormTextarea: lt,
|
|
2756
|
+
FormCheckbox: (e) => /* @__PURE__ */ u(ut, {
|
|
2755
2757
|
kind: "checkbox",
|
|
2756
2758
|
...e
|
|
2757
2759
|
}),
|
|
2758
|
-
FormRadio: (e) => /* @__PURE__ */
|
|
2760
|
+
FormRadio: (e) => /* @__PURE__ */ u(ut, {
|
|
2759
2761
|
kind: "radio",
|
|
2760
2762
|
...e
|
|
2761
2763
|
}),
|
|
2762
|
-
FormSelect:
|
|
2763
|
-
FormFile:
|
|
2764
|
-
FormSubmit:
|
|
2764
|
+
FormSelect: dt,
|
|
2765
|
+
FormFile: ft,
|
|
2766
|
+
FormSubmit: pt
|
|
2767
|
+
}, jt = {
|
|
2768
|
+
id: "auth",
|
|
2769
|
+
label: "Accounts",
|
|
2770
|
+
category: "Apps",
|
|
2771
|
+
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
2772
|
+
ssr: "shell",
|
|
2773
|
+
settings: ["apps.auth.redirect"]
|
|
2774
|
+
}, Mt = t({
|
|
2775
|
+
user: null,
|
|
2776
|
+
status: "loading",
|
|
2777
|
+
refresh: () => {},
|
|
2778
|
+
signOut: () => {}
|
|
2779
|
+
}), Nt = () => r(Mt);
|
|
2780
|
+
function Pt({ children: e, initialUser: t, disabled: a, apiUrl: s, tenant: l }) {
|
|
2781
|
+
let d = r(H), f = s || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : a ? "guest" : "loading"), v = n((e, t) => fetch(`${f}${e}`, {
|
|
2782
|
+
...t,
|
|
2783
|
+
credentials: "include",
|
|
2784
|
+
headers: {
|
|
2785
|
+
"content-type": "application/json",
|
|
2786
|
+
...p ? { "x-tenant": p } : {},
|
|
2787
|
+
...t?.headers
|
|
2788
|
+
}
|
|
2789
|
+
}), [f, p]), y = n(() => a ? Promise.resolve(null) : v("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
|
|
2790
|
+
let t = e?.payload ?? null;
|
|
2791
|
+
return h(t), _(t ? "user" : "guest"), t;
|
|
2792
|
+
}).catch(() => (h(null), _("guest"), null)), [v, a]), b = n(() => v("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
2793
|
+
h(null), _("guest");
|
|
2794
|
+
}), [v]);
|
|
2795
|
+
i(() => {
|
|
2796
|
+
a || t || y();
|
|
2797
|
+
}, [
|
|
2798
|
+
a,
|
|
2799
|
+
t,
|
|
2800
|
+
y
|
|
2801
|
+
]);
|
|
2802
|
+
let x = o(() => ({
|
|
2803
|
+
user: m,
|
|
2804
|
+
status: g,
|
|
2805
|
+
refresh: y,
|
|
2806
|
+
signOut: b
|
|
2807
|
+
}), [
|
|
2808
|
+
m,
|
|
2809
|
+
g,
|
|
2810
|
+
y,
|
|
2811
|
+
b
|
|
2812
|
+
]);
|
|
2813
|
+
return /* @__PURE__ */ u(Mt.Provider, {
|
|
2814
|
+
value: x,
|
|
2815
|
+
children: e
|
|
2816
|
+
});
|
|
2817
|
+
}
|
|
2818
|
+
function Ft({ when: e, children: t }) {
|
|
2819
|
+
let { status: n } = Nt();
|
|
2820
|
+
return !e || e === "always" ? t : n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
2821
|
+
}
|
|
2822
|
+
//#endregion
|
|
2823
|
+
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
2824
|
+
function It({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
|
|
2825
|
+
let { tenant: g, apiUrl: _, settings: v } = r(H), [y, b] = c("form"), [x, S] = c(""), [C, w] = c(!1), T = e === "register", E = f ? m || "form" : y, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
|
|
2826
|
+
if (e.preventDefault(), f) return;
|
|
2827
|
+
let n = new FormData(e.currentTarget);
|
|
2828
|
+
w(!0), S("");
|
|
2829
|
+
try {
|
|
2830
|
+
let e = await fetch(`${_ || "/api"}/site/${T ? "register" : "login"}`, {
|
|
2831
|
+
method: "post",
|
|
2832
|
+
headers: {
|
|
2833
|
+
"content-type": "application/json",
|
|
2834
|
+
...g ? { "x-tenant": g } : {}
|
|
2835
|
+
},
|
|
2836
|
+
credentials: "same-origin",
|
|
2837
|
+
body: JSON.stringify({
|
|
2838
|
+
email: n.get("email"),
|
|
2839
|
+
password: n.get("password"),
|
|
2840
|
+
...T ? { name: n.get("name") || "" } : {}
|
|
2841
|
+
})
|
|
2842
|
+
}), r = await e.json().catch(() => null);
|
|
2843
|
+
if (!e.ok || r?.success === !1) {
|
|
2844
|
+
S(r?.error?.message || "Sign-in failed"), b("error"), w(!1);
|
|
2845
|
+
return;
|
|
2846
|
+
}
|
|
2847
|
+
if (b("success"), typeof window < "u") {
|
|
2848
|
+
let e = D(t) || D(new URLSearchParams(window.location.search).get("next")) || D(v?.["apps.auth.redirect"]) || "/";
|
|
2849
|
+
window.location.assign(e);
|
|
2850
|
+
}
|
|
2851
|
+
} catch {
|
|
2852
|
+
S("Sign-in failed"), b("error"), w(!1);
|
|
2853
|
+
}
|
|
2854
|
+
};
|
|
2855
|
+
return /* @__PURE__ */ d("div", {
|
|
2856
|
+
ref: l,
|
|
2857
|
+
style: {
|
|
2858
|
+
display: "grid",
|
|
2859
|
+
gap: 12,
|
|
2860
|
+
maxWidth: 360,
|
|
2861
|
+
...h(s)
|
|
2862
|
+
},
|
|
2863
|
+
children: [
|
|
2864
|
+
/* @__PURE__ */ d("form", {
|
|
2865
|
+
onSubmit: O,
|
|
2866
|
+
style: {
|
|
2867
|
+
display: E === "form" ? "grid" : "none",
|
|
2868
|
+
gap: 10
|
|
2869
|
+
},
|
|
2870
|
+
children: [
|
|
2871
|
+
T ? /* @__PURE__ */ d("label", {
|
|
2872
|
+
style: {
|
|
2873
|
+
...X,
|
|
2874
|
+
display: "grid",
|
|
2875
|
+
gap: 6
|
|
2876
|
+
},
|
|
2877
|
+
children: [a, /* @__PURE__ */ u("input", {
|
|
2878
|
+
name: "name",
|
|
2879
|
+
type: "text",
|
|
2880
|
+
style: Z,
|
|
2881
|
+
...Q(f)
|
|
2882
|
+
})]
|
|
2883
|
+
}) : null,
|
|
2884
|
+
/* @__PURE__ */ d("label", {
|
|
2885
|
+
style: {
|
|
2886
|
+
...X,
|
|
2887
|
+
display: "grid",
|
|
2888
|
+
gap: 6
|
|
2889
|
+
},
|
|
2890
|
+
children: [n, /* @__PURE__ */ u("input", {
|
|
2891
|
+
name: "email",
|
|
2892
|
+
type: "email",
|
|
2893
|
+
required: !f,
|
|
2894
|
+
style: Z,
|
|
2895
|
+
...Q(f)
|
|
2896
|
+
})]
|
|
2897
|
+
}),
|
|
2898
|
+
/* @__PURE__ */ d("label", {
|
|
2899
|
+
style: {
|
|
2900
|
+
...X,
|
|
2901
|
+
display: "grid",
|
|
2902
|
+
gap: 6
|
|
2903
|
+
},
|
|
2904
|
+
children: [i, /* @__PURE__ */ u("input", {
|
|
2905
|
+
name: "password",
|
|
2906
|
+
type: "password",
|
|
2907
|
+
required: !f,
|
|
2908
|
+
style: Z,
|
|
2909
|
+
...Q(f)
|
|
2910
|
+
})]
|
|
2911
|
+
}),
|
|
2912
|
+
/* @__PURE__ */ u("button", {
|
|
2913
|
+
type: f ? "button" : "submit",
|
|
2914
|
+
disabled: C || void 0,
|
|
2915
|
+
style: {
|
|
2916
|
+
...J,
|
|
2917
|
+
border: 0,
|
|
2918
|
+
padding: "10px 22px",
|
|
2919
|
+
borderRadius: 8,
|
|
2920
|
+
fontSize: 15,
|
|
2921
|
+
fontWeight: 600,
|
|
2922
|
+
cursor: "pointer",
|
|
2923
|
+
opacity: C ? .6 : 1
|
|
2924
|
+
},
|
|
2925
|
+
children: o || (T ? "Create account" : "Sign in")
|
|
2926
|
+
}),
|
|
2927
|
+
x ? /* @__PURE__ */ u("p", {
|
|
2928
|
+
style: {
|
|
2929
|
+
margin: 0,
|
|
2930
|
+
fontSize: 14,
|
|
2931
|
+
color: "#dc2626"
|
|
2932
|
+
},
|
|
2933
|
+
children: x
|
|
2934
|
+
}) : null
|
|
2935
|
+
]
|
|
2936
|
+
}),
|
|
2937
|
+
/* @__PURE__ */ u("div", {
|
|
2938
|
+
style: { display: E === "success" ? "block" : "none" },
|
|
2939
|
+
children: p?.success ?? null
|
|
2940
|
+
}),
|
|
2941
|
+
/* @__PURE__ */ u("div", {
|
|
2942
|
+
style: { display: E === "error" ? "block" : "none" },
|
|
2943
|
+
children: p?.error ?? null
|
|
2944
|
+
})
|
|
2945
|
+
]
|
|
2946
|
+
});
|
|
2947
|
+
}
|
|
2948
|
+
function Lt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
2949
|
+
let { user: c, status: l, signOut: f } = Nt(), p = a ? s || "user" : l, m = a ? {
|
|
2950
|
+
name: "Ada Lovelace",
|
|
2951
|
+
email: "ada@example.com"
|
|
2952
|
+
} : c;
|
|
2953
|
+
return p === "loading" ? /* @__PURE__ */ u("div", {
|
|
2954
|
+
ref: i,
|
|
2955
|
+
style: {
|
|
2956
|
+
minHeight: 24,
|
|
2957
|
+
...h(r)
|
|
2958
|
+
}
|
|
2959
|
+
}) : p === "user" ? /* @__PURE__ */ d("div", {
|
|
2960
|
+
ref: i,
|
|
2961
|
+
style: {
|
|
2962
|
+
display: "flex",
|
|
2963
|
+
alignItems: "center",
|
|
2964
|
+
gap: 10,
|
|
2965
|
+
...h(r)
|
|
2966
|
+
},
|
|
2967
|
+
children: [
|
|
2968
|
+
/* @__PURE__ */ d("span", {
|
|
2969
|
+
style: {
|
|
2970
|
+
...X,
|
|
2971
|
+
fontWeight: 600
|
|
2972
|
+
},
|
|
2973
|
+
children: [
|
|
2974
|
+
e,
|
|
2975
|
+
" ",
|
|
2976
|
+
m?.name || m?.email || ""
|
|
2977
|
+
]
|
|
2978
|
+
}),
|
|
2979
|
+
n && m?.email ? /* @__PURE__ */ u("span", {
|
|
2980
|
+
style: {
|
|
2981
|
+
...X,
|
|
2982
|
+
opacity: .7
|
|
2983
|
+
},
|
|
2984
|
+
children: m.email
|
|
2985
|
+
}) : null,
|
|
2986
|
+
/* @__PURE__ */ u("button", {
|
|
2987
|
+
type: "button",
|
|
2988
|
+
onClick: a ? void 0 : f,
|
|
2989
|
+
style: {
|
|
2990
|
+
...J,
|
|
2991
|
+
border: 0,
|
|
2992
|
+
padding: "8px 16px",
|
|
2993
|
+
borderRadius: 8,
|
|
2994
|
+
fontSize: 14,
|
|
2995
|
+
cursor: a ? "default" : "pointer"
|
|
2996
|
+
},
|
|
2997
|
+
...Q(a),
|
|
2998
|
+
children: t
|
|
2999
|
+
})
|
|
3000
|
+
]
|
|
3001
|
+
}) : /* @__PURE__ */ u("div", {
|
|
3002
|
+
ref: i,
|
|
3003
|
+
style: {
|
|
3004
|
+
display: "flex",
|
|
3005
|
+
alignItems: "center",
|
|
3006
|
+
gap: 10,
|
|
3007
|
+
...h(r)
|
|
3008
|
+
},
|
|
3009
|
+
children: o?.signedOut ?? null
|
|
3010
|
+
});
|
|
3011
|
+
}
|
|
3012
|
+
//#endregion
|
|
3013
|
+
//#region ../ui/src/components/builder/apps/index.js
|
|
3014
|
+
var Rt = [jt], zt = {
|
|
3015
|
+
SiteLoginForm: It,
|
|
3016
|
+
SiteAccountMenu: Lt
|
|
2765
3017
|
};
|
|
3018
|
+
new Set(Rt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
2766
3019
|
//#endregion
|
|
2767
3020
|
//#region ../ui/src/components/builder/render.jsx
|
|
3021
|
+
var Bt = {
|
|
3022
|
+
...At,
|
|
3023
|
+
...zt
|
|
3024
|
+
};
|
|
2768
3025
|
function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
2769
3026
|
let o = n[t];
|
|
2770
3027
|
if (!o || o.hidden) return null;
|
|
@@ -2773,99 +3030,110 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
2773
3030
|
let n = o.props?.componentId, s = r?.[n];
|
|
2774
3031
|
if (!s?.template || i.has(n)) return null;
|
|
2775
3032
|
let c = new Set(i).add(n);
|
|
2776
|
-
return /* @__PURE__ */
|
|
3033
|
+
return /* @__PURE__ */ u(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
2777
3034
|
}
|
|
2778
|
-
let
|
|
2779
|
-
if (!
|
|
2780
|
-
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
|
|
2781
|
-
return /* @__PURE__ */ l(u, {
|
|
3035
|
+
let l = Bt[s];
|
|
3036
|
+
if (!l) return null;
|
|
3037
|
+
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, m = /* @__PURE__ */ u(l, {
|
|
2782
3038
|
...c,
|
|
2783
3039
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
2784
3040
|
linked: p,
|
|
2785
3041
|
nodeRef: (e) => {
|
|
2786
|
-
e && (e.setAttribute("data-wb", t),
|
|
3042
|
+
e && (e.setAttribute("data-wb", t), y(e, c));
|
|
2787
3043
|
},
|
|
2788
3044
|
children: d.length ? d : void 0
|
|
2789
3045
|
}, t);
|
|
3046
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(Ft, {
|
|
3047
|
+
when: c.when,
|
|
3048
|
+
children: m
|
|
3049
|
+
}, t) : m;
|
|
2790
3050
|
}
|
|
2791
3051
|
//#endregion
|
|
2792
3052
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
2793
|
-
var
|
|
2794
|
-
function
|
|
2795
|
-
let
|
|
2796
|
-
if (
|
|
2797
|
-
if (!
|
|
3053
|
+
var Vt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
|
|
3054
|
+
function Ht({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: g }) {
|
|
3055
|
+
let _ = s?.js?.trim();
|
|
3056
|
+
if (i(() => {
|
|
3057
|
+
if (!_) return;
|
|
2798
3058
|
let e = document.createElement("script");
|
|
2799
|
-
return e.text =
|
|
2800
|
-
}, [
|
|
2801
|
-
let
|
|
3059
|
+
return e.text = _, document.body.appendChild(e), () => e.remove();
|
|
3060
|
+
}, [_]), !e?.ROOT) return null;
|
|
3061
|
+
let v = {
|
|
2802
3062
|
lang: p || void 0,
|
|
2803
3063
|
dir: oe(m, p)
|
|
2804
|
-
},
|
|
3064
|
+
}, y = {
|
|
2805
3065
|
minHeight: "100%",
|
|
2806
3066
|
display: "flex",
|
|
2807
3067
|
flexDirection: "column"
|
|
2808
|
-
},
|
|
3068
|
+
}, b = $("ROOT", e, n), x = o(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), S = D(e, n), C = E(e, n), w = s?.css?.trim(), T = re(e, n).map((e) => /* @__PURE__ */ u("link", {
|
|
2809
3069
|
rel: "stylesheet",
|
|
2810
3070
|
precedence: "default",
|
|
2811
|
-
href:
|
|
3071
|
+
href: V(e)
|
|
2812
3072
|
}, e));
|
|
2813
|
-
if (
|
|
3073
|
+
if (r !== "auto") return /* @__PURE__ */ u(H.Provider, {
|
|
2814
3074
|
value: {
|
|
2815
3075
|
tenant: c || "",
|
|
2816
|
-
apiUrl:
|
|
2817
|
-
locale: p || ""
|
|
3076
|
+
apiUrl: l || "/api",
|
|
3077
|
+
locale: p || "",
|
|
3078
|
+
settings: h ?? null
|
|
2818
3079
|
},
|
|
2819
|
-
children: /* @__PURE__ */
|
|
2820
|
-
|
|
2821
|
-
children: /* @__PURE__ */
|
|
2822
|
-
value:
|
|
2823
|
-
children: /* @__PURE__ */ u(
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
...
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
3080
|
+
children: /* @__PURE__ */ u(Pt, {
|
|
3081
|
+
initialUser: g,
|
|
3082
|
+
children: /* @__PURE__ */ u(U.Provider, {
|
|
3083
|
+
value: f ?? null,
|
|
3084
|
+
children: /* @__PURE__ */ u(W.Provider, {
|
|
3085
|
+
value: x,
|
|
3086
|
+
children: /* @__PURE__ */ d("div", {
|
|
3087
|
+
...v,
|
|
3088
|
+
style: {
|
|
3089
|
+
...y,
|
|
3090
|
+
...L(t, r),
|
|
3091
|
+
...a
|
|
3092
|
+
},
|
|
3093
|
+
children: [
|
|
3094
|
+
T,
|
|
3095
|
+
S && /* @__PURE__ */ u("style", { children: S }),
|
|
3096
|
+
C && /* @__PURE__ */ u("style", { children: C }),
|
|
3097
|
+
w && /* @__PURE__ */ u("style", { children: w }),
|
|
3098
|
+
b
|
|
3099
|
+
]
|
|
3100
|
+
})
|
|
2837
3101
|
})
|
|
2838
3102
|
})
|
|
2839
3103
|
})
|
|
2840
3104
|
});
|
|
2841
|
-
let
|
|
2842
|
-
return /* @__PURE__ */
|
|
3105
|
+
let O = P(t);
|
|
3106
|
+
return /* @__PURE__ */ u(H.Provider, {
|
|
2843
3107
|
value: {
|
|
2844
3108
|
tenant: c || "",
|
|
2845
|
-
apiUrl:
|
|
2846
|
-
locale: p || ""
|
|
3109
|
+
apiUrl: l || "/api",
|
|
3110
|
+
locale: p || "",
|
|
3111
|
+
settings: h ?? null
|
|
2847
3112
|
},
|
|
2848
|
-
children: /* @__PURE__ */
|
|
2849
|
-
|
|
2850
|
-
children: /* @__PURE__ */
|
|
2851
|
-
value:
|
|
2852
|
-
children: /* @__PURE__ */ u(
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
|
|
2856
|
-
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
3113
|
+
children: /* @__PURE__ */ u(Pt, {
|
|
3114
|
+
initialUser: g,
|
|
3115
|
+
children: /* @__PURE__ */ u(U.Provider, {
|
|
3116
|
+
value: f ?? null,
|
|
3117
|
+
children: /* @__PURE__ */ u(W.Provider, {
|
|
3118
|
+
value: x,
|
|
3119
|
+
children: /* @__PURE__ */ d("div", {
|
|
3120
|
+
...v,
|
|
3121
|
+
className: "webim-page",
|
|
3122
|
+
style: {
|
|
3123
|
+
...y,
|
|
3124
|
+
...I(t),
|
|
3125
|
+
...a
|
|
3126
|
+
},
|
|
3127
|
+
children: [
|
|
3128
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${Vt(F(O.light))} }
|
|
3129
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Vt(F(O.dark))} } }` }),
|
|
3130
|
+
T,
|
|
3131
|
+
S && /* @__PURE__ */ u("style", { children: S }),
|
|
3132
|
+
C && /* @__PURE__ */ u("style", { children: C }),
|
|
3133
|
+
w && /* @__PURE__ */ u("style", { children: w }),
|
|
3134
|
+
b
|
|
3135
|
+
]
|
|
3136
|
+
})
|
|
2869
3137
|
})
|
|
2870
3138
|
})
|
|
2871
3139
|
})
|
|
@@ -2873,8 +3141,8 @@ function jt({ blocks: e, theme: t, components: n, mode: i = "auto", style: o, cu
|
|
|
2873
3141
|
}
|
|
2874
3142
|
//#endregion
|
|
2875
3143
|
//#region src/WebimContent.jsx
|
|
2876
|
-
function
|
|
2877
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */
|
|
3144
|
+
function Ut({ bundle: e, mode: t = "auto", style: n }) {
|
|
3145
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(Ht, {
|
|
2878
3146
|
blocks: e.blocks,
|
|
2879
3147
|
theme: e.theme,
|
|
2880
3148
|
components: e.components,
|
|
@@ -2884,54 +3152,55 @@ function Mt({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
2884
3152
|
datasets: e.datasets,
|
|
2885
3153
|
locale: e.locale,
|
|
2886
3154
|
direction: e.direction,
|
|
3155
|
+
settings: e.settings,
|
|
2887
3156
|
mode: t,
|
|
2888
3157
|
style: n
|
|
2889
3158
|
}) : null;
|
|
2890
3159
|
}
|
|
2891
3160
|
//#endregion
|
|
2892
3161
|
//#region src/WebimPage.jsx
|
|
2893
|
-
function
|
|
2894
|
-
let [g, _] =
|
|
3162
|
+
function Wt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
|
|
3163
|
+
let [g, _] = c({ status: "loading" }), v = s({
|
|
2895
3164
|
onLoad: m,
|
|
2896
3165
|
onError: h
|
|
2897
3166
|
});
|
|
2898
3167
|
return v.current = {
|
|
2899
3168
|
onLoad: m,
|
|
2900
3169
|
onError: h
|
|
2901
|
-
},
|
|
2902
|
-
let
|
|
2903
|
-
return _({ status: "loading" }),
|
|
3170
|
+
}, i(() => {
|
|
3171
|
+
let i = !0;
|
|
3172
|
+
return _({ status: "loading" }), B({
|
|
2904
3173
|
apiUrl: e,
|
|
2905
3174
|
tenant: t,
|
|
2906
3175
|
slug: n,
|
|
2907
|
-
locale:
|
|
3176
|
+
locale: r,
|
|
2908
3177
|
preview: a,
|
|
2909
|
-
token:
|
|
3178
|
+
token: o
|
|
2910
3179
|
}).then((e) => {
|
|
2911
|
-
|
|
3180
|
+
i && (_({
|
|
2912
3181
|
status: "ready",
|
|
2913
3182
|
bundle: e
|
|
2914
3183
|
}), v.current.onLoad?.(e));
|
|
2915
3184
|
}).catch((e) => {
|
|
2916
|
-
|
|
3185
|
+
i && (_({
|
|
2917
3186
|
status: "error",
|
|
2918
3187
|
error: e
|
|
2919
3188
|
}), v.current.onError?.(e));
|
|
2920
3189
|
}), () => {
|
|
2921
|
-
|
|
3190
|
+
i = !1;
|
|
2922
3191
|
};
|
|
2923
3192
|
}, [
|
|
2924
3193
|
e,
|
|
2925
3194
|
t,
|
|
2926
3195
|
n,
|
|
2927
|
-
|
|
3196
|
+
r,
|
|
2928
3197
|
a,
|
|
2929
|
-
|
|
2930
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */
|
|
3198
|
+
o
|
|
3199
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Ut, {
|
|
2931
3200
|
bundle: g.bundle,
|
|
2932
|
-
mode:
|
|
3201
|
+
mode: l,
|
|
2933
3202
|
style: d
|
|
2934
3203
|
});
|
|
2935
3204
|
}
|
|
2936
3205
|
//#endregion
|
|
2937
|
-
export {
|
|
3206
|
+
export { Ht as PageRenderer, Ut as WebimContent, Wt as WebimPage, B as fetchPage, we as renderRichContent, R as resolveTheme };
|