webim-adapter 0.3.0 → 0.5.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/README.md +5 -1
- package/build/webim-adapter.js +430 -149
- package/build/webim-embed.js +2 -2
- package/build/webim-ssr.js +578 -297
- package/package.json +1 -1
package/build/webim-ssr.js
CHANGED
|
@@ -161,54 +161,54 @@ function _(e) {
|
|
|
161
161
|
delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
|
|
162
162
|
let w = (Array.isArray(_) ? _ : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
|
|
163
163
|
(v !== void 0 || y !== void 0) && w.push(`translate(${h(v ?? 0)}, ${h(y ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), x !== void 0 && w.push(`rotate(${f(x)})`), (S !== void 0 || C !== void 0) && w.push(`skew(${f(S ?? 0)}, ${f(C ?? 0)})`), w.length && (t.transform = w.join(" "));
|
|
164
|
-
let T = (e) => `${e.inset ? "inset " : ""}${h(e.x ?? 0)} ${h(e.y ?? 0)} ${h(e.blur ?? 0)} ${h(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: E, boxShadowX: D, boxShadowY:
|
|
164
|
+
let T = (e) => `${e.inset ? "inset " : ""}${h(e.x ?? 0)} ${h(e.y ?? 0)} ${h(e.blur ?? 0)} ${h(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;
|
|
165
165
|
delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
|
|
166
|
-
let
|
|
166
|
+
let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
|
|
167
167
|
[
|
|
168
168
|
D,
|
|
169
|
-
ee,
|
|
170
169
|
O,
|
|
171
170
|
k,
|
|
172
171
|
A,
|
|
173
|
-
j
|
|
174
|
-
|
|
172
|
+
j,
|
|
173
|
+
M
|
|
174
|
+
].some((e) => e !== void 0) && N.push(T({
|
|
175
175
|
x: D,
|
|
176
|
-
y:
|
|
177
|
-
blur:
|
|
178
|
-
spread:
|
|
179
|
-
color:
|
|
180
|
-
inset:
|
|
181
|
-
})),
|
|
182
|
-
let
|
|
176
|
+
y: O,
|
|
177
|
+
blur: k,
|
|
178
|
+
spread: A,
|
|
179
|
+
color: j,
|
|
180
|
+
inset: M
|
|
181
|
+
})), N.length && (t.boxShadow = N.join(", "));
|
|
182
|
+
let P = (e) => e.type === "blur" ? `blur(${h(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: B, filterSaturate: V } = t;
|
|
183
183
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
184
|
-
let
|
|
185
|
-
|
|
186
|
-
let
|
|
187
|
-
|
|
184
|
+
let H = F(I);
|
|
185
|
+
R !== void 0 && H.push(`blur(${h(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), ee !== void 0 && H.push(`brightness(${ee}%)`), B !== void 0 && H.push(`contrast(${B}%)`), V !== void 0 && H.push(`saturate(${V}%)`), H.length && (t.filter = H.join(" "));
|
|
186
|
+
let te = F(L);
|
|
187
|
+
te.length && (t.backdropFilter = te.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
188
188
|
let { textStrokeWidth: U, textStrokeColor: ne } = t;
|
|
189
189
|
delete t.textStrokeWidth, delete t.textStrokeColor, (U !== void 0 || ne !== void 0) && (t.WebkitTextStroke = `${h(U ?? 1)} ${ne || "currentColor"}`);
|
|
190
190
|
let { clipText: W } = t;
|
|
191
191
|
delete t.clipText, W && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
192
|
-
let { transitions: re, transitionDuration: G, transitionEasing: ie, transitionProperty:
|
|
192
|
+
let { transitions: re, transitionDuration: G, transitionEasing: ie, transitionProperty: K } = t, ae = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
193
193
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
194
|
-
let
|
|
195
|
-
if (G !== void 0 &&
|
|
194
|
+
let q = (Array.isArray(re) ? re : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ae(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
195
|
+
if (G !== void 0 && q.push(`${K || "all"} ${ae(G)} ${ie || "ease"}`), q.length && (t.transition = q.join(", ")), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
196
196
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
197
197
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
198
198
|
}
|
|
199
199
|
delete t.backgroundVideo;
|
|
200
|
-
let { overlayColor:
|
|
201
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
202
|
-
let e = `color-mix(in srgb, ${
|
|
200
|
+
let { overlayColor: J, overlayOpacity: Y } = t;
|
|
201
|
+
if (delete t.overlayColor, delete t.overlayOpacity, J) {
|
|
202
|
+
let e = `color-mix(in srgb, ${J} ${Y ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
203
203
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
204
204
|
}
|
|
205
205
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
206
|
-
let { backgroundLayers:
|
|
206
|
+
let { backgroundLayers: oe } = t;
|
|
207
207
|
delete t.backgroundLayers;
|
|
208
|
-
let
|
|
209
|
-
if (
|
|
208
|
+
let se = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1);
|
|
209
|
+
if (se.length) {
|
|
210
210
|
let e = [], n = [], r = [], i = [], a = [];
|
|
211
|
-
for (let t of
|
|
211
|
+
for (let t of se) 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");
|
|
212
212
|
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");
|
|
213
213
|
else {
|
|
214
214
|
if (!t.src) continue;
|
|
@@ -268,7 +268,7 @@ function D(e, t) {
|
|
|
268
268
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
269
269
|
}).filter(Boolean).join("\n");
|
|
270
270
|
}
|
|
271
|
-
function
|
|
271
|
+
function O(e, t) {
|
|
272
272
|
let n = [], r = (e) => {
|
|
273
273
|
for (let [t, r] of Object.entries(e || {})) {
|
|
274
274
|
let e = D(t, r.props);
|
|
@@ -279,7 +279,7 @@ function ee(e, t) {
|
|
|
279
279
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
280
280
|
return n.join("\n");
|
|
281
281
|
}
|
|
282
|
-
function
|
|
282
|
+
function k(e, t) {
|
|
283
283
|
let n = [], r = (e) => {
|
|
284
284
|
for (let [t, r] of Object.entries(e || {})) {
|
|
285
285
|
let e = w(t, r.props);
|
|
@@ -290,7 +290,7 @@ function O(e, t) {
|
|
|
290
290
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
291
291
|
return n.join("\n");
|
|
292
292
|
}
|
|
293
|
-
var
|
|
293
|
+
var A = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", j = {
|
|
294
294
|
light: {
|
|
295
295
|
background: "#ffffff",
|
|
296
296
|
text: "#111827",
|
|
@@ -327,23 +327,23 @@ var k = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
327
327
|
contrastText: "#052e2b"
|
|
328
328
|
}
|
|
329
329
|
}
|
|
330
|
-
},
|
|
330
|
+
}, M = {
|
|
331
331
|
font: "system",
|
|
332
332
|
headingFont: "inherit",
|
|
333
|
-
light:
|
|
334
|
-
dark:
|
|
335
|
-
},
|
|
333
|
+
light: j.light,
|
|
334
|
+
dark: j.dark
|
|
335
|
+
}, N = {
|
|
336
336
|
system: {
|
|
337
337
|
label: "System",
|
|
338
|
-
value:
|
|
338
|
+
value: A
|
|
339
339
|
},
|
|
340
340
|
inter: {
|
|
341
341
|
label: "Inter",
|
|
342
|
-
value: `"Inter", ${
|
|
342
|
+
value: `"Inter", ${A}`
|
|
343
343
|
},
|
|
344
344
|
outfit: {
|
|
345
345
|
label: "Outfit",
|
|
346
|
-
value: `"Outfit", ${
|
|
346
|
+
value: `"Outfit", ${A}`
|
|
347
347
|
},
|
|
348
348
|
serif: {
|
|
349
349
|
label: "Serif",
|
|
@@ -353,7 +353,7 @@ var k = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
353
353
|
label: "Mono",
|
|
354
354
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
355
355
|
}
|
|
356
|
-
},
|
|
356
|
+
}, P = (e, t) => N[e]?.value ?? t, F = (e, ...t) => {
|
|
357
357
|
let n = Object.assign({}, e, ...t);
|
|
358
358
|
return n.primary = {
|
|
359
359
|
...e.primary,
|
|
@@ -369,16 +369,16 @@ var k = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
369
369
|
}), {})
|
|
370
370
|
}, n;
|
|
371
371
|
};
|
|
372
|
-
function
|
|
372
|
+
function I(e) {
|
|
373
373
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
374
374
|
return {
|
|
375
|
-
font: r ??
|
|
376
|
-
headingFont: i ??
|
|
377
|
-
light:
|
|
378
|
-
dark:
|
|
375
|
+
font: r ?? M.font,
|
|
376
|
+
headingFont: i ?? M.headingFont,
|
|
377
|
+
light: F(j.light, a, t),
|
|
378
|
+
dark: F(j.dark, n)
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function L(e) {
|
|
382
382
|
return {
|
|
383
383
|
"--page-bg": e.background,
|
|
384
384
|
"--page-text": e.text,
|
|
@@ -394,31 +394,31 @@ function F(e) {
|
|
|
394
394
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
395
395
|
};
|
|
396
396
|
}
|
|
397
|
-
function
|
|
398
|
-
let t =
|
|
397
|
+
function R(e) {
|
|
398
|
+
let t = I(e);
|
|
399
399
|
return {
|
|
400
400
|
backgroundColor: "var(--page-bg)",
|
|
401
401
|
color: "var(--page-text)",
|
|
402
|
-
fontFamily:
|
|
403
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
402
|
+
fontFamily: P(t.font, A),
|
|
403
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : P(t.headingFont, "inherit")
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
|
-
function
|
|
407
|
-
let n =
|
|
406
|
+
function z(e, t = "light") {
|
|
407
|
+
let n = I(e);
|
|
408
408
|
return {
|
|
409
|
-
...
|
|
410
|
-
...
|
|
409
|
+
...R(e),
|
|
410
|
+
...L(n[t] ?? n.light)
|
|
411
411
|
};
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function ee(e, t) {
|
|
414
414
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
415
415
|
}
|
|
416
416
|
//#endregion
|
|
417
417
|
//#region ../ui/src/components/builder/views.jsx
|
|
418
|
-
var
|
|
418
|
+
var B = n({
|
|
419
419
|
tenant: "",
|
|
420
420
|
apiUrl: "/api"
|
|
421
|
-
}),
|
|
421
|
+
}), V = n(null), H = n(null), te = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
422
422
|
function U(e, t) {
|
|
423
423
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
424
424
|
}
|
|
@@ -438,7 +438,7 @@ function W(e) {
|
|
|
438
438
|
function re(e, t) {
|
|
439
439
|
let n = t?.data ?? {}, r = ne(n);
|
|
440
440
|
if (!r.length) return e;
|
|
441
|
-
let i = RegExp(`:(${r.map(
|
|
441
|
+
let i = RegExp(`:(${r.map(te).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => W(U(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
442
442
|
return a(e);
|
|
443
443
|
}
|
|
444
444
|
var G = {
|
|
@@ -446,22 +446,22 @@ var G = {
|
|
|
446
446
|
fontWeight: 700,
|
|
447
447
|
lineHeight: 1.2,
|
|
448
448
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
449
|
-
}, ie = { margin: 0 },
|
|
449
|
+
}, ie = { margin: 0 }, K = {
|
|
450
450
|
display: "inline-block",
|
|
451
451
|
textDecoration: "none",
|
|
452
452
|
cursor: "pointer",
|
|
453
453
|
backgroundColor: "var(--page-accent, #111827)",
|
|
454
454
|
color: "var(--page-accent-text, #ffffff)"
|
|
455
|
-
},
|
|
455
|
+
}, ae = {
|
|
456
456
|
flexGrow: 1,
|
|
457
457
|
display: "flex",
|
|
458
458
|
flexDirection: "column",
|
|
459
459
|
position: "relative"
|
|
460
|
-
},
|
|
460
|
+
}, q = {
|
|
461
461
|
display: "flex",
|
|
462
462
|
flexDirection: "column"
|
|
463
463
|
};
|
|
464
|
-
function
|
|
464
|
+
function J({ style: e }) {
|
|
465
465
|
let t = e?.backgroundVideo;
|
|
466
466
|
if (!t) return null;
|
|
467
467
|
let n = {
|
|
@@ -487,7 +487,7 @@ function q({ style: e }) {
|
|
|
487
487
|
background: r
|
|
488
488
|
} })] });
|
|
489
489
|
}
|
|
490
|
-
var
|
|
490
|
+
var Y = (e, t) => e?.backgroundVideo ? {
|
|
491
491
|
position: "relative",
|
|
492
492
|
...t,
|
|
493
493
|
..._(e)
|
|
@@ -495,24 +495,24 @@ var J = (e, t) => e?.backgroundVideo ? {
|
|
|
495
495
|
...t,
|
|
496
496
|
..._(e)
|
|
497
497
|
};
|
|
498
|
-
function
|
|
498
|
+
function oe({ style: e, nodeRef: t, children: n }) {
|
|
499
499
|
return /* @__PURE__ */ l("div", {
|
|
500
500
|
ref: t,
|
|
501
501
|
style: {
|
|
502
|
-
...
|
|
502
|
+
...ae,
|
|
503
503
|
..._(e)
|
|
504
504
|
},
|
|
505
|
-
children: [/* @__PURE__ */ c(
|
|
505
|
+
children: [/* @__PURE__ */ c(J, { style: e }), n]
|
|
506
506
|
});
|
|
507
507
|
}
|
|
508
|
-
function
|
|
508
|
+
function se({ style: e, nodeRef: t, children: n }) {
|
|
509
509
|
return /* @__PURE__ */ l("section", {
|
|
510
510
|
ref: t,
|
|
511
|
-
style:
|
|
512
|
-
children: [/* @__PURE__ */ c(
|
|
511
|
+
style: Y(e, q),
|
|
512
|
+
children: [/* @__PURE__ */ c(J, { style: e }), n]
|
|
513
513
|
});
|
|
514
514
|
}
|
|
515
|
-
function
|
|
515
|
+
function ce({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
516
516
|
let i = t ? {
|
|
517
517
|
position: "relative",
|
|
518
518
|
minHeight: 240
|
|
@@ -521,61 +521,71 @@ function le({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
521
521
|
ref: n,
|
|
522
522
|
style: i ? {
|
|
523
523
|
...i,
|
|
524
|
-
...
|
|
525
|
-
} :
|
|
526
|
-
children: [/* @__PURE__ */ c(
|
|
524
|
+
...Y(e)
|
|
525
|
+
} : Y(e),
|
|
526
|
+
children: [/* @__PURE__ */ c(J, { style: e }), r]
|
|
527
527
|
});
|
|
528
528
|
}
|
|
529
|
-
function
|
|
529
|
+
function le({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
530
530
|
return /* @__PURE__ */ c(n, {
|
|
531
531
|
ref: a,
|
|
532
532
|
style: {
|
|
533
533
|
...G,
|
|
534
534
|
..._(r)
|
|
535
535
|
},
|
|
536
|
-
children:
|
|
536
|
+
children: X(t, e, i)
|
|
537
537
|
});
|
|
538
538
|
}
|
|
539
|
-
var
|
|
540
|
-
fontFamily:
|
|
539
|
+
var ue = {
|
|
540
|
+
fontFamily: N.mono.value,
|
|
541
541
|
background: "rgba(148, 163, 184, 0.18)",
|
|
542
542
|
padding: "1px 5px",
|
|
543
543
|
borderRadius: 4,
|
|
544
544
|
fontSize: "0.9em"
|
|
545
545
|
};
|
|
546
|
-
function
|
|
547
|
-
let
|
|
548
|
-
return t.includes("sup") ?
|
|
549
|
-
style:
|
|
550
|
-
children:
|
|
551
|
-
})), t.includes("strike") && (
|
|
546
|
+
function de(e, t = [], n, r) {
|
|
547
|
+
let i = e;
|
|
548
|
+
return t.includes("sup") ? i = /* @__PURE__ */ c("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ c("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ c("code", {
|
|
549
|
+
style: ue,
|
|
550
|
+
children: i
|
|
551
|
+
})), t.includes("strike") && (i = /* @__PURE__ */ c("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ c("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ c("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ c("strong", { children: i })), n && (i = /* @__PURE__ */ c("a", {
|
|
552
552
|
href: n,
|
|
553
|
+
target: r || void 0,
|
|
554
|
+
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
553
555
|
style: { color: "inherit" },
|
|
554
|
-
children:
|
|
555
|
-
})),
|
|
556
|
+
children: i
|
|
557
|
+
})), i;
|
|
556
558
|
}
|
|
557
|
-
function
|
|
559
|
+
function X(e, n, r) {
|
|
558
560
|
return e?.length ? e.map((e, n) => {
|
|
559
561
|
if (e.slot) return /* @__PURE__ */ c(t, { children: r?.[e.slot] ?? null }, n);
|
|
560
|
-
if (e.parts) return /* @__PURE__ */ c(t, { children:
|
|
562
|
+
if (e.parts) return /* @__PURE__ */ c(t, { children: X(e.parts, "", r) }, n);
|
|
561
563
|
let i = e.text;
|
|
562
564
|
return e.sup ? i = /* @__PURE__ */ c("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ c("sub", { children: i })), e.code && (i = /* @__PURE__ */ c("code", {
|
|
563
|
-
style:
|
|
565
|
+
style: ue,
|
|
564
566
|
children: i
|
|
565
|
-
})), e.strike && (i = /* @__PURE__ */ c("s", { children: i })), e.underline && (i = /* @__PURE__ */ c("u", { children: i })), e.italic && (i = /* @__PURE__ */ c("em", { children: i })), e.bold && (i = /* @__PURE__ */ c("strong", { children: i })), e.
|
|
567
|
+
})), e.strike && (i = /* @__PURE__ */ c("s", { children: i })), e.underline && (i = /* @__PURE__ */ c("u", { children: i })), e.italic && (i = /* @__PURE__ */ c("em", { children: i })), e.bold && (i = /* @__PURE__ */ c("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ c("span", {
|
|
568
|
+
style: {
|
|
569
|
+
...e.color && { color: e.color },
|
|
570
|
+
...e.background && { backgroundColor: e.background }
|
|
571
|
+
},
|
|
572
|
+
children: i
|
|
573
|
+
})), e.href && (i = /* @__PURE__ */ c("a", {
|
|
566
574
|
href: e.href,
|
|
567
|
-
|
|
575
|
+
target: e.target || void 0,
|
|
576
|
+
rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
577
|
+
style: { color: e.color ?? "inherit" },
|
|
568
578
|
children: i
|
|
569
579
|
})), /* @__PURE__ */ c(t, { children: i }, n);
|
|
570
580
|
}) : n;
|
|
571
581
|
}
|
|
572
|
-
function
|
|
582
|
+
function fe({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
573
583
|
return /* @__PURE__ */ c("span", {
|
|
574
|
-
style: _(
|
|
575
|
-
children: e?.length ?
|
|
584
|
+
style: _(a),
|
|
585
|
+
children: e?.length ? X(e, t) : de(t, n, r, i)
|
|
576
586
|
});
|
|
577
587
|
}
|
|
578
|
-
var
|
|
588
|
+
var pe = {
|
|
579
589
|
h1: 40,
|
|
580
590
|
h2: 32,
|
|
581
591
|
h3: 26,
|
|
@@ -583,31 +593,42 @@ var me = {
|
|
|
583
593
|
h5: 19,
|
|
584
594
|
h6: 16
|
|
585
595
|
};
|
|
586
|
-
function
|
|
587
|
-
let
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
596
|
+
function me({ align: e = "center", width: t, wrap: n } = {}) {
|
|
597
|
+
let r = t ? `${t}%` : void 0;
|
|
598
|
+
if (e === "full") return { width: "100%" };
|
|
599
|
+
let i = e === "left" || e === "right";
|
|
600
|
+
return i && (n ?? !0) ? {
|
|
601
|
+
float: e,
|
|
602
|
+
width: r ?? "50%",
|
|
603
|
+
maxWidth: "100%",
|
|
604
|
+
marginTop: "4px",
|
|
605
|
+
marginBottom: "12px",
|
|
606
|
+
...e === "left" ? {
|
|
607
|
+
marginRight: "20px",
|
|
608
|
+
marginLeft: 0
|
|
609
|
+
} : {
|
|
610
|
+
marginLeft: "20px",
|
|
611
|
+
marginRight: 0
|
|
612
|
+
}
|
|
613
|
+
} : i ? {
|
|
614
|
+
width: r ?? "fit-content",
|
|
615
|
+
maxWidth: "100%",
|
|
616
|
+
...e === "left" ? {
|
|
617
|
+
marginLeft: 0,
|
|
618
|
+
marginRight: "auto"
|
|
619
|
+
} : {
|
|
620
|
+
marginLeft: "auto",
|
|
621
|
+
marginRight: 0
|
|
622
|
+
}
|
|
602
623
|
} : {
|
|
603
|
-
width:
|
|
624
|
+
width: r ?? "fit-content",
|
|
604
625
|
maxWidth: "100%",
|
|
605
626
|
marginLeft: "auto",
|
|
606
627
|
marginRight: "auto"
|
|
607
628
|
};
|
|
608
629
|
}
|
|
609
|
-
function
|
|
610
|
-
let r = n ?? ((e, n) =>
|
|
630
|
+
function he(e = [], t, n) {
|
|
631
|
+
let r = n ?? ((e, n) => X(e, n, t));
|
|
611
632
|
return e.map((t, n) => {
|
|
612
633
|
let i = {
|
|
613
634
|
marginTop: 0,
|
|
@@ -629,10 +650,12 @@ function ge(e = [], t, n) {
|
|
|
629
650
|
marginLeft: 0,
|
|
630
651
|
marginRight: 0,
|
|
631
652
|
...i,
|
|
632
|
-
...
|
|
653
|
+
...me(t)
|
|
633
654
|
},
|
|
634
655
|
children: [t.href ? /* @__PURE__ */ c("a", {
|
|
635
656
|
href: t.href,
|
|
657
|
+
target: t.target || void 0,
|
|
658
|
+
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
636
659
|
style: { display: "block" },
|
|
637
660
|
children: e
|
|
638
661
|
}) : e, t.caption && /* @__PURE__ */ c("figcaption", {
|
|
@@ -646,15 +669,16 @@ function ge(e = [], t, n) {
|
|
|
646
669
|
})]
|
|
647
670
|
}, n);
|
|
648
671
|
}
|
|
649
|
-
if (t.type === "video") return
|
|
672
|
+
if (t.type === "video") return Ee(t.url) ? /* @__PURE__ */ c("div", {
|
|
650
673
|
style: {
|
|
651
674
|
...i,
|
|
652
|
-
...
|
|
675
|
+
...me({
|
|
653
676
|
align: t.align,
|
|
677
|
+
wrap: t.wrap,
|
|
654
678
|
width: t.width ?? 100
|
|
655
679
|
})
|
|
656
680
|
},
|
|
657
|
-
children: /* @__PURE__ */ c(
|
|
681
|
+
children: /* @__PURE__ */ c(De, {
|
|
658
682
|
url: t.url,
|
|
659
683
|
autoplay: t.autoplay,
|
|
660
684
|
muted: t.muted,
|
|
@@ -683,17 +707,17 @@ function ge(e = [], t, n) {
|
|
|
683
707
|
}
|
|
684
708
|
if (t.type === "quote") return /* @__PURE__ */ c("blockquote", {
|
|
685
709
|
style: {
|
|
686
|
-
...
|
|
710
|
+
..._e,
|
|
687
711
|
...i
|
|
688
712
|
},
|
|
689
713
|
children: r(t.parts, t.text)
|
|
690
714
|
}, n);
|
|
691
|
-
if (
|
|
715
|
+
if (pe[t.type]) {
|
|
692
716
|
let e = t.type;
|
|
693
717
|
return /* @__PURE__ */ c(e, {
|
|
694
718
|
style: {
|
|
695
719
|
...G,
|
|
696
|
-
fontSize:
|
|
720
|
+
fontSize: pe[t.type],
|
|
697
721
|
...i
|
|
698
722
|
},
|
|
699
723
|
children: r(t.parts, t.text)
|
|
@@ -708,32 +732,32 @@ function ge(e = [], t, n) {
|
|
|
708
732
|
}, n);
|
|
709
733
|
});
|
|
710
734
|
}
|
|
711
|
-
function
|
|
735
|
+
function ge({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
712
736
|
return /* @__PURE__ */ c("div", {
|
|
713
737
|
ref: r,
|
|
714
738
|
style: {
|
|
715
739
|
display: "flow-root",
|
|
716
740
|
..._(t)
|
|
717
741
|
},
|
|
718
|
-
children:
|
|
742
|
+
children: he(e, n)
|
|
719
743
|
});
|
|
720
744
|
}
|
|
721
|
-
var
|
|
745
|
+
var _e = {
|
|
722
746
|
margin: 0,
|
|
723
747
|
padding: "8px 0 8px 20px",
|
|
724
748
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
725
749
|
};
|
|
726
|
-
function
|
|
750
|
+
function ve({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
727
751
|
return /* @__PURE__ */ c("blockquote", {
|
|
728
752
|
ref: i,
|
|
729
753
|
style: {
|
|
730
|
-
...
|
|
754
|
+
..._e,
|
|
731
755
|
..._(n)
|
|
732
756
|
},
|
|
733
|
-
children:
|
|
757
|
+
children: X(t, e, r)
|
|
734
758
|
});
|
|
735
759
|
}
|
|
736
|
-
function
|
|
760
|
+
function ye({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
737
761
|
return /* @__PURE__ */ c(e ? "ol" : "ul", {
|
|
738
762
|
ref: r,
|
|
739
763
|
style: {
|
|
@@ -743,53 +767,53 @@ function be({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
743
767
|
},
|
|
744
768
|
children: t.map((e, t) => /* @__PURE__ */ c("li", {
|
|
745
769
|
style: { marginBottom: 4 },
|
|
746
|
-
children:
|
|
770
|
+
children: X(e.parts, e.text)
|
|
747
771
|
}, t))
|
|
748
772
|
});
|
|
749
773
|
}
|
|
750
|
-
function
|
|
774
|
+
function be({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
751
775
|
return /* @__PURE__ */ c("p", {
|
|
752
776
|
ref: i,
|
|
753
777
|
style: {
|
|
754
778
|
...ie,
|
|
755
779
|
..._(n)
|
|
756
780
|
},
|
|
757
|
-
children:
|
|
781
|
+
children: X(t, e, r)
|
|
758
782
|
});
|
|
759
783
|
}
|
|
760
|
-
var
|
|
784
|
+
var xe = {
|
|
761
785
|
color: "var(--page-accent, inherit)",
|
|
762
786
|
textDecoration: "underline",
|
|
763
787
|
textUnderlineOffset: 3,
|
|
764
788
|
cursor: "pointer"
|
|
765
789
|
};
|
|
766
|
-
function
|
|
790
|
+
function Se({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
767
791
|
return /* @__PURE__ */ c("a", {
|
|
768
792
|
ref: o,
|
|
769
793
|
href: n || "#",
|
|
770
794
|
target: r || void 0,
|
|
771
795
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
772
796
|
style: {
|
|
773
|
-
...
|
|
797
|
+
...xe,
|
|
774
798
|
..._(i)
|
|
775
799
|
},
|
|
776
|
-
children:
|
|
800
|
+
children: X(t, e, a)
|
|
777
801
|
});
|
|
778
802
|
}
|
|
779
|
-
function
|
|
803
|
+
function Ce({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
780
804
|
return /* @__PURE__ */ c("a", {
|
|
781
805
|
ref: o,
|
|
782
806
|
href: n || "#",
|
|
783
807
|
target: r || void 0,
|
|
784
808
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
785
809
|
style: {
|
|
786
|
-
...
|
|
810
|
+
...K,
|
|
787
811
|
..._(i)
|
|
788
812
|
},
|
|
789
|
-
children:
|
|
813
|
+
children: X(t, e, a)
|
|
790
814
|
});
|
|
791
815
|
}
|
|
792
|
-
function
|
|
816
|
+
function we({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
793
817
|
return e ? /* @__PURE__ */ c("img", {
|
|
794
818
|
ref: r,
|
|
795
819
|
src: e,
|
|
@@ -801,7 +825,7 @@ function Te({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
801
825
|
}
|
|
802
826
|
}) : null;
|
|
803
827
|
}
|
|
804
|
-
function
|
|
828
|
+
function Te({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
805
829
|
return e ? /* @__PURE__ */ c("video", {
|
|
806
830
|
ref: s,
|
|
807
831
|
src: e,
|
|
@@ -819,9 +843,9 @@ function Ee({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
819
843
|
}
|
|
820
844
|
}) : null;
|
|
821
845
|
}
|
|
822
|
-
var
|
|
823
|
-
function
|
|
824
|
-
let l =
|
|
846
|
+
var Ee = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
847
|
+
function De({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
848
|
+
let l = Ee(e);
|
|
825
849
|
if (!l) return null;
|
|
826
850
|
let u = new URLSearchParams({ rel: "0" });
|
|
827
851
|
return t && u.set("autoplay", "1"), (n || t) && u.set("mute", "1"), i || u.set("controls", "0"), r && (u.set("loop", "1"), u.set("playlist", l)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ c("div", {
|
|
@@ -847,7 +871,7 @@ function Oe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
847
871
|
})
|
|
848
872
|
});
|
|
849
873
|
}
|
|
850
|
-
function
|
|
874
|
+
function Oe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
851
875
|
return e ? /* @__PURE__ */ c("iframe", {
|
|
852
876
|
ref: i,
|
|
853
877
|
src: e,
|
|
@@ -863,7 +887,7 @@ function ke({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
863
887
|
}
|
|
864
888
|
}) : null;
|
|
865
889
|
}
|
|
866
|
-
function
|
|
890
|
+
function ke({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
867
891
|
let [a, s] = o(null);
|
|
868
892
|
return i(() => {
|
|
869
893
|
a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
|
|
@@ -882,7 +906,7 @@ function Ae({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
882
906
|
style: _(n)
|
|
883
907
|
});
|
|
884
908
|
}
|
|
885
|
-
function
|
|
909
|
+
function Ae({ height: e, nodeRef: t }) {
|
|
886
910
|
return /* @__PURE__ */ c("div", {
|
|
887
911
|
ref: t,
|
|
888
912
|
style: {
|
|
@@ -892,7 +916,7 @@ function je({ height: e, nodeRef: t }) {
|
|
|
892
916
|
}
|
|
893
917
|
});
|
|
894
918
|
}
|
|
895
|
-
function
|
|
919
|
+
function je({ style: e, nodeRef: t }) {
|
|
896
920
|
return /* @__PURE__ */ c("div", {
|
|
897
921
|
ref: t,
|
|
898
922
|
style: {
|
|
@@ -903,7 +927,7 @@ function Me({ style: e, nodeRef: t }) {
|
|
|
903
927
|
}
|
|
904
928
|
});
|
|
905
929
|
}
|
|
906
|
-
var
|
|
930
|
+
var Me = {
|
|
907
931
|
position: "absolute",
|
|
908
932
|
top: "50%",
|
|
909
933
|
transform: "translateY(-50%)",
|
|
@@ -920,7 +944,7 @@ var Ne = {
|
|
|
920
944
|
alignItems: "center",
|
|
921
945
|
justifyContent: "center",
|
|
922
946
|
padding: 0
|
|
923
|
-
},
|
|
947
|
+
}, Ne = {
|
|
924
948
|
bottom: {
|
|
925
949
|
inset: "auto 0 0 0",
|
|
926
950
|
padding: "40px 24px 20px",
|
|
@@ -939,8 +963,8 @@ var Ne = {
|
|
|
939
963
|
padding: 24,
|
|
940
964
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
941
965
|
}
|
|
942
|
-
},
|
|
943
|
-
function
|
|
966
|
+
}, Pe = 48;
|
|
967
|
+
function Fe({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: u = !0, style: d, nodeRef: f }) {
|
|
944
968
|
let [p, m] = o(0), [h, g] = o(!1), [v, y] = o(null), b = e ? Math.min(p, e - 1) : 0;
|
|
945
969
|
if (i(() => {
|
|
946
970
|
if (!n || h || v || e < 2) return;
|
|
@@ -956,7 +980,7 @@ function Ie({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
956
980
|
let x = (t) => m((t + e) % e), S = () => {
|
|
957
981
|
if (!v) return;
|
|
958
982
|
let { dx: e } = v;
|
|
959
|
-
y(null), e < -48 ? x(b + 1) : e >
|
|
983
|
+
y(null), e < -48 ? x(b + 1) : e > Pe && x(b - 1);
|
|
960
984
|
};
|
|
961
985
|
return /* @__PURE__ */ l("div", {
|
|
962
986
|
ref: f,
|
|
@@ -1004,7 +1028,7 @@ function Ie({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1004
1028
|
type: "button",
|
|
1005
1029
|
"aria-label": "Previous slide",
|
|
1006
1030
|
style: {
|
|
1007
|
-
...
|
|
1031
|
+
...Me,
|
|
1008
1032
|
left: 12
|
|
1009
1033
|
},
|
|
1010
1034
|
onClick: () => x(b - 1),
|
|
@@ -1014,7 +1038,7 @@ function Ie({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1014
1038
|
type: "button",
|
|
1015
1039
|
"aria-label": "Next slide",
|
|
1016
1040
|
style: {
|
|
1017
|
-
...
|
|
1041
|
+
...Me,
|
|
1018
1042
|
right: 12
|
|
1019
1043
|
},
|
|
1020
1044
|
onClick: () => x(b + 1),
|
|
@@ -1048,7 +1072,7 @@ function Ie({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1048
1072
|
] })]
|
|
1049
1073
|
});
|
|
1050
1074
|
}
|
|
1051
|
-
var
|
|
1075
|
+
var Ie = (e, t) => ({
|
|
1052
1076
|
position: "absolute",
|
|
1053
1077
|
inset: 0,
|
|
1054
1078
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1056,18 +1080,18 @@ var Le = (e, t) => ({
|
|
|
1056
1080
|
backgroundSize: "cover",
|
|
1057
1081
|
backgroundPosition: "center"
|
|
1058
1082
|
});
|
|
1059
|
-
function
|
|
1060
|
-
return e.length ? /* @__PURE__ */ c(
|
|
1083
|
+
function Le({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1084
|
+
return e.length ? /* @__PURE__ */ c(Fe, {
|
|
1061
1085
|
...r,
|
|
1062
1086
|
count: e.length,
|
|
1063
1087
|
renderSlide: (r) => {
|
|
1064
1088
|
let i = e[r];
|
|
1065
|
-
return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style:
|
|
1089
|
+
return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Ie(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
|
|
1066
1090
|
style: {
|
|
1067
1091
|
position: "absolute",
|
|
1068
1092
|
color: "#fff",
|
|
1069
1093
|
textAlign: n,
|
|
1070
|
-
...
|
|
1094
|
+
...Ne[t] ?? Ne.bottom
|
|
1071
1095
|
},
|
|
1072
1096
|
children: [i.title && /* @__PURE__ */ c("div", {
|
|
1073
1097
|
style: {
|
|
@@ -1087,13 +1111,13 @@ function Re({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1087
1111
|
}
|
|
1088
1112
|
}) : null;
|
|
1089
1113
|
}
|
|
1090
|
-
function
|
|
1091
|
-
return e.length ? /* @__PURE__ */ c(
|
|
1114
|
+
function Re({ slides: e = [], linked: t, ...n }) {
|
|
1115
|
+
return e.length ? /* @__PURE__ */ c(Fe, {
|
|
1092
1116
|
...n,
|
|
1093
1117
|
count: e.length,
|
|
1094
1118
|
renderSlide: (n) => {
|
|
1095
1119
|
let r = e[n];
|
|
1096
|
-
return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style:
|
|
1120
|
+
return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Ie(r.image, r.color) }), /* @__PURE__ */ c("div", {
|
|
1097
1121
|
style: {
|
|
1098
1122
|
position: "absolute",
|
|
1099
1123
|
inset: 0,
|
|
@@ -1105,19 +1129,19 @@ function ze({ slides: e = [], linked: t, ...n }) {
|
|
|
1105
1129
|
}
|
|
1106
1130
|
}) : null;
|
|
1107
1131
|
}
|
|
1108
|
-
var
|
|
1132
|
+
var Z = {
|
|
1109
1133
|
color: "inherit",
|
|
1110
1134
|
textDecoration: "none",
|
|
1111
1135
|
fontSize: 14,
|
|
1112
1136
|
opacity: .85
|
|
1113
|
-
},
|
|
1137
|
+
}, ze = {
|
|
1114
1138
|
background: "var(--page-bg, #ffffff)",
|
|
1115
1139
|
color: "var(--page-text, #111827)",
|
|
1116
1140
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
1117
1141
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
1118
1142
|
zIndex: 60
|
|
1119
1143
|
};
|
|
1120
|
-
function
|
|
1144
|
+
function Be({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u = "auto", breakpoint: d = 768 }) {
|
|
1121
1145
|
let [f, p] = o(null), [m, h] = o(!1), [g, v] = o(!1), [y, b] = o(null);
|
|
1122
1146
|
i(() => {
|
|
1123
1147
|
if (!f) return;
|
|
@@ -1127,7 +1151,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
|
|
|
1127
1151
|
let x = u === "hamburger" || u === "auto" && m, S = (e, t) => /* @__PURE__ */ l("a", {
|
|
1128
1152
|
href: e.href || "#",
|
|
1129
1153
|
style: {
|
|
1130
|
-
...
|
|
1154
|
+
...Z,
|
|
1131
1155
|
display: "block",
|
|
1132
1156
|
...t
|
|
1133
1157
|
},
|
|
@@ -1198,7 +1222,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
|
|
|
1198
1222
|
let t = e.children ?? [];
|
|
1199
1223
|
if (!t.length) return /* @__PURE__ */ c("a", {
|
|
1200
1224
|
href: e.href || "#",
|
|
1201
|
-
style:
|
|
1225
|
+
style: Z,
|
|
1202
1226
|
children: e.label
|
|
1203
1227
|
}, e.key);
|
|
1204
1228
|
let n = e.type === "mega";
|
|
@@ -1212,7 +1236,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
|
|
|
1212
1236
|
children: [/* @__PURE__ */ l("a", {
|
|
1213
1237
|
href: e.href || "#",
|
|
1214
1238
|
style: {
|
|
1215
|
-
...
|
|
1239
|
+
...Z,
|
|
1216
1240
|
cursor: "pointer"
|
|
1217
1241
|
},
|
|
1218
1242
|
children: [
|
|
@@ -1228,7 +1252,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
|
|
|
1228
1252
|
]
|
|
1229
1253
|
}), y === e.key && (n ? /* @__PURE__ */ c("div", {
|
|
1230
1254
|
style: {
|
|
1231
|
-
...
|
|
1255
|
+
...ze,
|
|
1232
1256
|
position: "absolute",
|
|
1233
1257
|
left: 0,
|
|
1234
1258
|
right: 0,
|
|
@@ -1244,7 +1268,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
|
|
|
1244
1268
|
}))
|
|
1245
1269
|
}) : /* @__PURE__ */ c("div", {
|
|
1246
1270
|
style: {
|
|
1247
|
-
...
|
|
1271
|
+
...ze,
|
|
1248
1272
|
position: "absolute",
|
|
1249
1273
|
top: "100%",
|
|
1250
1274
|
left: 0,
|
|
@@ -1273,7 +1297,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
|
|
|
1273
1297
|
children: r.map((e) => /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c("a", {
|
|
1274
1298
|
href: e.href || "#",
|
|
1275
1299
|
style: {
|
|
1276
|
-
...
|
|
1300
|
+
...Z,
|
|
1277
1301
|
padding: "10px 4px",
|
|
1278
1302
|
fontWeight: (e.children ?? []).length ? 600 : 400,
|
|
1279
1303
|
opacity: 1
|
|
@@ -1284,7 +1308,7 @@ function Ve({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
|
|
|
1284
1308
|
]
|
|
1285
1309
|
});
|
|
1286
1310
|
}
|
|
1287
|
-
function
|
|
1311
|
+
function Ve({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
1288
1312
|
let [i, a] = o(0), s = e.length ? Math.min(i, e.length - 1) : 0;
|
|
1289
1313
|
return e.length ? /* @__PURE__ */ l("div", {
|
|
1290
1314
|
ref: r,
|
|
@@ -1324,7 +1348,7 @@ function He({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
1324
1348
|
}, e.key))]
|
|
1325
1349
|
}) : null;
|
|
1326
1350
|
}
|
|
1327
|
-
function
|
|
1351
|
+
function He({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
|
|
1328
1352
|
let [a, s] = o(() => new Set(e.length ? [e[0].key] : []));
|
|
1329
1353
|
if (!e.length) return null;
|
|
1330
1354
|
let u = (e) => s((t) => {
|
|
@@ -1381,15 +1405,15 @@ function Ue({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
1381
1405
|
})
|
|
1382
1406
|
});
|
|
1383
1407
|
}
|
|
1384
|
-
var
|
|
1408
|
+
var Ue = {
|
|
1385
1409
|
display: "flex",
|
|
1386
1410
|
flexDirection: "column",
|
|
1387
1411
|
gap: "12px"
|
|
1388
|
-
},
|
|
1412
|
+
}, We = {
|
|
1389
1413
|
fontSize: "14px",
|
|
1390
1414
|
fontWeight: 500,
|
|
1391
1415
|
color: "var(--page-text, #111827)"
|
|
1392
|
-
},
|
|
1416
|
+
}, Ge = {
|
|
1393
1417
|
padding: "10px 12px",
|
|
1394
1418
|
border: "1px solid #d1d5db",
|
|
1395
1419
|
borderRadius: "6px",
|
|
@@ -1410,39 +1434,214 @@ var We = {
|
|
|
1410
1434
|
tabIndex: -1,
|
|
1411
1435
|
onMouseDown: (e) => e.preventDefault()
|
|
1412
1436
|
} : {};
|
|
1413
|
-
function Je(
|
|
1414
|
-
|
|
1437
|
+
function Je(e, t) {
|
|
1438
|
+
if (!e) return !0;
|
|
1439
|
+
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
1440
|
+
switch (e.op) {
|
|
1441
|
+
case "eq": return r === i;
|
|
1442
|
+
case "neq": return r !== i;
|
|
1443
|
+
case "contains": return r.toLowerCase().includes(i.toLowerCase());
|
|
1444
|
+
case "gt": return Number(r) > Number(i);
|
|
1445
|
+
case "lt": return Number(r) < Number(i);
|
|
1446
|
+
case "empty": return r === "";
|
|
1447
|
+
case "notEmpty": return r !== "";
|
|
1448
|
+
default: return !1;
|
|
1449
|
+
}
|
|
1450
|
+
}
|
|
1451
|
+
var Ye = {
|
|
1452
|
+
display: "flex",
|
|
1453
|
+
flexDirection: "column",
|
|
1454
|
+
gap: 6
|
|
1455
|
+
}, Xe = {
|
|
1456
|
+
font: "inherit",
|
|
1457
|
+
fontSize: 15,
|
|
1458
|
+
padding: "10px 12px",
|
|
1459
|
+
borderRadius: 8,
|
|
1460
|
+
border: "1px solid rgba(148, 163, 184, 0.55)",
|
|
1461
|
+
background: "transparent",
|
|
1462
|
+
color: "inherit",
|
|
1463
|
+
width: "100%",
|
|
1464
|
+
boxSizing: "border-box"
|
|
1465
|
+
};
|
|
1466
|
+
function Ze({ field: e, value: t, onChange: n, inert: r }) {
|
|
1467
|
+
let i = /* @__PURE__ */ l("span", {
|
|
1468
|
+
style: {
|
|
1469
|
+
...We,
|
|
1470
|
+
fontSize: 14
|
|
1471
|
+
},
|
|
1472
|
+
children: [e.label, e.required ? " *" : ""]
|
|
1473
|
+
}), a = {
|
|
1474
|
+
name: e.name,
|
|
1475
|
+
required: e.required || void 0,
|
|
1476
|
+
placeholder: e.placeholder || void 0,
|
|
1477
|
+
disabled: r || void 0,
|
|
1478
|
+
style: Xe,
|
|
1479
|
+
value: t ?? "",
|
|
1480
|
+
onChange: (t) => n(e.name, t.target.value)
|
|
1481
|
+
};
|
|
1482
|
+
return e.type === "display" ? /* @__PURE__ */ c(e.variant && e.variant !== "p" ? e.variant : "p", {
|
|
1483
|
+
style: {
|
|
1484
|
+
margin: 0,
|
|
1485
|
+
color: e.color || "inherit",
|
|
1486
|
+
fontSize: {
|
|
1487
|
+
h1: 32,
|
|
1488
|
+
h2: 26,
|
|
1489
|
+
h3: 21,
|
|
1490
|
+
h4: 18,
|
|
1491
|
+
h5: 16,
|
|
1492
|
+
h6: 14,
|
|
1493
|
+
p: 15
|
|
1494
|
+
}[e.variant] ?? 16,
|
|
1495
|
+
fontWeight: e.variant === "p" ? 400 : 700,
|
|
1496
|
+
lineHeight: 1.35
|
|
1497
|
+
},
|
|
1498
|
+
children: e.label
|
|
1499
|
+
}) : e.type === "image" ? e.src ? /* @__PURE__ */ c("img", {
|
|
1500
|
+
src: e.src,
|
|
1501
|
+
alt: e.label ?? "",
|
|
1502
|
+
style: {
|
|
1503
|
+
width: "100%",
|
|
1504
|
+
borderRadius: 8,
|
|
1505
|
+
display: "block"
|
|
1506
|
+
}
|
|
1507
|
+
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ c(De, {
|
|
1508
|
+
url: e.src,
|
|
1509
|
+
style: { width: "100%" }
|
|
1510
|
+
}) : /* @__PURE__ */ c("video", {
|
|
1511
|
+
src: e.src,
|
|
1512
|
+
controls: !0,
|
|
1513
|
+
style: {
|
|
1514
|
+
width: "100%",
|
|
1515
|
+
borderRadius: 8,
|
|
1516
|
+
display: "block"
|
|
1517
|
+
}
|
|
1518
|
+
}) : null : /* @__PURE__ */ l("label", {
|
|
1519
|
+
style: Ye,
|
|
1520
|
+
children: [
|
|
1521
|
+
i,
|
|
1522
|
+
e.type === "textarea" || e.multiline ? /* @__PURE__ */ c("textarea", {
|
|
1523
|
+
...a,
|
|
1524
|
+
rows: 4,
|
|
1525
|
+
style: {
|
|
1526
|
+
...Xe,
|
|
1527
|
+
resize: "vertical"
|
|
1528
|
+
}
|
|
1529
|
+
}) : e.type === "select" ? /* @__PURE__ */ l("select", {
|
|
1530
|
+
...a,
|
|
1531
|
+
children: [/* @__PURE__ */ c("option", {
|
|
1532
|
+
value: "",
|
|
1533
|
+
children: e.placeholder || "—"
|
|
1534
|
+
}), (e.options ?? []).map((e, t) => /* @__PURE__ */ c("option", {
|
|
1535
|
+
value: typeof e == "string" ? e : e.value,
|
|
1536
|
+
children: typeof e == "string" ? e : e.label ?? e.value
|
|
1537
|
+
}, t))]
|
|
1538
|
+
}) : e.type === "checkbox" ? /* @__PURE__ */ c("input", {
|
|
1539
|
+
type: "checkbox",
|
|
1540
|
+
name: e.name,
|
|
1541
|
+
required: e.required || void 0,
|
|
1542
|
+
disabled: r || void 0,
|
|
1543
|
+
checked: !!t,
|
|
1544
|
+
onChange: (t) => n(e.name, t.target.checked),
|
|
1545
|
+
style: {
|
|
1546
|
+
width: 18,
|
|
1547
|
+
height: 18
|
|
1548
|
+
}
|
|
1549
|
+
}) : e.type === "upload" ? /* @__PURE__ */ c("input", {
|
|
1550
|
+
type: "file",
|
|
1551
|
+
name: e.name,
|
|
1552
|
+
accept: e.accept || void 0,
|
|
1553
|
+
required: e.required || void 0,
|
|
1554
|
+
disabled: r || void 0,
|
|
1555
|
+
onChange: (t) => n(e.name, t.target.files?.[0]?.name ?? ""),
|
|
1556
|
+
style: {
|
|
1557
|
+
font: "inherit",
|
|
1558
|
+
fontSize: 14
|
|
1559
|
+
}
|
|
1560
|
+
}) : /* @__PURE__ */ c("input", {
|
|
1561
|
+
...a,
|
|
1562
|
+
type: {
|
|
1563
|
+
email: "email",
|
|
1564
|
+
number: "number",
|
|
1565
|
+
date: "date",
|
|
1566
|
+
datetime: "datetime-local",
|
|
1567
|
+
phone: "tel",
|
|
1568
|
+
link: "url"
|
|
1569
|
+
}[e.type] ?? "text"
|
|
1570
|
+
}),
|
|
1571
|
+
e.help && /* @__PURE__ */ c("span", {
|
|
1572
|
+
style: {
|
|
1573
|
+
fontSize: 12,
|
|
1574
|
+
opacity: .65
|
|
1575
|
+
},
|
|
1576
|
+
children: e.help
|
|
1577
|
+
})
|
|
1578
|
+
]
|
|
1579
|
+
});
|
|
1580
|
+
}
|
|
1581
|
+
function Qe({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: v, show: y }) {
|
|
1582
|
+
let { tenant: b, apiUrl: x } = r(B), [S, C] = o("form"), [w, T] = o(null), [E, D] = o({}), [O, k] = o(0), A = h ? y || "form" : S;
|
|
1583
|
+
i(() => {
|
|
1584
|
+
if (!f || !d) return;
|
|
1585
|
+
let e = !0;
|
|
1586
|
+
return fetch(`${x || "/api"}/forms/${encodeURIComponent(d)}`, { headers: b ? { "x-tenant": b } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload ?? null)).catch(() => e && T(null)), () => {
|
|
1587
|
+
e = !1;
|
|
1588
|
+
};
|
|
1589
|
+
}, [
|
|
1590
|
+
f,
|
|
1591
|
+
d,
|
|
1592
|
+
b,
|
|
1593
|
+
x
|
|
1594
|
+
]);
|
|
1595
|
+
let j = [{
|
|
1596
|
+
section: null,
|
|
1597
|
+
fields: []
|
|
1598
|
+
}];
|
|
1599
|
+
for (let e of w?.fields ?? []) e.type === "section" ? j.push({
|
|
1600
|
+
section: e,
|
|
1601
|
+
fields: []
|
|
1602
|
+
}) : j[j.length - 1].fields.push(e);
|
|
1603
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Je(e.section.condition, E)).map((e) => ({
|
|
1604
|
+
...e,
|
|
1605
|
+
fields: e.fields.filter((e) => Je(e.condition, E))
|
|
1606
|
+
})), 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) => {
|
|
1607
|
+
let t = E[e.name];
|
|
1608
|
+
return e.required && (t == null || t === "" || t === !1);
|
|
1609
|
+
}), R = F >= N.length - 1, z = (e, t) => D((n) => ({
|
|
1610
|
+
...n,
|
|
1611
|
+
[e]: t
|
|
1612
|
+
}));
|
|
1415
1613
|
return /* @__PURE__ */ l("div", {
|
|
1416
|
-
ref:
|
|
1614
|
+
ref: m,
|
|
1417
1615
|
style: _(e),
|
|
1418
1616
|
children: [
|
|
1419
1617
|
/* @__PURE__ */ c("form", {
|
|
1420
1618
|
action: t || void 0,
|
|
1421
1619
|
method: n || "post",
|
|
1422
|
-
name:
|
|
1423
|
-
encType:
|
|
1620
|
+
name: a || void 0,
|
|
1621
|
+
encType: u || void 0,
|
|
1424
1622
|
onSubmit: async (e) => {
|
|
1425
|
-
if (e.preventDefault(), !
|
|
1426
|
-
if (
|
|
1623
|
+
if (e.preventDefault(), !h) {
|
|
1624
|
+
if (d) {
|
|
1427
1625
|
let t = {};
|
|
1428
|
-
for (let [
|
|
1626
|
+
if (f) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
|
|
1627
|
+
else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
|
|
1429
1628
|
try {
|
|
1430
|
-
let e = await fetch(`${
|
|
1629
|
+
let e = await fetch(`${x || "/api"}/forms/${d}/submit`, {
|
|
1431
1630
|
method: "post",
|
|
1432
1631
|
headers: {
|
|
1433
1632
|
"content-type": "application/json",
|
|
1434
|
-
...
|
|
1633
|
+
...b ? { "x-tenant": b } : {}
|
|
1435
1634
|
},
|
|
1436
1635
|
body: JSON.stringify(t)
|
|
1437
1636
|
}), n = await e.json().catch(() => null);
|
|
1438
|
-
|
|
1637
|
+
C(e.ok && n?.success !== !1 ? "success" : "error");
|
|
1439
1638
|
} catch {
|
|
1440
|
-
|
|
1639
|
+
C("error");
|
|
1441
1640
|
}
|
|
1442
1641
|
return;
|
|
1443
1642
|
}
|
|
1444
1643
|
if (!t) {
|
|
1445
|
-
|
|
1644
|
+
C("success");
|
|
1446
1645
|
return;
|
|
1447
1646
|
}
|
|
1448
1647
|
try {
|
|
@@ -1450,43 +1649,113 @@ function Je({ style: e, action: t, method: n, name: i, enctype: a, formSlug: s,
|
|
|
1450
1649
|
method: n || "post",
|
|
1451
1650
|
body: new FormData(e.currentTarget)
|
|
1452
1651
|
});
|
|
1453
|
-
|
|
1652
|
+
C(r.ok ? "success" : "error");
|
|
1454
1653
|
} catch {
|
|
1455
|
-
|
|
1654
|
+
C("error");
|
|
1456
1655
|
}
|
|
1457
1656
|
}
|
|
1458
1657
|
},
|
|
1459
1658
|
style: {
|
|
1460
|
-
...
|
|
1461
|
-
display:
|
|
1659
|
+
...Ue,
|
|
1660
|
+
display: A === "success" ? "none" : "flex"
|
|
1462
1661
|
},
|
|
1463
|
-
children: f
|
|
1662
|
+
children: f && d ? /* @__PURE__ */ l(s, { children: [
|
|
1663
|
+
P && /* @__PURE__ */ c(ut, {
|
|
1664
|
+
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
1665
|
+
active: F + 1,
|
|
1666
|
+
style: { marginBottom: 8 }
|
|
1667
|
+
}),
|
|
1668
|
+
P && N[F]?.section?.help && /* @__PURE__ */ c("p", {
|
|
1669
|
+
style: {
|
|
1670
|
+
margin: 0,
|
|
1671
|
+
fontSize: 14,
|
|
1672
|
+
opacity: .7
|
|
1673
|
+
},
|
|
1674
|
+
children: N[F].section.help
|
|
1675
|
+
}),
|
|
1676
|
+
I.map((e) => /* @__PURE__ */ c(Ze, {
|
|
1677
|
+
field: e,
|
|
1678
|
+
value: E[e.name],
|
|
1679
|
+
onChange: z,
|
|
1680
|
+
inert: h
|
|
1681
|
+
}, e.name)),
|
|
1682
|
+
/* @__PURE__ */ l("div", {
|
|
1683
|
+
style: {
|
|
1684
|
+
display: "flex",
|
|
1685
|
+
gap: 10,
|
|
1686
|
+
alignItems: "center",
|
|
1687
|
+
marginTop: 4
|
|
1688
|
+
},
|
|
1689
|
+
children: [P && F > 0 && /* @__PURE__ */ c("button", {
|
|
1690
|
+
type: "button",
|
|
1691
|
+
disabled: h || void 0,
|
|
1692
|
+
onClick: () => k(F - 1),
|
|
1693
|
+
style: {
|
|
1694
|
+
...K,
|
|
1695
|
+
background: "transparent",
|
|
1696
|
+
color: "inherit",
|
|
1697
|
+
border: 0,
|
|
1698
|
+
padding: "10px 16px",
|
|
1699
|
+
cursor: "pointer"
|
|
1700
|
+
},
|
|
1701
|
+
children: "Back"
|
|
1702
|
+
}), P && !R ? /* @__PURE__ */ c("button", {
|
|
1703
|
+
type: "button",
|
|
1704
|
+
disabled: h || L.length > 0,
|
|
1705
|
+
onClick: () => k(F + 1),
|
|
1706
|
+
style: {
|
|
1707
|
+
...K,
|
|
1708
|
+
border: 0,
|
|
1709
|
+
padding: "10px 22px",
|
|
1710
|
+
borderRadius: 8,
|
|
1711
|
+
fontSize: 15,
|
|
1712
|
+
fontWeight: 600,
|
|
1713
|
+
cursor: "pointer",
|
|
1714
|
+
opacity: L.length ? .5 : 1
|
|
1715
|
+
},
|
|
1716
|
+
children: "Next"
|
|
1717
|
+
}) : /* @__PURE__ */ c("button", {
|
|
1718
|
+
type: "submit",
|
|
1719
|
+
disabled: h || void 0,
|
|
1720
|
+
style: {
|
|
1721
|
+
...K,
|
|
1722
|
+
border: 0,
|
|
1723
|
+
padding: "10px 22px",
|
|
1724
|
+
borderRadius: 8,
|
|
1725
|
+
fontSize: 15,
|
|
1726
|
+
fontWeight: 600,
|
|
1727
|
+
cursor: "pointer"
|
|
1728
|
+
},
|
|
1729
|
+
children: p || "Submit"
|
|
1730
|
+
})]
|
|
1731
|
+
})
|
|
1732
|
+
] }) : g
|
|
1464
1733
|
}),
|
|
1465
1734
|
/* @__PURE__ */ c("div", {
|
|
1466
|
-
style: { display:
|
|
1467
|
-
children:
|
|
1735
|
+
style: { display: A === "success" ? "block" : "none" },
|
|
1736
|
+
children: v?.success ?? null
|
|
1468
1737
|
}),
|
|
1469
1738
|
/* @__PURE__ */ c("div", {
|
|
1470
1739
|
style: {
|
|
1471
|
-
display:
|
|
1740
|
+
display: A === "error" ? "block" : "none",
|
|
1472
1741
|
marginTop: 12
|
|
1473
1742
|
},
|
|
1474
|
-
children:
|
|
1743
|
+
children: v?.error ?? null
|
|
1475
1744
|
})
|
|
1476
1745
|
]
|
|
1477
1746
|
});
|
|
1478
1747
|
}
|
|
1479
|
-
function
|
|
1748
|
+
function $e({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
1480
1749
|
return /* @__PURE__ */ c("label", {
|
|
1481
1750
|
ref: r,
|
|
1482
1751
|
style: {
|
|
1483
|
-
...
|
|
1752
|
+
...We,
|
|
1484
1753
|
..._(n)
|
|
1485
1754
|
},
|
|
1486
|
-
children:
|
|
1755
|
+
children: X(t, e, i)
|
|
1487
1756
|
});
|
|
1488
1757
|
}
|
|
1489
|
-
function
|
|
1758
|
+
function et({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1490
1759
|
return /* @__PURE__ */ c("input", {
|
|
1491
1760
|
ref: a,
|
|
1492
1761
|
type: e,
|
|
@@ -1494,13 +1763,13 @@ function Xe({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
1494
1763
|
placeholder: n,
|
|
1495
1764
|
required: !o && !!r,
|
|
1496
1765
|
style: {
|
|
1497
|
-
...
|
|
1766
|
+
...Ge,
|
|
1498
1767
|
..._(i)
|
|
1499
1768
|
},
|
|
1500
1769
|
...qe(o)
|
|
1501
1770
|
});
|
|
1502
1771
|
}
|
|
1503
|
-
function
|
|
1772
|
+
function tt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
1504
1773
|
return /* @__PURE__ */ c("textarea", {
|
|
1505
1774
|
ref: a,
|
|
1506
1775
|
name: e || void 0,
|
|
@@ -1508,14 +1777,14 @@ function Ze({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
1508
1777
|
rows: n,
|
|
1509
1778
|
required: !o && !!r,
|
|
1510
1779
|
style: {
|
|
1511
|
-
...
|
|
1780
|
+
...Ge,
|
|
1512
1781
|
resize: "vertical",
|
|
1513
1782
|
..._(i)
|
|
1514
1783
|
},
|
|
1515
1784
|
...qe(o)
|
|
1516
1785
|
});
|
|
1517
1786
|
}
|
|
1518
|
-
function
|
|
1787
|
+
function nt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
1519
1788
|
return /* @__PURE__ */ l("label", {
|
|
1520
1789
|
ref: o,
|
|
1521
1790
|
style: {
|
|
@@ -1536,7 +1805,7 @@ function Qe({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
1536
1805
|
}), t]
|
|
1537
1806
|
});
|
|
1538
1807
|
}
|
|
1539
|
-
function
|
|
1808
|
+
function rt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
1540
1809
|
return /* @__PURE__ */ l("select", {
|
|
1541
1810
|
ref: a,
|
|
1542
1811
|
name: e || void 0,
|
|
@@ -1545,7 +1814,7 @@ function $e({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
1545
1814
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
1546
1815
|
tabIndex: o ? -1 : void 0,
|
|
1547
1816
|
style: {
|
|
1548
|
-
...
|
|
1817
|
+
...Ge,
|
|
1549
1818
|
appearance: "auto",
|
|
1550
1819
|
..._(i)
|
|
1551
1820
|
},
|
|
@@ -1559,12 +1828,12 @@ function $e({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
1559
1828
|
}, t))]
|
|
1560
1829
|
});
|
|
1561
1830
|
}
|
|
1562
|
-
function
|
|
1831
|
+
function it({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
|
|
1563
1832
|
let [u, d] = o(null);
|
|
1564
1833
|
return /* @__PURE__ */ l("label", {
|
|
1565
1834
|
ref: a,
|
|
1566
1835
|
style: {
|
|
1567
|
-
...
|
|
1836
|
+
...Ge,
|
|
1568
1837
|
display: "flex",
|
|
1569
1838
|
alignItems: "center",
|
|
1570
1839
|
gap: "8px",
|
|
@@ -1591,12 +1860,12 @@ function et({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
1591
1860
|
]
|
|
1592
1861
|
});
|
|
1593
1862
|
}
|
|
1594
|
-
function
|
|
1863
|
+
function at({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
1595
1864
|
return /* @__PURE__ */ c("button", {
|
|
1596
1865
|
ref: n,
|
|
1597
1866
|
type: r ? "button" : "submit",
|
|
1598
1867
|
style: {
|
|
1599
|
-
...
|
|
1868
|
+
...K,
|
|
1600
1869
|
border: 0,
|
|
1601
1870
|
cursor: "pointer",
|
|
1602
1871
|
alignSelf: "flex-start",
|
|
@@ -1611,7 +1880,7 @@ function tt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
1611
1880
|
children: e
|
|
1612
1881
|
});
|
|
1613
1882
|
}
|
|
1614
|
-
function
|
|
1883
|
+
function ot({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
1615
1884
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
1616
1885
|
return /* @__PURE__ */ c("div", {
|
|
1617
1886
|
ref: r,
|
|
@@ -1628,8 +1897,8 @@ function nt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
1628
1897
|
}, t))
|
|
1629
1898
|
});
|
|
1630
1899
|
}
|
|
1631
|
-
function
|
|
1632
|
-
let { tenant: g, apiUrl: v } = r(
|
|
1900
|
+
function st({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: s, titleField: u = "name", textField: d, custom: f, templateId: p, style: m, nodeRef: h }) {
|
|
1901
|
+
let { tenant: g, apiUrl: v } = r(B), y = r(H), b = r(V)?.[e], [x, S] = o(null);
|
|
1633
1902
|
if (i(() => {
|
|
1634
1903
|
if (!e || b) return;
|
|
1635
1904
|
let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}`;
|
|
@@ -1717,7 +1986,7 @@ function rt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
1717
1986
|
lineHeight: 1.55,
|
|
1718
1987
|
opacity: .85
|
|
1719
1988
|
},
|
|
1720
|
-
children:
|
|
1989
|
+
children: he(a)
|
|
1721
1990
|
})
|
|
1722
1991
|
]
|
|
1723
1992
|
})]
|
|
@@ -1725,7 +1994,7 @@ function rt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
1725
1994
|
})
|
|
1726
1995
|
});
|
|
1727
1996
|
}
|
|
1728
|
-
function
|
|
1997
|
+
function ct({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
1729
1998
|
return e.length ? /* @__PURE__ */ c("nav", {
|
|
1730
1999
|
ref: r,
|
|
1731
2000
|
"aria-label": "Breadcrumb",
|
|
@@ -1775,7 +2044,7 @@ function it({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
1775
2044
|
})
|
|
1776
2045
|
}) : null;
|
|
1777
2046
|
}
|
|
1778
|
-
function
|
|
2047
|
+
function lt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
|
|
1779
2048
|
let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), u = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", d = (e) => ({
|
|
1780
2049
|
display: "inline-flex",
|
|
1781
2050
|
alignItems: "center",
|
|
@@ -1828,7 +2097,7 @@ function at({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
|
|
|
1828
2097
|
]
|
|
1829
2098
|
});
|
|
1830
2099
|
}
|
|
1831
|
-
function
|
|
2100
|
+
function ut({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
1832
2101
|
if (!e.length) return null;
|
|
1833
2102
|
let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
|
|
1834
2103
|
width: 32,
|
|
@@ -1906,91 +2175,103 @@ function ot({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
1906
2175
|
})
|
|
1907
2176
|
});
|
|
1908
2177
|
}
|
|
1909
|
-
function
|
|
1910
|
-
|
|
1911
|
-
|
|
2178
|
+
function dt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: s = !0, bordered: u = !1, compact: d = !1, style: f, nodeRef: p }) {
|
|
2179
|
+
let { tenant: m, apiUrl: h } = r(B), g = r(V)?.[n], [v, y] = o(null);
|
|
2180
|
+
if (i(() => {
|
|
2181
|
+
if (!n || g) return;
|
|
2182
|
+
let e = !0, t = n.startsWith("api:") ? `${h}/data/${encodeURIComponent(n.slice(4))}` : `${h}/dynamic/${encodeURIComponent(n)}`;
|
|
2183
|
+
return fetch(t, { headers: m ? { "x-tenant": m } : {} }).then((e) => e.json()).then((t) => e && y(Array.isArray(t?.payload) ? t.payload : [])).catch(() => e && y([])), () => {
|
|
2184
|
+
e = !1;
|
|
2185
|
+
};
|
|
2186
|
+
}, [
|
|
2187
|
+
n,
|
|
2188
|
+
m,
|
|
2189
|
+
h,
|
|
2190
|
+
g
|
|
2191
|
+
]), !e.length) return null;
|
|
2192
|
+
let b = n ? (g ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => W(U(t?.data, e.field)))) : t, S = d ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = u ? { border: C } : { borderBottom: C };
|
|
1912
2193
|
return /* @__PURE__ */ c("div", {
|
|
1913
|
-
ref:
|
|
2194
|
+
ref: p,
|
|
1914
2195
|
style: {
|
|
1915
2196
|
width: "100%",
|
|
1916
2197
|
overflowX: "auto",
|
|
1917
|
-
..._(
|
|
2198
|
+
..._(f)
|
|
1918
2199
|
},
|
|
1919
2200
|
children: /* @__PURE__ */ l("table", {
|
|
1920
2201
|
style: {
|
|
1921
2202
|
width: "100%",
|
|
1922
2203
|
borderCollapse: "collapse",
|
|
1923
2204
|
fontSize: 14,
|
|
1924
|
-
...
|
|
2205
|
+
...u ? { border: C } : {}
|
|
1925
2206
|
},
|
|
1926
2207
|
children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: e.map((e, t) => /* @__PURE__ */ c("th", {
|
|
1927
2208
|
style: {
|
|
1928
2209
|
textAlign: "left",
|
|
1929
2210
|
fontWeight: 600,
|
|
1930
|
-
padding:
|
|
2211
|
+
padding: S,
|
|
1931
2212
|
background: "rgba(148, 163, 184, 0.12)",
|
|
1932
|
-
...
|
|
2213
|
+
...w
|
|
1933
2214
|
},
|
|
1934
2215
|
children: e.label ?? e
|
|
1935
|
-
}, t)) }) }), /* @__PURE__ */ c("tbody", { children:
|
|
1936
|
-
style:
|
|
2216
|
+
}, t)) }) }), /* @__PURE__ */ c("tbody", { children: x.map((t, n) => /* @__PURE__ */ c("tr", {
|
|
2217
|
+
style: s && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
|
|
1937
2218
|
children: e.map((e, n) => /* @__PURE__ */ c("td", {
|
|
1938
2219
|
style: {
|
|
1939
|
-
padding:
|
|
1940
|
-
...
|
|
2220
|
+
padding: S,
|
|
2221
|
+
...w
|
|
1941
2222
|
},
|
|
1942
2223
|
children: t?.[n] ?? ""
|
|
1943
2224
|
}, n))
|
|
1944
|
-
},
|
|
2225
|
+
}, n)) })]
|
|
1945
2226
|
})
|
|
1946
2227
|
});
|
|
1947
2228
|
}
|
|
1948
|
-
var
|
|
1949
|
-
PageRoot:
|
|
1950
|
-
Section:
|
|
1951
|
-
Container:
|
|
1952
|
-
Heading:
|
|
1953
|
-
TextBlock:
|
|
1954
|
-
ButtonBlock:
|
|
1955
|
-
ImageBlock:
|
|
1956
|
-
Spacer:
|
|
1957
|
-
Divider:
|
|
1958
|
-
SliderBlock:
|
|
1959
|
-
CanvasSlider:
|
|
1960
|
-
TabsBlock:
|
|
1961
|
-
QuickStack:
|
|
1962
|
-
CollectionList:
|
|
1963
|
-
BreadcrumbsBlock:
|
|
1964
|
-
PaginationBlock:
|
|
1965
|
-
StepperBlock:
|
|
1966
|
-
TableBlock:
|
|
1967
|
-
AccordionBlock:
|
|
1968
|
-
NavbarBlock:
|
|
1969
|
-
ListBlock:
|
|
1970
|
-
TextSpan:
|
|
1971
|
-
QuoteBlock:
|
|
1972
|
-
TextLink:
|
|
1973
|
-
RichTextBlock:
|
|
1974
|
-
RichContentBlock:
|
|
1975
|
-
VideoBlock:
|
|
1976
|
-
YouTubeBlock:
|
|
1977
|
-
IframeBlock:
|
|
1978
|
-
EmbedBlock:
|
|
1979
|
-
FormBlock:
|
|
1980
|
-
FormLabel:
|
|
1981
|
-
FormInput:
|
|
1982
|
-
FormTextarea:
|
|
1983
|
-
FormCheckbox: (e) => /* @__PURE__ */ c(
|
|
2229
|
+
var ft = {
|
|
2230
|
+
PageRoot: oe,
|
|
2231
|
+
Section: se,
|
|
2232
|
+
Container: ce,
|
|
2233
|
+
Heading: le,
|
|
2234
|
+
TextBlock: be,
|
|
2235
|
+
ButtonBlock: Ce,
|
|
2236
|
+
ImageBlock: we,
|
|
2237
|
+
Spacer: Ae,
|
|
2238
|
+
Divider: je,
|
|
2239
|
+
SliderBlock: Le,
|
|
2240
|
+
CanvasSlider: Re,
|
|
2241
|
+
TabsBlock: Ve,
|
|
2242
|
+
QuickStack: ot,
|
|
2243
|
+
CollectionList: st,
|
|
2244
|
+
BreadcrumbsBlock: ct,
|
|
2245
|
+
PaginationBlock: lt,
|
|
2246
|
+
StepperBlock: ut,
|
|
2247
|
+
TableBlock: dt,
|
|
2248
|
+
AccordionBlock: He,
|
|
2249
|
+
NavbarBlock: Be,
|
|
2250
|
+
ListBlock: ye,
|
|
2251
|
+
TextSpan: fe,
|
|
2252
|
+
QuoteBlock: ve,
|
|
2253
|
+
TextLink: Se,
|
|
2254
|
+
RichTextBlock: ge,
|
|
2255
|
+
RichContentBlock: ge,
|
|
2256
|
+
VideoBlock: Te,
|
|
2257
|
+
YouTubeBlock: De,
|
|
2258
|
+
IframeBlock: Oe,
|
|
2259
|
+
EmbedBlock: ke,
|
|
2260
|
+
FormBlock: Qe,
|
|
2261
|
+
FormLabel: $e,
|
|
2262
|
+
FormInput: et,
|
|
2263
|
+
FormTextarea: tt,
|
|
2264
|
+
FormCheckbox: (e) => /* @__PURE__ */ c(nt, {
|
|
1984
2265
|
kind: "checkbox",
|
|
1985
2266
|
...e
|
|
1986
2267
|
}),
|
|
1987
|
-
FormRadio: (e) => /* @__PURE__ */ c(
|
|
2268
|
+
FormRadio: (e) => /* @__PURE__ */ c(nt, {
|
|
1988
2269
|
kind: "radio",
|
|
1989
2270
|
...e
|
|
1990
2271
|
}),
|
|
1991
|
-
FormSelect:
|
|
1992
|
-
FormFile:
|
|
1993
|
-
FormSubmit:
|
|
2272
|
+
FormSelect: rt,
|
|
2273
|
+
FormFile: it,
|
|
2274
|
+
FormSubmit: at
|
|
1994
2275
|
};
|
|
1995
2276
|
//#endregion
|
|
1996
2277
|
//#region ../ui/src/components/builder/render.jsx
|
|
@@ -2004,7 +2285,7 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
2004
2285
|
let l = new Set(i).add(n);
|
|
2005
2286
|
return /* @__PURE__ */ c(t, { children: Q(s.template.rootId, s.template.nodes, r, l, a) }, e);
|
|
2006
2287
|
}
|
|
2007
|
-
let u =
|
|
2288
|
+
let u = ft[s];
|
|
2008
2289
|
if (!u) return null;
|
|
2009
2290
|
let d = (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;
|
|
2010
2291
|
return /* @__PURE__ */ c(u, {
|
|
@@ -2019,8 +2300,8 @@ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
2019
2300
|
}
|
|
2020
2301
|
//#endregion
|
|
2021
2302
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
2022
|
-
var
|
|
2023
|
-
function
|
|
2303
|
+
var pt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
|
|
2304
|
+
function mt({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, custom: s, tenant: u, apiUrl: f, datasets: m }) {
|
|
2024
2305
|
let h = s?.js?.trim();
|
|
2025
2306
|
if (i(() => {
|
|
2026
2307
|
if (!h) return;
|
|
@@ -2031,24 +2312,24 @@ function ut({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, cu
|
|
|
2031
2312
|
minHeight: "100%",
|
|
2032
2313
|
display: "flex",
|
|
2033
2314
|
flexDirection: "column"
|
|
2034
|
-
}, _ = Q("ROOT", e, n), v = a(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), y =
|
|
2315
|
+
}, _ = Q("ROOT", e, n), v = a(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), y = k(e, n), b = O(e, n), x = s?.css?.trim(), S = p(e, n).map((e) => /* @__PURE__ */ c("link", {
|
|
2035
2316
|
rel: "stylesheet",
|
|
2036
2317
|
precedence: "default",
|
|
2037
2318
|
href: d(e)
|
|
2038
2319
|
}, e));
|
|
2039
|
-
if (r !== "auto") return /* @__PURE__ */ c(
|
|
2320
|
+
if (r !== "auto") return /* @__PURE__ */ c(B.Provider, {
|
|
2040
2321
|
value: {
|
|
2041
2322
|
tenant: u || "",
|
|
2042
2323
|
apiUrl: f || "/api"
|
|
2043
2324
|
},
|
|
2044
|
-
children: /* @__PURE__ */ c(
|
|
2325
|
+
children: /* @__PURE__ */ c(V.Provider, {
|
|
2045
2326
|
value: m ?? null,
|
|
2046
|
-
children: /* @__PURE__ */ c(
|
|
2327
|
+
children: /* @__PURE__ */ c(H.Provider, {
|
|
2047
2328
|
value: v,
|
|
2048
2329
|
children: /* @__PURE__ */ l("div", {
|
|
2049
2330
|
style: {
|
|
2050
2331
|
...g,
|
|
2051
|
-
...
|
|
2332
|
+
...z(t, r),
|
|
2052
2333
|
...o
|
|
2053
2334
|
},
|
|
2054
2335
|
children: [
|
|
@@ -2062,26 +2343,26 @@ function ut({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, cu
|
|
|
2062
2343
|
})
|
|
2063
2344
|
})
|
|
2064
2345
|
});
|
|
2065
|
-
let C =
|
|
2066
|
-
return /* @__PURE__ */ c(
|
|
2346
|
+
let C = I(t);
|
|
2347
|
+
return /* @__PURE__ */ c(B.Provider, {
|
|
2067
2348
|
value: {
|
|
2068
2349
|
tenant: u || "",
|
|
2069
2350
|
apiUrl: f || "/api"
|
|
2070
2351
|
},
|
|
2071
|
-
children: /* @__PURE__ */ c(
|
|
2352
|
+
children: /* @__PURE__ */ c(V.Provider, {
|
|
2072
2353
|
value: m ?? null,
|
|
2073
|
-
children: /* @__PURE__ */ c(
|
|
2354
|
+
children: /* @__PURE__ */ c(H.Provider, {
|
|
2074
2355
|
value: v,
|
|
2075
2356
|
children: /* @__PURE__ */ l("div", {
|
|
2076
2357
|
className: "webim-page",
|
|
2077
2358
|
style: {
|
|
2078
2359
|
...g,
|
|
2079
|
-
...
|
|
2360
|
+
...R(t),
|
|
2080
2361
|
...o
|
|
2081
2362
|
},
|
|
2082
2363
|
children: [
|
|
2083
|
-
/* @__PURE__ */ c("style", { children: `.webim-page { ${
|
|
2084
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
2364
|
+
/* @__PURE__ */ c("style", { children: `.webim-page { ${pt(L(C.light))} }
|
|
2365
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${pt(L(C.dark))} } }` }),
|
|
2085
2366
|
S,
|
|
2086
2367
|
y && /* @__PURE__ */ c("style", { children: y }),
|
|
2087
2368
|
b && /* @__PURE__ */ c("style", { children: b }),
|
|
@@ -2095,8 +2376,8 @@ function ut({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, cu
|
|
|
2095
2376
|
}
|
|
2096
2377
|
//#endregion
|
|
2097
2378
|
//#region src/WebimContent.jsx
|
|
2098
|
-
function
|
|
2099
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ c(
|
|
2379
|
+
function ht({ bundle: e, mode: t = "auto", style: n }) {
|
|
2380
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ c(mt, {
|
|
2100
2381
|
blocks: e.blocks,
|
|
2101
2382
|
theme: e.theme,
|
|
2102
2383
|
components: e.components,
|
|
@@ -2110,7 +2391,7 @@ function dt({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
2110
2391
|
}
|
|
2111
2392
|
//#endregion
|
|
2112
2393
|
//#region src/bundle.js
|
|
2113
|
-
function
|
|
2394
|
+
function gt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
2114
2395
|
let a = {
|
|
2115
2396
|
...t?.global ?? {},
|
|
2116
2397
|
...t?.tenant ?? {}
|
|
@@ -2120,7 +2401,7 @@ function ft({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
2120
2401
|
title: e.title,
|
|
2121
2402
|
slug: e.slug,
|
|
2122
2403
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
2123
|
-
theme:
|
|
2404
|
+
theme: ee(o, a.builder_themes?.themes),
|
|
2124
2405
|
components: a.builder_components?.components ?? {},
|
|
2125
2406
|
custom: o.custom,
|
|
2126
2407
|
seo: o.seo,
|
|
@@ -2131,23 +2412,23 @@ function ft({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
2131
2412
|
}
|
|
2132
2413
|
//#endregion
|
|
2133
2414
|
//#region src/fetchPage.js
|
|
2134
|
-
var
|
|
2415
|
+
var _t = async (e) => {
|
|
2135
2416
|
let t = await e.json().catch(() => null);
|
|
2136
2417
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
2137
2418
|
return t?.payload ?? t;
|
|
2138
2419
|
};
|
|
2139
|
-
async function
|
|
2420
|
+
async function vt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
|
|
2140
2421
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
2141
2422
|
if (!n) throw Error("fetchPage: slug is required");
|
|
2142
|
-
let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(
|
|
2423
|
+
let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(_t), o(`${s}/settings/public`, { headers: c }).then(_t)]), d = gt({
|
|
2143
2424
|
page: l,
|
|
2144
2425
|
settings: u,
|
|
2145
2426
|
tenant: t,
|
|
2146
2427
|
apiUrl: s,
|
|
2147
2428
|
locale: r
|
|
2148
|
-
}), f = [...new Set(Object.values(d.blocks ?? {}).
|
|
2429
|
+
}), f = [...new Set(Object.values(d.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" ? e.props?.source : null).filter(Boolean))];
|
|
2149
2430
|
if (f.length) {
|
|
2150
|
-
let e = (e) => e.startsWith("api:") ? `${s}/data/${encodeURIComponent(e.slice(4))}` : `${s}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(f.map((t) => o(e(t), { headers: c }).then(
|
|
2431
|
+
let e = (e) => e.startsWith("api:") ? `${s}/data/${encodeURIComponent(e.slice(4))}` : `${s}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(f.map((t) => o(e(t), { headers: c }).then(_t).then((e) => [t, Array.isArray(e) ? e : []]).catch(() => [t, []])));
|
|
2151
2432
|
d.datasets = Object.fromEntries(t);
|
|
2152
2433
|
}
|
|
2153
2434
|
return d;
|
|
@@ -2160,14 +2441,14 @@ var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
|
|
|
2160
2441
|
">": ">",
|
|
2161
2442
|
"\"": """
|
|
2162
2443
|
})[e]);
|
|
2163
|
-
function
|
|
2164
|
-
return e(/* @__PURE__ */ c(
|
|
2444
|
+
function yt(t, { mode: n = "auto", style: r } = {}) {
|
|
2445
|
+
return e(/* @__PURE__ */ c(ht, {
|
|
2165
2446
|
bundle: t,
|
|
2166
2447
|
mode: n,
|
|
2167
2448
|
style: r
|
|
2168
2449
|
}));
|
|
2169
2450
|
}
|
|
2170
|
-
function
|
|
2451
|
+
function bt(e, { mode: t = "auto", lang: n = "en" } = {}) {
|
|
2171
2452
|
let r = e.seo ?? {}, i = r.title || e.title || e.slug || "Page", a = e.custom?.js?.trim(), o = [
|
|
2172
2453
|
"<meta charset=\"utf-8\"/>",
|
|
2173
2454
|
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
|
|
@@ -2184,10 +2465,10 @@ function gt(e, { mode: t = "auto", lang: n = "en" } = {}) {
|
|
|
2184
2465
|
${o}
|
|
2185
2466
|
</head>
|
|
2186
2467
|
<body>
|
|
2187
|
-
${
|
|
2468
|
+
${yt(e, { mode: t })}
|
|
2188
2469
|
${a ? `<script>${a.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
|
|
2189
2470
|
</body>
|
|
2190
2471
|
</html>`;
|
|
2191
2472
|
}
|
|
2192
2473
|
//#endregion
|
|
2193
|
-
export {
|
|
2474
|
+
export { gt as assembleBundle, vt as fetchPage, yt as renderBundleHtml, bt as renderPageDocument };
|