webim-adapter 2.0.2 → 2.1.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/CHANGELOG.md +10 -0
- package/build/webim-adapter.js +1186 -738
- package/build/webim-embed.js +16 -10
- package/build/webim-ssr.js +1261 -813
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -266,18 +266,18 @@ function A(e) {
|
|
|
266
266
|
t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
|
|
267
267
|
}
|
|
268
268
|
delete t.backgroundVideo;
|
|
269
|
-
let { overlayColor:
|
|
270
|
-
if (delete t.overlayColor, delete t.overlayOpacity,
|
|
271
|
-
let e = `color-mix(in srgb, ${
|
|
269
|
+
let { overlayColor: oe, overlayOpacity: se } = t;
|
|
270
|
+
if (delete t.overlayColor, delete t.overlayOpacity, oe) {
|
|
271
|
+
let e = `color-mix(in srgb, ${oe} ${se ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
272
272
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
273
273
|
}
|
|
274
274
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
275
|
-
let { backgroundLayers:
|
|
275
|
+
let { backgroundLayers: ce } = t;
|
|
276
276
|
delete t.backgroundLayers;
|
|
277
|
-
let
|
|
278
|
-
if (
|
|
277
|
+
let le = (Array.isArray(ce) ? ce : []).filter((e) => e && e.on !== !1);
|
|
278
|
+
if (le.length) {
|
|
279
279
|
let e = [], n = [], r = [], i = [], a = [];
|
|
280
|
-
for (let t of
|
|
280
|
+
for (let t of le) 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");
|
|
281
281
|
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");
|
|
282
282
|
else {
|
|
283
283
|
if (!t.src) continue;
|
|
@@ -475,14 +475,14 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
475
475
|
h4: 22,
|
|
476
476
|
h5: 19,
|
|
477
477
|
h6: 16
|
|
478
|
-
},
|
|
478
|
+
}, oe = {
|
|
479
479
|
font: "system",
|
|
480
480
|
headingFont: "inherit",
|
|
481
481
|
headings: q,
|
|
482
482
|
bodySize: 16,
|
|
483
483
|
light: ae.light,
|
|
484
484
|
dark: ae.dark
|
|
485
|
-
},
|
|
485
|
+
}, se = {
|
|
486
486
|
system: {
|
|
487
487
|
label: "System",
|
|
488
488
|
value: G
|
|
@@ -503,7 +503,7 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
503
503
|
label: "Mono",
|
|
504
504
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
505
505
|
}
|
|
506
|
-
},
|
|
506
|
+
}, ce = (e, t) => se[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), le = (e, ...t) => {
|
|
507
507
|
let n = Object.assign({}, e, ...t);
|
|
508
508
|
return n.primary = {
|
|
509
509
|
...e.primary,
|
|
@@ -519,21 +519,21 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
519
519
|
}), {})
|
|
520
520
|
}, n;
|
|
521
521
|
};
|
|
522
|
-
function
|
|
522
|
+
function ue(e) {
|
|
523
523
|
let { light: t, dark: n, font: r, headingFont: i, headings: a, bodySize: o, ...s } = e ?? {};
|
|
524
524
|
return {
|
|
525
|
-
font: r ??
|
|
526
|
-
headingFont: i ??
|
|
525
|
+
font: r ?? oe.font,
|
|
526
|
+
headingFont: i ?? oe.headingFont,
|
|
527
527
|
headings: {
|
|
528
528
|
...q,
|
|
529
529
|
...a ?? {}
|
|
530
530
|
},
|
|
531
531
|
bodySize: o ?? 16,
|
|
532
|
-
light:
|
|
533
|
-
dark:
|
|
532
|
+
light: le(ae.light, s, t),
|
|
533
|
+
dark: le(ae.dark, n)
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function J(e) {
|
|
537
537
|
return {
|
|
538
538
|
"--page-bg": e.background,
|
|
539
539
|
"--page-surface": e.surface ?? e.background,
|
|
@@ -552,12 +552,12 @@ function ue(e) {
|
|
|
552
552
|
};
|
|
553
553
|
}
|
|
554
554
|
function de(e) {
|
|
555
|
-
let t =
|
|
555
|
+
let t = ue(e);
|
|
556
556
|
return {
|
|
557
557
|
backgroundColor: "var(--page-bg)",
|
|
558
558
|
color: "var(--page-text)",
|
|
559
|
-
fontFamily:
|
|
560
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
559
|
+
fontFamily: ce(t.font, G),
|
|
560
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : ce(t.headingFont, "inherit"),
|
|
561
561
|
...pe(t.headings),
|
|
562
562
|
"--page-body-size": fe(t.bodySize, 16)
|
|
563
563
|
};
|
|
@@ -574,10 +574,10 @@ function pe(e) {
|
|
|
574
574
|
return t;
|
|
575
575
|
}
|
|
576
576
|
function me(e, t = "light") {
|
|
577
|
-
let n =
|
|
577
|
+
let n = ue(e);
|
|
578
578
|
return {
|
|
579
579
|
...de(e),
|
|
580
|
-
...
|
|
580
|
+
...J(n[t] ?? n.light)
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
583
|
function he(e, t) {
|
|
@@ -665,34 +665,301 @@ var be = /* @__PURE__ */ new Set([
|
|
|
665
665
|
"yi",
|
|
666
666
|
"dv",
|
|
667
667
|
"ckb"
|
|
668
|
-
]), Y = (e) => be.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", X = (e, t) => e === "ltr" || e === "rtl" ? e : t ? Y(t) : void 0, Z =
|
|
668
|
+
]), Y = (e) => be.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", X = (e, t) => e === "ltr" || e === "rtl" ? e : t ? Y(t) : void 0, Z = /^(https?:|mailto:|tel:)/i, xe = /^[a-z][a-z0-9+.-]*:/i;
|
|
669
|
+
function Se(e) {
|
|
670
|
+
let t = String(e ?? "").trim();
|
|
671
|
+
return t ? Z.test(t) || t.startsWith("//") ? t : xe.test(t) ? "" : t : "";
|
|
672
|
+
}
|
|
673
|
+
var Ce = /^\\([\\`*_{}[\]()#+\-.!~>|])/, we = /^(`+)([\s\S]*?[^`])\1(?!`)/, Te = /^!\[([^\]]*)\]\(\s*<?([^)\s>]*)>?(?:\s+"([^"]*)")?\s*\)/, Ee = /^\[((?:[^[\]]|\[[^\]]*\])*)\]\(\s*<?([^)\s>]*)>?(?:\s+"([^"]*)")?\s*\)/, De = /^<((?:https?:\/\/|mailto:)[^>\s]+)>/, Oe = /^https?:\/\/[^\s<>"'`]+[^\s<>"'`.,;:!?)\]}]/, ke = /^(\*\*|__)(?=\S)([\s\S]*?\S)\1/, Ae = /^~~(?=\S)([\s\S]*?\S)~~/, je = /^(\*|_)(?=\S)([\s\S]*?\S)\1/, Me = /[\\`*_~![<\n]|https?:\/\//, Ne = (e, t) => e.map((e) => e.br || e.image ? {
|
|
674
|
+
...e,
|
|
675
|
+
...t.href ? {
|
|
676
|
+
href: t.href,
|
|
677
|
+
target: t.target
|
|
678
|
+
} : null
|
|
679
|
+
} : {
|
|
680
|
+
...e,
|
|
681
|
+
...t
|
|
682
|
+
});
|
|
683
|
+
function Pe(e, t = {}) {
|
|
684
|
+
let n = String(e ?? ""), r = t.newTab ? "_blank" : void 0, i = [], a = "", o = 0, s = () => {
|
|
685
|
+
a && i.push({ text: a }), a = "";
|
|
686
|
+
}, c = (e) => {
|
|
687
|
+
s(), i.push(...e);
|
|
688
|
+
};
|
|
689
|
+
for (; o < n.length;) {
|
|
690
|
+
let e = n.slice(o), i = o > 0 ? n[o - 1] : "", s = Ce.exec(e);
|
|
691
|
+
if (s) {
|
|
692
|
+
a += s[1], o += s[0].length;
|
|
693
|
+
continue;
|
|
694
|
+
}
|
|
695
|
+
if (e[0] === "\n") {
|
|
696
|
+
/ {2,}$/.test(a) ? (a = a.replace(/ +$/, ""), c([{ br: !0 }])) : a.endsWith("\\") ? (a = a.slice(0, -1), c([{ br: !0 }])) : a += " ", o += 1;
|
|
697
|
+
continue;
|
|
698
|
+
}
|
|
699
|
+
if (s = we.exec(e), s) {
|
|
700
|
+
c([{
|
|
701
|
+
text: (/^ .* $/.test(s[2]) ? s[2].slice(1, -1) : s[2]).replace(/\n/g, " "),
|
|
702
|
+
code: !0
|
|
703
|
+
}]), o += s[0].length;
|
|
704
|
+
continue;
|
|
705
|
+
}
|
|
706
|
+
if (s = Te.exec(e), s) {
|
|
707
|
+
let e = Se(s[2]);
|
|
708
|
+
e ? c([{ image: {
|
|
709
|
+
src: e,
|
|
710
|
+
alt: s[1] || "",
|
|
711
|
+
title: s[3] || ""
|
|
712
|
+
} }]) : a += s[1], o += s[0].length;
|
|
713
|
+
continue;
|
|
714
|
+
}
|
|
715
|
+
if (s = Ee.exec(e), s) {
|
|
716
|
+
let e = Se(s[2]), n = Pe(s[1], t);
|
|
717
|
+
c(e ? Ne(n, {
|
|
718
|
+
href: e,
|
|
719
|
+
target: r
|
|
720
|
+
}) : n), o += s[0].length;
|
|
721
|
+
continue;
|
|
722
|
+
}
|
|
723
|
+
if (s = De.exec(e) ?? (/[\s(<]/.test(i) || o === 0 ? Oe.exec(e) : null), s) {
|
|
724
|
+
let e = s[1] ?? s[0], t = Se(e);
|
|
725
|
+
t ? c([{
|
|
726
|
+
text: e.replace(/^mailto:/i, ""),
|
|
727
|
+
href: t,
|
|
728
|
+
target: r
|
|
729
|
+
}]) : a += e, o += s[0].length;
|
|
730
|
+
continue;
|
|
731
|
+
}
|
|
732
|
+
if (s = ke.exec(e), s && (s[1] === "**" || !/\w/.test(i))) {
|
|
733
|
+
c(Ne(Pe(s[2], t), { bold: !0 })), o += s[0].length;
|
|
734
|
+
continue;
|
|
735
|
+
}
|
|
736
|
+
if (s = Ae.exec(e), s) {
|
|
737
|
+
c(Ne(Pe(s[1], t), { strike: !0 })), o += s[0].length;
|
|
738
|
+
continue;
|
|
739
|
+
}
|
|
740
|
+
if (s = je.exec(e), s && (s[1] === "*" || !/\w/.test(i) && !/\w/.test(n[o + s[0].length] ?? ""))) {
|
|
741
|
+
c(Ne(Pe(s[2], t), { italic: !0 })), o += s[0].length;
|
|
742
|
+
continue;
|
|
743
|
+
}
|
|
744
|
+
a += n[o], o += 1;
|
|
745
|
+
let l = n.slice(o).search(Me);
|
|
746
|
+
l > 0 ? (a += n.slice(o, o + l), o += l) : l === -1 && (a += n.slice(o), o = n.length);
|
|
747
|
+
}
|
|
748
|
+
return s(), i;
|
|
749
|
+
}
|
|
750
|
+
var Fe = /^[ \t]*$/, Ie = /^ {0,3}(`{3,}|~{3,})[ \t]*([^`\s]*)[ \t]*$/, Le = /^ {0,3}(#{1,6})(?:[ \t]+(.*?))?[ \t]*$/, Re = /^ {0,3}(?:(?:\*[ \t]*){3,}|(?:-[ \t]*){3,}|(?:_[ \t]*){3,})$/, ze = /^ {0,3}>[ \t]?(.*)$/, Be = /^( *)([-*+])[ \t]+(.*)$/, Ve = /^( *)(\d{1,9})[.)][ \t]+(.*)$/, He = /^ {0,3}(=+|-+)[ \t]*$/, Ue = /^\[([ xX])\][ \t]+(.*)$/, We = /^ {0,3}\|?(?:[ \t]*:?-+:?[ \t]*\|)+[ \t]*:?-*:?[ \t]*\|?[ \t]*$/, Ge = (e) => (/^[ \t]*/.exec(e)[0].match(/\t/g) || []).length * 3 + /^[ \t]*/.exec(e)[0].length;
|
|
751
|
+
function Ke(e) {
|
|
752
|
+
let t = Be.exec(e);
|
|
753
|
+
if (t) return {
|
|
754
|
+
indent: t[1].length,
|
|
755
|
+
ordered: !1,
|
|
756
|
+
text: t[3]
|
|
757
|
+
};
|
|
758
|
+
let n = Ve.exec(e);
|
|
759
|
+
return n ? {
|
|
760
|
+
indent: n[1].length,
|
|
761
|
+
ordered: !0,
|
|
762
|
+
start: Number(n[2]),
|
|
763
|
+
text: n[3]
|
|
764
|
+
} : null;
|
|
765
|
+
}
|
|
766
|
+
function qe(e) {
|
|
767
|
+
let t = [], n = "";
|
|
768
|
+
for (let r = 0; r < e.length; r++) e[r] === "\\" && e[r + 1] === "|" ? (n += "|", r += 1) : e[r] === "|" ? (t.push(n), n = "") : n += e[r];
|
|
769
|
+
return t.push(n), t.length && Fe.test(t[0]) && t.shift(), t.length && Fe.test(t[t.length - 1]) && t.pop(), t.map((e) => e.trim());
|
|
770
|
+
}
|
|
771
|
+
var Je = (e) => {
|
|
772
|
+
let t = e.trim(), n = t.startsWith(":"), r = t.endsWith(":");
|
|
773
|
+
return n && r ? "center" : r ? "right" : n ? "left" : null;
|
|
774
|
+
};
|
|
775
|
+
function Ye(e) {
|
|
776
|
+
let t = e.filter((e) => !(e.text && !e.text.trim()));
|
|
777
|
+
if (t.length === 1 && t[0].image && !t[0].href) {
|
|
778
|
+
let { src: e, alt: n, title: r } = t[0].image;
|
|
779
|
+
return [{
|
|
780
|
+
type: "image",
|
|
781
|
+
src: e,
|
|
782
|
+
alt: n,
|
|
783
|
+
caption: r || "",
|
|
784
|
+
align: "left",
|
|
785
|
+
wrap: !1
|
|
786
|
+
}];
|
|
787
|
+
}
|
|
788
|
+
return e.length ? [{
|
|
789
|
+
type: "p",
|
|
790
|
+
parts: e
|
|
791
|
+
}] : [];
|
|
792
|
+
}
|
|
793
|
+
function Xe(e) {
|
|
794
|
+
let t = String(e ?? "").replace(/\r\n?/g, "\n").replace(/^/, "").split("\n"), n = null;
|
|
795
|
+
return t.map((e) => {
|
|
796
|
+
let t = Ie.exec(e);
|
|
797
|
+
return n ? (t && t[1].startsWith(n[0]) && t[1].length >= n.length && (n = null), e) : t ? (n = t[1], e) : e.replace(/^[ \t]+/, (e) => e.replace(/\t/g, " "));
|
|
798
|
+
});
|
|
799
|
+
}
|
|
800
|
+
function Ze(e, t) {
|
|
801
|
+
let n = [], r = 0;
|
|
802
|
+
for (; r < e.length;) {
|
|
803
|
+
let i = e[r];
|
|
804
|
+
if (Fe.test(i)) {
|
|
805
|
+
r += 1;
|
|
806
|
+
continue;
|
|
807
|
+
}
|
|
808
|
+
let a = Ie.exec(i);
|
|
809
|
+
if (a) {
|
|
810
|
+
let t = [], i = r + 1;
|
|
811
|
+
for (; i < e.length;) {
|
|
812
|
+
let n = Ie.exec(e[i]);
|
|
813
|
+
if (n && n[1][0] === a[1][0] && n[1].length >= a[1].length && !n[2]) break;
|
|
814
|
+
t.push(e[i]), i += 1;
|
|
815
|
+
}
|
|
816
|
+
n.push({
|
|
817
|
+
type: "code",
|
|
818
|
+
lang: a[2] || "",
|
|
819
|
+
text: t.join("\n")
|
|
820
|
+
}), r = i + 1;
|
|
821
|
+
continue;
|
|
822
|
+
}
|
|
823
|
+
let o = Le.exec(i);
|
|
824
|
+
if (o) {
|
|
825
|
+
let e = (o[2] ?? "").replace(/[ \t]+#+[ \t]*$/, "");
|
|
826
|
+
n.push({
|
|
827
|
+
type: `h${o[1].length}`,
|
|
828
|
+
parts: Pe(e, t)
|
|
829
|
+
}), r += 1;
|
|
830
|
+
continue;
|
|
831
|
+
}
|
|
832
|
+
if (Re.test(i)) {
|
|
833
|
+
n.push({ type: "divider" }), r += 1;
|
|
834
|
+
continue;
|
|
835
|
+
}
|
|
836
|
+
if (ze.test(i)) {
|
|
837
|
+
let i = [];
|
|
838
|
+
for (; r < e.length;) {
|
|
839
|
+
let t = ze.exec(e[r]);
|
|
840
|
+
if (t) i.push(t[1]);
|
|
841
|
+
else if (!Fe.test(e[r]) && i.length && !Fe.test(i[i.length - 1])) i.push(e[r]);
|
|
842
|
+
else break;
|
|
843
|
+
r += 1;
|
|
844
|
+
}
|
|
845
|
+
let a = Ze(i, t);
|
|
846
|
+
n.push(a.length === 1 && a[0].type === "p" ? {
|
|
847
|
+
type: "quote",
|
|
848
|
+
parts: a[0].parts
|
|
849
|
+
} : {
|
|
850
|
+
type: "quote",
|
|
851
|
+
blocks: a
|
|
852
|
+
});
|
|
853
|
+
continue;
|
|
854
|
+
}
|
|
855
|
+
if (Ke(i)) {
|
|
856
|
+
r = Qe(e, r, n, t);
|
|
857
|
+
continue;
|
|
858
|
+
}
|
|
859
|
+
if (i.includes("|") && r + 1 < e.length && We.test(e[r + 1])) {
|
|
860
|
+
let a = qe(i), o = qe(e[r + 1]).map(Je), s = [a.map((e) => Pe(e, t))], c = r + 2;
|
|
861
|
+
for (; c < e.length && !Fe.test(e[c]) && e[c].includes("|");) {
|
|
862
|
+
let n = qe(e[c]);
|
|
863
|
+
s.push(a.map((e, r) => Pe(n[r] ?? "", t))), c += 1;
|
|
864
|
+
}
|
|
865
|
+
let l = {};
|
|
866
|
+
o.forEach((e, t) => {
|
|
867
|
+
e && s.forEach((n, r) => l[`${r}:${t}`] = { align: e });
|
|
868
|
+
}), n.push({
|
|
869
|
+
type: "table",
|
|
870
|
+
header: !0,
|
|
871
|
+
rows: s,
|
|
872
|
+
cellStyles: l
|
|
873
|
+
}), r = c;
|
|
874
|
+
continue;
|
|
875
|
+
}
|
|
876
|
+
let s = [i];
|
|
877
|
+
for (r += 1; r < e.length && !Fe.test(e[r]);) {
|
|
878
|
+
let i = e[r], a = He.exec(i);
|
|
879
|
+
if (a) {
|
|
880
|
+
n.push({
|
|
881
|
+
type: a[1][0] === "=" ? "h1" : "h2",
|
|
882
|
+
parts: Pe(s.join("\n"), t)
|
|
883
|
+
}), r += 1, s.length = 0;
|
|
884
|
+
break;
|
|
885
|
+
}
|
|
886
|
+
if (Ie.test(i) || Le.test(i) || Re.test(i) || ze.test(i) || Ke(i)) break;
|
|
887
|
+
s.push(i), r += 1;
|
|
888
|
+
}
|
|
889
|
+
s.length && n.push(...Ye(Pe(s.join("\n"), t)));
|
|
890
|
+
}
|
|
891
|
+
return n;
|
|
892
|
+
}
|
|
893
|
+
function Qe(e, t, n, r) {
|
|
894
|
+
let i = Ke(e[t]), a = i.indent, o = [], s = null, c = t;
|
|
895
|
+
for (; c < e.length;) {
|
|
896
|
+
let t = e[c], n = Ke(t);
|
|
897
|
+
if (n && n.indent <= a + 1) {
|
|
898
|
+
if (n.ordered !== i.ordered) break;
|
|
899
|
+
s = { lines: [n.text] }, o.push(s), c += 1;
|
|
900
|
+
continue;
|
|
901
|
+
}
|
|
902
|
+
if (Fe.test(t)) {
|
|
903
|
+
let t = c;
|
|
904
|
+
for (; t < e.length && Fe.test(e[t]);) t += 1;
|
|
905
|
+
if (!(t < e.length && (Ge(e[t]) >= a + 2 || Ke(e[t]) && Ke(e[t]).ordered === i.ordered))) break;
|
|
906
|
+
s?.lines.push(""), c = t;
|
|
907
|
+
continue;
|
|
908
|
+
}
|
|
909
|
+
if (!s) break;
|
|
910
|
+
if (Ge(t) >= a + 2) s.lines.push(t.slice(Math.min(t.length - t.trimStart().length, a + 2)));
|
|
911
|
+
else if (!n) s.lines.push(t.trim());
|
|
912
|
+
else break;
|
|
913
|
+
c += 1;
|
|
914
|
+
}
|
|
915
|
+
return n.push({
|
|
916
|
+
type: i.ordered ? "ol" : "ul",
|
|
917
|
+
...i.ordered && i.start !== 1 ? { start: i.start } : null,
|
|
918
|
+
items: o.map((e) => {
|
|
919
|
+
let t = Ue.exec(e.lines[0] ?? "");
|
|
920
|
+
t && (e.lines[0] = t[2]);
|
|
921
|
+
let n = Ze(e.lines, r), i = n[0]?.type === "p" ? n.shift() : null;
|
|
922
|
+
return {
|
|
923
|
+
parts: i ? i.parts : [],
|
|
924
|
+
...n.length ? { blocks: n } : null,
|
|
925
|
+
...t ? { task: t[1].toLowerCase() === "x" } : null
|
|
926
|
+
};
|
|
927
|
+
})
|
|
928
|
+
}), c;
|
|
929
|
+
}
|
|
930
|
+
function $e(e, t = {}) {
|
|
931
|
+
return String(e ?? "").trim() ? Ze(Xe(e), t) : [];
|
|
932
|
+
}
|
|
933
|
+
//#endregion
|
|
934
|
+
//#region ../ui/src/components/builder/views.jsx
|
|
935
|
+
var Q = t({
|
|
669
936
|
tenant: "",
|
|
670
937
|
apiUrl: "/api",
|
|
671
938
|
locale: "",
|
|
672
939
|
settings: null
|
|
673
|
-
}),
|
|
940
|
+
}), et = t(null), tt = (e) => {
|
|
674
941
|
let t = Number(e?.__page);
|
|
675
942
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
676
943
|
if (typeof window > "u") return 1;
|
|
677
944
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
678
945
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
679
|
-
},
|
|
946
|
+
}, nt = () => {
|
|
680
947
|
if (typeof window > "u") return {};
|
|
681
948
|
let e = {};
|
|
682
949
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
683
950
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
684
951
|
}), e;
|
|
685
|
-
},
|
|
952
|
+
}, rt = (e) => {
|
|
686
953
|
let t = {
|
|
687
954
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
688
|
-
...
|
|
955
|
+
...nt()
|
|
689
956
|
};
|
|
690
957
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
691
|
-
},
|
|
692
|
-
function
|
|
958
|
+
}, it = t(null), at = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
959
|
+
function ot(e, t) {
|
|
693
960
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
694
961
|
}
|
|
695
|
-
var
|
|
962
|
+
var st = (e) => {
|
|
696
963
|
let t = [];
|
|
697
964
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
698
965
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -702,39 +969,39 @@ var De = (e) => {
|
|
|
702
969
|
}
|
|
703
970
|
return t;
|
|
704
971
|
};
|
|
705
|
-
function
|
|
972
|
+
function ct(e) {
|
|
706
973
|
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 ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : 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(" ") : "";
|
|
707
974
|
}
|
|
708
|
-
function
|
|
709
|
-
let n = t?.data ?? {}, r =
|
|
975
|
+
function lt(e, t) {
|
|
976
|
+
let n = t?.data ?? {}, r = st(n);
|
|
710
977
|
if (!r.length) return e;
|
|
711
|
-
let i = RegExp(`:(${r.map(
|
|
978
|
+
let i = RegExp(`:(${r.map(at).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => ct(ot(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
712
979
|
return a(e);
|
|
713
980
|
}
|
|
714
|
-
var
|
|
981
|
+
var ut = {
|
|
715
982
|
margin: 0,
|
|
716
983
|
fontWeight: 700,
|
|
717
984
|
lineHeight: 1.2,
|
|
718
985
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
719
|
-
},
|
|
986
|
+
}, dt = q, ft = (e) => `var(--page-${e}, ${q[e] ?? q.h2}px)`, pt = {
|
|
720
987
|
margin: 0,
|
|
721
988
|
fontSize: "var(--page-body-size, 16px)"
|
|
722
|
-
},
|
|
989
|
+
}, mt = {
|
|
723
990
|
display: "inline-block",
|
|
724
991
|
textDecoration: "none",
|
|
725
992
|
cursor: "pointer",
|
|
726
993
|
backgroundColor: "var(--page-accent, #111827)",
|
|
727
994
|
color: "var(--page-accent-text, #ffffff)"
|
|
728
|
-
},
|
|
995
|
+
}, ht = {
|
|
729
996
|
flexGrow: 1,
|
|
730
997
|
display: "flex",
|
|
731
998
|
flexDirection: "column",
|
|
732
999
|
position: "relative"
|
|
733
|
-
},
|
|
1000
|
+
}, gt = {
|
|
734
1001
|
display: "flex",
|
|
735
1002
|
flexDirection: "column"
|
|
736
1003
|
};
|
|
737
|
-
function
|
|
1004
|
+
function _t({ style: e }) {
|
|
738
1005
|
let t = e?.backgroundVideo;
|
|
739
1006
|
if (!t) return null;
|
|
740
1007
|
let n = {
|
|
@@ -760,7 +1027,7 @@ function Le({ style: e }) {
|
|
|
760
1027
|
background: r
|
|
761
1028
|
} })] });
|
|
762
1029
|
}
|
|
763
|
-
var
|
|
1030
|
+
var vt = (e, t) => e?.backgroundVideo ? {
|
|
764
1031
|
position: "relative",
|
|
765
1032
|
...t,
|
|
766
1033
|
...A(e)
|
|
@@ -768,24 +1035,24 @@ var Re = (e, t) => e?.backgroundVideo ? {
|
|
|
768
1035
|
...t,
|
|
769
1036
|
...A(e)
|
|
770
1037
|
};
|
|
771
|
-
function
|
|
1038
|
+
function yt({ style: e, nodeRef: t, children: n }) {
|
|
772
1039
|
return /* @__PURE__ */ d("div", {
|
|
773
1040
|
ref: t,
|
|
774
1041
|
style: {
|
|
775
|
-
...
|
|
1042
|
+
...ht,
|
|
776
1043
|
...A(e)
|
|
777
1044
|
},
|
|
778
|
-
children: [/* @__PURE__ */ u(
|
|
1045
|
+
children: [/* @__PURE__ */ u(_t, { style: e }), n]
|
|
779
1046
|
});
|
|
780
1047
|
}
|
|
781
|
-
function
|
|
1048
|
+
function bt({ style: e, nodeRef: t, children: n }) {
|
|
782
1049
|
return /* @__PURE__ */ d("section", {
|
|
783
1050
|
ref: t,
|
|
784
|
-
style:
|
|
785
|
-
children: [/* @__PURE__ */ u(
|
|
1051
|
+
style: vt(e, gt),
|
|
1052
|
+
children: [/* @__PURE__ */ u(_t, { style: e }), n]
|
|
786
1053
|
});
|
|
787
1054
|
}
|
|
788
|
-
function
|
|
1055
|
+
function xt({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
789
1056
|
let i = t ? {
|
|
790
1057
|
position: "relative",
|
|
791
1058
|
minHeight: 240
|
|
@@ -794,33 +1061,43 @@ function Ve({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
794
1061
|
ref: n,
|
|
795
1062
|
style: i ? {
|
|
796
1063
|
...i,
|
|
797
|
-
...
|
|
798
|
-
} :
|
|
799
|
-
children: [/* @__PURE__ */ u(
|
|
1064
|
+
...vt(e)
|
|
1065
|
+
} : vt(e),
|
|
1066
|
+
children: [/* @__PURE__ */ u(_t, { style: e }), r]
|
|
800
1067
|
});
|
|
801
1068
|
}
|
|
802
|
-
function
|
|
1069
|
+
function St({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
803
1070
|
return /* @__PURE__ */ u(n, {
|
|
804
1071
|
ref: a,
|
|
805
1072
|
style: {
|
|
806
|
-
...
|
|
807
|
-
fontSize:
|
|
1073
|
+
...ut,
|
|
1074
|
+
fontSize: ft(n),
|
|
808
1075
|
...A(r)
|
|
809
1076
|
},
|
|
810
|
-
children:
|
|
1077
|
+
children: Et(t, e, i)
|
|
811
1078
|
});
|
|
812
1079
|
}
|
|
813
|
-
var
|
|
814
|
-
fontFamily:
|
|
1080
|
+
var Ct = {
|
|
1081
|
+
fontFamily: se.mono.value,
|
|
815
1082
|
background: "rgba(148, 163, 184, 0.18)",
|
|
816
1083
|
padding: "1px 5px",
|
|
817
1084
|
borderRadius: 4,
|
|
818
1085
|
fontSize: "0.9em"
|
|
1086
|
+
}, wt = {
|
|
1087
|
+
fontFamily: se.mono.value,
|
|
1088
|
+
background: "rgba(148, 163, 184, 0.16)",
|
|
1089
|
+
border: "1px solid rgba(148, 163, 184, 0.3)",
|
|
1090
|
+
borderRadius: 6,
|
|
1091
|
+
padding: "12px 14px",
|
|
1092
|
+
fontSize: "0.875em",
|
|
1093
|
+
lineHeight: 1.55,
|
|
1094
|
+
overflowX: "auto",
|
|
1095
|
+
whiteSpace: "pre"
|
|
819
1096
|
};
|
|
820
|
-
function
|
|
1097
|
+
function Tt(e, t = [], n, r) {
|
|
821
1098
|
let i = e;
|
|
822
1099
|
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", {
|
|
823
|
-
style:
|
|
1100
|
+
style: Ct,
|
|
824
1101
|
children: i
|
|
825
1102
|
})), 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", {
|
|
826
1103
|
href: n,
|
|
@@ -836,13 +1113,22 @@ function We(e, t = [], n, r) {
|
|
|
836
1113
|
children: i
|
|
837
1114
|
})), i;
|
|
838
1115
|
}
|
|
839
|
-
function
|
|
1116
|
+
function Et(t, n, r) {
|
|
840
1117
|
return t?.length ? t.map((t, n) => {
|
|
841
1118
|
if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
|
|
842
|
-
if (t.parts) return /* @__PURE__ */ u(e, { children:
|
|
1119
|
+
if (t.parts) return /* @__PURE__ */ u(e, { children: Et(t.parts, "", r) }, n);
|
|
1120
|
+
if (t.br) return /* @__PURE__ */ u("br", {}, n);
|
|
843
1121
|
let i = t.text;
|
|
844
|
-
return t.
|
|
845
|
-
|
|
1122
|
+
return t.image && (i = /* @__PURE__ */ u("img", {
|
|
1123
|
+
src: t.image.src,
|
|
1124
|
+
alt: t.image.alt || "",
|
|
1125
|
+
title: t.image.title || void 0,
|
|
1126
|
+
style: {
|
|
1127
|
+
maxWidth: "100%",
|
|
1128
|
+
verticalAlign: "middle"
|
|
1129
|
+
}
|
|
1130
|
+
})), t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
|
|
1131
|
+
style: Ct,
|
|
846
1132
|
children: i
|
|
847
1133
|
})), 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", {
|
|
848
1134
|
style: {
|
|
@@ -865,35 +1151,35 @@ function Ge(t, n, r) {
|
|
|
865
1151
|
})), /* @__PURE__ */ u(e, { children: i }, n);
|
|
866
1152
|
}) : n;
|
|
867
1153
|
}
|
|
868
|
-
function
|
|
1154
|
+
function Dt({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
869
1155
|
return /* @__PURE__ */ u("span", {
|
|
870
1156
|
style: A(a),
|
|
871
|
-
children: e?.length ?
|
|
1157
|
+
children: e?.length ? Et(e, t) : Tt(t, n, r, i)
|
|
872
1158
|
});
|
|
873
1159
|
}
|
|
874
|
-
var
|
|
1160
|
+
var Ot = [
|
|
875
1161
|
"left",
|
|
876
1162
|
"center",
|
|
877
1163
|
"right",
|
|
878
1164
|
"justify"
|
|
879
1165
|
];
|
|
880
|
-
function
|
|
1166
|
+
function kt(e, t, n) {
|
|
881
1167
|
let r = e && e.cellStyles;
|
|
882
1168
|
if (!r || typeof r != "object" || Array.isArray(r)) return {};
|
|
883
1169
|
let i = r[`${t}:${n}`];
|
|
884
1170
|
return i && typeof i == "object" && !Array.isArray(i) ? i : {};
|
|
885
1171
|
}
|
|
886
|
-
function
|
|
1172
|
+
function At(e, t) {
|
|
887
1173
|
let n = e || {}, r = typeof n.bold == "boolean" ? n.bold : !!t;
|
|
888
1174
|
return {
|
|
889
|
-
textAlign:
|
|
1175
|
+
textAlign: Ot.includes(n.align) ? n.align : "left",
|
|
890
1176
|
fontWeight: r ? 700 : 400,
|
|
891
1177
|
fontStyle: n.italic ? "italic" : void 0,
|
|
892
1178
|
color: typeof n.color == "string" && n.color ? n.color : void 0,
|
|
893
1179
|
backgroundColor: typeof n.bg == "string" && n.bg ? n.bg : void 0
|
|
894
1180
|
};
|
|
895
1181
|
}
|
|
896
|
-
function
|
|
1182
|
+
function jt({ align: e = "center", width: t, wrap: n } = {}) {
|
|
897
1183
|
let r = t ? `${t}%` : void 0;
|
|
898
1184
|
if (e === "full") return { width: "100%" };
|
|
899
1185
|
let i = e === "left" || e === "right";
|
|
@@ -927,18 +1213,18 @@ function Xe({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
927
1213
|
marginRight: "auto"
|
|
928
1214
|
};
|
|
929
1215
|
}
|
|
930
|
-
function
|
|
931
|
-
let r = n ?? ((e, n) =>
|
|
932
|
-
return e.map((
|
|
933
|
-
let
|
|
1216
|
+
function Mt(e = [], t, n) {
|
|
1217
|
+
let r = n ?? ((e, n) => Et(e, n, t));
|
|
1218
|
+
return e.map((n, i) => {
|
|
1219
|
+
let a = {
|
|
934
1220
|
marginTop: 0,
|
|
935
|
-
marginBottom:
|
|
1221
|
+
marginBottom: i === e.length - 1 ? 0 : 14
|
|
936
1222
|
};
|
|
937
|
-
if (
|
|
938
|
-
if (!
|
|
1223
|
+
if (n.type === "image") {
|
|
1224
|
+
if (!n.src) return null;
|
|
939
1225
|
let e = /* @__PURE__ */ u("img", {
|
|
940
|
-
src:
|
|
941
|
-
alt:
|
|
1226
|
+
src: n.src,
|
|
1227
|
+
alt: n.alt || "",
|
|
942
1228
|
style: {
|
|
943
1229
|
width: "100%",
|
|
944
1230
|
display: "block",
|
|
@@ -949,51 +1235,51 @@ function Ze(e = [], t, n) {
|
|
|
949
1235
|
style: {
|
|
950
1236
|
marginLeft: 0,
|
|
951
1237
|
marginRight: 0,
|
|
952
|
-
...
|
|
953
|
-
...
|
|
1238
|
+
...a,
|
|
1239
|
+
...jt(n)
|
|
954
1240
|
},
|
|
955
|
-
children: [
|
|
956
|
-
href:
|
|
957
|
-
target:
|
|
958
|
-
rel:
|
|
1241
|
+
children: [n.href ? /* @__PURE__ */ u("a", {
|
|
1242
|
+
href: n.href,
|
|
1243
|
+
target: n.target || void 0,
|
|
1244
|
+
rel: n.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
959
1245
|
style: { display: "block" },
|
|
960
1246
|
children: e
|
|
961
|
-
}) : e,
|
|
1247
|
+
}) : e, n.caption && /* @__PURE__ */ u("figcaption", {
|
|
962
1248
|
style: {
|
|
963
1249
|
fontSize: 13,
|
|
964
1250
|
opacity: .65,
|
|
965
1251
|
marginTop: 6,
|
|
966
1252
|
textAlign: "center"
|
|
967
1253
|
},
|
|
968
|
-
children:
|
|
1254
|
+
children: n.caption
|
|
969
1255
|
})]
|
|
970
|
-
},
|
|
1256
|
+
}, i);
|
|
971
1257
|
}
|
|
972
|
-
if (
|
|
1258
|
+
if (n.type === "video") return Wt(n.url) ? /* @__PURE__ */ u("div", {
|
|
973
1259
|
style: {
|
|
974
|
-
...
|
|
975
|
-
...
|
|
976
|
-
align:
|
|
977
|
-
wrap:
|
|
978
|
-
width:
|
|
1260
|
+
...a,
|
|
1261
|
+
...jt({
|
|
1262
|
+
align: n.align,
|
|
1263
|
+
wrap: n.wrap,
|
|
1264
|
+
width: n.width ?? 100
|
|
979
1265
|
})
|
|
980
1266
|
},
|
|
981
|
-
children: /* @__PURE__ */ u(
|
|
982
|
-
url:
|
|
983
|
-
autoplay:
|
|
984
|
-
muted:
|
|
985
|
-
loop:
|
|
986
|
-
controls:
|
|
987
|
-
start:
|
|
1267
|
+
children: /* @__PURE__ */ u(Gt, {
|
|
1268
|
+
url: n.url,
|
|
1269
|
+
autoplay: n.autoplay,
|
|
1270
|
+
muted: n.muted,
|
|
1271
|
+
loop: n.loop,
|
|
1272
|
+
controls: n.controls ?? !0,
|
|
1273
|
+
start: n.start
|
|
988
1274
|
})
|
|
989
|
-
},
|
|
990
|
-
if (
|
|
991
|
-
if (!(typeof
|
|
992
|
-
let e = Number.isFinite(Number(
|
|
1275
|
+
}, i) : null;
|
|
1276
|
+
if (n.type === "button") {
|
|
1277
|
+
if (!(typeof n.label == "string" && n.label.trim())) return null;
|
|
1278
|
+
let e = Number.isFinite(Number(n.radius)) ? Number(n.radius) : 8, t = ["center", "right"].includes(n.align) ? n.align : "left";
|
|
993
1279
|
return /* @__PURE__ */ u("div", {
|
|
994
1280
|
style: {
|
|
995
|
-
...
|
|
996
|
-
textAlign:
|
|
1281
|
+
...a,
|
|
1282
|
+
textAlign: t
|
|
997
1283
|
},
|
|
998
1284
|
children: /* @__PURE__ */ u("table", {
|
|
999
1285
|
role: "presentation",
|
|
@@ -1005,132 +1291,171 @@ function Ze(e = [], t, n) {
|
|
|
1005
1291
|
},
|
|
1006
1292
|
children: /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
1007
1293
|
style: {
|
|
1008
|
-
backgroundColor:
|
|
1294
|
+
backgroundColor: n.bg || "var(--page-accent, #4f46e5)",
|
|
1009
1295
|
borderRadius: e
|
|
1010
1296
|
},
|
|
1011
1297
|
children: /* @__PURE__ */ u("a", {
|
|
1012
|
-
href:
|
|
1013
|
-
target:
|
|
1014
|
-
rel:
|
|
1298
|
+
href: n.href || "#",
|
|
1299
|
+
target: n.target || void 0,
|
|
1300
|
+
rel: n.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
1015
1301
|
style: {
|
|
1016
1302
|
display: "inline-block",
|
|
1017
1303
|
padding: "13px 24px",
|
|
1018
|
-
color:
|
|
1304
|
+
color: n.color || "#ffffff",
|
|
1019
1305
|
fontSize: 15,
|
|
1020
1306
|
fontWeight: 600,
|
|
1021
1307
|
lineHeight: 1.2,
|
|
1022
1308
|
textDecoration: "none",
|
|
1023
1309
|
borderRadius: e
|
|
1024
1310
|
},
|
|
1025
|
-
children:
|
|
1311
|
+
children: n.label
|
|
1026
1312
|
})
|
|
1027
1313
|
}) }) })
|
|
1028
1314
|
})
|
|
1029
|
-
},
|
|
1315
|
+
}, i);
|
|
1030
1316
|
}
|
|
1031
|
-
if (
|
|
1032
|
-
...
|
|
1317
|
+
if (n.type === "divider") return /* @__PURE__ */ u("hr", { style: {
|
|
1318
|
+
...a,
|
|
1033
1319
|
border: 0,
|
|
1034
1320
|
borderTop: "1px solid rgba(148, 163, 184, 0.4)"
|
|
1035
|
-
} },
|
|
1036
|
-
if (
|
|
1037
|
-
let e = Array.isArray(
|
|
1321
|
+
} }, i);
|
|
1322
|
+
if (n.type === "table") {
|
|
1323
|
+
let e = Array.isArray(n.rows) ? n.rows.filter(Array.isArray) : [];
|
|
1038
1324
|
if (!e.length) return null;
|
|
1039
|
-
let
|
|
1040
|
-
border:
|
|
1325
|
+
let t = n.header !== !1, o = {
|
|
1326
|
+
border: n.borders === !1 ? void 0 : "1px solid rgba(148, 163, 184, 0.4)",
|
|
1041
1327
|
padding: "6px 10px",
|
|
1042
1328
|
verticalAlign: "top"
|
|
1043
|
-
},
|
|
1044
|
-
...
|
|
1045
|
-
...
|
|
1329
|
+
}, s = t ? e.slice(1) : e, c = Array.isArray(n.widths) ? n.widths : null, l = (e, t, r) => ({
|
|
1330
|
+
...o,
|
|
1331
|
+
...At(kt(n, e, t), r)
|
|
1046
1332
|
});
|
|
1047
1333
|
return /* @__PURE__ */ d("table", {
|
|
1048
1334
|
style: {
|
|
1049
|
-
...
|
|
1335
|
+
...a,
|
|
1050
1336
|
borderCollapse: "collapse",
|
|
1051
1337
|
width: "100%",
|
|
1052
1338
|
fontSize: "inherit",
|
|
1053
|
-
tableLayout:
|
|
1339
|
+
tableLayout: c ? "fixed" : void 0
|
|
1054
1340
|
},
|
|
1055
1341
|
children: [
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
style:
|
|
1059
|
-
children: e
|
|
1342
|
+
c && /* @__PURE__ */ u("colgroup", { children: c.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
|
|
1343
|
+
t && /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e[0].map((e, t) => /* @__PURE__ */ u("th", {
|
|
1344
|
+
style: l(0, t, !0),
|
|
1345
|
+
children: Array.isArray(e) ? r(e) : e
|
|
1060
1346
|
}, t)) }) }),
|
|
1061
|
-
/* @__PURE__ */ u("tbody", { children:
|
|
1062
|
-
style:
|
|
1063
|
-
children: e
|
|
1064
|
-
},
|
|
1347
|
+
/* @__PURE__ */ u("tbody", { children: s.map((e, n) => /* @__PURE__ */ u("tr", { children: e.map((e, i) => /* @__PURE__ */ u("td", {
|
|
1348
|
+
style: l(t ? n + 1 : n, i, !1),
|
|
1349
|
+
children: Array.isArray(e) ? r(e) : e
|
|
1350
|
+
}, i)) }, n)) })
|
|
1065
1351
|
]
|
|
1066
|
-
},
|
|
1352
|
+
}, i);
|
|
1067
1353
|
}
|
|
1068
|
-
if (
|
|
1069
|
-
let e =
|
|
1354
|
+
if (n.type === "ul" || n.type === "ol") {
|
|
1355
|
+
let e = n.type;
|
|
1070
1356
|
return /* @__PURE__ */ u(e, {
|
|
1071
1357
|
style: {
|
|
1072
|
-
...
|
|
1358
|
+
...a,
|
|
1073
1359
|
paddingLeft: 24
|
|
1074
1360
|
},
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1361
|
+
start: n.type === "ol" ? n.start : void 0,
|
|
1362
|
+
children: (n.items ?? []).map((e, n) => {
|
|
1363
|
+
let i = typeof e.task == "boolean";
|
|
1364
|
+
return /* @__PURE__ */ d("li", {
|
|
1365
|
+
style: {
|
|
1366
|
+
marginBottom: 4,
|
|
1367
|
+
...i && {
|
|
1368
|
+
listStyleType: "none",
|
|
1369
|
+
marginLeft: -18
|
|
1370
|
+
}
|
|
1371
|
+
},
|
|
1372
|
+
children: [
|
|
1373
|
+
i && /* @__PURE__ */ u("span", {
|
|
1374
|
+
style: { marginRight: 6 },
|
|
1375
|
+
children: e.task ? "☑" : "☐"
|
|
1376
|
+
}),
|
|
1377
|
+
r(e.parts, e.text),
|
|
1378
|
+
e.blocks?.length ? Mt(e.blocks, t, r) : null
|
|
1379
|
+
]
|
|
1380
|
+
}, n);
|
|
1381
|
+
})
|
|
1382
|
+
}, i);
|
|
1080
1383
|
}
|
|
1081
|
-
if (
|
|
1384
|
+
if (n.type === "quote") return /* @__PURE__ */ u("blockquote", {
|
|
1082
1385
|
style: {
|
|
1083
|
-
|
|
1084
|
-
...
|
|
1386
|
+
...Ft,
|
|
1387
|
+
...a
|
|
1085
1388
|
},
|
|
1086
|
-
children: r(
|
|
1087
|
-
},
|
|
1088
|
-
if (
|
|
1089
|
-
|
|
1389
|
+
children: n.blocks?.length ? Mt(n.blocks, t, r) : r(n.parts, n.text)
|
|
1390
|
+
}, i);
|
|
1391
|
+
if (n.type === "code") return /* @__PURE__ */ u("pre", {
|
|
1392
|
+
"data-lang": n.lang || void 0,
|
|
1393
|
+
style: {
|
|
1394
|
+
...a,
|
|
1395
|
+
...wt
|
|
1396
|
+
},
|
|
1397
|
+
children: /* @__PURE__ */ u("code", {
|
|
1398
|
+
style: { fontFamily: "inherit" },
|
|
1399
|
+
children: n.text
|
|
1400
|
+
})
|
|
1401
|
+
}, i);
|
|
1402
|
+
if (dt[n.type]) {
|
|
1403
|
+
let e = n.type;
|
|
1090
1404
|
return /* @__PURE__ */ u(e, {
|
|
1091
1405
|
style: {
|
|
1092
|
-
...
|
|
1093
|
-
fontSize:
|
|
1094
|
-
...
|
|
1406
|
+
...ut,
|
|
1407
|
+
fontSize: ft(n.type),
|
|
1408
|
+
...a
|
|
1095
1409
|
},
|
|
1096
|
-
children: r(
|
|
1097
|
-
},
|
|
1410
|
+
children: r(n.parts, n.text)
|
|
1411
|
+
}, i);
|
|
1098
1412
|
}
|
|
1099
1413
|
return /* @__PURE__ */ u("p", {
|
|
1100
1414
|
style: {
|
|
1101
|
-
...
|
|
1102
|
-
...
|
|
1415
|
+
...pt,
|
|
1416
|
+
...a
|
|
1103
1417
|
},
|
|
1104
|
-
children: r(
|
|
1105
|
-
},
|
|
1418
|
+
children: r(n.parts, n.text)
|
|
1419
|
+
}, i);
|
|
1106
1420
|
});
|
|
1107
1421
|
}
|
|
1108
|
-
function
|
|
1422
|
+
function Nt({ content: e, style: t, linked: n, nodeRef: r }) {
|
|
1109
1423
|
return /* @__PURE__ */ u("div", {
|
|
1110
1424
|
ref: r,
|
|
1111
1425
|
style: {
|
|
1112
1426
|
display: "flow-root",
|
|
1113
1427
|
...A(t)
|
|
1114
1428
|
},
|
|
1115
|
-
children:
|
|
1429
|
+
children: Mt(e, n)
|
|
1430
|
+
});
|
|
1431
|
+
}
|
|
1432
|
+
function Pt({ markdown: e, newTab: t, style: n, nodeRef: r }) {
|
|
1433
|
+
let i = o(() => $e(e, { newTab: t }), [e, t]);
|
|
1434
|
+
return /* @__PURE__ */ u("div", {
|
|
1435
|
+
ref: r,
|
|
1436
|
+
style: {
|
|
1437
|
+
display: "flow-root",
|
|
1438
|
+
...A(n)
|
|
1439
|
+
},
|
|
1440
|
+
children: Mt(i)
|
|
1116
1441
|
});
|
|
1117
1442
|
}
|
|
1118
|
-
var
|
|
1443
|
+
var Ft = {
|
|
1119
1444
|
margin: 0,
|
|
1120
1445
|
padding: "8px 0 8px 20px",
|
|
1121
1446
|
borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
|
|
1122
1447
|
};
|
|
1123
|
-
function
|
|
1448
|
+
function It({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1124
1449
|
return /* @__PURE__ */ u("blockquote", {
|
|
1125
1450
|
ref: i,
|
|
1126
1451
|
style: {
|
|
1127
|
-
|
|
1452
|
+
...Ft,
|
|
1128
1453
|
...A(n)
|
|
1129
1454
|
},
|
|
1130
|
-
children:
|
|
1455
|
+
children: Et(t, e, r)
|
|
1131
1456
|
});
|
|
1132
1457
|
}
|
|
1133
|
-
function
|
|
1458
|
+
function Lt({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
1134
1459
|
return /* @__PURE__ */ u(e ? "ol" : "ul", {
|
|
1135
1460
|
ref: r,
|
|
1136
1461
|
style: {
|
|
@@ -1140,53 +1465,53 @@ function tt({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
1140
1465
|
},
|
|
1141
1466
|
children: t.map((e, t) => /* @__PURE__ */ u("li", {
|
|
1142
1467
|
style: { marginBottom: 4 },
|
|
1143
|
-
children:
|
|
1468
|
+
children: Et(e.parts, e.text)
|
|
1144
1469
|
}, t))
|
|
1145
1470
|
});
|
|
1146
1471
|
}
|
|
1147
|
-
function
|
|
1472
|
+
function Rt({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
1148
1473
|
return /* @__PURE__ */ u("p", {
|
|
1149
1474
|
ref: i,
|
|
1150
1475
|
style: {
|
|
1151
|
-
...
|
|
1476
|
+
...pt,
|
|
1152
1477
|
...A(n)
|
|
1153
1478
|
},
|
|
1154
|
-
children:
|
|
1479
|
+
children: Et(t, e, r)
|
|
1155
1480
|
});
|
|
1156
1481
|
}
|
|
1157
|
-
var
|
|
1482
|
+
var zt = {
|
|
1158
1483
|
color: "var(--page-accent, inherit)",
|
|
1159
1484
|
textDecoration: "underline",
|
|
1160
1485
|
textUnderlineOffset: 3,
|
|
1161
1486
|
cursor: "pointer"
|
|
1162
1487
|
};
|
|
1163
|
-
function
|
|
1488
|
+
function Bt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1164
1489
|
return /* @__PURE__ */ u("a", {
|
|
1165
1490
|
ref: o,
|
|
1166
1491
|
href: n || "#",
|
|
1167
1492
|
target: r || void 0,
|
|
1168
1493
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1169
1494
|
style: {
|
|
1170
|
-
...
|
|
1495
|
+
...zt,
|
|
1171
1496
|
...A(i)
|
|
1172
1497
|
},
|
|
1173
|
-
children:
|
|
1498
|
+
children: Et(t, e, a)
|
|
1174
1499
|
});
|
|
1175
1500
|
}
|
|
1176
|
-
function
|
|
1501
|
+
function Vt({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
1177
1502
|
return /* @__PURE__ */ u("a", {
|
|
1178
1503
|
ref: o,
|
|
1179
1504
|
href: n || "#",
|
|
1180
1505
|
target: r || void 0,
|
|
1181
1506
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1182
1507
|
style: {
|
|
1183
|
-
...
|
|
1508
|
+
...mt,
|
|
1184
1509
|
...A(i)
|
|
1185
1510
|
},
|
|
1186
|
-
children:
|
|
1511
|
+
children: Et(t, e, a)
|
|
1187
1512
|
});
|
|
1188
1513
|
}
|
|
1189
|
-
function
|
|
1514
|
+
function Ht({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
1190
1515
|
return e ? /* @__PURE__ */ u("img", {
|
|
1191
1516
|
ref: r,
|
|
1192
1517
|
src: e,
|
|
@@ -1198,7 +1523,7 @@ function ot({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
|
1198
1523
|
}
|
|
1199
1524
|
}) : null;
|
|
1200
1525
|
}
|
|
1201
|
-
function
|
|
1526
|
+
function Ut({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
|
|
1202
1527
|
return e ? /* @__PURE__ */ u("video", {
|
|
1203
1528
|
ref: s,
|
|
1204
1529
|
src: e,
|
|
@@ -1216,9 +1541,9 @@ function st({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
|
|
|
1216
1541
|
}
|
|
1217
1542
|
}) : null;
|
|
1218
1543
|
}
|
|
1219
|
-
var
|
|
1220
|
-
function
|
|
1221
|
-
let c =
|
|
1544
|
+
var Wt = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
|
|
1545
|
+
function Gt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
|
|
1546
|
+
let c = Wt(e);
|
|
1222
1547
|
if (!c) return null;
|
|
1223
1548
|
let l = new URLSearchParams({ rel: "0" });
|
|
1224
1549
|
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", {
|
|
@@ -1244,7 +1569,7 @@ function lt({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
|
|
|
1244
1569
|
})
|
|
1245
1570
|
});
|
|
1246
1571
|
}
|
|
1247
|
-
function
|
|
1572
|
+
function Kt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
|
|
1248
1573
|
return e ? /* @__PURE__ */ u("iframe", {
|
|
1249
1574
|
ref: i,
|
|
1250
1575
|
src: e,
|
|
@@ -1260,26 +1585,33 @@ function ut({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
1260
1585
|
}
|
|
1261
1586
|
}) : null;
|
|
1262
1587
|
}
|
|
1263
|
-
|
|
1264
|
-
|
|
1588
|
+
var qt = /(^|[\s,>+~{}])(:root|html|body)(?=$|[\s,{.:#[>+~])/g;
|
|
1589
|
+
function Jt(e) {
|
|
1590
|
+
return `@scope ([data-wb-embed]) {\n${e.replace(qt, "$1:scope")}\n}`;
|
|
1591
|
+
}
|
|
1592
|
+
function Yt({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRef: a }) {
|
|
1593
|
+
let [o, s] = c(null);
|
|
1265
1594
|
return i(() => {
|
|
1266
|
-
|
|
1595
|
+
o && (o.innerHTML = e || "", n ? (o.setAttribute("data-wb-embed", ""), o.querySelectorAll("style").forEach((e) => {
|
|
1596
|
+
e.textContent = Jt(e.textContent || "");
|
|
1597
|
+
})) : o.removeAttribute("data-wb-embed"), t && o.querySelectorAll("script").forEach((e) => {
|
|
1267
1598
|
let t = document.createElement("script");
|
|
1268
1599
|
for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
|
|
1269
1600
|
t.text = e.textContent, e.replaceWith(t);
|
|
1270
1601
|
}));
|
|
1271
1602
|
}, [
|
|
1272
|
-
|
|
1603
|
+
o,
|
|
1273
1604
|
e,
|
|
1274
|
-
t
|
|
1605
|
+
t,
|
|
1606
|
+
n
|
|
1275
1607
|
]), /* @__PURE__ */ u("div", {
|
|
1276
1608
|
ref: (e) => {
|
|
1277
|
-
|
|
1609
|
+
s(e), a && a(e);
|
|
1278
1610
|
},
|
|
1279
|
-
style: A(
|
|
1611
|
+
style: A(r)
|
|
1280
1612
|
});
|
|
1281
1613
|
}
|
|
1282
|
-
function
|
|
1614
|
+
function Xt({ height: e, style: t, nodeRef: n }) {
|
|
1283
1615
|
return /* @__PURE__ */ u("div", {
|
|
1284
1616
|
ref: n,
|
|
1285
1617
|
style: {
|
|
@@ -1290,7 +1622,7 @@ function ft({ height: e, style: t, nodeRef: n }) {
|
|
|
1290
1622
|
}
|
|
1291
1623
|
});
|
|
1292
1624
|
}
|
|
1293
|
-
function
|
|
1625
|
+
function Zt({ style: e, nodeRef: t }) {
|
|
1294
1626
|
return /* @__PURE__ */ u("div", {
|
|
1295
1627
|
ref: t,
|
|
1296
1628
|
style: {
|
|
@@ -1301,7 +1633,7 @@ function pt({ style: e, nodeRef: t }) {
|
|
|
1301
1633
|
}
|
|
1302
1634
|
});
|
|
1303
1635
|
}
|
|
1304
|
-
function
|
|
1636
|
+
function Qt({ style: e, nodeRef: t }) {
|
|
1305
1637
|
return /* @__PURE__ */ u("div", {
|
|
1306
1638
|
ref: t,
|
|
1307
1639
|
style: {
|
|
@@ -1310,7 +1642,7 @@ function mt({ style: e, nodeRef: t }) {
|
|
|
1310
1642
|
}
|
|
1311
1643
|
});
|
|
1312
1644
|
}
|
|
1313
|
-
var
|
|
1645
|
+
var $t = {
|
|
1314
1646
|
position: "absolute",
|
|
1315
1647
|
top: "50%",
|
|
1316
1648
|
transform: "translateY(-50%)",
|
|
@@ -1327,7 +1659,7 @@ var ht = {
|
|
|
1327
1659
|
alignItems: "center",
|
|
1328
1660
|
justifyContent: "center",
|
|
1329
1661
|
padding: 0
|
|
1330
|
-
},
|
|
1662
|
+
}, en = {
|
|
1331
1663
|
bottom: {
|
|
1332
1664
|
inset: "auto 0 0 0",
|
|
1333
1665
|
padding: "40px 24px 20px",
|
|
@@ -1346,8 +1678,8 @@ var ht = {
|
|
|
1346
1678
|
padding: 24,
|
|
1347
1679
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1348
1680
|
}
|
|
1349
|
-
},
|
|
1350
|
-
function
|
|
1681
|
+
}, tn = 48;
|
|
1682
|
+
function nn({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
|
|
1351
1683
|
let [p, m] = c(0), [h, g] = c(!1), [_, v] = c(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1352
1684
|
if (i(() => {
|
|
1353
1685
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1363,7 +1695,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1363
1695
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1364
1696
|
if (!_) return;
|
|
1365
1697
|
let { dx: e } = _;
|
|
1366
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1698
|
+
v(null), e < -48 ? b(y + 1) : e > tn && b(y - 1);
|
|
1367
1699
|
};
|
|
1368
1700
|
return /* @__PURE__ */ d("div", {
|
|
1369
1701
|
ref: f,
|
|
@@ -1412,7 +1744,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1412
1744
|
type: "button",
|
|
1413
1745
|
"aria-label": "Previous slide",
|
|
1414
1746
|
style: {
|
|
1415
|
-
|
|
1747
|
+
...$t,
|
|
1416
1748
|
left: 12
|
|
1417
1749
|
},
|
|
1418
1750
|
onClick: () => b(y - 1),
|
|
@@ -1422,7 +1754,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1422
1754
|
type: "button",
|
|
1423
1755
|
"aria-label": "Next slide",
|
|
1424
1756
|
style: {
|
|
1425
|
-
|
|
1757
|
+
...$t,
|
|
1426
1758
|
right: 12
|
|
1427
1759
|
},
|
|
1428
1760
|
onClick: () => b(y + 1),
|
|
@@ -1456,7 +1788,7 @@ function vt({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1456
1788
|
] })]
|
|
1457
1789
|
});
|
|
1458
1790
|
}
|
|
1459
|
-
var
|
|
1791
|
+
var rn = (e, t) => ({
|
|
1460
1792
|
position: "absolute",
|
|
1461
1793
|
inset: 0,
|
|
1462
1794
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1464,18 +1796,18 @@ var yt = (e, t) => ({
|
|
|
1464
1796
|
backgroundSize: "cover",
|
|
1465
1797
|
backgroundPosition: "center"
|
|
1466
1798
|
});
|
|
1467
|
-
function
|
|
1468
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1799
|
+
function an({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1800
|
+
return e.length ? /* @__PURE__ */ u(nn, {
|
|
1469
1801
|
...r,
|
|
1470
1802
|
count: e.length,
|
|
1471
1803
|
renderSlide: (r) => {
|
|
1472
1804
|
let i = e[r];
|
|
1473
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1805
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: rn(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
|
|
1474
1806
|
style: {
|
|
1475
1807
|
position: "absolute",
|
|
1476
1808
|
color: "#fff",
|
|
1477
1809
|
textAlign: n,
|
|
1478
|
-
...
|
|
1810
|
+
...en[t] ?? en.bottom
|
|
1479
1811
|
},
|
|
1480
1812
|
children: [i.title && /* @__PURE__ */ u("div", {
|
|
1481
1813
|
style: {
|
|
@@ -1495,13 +1827,13 @@ function bt({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1495
1827
|
}
|
|
1496
1828
|
}) : null;
|
|
1497
1829
|
}
|
|
1498
|
-
function
|
|
1499
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1830
|
+
function on({ slides: e = [], linked: t, ...n }) {
|
|
1831
|
+
return e.length ? /* @__PURE__ */ u(nn, {
|
|
1500
1832
|
...n,
|
|
1501
1833
|
count: e.length,
|
|
1502
1834
|
renderSlide: (n) => {
|
|
1503
1835
|
let r = e[n];
|
|
1504
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1836
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: rn(r.image, r.color) }), /* @__PURE__ */ u("div", {
|
|
1505
1837
|
style: {
|
|
1506
1838
|
position: "absolute",
|
|
1507
1839
|
inset: 0,
|
|
@@ -1513,23 +1845,23 @@ function xt({ slides: e = [], linked: t, ...n }) {
|
|
|
1513
1845
|
}
|
|
1514
1846
|
}) : null;
|
|
1515
1847
|
}
|
|
1516
|
-
var
|
|
1517
|
-
let r =
|
|
1848
|
+
var sn = 256, cn = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), ln = (e, t, n) => {
|
|
1849
|
+
let r = sn * 2 ** n;
|
|
1518
1850
|
return {
|
|
1519
1851
|
x: (Number(t) + 180) / 360 * r,
|
|
1520
|
-
y: (.5 -
|
|
1852
|
+
y: (.5 - cn(Number(e)) / (2 * Math.PI)) * r
|
|
1521
1853
|
};
|
|
1522
1854
|
}, $ = (e, t) => {
|
|
1523
1855
|
if (e === "" || e == null) return null;
|
|
1524
1856
|
let n = Number(e);
|
|
1525
1857
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1526
|
-
},
|
|
1527
|
-
function
|
|
1858
|
+
}, un = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1859
|
+
function dn(e, t, n = "directions", r = "") {
|
|
1528
1860
|
let i = `${e},${t}`;
|
|
1529
1861
|
return n === "place" ? `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r ? "&query_place_id=" : ""}` : `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`;
|
|
1530
1862
|
}
|
|
1531
|
-
var
|
|
1532
|
-
function
|
|
1863
|
+
var fn = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1864
|
+
function pn({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize: o = 22, pinLink: l = "directions", link: f = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
|
|
1533
1865
|
let _ = s(null), [v, y] = c(1200);
|
|
1534
1866
|
i(() => {
|
|
1535
1867
|
let e = _.current;
|
|
@@ -1539,7 +1871,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1539
1871
|
let n = new ResizeObserver(t);
|
|
1540
1872
|
return n.observe(e), () => n.disconnect();
|
|
1541
1873
|
}, []);
|
|
1542
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1874
|
+
let b = (Array.isArray(e) ? e : []).filter(un), x = un({
|
|
1543
1875
|
lat: t,
|
|
1544
1876
|
lng: n
|
|
1545
1877
|
}) ? {
|
|
@@ -1551,7 +1883,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1551
1883
|
} : null, S = Math.max(80, Number(a) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1552
1884
|
if (b.length < 2) return 13;
|
|
1553
1885
|
for (let e = 19; e >= 1; e--) {
|
|
1554
|
-
let t = b.map((t) =>
|
|
1886
|
+
let t = b.map((t) => ln($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
|
|
1555
1887
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1556
1888
|
}
|
|
1557
1889
|
return 1;
|
|
@@ -1575,12 +1907,12 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1575
1907
|
},
|
|
1576
1908
|
children: "Set the coordinates in Settings"
|
|
1577
1909
|
});
|
|
1578
|
-
let T =
|
|
1910
|
+
let T = ln(x.lat, x.lng, C), E = {
|
|
1579
1911
|
x: T.x - v / 2,
|
|
1580
1912
|
y: T.y - S / 2
|
|
1581
1913
|
}, D = [], O = [];
|
|
1582
|
-
for (let e = Math.floor(E.x /
|
|
1583
|
-
for (let e = Math.floor(E.y /
|
|
1914
|
+
for (let e = Math.floor(E.x / sn); e <= Math.floor((E.x + v) / sn); e++) D.push(e);
|
|
1915
|
+
for (let e = Math.floor(E.y / sn); e <= Math.floor((E.y + S) / sn); e++) O.push(e);
|
|
1584
1916
|
let k = 2 ** C;
|
|
1585
1917
|
return /* @__PURE__ */ d("div", {
|
|
1586
1918
|
ref: (e) => {
|
|
@@ -1603,22 +1935,22 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1603
1935
|
return e < 0 || e >= k ? null : /* @__PURE__ */ u("img", {
|
|
1604
1936
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1605
1937
|
alt: "",
|
|
1606
|
-
width:
|
|
1607
|
-
height:
|
|
1938
|
+
width: sn,
|
|
1939
|
+
height: sn,
|
|
1608
1940
|
loading: "lazy",
|
|
1609
1941
|
style: {
|
|
1610
1942
|
position: "absolute",
|
|
1611
|
-
left: Math.round(t *
|
|
1612
|
-
top: Math.round(e *
|
|
1613
|
-
width:
|
|
1614
|
-
height:
|
|
1943
|
+
left: Math.round(t * sn - E.x),
|
|
1944
|
+
top: Math.round(e * sn - E.y),
|
|
1945
|
+
width: sn,
|
|
1946
|
+
height: sn,
|
|
1615
1947
|
userSelect: "none",
|
|
1616
1948
|
pointerEvents: "none"
|
|
1617
1949
|
}
|
|
1618
1950
|
}, `${t}-${e}`);
|
|
1619
1951
|
})),
|
|
1620
1952
|
b.map((e, t) => {
|
|
1621
|
-
let n =
|
|
1953
|
+
let n = ln($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", s = l === "none" || g ? null : dn($(e.lat, 90), $(e.lng, 180), l, e.title);
|
|
1622
1954
|
return /* @__PURE__ */ d(s ? "a" : "span", {
|
|
1623
1955
|
href: s || void 0,
|
|
1624
1956
|
target: s ? "_blank" : void 0,
|
|
@@ -1657,8 +1989,8 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1657
1989
|
viewBox: "0 0 24 24",
|
|
1658
1990
|
fill: a,
|
|
1659
1991
|
style: { display: "block" },
|
|
1660
|
-
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
1661
|
-
d:
|
|
1992
|
+
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), mn[e.icon] ? /* @__PURE__ */ u("path", {
|
|
1993
|
+
d: mn[e.icon],
|
|
1662
1994
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1663
1995
|
fill: "none",
|
|
1664
1996
|
stroke: "#fff",
|
|
@@ -1694,7 +2026,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1694
2026
|
})
|
|
1695
2027
|
]
|
|
1696
2028
|
}), f ? /* @__PURE__ */ u("a", {
|
|
1697
|
-
href:
|
|
2029
|
+
href: fn(x.lat, x.lng, C),
|
|
1698
2030
|
target: "_blank",
|
|
1699
2031
|
rel: "noopener noreferrer",
|
|
1700
2032
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1708,7 +2040,7 @@ function Ot({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1708
2040
|
}) : null]
|
|
1709
2041
|
});
|
|
1710
2042
|
}
|
|
1711
|
-
var
|
|
2043
|
+
var mn = {
|
|
1712
2044
|
check: "M4 12l5 5L20 6",
|
|
1713
2045
|
close: "M6 6l12 12M18 6L6 18",
|
|
1714
2046
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1805,8 +2137,8 @@ var kt = {
|
|
|
1805
2137
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1806
2138
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1807
2139
|
};
|
|
1808
|
-
function
|
|
1809
|
-
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [
|
|
2140
|
+
function hn({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: d, inert: f }) {
|
|
2141
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [mn[e] ?? mn.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
|
|
1810
2142
|
viewBox: "0 0 24 24",
|
|
1811
2143
|
width: g,
|
|
1812
2144
|
height: g,
|
|
@@ -1842,10 +2174,10 @@ function At({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1842
2174
|
children: v
|
|
1843
2175
|
});
|
|
1844
2176
|
}
|
|
1845
|
-
function
|
|
1846
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
2177
|
+
function gn(e, t = {}, n = 0) {
|
|
2178
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : ct(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1847
2179
|
for (let e of r) {
|
|
1848
|
-
let n = e.data ?? e, r =
|
|
2180
|
+
let n = e.data ?? e, r = ot(n, t.imageField), s = (Array.isArray(r) ? r : [r]).map((e) => e && typeof e == "object" ? e.url ?? e.src ?? "" : e).filter((e) => typeof e == "string" && e.trim()), c = t.nameField ? i(ot(n, t.nameField)) : i(n.name), l = t.hrefField ? i(ot(n, t.hrefField)) : "";
|
|
1849
2181
|
for (let e of s) if (o.push({
|
|
1850
2182
|
src: e,
|
|
1851
2183
|
name: c,
|
|
@@ -1855,8 +2187,8 @@ function jt(e, t = {}, n = 0) {
|
|
|
1855
2187
|
}
|
|
1856
2188
|
return o;
|
|
1857
2189
|
}
|
|
1858
|
-
function
|
|
1859
|
-
let { tenant: x, apiUrl: S } = r(
|
|
2190
|
+
function _n({ images: e = [], source: t = "", entry: n = "", imageField: a = "", nameField: o = "", hrefField: s = "", limit: f = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
|
|
2191
|
+
let { tenant: x, apiUrl: S } = r(Q), C = r(et)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
|
|
1860
2192
|
i(() => {
|
|
1861
2193
|
if (!t || C) return;
|
|
1862
2194
|
let e = !0;
|
|
@@ -1873,7 +2205,7 @@ function Mt({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
1873
2205
|
C
|
|
1874
2206
|
]);
|
|
1875
2207
|
let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, j = Math.max(0, Number(f) || 0), M = t ? (() => {
|
|
1876
|
-
let e =
|
|
2208
|
+
let e = gn(k, {
|
|
1877
2209
|
imageField: a,
|
|
1878
2210
|
nameField: o,
|
|
1879
2211
|
hrefField: s
|
|
@@ -2078,20 +2410,20 @@ function Mt({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
2078
2410
|
]
|
|
2079
2411
|
});
|
|
2080
2412
|
}
|
|
2081
|
-
var
|
|
2413
|
+
var vn = {
|
|
2082
2414
|
color: "inherit",
|
|
2083
2415
|
textDecoration: "none",
|
|
2084
2416
|
fontSize: 14,
|
|
2085
2417
|
opacity: .85
|
|
2086
|
-
},
|
|
2418
|
+
}, yn = {
|
|
2087
2419
|
background: "var(--page-surface, #f2f2f2)",
|
|
2088
2420
|
color: "var(--page-text, #111827)",
|
|
2089
2421
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
2090
2422
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
2091
2423
|
zIndex: 60
|
|
2092
2424
|
};
|
|
2093
|
-
function
|
|
2094
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" :
|
|
2425
|
+
function bn(e, t = {}, n = "dropdown") {
|
|
2426
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" : ct(e), o = r.map((e) => {
|
|
2095
2427
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
2096
2428
|
return {
|
|
2097
2429
|
key: e.id,
|
|
@@ -2132,8 +2464,8 @@ function Ft(e, t = {}, n = "dropdown") {
|
|
|
2132
2464
|
type: e.children.length ? n : "link"
|
|
2133
2465
|
}));
|
|
2134
2466
|
}
|
|
2135
|
-
function
|
|
2136
|
-
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(
|
|
2467
|
+
function xn({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], style: f, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
|
|
2468
|
+
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(Q), P = r(et)?.[g], [F, I] = c(null);
|
|
2137
2469
|
i(() => {
|
|
2138
2470
|
if (!g || P) return;
|
|
2139
2471
|
let e = !0;
|
|
@@ -2153,7 +2485,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2153
2485
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2154
2486
|
return e.observe(C), () => e.disconnect();
|
|
2155
2487
|
}, [C, h]);
|
|
2156
|
-
let L = g ?
|
|
2488
|
+
let L = g ? bn(P ?? F ?? [], {
|
|
2157
2489
|
labelField: _,
|
|
2158
2490
|
hrefField: v,
|
|
2159
2491
|
imageField: y,
|
|
@@ -2182,7 +2514,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2182
2514
|
return /* @__PURE__ */ d("a", {
|
|
2183
2515
|
href: e.href || "#",
|
|
2184
2516
|
style: {
|
|
2185
|
-
...
|
|
2517
|
+
...vn,
|
|
2186
2518
|
display: n ? "block" : "flex",
|
|
2187
2519
|
alignItems: n ? void 0 : "center",
|
|
2188
2520
|
gap: n ? void 0 : 10,
|
|
@@ -2279,7 +2611,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2279
2611
|
let t = e.children ?? [];
|
|
2280
2612
|
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
2281
2613
|
href: e.href || "#",
|
|
2282
|
-
style:
|
|
2614
|
+
style: vn,
|
|
2283
2615
|
children: e.label
|
|
2284
2616
|
}, e.key);
|
|
2285
2617
|
let n = e.type === "mega";
|
|
@@ -2293,7 +2625,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2293
2625
|
children: [/* @__PURE__ */ d("a", {
|
|
2294
2626
|
href: e.href || "#",
|
|
2295
2627
|
style: {
|
|
2296
|
-
...
|
|
2628
|
+
...vn,
|
|
2297
2629
|
cursor: "pointer"
|
|
2298
2630
|
},
|
|
2299
2631
|
children: [
|
|
@@ -2309,7 +2641,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2309
2641
|
]
|
|
2310
2642
|
}), k === e.key && (n ? /* @__PURE__ */ u("div", {
|
|
2311
2643
|
style: {
|
|
2312
|
-
...
|
|
2644
|
+
...yn,
|
|
2313
2645
|
position: "absolute",
|
|
2314
2646
|
left: 0,
|
|
2315
2647
|
right: 0,
|
|
@@ -2325,7 +2657,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2325
2657
|
}, !0))
|
|
2326
2658
|
}) : /* @__PURE__ */ u("div", {
|
|
2327
2659
|
style: {
|
|
2328
|
-
...
|
|
2660
|
+
...yn,
|
|
2329
2661
|
position: "absolute",
|
|
2330
2662
|
top: "100%",
|
|
2331
2663
|
left: 0,
|
|
@@ -2354,7 +2686,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2354
2686
|
children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
2355
2687
|
href: t.href || "#",
|
|
2356
2688
|
style: {
|
|
2357
|
-
...
|
|
2689
|
+
...vn,
|
|
2358
2690
|
padding: "10px 4px",
|
|
2359
2691
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
2360
2692
|
opacity: 1
|
|
@@ -2365,7 +2697,7 @@ function It({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2365
2697
|
]
|
|
2366
2698
|
});
|
|
2367
2699
|
}
|
|
2368
|
-
function
|
|
2700
|
+
function Sn({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2369
2701
|
let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2370
2702
|
return e.length ? /* @__PURE__ */ d("div", {
|
|
2371
2703
|
ref: r,
|
|
@@ -2405,13 +2737,13 @@ function Lt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2405
2737
|
}, e.key))]
|
|
2406
2738
|
}) : null;
|
|
2407
2739
|
}
|
|
2408
|
-
function
|
|
2740
|
+
function Cn({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: l, openColor: f, borderColor: p, style: m, nodeRef: h }) {
|
|
2409
2741
|
let [g, _] = c(() => new Set(e.length ? [e[0].key] : []));
|
|
2410
2742
|
if (!e.length) return null;
|
|
2411
2743
|
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2412
2744
|
let n = Number(e);
|
|
2413
2745
|
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2414
|
-
}, b =
|
|
2746
|
+
}, b = mn[r], x = (e) => _((t) => {
|
|
2415
2747
|
let r = new Set(n ? t : []);
|
|
2416
2748
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2417
2749
|
});
|
|
@@ -2486,15 +2818,15 @@ function Rt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
|
|
|
2486
2818
|
})
|
|
2487
2819
|
});
|
|
2488
2820
|
}
|
|
2489
|
-
var
|
|
2821
|
+
var wn = {
|
|
2490
2822
|
display: "flex",
|
|
2491
2823
|
flexDirection: "column",
|
|
2492
2824
|
gap: "12px"
|
|
2493
|
-
},
|
|
2825
|
+
}, Tn = {
|
|
2494
2826
|
fontSize: "14px",
|
|
2495
2827
|
fontWeight: 500,
|
|
2496
2828
|
color: "var(--page-text, #111827)"
|
|
2497
|
-
},
|
|
2829
|
+
}, En = {
|
|
2498
2830
|
padding: "10px 12px",
|
|
2499
2831
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2500
2832
|
borderRadius: "6px",
|
|
@@ -2504,18 +2836,18 @@ var zt = {
|
|
|
2504
2836
|
boxSizing: "border-box",
|
|
2505
2837
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2506
2838
|
color: "var(--page-text, #111827)"
|
|
2507
|
-
},
|
|
2839
|
+
}, Dn = {
|
|
2508
2840
|
display: "flex",
|
|
2509
2841
|
alignItems: "center",
|
|
2510
2842
|
gap: "8px",
|
|
2511
2843
|
fontSize: "14px",
|
|
2512
2844
|
color: "var(--page-text, #111827)"
|
|
2513
|
-
},
|
|
2845
|
+
}, On = (e) => e ? {
|
|
2514
2846
|
readOnly: !0,
|
|
2515
2847
|
tabIndex: -1,
|
|
2516
2848
|
onMouseDown: (e) => e.preventDefault()
|
|
2517
2849
|
} : {};
|
|
2518
|
-
function
|
|
2850
|
+
function kn(e, t) {
|
|
2519
2851
|
if (!e) return !0;
|
|
2520
2852
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2521
2853
|
switch (e.op) {
|
|
@@ -2529,11 +2861,11 @@ function Wt(e, t) {
|
|
|
2529
2861
|
default: return !1;
|
|
2530
2862
|
}
|
|
2531
2863
|
}
|
|
2532
|
-
var
|
|
2864
|
+
var An = {
|
|
2533
2865
|
display: "flex",
|
|
2534
2866
|
flexDirection: "column",
|
|
2535
2867
|
gap: 6
|
|
2536
|
-
},
|
|
2868
|
+
}, jn = {
|
|
2537
2869
|
font: "inherit",
|
|
2538
2870
|
fontSize: 15,
|
|
2539
2871
|
padding: "10px 12px",
|
|
@@ -2544,17 +2876,17 @@ var Gt = {
|
|
|
2544
2876
|
width: "100%",
|
|
2545
2877
|
boxSizing: "border-box"
|
|
2546
2878
|
};
|
|
2547
|
-
function
|
|
2879
|
+
function Mn(e, t) {
|
|
2548
2880
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2549
2881
|
if (!e?.parentField) return n;
|
|
2550
2882
|
let r = t?.[e.parentField];
|
|
2551
2883
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2552
2884
|
}
|
|
2553
|
-
var
|
|
2554
|
-
function
|
|
2885
|
+
var Nn = "g-recaptcha-response", Pn = (e) => e?.type === "recaptcha" ? Nn : e?.name;
|
|
2886
|
+
function Fn({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2555
2887
|
let a = /* @__PURE__ */ d("span", {
|
|
2556
2888
|
style: {
|
|
2557
|
-
...
|
|
2889
|
+
...Tn,
|
|
2558
2890
|
fontSize: 14
|
|
2559
2891
|
},
|
|
2560
2892
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2563,7 +2895,7 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2563
2895
|
required: e.required || void 0,
|
|
2564
2896
|
placeholder: e.placeholder || void 0,
|
|
2565
2897
|
disabled: r || void 0,
|
|
2566
|
-
style:
|
|
2898
|
+
style: jn,
|
|
2567
2899
|
value: t ?? "",
|
|
2568
2900
|
onChange: (t) => n(e.name, t.target.value)
|
|
2569
2901
|
};
|
|
@@ -2592,12 +2924,12 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2592
2924
|
borderRadius: 8,
|
|
2593
2925
|
display: "block"
|
|
2594
2926
|
}
|
|
2595
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(
|
|
2927
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(Bn, {
|
|
2596
2928
|
theme: e.captchaTheme,
|
|
2597
2929
|
size: e.captchaSize,
|
|
2598
2930
|
inert: r,
|
|
2599
|
-
onChange: (e) => n(
|
|
2600
|
-
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(
|
|
2931
|
+
onChange: (e) => n(Nn, e)
|
|
2932
|
+
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Gt, {
|
|
2601
2933
|
url: e.src,
|
|
2602
2934
|
style: { width: "100%" }
|
|
2603
2935
|
}) : /* @__PURE__ */ u("video", {
|
|
@@ -2609,14 +2941,14 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2609
2941
|
display: "block"
|
|
2610
2942
|
}
|
|
2611
2943
|
}) : null : /* @__PURE__ */ d("label", {
|
|
2612
|
-
style:
|
|
2944
|
+
style: An,
|
|
2613
2945
|
children: [
|
|
2614
2946
|
a,
|
|
2615
2947
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
|
|
2616
2948
|
...o,
|
|
2617
2949
|
rows: 4,
|
|
2618
2950
|
style: {
|
|
2619
|
-
...
|
|
2951
|
+
...jn,
|
|
2620
2952
|
resize: "vertical"
|
|
2621
2953
|
}
|
|
2622
2954
|
}) : e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
@@ -2625,7 +2957,7 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2625
2957
|
children: [/* @__PURE__ */ u("option", {
|
|
2626
2958
|
value: "",
|
|
2627
2959
|
children: e.placeholder || "—"
|
|
2628
|
-
}),
|
|
2960
|
+
}), Mn(e, i).map((e, t) => /* @__PURE__ */ u("option", {
|
|
2629
2961
|
value: typeof e == "string" ? e : e.value,
|
|
2630
2962
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2631
2963
|
}, t))]
|
|
@@ -2672,8 +3004,8 @@ function Xt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2672
3004
|
]
|
|
2673
3005
|
});
|
|
2674
3006
|
}
|
|
2675
|
-
function
|
|
2676
|
-
let { tenant: y, apiUrl: b } = r(
|
|
3007
|
+
function In({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
|
|
3008
|
+
let { tenant: y, apiUrl: b } = r(Q), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
|
|
2677
3009
|
i(() => {
|
|
2678
3010
|
if (!f || !s) return;
|
|
2679
3011
|
let e = !0;
|
|
@@ -2694,11 +3026,11 @@ function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2694
3026
|
section: e,
|
|
2695
3027
|
fields: []
|
|
2696
3028
|
}) : j[j.length - 1].fields.push(e);
|
|
2697
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
3029
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || kn(e.section.condition, T)).map((e) => ({
|
|
2698
3030
|
...e,
|
|
2699
|
-
fields: e.fields.filter((e) =>
|
|
3031
|
+
fields: e.fields.filter((e) => kn(e.condition, T))
|
|
2700
3032
|
})), P = M.length > 1, F = Math.min(D, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
|
|
2701
|
-
let t = T[
|
|
3033
|
+
let t = T[Pn(e)];
|
|
2702
3034
|
return e.required && (t == null || t === "" || t === !1);
|
|
2703
3035
|
}), R = F >= N.length - 1, z = (e, t) => E((n) => {
|
|
2704
3036
|
let r = {
|
|
@@ -2754,11 +3086,11 @@ function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2754
3086
|
}
|
|
2755
3087
|
},
|
|
2756
3088
|
style: {
|
|
2757
|
-
...
|
|
3089
|
+
...wn,
|
|
2758
3090
|
display: k === "success" ? "none" : "flex"
|
|
2759
3091
|
},
|
|
2760
3092
|
children: f && s ? /* @__PURE__ */ d(l, { children: [
|
|
2761
|
-
P && /* @__PURE__ */ u(
|
|
3093
|
+
P && /* @__PURE__ */ u(hr, {
|
|
2762
3094
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2763
3095
|
active: F + 1,
|
|
2764
3096
|
style: { marginBottom: 8 }
|
|
@@ -2771,9 +3103,9 @@ function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2771
3103
|
},
|
|
2772
3104
|
children: N[F].section.help
|
|
2773
3105
|
}),
|
|
2774
|
-
I.map((e) => /* @__PURE__ */ u(
|
|
3106
|
+
I.map((e) => /* @__PURE__ */ u(Fn, {
|
|
2775
3107
|
field: e,
|
|
2776
|
-
value: T[
|
|
3108
|
+
value: T[Pn(e)],
|
|
2777
3109
|
values: T,
|
|
2778
3110
|
onChange: z,
|
|
2779
3111
|
inert: h
|
|
@@ -2790,7 +3122,7 @@ function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2790
3122
|
disabled: h || void 0,
|
|
2791
3123
|
onClick: () => O(F - 1),
|
|
2792
3124
|
style: {
|
|
2793
|
-
...
|
|
3125
|
+
...mt,
|
|
2794
3126
|
background: "transparent",
|
|
2795
3127
|
color: "inherit",
|
|
2796
3128
|
border: 0,
|
|
@@ -2803,7 +3135,7 @@ function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2803
3135
|
disabled: h || L.length > 0,
|
|
2804
3136
|
onClick: () => O(F + 1),
|
|
2805
3137
|
style: {
|
|
2806
|
-
...
|
|
3138
|
+
...mt,
|
|
2807
3139
|
border: 0,
|
|
2808
3140
|
padding: "10px 22px",
|
|
2809
3141
|
borderRadius: 8,
|
|
@@ -2817,7 +3149,7 @@ function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2817
3149
|
type: "submit",
|
|
2818
3150
|
disabled: h || void 0,
|
|
2819
3151
|
style: {
|
|
2820
|
-
...
|
|
3152
|
+
...mt,
|
|
2821
3153
|
border: 0,
|
|
2822
3154
|
padding: "10px 22px",
|
|
2823
3155
|
borderRadius: 8,
|
|
@@ -2844,10 +3176,10 @@ function Zt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2844
3176
|
]
|
|
2845
3177
|
});
|
|
2846
3178
|
}
|
|
2847
|
-
var
|
|
3179
|
+
var Ln = null, Rn = null, zn = (e) => {
|
|
2848
3180
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2849
|
-
if (
|
|
2850
|
-
if (
|
|
3181
|
+
if (Ln && Rn === t) return Ln;
|
|
3182
|
+
if (Ln && typeof window < "u") {
|
|
2851
3183
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2852
3184
|
delete window[e];
|
|
2853
3185
|
} catch {
|
|
@@ -2855,22 +3187,22 @@ var Qt = null, $t = null, en = (e) => {
|
|
|
2855
3187
|
}
|
|
2856
3188
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2857
3189
|
}
|
|
2858
|
-
return
|
|
3190
|
+
return Rn = t, Ln = new Promise((e) => {
|
|
2859
3191
|
if (typeof window > "u") return;
|
|
2860
3192
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2861
3193
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2862
3194
|
let n = document.createElement("script");
|
|
2863
3195
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2864
|
-
}),
|
|
3196
|
+
}), Ln;
|
|
2865
3197
|
};
|
|
2866
|
-
function
|
|
2867
|
-
let p = r(
|
|
3198
|
+
function Bn({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
|
|
3199
|
+
let p = r(Q), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
|
|
2868
3200
|
if (_.current = f, i(() => {
|
|
2869
3201
|
if (l || !h || !g.current) return;
|
|
2870
3202
|
let e = !0, r = (t) => {
|
|
2871
3203
|
e && typeof _.current == "function" && _.current(t);
|
|
2872
3204
|
};
|
|
2873
|
-
return
|
|
3205
|
+
return zn(a).then((i) => {
|
|
2874
3206
|
if (!(!e || !g.current || !i?.render)) {
|
|
2875
3207
|
g.current.innerHTML = "", r("");
|
|
2876
3208
|
try {
|
|
@@ -2952,17 +3284,17 @@ function tn({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2952
3284
|
children: /* @__PURE__ */ u("div", { ref: g })
|
|
2953
3285
|
}) : null;
|
|
2954
3286
|
}
|
|
2955
|
-
function
|
|
3287
|
+
function Vn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2956
3288
|
return /* @__PURE__ */ u("label", {
|
|
2957
3289
|
ref: r,
|
|
2958
3290
|
style: {
|
|
2959
|
-
...
|
|
3291
|
+
...Tn,
|
|
2960
3292
|
...A(n)
|
|
2961
3293
|
},
|
|
2962
|
-
children:
|
|
3294
|
+
children: Et(t, e, i)
|
|
2963
3295
|
});
|
|
2964
3296
|
}
|
|
2965
|
-
function
|
|
3297
|
+
function Hn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2966
3298
|
return /* @__PURE__ */ u("input", {
|
|
2967
3299
|
ref: a,
|
|
2968
3300
|
type: e,
|
|
@@ -2970,13 +3302,13 @@ function rn({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2970
3302
|
placeholder: n,
|
|
2971
3303
|
required: !o && !!r,
|
|
2972
3304
|
style: {
|
|
2973
|
-
...
|
|
3305
|
+
...En,
|
|
2974
3306
|
...A(i)
|
|
2975
3307
|
},
|
|
2976
|
-
...
|
|
3308
|
+
...On(o)
|
|
2977
3309
|
});
|
|
2978
3310
|
}
|
|
2979
|
-
function
|
|
3311
|
+
function Un({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2980
3312
|
return /* @__PURE__ */ u("textarea", {
|
|
2981
3313
|
ref: a,
|
|
2982
3314
|
name: e || void 0,
|
|
@@ -2984,18 +3316,18 @@ function an({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2984
3316
|
rows: n,
|
|
2985
3317
|
required: !o && !!r,
|
|
2986
3318
|
style: {
|
|
2987
|
-
...
|
|
3319
|
+
...En,
|
|
2988
3320
|
resize: "vertical",
|
|
2989
3321
|
...A(i)
|
|
2990
3322
|
},
|
|
2991
|
-
...
|
|
3323
|
+
...On(o)
|
|
2992
3324
|
});
|
|
2993
3325
|
}
|
|
2994
|
-
function
|
|
3326
|
+
function Wn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2995
3327
|
return /* @__PURE__ */ d("label", {
|
|
2996
3328
|
ref: o,
|
|
2997
3329
|
style: {
|
|
2998
|
-
...
|
|
3330
|
+
...Dn,
|
|
2999
3331
|
...A(a)
|
|
3000
3332
|
},
|
|
3001
3333
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -3012,7 +3344,7 @@ function on({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
3012
3344
|
}), t]
|
|
3013
3345
|
});
|
|
3014
3346
|
}
|
|
3015
|
-
function
|
|
3347
|
+
function Gn({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
3016
3348
|
return /* @__PURE__ */ d("select", {
|
|
3017
3349
|
ref: a,
|
|
3018
3350
|
name: e || void 0,
|
|
@@ -3021,7 +3353,7 @@ function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
3021
3353
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
3022
3354
|
tabIndex: o ? -1 : void 0,
|
|
3023
3355
|
style: {
|
|
3024
|
-
...
|
|
3356
|
+
...En,
|
|
3025
3357
|
appearance: "auto",
|
|
3026
3358
|
...A(i)
|
|
3027
3359
|
},
|
|
@@ -3035,12 +3367,12 @@ function sn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
3035
3367
|
}, t))]
|
|
3036
3368
|
});
|
|
3037
3369
|
}
|
|
3038
|
-
function
|
|
3370
|
+
function Kn({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
3039
3371
|
let [s, l] = c(null);
|
|
3040
3372
|
return /* @__PURE__ */ d("label", {
|
|
3041
3373
|
ref: a,
|
|
3042
3374
|
style: {
|
|
3043
|
-
...
|
|
3375
|
+
...En,
|
|
3044
3376
|
display: "flex",
|
|
3045
3377
|
alignItems: "center",
|
|
3046
3378
|
gap: "8px",
|
|
@@ -3067,12 +3399,12 @@ function cn({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
3067
3399
|
]
|
|
3068
3400
|
});
|
|
3069
3401
|
}
|
|
3070
|
-
function
|
|
3402
|
+
function qn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
3071
3403
|
return /* @__PURE__ */ u("button", {
|
|
3072
3404
|
ref: n,
|
|
3073
3405
|
type: r ? "button" : "submit",
|
|
3074
3406
|
style: {
|
|
3075
|
-
...
|
|
3407
|
+
...mt,
|
|
3076
3408
|
border: 0,
|
|
3077
3409
|
cursor: "pointer",
|
|
3078
3410
|
alignSelf: "flex-start",
|
|
@@ -3087,7 +3419,7 @@ function ln({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
3087
3419
|
children: e
|
|
3088
3420
|
});
|
|
3089
3421
|
}
|
|
3090
|
-
function
|
|
3422
|
+
function Jn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
3091
3423
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
3092
3424
|
return /* @__PURE__ */ u("div", {
|
|
3093
3425
|
ref: r,
|
|
@@ -3104,8 +3436,8 @@ function un({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
3104
3436
|
}, t))
|
|
3105
3437
|
});
|
|
3106
3438
|
}
|
|
3107
|
-
function
|
|
3108
|
-
let { tenant: v, apiUrl: y, locale: b } = r(
|
|
3439
|
+
function Yn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
|
|
3440
|
+
let { tenant: v, apiUrl: y, locale: b } = r(Q), x = r(it), S = r(et), [, C] = c(0);
|
|
3109
3441
|
i(() => {
|
|
3110
3442
|
if (typeof window > "u") return;
|
|
3111
3443
|
let e = () => C((e) => e + 1);
|
|
@@ -3113,7 +3445,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3113
3445
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
3114
3446
|
};
|
|
3115
3447
|
}, []);
|
|
3116
|
-
let w =
|
|
3448
|
+
let w = rt(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? tt(S) : 1, [k, j] = c(null);
|
|
3117
3449
|
if (i(() => {
|
|
3118
3450
|
if (!e || D) return;
|
|
3119
3451
|
let n = !0, r = new URLSearchParams();
|
|
@@ -3158,7 +3490,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3158
3490
|
},
|
|
3159
3491
|
children: N.map((e) => /* @__PURE__ */ u("div", {
|
|
3160
3492
|
style: { minWidth: 0 },
|
|
3161
|
-
children: x.render(p, (t) =>
|
|
3493
|
+
children: x.render(p, (t) => lt(t, e))
|
|
3162
3494
|
}, e.id ?? e?.data?.slug))
|
|
3163
3495
|
}) : /* @__PURE__ */ u("div", {
|
|
3164
3496
|
ref: _,
|
|
@@ -3168,7 +3500,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3168
3500
|
...A(g)
|
|
3169
3501
|
},
|
|
3170
3502
|
children: N.map((e) => {
|
|
3171
|
-
let t = o ?
|
|
3503
|
+
let t = o ? ot(e?.data, o) : null, r = s ? ct(ot(e?.data, s)) : null, i = l ? ot(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : ct(i), f = n === "list";
|
|
3172
3504
|
return /* @__PURE__ */ d("div", {
|
|
3173
3505
|
style: {
|
|
3174
3506
|
display: "flex",
|
|
@@ -3215,7 +3547,7 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3215
3547
|
lineHeight: 1.55,
|
|
3216
3548
|
opacity: .85
|
|
3217
3549
|
},
|
|
3218
|
-
children:
|
|
3550
|
+
children: Mt(a)
|
|
3219
3551
|
})
|
|
3220
3552
|
]
|
|
3221
3553
|
})]
|
|
@@ -3223,8 +3555,8 @@ function dn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3223
3555
|
})
|
|
3224
3556
|
});
|
|
3225
3557
|
}
|
|
3226
|
-
function
|
|
3227
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3558
|
+
function Xn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3559
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : nt(), s = {
|
|
3228
3560
|
height: 34,
|
|
3229
3561
|
padding: "0 12px",
|
|
3230
3562
|
borderRadius: 8,
|
|
@@ -3272,7 +3604,7 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3272
3604
|
name: `f_${e.name}`,
|
|
3273
3605
|
defaultValue: o[e.name] ?? "",
|
|
3274
3606
|
style: s,
|
|
3275
|
-
...
|
|
3607
|
+
...On(i),
|
|
3276
3608
|
children: [/* @__PURE__ */ u("option", {
|
|
3277
3609
|
value: "",
|
|
3278
3610
|
children: e.label || e.name
|
|
@@ -3287,7 +3619,7 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3287
3619
|
name: `f_${e.name}`,
|
|
3288
3620
|
defaultValue: o[e.name] ?? "",
|
|
3289
3621
|
style: s,
|
|
3290
|
-
...
|
|
3622
|
+
...On(i),
|
|
3291
3623
|
children: [
|
|
3292
3624
|
/* @__PURE__ */ u("option", {
|
|
3293
3625
|
value: "",
|
|
@@ -3308,7 +3640,7 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3308
3640
|
defaultValue: o[e.name] ?? "",
|
|
3309
3641
|
placeholder: e.label || e.name,
|
|
3310
3642
|
style: s,
|
|
3311
|
-
...
|
|
3643
|
+
...On(i)
|
|
3312
3644
|
}, e.name)), /* @__PURE__ */ u("button", {
|
|
3313
3645
|
type: "submit",
|
|
3314
3646
|
style: {
|
|
@@ -3321,12 +3653,12 @@ function fn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3321
3653
|
fontWeight: 600,
|
|
3322
3654
|
cursor: i ? "default" : "pointer"
|
|
3323
3655
|
},
|
|
3324
|
-
...
|
|
3656
|
+
...On(i),
|
|
3325
3657
|
children: t
|
|
3326
3658
|
})]
|
|
3327
3659
|
});
|
|
3328
3660
|
}
|
|
3329
|
-
function
|
|
3661
|
+
function Zn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3330
3662
|
return e.length ? /* @__PURE__ */ u("nav", {
|
|
3331
3663
|
ref: r,
|
|
3332
3664
|
"aria-label": "Breadcrumb",
|
|
@@ -3376,8 +3708,8 @@ function pn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3376
3708
|
})
|
|
3377
3709
|
}) : null;
|
|
3378
3710
|
}
|
|
3379
|
-
function
|
|
3380
|
-
let { tenant: g, apiUrl: _ } = r(
|
|
3711
|
+
function Qn({ 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: h }) {
|
|
3712
|
+
let { tenant: g, apiUrl: _ } = r(Q), v = r(et), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3381
3713
|
i(() => {
|
|
3382
3714
|
if (!o || Number.isFinite(x)) return;
|
|
3383
3715
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3396,7 +3728,7 @@ function mn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3396
3728
|
]);
|
|
3397
3729
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
3398
3730
|
if (o && C === null || o && f && !(C > 0)) return null;
|
|
3399
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3731
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? tt(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
3400
3732
|
if (o) {
|
|
3401
3733
|
if (typeof window < "u") {
|
|
3402
3734
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -3461,15 +3793,15 @@ function mn({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3461
3793
|
]
|
|
3462
3794
|
});
|
|
3463
3795
|
}
|
|
3464
|
-
var
|
|
3796
|
+
var $n = "webim.page_mode", er = () => {
|
|
3465
3797
|
if (typeof window > "u") return "auto";
|
|
3466
3798
|
try {
|
|
3467
|
-
let e = window.localStorage.getItem(
|
|
3799
|
+
let e = window.localStorage.getItem($n);
|
|
3468
3800
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3469
3801
|
} catch {
|
|
3470
3802
|
return "auto";
|
|
3471
3803
|
}
|
|
3472
|
-
},
|
|
3804
|
+
}, tr = (e) => {
|
|
3473
3805
|
let t = {
|
|
3474
3806
|
width: 16,
|
|
3475
3807
|
height: 16,
|
|
@@ -3501,13 +3833,13 @@ var hn = "webim.page_mode", gn = () => {
|
|
|
3501
3833
|
rx: "2"
|
|
3502
3834
|
}), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
|
|
3503
3835
|
});
|
|
3504
|
-
},
|
|
3836
|
+
}, nr = {
|
|
3505
3837
|
light: "Light theme",
|
|
3506
3838
|
dark: "Dark theme",
|
|
3507
3839
|
auto: "Follow the device theme"
|
|
3508
3840
|
};
|
|
3509
|
-
function
|
|
3510
|
-
let [o, l] = c(a ? "auto" :
|
|
3841
|
+
function rr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
3842
|
+
let [o, l] = c(a ? "auto" : er), d = s(null), f = (e) => {
|
|
3511
3843
|
d.current = e, typeof r == "function" && r(e);
|
|
3512
3844
|
};
|
|
3513
3845
|
i(() => {
|
|
@@ -3515,7 +3847,7 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3515
3847
|
let e = d.current?.closest?.(".webim-page");
|
|
3516
3848
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3517
3849
|
try {
|
|
3518
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3850
|
+
o === "auto" ? window.localStorage.removeItem($n) : window.localStorage.setItem($n, o);
|
|
3519
3851
|
} catch {}
|
|
3520
3852
|
}, [o, a]);
|
|
3521
3853
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3550,8 +3882,8 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3550
3882
|
},
|
|
3551
3883
|
children: p.map((e) => /* @__PURE__ */ u("button", {
|
|
3552
3884
|
type: "button",
|
|
3553
|
-
title:
|
|
3554
|
-
"aria-label":
|
|
3885
|
+
title: nr[e],
|
|
3886
|
+
"aria-label": nr[e],
|
|
3555
3887
|
"aria-pressed": e === m,
|
|
3556
3888
|
onClick: a ? void 0 : () => l(e),
|
|
3557
3889
|
style: {
|
|
@@ -3562,15 +3894,15 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3562
3894
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3563
3895
|
opacity: e === m ? 1 : .7
|
|
3564
3896
|
},
|
|
3565
|
-
children:
|
|
3897
|
+
children: tr(e)
|
|
3566
3898
|
}, e))
|
|
3567
3899
|
});
|
|
3568
3900
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3569
3901
|
return /* @__PURE__ */ u("button", {
|
|
3570
3902
|
ref: f,
|
|
3571
3903
|
type: "button",
|
|
3572
|
-
title:
|
|
3573
|
-
"aria-label": `Theme: ${
|
|
3904
|
+
title: nr[m],
|
|
3905
|
+
"aria-label": `Theme: ${nr[m]} — switch to ${nr[g]}`,
|
|
3574
3906
|
onClick: a ? void 0 : () => l(g),
|
|
3575
3907
|
style: {
|
|
3576
3908
|
...h,
|
|
@@ -3579,10 +3911,10 @@ function yn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3579
3911
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3580
3912
|
...A(n)
|
|
3581
3913
|
},
|
|
3582
|
-
children:
|
|
3914
|
+
children: tr(m)
|
|
3583
3915
|
});
|
|
3584
3916
|
}
|
|
3585
|
-
function
|
|
3917
|
+
function ir(e) {
|
|
3586
3918
|
let t = e?.parentElement;
|
|
3587
3919
|
for (; t && t !== document.body;) {
|
|
3588
3920
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3591,7 +3923,7 @@ function bn(e) {
|
|
|
3591
3923
|
}
|
|
3592
3924
|
return window;
|
|
3593
3925
|
}
|
|
3594
|
-
var
|
|
3926
|
+
var ar = (e) => e === window ? window.scrollY : e.scrollTop, or = {
|
|
3595
3927
|
"bottom-right": (e) => ({
|
|
3596
3928
|
right: e,
|
|
3597
3929
|
bottom: e
|
|
@@ -3605,8 +3937,122 @@ var xn = (e) => e === window ? window.scrollY : e.scrollTop, Sn = {
|
|
|
3605
3937
|
bottom: e,
|
|
3606
3938
|
transform: "translateX(-50%)"
|
|
3607
3939
|
})
|
|
3940
|
+
}, sr = {
|
|
3941
|
+
linear: (e) => e,
|
|
3942
|
+
out: (e) => 1 - (1 - e) ** 3,
|
|
3943
|
+
inout: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2
|
|
3944
|
+
}, cr = (e) => {
|
|
3945
|
+
let t = e.getBoundingClientRect(), n = e.parentElement;
|
|
3946
|
+
for (; n && n !== document.body;) {
|
|
3947
|
+
let e = getComputedStyle(n);
|
|
3948
|
+
if (/(auto|scroll)/.test(e.overflowY) && n.scrollHeight > n.clientHeight) break;
|
|
3949
|
+
n = n.parentElement;
|
|
3950
|
+
}
|
|
3951
|
+
return !n || n === document.body ? Math.max(document.documentElement.scrollHeight - (t.bottom + window.scrollY), 0) : Math.max(n.scrollHeight - (t.bottom - n.getBoundingClientRect().top + n.scrollTop), 0);
|
|
3952
|
+
}, lr = (e, t) => {
|
|
3953
|
+
let n = typeof e == "number" ? e : parseFloat(e);
|
|
3954
|
+
return Number.isFinite(n) ? n : t;
|
|
3608
3955
|
};
|
|
3609
|
-
function
|
|
3956
|
+
function ur(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
3957
|
+
let i = Math.min(Math.max(Math.round(lr(n, 0)), 0), 6);
|
|
3958
|
+
try {
|
|
3959
|
+
return new Intl.NumberFormat(t || void 0, {
|
|
3960
|
+
minimumFractionDigits: i,
|
|
3961
|
+
maximumFractionDigits: i,
|
|
3962
|
+
useGrouping: r !== "none"
|
|
3963
|
+
}).format(e);
|
|
3964
|
+
} catch {
|
|
3965
|
+
return e.toFixed(i);
|
|
3966
|
+
}
|
|
3967
|
+
}
|
|
3968
|
+
function dr({ from: e, to: t, duration: n, delay: a, decimals: o, prefix: l, suffix: f, separator: p, easing: m, trigger: h, offset: g, once: _, label: v, align: y, style: b, nodeRef: x, inert: S }) {
|
|
3969
|
+
let { locale: C } = r(Q), w = Math.max(lr(g, 0), 0), T = lr(e, 0), E = lr(t, 100), [D, O] = c(E), k = s(null), [j, M] = c(!1);
|
|
3970
|
+
return i(() => {
|
|
3971
|
+
let e = k.current;
|
|
3972
|
+
if (S || !j || !e) {
|
|
3973
|
+
O(E);
|
|
3974
|
+
return;
|
|
3975
|
+
}
|
|
3976
|
+
O(T);
|
|
3977
|
+
let t = Math.max(lr(n, 2e3), 0), r = Math.max(lr(a, 0), 0), i = sr[m] || sr.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, u = () => {
|
|
3978
|
+
if (cancelAnimationFrame(s), clearTimeout(c), o || t === 0) {
|
|
3979
|
+
O(E);
|
|
3980
|
+
return;
|
|
3981
|
+
}
|
|
3982
|
+
c = setTimeout(() => {
|
|
3983
|
+
let e = performance.now(), n = (r) => {
|
|
3984
|
+
let a = Math.min((r - e) / t, 1);
|
|
3985
|
+
O(T + (E - T) * i(a)), a < 1 && (s = requestAnimationFrame(n));
|
|
3986
|
+
};
|
|
3987
|
+
s = requestAnimationFrame(n);
|
|
3988
|
+
}, r);
|
|
3989
|
+
};
|
|
3990
|
+
if (h === "load" || typeof IntersectionObserver > "u") return u(), () => {
|
|
3991
|
+
cancelAnimationFrame(s), clearTimeout(c);
|
|
3992
|
+
};
|
|
3993
|
+
let d = new IntersectionObserver((e) => {
|
|
3994
|
+
let t = e.some((e) => e.isIntersecting);
|
|
3995
|
+
t && (!l || _ === !1) ? (l = !0, u()) : !t && _ === !1 && (cancelAnimationFrame(s), clearTimeout(c), O(T));
|
|
3996
|
+
}, {
|
|
3997
|
+
rootMargin: `0px 0px -${Math.min(w, Math.floor(cr(e)))}px 0px`,
|
|
3998
|
+
threshold: w > 0 ? 0 : .3
|
|
3999
|
+
});
|
|
4000
|
+
return d.observe(e), () => {
|
|
4001
|
+
d.disconnect(), cancelAnimationFrame(s), clearTimeout(c);
|
|
4002
|
+
};
|
|
4003
|
+
}, [
|
|
4004
|
+
j,
|
|
4005
|
+
S,
|
|
4006
|
+
T,
|
|
4007
|
+
E,
|
|
4008
|
+
n,
|
|
4009
|
+
a,
|
|
4010
|
+
m,
|
|
4011
|
+
h,
|
|
4012
|
+
w,
|
|
4013
|
+
_
|
|
4014
|
+
]), /* @__PURE__ */ d("div", {
|
|
4015
|
+
ref: (e) => {
|
|
4016
|
+
k.current = e, e && M(!0), typeof x == "function" && x(e);
|
|
4017
|
+
},
|
|
4018
|
+
"data-wb-counter": "",
|
|
4019
|
+
style: {
|
|
4020
|
+
display: "flex",
|
|
4021
|
+
flexDirection: "column",
|
|
4022
|
+
alignItems: y === "left" ? "flex-start" : y === "right" ? "flex-end" : "center",
|
|
4023
|
+
gap: 4,
|
|
4024
|
+
fontSize: 48,
|
|
4025
|
+
fontWeight: 700,
|
|
4026
|
+
lineHeight: 1.1,
|
|
4027
|
+
textAlign: y === "left" ? "left" : y === "right" ? "right" : "center",
|
|
4028
|
+
...A(b)
|
|
4029
|
+
},
|
|
4030
|
+
children: [/* @__PURE__ */ d("span", {
|
|
4031
|
+
style: {
|
|
4032
|
+
fontVariantNumeric: "tabular-nums",
|
|
4033
|
+
whiteSpace: "nowrap"
|
|
4034
|
+
},
|
|
4035
|
+
children: [
|
|
4036
|
+
l || "",
|
|
4037
|
+
ur(D, {
|
|
4038
|
+
locale: C,
|
|
4039
|
+
decimals: o,
|
|
4040
|
+
separator: p
|
|
4041
|
+
}),
|
|
4042
|
+
f || ""
|
|
4043
|
+
]
|
|
4044
|
+
}), v ? /* @__PURE__ */ u("span", {
|
|
4045
|
+
style: {
|
|
4046
|
+
fontSize: "0.3em",
|
|
4047
|
+
fontWeight: 400,
|
|
4048
|
+
lineHeight: 1.4,
|
|
4049
|
+
opacity: .72
|
|
4050
|
+
},
|
|
4051
|
+
children: v
|
|
4052
|
+
}) : null]
|
|
4053
|
+
});
|
|
4054
|
+
}
|
|
4055
|
+
function fr({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
|
|
3610
4056
|
let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
|
|
3611
4057
|
b(e), typeof p == "function" && p(e);
|
|
3612
4058
|
};
|
|
@@ -3617,8 +4063,8 @@ function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3617
4063
|
}
|
|
3618
4064
|
if (!y) return;
|
|
3619
4065
|
let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
|
|
3620
|
-
let t =
|
|
3621
|
-
v(n ||
|
|
4066
|
+
let t = ir(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
4067
|
+
v(n || ar(t) > e);
|
|
3622
4068
|
};
|
|
3623
4069
|
return t(), document.addEventListener("scroll", t, {
|
|
3624
4070
|
capture: !0,
|
|
@@ -3632,7 +4078,7 @@ function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3632
4078
|
]);
|
|
3633
4079
|
let S = () => {
|
|
3634
4080
|
if (m) return;
|
|
3635
|
-
let e =
|
|
4081
|
+
let e = ir(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3636
4082
|
e === window ? window.scrollTo({
|
|
3637
4083
|
top: 0,
|
|
3638
4084
|
behavior: n
|
|
@@ -3640,7 +4086,7 @@ function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3640
4086
|
top: 0,
|
|
3641
4087
|
behavior: n
|
|
3642
4088
|
});
|
|
3643
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
4089
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = or[n] ? n : "bottom-right", D = h ? {
|
|
3644
4090
|
position: "fixed",
|
|
3645
4091
|
zIndex: 5,
|
|
3646
4092
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3653,7 +4099,7 @@ function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3653
4099
|
} : {
|
|
3654
4100
|
position: "fixed",
|
|
3655
4101
|
zIndex: 2147482e3,
|
|
3656
|
-
...
|
|
4102
|
+
...or[E](C)
|
|
3657
4103
|
};
|
|
3658
4104
|
return /* @__PURE__ */ d("button", {
|
|
3659
4105
|
ref: x,
|
|
@@ -3704,7 +4150,7 @@ function Cn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3704
4150
|
}), w ? /* @__PURE__ */ u("span", { children: T }) : null]
|
|
3705
4151
|
});
|
|
3706
4152
|
}
|
|
3707
|
-
var
|
|
4153
|
+
var pr = {
|
|
3708
4154
|
facebook: {
|
|
3709
4155
|
label: "Facebook",
|
|
3710
4156
|
color: "#1877f2",
|
|
@@ -3771,8 +4217,8 @@ var wn = {
|
|
|
3771
4217
|
d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
|
|
3772
4218
|
}
|
|
3773
4219
|
};
|
|
3774
|
-
function
|
|
3775
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
4220
|
+
function mr({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
4221
|
+
let l = Array.isArray(e) ? e.filter((e) => e && pr[e.network]) : [];
|
|
3776
4222
|
if (!l.length) return null;
|
|
3777
4223
|
let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
|
|
3778
4224
|
return /* @__PURE__ */ u("div", {
|
|
@@ -3785,7 +4231,7 @@ function Tn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3785
4231
|
...A(o)
|
|
3786
4232
|
},
|
|
3787
4233
|
children: l.map((e, r) => {
|
|
3788
|
-
let i =
|
|
4234
|
+
let i = pr[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
|
|
3789
4235
|
return /* @__PURE__ */ u("a", {
|
|
3790
4236
|
href: e.url || "#",
|
|
3791
4237
|
onClick: h,
|
|
@@ -3819,7 +4265,7 @@ function Tn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3819
4265
|
})
|
|
3820
4266
|
});
|
|
3821
4267
|
}
|
|
3822
|
-
function
|
|
4268
|
+
function hr({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3823
4269
|
if (!t.length) return null;
|
|
3824
4270
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
3825
4271
|
width: 32,
|
|
@@ -3897,7 +4343,7 @@ function En({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3897
4343
|
})
|
|
3898
4344
|
});
|
|
3899
4345
|
}
|
|
3900
|
-
var
|
|
4346
|
+
var gr = {
|
|
3901
4347
|
small: {
|
|
3902
4348
|
w: 132,
|
|
3903
4349
|
h: 46,
|
|
@@ -3919,21 +4365,21 @@ var Dn = {
|
|
|
3919
4365
|
title: 12.5,
|
|
3920
4366
|
avatar: 46
|
|
3921
4367
|
}
|
|
3922
|
-
},
|
|
3923
|
-
|
|
3924
|
-
var
|
|
4368
|
+
}, _r = (e) => gr[e] ?? gr.medium;
|
|
4369
|
+
gr.medium.w, gr.medium.h;
|
|
4370
|
+
var vr = (e) => String(e?.group ?? "").trim(), yr = (e) => {
|
|
3925
4371
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
3926
4372
|
return e.forEach((e, r) => {
|
|
3927
|
-
let i =
|
|
4373
|
+
let i = vr(e) || `#${r}`;
|
|
3928
4374
|
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
3929
4375
|
}), t.flatMap((e) => n.get(e));
|
|
3930
4376
|
};
|
|
3931
|
-
function
|
|
3932
|
-
let i =
|
|
4377
|
+
function br(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
4378
|
+
let i = _r(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
|
|
3933
4379
|
for (let e of c) e.parent && l.has(e.parent) && e.parent !== e.id ? (u.has(e.parent) || u.set(e.parent, []), u.get(e.parent).push(e)) : d.push(e);
|
|
3934
|
-
d =
|
|
3935
|
-
for (let [e, t] of u) u.set(e,
|
|
3936
|
-
let f = (e, t) => o + (
|
|
4380
|
+
d = yr(d);
|
|
4381
|
+
for (let [e, t] of u) u.set(e, yr(t));
|
|
4382
|
+
let f = (e, t) => o + (vr(e) !== vr(t) && (vr(e) || vr(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
3937
4383
|
if (t.has(e.id)) return 0;
|
|
3938
4384
|
t.add(e.id);
|
|
3939
4385
|
let n = u.get(e.id) ?? [], r = n.reduce((e, r, i) => e + m(r, t) + (i ? f(n[i - 1], r) : 0), 0), i = Math.max(a, r);
|
|
@@ -3949,7 +4395,7 @@ function jn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
3949
4395
|
x: m,
|
|
3950
4396
|
y: b
|
|
3951
4397
|
});
|
|
3952
|
-
let x =
|
|
4398
|
+
let x = vr(e);
|
|
3953
4399
|
if (x) {
|
|
3954
4400
|
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
3955
4401
|
_.has(t) || _.set(t, {
|
|
@@ -4023,19 +4469,19 @@ function jn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
4023
4469
|
horizontal: n
|
|
4024
4470
|
};
|
|
4025
4471
|
}
|
|
4026
|
-
var
|
|
4472
|
+
var xr = (e, t) => {
|
|
4027
4473
|
let n = String(e ?? "");
|
|
4028
4474
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
4029
|
-
},
|
|
4475
|
+
}, Sr = (e) => {
|
|
4030
4476
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
4031
4477
|
if (!t) return "#ffffff";
|
|
4032
4478
|
let n = t[1];
|
|
4033
4479
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
4034
4480
|
let r = parseInt(n, 16);
|
|
4035
4481
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
4036
|
-
},
|
|
4037
|
-
function
|
|
4038
|
-
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 ? "" :
|
|
4482
|
+
}, Cr = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
4483
|
+
function wr(e, t = {}) {
|
|
4484
|
+
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 ? "" : ct(e);
|
|
4039
4485
|
return n.map((e) => {
|
|
4040
4486
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
4041
4487
|
return {
|
|
@@ -4050,11 +4496,11 @@ function Fn(e, t = {}) {
|
|
|
4050
4496
|
};
|
|
4051
4497
|
});
|
|
4052
4498
|
}
|
|
4053
|
-
var
|
|
4499
|
+
var Tr = {
|
|
4054
4500
|
size: 36,
|
|
4055
4501
|
pad: 10
|
|
4056
4502
|
};
|
|
4057
|
-
function
|
|
4503
|
+
function Er({ node: e, onClose: t }) {
|
|
4058
4504
|
return i(() => {
|
|
4059
4505
|
let e = (e) => e.key === "Escape" && t();
|
|
4060
4506
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -4175,8 +4621,8 @@ function Ln({ node: e, onClose: t }) {
|
|
|
4175
4621
|
})
|
|
4176
4622
|
});
|
|
4177
4623
|
}
|
|
4178
|
-
function
|
|
4179
|
-
let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(
|
|
4624
|
+
function Dr({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
|
|
4625
|
+
let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(Q), O = r(et)?.[t], [k, j] = c(null);
|
|
4180
4626
|
i(() => {
|
|
4181
4627
|
if (!t || O) return;
|
|
4182
4628
|
let e = !0;
|
|
@@ -4192,7 +4638,7 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4192
4638
|
D,
|
|
4193
4639
|
O
|
|
4194
4640
|
]);
|
|
4195
|
-
let M = t ?
|
|
4641
|
+
let M = t ? wr(O ?? k ?? [], {
|
|
4196
4642
|
nameField: n,
|
|
4197
4643
|
titleField: o,
|
|
4198
4644
|
photoField: s,
|
|
@@ -4200,7 +4646,7 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4200
4646
|
cvField: p,
|
|
4201
4647
|
hrefField: m,
|
|
4202
4648
|
groupField: h
|
|
4203
|
-
}) : e, N =
|
|
4649
|
+
}) : e, N = _r(v), { boxes: P, links: F, groups: I, width: L, height: R } = br(M, {
|
|
4204
4650
|
size: v,
|
|
4205
4651
|
horizontal: y,
|
|
4206
4652
|
groupTitles: g
|
|
@@ -4258,8 +4704,8 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4258
4704
|
fontSize: N.title + 1,
|
|
4259
4705
|
fontWeight: "600",
|
|
4260
4706
|
opacity: "0.55",
|
|
4261
|
-
fill: r ?
|
|
4262
|
-
children:
|
|
4707
|
+
fill: r ? Sr(e.color || _) : "var(--page-text, #111827)",
|
|
4708
|
+
children: xr(e.title, Math.floor(e.width / 7))
|
|
4263
4709
|
})] }, `group-${t}`);
|
|
4264
4710
|
}),
|
|
4265
4711
|
F.map((e, t) => /* @__PURE__ */ u("path", {
|
|
@@ -4269,7 +4715,7 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4269
4715
|
strokeWidth: "1.5"
|
|
4270
4716
|
}, t)),
|
|
4271
4717
|
P.map(({ node: e, x: t, y: n }) => {
|
|
4272
|
-
let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ?
|
|
4718
|
+
let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Sr(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Sr(e.color2) : s, f = S && (Cr(e) || e.href), p = () => Cr(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Tr.pad + N.avatar + 8 : t + N.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((N.w - N.avatar - 26) / 7) : Math.floor(N.w / 7.6), _ = N.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
|
|
4273
4719
|
return /* @__PURE__ */ d("g", {
|
|
4274
4720
|
onClick: f ? p : void 0,
|
|
4275
4721
|
style: f ? { cursor: "pointer" } : void 0,
|
|
@@ -4333,13 +4779,13 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4333
4779
|
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
4334
4780
|
id: `${C}-${e.id}`,
|
|
4335
4781
|
children: /* @__PURE__ */ u("circle", {
|
|
4336
|
-
cx: t +
|
|
4782
|
+
cx: t + Tr.pad + N.avatar / 2,
|
|
4337
4783
|
cy: n + N.h / 2,
|
|
4338
4784
|
r: N.avatar / 2
|
|
4339
4785
|
})
|
|
4340
4786
|
}), /* @__PURE__ */ u("image", {
|
|
4341
4787
|
href: e.photo,
|
|
4342
|
-
x: t +
|
|
4788
|
+
x: t + Tr.pad,
|
|
4343
4789
|
y: n + (N.h - N.avatar) / 2,
|
|
4344
4790
|
width: N.avatar,
|
|
4345
4791
|
height: N.avatar,
|
|
@@ -4353,7 +4799,7 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4353
4799
|
fontSize: N.title,
|
|
4354
4800
|
fontWeight: "600",
|
|
4355
4801
|
fill: s,
|
|
4356
|
-
children:
|
|
4802
|
+
children: xr(e.title, g + 4)
|
|
4357
4803
|
}), e.name && /* @__PURE__ */ u("text", {
|
|
4358
4804
|
x: m,
|
|
4359
4805
|
y: n + _ + _ / 2 + N.name * .35,
|
|
@@ -4361,7 +4807,7 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4361
4807
|
fontSize: N.name,
|
|
4362
4808
|
fontWeight: "600",
|
|
4363
4809
|
fill: c,
|
|
4364
|
-
children:
|
|
4810
|
+
children: xr(e.name, g)
|
|
4365
4811
|
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
4366
4812
|
x: m,
|
|
4367
4813
|
y: n + (v[1] ? N.h * .43 : N.h * .57),
|
|
@@ -4369,7 +4815,7 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4369
4815
|
fontSize: N.name,
|
|
4370
4816
|
fontWeight: "600",
|
|
4371
4817
|
fill: s,
|
|
4372
|
-
children:
|
|
4818
|
+
children: xr(v[0], g)
|
|
4373
4819
|
}), v[1] && /* @__PURE__ */ u("text", {
|
|
4374
4820
|
x: m,
|
|
4375
4821
|
y: n + N.h * .73,
|
|
@@ -4377,19 +4823,19 @@ function Rn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4377
4823
|
fontSize: N.title,
|
|
4378
4824
|
opacity: "0.7",
|
|
4379
4825
|
fill: s,
|
|
4380
|
-
children:
|
|
4826
|
+
children: xr(v[1], g + 4)
|
|
4381
4827
|
})] })
|
|
4382
4828
|
]
|
|
4383
4829
|
}, e.id);
|
|
4384
4830
|
})
|
|
4385
4831
|
]
|
|
4386
|
-
}), w && /* @__PURE__ */ u(
|
|
4832
|
+
}), w && /* @__PURE__ */ u(Er, {
|
|
4387
4833
|
node: w,
|
|
4388
4834
|
onClose: () => T(null)
|
|
4389
4835
|
})]
|
|
4390
4836
|
});
|
|
4391
4837
|
}
|
|
4392
|
-
function
|
|
4838
|
+
function Or({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4393
4839
|
let [a, o] = c(!1), l = s(null);
|
|
4394
4840
|
return i(() => {
|
|
4395
4841
|
if (!a || !l.current) return;
|
|
@@ -4419,7 +4865,7 @@ function zn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4419
4865
|
children: e ?? ""
|
|
4420
4866
|
});
|
|
4421
4867
|
}
|
|
4422
|
-
var
|
|
4868
|
+
var kr = 360, Ar = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", jr = (e, t) => e && t ? `cell-${e}-${t}` : "", Mr = (e) => {
|
|
4423
4869
|
if (!e || typeof e != "object") return e ?? "";
|
|
4424
4870
|
let t = String(e.text ?? "");
|
|
4425
4871
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ u("a", {
|
|
@@ -4430,7 +4876,7 @@ var Bn = 360, Vn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4430
4876
|
children: t
|
|
4431
4877
|
}) : t;
|
|
4432
4878
|
};
|
|
4433
|
-
function
|
|
4879
|
+
function Nr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], colKeys: o = [], heights: f = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: j, style: M, nodeRef: N, edit: P }) {
|
|
4434
4880
|
let F = s(null), I = s(null), [L, R] = c(null), [z, B] = c(null), V = (e, t) => () => R({
|
|
4435
4881
|
r: e,
|
|
4436
4882
|
c: t
|
|
@@ -4444,7 +4890,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4444
4890
|
}
|
|
4445
4891
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4446
4892
|
top: r.bottom - n.top + 4,
|
|
4447
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
4893
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - kr))
|
|
4448
4894
|
};
|
|
4449
4895
|
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4450
4896
|
}), i(() => {
|
|
@@ -4454,7 +4900,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4454
4900
|
};
|
|
4455
4901
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4456
4902
|
}, [P, L]);
|
|
4457
|
-
let { tenant: H, apiUrl: U } = r(
|
|
4903
|
+
let { tenant: H, apiUrl: U } = r(Q), ee = r(et), te = ee?.[h], ne = C ? tt(ee) : 1, [re, ie] = c(null);
|
|
4458
4904
|
if (i(() => {
|
|
4459
4905
|
if (!h || te) return;
|
|
4460
4906
|
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(ne - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
@@ -4473,17 +4919,17 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4473
4919
|
ne,
|
|
4474
4920
|
g
|
|
4475
4921
|
]), !e.length) return null;
|
|
4476
|
-
let W = Math.max(1, Number(g) || 10), G = h ? C ? te || h.startsWith("api:") ? (te ?? re ?? []).slice((ne - 1) * W, ne * W) : (re ?? []).slice(0, W) : (te ?? re ?? []).slice(0, W) : null, K = G ? G.map((t) => e.map((e) =>
|
|
4922
|
+
let W = Math.max(1, Number(g) || 10), G = h ? C ? te || h.startsWith("api:") ? (te ?? re ?? []).slice((ne - 1) * W, ne * W) : (re ?? []).slice(0, W) : (te ?? re ?? []).slice(0, W) : null, K = G ? G.map((t) => e.map((e) => ct(ot(t?.data, e.field)))) : t, ae = !!h && !(h && !te && re === null) && K.length === 0, q = b ? {
|
|
4477
4923
|
y: 6,
|
|
4478
4924
|
x: 10
|
|
4479
4925
|
} : {
|
|
4480
4926
|
y: 10,
|
|
4481
4927
|
x: 14
|
|
4482
|
-
},
|
|
4928
|
+
}, oe = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : q.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : q.x}px`, se = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, ce = y ? { border: se } : { borderBottom: se }, le = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), ue = [
|
|
4483
4929
|
"left",
|
|
4484
4930
|
"center",
|
|
4485
4931
|
"right"
|
|
4486
|
-
],
|
|
4932
|
+
], J = (t) => ue.includes(e[t]?.align) ? e[t].align : "", de = (e) => J(e) || (ue.includes(O) ? O : "left"), fe = Number.isFinite(Number(j)) && Number(j) > 0 ? Number(j) : 0, pe = A(M), me = !fe && pe && pe.maxHeight !== void 0 ? pe.maxHeight : 0, he = fe || me, ge = me ? {
|
|
4487
4933
|
...pe,
|
|
4488
4934
|
maxHeight: void 0
|
|
4489
4935
|
} : pe, _e = !!P && P.rows !== !1, ve = (t) => (r) => {
|
|
@@ -4491,7 +4937,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4491
4937
|
r.preventDefault(), r.stopPropagation();
|
|
4492
4938
|
let i = F.current, a = i ? i.clientWidth : 0;
|
|
4493
4939
|
if (!a) return;
|
|
4494
|
-
let o =
|
|
4940
|
+
let o = le ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4495
4941
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4496
4942
|
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, P.resize(i);
|
|
4497
4943
|
}, u = () => {
|
|
@@ -4500,7 +4946,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4500
4946
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4501
4947
|
}, ye = /* @__PURE__ */ new Set();
|
|
4502
4948
|
p && K.forEach((t, n) => e.forEach((e, t) => {
|
|
4503
|
-
let r = p[
|
|
4949
|
+
let r = p[jr(a[n], o[t])];
|
|
4504
4950
|
if (!r) return;
|
|
4505
4951
|
let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
|
|
4506
4952
|
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && ye.add(`${n + e},${t + r}`);
|
|
@@ -4523,7 +4969,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4523
4969
|
},
|
|
4524
4970
|
onClick: n,
|
|
4525
4971
|
children: e
|
|
4526
|
-
}, t), X = L && L.r < K.length && L.c < e.length ? L : null,
|
|
4972
|
+
}, t), X = L && L.r < K.length && L.c < e.length ? L : null, Z = (e, t) => P?.labels?.[e] ?? t, xe = X ? p?.[jr(a[X.r], o[X.c])] : null, Se = Math.max(1, Number(xe?.c) || 1), Ce = Math.max(1, Number(xe?.r) || 1);
|
|
4527
4973
|
return /* @__PURE__ */ d("div", {
|
|
4528
4974
|
ref: (e) => {
|
|
4529
4975
|
I.current = e, typeof N == "function" && N(e);
|
|
@@ -4534,7 +4980,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4534
4980
|
...ge
|
|
4535
4981
|
},
|
|
4536
4982
|
children: [
|
|
4537
|
-
P && /* @__PURE__ */ u("style", { children:
|
|
4983
|
+
P && /* @__PURE__ */ u("style", { children: Ar }),
|
|
4538
4984
|
P && X && z && /* @__PURE__ */ d("div", {
|
|
4539
4985
|
className: "wb-tedit-bar",
|
|
4540
4986
|
style: {
|
|
@@ -4547,21 +4993,21 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4547
4993
|
className: "wb-tedit-at",
|
|
4548
4994
|
children: `R${X.r + 1}·C${X.c + 1}`
|
|
4549
4995
|
}),
|
|
4550
|
-
Y("+↑",
|
|
4551
|
-
Y("+↓",
|
|
4552
|
-
Y("↑",
|
|
4553
|
-
Y("↓",
|
|
4554
|
-
Y("✕ row",
|
|
4996
|
+
Y("+↑", Z("rowAbove", "Insert row above"), () => P.addRow(X.r - 1)),
|
|
4997
|
+
Y("+↓", Z("rowBelow", "Insert row below"), () => P.addRow(X.r)),
|
|
4998
|
+
Y("↑", Z("rowUp", "Move row up"), () => P.moveRow(X.r, -1), X.r === 0),
|
|
4999
|
+
Y("↓", Z("rowDown", "Move row down"), () => P.moveRow(X.r, 1), X.r >= K.length - 1),
|
|
5000
|
+
Y("✕ row", Z("rowDelete", "Delete row"), () => P.dropRow(X.r), K.length <= 1),
|
|
4555
5001
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4556
|
-
Y("+←",
|
|
4557
|
-
Y("+→",
|
|
4558
|
-
Y("←",
|
|
4559
|
-
Y("→",
|
|
4560
|
-
Y("✕ col",
|
|
5002
|
+
Y("+←", Z("colLeft", "Insert column left"), () => P.addColumn(X.c - 1)),
|
|
5003
|
+
Y("+→", Z("colRight", "Insert column right"), () => P.addColumn(X.c)),
|
|
5004
|
+
Y("←", Z("colMoveLeft", "Move column left"), () => P.moveColumn(X.c, -1), X.c === 0),
|
|
5005
|
+
Y("→", Z("colMoveRight", "Move column right"), () => P.moveColumn(X.c, 1), X.c >= e.length - 1),
|
|
5006
|
+
Y("✕ col", Z("colDelete", "Delete column"), () => P.dropColumn(X.c), e.length <= 1),
|
|
4561
5007
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4562
|
-
Y("↔",
|
|
4563
|
-
Y("↕",
|
|
4564
|
-
Y("⤫",
|
|
5008
|
+
Y("↔", Z("mergeRight", "Merge with the cell on the right"), () => P.merge(X.r, X.c, "right"), X.c + Se >= e.length),
|
|
5009
|
+
Y("↕", Z("mergeDown", "Merge with the cell below"), () => P.merge(X.r, X.c, "down"), X.r + Ce >= K.length),
|
|
5010
|
+
Y("⤫", Z("split", "Split this cell"), () => P.split(X.r, X.c), Se === 1 && Ce === 1)
|
|
4565
5011
|
]
|
|
4566
5012
|
}),
|
|
4567
5013
|
/* @__PURE__ */ u("div", {
|
|
@@ -4580,17 +5026,17 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4580
5026
|
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
4581
5027
|
borderSpacing: 0,
|
|
4582
5028
|
fontSize: 14,
|
|
4583
|
-
...
|
|
4584
|
-
...y ? { border:
|
|
5029
|
+
...le ? { tableLayout: "fixed" } : null,
|
|
5030
|
+
...y ? { border: se } : {}
|
|
4585
5031
|
},
|
|
4586
5032
|
children: [
|
|
4587
|
-
|
|
5033
|
+
le && /* @__PURE__ */ u("colgroup", { children: n.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
|
|
4588
5034
|
_ === !1 ? null : /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((t, n) => /* @__PURE__ */ u("th", {
|
|
4589
5035
|
className: P ? "wb-tedit-head" : void 0,
|
|
4590
5036
|
style: {
|
|
4591
5037
|
textAlign: de(n),
|
|
4592
5038
|
fontWeight: 600,
|
|
4593
|
-
padding:
|
|
5039
|
+
padding: oe,
|
|
4594
5040
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4595
5041
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4596
5042
|
...T ? {
|
|
@@ -4598,26 +5044,26 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4598
5044
|
top: 0,
|
|
4599
5045
|
zIndex: 2
|
|
4600
5046
|
} : P ? { position: "relative" } : null,
|
|
4601
|
-
...
|
|
5047
|
+
...ce
|
|
4602
5048
|
},
|
|
4603
|
-
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
5049
|
+
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(Or, {
|
|
4604
5050
|
value: t.label ?? t,
|
|
4605
5051
|
onCommit: (e) => P.header(n, e),
|
|
4606
|
-
hint:
|
|
5052
|
+
hint: Z("editCell", "Double-click to edit"),
|
|
4607
5053
|
style: { paddingRight: 6 }
|
|
4608
5054
|
}), n < e.length - 1 && /* @__PURE__ */ u("span", {
|
|
4609
5055
|
className: "wb-tedit-grip",
|
|
4610
|
-
title:
|
|
5056
|
+
title: Z("colWidth", "Drag to resize the column"),
|
|
4611
5057
|
onPointerDown: ve(n)
|
|
4612
5058
|
})] }) : t.label ?? t
|
|
4613
5059
|
}, n)) }) }),
|
|
4614
5060
|
/* @__PURE__ */ d("tbody", { children: [ae && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
4615
5061
|
colSpan: e.length,
|
|
4616
5062
|
style: {
|
|
4617
|
-
padding:
|
|
5063
|
+
padding: oe,
|
|
4618
5064
|
textAlign: "center",
|
|
4619
5065
|
opacity: .6,
|
|
4620
|
-
...
|
|
5066
|
+
...ce
|
|
4621
5067
|
},
|
|
4622
5068
|
children: w || "No data yet"
|
|
4623
5069
|
}) }), K.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
@@ -4628,7 +5074,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4628
5074
|
},
|
|
4629
5075
|
children: e.map((e, r) => {
|
|
4630
5076
|
if (ye.has(`${n},${r}`)) return null;
|
|
4631
|
-
let i =
|
|
5077
|
+
let i = jr(a[n], o[r]), s = m?.[i], c = p?.[i], l = Math.max(1, Number(c?.c) || 1), f = Math.max(1, Number(c?.r) || 1);
|
|
4632
5078
|
return /* @__PURE__ */ d("td", {
|
|
4633
5079
|
className: P ? `wb-tedit-cell${L?.r === n && L?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4634
5080
|
onMouseDownCapture: _e ? V(n, r) : void 0,
|
|
@@ -4636,14 +5082,14 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4636
5082
|
colSpan: l > 1 ? l : void 0,
|
|
4637
5083
|
rowSpan: f > 1 ? f : void 0,
|
|
4638
5084
|
style: {
|
|
4639
|
-
padding:
|
|
4640
|
-
...
|
|
5085
|
+
padding: oe,
|
|
5086
|
+
...J(r) ? { textAlign: J(r) } : null,
|
|
4641
5087
|
...P ? { position: "relative" } : null,
|
|
4642
|
-
...
|
|
5088
|
+
...ce
|
|
4643
5089
|
},
|
|
4644
|
-
children: [s ??
|
|
5090
|
+
children: [s ?? Mr(t?.[r]), P && _e && /* @__PURE__ */ u("span", {
|
|
4645
5091
|
className: "wb-tedit-rowgrip",
|
|
4646
|
-
title:
|
|
5092
|
+
title: Z("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4647
5093
|
onPointerDown: be(n),
|
|
4648
5094
|
onDoubleClick: () => P.resizeRow(n, 0)
|
|
4649
5095
|
})]
|
|
@@ -4656,7 +5102,7 @@ function Wn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4656
5102
|
]
|
|
4657
5103
|
});
|
|
4658
5104
|
}
|
|
4659
|
-
var
|
|
5105
|
+
var Pr = {
|
|
4660
5106
|
small: {
|
|
4661
5107
|
cell: 62,
|
|
4662
5108
|
font: 10.5,
|
|
@@ -4681,9 +5127,9 @@ var Gn = {
|
|
|
4681
5127
|
pad: 8,
|
|
4682
5128
|
gap: 4
|
|
4683
5129
|
}
|
|
4684
|
-
},
|
|
4685
|
-
function
|
|
4686
|
-
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 ? "" :
|
|
5130
|
+
}, Fr = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Ir = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Lr = 366;
|
|
5131
|
+
function Rr(e, t = {}) {
|
|
5132
|
+
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 ? "" : ct(e), a = (e) => {
|
|
4687
5133
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4688
5134
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4689
5135
|
};
|
|
@@ -4699,7 +5145,7 @@ function Yn(e, t = {}) {
|
|
|
4699
5145
|
} : null;
|
|
4700
5146
|
}).filter(Boolean);
|
|
4701
5147
|
}
|
|
4702
|
-
function
|
|
5148
|
+
function zr(e) {
|
|
4703
5149
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4704
5150
|
let n = e?.start ? new Date(e.start) : null;
|
|
4705
5151
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4714,20 +5160,20 @@ function Xn(e) {
|
|
|
4714
5160
|
};
|
|
4715
5161
|
}).filter(Boolean);
|
|
4716
5162
|
}
|
|
4717
|
-
function
|
|
5163
|
+
function Br(e) {
|
|
4718
5164
|
let t = /* @__PURE__ */ new Map();
|
|
4719
5165
|
for (let n of e) {
|
|
4720
|
-
let e =
|
|
5166
|
+
let e = Ir(n.start), r = n.end ? Ir(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Lr);
|
|
4721
5167
|
for (let r = 0; r <= i; r += 1) {
|
|
4722
|
-
let i =
|
|
5168
|
+
let i = Fr(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4723
5169
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4724
5170
|
}
|
|
4725
5171
|
}
|
|
4726
5172
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4727
5173
|
return t;
|
|
4728
5174
|
}
|
|
4729
|
-
function
|
|
4730
|
-
let { tenant: T, apiUrl: E, locale: D } = r(
|
|
5175
|
+
function Vr({ events: e = [], source: t = "", titleField: n = "", startField: a = "", endField: o = "", hrefField: s = "", colorField: f = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
|
|
5176
|
+
let { tenant: T, apiUrl: E, locale: D } = r(Q), O = r(et)?.[t], [k, j] = c(null), [M, N] = c(() => {
|
|
4731
5177
|
let e = /* @__PURE__ */ new Date();
|
|
4732
5178
|
return {
|
|
4733
5179
|
year: e.getFullYear(),
|
|
@@ -4749,13 +5195,13 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4749
5195
|
E,
|
|
4750
5196
|
O
|
|
4751
5197
|
]);
|
|
4752
|
-
let P =
|
|
5198
|
+
let P = Pr[m] ?? Pr.medium, F = h || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = g || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? Rr(O ?? k ?? [], {
|
|
4753
5199
|
titleField: n,
|
|
4754
5200
|
startField: a,
|
|
4755
5201
|
endField: o,
|
|
4756
5202
|
hrefField: s,
|
|
4757
5203
|
colorField: f
|
|
4758
|
-
}) :
|
|
5204
|
+
}) : zr(e), B = Br(z), V = D || void 0, H = (e, t) => {
|
|
4759
5205
|
let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
|
|
4760
5206
|
width: 6,
|
|
4761
5207
|
height: 6,
|
|
@@ -4887,10 +5333,10 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4887
5333
|
})]
|
|
4888
5334
|
});
|
|
4889
5335
|
}
|
|
4890
|
-
let re = new Date(M.year, M.month, 1), ie = y === "sunday" ? 0 : 1, W = (re.getDay() - ie + 7) % 7, G = new Date(M.year, M.month + 1, 0).getDate(), K = Math.ceil((W + G) / 7), ae =
|
|
5336
|
+
let re = new Date(M.year, M.month, 1), ie = y === "sunday" ? 0 : 1, W = (re.getDay() - ie + 7) % 7, G = new Date(M.year, M.month + 1, 0).getDate(), K = Math.ceil((W + G) / 7), ae = Fr(/* @__PURE__ */ new Date()), q = new Intl.DateTimeFormat(V, { weekday: "short" }), oe = [];
|
|
4891
5337
|
for (let e = 0; e < K * 7; e += 1) {
|
|
4892
|
-
let t = e - W + 1, n = t >= 1 && t <= G, r =
|
|
4893
|
-
|
|
5338
|
+
let t = e - W + 1, n = t >= 1 && t <= G, r = Fr(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ae;
|
|
5339
|
+
oe.push(/* @__PURE__ */ d("div", {
|
|
4894
5340
|
style: {
|
|
4895
5341
|
minHeight: P.cell,
|
|
4896
5342
|
borderTop: `1px solid ${I}`,
|
|
@@ -4948,30 +5394,30 @@ function Qn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4948
5394
|
padding: `0 0 ${P.pad}px`
|
|
4949
5395
|
},
|
|
4950
5396
|
children: q.format(new Date(2024, 0, 7 + ie + t))
|
|
4951
|
-
}, `head-${t}`)),
|
|
5397
|
+
}, `head-${t}`)), oe]
|
|
4952
5398
|
}),
|
|
4953
5399
|
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4954
5400
|
]
|
|
4955
5401
|
});
|
|
4956
5402
|
}
|
|
4957
|
-
var
|
|
5403
|
+
var Hr = {
|
|
4958
5404
|
small: 36,
|
|
4959
5405
|
medium: 56,
|
|
4960
5406
|
large: 88
|
|
4961
5407
|
};
|
|
4962
|
-
function
|
|
4963
|
-
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" :
|
|
5408
|
+
function Ur(e, t = {}) {
|
|
5409
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : ct(e);
|
|
4964
5410
|
return n.map((e) => {
|
|
4965
|
-
let n = e.data ?? e, i =
|
|
5411
|
+
let n = e.data ?? e, i = ot(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(ot(n, t.nameField)) : r(n.name);
|
|
4966
5412
|
return {
|
|
4967
5413
|
src: typeof o == "string" ? o.trim() : "",
|
|
4968
5414
|
alt: s,
|
|
4969
|
-
href: t.hrefField ? r(
|
|
5415
|
+
href: t.hrefField ? r(ot(n, t.hrefField)) : ""
|
|
4970
5416
|
};
|
|
4971
5417
|
}).filter((e) => e.src);
|
|
4972
5418
|
}
|
|
4973
|
-
function
|
|
4974
|
-
let { tenant: D, apiUrl: O } = r(
|
|
5419
|
+
function Wr({ logos: e = [], source: t = "", imageField: n = "", nameField: a = "", hrefField: o = "", variant: f = "step", size: p = "medium", perView: m = 5, gap: h = 48, hold: g = 3, slideMs: _ = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
|
|
5420
|
+
let { tenant: D, apiUrl: O } = r(Q), k = r(et)?.[t], [j, M] = c(null), N = s(null), P = s(null), [F, I] = c(0), [L, R] = c(0), [z, B] = c(0), [V, H] = c(!0), [U, ee] = c(!1), [te, ne] = c(!1);
|
|
4975
5421
|
i(() => {
|
|
4976
5422
|
if (!t || k) return;
|
|
4977
5423
|
let e = !0;
|
|
@@ -5010,11 +5456,11 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5010
5456
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
5011
5457
|
};
|
|
5012
5458
|
});
|
|
5013
|
-
let re = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ie = t ?
|
|
5459
|
+
let re = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], ie = t ? Ur(k ?? j ?? [], {
|
|
5014
5460
|
imageField: n,
|
|
5015
5461
|
nameField: a,
|
|
5016
5462
|
hrefField: o
|
|
5017
|
-
}) : re, W =
|
|
5463
|
+
}) : re, W = Hr[p] ?? Hr.medium, G = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ae = f === "marquee" ? "step" : f, q = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), oe = Math.min(3e3, Math.max(100, Number(_) || 500)), se = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), ce = (L || W * 3) + G, le = F ? Math.max(1, Math.floor(F / ce)) : se, ue = Math.min(se, le), J = F ? Math.min(ce, F / ue) : ce;
|
|
5018
5464
|
if (!ie.length) return /* @__PURE__ */ u("div", {
|
|
5019
5465
|
ref: T,
|
|
5020
5466
|
style: {
|
|
@@ -5060,7 +5506,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5060
5506
|
children: C
|
|
5061
5507
|
}) : null
|
|
5062
5508
|
});
|
|
5063
|
-
let de = ie.length, fe = ae === "step" && de >
|
|
5509
|
+
let de = ie.length, fe = ae === "step" && de > ue, pe = ae === "slider", me = fe && !E && !U && !te, he = v === "right", ge = he ? de : 0, _e = fe ? [...ie, ...ie] : ie, ve = fe ? z * J : 0, ye = (e, t, n) => {
|
|
5064
5510
|
let r = /* @__PURE__ */ u("img", {
|
|
5065
5511
|
src: e.src,
|
|
5066
5512
|
alt: e.alt ?? "",
|
|
@@ -5072,7 +5518,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5072
5518
|
display: "block"
|
|
5073
5519
|
}
|
|
5074
5520
|
}), i = fe ? {
|
|
5075
|
-
width:
|
|
5521
|
+
width: J,
|
|
5076
5522
|
flex: "0 0 auto",
|
|
5077
5523
|
padding: `0 ${G / 2}px`,
|
|
5078
5524
|
justifyContent: "center"
|
|
@@ -5104,9 +5550,9 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5104
5550
|
display: "flex",
|
|
5105
5551
|
alignItems: "center",
|
|
5106
5552
|
...fe ? {
|
|
5107
|
-
width: _e.length *
|
|
5553
|
+
width: _e.length * J,
|
|
5108
5554
|
transform: `translateX(-${ve}px)`,
|
|
5109
|
-
transition: V ? `transform ${
|
|
5555
|
+
transition: V ? `transform ${oe}ms ease` : "none"
|
|
5110
5556
|
} : pe ? {
|
|
5111
5557
|
gap: G,
|
|
5112
5558
|
overflowX: "auto",
|
|
@@ -5137,7 +5583,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5137
5583
|
H(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
5138
5584
|
H(!0), B(n + e);
|
|
5139
5585
|
}));
|
|
5140
|
-
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show",
|
|
5586
|
+
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Z = X !== "off" && (pe ? F > 0 : fe), xe = (e) => /* @__PURE__ */ u("button", {
|
|
5141
5587
|
type: "button",
|
|
5142
5588
|
"aria-label": e < 0 ? "Previous logos" : "Next logos",
|
|
5143
5589
|
onClick: () => Y(e),
|
|
@@ -5182,27 +5628,27 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5182
5628
|
fe ? /* @__PURE__ */ d("div", {
|
|
5183
5629
|
style: {
|
|
5184
5630
|
position: "relative",
|
|
5185
|
-
width:
|
|
5631
|
+
width: ue * J,
|
|
5186
5632
|
maxWidth: "100%",
|
|
5187
5633
|
margin: "0 auto"
|
|
5188
5634
|
},
|
|
5189
5635
|
children: [
|
|
5190
|
-
|
|
5636
|
+
Z ? xe(-1) : null,
|
|
5191
5637
|
/* @__PURE__ */ u("div", {
|
|
5192
5638
|
style: { overflow: "hidden" },
|
|
5193
5639
|
children: be
|
|
5194
5640
|
}),
|
|
5195
|
-
|
|
5641
|
+
Z ? xe(1) : null
|
|
5196
5642
|
]
|
|
5197
5643
|
}) : /* @__PURE__ */ d(l, { children: [
|
|
5198
|
-
|
|
5644
|
+
Z ? xe(-1) : null,
|
|
5199
5645
|
be,
|
|
5200
|
-
|
|
5646
|
+
Z ? xe(1) : null
|
|
5201
5647
|
] }),
|
|
5202
|
-
/* @__PURE__ */ u(
|
|
5648
|
+
/* @__PURE__ */ u(Gr, {
|
|
5203
5649
|
running: me,
|
|
5204
|
-
every: q +
|
|
5205
|
-
slide:
|
|
5650
|
+
every: q + oe,
|
|
5651
|
+
slide: oe,
|
|
5206
5652
|
step: he ? -1 : 1,
|
|
5207
5653
|
index: z,
|
|
5208
5654
|
total: de,
|
|
@@ -5213,7 +5659,7 @@ function tr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5213
5659
|
]
|
|
5214
5660
|
});
|
|
5215
5661
|
}
|
|
5216
|
-
function
|
|
5662
|
+
function Gr({ running: e, every: t, slide: n, step: r, index: a, total: o, home: s, setIndex: c, setAnimate: l }) {
|
|
5217
5663
|
i(() => {
|
|
5218
5664
|
if (!e) return;
|
|
5219
5665
|
let n = setInterval(() => {
|
|
@@ -5249,13 +5695,13 @@ function nr({ running: e, every: t, slide: n, step: r, index: a, total: o, home:
|
|
|
5249
5695
|
l
|
|
5250
5696
|
]), null;
|
|
5251
5697
|
}
|
|
5252
|
-
var
|
|
5698
|
+
var Kr = {
|
|
5253
5699
|
small: 380,
|
|
5254
5700
|
medium: 560,
|
|
5255
5701
|
large: 820,
|
|
5256
5702
|
full: "100%"
|
|
5257
5703
|
};
|
|
5258
|
-
function
|
|
5704
|
+
function qr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: a = 0, size: o = "medium", title: l = "", showClose: f = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
|
|
5259
5705
|
let [C, w] = c(!1), T = s(null);
|
|
5260
5706
|
i(() => {
|
|
5261
5707
|
if (S || !e) return;
|
|
@@ -5280,7 +5726,7 @@ function ir({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5280
5726
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
5281
5727
|
};
|
|
5282
5728
|
}, [S, C]);
|
|
5283
|
-
let E =
|
|
5729
|
+
let E = Kr[o] ?? Kr.medium, D = (e) => {
|
|
5284
5730
|
let t = {
|
|
5285
5731
|
padding: "9px 16px",
|
|
5286
5732
|
borderRadius: 6,
|
|
@@ -5449,7 +5895,7 @@ function ir({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5449
5895
|
})]
|
|
5450
5896
|
});
|
|
5451
5897
|
}
|
|
5452
|
-
function
|
|
5898
|
+
function Jr({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu", openOn: r = "hover", align: a = "left", panelWidth: o = "", offset: l = 8, editorOpen: f = !0, linked: p, style: m, nodeRef: h, inert: g = !1 }) {
|
|
5453
5899
|
let [_, v] = c(!1), y = s(null), b = s(null), x = r !== "click", S = () => {
|
|
5454
5900
|
b.current && clearTimeout(b.current), b.current = null;
|
|
5455
5901
|
}, C = () => {
|
|
@@ -5550,99 +5996,101 @@ function ar({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
|
|
|
5550
5996
|
}), E]
|
|
5551
5997
|
});
|
|
5552
5998
|
}
|
|
5553
|
-
var
|
|
5554
|
-
PageRoot:
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5573
|
-
|
|
5574
|
-
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5585
|
-
|
|
5586
|
-
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
|
|
5595
|
-
|
|
5596
|
-
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
|
|
5601
|
-
|
|
5999
|
+
var Yr = {
|
|
6000
|
+
PageRoot: yt,
|
|
6001
|
+
MarkdownBlock: Pt,
|
|
6002
|
+
CalendarBlock: Vr,
|
|
6003
|
+
LogoCarousel: Wr,
|
|
6004
|
+
DialogBlock: qr,
|
|
6005
|
+
DropdownBlock: Jr,
|
|
6006
|
+
Section: bt,
|
|
6007
|
+
Container: xt,
|
|
6008
|
+
Heading: St,
|
|
6009
|
+
TextBlock: Rt,
|
|
6010
|
+
ButtonBlock: Vt,
|
|
6011
|
+
ImageBlock: Ht,
|
|
6012
|
+
Spacer: Xt,
|
|
6013
|
+
Divider: Zt,
|
|
6014
|
+
BoxBlock: Qt,
|
|
6015
|
+
SliderBlock: an,
|
|
6016
|
+
CanvasSlider: on,
|
|
6017
|
+
TabsBlock: Sn,
|
|
6018
|
+
QuickStack: Jn,
|
|
6019
|
+
CollectionList: Yn,
|
|
6020
|
+
CollectionSearch: Xn,
|
|
6021
|
+
BreadcrumbsBlock: Zn,
|
|
6022
|
+
PaginationBlock: Qn,
|
|
6023
|
+
StepperBlock: hr,
|
|
6024
|
+
SocialLinksBlock: mr,
|
|
6025
|
+
ThemeModeBlock: rr,
|
|
6026
|
+
ScrollTopBlock: fr,
|
|
6027
|
+
CounterBlock: dr,
|
|
6028
|
+
OrgChartBlock: Dr,
|
|
6029
|
+
TableBlock: Nr,
|
|
6030
|
+
IconBlock: hn,
|
|
6031
|
+
MapBlock: pn,
|
|
6032
|
+
MasonryBlock: _n,
|
|
6033
|
+
AccordionBlock: Cn,
|
|
6034
|
+
NavbarBlock: xn,
|
|
6035
|
+
ListBlock: Lt,
|
|
6036
|
+
TextSpan: Dt,
|
|
6037
|
+
QuoteBlock: It,
|
|
6038
|
+
TextLink: Bt,
|
|
6039
|
+
RichTextBlock: Nt,
|
|
6040
|
+
RichContentBlock: Nt,
|
|
6041
|
+
VideoBlock: Ut,
|
|
6042
|
+
YouTubeBlock: Gt,
|
|
6043
|
+
IframeBlock: Kt,
|
|
6044
|
+
EmbedBlock: Yt,
|
|
6045
|
+
FormBlock: In,
|
|
6046
|
+
FormLabel: Vn,
|
|
6047
|
+
FormInput: Hn,
|
|
6048
|
+
FormTextarea: Un,
|
|
6049
|
+
FormCheckbox: (e) => /* @__PURE__ */ u(Wn, {
|
|
5602
6050
|
kind: "checkbox",
|
|
5603
6051
|
...e
|
|
5604
6052
|
}),
|
|
5605
|
-
FormRadio: (e) => /* @__PURE__ */ u(
|
|
6053
|
+
FormRadio: (e) => /* @__PURE__ */ u(Wn, {
|
|
5606
6054
|
kind: "radio",
|
|
5607
6055
|
...e
|
|
5608
6056
|
}),
|
|
5609
|
-
FormSelect:
|
|
5610
|
-
FormFile:
|
|
5611
|
-
FormRecaptcha:
|
|
5612
|
-
FormSubmit:
|
|
5613
|
-
},
|
|
6057
|
+
FormSelect: Gn,
|
|
6058
|
+
FormFile: Kn,
|
|
6059
|
+
FormRecaptcha: Bn,
|
|
6060
|
+
FormSubmit: qn
|
|
6061
|
+
}, Xr = {
|
|
5614
6062
|
id: "auth",
|
|
5615
6063
|
label: "Accounts",
|
|
5616
6064
|
category: "Apps",
|
|
5617
6065
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5618
6066
|
ssr: "shell",
|
|
5619
6067
|
settings: ["site.authRedirect"]
|
|
5620
|
-
},
|
|
6068
|
+
}, Zr = t({
|
|
5621
6069
|
user: null,
|
|
5622
6070
|
status: "idle",
|
|
5623
6071
|
ensure: () => {},
|
|
5624
6072
|
refresh: () => {},
|
|
5625
6073
|
signOut: () => {}
|
|
5626
6074
|
});
|
|
5627
|
-
function
|
|
6075
|
+
function Qr(e, t) {
|
|
5628
6076
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5629
6077
|
}
|
|
5630
|
-
function
|
|
6078
|
+
function $r(e) {
|
|
5631
6079
|
let t = e && typeof e == "object" ? e["site.session"] : null, n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (e) => typeof e == "string" ? e.trim() : "", i = r(n.url), a = r(n.mePath), o = r(n.logoutPath);
|
|
5632
6080
|
return {
|
|
5633
6081
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5634
6082
|
url: i,
|
|
5635
6083
|
mePath: a,
|
|
5636
6084
|
logoutPath: o,
|
|
5637
|
-
meUrl:
|
|
5638
|
-
logoutUrl:
|
|
6085
|
+
meUrl: Qr(i, a),
|
|
6086
|
+
logoutUrl: Qr(i, o),
|
|
5639
6087
|
loginPage: r(n.loginPage),
|
|
5640
6088
|
userPath: r(n.userPath),
|
|
5641
6089
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5642
6090
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5643
6091
|
};
|
|
5644
6092
|
}
|
|
5645
|
-
function
|
|
6093
|
+
function ei(e, t) {
|
|
5646
6094
|
if (!t) return e ?? null;
|
|
5647
6095
|
let n = e;
|
|
5648
6096
|
for (let e of t.split(".")) {
|
|
@@ -5651,26 +6099,26 @@ function dr(e, t) {
|
|
|
5651
6099
|
}
|
|
5652
6100
|
return n ?? null;
|
|
5653
6101
|
}
|
|
5654
|
-
function
|
|
6102
|
+
function ti(e) {
|
|
5655
6103
|
try {
|
|
5656
6104
|
return window.localStorage.getItem(e) || "";
|
|
5657
6105
|
} catch {
|
|
5658
6106
|
return "";
|
|
5659
6107
|
}
|
|
5660
6108
|
}
|
|
5661
|
-
function
|
|
6109
|
+
function ni(e) {
|
|
5662
6110
|
try {
|
|
5663
6111
|
window.localStorage.removeItem(e);
|
|
5664
6112
|
} catch {}
|
|
5665
6113
|
}
|
|
5666
|
-
var
|
|
5667
|
-
let e = r(
|
|
6114
|
+
var ri = () => {
|
|
6115
|
+
let e = r(Zr);
|
|
5668
6116
|
return i(() => {
|
|
5669
6117
|
e.ensure();
|
|
5670
6118
|
}, [e]), e;
|
|
5671
6119
|
};
|
|
5672
|
-
function
|
|
5673
|
-
let f = r(
|
|
6120
|
+
function ii({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
|
|
6121
|
+
let f = r(Q), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => $r(f?.settings), [f?.settings]), [g, _] = c(t ?? null), [v, y] = c(t ? "user" : a ? "guest" : "idle"), b = s(!1), x = n((e, t) => fetch(`${p}${e}`, {
|
|
5674
6122
|
...t,
|
|
5675
6123
|
credentials: "include",
|
|
5676
6124
|
headers: {
|
|
@@ -5682,9 +6130,9 @@ function hr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5682
6130
|
if (a) return Promise.resolve(null);
|
|
5683
6131
|
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5684
6132
|
if (h.mode === "custom") {
|
|
5685
|
-
let e = h.auth === "bearer" ?
|
|
6133
|
+
let e = h.auth === "bearer" ? ti(h.tokenKey) : "";
|
|
5686
6134
|
return !h.meUrl || h.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(h.meUrl, { ...h.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
|
|
5687
|
-
let t =
|
|
6135
|
+
let t = ei(e, h.userPath);
|
|
5688
6136
|
return S(t && typeof t == "object" ? t : null);
|
|
5689
6137
|
}).catch(() => S(null));
|
|
5690
6138
|
}
|
|
@@ -5697,12 +6145,12 @@ function hr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5697
6145
|
]), w = n(() => {
|
|
5698
6146
|
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5699
6147
|
if (h.mode === "custom") {
|
|
5700
|
-
let e = h.auth === "bearer" ?
|
|
6148
|
+
let e = h.auth === "bearer" ? ti(h.tokenKey) : "";
|
|
5701
6149
|
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5702
6150
|
method: "post",
|
|
5703
6151
|
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5704
6152
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5705
|
-
h.auth === "bearer" &&
|
|
6153
|
+
h.auth === "bearer" && ni(h.tokenKey), S(null);
|
|
5706
6154
|
});
|
|
5707
6155
|
}
|
|
5708
6156
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -5752,19 +6200,19 @@ function hr({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5752
6200
|
h.loginPage,
|
|
5753
6201
|
C,
|
|
5754
6202
|
w
|
|
5755
|
-
]), /* @__PURE__ */ u(
|
|
6203
|
+
]), /* @__PURE__ */ u(Zr.Provider, {
|
|
5756
6204
|
value: E,
|
|
5757
6205
|
children: e
|
|
5758
6206
|
});
|
|
5759
6207
|
}
|
|
5760
|
-
function
|
|
5761
|
-
let { status: n } =
|
|
6208
|
+
function ai({ when: e, children: t }) {
|
|
6209
|
+
let { status: n } = ri();
|
|
5762
6210
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5763
6211
|
}
|
|
5764
6212
|
//#endregion
|
|
5765
6213
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5766
|
-
function
|
|
5767
|
-
let { tenant: h, apiUrl: g, settings: _ } = r(
|
|
6214
|
+
function oi({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
|
|
6215
|
+
let { tenant: h, apiUrl: g, settings: _ } = r(Q), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
5768
6216
|
if (e.preventDefault(), f) return;
|
|
5769
6217
|
let n = new FormData(e.currentTarget);
|
|
5770
6218
|
C(!0), x("");
|
|
@@ -5812,20 +6260,20 @@ function _r({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5812
6260
|
children: [
|
|
5813
6261
|
w ? /* @__PURE__ */ d("label", {
|
|
5814
6262
|
style: {
|
|
5815
|
-
...
|
|
6263
|
+
...Tn,
|
|
5816
6264
|
display: "grid",
|
|
5817
6265
|
gap: 6
|
|
5818
6266
|
},
|
|
5819
6267
|
children: [a, /* @__PURE__ */ u("input", {
|
|
5820
6268
|
name: "name",
|
|
5821
6269
|
type: "text",
|
|
5822
|
-
style:
|
|
5823
|
-
...
|
|
6270
|
+
style: En,
|
|
6271
|
+
...On(f)
|
|
5824
6272
|
})]
|
|
5825
6273
|
}) : null,
|
|
5826
6274
|
/* @__PURE__ */ d("label", {
|
|
5827
6275
|
style: {
|
|
5828
|
-
...
|
|
6276
|
+
...Tn,
|
|
5829
6277
|
display: "grid",
|
|
5830
6278
|
gap: 6
|
|
5831
6279
|
},
|
|
@@ -5833,13 +6281,13 @@ function _r({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5833
6281
|
name: "email",
|
|
5834
6282
|
type: "email",
|
|
5835
6283
|
required: !f,
|
|
5836
|
-
style:
|
|
5837
|
-
...
|
|
6284
|
+
style: En,
|
|
6285
|
+
...On(f)
|
|
5838
6286
|
})]
|
|
5839
6287
|
}),
|
|
5840
6288
|
/* @__PURE__ */ d("label", {
|
|
5841
6289
|
style: {
|
|
5842
|
-
...
|
|
6290
|
+
...Tn,
|
|
5843
6291
|
display: "grid",
|
|
5844
6292
|
gap: 6
|
|
5845
6293
|
},
|
|
@@ -5847,15 +6295,15 @@ function _r({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5847
6295
|
name: "password",
|
|
5848
6296
|
type: "password",
|
|
5849
6297
|
required: !f,
|
|
5850
|
-
style:
|
|
5851
|
-
...
|
|
6298
|
+
style: En,
|
|
6299
|
+
...On(f)
|
|
5852
6300
|
})]
|
|
5853
6301
|
}),
|
|
5854
6302
|
/* @__PURE__ */ u("button", {
|
|
5855
6303
|
type: f ? "button" : "submit",
|
|
5856
6304
|
disabled: S || void 0,
|
|
5857
6305
|
style: {
|
|
5858
|
-
...
|
|
6306
|
+
...mt,
|
|
5859
6307
|
border: 0,
|
|
5860
6308
|
padding: "10px 22px",
|
|
5861
6309
|
borderRadius: 8,
|
|
@@ -5887,8 +6335,8 @@ function _r({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5887
6335
|
]
|
|
5888
6336
|
});
|
|
5889
6337
|
}
|
|
5890
|
-
function
|
|
5891
|
-
let { user: c, status: l, signOut: f } =
|
|
6338
|
+
function si({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
6339
|
+
let { user: c, status: l, signOut: f } = ri(), p = a ? s || "user" : l, m = a ? {
|
|
5892
6340
|
name: "Ada Lovelace",
|
|
5893
6341
|
email: "ada@example.com"
|
|
5894
6342
|
} : c;
|
|
@@ -5909,7 +6357,7 @@ function vr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5909
6357
|
children: [
|
|
5910
6358
|
/* @__PURE__ */ d("span", {
|
|
5911
6359
|
style: {
|
|
5912
|
-
...
|
|
6360
|
+
...Tn,
|
|
5913
6361
|
fontWeight: 600
|
|
5914
6362
|
},
|
|
5915
6363
|
children: [
|
|
@@ -5920,7 +6368,7 @@ function vr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5920
6368
|
}),
|
|
5921
6369
|
n && m?.email ? /* @__PURE__ */ u("span", {
|
|
5922
6370
|
style: {
|
|
5923
|
-
...
|
|
6371
|
+
...Tn,
|
|
5924
6372
|
opacity: .7
|
|
5925
6373
|
},
|
|
5926
6374
|
children: m.email
|
|
@@ -5929,14 +6377,14 @@ function vr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5929
6377
|
type: "button",
|
|
5930
6378
|
onClick: a ? void 0 : f,
|
|
5931
6379
|
style: {
|
|
5932
|
-
...
|
|
6380
|
+
...mt,
|
|
5933
6381
|
border: 0,
|
|
5934
6382
|
padding: "8px 16px",
|
|
5935
6383
|
borderRadius: 8,
|
|
5936
6384
|
fontSize: 14,
|
|
5937
6385
|
cursor: a ? "default" : "pointer"
|
|
5938
6386
|
},
|
|
5939
|
-
...
|
|
6387
|
+
...On(a),
|
|
5940
6388
|
children: t
|
|
5941
6389
|
})
|
|
5942
6390
|
]
|
|
@@ -5953,40 +6401,40 @@ function vr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5953
6401
|
}
|
|
5954
6402
|
//#endregion
|
|
5955
6403
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5956
|
-
var
|
|
6404
|
+
var ci = {
|
|
5957
6405
|
id: "consent",
|
|
5958
6406
|
label: "Cookie consent",
|
|
5959
6407
|
category: "Apps",
|
|
5960
6408
|
keys: ["CookieConsent"],
|
|
5961
6409
|
ssr: "shell",
|
|
5962
6410
|
settings: []
|
|
5963
|
-
},
|
|
5964
|
-
function
|
|
6411
|
+
}, li = "webim.cookie_consent";
|
|
6412
|
+
function ui() {
|
|
5965
6413
|
try {
|
|
5966
|
-
let e = window.localStorage.getItem(
|
|
6414
|
+
let e = window.localStorage.getItem(li), t = e ? JSON.parse(e) : null;
|
|
5967
6415
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5968
6416
|
} catch {
|
|
5969
6417
|
return "";
|
|
5970
6418
|
}
|
|
5971
6419
|
}
|
|
5972
|
-
function
|
|
6420
|
+
function di(e) {
|
|
5973
6421
|
try {
|
|
5974
6422
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5975
6423
|
} catch {}
|
|
5976
6424
|
}
|
|
5977
|
-
function
|
|
6425
|
+
function fi(e) {
|
|
5978
6426
|
try {
|
|
5979
|
-
window.localStorage.setItem(
|
|
6427
|
+
window.localStorage.setItem(li, JSON.stringify({
|
|
5980
6428
|
choice: e,
|
|
5981
6429
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5982
6430
|
}));
|
|
5983
6431
|
} catch {}
|
|
5984
|
-
|
|
6432
|
+
di(e);
|
|
5985
6433
|
try {
|
|
5986
6434
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5987
6435
|
} catch {}
|
|
5988
6436
|
}
|
|
5989
|
-
var
|
|
6437
|
+
var pi = {
|
|
5990
6438
|
bottom: {
|
|
5991
6439
|
left: 0,
|
|
5992
6440
|
right: 0,
|
|
@@ -6008,18 +6456,18 @@ var wr = {
|
|
|
6008
6456
|
maxWidth: 400
|
|
6009
6457
|
}
|
|
6010
6458
|
};
|
|
6011
|
-
function
|
|
6459
|
+
function mi({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
|
|
6012
6460
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
6013
6461
|
y(e), typeof m == "function" && m(e);
|
|
6014
6462
|
};
|
|
6015
6463
|
if (i(() => {
|
|
6016
6464
|
if (h) return;
|
|
6017
|
-
let e =
|
|
6018
|
-
e ?
|
|
6465
|
+
let e = ui();
|
|
6466
|
+
e ? di(e) : _(!0);
|
|
6019
6467
|
}, [h, v]), !g) return null;
|
|
6020
6468
|
let x = (e) => () => {
|
|
6021
|
-
h || (
|
|
6022
|
-
}, S =
|
|
6469
|
+
h || (fi(e), _(!1));
|
|
6470
|
+
}, S = pi[s] ?? pi.bottom, C = {
|
|
6023
6471
|
appearance: "none",
|
|
6024
6472
|
font: "inherit",
|
|
6025
6473
|
fontSize: 14,
|
|
@@ -6099,37 +6547,37 @@ function Tr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
6099
6547
|
}
|
|
6100
6548
|
//#endregion
|
|
6101
6549
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
6102
|
-
var
|
|
6550
|
+
var hi = {
|
|
6103
6551
|
id: "language",
|
|
6104
6552
|
label: "Language",
|
|
6105
6553
|
category: "Apps",
|
|
6106
6554
|
keys: ["SiteLanguagePicker"],
|
|
6107
6555
|
ssr: "prefetch",
|
|
6108
6556
|
settings: ["locales"]
|
|
6109
|
-
},
|
|
6557
|
+
}, gi = {
|
|
6110
6558
|
id: "search",
|
|
6111
6559
|
label: "Search",
|
|
6112
6560
|
category: "Apps",
|
|
6113
6561
|
keys: ["SiteSearch"],
|
|
6114
6562
|
ssr: "prefetch",
|
|
6115
6563
|
settings: []
|
|
6116
|
-
},
|
|
6117
|
-
function
|
|
6564
|
+
}, _i = 50, vi = 2e3;
|
|
6565
|
+
function yi() {
|
|
6118
6566
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
6119
6567
|
}
|
|
6120
|
-
function
|
|
6568
|
+
function bi(e, t) {
|
|
6121
6569
|
let n = e?.data ?? {}, r = [];
|
|
6122
6570
|
for (let e of Object.values(n)) {
|
|
6123
|
-
let t = e == null ? "" :
|
|
6124
|
-
if (t && r.push(t), r.join(" ").length >
|
|
6571
|
+
let t = e == null ? "" : ct(e);
|
|
6572
|
+
if (t && r.push(t), r.join(" ").length > vi) break;
|
|
6125
6573
|
}
|
|
6126
|
-
return r.join(" ").slice(0,
|
|
6574
|
+
return r.join(" ").slice(0, vi).toLocaleLowerCase(t || void 0);
|
|
6127
6575
|
}
|
|
6128
|
-
function
|
|
6129
|
-
let { tenant: b, apiUrl: x, locale: S } = r(
|
|
6576
|
+
function xi({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
|
|
6577
|
+
let { tenant: b, apiUrl: x, locale: S } = r(Q), [C, w] = c(() => yi()), [T, E] = c(() => yi()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
|
|
6130
6578
|
i(() => {
|
|
6131
6579
|
let e = () => {
|
|
6132
|
-
let e =
|
|
6580
|
+
let e = yi();
|
|
6133
6581
|
w(e), E(e);
|
|
6134
6582
|
};
|
|
6135
6583
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -6180,8 +6628,8 @@ function Mr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6180
6628
|
});
|
|
6181
6629
|
}
|
|
6182
6630
|
else for (let t of e.rows) {
|
|
6183
|
-
if (!
|
|
6184
|
-
let n = t?.data ?? {}, r =
|
|
6631
|
+
if (!bi(t, S).includes(P)) continue;
|
|
6632
|
+
let n = t?.data ?? {}, r = ct(n.name) || "Untitled", i = ct(n.slug);
|
|
6185
6633
|
F.push({
|
|
6186
6634
|
key: `entry:${t.id}`,
|
|
6187
6635
|
title: r,
|
|
@@ -6189,7 +6637,7 @@ function Mr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6189
6637
|
kind: "entry"
|
|
6190
6638
|
});
|
|
6191
6639
|
}
|
|
6192
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
6640
|
+
let I = F.slice(0, Math.min(Math.max(1, p), _i)), L = (e) => {
|
|
6193
6641
|
if (v) {
|
|
6194
6642
|
e.preventDefault(), w(T), j(!0);
|
|
6195
6643
|
return;
|
|
@@ -6271,7 +6719,7 @@ function Mr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6271
6719
|
onChange: (e) => E(e.target.value),
|
|
6272
6720
|
onFocus: () => P && j(!0),
|
|
6273
6721
|
style: {
|
|
6274
|
-
...
|
|
6722
|
+
...En,
|
|
6275
6723
|
flexGrow: 1,
|
|
6276
6724
|
minWidth: 0
|
|
6277
6725
|
}
|
|
@@ -6329,21 +6777,21 @@ function Mr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6329
6777
|
}
|
|
6330
6778
|
//#endregion
|
|
6331
6779
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
6332
|
-
function
|
|
6780
|
+
function Si(e) {
|
|
6333
6781
|
let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
|
|
6334
6782
|
return [...new Set(n.map((e) => e.trim()))];
|
|
6335
6783
|
}
|
|
6336
|
-
var
|
|
6337
|
-
function
|
|
6784
|
+
var Ci = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6785
|
+
function wi(e, t) {
|
|
6338
6786
|
let n = String(e ?? "").toUpperCase();
|
|
6339
6787
|
if (t === "code") return n;
|
|
6340
6788
|
let r = "";
|
|
6341
6789
|
try {
|
|
6342
|
-
r =
|
|
6790
|
+
r = Ci(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
6343
6791
|
} catch {}
|
|
6344
6792
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
6345
6793
|
}
|
|
6346
|
-
function
|
|
6794
|
+
function Ti(e, t) {
|
|
6347
6795
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
6348
6796
|
if (typeof window > "u") return n || "?";
|
|
6349
6797
|
try {
|
|
@@ -6353,8 +6801,8 @@ function Ir(e, t) {
|
|
|
6353
6801
|
return n || "/";
|
|
6354
6802
|
}
|
|
6355
6803
|
}
|
|
6356
|
-
function
|
|
6357
|
-
let c = r(
|
|
6804
|
+
function Ei({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
|
|
6805
|
+
let c = r(Q), l = Si(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
|
|
6358
6806
|
display: "inline-flex",
|
|
6359
6807
|
alignItems: "center",
|
|
6360
6808
|
gap: 8,
|
|
@@ -6389,7 +6837,7 @@ function Lr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6389
6837
|
style: { opacity: .4 },
|
|
6390
6838
|
children: n ?? "·"
|
|
6391
6839
|
}), /* @__PURE__ */ u("a", {
|
|
6392
|
-
href:
|
|
6840
|
+
href: Ti(e, e === f),
|
|
6393
6841
|
hrefLang: e,
|
|
6394
6842
|
"aria-current": e === p ? "true" : void 0,
|
|
6395
6843
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -6399,7 +6847,7 @@ function Lr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6399
6847
|
textDecoration: "none",
|
|
6400
6848
|
cursor: s ? "default" : "pointer"
|
|
6401
6849
|
},
|
|
6402
|
-
children:
|
|
6850
|
+
children: wi(e, t)
|
|
6403
6851
|
})]
|
|
6404
6852
|
}, e))]
|
|
6405
6853
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -6410,7 +6858,7 @@ function Lr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6410
6858
|
value: p,
|
|
6411
6859
|
onChange: s ? void 0 : (e) => {
|
|
6412
6860
|
let t = e.target.value;
|
|
6413
|
-
window.location.assign(
|
|
6861
|
+
window.location.assign(Ti(t, t === f));
|
|
6414
6862
|
},
|
|
6415
6863
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
6416
6864
|
style: {
|
|
@@ -6424,47 +6872,47 @@ function Lr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6424
6872
|
},
|
|
6425
6873
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
6426
6874
|
value: e,
|
|
6427
|
-
children:
|
|
6875
|
+
children: wi(e, t)
|
|
6428
6876
|
}, e))
|
|
6429
6877
|
})]
|
|
6430
6878
|
});
|
|
6431
6879
|
}
|
|
6432
6880
|
//#endregion
|
|
6433
6881
|
//#region ../ui/src/components/builder/apps/index.js
|
|
6434
|
-
var
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
],
|
|
6440
|
-
SiteLoginForm:
|
|
6441
|
-
SiteAccountMenu:
|
|
6442
|
-
SiteLanguagePicker:
|
|
6443
|
-
CookieConsent:
|
|
6444
|
-
SiteSearch:
|
|
6882
|
+
var Di = [
|
|
6883
|
+
Xr,
|
|
6884
|
+
hi,
|
|
6885
|
+
ci,
|
|
6886
|
+
gi
|
|
6887
|
+
], Oi = {
|
|
6888
|
+
SiteLoginForm: oi,
|
|
6889
|
+
SiteAccountMenu: si,
|
|
6890
|
+
SiteLanguagePicker: Ei,
|
|
6891
|
+
CookieConsent: mi,
|
|
6892
|
+
SiteSearch: xi
|
|
6445
6893
|
};
|
|
6446
|
-
new Set(
|
|
6894
|
+
new Set(Di.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
6447
6895
|
//#endregion
|
|
6448
6896
|
//#region ../ui/src/components/builder/three/runtime.js
|
|
6449
|
-
var
|
|
6897
|
+
var ki = "0.185.1", Ai = "4.2.0", ji = "https://cdn.jsdelivr.net/npm", Mi = `${ji}/three@${ki}/+esm`, Ni = `${ji}/@google/model-viewer@${Ai}/dist/model-viewer.min.js`, Pi = (e) => import(
|
|
6450
6898
|
/* @vite-ignore */
|
|
6451
6899
|
/* webpackIgnore: true */
|
|
6452
6900
|
e
|
|
6453
|
-
),
|
|
6454
|
-
function
|
|
6455
|
-
if (
|
|
6901
|
+
), Fi = /* @__PURE__ */ new Map();
|
|
6902
|
+
function Ii(e) {
|
|
6903
|
+
if (Fi.has(e)) return Fi.get(e);
|
|
6456
6904
|
if (typeof window > "u") return new Promise(() => {});
|
|
6457
|
-
let t =
|
|
6458
|
-
throw
|
|
6905
|
+
let t = Pi(e).catch((t) => {
|
|
6906
|
+
throw Fi.delete(e), t;
|
|
6459
6907
|
});
|
|
6460
|
-
return
|
|
6908
|
+
return Fi.set(e, t), t;
|
|
6461
6909
|
}
|
|
6462
|
-
var
|
|
6463
|
-
function
|
|
6464
|
-
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) :
|
|
6910
|
+
var Li = () => Ii(Mi), Ri = (e) => Ii(`${ji}/three@${ki}/examples/jsm/${e}/+esm`);
|
|
6911
|
+
function zi() {
|
|
6912
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Ii(Ni);
|
|
6465
6913
|
}
|
|
6466
|
-
var
|
|
6467
|
-
function
|
|
6914
|
+
var Bi = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Vi = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
6915
|
+
function Hi(e, t) {
|
|
6468
6916
|
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
6469
6917
|
n = requestAnimationFrame(o), i ||= e;
|
|
6470
6918
|
let a = r ? (e - r) / 1e3 : 0;
|
|
@@ -6483,7 +6931,7 @@ function $r(e, t) {
|
|
|
6483
6931
|
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
6484
6932
|
};
|
|
6485
6933
|
}
|
|
6486
|
-
function
|
|
6934
|
+
function Ui(e, t, n = {}) {
|
|
6487
6935
|
let r = {
|
|
6488
6936
|
radius: n.distance ?? 4,
|
|
6489
6937
|
polar: n.polar ?? Math.PI / 2.4,
|
|
@@ -6532,13 +6980,13 @@ function ei(e, t, n = {}) {
|
|
|
6532
6980
|
}
|
|
6533
6981
|
//#endregion
|
|
6534
6982
|
//#region ../ui/src/components/builder/three/views.jsx
|
|
6535
|
-
var
|
|
6536
|
-
function
|
|
6983
|
+
var Wi = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Gi = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, Ki = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, qi = (e) => typeof e == "string" && !!e.trim();
|
|
6984
|
+
function Ji({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
6537
6985
|
return /* @__PURE__ */ d("div", {
|
|
6538
6986
|
ref: r,
|
|
6539
6987
|
style: {
|
|
6540
6988
|
...A(i),
|
|
6541
|
-
minHeight:
|
|
6989
|
+
minHeight: Wi(n, 320),
|
|
6542
6990
|
display: "flex",
|
|
6543
6991
|
flexDirection: "column",
|
|
6544
6992
|
alignItems: "center",
|
|
@@ -6566,24 +7014,24 @@ function ai({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
6566
7014
|
}) : null]
|
|
6567
7015
|
});
|
|
6568
7016
|
}
|
|
6569
|
-
function
|
|
7017
|
+
function Yi({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotateDelay: s, cameraControls: l, ar: d, exposure: f, shadow: p, fieldOfView: m, environment: h, style: g, nodeRef: _, inert: v }) {
|
|
6570
7018
|
let [y, b] = c(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = c(!1);
|
|
6571
7019
|
i(() => {
|
|
6572
7020
|
if (y || !e) return;
|
|
6573
7021
|
let t = !0;
|
|
6574
|
-
return
|
|
7022
|
+
return zi().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
6575
7023
|
t = !1;
|
|
6576
7024
|
};
|
|
6577
7025
|
}, [y, e]);
|
|
6578
7026
|
let C = {
|
|
6579
7027
|
display: "block",
|
|
6580
7028
|
width: "100%",
|
|
6581
|
-
minHeight:
|
|
6582
|
-
height:
|
|
7029
|
+
minHeight: Wi(r, 360),
|
|
7030
|
+
height: Wi(r, 360),
|
|
6583
7031
|
backgroundColor: a || "transparent",
|
|
6584
7032
|
...A(g)
|
|
6585
7033
|
};
|
|
6586
|
-
if (!e) return v ? /* @__PURE__ */ u(
|
|
7034
|
+
if (!e) return v ? /* @__PURE__ */ u(Ji, {
|
|
6587
7035
|
nodeRef: _,
|
|
6588
7036
|
style: g,
|
|
6589
7037
|
height: r,
|
|
@@ -6618,13 +7066,13 @@ function oi({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotate
|
|
|
6618
7066
|
poster: t || void 0,
|
|
6619
7067
|
style: C,
|
|
6620
7068
|
"camera-controls": w(!v && l !== !1),
|
|
6621
|
-
"auto-rotate": w(T && !
|
|
6622
|
-
"auto-rotate-delay": T ? String(
|
|
7069
|
+
"auto-rotate": w(T && !Bi()),
|
|
7070
|
+
"auto-rotate-delay": T ? String(Wi(s, 0)) : void 0,
|
|
6623
7071
|
"rotation-per-second": "18deg",
|
|
6624
7072
|
ar: w(!v && d === !0),
|
|
6625
7073
|
"ar-modes": "webxr scene-viewer quick-look",
|
|
6626
|
-
"shadow-intensity": String(
|
|
6627
|
-
exposure: String(
|
|
7074
|
+
"shadow-intensity": String(Gi(p, 100)),
|
|
7075
|
+
exposure: String(Gi(f, 100)),
|
|
6628
7076
|
"field-of-view": m ? `${Number(m)}deg` : void 0,
|
|
6629
7077
|
"environment-image": h && h !== "neutral" ? h : "neutral",
|
|
6630
7078
|
"interaction-prompt": v ? "none" : void 0,
|
|
@@ -6642,7 +7090,7 @@ function oi({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotate
|
|
|
6642
7090
|
}) : null
|
|
6643
7091
|
});
|
|
6644
7092
|
}
|
|
6645
|
-
var
|
|
7093
|
+
var Xi = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), Zi = [
|
|
6646
7094
|
"precision highp float;",
|
|
6647
7095
|
"uniform vec2 u_res;",
|
|
6648
7096
|
"uniform float u_time;",
|
|
@@ -6665,7 +7113,7 @@ var si = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6665
7113
|
" return v;",
|
|
6666
7114
|
"}",
|
|
6667
7115
|
""
|
|
6668
|
-
].join("\n"),
|
|
7116
|
+
].join("\n"), Qi = {
|
|
6669
7117
|
gradient: [
|
|
6670
7118
|
"void main(){",
|
|
6671
7119
|
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
@@ -6717,7 +7165,7 @@ var si = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
6717
7165
|
"}"
|
|
6718
7166
|
].join("\n")
|
|
6719
7167
|
};
|
|
6720
|
-
function
|
|
7168
|
+
function $i(e, t) {
|
|
6721
7169
|
let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
|
|
6722
7170
|
if (!n) return t;
|
|
6723
7171
|
let r = parseInt(n[1], 16);
|
|
@@ -6727,7 +7175,7 @@ function ui(e, t) {
|
|
|
6727
7175
|
(r & 255) / 255
|
|
6728
7176
|
];
|
|
6729
7177
|
}
|
|
6730
|
-
function
|
|
7178
|
+
function ea(e, t, n) {
|
|
6731
7179
|
let r = e.createShader(t);
|
|
6732
7180
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
6733
7181
|
let t = e.getShaderInfoLog(r);
|
|
@@ -6735,13 +7183,13 @@ function di(e, t, n) {
|
|
|
6735
7183
|
}
|
|
6736
7184
|
return r;
|
|
6737
7185
|
}
|
|
6738
|
-
function
|
|
7186
|
+
function ta({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, scale: l, height: f, interactive: p, style: m, nodeRef: h, inert: g }) {
|
|
6739
7187
|
let _ = s(null), v = s(null), y = s(null), [b, x] = c("");
|
|
6740
7188
|
i(() => () => {
|
|
6741
7189
|
let e = y.current;
|
|
6742
7190
|
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
6743
7191
|
}, []);
|
|
6744
|
-
let S = typeof t == "string" && t.trim() ? t :
|
|
7192
|
+
let S = typeof t == "string" && t.trim() ? t : Qi[e] ?? Qi.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(a ?? ""), E = Gi(o, 100), D = Math.max(.05, Gi(l, 100));
|
|
6745
7193
|
return i(() => {
|
|
6746
7194
|
let e = _.current, t = v.current;
|
|
6747
7195
|
if (!e || !t) return;
|
|
@@ -6756,7 +7204,7 @@ function fi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6756
7204
|
}
|
|
6757
7205
|
let r = null;
|
|
6758
7206
|
try {
|
|
6759
|
-
let e =
|
|
7207
|
+
let e = ea(n, n.VERTEX_SHADER, Xi), t = ea(n, n.FRAGMENT_SHADER, Zi + S);
|
|
6760
7208
|
if (r = n.createProgram(), n.attachShader(r, e), n.attachShader(r, t), n.linkProgram(r), !n.getProgramParameter(r, n.LINK_STATUS)) throw Error(n.getProgramInfoLog(r) || "Link failed");
|
|
6761
7209
|
x("");
|
|
6762
7210
|
} catch (e) {
|
|
@@ -6792,28 +7240,28 @@ function fi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6792
7240
|
};
|
|
6793
7241
|
p !== !1 && t.addEventListener("pointermove", l);
|
|
6794
7242
|
let u = () => {
|
|
6795
|
-
let r =
|
|
7243
|
+
let r = Vi(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
6796
7244
|
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
6797
7245
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
6798
7246
|
d?.observe(t), u();
|
|
6799
|
-
let f =
|
|
6800
|
-
a:
|
|
7247
|
+
let f = Bi(), m = {
|
|
7248
|
+
a: $i(C, [
|
|
6801
7249
|
.35,
|
|
6802
7250
|
.4,
|
|
6803
7251
|
.95
|
|
6804
7252
|
]),
|
|
6805
|
-
b:
|
|
7253
|
+
b: $i(w, [
|
|
6806
7254
|
.05,
|
|
6807
7255
|
.06,
|
|
6808
7256
|
.16
|
|
6809
7257
|
]),
|
|
6810
|
-
c:
|
|
7258
|
+
c: $i(T, [
|
|
6811
7259
|
.95,
|
|
6812
7260
|
.35,
|
|
6813
7261
|
.6
|
|
6814
7262
|
])
|
|
6815
7263
|
}, h = {};
|
|
6816
|
-
return h.stop =
|
|
7264
|
+
return h.stop = Hi(t, (t, r) => {
|
|
6817
7265
|
u(), n.uniform2f(s.res, e.width, e.height), n.uniform1f(s.time, (f ? 0 : r) * E), n.uniform2f(s.mouse, c.x, c.y), n.uniform3fv(s.a, m.a), n.uniform3fv(s.b, m.b), n.uniform3fv(s.c, m.c), n.uniform1f(s.scale, D), n.drawArrays(n.TRIANGLES, 0, 3), f && h.stop?.();
|
|
6818
7266
|
}), () => {
|
|
6819
7267
|
h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
|
|
@@ -6832,7 +7280,7 @@ function fi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6832
7280
|
},
|
|
6833
7281
|
style: {
|
|
6834
7282
|
position: "relative",
|
|
6835
|
-
minHeight:
|
|
7283
|
+
minHeight: Wi(f, 320),
|
|
6836
7284
|
overflow: "hidden",
|
|
6837
7285
|
...A(m)
|
|
6838
7286
|
},
|
|
@@ -6864,7 +7312,7 @@ function fi({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
6864
7312
|
}) : null]
|
|
6865
7313
|
});
|
|
6866
7314
|
}
|
|
6867
|
-
function
|
|
7315
|
+
function na(e, t) {
|
|
6868
7316
|
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
6869
7317
|
r.deleteAttribute("uv");
|
|
6870
7318
|
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
@@ -6880,23 +7328,23 @@ function pi(e, t) {
|
|
|
6880
7328
|
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
6881
7329
|
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
6882
7330
|
}
|
|
6883
|
-
var
|
|
6884
|
-
function
|
|
6885
|
-
if (
|
|
6886
|
-
let t =
|
|
7331
|
+
var ra = /* @__PURE__ */ new Map();
|
|
7332
|
+
function ia(e) {
|
|
7333
|
+
if (ra.has(e)) return ra.get(e);
|
|
7334
|
+
let t = Ri("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
|
|
6887
7335
|
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
6888
7336
|
})).catch((t) => {
|
|
6889
|
-
throw
|
|
7337
|
+
throw ra.delete(e), t;
|
|
6890
7338
|
});
|
|
6891
|
-
return
|
|
7339
|
+
return ra.set(e, t), t;
|
|
6892
7340
|
}
|
|
6893
|
-
function
|
|
7341
|
+
function aa(e, t) {
|
|
6894
7342
|
let n = new e.Box3().setFromObject(t);
|
|
6895
7343
|
if (n.isEmpty()) return t;
|
|
6896
7344
|
let r = n.getSize(new e.Vector3()), i = n.getCenter(new e.Vector3()), a = Math.max(r.x, r.y, r.z) || 1, o = new e.Group();
|
|
6897
7345
|
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
6898
7346
|
}
|
|
6899
|
-
var
|
|
7347
|
+
var oa = {
|
|
6900
7348
|
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
6901
7349
|
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
6902
7350
|
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
@@ -6905,50 +7353,50 @@ var _i = {
|
|
|
6905
7353
|
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
6906
7354
|
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
6907
7355
|
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
6908
|
-
},
|
|
6909
|
-
function
|
|
6910
|
-
let g = s(null), [_, v] = c(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = a !== !1 && !
|
|
7356
|
+
}, sa = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
7357
|
+
function ca({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: a, spinSpeed: o, controls: l, ground: d, height: f, style: p, nodeRef: m, inert: h }) {
|
|
7358
|
+
let g = s(null), [_, v] = c(!1), y = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], b = JSON.stringify(y), x = a !== !1 && !Bi(), S = l !== !1 && !h;
|
|
6911
7359
|
return i(() => {
|
|
6912
7360
|
let e = g.current;
|
|
6913
7361
|
if (!e) return;
|
|
6914
7362
|
let i = !0, a = null;
|
|
6915
|
-
return
|
|
7363
|
+
return Li().then((s) => {
|
|
6916
7364
|
if (!i || !e) return;
|
|
6917
7365
|
let c = new s.WebGLRenderer({
|
|
6918
7366
|
antialias: !0,
|
|
6919
7367
|
alpha: !t
|
|
6920
7368
|
});
|
|
6921
|
-
c.setPixelRatio(
|
|
7369
|
+
c.setPixelRatio(Vi()), c.shadowMap.enabled = d !== !1, c.shadowMap.type = s.PCFSoftShadowMap, c.outputColorSpace = s.SRGBColorSpace, c.toneMapping = s.ACESFilmicToneMapping, c.domElement.style.display = "block", c.domElement.style.width = "100%", c.domElement.style.height = "100%", e.appendChild(c.domElement);
|
|
6922
7370
|
let l = new s.Scene();
|
|
6923
|
-
t && (l.background = new s.Color(t)), l.environment =
|
|
6924
|
-
let u = new s.PerspectiveCamera(
|
|
6925
|
-
distance:
|
|
7371
|
+
t && (l.background = new s.Color(t)), l.environment = na(s, c);
|
|
7372
|
+
let u = new s.PerspectiveCamera(sa(r, 45), 1, .1, 400), f = Ui(u, c.domElement, {
|
|
7373
|
+
distance: sa(n, 5),
|
|
6926
7374
|
enableZoom: S
|
|
6927
7375
|
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
6928
7376
|
p.position.set(4, 7, 5), p.castShadow = d !== !1, p.shadow.mapSize.set(1024, 1024), p.shadow.camera.near = .5, p.shadow.camera.far = 30, l.add(p, new s.AmbientLight(16777215, .35));
|
|
6929
7377
|
let m = [], h = new s.Group(), g = (e, t) => {
|
|
6930
|
-
let n =
|
|
6931
|
-
e.position.set(
|
|
7378
|
+
let n = sa(t.scale, 1);
|
|
7379
|
+
e.position.set(sa(t.x, 0), sa(t.y, 0), sa(t.z, 0)), e.rotation.set(Ki(t.rx), Ki(t.ry), Ki(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = Ki(t.spin);
|
|
6932
7380
|
};
|
|
6933
7381
|
for (let e of y) {
|
|
6934
7382
|
if (e.shape === "model") {
|
|
6935
|
-
if (!
|
|
7383
|
+
if (!qi(e.src)) continue;
|
|
6936
7384
|
let t = new s.Group();
|
|
6937
|
-
g(t, e), h.add(t),
|
|
7385
|
+
g(t, e), h.add(t), ia(e.src).then((e) => {
|
|
6938
7386
|
if (!i) return;
|
|
6939
|
-
let n =
|
|
7387
|
+
let n = aa(s, e.clone(!0));
|
|
6940
7388
|
n.traverse((e) => {
|
|
6941
7389
|
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
6942
7390
|
}), t.add(n);
|
|
6943
7391
|
}, () => {});
|
|
6944
7392
|
continue;
|
|
6945
7393
|
}
|
|
6946
|
-
let t = (
|
|
7394
|
+
let t = (oa[e.shape] ?? oa.box)(s), n = new s.MeshStandardMaterial({
|
|
6947
7395
|
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
6948
|
-
metalness: Math.min(1, Math.max(0,
|
|
6949
|
-
roughness: Math.min(1, Math.max(0,
|
|
6950
|
-
transparent:
|
|
6951
|
-
opacity: Math.min(1, Math.max(0,
|
|
7396
|
+
metalness: Math.min(1, Math.max(0, Gi(e.metalness, 10))),
|
|
7397
|
+
roughness: Math.min(1, Math.max(0, Gi(e.roughness, 35))),
|
|
7398
|
+
transparent: Gi(e.opacity, 100) < 1,
|
|
7399
|
+
opacity: Math.min(1, Math.max(0, Gi(e.opacity, 100))),
|
|
6952
7400
|
flatShading: e.flat === !0,
|
|
6953
7401
|
wireframe: e.wireframe === !0,
|
|
6954
7402
|
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
@@ -6959,14 +7407,14 @@ function yi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6959
7407
|
let _ = null;
|
|
6960
7408
|
if (d !== !1) {
|
|
6961
7409
|
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
6962
|
-
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y =
|
|
7410
|
+
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = sa(d === !0 ? 0 : d, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
|
|
6963
7411
|
}
|
|
6964
7412
|
let v = () => {
|
|
6965
7413
|
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
6966
7414
|
c.setSize(t, n, !1), u.aspect = t / n, u.updateProjectionMatrix();
|
|
6967
7415
|
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
6968
7416
|
b?.observe(e), v();
|
|
6969
|
-
let C =
|
|
7417
|
+
let C = Ki(Number.isFinite(Number(o)) ? o : 20), w = Hi(e, (e) => {
|
|
6970
7418
|
f.autoSpin(x ? C : 0, e), f.update();
|
|
6971
7419
|
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
6972
7420
|
c.render(l, u);
|
|
@@ -6990,7 +7438,7 @@ function yi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
6990
7438
|
o,
|
|
6991
7439
|
S,
|
|
6992
7440
|
d
|
|
6993
|
-
]), _ && h ? /* @__PURE__ */ u(
|
|
7441
|
+
]), _ && h ? /* @__PURE__ */ u(Ji, {
|
|
6994
7442
|
nodeRef: m,
|
|
6995
7443
|
style: p,
|
|
6996
7444
|
height: f,
|
|
@@ -7001,27 +7449,27 @@ function yi({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7001
7449
|
g.current = e, typeof m == "function" && m(e);
|
|
7002
7450
|
},
|
|
7003
7451
|
style: {
|
|
7004
|
-
minHeight:
|
|
7005
|
-
height:
|
|
7452
|
+
minHeight: Wi(f, 380),
|
|
7453
|
+
height: Wi(f, 380),
|
|
7006
7454
|
overflow: "hidden",
|
|
7007
7455
|
touchAction: S ? "pan-y" : void 0,
|
|
7008
7456
|
...A(p)
|
|
7009
7457
|
}
|
|
7010
7458
|
});
|
|
7011
7459
|
}
|
|
7012
|
-
function
|
|
7460
|
+
function la({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o }) {
|
|
7013
7461
|
let l = s(null), [d, f] = c("");
|
|
7014
7462
|
return i(() => {
|
|
7015
7463
|
let t = l.current;
|
|
7016
7464
|
if (o || !t || typeof e != "string" || !e.trim()) return;
|
|
7017
7465
|
let r = !0, i = null;
|
|
7018
|
-
return
|
|
7466
|
+
return Li().then((a) => {
|
|
7019
7467
|
if (!r || !t) return;
|
|
7020
7468
|
let o = new a.WebGLRenderer({
|
|
7021
7469
|
antialias: !0,
|
|
7022
7470
|
alpha: !n
|
|
7023
7471
|
});
|
|
7024
|
-
o.setPixelRatio(
|
|
7472
|
+
o.setPixelRatio(Vi()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
7025
7473
|
let s = new a.Scene();
|
|
7026
7474
|
n && (s.background = new a.Color(n));
|
|
7027
7475
|
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
@@ -7044,7 +7492,7 @@ function bi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7044
7492
|
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
7045
7493
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
7046
7494
|
d?.observe(t), u();
|
|
7047
|
-
let p = !1, m =
|
|
7495
|
+
let p = !1, m = Hi(t, (e, t) => {
|
|
7048
7496
|
if (!p && typeof l?.frame == "function") try {
|
|
7049
7497
|
l.frame(e, t);
|
|
7050
7498
|
} catch (e) {
|
|
@@ -7066,7 +7514,7 @@ function bi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7066
7514
|
e,
|
|
7067
7515
|
o,
|
|
7068
7516
|
n
|
|
7069
|
-
]), o ? /* @__PURE__ */ u(
|
|
7517
|
+
]), o ? /* @__PURE__ */ u(Ji, {
|
|
7070
7518
|
nodeRef: a,
|
|
7071
7519
|
style: r,
|
|
7072
7520
|
height: t,
|
|
@@ -7077,8 +7525,8 @@ function bi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7077
7525
|
l.current = e, typeof a == "function" && a(e);
|
|
7078
7526
|
},
|
|
7079
7527
|
style: {
|
|
7080
|
-
minHeight:
|
|
7081
|
-
height:
|
|
7528
|
+
minHeight: Wi(t, 380),
|
|
7529
|
+
height: Wi(t, 380),
|
|
7082
7530
|
overflow: "hidden",
|
|
7083
7531
|
position: "relative",
|
|
7084
7532
|
touchAction: "pan-y",
|
|
@@ -7101,40 +7549,40 @@ function bi({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7101
7549
|
}) : null
|
|
7102
7550
|
});
|
|
7103
7551
|
}
|
|
7104
|
-
var
|
|
7105
|
-
ModelViewerBlock:
|
|
7106
|
-
ShaderBlock:
|
|
7107
|
-
SceneBlock:
|
|
7108
|
-
ThreeCanvasBlock:
|
|
7109
|
-
},
|
|
7110
|
-
function
|
|
7111
|
-
if (
|
|
7552
|
+
var ua = {
|
|
7553
|
+
ModelViewerBlock: Yi,
|
|
7554
|
+
ShaderBlock: ta,
|
|
7555
|
+
SceneBlock: ca,
|
|
7556
|
+
ThreeCanvasBlock: la
|
|
7557
|
+
}, da = /* @__PURE__ */ new Map();
|
|
7558
|
+
function fa(e) {
|
|
7559
|
+
if (da.has(e)) return da.get(e);
|
|
7112
7560
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
7113
7561
|
/* @vite-ignore */
|
|
7114
7562
|
/* webpackIgnore: true */
|
|
7115
7563
|
t
|
|
7116
7564
|
).finally(() => URL.revokeObjectURL(t));
|
|
7117
|
-
return
|
|
7565
|
+
return da.set(e, n), n;
|
|
7118
7566
|
}
|
|
7119
|
-
function
|
|
7567
|
+
function pa(e) {
|
|
7120
7568
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
7121
7569
|
return n && typeof n == "object" ? n : {};
|
|
7122
7570
|
}
|
|
7123
7571
|
//#endregion
|
|
7124
7572
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
7125
|
-
async function
|
|
7126
|
-
let n = await
|
|
7573
|
+
async function ma(e, t) {
|
|
7574
|
+
let n = await fa(e);
|
|
7127
7575
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
7128
7576
|
}
|
|
7129
|
-
var
|
|
7577
|
+
var ha = {
|
|
7130
7578
|
padding: "10px 12px",
|
|
7131
7579
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
7132
7580
|
borderRadius: 8,
|
|
7133
7581
|
fontSize: 12,
|
|
7134
7582
|
opacity: .6
|
|
7135
7583
|
};
|
|
7136
|
-
function
|
|
7137
|
-
let c = r(
|
|
7584
|
+
function ga({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
7585
|
+
let c = r(Q), l = pa(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
7138
7586
|
tenant: c?.tenant ?? "",
|
|
7139
7587
|
apiUrl: c?.apiUrl ?? "/api",
|
|
7140
7588
|
locale: c?.locale ?? "",
|
|
@@ -7146,7 +7594,7 @@ function Di({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7146
7594
|
let e = f.current;
|
|
7147
7595
|
if (!l?.code || !e) return;
|
|
7148
7596
|
let n = !0;
|
|
7149
|
-
return
|
|
7597
|
+
return ma(l.code, t).then((e) => {
|
|
7150
7598
|
if (!(!n || !e || !f.current)) {
|
|
7151
7599
|
p.current = e;
|
|
7152
7600
|
try {
|
|
@@ -7176,7 +7624,7 @@ function Di({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7176
7624
|
}) : /* @__PURE__ */ d("div", {
|
|
7177
7625
|
ref: o,
|
|
7178
7626
|
style: {
|
|
7179
|
-
...
|
|
7627
|
+
...ha,
|
|
7180
7628
|
...A(a)
|
|
7181
7629
|
},
|
|
7182
7630
|
children: [
|
|
@@ -7188,13 +7636,13 @@ function Di({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7188
7636
|
}
|
|
7189
7637
|
//#endregion
|
|
7190
7638
|
//#region ../ui/src/components/builder/render.jsx
|
|
7191
|
-
var
|
|
7192
|
-
...
|
|
7193
|
-
...
|
|
7194
|
-
...
|
|
7195
|
-
PluginBlock:
|
|
7639
|
+
var _a = {
|
|
7640
|
+
...Yr,
|
|
7641
|
+
...Oi,
|
|
7642
|
+
...ua,
|
|
7643
|
+
PluginBlock: ga
|
|
7196
7644
|
};
|
|
7197
|
-
function
|
|
7645
|
+
function va(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
7198
7646
|
let o = n[t];
|
|
7199
7647
|
if (!o || o.hidden) return null;
|
|
7200
7648
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -7202,11 +7650,11 @@ function ki(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7202
7650
|
let n = o.props?.componentId, s = r?.[n];
|
|
7203
7651
|
if (!s?.template || i.has(n)) return null;
|
|
7204
7652
|
let c = new Set(i).add(n);
|
|
7205
|
-
return /* @__PURE__ */ u(e, { children:
|
|
7653
|
+
return /* @__PURE__ */ u(e, { children: va(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
7206
7654
|
}
|
|
7207
|
-
let l =
|
|
7655
|
+
let l = _a[s];
|
|
7208
7656
|
if (!l) return null;
|
|
7209
|
-
let d = (o.nodes ?? []).map((e) =>
|
|
7657
|
+
let d = (o.nodes ?? []).map((e) => va(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, va(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
7210
7658
|
...c,
|
|
7211
7659
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
7212
7660
|
linked: p,
|
|
@@ -7215,16 +7663,16 @@ function ki(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7215
7663
|
},
|
|
7216
7664
|
children: d.length ? d : void 0
|
|
7217
7665
|
}, t);
|
|
7218
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
7666
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(ai, {
|
|
7219
7667
|
when: c.when,
|
|
7220
7668
|
children: m
|
|
7221
7669
|
}, t) : m;
|
|
7222
7670
|
}
|
|
7223
7671
|
//#endregion
|
|
7224
7672
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
7225
|
-
var
|
|
7226
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
7227
|
-
function
|
|
7673
|
+
var ya = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), ba = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(J(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
7674
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(J(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
7675
|
+
function xa({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, animations: c, tenant: l, apiUrl: f, datasets: p, locale: m, direction: h, settings: _, siteUser: v }) {
|
|
7228
7676
|
let b = s?.js?.trim();
|
|
7229
7677
|
if (i(() => {
|
|
7230
7678
|
if (!b) return;
|
|
@@ -7238,23 +7686,23 @@ function Mi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7238
7686
|
minHeight: "100%",
|
|
7239
7687
|
display: "flex",
|
|
7240
7688
|
flexDirection: "column"
|
|
7241
|
-
}, w =
|
|
7689
|
+
}, w = va("ROOT", e, n), T = o(() => ({ render: (t, r) => va(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = W(e, n), O = ie(e, n), k = s?.css?.trim(), A = E(c), j = ue(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !se[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
|
|
7242
7690
|
rel: "stylesheet",
|
|
7243
7691
|
precedence: "default",
|
|
7244
7692
|
href: g(e)
|
|
7245
|
-
}, e)), P =
|
|
7246
|
-
return r === "auto" ? /* @__PURE__ */ u(
|
|
7693
|
+
}, e)), P = ba(j);
|
|
7694
|
+
return r === "auto" ? /* @__PURE__ */ u(Q.Provider, {
|
|
7247
7695
|
value: {
|
|
7248
7696
|
tenant: l || "",
|
|
7249
7697
|
apiUrl: f || "/api",
|
|
7250
7698
|
locale: m || "",
|
|
7251
7699
|
settings: _ ?? null
|
|
7252
7700
|
},
|
|
7253
|
-
children: /* @__PURE__ */ u(
|
|
7701
|
+
children: /* @__PURE__ */ u(ii, {
|
|
7254
7702
|
initialUser: v,
|
|
7255
|
-
children: /* @__PURE__ */ u(
|
|
7703
|
+
children: /* @__PURE__ */ u(et.Provider, {
|
|
7256
7704
|
value: p ?? null,
|
|
7257
|
-
children: /* @__PURE__ */ u(
|
|
7705
|
+
children: /* @__PURE__ */ u(it.Provider, {
|
|
7258
7706
|
value: T,
|
|
7259
7707
|
children: /* @__PURE__ */ d("div", {
|
|
7260
7708
|
...x,
|
|
@@ -7265,8 +7713,8 @@ function Mi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7265
7713
|
...a
|
|
7266
7714
|
},
|
|
7267
7715
|
children: [
|
|
7268
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
7269
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
7716
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${ya(J(j.light))} }
|
|
7717
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${ya(J(j.dark))} } }` }),
|
|
7270
7718
|
/* @__PURE__ */ u("style", { children: P }),
|
|
7271
7719
|
N,
|
|
7272
7720
|
/* @__PURE__ */ u("style", { children: S }),
|
|
@@ -7279,18 +7727,18 @@ function Mi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7279
7727
|
})
|
|
7280
7728
|
})
|
|
7281
7729
|
})
|
|
7282
|
-
}) : /* @__PURE__ */ u(
|
|
7730
|
+
}) : /* @__PURE__ */ u(Q.Provider, {
|
|
7283
7731
|
value: {
|
|
7284
7732
|
tenant: l || "",
|
|
7285
7733
|
apiUrl: f || "/api",
|
|
7286
7734
|
locale: m || "",
|
|
7287
7735
|
settings: _ ?? null
|
|
7288
7736
|
},
|
|
7289
|
-
children: /* @__PURE__ */ u(
|
|
7737
|
+
children: /* @__PURE__ */ u(ii, {
|
|
7290
7738
|
initialUser: v,
|
|
7291
|
-
children: /* @__PURE__ */ u(
|
|
7739
|
+
children: /* @__PURE__ */ u(et.Provider, {
|
|
7292
7740
|
value: p ?? null,
|
|
7293
|
-
children: /* @__PURE__ */ u(
|
|
7741
|
+
children: /* @__PURE__ */ u(it.Provider, {
|
|
7294
7742
|
value: T,
|
|
7295
7743
|
children: /* @__PURE__ */ d("div", {
|
|
7296
7744
|
...x,
|
|
@@ -7319,8 +7767,8 @@ function Mi({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7319
7767
|
}
|
|
7320
7768
|
//#endregion
|
|
7321
7769
|
//#region src/WebimContent.jsx
|
|
7322
|
-
function
|
|
7323
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
7770
|
+
function Sa({ bundle: e, mode: t = "auto", style: n }) {
|
|
7771
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(xa, {
|
|
7324
7772
|
blocks: e.blocks,
|
|
7325
7773
|
theme: e.theme,
|
|
7326
7774
|
components: e.components,
|
|
@@ -7338,7 +7786,7 @@ function Ni({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
7338
7786
|
}
|
|
7339
7787
|
//#endregion
|
|
7340
7788
|
//#region src/WebimPage.jsx
|
|
7341
|
-
function
|
|
7789
|
+
function Ca({ 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 }) {
|
|
7342
7790
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
7343
7791
|
onLoad: m,
|
|
7344
7792
|
onError: h
|
|
@@ -7375,11 +7823,11 @@ function Pi({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
7375
7823
|
r,
|
|
7376
7824
|
a,
|
|
7377
7825
|
o
|
|
7378
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
7826
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Sa, {
|
|
7379
7827
|
bundle: g.bundle,
|
|
7380
7828
|
mode: l,
|
|
7381
7829
|
style: d
|
|
7382
7830
|
});
|
|
7383
7831
|
}
|
|
7384
7832
|
//#endregion
|
|
7385
|
-
export {
|
|
7833
|
+
export { xa as PageRenderer, Sa as WebimContent, Ca as WebimPage, ye as fetchPage, Mt as renderRichContent, he as resolveTheme };
|