webim-adapter 2.2.3 → 2.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +654 -578
- package/build/webim-embed.js +15 -15
- package/build/webim-ssr.js +552 -476
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -254,30 +254,30 @@ function A(e) {
|
|
|
254
254
|
R !== void 0 && U.push(`blur(${O(R)})`), z !== void 0 && U.push(`grayscale(${z}%)`), B !== void 0 && U.push(`brightness(${B}%)`), V !== void 0 && U.push(`contrast(${V}%)`), H !== void 0 && U.push(`saturate(${H}%)`), U.length && (t.filter = U.join(" "));
|
|
255
255
|
let ee = F(L);
|
|
256
256
|
ee.length && (t.backdropFilter = ee.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
257
|
-
let { textStrokeWidth:
|
|
258
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
259
|
-
let { clipText:
|
|
260
|
-
delete t.clipText,
|
|
261
|
-
let { transitions:
|
|
257
|
+
let { textStrokeWidth: W, textStrokeColor: te } = t;
|
|
258
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (W !== void 0 || te !== void 0) && (t.WebkitTextStroke = `${O(W ?? 1)} ${te || "currentColor"}`);
|
|
259
|
+
let { clipText: ne } = t;
|
|
260
|
+
delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
261
|
+
let { transitions: re, transitionDuration: G, transitionEasing: K, transitionProperty: q } = t, ie = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
|
|
262
262
|
delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
|
|
263
|
-
let
|
|
264
|
-
if (
|
|
263
|
+
let J = (Array.isArray(re) ? re : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ie(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
264
|
+
if (G !== void 0 && J.push(`${q || "all"} ${ie(G)} ${K || "ease"}`), J.length && (t.transition = J.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
|
|
265
265
|
let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${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: ae, overlayOpacity: oe } = t;
|
|
270
|
+
if (delete t.overlayColor, delete t.overlayOpacity, ae) {
|
|
271
|
+
let e = `color-mix(in srgb, ${ae} ${oe ?? 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: se } = t;
|
|
276
276
|
delete t.backgroundLayers;
|
|
277
|
-
let
|
|
278
|
-
if (
|
|
277
|
+
let ce = (Array.isArray(se) ? se : []).filter((e) => e && e.on !== !1);
|
|
278
|
+
if (ce.length) {
|
|
279
279
|
let e = [], n = [], r = [], i = [], a = [];
|
|
280
|
-
for (let t of
|
|
280
|
+
for (let t of ce) 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;
|
|
@@ -377,7 +377,7 @@ function U(e, t, n, r = !1) {
|
|
|
377
377
|
function ee(e, t, n) {
|
|
378
378
|
return Object.entries(j).map(([r, i]) => U(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
|
|
379
379
|
}
|
|
380
|
-
var
|
|
380
|
+
var W = [
|
|
381
381
|
{
|
|
382
382
|
key: "tablet",
|
|
383
383
|
max: 991
|
|
@@ -390,17 +390,17 @@ var te = [
|
|
|
390
390
|
key: "mobile",
|
|
391
391
|
max: 478
|
|
392
392
|
}
|
|
393
|
-
],
|
|
394
|
-
function
|
|
395
|
-
return
|
|
396
|
-
let i = t?.[n] ?
|
|
393
|
+
], te = (e) => Object.entries(A(e)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
|
|
394
|
+
function ne(e, t) {
|
|
395
|
+
return W.map(({ key: n, max: r }) => {
|
|
396
|
+
let i = t?.[n] ? te(t[n]) : "";
|
|
397
397
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
398
398
|
}).filter(Boolean).join("\n");
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function re(e, t) {
|
|
401
401
|
let n = [], r = (e) => {
|
|
402
402
|
for (let [t, r] of Object.entries(e || {})) {
|
|
403
|
-
let e =
|
|
403
|
+
let e = ne(t, r.props);
|
|
404
404
|
e && n.push(e);
|
|
405
405
|
}
|
|
406
406
|
};
|
|
@@ -408,7 +408,7 @@ function ie(e, t) {
|
|
|
408
408
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
409
409
|
return n.join("\n");
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function G(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
414
|
let e = ee(t, r.props);
|
|
@@ -419,15 +419,15 @@ function W(e, t) {
|
|
|
419
419
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
420
420
|
return n.join("\n");
|
|
421
421
|
}
|
|
422
|
-
var
|
|
423
|
-
fontFamily:
|
|
422
|
+
var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", q = {
|
|
423
|
+
fontFamily: K,
|
|
424
424
|
fontStyle: "normal",
|
|
425
425
|
fontWeight: 400,
|
|
426
426
|
letterSpacing: "normal",
|
|
427
427
|
textTransform: "none",
|
|
428
428
|
lineHeight: 1.4,
|
|
429
429
|
textShadow: "none"
|
|
430
|
-
},
|
|
430
|
+
}, ie = {
|
|
431
431
|
light: {
|
|
432
432
|
background: "#f2f2f2",
|
|
433
433
|
surface: "#f2f2f2",
|
|
@@ -468,32 +468,32 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
468
468
|
contrastText: "#052e2b"
|
|
469
469
|
}
|
|
470
470
|
}
|
|
471
|
-
},
|
|
471
|
+
}, J = {
|
|
472
472
|
h1: 40,
|
|
473
473
|
h2: 32,
|
|
474
474
|
h3: 26,
|
|
475
475
|
h4: 22,
|
|
476
476
|
h5: 19,
|
|
477
477
|
h6: 16
|
|
478
|
-
},
|
|
478
|
+
}, ae = {
|
|
479
479
|
font: "system",
|
|
480
480
|
headingFont: "inherit",
|
|
481
|
-
headings:
|
|
481
|
+
headings: J,
|
|
482
482
|
bodySize: 16,
|
|
483
|
-
light:
|
|
484
|
-
dark:
|
|
485
|
-
},
|
|
483
|
+
light: ie.light,
|
|
484
|
+
dark: ie.dark
|
|
485
|
+
}, oe = {
|
|
486
486
|
system: {
|
|
487
487
|
label: "System",
|
|
488
|
-
value:
|
|
488
|
+
value: K
|
|
489
489
|
},
|
|
490
490
|
inter: {
|
|
491
491
|
label: "Inter",
|
|
492
|
-
value: `"Inter", ${
|
|
492
|
+
value: `"Inter", ${K}`
|
|
493
493
|
},
|
|
494
494
|
outfit: {
|
|
495
495
|
label: "Outfit",
|
|
496
|
-
value: `"Outfit", ${
|
|
496
|
+
value: `"Outfit", ${K}`
|
|
497
497
|
},
|
|
498
498
|
serif: {
|
|
499
499
|
label: "Serif",
|
|
@@ -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
|
+
}, se = (e, t) => oe[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), ce = (e, ...t) => {
|
|
507
507
|
let n = Object.assign({}, e, ...t);
|
|
508
508
|
return n.primary = {
|
|
509
509
|
...e.primary,
|
|
@@ -519,25 +519,25 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
519
519
|
}), {})
|
|
520
520
|
}, n;
|
|
521
521
|
};
|
|
522
|
-
function
|
|
522
|
+
function le(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 ?? ae.font,
|
|
526
|
+
headingFont: i ?? ae.headingFont,
|
|
527
527
|
headings: {
|
|
528
|
-
...
|
|
528
|
+
...J,
|
|
529
529
|
...a ?? {}
|
|
530
530
|
},
|
|
531
531
|
bodySize: o ?? 16,
|
|
532
|
-
light:
|
|
533
|
-
dark:
|
|
532
|
+
light: ce(ie.light, s, t),
|
|
533
|
+
dark: ce(ie.dark, n)
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
|
-
function
|
|
536
|
+
function ue(e) {
|
|
537
537
|
return {
|
|
538
538
|
"--page-bg": e.background,
|
|
539
539
|
"--page-surface": e.surface ?? e.background,
|
|
540
|
-
"--page-border": e.border ??
|
|
540
|
+
"--page-border": e.border ?? ie.light.border,
|
|
541
541
|
"--page-text": e.text,
|
|
542
542
|
"--page-accent": e.accent,
|
|
543
543
|
"--page-accent-text": e.accentText,
|
|
@@ -552,12 +552,12 @@ function J(e) {
|
|
|
552
552
|
};
|
|
553
553
|
}
|
|
554
554
|
function de(e) {
|
|
555
|
-
let t =
|
|
555
|
+
let t = le(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: se(t.font, K),
|
|
560
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : se(t.headingFont, "inherit"),
|
|
561
561
|
...pe(t.headings),
|
|
562
562
|
"--page-body-size": fe(t.bodySize, 16)
|
|
563
563
|
};
|
|
@@ -567,17 +567,17 @@ function fe(e, t) {
|
|
|
567
567
|
}
|
|
568
568
|
function pe(e) {
|
|
569
569
|
let t = {};
|
|
570
|
-
for (let n of Object.keys(
|
|
571
|
-
let r = e?.[n] ??
|
|
572
|
-
t[`--page-${n}`] = fe(r,
|
|
570
|
+
for (let n of Object.keys(J)) {
|
|
571
|
+
let r = e?.[n] ?? J[n];
|
|
572
|
+
t[`--page-${n}`] = fe(r, J[n]);
|
|
573
573
|
}
|
|
574
574
|
return t;
|
|
575
575
|
}
|
|
576
576
|
function me(e, t = "light") {
|
|
577
|
-
let n =
|
|
577
|
+
let n = le(e);
|
|
578
578
|
return {
|
|
579
579
|
...de(e),
|
|
580
|
-
...
|
|
580
|
+
...ue(n[t] ?? n.light)
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
583
|
function he(e, t) {
|
|
@@ -983,7 +983,7 @@ var ut = {
|
|
|
983
983
|
fontWeight: 700,
|
|
984
984
|
lineHeight: 1.2,
|
|
985
985
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
986
|
-
}, dt =
|
|
986
|
+
}, dt = J, ft = (e) => `var(--page-${e}, ${J[e] ?? J.h2}px)`, pt = {
|
|
987
987
|
margin: 0,
|
|
988
988
|
fontSize: "var(--page-body-size, 16px)"
|
|
989
989
|
}, mt = {
|
|
@@ -1091,13 +1091,13 @@ function Ct({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a
|
|
|
1091
1091
|
});
|
|
1092
1092
|
}
|
|
1093
1093
|
var wt = {
|
|
1094
|
-
fontFamily:
|
|
1094
|
+
fontFamily: oe.mono.value,
|
|
1095
1095
|
background: "rgba(148, 163, 184, 0.18)",
|
|
1096
1096
|
padding: "1px 5px",
|
|
1097
1097
|
borderRadius: 4,
|
|
1098
1098
|
fontSize: "0.9em"
|
|
1099
1099
|
}, Tt = {
|
|
1100
|
-
fontFamily:
|
|
1100
|
+
fontFamily: oe.mono.value,
|
|
1101
1101
|
background: "rgba(148, 163, 184, 0.16)",
|
|
1102
1102
|
border: "1px solid rgba(148, 163, 184, 0.3)",
|
|
1103
1103
|
borderRadius: 6,
|
|
@@ -1666,15 +1666,90 @@ function Zt({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
|
|
|
1666
1666
|
}
|
|
1667
1667
|
}) : null;
|
|
1668
1668
|
}
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1669
|
+
function Qt(e, { toolbar: t = !0, page: n, zoom: r } = {}) {
|
|
1670
|
+
let i = Se(e);
|
|
1671
|
+
if (!i) return "";
|
|
1672
|
+
let a = [];
|
|
1673
|
+
return t === !1 && a.push("toolbar=0&navpanes=0"), Number(n) > 1 && a.push(`page=${Number(n)}`), r && r !== "auto" && a.push(`zoom=${r}`), a.length ? `${i.split("#")[0]}#${a.join("&")}` : i;
|
|
1674
|
+
}
|
|
1675
|
+
function $t({ src: e, title: t, toolbar: n = !0, page: r, zoom: i = "auto", link: a = !0, linkLabel: o, fallbackText: s, style: c, nodeRef: l }) {
|
|
1676
|
+
let f = Se(e);
|
|
1677
|
+
if (!f) return null;
|
|
1678
|
+
let p = o || "Open the PDF", m = t || "PDF document";
|
|
1679
|
+
return /* @__PURE__ */ d("div", {
|
|
1680
|
+
ref: l,
|
|
1681
|
+
style: {
|
|
1682
|
+
display: "flex",
|
|
1683
|
+
flexDirection: "column",
|
|
1684
|
+
width: "100%",
|
|
1685
|
+
height: 600,
|
|
1686
|
+
...A(c)
|
|
1687
|
+
},
|
|
1688
|
+
children: [/* @__PURE__ */ u("object", {
|
|
1689
|
+
data: Qt(f, {
|
|
1690
|
+
toolbar: n,
|
|
1691
|
+
page: r,
|
|
1692
|
+
zoom: i
|
|
1693
|
+
}),
|
|
1694
|
+
type: "application/pdf",
|
|
1695
|
+
"aria-label": m,
|
|
1696
|
+
style: {
|
|
1697
|
+
display: "block",
|
|
1698
|
+
flex: "1 1 auto",
|
|
1699
|
+
minHeight: 0,
|
|
1700
|
+
width: "100%",
|
|
1701
|
+
border: 0
|
|
1702
|
+
},
|
|
1703
|
+
children: /* @__PURE__ */ d("div", {
|
|
1704
|
+
style: {
|
|
1705
|
+
display: "grid",
|
|
1706
|
+
placeItems: "center",
|
|
1707
|
+
gap: 8,
|
|
1708
|
+
height: "100%",
|
|
1709
|
+
padding: 16,
|
|
1710
|
+
textAlign: "center"
|
|
1711
|
+
},
|
|
1712
|
+
children: [/* @__PURE__ */ u("p", {
|
|
1713
|
+
style: {
|
|
1714
|
+
...pt,
|
|
1715
|
+
opacity: .75
|
|
1716
|
+
},
|
|
1717
|
+
children: s || "This browser can’t show the PDF here."
|
|
1718
|
+
}), /* @__PURE__ */ u("a", {
|
|
1719
|
+
href: f,
|
|
1720
|
+
target: "_blank",
|
|
1721
|
+
rel: "noopener noreferrer",
|
|
1722
|
+
style: { color: "var(--page-accent, inherit)" },
|
|
1723
|
+
children: p
|
|
1724
|
+
})]
|
|
1725
|
+
})
|
|
1726
|
+
}, Qt(f, {
|
|
1727
|
+
toolbar: n,
|
|
1728
|
+
page: r,
|
|
1729
|
+
zoom: i
|
|
1730
|
+
})), a && /* @__PURE__ */ u("a", {
|
|
1731
|
+
href: f,
|
|
1732
|
+
target: "_blank",
|
|
1733
|
+
rel: "noopener noreferrer",
|
|
1734
|
+
style: {
|
|
1735
|
+
flexShrink: 0,
|
|
1736
|
+
marginTop: 8,
|
|
1737
|
+
color: "var(--page-accent, inherit)",
|
|
1738
|
+
fontSize: 14
|
|
1739
|
+
},
|
|
1740
|
+
children: p
|
|
1741
|
+
})]
|
|
1742
|
+
});
|
|
1743
|
+
}
|
|
1744
|
+
var en = /(^|[\s,>+~{}])(:root|html|body)(?=$|[\s,{.:#[>+~])/g;
|
|
1745
|
+
function tn(e) {
|
|
1746
|
+
return `@scope ([data-wb-embed]) {\n${e.replace(en, "$1:scope")}\n}`;
|
|
1672
1747
|
}
|
|
1673
|
-
function
|
|
1748
|
+
function nn({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRef: a }) {
|
|
1674
1749
|
let [o, s] = c(null);
|
|
1675
1750
|
return i(() => {
|
|
1676
1751
|
o && (o.innerHTML = e || "", n ? (o.setAttribute("data-wb-embed", ""), o.querySelectorAll("style").forEach((e) => {
|
|
1677
|
-
e.textContent =
|
|
1752
|
+
e.textContent = tn(e.textContent || "");
|
|
1678
1753
|
})) : o.removeAttribute("data-wb-embed"), t && o.querySelectorAll("script").forEach((e) => {
|
|
1679
1754
|
let t = document.createElement("script");
|
|
1680
1755
|
for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
|
|
@@ -1692,7 +1767,7 @@ function en({ code: e, runScripts: t = !0, scopeStyles: n = !1, style: r, nodeRe
|
|
|
1692
1767
|
style: A(r)
|
|
1693
1768
|
});
|
|
1694
1769
|
}
|
|
1695
|
-
function
|
|
1770
|
+
function rn({ height: e, style: t, nodeRef: n }) {
|
|
1696
1771
|
return /* @__PURE__ */ u("div", {
|
|
1697
1772
|
ref: n,
|
|
1698
1773
|
style: {
|
|
@@ -1703,7 +1778,7 @@ function tn({ height: e, style: t, nodeRef: n }) {
|
|
|
1703
1778
|
}
|
|
1704
1779
|
});
|
|
1705
1780
|
}
|
|
1706
|
-
function
|
|
1781
|
+
function an({ style: e, nodeRef: t }) {
|
|
1707
1782
|
return /* @__PURE__ */ u("div", {
|
|
1708
1783
|
ref: t,
|
|
1709
1784
|
style: {
|
|
@@ -1714,7 +1789,7 @@ function nn({ style: e, nodeRef: t }) {
|
|
|
1714
1789
|
}
|
|
1715
1790
|
});
|
|
1716
1791
|
}
|
|
1717
|
-
function
|
|
1792
|
+
function on({ style: e, nodeRef: t }) {
|
|
1718
1793
|
return /* @__PURE__ */ u("div", {
|
|
1719
1794
|
ref: t,
|
|
1720
1795
|
style: {
|
|
@@ -1723,7 +1798,7 @@ function rn({ style: e, nodeRef: t }) {
|
|
|
1723
1798
|
}
|
|
1724
1799
|
});
|
|
1725
1800
|
}
|
|
1726
|
-
var
|
|
1801
|
+
var sn = {
|
|
1727
1802
|
position: "absolute",
|
|
1728
1803
|
top: "50%",
|
|
1729
1804
|
transform: "translateY(-50%)",
|
|
@@ -1740,7 +1815,7 @@ var an = {
|
|
|
1740
1815
|
alignItems: "center",
|
|
1741
1816
|
justifyContent: "center",
|
|
1742
1817
|
padding: 0
|
|
1743
|
-
},
|
|
1818
|
+
}, cn = {
|
|
1744
1819
|
bottom: {
|
|
1745
1820
|
inset: "auto 0 0 0",
|
|
1746
1821
|
padding: "40px 24px 20px",
|
|
@@ -1759,8 +1834,8 @@ var an = {
|
|
|
1759
1834
|
padding: 24,
|
|
1760
1835
|
textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
|
|
1761
1836
|
}
|
|
1762
|
-
},
|
|
1763
|
-
function
|
|
1837
|
+
}, ln = 48;
|
|
1838
|
+
function un({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
|
|
1764
1839
|
let [p, m] = c(0), [h, g] = c(!1), [_, v] = c(null), y = e ? Math.min(p, e - 1) : 0;
|
|
1765
1840
|
if (i(() => {
|
|
1766
1841
|
if (!n || h || _ || e < 2) return;
|
|
@@ -1776,7 +1851,7 @@ function cn({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1776
1851
|
let b = (t) => m((t + e) % e), x = () => {
|
|
1777
1852
|
if (!_) return;
|
|
1778
1853
|
let { dx: e } = _;
|
|
1779
|
-
v(null), e < -48 ? b(y + 1) : e >
|
|
1854
|
+
v(null), e < -48 ? b(y + 1) : e > ln && b(y - 1);
|
|
1780
1855
|
};
|
|
1781
1856
|
return /* @__PURE__ */ d("div", {
|
|
1782
1857
|
ref: f,
|
|
@@ -1825,7 +1900,7 @@ function cn({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1825
1900
|
type: "button",
|
|
1826
1901
|
"aria-label": "Previous slide",
|
|
1827
1902
|
style: {
|
|
1828
|
-
...
|
|
1903
|
+
...sn,
|
|
1829
1904
|
left: 12
|
|
1830
1905
|
},
|
|
1831
1906
|
onClick: () => b(y - 1),
|
|
@@ -1835,7 +1910,7 @@ function cn({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1835
1910
|
type: "button",
|
|
1836
1911
|
"aria-label": "Next slide",
|
|
1837
1912
|
style: {
|
|
1838
|
-
...
|
|
1913
|
+
...sn,
|
|
1839
1914
|
right: 12
|
|
1840
1915
|
},
|
|
1841
1916
|
onClick: () => b(y + 1),
|
|
@@ -1869,7 +1944,7 @@ function cn({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
|
|
|
1869
1944
|
] })]
|
|
1870
1945
|
});
|
|
1871
1946
|
}
|
|
1872
|
-
var
|
|
1947
|
+
var dn = (e, t) => ({
|
|
1873
1948
|
position: "absolute",
|
|
1874
1949
|
inset: 0,
|
|
1875
1950
|
backgroundImage: e ? `url(${e})` : "none",
|
|
@@ -1877,18 +1952,18 @@ var ln = (e, t) => ({
|
|
|
1877
1952
|
backgroundSize: "cover",
|
|
1878
1953
|
backgroundPosition: "center"
|
|
1879
1954
|
});
|
|
1880
|
-
function
|
|
1881
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1955
|
+
function fn({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
|
|
1956
|
+
return e.length ? /* @__PURE__ */ u(un, {
|
|
1882
1957
|
...r,
|
|
1883
1958
|
count: e.length,
|
|
1884
1959
|
renderSlide: (r) => {
|
|
1885
1960
|
let i = e[r];
|
|
1886
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1961
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: dn(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
|
|
1887
1962
|
style: {
|
|
1888
1963
|
position: "absolute",
|
|
1889
1964
|
color: "#fff",
|
|
1890
1965
|
textAlign: n,
|
|
1891
|
-
...
|
|
1966
|
+
...cn[t] ?? cn.bottom
|
|
1892
1967
|
},
|
|
1893
1968
|
children: [i.title && /* @__PURE__ */ u("div", {
|
|
1894
1969
|
style: {
|
|
@@ -1908,13 +1983,13 @@ function un({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
|
|
|
1908
1983
|
}
|
|
1909
1984
|
}) : null;
|
|
1910
1985
|
}
|
|
1911
|
-
function
|
|
1912
|
-
return e.length ? /* @__PURE__ */ u(
|
|
1986
|
+
function pn({ slides: e = [], linked: t, ...n }) {
|
|
1987
|
+
return e.length ? /* @__PURE__ */ u(un, {
|
|
1913
1988
|
...n,
|
|
1914
1989
|
count: e.length,
|
|
1915
1990
|
renderSlide: (n) => {
|
|
1916
1991
|
let r = e[n];
|
|
1917
|
-
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style:
|
|
1992
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: dn(r.image, r.color) }), /* @__PURE__ */ u("div", {
|
|
1918
1993
|
style: {
|
|
1919
1994
|
position: "absolute",
|
|
1920
1995
|
inset: 0,
|
|
@@ -1926,23 +2001,23 @@ function dn({ slides: e = [], linked: t, ...n }) {
|
|
|
1926
2001
|
}
|
|
1927
2002
|
}) : null;
|
|
1928
2003
|
}
|
|
1929
|
-
var
|
|
1930
|
-
let r =
|
|
2004
|
+
var mn = 256, hn = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), gn = (e, t, n) => {
|
|
2005
|
+
let r = mn * 2 ** n;
|
|
1931
2006
|
return {
|
|
1932
2007
|
x: (Number(t) + 180) / 360 * r,
|
|
1933
|
-
y: (.5 -
|
|
2008
|
+
y: (.5 - hn(Number(e)) / (2 * Math.PI)) * r
|
|
1934
2009
|
};
|
|
1935
2010
|
}, $ = (e, t) => {
|
|
1936
2011
|
if (e === "" || e == null) return null;
|
|
1937
2012
|
let n = Number(e);
|
|
1938
2013
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1939
|
-
},
|
|
1940
|
-
function
|
|
2014
|
+
}, _n = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
2015
|
+
function vn(e, t, n = "directions", r = "") {
|
|
1941
2016
|
let i = `${e},${t}`;
|
|
1942
2017
|
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)}`;
|
|
1943
2018
|
}
|
|
1944
|
-
var
|
|
1945
|
-
function
|
|
2019
|
+
var yn = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
2020
|
+
function bn({ 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 }) {
|
|
1946
2021
|
let _ = s(null), [v, y] = c(1200);
|
|
1947
2022
|
i(() => {
|
|
1948
2023
|
let e = _.current;
|
|
@@ -1952,7 +2027,7 @@ function vn({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1952
2027
|
let n = new ResizeObserver(t);
|
|
1953
2028
|
return n.observe(e), () => n.disconnect();
|
|
1954
2029
|
}, []);
|
|
1955
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
2030
|
+
let b = (Array.isArray(e) ? e : []).filter(_n), x = _n({
|
|
1956
2031
|
lat: t,
|
|
1957
2032
|
lng: n
|
|
1958
2033
|
}) ? {
|
|
@@ -1964,7 +2039,7 @@ function vn({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1964
2039
|
} : null, S = Math.max(80, Number(a) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1965
2040
|
if (b.length < 2) return 13;
|
|
1966
2041
|
for (let e = 19; e >= 1; e--) {
|
|
1967
|
-
let t = b.map((t) =>
|
|
2042
|
+
let t = b.map((t) => gn($(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));
|
|
1968
2043
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1969
2044
|
}
|
|
1970
2045
|
return 1;
|
|
@@ -1988,12 +2063,12 @@ function vn({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1988
2063
|
},
|
|
1989
2064
|
children: "Set the coordinates in Settings"
|
|
1990
2065
|
});
|
|
1991
|
-
let T =
|
|
2066
|
+
let T = gn(x.lat, x.lng, C), E = {
|
|
1992
2067
|
x: T.x - v / 2,
|
|
1993
2068
|
y: T.y - S / 2
|
|
1994
2069
|
}, D = [], O = [];
|
|
1995
|
-
for (let e = Math.floor(E.x /
|
|
1996
|
-
for (let e = Math.floor(E.y /
|
|
2070
|
+
for (let e = Math.floor(E.x / mn); e <= Math.floor((E.x + v) / mn); e++) D.push(e);
|
|
2071
|
+
for (let e = Math.floor(E.y / mn); e <= Math.floor((E.y + S) / mn); e++) O.push(e);
|
|
1997
2072
|
let k = 2 ** C;
|
|
1998
2073
|
return /* @__PURE__ */ d("div", {
|
|
1999
2074
|
ref: (e) => {
|
|
@@ -2016,22 +2091,22 @@ function vn({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
2016
2091
|
return e < 0 || e >= k ? null : /* @__PURE__ */ u("img", {
|
|
2017
2092
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
2018
2093
|
alt: "",
|
|
2019
|
-
width:
|
|
2020
|
-
height:
|
|
2094
|
+
width: mn,
|
|
2095
|
+
height: mn,
|
|
2021
2096
|
loading: "lazy",
|
|
2022
2097
|
style: {
|
|
2023
2098
|
position: "absolute",
|
|
2024
|
-
left: Math.round(t *
|
|
2025
|
-
top: Math.round(e *
|
|
2026
|
-
width:
|
|
2027
|
-
height:
|
|
2099
|
+
left: Math.round(t * mn - E.x),
|
|
2100
|
+
top: Math.round(e * mn - E.y),
|
|
2101
|
+
width: mn,
|
|
2102
|
+
height: mn,
|
|
2028
2103
|
userSelect: "none",
|
|
2029
2104
|
pointerEvents: "none"
|
|
2030
2105
|
}
|
|
2031
2106
|
}, `${t}-${e}`);
|
|
2032
2107
|
})),
|
|
2033
2108
|
b.map((e, t) => {
|
|
2034
|
-
let n =
|
|
2109
|
+
let n = gn($(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 : vn($(e.lat, 90), $(e.lng, 180), l, e.title);
|
|
2035
2110
|
return /* @__PURE__ */ d(s ? "a" : "span", {
|
|
2036
2111
|
href: s || void 0,
|
|
2037
2112
|
target: s ? "_blank" : void 0,
|
|
@@ -2070,8 +2145,8 @@ function vn({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
2070
2145
|
viewBox: "0 0 24 24",
|
|
2071
2146
|
fill: a,
|
|
2072
2147
|
style: { display: "block" },
|
|
2073
|
-
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
2074
|
-
d:
|
|
2148
|
+
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), xn[e.icon] ? /* @__PURE__ */ u("path", {
|
|
2149
|
+
d: xn[e.icon],
|
|
2075
2150
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
2076
2151
|
fill: "none",
|
|
2077
2152
|
stroke: "#fff",
|
|
@@ -2107,7 +2182,7 @@ function vn({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
2107
2182
|
})
|
|
2108
2183
|
]
|
|
2109
2184
|
}), f ? /* @__PURE__ */ u("a", {
|
|
2110
|
-
href:
|
|
2185
|
+
href: yn(x.lat, x.lng, C),
|
|
2111
2186
|
target: "_blank",
|
|
2112
2187
|
rel: "noopener noreferrer",
|
|
2113
2188
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -2121,7 +2196,7 @@ function vn({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
2121
2196
|
}) : null]
|
|
2122
2197
|
});
|
|
2123
2198
|
}
|
|
2124
|
-
var
|
|
2199
|
+
var xn = {
|
|
2125
2200
|
check: "M4 12l5 5L20 6",
|
|
2126
2201
|
close: "M6 6l12 12M18 6L6 18",
|
|
2127
2202
|
plus: "M12 5v14M5 12h14",
|
|
@@ -2218,8 +2293,8 @@ var yn = {
|
|
|
2218
2293
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
2219
2294
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
2220
2295
|
};
|
|
2221
|
-
function
|
|
2222
|
-
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [
|
|
2296
|
+
function Sn({ 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 }) {
|
|
2297
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [xn[e] ?? xn.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
|
|
2223
2298
|
viewBox: "0 0 24 24",
|
|
2224
2299
|
width: g,
|
|
2225
2300
|
height: g,
|
|
@@ -2255,7 +2330,7 @@ function bn({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
2255
2330
|
children: v
|
|
2256
2331
|
});
|
|
2257
2332
|
}
|
|
2258
|
-
function
|
|
2333
|
+
function Cn(e, t = {}, n = 0) {
|
|
2259
2334
|
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 = [];
|
|
2260
2335
|
for (let e of r) {
|
|
2261
2336
|
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)) : "";
|
|
@@ -2268,7 +2343,7 @@ function xn(e, t = {}, n = 0) {
|
|
|
2268
2343
|
}
|
|
2269
2344
|
return o;
|
|
2270
2345
|
}
|
|
2271
|
-
function
|
|
2346
|
+
function wn({ 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 }) {
|
|
2272
2347
|
let { tenant: x, apiUrl: S } = r(Q), C = r(et)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
|
|
2273
2348
|
i(() => {
|
|
2274
2349
|
if (!t || C) return;
|
|
@@ -2286,7 +2361,7 @@ function Sn({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
2286
2361
|
C
|
|
2287
2362
|
]);
|
|
2288
2363
|
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 ? (() => {
|
|
2289
|
-
let e =
|
|
2364
|
+
let e = Cn(k, {
|
|
2290
2365
|
imageField: a,
|
|
2291
2366
|
nameField: o,
|
|
2292
2367
|
hrefField: s
|
|
@@ -2491,19 +2566,19 @@ function Sn({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
2491
2566
|
]
|
|
2492
2567
|
});
|
|
2493
2568
|
}
|
|
2494
|
-
var
|
|
2569
|
+
var Tn = {
|
|
2495
2570
|
color: "inherit",
|
|
2496
2571
|
textDecoration: "none",
|
|
2497
2572
|
fontSize: 14,
|
|
2498
2573
|
opacity: .85
|
|
2499
|
-
},
|
|
2574
|
+
}, En = {
|
|
2500
2575
|
background: "var(--page-surface, #f2f2f2)",
|
|
2501
2576
|
color: "var(--page-text, #111827)",
|
|
2502
2577
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
2503
2578
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
2504
2579
|
zIndex: 60
|
|
2505
2580
|
};
|
|
2506
|
-
function
|
|
2581
|
+
function Dn(e, t = {}, n = "dropdown") {
|
|
2507
2582
|
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) => {
|
|
2508
2583
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
2509
2584
|
return {
|
|
@@ -2545,7 +2620,7 @@ function Tn(e, t = {}, n = "dropdown") {
|
|
|
2545
2620
|
type: e.children.length ? n : "link"
|
|
2546
2621
|
}));
|
|
2547
2622
|
}
|
|
2548
|
-
function
|
|
2623
|
+
function On({ 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" }) {
|
|
2549
2624
|
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);
|
|
2550
2625
|
i(() => {
|
|
2551
2626
|
if (!g || P) return;
|
|
@@ -2566,7 +2641,7 @@ function En({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2566
2641
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2567
2642
|
return e.observe(C), () => e.disconnect();
|
|
2568
2643
|
}, [C, h]);
|
|
2569
|
-
let L = g ?
|
|
2644
|
+
let L = g ? Dn(P ?? F ?? [], {
|
|
2570
2645
|
labelField: _,
|
|
2571
2646
|
hrefField: v,
|
|
2572
2647
|
imageField: y,
|
|
@@ -2595,7 +2670,7 @@ function En({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2595
2670
|
return /* @__PURE__ */ d("a", {
|
|
2596
2671
|
href: e.href || "#",
|
|
2597
2672
|
style: {
|
|
2598
|
-
...
|
|
2673
|
+
...Tn,
|
|
2599
2674
|
display: n ? "block" : "flex",
|
|
2600
2675
|
alignItems: n ? void 0 : "center",
|
|
2601
2676
|
gap: n ? void 0 : 10,
|
|
@@ -2692,7 +2767,7 @@ function En({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2692
2767
|
let t = e.children ?? [];
|
|
2693
2768
|
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
2694
2769
|
href: e.href || "#",
|
|
2695
|
-
style:
|
|
2770
|
+
style: Tn,
|
|
2696
2771
|
children: e.label
|
|
2697
2772
|
}, e.key);
|
|
2698
2773
|
let n = e.type === "mega";
|
|
@@ -2706,7 +2781,7 @@ function En({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2706
2781
|
children: [/* @__PURE__ */ d("a", {
|
|
2707
2782
|
href: e.href || "#",
|
|
2708
2783
|
style: {
|
|
2709
|
-
...
|
|
2784
|
+
...Tn,
|
|
2710
2785
|
cursor: "pointer"
|
|
2711
2786
|
},
|
|
2712
2787
|
children: [
|
|
@@ -2722,7 +2797,7 @@ function En({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2722
2797
|
]
|
|
2723
2798
|
}), k === e.key && (n ? /* @__PURE__ */ u("div", {
|
|
2724
2799
|
style: {
|
|
2725
|
-
...
|
|
2800
|
+
...En,
|
|
2726
2801
|
position: "absolute",
|
|
2727
2802
|
left: 0,
|
|
2728
2803
|
right: 0,
|
|
@@ -2738,7 +2813,7 @@ function En({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2738
2813
|
}, !0))
|
|
2739
2814
|
}) : /* @__PURE__ */ u("div", {
|
|
2740
2815
|
style: {
|
|
2741
|
-
...
|
|
2816
|
+
...En,
|
|
2742
2817
|
position: "absolute",
|
|
2743
2818
|
top: "100%",
|
|
2744
2819
|
left: 0,
|
|
@@ -2767,7 +2842,7 @@ function En({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2767
2842
|
children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
2768
2843
|
href: t.href || "#",
|
|
2769
2844
|
style: {
|
|
2770
|
-
...
|
|
2845
|
+
...Tn,
|
|
2771
2846
|
padding: "10px 4px",
|
|
2772
2847
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
2773
2848
|
opacity: 1
|
|
@@ -2778,7 +2853,7 @@ function En({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2778
2853
|
]
|
|
2779
2854
|
});
|
|
2780
2855
|
}
|
|
2781
|
-
function
|
|
2856
|
+
function kn({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2782
2857
|
let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2783
2858
|
return e.length ? /* @__PURE__ */ d("div", {
|
|
2784
2859
|
ref: r,
|
|
@@ -2818,13 +2893,13 @@ function Dn({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2818
2893
|
}, e.key))]
|
|
2819
2894
|
}) : null;
|
|
2820
2895
|
}
|
|
2821
|
-
function
|
|
2896
|
+
function An({ 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 }) {
|
|
2822
2897
|
let [g, _] = c(() => new Set(e.length ? [e[0].key] : []));
|
|
2823
2898
|
if (!e.length) return null;
|
|
2824
2899
|
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2825
2900
|
let n = Number(e);
|
|
2826
2901
|
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2827
|
-
}, b =
|
|
2902
|
+
}, b = xn[r], x = (e) => _((t) => {
|
|
2828
2903
|
let r = new Set(n ? t : []);
|
|
2829
2904
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2830
2905
|
});
|
|
@@ -2899,15 +2974,15 @@ function On({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
|
|
|
2899
2974
|
})
|
|
2900
2975
|
});
|
|
2901
2976
|
}
|
|
2902
|
-
var
|
|
2977
|
+
var jn = {
|
|
2903
2978
|
display: "flex",
|
|
2904
2979
|
flexDirection: "column",
|
|
2905
2980
|
gap: "12px"
|
|
2906
|
-
},
|
|
2981
|
+
}, Mn = {
|
|
2907
2982
|
fontSize: "14px",
|
|
2908
2983
|
fontWeight: 500,
|
|
2909
2984
|
color: "var(--page-text, #111827)"
|
|
2910
|
-
},
|
|
2985
|
+
}, Nn = {
|
|
2911
2986
|
padding: "10px 12px",
|
|
2912
2987
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2913
2988
|
borderRadius: "6px",
|
|
@@ -2917,18 +2992,18 @@ var kn = {
|
|
|
2917
2992
|
boxSizing: "border-box",
|
|
2918
2993
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2919
2994
|
color: "var(--page-text, #111827)"
|
|
2920
|
-
},
|
|
2995
|
+
}, Pn = {
|
|
2921
2996
|
display: "flex",
|
|
2922
2997
|
alignItems: "center",
|
|
2923
2998
|
gap: "8px",
|
|
2924
2999
|
fontSize: "14px",
|
|
2925
3000
|
color: "var(--page-text, #111827)"
|
|
2926
|
-
},
|
|
3001
|
+
}, Fn = (e) => e ? {
|
|
2927
3002
|
readOnly: !0,
|
|
2928
3003
|
tabIndex: -1,
|
|
2929
3004
|
onMouseDown: (e) => e.preventDefault()
|
|
2930
3005
|
} : {};
|
|
2931
|
-
function
|
|
3006
|
+
function In(e, t) {
|
|
2932
3007
|
if (!e) return !0;
|
|
2933
3008
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2934
3009
|
switch (e.op) {
|
|
@@ -2942,11 +3017,11 @@ function Pn(e, t) {
|
|
|
2942
3017
|
default: return !1;
|
|
2943
3018
|
}
|
|
2944
3019
|
}
|
|
2945
|
-
var
|
|
3020
|
+
var Ln = {
|
|
2946
3021
|
display: "flex",
|
|
2947
3022
|
flexDirection: "column",
|
|
2948
3023
|
gap: 6
|
|
2949
|
-
},
|
|
3024
|
+
}, Rn = {
|
|
2950
3025
|
font: "inherit",
|
|
2951
3026
|
fontSize: 15,
|
|
2952
3027
|
padding: "10px 12px",
|
|
@@ -2957,17 +3032,17 @@ var Fn = {
|
|
|
2957
3032
|
width: "100%",
|
|
2958
3033
|
boxSizing: "border-box"
|
|
2959
3034
|
};
|
|
2960
|
-
function
|
|
3035
|
+
function zn(e, t) {
|
|
2961
3036
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2962
3037
|
if (!e?.parentField) return n;
|
|
2963
3038
|
let r = t?.[e.parentField];
|
|
2964
3039
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2965
3040
|
}
|
|
2966
|
-
var
|
|
2967
|
-
function
|
|
3041
|
+
var Bn = "g-recaptcha-response", Vn = (e) => e?.type === "recaptcha" ? Bn : e?.name;
|
|
3042
|
+
function Hn({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2968
3043
|
let a = /* @__PURE__ */ d("span", {
|
|
2969
3044
|
style: {
|
|
2970
|
-
...
|
|
3045
|
+
...Mn,
|
|
2971
3046
|
fontSize: 14
|
|
2972
3047
|
},
|
|
2973
3048
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2976,7 +3051,7 @@ function Bn({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2976
3051
|
required: e.required || void 0,
|
|
2977
3052
|
placeholder: e.placeholder || void 0,
|
|
2978
3053
|
disabled: r || void 0,
|
|
2979
|
-
style:
|
|
3054
|
+
style: Rn,
|
|
2980
3055
|
value: t ?? "",
|
|
2981
3056
|
onChange: (t) => n(e.name, t.target.value)
|
|
2982
3057
|
};
|
|
@@ -3005,11 +3080,11 @@ function Bn({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
3005
3080
|
borderRadius: 8,
|
|
3006
3081
|
display: "block"
|
|
3007
3082
|
}
|
|
3008
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(
|
|
3083
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(qn, {
|
|
3009
3084
|
theme: e.captchaTheme,
|
|
3010
3085
|
size: e.captchaSize,
|
|
3011
3086
|
inert: r,
|
|
3012
|
-
onChange: (e) => n(
|
|
3087
|
+
onChange: (e) => n(Bn, e)
|
|
3013
3088
|
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Xt, {
|
|
3014
3089
|
url: e.src,
|
|
3015
3090
|
style: { width: "100%" }
|
|
@@ -3022,14 +3097,14 @@ function Bn({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
3022
3097
|
display: "block"
|
|
3023
3098
|
}
|
|
3024
3099
|
}) : null : /* @__PURE__ */ d("label", {
|
|
3025
|
-
style:
|
|
3100
|
+
style: Ln,
|
|
3026
3101
|
children: [
|
|
3027
3102
|
a,
|
|
3028
3103
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
|
|
3029
3104
|
...o,
|
|
3030
3105
|
rows: 4,
|
|
3031
3106
|
style: {
|
|
3032
|
-
...
|
|
3107
|
+
...Rn,
|
|
3033
3108
|
resize: "vertical"
|
|
3034
3109
|
}
|
|
3035
3110
|
}) : e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
@@ -3038,7 +3113,7 @@ function Bn({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
3038
3113
|
children: [/* @__PURE__ */ u("option", {
|
|
3039
3114
|
value: "",
|
|
3040
3115
|
children: e.placeholder || "—"
|
|
3041
|
-
}),
|
|
3116
|
+
}), zn(e, i).map((e, t) => /* @__PURE__ */ u("option", {
|
|
3042
3117
|
value: typeof e == "string" ? e : e.value,
|
|
3043
3118
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
3044
3119
|
}, t))]
|
|
@@ -3085,7 +3160,7 @@ function Bn({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
3085
3160
|
]
|
|
3086
3161
|
});
|
|
3087
3162
|
}
|
|
3088
|
-
function
|
|
3163
|
+
function Un({ 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 }) {
|
|
3089
3164
|
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;
|
|
3090
3165
|
i(() => {
|
|
3091
3166
|
if (!f || !s) return;
|
|
@@ -3107,11 +3182,11 @@ function Vn({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
3107
3182
|
section: e,
|
|
3108
3183
|
fields: []
|
|
3109
3184
|
}) : j[j.length - 1].fields.push(e);
|
|
3110
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
3185
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || In(e.section.condition, T)).map((e) => ({
|
|
3111
3186
|
...e,
|
|
3112
|
-
fields: e.fields.filter((e) =>
|
|
3187
|
+
fields: e.fields.filter((e) => In(e.condition, T))
|
|
3113
3188
|
})), 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) => {
|
|
3114
|
-
let t = T[
|
|
3189
|
+
let t = T[Vn(e)];
|
|
3115
3190
|
return e.required && (t == null || t === "" || t === !1);
|
|
3116
3191
|
}), R = F >= N.length - 1, z = (e, t) => E((n) => {
|
|
3117
3192
|
let r = {
|
|
@@ -3167,11 +3242,11 @@ function Vn({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
3167
3242
|
}
|
|
3168
3243
|
},
|
|
3169
3244
|
style: {
|
|
3170
|
-
...
|
|
3245
|
+
...jn,
|
|
3171
3246
|
display: k === "success" ? "none" : "flex"
|
|
3172
3247
|
},
|
|
3173
3248
|
children: f && s ? /* @__PURE__ */ d(l, { children: [
|
|
3174
|
-
P && /* @__PURE__ */ u(
|
|
3249
|
+
P && /* @__PURE__ */ u(Sr, {
|
|
3175
3250
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
3176
3251
|
active: F + 1,
|
|
3177
3252
|
style: { marginBottom: 8 }
|
|
@@ -3184,9 +3259,9 @@ function Vn({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
3184
3259
|
},
|
|
3185
3260
|
children: N[F].section.help
|
|
3186
3261
|
}),
|
|
3187
|
-
I.map((e) => /* @__PURE__ */ u(
|
|
3262
|
+
I.map((e) => /* @__PURE__ */ u(Hn, {
|
|
3188
3263
|
field: e,
|
|
3189
|
-
value: T[
|
|
3264
|
+
value: T[Vn(e)],
|
|
3190
3265
|
values: T,
|
|
3191
3266
|
onChange: z,
|
|
3192
3267
|
inert: h
|
|
@@ -3257,10 +3332,10 @@ function Vn({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
3257
3332
|
]
|
|
3258
3333
|
});
|
|
3259
3334
|
}
|
|
3260
|
-
var
|
|
3335
|
+
var Wn = null, Gn = null, Kn = (e) => {
|
|
3261
3336
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
3262
|
-
if (
|
|
3263
|
-
if (
|
|
3337
|
+
if (Wn && Gn === t) return Wn;
|
|
3338
|
+
if (Wn && typeof window < "u") {
|
|
3264
3339
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
3265
3340
|
delete window[e];
|
|
3266
3341
|
} catch {
|
|
@@ -3268,22 +3343,22 @@ var Hn = null, Un = null, Wn = (e) => {
|
|
|
3268
3343
|
}
|
|
3269
3344
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
3270
3345
|
}
|
|
3271
|
-
return
|
|
3346
|
+
return Gn = t, Wn = new Promise((e) => {
|
|
3272
3347
|
if (typeof window > "u") return;
|
|
3273
3348
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
3274
3349
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
3275
3350
|
let n = document.createElement("script");
|
|
3276
3351
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
3277
|
-
}),
|
|
3352
|
+
}), Wn;
|
|
3278
3353
|
};
|
|
3279
|
-
function
|
|
3354
|
+
function qn({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
|
|
3280
3355
|
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);
|
|
3281
3356
|
if (_.current = f, i(() => {
|
|
3282
3357
|
if (l || !h || !g.current) return;
|
|
3283
3358
|
let e = !0, r = (t) => {
|
|
3284
3359
|
e && typeof _.current == "function" && _.current(t);
|
|
3285
3360
|
};
|
|
3286
|
-
return
|
|
3361
|
+
return Kn(a).then((i) => {
|
|
3287
3362
|
if (!(!e || !g.current || !i?.render)) {
|
|
3288
3363
|
g.current.innerHTML = "", r("");
|
|
3289
3364
|
try {
|
|
@@ -3365,17 +3440,17 @@ function Gn({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
3365
3440
|
children: /* @__PURE__ */ u("div", { ref: g })
|
|
3366
3441
|
}) : null;
|
|
3367
3442
|
}
|
|
3368
|
-
function
|
|
3443
|
+
function Jn({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
3369
3444
|
return /* @__PURE__ */ u("label", {
|
|
3370
3445
|
ref: r,
|
|
3371
3446
|
style: {
|
|
3372
|
-
...
|
|
3447
|
+
...Mn,
|
|
3373
3448
|
...A(n)
|
|
3374
3449
|
},
|
|
3375
3450
|
children: Dt(t, e, i)
|
|
3376
3451
|
});
|
|
3377
3452
|
}
|
|
3378
|
-
function
|
|
3453
|
+
function Yn({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
3379
3454
|
return /* @__PURE__ */ u("input", {
|
|
3380
3455
|
ref: a,
|
|
3381
3456
|
type: e,
|
|
@@ -3383,13 +3458,13 @@ function qn({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
3383
3458
|
placeholder: n,
|
|
3384
3459
|
required: !o && !!r,
|
|
3385
3460
|
style: {
|
|
3386
|
-
...
|
|
3461
|
+
...Nn,
|
|
3387
3462
|
...A(i)
|
|
3388
3463
|
},
|
|
3389
|
-
...
|
|
3464
|
+
...Fn(o)
|
|
3390
3465
|
});
|
|
3391
3466
|
}
|
|
3392
|
-
function
|
|
3467
|
+
function Xn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
3393
3468
|
return /* @__PURE__ */ u("textarea", {
|
|
3394
3469
|
ref: a,
|
|
3395
3470
|
name: e || void 0,
|
|
@@ -3397,18 +3472,18 @@ function Jn({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
3397
3472
|
rows: n,
|
|
3398
3473
|
required: !o && !!r,
|
|
3399
3474
|
style: {
|
|
3400
|
-
...
|
|
3475
|
+
...Nn,
|
|
3401
3476
|
resize: "vertical",
|
|
3402
3477
|
...A(i)
|
|
3403
3478
|
},
|
|
3404
|
-
...
|
|
3479
|
+
...Fn(o)
|
|
3405
3480
|
});
|
|
3406
3481
|
}
|
|
3407
|
-
function
|
|
3482
|
+
function Zn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
3408
3483
|
return /* @__PURE__ */ d("label", {
|
|
3409
3484
|
ref: o,
|
|
3410
3485
|
style: {
|
|
3411
|
-
...
|
|
3486
|
+
...Pn,
|
|
3412
3487
|
...A(a)
|
|
3413
3488
|
},
|
|
3414
3489
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -3425,7 +3500,7 @@ function Yn({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
3425
3500
|
}), t]
|
|
3426
3501
|
});
|
|
3427
3502
|
}
|
|
3428
|
-
function
|
|
3503
|
+
function Qn({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
3429
3504
|
return /* @__PURE__ */ d("select", {
|
|
3430
3505
|
ref: a,
|
|
3431
3506
|
name: e || void 0,
|
|
@@ -3434,7 +3509,7 @@ function Xn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
3434
3509
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
3435
3510
|
tabIndex: o ? -1 : void 0,
|
|
3436
3511
|
style: {
|
|
3437
|
-
...
|
|
3512
|
+
...Nn,
|
|
3438
3513
|
appearance: "auto",
|
|
3439
3514
|
...A(i)
|
|
3440
3515
|
},
|
|
@@ -3448,12 +3523,12 @@ function Xn({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
3448
3523
|
}, t))]
|
|
3449
3524
|
});
|
|
3450
3525
|
}
|
|
3451
|
-
function
|
|
3526
|
+
function $n({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
3452
3527
|
let [s, l] = c(null);
|
|
3453
3528
|
return /* @__PURE__ */ d("label", {
|
|
3454
3529
|
ref: a,
|
|
3455
3530
|
style: {
|
|
3456
|
-
...
|
|
3531
|
+
...Nn,
|
|
3457
3532
|
display: "flex",
|
|
3458
3533
|
alignItems: "center",
|
|
3459
3534
|
gap: "8px",
|
|
@@ -3480,7 +3555,7 @@ function Zn({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
3480
3555
|
]
|
|
3481
3556
|
});
|
|
3482
3557
|
}
|
|
3483
|
-
function
|
|
3558
|
+
function er({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
3484
3559
|
return /* @__PURE__ */ u("button", {
|
|
3485
3560
|
ref: n,
|
|
3486
3561
|
type: r ? "button" : "submit",
|
|
@@ -3500,7 +3575,7 @@ function Qn({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
3500
3575
|
children: e
|
|
3501
3576
|
});
|
|
3502
3577
|
}
|
|
3503
|
-
function
|
|
3578
|
+
function tr({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
3504
3579
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
3505
3580
|
return /* @__PURE__ */ u("div", {
|
|
3506
3581
|
ref: r,
|
|
@@ -3517,7 +3592,7 @@ function $n({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
3517
3592
|
}, t))
|
|
3518
3593
|
});
|
|
3519
3594
|
}
|
|
3520
|
-
function
|
|
3595
|
+
function nr({ 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: _ }) {
|
|
3521
3596
|
let { tenant: v, apiUrl: y, locale: b } = r(Q), x = r(it), S = r(et), [, C] = c(0);
|
|
3522
3597
|
i(() => {
|
|
3523
3598
|
if (typeof window > "u") return;
|
|
@@ -3636,7 +3711,7 @@ function er({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3636
3711
|
})
|
|
3637
3712
|
});
|
|
3638
3713
|
}
|
|
3639
|
-
function
|
|
3714
|
+
function rr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3640
3715
|
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : nt(), s = {
|
|
3641
3716
|
height: 34,
|
|
3642
3717
|
padding: "0 12px",
|
|
@@ -3685,7 +3760,7 @@ function tr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3685
3760
|
name: `f_${e.name}`,
|
|
3686
3761
|
defaultValue: o[e.name] ?? "",
|
|
3687
3762
|
style: s,
|
|
3688
|
-
...
|
|
3763
|
+
...Fn(i),
|
|
3689
3764
|
children: [/* @__PURE__ */ u("option", {
|
|
3690
3765
|
value: "",
|
|
3691
3766
|
children: e.label || e.name
|
|
@@ -3700,7 +3775,7 @@ function tr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3700
3775
|
name: `f_${e.name}`,
|
|
3701
3776
|
defaultValue: o[e.name] ?? "",
|
|
3702
3777
|
style: s,
|
|
3703
|
-
...
|
|
3778
|
+
...Fn(i),
|
|
3704
3779
|
children: [
|
|
3705
3780
|
/* @__PURE__ */ u("option", {
|
|
3706
3781
|
value: "",
|
|
@@ -3721,7 +3796,7 @@ function tr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3721
3796
|
defaultValue: o[e.name] ?? "",
|
|
3722
3797
|
placeholder: e.label || e.name,
|
|
3723
3798
|
style: s,
|
|
3724
|
-
...
|
|
3799
|
+
...Fn(i)
|
|
3725
3800
|
}, e.name)), /* @__PURE__ */ u("button", {
|
|
3726
3801
|
type: "submit",
|
|
3727
3802
|
style: {
|
|
@@ -3734,12 +3809,12 @@ function tr({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3734
3809
|
fontWeight: 600,
|
|
3735
3810
|
cursor: i ? "default" : "pointer"
|
|
3736
3811
|
},
|
|
3737
|
-
...
|
|
3812
|
+
...Fn(i),
|
|
3738
3813
|
children: t
|
|
3739
3814
|
})]
|
|
3740
3815
|
});
|
|
3741
3816
|
}
|
|
3742
|
-
function
|
|
3817
|
+
function ir({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3743
3818
|
return e.length ? /* @__PURE__ */ u("nav", {
|
|
3744
3819
|
ref: r,
|
|
3745
3820
|
"aria-label": "Breadcrumb",
|
|
@@ -3789,7 +3864,7 @@ function nr({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3789
3864
|
})
|
|
3790
3865
|
}) : null;
|
|
3791
3866
|
}
|
|
3792
|
-
function
|
|
3867
|
+
function ar({ 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 }) {
|
|
3793
3868
|
let { tenant: g, apiUrl: _ } = r(Q), v = r(et), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3794
3869
|
i(() => {
|
|
3795
3870
|
if (!o || Number.isFinite(x)) return;
|
|
@@ -3874,15 +3949,15 @@ function rr({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3874
3949
|
]
|
|
3875
3950
|
});
|
|
3876
3951
|
}
|
|
3877
|
-
var
|
|
3952
|
+
var or = "webim.page_mode", sr = () => {
|
|
3878
3953
|
if (typeof window > "u") return "auto";
|
|
3879
3954
|
try {
|
|
3880
|
-
let e = window.localStorage.getItem(
|
|
3955
|
+
let e = window.localStorage.getItem(or);
|
|
3881
3956
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3882
3957
|
} catch {
|
|
3883
3958
|
return "auto";
|
|
3884
3959
|
}
|
|
3885
|
-
},
|
|
3960
|
+
}, cr = (e) => {
|
|
3886
3961
|
let t = {
|
|
3887
3962
|
width: 16,
|
|
3888
3963
|
height: 16,
|
|
@@ -3914,13 +3989,13 @@ var ir = "webim.page_mode", ar = () => {
|
|
|
3914
3989
|
rx: "2"
|
|
3915
3990
|
}), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
|
|
3916
3991
|
});
|
|
3917
|
-
},
|
|
3992
|
+
}, lr = {
|
|
3918
3993
|
light: "Light theme",
|
|
3919
3994
|
dark: "Dark theme",
|
|
3920
3995
|
auto: "Follow the device theme"
|
|
3921
3996
|
};
|
|
3922
|
-
function
|
|
3923
|
-
let [o, l] = c(a ? "auto" :
|
|
3997
|
+
function ur({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
3998
|
+
let [o, l] = c(a ? "auto" : sr), d = s(null), f = (e) => {
|
|
3924
3999
|
d.current = e, typeof r == "function" && r(e);
|
|
3925
4000
|
};
|
|
3926
4001
|
i(() => {
|
|
@@ -3928,7 +4003,7 @@ function cr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3928
4003
|
let e = d.current?.closest?.(".webim-page");
|
|
3929
4004
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3930
4005
|
try {
|
|
3931
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
4006
|
+
o === "auto" ? window.localStorage.removeItem(or) : window.localStorage.setItem(or, o);
|
|
3932
4007
|
} catch {}
|
|
3933
4008
|
}, [o, a]);
|
|
3934
4009
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3963,8 +4038,8 @@ function cr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3963
4038
|
},
|
|
3964
4039
|
children: p.map((e) => /* @__PURE__ */ u("button", {
|
|
3965
4040
|
type: "button",
|
|
3966
|
-
title:
|
|
3967
|
-
"aria-label":
|
|
4041
|
+
title: lr[e],
|
|
4042
|
+
"aria-label": lr[e],
|
|
3968
4043
|
"aria-pressed": e === m,
|
|
3969
4044
|
onClick: a ? void 0 : () => l(e),
|
|
3970
4045
|
style: {
|
|
@@ -3975,15 +4050,15 @@ function cr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3975
4050
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3976
4051
|
opacity: e === m ? 1 : .7
|
|
3977
4052
|
},
|
|
3978
|
-
children:
|
|
4053
|
+
children: cr(e)
|
|
3979
4054
|
}, e))
|
|
3980
4055
|
});
|
|
3981
4056
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3982
4057
|
return /* @__PURE__ */ u("button", {
|
|
3983
4058
|
ref: f,
|
|
3984
4059
|
type: "button",
|
|
3985
|
-
title:
|
|
3986
|
-
"aria-label": `Theme: ${
|
|
4060
|
+
title: lr[m],
|
|
4061
|
+
"aria-label": `Theme: ${lr[m]} — switch to ${lr[g]}`,
|
|
3987
4062
|
onClick: a ? void 0 : () => l(g),
|
|
3988
4063
|
style: {
|
|
3989
4064
|
...h,
|
|
@@ -3992,10 +4067,10 @@ function cr({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3992
4067
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3993
4068
|
...A(n)
|
|
3994
4069
|
},
|
|
3995
|
-
children:
|
|
4070
|
+
children: cr(m)
|
|
3996
4071
|
});
|
|
3997
4072
|
}
|
|
3998
|
-
function
|
|
4073
|
+
function dr(e) {
|
|
3999
4074
|
let t = e?.parentElement;
|
|
4000
4075
|
for (; t && t !== document.body;) {
|
|
4001
4076
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -4004,7 +4079,7 @@ function lr(e) {
|
|
|
4004
4079
|
}
|
|
4005
4080
|
return window;
|
|
4006
4081
|
}
|
|
4007
|
-
var
|
|
4082
|
+
var fr = (e) => e === window ? window.scrollY : e.scrollTop, pr = {
|
|
4008
4083
|
"bottom-right": (e) => ({
|
|
4009
4084
|
right: e,
|
|
4010
4085
|
bottom: e
|
|
@@ -4018,11 +4093,11 @@ var ur = (e) => e === window ? window.scrollY : e.scrollTop, dr = {
|
|
|
4018
4093
|
bottom: e,
|
|
4019
4094
|
transform: "translateX(-50%)"
|
|
4020
4095
|
})
|
|
4021
|
-
},
|
|
4096
|
+
}, mr = {
|
|
4022
4097
|
linear: (e) => e,
|
|
4023
4098
|
out: (e) => 1 - (1 - e) ** 3,
|
|
4024
4099
|
inout: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2
|
|
4025
|
-
},
|
|
4100
|
+
}, hr = (e) => {
|
|
4026
4101
|
let t = e.getBoundingClientRect(), n = e.parentElement;
|
|
4027
4102
|
for (; n && n !== document.body;) {
|
|
4028
4103
|
let e = getComputedStyle(n);
|
|
@@ -4030,12 +4105,12 @@ var ur = (e) => e === window ? window.scrollY : e.scrollTop, dr = {
|
|
|
4030
4105
|
n = n.parentElement;
|
|
4031
4106
|
}
|
|
4032
4107
|
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);
|
|
4033
|
-
},
|
|
4108
|
+
}, gr = (e, t) => {
|
|
4034
4109
|
let n = typeof e == "number" ? e : parseFloat(e);
|
|
4035
4110
|
return Number.isFinite(n) ? n : t;
|
|
4036
4111
|
};
|
|
4037
|
-
function
|
|
4038
|
-
let i = Math.min(Math.max(Math.round(
|
|
4112
|
+
function _r(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
4113
|
+
let i = Math.min(Math.max(Math.round(gr(n, 0)), 0), 6);
|
|
4039
4114
|
try {
|
|
4040
4115
|
return new Intl.NumberFormat(t || void 0, {
|
|
4041
4116
|
minimumFractionDigits: i,
|
|
@@ -4046,8 +4121,8 @@ function hr(e, { locale: t, decimals: n = 0, separator: r = "auto" } = {}) {
|
|
|
4046
4121
|
return e.toFixed(i);
|
|
4047
4122
|
}
|
|
4048
4123
|
}
|
|
4049
|
-
function
|
|
4050
|
-
let { locale: C } = r(Q), w = Math.max(
|
|
4124
|
+
function vr({ 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 }) {
|
|
4125
|
+
let { locale: C } = r(Q), w = Math.max(gr(g, 0), 0), T = gr(e, 0), E = gr(t, 100), [D, O] = c(E), k = s(null), [j, M] = c(!1);
|
|
4051
4126
|
return i(() => {
|
|
4052
4127
|
let e = k.current;
|
|
4053
4128
|
if (S || !j || !e) {
|
|
@@ -4055,7 +4130,7 @@ function gr({ from: e, to: t, duration: n, delay: a, decimals: o, prefix: l, suf
|
|
|
4055
4130
|
return;
|
|
4056
4131
|
}
|
|
4057
4132
|
O(T);
|
|
4058
|
-
let t = Math.max(
|
|
4133
|
+
let t = Math.max(gr(n, 2e3), 0), r = Math.max(gr(a, 0), 0), i = mr[m] || mr.out, o = typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, s = 0, c = 0, l = !1, u = () => {
|
|
4059
4134
|
if (cancelAnimationFrame(s), clearTimeout(c), o || t === 0) {
|
|
4060
4135
|
O(E);
|
|
4061
4136
|
return;
|
|
@@ -4075,7 +4150,7 @@ function gr({ from: e, to: t, duration: n, delay: a, decimals: o, prefix: l, suf
|
|
|
4075
4150
|
let t = e.some((e) => e.isIntersecting);
|
|
4076
4151
|
t && (!l || _ === !1) ? (l = !0, u()) : !t && _ === !1 && (cancelAnimationFrame(s), clearTimeout(c), O(T));
|
|
4077
4152
|
}, {
|
|
4078
|
-
rootMargin: `0px 0px -${Math.min(w, Math.floor(
|
|
4153
|
+
rootMargin: `0px 0px -${Math.min(w, Math.floor(hr(e)))}px 0px`,
|
|
4079
4154
|
threshold: w > 0 ? 0 : .3
|
|
4080
4155
|
});
|
|
4081
4156
|
return d.observe(e), () => {
|
|
@@ -4115,7 +4190,7 @@ function gr({ from: e, to: t, duration: n, delay: a, decimals: o, prefix: l, suf
|
|
|
4115
4190
|
},
|
|
4116
4191
|
children: [
|
|
4117
4192
|
l || "",
|
|
4118
|
-
|
|
4193
|
+
_r(D, {
|
|
4119
4194
|
locale: C,
|
|
4120
4195
|
decimals: o,
|
|
4121
4196
|
separator: p
|
|
@@ -4133,7 +4208,7 @@ function gr({ from: e, to: t, duration: n, delay: a, decimals: o, prefix: l, suf
|
|
|
4133
4208
|
}) : null]
|
|
4134
4209
|
});
|
|
4135
4210
|
}
|
|
4136
|
-
function
|
|
4211
|
+
function yr({ 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 }) {
|
|
4137
4212
|
let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
|
|
4138
4213
|
b(e), typeof p == "function" && p(e);
|
|
4139
4214
|
};
|
|
@@ -4144,8 +4219,8 @@ function _r({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
4144
4219
|
}
|
|
4145
4220
|
if (!y) return;
|
|
4146
4221
|
let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
|
|
4147
|
-
let t =
|
|
4148
|
-
v(n ||
|
|
4222
|
+
let t = dr(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
4223
|
+
v(n || fr(t) > e);
|
|
4149
4224
|
};
|
|
4150
4225
|
return t(), document.addEventListener("scroll", t, {
|
|
4151
4226
|
capture: !0,
|
|
@@ -4159,7 +4234,7 @@ function _r({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
4159
4234
|
]);
|
|
4160
4235
|
let S = () => {
|
|
4161
4236
|
if (m) return;
|
|
4162
|
-
let e =
|
|
4237
|
+
let e = dr(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
4163
4238
|
e === window ? window.scrollTo({
|
|
4164
4239
|
top: 0,
|
|
4165
4240
|
behavior: n
|
|
@@ -4167,7 +4242,7 @@ function _r({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
4167
4242
|
top: 0,
|
|
4168
4243
|
behavior: n
|
|
4169
4244
|
});
|
|
4170
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
4245
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = pr[n] ? n : "bottom-right", D = h ? {
|
|
4171
4246
|
position: "fixed",
|
|
4172
4247
|
zIndex: 5,
|
|
4173
4248
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -4180,7 +4255,7 @@ function _r({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
4180
4255
|
} : {
|
|
4181
4256
|
position: "fixed",
|
|
4182
4257
|
zIndex: 2147482e3,
|
|
4183
|
-
...
|
|
4258
|
+
...pr[E](C)
|
|
4184
4259
|
};
|
|
4185
4260
|
return /* @__PURE__ */ d("button", {
|
|
4186
4261
|
ref: x,
|
|
@@ -4231,7 +4306,7 @@ function _r({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
4231
4306
|
}), w ? /* @__PURE__ */ u("span", { children: T }) : null]
|
|
4232
4307
|
});
|
|
4233
4308
|
}
|
|
4234
|
-
var
|
|
4309
|
+
var br = {
|
|
4235
4310
|
facebook: {
|
|
4236
4311
|
label: "Facebook",
|
|
4237
4312
|
color: "#1877f2",
|
|
@@ -4298,8 +4373,8 @@ var vr = {
|
|
|
4298
4373
|
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"
|
|
4299
4374
|
}
|
|
4300
4375
|
};
|
|
4301
|
-
function
|
|
4302
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
4376
|
+
function xr({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
4377
|
+
let l = Array.isArray(e) ? e.filter((e) => e && br[e.network]) : [];
|
|
4303
4378
|
if (!l.length) return null;
|
|
4304
4379
|
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;
|
|
4305
4380
|
return /* @__PURE__ */ u("div", {
|
|
@@ -4312,7 +4387,7 @@ function yr({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
4312
4387
|
...A(o)
|
|
4313
4388
|
},
|
|
4314
4389
|
children: l.map((e, r) => {
|
|
4315
|
-
let i =
|
|
4390
|
+
let i = br[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);
|
|
4316
4391
|
return /* @__PURE__ */ u("a", {
|
|
4317
4392
|
href: e.url || "#",
|
|
4318
4393
|
onClick: h,
|
|
@@ -4346,7 +4421,7 @@ function yr({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
4346
4421
|
})
|
|
4347
4422
|
});
|
|
4348
4423
|
}
|
|
4349
|
-
function
|
|
4424
|
+
function Sr({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
4350
4425
|
if (!t.length) return null;
|
|
4351
4426
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
4352
4427
|
width: 32,
|
|
@@ -4424,7 +4499,7 @@ function br({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
4424
4499
|
})
|
|
4425
4500
|
});
|
|
4426
4501
|
}
|
|
4427
|
-
var
|
|
4502
|
+
var Cr = {
|
|
4428
4503
|
small: {
|
|
4429
4504
|
w: 132,
|
|
4430
4505
|
h: 46,
|
|
@@ -4446,21 +4521,21 @@ var xr = {
|
|
|
4446
4521
|
title: 12.5,
|
|
4447
4522
|
avatar: 46
|
|
4448
4523
|
}
|
|
4449
|
-
},
|
|
4450
|
-
|
|
4451
|
-
var
|
|
4524
|
+
}, wr = (e) => Cr[e] ?? Cr.medium;
|
|
4525
|
+
Cr.medium.w, Cr.medium.h;
|
|
4526
|
+
var Tr = (e) => String(e?.group ?? "").trim(), Er = (e) => {
|
|
4452
4527
|
let t = [], n = /* @__PURE__ */ new Map();
|
|
4453
4528
|
return e.forEach((e, r) => {
|
|
4454
|
-
let i =
|
|
4529
|
+
let i = Tr(e) || `#${r}`;
|
|
4455
4530
|
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
4456
4531
|
}), t.flatMap((e) => n.get(e));
|
|
4457
4532
|
};
|
|
4458
|
-
function
|
|
4459
|
-
let i =
|
|
4533
|
+
function Dr(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
4534
|
+
let i = wr(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 = [];
|
|
4460
4535
|
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);
|
|
4461
|
-
d =
|
|
4462
|
-
for (let [e, t] of u) u.set(e,
|
|
4463
|
-
let f = (e, t) => o + (
|
|
4536
|
+
d = Er(d);
|
|
4537
|
+
for (let [e, t] of u) u.set(e, Er(t));
|
|
4538
|
+
let f = (e, t) => o + (Tr(e) !== Tr(t) && (Tr(e) || Tr(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
4464
4539
|
if (t.has(e.id)) return 0;
|
|
4465
4540
|
t.add(e.id);
|
|
4466
4541
|
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);
|
|
@@ -4476,7 +4551,7 @@ function Tr(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
4476
4551
|
x: m,
|
|
4477
4552
|
y: b
|
|
4478
4553
|
});
|
|
4479
|
-
let x =
|
|
4554
|
+
let x = Tr(e);
|
|
4480
4555
|
if (x) {
|
|
4481
4556
|
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
4482
4557
|
_.has(t) || _.set(t, {
|
|
@@ -4550,18 +4625,18 @@ function Tr(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top"
|
|
|
4550
4625
|
horizontal: n
|
|
4551
4626
|
};
|
|
4552
4627
|
}
|
|
4553
|
-
var
|
|
4628
|
+
var Or = (e, t) => {
|
|
4554
4629
|
let n = String(e ?? "");
|
|
4555
4630
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
4556
|
-
},
|
|
4631
|
+
}, kr = (e) => {
|
|
4557
4632
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
4558
4633
|
if (!t) return "#ffffff";
|
|
4559
4634
|
let n = t[1];
|
|
4560
4635
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
4561
4636
|
let r = parseInt(n, 16);
|
|
4562
4637
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
4563
|
-
},
|
|
4564
|
-
function
|
|
4638
|
+
}, Ar = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
4639
|
+
function jr(e, t = {}) {
|
|
4565
4640
|
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);
|
|
4566
4641
|
return n.map((e) => {
|
|
4567
4642
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
@@ -4577,11 +4652,11 @@ function kr(e, t = {}) {
|
|
|
4577
4652
|
};
|
|
4578
4653
|
});
|
|
4579
4654
|
}
|
|
4580
|
-
var
|
|
4655
|
+
var Mr = {
|
|
4581
4656
|
size: 36,
|
|
4582
4657
|
pad: 10
|
|
4583
4658
|
};
|
|
4584
|
-
function
|
|
4659
|
+
function Nr({ node: e, onClose: t }) {
|
|
4585
4660
|
return i(() => {
|
|
4586
4661
|
let e = (e) => e.key === "Escape" && t();
|
|
4587
4662
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -4702,7 +4777,7 @@ function jr({ node: e, onClose: t }) {
|
|
|
4702
4777
|
})
|
|
4703
4778
|
});
|
|
4704
4779
|
}
|
|
4705
|
-
function
|
|
4780
|
+
function Pr({ 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 }) {
|
|
4706
4781
|
let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(Q), O = r(et)?.[t], [k, j] = c(null);
|
|
4707
4782
|
i(() => {
|
|
4708
4783
|
if (!t || O) return;
|
|
@@ -4719,7 +4794,7 @@ function Mr({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4719
4794
|
D,
|
|
4720
4795
|
O
|
|
4721
4796
|
]);
|
|
4722
|
-
let M = t ?
|
|
4797
|
+
let M = t ? jr(O ?? k ?? [], {
|
|
4723
4798
|
nameField: n,
|
|
4724
4799
|
titleField: o,
|
|
4725
4800
|
photoField: s,
|
|
@@ -4727,7 +4802,7 @@ function Mr({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4727
4802
|
cvField: p,
|
|
4728
4803
|
hrefField: m,
|
|
4729
4804
|
groupField: h
|
|
4730
|
-
}) : e, N =
|
|
4805
|
+
}) : e, N = wr(v), { boxes: P, links: F, groups: I, width: L, height: R } = Dr(M, {
|
|
4731
4806
|
size: v,
|
|
4732
4807
|
horizontal: y,
|
|
4733
4808
|
groupTitles: g
|
|
@@ -4785,8 +4860,8 @@ function Mr({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4785
4860
|
fontSize: N.title + 1,
|
|
4786
4861
|
fontWeight: "600",
|
|
4787
4862
|
opacity: "0.55",
|
|
4788
|
-
fill: r ?
|
|
4789
|
-
children:
|
|
4863
|
+
fill: r ? kr(e.color || _) : "var(--page-text, #111827)",
|
|
4864
|
+
children: Or(e.title, Math.floor(e.width / 7))
|
|
4790
4865
|
})] }, `group-${t}`);
|
|
4791
4866
|
}),
|
|
4792
4867
|
F.map((e, t) => /* @__PURE__ */ u("path", {
|
|
@@ -4796,7 +4871,7 @@ function Mr({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4796
4871
|
strokeWidth: "1.5"
|
|
4797
4872
|
}, t)),
|
|
4798
4873
|
P.map(({ node: e, x: t, y: n }) => {
|
|
4799
|
-
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 ?
|
|
4874
|
+
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 ? kr(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? kr(e.color2) : s, f = S && (Ar(e) || e.href), p = () => Ar(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Mr.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);
|
|
4800
4875
|
return /* @__PURE__ */ d("g", {
|
|
4801
4876
|
onClick: f ? p : void 0,
|
|
4802
4877
|
style: f ? { cursor: "pointer" } : void 0,
|
|
@@ -4860,13 +4935,13 @@ function Mr({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4860
4935
|
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
4861
4936
|
id: `${C}-${e.id}`,
|
|
4862
4937
|
children: /* @__PURE__ */ u("circle", {
|
|
4863
|
-
cx: t +
|
|
4938
|
+
cx: t + Mr.pad + N.avatar / 2,
|
|
4864
4939
|
cy: n + N.h / 2,
|
|
4865
4940
|
r: N.avatar / 2
|
|
4866
4941
|
})
|
|
4867
4942
|
}), /* @__PURE__ */ u("image", {
|
|
4868
4943
|
href: e.photo,
|
|
4869
|
-
x: t +
|
|
4944
|
+
x: t + Mr.pad,
|
|
4870
4945
|
y: n + (N.h - N.avatar) / 2,
|
|
4871
4946
|
width: N.avatar,
|
|
4872
4947
|
height: N.avatar,
|
|
@@ -4880,7 +4955,7 @@ function Mr({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4880
4955
|
fontSize: N.title,
|
|
4881
4956
|
fontWeight: "600",
|
|
4882
4957
|
fill: s,
|
|
4883
|
-
children:
|
|
4958
|
+
children: Or(e.title, g + 4)
|
|
4884
4959
|
}), e.name && /* @__PURE__ */ u("text", {
|
|
4885
4960
|
x: m,
|
|
4886
4961
|
y: n + _ + _ / 2 + N.name * .35,
|
|
@@ -4888,7 +4963,7 @@ function Mr({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4888
4963
|
fontSize: N.name,
|
|
4889
4964
|
fontWeight: "600",
|
|
4890
4965
|
fill: c,
|
|
4891
|
-
children:
|
|
4966
|
+
children: Or(e.name, g)
|
|
4892
4967
|
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
4893
4968
|
x: m,
|
|
4894
4969
|
y: n + (v[1] ? N.h * .43 : N.h * .57),
|
|
@@ -4896,7 +4971,7 @@ function Mr({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4896
4971
|
fontSize: N.name,
|
|
4897
4972
|
fontWeight: "600",
|
|
4898
4973
|
fill: s,
|
|
4899
|
-
children:
|
|
4974
|
+
children: Or(v[0], g)
|
|
4900
4975
|
}), v[1] && /* @__PURE__ */ u("text", {
|
|
4901
4976
|
x: m,
|
|
4902
4977
|
y: n + N.h * .73,
|
|
@@ -4904,19 +4979,19 @@ function Mr({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4904
4979
|
fontSize: N.title,
|
|
4905
4980
|
opacity: "0.7",
|
|
4906
4981
|
fill: s,
|
|
4907
|
-
children:
|
|
4982
|
+
children: Or(v[1], g + 4)
|
|
4908
4983
|
})] })
|
|
4909
4984
|
]
|
|
4910
4985
|
}, e.id);
|
|
4911
4986
|
})
|
|
4912
4987
|
]
|
|
4913
|
-
}), w && /* @__PURE__ */ u(
|
|
4988
|
+
}), w && /* @__PURE__ */ u(Nr, {
|
|
4914
4989
|
node: w,
|
|
4915
4990
|
onClose: () => T(null)
|
|
4916
4991
|
})]
|
|
4917
4992
|
});
|
|
4918
4993
|
}
|
|
4919
|
-
function
|
|
4994
|
+
function Fr({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4920
4995
|
let [a, o] = c(!1), l = s(null);
|
|
4921
4996
|
return i(() => {
|
|
4922
4997
|
if (!a || !l.current) return;
|
|
@@ -4946,7 +5021,7 @@ function Nr({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4946
5021
|
children: e ?? ""
|
|
4947
5022
|
});
|
|
4948
5023
|
}
|
|
4949
|
-
var
|
|
5024
|
+
var Ir = 360, Lr = "\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", Rr = (e, t) => e && t ? `cell-${e}-${t}` : "", zr = (e) => {
|
|
4950
5025
|
if (!e || typeof e != "object") return e ?? "";
|
|
4951
5026
|
let t = String(e.text ?? "");
|
|
4952
5027
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ u("a", {
|
|
@@ -4957,7 +5032,7 @@ var Pr = 360, Fr = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4957
5032
|
children: t
|
|
4958
5033
|
}) : t;
|
|
4959
5034
|
};
|
|
4960
|
-
function
|
|
5035
|
+
function Br({ 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 }) {
|
|
4961
5036
|
let F = s(null), I = s(null), [L, R] = c(null), [z, B] = c(null), V = (e, t) => () => R({
|
|
4962
5037
|
r: e,
|
|
4963
5038
|
c: t
|
|
@@ -4971,7 +5046,7 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4971
5046
|
}
|
|
4972
5047
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4973
5048
|
top: r.bottom - n.top + 4,
|
|
4974
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
5049
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - Ir))
|
|
4975
5050
|
};
|
|
4976
5051
|
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4977
5052
|
}), i(() => {
|
|
@@ -4981,36 +5056,36 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4981
5056
|
};
|
|
4982
5057
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4983
5058
|
}, [P, L]);
|
|
4984
|
-
let { tenant: H, apiUrl: U } = r(Q), ee = r(et),
|
|
5059
|
+
let { tenant: H, apiUrl: U } = r(Q), ee = r(et), W = ee?.[h], te = C ? tt(ee) : 1, [ne, re] = c(null);
|
|
4985
5060
|
if (i(() => {
|
|
4986
|
-
if (!h ||
|
|
4987
|
-
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(
|
|
5061
|
+
if (!h || W) return;
|
|
5062
|
+
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(te - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4988
5063
|
return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
|
|
4989
5064
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4990
|
-
return e &&
|
|
4991
|
-
}).catch(() => e &&
|
|
5065
|
+
return e && re(n);
|
|
5066
|
+
}).catch(() => e && re([])), () => {
|
|
4992
5067
|
e = !1;
|
|
4993
5068
|
};
|
|
4994
5069
|
}, [
|
|
4995
5070
|
h,
|
|
4996
5071
|
H,
|
|
4997
5072
|
U,
|
|
4998
|
-
|
|
5073
|
+
W,
|
|
4999
5074
|
C,
|
|
5000
|
-
|
|
5075
|
+
te,
|
|
5001
5076
|
g
|
|
5002
5077
|
]), !e.length) return null;
|
|
5003
|
-
let
|
|
5078
|
+
let G = Math.max(1, Number(g) || 10), K = h ? C ? W || h.startsWith("api:") ? (W ?? ne ?? []).slice((te - 1) * G, te * G) : (ne ?? []).slice(0, G) : (W ?? ne ?? []).slice(0, G) : null, q = K ? K.map((t) => e.map((e) => ct(ot(t?.data, e.field)))) : t, ie = !!h && !(h && !W && ne === null) && q.length === 0, J = b ? {
|
|
5004
5079
|
y: 6,
|
|
5005
5080
|
x: 10
|
|
5006
5081
|
} : {
|
|
5007
5082
|
y: 10,
|
|
5008
5083
|
x: 14
|
|
5009
|
-
},
|
|
5084
|
+
}, ae = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : J.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : J.x}px`, oe = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, se = y ? { border: oe } : { borderBottom: oe }, ce = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), le = [
|
|
5010
5085
|
"left",
|
|
5011
5086
|
"center",
|
|
5012
5087
|
"right"
|
|
5013
|
-
],
|
|
5088
|
+
], ue = (t) => le.includes(e[t]?.align) ? e[t].align : "", de = (e) => ue(e) || (le.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 ? {
|
|
5014
5089
|
...pe,
|
|
5015
5090
|
maxHeight: void 0
|
|
5016
5091
|
} : pe, _e = !!P && P.rows !== !1, ve = (t) => (r) => {
|
|
@@ -5018,7 +5093,7 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
5018
5093
|
r.preventDefault(), r.stopPropagation();
|
|
5019
5094
|
let i = F.current, a = i ? i.clientWidth : 0;
|
|
5020
5095
|
if (!a) return;
|
|
5021
|
-
let o =
|
|
5096
|
+
let o = ce ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
5022
5097
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
5023
5098
|
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, P.resize(i);
|
|
5024
5099
|
}, u = () => {
|
|
@@ -5026,8 +5101,8 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
5026
5101
|
};
|
|
5027
5102
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
5028
5103
|
}, ye = /* @__PURE__ */ new Set();
|
|
5029
|
-
p &&
|
|
5030
|
-
let r = p[
|
|
5104
|
+
p && q.forEach((t, n) => e.forEach((e, t) => {
|
|
5105
|
+
let r = p[Rr(a[n], o[t])];
|
|
5031
5106
|
if (!r) return;
|
|
5032
5107
|
let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
|
|
5033
5108
|
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && ye.add(`${n + e},${t + r}`);
|
|
@@ -5050,7 +5125,7 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
5050
5125
|
},
|
|
5051
5126
|
onClick: n,
|
|
5052
5127
|
children: e
|
|
5053
|
-
}, t), X = L && L.r <
|
|
5128
|
+
}, t), X = L && L.r < q.length && L.c < e.length ? L : null, Z = (e, t) => P?.labels?.[e] ?? t, xe = X ? p?.[Rr(a[X.r], o[X.c])] : null, Se = Math.max(1, Number(xe?.c) || 1), Ce = Math.max(1, Number(xe?.r) || 1);
|
|
5054
5129
|
return /* @__PURE__ */ d("div", {
|
|
5055
5130
|
ref: (e) => {
|
|
5056
5131
|
I.current = e, typeof N == "function" && N(e);
|
|
@@ -5061,7 +5136,7 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
5061
5136
|
...ge
|
|
5062
5137
|
},
|
|
5063
5138
|
children: [
|
|
5064
|
-
P && /* @__PURE__ */ u("style", { children:
|
|
5139
|
+
P && /* @__PURE__ */ u("style", { children: Lr }),
|
|
5065
5140
|
P && X && z && /* @__PURE__ */ d("div", {
|
|
5066
5141
|
className: "wb-tedit-bar",
|
|
5067
5142
|
style: {
|
|
@@ -5077,8 +5152,8 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
5077
5152
|
Y("+↑", Z("rowAbove", "Insert row above"), () => P.addRow(X.r - 1)),
|
|
5078
5153
|
Y("+↓", Z("rowBelow", "Insert row below"), () => P.addRow(X.r)),
|
|
5079
5154
|
Y("↑", Z("rowUp", "Move row up"), () => P.moveRow(X.r, -1), X.r === 0),
|
|
5080
|
-
Y("↓", Z("rowDown", "Move row down"), () => P.moveRow(X.r, 1), X.r >=
|
|
5081
|
-
Y("✕ row", Z("rowDelete", "Delete row"), () => P.dropRow(X.r),
|
|
5155
|
+
Y("↓", Z("rowDown", "Move row down"), () => P.moveRow(X.r, 1), X.r >= q.length - 1),
|
|
5156
|
+
Y("✕ row", Z("rowDelete", "Delete row"), () => P.dropRow(X.r), q.length <= 1),
|
|
5082
5157
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
5083
5158
|
Y("+←", Z("colLeft", "Insert column left"), () => P.addColumn(X.c - 1)),
|
|
5084
5159
|
Y("+→", Z("colRight", "Insert column right"), () => P.addColumn(X.c)),
|
|
@@ -5087,7 +5162,7 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
5087
5162
|
Y("✕ col", Z("colDelete", "Delete column"), () => P.dropColumn(X.c), e.length <= 1),
|
|
5088
5163
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
5089
5164
|
Y("↔", Z("mergeRight", "Merge with the cell on the right"), () => P.merge(X.r, X.c, "right"), X.c + Se >= e.length),
|
|
5090
|
-
Y("↕", Z("mergeDown", "Merge with the cell below"), () => P.merge(X.r, X.c, "down"), X.r + Ce >=
|
|
5165
|
+
Y("↕", Z("mergeDown", "Merge with the cell below"), () => P.merge(X.r, X.c, "down"), X.r + Ce >= q.length),
|
|
5091
5166
|
Y("⤫", Z("split", "Split this cell"), () => P.split(X.r, X.c), Se === 1 && Ce === 1)
|
|
5092
5167
|
]
|
|
5093
5168
|
}),
|
|
@@ -5107,17 +5182,17 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
5107
5182
|
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
5108
5183
|
borderSpacing: 0,
|
|
5109
5184
|
fontSize: 14,
|
|
5110
|
-
...
|
|
5111
|
-
...y ? { border:
|
|
5185
|
+
...ce ? { tableLayout: "fixed" } : null,
|
|
5186
|
+
...y ? { border: oe } : {}
|
|
5112
5187
|
},
|
|
5113
5188
|
children: [
|
|
5114
|
-
|
|
5189
|
+
ce && /* @__PURE__ */ u("colgroup", { children: n.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
|
|
5115
5190
|
_ === !1 ? null : /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((t, n) => /* @__PURE__ */ u("th", {
|
|
5116
5191
|
className: P ? "wb-tedit-head" : void 0,
|
|
5117
5192
|
style: {
|
|
5118
5193
|
textAlign: de(n),
|
|
5119
5194
|
fontWeight: 600,
|
|
5120
|
-
padding:
|
|
5195
|
+
padding: ae,
|
|
5121
5196
|
...typeof D == "string" && D ? { color: D } : null,
|
|
5122
5197
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
5123
5198
|
...T ? {
|
|
@@ -5125,9 +5200,9 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
5125
5200
|
top: 0,
|
|
5126
5201
|
zIndex: 2
|
|
5127
5202
|
} : P ? { position: "relative" } : null,
|
|
5128
|
-
...
|
|
5203
|
+
...se
|
|
5129
5204
|
},
|
|
5130
|
-
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(
|
|
5205
|
+
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(Fr, {
|
|
5131
5206
|
value: t.label ?? t,
|
|
5132
5207
|
onCommit: (e) => P.header(n, e),
|
|
5133
5208
|
hint: Z("editCell", "Double-click to edit"),
|
|
@@ -5138,16 +5213,16 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
5138
5213
|
onPointerDown: ve(n)
|
|
5139
5214
|
})] }) : t.label ?? t
|
|
5140
5215
|
}, n)) }) }),
|
|
5141
|
-
/* @__PURE__ */ d("tbody", { children: [
|
|
5216
|
+
/* @__PURE__ */ d("tbody", { children: [ie && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
5142
5217
|
colSpan: e.length,
|
|
5143
5218
|
style: {
|
|
5144
|
-
padding:
|
|
5219
|
+
padding: ae,
|
|
5145
5220
|
textAlign: "center",
|
|
5146
5221
|
opacity: .6,
|
|
5147
|
-
...
|
|
5222
|
+
...se
|
|
5148
5223
|
},
|
|
5149
5224
|
children: w || "No data yet"
|
|
5150
|
-
}) }),
|
|
5225
|
+
}) }), q.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
5151
5226
|
className: P ? "wb-tedit-row" : void 0,
|
|
5152
5227
|
style: {
|
|
5153
5228
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
@@ -5155,7 +5230,7 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
5155
5230
|
},
|
|
5156
5231
|
children: e.map((e, r) => {
|
|
5157
5232
|
if (ye.has(`${n},${r}`)) return null;
|
|
5158
|
-
let i =
|
|
5233
|
+
let i = Rr(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);
|
|
5159
5234
|
return /* @__PURE__ */ d("td", {
|
|
5160
5235
|
className: P ? `wb-tedit-cell${L?.r === n && L?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
|
|
5161
5236
|
onMouseDownCapture: _e ? V(n, r) : void 0,
|
|
@@ -5163,12 +5238,12 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
5163
5238
|
colSpan: l > 1 ? l : void 0,
|
|
5164
5239
|
rowSpan: f > 1 ? f : void 0,
|
|
5165
5240
|
style: {
|
|
5166
|
-
padding:
|
|
5167
|
-
...
|
|
5241
|
+
padding: ae,
|
|
5242
|
+
...ue(r) ? { textAlign: ue(r) } : null,
|
|
5168
5243
|
...P ? { position: "relative" } : null,
|
|
5169
|
-
...
|
|
5244
|
+
...se
|
|
5170
5245
|
},
|
|
5171
|
-
children: [s ??
|
|
5246
|
+
children: [s ?? zr(t?.[r]), P && _e && /* @__PURE__ */ u("span", {
|
|
5172
5247
|
className: "wb-tedit-rowgrip",
|
|
5173
5248
|
title: Z("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
5174
5249
|
onPointerDown: be(n),
|
|
@@ -5183,7 +5258,7 @@ function Rr({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
5183
5258
|
]
|
|
5184
5259
|
});
|
|
5185
5260
|
}
|
|
5186
|
-
var
|
|
5261
|
+
var Vr = {
|
|
5187
5262
|
small: {
|
|
5188
5263
|
cell: 62,
|
|
5189
5264
|
font: 10.5,
|
|
@@ -5208,8 +5283,8 @@ var zr = {
|
|
|
5208
5283
|
pad: 8,
|
|
5209
5284
|
gap: 4
|
|
5210
5285
|
}
|
|
5211
|
-
},
|
|
5212
|
-
function
|
|
5286
|
+
}, Hr = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, Ur = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Wr = 366;
|
|
5287
|
+
function Gr(e, t = {}) {
|
|
5213
5288
|
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) => {
|
|
5214
5289
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
5215
5290
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
@@ -5226,7 +5301,7 @@ function Ur(e, t = {}) {
|
|
|
5226
5301
|
} : null;
|
|
5227
5302
|
}).filter(Boolean);
|
|
5228
5303
|
}
|
|
5229
|
-
function
|
|
5304
|
+
function Kr(e) {
|
|
5230
5305
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
5231
5306
|
let n = e?.start ? new Date(e.start) : null;
|
|
5232
5307
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -5241,19 +5316,19 @@ function Wr(e) {
|
|
|
5241
5316
|
};
|
|
5242
5317
|
}).filter(Boolean);
|
|
5243
5318
|
}
|
|
5244
|
-
function
|
|
5319
|
+
function qr(e) {
|
|
5245
5320
|
let t = /* @__PURE__ */ new Map();
|
|
5246
5321
|
for (let n of e) {
|
|
5247
|
-
let e =
|
|
5322
|
+
let e = Ur(n.start), r = n.end ? Ur(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Wr);
|
|
5248
5323
|
for (let r = 0; r <= i; r += 1) {
|
|
5249
|
-
let i =
|
|
5324
|
+
let i = Hr(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
5250
5325
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
5251
5326
|
}
|
|
5252
5327
|
}
|
|
5253
5328
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
5254
5329
|
return t;
|
|
5255
5330
|
}
|
|
5256
|
-
function
|
|
5331
|
+
function Jr({ 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 }) {
|
|
5257
5332
|
let { tenant: T, apiUrl: E, locale: D } = r(Q), O = r(et)?.[t], [k, j] = c(null), [M, N] = c(() => {
|
|
5258
5333
|
let e = /* @__PURE__ */ new Date();
|
|
5259
5334
|
return {
|
|
@@ -5276,13 +5351,13 @@ function Kr({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
5276
5351
|
E,
|
|
5277
5352
|
O
|
|
5278
5353
|
]);
|
|
5279
|
-
let P =
|
|
5354
|
+
let P = Vr[m] ?? Vr.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 ? Gr(O ?? k ?? [], {
|
|
5280
5355
|
titleField: n,
|
|
5281
5356
|
startField: a,
|
|
5282
5357
|
endField: o,
|
|
5283
5358
|
hrefField: s,
|
|
5284
5359
|
colorField: f
|
|
5285
|
-
}) :
|
|
5360
|
+
}) : Kr(e), B = qr(z), V = D || void 0, H = (e, t) => {
|
|
5286
5361
|
let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
|
|
5287
5362
|
width: 6,
|
|
5288
5363
|
height: 6,
|
|
@@ -5329,7 +5404,7 @@ function Kr({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
5329
5404
|
year: n.getFullYear(),
|
|
5330
5405
|
month: n.getMonth()
|
|
5331
5406
|
};
|
|
5332
|
-
}),
|
|
5407
|
+
}), W = (e, t) => /* @__PURE__ */ u("button", {
|
|
5333
5408
|
type: "button",
|
|
5334
5409
|
"aria-label": e,
|
|
5335
5410
|
onClick: () => ee(t),
|
|
@@ -5344,7 +5419,7 @@ function Kr({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
5344
5419
|
padding: "4px 8px"
|
|
5345
5420
|
},
|
|
5346
5421
|
children: t < 0 ? "‹" : "›"
|
|
5347
|
-
}),
|
|
5422
|
+
}), te = /* @__PURE__ */ d("div", {
|
|
5348
5423
|
style: {
|
|
5349
5424
|
display: "flex",
|
|
5350
5425
|
alignItems: "center",
|
|
@@ -5361,8 +5436,8 @@ function Kr({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
5361
5436
|
},
|
|
5362
5437
|
children: U
|
|
5363
5438
|
}),
|
|
5364
|
-
|
|
5365
|
-
|
|
5439
|
+
W("Previous month", -1),
|
|
5440
|
+
W("Next month", 1)
|
|
5366
5441
|
]
|
|
5367
5442
|
});
|
|
5368
5443
|
if (p === "list") {
|
|
@@ -5378,7 +5453,7 @@ function Kr({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
5378
5453
|
width: "100%",
|
|
5379
5454
|
...A(S)
|
|
5380
5455
|
},
|
|
5381
|
-
children: [
|
|
5456
|
+
children: [te, e.length ? /* @__PURE__ */ u("div", {
|
|
5382
5457
|
style: {
|
|
5383
5458
|
display: "flex",
|
|
5384
5459
|
flexDirection: "column",
|
|
@@ -5414,10 +5489,10 @@ function Kr({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
5414
5489
|
})]
|
|
5415
5490
|
});
|
|
5416
5491
|
}
|
|
5417
|
-
let
|
|
5418
|
-
for (let e = 0; e <
|
|
5419
|
-
let t = e -
|
|
5420
|
-
|
|
5492
|
+
let ne = new Date(M.year, M.month, 1), re = y === "sunday" ? 0 : 1, G = (ne.getDay() - re + 7) % 7, K = new Date(M.year, M.month + 1, 0).getDate(), q = Math.ceil((G + K) / 7), ie = Hr(/* @__PURE__ */ new Date()), J = new Intl.DateTimeFormat(V, { weekday: "short" }), ae = [];
|
|
5493
|
+
for (let e = 0; e < q * 7; e += 1) {
|
|
5494
|
+
let t = e - G + 1, n = t >= 1 && t <= K, r = Hr(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ie;
|
|
5495
|
+
ae.push(/* @__PURE__ */ d("div", {
|
|
5421
5496
|
style: {
|
|
5422
5497
|
minHeight: P.cell,
|
|
5423
5498
|
borderTop: `1px solid ${I}`,
|
|
@@ -5460,7 +5535,7 @@ function Kr({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
5460
5535
|
...A(S)
|
|
5461
5536
|
},
|
|
5462
5537
|
children: [
|
|
5463
|
-
|
|
5538
|
+
te,
|
|
5464
5539
|
/* @__PURE__ */ d("div", {
|
|
5465
5540
|
style: {
|
|
5466
5541
|
display: "grid",
|
|
@@ -5474,19 +5549,19 @@ function Kr({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
5474
5549
|
textAlign: "center",
|
|
5475
5550
|
padding: `0 0 ${P.pad}px`
|
|
5476
5551
|
},
|
|
5477
|
-
children:
|
|
5478
|
-
}, `head-${t}`)),
|
|
5552
|
+
children: J.format(new Date(2024, 0, 7 + re + t))
|
|
5553
|
+
}, `head-${t}`)), ae]
|
|
5479
5554
|
}),
|
|
5480
5555
|
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
5481
5556
|
]
|
|
5482
5557
|
});
|
|
5483
5558
|
}
|
|
5484
|
-
var
|
|
5559
|
+
var Yr = {
|
|
5485
5560
|
small: 36,
|
|
5486
5561
|
medium: 56,
|
|
5487
5562
|
large: 88
|
|
5488
5563
|
};
|
|
5489
|
-
function
|
|
5564
|
+
function Xr(e, t = {}) {
|
|
5490
5565
|
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : ct(e);
|
|
5491
5566
|
return n.map((e) => {
|
|
5492
5567
|
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);
|
|
@@ -5497,8 +5572,8 @@ function Jr(e, t = {}) {
|
|
|
5497
5572
|
};
|
|
5498
5573
|
}).filter((e) => e.src);
|
|
5499
5574
|
}
|
|
5500
|
-
function
|
|
5501
|
-
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), [
|
|
5575
|
+
function Zr({ 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 }) {
|
|
5576
|
+
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), [W, te] = c(!1);
|
|
5502
5577
|
i(() => {
|
|
5503
5578
|
if (!t || k) return;
|
|
5504
5579
|
let e = !0;
|
|
@@ -5515,7 +5590,7 @@ function Yr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5515
5590
|
k
|
|
5516
5591
|
]), i(() => {
|
|
5517
5592
|
if (typeof window > "u" || !window.matchMedia) return;
|
|
5518
|
-
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () =>
|
|
5593
|
+
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => te(e.matches);
|
|
5519
5594
|
return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
|
|
5520
5595
|
}, []), i(() => {
|
|
5521
5596
|
let e = P.current;
|
|
@@ -5528,7 +5603,7 @@ function Yr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5528
5603
|
let e = N.current;
|
|
5529
5604
|
if (!e) return;
|
|
5530
5605
|
let t = !0, n = () => {
|
|
5531
|
-
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight *
|
|
5606
|
+
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * G);
|
|
5532
5607
|
t && n.length && R(Math.ceil(Math.max(...n)));
|
|
5533
5608
|
};
|
|
5534
5609
|
n();
|
|
@@ -5537,12 +5612,12 @@ function Yr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5537
5612
|
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
5538
5613
|
};
|
|
5539
5614
|
});
|
|
5540
|
-
let
|
|
5615
|
+
let ne = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], re = t ? Xr(k ?? j ?? [], {
|
|
5541
5616
|
imageField: n,
|
|
5542
5617
|
nameField: a,
|
|
5543
5618
|
hrefField: o
|
|
5544
|
-
}) :
|
|
5545
|
-
if (!
|
|
5619
|
+
}) : ne, G = Yr[p] ?? Yr.medium, K = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ie = f === "marquee" ? "step" : f, J = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), ae = Math.min(3e3, Math.max(100, Number(_) || 500)), oe = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), se = (L || G * 3) + K, ce = F ? Math.max(1, Math.floor(F / se)) : oe, le = Math.min(oe, ce), ue = F ? Math.min(se, F / le) : se;
|
|
5620
|
+
if (!re.length) return /* @__PURE__ */ u("div", {
|
|
5546
5621
|
ref: T,
|
|
5547
5622
|
style: {
|
|
5548
5623
|
width: "100%",
|
|
@@ -5554,7 +5629,7 @@ function Yr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5554
5629
|
alignItems: "center",
|
|
5555
5630
|
justifyContent: "center",
|
|
5556
5631
|
flexWrap: "wrap",
|
|
5557
|
-
gap:
|
|
5632
|
+
gap: K
|
|
5558
5633
|
},
|
|
5559
5634
|
children: [
|
|
5560
5635
|
0,
|
|
@@ -5564,16 +5639,16 @@ function Yr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5564
5639
|
4
|
|
5565
5640
|
].map((e) => /* @__PURE__ */ u("div", {
|
|
5566
5641
|
style: {
|
|
5567
|
-
height:
|
|
5568
|
-
width:
|
|
5642
|
+
height: G,
|
|
5643
|
+
width: G * 3,
|
|
5569
5644
|
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
5570
5645
|
borderRadius: 6,
|
|
5571
5646
|
display: "flex",
|
|
5572
5647
|
alignItems: "center",
|
|
5573
5648
|
justifyContent: "center",
|
|
5574
|
-
fontSize: Math.max(10, Math.round(
|
|
5649
|
+
fontSize: Math.max(10, Math.round(G / 4)),
|
|
5575
5650
|
opacity: .45,
|
|
5576
|
-
...
|
|
5651
|
+
...q
|
|
5577
5652
|
},
|
|
5578
5653
|
children: "LOGO"
|
|
5579
5654
|
}, e))
|
|
@@ -5587,21 +5662,21 @@ function Yr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5587
5662
|
children: C
|
|
5588
5663
|
}) : null
|
|
5589
5664
|
});
|
|
5590
|
-
let de =
|
|
5665
|
+
let de = re.length, fe = ie === "step" && de > le, pe = ie === "slider", me = fe && !E && !U && !W, he = v === "right", ge = he ? de : 0, _e = fe ? [...re, ...re] : re, ve = fe ? z * ue : 0, ye = (e, t, n) => {
|
|
5591
5666
|
let r = /* @__PURE__ */ u("img", {
|
|
5592
5667
|
src: e.src,
|
|
5593
5668
|
alt: e.alt ?? "",
|
|
5594
5669
|
style: {
|
|
5595
|
-
height:
|
|
5670
|
+
height: G,
|
|
5596
5671
|
width: "auto",
|
|
5597
5672
|
maxWidth: "100%",
|
|
5598
5673
|
objectFit: "contain",
|
|
5599
5674
|
display: "block"
|
|
5600
5675
|
}
|
|
5601
5676
|
}), i = fe ? {
|
|
5602
|
-
width:
|
|
5677
|
+
width: ue,
|
|
5603
5678
|
flex: "0 0 auto",
|
|
5604
|
-
padding: `0 ${
|
|
5679
|
+
padding: `0 ${K / 2}px`,
|
|
5605
5680
|
justifyContent: "center"
|
|
5606
5681
|
} : {};
|
|
5607
5682
|
return e.href && !E ? /* @__PURE__ */ u("a", {
|
|
@@ -5631,16 +5706,16 @@ function Yr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5631
5706
|
display: "flex",
|
|
5632
5707
|
alignItems: "center",
|
|
5633
5708
|
...fe ? {
|
|
5634
|
-
width: _e.length *
|
|
5709
|
+
width: _e.length * ue,
|
|
5635
5710
|
transform: `translateX(-${ve}px)`,
|
|
5636
|
-
transition: V ? `transform ${
|
|
5711
|
+
transition: V ? `transform ${ae}ms ease` : "none"
|
|
5637
5712
|
} : pe ? {
|
|
5638
|
-
gap:
|
|
5713
|
+
gap: K,
|
|
5639
5714
|
overflowX: "auto",
|
|
5640
5715
|
scrollBehavior: "smooth",
|
|
5641
5716
|
scrollSnapType: "x proximity"
|
|
5642
5717
|
} : {
|
|
5643
|
-
gap:
|
|
5718
|
+
gap: K,
|
|
5644
5719
|
flexWrap: "wrap",
|
|
5645
5720
|
justifyContent: "center"
|
|
5646
5721
|
}
|
|
@@ -5709,7 +5784,7 @@ function Yr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5709
5784
|
fe ? /* @__PURE__ */ d("div", {
|
|
5710
5785
|
style: {
|
|
5711
5786
|
position: "relative",
|
|
5712
|
-
width:
|
|
5787
|
+
width: le * ue,
|
|
5713
5788
|
maxWidth: "100%",
|
|
5714
5789
|
margin: "0 auto"
|
|
5715
5790
|
},
|
|
@@ -5726,10 +5801,10 @@ function Yr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5726
5801
|
be,
|
|
5727
5802
|
Z ? xe(1) : null
|
|
5728
5803
|
] }),
|
|
5729
|
-
/* @__PURE__ */ u(
|
|
5804
|
+
/* @__PURE__ */ u(Qr, {
|
|
5730
5805
|
running: me,
|
|
5731
|
-
every:
|
|
5732
|
-
slide:
|
|
5806
|
+
every: J + ae,
|
|
5807
|
+
slide: ae,
|
|
5733
5808
|
step: he ? -1 : 1,
|
|
5734
5809
|
index: z,
|
|
5735
5810
|
total: de,
|
|
@@ -5740,7 +5815,7 @@ function Yr({ logos: e = [], source: t = "", imageField: n = "", nameField: a =
|
|
|
5740
5815
|
]
|
|
5741
5816
|
});
|
|
5742
5817
|
}
|
|
5743
|
-
function
|
|
5818
|
+
function Qr({ running: e, every: t, slide: n, step: r, index: a, total: o, home: s, setIndex: c, setAnimate: l }) {
|
|
5744
5819
|
i(() => {
|
|
5745
5820
|
if (!e) return;
|
|
5746
5821
|
let n = setInterval(() => {
|
|
@@ -5776,13 +5851,13 @@ function Xr({ running: e, every: t, slide: n, step: r, index: a, total: o, home:
|
|
|
5776
5851
|
l
|
|
5777
5852
|
]), null;
|
|
5778
5853
|
}
|
|
5779
|
-
var
|
|
5854
|
+
var $r = {
|
|
5780
5855
|
small: 380,
|
|
5781
5856
|
medium: 560,
|
|
5782
5857
|
large: 820,
|
|
5783
5858
|
full: "100%"
|
|
5784
5859
|
};
|
|
5785
|
-
function
|
|
5860
|
+
function ei({ 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 }) {
|
|
5786
5861
|
let [C, w] = c(!1), T = s(null);
|
|
5787
5862
|
i(() => {
|
|
5788
5863
|
if (S || !e) return;
|
|
@@ -5807,7 +5882,7 @@ function Qr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5807
5882
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
5808
5883
|
};
|
|
5809
5884
|
}, [S, C]);
|
|
5810
|
-
let E =
|
|
5885
|
+
let E = $r[o] ?? $r.medium, D = (e) => {
|
|
5811
5886
|
let t = {
|
|
5812
5887
|
padding: "9px 16px",
|
|
5813
5888
|
borderRadius: 6,
|
|
@@ -5976,7 +6051,7 @@ function Qr({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
5976
6051
|
})]
|
|
5977
6052
|
});
|
|
5978
6053
|
}
|
|
5979
|
-
function
|
|
6054
|
+
function ti({ 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 }) {
|
|
5980
6055
|
let [_, v] = c(!1), y = s(null), b = s(null), x = r !== "click", S = () => {
|
|
5981
6056
|
b.current && clearTimeout(b.current), b.current = null;
|
|
5982
6057
|
}, C = () => {
|
|
@@ -6077,13 +6152,13 @@ function $r({ dropdownId: e = "", trigger: t = "button", triggerLabel: n = "Menu
|
|
|
6077
6152
|
}), E]
|
|
6078
6153
|
});
|
|
6079
6154
|
}
|
|
6080
|
-
var
|
|
6155
|
+
var ni = {
|
|
6081
6156
|
PageRoot: yt,
|
|
6082
6157
|
MarkdownBlock: Rt,
|
|
6083
|
-
CalendarBlock:
|
|
6084
|
-
LogoCarousel:
|
|
6085
|
-
DialogBlock:
|
|
6086
|
-
DropdownBlock:
|
|
6158
|
+
CalendarBlock: Jr,
|
|
6159
|
+
LogoCarousel: Zr,
|
|
6160
|
+
DialogBlock: ei,
|
|
6161
|
+
DropdownBlock: ti,
|
|
6087
6162
|
Section: bt,
|
|
6088
6163
|
Container: xt,
|
|
6089
6164
|
LinkBlock: St,
|
|
@@ -6091,29 +6166,29 @@ var ei = {
|
|
|
6091
6166
|
TextBlock: Ht,
|
|
6092
6167
|
ButtonBlock: Kt,
|
|
6093
6168
|
ImageBlock: qt,
|
|
6094
|
-
Spacer:
|
|
6095
|
-
Divider:
|
|
6096
|
-
BoxBlock:
|
|
6097
|
-
SliderBlock:
|
|
6098
|
-
CanvasSlider:
|
|
6099
|
-
TabsBlock:
|
|
6100
|
-
QuickStack:
|
|
6101
|
-
CollectionList:
|
|
6102
|
-
CollectionSearch:
|
|
6103
|
-
BreadcrumbsBlock:
|
|
6104
|
-
PaginationBlock:
|
|
6105
|
-
StepperBlock:
|
|
6106
|
-
SocialLinksBlock:
|
|
6107
|
-
ThemeModeBlock:
|
|
6108
|
-
ScrollTopBlock:
|
|
6109
|
-
CounterBlock:
|
|
6110
|
-
OrgChartBlock:
|
|
6111
|
-
TableBlock:
|
|
6112
|
-
IconBlock:
|
|
6113
|
-
MapBlock:
|
|
6114
|
-
MasonryBlock:
|
|
6115
|
-
AccordionBlock:
|
|
6116
|
-
NavbarBlock:
|
|
6169
|
+
Spacer: rn,
|
|
6170
|
+
Divider: an,
|
|
6171
|
+
BoxBlock: on,
|
|
6172
|
+
SliderBlock: fn,
|
|
6173
|
+
CanvasSlider: pn,
|
|
6174
|
+
TabsBlock: kn,
|
|
6175
|
+
QuickStack: tr,
|
|
6176
|
+
CollectionList: nr,
|
|
6177
|
+
CollectionSearch: rr,
|
|
6178
|
+
BreadcrumbsBlock: ir,
|
|
6179
|
+
PaginationBlock: ar,
|
|
6180
|
+
StepperBlock: Sr,
|
|
6181
|
+
SocialLinksBlock: xr,
|
|
6182
|
+
ThemeModeBlock: ur,
|
|
6183
|
+
ScrollTopBlock: yr,
|
|
6184
|
+
CounterBlock: vr,
|
|
6185
|
+
OrgChartBlock: Pr,
|
|
6186
|
+
TableBlock: Br,
|
|
6187
|
+
IconBlock: Sn,
|
|
6188
|
+
MapBlock: bn,
|
|
6189
|
+
MasonryBlock: wn,
|
|
6190
|
+
AccordionBlock: An,
|
|
6191
|
+
NavbarBlock: On,
|
|
6117
6192
|
ListBlock: Vt,
|
|
6118
6193
|
TextSpan: Ot,
|
|
6119
6194
|
QuoteBlock: Bt,
|
|
@@ -6123,56 +6198,57 @@ var ei = {
|
|
|
6123
6198
|
VideoBlock: Jt,
|
|
6124
6199
|
YouTubeBlock: Xt,
|
|
6125
6200
|
IframeBlock: Zt,
|
|
6126
|
-
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6131
|
-
|
|
6201
|
+
PdfBlock: $t,
|
|
6202
|
+
EmbedBlock: nn,
|
|
6203
|
+
FormBlock: Un,
|
|
6204
|
+
FormLabel: Jn,
|
|
6205
|
+
FormInput: Yn,
|
|
6206
|
+
FormTextarea: Xn,
|
|
6207
|
+
FormCheckbox: (e) => /* @__PURE__ */ u(Zn, {
|
|
6132
6208
|
kind: "checkbox",
|
|
6133
6209
|
...e
|
|
6134
6210
|
}),
|
|
6135
|
-
FormRadio: (e) => /* @__PURE__ */ u(
|
|
6211
|
+
FormRadio: (e) => /* @__PURE__ */ u(Zn, {
|
|
6136
6212
|
kind: "radio",
|
|
6137
6213
|
...e
|
|
6138
6214
|
}),
|
|
6139
|
-
FormSelect:
|
|
6140
|
-
FormFile:
|
|
6141
|
-
FormRecaptcha:
|
|
6142
|
-
FormSubmit:
|
|
6143
|
-
},
|
|
6215
|
+
FormSelect: Qn,
|
|
6216
|
+
FormFile: $n,
|
|
6217
|
+
FormRecaptcha: qn,
|
|
6218
|
+
FormSubmit: er
|
|
6219
|
+
}, ri = {
|
|
6144
6220
|
id: "auth",
|
|
6145
6221
|
label: "Accounts",
|
|
6146
6222
|
category: "Apps",
|
|
6147
6223
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
6148
6224
|
ssr: "shell",
|
|
6149
6225
|
settings: ["site.authRedirect"]
|
|
6150
|
-
},
|
|
6226
|
+
}, ii = t({
|
|
6151
6227
|
user: null,
|
|
6152
6228
|
status: "idle",
|
|
6153
6229
|
ensure: () => {},
|
|
6154
6230
|
refresh: () => {},
|
|
6155
6231
|
signOut: () => {}
|
|
6156
6232
|
});
|
|
6157
|
-
function
|
|
6233
|
+
function ai(e, t) {
|
|
6158
6234
|
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
6159
6235
|
}
|
|
6160
|
-
function
|
|
6236
|
+
function oi(e) {
|
|
6161
6237
|
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);
|
|
6162
6238
|
return {
|
|
6163
6239
|
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
6164
6240
|
url: i,
|
|
6165
6241
|
mePath: a,
|
|
6166
6242
|
logoutPath: o,
|
|
6167
|
-
meUrl:
|
|
6168
|
-
logoutUrl:
|
|
6243
|
+
meUrl: ai(i, a),
|
|
6244
|
+
logoutUrl: ai(i, o),
|
|
6169
6245
|
loginPage: r(n.loginPage),
|
|
6170
6246
|
userPath: r(n.userPath),
|
|
6171
6247
|
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
6172
6248
|
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
6173
6249
|
};
|
|
6174
6250
|
}
|
|
6175
|
-
function
|
|
6251
|
+
function si(e, t) {
|
|
6176
6252
|
if (!t) return e ?? null;
|
|
6177
6253
|
let n = e;
|
|
6178
6254
|
for (let e of t.split(".")) {
|
|
@@ -6181,26 +6257,26 @@ function ai(e, t) {
|
|
|
6181
6257
|
}
|
|
6182
6258
|
return n ?? null;
|
|
6183
6259
|
}
|
|
6184
|
-
function
|
|
6260
|
+
function ci(e) {
|
|
6185
6261
|
try {
|
|
6186
6262
|
return window.localStorage.getItem(e) || "";
|
|
6187
6263
|
} catch {
|
|
6188
6264
|
return "";
|
|
6189
6265
|
}
|
|
6190
6266
|
}
|
|
6191
|
-
function
|
|
6267
|
+
function li(e) {
|
|
6192
6268
|
try {
|
|
6193
6269
|
window.localStorage.removeItem(e);
|
|
6194
6270
|
} catch {}
|
|
6195
6271
|
}
|
|
6196
|
-
var
|
|
6197
|
-
let e = r(
|
|
6272
|
+
var ui = () => {
|
|
6273
|
+
let e = r(ii);
|
|
6198
6274
|
return i(() => {
|
|
6199
6275
|
e.ensure();
|
|
6200
6276
|
}, [e]), e;
|
|
6201
6277
|
};
|
|
6202
|
-
function
|
|
6203
|
-
let f = r(Q), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() =>
|
|
6278
|
+
function di({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
|
|
6279
|
+
let f = r(Q), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => oi(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}`, {
|
|
6204
6280
|
...t,
|
|
6205
6281
|
credentials: "include",
|
|
6206
6282
|
headers: {
|
|
@@ -6212,9 +6288,9 @@ function li({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
6212
6288
|
if (a) return Promise.resolve(null);
|
|
6213
6289
|
if (h.mode === "off") return Promise.resolve(S(null));
|
|
6214
6290
|
if (h.mode === "custom") {
|
|
6215
|
-
let e = h.auth === "bearer" ?
|
|
6291
|
+
let e = h.auth === "bearer" ? ci(h.tokenKey) : "";
|
|
6216
6292
|
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) => {
|
|
6217
|
-
let t =
|
|
6293
|
+
let t = si(e, h.userPath);
|
|
6218
6294
|
return S(t && typeof t == "object" ? t : null);
|
|
6219
6295
|
}).catch(() => S(null));
|
|
6220
6296
|
}
|
|
@@ -6227,12 +6303,12 @@ function li({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
6227
6303
|
]), w = n(() => {
|
|
6228
6304
|
if (h.mode === "off") return S(null), Promise.resolve();
|
|
6229
6305
|
if (h.mode === "custom") {
|
|
6230
|
-
let e = h.auth === "bearer" ?
|
|
6306
|
+
let e = h.auth === "bearer" ? ci(h.tokenKey) : "";
|
|
6231
6307
|
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
6232
6308
|
method: "post",
|
|
6233
6309
|
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
6234
6310
|
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
6235
|
-
h.auth === "bearer" &&
|
|
6311
|
+
h.auth === "bearer" && li(h.tokenKey), S(null);
|
|
6236
6312
|
});
|
|
6237
6313
|
}
|
|
6238
6314
|
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
@@ -6282,18 +6358,18 @@ function li({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
6282
6358
|
h.loginPage,
|
|
6283
6359
|
C,
|
|
6284
6360
|
w
|
|
6285
|
-
]), /* @__PURE__ */ u(
|
|
6361
|
+
]), /* @__PURE__ */ u(ii.Provider, {
|
|
6286
6362
|
value: E,
|
|
6287
6363
|
children: e
|
|
6288
6364
|
});
|
|
6289
6365
|
}
|
|
6290
|
-
function
|
|
6291
|
-
let { status: n } =
|
|
6366
|
+
function fi({ when: e, children: t }) {
|
|
6367
|
+
let { status: n } = ui();
|
|
6292
6368
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
6293
6369
|
}
|
|
6294
6370
|
//#endregion
|
|
6295
6371
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
6296
|
-
function
|
|
6372
|
+
function pi({ 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 }) {
|
|
6297
6373
|
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) => {
|
|
6298
6374
|
if (e.preventDefault(), f) return;
|
|
6299
6375
|
let n = new FormData(e.currentTarget);
|
|
@@ -6342,20 +6418,20 @@ function di({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
6342
6418
|
children: [
|
|
6343
6419
|
w ? /* @__PURE__ */ d("label", {
|
|
6344
6420
|
style: {
|
|
6345
|
-
...
|
|
6421
|
+
...Mn,
|
|
6346
6422
|
display: "grid",
|
|
6347
6423
|
gap: 6
|
|
6348
6424
|
},
|
|
6349
6425
|
children: [a, /* @__PURE__ */ u("input", {
|
|
6350
6426
|
name: "name",
|
|
6351
6427
|
type: "text",
|
|
6352
|
-
style:
|
|
6353
|
-
...
|
|
6428
|
+
style: Nn,
|
|
6429
|
+
...Fn(f)
|
|
6354
6430
|
})]
|
|
6355
6431
|
}) : null,
|
|
6356
6432
|
/* @__PURE__ */ d("label", {
|
|
6357
6433
|
style: {
|
|
6358
|
-
...
|
|
6434
|
+
...Mn,
|
|
6359
6435
|
display: "grid",
|
|
6360
6436
|
gap: 6
|
|
6361
6437
|
},
|
|
@@ -6363,13 +6439,13 @@ function di({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
6363
6439
|
name: "email",
|
|
6364
6440
|
type: "email",
|
|
6365
6441
|
required: !f,
|
|
6366
|
-
style:
|
|
6367
|
-
...
|
|
6442
|
+
style: Nn,
|
|
6443
|
+
...Fn(f)
|
|
6368
6444
|
})]
|
|
6369
6445
|
}),
|
|
6370
6446
|
/* @__PURE__ */ d("label", {
|
|
6371
6447
|
style: {
|
|
6372
|
-
...
|
|
6448
|
+
...Mn,
|
|
6373
6449
|
display: "grid",
|
|
6374
6450
|
gap: 6
|
|
6375
6451
|
},
|
|
@@ -6377,8 +6453,8 @@ function di({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
6377
6453
|
name: "password",
|
|
6378
6454
|
type: "password",
|
|
6379
6455
|
required: !f,
|
|
6380
|
-
style:
|
|
6381
|
-
...
|
|
6456
|
+
style: Nn,
|
|
6457
|
+
...Fn(f)
|
|
6382
6458
|
})]
|
|
6383
6459
|
}),
|
|
6384
6460
|
/* @__PURE__ */ u("button", {
|
|
@@ -6417,8 +6493,8 @@ function di({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
6417
6493
|
]
|
|
6418
6494
|
});
|
|
6419
6495
|
}
|
|
6420
|
-
function
|
|
6421
|
-
let { user: c, status: l, signOut: f } =
|
|
6496
|
+
function mi({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
6497
|
+
let { user: c, status: l, signOut: f } = ui(), p = a ? s || "user" : l, m = a ? {
|
|
6422
6498
|
name: "Ada Lovelace",
|
|
6423
6499
|
email: "ada@example.com"
|
|
6424
6500
|
} : c;
|
|
@@ -6439,7 +6515,7 @@ function fi({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
6439
6515
|
children: [
|
|
6440
6516
|
/* @__PURE__ */ d("span", {
|
|
6441
6517
|
style: {
|
|
6442
|
-
...
|
|
6518
|
+
...Mn,
|
|
6443
6519
|
fontWeight: 600
|
|
6444
6520
|
},
|
|
6445
6521
|
children: [
|
|
@@ -6450,7 +6526,7 @@ function fi({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
6450
6526
|
}),
|
|
6451
6527
|
n && m?.email ? /* @__PURE__ */ u("span", {
|
|
6452
6528
|
style: {
|
|
6453
|
-
...
|
|
6529
|
+
...Mn,
|
|
6454
6530
|
opacity: .7
|
|
6455
6531
|
},
|
|
6456
6532
|
children: m.email
|
|
@@ -6466,7 +6542,7 @@ function fi({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
6466
6542
|
fontSize: 14,
|
|
6467
6543
|
cursor: a ? "default" : "pointer"
|
|
6468
6544
|
},
|
|
6469
|
-
...
|
|
6545
|
+
...Fn(a),
|
|
6470
6546
|
children: t
|
|
6471
6547
|
})
|
|
6472
6548
|
]
|
|
@@ -6483,40 +6559,40 @@ function fi({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
6483
6559
|
}
|
|
6484
6560
|
//#endregion
|
|
6485
6561
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
6486
|
-
var
|
|
6562
|
+
var hi = {
|
|
6487
6563
|
id: "consent",
|
|
6488
6564
|
label: "Cookie consent",
|
|
6489
6565
|
category: "Apps",
|
|
6490
6566
|
keys: ["CookieConsent"],
|
|
6491
6567
|
ssr: "shell",
|
|
6492
6568
|
settings: []
|
|
6493
|
-
},
|
|
6494
|
-
function
|
|
6569
|
+
}, gi = "webim.cookie_consent";
|
|
6570
|
+
function _i() {
|
|
6495
6571
|
try {
|
|
6496
|
-
let e = window.localStorage.getItem(
|
|
6572
|
+
let e = window.localStorage.getItem(gi), t = e ? JSON.parse(e) : null;
|
|
6497
6573
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
6498
6574
|
} catch {
|
|
6499
6575
|
return "";
|
|
6500
6576
|
}
|
|
6501
6577
|
}
|
|
6502
|
-
function
|
|
6578
|
+
function vi(e) {
|
|
6503
6579
|
try {
|
|
6504
6580
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
6505
6581
|
} catch {}
|
|
6506
6582
|
}
|
|
6507
|
-
function
|
|
6583
|
+
function yi(e) {
|
|
6508
6584
|
try {
|
|
6509
|
-
window.localStorage.setItem(
|
|
6585
|
+
window.localStorage.setItem(gi, JSON.stringify({
|
|
6510
6586
|
choice: e,
|
|
6511
6587
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
6512
6588
|
}));
|
|
6513
6589
|
} catch {}
|
|
6514
|
-
|
|
6590
|
+
vi(e);
|
|
6515
6591
|
try {
|
|
6516
6592
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
6517
6593
|
} catch {}
|
|
6518
6594
|
}
|
|
6519
|
-
var
|
|
6595
|
+
var bi = {
|
|
6520
6596
|
bottom: {
|
|
6521
6597
|
left: 0,
|
|
6522
6598
|
right: 0,
|
|
@@ -6538,18 +6614,18 @@ var vi = {
|
|
|
6538
6614
|
maxWidth: 400
|
|
6539
6615
|
}
|
|
6540
6616
|
};
|
|
6541
|
-
function
|
|
6617
|
+
function xi({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
|
|
6542
6618
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
6543
6619
|
y(e), typeof m == "function" && m(e);
|
|
6544
6620
|
};
|
|
6545
6621
|
if (i(() => {
|
|
6546
6622
|
if (h) return;
|
|
6547
|
-
let e =
|
|
6548
|
-
e ?
|
|
6623
|
+
let e = _i();
|
|
6624
|
+
e ? vi(e) : _(!0);
|
|
6549
6625
|
}, [h, v]), !g) return null;
|
|
6550
6626
|
let x = (e) => () => {
|
|
6551
|
-
h || (
|
|
6552
|
-
}, S =
|
|
6627
|
+
h || (yi(e), _(!1));
|
|
6628
|
+
}, S = bi[s] ?? bi.bottom, C = {
|
|
6553
6629
|
appearance: "none",
|
|
6554
6630
|
font: "inherit",
|
|
6555
6631
|
fontSize: 14,
|
|
@@ -6629,37 +6705,37 @@ function yi({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
6629
6705
|
}
|
|
6630
6706
|
//#endregion
|
|
6631
6707
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
6632
|
-
var
|
|
6708
|
+
var Si = {
|
|
6633
6709
|
id: "language",
|
|
6634
6710
|
label: "Language",
|
|
6635
6711
|
category: "Apps",
|
|
6636
6712
|
keys: ["SiteLanguagePicker"],
|
|
6637
6713
|
ssr: "prefetch",
|
|
6638
6714
|
settings: ["locales"]
|
|
6639
|
-
},
|
|
6715
|
+
}, Ci = {
|
|
6640
6716
|
id: "search",
|
|
6641
6717
|
label: "Search",
|
|
6642
6718
|
category: "Apps",
|
|
6643
6719
|
keys: ["SiteSearch"],
|
|
6644
6720
|
ssr: "prefetch",
|
|
6645
6721
|
settings: []
|
|
6646
|
-
},
|
|
6647
|
-
function
|
|
6722
|
+
}, wi = 50, Ti = 2e3;
|
|
6723
|
+
function Ei() {
|
|
6648
6724
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
6649
6725
|
}
|
|
6650
|
-
function
|
|
6726
|
+
function Di(e, t) {
|
|
6651
6727
|
let n = e?.data ?? {}, r = [];
|
|
6652
6728
|
for (let e of Object.values(n)) {
|
|
6653
6729
|
let t = e == null ? "" : ct(e);
|
|
6654
|
-
if (t && r.push(t), r.join(" ").length >
|
|
6730
|
+
if (t && r.push(t), r.join(" ").length > Ti) break;
|
|
6655
6731
|
}
|
|
6656
|
-
return r.join(" ").slice(0,
|
|
6732
|
+
return r.join(" ").slice(0, Ti).toLocaleLowerCase(t || void 0);
|
|
6657
6733
|
}
|
|
6658
|
-
function
|
|
6659
|
-
let { tenant: b, apiUrl: x, locale: S } = r(Q), [C, w] = c(() =>
|
|
6734
|
+
function Oi({ 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 }) {
|
|
6735
|
+
let { tenant: b, apiUrl: x, locale: S } = r(Q), [C, w] = c(() => Ei()), [T, E] = c(() => Ei()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
|
|
6660
6736
|
i(() => {
|
|
6661
6737
|
let e = () => {
|
|
6662
|
-
let e =
|
|
6738
|
+
let e = Ei();
|
|
6663
6739
|
w(e), E(e);
|
|
6664
6740
|
};
|
|
6665
6741
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -6710,7 +6786,7 @@ function Ei({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6710
6786
|
});
|
|
6711
6787
|
}
|
|
6712
6788
|
else for (let t of e.rows) {
|
|
6713
|
-
if (!
|
|
6789
|
+
if (!Di(t, S).includes(P)) continue;
|
|
6714
6790
|
let n = t?.data ?? {}, r = ct(n.name) || "Untitled", i = ct(n.slug);
|
|
6715
6791
|
F.push({
|
|
6716
6792
|
key: `entry:${t.id}`,
|
|
@@ -6719,7 +6795,7 @@ function Ei({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6719
6795
|
kind: "entry"
|
|
6720
6796
|
});
|
|
6721
6797
|
}
|
|
6722
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
6798
|
+
let I = F.slice(0, Math.min(Math.max(1, p), wi)), L = (e) => {
|
|
6723
6799
|
if (v) {
|
|
6724
6800
|
e.preventDefault(), w(T), j(!0);
|
|
6725
6801
|
return;
|
|
@@ -6801,7 +6877,7 @@ function Ei({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6801
6877
|
onChange: (e) => E(e.target.value),
|
|
6802
6878
|
onFocus: () => P && j(!0),
|
|
6803
6879
|
style: {
|
|
6804
|
-
...
|
|
6880
|
+
...Nn,
|
|
6805
6881
|
flexGrow: 1,
|
|
6806
6882
|
minWidth: 0
|
|
6807
6883
|
}
|
|
@@ -6859,21 +6935,21 @@ function Ei({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
6859
6935
|
}
|
|
6860
6936
|
//#endregion
|
|
6861
6937
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
6862
|
-
function
|
|
6938
|
+
function ki(e) {
|
|
6863
6939
|
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());
|
|
6864
6940
|
return [...new Set(n.map((e) => e.trim()))];
|
|
6865
6941
|
}
|
|
6866
|
-
var
|
|
6867
|
-
function
|
|
6942
|
+
var Ai = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6943
|
+
function ji(e, t) {
|
|
6868
6944
|
let n = String(e ?? "").toUpperCase();
|
|
6869
6945
|
if (t === "code") return n;
|
|
6870
6946
|
let r = "";
|
|
6871
6947
|
try {
|
|
6872
|
-
r =
|
|
6948
|
+
r = Ai(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
6873
6949
|
} catch {}
|
|
6874
6950
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
6875
6951
|
}
|
|
6876
|
-
function
|
|
6952
|
+
function Mi(e, t) {
|
|
6877
6953
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
6878
6954
|
if (typeof window > "u") return n || "?";
|
|
6879
6955
|
try {
|
|
@@ -6883,8 +6959,8 @@ function Ai(e, t) {
|
|
|
6883
6959
|
return n || "/";
|
|
6884
6960
|
}
|
|
6885
6961
|
}
|
|
6886
|
-
function
|
|
6887
|
-
let c = r(Q), l =
|
|
6962
|
+
function Ni({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
|
|
6963
|
+
let c = r(Q), l = ki(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
|
|
6888
6964
|
display: "inline-flex",
|
|
6889
6965
|
alignItems: "center",
|
|
6890
6966
|
gap: 8,
|
|
@@ -6919,7 +6995,7 @@ function ji({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6919
6995
|
style: { opacity: .4 },
|
|
6920
6996
|
children: n ?? "·"
|
|
6921
6997
|
}), /* @__PURE__ */ u("a", {
|
|
6922
|
-
href:
|
|
6998
|
+
href: Mi(e, e === f),
|
|
6923
6999
|
hrefLang: e,
|
|
6924
7000
|
"aria-current": e === p ? "true" : void 0,
|
|
6925
7001
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -6929,7 +7005,7 @@ function ji({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6929
7005
|
textDecoration: "none",
|
|
6930
7006
|
cursor: s ? "default" : "pointer"
|
|
6931
7007
|
},
|
|
6932
|
-
children:
|
|
7008
|
+
children: ji(e, t)
|
|
6933
7009
|
})]
|
|
6934
7010
|
}, e))]
|
|
6935
7011
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -6940,7 +7016,7 @@ function ji({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6940
7016
|
value: p,
|
|
6941
7017
|
onChange: s ? void 0 : (e) => {
|
|
6942
7018
|
let t = e.target.value;
|
|
6943
|
-
window.location.assign(
|
|
7019
|
+
window.location.assign(Mi(t, t === f));
|
|
6944
7020
|
},
|
|
6945
7021
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
6946
7022
|
style: {
|
|
@@ -6954,47 +7030,47 @@ function ji({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
6954
7030
|
},
|
|
6955
7031
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
6956
7032
|
value: e,
|
|
6957
|
-
children:
|
|
7033
|
+
children: ji(e, t)
|
|
6958
7034
|
}, e))
|
|
6959
7035
|
})]
|
|
6960
7036
|
});
|
|
6961
7037
|
}
|
|
6962
7038
|
//#endregion
|
|
6963
7039
|
//#region ../ui/src/components/builder/apps/index.js
|
|
6964
|
-
var
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
],
|
|
6970
|
-
SiteLoginForm:
|
|
6971
|
-
SiteAccountMenu:
|
|
6972
|
-
SiteLanguagePicker:
|
|
6973
|
-
CookieConsent:
|
|
6974
|
-
SiteSearch:
|
|
7040
|
+
var Pi = [
|
|
7041
|
+
ri,
|
|
7042
|
+
Si,
|
|
7043
|
+
hi,
|
|
7044
|
+
Ci
|
|
7045
|
+
], Fi = {
|
|
7046
|
+
SiteLoginForm: pi,
|
|
7047
|
+
SiteAccountMenu: mi,
|
|
7048
|
+
SiteLanguagePicker: Ni,
|
|
7049
|
+
CookieConsent: xi,
|
|
7050
|
+
SiteSearch: Oi
|
|
6975
7051
|
};
|
|
6976
|
-
new Set(
|
|
7052
|
+
new Set(Pi.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
6977
7053
|
//#endregion
|
|
6978
7054
|
//#region ../ui/src/components/builder/three/runtime.js
|
|
6979
|
-
var
|
|
7055
|
+
var Ii = "0.185.1", Li = "4.2.0", Ri = "https://cdn.jsdelivr.net/npm", zi = `${Ri}/three@${Ii}/+esm`, Bi = `${Ri}/@google/model-viewer@${Li}/dist/model-viewer.min.js`, Vi = (e) => import(
|
|
6980
7056
|
/* @vite-ignore */
|
|
6981
7057
|
/* webpackIgnore: true */
|
|
6982
7058
|
e
|
|
6983
|
-
),
|
|
6984
|
-
function
|
|
6985
|
-
if (
|
|
7059
|
+
), Hi = /* @__PURE__ */ new Map();
|
|
7060
|
+
function Ui(e) {
|
|
7061
|
+
if (Hi.has(e)) return Hi.get(e);
|
|
6986
7062
|
if (typeof window > "u") return new Promise(() => {});
|
|
6987
|
-
let t =
|
|
6988
|
-
throw
|
|
7063
|
+
let t = Vi(e).catch((t) => {
|
|
7064
|
+
throw Hi.delete(e), t;
|
|
6989
7065
|
});
|
|
6990
|
-
return
|
|
7066
|
+
return Hi.set(e, t), t;
|
|
6991
7067
|
}
|
|
6992
|
-
var
|
|
6993
|
-
function
|
|
6994
|
-
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) :
|
|
7068
|
+
var Wi = () => Ui(zi), Gi = (e) => Ui(`${Ri}/three@${Ii}/examples/jsm/${e}/+esm`);
|
|
7069
|
+
function Ki() {
|
|
7070
|
+
return typeof window < "u" && window.customElements?.get("model-viewer") ? Promise.resolve(null) : Ui(Bi);
|
|
6995
7071
|
}
|
|
6996
|
-
var
|
|
6997
|
-
function
|
|
7072
|
+
var qi = () => typeof window < "u" && !!window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, Ji = (e = 2) => Math.min(typeof window > "u" ? 1 : window.devicePixelRatio || 1, e);
|
|
7073
|
+
function Yi(e, t) {
|
|
6998
7074
|
let n = 0, r = 0, i = 0, a = !0, o = (e) => {
|
|
6999
7075
|
n = requestAnimationFrame(o), i ||= e;
|
|
7000
7076
|
let a = r ? (e - r) / 1e3 : 0;
|
|
@@ -7013,7 +7089,7 @@ function qi(e, t) {
|
|
|
7013
7089
|
s(), l?.disconnect(), document.removeEventListener("visibilitychange", c);
|
|
7014
7090
|
};
|
|
7015
7091
|
}
|
|
7016
|
-
function
|
|
7092
|
+
function Xi(e, t, n = {}) {
|
|
7017
7093
|
let r = {
|
|
7018
7094
|
radius: n.distance ?? 4,
|
|
7019
7095
|
polar: n.polar ?? Math.PI / 2.4,
|
|
@@ -7062,13 +7138,13 @@ function Ji(e, t, n = {}) {
|
|
|
7062
7138
|
}
|
|
7063
7139
|
//#endregion
|
|
7064
7140
|
//#region ../ui/src/components/builder/three/views.jsx
|
|
7065
|
-
var
|
|
7066
|
-
function
|
|
7141
|
+
var Zi = (e, t) => Number.isFinite(Number(e)) && Number(e) > 0 ? Number(e) : t, Qi = (e, t) => (Number.isFinite(Number(e)) ? Number(e) : t) / 100, $i = (e) => (Number.isFinite(Number(e)) ? Number(e) : 0) * Math.PI / 180, ea = (e) => typeof e == "string" && !!e.trim();
|
|
7142
|
+
function ta({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
7067
7143
|
return /* @__PURE__ */ d("div", {
|
|
7068
7144
|
ref: r,
|
|
7069
7145
|
style: {
|
|
7070
7146
|
...A(i),
|
|
7071
|
-
minHeight:
|
|
7147
|
+
minHeight: Zi(n, 320),
|
|
7072
7148
|
display: "flex",
|
|
7073
7149
|
flexDirection: "column",
|
|
7074
7150
|
alignItems: "center",
|
|
@@ -7077,7 +7153,7 @@ function $i({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
7077
7153
|
border: "1px dashed rgba(148,163,184,.55)",
|
|
7078
7154
|
borderRadius: 10,
|
|
7079
7155
|
background: "rgba(148,163,184,.08)",
|
|
7080
|
-
...
|
|
7156
|
+
...q,
|
|
7081
7157
|
color: "rgba(100,116,139,.95)",
|
|
7082
7158
|
fontSize: 13,
|
|
7083
7159
|
textAlign: "center",
|
|
@@ -7096,24 +7172,24 @@ function $i({ label: e, note: t, height: n, nodeRef: r, style: i }) {
|
|
|
7096
7172
|
}) : null]
|
|
7097
7173
|
});
|
|
7098
7174
|
}
|
|
7099
|
-
function
|
|
7175
|
+
function na({ 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 }) {
|
|
7100
7176
|
let [y, b] = c(typeof window < "u" && !!window.customElements?.get("model-viewer")), [x, S] = c(!1);
|
|
7101
7177
|
i(() => {
|
|
7102
7178
|
if (y || !e) return;
|
|
7103
7179
|
let t = !0;
|
|
7104
|
-
return
|
|
7180
|
+
return Ki().then(() => t && b(!0), () => t && S(!0)), () => {
|
|
7105
7181
|
t = !1;
|
|
7106
7182
|
};
|
|
7107
7183
|
}, [y, e]);
|
|
7108
7184
|
let C = {
|
|
7109
7185
|
display: "block",
|
|
7110
7186
|
width: "100%",
|
|
7111
|
-
minHeight:
|
|
7112
|
-
height:
|
|
7187
|
+
minHeight: Zi(r, 360),
|
|
7188
|
+
height: Zi(r, 360),
|
|
7113
7189
|
backgroundColor: a || "transparent",
|
|
7114
7190
|
...A(g)
|
|
7115
7191
|
};
|
|
7116
|
-
if (!e) return v ? /* @__PURE__ */ u(
|
|
7192
|
+
if (!e) return v ? /* @__PURE__ */ u(ta, {
|
|
7117
7193
|
nodeRef: _,
|
|
7118
7194
|
style: g,
|
|
7119
7195
|
height: r,
|
|
@@ -7148,13 +7224,13 @@ function ea({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotate
|
|
|
7148
7224
|
poster: t || void 0,
|
|
7149
7225
|
style: C,
|
|
7150
7226
|
"camera-controls": w(!v && l !== !1),
|
|
7151
|
-
"auto-rotate": w(T && !
|
|
7152
|
-
"auto-rotate-delay": T ? String(
|
|
7227
|
+
"auto-rotate": w(T && !qi()),
|
|
7228
|
+
"auto-rotate-delay": T ? String(Zi(s, 0)) : void 0,
|
|
7153
7229
|
"rotation-per-second": "18deg",
|
|
7154
7230
|
ar: w(!v && d === !0),
|
|
7155
7231
|
"ar-modes": "webxr scene-viewer quick-look",
|
|
7156
|
-
"shadow-intensity": String(
|
|
7157
|
-
exposure: String(
|
|
7232
|
+
"shadow-intensity": String(Qi(p, 100)),
|
|
7233
|
+
exposure: String(Qi(f, 100)),
|
|
7158
7234
|
"field-of-view": m ? `${Number(m)}deg` : void 0,
|
|
7159
7235
|
"environment-image": h && h !== "neutral" ? h : "neutral",
|
|
7160
7236
|
"interaction-prompt": v ? "none" : void 0,
|
|
@@ -7172,7 +7248,7 @@ function ea({ src: e, poster: t, alt: n, height: r, bg: a, autoRotate: o, rotate
|
|
|
7172
7248
|
}) : null
|
|
7173
7249
|
});
|
|
7174
7250
|
}
|
|
7175
|
-
var
|
|
7251
|
+
var ra = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }"].join("\n"), ia = [
|
|
7176
7252
|
"precision highp float;",
|
|
7177
7253
|
"uniform vec2 u_res;",
|
|
7178
7254
|
"uniform float u_time;",
|
|
@@ -7195,7 +7271,7 @@ var ta = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
7195
7271
|
" return v;",
|
|
7196
7272
|
"}",
|
|
7197
7273
|
""
|
|
7198
|
-
].join("\n"),
|
|
7274
|
+
].join("\n"), aa = {
|
|
7199
7275
|
gradient: [
|
|
7200
7276
|
"void main(){",
|
|
7201
7277
|
" vec2 uv = gl_FragCoord.xy / u_res;",
|
|
@@ -7247,7 +7323,7 @@ var ta = ["attribute vec2 p;", "void main() { gl_Position = vec4(p, 0.0, 1.0); }
|
|
|
7247
7323
|
"}"
|
|
7248
7324
|
].join("\n")
|
|
7249
7325
|
};
|
|
7250
|
-
function
|
|
7326
|
+
function oa(e, t) {
|
|
7251
7327
|
let n = /^#?([0-9a-f]{6})$/i.exec(String(e ?? "").trim());
|
|
7252
7328
|
if (!n) return t;
|
|
7253
7329
|
let r = parseInt(n[1], 16);
|
|
@@ -7257,7 +7333,7 @@ function ia(e, t) {
|
|
|
7257
7333
|
(r & 255) / 255
|
|
7258
7334
|
];
|
|
7259
7335
|
}
|
|
7260
|
-
function
|
|
7336
|
+
function sa(e, t, n) {
|
|
7261
7337
|
let r = e.createShader(t);
|
|
7262
7338
|
if (e.shaderSource(r, n), e.compileShader(r), !e.getShaderParameter(r, e.COMPILE_STATUS)) {
|
|
7263
7339
|
let t = e.getShaderInfoLog(r);
|
|
@@ -7265,13 +7341,13 @@ function aa(e, t, n) {
|
|
|
7265
7341
|
}
|
|
7266
7342
|
return r;
|
|
7267
7343
|
}
|
|
7268
|
-
function
|
|
7344
|
+
function ca({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, scale: l, height: f, interactive: p, style: m, nodeRef: h, inert: g }) {
|
|
7269
7345
|
let _ = s(null), v = s(null), y = s(null), [b, x] = c("");
|
|
7270
7346
|
i(() => () => {
|
|
7271
7347
|
let e = y.current;
|
|
7272
7348
|
y.current = null, e?.getExtension("WEBGL_lose_context")?.loseContext();
|
|
7273
7349
|
}, []);
|
|
7274
|
-
let S = typeof t == "string" && t.trim() ? t :
|
|
7350
|
+
let S = typeof t == "string" && t.trim() ? t : aa[e] ?? aa.gradient, C = String(n ?? ""), w = String(r ?? ""), T = String(a ?? ""), E = Qi(o, 100), D = Math.max(.05, Qi(l, 100));
|
|
7275
7351
|
return i(() => {
|
|
7276
7352
|
let e = _.current, t = v.current;
|
|
7277
7353
|
if (!e || !t) return;
|
|
@@ -7286,7 +7362,7 @@ function oa({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
7286
7362
|
}
|
|
7287
7363
|
let r = null;
|
|
7288
7364
|
try {
|
|
7289
|
-
let e =
|
|
7365
|
+
let e = sa(n, n.VERTEX_SHADER, ra), t = sa(n, n.FRAGMENT_SHADER, ia + S);
|
|
7290
7366
|
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");
|
|
7291
7367
|
x("");
|
|
7292
7368
|
} catch (e) {
|
|
@@ -7322,28 +7398,28 @@ function oa({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
7322
7398
|
};
|
|
7323
7399
|
p !== !1 && t.addEventListener("pointermove", l);
|
|
7324
7400
|
let u = () => {
|
|
7325
|
-
let r =
|
|
7401
|
+
let r = Ji(), i = Math.max(1, Math.round(t.clientWidth * r)), a = Math.max(1, Math.round(t.clientHeight * r));
|
|
7326
7402
|
(e.width !== i || e.height !== a) && (e.width = i, e.height = a, n.viewport(0, 0, i, a));
|
|
7327
7403
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
7328
7404
|
d?.observe(t), u();
|
|
7329
|
-
let f =
|
|
7330
|
-
a:
|
|
7405
|
+
let f = qi(), m = {
|
|
7406
|
+
a: oa(C, [
|
|
7331
7407
|
.35,
|
|
7332
7408
|
.4,
|
|
7333
7409
|
.95
|
|
7334
7410
|
]),
|
|
7335
|
-
b:
|
|
7411
|
+
b: oa(w, [
|
|
7336
7412
|
.05,
|
|
7337
7413
|
.06,
|
|
7338
7414
|
.16
|
|
7339
7415
|
]),
|
|
7340
|
-
c:
|
|
7416
|
+
c: oa(T, [
|
|
7341
7417
|
.95,
|
|
7342
7418
|
.35,
|
|
7343
7419
|
.6
|
|
7344
7420
|
])
|
|
7345
7421
|
}, h = {};
|
|
7346
|
-
return h.stop =
|
|
7422
|
+
return h.stop = Yi(t, (t, r) => {
|
|
7347
7423
|
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?.();
|
|
7348
7424
|
}), () => {
|
|
7349
7425
|
h.stop?.(), d?.disconnect(), t.removeEventListener("pointermove", l), n.deleteProgram(r), n.deleteBuffer(i);
|
|
@@ -7362,7 +7438,7 @@ function oa({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
7362
7438
|
},
|
|
7363
7439
|
style: {
|
|
7364
7440
|
position: "relative",
|
|
7365
|
-
minHeight:
|
|
7441
|
+
minHeight: Zi(f, 320),
|
|
7366
7442
|
overflow: "hidden",
|
|
7367
7443
|
...A(m)
|
|
7368
7444
|
},
|
|
@@ -7384,7 +7460,7 @@ function oa({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
7384
7460
|
justifyContent: "center",
|
|
7385
7461
|
padding: 12,
|
|
7386
7462
|
background: "rgba(15,23,42,.75)",
|
|
7387
|
-
...
|
|
7463
|
+
...q,
|
|
7388
7464
|
color: "#fecaca",
|
|
7389
7465
|
fontSize: 11,
|
|
7390
7466
|
whiteSpace: "pre-wrap",
|
|
@@ -7394,7 +7470,7 @@ function oa({ preset: e, code: t, colorA: n, colorB: r, colorC: a, speed: o, sca
|
|
|
7394
7470
|
}) : null]
|
|
7395
7471
|
});
|
|
7396
7472
|
}
|
|
7397
|
-
function
|
|
7473
|
+
function la(e, t) {
|
|
7398
7474
|
let n = new e.Scene(), r = new e.BoxGeometry();
|
|
7399
7475
|
r.deleteAttribute("uv");
|
|
7400
7476
|
let i = new e.Mesh(r, new e.MeshBasicMaterial({
|
|
@@ -7410,23 +7486,23 @@ function sa(e, t) {
|
|
|
7410
7486
|
let o = new e.PMREMGenerator(t), s = o.fromScene(n, .04);
|
|
7411
7487
|
return o.dispose(), r.dispose(), n.traverse((e) => e.material?.dispose?.()), s.texture;
|
|
7412
7488
|
}
|
|
7413
|
-
var
|
|
7414
|
-
function
|
|
7415
|
-
if (
|
|
7416
|
-
let t =
|
|
7489
|
+
var ua = /* @__PURE__ */ new Map();
|
|
7490
|
+
function da(e) {
|
|
7491
|
+
if (ua.has(e)) return ua.get(e);
|
|
7492
|
+
let t = Gi("loaders/GLTFLoader.js").then((t) => new Promise((n, r) => {
|
|
7417
7493
|
new t.GLTFLoader().load(e, (e) => n(e.scene), void 0, r);
|
|
7418
7494
|
})).catch((t) => {
|
|
7419
|
-
throw
|
|
7495
|
+
throw ua.delete(e), t;
|
|
7420
7496
|
});
|
|
7421
|
-
return
|
|
7497
|
+
return ua.set(e, t), t;
|
|
7422
7498
|
}
|
|
7423
|
-
function
|
|
7499
|
+
function fa(e, t) {
|
|
7424
7500
|
let n = new e.Box3().setFromObject(t);
|
|
7425
7501
|
if (n.isEmpty()) return t;
|
|
7426
7502
|
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();
|
|
7427
7503
|
return t.position.sub(i), t.scale.multiplyScalar(1 / a), t.position.multiplyScalar(1 / a), o.add(t), o;
|
|
7428
7504
|
}
|
|
7429
|
-
var
|
|
7505
|
+
var pa = {
|
|
7430
7506
|
box: (e) => new e.BoxGeometry(1, 1, 1, 1, 1, 1),
|
|
7431
7507
|
sphere: (e) => new e.SphereGeometry(.62, 48, 32),
|
|
7432
7508
|
torus: (e) => new e.TorusGeometry(.5, .2, 24, 64),
|
|
@@ -7435,50 +7511,50 @@ var da = {
|
|
|
7435
7511
|
cylinder: (e) => new e.CylinderGeometry(.45, .45, 1.1, 48),
|
|
7436
7512
|
plane: (e) => new e.PlaneGeometry(1.4, 1.4),
|
|
7437
7513
|
capsule: (e) => new e.CapsuleGeometry(.35, .6, 8, 32)
|
|
7438
|
-
},
|
|
7439
|
-
function
|
|
7440
|
-
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 && !
|
|
7514
|
+
}, ma = (e, t) => Number.isFinite(Number(e)) ? Number(e) : t;
|
|
7515
|
+
function ha({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate: a, spinSpeed: o, controls: l, ground: d, height: f, style: p, nodeRef: m, inert: h }) {
|
|
7516
|
+
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 && !qi(), S = l !== !1 && !h;
|
|
7441
7517
|
return i(() => {
|
|
7442
7518
|
let e = g.current;
|
|
7443
7519
|
if (!e) return;
|
|
7444
7520
|
let i = !0, a = null;
|
|
7445
|
-
return
|
|
7521
|
+
return Wi().then((s) => {
|
|
7446
7522
|
if (!i || !e) return;
|
|
7447
7523
|
let c = new s.WebGLRenderer({
|
|
7448
7524
|
antialias: !0,
|
|
7449
7525
|
alpha: !t
|
|
7450
7526
|
});
|
|
7451
|
-
c.setPixelRatio(
|
|
7527
|
+
c.setPixelRatio(Ji()), 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);
|
|
7452
7528
|
let l = new s.Scene();
|
|
7453
|
-
t && (l.background = new s.Color(t)), l.environment =
|
|
7454
|
-
let u = new s.PerspectiveCamera(
|
|
7455
|
-
distance:
|
|
7529
|
+
t && (l.background = new s.Color(t)), l.environment = la(s, c);
|
|
7530
|
+
let u = new s.PerspectiveCamera(ma(r, 45), 1, .1, 400), f = Xi(u, c.domElement, {
|
|
7531
|
+
distance: ma(n, 5),
|
|
7456
7532
|
enableZoom: S
|
|
7457
7533
|
}), p = new s.DirectionalLight(16777215, 2.2);
|
|
7458
7534
|
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));
|
|
7459
7535
|
let m = [], h = new s.Group(), g = (e, t) => {
|
|
7460
|
-
let n =
|
|
7461
|
-
e.position.set(
|
|
7536
|
+
let n = ma(t.scale, 1);
|
|
7537
|
+
e.position.set(ma(t.x, 0), ma(t.y, 0), ma(t.z, 0)), e.rotation.set($i(t.rx), $i(t.ry), $i(t.rz)), e.scale.setScalar(n > 0 ? n : 1), e.userData.spin = $i(t.spin);
|
|
7462
7538
|
};
|
|
7463
7539
|
for (let e of y) {
|
|
7464
7540
|
if (e.shape === "model") {
|
|
7465
|
-
if (!
|
|
7541
|
+
if (!ea(e.src)) continue;
|
|
7466
7542
|
let t = new s.Group();
|
|
7467
|
-
g(t, e), h.add(t),
|
|
7543
|
+
g(t, e), h.add(t), da(e.src).then((e) => {
|
|
7468
7544
|
if (!i) return;
|
|
7469
|
-
let n =
|
|
7545
|
+
let n = fa(s, e.clone(!0));
|
|
7470
7546
|
n.traverse((e) => {
|
|
7471
7547
|
e.isMesh && (e.castShadow = !0, e.receiveShadow = !0);
|
|
7472
7548
|
}), t.add(n);
|
|
7473
7549
|
}, () => {});
|
|
7474
7550
|
continue;
|
|
7475
7551
|
}
|
|
7476
|
-
let t = (
|
|
7552
|
+
let t = (pa[e.shape] ?? pa.box)(s), n = new s.MeshStandardMaterial({
|
|
7477
7553
|
color: /^#?[0-9a-f]{6}$/i.test(String(e.color ?? "")) ? e.color : "#6366f1",
|
|
7478
|
-
metalness: Math.min(1, Math.max(0,
|
|
7479
|
-
roughness: Math.min(1, Math.max(0,
|
|
7480
|
-
transparent:
|
|
7481
|
-
opacity: Math.min(1, Math.max(0,
|
|
7554
|
+
metalness: Math.min(1, Math.max(0, Qi(e.metalness, 10))),
|
|
7555
|
+
roughness: Math.min(1, Math.max(0, Qi(e.roughness, 35))),
|
|
7556
|
+
transparent: Qi(e.opacity, 100) < 1,
|
|
7557
|
+
opacity: Math.min(1, Math.max(0, Qi(e.opacity, 100))),
|
|
7482
7558
|
flatShading: e.flat === !0,
|
|
7483
7559
|
wireframe: e.wireframe === !0,
|
|
7484
7560
|
side: e.shape === "plane" ? s.DoubleSide : s.FrontSide
|
|
@@ -7489,14 +7565,14 @@ function pa({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7489
7565
|
let _ = null;
|
|
7490
7566
|
if (d !== !1) {
|
|
7491
7567
|
let e = new s.ShadowMaterial({ opacity: .22 }), t = new s.PlaneGeometry(60, 60);
|
|
7492
|
-
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y =
|
|
7568
|
+
_ = new s.Mesh(t, e), _.rotation.x = -Math.PI / 2, _.position.y = ma(d === !0 ? 0 : d, -.85), _.receiveShadow = !0, l.add(_), m.push(t, e);
|
|
7493
7569
|
}
|
|
7494
7570
|
let v = () => {
|
|
7495
7571
|
let t = Math.max(1, e.clientWidth), n = Math.max(1, e.clientHeight);
|
|
7496
7572
|
c.setSize(t, n, !1), u.aspect = t / n, u.updateProjectionMatrix();
|
|
7497
7573
|
}, b = typeof ResizeObserver > "u" ? null : new ResizeObserver(v);
|
|
7498
7574
|
b?.observe(e), v();
|
|
7499
|
-
let C =
|
|
7575
|
+
let C = $i(Number.isFinite(Number(o)) ? o : 20), w = Yi(e, (e) => {
|
|
7500
7576
|
f.autoSpin(x ? C : 0, e), f.update();
|
|
7501
7577
|
for (let t of h.children) t.userData.spin && (t.rotation.y += t.userData.spin * e);
|
|
7502
7578
|
c.render(l, u);
|
|
@@ -7520,7 +7596,7 @@ function pa({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7520
7596
|
o,
|
|
7521
7597
|
S,
|
|
7522
7598
|
d
|
|
7523
|
-
]), _ && h ? /* @__PURE__ */ u(
|
|
7599
|
+
]), _ && h ? /* @__PURE__ */ u(ta, {
|
|
7524
7600
|
nodeRef: m,
|
|
7525
7601
|
style: p,
|
|
7526
7602
|
height: f,
|
|
@@ -7531,27 +7607,27 @@ function pa({ objects: e, background: t, cameraDistance: n, fov: r, autoRotate:
|
|
|
7531
7607
|
g.current = e, typeof m == "function" && m(e);
|
|
7532
7608
|
},
|
|
7533
7609
|
style: {
|
|
7534
|
-
minHeight:
|
|
7535
|
-
height:
|
|
7610
|
+
minHeight: Zi(f, 380),
|
|
7611
|
+
height: Zi(f, 380),
|
|
7536
7612
|
overflow: "hidden",
|
|
7537
7613
|
touchAction: S ? "pan-y" : void 0,
|
|
7538
7614
|
...A(p)
|
|
7539
7615
|
}
|
|
7540
7616
|
});
|
|
7541
7617
|
}
|
|
7542
|
-
function
|
|
7618
|
+
function ga({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o }) {
|
|
7543
7619
|
let l = s(null), [d, f] = c("");
|
|
7544
7620
|
return i(() => {
|
|
7545
7621
|
let t = l.current;
|
|
7546
7622
|
if (o || !t || typeof e != "string" || !e.trim()) return;
|
|
7547
7623
|
let r = !0, i = null;
|
|
7548
|
-
return
|
|
7624
|
+
return Wi().then((a) => {
|
|
7549
7625
|
if (!r || !t) return;
|
|
7550
7626
|
let o = new a.WebGLRenderer({
|
|
7551
7627
|
antialias: !0,
|
|
7552
7628
|
alpha: !n
|
|
7553
7629
|
});
|
|
7554
|
-
o.setPixelRatio(
|
|
7630
|
+
o.setPixelRatio(Ji()), o.outputColorSpace = a.SRGBColorSpace, o.domElement.style.display = "block", o.domElement.style.width = "100%", o.domElement.style.height = "100%", t.appendChild(o.domElement);
|
|
7555
7631
|
let s = new a.Scene();
|
|
7556
7632
|
n && (s.background = new a.Color(n));
|
|
7557
7633
|
let c = new a.PerspectiveCamera(45, 1, .1, 1e3);
|
|
@@ -7574,7 +7650,7 @@ function ma({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7574
7650
|
o.setSize(e, n, !1), c.aspect = e / n, c.updateProjectionMatrix();
|
|
7575
7651
|
}, d = typeof ResizeObserver > "u" ? null : new ResizeObserver(u);
|
|
7576
7652
|
d?.observe(t), u();
|
|
7577
|
-
let p = !1, m =
|
|
7653
|
+
let p = !1, m = Yi(t, (e, t) => {
|
|
7578
7654
|
if (!p && typeof l?.frame == "function") try {
|
|
7579
7655
|
l.frame(e, t);
|
|
7580
7656
|
} catch (e) {
|
|
@@ -7596,7 +7672,7 @@ function ma({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7596
7672
|
e,
|
|
7597
7673
|
o,
|
|
7598
7674
|
n
|
|
7599
|
-
]), o ? /* @__PURE__ */ u(
|
|
7675
|
+
]), o ? /* @__PURE__ */ u(ta, {
|
|
7600
7676
|
nodeRef: a,
|
|
7601
7677
|
style: r,
|
|
7602
7678
|
height: t,
|
|
@@ -7607,8 +7683,8 @@ function ma({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7607
7683
|
l.current = e, typeof a == "function" && a(e);
|
|
7608
7684
|
},
|
|
7609
7685
|
style: {
|
|
7610
|
-
minHeight:
|
|
7611
|
-
height:
|
|
7686
|
+
minHeight: Zi(t, 380),
|
|
7687
|
+
height: Zi(t, 380),
|
|
7612
7688
|
overflow: "hidden",
|
|
7613
7689
|
position: "relative",
|
|
7614
7690
|
touchAction: "pan-y",
|
|
@@ -7623,7 +7699,7 @@ function ma({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7623
7699
|
padding: "6px 8px",
|
|
7624
7700
|
borderRadius: 6,
|
|
7625
7701
|
background: "rgba(127,29,29,.85)",
|
|
7626
|
-
...
|
|
7702
|
+
...q,
|
|
7627
7703
|
color: "#fee2e2",
|
|
7628
7704
|
fontSize: 11
|
|
7629
7705
|
},
|
|
@@ -7631,40 +7707,40 @@ function ma({ code: e, height: t, background: n, style: r, nodeRef: a, inert: o
|
|
|
7631
7707
|
}) : null
|
|
7632
7708
|
});
|
|
7633
7709
|
}
|
|
7634
|
-
var
|
|
7635
|
-
ModelViewerBlock:
|
|
7636
|
-
ShaderBlock:
|
|
7637
|
-
SceneBlock:
|
|
7638
|
-
ThreeCanvasBlock:
|
|
7639
|
-
},
|
|
7640
|
-
function
|
|
7641
|
-
if (
|
|
7710
|
+
var _a = {
|
|
7711
|
+
ModelViewerBlock: na,
|
|
7712
|
+
ShaderBlock: ca,
|
|
7713
|
+
SceneBlock: ha,
|
|
7714
|
+
ThreeCanvasBlock: ga
|
|
7715
|
+
}, va = /* @__PURE__ */ new Map();
|
|
7716
|
+
function ya(e) {
|
|
7717
|
+
if (va.has(e)) return va.get(e);
|
|
7642
7718
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
7643
7719
|
/* @vite-ignore */
|
|
7644
7720
|
/* webpackIgnore: true */
|
|
7645
7721
|
t
|
|
7646
7722
|
).finally(() => URL.revokeObjectURL(t));
|
|
7647
|
-
return
|
|
7723
|
+
return va.set(e, n), n;
|
|
7648
7724
|
}
|
|
7649
|
-
function
|
|
7725
|
+
function ba(e) {
|
|
7650
7726
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
7651
7727
|
return n && typeof n == "object" ? n : {};
|
|
7652
7728
|
}
|
|
7653
7729
|
//#endregion
|
|
7654
7730
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
7655
|
-
async function
|
|
7656
|
-
let n = await
|
|
7731
|
+
async function xa(e, t) {
|
|
7732
|
+
let n = await ya(e);
|
|
7657
7733
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
7658
7734
|
}
|
|
7659
|
-
var
|
|
7735
|
+
var Sa = {
|
|
7660
7736
|
padding: "10px 12px",
|
|
7661
7737
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
7662
7738
|
borderRadius: 8,
|
|
7663
7739
|
fontSize: 12,
|
|
7664
7740
|
opacity: .6
|
|
7665
7741
|
};
|
|
7666
|
-
function
|
|
7667
|
-
let c = r(Q), l =
|
|
7742
|
+
function Ca({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
7743
|
+
let c = r(Q), l = ba(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
7668
7744
|
tenant: c?.tenant ?? "",
|
|
7669
7745
|
apiUrl: c?.apiUrl ?? "/api",
|
|
7670
7746
|
locale: c?.locale ?? "",
|
|
@@ -7676,7 +7752,7 @@ function xa({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7676
7752
|
let e = f.current;
|
|
7677
7753
|
if (!l?.code || !e) return;
|
|
7678
7754
|
let n = !0;
|
|
7679
|
-
return
|
|
7755
|
+
return xa(l.code, t).then((e) => {
|
|
7680
7756
|
if (!(!n || !e || !f.current)) {
|
|
7681
7757
|
p.current = e;
|
|
7682
7758
|
try {
|
|
@@ -7706,7 +7782,7 @@ function xa({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7706
7782
|
}) : /* @__PURE__ */ d("div", {
|
|
7707
7783
|
ref: o,
|
|
7708
7784
|
style: {
|
|
7709
|
-
...
|
|
7785
|
+
...Sa,
|
|
7710
7786
|
...A(a)
|
|
7711
7787
|
},
|
|
7712
7788
|
children: [
|
|
@@ -7718,13 +7794,13 @@ function xa({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
7718
7794
|
}
|
|
7719
7795
|
//#endregion
|
|
7720
7796
|
//#region ../ui/src/components/builder/render.jsx
|
|
7721
|
-
var
|
|
7722
|
-
...
|
|
7723
|
-
...
|
|
7724
|
-
...
|
|
7725
|
-
PluginBlock:
|
|
7797
|
+
var wa = {
|
|
7798
|
+
...ni,
|
|
7799
|
+
...Fi,
|
|
7800
|
+
..._a,
|
|
7801
|
+
PluginBlock: Ca
|
|
7726
7802
|
};
|
|
7727
|
-
function
|
|
7803
|
+
function Ta(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
7728
7804
|
let o = n[t];
|
|
7729
7805
|
if (!o || o.hidden) return null;
|
|
7730
7806
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -7732,11 +7808,11 @@ function Ca(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7732
7808
|
let n = o.props?.componentId, s = r?.[n];
|
|
7733
7809
|
if (!s?.template || i.has(n)) return null;
|
|
7734
7810
|
let c = new Set(i).add(n);
|
|
7735
|
-
return /* @__PURE__ */ u(e, { children:
|
|
7811
|
+
return /* @__PURE__ */ u(e, { children: Ta(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
7736
7812
|
}
|
|
7737
|
-
let l =
|
|
7813
|
+
let l = wa[s];
|
|
7738
7814
|
if (!l) return null;
|
|
7739
|
-
let d = (o.nodes ?? []).map((e) =>
|
|
7815
|
+
let d = (o.nodes ?? []).map((e) => Ta(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Ta(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
7740
7816
|
...c,
|
|
7741
7817
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
7742
7818
|
linked: p,
|
|
@@ -7745,16 +7821,16 @@ function Ca(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
7745
7821
|
},
|
|
7746
7822
|
children: d.length ? d : void 0
|
|
7747
7823
|
}, t);
|
|
7748
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
7824
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(fi, {
|
|
7749
7825
|
when: c.when,
|
|
7750
7826
|
children: m
|
|
7751
7827
|
}, t) : m;
|
|
7752
7828
|
}
|
|
7753
7829
|
//#endregion
|
|
7754
7830
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
7755
|
-
var
|
|
7756
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
7757
|
-
function
|
|
7831
|
+
var Ea = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Da = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ue(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
7832
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(ue(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
7833
|
+
function Oa({ 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 }) {
|
|
7758
7834
|
let b = s?.js?.trim();
|
|
7759
7835
|
if (i(() => {
|
|
7760
7836
|
if (!b) return;
|
|
@@ -7768,11 +7844,11 @@ function Ea({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7768
7844
|
minHeight: "100%",
|
|
7769
7845
|
display: "flex",
|
|
7770
7846
|
flexDirection: "column"
|
|
7771
|
-
}, w =
|
|
7847
|
+
}, w = Ta("ROOT", e, n), T = o(() => ({ render: (t, r) => Ta(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = G(e, n), O = re(e, n), k = s?.css?.trim(), A = E(c), j = le(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !oe[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
|
|
7772
7848
|
rel: "stylesheet",
|
|
7773
7849
|
precedence: "default",
|
|
7774
7850
|
href: g(e)
|
|
7775
|
-
}, e)), P =
|
|
7851
|
+
}, e)), P = Da(j);
|
|
7776
7852
|
return r === "auto" ? /* @__PURE__ */ u(Q.Provider, {
|
|
7777
7853
|
value: {
|
|
7778
7854
|
tenant: l || "",
|
|
@@ -7780,7 +7856,7 @@ function Ea({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7780
7856
|
locale: m || "",
|
|
7781
7857
|
settings: _ ?? null
|
|
7782
7858
|
},
|
|
7783
|
-
children: /* @__PURE__ */ u(
|
|
7859
|
+
children: /* @__PURE__ */ u(di, {
|
|
7784
7860
|
initialUser: v,
|
|
7785
7861
|
children: /* @__PURE__ */ u(et.Provider, {
|
|
7786
7862
|
value: p ?? null,
|
|
@@ -7795,8 +7871,8 @@ function Ea({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7795
7871
|
...a
|
|
7796
7872
|
},
|
|
7797
7873
|
children: [
|
|
7798
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
7799
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
7874
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${Ea(ue(j.light))} }
|
|
7875
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Ea(ue(j.dark))} } }` }),
|
|
7800
7876
|
/* @__PURE__ */ u("style", { children: P }),
|
|
7801
7877
|
N,
|
|
7802
7878
|
/* @__PURE__ */ u("style", { children: S }),
|
|
@@ -7816,7 +7892,7 @@ function Ea({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7816
7892
|
locale: m || "",
|
|
7817
7893
|
settings: _ ?? null
|
|
7818
7894
|
},
|
|
7819
|
-
children: /* @__PURE__ */ u(
|
|
7895
|
+
children: /* @__PURE__ */ u(di, {
|
|
7820
7896
|
initialUser: v,
|
|
7821
7897
|
children: /* @__PURE__ */ u(et.Provider, {
|
|
7822
7898
|
value: p ?? null,
|
|
@@ -7849,8 +7925,8 @@ function Ea({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
7849
7925
|
}
|
|
7850
7926
|
//#endregion
|
|
7851
7927
|
//#region src/WebimContent.jsx
|
|
7852
|
-
function
|
|
7853
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
7928
|
+
function ka({ bundle: e, mode: t = "auto", style: n }) {
|
|
7929
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(Oa, {
|
|
7854
7930
|
blocks: e.blocks,
|
|
7855
7931
|
theme: e.theme,
|
|
7856
7932
|
components: e.components,
|
|
@@ -7868,7 +7944,7 @@ function Da({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
7868
7944
|
}
|
|
7869
7945
|
//#endregion
|
|
7870
7946
|
//#region src/WebimPage.jsx
|
|
7871
|
-
function
|
|
7947
|
+
function Aa({ 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 }) {
|
|
7872
7948
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
7873
7949
|
onLoad: m,
|
|
7874
7950
|
onError: h
|
|
@@ -7905,11 +7981,11 @@ function Oa({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
7905
7981
|
r,
|
|
7906
7982
|
a,
|
|
7907
7983
|
o
|
|
7908
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
7984
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(ka, {
|
|
7909
7985
|
bundle: g.bundle,
|
|
7910
7986
|
mode: l,
|
|
7911
7987
|
style: d
|
|
7912
7988
|
});
|
|
7913
7989
|
}
|
|
7914
7990
|
//#endregion
|
|
7915
|
-
export {
|
|
7991
|
+
export { Oa as PageRenderer, ka as WebimContent, Aa as WebimPage, ye as fetchPage, It as renderRichContent, he as resolveTheme };
|