webim-adapter 0.13.0 → 0.15.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 +261 -176
- package/build/webim-embed.js +4 -4
- package/build/webim-ssr.js +131 -46
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -60,24 +60,24 @@ function h(e) {
|
|
|
60
60
|
delete t.clipText, oe && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
61
61
|
let { transitions: se, transitionDuration: V, transitionEasing: H, transitionProperty: U } = t, W = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
62
62
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
63
|
-
let
|
|
64
|
-
if (V !== void 0 &&
|
|
63
|
+
let ce = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${W(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
64
|
+
if (V !== void 0 && ce.push(`${U || "all"} ${W(V)} ${H || "ease"}`), ce.length && (t.transition = ce.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
65
65
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
|
|
66
66
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
67
67
|
}
|
|
68
68
|
delete t.backgroundVideo;
|
|
69
|
-
let { overlayColor:
|
|
70
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
71
|
-
let e = `color-mix(in srgb, ${
|
|
69
|
+
let { overlayColor: G, overlayOpacity: le } = t;
|
|
70
|
+
if (delete t.overlayColor, delete t.overlayOpacity, G) {
|
|
71
|
+
let e = `color-mix(in srgb, ${G} ${le ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
72
72
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
73
73
|
}
|
|
74
74
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
75
|
-
let { backgroundLayers:
|
|
75
|
+
let { backgroundLayers: K } = t;
|
|
76
76
|
delete t.backgroundLayers;
|
|
77
|
-
let
|
|
78
|
-
if (
|
|
77
|
+
let ue = (Array.isArray(K) ? K : []).filter((e) => e && e.on !== !1);
|
|
78
|
+
if (ue.length) {
|
|
79
79
|
let e = [], n = [], r = [], i = [], a = [];
|
|
80
|
-
for (let t of
|
|
80
|
+
for (let t of ue) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
81
81
|
else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
82
82
|
else {
|
|
83
83
|
if (!t.src) continue;
|
|
@@ -492,11 +492,11 @@ var ae = /* @__PURE__ */ new Set([
|
|
|
492
492
|
if (typeof window > "u") return 1;
|
|
493
493
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
494
494
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
495
|
-
}, W = t(null),
|
|
496
|
-
function
|
|
495
|
+
}, W = t(null), ce = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
496
|
+
function G(e, t) {
|
|
497
497
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
498
498
|
}
|
|
499
|
-
var
|
|
499
|
+
var le = (e) => {
|
|
500
500
|
let t = [];
|
|
501
501
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
502
502
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -506,36 +506,36 @@ var ce = (e) => {
|
|
|
506
506
|
}
|
|
507
507
|
return t;
|
|
508
508
|
};
|
|
509
|
-
function
|
|
509
|
+
function K(e) {
|
|
510
510
|
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(" ") : "";
|
|
511
511
|
}
|
|
512
|
-
function
|
|
513
|
-
let n = t?.data ?? {}, r =
|
|
512
|
+
function ue(e, t) {
|
|
513
|
+
let n = t?.data ?? {}, r = le(n);
|
|
514
514
|
if (!r.length) return e;
|
|
515
|
-
let i = RegExp(`:(${r.map(
|
|
515
|
+
let i = RegExp(`:(${r.map(ce).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;
|
|
516
516
|
return a(e);
|
|
517
517
|
}
|
|
518
|
-
var
|
|
518
|
+
var de = {
|
|
519
519
|
margin: 0,
|
|
520
520
|
fontWeight: 700,
|
|
521
521
|
lineHeight: 1.2,
|
|
522
522
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
523
|
-
},
|
|
523
|
+
}, fe = { margin: 0 }, q = {
|
|
524
524
|
display: "inline-block",
|
|
525
525
|
textDecoration: "none",
|
|
526
526
|
cursor: "pointer",
|
|
527
527
|
backgroundColor: "var(--page-accent, #111827)",
|
|
528
528
|
color: "var(--page-accent-text, #ffffff)"
|
|
529
|
-
},
|
|
529
|
+
}, pe = {
|
|
530
530
|
flexGrow: 1,
|
|
531
531
|
display: "flex",
|
|
532
532
|
flexDirection: "column",
|
|
533
533
|
position: "relative"
|
|
534
|
-
},
|
|
534
|
+
}, me = {
|
|
535
535
|
display: "flex",
|
|
536
536
|
flexDirection: "column"
|
|
537
537
|
};
|
|
538
|
-
function
|
|
538
|
+
function he({ style: e }) {
|
|
539
539
|
let t = e?.backgroundVideo;
|
|
540
540
|
if (!t) return null;
|
|
541
541
|
let n = {
|
|
@@ -561,7 +561,7 @@ function me({ style: e }) {
|
|
|
561
561
|
background: r
|
|
562
562
|
} })] });
|
|
563
563
|
}
|
|
564
|
-
var
|
|
564
|
+
var ge = (e, t) => e?.backgroundVideo ? {
|
|
565
565
|
position: "relative",
|
|
566
566
|
...t,
|
|
567
567
|
...h(e)
|
|
@@ -569,24 +569,24 @@ var he = (e, t) => e?.backgroundVideo ? {
|
|
|
569
569
|
...t,
|
|
570
570
|
...h(e)
|
|
571
571
|
};
|
|
572
|
-
function
|
|
572
|
+
function _e({ style: e, nodeRef: t, children: n }) {
|
|
573
573
|
return /* @__PURE__ */ d("div", {
|
|
574
574
|
ref: t,
|
|
575
575
|
style: {
|
|
576
|
-
...
|
|
576
|
+
...pe,
|
|
577
577
|
...h(e)
|
|
578
578
|
},
|
|
579
|
-
children: [/* @__PURE__ */ u(
|
|
579
|
+
children: [/* @__PURE__ */ u(he, { style: e }), n]
|
|
580
580
|
});
|
|
581
581
|
}
|
|
582
|
-
function
|
|
582
|
+
function ve({ style: e, nodeRef: t, children: n }) {
|
|
583
583
|
return /* @__PURE__ */ d("section", {
|
|
584
584
|
ref: t,
|
|
585
|
-
style:
|
|
586
|
-
children: [/* @__PURE__ */ u(
|
|
585
|
+
style: ge(e, me),
|
|
586
|
+
children: [/* @__PURE__ */ u(he, { style: e }), n]
|
|
587
587
|
});
|
|
588
588
|
}
|
|
589
|
-
function
|
|
589
|
+
function ye({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
590
590
|
let i = t ? {
|
|
591
591
|
position: "relative",
|
|
592
592
|
minHeight: 240
|
|
@@ -595,32 +595,32 @@ function ve({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
595
595
|
ref: n,
|
|
596
596
|
style: i ? {
|
|
597
597
|
...i,
|
|
598
|
-
...
|
|
599
|
-
} :
|
|
600
|
-
children: [/* @__PURE__ */ u(
|
|
598
|
+
...ge(e)
|
|
599
|
+
} : ge(e),
|
|
600
|
+
children: [/* @__PURE__ */ u(he, { style: e }), r]
|
|
601
601
|
});
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function be({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
604
604
|
return /* @__PURE__ */ u(n, {
|
|
605
605
|
ref: a,
|
|
606
606
|
style: {
|
|
607
|
-
...
|
|
607
|
+
...de,
|
|
608
608
|
...h(r)
|
|
609
609
|
},
|
|
610
|
-
children:
|
|
610
|
+
children: J(t, e, i)
|
|
611
611
|
});
|
|
612
612
|
}
|
|
613
|
-
var
|
|
613
|
+
var xe = {
|
|
614
614
|
fontFamily: j.mono.value,
|
|
615
615
|
background: "rgba(148, 163, 184, 0.18)",
|
|
616
616
|
padding: "1px 5px",
|
|
617
617
|
borderRadius: 4,
|
|
618
618
|
fontSize: "0.9em"
|
|
619
619
|
};
|
|
620
|
-
function
|
|
620
|
+
function Se(e, t = [], n, r) {
|
|
621
621
|
let i = e;
|
|
622
622
|
return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
|
|
623
|
-
style:
|
|
623
|
+
style: xe,
|
|
624
624
|
children: i
|
|
625
625
|
})), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n && (i = /* @__PURE__ */ u("a", {
|
|
626
626
|
href: n,
|
|
@@ -630,13 +630,13 @@ function xe(e, t = [], n, r) {
|
|
|
630
630
|
children: i
|
|
631
631
|
})), i;
|
|
632
632
|
}
|
|
633
|
-
function
|
|
633
|
+
function J(t, n, r) {
|
|
634
634
|
return t?.length ? t.map((t, n) => {
|
|
635
635
|
if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
|
|
636
|
-
if (t.parts) return /* @__PURE__ */ u(e, { children:
|
|
636
|
+
if (t.parts) return /* @__PURE__ */ u(e, { children: J(t.parts, "", r) }, n);
|
|
637
637
|
let i = t.text;
|
|
638
638
|
return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
|
|
639
|
-
style:
|
|
639
|
+
style: xe,
|
|
640
640
|
children: i
|
|
641
641
|
})), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
|
|
642
642
|
style: {
|
|
@@ -653,13 +653,13 @@ function Y(t, n, r) {
|
|
|
653
653
|
})), /* @__PURE__ */ u(e, { children: i }, n);
|
|
654
654
|
}) : n;
|
|
655
655
|
}
|
|
656
|
-
function
|
|
656
|
+
function Ce({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
657
657
|
return /* @__PURE__ */ u("span", {
|
|
658
658
|
style: h(a),
|
|
659
|
-
children: e?.length ?
|
|
659
|
+
children: e?.length ? J(e, t) : Se(t, n, r, i)
|
|
660
660
|
});
|
|
661
661
|
}
|
|
662
|
-
var
|
|
662
|
+
var we = {
|
|
663
663
|
h1: 40,
|
|
664
664
|
h2: 32,
|
|
665
665
|
h3: 26,
|
|
@@ -667,7 +667,7 @@ var Ce = {
|
|
|
667
667
|
h5: 19,
|
|
668
668
|
h6: 16
|
|
669
669
|
};
|
|
670
|
-
function
|
|
670
|
+
function Te({ align: e = "center", width: t, wrap: n } = {}) {
|
|
671
671
|
let r = t ? `${t}%` : void 0;
|
|
672
672
|
if (e === "full") return { width: "100%" };
|
|
673
673
|
let i = e === "left" || e === "right";
|
|
@@ -701,8 +701,8 @@ function we({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
701
701
|
marginRight: "auto"
|
|
702
702
|
};
|
|
703
703
|
}
|
|
704
|
-
function
|
|
705
|
-
let r = n ?? ((e, n) =>
|
|
704
|
+
function Ee(e = [], t, n) {
|
|
705
|
+
let r = n ?? ((e, n) => J(e, n, t));
|
|
706
706
|
return e.map((t, n) => {
|
|
707
707
|
let i = {
|
|
708
708
|
marginTop: 0,
|
|
@@ -724,7 +724,7 @@ function Te(e = [], t, n) {
|
|
|
724
724
|
marginLeft: 0,
|
|
725
725
|
marginRight: 0,
|
|
726
726
|
...i,
|
|
727
|
-
...
|
|
727
|
+
...Te(t)
|
|
728
728
|
},
|
|
729
729
|
children: [t.href ? /* @__PURE__ */ u("a", {
|
|
730
730
|
href: t.href,
|
|
@@ -743,16 +743,16 @@ function Te(e = [], t, n) {
|
|
|
743
743
|
})]
|
|
744
744
|
}, n);
|
|
745
745
|
}
|
|
746
|
-
if (t.type === "video") return
|
|
746
|
+
if (t.type === "video") return Le(t.url) ? /* @__PURE__ */ u("div", {
|
|
747
747
|
style: {
|
|
748
748
|
...i,
|
|
749
|
-
...
|
|
749
|
+
...Te({
|
|
750
750
|
align: t.align,
|
|
751
751
|
wrap: t.wrap,
|
|
752
752
|
width: t.width ?? 100
|
|
753
753
|
})
|
|
754
754
|
},
|
|
755
|
-
children: /* @__PURE__ */ u(
|
|
755
|
+
children: /* @__PURE__ */ u(Re, {
|
|
756
756
|
url: t.url,
|
|
757
757
|
autoplay: t.autoplay,
|
|
758
758
|
muted: t.muted,
|
|
@@ -781,17 +781,17 @@ function Te(e = [], t, n) {
|
|
|
781
781
|
}
|
|
782
782
|
if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
|
|
783
783
|
style: {
|
|
784
|
-
...
|
|
784
|
+
...Oe,
|
|
785
785
|
...i
|
|
786
786
|
},
|
|
787
787
|
children: r(t.parts, t.text)
|
|
788
788
|
}, n);
|
|
789
|
-
if (
|
|
789
|
+
if (we[t.type]) {
|
|
790
790
|
let e = t.type;
|
|
791
791
|
return /* @__PURE__ */ u(e, {
|
|
792
792
|
style: {
|
|
793
|
-
...
|
|
794
|
-
fontSize:
|
|
793
|
+
...de,
|
|
794
|
+
fontSize: we[t.type],
|
|
795
795
|
...i
|
|
796
796
|
},
|
|
797
797
|
children: r(t.parts, t.text)
|
|
@@ -799,39 +799,39 @@ function Te(e = [], t, n) {
|
|
|
799
799
|
}
|
|
800
800
|
return /* @__PURE__ */ u("p", {
|
|
801
801
|
style: {
|
|
802
|
-
...
|
|
802
|
+
...fe,
|
|
803
803
|
...i
|
|
804
804
|
},
|
|
805
805
|
children: r(t.parts, t.text)
|
|
806
806
|
}, n);
|
|
807
807
|
});
|
|
808
808
|
}
|
|
809
|
-
function
|
|
809
|
+
function De({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
810
810
|
return /* @__PURE__ */ u("div", {
|
|
811
811
|
ref: r,
|
|
812
812
|
style: {
|
|
813
813
|
display: "flow-root",
|
|
814
814
|
...h(t)
|
|
815
815
|
},
|
|
816
|
-
children:
|
|
816
|
+
children: Ee(e, n)
|
|
817
817
|
});
|
|
818
818
|
}
|
|
819
|
-
var
|
|
819
|
+
var Oe = {
|
|
820
820
|
margin: 0,
|
|
821
821
|
padding: "8px 0 8px 20px",
|
|
822
822
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
823
823
|
};
|
|
824
|
-
function
|
|
824
|
+
function ke({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
825
825
|
return /* @__PURE__ */ u("blockquote", {
|
|
826
826
|
ref: i,
|
|
827
827
|
style: {
|
|
828
|
-
...
|
|
828
|
+
...Oe,
|
|
829
829
|
...h(n)
|
|
830
830
|
},
|
|
831
|
-
children:
|
|
831
|
+
children: J(t, e, r)
|
|
832
832
|
});
|
|
833
833
|
}
|
|
834
|
-
function
|
|
834
|
+
function Ae({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
835
835
|
return /* @__PURE__ */ u(e ? "ol" : "ul", {
|
|
836
836
|
ref: r,
|
|
837
837
|
style: {
|
|
@@ -841,53 +841,53 @@ function ke({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
841
841
|
},
|
|
842
842
|
children: t.map((e, t) => /* @__PURE__ */ u("li", {
|
|
843
843
|
style: { marginBottom: 4 },
|
|
844
|
-
children:
|
|
844
|
+
children: J(e.parts, e.text)
|
|
845
845
|
}, t))
|
|
846
846
|
});
|
|
847
847
|
}
|
|
848
|
-
function
|
|
848
|
+
function je({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
849
849
|
return /* @__PURE__ */ u("p", {
|
|
850
850
|
ref: i,
|
|
851
851
|
style: {
|
|
852
|
-
...
|
|
852
|
+
...fe,
|
|
853
853
|
...h(n)
|
|
854
854
|
},
|
|
855
|
-
children:
|
|
855
|
+
children: J(t, e, r)
|
|
856
856
|
});
|
|
857
857
|
}
|
|
858
|
-
var
|
|
858
|
+
var Me = {
|
|
859
859
|
color: "var(--page-accent, inherit)",
|
|
860
860
|
textDecoration: "underline",
|
|
861
861
|
textUnderlineOffset: 3,
|
|
862
862
|
cursor: "pointer"
|
|
863
863
|
};
|
|
864
|
-
function
|
|
864
|
+
function Ne({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
865
865
|
return /* @__PURE__ */ u("a", {
|
|
866
866
|
ref: o,
|
|
867
867
|
href: n || "#",
|
|
868
868
|
target: r || void 0,
|
|
869
869
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
870
870
|
style: {
|
|
871
|
-
...
|
|
871
|
+
...Me,
|
|
872
872
|
...h(i)
|
|
873
873
|
},
|
|
874
|
-
children:
|
|
874
|
+
children: J(t, e, a)
|
|
875
875
|
});
|
|
876
876
|
}
|
|
877
|
-
function
|
|
877
|
+
function Pe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
878
878
|
return /* @__PURE__ */ u("a", {
|
|
879
879
|
ref: o,
|
|
880
880
|
href: n || "#",
|
|
881
881
|
target: r || void 0,
|
|
882
882
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
883
883
|
style: {
|
|
884
|
-
...
|
|
884
|
+
...q,
|
|
885
885
|
...h(i)
|
|
886
886
|
},
|
|
887
|
-
children:
|
|
887
|
+
children: J(t, e, a)
|
|
888
888
|
});
|
|
889
889
|
}
|
|
890
|
-
function
|
|
890
|
+
function Fe({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
891
891
|
return e ? /* @__PURE__ */ u("img", {
|
|
892
892
|
ref: r,
|
|
893
893
|
src: e,
|
|
@@ -899,7 +899,7 @@ function Pe({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
899
899
|
}
|
|
900
900
|
}) : null;
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function Ie({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
903
903
|
return e ? /* @__PURE__ */ u("video", {
|
|
904
904
|
ref: s,
|
|
905
905
|
src: e,
|
|
@@ -917,9 +917,9 @@ function Fe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
917
917
|
}
|
|
918
918
|
}) : null;
|
|
919
919
|
}
|
|
920
|
-
var
|
|
921
|
-
function
|
|
922
|
-
let c =
|
|
920
|
+
var Le = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
921
|
+
function Re({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
922
|
+
let c = Le(e);
|
|
923
923
|
if (!c) return null;
|
|
924
924
|
let l = new URLSearchParams({ rel: "0" });
|
|
925
925
|
return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ u("div", {
|
|
@@ -945,7 +945,7 @@ function Le({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
945
945
|
})
|
|
946
946
|
});
|
|
947
947
|
}
|
|
948
|
-
function
|
|
948
|
+
function ze({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
949
949
|
return e ? /* @__PURE__ */ u("iframe", {
|
|
950
950
|
ref: i,
|
|
951
951
|
src: e,
|
|
@@ -961,7 +961,7 @@ function Re({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
961
961
|
}
|
|
962
962
|
}) : null;
|
|
963
963
|
}
|
|
964
|
-
function
|
|
964
|
+
function Be({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
965
965
|
let [a, o] = c(null);
|
|
966
966
|
return i(() => {
|
|
967
967
|
a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
|
|
@@ -980,7 +980,7 @@ function ze({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
|
|
|
980
980
|
style: h(n)
|
|
981
981
|
});
|
|
982
982
|
}
|
|
983
|
-
function
|
|
983
|
+
function Ve({ height: e, nodeRef: t }) {
|
|
984
984
|
return /* @__PURE__ */ u("div", {
|
|
985
985
|
ref: t,
|
|
986
986
|
style: {
|
|
@@ -990,7 +990,7 @@ function Be({ height: e, nodeRef: t }) {
|
|
|
990
990
|
}
|
|
991
991
|
});
|
|
992
992
|
}
|
|
993
|
-
function
|
|
993
|
+
function He({ style: e, nodeRef: t }) {
|
|
994
994
|
return /* @__PURE__ */ u("div", {
|
|
995
995
|
ref: t,
|
|
996
996
|
style: {
|
|
@@ -1001,7 +1001,7 @@ function Ve({ style: e, nodeRef: t }) {
|
|
|
1001
1001
|
}
|
|
1002
1002
|
});
|
|
1003
1003
|
}
|
|
1004
|
-
var
|
|
1004
|
+
var Ue = {
|
|
1005
1005
|
position: "absolute",
|
|
1006
1006
|
top: "50%",
|
|
1007
1007
|
transform: "translateY(-50%)",
|
|
@@ -1018,7 +1018,7 @@ var He = {
|
|
|
1018
1018
|
alignItems: "center",
|
|
1019
1019
|
justifyContent: "center",
|
|
1020
1020
|
padding: 0
|
|
1021
|
-
},
|
|
1021
|
+
}, We = {
|
|
1022
1022
|
bottom: {
|
|
1023
1023
|
inset: "auto 0 0 0",
|
|
1024
1024
|
padding: "40px 24px 20px",
|
|
@@ -1037,8 +1037,8 @@ var He = {
|
|
|
1037
1037
|
padding: 24,
|
|
1038
1038
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1039
1039
|
}
|
|
1040
|
-
},
|
|
1041
|
-
function
|
|
1040
|
+
}, Ge = 48;
|
|
1041
|
+
function Ke({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
|
|
1042
1042
|
let [p, m] = c(0), [g, _] = c(!1), [v, y] = c(null), b = e ? Math.min(p, e - 1) : 0;
|
|
1043
1043
|
if (i(() => {
|
|
1044
1044
|
if (!n || g || v || e < 2) return;
|
|
@@ -1054,7 +1054,7 @@ function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1054
1054
|
let x = (t) => m((t + e) % e), S = () => {
|
|
1055
1055
|
if (!v) return;
|
|
1056
1056
|
let { dx: e } = v;
|
|
1057
|
-
y(null), e < -48 ? x(b + 1) : e >
|
|
1057
|
+
y(null), e < -48 ? x(b + 1) : e > Ge && x(b - 1);
|
|
1058
1058
|
};
|
|
1059
1059
|
return /* @__PURE__ */ d("div", {
|
|
1060
1060
|
ref: f,
|
|
@@ -1102,7 +1102,7 @@ function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1102
1102
|
type: "button",
|
|
1103
1103
|
"aria-label": "Previous slide",
|
|
1104
1104
|
style: {
|
|
1105
|
-
...
|
|
1105
|
+
...Ue,
|
|
1106
1106
|
left: 12
|
|
1107
1107
|
},
|
|
1108
1108
|
onClick: () => x(b - 1),
|
|
@@ -1112,7 +1112,7 @@ function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1112
1112
|
type: "button",
|
|
1113
1113
|
"aria-label": "Next slide",
|
|
1114
1114
|
style: {
|
|
1115
|
-
...
|
|
1115
|
+
...Ue,
|
|
1116
1116
|
right: 12
|
|
1117
1117
|
},
|
|
1118
1118
|
onClick: () => x(b + 1),
|
|
@@ -1146,7 +1146,7 @@ function Ge({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1146
1146
|
] })]
|
|
1147
1147
|
});
|
|
1148
1148
|
}
|
|
1149
|
-
var
|
|
1149
|
+
var qe = (e, t) => ({
|
|
1150
1150
|
position: "absolute",
|
|
1151
1151
|
inset: 0,
|
|
1152
1152
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1154,18 +1154,18 @@ var Ke = (e, t) => ({
|
|
|
1154
1154
|
backgroundSize: "cover",
|
|
1155
1155
|
backgroundPosition: "center"
|
|
1156
1156
|
});
|
|
1157
|
-
function
|
|
1158
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1157
|
+
function Je({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1158
|
+
return e.length ? /* @__PURE__ */ u(Ke, {
|
|
1159
1159
|
...r,
|
|
1160
1160
|
count: e.length,
|
|
1161
1161
|
renderSlide: (r) => {
|
|
1162
1162
|
let i = e[r];
|
|
1163
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1163
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: qe(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
|
|
1164
1164
|
style: {
|
|
1165
1165
|
position: "absolute",
|
|
1166
1166
|
color: "#fff",
|
|
1167
1167
|
textAlign: n,
|
|
1168
|
-
...
|
|
1168
|
+
...We[t] ?? We.bottom
|
|
1169
1169
|
},
|
|
1170
1170
|
children: [i.title && /* @__PURE__ */ u("div", {
|
|
1171
1171
|
style: {
|
|
@@ -1185,13 +1185,13 @@ function qe({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1185
1185
|
}
|
|
1186
1186
|
}) : null;
|
|
1187
1187
|
}
|
|
1188
|
-
function
|
|
1189
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1188
|
+
function Ye({ slides: e = [], linked: t, ...n }) {
|
|
1189
|
+
return e.length ? /* @__PURE__ */ u(Ke, {
|
|
1190
1190
|
...n,
|
|
1191
1191
|
count: e.length,
|
|
1192
1192
|
renderSlide: (n) => {
|
|
1193
1193
|
let r = e[n];
|
|
1194
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1194
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: qe(r.image, r.color) }), /* @__PURE__ */ u("div", {
|
|
1195
1195
|
style: {
|
|
1196
1196
|
position: "absolute",
|
|
1197
1197
|
inset: 0,
|
|
@@ -1203,7 +1203,7 @@ function Je({ slides: e = [], linked: t, ...n }) {
|
|
|
1203
1203
|
}
|
|
1204
1204
|
}) : null;
|
|
1205
1205
|
}
|
|
1206
|
-
var
|
|
1206
|
+
var Y = {
|
|
1207
1207
|
color: "inherit",
|
|
1208
1208
|
textDecoration: "none",
|
|
1209
1209
|
fontSize: 14,
|
|
@@ -1225,7 +1225,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1225
1225
|
let w = p === "hamburger" || p === "auto" && v, T = (e, t) => /* @__PURE__ */ d("a", {
|
|
1226
1226
|
href: e.href || "#",
|
|
1227
1227
|
style: {
|
|
1228
|
-
...
|
|
1228
|
+
...Y,
|
|
1229
1229
|
display: "block",
|
|
1230
1230
|
...t
|
|
1231
1231
|
},
|
|
@@ -1313,7 +1313,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1313
1313
|
let t = e.children ?? [];
|
|
1314
1314
|
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
1315
1315
|
href: e.href || "#",
|
|
1316
|
-
style:
|
|
1316
|
+
style: Y,
|
|
1317
1317
|
children: e.label
|
|
1318
1318
|
}, e.key);
|
|
1319
1319
|
let n = e.type === "mega";
|
|
@@ -1327,7 +1327,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1327
1327
|
children: [/* @__PURE__ */ d("a", {
|
|
1328
1328
|
href: e.href || "#",
|
|
1329
1329
|
style: {
|
|
1330
|
-
...
|
|
1330
|
+
...Y,
|
|
1331
1331
|
cursor: "pointer"
|
|
1332
1332
|
},
|
|
1333
1333
|
children: [
|
|
@@ -1388,7 +1388,7 @@ function Ze({ brand: t, logo: n, brandHref: r, brandTarget: a, links: o = [], st
|
|
|
1388
1388
|
children: o.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
1389
1389
|
href: t.href || "#",
|
|
1390
1390
|
style: {
|
|
1391
|
-
...
|
|
1391
|
+
...Y,
|
|
1392
1392
|
padding: "10px 4px",
|
|
1393
1393
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
1394
1394
|
opacity: 1
|
|
@@ -1601,7 +1601,7 @@ function ot({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
1601
1601
|
borderRadius: 8,
|
|
1602
1602
|
display: "block"
|
|
1603
1603
|
}
|
|
1604
|
-
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(
|
|
1604
|
+
}) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Re, {
|
|
1605
1605
|
url: e.src,
|
|
1606
1606
|
style: { width: "100%" }
|
|
1607
1607
|
}) : /* @__PURE__ */ u("video", {
|
|
@@ -1794,7 +1794,7 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1794
1794
|
disabled: g || void 0,
|
|
1795
1795
|
onClick: () => k(F - 1),
|
|
1796
1796
|
style: {
|
|
1797
|
-
...
|
|
1797
|
+
...q,
|
|
1798
1798
|
background: "transparent",
|
|
1799
1799
|
color: "inherit",
|
|
1800
1800
|
border: 0,
|
|
@@ -1807,7 +1807,7 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1807
1807
|
disabled: g || ee.length > 0,
|
|
1808
1808
|
onClick: () => k(F + 1),
|
|
1809
1809
|
style: {
|
|
1810
|
-
...
|
|
1810
|
+
...q,
|
|
1811
1811
|
border: 0,
|
|
1812
1812
|
padding: "10px 22px",
|
|
1813
1813
|
borderRadius: 8,
|
|
@@ -1821,7 +1821,7 @@ function st({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
1821
1821
|
type: "submit",
|
|
1822
1822
|
disabled: g || void 0,
|
|
1823
1823
|
style: {
|
|
1824
|
-
...
|
|
1824
|
+
...q,
|
|
1825
1825
|
border: 0,
|
|
1826
1826
|
padding: "10px 22px",
|
|
1827
1827
|
borderRadius: 8,
|
|
@@ -1945,7 +1945,7 @@ function dt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
|
1945
1945
|
...X,
|
|
1946
1946
|
...h(n)
|
|
1947
1947
|
},
|
|
1948
|
-
children:
|
|
1948
|
+
children: J(t, e, i)
|
|
1949
1949
|
});
|
|
1950
1950
|
}
|
|
1951
1951
|
function ft({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
@@ -2058,7 +2058,7 @@ function _t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2058
2058
|
ref: n,
|
|
2059
2059
|
type: r ? "button" : "submit",
|
|
2060
2060
|
style: {
|
|
2061
|
-
...
|
|
2061
|
+
...q,
|
|
2062
2062
|
border: 0,
|
|
2063
2063
|
cursor: "pointer",
|
|
2064
2064
|
alignSelf: "flex-start",
|
|
@@ -2134,7 +2134,7 @@ function yt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2134
2134
|
},
|
|
2135
2135
|
children: O.map((e) => /* @__PURE__ */ u("div", {
|
|
2136
2136
|
style: { minWidth: 0 },
|
|
2137
|
-
children: x.render(p, (t) =>
|
|
2137
|
+
children: x.render(p, (t) => ue(t, e))
|
|
2138
2138
|
}, e.id ?? e?.data?.slug))
|
|
2139
2139
|
}) : /* @__PURE__ */ u("div", {
|
|
2140
2140
|
ref: _,
|
|
@@ -2144,7 +2144,7 @@ function yt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2144
2144
|
...h(g)
|
|
2145
2145
|
},
|
|
2146
2146
|
children: O.map((e) => {
|
|
2147
|
-
let t = o ?
|
|
2147
|
+
let t = o ? G(e?.data, o) : null, r = s ? K(G(e?.data, s)) : null, i = l ? G(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : K(i), f = n === "list";
|
|
2148
2148
|
return /* @__PURE__ */ d("div", {
|
|
2149
2149
|
style: {
|
|
2150
2150
|
display: "flex",
|
|
@@ -2191,7 +2191,7 @@ function yt({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2191
2191
|
lineHeight: 1.55,
|
|
2192
2192
|
opacity: .85
|
|
2193
2193
|
},
|
|
2194
|
-
children:
|
|
2194
|
+
children: Ee(a)
|
|
2195
2195
|
})
|
|
2196
2196
|
]
|
|
2197
2197
|
})]
|
|
@@ -2249,27 +2249,27 @@ function bt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
2249
2249
|
})
|
|
2250
2250
|
}) : null;
|
|
2251
2251
|
}
|
|
2252
|
-
function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l,
|
|
2253
|
-
let { tenant:
|
|
2252
|
+
function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: g }) {
|
|
2253
|
+
let { tenant: _, apiUrl: v } = r(V), y = r(H), [b, x] = c(null), S = o ? Number(y?.[`${o}:total`]) : NaN;
|
|
2254
2254
|
i(() => {
|
|
2255
|
-
if (!o || Number.isFinite(
|
|
2256
|
-
let e = !0, t = o.startsWith("api:") ? `${
|
|
2257
|
-
return fetch(t, { headers:
|
|
2255
|
+
if (!o || Number.isFinite(S)) return;
|
|
2256
|
+
let e = !0, t = o.startsWith("api:") ? `${v}/data/${encodeURIComponent(o.slice(4))}` : `${v}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
2257
|
+
return fetch(t, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((t) => {
|
|
2258
2258
|
if (!e) return;
|
|
2259
2259
|
let n = t?.payload, r = Array.isArray(n) ? n.length : Number(n?.total?.filtered ?? n?.total?.all ?? (Array.isArray(n?.data) ? n.data.length : 0));
|
|
2260
|
-
|
|
2261
|
-
}).catch(() => e &&
|
|
2260
|
+
x(Number.isFinite(r) ? r : 0);
|
|
2261
|
+
}).catch(() => e && x(0)), () => {
|
|
2262
2262
|
e = !1;
|
|
2263
2263
|
};
|
|
2264
2264
|
}, [
|
|
2265
2265
|
o,
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2266
|
+
_,
|
|
2267
|
+
v,
|
|
2268
|
+
S
|
|
2269
2269
|
]);
|
|
2270
|
-
let
|
|
2271
|
-
if (o &&
|
|
2272
|
-
let
|
|
2270
|
+
let C = Math.max(1, Number(s) || 6), w = Number.isFinite(S) ? S : b;
|
|
2271
|
+
if (o && w === null || o && f && !(w > 0)) return null;
|
|
2272
|
+
let T = Math.min(Math.max(o ? Math.ceil(w / C) : Number(e) || 1, 1), 50), E = Math.min(Math.max(o ? U(y) : Number(t) || 1, 1), T), D = (e) => {
|
|
2273
2273
|
if (o) {
|
|
2274
2274
|
if (typeof window < "u") {
|
|
2275
2275
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -2278,7 +2278,7 @@ function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
2278
2278
|
return `?page=${e}`;
|
|
2279
2279
|
}
|
|
2280
2280
|
return a && a !== "#" ? a.replace("{page}", String(e)) : "#";
|
|
2281
|
-
},
|
|
2281
|
+
}, O = l === "center" ? "center" : l === "right" ? "flex-end" : "flex-start", k = p ? (e) => e.preventDefault() : void 0, A = (e) => ({
|
|
2282
2282
|
display: "inline-flex",
|
|
2283
2283
|
alignItems: "center",
|
|
2284
2284
|
justifyContent: "center",
|
|
@@ -2293,38 +2293,41 @@ function xt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
2293
2293
|
border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
|
|
2294
2294
|
});
|
|
2295
2295
|
return /* @__PURE__ */ d("nav", {
|
|
2296
|
-
ref:
|
|
2296
|
+
ref: g,
|
|
2297
2297
|
"aria-label": "Pagination",
|
|
2298
2298
|
style: {
|
|
2299
2299
|
display: "flex",
|
|
2300
2300
|
flexWrap: "wrap",
|
|
2301
2301
|
gap: 8,
|
|
2302
2302
|
alignItems: "center",
|
|
2303
|
-
justifyContent:
|
|
2304
|
-
...h(
|
|
2303
|
+
justifyContent: O,
|
|
2304
|
+
...h(m)
|
|
2305
2305
|
},
|
|
2306
2306
|
children: [
|
|
2307
2307
|
n && /* @__PURE__ */ u("a", {
|
|
2308
|
-
href:
|
|
2308
|
+
href: E > 1 ? D(E - 1) : "#",
|
|
2309
|
+
onClick: k,
|
|
2309
2310
|
"aria-label": "Previous",
|
|
2310
2311
|
style: {
|
|
2311
|
-
...
|
|
2312
|
-
opacity:
|
|
2312
|
+
...A(!1),
|
|
2313
|
+
opacity: E > 1 ? 1 : .4
|
|
2313
2314
|
},
|
|
2314
2315
|
children: "‹"
|
|
2315
2316
|
}),
|
|
2316
|
-
Array.from({ length:
|
|
2317
|
-
href:
|
|
2318
|
-
|
|
2319
|
-
|
|
2317
|
+
Array.from({ length: T }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
|
|
2318
|
+
href: D(e),
|
|
2319
|
+
onClick: k,
|
|
2320
|
+
"aria-current": e === E ? "page" : void 0,
|
|
2321
|
+
style: A(e === E),
|
|
2320
2322
|
children: e
|
|
2321
2323
|
}, e)),
|
|
2322
2324
|
n && /* @__PURE__ */ u("a", {
|
|
2323
|
-
href:
|
|
2325
|
+
href: E < T ? D(E + 1) : "#",
|
|
2326
|
+
onClick: k,
|
|
2324
2327
|
"aria-label": "Next",
|
|
2325
2328
|
style: {
|
|
2326
|
-
...
|
|
2327
|
-
opacity:
|
|
2329
|
+
...A(!1),
|
|
2330
|
+
opacity: E < T ? 1 : .4
|
|
2328
2331
|
},
|
|
2329
2332
|
children: "›"
|
|
2330
2333
|
})
|
|
@@ -2498,7 +2501,7 @@ var Et = (e, t) => {
|
|
|
2498
2501
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
2499
2502
|
}, Ot = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
2500
2503
|
function kt(e, t = {}) {
|
|
2501
|
-
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 ? "" :
|
|
2504
|
+
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);
|
|
2502
2505
|
return n.map((e) => {
|
|
2503
2506
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
2504
2507
|
return {
|
|
@@ -2843,7 +2846,7 @@ function Nt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
|
|
|
2843
2846
|
x,
|
|
2844
2847
|
a
|
|
2845
2848
|
]), !e.length) return null;
|
|
2846
|
-
let w = Math.max(1, Number(a) || 10), T = n ? f ? b || n.startsWith("api:") ? (b ?? S ?? []).slice((x - 1) * w, x * w) : (S ?? []).slice(0, w) : (b ?? S ?? []).slice(0, w) : null, E = T ? T.map((t) => e.map((e) =>
|
|
2849
|
+
let w = Math.max(1, Number(a) || 10), T = n ? f ? b || n.startsWith("api:") ? (b ?? S ?? []).slice((x - 1) * w, x * w) : (S ?? []).slice(0, w) : (b ?? S ?? []).slice(0, w) : null, E = T ? T.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, D = !!n && !(n && !b && S === null) && E.length === 0, O = l ? "6px 10px" : "10px 14px", k = "1px solid rgba(148, 163, 184, 0.35)", A = s ? { border: k } : { borderBottom: k };
|
|
2847
2850
|
return /* @__PURE__ */ u("div", {
|
|
2848
2851
|
ref: g,
|
|
2849
2852
|
style: {
|
|
@@ -2890,17 +2893,17 @@ function Nt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
|
|
|
2890
2893
|
});
|
|
2891
2894
|
}
|
|
2892
2895
|
var Pt = {
|
|
2893
|
-
PageRoot:
|
|
2894
|
-
Section:
|
|
2895
|
-
Container:
|
|
2896
|
-
Heading:
|
|
2897
|
-
TextBlock:
|
|
2898
|
-
ButtonBlock:
|
|
2899
|
-
ImageBlock:
|
|
2900
|
-
Spacer:
|
|
2901
|
-
Divider:
|
|
2902
|
-
SliderBlock:
|
|
2903
|
-
CanvasSlider:
|
|
2896
|
+
PageRoot: _e,
|
|
2897
|
+
Section: ve,
|
|
2898
|
+
Container: ye,
|
|
2899
|
+
Heading: be,
|
|
2900
|
+
TextBlock: je,
|
|
2901
|
+
ButtonBlock: Pe,
|
|
2902
|
+
ImageBlock: Fe,
|
|
2903
|
+
Spacer: Ve,
|
|
2904
|
+
Divider: He,
|
|
2905
|
+
SliderBlock: Je,
|
|
2906
|
+
CanvasSlider: Ye,
|
|
2904
2907
|
TabsBlock: Qe,
|
|
2905
2908
|
QuickStack: vt,
|
|
2906
2909
|
CollectionList: yt,
|
|
@@ -2911,16 +2914,16 @@ var Pt = {
|
|
|
2911
2914
|
TableBlock: Nt,
|
|
2912
2915
|
AccordionBlock: $e,
|
|
2913
2916
|
NavbarBlock: Ze,
|
|
2914
|
-
ListBlock:
|
|
2915
|
-
TextSpan:
|
|
2916
|
-
QuoteBlock:
|
|
2917
|
-
TextLink:
|
|
2918
|
-
RichTextBlock:
|
|
2919
|
-
RichContentBlock:
|
|
2920
|
-
VideoBlock:
|
|
2921
|
-
YouTubeBlock:
|
|
2922
|
-
IframeBlock:
|
|
2923
|
-
EmbedBlock:
|
|
2917
|
+
ListBlock: Ae,
|
|
2918
|
+
TextSpan: Ce,
|
|
2919
|
+
QuoteBlock: ke,
|
|
2920
|
+
TextLink: Ne,
|
|
2921
|
+
RichTextBlock: De,
|
|
2922
|
+
RichContentBlock: De,
|
|
2923
|
+
VideoBlock: Ie,
|
|
2924
|
+
YouTubeBlock: Re,
|
|
2925
|
+
IframeBlock: ze,
|
|
2926
|
+
EmbedBlock: Be,
|
|
2924
2927
|
FormBlock: st,
|
|
2925
2928
|
FormLabel: dt,
|
|
2926
2929
|
FormInput: ft,
|
|
@@ -3092,7 +3095,7 @@ function Bt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
3092
3095
|
type: f ? "button" : "submit",
|
|
3093
3096
|
disabled: C || void 0,
|
|
3094
3097
|
style: {
|
|
3095
|
-
...
|
|
3098
|
+
...q,
|
|
3096
3099
|
border: 0,
|
|
3097
3100
|
padding: "10px 22px",
|
|
3098
3101
|
borderRadius: 8,
|
|
@@ -3166,7 +3169,7 @@ function Vt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
3166
3169
|
type: "button",
|
|
3167
3170
|
onClick: a ? void 0 : f,
|
|
3168
3171
|
style: {
|
|
3169
|
-
...
|
|
3172
|
+
...q,
|
|
3170
3173
|
border: 0,
|
|
3171
3174
|
padding: "8px 16px",
|
|
3172
3175
|
borderRadius: 8,
|
|
@@ -3196,10 +3199,92 @@ var Ht = [Ft], Ut = {
|
|
|
3196
3199
|
};
|
|
3197
3200
|
new Set(Ht.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
3198
3201
|
//#endregion
|
|
3202
|
+
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
3203
|
+
var Wt = /* @__PURE__ */ new Map();
|
|
3204
|
+
function Gt(e) {
|
|
3205
|
+
if (Wt.has(e)) return Wt.get(e);
|
|
3206
|
+
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
3207
|
+
/* @vite-ignore */
|
|
3208
|
+
t
|
|
3209
|
+
).finally(() => URL.revokeObjectURL(t));
|
|
3210
|
+
return Wt.set(e, n), n;
|
|
3211
|
+
}
|
|
3212
|
+
function Kt(e) {
|
|
3213
|
+
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
3214
|
+
return n && typeof n == "object" ? n : {};
|
|
3215
|
+
}
|
|
3216
|
+
//#endregion
|
|
3217
|
+
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
3218
|
+
async function qt(e, t) {
|
|
3219
|
+
let n = await Gt(e);
|
|
3220
|
+
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
3221
|
+
}
|
|
3222
|
+
var Jt = {
|
|
3223
|
+
padding: "10px 12px",
|
|
3224
|
+
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
3225
|
+
borderRadius: 8,
|
|
3226
|
+
fontSize: 12,
|
|
3227
|
+
opacity: .6
|
|
3228
|
+
};
|
|
3229
|
+
function Yt({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
3230
|
+
let c = r(V), l = Kt(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
3231
|
+
tenant: c?.tenant ?? "",
|
|
3232
|
+
apiUrl: c?.apiUrl ?? "/api",
|
|
3233
|
+
locale: c?.locale ?? "",
|
|
3234
|
+
settings: c?.settings ?? null
|
|
3235
|
+
}, g = s(m);
|
|
3236
|
+
g.current = m;
|
|
3237
|
+
let _ = JSON.stringify(n ?? {});
|
|
3238
|
+
return i(() => {
|
|
3239
|
+
let e = f.current;
|
|
3240
|
+
if (!l?.code || !e) return;
|
|
3241
|
+
let n = !0;
|
|
3242
|
+
return qt(l.code, t).then((e) => {
|
|
3243
|
+
if (!(!n || !e || !f.current)) {
|
|
3244
|
+
p.current = e;
|
|
3245
|
+
try {
|
|
3246
|
+
e.mount(f.current, JSON.parse(_), g.current);
|
|
3247
|
+
} catch {
|
|
3248
|
+
p.current = null;
|
|
3249
|
+
}
|
|
3250
|
+
}
|
|
3251
|
+
}).catch(() => {}), () => {
|
|
3252
|
+
n = !1;
|
|
3253
|
+
let t = p.current;
|
|
3254
|
+
p.current = null;
|
|
3255
|
+
try {
|
|
3256
|
+
t?.unmount?.(e);
|
|
3257
|
+
} catch {}
|
|
3258
|
+
e && (e.innerHTML = "");
|
|
3259
|
+
};
|
|
3260
|
+
}, [l?.code, t]), i(() => {
|
|
3261
|
+
let e = p.current, t = f.current;
|
|
3262
|
+
if (!(!e || !t)) try {
|
|
3263
|
+
e.update ? e.update(t, JSON.parse(_), g.current) : (e.unmount?.(t), t.innerHTML = "", e.mount(t, JSON.parse(_), g.current));
|
|
3264
|
+
} catch {}
|
|
3265
|
+
}, [_]), l ? /* @__PURE__ */ u("div", {
|
|
3266
|
+
ref: o,
|
|
3267
|
+
style: h(a),
|
|
3268
|
+
children: /* @__PURE__ */ u("div", { ref: f })
|
|
3269
|
+
}) : /* @__PURE__ */ d("div", {
|
|
3270
|
+
ref: o,
|
|
3271
|
+
style: {
|
|
3272
|
+
...Jt,
|
|
3273
|
+
...h(a)
|
|
3274
|
+
},
|
|
3275
|
+
children: [
|
|
3276
|
+
"Plugin “",
|
|
3277
|
+
e,
|
|
3278
|
+
"” is not installed"
|
|
3279
|
+
]
|
|
3280
|
+
});
|
|
3281
|
+
}
|
|
3282
|
+
//#endregion
|
|
3199
3283
|
//#region ../ui/src/components/builder/render.jsx
|
|
3200
|
-
var
|
|
3284
|
+
var Xt = {
|
|
3201
3285
|
...Pt,
|
|
3202
|
-
...Ut
|
|
3286
|
+
...Ut,
|
|
3287
|
+
PluginBlock: Yt
|
|
3203
3288
|
};
|
|
3204
3289
|
function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
3205
3290
|
let o = n[t];
|
|
@@ -3211,7 +3296,7 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3211
3296
|
let c = new Set(i).add(n);
|
|
3212
3297
|
return /* @__PURE__ */ u(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
3213
3298
|
}
|
|
3214
|
-
let l =
|
|
3299
|
+
let l = Xt[s];
|
|
3215
3300
|
if (!l) return null;
|
|
3216
3301
|
let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
3217
3302
|
...c,
|
|
@@ -3229,8 +3314,8 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
3229
3314
|
}
|
|
3230
3315
|
//#endregion
|
|
3231
3316
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
3232
|
-
var
|
|
3233
|
-
function
|
|
3317
|
+
var Zt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
|
|
3318
|
+
function Qt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: g }) {
|
|
3234
3319
|
let _ = s?.js?.trim();
|
|
3235
3320
|
if (i(() => {
|
|
3236
3321
|
if (!_) return;
|
|
@@ -3306,8 +3391,8 @@ function Kt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
3306
3391
|
...a
|
|
3307
3392
|
},
|
|
3308
3393
|
children: [
|
|
3309
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
3310
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
3394
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${Zt(F(k.light))} }
|
|
3395
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Zt(F(k.dark))} } }` }),
|
|
3311
3396
|
O,
|
|
3312
3397
|
/* @__PURE__ */ u("style", { children: y }),
|
|
3313
3398
|
C && /* @__PURE__ */ u("style", { children: C }),
|
|
@@ -3323,8 +3408,8 @@ function Kt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
3323
3408
|
}
|
|
3324
3409
|
//#endregion
|
|
3325
3410
|
//#region src/WebimContent.jsx
|
|
3326
|
-
function
|
|
3327
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
3411
|
+
function $t({ bundle: e, mode: t = "auto", style: n }) {
|
|
3412
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(Qt, {
|
|
3328
3413
|
blocks: e.blocks,
|
|
3329
3414
|
theme: e.theme,
|
|
3330
3415
|
components: e.components,
|
|
@@ -3341,7 +3426,7 @@ function qt({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
3341
3426
|
}
|
|
3342
3427
|
//#endregion
|
|
3343
3428
|
//#region src/WebimPage.jsx
|
|
3344
|
-
function
|
|
3429
|
+
function en({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
|
|
3345
3430
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
3346
3431
|
onLoad: m,
|
|
3347
3432
|
onError: h
|
|
@@ -3378,11 +3463,11 @@ function Jt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
3378
3463
|
r,
|
|
3379
3464
|
a,
|
|
3380
3465
|
o
|
|
3381
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
3466
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u($t, {
|
|
3382
3467
|
bundle: g.bundle,
|
|
3383
3468
|
mode: l,
|
|
3384
3469
|
style: d
|
|
3385
3470
|
});
|
|
3386
3471
|
}
|
|
3387
3472
|
//#endregion
|
|
3388
|
-
export {
|
|
3473
|
+
export { Qt as PageRenderer, $t as WebimContent, en as WebimPage, z as fetchPage, Ee as renderRichContent, L as resolveTheme };
|