webim-adapter 0.9.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +484 -367
- package/build/webim-embed.js +2 -2
- package/build/webim-ssr.js +830 -713
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { renderToStaticMarkup as e } from "react-dom/server";
|
|
2
|
-
import { Fragment as t, createContext as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s,
|
|
3
|
-
import { Fragment as
|
|
2
|
+
import { Fragment as t, createContext as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
3
|
+
import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
4
4
|
//#region ../ui/src/components/builder/locale.js
|
|
5
|
-
var
|
|
5
|
+
var p = /* @__PURE__ */ new Set([
|
|
6
6
|
"ar",
|
|
7
7
|
"he",
|
|
8
8
|
"fa",
|
|
@@ -13,7 +13,7 @@ var f = /* @__PURE__ */ new Set([
|
|
|
13
13
|
"yi",
|
|
14
14
|
"dv",
|
|
15
15
|
"ckb"
|
|
16
|
-
]),
|
|
16
|
+
]), m = (e) => p.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", h = (e, t) => e === "ltr" || e === "rtl" ? e : t ? m(t) : void 0;
|
|
17
17
|
new Map([
|
|
18
18
|
{
|
|
19
19
|
family: "Bebas Neue",
|
|
@@ -120,14 +120,14 @@ new Map([
|
|
|
120
120
|
fallback: "sans-serif"
|
|
121
121
|
}
|
|
122
122
|
].map((e) => [e.family, e]));
|
|
123
|
-
function
|
|
123
|
+
function g(e) {
|
|
124
124
|
return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
|
|
125
125
|
}
|
|
126
|
-
var
|
|
126
|
+
var _ = (e) => g([e]), v = (e) => {
|
|
127
127
|
let t = typeof e == "string" && e.match(/^"([^"]+)"/);
|
|
128
128
|
return t ? t[1] : null;
|
|
129
129
|
};
|
|
130
|
-
function
|
|
130
|
+
function y(e, t) {
|
|
131
131
|
let n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
132
132
|
for (let t of Object.values(e || {})) for (let e of [
|
|
133
133
|
"style",
|
|
@@ -135,7 +135,7 @@ function v(e, t) {
|
|
|
135
135
|
"pressed",
|
|
136
136
|
"focused"
|
|
137
137
|
]) {
|
|
138
|
-
let r =
|
|
138
|
+
let r = v(t.props?.[e]?.fontFamily);
|
|
139
139
|
r && n.add(r);
|
|
140
140
|
}
|
|
141
141
|
};
|
|
@@ -145,36 +145,36 @@ function v(e, t) {
|
|
|
145
145
|
}
|
|
146
146
|
//#endregion
|
|
147
147
|
//#region ../ui/src/components/builder/styles.js
|
|
148
|
-
var
|
|
148
|
+
var b = /* @__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(".")), x = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, S = [
|
|
149
149
|
"borderWidth",
|
|
150
150
|
"borderStyle",
|
|
151
151
|
"borderColor",
|
|
152
152
|
"borderRadius",
|
|
153
153
|
"gap"
|
|
154
154
|
];
|
|
155
|
-
function
|
|
155
|
+
function C(e) {
|
|
156
156
|
let t = {};
|
|
157
|
-
for (let n of
|
|
157
|
+
for (let n of S) {
|
|
158
158
|
let r = e?.[n];
|
|
159
|
-
r != null && r !== "" && (t[n] =
|
|
159
|
+
r != null && r !== "" && (t[n] = b.has(n) ? x(r) : r);
|
|
160
160
|
}
|
|
161
|
-
for (let [n, r] of Object.entries(e || {})) r == null || r === "" ||
|
|
161
|
+
for (let [n, r] of Object.entries(e || {})) r == null || r === "" || S.includes(n) || (t[n] = b.has(n) ? x(r) : r);
|
|
162
162
|
let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
|
|
163
163
|
delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
|
|
164
164
|
let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
|
|
165
165
|
delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
|
|
166
|
-
let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${
|
|
166
|
+
let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${x(e.x ?? 0)} ${x(e.y ?? 0)} ${x(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
|
|
167
167
|
[
|
|
168
168
|
s,
|
|
169
169
|
c,
|
|
170
170
|
l,
|
|
171
171
|
u
|
|
172
|
-
].some((e) => e !== void 0) && d.push(`${
|
|
173
|
-
let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${
|
|
172
|
+
].some((e) => e !== void 0) && d.push(`${x(s ?? 0)} ${x(c ?? 0)} ${x(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
|
|
173
|
+
let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${x(e.x ?? 0)}, ${x(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${f(e.a ?? 0)})` : e.type === "skew" ? `skew(${f(e.x ?? 0)}, ${f(e.y ?? 0)})` : null, { transforms: m, translateX: h, translateY: g, scale: _, rotate: v, skewX: y, skewY: C } = t;
|
|
174
174
|
delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
|
|
175
175
|
let w = (Array.isArray(m) ? m : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
|
|
176
|
-
(h !== void 0 || g !== void 0) && w.push(`translate(${
|
|
177
|
-
let T = (e) => `${e.inset ? "inset " : ""}${
|
|
176
|
+
(h !== void 0 || g !== void 0) && w.push(`translate(${x(h ?? 0)}, ${x(g ?? 0)})`), _ !== void 0 && w.push(`scale(${_})`), v !== void 0 && w.push(`rotate(${f(v)})`), (y !== void 0 || C !== void 0) && w.push(`skew(${f(y ?? 0)}, ${f(C ?? 0)})`), w.length && (t.transform = w.join(" "));
|
|
177
|
+
let T = (e) => `${e.inset ? "inset " : ""}${x(e.x ?? 0)} ${x(e.y ?? 0)} ${x(e.blur ?? 0)} ${x(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;
|
|
178
178
|
delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
|
|
179
179
|
let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
|
|
180
180
|
[
|
|
@@ -192,76 +192,76 @@ function S(e) {
|
|
|
192
192
|
color: j,
|
|
193
193
|
inset: M
|
|
194
194
|
})), N.length && (t.boxShadow = N.join(", "));
|
|
195
|
-
let P = (e) => e.type === "blur" ? `blur(${
|
|
195
|
+
let P = (e) => e.type === "blur" ? `blur(${x(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(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: z, filterBrightness: ee, filterContrast: te, filterSaturate: B } = t;
|
|
196
196
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
197
|
-
let
|
|
198
|
-
R !== void 0 &&
|
|
199
|
-
let
|
|
200
|
-
|
|
201
|
-
let { textStrokeWidth:
|
|
202
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
203
|
-
let { clipText:
|
|
204
|
-
delete t.clipText,
|
|
205
|
-
let { transitions:
|
|
197
|
+
let V = F(I);
|
|
198
|
+
R !== void 0 && V.push(`blur(${x(R)})`), z !== void 0 && V.push(`grayscale(${z}%)`), ee !== void 0 && V.push(`brightness(${ee}%)`), te !== void 0 && V.push(`contrast(${te}%)`), B !== void 0 && V.push(`saturate(${B}%)`), V.length && (t.filter = V.join(" "));
|
|
199
|
+
let ne = F(L);
|
|
200
|
+
ne.length && (t.backdropFilter = ne.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
201
|
+
let { textStrokeWidth: re, textStrokeColor: ie } = t;
|
|
202
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (re !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${x(re ?? 1)} ${ie || "currentColor"}`);
|
|
203
|
+
let { clipText: H } = t;
|
|
204
|
+
delete t.clipText, H && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
205
|
+
let { transitions: U, transitionDuration: W, transitionEasing: ae, transitionProperty: G } = t, oe = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
206
206
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
207
|
-
let
|
|
208
|
-
if (
|
|
207
|
+
let K = (Array.isArray(U) ? U : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${oe(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
208
|
+
if (W !== void 0 && K.push(`${G || "all"} ${oe(W)} ${ae || "ease"}`), K.length && (t.transition = K.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
209
209
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
210
210
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
211
211
|
}
|
|
212
212
|
delete t.backgroundVideo;
|
|
213
|
-
let { overlayColor:
|
|
214
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
215
|
-
let e = `color-mix(in srgb, ${
|
|
213
|
+
let { overlayColor: se, overlayOpacity: ce } = t;
|
|
214
|
+
if (delete t.overlayColor, delete t.overlayOpacity, se) {
|
|
215
|
+
let e = `color-mix(in srgb, ${se} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
216
216
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
217
217
|
}
|
|
218
218
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
219
|
-
let { backgroundLayers:
|
|
219
|
+
let { backgroundLayers: le } = t;
|
|
220
220
|
delete t.backgroundLayers;
|
|
221
|
-
let
|
|
222
|
-
if (
|
|
221
|
+
let q = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
|
|
222
|
+
if (q.length) {
|
|
223
223
|
let e = [], n = [], r = [], i = [], a = [];
|
|
224
|
-
for (let t of
|
|
224
|
+
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");
|
|
225
225
|
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");
|
|
226
226
|
else {
|
|
227
227
|
if (!t.src) continue;
|
|
228
|
-
e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${
|
|
228
|
+
e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${x(t.w ?? "auto")} ${x(t.h ?? "auto")}` : t.size || "cover"), r.push(`${x(t.posX ?? 0)} ${x(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
|
|
229
229
|
}
|
|
230
230
|
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(", "));
|
|
231
231
|
}
|
|
232
232
|
return t;
|
|
233
233
|
}
|
|
234
|
-
var
|
|
234
|
+
var w = {
|
|
235
235
|
hover: ":hover",
|
|
236
236
|
pressed: ":active",
|
|
237
237
|
focused: ":focus"
|
|
238
|
-
},
|
|
238
|
+
}, T = /* @__PURE__ */ new Set([
|
|
239
239
|
"style",
|
|
240
240
|
"class",
|
|
241
241
|
"id",
|
|
242
242
|
"data-wb",
|
|
243
243
|
"data-wb-class",
|
|
244
244
|
"data-slot"
|
|
245
|
-
]),
|
|
246
|
-
function
|
|
245
|
+
]), E = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !T.has(e.toLowerCase());
|
|
246
|
+
function D(e, t, n = []) {
|
|
247
247
|
t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
|
|
248
248
|
for (let t of n) e.removeAttribute(t);
|
|
249
249
|
let r = [];
|
|
250
250
|
for (let n of t.attributes ?? []) {
|
|
251
251
|
let t = String(n?.name ?? "").trim();
|
|
252
|
-
|
|
252
|
+
E(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
|
|
253
253
|
}
|
|
254
254
|
return r;
|
|
255
255
|
}
|
|
256
|
-
var
|
|
257
|
-
function
|
|
258
|
-
let i = Object.entries(
|
|
256
|
+
var O = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
257
|
+
function k(e, t, n, r = !1) {
|
|
258
|
+
let i = Object.entries(C(t)).map(([e, t]) => `${O(e)}: ${t} !important;`).join(" ");
|
|
259
259
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
260
260
|
}
|
|
261
|
-
function
|
|
262
|
-
return Object.entries(
|
|
261
|
+
function A(e, t, n) {
|
|
262
|
+
return Object.entries(w).map(([r, i]) => k(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
263
263
|
}
|
|
264
|
-
var
|
|
264
|
+
var j = [
|
|
265
265
|
{
|
|
266
266
|
key: "tablet",
|
|
267
267
|
max: 991
|
|
@@ -274,17 +274,17 @@ var A = [
|
|
|
274
274
|
key: "mobile",
|
|
275
275
|
max: 478
|
|
276
276
|
}
|
|
277
|
-
],
|
|
278
|
-
function
|
|
279
|
-
return
|
|
280
|
-
let i = t?.[n] ?
|
|
277
|
+
], M = (e) => Object.entries(C(e)).map(([e, t]) => `${O(e)}: ${t} !important;`).join(" ");
|
|
278
|
+
function N(e, t) {
|
|
279
|
+
return j.map(({ key: n, max: r }) => {
|
|
280
|
+
let i = t?.[n] ? M(t[n]) : "";
|
|
281
281
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
282
282
|
}).filter(Boolean).join("\n");
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function P(e, t) {
|
|
285
285
|
let n = [], r = (e) => {
|
|
286
286
|
for (let [t, r] of Object.entries(e || {})) {
|
|
287
|
-
let e =
|
|
287
|
+
let e = N(t, r.props);
|
|
288
288
|
e && n.push(e);
|
|
289
289
|
}
|
|
290
290
|
};
|
|
@@ -292,10 +292,10 @@ function N(e, t) {
|
|
|
292
292
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
293
293
|
return n.join("\n");
|
|
294
294
|
}
|
|
295
|
-
function
|
|
295
|
+
function F(e, t) {
|
|
296
296
|
let n = [], r = (e) => {
|
|
297
297
|
for (let [t, r] of Object.entries(e || {})) {
|
|
298
|
-
let e =
|
|
298
|
+
let e = A(t, r.props);
|
|
299
299
|
e && n.push(e);
|
|
300
300
|
}
|
|
301
301
|
};
|
|
@@ -303,7 +303,7 @@ function P(e, t) {
|
|
|
303
303
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
304
304
|
return n.join("\n");
|
|
305
305
|
}
|
|
306
|
-
var
|
|
306
|
+
var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", L = {
|
|
307
307
|
light: {
|
|
308
308
|
background: "#ffffff",
|
|
309
309
|
text: "#111827",
|
|
@@ -340,23 +340,23 @@ var F = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
340
340
|
contrastText: "#052e2b"
|
|
341
341
|
}
|
|
342
342
|
}
|
|
343
|
-
},
|
|
343
|
+
}, R = {
|
|
344
344
|
font: "system",
|
|
345
345
|
headingFont: "inherit",
|
|
346
|
-
light:
|
|
347
|
-
dark:
|
|
348
|
-
},
|
|
346
|
+
light: L.light,
|
|
347
|
+
dark: L.dark
|
|
348
|
+
}, z = {
|
|
349
349
|
system: {
|
|
350
350
|
label: "System",
|
|
351
|
-
value:
|
|
351
|
+
value: I
|
|
352
352
|
},
|
|
353
353
|
inter: {
|
|
354
354
|
label: "Inter",
|
|
355
|
-
value: `"Inter", ${
|
|
355
|
+
value: `"Inter", ${I}`
|
|
356
356
|
},
|
|
357
357
|
outfit: {
|
|
358
358
|
label: "Outfit",
|
|
359
|
-
value: `"Outfit", ${
|
|
359
|
+
value: `"Outfit", ${I}`
|
|
360
360
|
},
|
|
361
361
|
serif: {
|
|
362
362
|
label: "Serif",
|
|
@@ -366,7 +366,7 @@ var F = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
366
366
|
label: "Mono",
|
|
367
367
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
368
368
|
}
|
|
369
|
-
},
|
|
369
|
+
}, ee = (e, t) => z[e]?.value ?? t, te = (e, ...t) => {
|
|
370
370
|
let n = Object.assign({}, e, ...t);
|
|
371
371
|
return n.primary = {
|
|
372
372
|
...e.primary,
|
|
@@ -385,10 +385,10 @@ var F = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
385
385
|
function B(e) {
|
|
386
386
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
387
387
|
return {
|
|
388
|
-
font: r ??
|
|
389
|
-
headingFont: i ??
|
|
390
|
-
light:
|
|
391
|
-
dark:
|
|
388
|
+
font: r ?? R.font,
|
|
389
|
+
headingFont: i ?? R.headingFont,
|
|
390
|
+
light: te(L.light, a, t),
|
|
391
|
+
dark: te(L.dark, n)
|
|
392
392
|
};
|
|
393
393
|
}
|
|
394
394
|
function V(e) {
|
|
@@ -407,37 +407,37 @@ function V(e) {
|
|
|
407
407
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
408
408
|
};
|
|
409
409
|
}
|
|
410
|
-
function
|
|
410
|
+
function ne(e) {
|
|
411
411
|
let t = B(e);
|
|
412
412
|
return {
|
|
413
413
|
backgroundColor: "var(--page-bg)",
|
|
414
414
|
color: "var(--page-text)",
|
|
415
|
-
fontFamily:
|
|
416
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
415
|
+
fontFamily: ee(t.font, I),
|
|
416
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : ee(t.headingFont, "inherit")
|
|
417
417
|
};
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function re(e, t = "light") {
|
|
420
420
|
let n = B(e);
|
|
421
421
|
return {
|
|
422
|
-
...
|
|
422
|
+
...ne(e),
|
|
423
423
|
...V(n[t] ?? n.light)
|
|
424
424
|
};
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function ie(e, t) {
|
|
427
427
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
428
428
|
}
|
|
429
429
|
//#endregion
|
|
430
430
|
//#region ../ui/src/components/builder/views.jsx
|
|
431
|
-
var
|
|
431
|
+
var H = n({
|
|
432
432
|
tenant: "",
|
|
433
433
|
apiUrl: "/api",
|
|
434
434
|
locale: "",
|
|
435
435
|
settings: null
|
|
436
|
-
}),
|
|
437
|
-
function
|
|
436
|
+
}), U = n(null), W = n(null), ae = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
437
|
+
function G(e, t) {
|
|
438
438
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
439
439
|
}
|
|
440
|
-
var
|
|
440
|
+
var oe = (e) => {
|
|
441
441
|
let t = [];
|
|
442
442
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
443
443
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -447,36 +447,36 @@ var ie = (e) => {
|
|
|
447
447
|
}
|
|
448
448
|
return t;
|
|
449
449
|
};
|
|
450
|
-
function
|
|
450
|
+
function K(e) {
|
|
451
451
|
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(" ") : "";
|
|
452
452
|
}
|
|
453
|
-
function
|
|
454
|
-
let n = t?.data ?? {}, r =
|
|
453
|
+
function se(e, t) {
|
|
454
|
+
let n = t?.data ?? {}, r = oe(n);
|
|
455
455
|
if (!r.length) return e;
|
|
456
|
-
let i = RegExp(`:(${r.map(
|
|
456
|
+
let i = RegExp(`:(${r.map(ae).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;
|
|
457
457
|
return a(e);
|
|
458
458
|
}
|
|
459
|
-
var
|
|
459
|
+
var ce = {
|
|
460
460
|
margin: 0,
|
|
461
461
|
fontWeight: 700,
|
|
462
462
|
lineHeight: 1.2,
|
|
463
463
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
464
|
-
},
|
|
464
|
+
}, le = { margin: 0 }, q = {
|
|
465
465
|
display: "inline-block",
|
|
466
466
|
textDecoration: "none",
|
|
467
467
|
cursor: "pointer",
|
|
468
468
|
backgroundColor: "var(--page-accent, #111827)",
|
|
469
469
|
color: "var(--page-accent-text, #ffffff)"
|
|
470
|
-
},
|
|
470
|
+
}, ue = {
|
|
471
471
|
flexGrow: 1,
|
|
472
472
|
display: "flex",
|
|
473
473
|
flexDirection: "column",
|
|
474
474
|
position: "relative"
|
|
475
|
-
},
|
|
475
|
+
}, de = {
|
|
476
476
|
display: "flex",
|
|
477
477
|
flexDirection: "column"
|
|
478
478
|
};
|
|
479
|
-
function
|
|
479
|
+
function fe({ style: e }) {
|
|
480
480
|
let t = e?.backgroundVideo;
|
|
481
481
|
if (!t) return null;
|
|
482
482
|
let n = {
|
|
@@ -487,7 +487,7 @@ function ue({ style: e }) {
|
|
|
487
487
|
zIndex: -1,
|
|
488
488
|
pointerEvents: "none"
|
|
489
489
|
}, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
|
|
490
|
-
return /* @__PURE__ */
|
|
490
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("video", {
|
|
491
491
|
src: t,
|
|
492
492
|
autoPlay: !0,
|
|
493
493
|
muted: !0,
|
|
@@ -497,73 +497,73 @@ function ue({ style: e }) {
|
|
|
497
497
|
...n,
|
|
498
498
|
objectFit: "cover"
|
|
499
499
|
}
|
|
500
|
-
}), r && /* @__PURE__ */
|
|
500
|
+
}), r && /* @__PURE__ */ d("div", { style: {
|
|
501
501
|
...n,
|
|
502
502
|
background: r
|
|
503
503
|
} })] });
|
|
504
504
|
}
|
|
505
|
-
var
|
|
505
|
+
var pe = (e, t) => e?.backgroundVideo ? {
|
|
506
506
|
position: "relative",
|
|
507
507
|
...t,
|
|
508
|
-
...
|
|
508
|
+
...C(e)
|
|
509
509
|
} : {
|
|
510
510
|
...t,
|
|
511
|
-
...
|
|
511
|
+
...C(e)
|
|
512
512
|
};
|
|
513
|
-
function
|
|
514
|
-
return /* @__PURE__ */
|
|
513
|
+
function me({ style: e, nodeRef: t, children: n }) {
|
|
514
|
+
return /* @__PURE__ */ f("div", {
|
|
515
515
|
ref: t,
|
|
516
516
|
style: {
|
|
517
|
-
...
|
|
518
|
-
...
|
|
517
|
+
...ue,
|
|
518
|
+
...C(e)
|
|
519
519
|
},
|
|
520
|
-
children: [/* @__PURE__ */
|
|
520
|
+
children: [/* @__PURE__ */ d(fe, { style: e }), n]
|
|
521
521
|
});
|
|
522
522
|
}
|
|
523
|
-
function
|
|
524
|
-
return /* @__PURE__ */
|
|
523
|
+
function he({ style: e, nodeRef: t, children: n }) {
|
|
524
|
+
return /* @__PURE__ */ f("section", {
|
|
525
525
|
ref: t,
|
|
526
|
-
style:
|
|
527
|
-
children: [/* @__PURE__ */
|
|
526
|
+
style: pe(e, de),
|
|
527
|
+
children: [/* @__PURE__ */ d(fe, { style: e }), n]
|
|
528
528
|
});
|
|
529
529
|
}
|
|
530
|
-
function
|
|
530
|
+
function ge({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
531
531
|
let i = t ? {
|
|
532
532
|
position: "relative",
|
|
533
533
|
minHeight: 240
|
|
534
534
|
} : null;
|
|
535
|
-
return /* @__PURE__ */
|
|
535
|
+
return /* @__PURE__ */ f("div", {
|
|
536
536
|
ref: n,
|
|
537
537
|
style: i ? {
|
|
538
538
|
...i,
|
|
539
|
-
...
|
|
540
|
-
} :
|
|
541
|
-
children: [/* @__PURE__ */
|
|
539
|
+
...pe(e)
|
|
540
|
+
} : pe(e),
|
|
541
|
+
children: [/* @__PURE__ */ d(fe, { style: e }), r]
|
|
542
542
|
});
|
|
543
543
|
}
|
|
544
|
-
function
|
|
545
|
-
return /* @__PURE__ */
|
|
544
|
+
function _e({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
545
|
+
return /* @__PURE__ */ d(n, {
|
|
546
546
|
ref: a,
|
|
547
547
|
style: {
|
|
548
|
-
...
|
|
549
|
-
...
|
|
548
|
+
...ce,
|
|
549
|
+
...C(r)
|
|
550
550
|
},
|
|
551
|
-
children:
|
|
551
|
+
children: J(t, e, i)
|
|
552
552
|
});
|
|
553
553
|
}
|
|
554
|
-
var
|
|
555
|
-
fontFamily:
|
|
554
|
+
var ve = {
|
|
555
|
+
fontFamily: z.mono.value,
|
|
556
556
|
background: "rgba(148, 163, 184, 0.18)",
|
|
557
557
|
padding: "1px 5px",
|
|
558
558
|
borderRadius: 4,
|
|
559
559
|
fontSize: "0.9em"
|
|
560
560
|
};
|
|
561
|
-
function
|
|
561
|
+
function ye(e, t = [], n, r) {
|
|
562
562
|
let i = e;
|
|
563
|
-
return t.includes("sup") ? i = /* @__PURE__ */
|
|
564
|
-
style:
|
|
563
|
+
return t.includes("sup") ? i = /* @__PURE__ */ d("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ d("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ d("code", {
|
|
564
|
+
style: ve,
|
|
565
565
|
children: i
|
|
566
|
-
})), t.includes("strike") && (i = /* @__PURE__ */
|
|
566
|
+
})), t.includes("strike") && (i = /* @__PURE__ */ d("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ d("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ d("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ d("strong", { children: i })), n && (i = /* @__PURE__ */ d("a", {
|
|
567
567
|
href: n,
|
|
568
568
|
target: r || void 0,
|
|
569
569
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
@@ -571,36 +571,36 @@ function _e(e, t = [], n, r) {
|
|
|
571
571
|
children: i
|
|
572
572
|
})), i;
|
|
573
573
|
}
|
|
574
|
-
function
|
|
574
|
+
function J(e, n, r) {
|
|
575
575
|
return e?.length ? e.map((e, n) => {
|
|
576
|
-
if (e.slot) return /* @__PURE__ */
|
|
577
|
-
if (e.parts) return /* @__PURE__ */
|
|
576
|
+
if (e.slot) return /* @__PURE__ */ d(t, { children: r?.[e.slot] ?? null }, n);
|
|
577
|
+
if (e.parts) return /* @__PURE__ */ d(t, { children: J(e.parts, "", r) }, n);
|
|
578
578
|
let i = e.text;
|
|
579
|
-
return e.sup ? i = /* @__PURE__ */
|
|
580
|
-
style:
|
|
579
|
+
return e.sup ? i = /* @__PURE__ */ d("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ d("sub", { children: i })), e.code && (i = /* @__PURE__ */ d("code", {
|
|
580
|
+
style: ve,
|
|
581
581
|
children: i
|
|
582
|
-
})), e.strike && (i = /* @__PURE__ */
|
|
582
|
+
})), e.strike && (i = /* @__PURE__ */ d("s", { children: i })), e.underline && (i = /* @__PURE__ */ d("u", { children: i })), e.italic && (i = /* @__PURE__ */ d("em", { children: i })), e.bold && (i = /* @__PURE__ */ d("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ d("span", {
|
|
583
583
|
style: {
|
|
584
584
|
...e.color && { color: e.color },
|
|
585
585
|
...e.background && { backgroundColor: e.background }
|
|
586
586
|
},
|
|
587
587
|
children: i
|
|
588
|
-
})), e.href && (i = /* @__PURE__ */
|
|
588
|
+
})), e.href && (i = /* @__PURE__ */ d("a", {
|
|
589
589
|
href: e.href,
|
|
590
590
|
target: e.target || void 0,
|
|
591
591
|
rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
592
592
|
style: { color: e.color ?? "inherit" },
|
|
593
593
|
children: i
|
|
594
|
-
})), /* @__PURE__ */
|
|
594
|
+
})), /* @__PURE__ */ d(t, { children: i }, n);
|
|
595
595
|
}) : n;
|
|
596
596
|
}
|
|
597
|
-
function
|
|
598
|
-
return /* @__PURE__ */
|
|
599
|
-
style:
|
|
600
|
-
children: e?.length ?
|
|
597
|
+
function be({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
598
|
+
return /* @__PURE__ */ d("span", {
|
|
599
|
+
style: C(a),
|
|
600
|
+
children: e?.length ? J(e, t) : ye(t, n, r, i)
|
|
601
601
|
});
|
|
602
602
|
}
|
|
603
|
-
var
|
|
603
|
+
var xe = {
|
|
604
604
|
h1: 40,
|
|
605
605
|
h2: 32,
|
|
606
606
|
h3: 26,
|
|
@@ -608,7 +608,7 @@ var ye = {
|
|
|
608
608
|
h5: 19,
|
|
609
609
|
h6: 16
|
|
610
610
|
};
|
|
611
|
-
function
|
|
611
|
+
function Se({ align: e = "center", width: t, wrap: n } = {}) {
|
|
612
612
|
let r = t ? `${t}%` : void 0;
|
|
613
613
|
if (e === "full") return { width: "100%" };
|
|
614
614
|
let i = e === "left" || e === "right";
|
|
@@ -642,8 +642,8 @@ function be({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
642
642
|
marginRight: "auto"
|
|
643
643
|
};
|
|
644
644
|
}
|
|
645
|
-
function
|
|
646
|
-
let r = n ?? ((e, n) =>
|
|
645
|
+
function Ce(e = [], t, n) {
|
|
646
|
+
let r = n ?? ((e, n) => J(e, n, t));
|
|
647
647
|
return e.map((t, n) => {
|
|
648
648
|
let i = {
|
|
649
649
|
marginTop: 0,
|
|
@@ -651,7 +651,7 @@ function xe(e = [], t, n) {
|
|
|
651
651
|
};
|
|
652
652
|
if (t.type === "image") {
|
|
653
653
|
if (!t.src) return null;
|
|
654
|
-
let e = /* @__PURE__ */
|
|
654
|
+
let e = /* @__PURE__ */ d("img", {
|
|
655
655
|
src: t.src,
|
|
656
656
|
alt: t.alt || "",
|
|
657
657
|
style: {
|
|
@@ -660,20 +660,20 @@ function xe(e = [], t, n) {
|
|
|
660
660
|
borderRadius: 6
|
|
661
661
|
}
|
|
662
662
|
});
|
|
663
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ f("figure", {
|
|
664
664
|
style: {
|
|
665
665
|
marginLeft: 0,
|
|
666
666
|
marginRight: 0,
|
|
667
667
|
...i,
|
|
668
|
-
...
|
|
668
|
+
...Se(t)
|
|
669
669
|
},
|
|
670
|
-
children: [t.href ? /* @__PURE__ */
|
|
670
|
+
children: [t.href ? /* @__PURE__ */ d("a", {
|
|
671
671
|
href: t.href,
|
|
672
672
|
target: t.target || void 0,
|
|
673
673
|
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
674
674
|
style: { display: "block" },
|
|
675
675
|
children: e
|
|
676
|
-
}) : e, t.caption && /* @__PURE__ */
|
|
676
|
+
}) : e, t.caption && /* @__PURE__ */ d("figcaption", {
|
|
677
677
|
style: {
|
|
678
678
|
fontSize: 13,
|
|
679
679
|
opacity: .65,
|
|
@@ -684,16 +684,16 @@ function xe(e = [], t, n) {
|
|
|
684
684
|
})]
|
|
685
685
|
}, n);
|
|
686
686
|
}
|
|
687
|
-
if (t.type === "video") return
|
|
687
|
+
if (t.type === "video") return Pe(t.url) ? /* @__PURE__ */ d("div", {
|
|
688
688
|
style: {
|
|
689
689
|
...i,
|
|
690
|
-
...
|
|
690
|
+
...Se({
|
|
691
691
|
align: t.align,
|
|
692
692
|
wrap: t.wrap,
|
|
693
693
|
width: t.width ?? 100
|
|
694
694
|
})
|
|
695
695
|
},
|
|
696
|
-
children: /* @__PURE__ */
|
|
696
|
+
children: /* @__PURE__ */ d(Fe, {
|
|
697
697
|
url: t.url,
|
|
698
698
|
autoplay: t.autoplay,
|
|
699
699
|
muted: t.muted,
|
|
@@ -702,146 +702,146 @@ function xe(e = [], t, n) {
|
|
|
702
702
|
start: t.start
|
|
703
703
|
})
|
|
704
704
|
}, n) : null;
|
|
705
|
-
if (t.type === "divider") return /* @__PURE__ */
|
|
705
|
+
if (t.type === "divider") return /* @__PURE__ */ d("hr", { style: {
|
|
706
706
|
...i,
|
|
707
707
|
border: 0,
|
|
708
708
|
borderTop: "1px solid rgba(148, 163, 184, 0.4)"
|
|
709
709
|
} }, n);
|
|
710
710
|
if (t.type === "ul" || t.type === "ol") {
|
|
711
711
|
let e = t.type;
|
|
712
|
-
return /* @__PURE__ */
|
|
712
|
+
return /* @__PURE__ */ d(e, {
|
|
713
713
|
style: {
|
|
714
714
|
...i,
|
|
715
715
|
paddingLeft: 24
|
|
716
716
|
},
|
|
717
|
-
children: (t.items ?? []).map((e, t) => /* @__PURE__ */
|
|
717
|
+
children: (t.items ?? []).map((e, t) => /* @__PURE__ */ d("li", {
|
|
718
718
|
style: { marginBottom: 4 },
|
|
719
719
|
children: r(e.parts, e.text)
|
|
720
720
|
}, t))
|
|
721
721
|
}, n);
|
|
722
722
|
}
|
|
723
|
-
if (t.type === "quote") return /* @__PURE__ */
|
|
723
|
+
if (t.type === "quote") return /* @__PURE__ */ d("blockquote", {
|
|
724
724
|
style: {
|
|
725
|
-
...
|
|
725
|
+
...Te,
|
|
726
726
|
...i
|
|
727
727
|
},
|
|
728
728
|
children: r(t.parts, t.text)
|
|
729
729
|
}, n);
|
|
730
|
-
if (
|
|
730
|
+
if (xe[t.type]) {
|
|
731
731
|
let e = t.type;
|
|
732
|
-
return /* @__PURE__ */
|
|
732
|
+
return /* @__PURE__ */ d(e, {
|
|
733
733
|
style: {
|
|
734
|
-
...
|
|
735
|
-
fontSize:
|
|
734
|
+
...ce,
|
|
735
|
+
fontSize: xe[t.type],
|
|
736
736
|
...i
|
|
737
737
|
},
|
|
738
738
|
children: r(t.parts, t.text)
|
|
739
739
|
}, n);
|
|
740
740
|
}
|
|
741
|
-
return /* @__PURE__ */
|
|
741
|
+
return /* @__PURE__ */ d("p", {
|
|
742
742
|
style: {
|
|
743
|
-
...
|
|
743
|
+
...le,
|
|
744
744
|
...i
|
|
745
745
|
},
|
|
746
746
|
children: r(t.parts, t.text)
|
|
747
747
|
}, n);
|
|
748
748
|
});
|
|
749
749
|
}
|
|
750
|
-
function
|
|
751
|
-
return /* @__PURE__ */
|
|
750
|
+
function we({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
751
|
+
return /* @__PURE__ */ d("div", {
|
|
752
752
|
ref: r,
|
|
753
753
|
style: {
|
|
754
754
|
display: "flow-root",
|
|
755
|
-
...
|
|
755
|
+
...C(t)
|
|
756
756
|
},
|
|
757
|
-
children:
|
|
757
|
+
children: Ce(e, n)
|
|
758
758
|
});
|
|
759
759
|
}
|
|
760
|
-
var
|
|
760
|
+
var Te = {
|
|
761
761
|
margin: 0,
|
|
762
762
|
padding: "8px 0 8px 20px",
|
|
763
763
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
764
764
|
};
|
|
765
|
-
function
|
|
766
|
-
return /* @__PURE__ */
|
|
765
|
+
function Ee({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
766
|
+
return /* @__PURE__ */ d("blockquote", {
|
|
767
767
|
ref: i,
|
|
768
768
|
style: {
|
|
769
|
-
...
|
|
770
|
-
...
|
|
769
|
+
...Te,
|
|
770
|
+
...C(n)
|
|
771
771
|
},
|
|
772
|
-
children:
|
|
772
|
+
children: J(t, e, r)
|
|
773
773
|
});
|
|
774
774
|
}
|
|
775
|
-
function
|
|
776
|
-
return /* @__PURE__ */
|
|
775
|
+
function De({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
776
|
+
return /* @__PURE__ */ d(e ? "ol" : "ul", {
|
|
777
777
|
ref: r,
|
|
778
778
|
style: {
|
|
779
779
|
margin: 0,
|
|
780
780
|
paddingLeft: 24,
|
|
781
|
-
...
|
|
781
|
+
...C(n)
|
|
782
782
|
},
|
|
783
|
-
children: t.map((e, t) => /* @__PURE__ */
|
|
783
|
+
children: t.map((e, t) => /* @__PURE__ */ d("li", {
|
|
784
784
|
style: { marginBottom: 4 },
|
|
785
|
-
children:
|
|
785
|
+
children: J(e.parts, e.text)
|
|
786
786
|
}, t))
|
|
787
787
|
});
|
|
788
788
|
}
|
|
789
|
-
function
|
|
790
|
-
return /* @__PURE__ */
|
|
789
|
+
function Oe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
790
|
+
return /* @__PURE__ */ d("p", {
|
|
791
791
|
ref: i,
|
|
792
792
|
style: {
|
|
793
|
-
...
|
|
794
|
-
...
|
|
793
|
+
...le,
|
|
794
|
+
...C(n)
|
|
795
795
|
},
|
|
796
|
-
children:
|
|
796
|
+
children: J(t, e, r)
|
|
797
797
|
});
|
|
798
798
|
}
|
|
799
|
-
var
|
|
799
|
+
var ke = {
|
|
800
800
|
color: "var(--page-accent, inherit)",
|
|
801
801
|
textDecoration: "underline",
|
|
802
802
|
textUnderlineOffset: 3,
|
|
803
803
|
cursor: "pointer"
|
|
804
804
|
};
|
|
805
|
-
function
|
|
806
|
-
return /* @__PURE__ */
|
|
805
|
+
function Ae({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
806
|
+
return /* @__PURE__ */ d("a", {
|
|
807
807
|
ref: o,
|
|
808
808
|
href: n || "#",
|
|
809
809
|
target: r || void 0,
|
|
810
810
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
811
811
|
style: {
|
|
812
|
-
...
|
|
813
|
-
...
|
|
812
|
+
...ke,
|
|
813
|
+
...C(i)
|
|
814
814
|
},
|
|
815
|
-
children:
|
|
815
|
+
children: J(t, e, a)
|
|
816
816
|
});
|
|
817
817
|
}
|
|
818
|
-
function
|
|
819
|
-
return /* @__PURE__ */
|
|
818
|
+
function je({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
819
|
+
return /* @__PURE__ */ d("a", {
|
|
820
820
|
ref: o,
|
|
821
821
|
href: n || "#",
|
|
822
822
|
target: r || void 0,
|
|
823
823
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
824
824
|
style: {
|
|
825
|
-
...
|
|
826
|
-
...
|
|
825
|
+
...q,
|
|
826
|
+
...C(i)
|
|
827
827
|
},
|
|
828
|
-
children:
|
|
828
|
+
children: J(t, e, a)
|
|
829
829
|
});
|
|
830
830
|
}
|
|
831
|
-
function
|
|
832
|
-
return e ? /* @__PURE__ */
|
|
831
|
+
function Me({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
832
|
+
return e ? /* @__PURE__ */ d("img", {
|
|
833
833
|
ref: r,
|
|
834
834
|
src: e,
|
|
835
835
|
alt: t || "",
|
|
836
836
|
style: {
|
|
837
837
|
display: "block",
|
|
838
838
|
maxWidth: "100%",
|
|
839
|
-
...
|
|
839
|
+
...C(n)
|
|
840
840
|
}
|
|
841
841
|
}) : null;
|
|
842
842
|
}
|
|
843
|
-
function
|
|
844
|
-
return e ? /* @__PURE__ */
|
|
843
|
+
function Ne({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
844
|
+
return e ? /* @__PURE__ */ d("video", {
|
|
845
845
|
ref: s,
|
|
846
846
|
src: e,
|
|
847
847
|
poster: t || void 0,
|
|
@@ -854,24 +854,24 @@ function je({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
854
854
|
display: "block",
|
|
855
855
|
width: "100%",
|
|
856
856
|
maxWidth: "100%",
|
|
857
|
-
...
|
|
857
|
+
...C(o)
|
|
858
858
|
}
|
|
859
859
|
}) : null;
|
|
860
860
|
}
|
|
861
|
-
var
|
|
862
|
-
function
|
|
863
|
-
let c =
|
|
861
|
+
var Pe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
862
|
+
function Fe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
863
|
+
let c = Pe(e);
|
|
864
864
|
if (!c) return null;
|
|
865
865
|
let l = new URLSearchParams({ rel: "0" });
|
|
866
|
-
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__ */
|
|
866
|
+
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__ */ d("div", {
|
|
867
867
|
ref: s,
|
|
868
868
|
style: {
|
|
869
869
|
position: "relative",
|
|
870
870
|
width: "100%",
|
|
871
871
|
paddingTop: "56.25%",
|
|
872
|
-
...
|
|
872
|
+
...C(o)
|
|
873
873
|
},
|
|
874
|
-
children: /* @__PURE__ */
|
|
874
|
+
children: /* @__PURE__ */ d("iframe", {
|
|
875
875
|
src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
|
|
876
876
|
title: "YouTube video",
|
|
877
877
|
allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
|
|
@@ -886,8 +886,8 @@ function Ne({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
886
886
|
})
|
|
887
887
|
});
|
|
888
888
|
}
|
|
889
|
-
function
|
|
890
|
-
return e ? /* @__PURE__ */
|
|
889
|
+
function Ie({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
890
|
+
return e ? /* @__PURE__ */ d("iframe", {
|
|
891
891
|
ref: i,
|
|
892
892
|
src: e,
|
|
893
893
|
title: t || "Embedded frame",
|
|
@@ -898,12 +898,12 @@ function Pe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
898
898
|
width: "100%",
|
|
899
899
|
height: 300,
|
|
900
900
|
border: 0,
|
|
901
|
-
...
|
|
901
|
+
...C(r)
|
|
902
902
|
}
|
|
903
903
|
}) : null;
|
|
904
904
|
}
|
|
905
|
-
function
|
|
906
|
-
let [i, o] =
|
|
905
|
+
function Le({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
906
|
+
let [i, o] = l(null);
|
|
907
907
|
return a(() => {
|
|
908
908
|
i && (i.innerHTML = e || "", t && i.querySelectorAll("script").forEach((e) => {
|
|
909
909
|
let t = document.createElement("script");
|
|
@@ -914,15 +914,15 @@ function Fe({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
914
914
|
i,
|
|
915
915
|
e,
|
|
916
916
|
t
|
|
917
|
-
]), /* @__PURE__ */
|
|
917
|
+
]), /* @__PURE__ */ d("div", {
|
|
918
918
|
ref: (e) => {
|
|
919
919
|
o(e), r && r(e);
|
|
920
920
|
},
|
|
921
|
-
style:
|
|
921
|
+
style: C(n)
|
|
922
922
|
});
|
|
923
923
|
}
|
|
924
|
-
function
|
|
925
|
-
return /* @__PURE__ */
|
|
924
|
+
function Re({ height: e, nodeRef: t }) {
|
|
925
|
+
return /* @__PURE__ */ d("div", {
|
|
926
926
|
ref: t,
|
|
927
927
|
style: {
|
|
928
928
|
height: e || 32,
|
|
@@ -931,18 +931,18 @@ function Ie({ height: e, nodeRef: t }) {
|
|
|
931
931
|
}
|
|
932
932
|
});
|
|
933
933
|
}
|
|
934
|
-
function
|
|
935
|
-
return /* @__PURE__ */
|
|
934
|
+
function ze({ style: e, nodeRef: t }) {
|
|
935
|
+
return /* @__PURE__ */ d("div", {
|
|
936
936
|
ref: t,
|
|
937
937
|
style: {
|
|
938
938
|
height: 1,
|
|
939
939
|
alignSelf: "stretch",
|
|
940
940
|
flexShrink: 0,
|
|
941
|
-
...
|
|
941
|
+
...C(e)
|
|
942
942
|
}
|
|
943
943
|
});
|
|
944
944
|
}
|
|
945
|
-
var
|
|
945
|
+
var Be = {
|
|
946
946
|
position: "absolute",
|
|
947
947
|
top: "50%",
|
|
948
948
|
transform: "translateY(-50%)",
|
|
@@ -959,7 +959,7 @@ var Re = {
|
|
|
959
959
|
alignItems: "center",
|
|
960
960
|
justifyContent: "center",
|
|
961
961
|
padding: 0
|
|
962
|
-
},
|
|
962
|
+
}, Ve = {
|
|
963
963
|
bottom: {
|
|
964
964
|
inset: "auto 0 0 0",
|
|
965
965
|
padding: "40px 24px 20px",
|
|
@@ -978,9 +978,9 @@ var Re = {
|
|
|
978
978
|
padding: 24,
|
|
979
979
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
980
980
|
}
|
|
981
|
-
},
|
|
982
|
-
function
|
|
983
|
-
let [p, m] =
|
|
981
|
+
}, He = 48;
|
|
982
|
+
function Ue({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
|
|
983
|
+
let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
|
|
984
984
|
if (a(() => {
|
|
985
985
|
if (!n || h || _ || e < 2) return;
|
|
986
986
|
let t = setInterval(() => m((t) => (t + 1) % e), Math.max(2, Number(r) || 5) * 1e3);
|
|
@@ -995,10 +995,10 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
995
995
|
let b = (t) => m((t + e) % e), x = () => {
|
|
996
996
|
if (!_) return;
|
|
997
997
|
let { dx: e } = _;
|
|
998
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
998
|
+
v(null), e < -48 ? b(y + 1) : e > He && b(y - 1);
|
|
999
999
|
};
|
|
1000
|
-
return /* @__PURE__ */
|
|
1001
|
-
ref:
|
|
1000
|
+
return /* @__PURE__ */ f("div", {
|
|
1001
|
+
ref: c,
|
|
1002
1002
|
onMouseEnter: () => g(!0),
|
|
1003
1003
|
onMouseLeave: () => g(!1),
|
|
1004
1004
|
onPointerDown: o && e > 1 ? (e) => {
|
|
@@ -1020,16 +1020,16 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1020
1020
|
touchAction: "pan-y",
|
|
1021
1021
|
userSelect: _ ? "none" : void 0,
|
|
1022
1022
|
cursor: _ ? "grabbing" : void 0,
|
|
1023
|
-
...
|
|
1023
|
+
...C(s)
|
|
1024
1024
|
},
|
|
1025
|
-
children: [/* @__PURE__ */
|
|
1025
|
+
children: [/* @__PURE__ */ d("div", {
|
|
1026
1026
|
style: {
|
|
1027
1027
|
display: "flex",
|
|
1028
1028
|
height: i,
|
|
1029
1029
|
transform: `translateX(calc(${-y * 100}% + ${_?.dx ?? 0}px))`,
|
|
1030
1030
|
transition: _ ? "none" : "transform 450ms ease"
|
|
1031
1031
|
},
|
|
1032
|
-
children: Array.from({ length: e }, (e, n) => /* @__PURE__ */
|
|
1032
|
+
children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ d("div", {
|
|
1033
1033
|
style: {
|
|
1034
1034
|
position: "relative",
|
|
1035
1035
|
width: "100%",
|
|
@@ -1038,28 +1038,28 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1038
1038
|
},
|
|
1039
1039
|
children: t(n)
|
|
1040
1040
|
}, n))
|
|
1041
|
-
}), e > 1 && /* @__PURE__ */
|
|
1042
|
-
/* @__PURE__ */
|
|
1041
|
+
}), e > 1 && /* @__PURE__ */ f(u, { children: [
|
|
1042
|
+
/* @__PURE__ */ d("button", {
|
|
1043
1043
|
type: "button",
|
|
1044
1044
|
"aria-label": "Previous slide",
|
|
1045
1045
|
style: {
|
|
1046
|
-
...
|
|
1046
|
+
...Be,
|
|
1047
1047
|
left: 12
|
|
1048
1048
|
},
|
|
1049
1049
|
onClick: () => b(y - 1),
|
|
1050
1050
|
children: "‹"
|
|
1051
1051
|
}),
|
|
1052
|
-
/* @__PURE__ */
|
|
1052
|
+
/* @__PURE__ */ d("button", {
|
|
1053
1053
|
type: "button",
|
|
1054
1054
|
"aria-label": "Next slide",
|
|
1055
1055
|
style: {
|
|
1056
|
-
...
|
|
1056
|
+
...Be,
|
|
1057
1057
|
right: 12
|
|
1058
1058
|
},
|
|
1059
1059
|
onClick: () => b(y + 1),
|
|
1060
1060
|
children: "›"
|
|
1061
1061
|
}),
|
|
1062
|
-
/* @__PURE__ */
|
|
1062
|
+
/* @__PURE__ */ d("div", {
|
|
1063
1063
|
style: {
|
|
1064
1064
|
position: "absolute",
|
|
1065
1065
|
bottom: 10,
|
|
@@ -1069,7 +1069,7 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1069
1069
|
justifyContent: "center",
|
|
1070
1070
|
gap: 6
|
|
1071
1071
|
},
|
|
1072
|
-
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */
|
|
1072
|
+
children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ d("button", {
|
|
1073
1073
|
type: "button",
|
|
1074
1074
|
"aria-label": `Go to slide ${t + 1}`,
|
|
1075
1075
|
onClick: () => b(t),
|
|
@@ -1087,7 +1087,7 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1087
1087
|
] })]
|
|
1088
1088
|
});
|
|
1089
1089
|
}
|
|
1090
|
-
var
|
|
1090
|
+
var We = (e, t) => ({
|
|
1091
1091
|
position: "absolute",
|
|
1092
1092
|
inset: 0,
|
|
1093
1093
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1095,26 +1095,26 @@ var He = (e, t) => ({
|
|
|
1095
1095
|
backgroundSize: "cover",
|
|
1096
1096
|
backgroundPosition: "center"
|
|
1097
1097
|
});
|
|
1098
|
-
function
|
|
1099
|
-
return e.length ? /* @__PURE__ */
|
|
1098
|
+
function Ge({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1099
|
+
return e.length ? /* @__PURE__ */ d(Ue, {
|
|
1100
1100
|
...r,
|
|
1101
1101
|
count: e.length,
|
|
1102
1102
|
renderSlide: (r) => {
|
|
1103
1103
|
let i = e[r];
|
|
1104
|
-
return /* @__PURE__ */
|
|
1104
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: We(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
|
|
1105
1105
|
style: {
|
|
1106
1106
|
position: "absolute",
|
|
1107
1107
|
color: "#fff",
|
|
1108
1108
|
textAlign: n,
|
|
1109
|
-
...
|
|
1109
|
+
...Ve[t] ?? Ve.bottom
|
|
1110
1110
|
},
|
|
1111
|
-
children: [i.title && /* @__PURE__ */
|
|
1111
|
+
children: [i.title && /* @__PURE__ */ d("div", {
|
|
1112
1112
|
style: {
|
|
1113
1113
|
fontSize: 22,
|
|
1114
1114
|
fontWeight: 700
|
|
1115
1115
|
},
|
|
1116
1116
|
children: i.title
|
|
1117
|
-
}), i.text && /* @__PURE__ */
|
|
1117
|
+
}), i.text && /* @__PURE__ */ d("div", {
|
|
1118
1118
|
style: {
|
|
1119
1119
|
fontSize: 14,
|
|
1120
1120
|
opacity: .9,
|
|
@@ -1126,13 +1126,13 @@ function Ue({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1126
1126
|
}
|
|
1127
1127
|
}) : null;
|
|
1128
1128
|
}
|
|
1129
|
-
function
|
|
1130
|
-
return e.length ? /* @__PURE__ */
|
|
1129
|
+
function Ke({ slides: e = [], linked: t, ...n }) {
|
|
1130
|
+
return e.length ? /* @__PURE__ */ d(Ue, {
|
|
1131
1131
|
...n,
|
|
1132
1132
|
count: e.length,
|
|
1133
1133
|
renderSlide: (n) => {
|
|
1134
1134
|
let r = e[n];
|
|
1135
|
-
return /* @__PURE__ */
|
|
1135
|
+
return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: We(r.image, r.color) }), /* @__PURE__ */ d("div", {
|
|
1136
1136
|
style: {
|
|
1137
1137
|
position: "absolute",
|
|
1138
1138
|
inset: 0,
|
|
@@ -1144,33 +1144,33 @@ function We({ slides: e = [], linked: t, ...n }) {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
}) : null;
|
|
1146
1146
|
}
|
|
1147
|
-
var
|
|
1147
|
+
var qe = {
|
|
1148
1148
|
color: "inherit",
|
|
1149
1149
|
textDecoration: "none",
|
|
1150
1150
|
fontSize: 14,
|
|
1151
1151
|
opacity: .85
|
|
1152
|
-
},
|
|
1152
|
+
}, Je = {
|
|
1153
1153
|
background: "var(--page-bg, #ffffff)",
|
|
1154
1154
|
color: "var(--page-text, #111827)",
|
|
1155
1155
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1156
1156
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1157
1157
|
zIndex: 60
|
|
1158
1158
|
};
|
|
1159
|
-
function
|
|
1160
|
-
let [
|
|
1159
|
+
function Ye({ brand: e, logo: n, brandHref: r, brandTarget: i, links: o = [], style: s, nodeRef: c, menu: p = "auto", breakpoint: m = 768 }) {
|
|
1160
|
+
let [h, g] = l(null), [_, v] = l(!1), [y, b] = l(!1), [x, S] = l(null);
|
|
1161
1161
|
a(() => {
|
|
1162
|
-
if (!
|
|
1163
|
-
let e = new ResizeObserver(() => h
|
|
1164
|
-
return e.observe(
|
|
1165
|
-
}, [
|
|
1166
|
-
let
|
|
1162
|
+
if (!h) return;
|
|
1163
|
+
let e = new ResizeObserver(() => v(h.offsetWidth < m));
|
|
1164
|
+
return e.observe(h), () => e.disconnect();
|
|
1165
|
+
}, [h, m]);
|
|
1166
|
+
let w = p === "hamburger" || p === "auto" && _, T = (e, t) => /* @__PURE__ */ f("a", {
|
|
1167
1167
|
href: e.href || "#",
|
|
1168
1168
|
style: {
|
|
1169
|
-
...
|
|
1169
|
+
...qe,
|
|
1170
1170
|
display: "block",
|
|
1171
1171
|
...t
|
|
1172
1172
|
},
|
|
1173
|
-
children: [e.label, e.desc && /* @__PURE__ */
|
|
1173
|
+
children: [e.label, e.desc && /* @__PURE__ */ d("span", {
|
|
1174
1174
|
style: {
|
|
1175
1175
|
display: "block",
|
|
1176
1176
|
fontSize: 12,
|
|
@@ -1180,9 +1180,9 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1180
1180
|
children: e.desc
|
|
1181
1181
|
})]
|
|
1182
1182
|
}, e.key);
|
|
1183
|
-
return /* @__PURE__ */
|
|
1183
|
+
return /* @__PURE__ */ f("nav", {
|
|
1184
1184
|
ref: (e) => {
|
|
1185
|
-
|
|
1185
|
+
g(e), c && c(e);
|
|
1186
1186
|
},
|
|
1187
1187
|
style: {
|
|
1188
1188
|
display: "flex",
|
|
@@ -1192,30 +1192,47 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1192
1192
|
padding: "14px 24px",
|
|
1193
1193
|
width: "100%",
|
|
1194
1194
|
position: "relative",
|
|
1195
|
-
...
|
|
1195
|
+
...C(s)
|
|
1196
1196
|
},
|
|
1197
1197
|
children: [
|
|
1198
|
-
n
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1198
|
+
(n || e) && (() => {
|
|
1199
|
+
let t = /* @__PURE__ */ f(u, { children: [n && /* @__PURE__ */ d("img", {
|
|
1200
|
+
src: n,
|
|
1201
|
+
alt: e || "Logo",
|
|
1202
|
+
style: {
|
|
1203
|
+
height: 28,
|
|
1204
|
+
display: "block"
|
|
1205
|
+
}
|
|
1206
|
+
}), e && /* @__PURE__ */ d("span", {
|
|
1207
|
+
style: {
|
|
1208
|
+
fontWeight: 700,
|
|
1209
|
+
fontSize: 18,
|
|
1210
|
+
fontFamily: "var(--page-heading-font, inherit)"
|
|
1211
|
+
},
|
|
1212
|
+
children: e
|
|
1213
|
+
})] }), a = {
|
|
1214
|
+
display: "flex",
|
|
1215
|
+
alignItems: "center",
|
|
1216
|
+
gap: 10,
|
|
1217
|
+
color: "inherit",
|
|
1218
|
+
textDecoration: "none"
|
|
1219
|
+
};
|
|
1220
|
+
return r ? /* @__PURE__ */ d("a", {
|
|
1221
|
+
href: r,
|
|
1222
|
+
target: i || void 0,
|
|
1223
|
+
rel: i === "_blank" ? "noopener noreferrer" : void 0,
|
|
1224
|
+
style: a,
|
|
1225
|
+
children: t
|
|
1226
|
+
}) : /* @__PURE__ */ d("div", {
|
|
1227
|
+
style: a,
|
|
1228
|
+
children: t
|
|
1229
|
+
});
|
|
1230
|
+
})(),
|
|
1231
|
+
/* @__PURE__ */ d("div", { style: { flexGrow: 1 } }),
|
|
1232
|
+
w ? /* @__PURE__ */ d("button", {
|
|
1216
1233
|
type: "button",
|
|
1217
|
-
"aria-label":
|
|
1218
|
-
onClick: () =>
|
|
1234
|
+
"aria-label": y ? "Close menu" : "Open menu",
|
|
1235
|
+
onClick: () => b(!y),
|
|
1219
1236
|
style: {
|
|
1220
1237
|
background: "transparent",
|
|
1221
1238
|
border: 0,
|
|
@@ -1225,39 +1242,39 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1225
1242
|
lineHeight: 1,
|
|
1226
1243
|
padding: 4
|
|
1227
1244
|
},
|
|
1228
|
-
children:
|
|
1229
|
-
}) : /* @__PURE__ */
|
|
1245
|
+
children: y ? "✕" : "☰"
|
|
1246
|
+
}) : /* @__PURE__ */ d("div", {
|
|
1230
1247
|
style: {
|
|
1231
1248
|
display: "flex",
|
|
1232
1249
|
gap: 20,
|
|
1233
1250
|
alignItems: "center",
|
|
1234
1251
|
flexWrap: "wrap"
|
|
1235
1252
|
},
|
|
1236
|
-
children:
|
|
1253
|
+
children: o.map((e) => {
|
|
1237
1254
|
let t = e.children ?? [];
|
|
1238
|
-
if (!t.length) return /* @__PURE__ */
|
|
1255
|
+
if (!t.length) return /* @__PURE__ */ d("a", {
|
|
1239
1256
|
href: e.href || "#",
|
|
1240
|
-
style:
|
|
1257
|
+
style: qe,
|
|
1241
1258
|
children: e.label
|
|
1242
1259
|
}, e.key);
|
|
1243
1260
|
let n = e.type === "mega";
|
|
1244
|
-
return /* @__PURE__ */
|
|
1261
|
+
return /* @__PURE__ */ f("span", {
|
|
1245
1262
|
style: {
|
|
1246
1263
|
position: n ? "static" : "relative",
|
|
1247
1264
|
display: "inline-flex"
|
|
1248
1265
|
},
|
|
1249
|
-
onMouseEnter: () =>
|
|
1250
|
-
onMouseLeave: () =>
|
|
1251
|
-
children: [/* @__PURE__ */
|
|
1266
|
+
onMouseEnter: () => S(e.key),
|
|
1267
|
+
onMouseLeave: () => S(null),
|
|
1268
|
+
children: [/* @__PURE__ */ f("a", {
|
|
1252
1269
|
href: e.href || "#",
|
|
1253
1270
|
style: {
|
|
1254
|
-
...
|
|
1271
|
+
...qe,
|
|
1255
1272
|
cursor: "pointer"
|
|
1256
1273
|
},
|
|
1257
1274
|
children: [
|
|
1258
1275
|
e.label,
|
|
1259
1276
|
" ",
|
|
1260
|
-
/* @__PURE__ */
|
|
1277
|
+
/* @__PURE__ */ d("span", {
|
|
1261
1278
|
style: {
|
|
1262
1279
|
fontSize: 9,
|
|
1263
1280
|
opacity: .6
|
|
@@ -1265,9 +1282,9 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1265
1282
|
children: "▼"
|
|
1266
1283
|
})
|
|
1267
1284
|
]
|
|
1268
|
-
}),
|
|
1285
|
+
}), x === e.key && (n ? /* @__PURE__ */ d("div", {
|
|
1269
1286
|
style: {
|
|
1270
|
-
...
|
|
1287
|
+
...Je,
|
|
1271
1288
|
position: "absolute",
|
|
1272
1289
|
left: 0,
|
|
1273
1290
|
right: 0,
|
|
@@ -1277,13 +1294,13 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1277
1294
|
gridTemplateColumns: "repeat(auto-fit, minmax(170px, 1fr))",
|
|
1278
1295
|
gap: 16
|
|
1279
1296
|
},
|
|
1280
|
-
children: t.map((e) =>
|
|
1297
|
+
children: t.map((e) => T(e, {
|
|
1281
1298
|
padding: "6px 8px",
|
|
1282
1299
|
borderRadius: 6
|
|
1283
1300
|
}))
|
|
1284
|
-
}) : /* @__PURE__ */
|
|
1301
|
+
}) : /* @__PURE__ */ d("div", {
|
|
1285
1302
|
style: {
|
|
1286
|
-
...
|
|
1303
|
+
...Je,
|
|
1287
1304
|
position: "absolute",
|
|
1288
1305
|
top: "100%",
|
|
1289
1306
|
left: 0,
|
|
@@ -1293,7 +1310,7 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1293
1310
|
display: "flex",
|
|
1294
1311
|
flexDirection: "column"
|
|
1295
1312
|
},
|
|
1296
|
-
children: t.map((e) =>
|
|
1313
|
+
children: t.map((e) => T(e, {
|
|
1297
1314
|
padding: "8px 12px",
|
|
1298
1315
|
borderRadius: 6
|
|
1299
1316
|
}))
|
|
@@ -1301,7 +1318,7 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1301
1318
|
}, e.key);
|
|
1302
1319
|
})
|
|
1303
1320
|
}),
|
|
1304
|
-
|
|
1321
|
+
w && y && /* @__PURE__ */ d("div", {
|
|
1305
1322
|
style: {
|
|
1306
1323
|
flexBasis: "100%",
|
|
1307
1324
|
width: "100%",
|
|
@@ -1309,35 +1326,35 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
|
|
|
1309
1326
|
flexDirection: "column",
|
|
1310
1327
|
paddingTop: 10
|
|
1311
1328
|
},
|
|
1312
|
-
children:
|
|
1329
|
+
children: o.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
|
|
1313
1330
|
href: e.href || "#",
|
|
1314
1331
|
style: {
|
|
1315
|
-
...
|
|
1332
|
+
...qe,
|
|
1316
1333
|
padding: "10px 4px",
|
|
1317
1334
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
1318
1335
|
opacity: 1
|
|
1319
1336
|
},
|
|
1320
1337
|
children: e.label
|
|
1321
|
-
}), (e.children ?? []).map((e) =>
|
|
1338
|
+
}), (e.children ?? []).map((e) => T(e, { padding: "8px 4px 8px 22px" }))] }, e.key))
|
|
1322
1339
|
})
|
|
1323
1340
|
]
|
|
1324
1341
|
});
|
|
1325
1342
|
}
|
|
1326
|
-
function
|
|
1327
|
-
let [i, a] =
|
|
1328
|
-
return e.length ? /* @__PURE__ */
|
|
1343
|
+
function Xe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1344
|
+
let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1345
|
+
return e.length ? /* @__PURE__ */ f("div", {
|
|
1329
1346
|
ref: r,
|
|
1330
1347
|
style: {
|
|
1331
1348
|
width: "100%",
|
|
1332
|
-
...
|
|
1349
|
+
...C(n)
|
|
1333
1350
|
},
|
|
1334
|
-
children: [/* @__PURE__ */
|
|
1351
|
+
children: [/* @__PURE__ */ d("div", {
|
|
1335
1352
|
style: {
|
|
1336
1353
|
display: "flex",
|
|
1337
1354
|
gap: 4,
|
|
1338
1355
|
borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
|
|
1339
1356
|
},
|
|
1340
|
-
children: e.map((e, t) => /* @__PURE__ */
|
|
1357
|
+
children: e.map((e, t) => /* @__PURE__ */ d("button", {
|
|
1341
1358
|
type: "button",
|
|
1342
1359
|
onClick: () => a(t),
|
|
1343
1360
|
style: {
|
|
@@ -1354,7 +1371,7 @@ function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1354
1371
|
},
|
|
1355
1372
|
children: e.label || `Tab ${t + 1}`
|
|
1356
1373
|
}, e.key))
|
|
1357
|
-
}), e.map((e, n) => /* @__PURE__ */
|
|
1374
|
+
}), e.map((e, n) => /* @__PURE__ */ d("div", {
|
|
1358
1375
|
style: {
|
|
1359
1376
|
display: n === o ? "flex" : "none",
|
|
1360
1377
|
flexDirection: "column"
|
|
@@ -1363,24 +1380,24 @@ function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1363
1380
|
}, e.key))]
|
|
1364
1381
|
}) : null;
|
|
1365
1382
|
}
|
|
1366
|
-
function
|
|
1367
|
-
let [a, o] =
|
|
1383
|
+
function Ze({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1384
|
+
let [a, o] = l(() => new Set(e.length ? [e[0].key] : []));
|
|
1368
1385
|
if (!e.length) return null;
|
|
1369
1386
|
let s = (e) => o((t) => {
|
|
1370
1387
|
let r = new Set(n ? t : []);
|
|
1371
1388
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
1372
1389
|
});
|
|
1373
|
-
return /* @__PURE__ */
|
|
1390
|
+
return /* @__PURE__ */ d("div", {
|
|
1374
1391
|
ref: i,
|
|
1375
1392
|
style: {
|
|
1376
1393
|
width: "100%",
|
|
1377
|
-
...
|
|
1394
|
+
...C(r)
|
|
1378
1395
|
},
|
|
1379
1396
|
children: e.map((n, r) => {
|
|
1380
1397
|
let i = a.has(n.key);
|
|
1381
|
-
return /* @__PURE__ */
|
|
1398
|
+
return /* @__PURE__ */ f("div", {
|
|
1382
1399
|
style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
|
|
1383
|
-
children: [/* @__PURE__ */
|
|
1400
|
+
children: [/* @__PURE__ */ f("button", {
|
|
1384
1401
|
type: "button",
|
|
1385
1402
|
onClick: () => s(n.key),
|
|
1386
1403
|
style: {
|
|
@@ -1399,7 +1416,7 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1399
1416
|
textAlign: "left",
|
|
1400
1417
|
cursor: "pointer"
|
|
1401
1418
|
},
|
|
1402
|
-
children: [n.title || `Item ${r + 1}`, /* @__PURE__ */
|
|
1419
|
+
children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ d("span", {
|
|
1403
1420
|
"aria-hidden": !0,
|
|
1404
1421
|
style: {
|
|
1405
1422
|
fontSize: 12,
|
|
@@ -1409,7 +1426,7 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1409
1426
|
},
|
|
1410
1427
|
children: "▼"
|
|
1411
1428
|
})]
|
|
1412
|
-
}), /* @__PURE__ */
|
|
1429
|
+
}), /* @__PURE__ */ d("div", {
|
|
1413
1430
|
style: {
|
|
1414
1431
|
display: i ? "flex" : "none",
|
|
1415
1432
|
flexDirection: "column"
|
|
@@ -1420,15 +1437,15 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1420
1437
|
})
|
|
1421
1438
|
});
|
|
1422
1439
|
}
|
|
1423
|
-
var
|
|
1440
|
+
var Qe = {
|
|
1424
1441
|
display: "flex",
|
|
1425
1442
|
flexDirection: "column",
|
|
1426
1443
|
gap: "12px"
|
|
1427
|
-
},
|
|
1444
|
+
}, Y = {
|
|
1428
1445
|
fontSize: "14px",
|
|
1429
1446
|
fontWeight: 500,
|
|
1430
1447
|
color: "var(--page-text, #111827)"
|
|
1431
|
-
},
|
|
1448
|
+
}, X = {
|
|
1432
1449
|
padding: "10px 12px",
|
|
1433
1450
|
border: "1px solid #d1d5db",
|
|
1434
1451
|
borderRadius: "6px",
|
|
@@ -1438,18 +1455,18 @@ var Xe = {
|
|
|
1438
1455
|
boxSizing: "border-box",
|
|
1439
1456
|
backgroundColor: "#ffffff",
|
|
1440
1457
|
color: "#111827"
|
|
1441
|
-
},
|
|
1458
|
+
}, $e = {
|
|
1442
1459
|
display: "flex",
|
|
1443
1460
|
alignItems: "center",
|
|
1444
1461
|
gap: "8px",
|
|
1445
1462
|
fontSize: "14px",
|
|
1446
1463
|
color: "var(--page-text, #111827)"
|
|
1447
|
-
},
|
|
1464
|
+
}, Z = (e) => e ? {
|
|
1448
1465
|
readOnly: !0,
|
|
1449
1466
|
tabIndex: -1,
|
|
1450
1467
|
onMouseDown: (e) => e.preventDefault()
|
|
1451
1468
|
} : {};
|
|
1452
|
-
function
|
|
1469
|
+
function et(e, t) {
|
|
1453
1470
|
if (!e) return !0;
|
|
1454
1471
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
1455
1472
|
switch (e.op) {
|
|
@@ -1463,11 +1480,11 @@ function Qe(e, t) {
|
|
|
1463
1480
|
default: return !1;
|
|
1464
1481
|
}
|
|
1465
1482
|
}
|
|
1466
|
-
var
|
|
1483
|
+
var tt = {
|
|
1467
1484
|
display: "flex",
|
|
1468
1485
|
flexDirection: "column",
|
|
1469
1486
|
gap: 6
|
|
1470
|
-
},
|
|
1487
|
+
}, nt = {
|
|
1471
1488
|
font: "inherit",
|
|
1472
1489
|
fontSize: 15,
|
|
1473
1490
|
padding: "10px 12px",
|
|
@@ -1478,16 +1495,16 @@ var $e = {
|
|
|
1478
1495
|
width: "100%",
|
|
1479
1496
|
boxSizing: "border-box"
|
|
1480
1497
|
};
|
|
1481
|
-
function
|
|
1498
|
+
function rt(e, t) {
|
|
1482
1499
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
1483
1500
|
if (!e?.parentField) return n;
|
|
1484
1501
|
let r = t?.[e.parentField];
|
|
1485
1502
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
1486
1503
|
}
|
|
1487
|
-
function
|
|
1488
|
-
let a = /* @__PURE__ */
|
|
1504
|
+
function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
1505
|
+
let a = /* @__PURE__ */ f("span", {
|
|
1489
1506
|
style: {
|
|
1490
|
-
...
|
|
1507
|
+
...Y,
|
|
1491
1508
|
fontSize: 14
|
|
1492
1509
|
},
|
|
1493
1510
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -1496,11 +1513,11 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1496
1513
|
required: e.required || void 0,
|
|
1497
1514
|
placeholder: e.placeholder || void 0,
|
|
1498
1515
|
disabled: r || void 0,
|
|
1499
|
-
style:
|
|
1516
|
+
style: nt,
|
|
1500
1517
|
value: t ?? "",
|
|
1501
1518
|
onChange: (t) => n(e.name, t.target.value)
|
|
1502
1519
|
};
|
|
1503
|
-
return e.type === "display" ? /* @__PURE__ */
|
|
1520
|
+
return e.type === "display" ? /* @__PURE__ */ d(e.variant && e.variant !== "p" ? e.variant : "p", {
|
|
1504
1521
|
style: {
|
|
1505
1522
|
margin: 0,
|
|
1506
1523
|
color: e.color || "inherit",
|
|
@@ -1517,7 +1534,7 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1517
1534
|
lineHeight: 1.35
|
|
1518
1535
|
},
|
|
1519
1536
|
children: e.label
|
|
1520
|
-
}) : e.type === "image" ? e.src ? /* @__PURE__ */
|
|
1537
|
+
}) : e.type === "image" ? e.src ? /* @__PURE__ */ d("img", {
|
|
1521
1538
|
src: e.src,
|
|
1522
1539
|
alt: e.label ?? "",
|
|
1523
1540
|
style: {
|
|
@@ -1525,10 +1542,10 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1525
1542
|
borderRadius: 8,
|
|
1526
1543
|
display: "block"
|
|
1527
1544
|
}
|
|
1528
|
-
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */
|
|
1545
|
+
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(Fe, {
|
|
1529
1546
|
url: e.src,
|
|
1530
1547
|
style: { width: "100%" }
|
|
1531
|
-
}) : /* @__PURE__ */
|
|
1548
|
+
}) : /* @__PURE__ */ d("video", {
|
|
1532
1549
|
src: e.src,
|
|
1533
1550
|
controls: !0,
|
|
1534
1551
|
style: {
|
|
@@ -1536,28 +1553,28 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1536
1553
|
borderRadius: 8,
|
|
1537
1554
|
display: "block"
|
|
1538
1555
|
}
|
|
1539
|
-
}) : null : /* @__PURE__ */
|
|
1540
|
-
style:
|
|
1556
|
+
}) : null : /* @__PURE__ */ f("label", {
|
|
1557
|
+
style: tt,
|
|
1541
1558
|
children: [
|
|
1542
1559
|
a,
|
|
1543
|
-
e.type === "textarea" || e.multiline ? /* @__PURE__ */
|
|
1560
|
+
e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
|
|
1544
1561
|
...o,
|
|
1545
1562
|
rows: 4,
|
|
1546
1563
|
style: {
|
|
1547
|
-
...
|
|
1564
|
+
...nt,
|
|
1548
1565
|
resize: "vertical"
|
|
1549
1566
|
}
|
|
1550
|
-
}) : e.type === "select" ? /* @__PURE__ */
|
|
1567
|
+
}) : e.type === "select" ? /* @__PURE__ */ f("select", {
|
|
1551
1568
|
...o,
|
|
1552
1569
|
disabled: o.disabled || !!e.parentField && !i?.[e.parentField],
|
|
1553
|
-
children: [/* @__PURE__ */
|
|
1570
|
+
children: [/* @__PURE__ */ d("option", {
|
|
1554
1571
|
value: "",
|
|
1555
1572
|
children: e.placeholder || "—"
|
|
1556
|
-
}),
|
|
1573
|
+
}), rt(e, i).map((e, t) => /* @__PURE__ */ d("option", {
|
|
1557
1574
|
value: typeof e == "string" ? e : e.value,
|
|
1558
1575
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
1559
1576
|
}, t))]
|
|
1560
|
-
}) : e.type === "checkbox" ? /* @__PURE__ */
|
|
1577
|
+
}) : e.type === "checkbox" ? /* @__PURE__ */ d("input", {
|
|
1561
1578
|
type: "checkbox",
|
|
1562
1579
|
name: e.name,
|
|
1563
1580
|
required: e.required || void 0,
|
|
@@ -1568,7 +1585,7 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1568
1585
|
width: 18,
|
|
1569
1586
|
height: 18
|
|
1570
1587
|
}
|
|
1571
|
-
}) : e.type === "upload" ? /* @__PURE__ */
|
|
1588
|
+
}) : e.type === "upload" ? /* @__PURE__ */ d("input", {
|
|
1572
1589
|
type: "file",
|
|
1573
1590
|
name: e.name,
|
|
1574
1591
|
accept: e.accept || void 0,
|
|
@@ -1579,7 +1596,7 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1579
1596
|
font: "inherit",
|
|
1580
1597
|
fontSize: 14
|
|
1581
1598
|
}
|
|
1582
|
-
}) : /* @__PURE__ */
|
|
1599
|
+
}) : /* @__PURE__ */ d("input", {
|
|
1583
1600
|
...o,
|
|
1584
1601
|
type: {
|
|
1585
1602
|
email: "email",
|
|
@@ -1590,7 +1607,7 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1590
1607
|
link: "url"
|
|
1591
1608
|
}[e.type] ?? "text"
|
|
1592
1609
|
}),
|
|
1593
|
-
e.help && /* @__PURE__ */
|
|
1610
|
+
e.help && /* @__PURE__ */ d("span", {
|
|
1594
1611
|
style: {
|
|
1595
1612
|
fontSize: 12,
|
|
1596
1613
|
opacity: .65
|
|
@@ -1600,16 +1617,16 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1600
1617
|
]
|
|
1601
1618
|
});
|
|
1602
1619
|
}
|
|
1603
|
-
function
|
|
1604
|
-
let { tenant: y, apiUrl: b } = i(
|
|
1620
|
+
function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
1621
|
+
let { tenant: y, apiUrl: b } = i(H), [x, S] = l("form"), [w, T] = l(null), [E, D] = l({}), [O, k] = l(0), A = h ? v || "form" : x;
|
|
1605
1622
|
a(() => {
|
|
1606
|
-
if (!
|
|
1623
|
+
if (!c || !s) return;
|
|
1607
1624
|
let e = !0;
|
|
1608
1625
|
return fetch(`${b || "/api"}/forms/${encodeURIComponent(s)}`, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
|
|
1609
1626
|
e = !1;
|
|
1610
1627
|
};
|
|
1611
1628
|
}, [
|
|
1612
|
-
|
|
1629
|
+
c,
|
|
1613
1630
|
s,
|
|
1614
1631
|
y,
|
|
1615
1632
|
b
|
|
@@ -1622,9 +1639,9 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1622
1639
|
section: e,
|
|
1623
1640
|
fields: []
|
|
1624
1641
|
}) : j[j.length - 1].fields.push(e);
|
|
1625
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
1642
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || et(e.section.condition, E)).map((e) => ({
|
|
1626
1643
|
...e,
|
|
1627
|
-
fields: e.fields.filter((e) =>
|
|
1644
|
+
fields: e.fields.filter((e) => et(e.condition, E))
|
|
1628
1645
|
})), 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) => {
|
|
1629
1646
|
let t = E[e.name];
|
|
1630
1647
|
return e.required && (t == null || t === "" || t === !1);
|
|
@@ -1636,11 +1653,11 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1636
1653
|
for (let t of Array.isArray(w?.fields) ? w.fields : []) t?.parentField === e && delete r[t.name];
|
|
1637
1654
|
return r;
|
|
1638
1655
|
});
|
|
1639
|
-
return /* @__PURE__ */
|
|
1656
|
+
return /* @__PURE__ */ f("div", {
|
|
1640
1657
|
ref: m,
|
|
1641
|
-
style:
|
|
1658
|
+
style: C(e),
|
|
1642
1659
|
children: [
|
|
1643
|
-
/* @__PURE__ */
|
|
1660
|
+
/* @__PURE__ */ d("form", {
|
|
1644
1661
|
action: t || void 0,
|
|
1645
1662
|
method: n || "post",
|
|
1646
1663
|
name: r || void 0,
|
|
@@ -1649,7 +1666,7 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1649
1666
|
if (e.preventDefault(), !h) {
|
|
1650
1667
|
if (s) {
|
|
1651
1668
|
let t = {};
|
|
1652
|
-
if (
|
|
1669
|
+
if (c) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
|
|
1653
1670
|
else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
|
|
1654
1671
|
try {
|
|
1655
1672
|
let e = await fetch(`${b || "/api"}/forms/${s}/submit`, {
|
|
@@ -1660,14 +1677,14 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1660
1677
|
},
|
|
1661
1678
|
body: JSON.stringify(t)
|
|
1662
1679
|
}), n = await e.json().catch(() => null);
|
|
1663
|
-
|
|
1680
|
+
S(e.ok && n?.success !== !1 ? "success" : "error");
|
|
1664
1681
|
} catch {
|
|
1665
|
-
|
|
1682
|
+
S("error");
|
|
1666
1683
|
}
|
|
1667
1684
|
return;
|
|
1668
1685
|
}
|
|
1669
1686
|
if (!t) {
|
|
1670
|
-
|
|
1687
|
+
S("success");
|
|
1671
1688
|
return;
|
|
1672
1689
|
}
|
|
1673
1690
|
try {
|
|
@@ -1675,23 +1692,23 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1675
1692
|
method: n || "post",
|
|
1676
1693
|
body: new FormData(e.currentTarget)
|
|
1677
1694
|
});
|
|
1678
|
-
|
|
1695
|
+
S(r.ok ? "success" : "error");
|
|
1679
1696
|
} catch {
|
|
1680
|
-
|
|
1697
|
+
S("error");
|
|
1681
1698
|
}
|
|
1682
1699
|
}
|
|
1683
1700
|
},
|
|
1684
1701
|
style: {
|
|
1685
|
-
...
|
|
1702
|
+
...Qe,
|
|
1686
1703
|
display: A === "success" ? "none" : "flex"
|
|
1687
1704
|
},
|
|
1688
|
-
children:
|
|
1689
|
-
P && /* @__PURE__ */
|
|
1705
|
+
children: c && s ? /* @__PURE__ */ f(u, { children: [
|
|
1706
|
+
P && /* @__PURE__ */ d(bt, {
|
|
1690
1707
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
1691
1708
|
active: F + 1,
|
|
1692
1709
|
style: { marginBottom: 8 }
|
|
1693
1710
|
}),
|
|
1694
|
-
P && N[F]?.section?.help && /* @__PURE__ */
|
|
1711
|
+
P && N[F]?.section?.help && /* @__PURE__ */ d("p", {
|
|
1695
1712
|
style: {
|
|
1696
1713
|
margin: 0,
|
|
1697
1714
|
fontSize: 14,
|
|
@@ -1699,26 +1716,26 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1699
1716
|
},
|
|
1700
1717
|
children: N[F].section.help
|
|
1701
1718
|
}),
|
|
1702
|
-
I.map((e) => /* @__PURE__ */
|
|
1719
|
+
I.map((e) => /* @__PURE__ */ d(it, {
|
|
1703
1720
|
field: e,
|
|
1704
1721
|
value: E[e.name],
|
|
1705
1722
|
values: E,
|
|
1706
1723
|
onChange: z,
|
|
1707
1724
|
inert: h
|
|
1708
1725
|
}, e.name)),
|
|
1709
|
-
/* @__PURE__ */
|
|
1726
|
+
/* @__PURE__ */ f("div", {
|
|
1710
1727
|
style: {
|
|
1711
1728
|
display: "flex",
|
|
1712
1729
|
gap: 10,
|
|
1713
1730
|
alignItems: "center",
|
|
1714
1731
|
marginTop: 4
|
|
1715
1732
|
},
|
|
1716
|
-
children: [P && F > 0 && /* @__PURE__ */
|
|
1733
|
+
children: [P && F > 0 && /* @__PURE__ */ d("button", {
|
|
1717
1734
|
type: "button",
|
|
1718
1735
|
disabled: h || void 0,
|
|
1719
1736
|
onClick: () => k(F - 1),
|
|
1720
1737
|
style: {
|
|
1721
|
-
...
|
|
1738
|
+
...q,
|
|
1722
1739
|
background: "transparent",
|
|
1723
1740
|
color: "inherit",
|
|
1724
1741
|
border: 0,
|
|
@@ -1726,12 +1743,12 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1726
1743
|
cursor: "pointer"
|
|
1727
1744
|
},
|
|
1728
1745
|
children: "Back"
|
|
1729
|
-
}), P && !R ? /* @__PURE__ */
|
|
1746
|
+
}), P && !R ? /* @__PURE__ */ d("button", {
|
|
1730
1747
|
type: "button",
|
|
1731
1748
|
disabled: h || L.length > 0,
|
|
1732
1749
|
onClick: () => k(F + 1),
|
|
1733
1750
|
style: {
|
|
1734
|
-
...
|
|
1751
|
+
...q,
|
|
1735
1752
|
border: 0,
|
|
1736
1753
|
padding: "10px 22px",
|
|
1737
1754
|
borderRadius: 8,
|
|
@@ -1741,11 +1758,11 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1741
1758
|
opacity: L.length ? .5 : 1
|
|
1742
1759
|
},
|
|
1743
1760
|
children: "Next"
|
|
1744
|
-
}) : /* @__PURE__ */
|
|
1761
|
+
}) : /* @__PURE__ */ d("button", {
|
|
1745
1762
|
type: "submit",
|
|
1746
1763
|
disabled: h || void 0,
|
|
1747
1764
|
style: {
|
|
1748
|
-
...
|
|
1765
|
+
...q,
|
|
1749
1766
|
border: 0,
|
|
1750
1767
|
padding: "10px 22px",
|
|
1751
1768
|
borderRadius: 8,
|
|
@@ -1758,11 +1775,11 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1758
1775
|
})
|
|
1759
1776
|
] }) : g
|
|
1760
1777
|
}),
|
|
1761
|
-
/* @__PURE__ */
|
|
1778
|
+
/* @__PURE__ */ d("div", {
|
|
1762
1779
|
style: { display: A === "success" ? "block" : "none" },
|
|
1763
1780
|
children: _?.success ?? null
|
|
1764
1781
|
}),
|
|
1765
|
-
/* @__PURE__ */
|
|
1782
|
+
/* @__PURE__ */ d("div", {
|
|
1766
1783
|
style: {
|
|
1767
1784
|
display: A === "error" ? "block" : "none",
|
|
1768
1785
|
marginTop: 12
|
|
@@ -1772,53 +1789,143 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
|
|
|
1772
1789
|
]
|
|
1773
1790
|
});
|
|
1774
1791
|
}
|
|
1775
|
-
|
|
1776
|
-
|
|
1792
|
+
var ot = null, st = () => ot || (ot = new Promise((e) => {
|
|
1793
|
+
if (typeof window > "u") return;
|
|
1794
|
+
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
1795
|
+
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
1796
|
+
let t = document.createElement("script");
|
|
1797
|
+
t.src = "https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit", t.async = !0, document.head.appendChild(t);
|
|
1798
|
+
}), ot);
|
|
1799
|
+
function ct({ siteKey: e, theme: t, size: n, style: r, nodeRef: o, inert: s }) {
|
|
1800
|
+
let l = i(H), u = l?.settings && typeof l.settings == "object" ? l.settings["google.recaptchaKey"] : "", p = typeof e == "string" && e.trim() || (typeof u == "string" ? u.trim() : ""), m = c(null), h = c(!1);
|
|
1801
|
+
if (a(() => {
|
|
1802
|
+
if (s || !p || h.current || !m.current) return;
|
|
1803
|
+
let e = !0;
|
|
1804
|
+
return st().then((r) => {
|
|
1805
|
+
if (!(!e || h.current || !m.current || !r?.render)) {
|
|
1806
|
+
h.current = !0;
|
|
1807
|
+
try {
|
|
1808
|
+
r.render(m.current, {
|
|
1809
|
+
sitekey: p,
|
|
1810
|
+
theme: t === "dark" ? "dark" : "light",
|
|
1811
|
+
size: n === "compact" ? "compact" : "normal"
|
|
1812
|
+
});
|
|
1813
|
+
} catch {}
|
|
1814
|
+
}
|
|
1815
|
+
}), () => {
|
|
1816
|
+
e = !1;
|
|
1817
|
+
};
|
|
1818
|
+
}, [
|
|
1819
|
+
s,
|
|
1820
|
+
p,
|
|
1821
|
+
t,
|
|
1822
|
+
n
|
|
1823
|
+
]), s) {
|
|
1824
|
+
let e = t === "dark";
|
|
1825
|
+
return /* @__PURE__ */ f("div", {
|
|
1826
|
+
ref: o,
|
|
1827
|
+
style: C(r),
|
|
1828
|
+
children: [/* @__PURE__ */ f("div", {
|
|
1829
|
+
style: {
|
|
1830
|
+
width: n === "compact" ? 164 : 302,
|
|
1831
|
+
boxSizing: "border-box",
|
|
1832
|
+
padding: "12px 14px",
|
|
1833
|
+
display: "flex",
|
|
1834
|
+
alignItems: "center",
|
|
1835
|
+
gap: 12,
|
|
1836
|
+
borderRadius: 4,
|
|
1837
|
+
border: `1px solid ${e ? "#52565b" : "#d3d3d3"}`,
|
|
1838
|
+
background: e ? "#222528" : "#f9f9f9",
|
|
1839
|
+
color: e ? "#f1f1f1" : "#282828",
|
|
1840
|
+
fontSize: 14,
|
|
1841
|
+
fontFamily: "Roboto, Arial, sans-serif"
|
|
1842
|
+
},
|
|
1843
|
+
children: [
|
|
1844
|
+
/* @__PURE__ */ d("span", { style: {
|
|
1845
|
+
width: 24,
|
|
1846
|
+
height: 24,
|
|
1847
|
+
flexShrink: 0,
|
|
1848
|
+
borderRadius: 3,
|
|
1849
|
+
border: `2px solid ${e ? "#8a8f94" : "#c1c1c1"}`,
|
|
1850
|
+
background: e ? "#2f3337" : "#fff"
|
|
1851
|
+
} }),
|
|
1852
|
+
/* @__PURE__ */ d("span", {
|
|
1853
|
+
style: { flexGrow: 1 },
|
|
1854
|
+
children: "I'm not a robot"
|
|
1855
|
+
}),
|
|
1856
|
+
/* @__PURE__ */ d("span", {
|
|
1857
|
+
style: {
|
|
1858
|
+
fontSize: 9,
|
|
1859
|
+
opacity: .6,
|
|
1860
|
+
textAlign: "center",
|
|
1861
|
+
lineHeight: 1.3
|
|
1862
|
+
},
|
|
1863
|
+
children: "reCAPTCHA"
|
|
1864
|
+
})
|
|
1865
|
+
]
|
|
1866
|
+
}), !p && /* @__PURE__ */ d("div", {
|
|
1867
|
+
style: {
|
|
1868
|
+
marginTop: 6,
|
|
1869
|
+
fontSize: 11,
|
|
1870
|
+
color: "#b45309"
|
|
1871
|
+
},
|
|
1872
|
+
children: "Set the google.recaptchaKey tenant setting (or a site key in Settings) to activate it."
|
|
1873
|
+
})]
|
|
1874
|
+
});
|
|
1875
|
+
}
|
|
1876
|
+
return p ? /* @__PURE__ */ d("div", {
|
|
1877
|
+
ref: o,
|
|
1878
|
+
style: C(r),
|
|
1879
|
+
children: /* @__PURE__ */ d("div", { ref: m })
|
|
1880
|
+
}) : null;
|
|
1881
|
+
}
|
|
1882
|
+
function lt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
1883
|
+
return /* @__PURE__ */ d("label", {
|
|
1777
1884
|
ref: r,
|
|
1778
1885
|
style: {
|
|
1779
|
-
...
|
|
1780
|
-
...
|
|
1886
|
+
...Y,
|
|
1887
|
+
...C(n)
|
|
1781
1888
|
},
|
|
1782
|
-
children:
|
|
1889
|
+
children: J(t, e, i)
|
|
1783
1890
|
});
|
|
1784
1891
|
}
|
|
1785
|
-
function
|
|
1786
|
-
return /* @__PURE__ */
|
|
1892
|
+
function ut({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1893
|
+
return /* @__PURE__ */ d("input", {
|
|
1787
1894
|
ref: a,
|
|
1788
1895
|
type: e,
|
|
1789
1896
|
name: t || void 0,
|
|
1790
1897
|
placeholder: n,
|
|
1791
1898
|
required: !o && !!r,
|
|
1792
1899
|
style: {
|
|
1793
|
-
...
|
|
1794
|
-
...
|
|
1900
|
+
...X,
|
|
1901
|
+
...C(i)
|
|
1795
1902
|
},
|
|
1796
|
-
...
|
|
1903
|
+
...Z(o)
|
|
1797
1904
|
});
|
|
1798
1905
|
}
|
|
1799
|
-
function
|
|
1800
|
-
return /* @__PURE__ */
|
|
1906
|
+
function dt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1907
|
+
return /* @__PURE__ */ d("textarea", {
|
|
1801
1908
|
ref: a,
|
|
1802
1909
|
name: e || void 0,
|
|
1803
1910
|
placeholder: t,
|
|
1804
1911
|
rows: n,
|
|
1805
1912
|
required: !o && !!r,
|
|
1806
1913
|
style: {
|
|
1807
|
-
...
|
|
1914
|
+
...X,
|
|
1808
1915
|
resize: "vertical",
|
|
1809
|
-
...
|
|
1916
|
+
...C(i)
|
|
1810
1917
|
},
|
|
1811
|
-
...
|
|
1918
|
+
...Z(o)
|
|
1812
1919
|
});
|
|
1813
1920
|
}
|
|
1814
|
-
function
|
|
1815
|
-
return /* @__PURE__ */
|
|
1921
|
+
function ft({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
1922
|
+
return /* @__PURE__ */ f("label", {
|
|
1816
1923
|
ref: o,
|
|
1817
1924
|
style: {
|
|
1818
|
-
|
|
1819
|
-
...
|
|
1925
|
+
...$e,
|
|
1926
|
+
...C(a)
|
|
1820
1927
|
},
|
|
1821
|
-
children: [/* @__PURE__ */
|
|
1928
|
+
children: [/* @__PURE__ */ d("input", {
|
|
1822
1929
|
type: e,
|
|
1823
1930
|
name: n || void 0,
|
|
1824
1931
|
value: r || void 0,
|
|
@@ -1832,8 +1939,8 @@ function st({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
1832
1939
|
}), t]
|
|
1833
1940
|
});
|
|
1834
1941
|
}
|
|
1835
|
-
function
|
|
1836
|
-
return /* @__PURE__ */
|
|
1942
|
+
function pt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
1943
|
+
return /* @__PURE__ */ f("select", {
|
|
1837
1944
|
ref: a,
|
|
1838
1945
|
name: e || void 0,
|
|
1839
1946
|
required: !o && !!r,
|
|
@@ -1841,45 +1948,45 @@ function ct({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
1841
1948
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
1842
1949
|
tabIndex: o ? -1 : void 0,
|
|
1843
1950
|
style: {
|
|
1844
|
-
...
|
|
1951
|
+
...X,
|
|
1845
1952
|
appearance: "auto",
|
|
1846
|
-
...
|
|
1953
|
+
...C(i)
|
|
1847
1954
|
},
|
|
1848
|
-
children: [t !== "" && /* @__PURE__ */
|
|
1955
|
+
children: [t !== "" && /* @__PURE__ */ d("option", {
|
|
1849
1956
|
value: "",
|
|
1850
1957
|
disabled: !0,
|
|
1851
1958
|
children: t ?? "Select…"
|
|
1852
|
-
}), n.map((e, t) => /* @__PURE__ */
|
|
1959
|
+
}), n.map((e, t) => /* @__PURE__ */ d("option", {
|
|
1853
1960
|
value: e,
|
|
1854
1961
|
children: e
|
|
1855
1962
|
}, t))]
|
|
1856
1963
|
});
|
|
1857
1964
|
}
|
|
1858
|
-
function
|
|
1859
|
-
let [s,
|
|
1860
|
-
return /* @__PURE__ */
|
|
1965
|
+
function mt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
1966
|
+
let [s, c] = l(null);
|
|
1967
|
+
return /* @__PURE__ */ f("label", {
|
|
1861
1968
|
ref: a,
|
|
1862
1969
|
style: {
|
|
1863
|
-
...
|
|
1970
|
+
...X,
|
|
1864
1971
|
display: "flex",
|
|
1865
1972
|
alignItems: "center",
|
|
1866
1973
|
gap: "8px",
|
|
1867
1974
|
cursor: o ? "default" : "pointer",
|
|
1868
1975
|
borderStyle: "dashed",
|
|
1869
1976
|
color: s ? "#111827" : "#6b7280",
|
|
1870
|
-
...
|
|
1977
|
+
...C(i)
|
|
1871
1978
|
},
|
|
1872
1979
|
children: [
|
|
1873
|
-
/* @__PURE__ */
|
|
1980
|
+
/* @__PURE__ */ d("input", {
|
|
1874
1981
|
type: "file",
|
|
1875
1982
|
name: e || void 0,
|
|
1876
1983
|
accept: t || void 0,
|
|
1877
1984
|
required: !o && !!n,
|
|
1878
1985
|
disabled: !!o,
|
|
1879
|
-
onChange: (e) =>
|
|
1986
|
+
onChange: (e) => c(e.target.files?.[0]?.name ?? null),
|
|
1880
1987
|
style: { display: "none" }
|
|
1881
1988
|
}),
|
|
1882
|
-
/* @__PURE__ */
|
|
1989
|
+
/* @__PURE__ */ d("span", {
|
|
1883
1990
|
"aria-hidden": !0,
|
|
1884
1991
|
children: "📎"
|
|
1885
1992
|
}),
|
|
@@ -1887,12 +1994,12 @@ function lt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
1887
1994
|
]
|
|
1888
1995
|
});
|
|
1889
1996
|
}
|
|
1890
|
-
function
|
|
1891
|
-
return /* @__PURE__ */
|
|
1997
|
+
function ht({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
1998
|
+
return /* @__PURE__ */ d("button", {
|
|
1892
1999
|
ref: n,
|
|
1893
2000
|
type: r ? "button" : "submit",
|
|
1894
2001
|
style: {
|
|
1895
|
-
...
|
|
2002
|
+
...q,
|
|
1896
2003
|
border: 0,
|
|
1897
2004
|
cursor: "pointer",
|
|
1898
2005
|
alignSelf: "flex-start",
|
|
@@ -1902,37 +2009,37 @@ function ut({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
1902
2009
|
fontWeight: 600,
|
|
1903
2010
|
lineHeight: 1.4,
|
|
1904
2011
|
fontFamily: "inherit",
|
|
1905
|
-
...
|
|
2012
|
+
...C(t)
|
|
1906
2013
|
},
|
|
1907
2014
|
children: e
|
|
1908
2015
|
});
|
|
1909
2016
|
}
|
|
1910
|
-
function
|
|
2017
|
+
function gt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
1911
2018
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
1912
|
-
return /* @__PURE__ */
|
|
2019
|
+
return /* @__PURE__ */ d("div", {
|
|
1913
2020
|
ref: r,
|
|
1914
2021
|
style: {
|
|
1915
2022
|
display: "grid",
|
|
1916
2023
|
gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
|
|
1917
2024
|
gap: 16,
|
|
1918
2025
|
width: "100%",
|
|
1919
|
-
...
|
|
2026
|
+
...C(n)
|
|
1920
2027
|
},
|
|
1921
|
-
children: Array.from({ length: a }, (e, t) => /* @__PURE__ */
|
|
2028
|
+
children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ d("div", {
|
|
1922
2029
|
style: { minWidth: 0 },
|
|
1923
2030
|
children: i?.[`cell-${t}`] ?? null
|
|
1924
2031
|
}, t))
|
|
1925
2032
|
});
|
|
1926
2033
|
}
|
|
1927
|
-
function
|
|
1928
|
-
let { tenant: g, apiUrl: _, locale: v } = i(
|
|
2034
|
+
function _t({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, style: m, nodeRef: h }) {
|
|
2035
|
+
let { tenant: g, apiUrl: _, locale: v } = i(H), y = i(W), b = i(U)?.[e], [x, S] = l(null);
|
|
1929
2036
|
if (a(() => {
|
|
1930
2037
|
if (!e || b) return;
|
|
1931
2038
|
let t = !0, n = e.startsWith("api:") ? `${_}/data/${encodeURIComponent(e.slice(4))}` : `${_}/dynamic/${encodeURIComponent(e)}${v ? `?locale=${encodeURIComponent(v)}` : ""}`;
|
|
1932
2039
|
return fetch(n, { headers: g ? { "x-tenant": g } : {} }).then((e) => e.json()).then((e) => {
|
|
1933
2040
|
let n = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
|
|
1934
|
-
return t &&
|
|
1935
|
-
}).catch(() => t &&
|
|
2041
|
+
return t && S(n.filter((e) => e && typeof e == "object"));
|
|
2042
|
+
}).catch(() => t && S([])), () => {
|
|
1936
2043
|
t = !1;
|
|
1937
2044
|
};
|
|
1938
2045
|
}, [
|
|
@@ -1951,49 +2058,49 @@ function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
1951
2058
|
gridTemplateColumns: `repeat(${T}, minmax(0, 1fr))`,
|
|
1952
2059
|
gap: 24
|
|
1953
2060
|
};
|
|
1954
|
-
return
|
|
2061
|
+
return u && p && y?.render ? /* @__PURE__ */ d("div", {
|
|
1955
2062
|
ref: h,
|
|
1956
2063
|
style: {
|
|
1957
2064
|
width: "100%",
|
|
1958
2065
|
...E,
|
|
1959
|
-
...
|
|
2066
|
+
...C(m)
|
|
1960
2067
|
},
|
|
1961
|
-
children: w.map((e) => /* @__PURE__ */
|
|
2068
|
+
children: w.map((e) => /* @__PURE__ */ d("div", {
|
|
1962
2069
|
style: { minWidth: 0 },
|
|
1963
|
-
children: y.render(p, (t) =>
|
|
2070
|
+
children: y.render(p, (t) => se(t, e))
|
|
1964
2071
|
}, e.id ?? e?.data?.slug))
|
|
1965
|
-
}) : /* @__PURE__ */
|
|
2072
|
+
}) : /* @__PURE__ */ d("div", {
|
|
1966
2073
|
ref: h,
|
|
1967
2074
|
style: {
|
|
1968
2075
|
width: "100%",
|
|
1969
2076
|
...E,
|
|
1970
|
-
...
|
|
2077
|
+
...C(m)
|
|
1971
2078
|
},
|
|
1972
2079
|
children: w.map((e) => {
|
|
1973
|
-
let t = o ?
|
|
1974
|
-
return /* @__PURE__ */
|
|
2080
|
+
let t = o ? G(e?.data, o) : null, r = s ? K(G(e?.data, s)) : null, i = c ? G(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : K(i), u = n === "list";
|
|
2081
|
+
return /* @__PURE__ */ f("div", {
|
|
1975
2082
|
style: {
|
|
1976
2083
|
display: "flex",
|
|
1977
|
-
flexDirection:
|
|
1978
|
-
gap:
|
|
1979
|
-
alignItems:
|
|
2084
|
+
flexDirection: u ? "row" : "column",
|
|
2085
|
+
gap: u ? 20 : 12,
|
|
2086
|
+
alignItems: u ? "center" : "stretch",
|
|
1980
2087
|
minWidth: 0
|
|
1981
2088
|
},
|
|
1982
|
-
children: [t && /* @__PURE__ */
|
|
2089
|
+
children: [t && /* @__PURE__ */ d("img", {
|
|
1983
2090
|
src: t,
|
|
1984
2091
|
alt: r ?? "",
|
|
1985
2092
|
style: {
|
|
1986
|
-
width:
|
|
2093
|
+
width: u ? 160 : "100%",
|
|
1987
2094
|
aspectRatio: "3 / 2",
|
|
1988
2095
|
objectFit: "cover",
|
|
1989
2096
|
borderRadius: 10,
|
|
1990
2097
|
flexShrink: 0,
|
|
1991
2098
|
display: "block"
|
|
1992
2099
|
}
|
|
1993
|
-
}), /* @__PURE__ */
|
|
2100
|
+
}), /* @__PURE__ */ f("div", {
|
|
1994
2101
|
style: { minWidth: 0 },
|
|
1995
2102
|
children: [
|
|
1996
|
-
r && /* @__PURE__ */
|
|
2103
|
+
r && /* @__PURE__ */ d("h3", {
|
|
1997
2104
|
style: {
|
|
1998
2105
|
margin: 0,
|
|
1999
2106
|
fontSize: 18,
|
|
@@ -2001,23 +2108,23 @@ function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2001
2108
|
},
|
|
2002
2109
|
children: r
|
|
2003
2110
|
}),
|
|
2004
|
-
|
|
2111
|
+
l && /* @__PURE__ */ d("p", {
|
|
2005
2112
|
style: {
|
|
2006
2113
|
margin: "6px 0 0",
|
|
2007
2114
|
fontSize: 14,
|
|
2008
2115
|
lineHeight: 1.55,
|
|
2009
2116
|
opacity: .75
|
|
2010
2117
|
},
|
|
2011
|
-
children:
|
|
2118
|
+
children: l
|
|
2012
2119
|
}),
|
|
2013
|
-
a && /* @__PURE__ */
|
|
2120
|
+
a && /* @__PURE__ */ d("div", {
|
|
2014
2121
|
style: {
|
|
2015
2122
|
marginTop: 6,
|
|
2016
2123
|
fontSize: 14,
|
|
2017
2124
|
lineHeight: 1.55,
|
|
2018
2125
|
opacity: .85
|
|
2019
2126
|
},
|
|
2020
|
-
children:
|
|
2127
|
+
children: Ce(a)
|
|
2021
2128
|
})
|
|
2022
2129
|
]
|
|
2023
2130
|
})]
|
|
@@ -2025,12 +2132,12 @@ function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
|
|
|
2025
2132
|
})
|
|
2026
2133
|
});
|
|
2027
2134
|
}
|
|
2028
|
-
function
|
|
2029
|
-
return e.length ? /* @__PURE__ */
|
|
2135
|
+
function vt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
2136
|
+
return e.length ? /* @__PURE__ */ d("nav", {
|
|
2030
2137
|
ref: r,
|
|
2031
2138
|
"aria-label": "Breadcrumb",
|
|
2032
|
-
style: { ...
|
|
2033
|
-
children: /* @__PURE__ */
|
|
2139
|
+
style: { ...C(n) },
|
|
2140
|
+
children: /* @__PURE__ */ d("ol", {
|
|
2034
2141
|
style: {
|
|
2035
2142
|
display: "flex",
|
|
2036
2143
|
flexWrap: "wrap",
|
|
@@ -2043,25 +2150,25 @@ function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2043
2150
|
},
|
|
2044
2151
|
children: e.map((n, r) => {
|
|
2045
2152
|
let i = r === e.length - 1;
|
|
2046
|
-
return /* @__PURE__ */
|
|
2153
|
+
return /* @__PURE__ */ f("li", {
|
|
2047
2154
|
style: {
|
|
2048
2155
|
display: "flex",
|
|
2049
2156
|
alignItems: "center",
|
|
2050
2157
|
gap: 8,
|
|
2051
2158
|
minWidth: 0
|
|
2052
2159
|
},
|
|
2053
|
-
children: [r > 0 && /* @__PURE__ */
|
|
2160
|
+
children: [r > 0 && /* @__PURE__ */ d("span", {
|
|
2054
2161
|
style: { opacity: .4 },
|
|
2055
2162
|
"aria-hidden": !0,
|
|
2056
2163
|
children: t
|
|
2057
|
-
}), i || !n.href ? /* @__PURE__ */
|
|
2164
|
+
}), i || !n.href ? /* @__PURE__ */ d("span", {
|
|
2058
2165
|
style: {
|
|
2059
2166
|
fontWeight: i ? 600 : 400,
|
|
2060
2167
|
opacity: i ? 1 : .7
|
|
2061
2168
|
},
|
|
2062
2169
|
"aria-current": i ? "page" : void 0,
|
|
2063
2170
|
children: n.label
|
|
2064
|
-
}) : /* @__PURE__ */
|
|
2171
|
+
}) : /* @__PURE__ */ d("a", {
|
|
2065
2172
|
href: n.href,
|
|
2066
2173
|
style: {
|
|
2067
2174
|
color: "inherit",
|
|
@@ -2075,7 +2182,7 @@ function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2075
2182
|
})
|
|
2076
2183
|
}) : null;
|
|
2077
2184
|
}
|
|
2078
|
-
function
|
|
2185
|
+
function yt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
|
|
2079
2186
|
let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), c = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", l = (e) => ({
|
|
2080
2187
|
display: "inline-flex",
|
|
2081
2188
|
alignItems: "center",
|
|
@@ -2090,7 +2197,7 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2090
2197
|
background: e ? "var(--page-accent, #111827)" : "transparent",
|
|
2091
2198
|
border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
|
|
2092
2199
|
});
|
|
2093
|
-
return /* @__PURE__ */
|
|
2200
|
+
return /* @__PURE__ */ f("nav", {
|
|
2094
2201
|
ref: a,
|
|
2095
2202
|
"aria-label": "Pagination",
|
|
2096
2203
|
style: {
|
|
@@ -2098,10 +2205,10 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2098
2205
|
flexWrap: "wrap",
|
|
2099
2206
|
gap: 8,
|
|
2100
2207
|
alignItems: "center",
|
|
2101
|
-
...
|
|
2208
|
+
...C(i)
|
|
2102
2209
|
},
|
|
2103
2210
|
children: [
|
|
2104
|
-
n && /* @__PURE__ */
|
|
2211
|
+
n && /* @__PURE__ */ d("a", {
|
|
2105
2212
|
href: s > 1 ? c(s - 1) : "#",
|
|
2106
2213
|
"aria-label": "Previous",
|
|
2107
2214
|
style: {
|
|
@@ -2110,13 +2217,13 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2110
2217
|
},
|
|
2111
2218
|
children: "‹"
|
|
2112
2219
|
}),
|
|
2113
|
-
Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */
|
|
2220
|
+
Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ d("a", {
|
|
2114
2221
|
href: c(e),
|
|
2115
2222
|
"aria-current": e === s ? "page" : void 0,
|
|
2116
2223
|
style: l(e === s),
|
|
2117
2224
|
children: e
|
|
2118
2225
|
}, e)),
|
|
2119
|
-
n && /* @__PURE__ */
|
|
2226
|
+
n && /* @__PURE__ */ d("a", {
|
|
2120
2227
|
href: s < o ? c(s + 1) : "#",
|
|
2121
2228
|
"aria-label": "Next",
|
|
2122
2229
|
style: {
|
|
@@ -2128,7 +2235,7 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
2128
2235
|
]
|
|
2129
2236
|
});
|
|
2130
2237
|
}
|
|
2131
|
-
function
|
|
2238
|
+
function bt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
2132
2239
|
if (!e.length) return null;
|
|
2133
2240
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
2134
2241
|
width: 32,
|
|
@@ -2159,21 +2266,21 @@ function ht({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2159
2266
|
minWidth: 24
|
|
2160
2267
|
}
|
|
2161
2268
|
});
|
|
2162
|
-
return /* @__PURE__ */
|
|
2269
|
+
return /* @__PURE__ */ d("div", {
|
|
2163
2270
|
ref: a,
|
|
2164
2271
|
style: {
|
|
2165
2272
|
display: "flex",
|
|
2166
2273
|
flexDirection: r ? "column" : "row",
|
|
2167
2274
|
alignItems: r ? "stretch" : "flex-start",
|
|
2168
2275
|
gap: r ? 4 : 8,
|
|
2169
|
-
...
|
|
2276
|
+
...C(i)
|
|
2170
2277
|
},
|
|
2171
2278
|
children: e.map((e, n) => {
|
|
2172
2279
|
let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
|
|
2173
|
-
return /* @__PURE__ */
|
|
2280
|
+
return /* @__PURE__ */ f(t, { children: [n > 0 && /* @__PURE__ */ d("div", {
|
|
2174
2281
|
style: c(i <= o),
|
|
2175
2282
|
"aria-hidden": !0
|
|
2176
|
-
}), /* @__PURE__ */
|
|
2283
|
+
}), /* @__PURE__ */ f("div", {
|
|
2177
2284
|
style: {
|
|
2178
2285
|
display: "flex",
|
|
2179
2286
|
flexDirection: r ? "row" : "column",
|
|
@@ -2182,19 +2289,19 @@ function ht({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2182
2289
|
minWidth: 0,
|
|
2183
2290
|
textAlign: r ? "left" : "center"
|
|
2184
2291
|
},
|
|
2185
|
-
children: [/* @__PURE__ */
|
|
2292
|
+
children: [/* @__PURE__ */ d("div", {
|
|
2186
2293
|
style: s(a),
|
|
2187
2294
|
children: a === "done" ? "✓" : i
|
|
2188
|
-
}), /* @__PURE__ */
|
|
2295
|
+
}), /* @__PURE__ */ f("div", {
|
|
2189
2296
|
style: { minWidth: 0 },
|
|
2190
|
-
children: [/* @__PURE__ */
|
|
2297
|
+
children: [/* @__PURE__ */ d("div", {
|
|
2191
2298
|
style: {
|
|
2192
2299
|
fontSize: 13,
|
|
2193
2300
|
fontWeight: a === "active" ? 700 : 500,
|
|
2194
2301
|
opacity: a === "todo" ? .6 : 1
|
|
2195
2302
|
},
|
|
2196
2303
|
children: e.label
|
|
2197
|
-
}), e.description && /* @__PURE__ */
|
|
2304
|
+
}), e.description && /* @__PURE__ */ d("div", {
|
|
2198
2305
|
style: {
|
|
2199
2306
|
fontSize: 12,
|
|
2200
2307
|
opacity: .6
|
|
@@ -2206,7 +2313,7 @@ function ht({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
2206
2313
|
})
|
|
2207
2314
|
});
|
|
2208
2315
|
}
|
|
2209
|
-
var
|
|
2316
|
+
var xt = {
|
|
2210
2317
|
small: {
|
|
2211
2318
|
w: 132,
|
|
2212
2319
|
h: 46,
|
|
@@ -2228,10 +2335,10 @@ var gt = {
|
|
|
2228
2335
|
title: 12.5,
|
|
2229
2336
|
avatar: 46
|
|
2230
2337
|
}
|
|
2231
|
-
},
|
|
2232
|
-
|
|
2233
|
-
function
|
|
2234
|
-
let r =
|
|
2338
|
+
}, St = (e) => xt[e] ?? xt.medium;
|
|
2339
|
+
xt.medium.w, xt.medium.h;
|
|
2340
|
+
function Ct(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
2341
|
+
let r = St(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
|
|
2235
2342
|
for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
|
|
2236
2343
|
let d = /* @__PURE__ */ new Map(), f = (e, t) => {
|
|
2237
2344
|
if (t.has(e.id)) return 0;
|
|
@@ -2283,19 +2390,19 @@ function vt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
|
|
|
2283
2390
|
horizontal: n
|
|
2284
2391
|
};
|
|
2285
2392
|
}
|
|
2286
|
-
var
|
|
2393
|
+
var wt = (e, t) => {
|
|
2287
2394
|
let n = String(e ?? "");
|
|
2288
2395
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
2289
|
-
},
|
|
2396
|
+
}, Tt = (e) => {
|
|
2290
2397
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
2291
2398
|
if (!t) return "#ffffff";
|
|
2292
2399
|
let n = t[1];
|
|
2293
2400
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
2294
2401
|
let r = parseInt(n, 16);
|
|
2295
2402
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
2296
|
-
},
|
|
2297
|
-
function
|
|
2298
|
-
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 ? "" :
|
|
2403
|
+
}, Et = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
2404
|
+
function Dt(e, t = {}) {
|
|
2405
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : K(e);
|
|
2299
2406
|
return n.map((e) => {
|
|
2300
2407
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
2301
2408
|
return {
|
|
@@ -2309,15 +2416,15 @@ function St(e, t = {}) {
|
|
|
2309
2416
|
};
|
|
2310
2417
|
});
|
|
2311
2418
|
}
|
|
2312
|
-
var
|
|
2419
|
+
var Ot = {
|
|
2313
2420
|
size: 36,
|
|
2314
2421
|
pad: 10
|
|
2315
2422
|
};
|
|
2316
|
-
function
|
|
2423
|
+
function kt({ node: e, onClose: t }) {
|
|
2317
2424
|
return a(() => {
|
|
2318
2425
|
let e = (e) => e.key === "Escape" && t();
|
|
2319
2426
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
2320
|
-
}, [t]), /* @__PURE__ */
|
|
2427
|
+
}, [t]), /* @__PURE__ */ d("div", {
|
|
2321
2428
|
onClick: t,
|
|
2322
2429
|
role: "dialog",
|
|
2323
2430
|
"aria-modal": "true",
|
|
@@ -2332,7 +2439,7 @@ function wt({ node: e, onClose: t }) {
|
|
|
2332
2439
|
justifyContent: "center",
|
|
2333
2440
|
padding: 16
|
|
2334
2441
|
},
|
|
2335
|
-
children: /* @__PURE__ */
|
|
2442
|
+
children: /* @__PURE__ */ f("div", {
|
|
2336
2443
|
onClick: (e) => e.stopPropagation(),
|
|
2337
2444
|
style: {
|
|
2338
2445
|
background: "var(--page-bg, #ffffff)",
|
|
@@ -2347,7 +2454,7 @@ function wt({ node: e, onClose: t }) {
|
|
|
2347
2454
|
boxShadow: "0 24px 64px rgba(15, 23, 42, 0.35)"
|
|
2348
2455
|
},
|
|
2349
2456
|
children: [
|
|
2350
|
-
/* @__PURE__ */
|
|
2457
|
+
/* @__PURE__ */ d("button", {
|
|
2351
2458
|
type: "button",
|
|
2352
2459
|
"aria-label": "Close",
|
|
2353
2460
|
onClick: t,
|
|
@@ -2368,14 +2475,14 @@ function wt({ node: e, onClose: t }) {
|
|
|
2368
2475
|
},
|
|
2369
2476
|
children: "×"
|
|
2370
2477
|
}),
|
|
2371
|
-
/* @__PURE__ */
|
|
2478
|
+
/* @__PURE__ */ f("div", {
|
|
2372
2479
|
style: {
|
|
2373
2480
|
display: "flex",
|
|
2374
2481
|
alignItems: "center",
|
|
2375
2482
|
gap: 14,
|
|
2376
2483
|
marginBottom: e.cv ? 14 : 0
|
|
2377
2484
|
},
|
|
2378
|
-
children: [e.photo && /* @__PURE__ */
|
|
2485
|
+
children: [e.photo && /* @__PURE__ */ d("img", {
|
|
2379
2486
|
src: e.photo,
|
|
2380
2487
|
alt: "",
|
|
2381
2488
|
style: {
|
|
@@ -2385,15 +2492,15 @@ function wt({ node: e, onClose: t }) {
|
|
|
2385
2492
|
objectFit: "cover",
|
|
2386
2493
|
flexShrink: 0
|
|
2387
2494
|
}
|
|
2388
|
-
}), /* @__PURE__ */
|
|
2495
|
+
}), /* @__PURE__ */ f("div", {
|
|
2389
2496
|
style: { minWidth: 0 },
|
|
2390
|
-
children: [/* @__PURE__ */
|
|
2497
|
+
children: [/* @__PURE__ */ d("div", {
|
|
2391
2498
|
style: {
|
|
2392
2499
|
fontSize: 18,
|
|
2393
2500
|
fontWeight: 700
|
|
2394
2501
|
},
|
|
2395
2502
|
children: e.name
|
|
2396
|
-
}), e.title && /* @__PURE__ */
|
|
2503
|
+
}), e.title && /* @__PURE__ */ d("div", {
|
|
2397
2504
|
style: {
|
|
2398
2505
|
fontSize: 13,
|
|
2399
2506
|
opacity: .65
|
|
@@ -2402,7 +2509,7 @@ function wt({ node: e, onClose: t }) {
|
|
|
2402
2509
|
})]
|
|
2403
2510
|
})]
|
|
2404
2511
|
}),
|
|
2405
|
-
e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */
|
|
2512
|
+
e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ d("p", {
|
|
2406
2513
|
style: {
|
|
2407
2514
|
fontSize: 14,
|
|
2408
2515
|
lineHeight: 1.6,
|
|
@@ -2410,7 +2517,7 @@ function wt({ node: e, onClose: t }) {
|
|
|
2410
2517
|
},
|
|
2411
2518
|
children: e
|
|
2412
2519
|
}, t)),
|
|
2413
|
-
e.href && /* @__PURE__ */
|
|
2520
|
+
e.href && /* @__PURE__ */ d("a", {
|
|
2414
2521
|
href: e.href,
|
|
2415
2522
|
target: "_blank",
|
|
2416
2523
|
rel: "noopener noreferrer",
|
|
@@ -2431,8 +2538,8 @@ function wt({ node: e, onClose: t }) {
|
|
|
2431
2538
|
})
|
|
2432
2539
|
});
|
|
2433
2540
|
}
|
|
2434
|
-
function
|
|
2435
|
-
let b = o(), [x,
|
|
2541
|
+
function At({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
|
|
2542
|
+
let b = o(), [x, S] = l(null), { tenant: w, apiUrl: T } = i(H), E = i(U)?.[t], [D, O] = l(null);
|
|
2436
2543
|
a(() => {
|
|
2437
2544
|
if (!t || E) return;
|
|
2438
2545
|
let e = !0;
|
|
@@ -2448,18 +2555,18 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2448
2555
|
T,
|
|
2449
2556
|
E
|
|
2450
2557
|
]);
|
|
2451
|
-
let k = t ?
|
|
2558
|
+
let k = t ? Dt(E ?? D ?? [], {
|
|
2452
2559
|
nameField: n,
|
|
2453
2560
|
titleField: r,
|
|
2454
2561
|
photoField: s,
|
|
2455
|
-
parentField:
|
|
2562
|
+
parentField: c,
|
|
2456
2563
|
cvField: p,
|
|
2457
2564
|
hrefField: m
|
|
2458
|
-
}) : e, A =
|
|
2565
|
+
}) : e, A = St(h), { boxes: j, links: M, width: N, height: P } = Ct(k, {
|
|
2459
2566
|
size: h,
|
|
2460
2567
|
horizontal: g
|
|
2461
2568
|
});
|
|
2462
|
-
if (!j.length) return !y && t ? /* @__PURE__ */
|
|
2569
|
+
if (!j.length) return !y && t ? /* @__PURE__ */ f("div", {
|
|
2463
2570
|
ref: v,
|
|
2464
2571
|
style: {
|
|
2465
2572
|
padding: 18,
|
|
@@ -2468,7 +2575,7 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2468
2575
|
fontSize: 13,
|
|
2469
2576
|
opacity: .7,
|
|
2470
2577
|
textAlign: "center",
|
|
2471
|
-
...
|
|
2578
|
+
...C(_)
|
|
2472
2579
|
},
|
|
2473
2580
|
children: [
|
|
2474
2581
|
"Org Chart — no published entries in “",
|
|
@@ -2477,14 +2584,14 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2477
2584
|
]
|
|
2478
2585
|
}) : null;
|
|
2479
2586
|
let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
|
|
2480
|
-
return /* @__PURE__ */
|
|
2587
|
+
return /* @__PURE__ */ f("div", {
|
|
2481
2588
|
ref: v,
|
|
2482
2589
|
style: {
|
|
2483
2590
|
maxWidth: "100%",
|
|
2484
2591
|
overflowX: "auto",
|
|
2485
|
-
...
|
|
2592
|
+
...C(_)
|
|
2486
2593
|
},
|
|
2487
|
-
children: [/* @__PURE__ */
|
|
2594
|
+
children: [/* @__PURE__ */ f("svg", {
|
|
2488
2595
|
viewBox: `0 0 ${N} ${P}`,
|
|
2489
2596
|
role: "img",
|
|
2490
2597
|
"aria-label": "Organization chart",
|
|
@@ -2495,64 +2602,64 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2495
2602
|
height: "auto",
|
|
2496
2603
|
margin: "0 auto"
|
|
2497
2604
|
},
|
|
2498
|
-
children: [M.map((e, t) => /* @__PURE__ */
|
|
2605
|
+
children: [M.map((e, t) => /* @__PURE__ */ d("path", {
|
|
2499
2606
|
d: g ? `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}`,
|
|
2500
2607
|
fill: "none",
|
|
2501
2608
|
stroke: "rgba(148, 163, 184, 0.7)",
|
|
2502
2609
|
strokeWidth: "1.5"
|
|
2503
2610
|
}, t)), j.map(({ node: e, x: t, y: n }) => {
|
|
2504
|
-
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ?
|
|
2505
|
-
return /* @__PURE__ */
|
|
2506
|
-
onClick:
|
|
2507
|
-
style:
|
|
2508
|
-
role:
|
|
2509
|
-
"aria-label":
|
|
2611
|
+
let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Tt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Tt(e.color2) : s, l = y && (Et(e) || e.href), p = () => Et(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Ot.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
2612
|
+
return /* @__PURE__ */ f("g", {
|
|
2613
|
+
onClick: l ? p : void 0,
|
|
2614
|
+
style: l ? { cursor: "pointer" } : void 0,
|
|
2615
|
+
role: l ? "button" : void 0,
|
|
2616
|
+
"aria-label": l ? `Open ${e.name || e.title}'s profile` : void 0,
|
|
2510
2617
|
children: [
|
|
2511
|
-
i && e.gradient ? /* @__PURE__ */
|
|
2618
|
+
i && e.gradient ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("linearGradient", {
|
|
2512
2619
|
id: `${b}-${e.id}-grad`,
|
|
2513
2620
|
x1: "0",
|
|
2514
2621
|
y1: "0",
|
|
2515
2622
|
x2: "0",
|
|
2516
2623
|
y2: "1",
|
|
2517
|
-
children: [/* @__PURE__ */
|
|
2624
|
+
children: [/* @__PURE__ */ d("stop", {
|
|
2518
2625
|
offset: "0%",
|
|
2519
2626
|
stopColor: e.color || "var(--page-accent, #4f46e5)"
|
|
2520
|
-
}), /* @__PURE__ */
|
|
2627
|
+
}), /* @__PURE__ */ d("stop", {
|
|
2521
2628
|
offset: "100%",
|
|
2522
2629
|
stopColor: e.color2
|
|
2523
2630
|
})]
|
|
2524
|
-
}), /* @__PURE__ */
|
|
2631
|
+
}), /* @__PURE__ */ d("rect", {
|
|
2525
2632
|
x: t,
|
|
2526
2633
|
y: n,
|
|
2527
2634
|
width: A.w,
|
|
2528
2635
|
height: A.h,
|
|
2529
2636
|
rx: "10",
|
|
2530
2637
|
fill: `url(#${b}-${e.id}-grad)`
|
|
2531
|
-
})] }) : i ? /* @__PURE__ */
|
|
2638
|
+
})] }) : i ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
2532
2639
|
id: `${b}-${e.id}-box`,
|
|
2533
|
-
children: /* @__PURE__ */
|
|
2640
|
+
children: /* @__PURE__ */ d("rect", {
|
|
2534
2641
|
x: t,
|
|
2535
2642
|
y: n,
|
|
2536
2643
|
width: A.w,
|
|
2537
2644
|
height: A.h,
|
|
2538
2645
|
rx: "10"
|
|
2539
2646
|
})
|
|
2540
|
-
}), /* @__PURE__ */
|
|
2647
|
+
}), /* @__PURE__ */ f("g", {
|
|
2541
2648
|
clipPath: `url(#${b}-${e.id}-box)`,
|
|
2542
|
-
children: [/* @__PURE__ */
|
|
2649
|
+
children: [/* @__PURE__ */ d("rect", {
|
|
2543
2650
|
x: t,
|
|
2544
2651
|
y: n,
|
|
2545
2652
|
width: A.w,
|
|
2546
2653
|
height: _,
|
|
2547
2654
|
fill: o
|
|
2548
|
-
}), /* @__PURE__ */
|
|
2655
|
+
}), /* @__PURE__ */ d("rect", {
|
|
2549
2656
|
x: t,
|
|
2550
2657
|
y: n + _,
|
|
2551
2658
|
width: A.w,
|
|
2552
2659
|
height: A.h - _,
|
|
2553
2660
|
fill: e.color2
|
|
2554
2661
|
})]
|
|
2555
|
-
})] }) : /* @__PURE__ */
|
|
2662
|
+
})] }) : /* @__PURE__ */ d("rect", {
|
|
2556
2663
|
x: t,
|
|
2557
2664
|
y: n,
|
|
2558
2665
|
width: A.w,
|
|
@@ -2562,66 +2669,66 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
|
|
|
2562
2669
|
stroke: a ? "none" : "var(--page-accent, #4f46e5)",
|
|
2563
2670
|
strokeWidth: a ? 0 : 1.5
|
|
2564
2671
|
}),
|
|
2565
|
-
e.photo && /* @__PURE__ */
|
|
2672
|
+
e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
|
|
2566
2673
|
id: `${b}-${e.id}`,
|
|
2567
|
-
children: /* @__PURE__ */
|
|
2568
|
-
cx: t +
|
|
2674
|
+
children: /* @__PURE__ */ d("circle", {
|
|
2675
|
+
cx: t + Ot.pad + A.avatar / 2,
|
|
2569
2676
|
cy: n + A.h / 2,
|
|
2570
2677
|
r: A.avatar / 2
|
|
2571
2678
|
})
|
|
2572
|
-
}), /* @__PURE__ */
|
|
2679
|
+
}), /* @__PURE__ */ d("image", {
|
|
2573
2680
|
href: e.photo,
|
|
2574
|
-
x: t +
|
|
2681
|
+
x: t + Ot.pad,
|
|
2575
2682
|
y: n + (A.h - A.avatar) / 2,
|
|
2576
2683
|
width: A.avatar,
|
|
2577
2684
|
height: A.avatar,
|
|
2578
2685
|
preserveAspectRatio: "xMidYMid slice",
|
|
2579
2686
|
clipPath: `url(#${b}-${e.id})`
|
|
2580
2687
|
})] }),
|
|
2581
|
-
i && !e.gradient ? /* @__PURE__ */
|
|
2688
|
+
i && !e.gradient ? /* @__PURE__ */ f(u, { children: [e.title && /* @__PURE__ */ d("text", {
|
|
2582
2689
|
x: m,
|
|
2583
2690
|
y: n + _ / 2 + A.title * .35,
|
|
2584
2691
|
textAnchor: h,
|
|
2585
2692
|
fontSize: A.title,
|
|
2586
2693
|
fontWeight: "600",
|
|
2587
2694
|
fill: s,
|
|
2588
|
-
children:
|
|
2589
|
-
}), e.name && /* @__PURE__ */
|
|
2695
|
+
children: wt(e.title, g + 4)
|
|
2696
|
+
}), e.name && /* @__PURE__ */ d("text", {
|
|
2590
2697
|
x: m,
|
|
2591
2698
|
y: n + _ + _ / 2 + A.name * .35,
|
|
2592
2699
|
textAnchor: h,
|
|
2593
2700
|
fontSize: A.name,
|
|
2594
2701
|
fontWeight: "600",
|
|
2595
2702
|
fill: c,
|
|
2596
|
-
children:
|
|
2597
|
-
})] }) : /* @__PURE__ */
|
|
2703
|
+
children: wt(e.name, g)
|
|
2704
|
+
})] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
|
|
2598
2705
|
x: m,
|
|
2599
2706
|
y: n + (v[1] ? A.h * .43 : A.h * .57),
|
|
2600
2707
|
textAnchor: h,
|
|
2601
2708
|
fontSize: A.name,
|
|
2602
2709
|
fontWeight: "600",
|
|
2603
2710
|
fill: s,
|
|
2604
|
-
children:
|
|
2605
|
-
}), v[1] && /* @__PURE__ */
|
|
2711
|
+
children: wt(v[0], g)
|
|
2712
|
+
}), v[1] && /* @__PURE__ */ d("text", {
|
|
2606
2713
|
x: m,
|
|
2607
2714
|
y: n + A.h * .73,
|
|
2608
2715
|
textAnchor: h,
|
|
2609
2716
|
fontSize: A.title,
|
|
2610
2717
|
opacity: "0.7",
|
|
2611
2718
|
fill: s,
|
|
2612
|
-
children:
|
|
2719
|
+
children: wt(v[1], g + 4)
|
|
2613
2720
|
})] })
|
|
2614
2721
|
]
|
|
2615
2722
|
}, e.id);
|
|
2616
2723
|
})]
|
|
2617
|
-
}), x && /* @__PURE__ */
|
|
2724
|
+
}), x && /* @__PURE__ */ d(kt, {
|
|
2618
2725
|
node: x,
|
|
2619
|
-
onClose: () =>
|
|
2726
|
+
onClose: () => S(null)
|
|
2620
2727
|
})]
|
|
2621
2728
|
});
|
|
2622
2729
|
}
|
|
2623
|
-
function
|
|
2624
|
-
let { tenant: m, apiUrl: h } = i(
|
|
2730
|
+
function jt({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: c = !1, style: u, nodeRef: p }) {
|
|
2731
|
+
let { tenant: m, apiUrl: h } = i(H), g = i(U)?.[n], [_, v] = l(null);
|
|
2625
2732
|
if (a(() => {
|
|
2626
2733
|
if (!n || g) return;
|
|
2627
2734
|
let e = !0, t = n.startsWith("api:") ? `${h}/data/${encodeURIComponent(n.slice(4))}` : `${h}/dynamic/${encodeURIComponent(n)}`;
|
|
@@ -2634,22 +2741,22 @@ function Et({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
|
|
|
2634
2741
|
h,
|
|
2635
2742
|
g
|
|
2636
2743
|
]), !e.length) return null;
|
|
2637
|
-
let y = n ? (g ?? _ ?? []).slice(0, Math.max(1, Number(r) || 10)) : null, b = y ? y.map((t) => e.map((e) =>
|
|
2638
|
-
return /* @__PURE__ */
|
|
2744
|
+
let y = n ? (g ?? _ ?? []).slice(0, Math.max(1, Number(r) || 10)) : null, b = y ? y.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, x = c ? "6px 10px" : "10px 14px", S = "1px solid rgba(148, 163, 184, 0.35)", w = s ? { border: S } : { borderBottom: S };
|
|
2745
|
+
return /* @__PURE__ */ d("div", {
|
|
2639
2746
|
ref: p,
|
|
2640
2747
|
style: {
|
|
2641
2748
|
width: "100%",
|
|
2642
2749
|
overflowX: "auto",
|
|
2643
|
-
...
|
|
2750
|
+
...C(u)
|
|
2644
2751
|
},
|
|
2645
|
-
children: /* @__PURE__ */
|
|
2752
|
+
children: /* @__PURE__ */ f("table", {
|
|
2646
2753
|
style: {
|
|
2647
2754
|
width: "100%",
|
|
2648
2755
|
borderCollapse: "collapse",
|
|
2649
2756
|
fontSize: 14,
|
|
2650
|
-
...s ? { border:
|
|
2757
|
+
...s ? { border: S } : {}
|
|
2651
2758
|
},
|
|
2652
|
-
children: [/* @__PURE__ */
|
|
2759
|
+
children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((e, t) => /* @__PURE__ */ d("th", {
|
|
2653
2760
|
style: {
|
|
2654
2761
|
textAlign: "left",
|
|
2655
2762
|
fontWeight: 600,
|
|
@@ -2658,9 +2765,9 @@ function Et({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
|
|
|
2658
2765
|
...w
|
|
2659
2766
|
},
|
|
2660
2767
|
children: e.label ?? e
|
|
2661
|
-
}, t)) }) }), /* @__PURE__ */
|
|
2768
|
+
}, t)) }) }), /* @__PURE__ */ d("tbody", { children: b.map((t, n) => /* @__PURE__ */ d("tr", {
|
|
2662
2769
|
style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
2663
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
2770
|
+
children: e.map((e, n) => /* @__PURE__ */ d("td", {
|
|
2664
2771
|
style: {
|
|
2665
2772
|
padding: x,
|
|
2666
2773
|
...w
|
|
@@ -2671,68 +2778,75 @@ function Et({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
|
|
|
2671
2778
|
})
|
|
2672
2779
|
});
|
|
2673
2780
|
}
|
|
2674
|
-
var
|
|
2675
|
-
PageRoot:
|
|
2676
|
-
Section:
|
|
2677
|
-
Container:
|
|
2678
|
-
Heading:
|
|
2679
|
-
TextBlock:
|
|
2680
|
-
ButtonBlock:
|
|
2681
|
-
ImageBlock:
|
|
2682
|
-
Spacer:
|
|
2683
|
-
Divider:
|
|
2684
|
-
SliderBlock:
|
|
2685
|
-
CanvasSlider:
|
|
2686
|
-
TabsBlock:
|
|
2687
|
-
QuickStack:
|
|
2688
|
-
CollectionList:
|
|
2689
|
-
BreadcrumbsBlock:
|
|
2690
|
-
PaginationBlock:
|
|
2691
|
-
StepperBlock:
|
|
2692
|
-
OrgChartBlock:
|
|
2693
|
-
TableBlock:
|
|
2694
|
-
AccordionBlock:
|
|
2695
|
-
NavbarBlock:
|
|
2696
|
-
ListBlock:
|
|
2697
|
-
TextSpan:
|
|
2698
|
-
QuoteBlock:
|
|
2699
|
-
TextLink:
|
|
2700
|
-
RichTextBlock:
|
|
2701
|
-
RichContentBlock:
|
|
2702
|
-
VideoBlock:
|
|
2703
|
-
YouTubeBlock:
|
|
2704
|
-
IframeBlock:
|
|
2705
|
-
EmbedBlock:
|
|
2706
|
-
FormBlock:
|
|
2707
|
-
FormLabel:
|
|
2708
|
-
FormInput:
|
|
2709
|
-
FormTextarea:
|
|
2710
|
-
FormCheckbox: (e) => /* @__PURE__ */
|
|
2781
|
+
var Mt = {
|
|
2782
|
+
PageRoot: me,
|
|
2783
|
+
Section: he,
|
|
2784
|
+
Container: ge,
|
|
2785
|
+
Heading: _e,
|
|
2786
|
+
TextBlock: Oe,
|
|
2787
|
+
ButtonBlock: je,
|
|
2788
|
+
ImageBlock: Me,
|
|
2789
|
+
Spacer: Re,
|
|
2790
|
+
Divider: ze,
|
|
2791
|
+
SliderBlock: Ge,
|
|
2792
|
+
CanvasSlider: Ke,
|
|
2793
|
+
TabsBlock: Xe,
|
|
2794
|
+
QuickStack: gt,
|
|
2795
|
+
CollectionList: _t,
|
|
2796
|
+
BreadcrumbsBlock: vt,
|
|
2797
|
+
PaginationBlock: yt,
|
|
2798
|
+
StepperBlock: bt,
|
|
2799
|
+
OrgChartBlock: At,
|
|
2800
|
+
TableBlock: jt,
|
|
2801
|
+
AccordionBlock: Ze,
|
|
2802
|
+
NavbarBlock: Ye,
|
|
2803
|
+
ListBlock: De,
|
|
2804
|
+
TextSpan: be,
|
|
2805
|
+
QuoteBlock: Ee,
|
|
2806
|
+
TextLink: Ae,
|
|
2807
|
+
RichTextBlock: we,
|
|
2808
|
+
RichContentBlock: we,
|
|
2809
|
+
VideoBlock: Ne,
|
|
2810
|
+
YouTubeBlock: Fe,
|
|
2811
|
+
IframeBlock: Ie,
|
|
2812
|
+
EmbedBlock: Le,
|
|
2813
|
+
FormBlock: at,
|
|
2814
|
+
FormLabel: lt,
|
|
2815
|
+
FormInput: ut,
|
|
2816
|
+
FormTextarea: dt,
|
|
2817
|
+
FormCheckbox: (e) => /* @__PURE__ */ d(ft, {
|
|
2711
2818
|
kind: "checkbox",
|
|
2712
2819
|
...e
|
|
2713
2820
|
}),
|
|
2714
|
-
FormRadio: (e) => /* @__PURE__ */
|
|
2821
|
+
FormRadio: (e) => /* @__PURE__ */ d(ft, {
|
|
2715
2822
|
kind: "radio",
|
|
2716
2823
|
...e
|
|
2717
2824
|
}),
|
|
2718
|
-
FormSelect:
|
|
2719
|
-
FormFile:
|
|
2720
|
-
|
|
2721
|
-
|
|
2825
|
+
FormSelect: pt,
|
|
2826
|
+
FormFile: mt,
|
|
2827
|
+
FormRecaptcha: ct,
|
|
2828
|
+
FormSubmit: ht
|
|
2829
|
+
}, Nt = {
|
|
2722
2830
|
id: "auth",
|
|
2723
2831
|
label: "Accounts",
|
|
2724
2832
|
category: "Apps",
|
|
2725
2833
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
2726
2834
|
ssr: "shell",
|
|
2727
2835
|
settings: ["apps.auth.redirect"]
|
|
2728
|
-
},
|
|
2836
|
+
}, Pt = n({
|
|
2729
2837
|
user: null,
|
|
2730
|
-
status: "
|
|
2838
|
+
status: "idle",
|
|
2839
|
+
ensure: () => {},
|
|
2731
2840
|
refresh: () => {},
|
|
2732
2841
|
signOut: () => {}
|
|
2733
|
-
}),
|
|
2734
|
-
|
|
2735
|
-
|
|
2842
|
+
}), Ft = () => {
|
|
2843
|
+
let e = i(Pt);
|
|
2844
|
+
return a(() => {
|
|
2845
|
+
e.ensure();
|
|
2846
|
+
}, [e]), e;
|
|
2847
|
+
};
|
|
2848
|
+
function It({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o }) {
|
|
2849
|
+
let u = i(H), f = a || u?.apiUrl || "/api", p = o || u?.tenant || "", [m, h] = l(t ?? null), [g, _] = l(t ? "user" : n ? "guest" : "idle"), v = c(!1), y = r((e, t) => fetch(`${f}${e}`, {
|
|
2736
2850
|
...t,
|
|
2737
2851
|
credentials: "include",
|
|
2738
2852
|
headers: {
|
|
@@ -2740,44 +2854,44 @@ function jt({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: l })
|
|
|
2740
2854
|
...p ? { "x-tenant": p } : {},
|
|
2741
2855
|
...t?.headers
|
|
2742
2856
|
}
|
|
2743
|
-
}), [f, p]),
|
|
2857
|
+
}), [f, p]), b = r(() => n ? Promise.resolve(null) : y("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
|
|
2744
2858
|
let t = e?.payload ?? null;
|
|
2745
2859
|
return h(t), _(t ? "user" : "guest"), t;
|
|
2746
|
-
}).catch(() => (h(null), _("guest"), null)), [
|
|
2860
|
+
}).catch(() => (h(null), _("guest"), null)), [y, n]), x = r(() => y("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
2747
2861
|
h(null), _("guest");
|
|
2748
|
-
}), [
|
|
2749
|
-
|
|
2750
|
-
n || t || y();
|
|
2862
|
+
}), [y]), S = r(() => {
|
|
2863
|
+
v.current || n || t || (v.current = !0, _("loading"), b());
|
|
2751
2864
|
}, [
|
|
2752
2865
|
n,
|
|
2753
2866
|
t,
|
|
2754
|
-
|
|
2755
|
-
])
|
|
2756
|
-
let x = s(() => ({
|
|
2867
|
+
b
|
|
2868
|
+
]), C = s(() => ({
|
|
2757
2869
|
user: m,
|
|
2758
2870
|
status: g,
|
|
2759
|
-
|
|
2760
|
-
|
|
2871
|
+
ensure: S,
|
|
2872
|
+
refresh: b,
|
|
2873
|
+
signOut: x
|
|
2761
2874
|
}), [
|
|
2762
2875
|
m,
|
|
2763
2876
|
g,
|
|
2764
|
-
|
|
2765
|
-
b
|
|
2877
|
+
S,
|
|
2878
|
+
b,
|
|
2879
|
+
x
|
|
2766
2880
|
]);
|
|
2767
|
-
return /* @__PURE__ */
|
|
2768
|
-
value:
|
|
2881
|
+
return /* @__PURE__ */ d(Pt.Provider, {
|
|
2882
|
+
value: C,
|
|
2769
2883
|
children: e
|
|
2770
2884
|
});
|
|
2771
2885
|
}
|
|
2772
|
-
function
|
|
2773
|
-
let { status: n } =
|
|
2774
|
-
return !e || e === "always" ? t : n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
2886
|
+
function Lt({ when: e, children: t }) {
|
|
2887
|
+
let { status: n } = Ft();
|
|
2888
|
+
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
2775
2889
|
}
|
|
2776
2890
|
//#endregion
|
|
2777
2891
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
2778
|
-
function
|
|
2779
|
-
let { tenant: h, apiUrl: g, settings: _ } = i(
|
|
2780
|
-
if (e.preventDefault(),
|
|
2892
|
+
function Rt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
|
|
2893
|
+
let { tenant: h, apiUrl: g, settings: _ } = i(H), [v, y] = l("form"), [b, x] = l(""), [S, w] = l(!1), T = e === "register", E = u ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
|
|
2894
|
+
if (e.preventDefault(), u) return;
|
|
2781
2895
|
let n = new FormData(e.currentTarget);
|
|
2782
2896
|
w(!0), x("");
|
|
2783
2897
|
try {
|
|
@@ -2806,79 +2920,79 @@ function Nt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
2806
2920
|
x("Sign-in failed"), y("error"), w(!1);
|
|
2807
2921
|
}
|
|
2808
2922
|
};
|
|
2809
|
-
return /* @__PURE__ */
|
|
2810
|
-
ref:
|
|
2923
|
+
return /* @__PURE__ */ f("div", {
|
|
2924
|
+
ref: c,
|
|
2811
2925
|
style: {
|
|
2812
2926
|
display: "grid",
|
|
2813
2927
|
gap: 12,
|
|
2814
2928
|
maxWidth: 360,
|
|
2815
|
-
...
|
|
2929
|
+
...C(s)
|
|
2816
2930
|
},
|
|
2817
2931
|
children: [
|
|
2818
|
-
/* @__PURE__ */
|
|
2932
|
+
/* @__PURE__ */ f("form", {
|
|
2819
2933
|
onSubmit: O,
|
|
2820
2934
|
style: {
|
|
2821
2935
|
display: E === "form" ? "grid" : "none",
|
|
2822
2936
|
gap: 10
|
|
2823
2937
|
},
|
|
2824
2938
|
children: [
|
|
2825
|
-
T ? /* @__PURE__ */
|
|
2939
|
+
T ? /* @__PURE__ */ f("label", {
|
|
2826
2940
|
style: {
|
|
2827
|
-
...
|
|
2941
|
+
...Y,
|
|
2828
2942
|
display: "grid",
|
|
2829
2943
|
gap: 6
|
|
2830
2944
|
},
|
|
2831
|
-
children: [a, /* @__PURE__ */
|
|
2945
|
+
children: [a, /* @__PURE__ */ d("input", {
|
|
2832
2946
|
name: "name",
|
|
2833
2947
|
type: "text",
|
|
2834
|
-
style:
|
|
2835
|
-
...
|
|
2948
|
+
style: X,
|
|
2949
|
+
...Z(u)
|
|
2836
2950
|
})]
|
|
2837
2951
|
}) : null,
|
|
2838
|
-
/* @__PURE__ */
|
|
2952
|
+
/* @__PURE__ */ f("label", {
|
|
2839
2953
|
style: {
|
|
2840
|
-
...
|
|
2954
|
+
...Y,
|
|
2841
2955
|
display: "grid",
|
|
2842
2956
|
gap: 6
|
|
2843
2957
|
},
|
|
2844
|
-
children: [n, /* @__PURE__ */
|
|
2958
|
+
children: [n, /* @__PURE__ */ d("input", {
|
|
2845
2959
|
name: "email",
|
|
2846
2960
|
type: "email",
|
|
2847
|
-
required: !
|
|
2848
|
-
style:
|
|
2849
|
-
...
|
|
2961
|
+
required: !u,
|
|
2962
|
+
style: X,
|
|
2963
|
+
...Z(u)
|
|
2850
2964
|
})]
|
|
2851
2965
|
}),
|
|
2852
|
-
/* @__PURE__ */
|
|
2966
|
+
/* @__PURE__ */ f("label", {
|
|
2853
2967
|
style: {
|
|
2854
|
-
...
|
|
2968
|
+
...Y,
|
|
2855
2969
|
display: "grid",
|
|
2856
2970
|
gap: 6
|
|
2857
2971
|
},
|
|
2858
|
-
children: [r, /* @__PURE__ */
|
|
2972
|
+
children: [r, /* @__PURE__ */ d("input", {
|
|
2859
2973
|
name: "password",
|
|
2860
2974
|
type: "password",
|
|
2861
|
-
required: !
|
|
2862
|
-
style:
|
|
2863
|
-
...
|
|
2975
|
+
required: !u,
|
|
2976
|
+
style: X,
|
|
2977
|
+
...Z(u)
|
|
2864
2978
|
})]
|
|
2865
2979
|
}),
|
|
2866
|
-
/* @__PURE__ */
|
|
2867
|
-
type:
|
|
2868
|
-
disabled:
|
|
2980
|
+
/* @__PURE__ */ d("button", {
|
|
2981
|
+
type: u ? "button" : "submit",
|
|
2982
|
+
disabled: S || void 0,
|
|
2869
2983
|
style: {
|
|
2870
|
-
...
|
|
2984
|
+
...q,
|
|
2871
2985
|
border: 0,
|
|
2872
2986
|
padding: "10px 22px",
|
|
2873
2987
|
borderRadius: 8,
|
|
2874
2988
|
fontSize: 15,
|
|
2875
2989
|
fontWeight: 600,
|
|
2876
2990
|
cursor: "pointer",
|
|
2877
|
-
opacity:
|
|
2991
|
+
opacity: S ? .6 : 1
|
|
2878
2992
|
},
|
|
2879
2993
|
children: o || (T ? "Create account" : "Sign in")
|
|
2880
2994
|
}),
|
|
2881
|
-
b ? /* @__PURE__ */
|
|
2995
|
+
b ? /* @__PURE__ */ d("p", {
|
|
2882
2996
|
style: {
|
|
2883
2997
|
margin: 0,
|
|
2884
2998
|
fontSize: 14,
|
|
@@ -2888,40 +3002,40 @@ function Nt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
2888
3002
|
}) : null
|
|
2889
3003
|
]
|
|
2890
3004
|
}),
|
|
2891
|
-
/* @__PURE__ */
|
|
3005
|
+
/* @__PURE__ */ d("div", {
|
|
2892
3006
|
style: { display: E === "success" ? "block" : "none" },
|
|
2893
3007
|
children: p?.success ?? null
|
|
2894
3008
|
}),
|
|
2895
|
-
/* @__PURE__ */
|
|
3009
|
+
/* @__PURE__ */ d("div", {
|
|
2896
3010
|
style: { display: E === "error" ? "block" : "none" },
|
|
2897
3011
|
children: p?.error ?? null
|
|
2898
3012
|
})
|
|
2899
3013
|
]
|
|
2900
3014
|
});
|
|
2901
3015
|
}
|
|
2902
|
-
function
|
|
2903
|
-
let { user: c, status: l, signOut:
|
|
3016
|
+
function zt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
3017
|
+
let { user: c, status: l, signOut: u } = Ft(), p = a ? s || "user" : l, m = a ? {
|
|
2904
3018
|
name: "Ada Lovelace",
|
|
2905
3019
|
email: "ada@example.com"
|
|
2906
3020
|
} : c;
|
|
2907
|
-
return p === "loading" ? /* @__PURE__ */
|
|
3021
|
+
return p === "loading" ? /* @__PURE__ */ d("div", {
|
|
2908
3022
|
ref: i,
|
|
2909
3023
|
style: {
|
|
2910
3024
|
minHeight: 24,
|
|
2911
|
-
...
|
|
3025
|
+
...C(r)
|
|
2912
3026
|
}
|
|
2913
|
-
}) : p === "user" ? /* @__PURE__ */
|
|
3027
|
+
}) : p === "user" ? /* @__PURE__ */ f("div", {
|
|
2914
3028
|
ref: i,
|
|
2915
3029
|
style: {
|
|
2916
3030
|
display: "flex",
|
|
2917
3031
|
alignItems: "center",
|
|
2918
3032
|
gap: 10,
|
|
2919
|
-
...
|
|
3033
|
+
...C(r)
|
|
2920
3034
|
},
|
|
2921
3035
|
children: [
|
|
2922
|
-
/* @__PURE__ */
|
|
3036
|
+
/* @__PURE__ */ f("span", {
|
|
2923
3037
|
style: {
|
|
2924
|
-
...
|
|
3038
|
+
...Y,
|
|
2925
3039
|
fontWeight: 600
|
|
2926
3040
|
},
|
|
2927
3041
|
children: [
|
|
@@ -2930,53 +3044,53 @@ function Pt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
2930
3044
|
m?.name || m?.email || ""
|
|
2931
3045
|
]
|
|
2932
3046
|
}),
|
|
2933
|
-
n && m?.email ? /* @__PURE__ */
|
|
3047
|
+
n && m?.email ? /* @__PURE__ */ d("span", {
|
|
2934
3048
|
style: {
|
|
2935
|
-
...
|
|
3049
|
+
...Y,
|
|
2936
3050
|
opacity: .7
|
|
2937
3051
|
},
|
|
2938
3052
|
children: m.email
|
|
2939
3053
|
}) : null,
|
|
2940
|
-
/* @__PURE__ */
|
|
3054
|
+
/* @__PURE__ */ d("button", {
|
|
2941
3055
|
type: "button",
|
|
2942
|
-
onClick: a ? void 0 :
|
|
3056
|
+
onClick: a ? void 0 : u,
|
|
2943
3057
|
style: {
|
|
2944
|
-
...
|
|
3058
|
+
...q,
|
|
2945
3059
|
border: 0,
|
|
2946
3060
|
padding: "8px 16px",
|
|
2947
3061
|
borderRadius: 8,
|
|
2948
3062
|
fontSize: 14,
|
|
2949
3063
|
cursor: a ? "default" : "pointer"
|
|
2950
3064
|
},
|
|
2951
|
-
...
|
|
3065
|
+
...Z(a),
|
|
2952
3066
|
children: t
|
|
2953
3067
|
})
|
|
2954
3068
|
]
|
|
2955
|
-
}) : /* @__PURE__ */
|
|
3069
|
+
}) : /* @__PURE__ */ d("div", {
|
|
2956
3070
|
ref: i,
|
|
2957
3071
|
style: {
|
|
2958
3072
|
display: "flex",
|
|
2959
3073
|
alignItems: "center",
|
|
2960
3074
|
gap: 10,
|
|
2961
|
-
...
|
|
3075
|
+
...C(r)
|
|
2962
3076
|
},
|
|
2963
3077
|
children: o?.signedOut ?? null
|
|
2964
3078
|
});
|
|
2965
3079
|
}
|
|
2966
3080
|
//#endregion
|
|
2967
3081
|
//#region ../ui/src/components/builder/apps/index.js
|
|
2968
|
-
var
|
|
2969
|
-
SiteLoginForm:
|
|
2970
|
-
SiteAccountMenu:
|
|
3082
|
+
var Bt = [Nt], Vt = {
|
|
3083
|
+
SiteLoginForm: Rt,
|
|
3084
|
+
SiteAccountMenu: zt
|
|
2971
3085
|
};
|
|
2972
|
-
new Set(
|
|
3086
|
+
new Set(Bt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
2973
3087
|
//#endregion
|
|
2974
3088
|
//#region ../ui/src/components/builder/render.jsx
|
|
2975
|
-
var
|
|
2976
|
-
...
|
|
2977
|
-
...
|
|
3089
|
+
var Ht = {
|
|
3090
|
+
...Mt,
|
|
3091
|
+
...Vt
|
|
2978
3092
|
};
|
|
2979
|
-
function
|
|
3093
|
+
function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
2980
3094
|
let o = n[e];
|
|
2981
3095
|
if (!o || o.hidden) return null;
|
|
2982
3096
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -2984,28 +3098,28 @@ function $(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
2984
3098
|
let n = o.props?.componentId, s = r?.[n];
|
|
2985
3099
|
if (!s?.template || i.has(n)) return null;
|
|
2986
3100
|
let c = new Set(i).add(n);
|
|
2987
|
-
return /* @__PURE__ */
|
|
3101
|
+
return /* @__PURE__ */ d(t, { children: Q(s.template.rootId, s.template.nodes, r, c, a) }, e);
|
|
2988
3102
|
}
|
|
2989
|
-
let l =
|
|
3103
|
+
let l = Ht[s];
|
|
2990
3104
|
if (!l) return null;
|
|
2991
|
-
let
|
|
3105
|
+
let u = (o.nodes ?? []).map((e) => Q(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Q(t, n, r, i)])) : void 0, m = /* @__PURE__ */ d(l, {
|
|
2992
3106
|
...c,
|
|
2993
3107
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
2994
3108
|
linked: p,
|
|
2995
3109
|
nodeRef: (t) => {
|
|
2996
|
-
t && (t.setAttribute("data-wb", e),
|
|
3110
|
+
t && (t.setAttribute("data-wb", e), D(t, c));
|
|
2997
3111
|
},
|
|
2998
|
-
children:
|
|
3112
|
+
children: u.length ? u : void 0
|
|
2999
3113
|
}, e);
|
|
3000
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */
|
|
3114
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ d(Lt, {
|
|
3001
3115
|
when: c.when,
|
|
3002
3116
|
children: m
|
|
3003
3117
|
}, e) : m;
|
|
3004
3118
|
}
|
|
3005
3119
|
//#endregion
|
|
3006
3120
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
3007
|
-
var
|
|
3008
|
-
function
|
|
3121
|
+
var Ut = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
|
|
3122
|
+
function Wt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, tenant: c, apiUrl: l, datasets: u, locale: p, direction: m, settings: g, siteUser: v }) {
|
|
3009
3123
|
let b = o?.js?.trim();
|
|
3010
3124
|
if (a(() => {
|
|
3011
3125
|
if (!b) return;
|
|
@@ -3014,78 +3128,81 @@ function zt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3014
3128
|
}, [b]), !e?.ROOT) return null;
|
|
3015
3129
|
let x = {
|
|
3016
3130
|
lang: p || void 0,
|
|
3017
|
-
dir: m
|
|
3018
|
-
}, S = {
|
|
3131
|
+
dir: h(m, p)
|
|
3132
|
+
}, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
|
|
3019
3133
|
minHeight: "100%",
|
|
3020
3134
|
display: "flex",
|
|
3021
3135
|
flexDirection: "column"
|
|
3022
|
-
},
|
|
3136
|
+
}, w = Q("ROOT", e, n), T = s(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), E = F(e, n), D = P(e, n), O = o?.css?.trim(), k = y(e, n).map((e) => /* @__PURE__ */ d("link", {
|
|
3023
3137
|
rel: "stylesheet",
|
|
3024
3138
|
precedence: "default",
|
|
3025
|
-
href:
|
|
3139
|
+
href: _(e)
|
|
3026
3140
|
}, e));
|
|
3027
|
-
if (r !== "auto") return /* @__PURE__ */
|
|
3141
|
+
if (r !== "auto") return /* @__PURE__ */ d(H.Provider, {
|
|
3028
3142
|
value: {
|
|
3029
3143
|
tenant: c || "",
|
|
3030
3144
|
apiUrl: l || "/api",
|
|
3031
3145
|
locale: p || "",
|
|
3032
|
-
settings:
|
|
3146
|
+
settings: g ?? null
|
|
3033
3147
|
},
|
|
3034
|
-
children: /* @__PURE__ */
|
|
3035
|
-
initialUser:
|
|
3036
|
-
children: /* @__PURE__ */
|
|
3037
|
-
value:
|
|
3038
|
-
children: /* @__PURE__ */
|
|
3039
|
-
value:
|
|
3040
|
-
children: /* @__PURE__ */
|
|
3148
|
+
children: /* @__PURE__ */ d(It, {
|
|
3149
|
+
initialUser: v,
|
|
3150
|
+
children: /* @__PURE__ */ d(U.Provider, {
|
|
3151
|
+
value: u ?? null,
|
|
3152
|
+
children: /* @__PURE__ */ d(W.Provider, {
|
|
3153
|
+
value: T,
|
|
3154
|
+
children: /* @__PURE__ */ f("div", {
|
|
3041
3155
|
...x,
|
|
3156
|
+
className: "webim-page",
|
|
3042
3157
|
style: {
|
|
3043
|
-
...
|
|
3044
|
-
...
|
|
3158
|
+
...C,
|
|
3159
|
+
...re(t, r),
|
|
3045
3160
|
...i
|
|
3046
3161
|
},
|
|
3047
3162
|
children: [
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
E && /* @__PURE__ */
|
|
3051
|
-
D && /* @__PURE__ */
|
|
3052
|
-
|
|
3163
|
+
k,
|
|
3164
|
+
/* @__PURE__ */ d("style", { children: S }),
|
|
3165
|
+
E && /* @__PURE__ */ d("style", { children: E }),
|
|
3166
|
+
D && /* @__PURE__ */ d("style", { children: D }),
|
|
3167
|
+
O && /* @__PURE__ */ d("style", { children: O }),
|
|
3168
|
+
w
|
|
3053
3169
|
]
|
|
3054
3170
|
})
|
|
3055
3171
|
})
|
|
3056
3172
|
})
|
|
3057
3173
|
})
|
|
3058
3174
|
});
|
|
3059
|
-
let
|
|
3060
|
-
return /* @__PURE__ */
|
|
3175
|
+
let A = B(t);
|
|
3176
|
+
return /* @__PURE__ */ d(H.Provider, {
|
|
3061
3177
|
value: {
|
|
3062
3178
|
tenant: c || "",
|
|
3063
3179
|
apiUrl: l || "/api",
|
|
3064
3180
|
locale: p || "",
|
|
3065
|
-
settings:
|
|
3181
|
+
settings: g ?? null
|
|
3066
3182
|
},
|
|
3067
|
-
children: /* @__PURE__ */
|
|
3068
|
-
initialUser:
|
|
3069
|
-
children: /* @__PURE__ */
|
|
3070
|
-
value:
|
|
3071
|
-
children: /* @__PURE__ */
|
|
3072
|
-
value:
|
|
3073
|
-
children: /* @__PURE__ */
|
|
3183
|
+
children: /* @__PURE__ */ d(It, {
|
|
3184
|
+
initialUser: v,
|
|
3185
|
+
children: /* @__PURE__ */ d(U.Provider, {
|
|
3186
|
+
value: u ?? null,
|
|
3187
|
+
children: /* @__PURE__ */ d(W.Provider, {
|
|
3188
|
+
value: T,
|
|
3189
|
+
children: /* @__PURE__ */ f("div", {
|
|
3074
3190
|
...x,
|
|
3075
3191
|
className: "webim-page",
|
|
3076
3192
|
style: {
|
|
3077
|
-
...
|
|
3078
|
-
...
|
|
3193
|
+
...C,
|
|
3194
|
+
...ne(t),
|
|
3079
3195
|
...i
|
|
3080
3196
|
},
|
|
3081
3197
|
children: [
|
|
3082
|
-
/* @__PURE__ */
|
|
3083
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
3084
|
-
|
|
3085
|
-
|
|
3086
|
-
E && /* @__PURE__ */
|
|
3087
|
-
D && /* @__PURE__ */
|
|
3088
|
-
|
|
3198
|
+
/* @__PURE__ */ d("style", { children: `.webim-page { ${Ut(V(A.light))} }
|
|
3199
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Ut(V(A.dark))} } }` }),
|
|
3200
|
+
k,
|
|
3201
|
+
/* @__PURE__ */ d("style", { children: S }),
|
|
3202
|
+
E && /* @__PURE__ */ d("style", { children: E }),
|
|
3203
|
+
D && /* @__PURE__ */ d("style", { children: D }),
|
|
3204
|
+
O && /* @__PURE__ */ d("style", { children: O }),
|
|
3205
|
+
w
|
|
3089
3206
|
]
|
|
3090
3207
|
})
|
|
3091
3208
|
})
|
|
@@ -3095,8 +3212,8 @@ function zt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
|
|
|
3095
3212
|
}
|
|
3096
3213
|
//#endregion
|
|
3097
3214
|
//#region src/WebimContent.jsx
|
|
3098
|
-
function
|
|
3099
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */
|
|
3215
|
+
function Gt({ bundle: e, mode: t = "auto", style: n }) {
|
|
3216
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ d(Wt, {
|
|
3100
3217
|
blocks: e.blocks,
|
|
3101
3218
|
theme: e.theme,
|
|
3102
3219
|
components: e.components,
|
|
@@ -3113,7 +3230,7 @@ function Bt({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
3113
3230
|
}
|
|
3114
3231
|
//#endregion
|
|
3115
3232
|
//#region src/bundle.js
|
|
3116
|
-
function
|
|
3233
|
+
function Kt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
3117
3234
|
let a = {
|
|
3118
3235
|
...t?.global ?? {},
|
|
3119
3236
|
...t?.tenant ?? {}
|
|
@@ -3123,7 +3240,7 @@ function Vt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
3123
3240
|
title: e.title,
|
|
3124
3241
|
slug: e.slug,
|
|
3125
3242
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
3126
|
-
theme:
|
|
3243
|
+
theme: ie(o, a.builder_themes?.themes),
|
|
3127
3244
|
components: a.builder_components?.components ?? {},
|
|
3128
3245
|
custom: o.custom,
|
|
3129
3246
|
seo: o.seo,
|
|
@@ -3137,18 +3254,18 @@ function Vt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
3137
3254
|
}
|
|
3138
3255
|
//#endregion
|
|
3139
3256
|
//#region src/fetchPage.js
|
|
3140
|
-
var
|
|
3257
|
+
var qt = async (e) => {
|
|
3141
3258
|
let t = await e.json().catch(() => null);
|
|
3142
3259
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
3143
3260
|
return t?.payload ?? t;
|
|
3144
3261
|
};
|
|
3145
|
-
async function
|
|
3262
|
+
async function Jt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
|
|
3146
3263
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
3147
3264
|
if (!n) throw Error("fetchPage: slug is required");
|
|
3148
3265
|
let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
|
|
3149
3266
|
...t ? { "x-tenant": t } : {},
|
|
3150
3267
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
3151
|
-
}, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(
|
|
3268
|
+
}, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(qt), s(`${c}/settings/public`, { headers: l }).then(qt)]), f = Kt({
|
|
3152
3269
|
page: u,
|
|
3153
3270
|
settings: d,
|
|
3154
3271
|
tenant: t,
|
|
@@ -3156,47 +3273,47 @@ async function Ut({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
3156
3273
|
locale: r
|
|
3157
3274
|
}), p = [...new Set(Object.values(f.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
|
|
3158
3275
|
if (p.length) {
|
|
3159
|
-
let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(
|
|
3276
|
+
let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(qt).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
|
|
3160
3277
|
f.datasets = Object.fromEntries(t);
|
|
3161
3278
|
}
|
|
3162
3279
|
return f;
|
|
3163
3280
|
}
|
|
3164
3281
|
//#endregion
|
|
3165
3282
|
//#region src/ssr.jsx
|
|
3166
|
-
var
|
|
3283
|
+
var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
3167
3284
|
"&": "&",
|
|
3168
3285
|
"<": "<",
|
|
3169
3286
|
">": ">",
|
|
3170
3287
|
"\"": """
|
|
3171
3288
|
})[e]);
|
|
3172
|
-
function
|
|
3173
|
-
return e(/* @__PURE__ */
|
|
3289
|
+
function Yt(t, { mode: n = "auto", style: r } = {}) {
|
|
3290
|
+
return e(/* @__PURE__ */ d(Gt, {
|
|
3174
3291
|
bundle: t,
|
|
3175
3292
|
mode: n,
|
|
3176
3293
|
style: r
|
|
3177
3294
|
}));
|
|
3178
3295
|
}
|
|
3179
|
-
function
|
|
3180
|
-
let r = e.seo ?? {}, i = n || e.locale || "en", a =
|
|
3296
|
+
function Xt(e, { mode: t = "auto", lang: n } = {}) {
|
|
3297
|
+
let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
|
|
3181
3298
|
"<meta charset=\"utf-8\"/>",
|
|
3182
3299
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
3183
|
-
`<title>${
|
|
3184
|
-
r.description && `<meta name="description" content="${
|
|
3185
|
-
`<meta property="og:title" content="${
|
|
3186
|
-
r.image && `<meta property="og:image" content="${
|
|
3300
|
+
`<title>${$(o)}</title>`,
|
|
3301
|
+
r.description && `<meta name="description" content="${$(r.description)}"/>`,
|
|
3302
|
+
`<meta property="og:title" content="${$(o)}"/>`,
|
|
3303
|
+
r.image && `<meta property="og:image" content="${$(r.image)}"/>`,
|
|
3187
3304
|
r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
|
|
3188
3305
|
"<style>html,body{margin:0;height:100%}</style>"
|
|
3189
3306
|
].filter(Boolean).join("\n");
|
|
3190
3307
|
return `<!doctype html>
|
|
3191
|
-
<html lang="${
|
|
3308
|
+
<html lang="${$(i)}"${a ? ` dir="${a}"` : ""}>
|
|
3192
3309
|
<head>
|
|
3193
3310
|
${c}
|
|
3194
3311
|
</head>
|
|
3195
3312
|
<body>
|
|
3196
|
-
${
|
|
3313
|
+
${Yt(e, { mode: t })}
|
|
3197
3314
|
${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
3198
3315
|
</body>
|
|
3199
3316
|
</html>`;
|
|
3200
3317
|
}
|
|
3201
3318
|
//#endregion
|
|
3202
|
-
export {
|
|
3319
|
+
export { Kt as assembleBundle, Jt as fetchPage, Yt as renderBundleHtml, Xt as renderPageDocument };
|