webim-adapter 1.1.0 → 1.1.2
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 +1176 -688
- package/build/webim-embed.js +25 -6
- package/build/webim-ssr.js +1206 -718
- package/package.json +1 -1
package/build/webim-adapter.js
CHANGED
|
@@ -252,32 +252,32 @@ function A(e) {
|
|
|
252
252
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
253
253
|
let U = F(I);
|
|
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
|
-
let
|
|
256
|
-
|
|
257
|
-
let { textStrokeWidth:
|
|
258
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
259
|
-
let { clipText:
|
|
260
|
-
delete t.clipText,
|
|
261
|
-
let { transitions:
|
|
255
|
+
let ee = F(L);
|
|
256
|
+
ee.length && (t.backdropFilter = ee.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
257
|
+
let { textStrokeWidth: te, textStrokeColor: ne } = t;
|
|
258
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (te !== void 0 || ne !== void 0) && (t.WebkitTextStroke = `${O(te ?? 1)} ${ne || "currentColor"}`);
|
|
259
|
+
let { clipText: re } = t;
|
|
260
|
+
delete t.clipText, re && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
261
|
+
let { transitions: W, transitionDuration: G, transitionEasing: K, transitionProperty: ie } = t, ae = (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 oe = (Array.isArray(W) ? W : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ae(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
264
|
+
if (G !== void 0 && oe.push(`${ie || "all"} ${ae(G)} ${K || "ease"}`), oe.length && (t.transition = oe.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: q, overlayOpacity: se } = t;
|
|
270
|
+
if (delete t.overlayColor, delete t.overlayOpacity, q) {
|
|
271
|
+
let e = `color-mix(in srgb, ${q} ${se ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
|
|
272
272
|
t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
|
|
273
273
|
}
|
|
274
274
|
t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
|
|
275
|
-
let { backgroundLayers:
|
|
275
|
+
let { backgroundLayers: ce } = t;
|
|
276
276
|
delete t.backgroundLayers;
|
|
277
|
-
let
|
|
278
|
-
if (
|
|
277
|
+
let le = (Array.isArray(ce) ? ce : []).filter((e) => e && e.on !== !1);
|
|
278
|
+
if (le.length) {
|
|
279
279
|
let e = [], n = [], r = [], i = [], a = [];
|
|
280
|
-
for (let t of
|
|
280
|
+
for (let t of le) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
281
281
|
else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
282
282
|
else {
|
|
283
283
|
if (!t.src) continue;
|
|
@@ -374,10 +374,10 @@ function U(e, t, n, r = !1) {
|
|
|
374
374
|
let i = Object.entries(A(t)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
|
|
375
375
|
return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
|
|
376
376
|
}
|
|
377
|
-
function
|
|
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 te = [
|
|
381
381
|
{
|
|
382
382
|
key: "tablet",
|
|
383
383
|
max: 991
|
|
@@ -390,17 +390,17 @@ var ee = [
|
|
|
390
390
|
key: "mobile",
|
|
391
391
|
max: 478
|
|
392
392
|
}
|
|
393
|
-
],
|
|
394
|
-
function
|
|
395
|
-
return
|
|
396
|
-
let i = t?.[n] ?
|
|
393
|
+
], ne = (e) => Object.entries(A(e)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
|
|
394
|
+
function re(e, t) {
|
|
395
|
+
return te.map(({ key: n, max: r }) => {
|
|
396
|
+
let i = t?.[n] ? ne(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 W(e, t) {
|
|
401
401
|
let n = [], r = (e) => {
|
|
402
402
|
for (let [t, r] of Object.entries(e || {})) {
|
|
403
|
-
let e =
|
|
403
|
+
let e = re(t, r.props);
|
|
404
404
|
e && n.push(e);
|
|
405
405
|
}
|
|
406
406
|
};
|
|
@@ -408,10 +408,10 @@ function re(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
|
-
let e =
|
|
414
|
+
let e = ee(t, r.props);
|
|
415
415
|
e && n.push(e);
|
|
416
416
|
}
|
|
417
417
|
};
|
|
@@ -419,7 +419,15 @@ function ie(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
|
|
422
|
+
var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", ie = {
|
|
423
|
+
fontFamily: K,
|
|
424
|
+
fontStyle: "normal",
|
|
425
|
+
fontWeight: 400,
|
|
426
|
+
letterSpacing: "normal",
|
|
427
|
+
textTransform: "none",
|
|
428
|
+
lineHeight: 1.4,
|
|
429
|
+
textShadow: "none"
|
|
430
|
+
}, ae = {
|
|
423
431
|
light: {
|
|
424
432
|
background: "#f2f2f2",
|
|
425
433
|
surface: "#f2f2f2",
|
|
@@ -465,18 +473,18 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
465
473
|
headingFont: "inherit",
|
|
466
474
|
light: ae.light,
|
|
467
475
|
dark: ae.dark
|
|
468
|
-
},
|
|
476
|
+
}, q = {
|
|
469
477
|
system: {
|
|
470
478
|
label: "System",
|
|
471
|
-
value:
|
|
479
|
+
value: K
|
|
472
480
|
},
|
|
473
481
|
inter: {
|
|
474
482
|
label: "Inter",
|
|
475
|
-
value: `"Inter", ${
|
|
483
|
+
value: `"Inter", ${K}`
|
|
476
484
|
},
|
|
477
485
|
outfit: {
|
|
478
486
|
label: "Outfit",
|
|
479
|
-
value: `"Outfit", ${
|
|
487
|
+
value: `"Outfit", ${K}`
|
|
480
488
|
},
|
|
481
489
|
serif: {
|
|
482
490
|
label: "Serif",
|
|
@@ -486,7 +494,7 @@ var G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
486
494
|
label: "Mono",
|
|
487
495
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
488
496
|
}
|
|
489
|
-
}, se = (e, t) =>
|
|
497
|
+
}, se = (e, t) => q[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) => {
|
|
490
498
|
let n = Object.assign({}, e, ...t);
|
|
491
499
|
return n.primary = {
|
|
492
500
|
...e.primary,
|
|
@@ -534,7 +542,7 @@ function de(e) {
|
|
|
534
542
|
return {
|
|
535
543
|
backgroundColor: "var(--page-bg)",
|
|
536
544
|
color: "var(--page-text)",
|
|
537
|
-
fontFamily: se(t.font,
|
|
545
|
+
fontFamily: se(t.font, K),
|
|
538
546
|
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : se(t.headingFont, "inherit")
|
|
539
547
|
};
|
|
540
548
|
}
|
|
@@ -545,15 +553,15 @@ function fe(e, t = "light") {
|
|
|
545
553
|
...ue(n[t] ?? n.light)
|
|
546
554
|
};
|
|
547
555
|
}
|
|
548
|
-
function
|
|
556
|
+
function J(e, t) {
|
|
549
557
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
550
558
|
}
|
|
551
|
-
function
|
|
559
|
+
function pe(e, t) {
|
|
552
560
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
553
561
|
}
|
|
554
562
|
//#endregion
|
|
555
563
|
//#region src/bundle.js
|
|
556
|
-
function
|
|
564
|
+
function me({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
557
565
|
let a = {
|
|
558
566
|
...t?.global ?? {},
|
|
559
567
|
...t?.tenant ?? {}
|
|
@@ -563,7 +571,7 @@ function he({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
563
571
|
title: e.title,
|
|
564
572
|
slug: e.slug,
|
|
565
573
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
566
|
-
theme:
|
|
574
|
+
theme: J(o, a.builder_themes?.themes),
|
|
567
575
|
components: a.builder_components?.components ?? {},
|
|
568
576
|
custom: o.custom,
|
|
569
577
|
animations: o.animations,
|
|
@@ -579,18 +587,18 @@ function he({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
579
587
|
}
|
|
580
588
|
//#endregion
|
|
581
589
|
//#region src/fetchPage.js
|
|
582
|
-
var
|
|
590
|
+
var he = async (e) => {
|
|
583
591
|
let t = await e.json().catch(() => null);
|
|
584
592
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
585
593
|
return t?.payload ?? t;
|
|
586
594
|
};
|
|
587
|
-
async function
|
|
595
|
+
async function ge({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
588
596
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
589
597
|
if (!n) throw Error("fetchPage: slug is required");
|
|
590
598
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
591
599
|
...t ? { "x-tenant": t } : {},
|
|
592
600
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
593
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
601
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(he), c(`${l}/settings/public`, { headers: u }).then(he)]), p = me({
|
|
594
602
|
page: d,
|
|
595
603
|
settings: f,
|
|
596
604
|
tenant: t,
|
|
@@ -601,10 +609,11 @@ async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
601
609
|
"OrgChartBlock",
|
|
602
610
|
"NavbarBlock",
|
|
603
611
|
"CalendarBlock",
|
|
604
|
-
"MasonryBlock"
|
|
612
|
+
"MasonryBlock",
|
|
613
|
+
"LogoCarousel"
|
|
605
614
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
606
615
|
if (m.length) {
|
|
607
|
-
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(
|
|
616
|
+
let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(he).then((e) => {
|
|
608
617
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
609
618
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
610
619
|
}).catch(() => [[t, []]])));
|
|
@@ -618,7 +627,7 @@ async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
618
627
|
}
|
|
619
628
|
//#endregion
|
|
620
629
|
//#region ../ui/src/components/builder/locale.js
|
|
621
|
-
var
|
|
630
|
+
var _e = /* @__PURE__ */ new Set([
|
|
622
631
|
"ar",
|
|
623
632
|
"he",
|
|
624
633
|
"fa",
|
|
@@ -629,34 +638,34 @@ var ve = /* @__PURE__ */ new Set([
|
|
|
629
638
|
"yi",
|
|
630
639
|
"dv",
|
|
631
640
|
"ckb"
|
|
632
|
-
]),
|
|
641
|
+
]), ve = (e) => _e.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", ye = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ve(t) : void 0, Y = t({
|
|
633
642
|
tenant: "",
|
|
634
643
|
apiUrl: "/api",
|
|
635
644
|
locale: "",
|
|
636
645
|
settings: null
|
|
637
|
-
}),
|
|
646
|
+
}), be = t(null), xe = (e) => {
|
|
638
647
|
let t = Number(e?.__page);
|
|
639
648
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
640
649
|
if (typeof window > "u") return 1;
|
|
641
650
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
642
651
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
643
|
-
},
|
|
652
|
+
}, Se = () => {
|
|
644
653
|
if (typeof window > "u") return {};
|
|
645
654
|
let e = {};
|
|
646
655
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
647
656
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
648
657
|
}), e;
|
|
649
|
-
},
|
|
658
|
+
}, X = (e) => {
|
|
650
659
|
let t = {
|
|
651
660
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
652
|
-
...
|
|
661
|
+
...Se()
|
|
653
662
|
};
|
|
654
663
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
655
|
-
},
|
|
656
|
-
function
|
|
664
|
+
}, Z = t(null), Q = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
665
|
+
function Ce(e, t) {
|
|
657
666
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
658
667
|
}
|
|
659
|
-
var
|
|
668
|
+
var we = (e) => {
|
|
660
669
|
let t = [];
|
|
661
670
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
662
671
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -666,13 +675,13 @@ var Te = (e) => {
|
|
|
666
675
|
}
|
|
667
676
|
return t;
|
|
668
677
|
};
|
|
669
|
-
function
|
|
678
|
+
function Te(e) {
|
|
670
679
|
return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
|
|
671
680
|
}
|
|
672
681
|
function Ee(e, t) {
|
|
673
|
-
let n = t?.data ?? {}, r =
|
|
682
|
+
let n = t?.data ?? {}, r = we(n);
|
|
674
683
|
if (!r.length) return e;
|
|
675
|
-
let i = RegExp(`:(${r.map(
|
|
684
|
+
let i = RegExp(`:(${r.map(Q).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Te(Ce(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
|
|
676
685
|
return a(e);
|
|
677
686
|
}
|
|
678
687
|
var De = {
|
|
@@ -771,7 +780,7 @@ function Le({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a
|
|
|
771
780
|
});
|
|
772
781
|
}
|
|
773
782
|
var Re = {
|
|
774
|
-
fontFamily:
|
|
783
|
+
fontFamily: q.mono.value,
|
|
775
784
|
background: "rgba(148, 163, 184, 0.18)",
|
|
776
785
|
padding: "1px 5px",
|
|
777
786
|
borderRadius: 4,
|
|
@@ -782,11 +791,17 @@ function ze(e, t = [], n, r) {
|
|
|
782
791
|
return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
|
|
783
792
|
style: Re,
|
|
784
793
|
children: i
|
|
785
|
-
})), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n
|
|
794
|
+
})), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n ? i = /* @__PURE__ */ u("a", {
|
|
786
795
|
href: n,
|
|
787
796
|
target: r || void 0,
|
|
788
797
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
789
|
-
style: {
|
|
798
|
+
style: {
|
|
799
|
+
color: "inherit",
|
|
800
|
+
...t.includes("nounderline") && { textDecoration: "none" }
|
|
801
|
+
},
|
|
802
|
+
children: i
|
|
803
|
+
}) : t.includes("nounderline") && (i = /* @__PURE__ */ u("span", {
|
|
804
|
+
style: { textDecoration: "none" },
|
|
790
805
|
children: i
|
|
791
806
|
})), i;
|
|
792
807
|
}
|
|
@@ -804,11 +819,17 @@ function Be(t, n, r) {
|
|
|
804
819
|
...t.background && { backgroundColor: t.background }
|
|
805
820
|
},
|
|
806
821
|
children: i
|
|
807
|
-
})), t.href
|
|
822
|
+
})), t.href ? i = /* @__PURE__ */ u("a", {
|
|
808
823
|
href: t.href,
|
|
809
824
|
target: t.target || void 0,
|
|
810
825
|
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
811
|
-
style: {
|
|
826
|
+
style: {
|
|
827
|
+
color: t.color ?? "inherit",
|
|
828
|
+
...t.nounderline && { textDecoration: "none" }
|
|
829
|
+
},
|
|
830
|
+
children: i
|
|
831
|
+
}) : t.nounderline && (i = /* @__PURE__ */ u("span", {
|
|
832
|
+
style: { textDecoration: "none" },
|
|
812
833
|
children: i
|
|
813
834
|
})), /* @__PURE__ */ u(e, { children: i }, n);
|
|
814
835
|
}) : n;
|
|
@@ -1437,23 +1458,23 @@ function pt({ slides: e = [], linked: t, ...n }) {
|
|
|
1437
1458
|
}
|
|
1438
1459
|
}) : null;
|
|
1439
1460
|
}
|
|
1440
|
-
var
|
|
1441
|
-
let r =
|
|
1461
|
+
var mt = 256, ht = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), gt = (e, t, n) => {
|
|
1462
|
+
let r = mt * 2 ** n;
|
|
1442
1463
|
return {
|
|
1443
1464
|
x: (Number(t) + 180) / 360 * r,
|
|
1444
|
-
y: (.5 -
|
|
1465
|
+
y: (.5 - ht(Number(e)) / (2 * Math.PI)) * r
|
|
1445
1466
|
};
|
|
1446
1467
|
}, $ = (e, t) => {
|
|
1447
1468
|
if (e === "" || e == null) return null;
|
|
1448
1469
|
let n = Number(e);
|
|
1449
1470
|
return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
|
|
1450
|
-
},
|
|
1451
|
-
function
|
|
1471
|
+
}, _t = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
|
|
1472
|
+
function vt(e, t, n = "directions", r = "") {
|
|
1452
1473
|
let i = `${e},${t}`;
|
|
1453
1474
|
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)}`;
|
|
1454
1475
|
}
|
|
1455
|
-
var
|
|
1456
|
-
function
|
|
1476
|
+
var yt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
|
|
1477
|
+
function bt({ 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 }) {
|
|
1457
1478
|
let _ = s(null), [v, y] = c(1200);
|
|
1458
1479
|
i(() => {
|
|
1459
1480
|
let e = _.current;
|
|
@@ -1463,7 +1484,7 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1463
1484
|
let n = new ResizeObserver(t);
|
|
1464
1485
|
return n.observe(e), () => n.disconnect();
|
|
1465
1486
|
}, []);
|
|
1466
|
-
let b = (Array.isArray(e) ? e : []).filter(
|
|
1487
|
+
let b = (Array.isArray(e) ? e : []).filter(_t), x = _t({
|
|
1467
1488
|
lat: t,
|
|
1468
1489
|
lng: n
|
|
1469
1490
|
}) ? {
|
|
@@ -1475,7 +1496,7 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1475
1496
|
} : null, S = Math.max(80, Number(a) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
|
|
1476
1497
|
if (b.length < 2) return 13;
|
|
1477
1498
|
for (let e = 19; e >= 1; e--) {
|
|
1478
|
-
let t = b.map((t) =>
|
|
1499
|
+
let t = b.map((t) => gt($(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));
|
|
1479
1500
|
if (n <= v * .8 && r <= S * .7) return e;
|
|
1480
1501
|
}
|
|
1481
1502
|
return 1;
|
|
@@ -1499,12 +1520,12 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1499
1520
|
},
|
|
1500
1521
|
children: "Set the coordinates in Settings"
|
|
1501
1522
|
});
|
|
1502
|
-
let T =
|
|
1523
|
+
let T = gt(x.lat, x.lng, C), E = {
|
|
1503
1524
|
x: T.x - v / 2,
|
|
1504
1525
|
y: T.y - S / 2
|
|
1505
1526
|
}, D = [], O = [];
|
|
1506
|
-
for (let e = Math.floor(E.x /
|
|
1507
|
-
for (let e = Math.floor(E.y /
|
|
1527
|
+
for (let e = Math.floor(E.x / mt); e <= Math.floor((E.x + v) / mt); e++) D.push(e);
|
|
1528
|
+
for (let e = Math.floor(E.y / mt); e <= Math.floor((E.y + S) / mt); e++) O.push(e);
|
|
1508
1529
|
let k = 2 ** C;
|
|
1509
1530
|
return /* @__PURE__ */ d("div", {
|
|
1510
1531
|
ref: (e) => {
|
|
@@ -1527,22 +1548,22 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1527
1548
|
return e < 0 || e >= k ? null : /* @__PURE__ */ u("img", {
|
|
1528
1549
|
src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
|
|
1529
1550
|
alt: "",
|
|
1530
|
-
width:
|
|
1531
|
-
height:
|
|
1551
|
+
width: mt,
|
|
1552
|
+
height: mt,
|
|
1532
1553
|
loading: "lazy",
|
|
1533
1554
|
style: {
|
|
1534
1555
|
position: "absolute",
|
|
1535
|
-
left: Math.round(t *
|
|
1536
|
-
top: Math.round(e *
|
|
1537
|
-
width:
|
|
1538
|
-
height:
|
|
1556
|
+
left: Math.round(t * mt - E.x),
|
|
1557
|
+
top: Math.round(e * mt - E.y),
|
|
1558
|
+
width: mt,
|
|
1559
|
+
height: mt,
|
|
1539
1560
|
userSelect: "none",
|
|
1540
1561
|
pointerEvents: "none"
|
|
1541
1562
|
}
|
|
1542
1563
|
}, `${t}-${e}`);
|
|
1543
1564
|
})),
|
|
1544
1565
|
b.map((e, t) => {
|
|
1545
|
-
let n =
|
|
1566
|
+
let n = gt($(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 : vt($(e.lat, 90), $(e.lng, 180), l, e.title);
|
|
1546
1567
|
return /* @__PURE__ */ d(s ? "a" : "span", {
|
|
1547
1568
|
href: s || void 0,
|
|
1548
1569
|
target: s ? "_blank" : void 0,
|
|
@@ -1581,8 +1602,8 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1581
1602
|
viewBox: "0 0 24 24",
|
|
1582
1603
|
fill: a,
|
|
1583
1604
|
style: { display: "block" },
|
|
1584
|
-
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }),
|
|
1585
|
-
d:
|
|
1605
|
+
children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), xt[e.icon] ? /* @__PURE__ */ u("path", {
|
|
1606
|
+
d: xt[e.icon],
|
|
1586
1607
|
transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
|
|
1587
1608
|
fill: "none",
|
|
1588
1609
|
stroke: "#fff",
|
|
@@ -1618,7 +1639,7 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1618
1639
|
})
|
|
1619
1640
|
]
|
|
1620
1641
|
}), f ? /* @__PURE__ */ u("a", {
|
|
1621
|
-
href:
|
|
1642
|
+
href: yt(x.lat, x.lng, C),
|
|
1622
1643
|
target: "_blank",
|
|
1623
1644
|
rel: "noopener noreferrer",
|
|
1624
1645
|
onClick: g ? (e) => e.preventDefault() : void 0,
|
|
@@ -1632,7 +1653,7 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
|
|
|
1632
1653
|
}) : null]
|
|
1633
1654
|
});
|
|
1634
1655
|
}
|
|
1635
|
-
var
|
|
1656
|
+
var xt = {
|
|
1636
1657
|
check: "M4 12l5 5L20 6",
|
|
1637
1658
|
close: "M6 6l12 12M18 6L6 18",
|
|
1638
1659
|
plus: "M12 5v14M5 12h14",
|
|
@@ -1729,8 +1750,8 @@ var bt = {
|
|
|
1729
1750
|
droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
|
|
1730
1751
|
leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
|
|
1731
1752
|
};
|
|
1732
|
-
function
|
|
1733
|
-
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [
|
|
1753
|
+
function St({ 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 }) {
|
|
1754
|
+
let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [xt[e] ?? xt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
|
|
1734
1755
|
viewBox: "0 0 24 24",
|
|
1735
1756
|
width: g,
|
|
1736
1757
|
height: g,
|
|
@@ -1766,10 +1787,10 @@ function xt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1766
1787
|
children: v
|
|
1767
1788
|
});
|
|
1768
1789
|
}
|
|
1769
|
-
function
|
|
1770
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
1790
|
+
function Ct(e, t = {}, n = 0) {
|
|
1791
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Te(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1771
1792
|
for (let e of r) {
|
|
1772
|
-
let n = e.data ?? e, r =
|
|
1793
|
+
let n = e.data ?? e, r = Ce(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(Ce(n, t.nameField)) : i(n.name), l = t.hrefField ? i(Ce(n, t.hrefField)) : "";
|
|
1773
1794
|
for (let e of s) if (o.push({
|
|
1774
1795
|
src: e,
|
|
1775
1796
|
name: c,
|
|
@@ -1779,8 +1800,8 @@ function St(e, t = {}, n = 0) {
|
|
|
1779
1800
|
}
|
|
1780
1801
|
return o;
|
|
1781
1802
|
}
|
|
1782
|
-
function
|
|
1783
|
-
let { tenant: x, apiUrl: S } = r(
|
|
1803
|
+
function wt({ 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 }) {
|
|
1804
|
+
let { tenant: x, apiUrl: S } = r(Y), C = r(be)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
|
|
1784
1805
|
i(() => {
|
|
1785
1806
|
if (!t || C) return;
|
|
1786
1807
|
let e = !0;
|
|
@@ -1797,7 +1818,7 @@ function Ct({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
1797
1818
|
C
|
|
1798
1819
|
]);
|
|
1799
1820
|
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 ? (() => {
|
|
1800
|
-
let e =
|
|
1821
|
+
let e = Ct(k, {
|
|
1801
1822
|
imageField: a,
|
|
1802
1823
|
nameField: o,
|
|
1803
1824
|
hrefField: s
|
|
@@ -2002,20 +2023,20 @@ function Ct({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
|
|
|
2002
2023
|
]
|
|
2003
2024
|
});
|
|
2004
2025
|
}
|
|
2005
|
-
var
|
|
2026
|
+
var Tt = {
|
|
2006
2027
|
color: "inherit",
|
|
2007
2028
|
textDecoration: "none",
|
|
2008
2029
|
fontSize: 14,
|
|
2009
2030
|
opacity: .85
|
|
2010
|
-
},
|
|
2031
|
+
}, Et = {
|
|
2011
2032
|
background: "var(--page-surface, #f2f2f2)",
|
|
2012
2033
|
color: "var(--page-text, #111827)",
|
|
2013
2034
|
border: "1px solid rgba(148, 163, 184, 0.25)",
|
|
2014
2035
|
boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
|
|
2015
2036
|
zIndex: 60
|
|
2016
2037
|
};
|
|
2017
|
-
function
|
|
2018
|
-
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 ? "" :
|
|
2038
|
+
function Dt(e, t = {}, n = "dropdown") {
|
|
2039
|
+
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 ? "" : Te(e), o = r.map((e) => {
|
|
2019
2040
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
2020
2041
|
return {
|
|
2021
2042
|
key: e.id,
|
|
@@ -2056,8 +2077,8 @@ function Et(e, t = {}, n = "dropdown") {
|
|
|
2056
2077
|
type: e.children.length ? n : "link"
|
|
2057
2078
|
}));
|
|
2058
2079
|
}
|
|
2059
|
-
function
|
|
2060
|
-
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(
|
|
2080
|
+
function Ot({ 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" }) {
|
|
2081
|
+
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(Y), P = r(be)?.[g], [F, I] = c(null);
|
|
2061
2082
|
i(() => {
|
|
2062
2083
|
if (!g || P) return;
|
|
2063
2084
|
let e = !0;
|
|
@@ -2077,7 +2098,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2077
2098
|
let e = new ResizeObserver(() => E(C.offsetWidth < h));
|
|
2078
2099
|
return e.observe(C), () => e.disconnect();
|
|
2079
2100
|
}, [C, h]);
|
|
2080
|
-
let L = g ?
|
|
2101
|
+
let L = g ? Dt(P ?? F ?? [], {
|
|
2081
2102
|
labelField: _,
|
|
2082
2103
|
hrefField: v,
|
|
2083
2104
|
imageField: y,
|
|
@@ -2106,7 +2127,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2106
2127
|
return /* @__PURE__ */ d("a", {
|
|
2107
2128
|
href: e.href || "#",
|
|
2108
2129
|
style: {
|
|
2109
|
-
...
|
|
2130
|
+
...Tt,
|
|
2110
2131
|
display: n ? "block" : "flex",
|
|
2111
2132
|
alignItems: n ? void 0 : "center",
|
|
2112
2133
|
gap: n ? void 0 : 10,
|
|
@@ -2203,7 +2224,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2203
2224
|
let t = e.children ?? [];
|
|
2204
2225
|
if (!t.length) return /* @__PURE__ */ u("a", {
|
|
2205
2226
|
href: e.href || "#",
|
|
2206
|
-
style:
|
|
2227
|
+
style: Tt,
|
|
2207
2228
|
children: e.label
|
|
2208
2229
|
}, e.key);
|
|
2209
2230
|
let n = e.type === "mega";
|
|
@@ -2217,7 +2238,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2217
2238
|
children: [/* @__PURE__ */ d("a", {
|
|
2218
2239
|
href: e.href || "#",
|
|
2219
2240
|
style: {
|
|
2220
|
-
...
|
|
2241
|
+
...Tt,
|
|
2221
2242
|
cursor: "pointer"
|
|
2222
2243
|
},
|
|
2223
2244
|
children: [
|
|
@@ -2233,7 +2254,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2233
2254
|
]
|
|
2234
2255
|
}), k === e.key && (n ? /* @__PURE__ */ u("div", {
|
|
2235
2256
|
style: {
|
|
2236
|
-
...
|
|
2257
|
+
...Et,
|
|
2237
2258
|
position: "absolute",
|
|
2238
2259
|
left: 0,
|
|
2239
2260
|
right: 0,
|
|
@@ -2249,7 +2270,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2249
2270
|
}, !0))
|
|
2250
2271
|
}) : /* @__PURE__ */ u("div", {
|
|
2251
2272
|
style: {
|
|
2252
|
-
...
|
|
2273
|
+
...Et,
|
|
2253
2274
|
position: "absolute",
|
|
2254
2275
|
top: "100%",
|
|
2255
2276
|
left: 0,
|
|
@@ -2278,7 +2299,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2278
2299
|
children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
|
|
2279
2300
|
href: t.href || "#",
|
|
2280
2301
|
style: {
|
|
2281
|
-
...
|
|
2302
|
+
...Tt,
|
|
2282
2303
|
padding: "10px 4px",
|
|
2283
2304
|
fontWeight: (t.children ?? []).length ? 600 : 400,
|
|
2284
2305
|
opacity: 1
|
|
@@ -2289,7 +2310,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
|
|
|
2289
2310
|
]
|
|
2290
2311
|
});
|
|
2291
2312
|
}
|
|
2292
|
-
function
|
|
2313
|
+
function kt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
2293
2314
|
let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
|
|
2294
2315
|
return e.length ? /* @__PURE__ */ d("div", {
|
|
2295
2316
|
ref: r,
|
|
@@ -2329,55 +2350,79 @@ function Ot({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
|
|
|
2329
2350
|
}, e.key))]
|
|
2330
2351
|
}) : null;
|
|
2331
2352
|
}
|
|
2332
|
-
function
|
|
2333
|
-
let [
|
|
2353
|
+
function At({ 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 }) {
|
|
2354
|
+
let [g, _] = c(() => new Set(e.length ? [e[0].key] : []));
|
|
2334
2355
|
if (!e.length) return null;
|
|
2335
|
-
let
|
|
2356
|
+
let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
|
|
2357
|
+
let n = Number(e);
|
|
2358
|
+
return e === "" || e == null || !Number.isFinite(n) ? t : n;
|
|
2359
|
+
}, b = xt[r], x = (e) => _((t) => {
|
|
2336
2360
|
let r = new Set(n ? t : []);
|
|
2337
2361
|
return t.has(e) ? r.delete(e) : r.add(e), r;
|
|
2338
2362
|
});
|
|
2339
2363
|
return /* @__PURE__ */ u("div", {
|
|
2340
|
-
ref:
|
|
2364
|
+
ref: h,
|
|
2341
2365
|
style: {
|
|
2342
2366
|
width: "100%",
|
|
2343
|
-
...A(
|
|
2367
|
+
...A(m)
|
|
2344
2368
|
},
|
|
2345
2369
|
children: e.map((n, r) => {
|
|
2346
|
-
let
|
|
2370
|
+
let c = g.has(n.key);
|
|
2347
2371
|
return /* @__PURE__ */ d("div", {
|
|
2348
|
-
style: { borderBottom: r < e.length - 1 ?
|
|
2372
|
+
style: { borderBottom: r < e.length - 1 ? `1px solid ${v(p, "rgba(148, 163, 184, 0.35)")}` : "none" },
|
|
2349
2373
|
children: [/* @__PURE__ */ d("button", {
|
|
2350
2374
|
type: "button",
|
|
2351
|
-
onClick: () =>
|
|
2375
|
+
onClick: () => x(n.key),
|
|
2352
2376
|
style: {
|
|
2353
2377
|
width: "100%",
|
|
2354
2378
|
display: "flex",
|
|
2355
2379
|
alignItems: "center",
|
|
2356
2380
|
justifyContent: "space-between",
|
|
2357
2381
|
gap: 12,
|
|
2358
|
-
background: "transparent",
|
|
2382
|
+
background: c ? v(l, v(o, "transparent")) : v(o, "transparent"),
|
|
2359
2383
|
border: 0,
|
|
2360
|
-
padding:
|
|
2384
|
+
padding: `${y(a, 14)}px ${y(i, 4)}px`,
|
|
2361
2385
|
fontSize: 15,
|
|
2362
2386
|
fontWeight: 600,
|
|
2363
2387
|
fontFamily: "inherit",
|
|
2364
|
-
color: "inherit",
|
|
2388
|
+
color: c ? v(f, v(s, "inherit")) : v(s, "inherit"),
|
|
2365
2389
|
textAlign: "left",
|
|
2366
|
-
cursor: "pointer"
|
|
2390
|
+
cursor: "pointer",
|
|
2391
|
+
transition: "background 180ms, color 180ms"
|
|
2367
2392
|
},
|
|
2368
|
-
children: [
|
|
2393
|
+
children: [/* @__PURE__ */ d("span", {
|
|
2394
|
+
style: {
|
|
2395
|
+
display: "flex",
|
|
2396
|
+
alignItems: "center",
|
|
2397
|
+
gap: 10,
|
|
2398
|
+
minWidth: 0
|
|
2399
|
+
},
|
|
2400
|
+
children: [b ? /* @__PURE__ */ u("svg", {
|
|
2401
|
+
viewBox: "0 0 24 24",
|
|
2402
|
+
width: 16,
|
|
2403
|
+
height: 16,
|
|
2404
|
+
fill: "none",
|
|
2405
|
+
stroke: "currentColor",
|
|
2406
|
+
strokeWidth: 2,
|
|
2407
|
+
strokeLinecap: "round",
|
|
2408
|
+
strokeLinejoin: "round",
|
|
2409
|
+
"aria-hidden": "true",
|
|
2410
|
+
style: { flexShrink: 0 },
|
|
2411
|
+
children: /* @__PURE__ */ u("path", { d: b })
|
|
2412
|
+
}) : null, n.title || `Item ${r + 1}`]
|
|
2413
|
+
}), /* @__PURE__ */ u("span", {
|
|
2369
2414
|
"aria-hidden": !0,
|
|
2370
2415
|
style: {
|
|
2371
2416
|
fontSize: 12,
|
|
2372
2417
|
opacity: .6,
|
|
2373
|
-
transform:
|
|
2418
|
+
transform: c ? "rotate(180deg)" : "none",
|
|
2374
2419
|
transition: "transform 180ms"
|
|
2375
2420
|
},
|
|
2376
2421
|
children: "▼"
|
|
2377
2422
|
})]
|
|
2378
2423
|
}), /* @__PURE__ */ u("div", {
|
|
2379
2424
|
style: {
|
|
2380
|
-
display:
|
|
2425
|
+
display: c ? "flex" : "none",
|
|
2381
2426
|
flexDirection: "column"
|
|
2382
2427
|
},
|
|
2383
2428
|
children: t?.[n.key] ?? null
|
|
@@ -2386,15 +2431,15 @@ function kt({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
|
|
|
2386
2431
|
})
|
|
2387
2432
|
});
|
|
2388
2433
|
}
|
|
2389
|
-
var
|
|
2434
|
+
var jt = {
|
|
2390
2435
|
display: "flex",
|
|
2391
2436
|
flexDirection: "column",
|
|
2392
2437
|
gap: "12px"
|
|
2393
|
-
},
|
|
2438
|
+
}, Mt = {
|
|
2394
2439
|
fontSize: "14px",
|
|
2395
2440
|
fontWeight: 500,
|
|
2396
2441
|
color: "var(--page-text, #111827)"
|
|
2397
|
-
},
|
|
2442
|
+
}, Nt = {
|
|
2398
2443
|
padding: "10px 12px",
|
|
2399
2444
|
border: "1px solid var(--page-border, #d1d5db)",
|
|
2400
2445
|
borderRadius: "6px",
|
|
@@ -2404,18 +2449,18 @@ var At = {
|
|
|
2404
2449
|
boxSizing: "border-box",
|
|
2405
2450
|
backgroundColor: "var(--page-surface, #f2f2f2)",
|
|
2406
2451
|
color: "var(--page-text, #111827)"
|
|
2407
|
-
},
|
|
2452
|
+
}, Pt = {
|
|
2408
2453
|
display: "flex",
|
|
2409
2454
|
alignItems: "center",
|
|
2410
2455
|
gap: "8px",
|
|
2411
2456
|
fontSize: "14px",
|
|
2412
2457
|
color: "var(--page-text, #111827)"
|
|
2413
|
-
},
|
|
2458
|
+
}, Ft = (e) => e ? {
|
|
2414
2459
|
readOnly: !0,
|
|
2415
2460
|
tabIndex: -1,
|
|
2416
2461
|
onMouseDown: (e) => e.preventDefault()
|
|
2417
2462
|
} : {};
|
|
2418
|
-
function
|
|
2463
|
+
function It(e, t) {
|
|
2419
2464
|
if (!e) return !0;
|
|
2420
2465
|
let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
|
|
2421
2466
|
switch (e.op) {
|
|
@@ -2429,11 +2474,11 @@ function Ft(e, t) {
|
|
|
2429
2474
|
default: return !1;
|
|
2430
2475
|
}
|
|
2431
2476
|
}
|
|
2432
|
-
var
|
|
2477
|
+
var Lt = {
|
|
2433
2478
|
display: "flex",
|
|
2434
2479
|
flexDirection: "column",
|
|
2435
2480
|
gap: 6
|
|
2436
|
-
},
|
|
2481
|
+
}, Rt = {
|
|
2437
2482
|
font: "inherit",
|
|
2438
2483
|
fontSize: 15,
|
|
2439
2484
|
padding: "10px 12px",
|
|
@@ -2444,17 +2489,17 @@ var It = {
|
|
|
2444
2489
|
width: "100%",
|
|
2445
2490
|
boxSizing: "border-box"
|
|
2446
2491
|
};
|
|
2447
|
-
function
|
|
2492
|
+
function zt(e, t) {
|
|
2448
2493
|
let n = Array.isArray(e?.options) ? e.options : [];
|
|
2449
2494
|
if (!e?.parentField) return n;
|
|
2450
2495
|
let r = t?.[e.parentField];
|
|
2451
2496
|
return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
|
|
2452
2497
|
}
|
|
2453
|
-
var
|
|
2454
|
-
function
|
|
2498
|
+
var Bt = "g-recaptcha-response", Vt = (e) => e?.type === "recaptcha" ? Bt : e?.name;
|
|
2499
|
+
function Ht({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
2455
2500
|
let a = /* @__PURE__ */ d("span", {
|
|
2456
2501
|
style: {
|
|
2457
|
-
...
|
|
2502
|
+
...Mt,
|
|
2458
2503
|
fontSize: 14
|
|
2459
2504
|
},
|
|
2460
2505
|
children: [e.label, e.required ? " *" : ""]
|
|
@@ -2463,7 +2508,7 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2463
2508
|
required: e.required || void 0,
|
|
2464
2509
|
placeholder: e.placeholder || void 0,
|
|
2465
2510
|
disabled: r || void 0,
|
|
2466
|
-
style:
|
|
2511
|
+
style: Rt,
|
|
2467
2512
|
value: t ?? "",
|
|
2468
2513
|
onChange: (t) => n(e.name, t.target.value)
|
|
2469
2514
|
};
|
|
@@ -2492,11 +2537,11 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2492
2537
|
borderRadius: 8,
|
|
2493
2538
|
display: "block"
|
|
2494
2539
|
}
|
|
2495
|
-
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(
|
|
2540
|
+
}) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(qt, {
|
|
2496
2541
|
theme: e.captchaTheme,
|
|
2497
2542
|
size: e.captchaSize,
|
|
2498
2543
|
inert: r,
|
|
2499
|
-
onChange: (e) => n(
|
|
2544
|
+
onChange: (e) => n(Bt, e)
|
|
2500
2545
|
}) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(nt, {
|
|
2501
2546
|
url: e.src,
|
|
2502
2547
|
style: { width: "100%" }
|
|
@@ -2509,14 +2554,14 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2509
2554
|
display: "block"
|
|
2510
2555
|
}
|
|
2511
2556
|
}) : null : /* @__PURE__ */ d("label", {
|
|
2512
|
-
style:
|
|
2557
|
+
style: Lt,
|
|
2513
2558
|
children: [
|
|
2514
2559
|
a,
|
|
2515
2560
|
e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
|
|
2516
2561
|
...o,
|
|
2517
2562
|
rows: 4,
|
|
2518
2563
|
style: {
|
|
2519
|
-
...
|
|
2564
|
+
...Rt,
|
|
2520
2565
|
resize: "vertical"
|
|
2521
2566
|
}
|
|
2522
2567
|
}) : e.type === "select" ? /* @__PURE__ */ d("select", {
|
|
@@ -2525,7 +2570,7 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2525
2570
|
children: [/* @__PURE__ */ u("option", {
|
|
2526
2571
|
value: "",
|
|
2527
2572
|
children: e.placeholder || "—"
|
|
2528
|
-
}),
|
|
2573
|
+
}), zt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
|
|
2529
2574
|
value: typeof e == "string" ? e : e.value,
|
|
2530
2575
|
children: typeof e == "string" ? e : e.label ?? e.value
|
|
2531
2576
|
}, t))]
|
|
@@ -2572,8 +2617,8 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2572
2617
|
]
|
|
2573
2618
|
});
|
|
2574
2619
|
}
|
|
2575
|
-
function
|
|
2576
|
-
let { tenant: y, apiUrl: b } = r(
|
|
2620
|
+
function Ut({ 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 }) {
|
|
2621
|
+
let { tenant: y, apiUrl: b } = r(Y), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
|
|
2577
2622
|
i(() => {
|
|
2578
2623
|
if (!f || !s) return;
|
|
2579
2624
|
let e = !0;
|
|
@@ -2594,11 +2639,11 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2594
2639
|
section: e,
|
|
2595
2640
|
fields: []
|
|
2596
2641
|
}) : j[j.length - 1].fields.push(e);
|
|
2597
|
-
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section ||
|
|
2642
|
+
let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || It(e.section.condition, T)).map((e) => ({
|
|
2598
2643
|
...e,
|
|
2599
|
-
fields: e.fields.filter((e) =>
|
|
2644
|
+
fields: e.fields.filter((e) => It(e.condition, T))
|
|
2600
2645
|
})), 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) => {
|
|
2601
|
-
let t = T[
|
|
2646
|
+
let t = T[Vt(e)];
|
|
2602
2647
|
return e.required && (t == null || t === "" || t === !1);
|
|
2603
2648
|
}), R = F >= N.length - 1, z = (e, t) => E((n) => {
|
|
2604
2649
|
let r = {
|
|
@@ -2654,11 +2699,11 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2654
2699
|
}
|
|
2655
2700
|
},
|
|
2656
2701
|
style: {
|
|
2657
|
-
...
|
|
2702
|
+
...jt,
|
|
2658
2703
|
display: k === "success" ? "none" : "flex"
|
|
2659
2704
|
},
|
|
2660
2705
|
children: f && s ? /* @__PURE__ */ d(l, { children: [
|
|
2661
|
-
P && /* @__PURE__ */ u(
|
|
2706
|
+
P && /* @__PURE__ */ u(vn, {
|
|
2662
2707
|
steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
|
|
2663
2708
|
active: F + 1,
|
|
2664
2709
|
style: { marginBottom: 8 }
|
|
@@ -2671,9 +2716,9 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2671
2716
|
},
|
|
2672
2717
|
children: N[F].section.help
|
|
2673
2718
|
}),
|
|
2674
|
-
I.map((e) => /* @__PURE__ */ u(
|
|
2719
|
+
I.map((e) => /* @__PURE__ */ u(Ht, {
|
|
2675
2720
|
field: e,
|
|
2676
|
-
value: T[
|
|
2721
|
+
value: T[Vt(e)],
|
|
2677
2722
|
values: T,
|
|
2678
2723
|
onChange: z,
|
|
2679
2724
|
inert: h
|
|
@@ -2744,10 +2789,10 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2744
2789
|
]
|
|
2745
2790
|
});
|
|
2746
2791
|
}
|
|
2747
|
-
var
|
|
2792
|
+
var Wt = null, Gt = null, Kt = (e) => {
|
|
2748
2793
|
let t = typeof e == "string" && e.trim() ? e.trim() : "";
|
|
2749
|
-
if (
|
|
2750
|
-
if (
|
|
2794
|
+
if (Wt && Gt === t) return Wt;
|
|
2795
|
+
if (Wt && typeof window < "u") {
|
|
2751
2796
|
for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
|
|
2752
2797
|
delete window[e];
|
|
2753
2798
|
} catch {
|
|
@@ -2755,22 +2800,22 @@ var Ut = null, Wt = null, Gt = (e) => {
|
|
|
2755
2800
|
}
|
|
2756
2801
|
document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
|
|
2757
2802
|
}
|
|
2758
|
-
return
|
|
2803
|
+
return Gt = t, Wt = new Promise((e) => {
|
|
2759
2804
|
if (typeof window > "u") return;
|
|
2760
2805
|
if (window.grecaptcha?.render) return e(window.grecaptcha);
|
|
2761
2806
|
window.__webimRecaptchaReady = () => e(window.grecaptcha);
|
|
2762
2807
|
let n = document.createElement("script");
|
|
2763
2808
|
n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
|
|
2764
|
-
}),
|
|
2809
|
+
}), Wt;
|
|
2765
2810
|
};
|
|
2766
|
-
function
|
|
2767
|
-
let p = r(
|
|
2811
|
+
function qt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
|
|
2812
|
+
let p = r(Y), 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);
|
|
2768
2813
|
if (_.current = f, i(() => {
|
|
2769
2814
|
if (l || !h || !g.current) return;
|
|
2770
2815
|
let e = !0, r = (t) => {
|
|
2771
2816
|
e && typeof _.current == "function" && _.current(t);
|
|
2772
2817
|
};
|
|
2773
|
-
return
|
|
2818
|
+
return Kt(a).then((i) => {
|
|
2774
2819
|
if (!(!e || !g.current || !i?.render)) {
|
|
2775
2820
|
g.current.innerHTML = "", r("");
|
|
2776
2821
|
try {
|
|
@@ -2852,17 +2897,17 @@ function Kt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
|
|
|
2852
2897
|
children: /* @__PURE__ */ u("div", { ref: g })
|
|
2853
2898
|
}) : null;
|
|
2854
2899
|
}
|
|
2855
|
-
function
|
|
2900
|
+
function Jt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
2856
2901
|
return /* @__PURE__ */ u("label", {
|
|
2857
2902
|
ref: r,
|
|
2858
2903
|
style: {
|
|
2859
|
-
...
|
|
2904
|
+
...Mt,
|
|
2860
2905
|
...A(n)
|
|
2861
2906
|
},
|
|
2862
2907
|
children: Be(t, e, i)
|
|
2863
2908
|
});
|
|
2864
2909
|
}
|
|
2865
|
-
function
|
|
2910
|
+
function Yt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2866
2911
|
return /* @__PURE__ */ u("input", {
|
|
2867
2912
|
ref: a,
|
|
2868
2913
|
type: e,
|
|
@@ -2870,13 +2915,13 @@ function Jt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
|
|
|
2870
2915
|
placeholder: n,
|
|
2871
2916
|
required: !o && !!r,
|
|
2872
2917
|
style: {
|
|
2873
|
-
...
|
|
2918
|
+
...Nt,
|
|
2874
2919
|
...A(i)
|
|
2875
2920
|
},
|
|
2876
|
-
...
|
|
2921
|
+
...Ft(o)
|
|
2877
2922
|
});
|
|
2878
2923
|
}
|
|
2879
|
-
function
|
|
2924
|
+
function Xt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
|
|
2880
2925
|
return /* @__PURE__ */ u("textarea", {
|
|
2881
2926
|
ref: a,
|
|
2882
2927
|
name: e || void 0,
|
|
@@ -2884,18 +2929,18 @@ function Yt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
|
|
|
2884
2929
|
rows: n,
|
|
2885
2930
|
required: !o && !!r,
|
|
2886
2931
|
style: {
|
|
2887
|
-
...
|
|
2932
|
+
...Nt,
|
|
2888
2933
|
resize: "vertical",
|
|
2889
2934
|
...A(i)
|
|
2890
2935
|
},
|
|
2891
|
-
...
|
|
2936
|
+
...Ft(o)
|
|
2892
2937
|
});
|
|
2893
2938
|
}
|
|
2894
|
-
function
|
|
2939
|
+
function Zt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
|
|
2895
2940
|
return /* @__PURE__ */ d("label", {
|
|
2896
2941
|
ref: o,
|
|
2897
2942
|
style: {
|
|
2898
|
-
...
|
|
2943
|
+
...Pt,
|
|
2899
2944
|
...A(a)
|
|
2900
2945
|
},
|
|
2901
2946
|
children: [/* @__PURE__ */ u("input", {
|
|
@@ -2912,7 +2957,7 @@ function Xt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
|
|
|
2912
2957
|
}), t]
|
|
2913
2958
|
});
|
|
2914
2959
|
}
|
|
2915
|
-
function
|
|
2960
|
+
function Qt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
|
|
2916
2961
|
return /* @__PURE__ */ d("select", {
|
|
2917
2962
|
ref: a,
|
|
2918
2963
|
name: e || void 0,
|
|
@@ -2921,7 +2966,7 @@ function Zt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2921
2966
|
onMouseDown: o ? (e) => e.preventDefault() : void 0,
|
|
2922
2967
|
tabIndex: o ? -1 : void 0,
|
|
2923
2968
|
style: {
|
|
2924
|
-
...
|
|
2969
|
+
...Nt,
|
|
2925
2970
|
appearance: "auto",
|
|
2926
2971
|
...A(i)
|
|
2927
2972
|
},
|
|
@@ -2935,12 +2980,12 @@ function Zt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
|
|
|
2935
2980
|
}, t))]
|
|
2936
2981
|
});
|
|
2937
2982
|
}
|
|
2938
|
-
function
|
|
2983
|
+
function $t({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
|
|
2939
2984
|
let [s, l] = c(null);
|
|
2940
2985
|
return /* @__PURE__ */ d("label", {
|
|
2941
2986
|
ref: a,
|
|
2942
2987
|
style: {
|
|
2943
|
-
...
|
|
2988
|
+
...Nt,
|
|
2944
2989
|
display: "flex",
|
|
2945
2990
|
alignItems: "center",
|
|
2946
2991
|
gap: "8px",
|
|
@@ -2967,7 +3012,7 @@ function Qt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
|
|
|
2967
3012
|
]
|
|
2968
3013
|
});
|
|
2969
3014
|
}
|
|
2970
|
-
function
|
|
3015
|
+
function en({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
2971
3016
|
return /* @__PURE__ */ u("button", {
|
|
2972
3017
|
ref: n,
|
|
2973
3018
|
type: r ? "button" : "submit",
|
|
@@ -2987,7 +3032,7 @@ function $t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2987
3032
|
children: e
|
|
2988
3033
|
});
|
|
2989
3034
|
}
|
|
2990
|
-
function
|
|
3035
|
+
function tn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
2991
3036
|
let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
|
|
2992
3037
|
return /* @__PURE__ */ u("div", {
|
|
2993
3038
|
ref: r,
|
|
@@ -3004,8 +3049,8 @@ function en({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
3004
3049
|
}, t))
|
|
3005
3050
|
});
|
|
3006
3051
|
}
|
|
3007
|
-
function
|
|
3008
|
-
let { tenant: v, apiUrl: y, locale: b } = r(
|
|
3052
|
+
function nn({ 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: _ }) {
|
|
3053
|
+
let { tenant: v, apiUrl: y, locale: b } = r(Y), x = r(Z), S = r(be), [, C] = c(0);
|
|
3009
3054
|
i(() => {
|
|
3010
3055
|
if (typeof window > "u") return;
|
|
3011
3056
|
let e = () => C((e) => e + 1);
|
|
@@ -3013,7 +3058,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3013
3058
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
3014
3059
|
};
|
|
3015
3060
|
}, []);
|
|
3016
|
-
let w =
|
|
3061
|
+
let w = X(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? xe(S) : 1, [k, j] = c(null);
|
|
3017
3062
|
if (i(() => {
|
|
3018
3063
|
if (!e || D) return;
|
|
3019
3064
|
let n = !0, r = new URLSearchParams();
|
|
@@ -3068,7 +3113,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3068
3113
|
...A(g)
|
|
3069
3114
|
},
|
|
3070
3115
|
children: N.map((e) => {
|
|
3071
|
-
let t = o ?
|
|
3116
|
+
let t = o ? Ce(e?.data, o) : null, r = s ? Te(Ce(e?.data, s)) : null, i = l ? Ce(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : Te(i), f = n === "list";
|
|
3072
3117
|
return /* @__PURE__ */ d("div", {
|
|
3073
3118
|
style: {
|
|
3074
3119
|
display: "flex",
|
|
@@ -3123,8 +3168,8 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3123
3168
|
})
|
|
3124
3169
|
});
|
|
3125
3170
|
}
|
|
3126
|
-
function
|
|
3127
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3171
|
+
function rn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3172
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Se(), s = {
|
|
3128
3173
|
height: 34,
|
|
3129
3174
|
padding: "0 12px",
|
|
3130
3175
|
borderRadius: 8,
|
|
@@ -3172,7 +3217,7 @@ function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3172
3217
|
name: `f_${e.name}`,
|
|
3173
3218
|
defaultValue: o[e.name] ?? "",
|
|
3174
3219
|
style: s,
|
|
3175
|
-
...
|
|
3220
|
+
...Ft(i),
|
|
3176
3221
|
children: [/* @__PURE__ */ u("option", {
|
|
3177
3222
|
value: "",
|
|
3178
3223
|
children: e.label || e.name
|
|
@@ -3187,7 +3232,7 @@ function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3187
3232
|
name: `f_${e.name}`,
|
|
3188
3233
|
defaultValue: o[e.name] ?? "",
|
|
3189
3234
|
style: s,
|
|
3190
|
-
...
|
|
3235
|
+
...Ft(i),
|
|
3191
3236
|
children: [
|
|
3192
3237
|
/* @__PURE__ */ u("option", {
|
|
3193
3238
|
value: "",
|
|
@@ -3208,7 +3253,7 @@ function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3208
3253
|
defaultValue: o[e.name] ?? "",
|
|
3209
3254
|
placeholder: e.label || e.name,
|
|
3210
3255
|
style: s,
|
|
3211
|
-
...
|
|
3256
|
+
...Ft(i)
|
|
3212
3257
|
}, e.name)), /* @__PURE__ */ u("button", {
|
|
3213
3258
|
type: "submit",
|
|
3214
3259
|
style: {
|
|
@@ -3221,12 +3266,12 @@ function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
|
|
|
3221
3266
|
fontWeight: 600,
|
|
3222
3267
|
cursor: i ? "default" : "pointer"
|
|
3223
3268
|
},
|
|
3224
|
-
...
|
|
3269
|
+
...Ft(i),
|
|
3225
3270
|
children: t
|
|
3226
3271
|
})]
|
|
3227
3272
|
});
|
|
3228
3273
|
}
|
|
3229
|
-
function
|
|
3274
|
+
function an({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
3230
3275
|
return e.length ? /* @__PURE__ */ u("nav", {
|
|
3231
3276
|
ref: r,
|
|
3232
3277
|
"aria-label": "Breadcrumb",
|
|
@@ -3276,8 +3321,8 @@ function rn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3276
3321
|
})
|
|
3277
3322
|
}) : null;
|
|
3278
3323
|
}
|
|
3279
|
-
function
|
|
3280
|
-
let { tenant: g, apiUrl: _ } = r(
|
|
3324
|
+
function on({ 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 }) {
|
|
3325
|
+
let { tenant: g, apiUrl: _ } = r(Y), v = r(be), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3281
3326
|
i(() => {
|
|
3282
3327
|
if (!o || Number.isFinite(x)) return;
|
|
3283
3328
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3296,7 +3341,7 @@ function an({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3296
3341
|
]);
|
|
3297
3342
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
3298
3343
|
if (o && C === null || o && f && !(C > 0)) return null;
|
|
3299
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3344
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? xe(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
3300
3345
|
if (o) {
|
|
3301
3346
|
if (typeof window < "u") {
|
|
3302
3347
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -3361,15 +3406,15 @@ function an({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3361
3406
|
]
|
|
3362
3407
|
});
|
|
3363
3408
|
}
|
|
3364
|
-
var
|
|
3409
|
+
var sn = "webim.page_mode", cn = () => {
|
|
3365
3410
|
if (typeof window > "u") return "auto";
|
|
3366
3411
|
try {
|
|
3367
|
-
let e = window.localStorage.getItem(
|
|
3412
|
+
let e = window.localStorage.getItem(sn);
|
|
3368
3413
|
return e === "light" || e === "dark" ? e : "auto";
|
|
3369
3414
|
} catch {
|
|
3370
3415
|
return "auto";
|
|
3371
3416
|
}
|
|
3372
|
-
},
|
|
3417
|
+
}, ln = (e) => {
|
|
3373
3418
|
let t = {
|
|
3374
3419
|
width: 16,
|
|
3375
3420
|
height: 16,
|
|
@@ -3401,13 +3446,13 @@ var on = "webim.page_mode", sn = () => {
|
|
|
3401
3446
|
rx: "2"
|
|
3402
3447
|
}), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
|
|
3403
3448
|
});
|
|
3404
|
-
},
|
|
3449
|
+
}, un = {
|
|
3405
3450
|
light: "Light theme",
|
|
3406
3451
|
dark: "Dark theme",
|
|
3407
3452
|
auto: "Follow the device theme"
|
|
3408
3453
|
};
|
|
3409
|
-
function
|
|
3410
|
-
let [o, l] = c(a ? "auto" :
|
|
3454
|
+
function dn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
3455
|
+
let [o, l] = c(a ? "auto" : cn), d = s(null), f = (e) => {
|
|
3411
3456
|
d.current = e, typeof r == "function" && r(e);
|
|
3412
3457
|
};
|
|
3413
3458
|
i(() => {
|
|
@@ -3415,7 +3460,7 @@ function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3415
3460
|
let e = d.current?.closest?.(".webim-page");
|
|
3416
3461
|
e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
|
|
3417
3462
|
try {
|
|
3418
|
-
o === "auto" ? window.localStorage.removeItem(
|
|
3463
|
+
o === "auto" ? window.localStorage.removeItem(sn) : window.localStorage.setItem(sn, o);
|
|
3419
3464
|
} catch {}
|
|
3420
3465
|
}, [o, a]);
|
|
3421
3466
|
let p = t === !1 ? ["light", "dark"] : [
|
|
@@ -3450,8 +3495,8 @@ function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3450
3495
|
},
|
|
3451
3496
|
children: p.map((e) => /* @__PURE__ */ u("button", {
|
|
3452
3497
|
type: "button",
|
|
3453
|
-
title:
|
|
3454
|
-
"aria-label":
|
|
3498
|
+
title: un[e],
|
|
3499
|
+
"aria-label": un[e],
|
|
3455
3500
|
"aria-pressed": e === m,
|
|
3456
3501
|
onClick: a ? void 0 : () => l(e),
|
|
3457
3502
|
style: {
|
|
@@ -3462,15 +3507,15 @@ function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3462
3507
|
background: e === m ? "var(--page-accent, #111827)" : "transparent",
|
|
3463
3508
|
opacity: e === m ? 1 : .7
|
|
3464
3509
|
},
|
|
3465
|
-
children:
|
|
3510
|
+
children: ln(e)
|
|
3466
3511
|
}, e))
|
|
3467
3512
|
});
|
|
3468
3513
|
let g = p[(p.indexOf(m) + 1) % p.length];
|
|
3469
3514
|
return /* @__PURE__ */ u("button", {
|
|
3470
3515
|
ref: f,
|
|
3471
3516
|
type: "button",
|
|
3472
|
-
title:
|
|
3473
|
-
"aria-label": `Theme: ${
|
|
3517
|
+
title: un[m],
|
|
3518
|
+
"aria-label": `Theme: ${un[m]} — switch to ${un[g]}`,
|
|
3474
3519
|
onClick: a ? void 0 : () => l(g),
|
|
3475
3520
|
style: {
|
|
3476
3521
|
...h,
|
|
@@ -3479,10 +3524,10 @@ function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
|
|
|
3479
3524
|
border: "1px solid rgba(148, 163, 184, 0.4)",
|
|
3480
3525
|
...A(n)
|
|
3481
3526
|
},
|
|
3482
|
-
children:
|
|
3527
|
+
children: ln(m)
|
|
3483
3528
|
});
|
|
3484
3529
|
}
|
|
3485
|
-
function
|
|
3530
|
+
function fn(e) {
|
|
3486
3531
|
let t = e?.parentElement;
|
|
3487
3532
|
for (; t && t !== document.body;) {
|
|
3488
3533
|
let e = getComputedStyle(t).overflowY;
|
|
@@ -3491,7 +3536,7 @@ function dn(e) {
|
|
|
3491
3536
|
}
|
|
3492
3537
|
return window;
|
|
3493
3538
|
}
|
|
3494
|
-
var
|
|
3539
|
+
var pn = (e) => e === window ? window.scrollY : e.scrollTop, mn = {
|
|
3495
3540
|
"bottom-right": (e) => ({
|
|
3496
3541
|
right: e,
|
|
3497
3542
|
bottom: e
|
|
@@ -3506,7 +3551,7 @@ var fn = (e) => e === window ? window.scrollY : e.scrollTop, pn = {
|
|
|
3506
3551
|
transform: "translateX(-50%)"
|
|
3507
3552
|
})
|
|
3508
3553
|
};
|
|
3509
|
-
function
|
|
3554
|
+
function hn({ 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 }) {
|
|
3510
3555
|
let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
|
|
3511
3556
|
b(e), typeof p == "function" && p(e);
|
|
3512
3557
|
};
|
|
@@ -3517,8 +3562,8 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3517
3562
|
}
|
|
3518
3563
|
if (!y) return;
|
|
3519
3564
|
let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
|
|
3520
|
-
let t =
|
|
3521
|
-
v(n ||
|
|
3565
|
+
let t = fn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
|
|
3566
|
+
v(n || pn(t) > e);
|
|
3522
3567
|
};
|
|
3523
3568
|
return t(), document.addEventListener("scroll", t, {
|
|
3524
3569
|
capture: !0,
|
|
@@ -3532,7 +3577,7 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3532
3577
|
]);
|
|
3533
3578
|
let S = () => {
|
|
3534
3579
|
if (m) return;
|
|
3535
|
-
let e =
|
|
3580
|
+
let e = fn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
|
|
3536
3581
|
e === window ? window.scrollTo({
|
|
3537
3582
|
top: 0,
|
|
3538
3583
|
behavior: n
|
|
@@ -3540,7 +3585,7 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3540
3585
|
top: 0,
|
|
3541
3586
|
behavior: n
|
|
3542
3587
|
});
|
|
3543
|
-
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E =
|
|
3588
|
+
}, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = mn[n] ? n : "bottom-right", D = h ? {
|
|
3544
3589
|
position: "fixed",
|
|
3545
3590
|
zIndex: 5,
|
|
3546
3591
|
bottom: (h.bottom ?? 0) + C,
|
|
@@ -3553,7 +3598,7 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3553
3598
|
} : {
|
|
3554
3599
|
position: "fixed",
|
|
3555
3600
|
zIndex: 2147482e3,
|
|
3556
|
-
...
|
|
3601
|
+
...mn[E](C)
|
|
3557
3602
|
};
|
|
3558
3603
|
return /* @__PURE__ */ d("button", {
|
|
3559
3604
|
ref: x,
|
|
@@ -3604,7 +3649,7 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
|
|
|
3604
3649
|
}), w ? /* @__PURE__ */ u("span", { children: T }) : null]
|
|
3605
3650
|
});
|
|
3606
3651
|
}
|
|
3607
|
-
var
|
|
3652
|
+
var gn = {
|
|
3608
3653
|
facebook: {
|
|
3609
3654
|
label: "Facebook",
|
|
3610
3655
|
color: "#1877f2",
|
|
@@ -3671,8 +3716,8 @@ var hn = {
|
|
|
3671
3716
|
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"
|
|
3672
3717
|
}
|
|
3673
3718
|
};
|
|
3674
|
-
function
|
|
3675
|
-
let l = Array.isArray(e) ? e.filter((e) => e &&
|
|
3719
|
+
function _n({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
|
|
3720
|
+
let l = Array.isArray(e) ? e.filter((e) => e && gn[e.network]) : [];
|
|
3676
3721
|
if (!l.length) return null;
|
|
3677
3722
|
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;
|
|
3678
3723
|
return /* @__PURE__ */ u("div", {
|
|
@@ -3685,7 +3730,7 @@ function gn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3685
3730
|
...A(o)
|
|
3686
3731
|
},
|
|
3687
3732
|
children: l.map((e, r) => {
|
|
3688
|
-
let i =
|
|
3733
|
+
let i = gn[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);
|
|
3689
3734
|
return /* @__PURE__ */ u("a", {
|
|
3690
3735
|
href: e.url || "#",
|
|
3691
3736
|
onClick: h,
|
|
@@ -3719,7 +3764,7 @@ function gn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
|
|
|
3719
3764
|
})
|
|
3720
3765
|
});
|
|
3721
3766
|
}
|
|
3722
|
-
function
|
|
3767
|
+
function vn({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
|
|
3723
3768
|
if (!t.length) return null;
|
|
3724
3769
|
let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
|
|
3725
3770
|
width: 32,
|
|
@@ -3797,7 +3842,7 @@ function _n({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
|
|
|
3797
3842
|
})
|
|
3798
3843
|
});
|
|
3799
3844
|
}
|
|
3800
|
-
var
|
|
3845
|
+
var yn = {
|
|
3801
3846
|
small: {
|
|
3802
3847
|
w: 132,
|
|
3803
3848
|
h: 46,
|
|
@@ -3819,74 +3864,123 @@ var vn = {
|
|
|
3819
3864
|
title: 12.5,
|
|
3820
3865
|
avatar: 46
|
|
3821
3866
|
}
|
|
3822
|
-
},
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
let
|
|
3826
|
-
|
|
3827
|
-
|
|
3867
|
+
}, bn = (e) => yn[e] ?? yn.medium;
|
|
3868
|
+
yn.medium.w, yn.medium.h;
|
|
3869
|
+
var xn = (e) => String(e?.group ?? "").trim(), Sn = (e) => {
|
|
3870
|
+
let t = [], n = /* @__PURE__ */ new Map();
|
|
3871
|
+
return e.forEach((e, r) => {
|
|
3872
|
+
let i = xn(e) || `#${r}`;
|
|
3873
|
+
n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
|
|
3874
|
+
}), t.flatMap((e) => n.get(e));
|
|
3875
|
+
};
|
|
3876
|
+
function Cn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
|
|
3877
|
+
let i = bn(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 = [];
|
|
3878
|
+
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);
|
|
3879
|
+
d = Sn(d);
|
|
3880
|
+
for (let [e, t] of u) u.set(e, Sn(t));
|
|
3881
|
+
let f = (e, t) => o + (xn(e) !== xn(t) && (xn(e) || xn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
|
|
3828
3882
|
if (t.has(e.id)) return 0;
|
|
3829
3883
|
t.add(e.id);
|
|
3830
|
-
let n =
|
|
3831
|
-
return
|
|
3884
|
+
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);
|
|
3885
|
+
return p.set(e.id, i), i;
|
|
3832
3886
|
};
|
|
3833
|
-
|
|
3834
|
-
let
|
|
3835
|
-
if (
|
|
3836
|
-
|
|
3837
|
-
let
|
|
3838
|
-
|
|
3887
|
+
d.forEach((e) => m(e, /* @__PURE__ */ new Set()));
|
|
3888
|
+
let h = [], g = [], _ = /* @__PURE__ */ new Map(), v = 0, y = (e, t, r, o) => {
|
|
3889
|
+
if (o.has(e.id)) return;
|
|
3890
|
+
o.add(e.id);
|
|
3891
|
+
let c = t + ((p.get(e.id) ?? a) - a) / 2, d = r * s, m = n ? d : c, b = n ? c : d;
|
|
3892
|
+
h.push({
|
|
3839
3893
|
node: e,
|
|
3840
|
-
x:
|
|
3841
|
-
y:
|
|
3842
|
-
})
|
|
3843
|
-
let
|
|
3844
|
-
|
|
3845
|
-
let
|
|
3846
|
-
|
|
3894
|
+
x: m,
|
|
3895
|
+
y: b
|
|
3896
|
+
});
|
|
3897
|
+
let x = xn(e);
|
|
3898
|
+
if (x) {
|
|
3899
|
+
let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
|
|
3900
|
+
_.has(t) || _.set(t, {
|
|
3901
|
+
title: x,
|
|
3902
|
+
color: "",
|
|
3903
|
+
members: []
|
|
3904
|
+
});
|
|
3905
|
+
let n = _.get(t);
|
|
3906
|
+
!n.color && e.groupColor && (n.color = e.groupColor), n.members.push({
|
|
3907
|
+
x: m,
|
|
3908
|
+
y: b
|
|
3909
|
+
});
|
|
3910
|
+
}
|
|
3911
|
+
v = Math.max(v, d + (n ? i.w : i.h));
|
|
3912
|
+
let S = t, C = u.get(e.id) ?? [];
|
|
3913
|
+
C.forEach((e, t) => {
|
|
3914
|
+
t && (S += f(C[t - 1], e));
|
|
3915
|
+
let l = S + ((p.get(e.id) ?? a) - a) / 2 + a / 2, u = (r + 1) * s;
|
|
3916
|
+
g.push(n ? {
|
|
3847
3917
|
from: {
|
|
3848
|
-
x:
|
|
3849
|
-
y:
|
|
3918
|
+
x: d + i.w,
|
|
3919
|
+
y: c + i.h / 2
|
|
3850
3920
|
},
|
|
3851
3921
|
to: {
|
|
3852
|
-
x:
|
|
3853
|
-
y:
|
|
3922
|
+
x: u,
|
|
3923
|
+
y: l
|
|
3854
3924
|
}
|
|
3855
3925
|
} : {
|
|
3856
3926
|
from: {
|
|
3857
|
-
x:
|
|
3858
|
-
y:
|
|
3927
|
+
x: c + i.w / 2,
|
|
3928
|
+
y: d + i.h
|
|
3859
3929
|
},
|
|
3860
3930
|
to: {
|
|
3861
|
-
x:
|
|
3862
|
-
y:
|
|
3931
|
+
x: l,
|
|
3932
|
+
y: u
|
|
3863
3933
|
}
|
|
3864
|
-
}),
|
|
3865
|
-
}
|
|
3866
|
-
},
|
|
3867
|
-
|
|
3868
|
-
|
|
3934
|
+
}), y(e, S, r + 1, o), S += p.get(e.id) ?? a;
|
|
3935
|
+
});
|
|
3936
|
+
}, b = 0, x = /* @__PURE__ */ new Set();
|
|
3937
|
+
d.forEach((e, t) => {
|
|
3938
|
+
t && (b += f(d[t - 1], e)), y(e, b, 0, x), b += p.get(e.id) ?? a;
|
|
3939
|
+
});
|
|
3940
|
+
let S = Math.max(b, a), C = r === "hidden" ? 0 : 22, w = [..._.values()].map((e) => {
|
|
3941
|
+
let t = Math.min(...e.members.map((e) => e.x)) - 12, n = Math.max(...e.members.map((e) => e.x)) + i.w + 12, a = Math.min(...e.members.map((e) => e.y)) - 12 - (r === "bottom" ? 0 : C), o = Math.max(...e.members.map((e) => e.y)) + i.h + 12 + (r === "bottom" ? C : 0);
|
|
3942
|
+
return {
|
|
3943
|
+
x: t,
|
|
3944
|
+
y: a,
|
|
3945
|
+
width: n - t,
|
|
3946
|
+
height: o - a,
|
|
3947
|
+
title: e.title,
|
|
3948
|
+
color: e.color
|
|
3949
|
+
};
|
|
3950
|
+
}), T = n ? Math.max(v, i.w) : S, E = n ? S : Math.max(v, i.h), D = Math.max(0, ...w.map((e) => -e.x)), O = Math.max(0, ...w.map((e) => -e.y));
|
|
3951
|
+
if (w.length && (T = Math.max(T, ...w.map((e) => e.x + e.width)) + D, E = Math.max(E, ...w.map((e) => e.y + e.height)) + O, D || O)) {
|
|
3952
|
+
for (let e of h) e.x += D, e.y += O;
|
|
3953
|
+
for (let e of g) e.from = {
|
|
3954
|
+
x: e.from.x + D,
|
|
3955
|
+
y: e.from.y + O
|
|
3956
|
+
}, e.to = {
|
|
3957
|
+
x: e.to.x + D,
|
|
3958
|
+
y: e.to.y + O
|
|
3959
|
+
};
|
|
3960
|
+
for (let e of w) e.x += D, e.y += O;
|
|
3961
|
+
}
|
|
3869
3962
|
return {
|
|
3870
|
-
boxes:
|
|
3871
|
-
links:
|
|
3872
|
-
|
|
3873
|
-
|
|
3963
|
+
boxes: h,
|
|
3964
|
+
links: g,
|
|
3965
|
+
groups: w,
|
|
3966
|
+
width: T,
|
|
3967
|
+
height: E,
|
|
3874
3968
|
horizontal: n
|
|
3875
3969
|
};
|
|
3876
3970
|
}
|
|
3877
|
-
var
|
|
3971
|
+
var wn = (e, t) => {
|
|
3878
3972
|
let n = String(e ?? "");
|
|
3879
3973
|
return n.length > t ? `${n.slice(0, t - 1)}…` : n;
|
|
3880
|
-
},
|
|
3974
|
+
}, Tn = (e) => {
|
|
3881
3975
|
let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
|
|
3882
3976
|
if (!t) return "#ffffff";
|
|
3883
3977
|
let n = t[1];
|
|
3884
3978
|
n.length === 3 && (n = [...n].map((e) => e + e).join(""));
|
|
3885
3979
|
let r = parseInt(n, 16);
|
|
3886
3980
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3887
|
-
},
|
|
3888
|
-
function
|
|
3889
|
-
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 ? "" :
|
|
3981
|
+
}, En = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
3982
|
+
function Dn(e, t = {}) {
|
|
3983
|
+
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 ? "" : Te(e);
|
|
3890
3984
|
return n.map((e) => {
|
|
3891
3985
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3892
3986
|
return {
|
|
@@ -3896,15 +3990,16 @@ function wn(e, t = {}) {
|
|
|
3896
3990
|
photo: t.photoField && r(n[t.photoField]) || "",
|
|
3897
3991
|
parent: t.parentField ? o : null,
|
|
3898
3992
|
cv: t.cvField ? i(n[t.cvField]) : "",
|
|
3899
|
-
href: t.hrefField ? i(n[t.hrefField]) : ""
|
|
3993
|
+
href: t.hrefField ? i(n[t.hrefField]) : "",
|
|
3994
|
+
group: t.groupField ? i(n[t.groupField]) : ""
|
|
3900
3995
|
};
|
|
3901
3996
|
});
|
|
3902
3997
|
}
|
|
3903
|
-
var
|
|
3998
|
+
var On = {
|
|
3904
3999
|
size: 36,
|
|
3905
4000
|
pad: 10
|
|
3906
4001
|
};
|
|
3907
|
-
function
|
|
4002
|
+
function kn({ node: e, onClose: t }) {
|
|
3908
4003
|
return i(() => {
|
|
3909
4004
|
let e = (e) => e.key === "Escape" && t();
|
|
3910
4005
|
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
@@ -4025,36 +4120,38 @@ function En({ node: e, onClose: t }) {
|
|
|
4025
4120
|
})
|
|
4026
4121
|
});
|
|
4027
4122
|
}
|
|
4028
|
-
function
|
|
4029
|
-
let
|
|
4123
|
+
function An({ 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 }) {
|
|
4124
|
+
let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(Y), O = r(be)?.[t], [k, j] = c(null);
|
|
4030
4125
|
i(() => {
|
|
4031
|
-
if (!t ||
|
|
4126
|
+
if (!t || O) return;
|
|
4032
4127
|
let e = !0;
|
|
4033
|
-
return fetch(`${
|
|
4128
|
+
return fetch(`${D}/dynamic/${encodeURIComponent(t)}`, { headers: E ? { "x-tenant": E } : {} }).then((e) => e.json()).then((t) => {
|
|
4034
4129
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4035
|
-
e &&
|
|
4036
|
-
}).catch(() => e &&
|
|
4130
|
+
e && j(n);
|
|
4131
|
+
}).catch(() => e && j([])), () => {
|
|
4037
4132
|
e = !1;
|
|
4038
4133
|
};
|
|
4039
4134
|
}, [
|
|
4040
4135
|
t,
|
|
4041
|
-
|
|
4042
|
-
|
|
4043
|
-
|
|
4136
|
+
E,
|
|
4137
|
+
D,
|
|
4138
|
+
O
|
|
4044
4139
|
]);
|
|
4045
|
-
let
|
|
4140
|
+
let M = t ? Dn(O ?? k ?? [], {
|
|
4046
4141
|
nameField: n,
|
|
4047
4142
|
titleField: o,
|
|
4048
4143
|
photoField: s,
|
|
4049
4144
|
parentField: f,
|
|
4050
4145
|
cvField: p,
|
|
4051
|
-
hrefField: m
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4146
|
+
hrefField: m,
|
|
4147
|
+
groupField: h
|
|
4148
|
+
}) : e, N = bn(v), { boxes: P, links: F, groups: I, width: L, height: R } = Cn(M, {
|
|
4149
|
+
size: v,
|
|
4150
|
+
horizontal: y,
|
|
4151
|
+
groupTitles: g
|
|
4055
4152
|
});
|
|
4056
|
-
if (!
|
|
4057
|
-
ref:
|
|
4153
|
+
if (!P.length) return !S && t ? /* @__PURE__ */ d("div", {
|
|
4154
|
+
ref: x,
|
|
4058
4155
|
style: {
|
|
4059
4156
|
padding: 18,
|
|
4060
4157
|
border: "1px dashed rgba(148, 163, 184, 0.6)",
|
|
@@ -4062,7 +4159,7 @@ function Dn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4062
4159
|
fontSize: 13,
|
|
4063
4160
|
opacity: .7,
|
|
4064
4161
|
textAlign: "center",
|
|
4065
|
-
...A(
|
|
4162
|
+
...A(b)
|
|
4066
4163
|
},
|
|
4067
4164
|
children: [
|
|
4068
4165
|
"Org Chart — no published entries in “",
|
|
@@ -4070,151 +4167,174 @@ function Dn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
|
|
|
4070
4167
|
"” yet"
|
|
4071
4168
|
]
|
|
4072
4169
|
}) : null;
|
|
4073
|
-
let
|
|
4170
|
+
let z = new Set(P.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
|
|
4074
4171
|
return /* @__PURE__ */ d("div", {
|
|
4075
|
-
ref:
|
|
4172
|
+
ref: x,
|
|
4076
4173
|
style: {
|
|
4077
4174
|
maxWidth: "100%",
|
|
4078
4175
|
overflowX: "auto",
|
|
4079
|
-
...A(
|
|
4176
|
+
...A(b)
|
|
4080
4177
|
},
|
|
4081
4178
|
children: [/* @__PURE__ */ d("svg", {
|
|
4082
|
-
viewBox: `0 0 ${
|
|
4179
|
+
viewBox: `0 0 ${L} ${R}`,
|
|
4083
4180
|
role: "img",
|
|
4084
4181
|
"aria-label": "Organization chart",
|
|
4085
4182
|
style: {
|
|
4086
4183
|
display: "block",
|
|
4087
4184
|
width: "100%",
|
|
4088
|
-
maxWidth:
|
|
4185
|
+
maxWidth: L,
|
|
4089
4186
|
height: "auto",
|
|
4090
4187
|
margin: "0 auto"
|
|
4091
4188
|
},
|
|
4092
|
-
children: [
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
|
|
4127
|
-
children: /* @__PURE__ */
|
|
4189
|
+
children: [
|
|
4190
|
+
I.map((e, t) => {
|
|
4191
|
+
let n = e.color || _ || "rgba(148, 163, 184, 0.16)", r = !!(e.color || _);
|
|
4192
|
+
return /* @__PURE__ */ d("g", { children: [/* @__PURE__ */ u("rect", {
|
|
4193
|
+
x: e.x,
|
|
4194
|
+
y: e.y,
|
|
4195
|
+
width: e.width,
|
|
4196
|
+
height: e.height,
|
|
4197
|
+
rx: "16",
|
|
4198
|
+
fill: n
|
|
4199
|
+
}), g !== "hidden" && e.title && /* @__PURE__ */ u("text", {
|
|
4200
|
+
x: e.x + e.width / 2,
|
|
4201
|
+
y: g === "bottom" ? e.y + e.height - 22 * .42 : e.y + 22 * .78,
|
|
4202
|
+
textAnchor: "middle",
|
|
4203
|
+
fontSize: N.title + 1,
|
|
4204
|
+
fontWeight: "600",
|
|
4205
|
+
opacity: "0.55",
|
|
4206
|
+
fill: r ? Tn(e.color || _) : "var(--page-text, #111827)",
|
|
4207
|
+
children: wn(e.title, Math.floor(e.width / 7))
|
|
4208
|
+
})] }, `group-${t}`);
|
|
4209
|
+
}),
|
|
4210
|
+
F.map((e, t) => /* @__PURE__ */ u("path", {
|
|
4211
|
+
d: y ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
|
|
4212
|
+
fill: "none",
|
|
4213
|
+
stroke: "rgba(148, 163, 184, 0.7)",
|
|
4214
|
+
strokeWidth: "1.5"
|
|
4215
|
+
}, t)),
|
|
4216
|
+
P.map(({ node: e, x: t, y: n }) => {
|
|
4217
|
+
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 ? Tn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Tn(e.color2) : s, f = S && (En(e) || e.href), p = () => En(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + On.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);
|
|
4218
|
+
return /* @__PURE__ */ d("g", {
|
|
4219
|
+
onClick: f ? p : void 0,
|
|
4220
|
+
style: f ? { cursor: "pointer" } : void 0,
|
|
4221
|
+
role: f ? "button" : void 0,
|
|
4222
|
+
"aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
|
|
4223
|
+
children: [
|
|
4224
|
+
i && e.gradient ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("linearGradient", {
|
|
4225
|
+
id: `${C}-${e.id}-grad`,
|
|
4226
|
+
x1: "0",
|
|
4227
|
+
y1: "0",
|
|
4228
|
+
x2: "0",
|
|
4229
|
+
y2: "1",
|
|
4230
|
+
children: [/* @__PURE__ */ u("stop", {
|
|
4231
|
+
offset: "0%",
|
|
4232
|
+
stopColor: e.color || "var(--page-accent, #4f46e5)"
|
|
4233
|
+
}), /* @__PURE__ */ u("stop", {
|
|
4234
|
+
offset: "100%",
|
|
4235
|
+
stopColor: e.color2
|
|
4236
|
+
})]
|
|
4237
|
+
}), /* @__PURE__ */ u("rect", {
|
|
4128
4238
|
x: t,
|
|
4129
4239
|
y: n,
|
|
4130
|
-
width:
|
|
4131
|
-
height:
|
|
4132
|
-
rx: "10"
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4240
|
+
width: N.w,
|
|
4241
|
+
height: N.h,
|
|
4242
|
+
rx: "10",
|
|
4243
|
+
fill: `url(#${C}-${e.id}-grad)`
|
|
4244
|
+
})] }) : i ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
4245
|
+
id: `${C}-${e.id}-box`,
|
|
4246
|
+
children: /* @__PURE__ */ u("rect", {
|
|
4247
|
+
x: t,
|
|
4248
|
+
y: n,
|
|
4249
|
+
width: N.w,
|
|
4250
|
+
height: N.h,
|
|
4251
|
+
rx: "10"
|
|
4252
|
+
})
|
|
4253
|
+
}), /* @__PURE__ */ d("g", {
|
|
4254
|
+
clipPath: `url(#${C}-${e.id}-box)`,
|
|
4255
|
+
children: [/* @__PURE__ */ u("rect", {
|
|
4256
|
+
x: t,
|
|
4257
|
+
y: n,
|
|
4258
|
+
width: N.w,
|
|
4259
|
+
height: _,
|
|
4260
|
+
fill: o
|
|
4261
|
+
}), /* @__PURE__ */ u("rect", {
|
|
4262
|
+
x: t,
|
|
4263
|
+
y: n + _,
|
|
4264
|
+
width: N.w,
|
|
4265
|
+
height: N.h - _,
|
|
4266
|
+
fill: e.color2
|
|
4267
|
+
})]
|
|
4268
|
+
})] }) : /* @__PURE__ */ u("rect", {
|
|
4137
4269
|
x: t,
|
|
4138
4270
|
y: n,
|
|
4139
|
-
width:
|
|
4140
|
-
height:
|
|
4141
|
-
|
|
4142
|
-
|
|
4143
|
-
|
|
4144
|
-
|
|
4145
|
-
|
|
4146
|
-
|
|
4147
|
-
|
|
4148
|
-
|
|
4149
|
-
|
|
4150
|
-
|
|
4151
|
-
|
|
4152
|
-
|
|
4153
|
-
|
|
4154
|
-
|
|
4155
|
-
|
|
4156
|
-
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4161
|
-
|
|
4162
|
-
|
|
4163
|
-
|
|
4164
|
-
|
|
4165
|
-
|
|
4166
|
-
|
|
4167
|
-
|
|
4168
|
-
|
|
4169
|
-
|
|
4170
|
-
|
|
4171
|
-
|
|
4172
|
-
|
|
4173
|
-
|
|
4174
|
-
|
|
4175
|
-
|
|
4176
|
-
|
|
4177
|
-
|
|
4178
|
-
|
|
4179
|
-
|
|
4180
|
-
|
|
4181
|
-
|
|
4182
|
-
|
|
4183
|
-
|
|
4184
|
-
|
|
4185
|
-
|
|
4186
|
-
|
|
4187
|
-
|
|
4188
|
-
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4197
|
-
|
|
4198
|
-
|
|
4199
|
-
|
|
4200
|
-
|
|
4201
|
-
|
|
4202
|
-
textAnchor: h,
|
|
4203
|
-
fontSize: k.title,
|
|
4204
|
-
opacity: "0.7",
|
|
4205
|
-
fill: s,
|
|
4206
|
-
children: xn(v[1], g + 4)
|
|
4207
|
-
})] })
|
|
4208
|
-
]
|
|
4209
|
-
}, e.id);
|
|
4210
|
-
})]
|
|
4211
|
-
}), x && /* @__PURE__ */ u(En, {
|
|
4212
|
-
node: x,
|
|
4213
|
-
onClose: () => S(null)
|
|
4271
|
+
width: N.w,
|
|
4272
|
+
height: N.h,
|
|
4273
|
+
rx: "10",
|
|
4274
|
+
fill: o,
|
|
4275
|
+
stroke: a ? "none" : "var(--page-accent, #4f46e5)",
|
|
4276
|
+
strokeWidth: a ? 0 : 1.5
|
|
4277
|
+
}),
|
|
4278
|
+
e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
|
|
4279
|
+
id: `${C}-${e.id}`,
|
|
4280
|
+
children: /* @__PURE__ */ u("circle", {
|
|
4281
|
+
cx: t + On.pad + N.avatar / 2,
|
|
4282
|
+
cy: n + N.h / 2,
|
|
4283
|
+
r: N.avatar / 2
|
|
4284
|
+
})
|
|
4285
|
+
}), /* @__PURE__ */ u("image", {
|
|
4286
|
+
href: e.photo,
|
|
4287
|
+
x: t + On.pad,
|
|
4288
|
+
y: n + (N.h - N.avatar) / 2,
|
|
4289
|
+
width: N.avatar,
|
|
4290
|
+
height: N.avatar,
|
|
4291
|
+
preserveAspectRatio: "xMidYMid slice",
|
|
4292
|
+
clipPath: `url(#${C}-${e.id})`
|
|
4293
|
+
})] }),
|
|
4294
|
+
i && !e.gradient ? /* @__PURE__ */ d(l, { children: [e.title && /* @__PURE__ */ u("text", {
|
|
4295
|
+
x: m,
|
|
4296
|
+
y: n + _ / 2 + N.title * .35,
|
|
4297
|
+
textAnchor: h,
|
|
4298
|
+
fontSize: N.title,
|
|
4299
|
+
fontWeight: "600",
|
|
4300
|
+
fill: s,
|
|
4301
|
+
children: wn(e.title, g + 4)
|
|
4302
|
+
}), e.name && /* @__PURE__ */ u("text", {
|
|
4303
|
+
x: m,
|
|
4304
|
+
y: n + _ + _ / 2 + N.name * .35,
|
|
4305
|
+
textAnchor: h,
|
|
4306
|
+
fontSize: N.name,
|
|
4307
|
+
fontWeight: "600",
|
|
4308
|
+
fill: c,
|
|
4309
|
+
children: wn(e.name, g)
|
|
4310
|
+
})] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
|
|
4311
|
+
x: m,
|
|
4312
|
+
y: n + (v[1] ? N.h * .43 : N.h * .57),
|
|
4313
|
+
textAnchor: h,
|
|
4314
|
+
fontSize: N.name,
|
|
4315
|
+
fontWeight: "600",
|
|
4316
|
+
fill: s,
|
|
4317
|
+
children: wn(v[0], g)
|
|
4318
|
+
}), v[1] && /* @__PURE__ */ u("text", {
|
|
4319
|
+
x: m,
|
|
4320
|
+
y: n + N.h * .73,
|
|
4321
|
+
textAnchor: h,
|
|
4322
|
+
fontSize: N.title,
|
|
4323
|
+
opacity: "0.7",
|
|
4324
|
+
fill: s,
|
|
4325
|
+
children: wn(v[1], g + 4)
|
|
4326
|
+
})] })
|
|
4327
|
+
]
|
|
4328
|
+
}, e.id);
|
|
4329
|
+
})
|
|
4330
|
+
]
|
|
4331
|
+
}), w && /* @__PURE__ */ u(kn, {
|
|
4332
|
+
node: w,
|
|
4333
|
+
onClose: () => T(null)
|
|
4214
4334
|
})]
|
|
4215
4335
|
});
|
|
4216
4336
|
}
|
|
4217
|
-
function
|
|
4337
|
+
function jn({ value: e, onCommit: t, style: n, hint: r }) {
|
|
4218
4338
|
let [a, o] = c(!1), l = s(null);
|
|
4219
4339
|
return i(() => {
|
|
4220
4340
|
if (!a || !l.current) return;
|
|
@@ -4244,7 +4364,7 @@ function On({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4244
4364
|
children: e ?? ""
|
|
4245
4365
|
});
|
|
4246
4366
|
}
|
|
4247
|
-
var
|
|
4367
|
+
var Mn = 360, Nn = "\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", Pn = (e, t) => e && t ? `cell-${e}-${t}` : "", Fn = (e) => {
|
|
4248
4368
|
if (!e || typeof e != "object") return e ?? "";
|
|
4249
4369
|
let t = String(e.text ?? "");
|
|
4250
4370
|
return typeof e.href == "string" && e.href ? /* @__PURE__ */ u("a", {
|
|
@@ -4255,91 +4375,91 @@ var kn = 360, An = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
|
|
|
4255
4375
|
children: t
|
|
4256
4376
|
}) : t;
|
|
4257
4377
|
};
|
|
4258
|
-
function
|
|
4259
|
-
let
|
|
4378
|
+
function In({ 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 }) {
|
|
4379
|
+
let F = s(null), I = s(null), [L, R] = c(null), [z, B] = c(null), V = (e, t) => () => R({
|
|
4260
4380
|
r: e,
|
|
4261
4381
|
c: t
|
|
4262
4382
|
});
|
|
4263
4383
|
i(() => {
|
|
4264
|
-
if (!
|
|
4265
|
-
let e =
|
|
4384
|
+
if (!P) return;
|
|
4385
|
+
let e = I.current, t = L && e?.querySelector(`[data-cell="${L.r}-${L.c}"]`);
|
|
4266
4386
|
if (!t) {
|
|
4267
|
-
|
|
4387
|
+
z && B(null);
|
|
4268
4388
|
return;
|
|
4269
4389
|
}
|
|
4270
4390
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4271
4391
|
top: r.bottom - n.top + 4,
|
|
4272
|
-
left: Math.max(0, Math.min(r.left - n.left, n.width -
|
|
4392
|
+
left: Math.max(0, Math.min(r.left - n.left, n.width - Mn))
|
|
4273
4393
|
};
|
|
4274
|
-
(
|
|
4394
|
+
(z?.top !== i.top || z?.left !== i.left) && B(i);
|
|
4275
4395
|
}), i(() => {
|
|
4276
|
-
if (!
|
|
4396
|
+
if (!P || !L) return;
|
|
4277
4397
|
let e = (e) => {
|
|
4278
|
-
|
|
4398
|
+
I.current?.contains(e.target) || R(null);
|
|
4279
4399
|
};
|
|
4280
4400
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4281
|
-
}, [
|
|
4282
|
-
let { tenant:
|
|
4401
|
+
}, [P, L]);
|
|
4402
|
+
let { tenant: H, apiUrl: U } = r(Y), ee = r(be), te = ee?.[h], ne = C ? xe(ee) : 1, [re, W] = c(null);
|
|
4283
4403
|
if (i(() => {
|
|
4284
|
-
if (!h ||
|
|
4285
|
-
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(
|
|
4286
|
-
return fetch(r, { headers:
|
|
4404
|
+
if (!h || te) return;
|
|
4405
|
+
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(ne - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4406
|
+
return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
|
|
4287
4407
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4288
|
-
return e &&
|
|
4289
|
-
}).catch(() => e &&
|
|
4408
|
+
return e && W(n);
|
|
4409
|
+
}).catch(() => e && W([])), () => {
|
|
4290
4410
|
e = !1;
|
|
4291
4411
|
};
|
|
4292
4412
|
}, [
|
|
4293
4413
|
h,
|
|
4294
|
-
V,
|
|
4295
4414
|
H,
|
|
4296
|
-
|
|
4415
|
+
U,
|
|
4416
|
+
te,
|
|
4297
4417
|
C,
|
|
4298
|
-
|
|
4418
|
+
ne,
|
|
4299
4419
|
g
|
|
4300
4420
|
]), !e.length) return null;
|
|
4301
|
-
let
|
|
4421
|
+
let G = Math.max(1, Number(g) || 10), K = h ? C ? te || h.startsWith("api:") ? (te ?? re ?? []).slice((ne - 1) * G, ne * G) : (re ?? []).slice(0, G) : (te ?? re ?? []).slice(0, G) : null, ie = K ? K.map((t) => e.map((e) => Te(Ce(t?.data, e.field)))) : t, ae = !!h && !(h && !te && re === null) && ie.length === 0, oe = b ? {
|
|
4302
4422
|
y: 6,
|
|
4303
4423
|
x: 10
|
|
4304
4424
|
} : {
|
|
4305
4425
|
y: 10,
|
|
4306
4426
|
x: 14
|
|
4307
|
-
},
|
|
4427
|
+
}, q = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : oe.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : oe.x}px`, se = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, ce = y ? { border: se } : { borderBottom: se }, le = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), ue = [
|
|
4308
4428
|
"left",
|
|
4309
4429
|
"center",
|
|
4310
4430
|
"right"
|
|
4311
|
-
], de = (t) => ue.includes(e[t]?.align) ? e[t].align : "", fe = (e) => de(e) || (ue.includes(O) ? O : "left"),
|
|
4312
|
-
...
|
|
4431
|
+
], de = (t) => ue.includes(e[t]?.align) ? e[t].align : "", fe = (e) => de(e) || (ue.includes(O) ? O : "left"), J = Number.isFinite(Number(j)) && Number(j) > 0 ? Number(j) : 0, pe = A(M), me = !J && pe && pe.maxHeight !== void 0 ? pe.maxHeight : 0, he = J || me, ge = me ? {
|
|
4432
|
+
...pe,
|
|
4313
4433
|
maxHeight: void 0
|
|
4314
|
-
} :
|
|
4315
|
-
if (!
|
|
4434
|
+
} : pe, _e = !!P && P.rows !== !1, ve = (t) => (r) => {
|
|
4435
|
+
if (!P?.resize || t >= e.length - 1) return;
|
|
4316
4436
|
r.preventDefault(), r.stopPropagation();
|
|
4317
|
-
let i =
|
|
4437
|
+
let i = F.current, a = i ? i.clientWidth : 0;
|
|
4318
4438
|
if (!a) return;
|
|
4319
4439
|
let o = le ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4320
4440
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4321
|
-
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10,
|
|
4441
|
+
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, P.resize(i);
|
|
4322
4442
|
}, u = () => {
|
|
4323
4443
|
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
|
|
4324
4444
|
};
|
|
4325
4445
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4326
|
-
},
|
|
4327
|
-
p &&
|
|
4328
|
-
let r = p[
|
|
4446
|
+
}, ye = /* @__PURE__ */ new Set();
|
|
4447
|
+
p && ie.forEach((t, n) => e.forEach((e, t) => {
|
|
4448
|
+
let r = p[Pn(a[n], o[t])];
|
|
4329
4449
|
if (!r) return;
|
|
4330
4450
|
let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
|
|
4331
|
-
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) &&
|
|
4451
|
+
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && ye.add(`${n + e},${t + r}`);
|
|
4332
4452
|
}));
|
|
4333
|
-
let
|
|
4334
|
-
if (!
|
|
4453
|
+
let Se = (e) => (t) => {
|
|
4454
|
+
if (!P?.resizeRow) return;
|
|
4335
4455
|
t.preventDefault(), t.stopPropagation();
|
|
4336
4456
|
let n = t.currentTarget.closest("tr");
|
|
4337
4457
|
if (!n) return;
|
|
4338
|
-
let r = t.clientY, i = n.offsetHeight, a = (t) =>
|
|
4458
|
+
let r = t.clientY, i = n.offsetHeight, a = (t) => P.resizeRow(e, Math.max(20, Math.round(i + (t.clientY - r)))), o = () => {
|
|
4339
4459
|
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4340
4460
|
};
|
|
4341
4461
|
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4342
|
-
},
|
|
4462
|
+
}, X = (e, t, n, r) => r ? null : /* @__PURE__ */ u("span", {
|
|
4343
4463
|
className: "wb-tedit-btn",
|
|
4344
4464
|
role: "button",
|
|
4345
4465
|
"data-hint": t,
|
|
@@ -4348,58 +4468,58 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4348
4468
|
},
|
|
4349
4469
|
onClick: n,
|
|
4350
4470
|
children: e
|
|
4351
|
-
}, t),
|
|
4471
|
+
}, t), Z = L && L.r < ie.length && L.c < e.length ? L : null, Q = (e, t) => P?.labels?.[e] ?? t, we = Z ? p?.[Pn(a[Z.r], o[Z.c])] : null, Ee = Math.max(1, Number(we?.c) || 1), De = Math.max(1, Number(we?.r) || 1);
|
|
4352
4472
|
return /* @__PURE__ */ d("div", {
|
|
4353
4473
|
ref: (e) => {
|
|
4354
|
-
|
|
4474
|
+
I.current = e, typeof N == "function" && N(e);
|
|
4355
4475
|
},
|
|
4356
4476
|
style: {
|
|
4357
4477
|
width: "100%",
|
|
4358
|
-
...
|
|
4359
|
-
...
|
|
4478
|
+
...P ? { position: "relative" } : null,
|
|
4479
|
+
...ge
|
|
4360
4480
|
},
|
|
4361
4481
|
children: [
|
|
4362
|
-
|
|
4363
|
-
|
|
4482
|
+
P && /* @__PURE__ */ u("style", { children: Nn }),
|
|
4483
|
+
P && Z && z && /* @__PURE__ */ d("div", {
|
|
4364
4484
|
className: "wb-tedit-bar",
|
|
4365
4485
|
style: {
|
|
4366
|
-
top:
|
|
4367
|
-
left:
|
|
4486
|
+
top: z.top,
|
|
4487
|
+
left: z.left
|
|
4368
4488
|
},
|
|
4369
4489
|
onMouseDown: (e) => e.stopPropagation(),
|
|
4370
4490
|
children: [
|
|
4371
4491
|
/* @__PURE__ */ u("span", {
|
|
4372
4492
|
className: "wb-tedit-at",
|
|
4373
|
-
children: `R${
|
|
4493
|
+
children: `R${Z.r + 1}·C${Z.c + 1}`
|
|
4374
4494
|
}),
|
|
4375
|
-
|
|
4376
|
-
|
|
4377
|
-
|
|
4378
|
-
|
|
4379
|
-
|
|
4495
|
+
X("+↑", Q("rowAbove", "Insert row above"), () => P.addRow(Z.r - 1)),
|
|
4496
|
+
X("+↓", Q("rowBelow", "Insert row below"), () => P.addRow(Z.r)),
|
|
4497
|
+
X("↑", Q("rowUp", "Move row up"), () => P.moveRow(Z.r, -1), Z.r === 0),
|
|
4498
|
+
X("↓", Q("rowDown", "Move row down"), () => P.moveRow(Z.r, 1), Z.r >= ie.length - 1),
|
|
4499
|
+
X("✕ row", Q("rowDelete", "Delete row"), () => P.dropRow(Z.r), ie.length <= 1),
|
|
4380
4500
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4381
|
-
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4501
|
+
X("+←", Q("colLeft", "Insert column left"), () => P.addColumn(Z.c - 1)),
|
|
4502
|
+
X("+→", Q("colRight", "Insert column right"), () => P.addColumn(Z.c)),
|
|
4503
|
+
X("←", Q("colMoveLeft", "Move column left"), () => P.moveColumn(Z.c, -1), Z.c === 0),
|
|
4504
|
+
X("→", Q("colMoveRight", "Move column right"), () => P.moveColumn(Z.c, 1), Z.c >= e.length - 1),
|
|
4505
|
+
X("✕ col", Q("colDelete", "Delete column"), () => P.dropColumn(Z.c), e.length <= 1),
|
|
4386
4506
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4387
|
-
|
|
4388
|
-
|
|
4389
|
-
|
|
4507
|
+
X("↔", Q("mergeRight", "Merge with the cell on the right"), () => P.merge(Z.r, Z.c, "right"), Z.c + Ee >= e.length),
|
|
4508
|
+
X("↕", Q("mergeDown", "Merge with the cell below"), () => P.merge(Z.r, Z.c, "down"), Z.r + De >= ie.length),
|
|
4509
|
+
X("⤫", Q("split", "Split this cell"), () => P.split(Z.r, Z.c), Ee === 1 && De === 1)
|
|
4390
4510
|
]
|
|
4391
4511
|
}),
|
|
4392
4512
|
/* @__PURE__ */ u("div", {
|
|
4393
4513
|
style: {
|
|
4394
4514
|
width: "100%",
|
|
4395
4515
|
overflowX: "auto",
|
|
4396
|
-
...
|
|
4397
|
-
maxHeight:
|
|
4516
|
+
...he ? {
|
|
4517
|
+
maxHeight: he,
|
|
4398
4518
|
overflowY: "auto"
|
|
4399
4519
|
} : null
|
|
4400
4520
|
},
|
|
4401
4521
|
children: /* @__PURE__ */ d("table", {
|
|
4402
|
-
ref:
|
|
4522
|
+
ref: F,
|
|
4403
4523
|
style: {
|
|
4404
4524
|
width: "100%",
|
|
4405
4525
|
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
@@ -4411,66 +4531,66 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4411
4531
|
children: [
|
|
4412
4532
|
le && /* @__PURE__ */ u("colgroup", { children: n.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
|
|
4413
4533
|
_ === !1 ? null : /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((t, n) => /* @__PURE__ */ u("th", {
|
|
4414
|
-
className:
|
|
4534
|
+
className: P ? "wb-tedit-head" : void 0,
|
|
4415
4535
|
style: {
|
|
4416
4536
|
textAlign: fe(n),
|
|
4417
4537
|
fontWeight: 600,
|
|
4418
|
-
padding:
|
|
4538
|
+
padding: q,
|
|
4419
4539
|
...typeof D == "string" && D ? { color: D } : null,
|
|
4420
4540
|
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4421
4541
|
...T ? {
|
|
4422
4542
|
position: "sticky",
|
|
4423
4543
|
top: 0,
|
|
4424
4544
|
zIndex: 2
|
|
4425
|
-
} :
|
|
4545
|
+
} : P ? { position: "relative" } : null,
|
|
4426
4546
|
...ce
|
|
4427
4547
|
},
|
|
4428
|
-
children:
|
|
4548
|
+
children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(jn, {
|
|
4429
4549
|
value: t.label ?? t,
|
|
4430
|
-
onCommit: (e) =>
|
|
4431
|
-
hint:
|
|
4550
|
+
onCommit: (e) => P.header(n, e),
|
|
4551
|
+
hint: Q("editCell", "Double-click to edit"),
|
|
4432
4552
|
style: { paddingRight: 6 }
|
|
4433
4553
|
}), n < e.length - 1 && /* @__PURE__ */ u("span", {
|
|
4434
4554
|
className: "wb-tedit-grip",
|
|
4435
|
-
title:
|
|
4436
|
-
onPointerDown:
|
|
4555
|
+
title: Q("colWidth", "Drag to resize the column"),
|
|
4556
|
+
onPointerDown: ve(n)
|
|
4437
4557
|
})] }) : t.label ?? t
|
|
4438
4558
|
}, n)) }) }),
|
|
4439
4559
|
/* @__PURE__ */ d("tbody", { children: [ae && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
4440
4560
|
colSpan: e.length,
|
|
4441
4561
|
style: {
|
|
4442
|
-
padding:
|
|
4562
|
+
padding: q,
|
|
4443
4563
|
textAlign: "center",
|
|
4444
4564
|
opacity: .6,
|
|
4445
4565
|
...ce
|
|
4446
4566
|
},
|
|
4447
4567
|
children: w || "No data yet"
|
|
4448
|
-
}) }),
|
|
4449
|
-
className:
|
|
4568
|
+
}) }), ie.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
4569
|
+
className: P ? "wb-tedit-row" : void 0,
|
|
4450
4570
|
style: {
|
|
4451
4571
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
4452
4572
|
...Number.isFinite(Number(f?.[n])) && f[n] > 0 ? { height: f[n] } : null
|
|
4453
4573
|
},
|
|
4454
4574
|
children: e.map((e, r) => {
|
|
4455
|
-
if (
|
|
4456
|
-
let i =
|
|
4575
|
+
if (ye.has(`${n},${r}`)) return null;
|
|
4576
|
+
let i = Pn(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);
|
|
4457
4577
|
return /* @__PURE__ */ d("td", {
|
|
4458
|
-
className:
|
|
4459
|
-
onMouseDownCapture:
|
|
4460
|
-
"data-cell":
|
|
4578
|
+
className: P ? `wb-tedit-cell${L?.r === n && L?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4579
|
+
onMouseDownCapture: _e ? V(n, r) : void 0,
|
|
4580
|
+
"data-cell": P ? `${n}-${r}` : void 0,
|
|
4461
4581
|
colSpan: l > 1 ? l : void 0,
|
|
4462
4582
|
rowSpan: f > 1 ? f : void 0,
|
|
4463
4583
|
style: {
|
|
4464
|
-
padding:
|
|
4584
|
+
padding: q,
|
|
4465
4585
|
...de(r) ? { textAlign: de(r) } : null,
|
|
4466
|
-
...
|
|
4586
|
+
...P ? { position: "relative" } : null,
|
|
4467
4587
|
...ce
|
|
4468
4588
|
},
|
|
4469
|
-
children: [s ??
|
|
4589
|
+
children: [s ?? Fn(t?.[r]), P && _e && /* @__PURE__ */ u("span", {
|
|
4470
4590
|
className: "wb-tedit-rowgrip",
|
|
4471
|
-
title:
|
|
4472
|
-
onPointerDown:
|
|
4473
|
-
onDoubleClick: () =>
|
|
4591
|
+
title: Q("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4592
|
+
onPointerDown: Se(n),
|
|
4593
|
+
onDoubleClick: () => P.resizeRow(n, 0)
|
|
4474
4594
|
})]
|
|
4475
4595
|
}, r);
|
|
4476
4596
|
})
|
|
@@ -4481,7 +4601,7 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4481
4601
|
]
|
|
4482
4602
|
});
|
|
4483
4603
|
}
|
|
4484
|
-
var
|
|
4604
|
+
var Ln = {
|
|
4485
4605
|
small: {
|
|
4486
4606
|
cell: 62,
|
|
4487
4607
|
font: 10.5,
|
|
@@ -4506,9 +4626,9 @@ var Pn = {
|
|
|
4506
4626
|
pad: 8,
|
|
4507
4627
|
gap: 4
|
|
4508
4628
|
}
|
|
4509
|
-
},
|
|
4510
|
-
function
|
|
4511
|
-
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 ? "" :
|
|
4629
|
+
}, Rn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, zn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Bn = 366;
|
|
4630
|
+
function Vn(e, t = {}) {
|
|
4631
|
+
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 ? "" : Te(e), a = (e) => {
|
|
4512
4632
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4513
4633
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4514
4634
|
};
|
|
@@ -4524,7 +4644,7 @@ function Rn(e, t = {}) {
|
|
|
4524
4644
|
} : null;
|
|
4525
4645
|
}).filter(Boolean);
|
|
4526
4646
|
}
|
|
4527
|
-
function
|
|
4647
|
+
function Hn(e) {
|
|
4528
4648
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4529
4649
|
let n = e?.start ? new Date(e.start) : null;
|
|
4530
4650
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4539,20 +4659,20 @@ function zn(e) {
|
|
|
4539
4659
|
};
|
|
4540
4660
|
}).filter(Boolean);
|
|
4541
4661
|
}
|
|
4542
|
-
function
|
|
4662
|
+
function Un(e) {
|
|
4543
4663
|
let t = /* @__PURE__ */ new Map();
|
|
4544
4664
|
for (let n of e) {
|
|
4545
|
-
let e =
|
|
4665
|
+
let e = zn(n.start), r = n.end ? zn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Bn);
|
|
4546
4666
|
for (let r = 0; r <= i; r += 1) {
|
|
4547
|
-
let i =
|
|
4667
|
+
let i = Rn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4548
4668
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4549
4669
|
}
|
|
4550
4670
|
}
|
|
4551
4671
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4552
4672
|
return t;
|
|
4553
4673
|
}
|
|
4554
|
-
function
|
|
4555
|
-
let { tenant: T, apiUrl: E, locale: D } = r(
|
|
4674
|
+
function Wn({ 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 }) {
|
|
4675
|
+
let { tenant: T, apiUrl: E, locale: D } = r(Y), O = r(be)?.[t], [k, j] = c(null), [M, N] = c(() => {
|
|
4556
4676
|
let e = /* @__PURE__ */ new Date();
|
|
4557
4677
|
return {
|
|
4558
4678
|
year: e.getFullYear(),
|
|
@@ -4574,13 +4694,13 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4574
4694
|
E,
|
|
4575
4695
|
O
|
|
4576
4696
|
]);
|
|
4577
|
-
let P =
|
|
4697
|
+
let P = Ln[m] ?? Ln.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 ? Vn(O ?? k ?? [], {
|
|
4578
4698
|
titleField: n,
|
|
4579
4699
|
startField: a,
|
|
4580
4700
|
endField: o,
|
|
4581
4701
|
hrefField: s,
|
|
4582
4702
|
colorField: f
|
|
4583
|
-
}) :
|
|
4703
|
+
}) : Hn(e), B = Un(z), V = D || void 0, H = (e, t) => {
|
|
4584
4704
|
let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
|
|
4585
4705
|
width: 6,
|
|
4586
4706
|
height: 6,
|
|
@@ -4621,16 +4741,16 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4621
4741
|
}, U = new Intl.DateTimeFormat(V, {
|
|
4622
4742
|
month: "long",
|
|
4623
4743
|
year: "numeric"
|
|
4624
|
-
}).format(new Date(M.year, M.month, 1)),
|
|
4744
|
+
}).format(new Date(M.year, M.month, 1)), ee = (e) => N((t) => {
|
|
4625
4745
|
let n = new Date(t.year, t.month + e, 1);
|
|
4626
4746
|
return {
|
|
4627
4747
|
year: n.getFullYear(),
|
|
4628
4748
|
month: n.getMonth()
|
|
4629
4749
|
};
|
|
4630
|
-
}),
|
|
4750
|
+
}), te = (e, t) => /* @__PURE__ */ u("button", {
|
|
4631
4751
|
type: "button",
|
|
4632
4752
|
"aria-label": e,
|
|
4633
|
-
onClick: () =>
|
|
4753
|
+
onClick: () => ee(t),
|
|
4634
4754
|
style: {
|
|
4635
4755
|
background: "transparent",
|
|
4636
4756
|
border: `1px solid ${I}`,
|
|
@@ -4642,7 +4762,7 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4642
4762
|
padding: "4px 8px"
|
|
4643
4763
|
},
|
|
4644
4764
|
children: t < 0 ? "‹" : "›"
|
|
4645
|
-
}),
|
|
4765
|
+
}), ne = /* @__PURE__ */ d("div", {
|
|
4646
4766
|
style: {
|
|
4647
4767
|
display: "flex",
|
|
4648
4768
|
alignItems: "center",
|
|
@@ -4659,8 +4779,8 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4659
4779
|
},
|
|
4660
4780
|
children: U
|
|
4661
4781
|
}),
|
|
4662
|
-
|
|
4663
|
-
|
|
4782
|
+
te("Previous month", -1),
|
|
4783
|
+
te("Next month", 1)
|
|
4664
4784
|
]
|
|
4665
4785
|
});
|
|
4666
4786
|
if (p === "list") {
|
|
@@ -4676,7 +4796,7 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4676
4796
|
width: "100%",
|
|
4677
4797
|
...A(S)
|
|
4678
4798
|
},
|
|
4679
|
-
children: [
|
|
4799
|
+
children: [ne, e.length ? /* @__PURE__ */ u("div", {
|
|
4680
4800
|
style: {
|
|
4681
4801
|
display: "flex",
|
|
4682
4802
|
flexDirection: "column",
|
|
@@ -4712,10 +4832,10 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4712
4832
|
})]
|
|
4713
4833
|
});
|
|
4714
4834
|
}
|
|
4715
|
-
let
|
|
4716
|
-
for (let e = 0; e <
|
|
4717
|
-
let t = e -
|
|
4718
|
-
|
|
4835
|
+
let re = new Date(M.year, M.month, 1), W = y === "sunday" ? 0 : 1, G = (re.getDay() - W + 7) % 7, K = new Date(M.year, M.month + 1, 0).getDate(), ie = Math.ceil((G + K) / 7), ae = Rn(/* @__PURE__ */ new Date()), oe = new Intl.DateTimeFormat(V, { weekday: "short" }), q = [];
|
|
4836
|
+
for (let e = 0; e < ie * 7; e += 1) {
|
|
4837
|
+
let t = e - G + 1, n = t >= 1 && t <= K, r = Rn(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ae;
|
|
4838
|
+
q.push(/* @__PURE__ */ d("div", {
|
|
4719
4839
|
style: {
|
|
4720
4840
|
minHeight: P.cell,
|
|
4721
4841
|
borderTop: `1px solid ${I}`,
|
|
@@ -4758,7 +4878,7 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4758
4878
|
...A(S)
|
|
4759
4879
|
},
|
|
4760
4880
|
children: [
|
|
4761
|
-
|
|
4881
|
+
ne,
|
|
4762
4882
|
/* @__PURE__ */ d("div", {
|
|
4763
4883
|
style: {
|
|
4764
4884
|
display: "grid",
|
|
@@ -4772,20 +4892,315 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4772
4892
|
textAlign: "center",
|
|
4773
4893
|
padding: `0 0 ${P.pad}px`
|
|
4774
4894
|
},
|
|
4775
|
-
children:
|
|
4776
|
-
}, `head-${t}`)),
|
|
4895
|
+
children: oe.format(new Date(2024, 0, 7 + W + t))
|
|
4896
|
+
}, `head-${t}`)), q]
|
|
4777
4897
|
}),
|
|
4778
4898
|
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4779
4899
|
]
|
|
4780
4900
|
});
|
|
4781
4901
|
}
|
|
4782
|
-
var
|
|
4902
|
+
var Gn = {
|
|
4903
|
+
small: 36,
|
|
4904
|
+
medium: 56,
|
|
4905
|
+
large: 88
|
|
4906
|
+
};
|
|
4907
|
+
function Kn(e, t = {}) {
|
|
4908
|
+
let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : Te(e);
|
|
4909
|
+
return n.map((e) => {
|
|
4910
|
+
let n = e.data ?? e, i = Ce(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(Ce(n, t.nameField)) : r(n.name);
|
|
4911
|
+
return {
|
|
4912
|
+
src: typeof o == "string" ? o.trim() : "",
|
|
4913
|
+
alt: s,
|
|
4914
|
+
href: t.hrefField ? r(Ce(n, t.hrefField)) : ""
|
|
4915
|
+
};
|
|
4916
|
+
}).filter((e) => e.src);
|
|
4917
|
+
}
|
|
4918
|
+
function qn({ 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 }) {
|
|
4919
|
+
let { tenant: D, apiUrl: O } = r(Y), k = r(be)?.[t], [j, M] = c(null), N = s(null), P = s(null), [F, I] = c(0), [L, R] = c(0), [z, B] = c(0), [V, H] = c(!0), [U, ee] = c(!1), [te, ne] = c(!1);
|
|
4920
|
+
i(() => {
|
|
4921
|
+
if (!t || k) return;
|
|
4922
|
+
let e = !0;
|
|
4923
|
+
return fetch(`${O}/dynamic/${encodeURIComponent(t)}`, { headers: D ? { "x-tenant": D } : {} }).then((e) => e.json()).then((t) => {
|
|
4924
|
+
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4925
|
+
e && M(n);
|
|
4926
|
+
}).catch(() => e && M([])), () => {
|
|
4927
|
+
e = !1;
|
|
4928
|
+
};
|
|
4929
|
+
}, [
|
|
4930
|
+
t,
|
|
4931
|
+
D,
|
|
4932
|
+
O,
|
|
4933
|
+
k
|
|
4934
|
+
]), i(() => {
|
|
4935
|
+
if (typeof window > "u" || !window.matchMedia) return;
|
|
4936
|
+
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => ne(e.matches);
|
|
4937
|
+
return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
|
|
4938
|
+
}, []), i(() => {
|
|
4939
|
+
let e = P.current;
|
|
4940
|
+
if (!e) return;
|
|
4941
|
+
let t = () => I(e.clientWidth);
|
|
4942
|
+
if (t(), typeof ResizeObserver > "u") return;
|
|
4943
|
+
let n = new ResizeObserver(t);
|
|
4944
|
+
return n.observe(e), () => n.disconnect();
|
|
4945
|
+
}, []), i(() => {
|
|
4946
|
+
let e = N.current;
|
|
4947
|
+
if (!e) return;
|
|
4948
|
+
let t = !0, n = () => {
|
|
4949
|
+
let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * G);
|
|
4950
|
+
t && n.length && R(Math.ceil(Math.max(...n)));
|
|
4951
|
+
};
|
|
4952
|
+
n();
|
|
4953
|
+
let r = [...e.querySelectorAll("img")].filter((e) => !e.complete);
|
|
4954
|
+
return r.forEach((e) => e.addEventListener("load", n)), () => {
|
|
4955
|
+
t = !1, r.forEach((e) => e.removeEventListener("load", n));
|
|
4956
|
+
};
|
|
4957
|
+
});
|
|
4958
|
+
let re = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], W = t ? Kn(k ?? j ?? [], {
|
|
4959
|
+
imageField: n,
|
|
4960
|
+
nameField: a,
|
|
4961
|
+
hrefField: o
|
|
4962
|
+
}) : re, G = Gn[p] ?? Gn.medium, K = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ae = f === "marquee" ? "step" : f, oe = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), q = Math.min(3e3, Math.max(100, Number(_) || 500)), se = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), ce = (L || G * 3) + K, le = F ? Math.max(1, Math.floor(F / ce)) : se, ue = Math.min(se, le), de = F ? Math.min(ce, F / ue) : ce;
|
|
4963
|
+
if (!W.length) return /* @__PURE__ */ u("div", {
|
|
4964
|
+
ref: T,
|
|
4965
|
+
style: {
|
|
4966
|
+
width: "100%",
|
|
4967
|
+
...A(w)
|
|
4968
|
+
},
|
|
4969
|
+
children: E ? /* @__PURE__ */ u("div", {
|
|
4970
|
+
style: {
|
|
4971
|
+
display: "flex",
|
|
4972
|
+
alignItems: "center",
|
|
4973
|
+
justifyContent: "center",
|
|
4974
|
+
flexWrap: "wrap",
|
|
4975
|
+
gap: K
|
|
4976
|
+
},
|
|
4977
|
+
children: [
|
|
4978
|
+
0,
|
|
4979
|
+
1,
|
|
4980
|
+
2,
|
|
4981
|
+
3,
|
|
4982
|
+
4
|
|
4983
|
+
].map((e) => /* @__PURE__ */ u("div", {
|
|
4984
|
+
style: {
|
|
4985
|
+
height: G,
|
|
4986
|
+
width: G * 3,
|
|
4987
|
+
border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
|
|
4988
|
+
borderRadius: 6,
|
|
4989
|
+
display: "flex",
|
|
4990
|
+
alignItems: "center",
|
|
4991
|
+
justifyContent: "center",
|
|
4992
|
+
fontSize: Math.max(10, Math.round(G / 4)),
|
|
4993
|
+
opacity: .45,
|
|
4994
|
+
...ie
|
|
4995
|
+
},
|
|
4996
|
+
children: "LOGO"
|
|
4997
|
+
}, e))
|
|
4998
|
+
}) : C ? /* @__PURE__ */ u("div", {
|
|
4999
|
+
style: {
|
|
5000
|
+
fontSize: 13,
|
|
5001
|
+
opacity: .6,
|
|
5002
|
+
textAlign: "center",
|
|
5003
|
+
padding: 16
|
|
5004
|
+
},
|
|
5005
|
+
children: C
|
|
5006
|
+
}) : null
|
|
5007
|
+
});
|
|
5008
|
+
let fe = W.length, J = ae === "step" && fe > ue, pe = ae === "slider", me = J && !E && !U && !te, he = v === "right", ge = he ? fe : 0, _e = J ? [...W, ...W] : W, ve = J ? z * de : 0, ye = (e, t, n) => {
|
|
5009
|
+
let r = /* @__PURE__ */ u("img", {
|
|
5010
|
+
src: e.src,
|
|
5011
|
+
alt: e.alt ?? "",
|
|
5012
|
+
style: {
|
|
5013
|
+
height: G,
|
|
5014
|
+
width: "auto",
|
|
5015
|
+
maxWidth: "100%",
|
|
5016
|
+
objectFit: "contain",
|
|
5017
|
+
display: "block"
|
|
5018
|
+
}
|
|
5019
|
+
}), i = J ? {
|
|
5020
|
+
width: de,
|
|
5021
|
+
flex: "0 0 auto",
|
|
5022
|
+
padding: `0 ${K / 2}px`,
|
|
5023
|
+
justifyContent: "center"
|
|
5024
|
+
} : {};
|
|
5025
|
+
return e.href && !E ? /* @__PURE__ */ u("a", {
|
|
5026
|
+
href: e.href,
|
|
5027
|
+
className: "wb-logo",
|
|
5028
|
+
title: e.alt || void 0,
|
|
5029
|
+
style: i,
|
|
5030
|
+
...S === !1 ? {} : {
|
|
5031
|
+
target: "_blank",
|
|
5032
|
+
rel: "noopener noreferrer"
|
|
5033
|
+
},
|
|
5034
|
+
...n ? {
|
|
5035
|
+
"aria-hidden": "true",
|
|
5036
|
+
tabIndex: -1
|
|
5037
|
+
} : {},
|
|
5038
|
+
children: r
|
|
5039
|
+
}, `${n ? "c" : "o"}-${t}`) : /* @__PURE__ */ u("div", {
|
|
5040
|
+
className: "wb-logo",
|
|
5041
|
+
style: i,
|
|
5042
|
+
...n ? { "aria-hidden": "true" } : {},
|
|
5043
|
+
children: r
|
|
5044
|
+
}, `${n ? "c" : "o"}-${t}`);
|
|
5045
|
+
}, xe = /* @__PURE__ */ u("div", {
|
|
5046
|
+
ref: N,
|
|
5047
|
+
className: "wb-logos-track",
|
|
5048
|
+
style: {
|
|
5049
|
+
display: "flex",
|
|
5050
|
+
alignItems: "center",
|
|
5051
|
+
...J ? {
|
|
5052
|
+
width: _e.length * de,
|
|
5053
|
+
transform: `translateX(-${ve}px)`,
|
|
5054
|
+
transition: V ? `transform ${q}ms ease` : "none"
|
|
5055
|
+
} : pe ? {
|
|
5056
|
+
gap: K,
|
|
5057
|
+
overflowX: "auto",
|
|
5058
|
+
scrollBehavior: "smooth",
|
|
5059
|
+
scrollSnapType: "x proximity"
|
|
5060
|
+
} : {
|
|
5061
|
+
gap: K,
|
|
5062
|
+
flexWrap: "wrap",
|
|
5063
|
+
justifyContent: "center"
|
|
5064
|
+
}
|
|
5065
|
+
},
|
|
5066
|
+
children: _e.map((e, t) => ye(e, t, J && t >= fe))
|
|
5067
|
+
}), Se = (e) => {
|
|
5068
|
+
if (pe) {
|
|
5069
|
+
let t = N.current;
|
|
5070
|
+
t && t.scrollBy({
|
|
5071
|
+
left: e * Math.max(120, t.clientWidth * .8),
|
|
5072
|
+
behavior: "smooth"
|
|
5073
|
+
});
|
|
5074
|
+
return;
|
|
5075
|
+
}
|
|
5076
|
+
let t = z + e;
|
|
5077
|
+
if (t >= 0 && t <= fe) {
|
|
5078
|
+
H(!0), B(t);
|
|
5079
|
+
return;
|
|
5080
|
+
}
|
|
5081
|
+
let n = t < 0 ? fe : 0;
|
|
5082
|
+
H(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
5083
|
+
H(!0), B(n + e);
|
|
5084
|
+
}));
|
|
5085
|
+
}, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Z = X !== "off" && (pe ? F > 0 : J), Q = (e) => /* @__PURE__ */ u("button", {
|
|
5086
|
+
type: "button",
|
|
5087
|
+
"aria-label": e < 0 ? "Previous logos" : "Next logos",
|
|
5088
|
+
onClick: () => Se(e),
|
|
5089
|
+
className: `wb-logos-arrow${X === "hover" ? " wb-logos-arrow-shy" : ""}`,
|
|
5090
|
+
style: { [e < 0 ? "left" : "right"]: 0 },
|
|
5091
|
+
children: e < 0 ? "‹" : "›"
|
|
5092
|
+
});
|
|
5093
|
+
return /* @__PURE__ */ d("div", {
|
|
5094
|
+
ref: (e) => {
|
|
5095
|
+
P.current = e, T && T(e);
|
|
5096
|
+
},
|
|
5097
|
+
className: "wb-logos",
|
|
5098
|
+
style: {
|
|
5099
|
+
width: "100%",
|
|
5100
|
+
position: "relative",
|
|
5101
|
+
overflow: "hidden",
|
|
5102
|
+
...A(w)
|
|
5103
|
+
},
|
|
5104
|
+
onMouseEnter: b === !1 ? void 0 : () => ee(!0),
|
|
5105
|
+
onMouseLeave: b === !1 ? void 0 : () => ee(!1),
|
|
5106
|
+
children: [
|
|
5107
|
+
/* @__PURE__ */ u("style", { children: `
|
|
5108
|
+
.wb-logos .wb-logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; box-sizing: border-box; }
|
|
5109
|
+
.wb-logos .wb-logo img { filter: ${x === !1 ? "none" : "grayscale(1)"}; opacity: ${x === !1 ? 1 : .7}; transition: filter .2s ease, opacity .2s ease; }
|
|
5110
|
+
.wb-logos .wb-logo:hover img { filter: none; opacity: 1; }
|
|
5111
|
+
.wb-logos .wb-logos-track::-webkit-scrollbar { display: none; }
|
|
5112
|
+
.wb-logos .wb-logos-track { scrollbar-width: none; }
|
|
5113
|
+
.wb-logos .wb-logo { scroll-snap-align: start; }
|
|
5114
|
+
/* Shy arrows fade in with the pointer — and with KEYBOARD focus, or they
|
|
5115
|
+
would be unreachable without a mouse. */
|
|
5116
|
+
.wb-logos .wb-logos-arrow-shy { opacity: 0; transition: opacity .18s ease; }
|
|
5117
|
+
.wb-logos:hover .wb-logos-arrow-shy,
|
|
5118
|
+
.wb-logos:focus-within .wb-logos-arrow-shy { opacity: 1; }
|
|
5119
|
+
.wb-logos-arrow {
|
|
5120
|
+
position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
|
|
5121
|
+
width: 30px; height: 30px; border-radius: 999px; cursor: pointer; line-height: 1; font-size: 18px;
|
|
5122
|
+
display: flex; align-items: center; justify-content: center;
|
|
5123
|
+
color: inherit; background: var(--page-surface, #f2f2f2);
|
|
5124
|
+
border: 1px solid var(--page-border, rgba(148, 163, 184, 0.5));
|
|
5125
|
+
}
|
|
5126
|
+
` }),
|
|
5127
|
+
J ? /* @__PURE__ */ d("div", {
|
|
5128
|
+
style: {
|
|
5129
|
+
position: "relative",
|
|
5130
|
+
width: ue * de,
|
|
5131
|
+
maxWidth: "100%",
|
|
5132
|
+
margin: "0 auto"
|
|
5133
|
+
},
|
|
5134
|
+
children: [
|
|
5135
|
+
Z ? Q(-1) : null,
|
|
5136
|
+
/* @__PURE__ */ u("div", {
|
|
5137
|
+
style: { overflow: "hidden" },
|
|
5138
|
+
children: xe
|
|
5139
|
+
}),
|
|
5140
|
+
Z ? Q(1) : null
|
|
5141
|
+
]
|
|
5142
|
+
}) : /* @__PURE__ */ d(l, { children: [
|
|
5143
|
+
Z ? Q(-1) : null,
|
|
5144
|
+
xe,
|
|
5145
|
+
Z ? Q(1) : null
|
|
5146
|
+
] }),
|
|
5147
|
+
/* @__PURE__ */ u(Jn, {
|
|
5148
|
+
running: me,
|
|
5149
|
+
every: oe + q,
|
|
5150
|
+
slide: q,
|
|
5151
|
+
step: he ? -1 : 1,
|
|
5152
|
+
index: z,
|
|
5153
|
+
total: fe,
|
|
5154
|
+
home: ge,
|
|
5155
|
+
setIndex: B,
|
|
5156
|
+
setAnimate: H
|
|
5157
|
+
})
|
|
5158
|
+
]
|
|
5159
|
+
});
|
|
5160
|
+
}
|
|
5161
|
+
function Jn({ running: e, every: t, slide: n, step: r, index: a, total: o, home: s, setIndex: c, setAnimate: l }) {
|
|
5162
|
+
i(() => {
|
|
5163
|
+
if (!e) return;
|
|
5164
|
+
let n = setInterval(() => {
|
|
5165
|
+
l(!0), c((e) => e + r);
|
|
5166
|
+
}, t);
|
|
5167
|
+
return () => clearInterval(n);
|
|
5168
|
+
}, [
|
|
5169
|
+
e,
|
|
5170
|
+
t,
|
|
5171
|
+
r,
|
|
5172
|
+
c,
|
|
5173
|
+
l
|
|
5174
|
+
]), i(() => {
|
|
5175
|
+
l(!1), c(s);
|
|
5176
|
+
}, [
|
|
5177
|
+
s,
|
|
5178
|
+
c,
|
|
5179
|
+
l
|
|
5180
|
+
]);
|
|
5181
|
+
let u = r > 0 ? a >= o : a <= 0;
|
|
5182
|
+
return i(() => {
|
|
5183
|
+
if (!u || a === s) return;
|
|
5184
|
+
let e = setTimeout(() => {
|
|
5185
|
+
l(!1), c(s);
|
|
5186
|
+
}, n);
|
|
5187
|
+
return () => clearTimeout(e);
|
|
5188
|
+
}, [
|
|
5189
|
+
u,
|
|
5190
|
+
a,
|
|
5191
|
+
n,
|
|
5192
|
+
s,
|
|
5193
|
+
c,
|
|
5194
|
+
l
|
|
5195
|
+
]), null;
|
|
5196
|
+
}
|
|
5197
|
+
var Yn = {
|
|
4783
5198
|
small: 380,
|
|
4784
5199
|
medium: 560,
|
|
4785
5200
|
large: 820,
|
|
4786
5201
|
full: "100%"
|
|
4787
5202
|
};
|
|
4788
|
-
function
|
|
5203
|
+
function Xn({ 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 }) {
|
|
4789
5204
|
let [C, w] = c(!1), T = s(null);
|
|
4790
5205
|
i(() => {
|
|
4791
5206
|
if (S || !e) return;
|
|
@@ -4810,7 +5225,7 @@ function Un({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4810
5225
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
4811
5226
|
};
|
|
4812
5227
|
}, [S, C]);
|
|
4813
|
-
let E =
|
|
5228
|
+
let E = Yn[o] ?? Yn.medium, D = (e) => {
|
|
4814
5229
|
let t = {
|
|
4815
5230
|
padding: "9px 16px",
|
|
4816
5231
|
borderRadius: 6,
|
|
@@ -4979,10 +5394,11 @@ function Un({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4979
5394
|
})]
|
|
4980
5395
|
});
|
|
4981
5396
|
}
|
|
4982
|
-
var
|
|
5397
|
+
var Zn = {
|
|
4983
5398
|
PageRoot: Pe,
|
|
4984
|
-
CalendarBlock:
|
|
4985
|
-
|
|
5399
|
+
CalendarBlock: Wn,
|
|
5400
|
+
LogoCarousel: qn,
|
|
5401
|
+
DialogBlock: Xn,
|
|
4986
5402
|
Section: Fe,
|
|
4987
5403
|
Container: Ie,
|
|
4988
5404
|
Heading: Le,
|
|
@@ -4993,23 +5409,23 @@ var Wn = {
|
|
|
4993
5409
|
Divider: ot,
|
|
4994
5410
|
SliderBlock: ft,
|
|
4995
5411
|
CanvasSlider: pt,
|
|
4996
|
-
TabsBlock:
|
|
4997
|
-
QuickStack:
|
|
4998
|
-
CollectionList:
|
|
4999
|
-
CollectionSearch:
|
|
5000
|
-
BreadcrumbsBlock:
|
|
5001
|
-
PaginationBlock:
|
|
5002
|
-
StepperBlock:
|
|
5003
|
-
SocialLinksBlock:
|
|
5004
|
-
ThemeModeBlock:
|
|
5005
|
-
ScrollTopBlock:
|
|
5006
|
-
OrgChartBlock:
|
|
5007
|
-
TableBlock:
|
|
5008
|
-
IconBlock:
|
|
5009
|
-
MapBlock:
|
|
5010
|
-
MasonryBlock:
|
|
5011
|
-
AccordionBlock:
|
|
5012
|
-
NavbarBlock:
|
|
5412
|
+
TabsBlock: kt,
|
|
5413
|
+
QuickStack: tn,
|
|
5414
|
+
CollectionList: nn,
|
|
5415
|
+
CollectionSearch: rn,
|
|
5416
|
+
BreadcrumbsBlock: an,
|
|
5417
|
+
PaginationBlock: on,
|
|
5418
|
+
StepperBlock: vn,
|
|
5419
|
+
SocialLinksBlock: _n,
|
|
5420
|
+
ThemeModeBlock: dn,
|
|
5421
|
+
ScrollTopBlock: hn,
|
|
5422
|
+
OrgChartBlock: An,
|
|
5423
|
+
TableBlock: In,
|
|
5424
|
+
IconBlock: St,
|
|
5425
|
+
MapBlock: bt,
|
|
5426
|
+
MasonryBlock: wt,
|
|
5427
|
+
AccordionBlock: At,
|
|
5428
|
+
NavbarBlock: Ot,
|
|
5013
5429
|
ListBlock: Je,
|
|
5014
5430
|
TextSpan: Ve,
|
|
5015
5431
|
QuoteBlock: qe,
|
|
@@ -5020,43 +5436,83 @@ var Wn = {
|
|
|
5020
5436
|
YouTubeBlock: nt,
|
|
5021
5437
|
IframeBlock: rt,
|
|
5022
5438
|
EmbedBlock: it,
|
|
5023
|
-
FormBlock:
|
|
5024
|
-
FormLabel:
|
|
5025
|
-
FormInput:
|
|
5026
|
-
FormTextarea:
|
|
5027
|
-
FormCheckbox: (e) => /* @__PURE__ */ u(
|
|
5439
|
+
FormBlock: Ut,
|
|
5440
|
+
FormLabel: Jt,
|
|
5441
|
+
FormInput: Yt,
|
|
5442
|
+
FormTextarea: Xt,
|
|
5443
|
+
FormCheckbox: (e) => /* @__PURE__ */ u(Zt, {
|
|
5028
5444
|
kind: "checkbox",
|
|
5029
5445
|
...e
|
|
5030
5446
|
}),
|
|
5031
|
-
FormRadio: (e) => /* @__PURE__ */ u(
|
|
5447
|
+
FormRadio: (e) => /* @__PURE__ */ u(Zt, {
|
|
5032
5448
|
kind: "radio",
|
|
5033
5449
|
...e
|
|
5034
5450
|
}),
|
|
5035
|
-
FormSelect:
|
|
5036
|
-
FormFile:
|
|
5037
|
-
FormRecaptcha:
|
|
5038
|
-
FormSubmit:
|
|
5039
|
-
},
|
|
5451
|
+
FormSelect: Qt,
|
|
5452
|
+
FormFile: $t,
|
|
5453
|
+
FormRecaptcha: qt,
|
|
5454
|
+
FormSubmit: en
|
|
5455
|
+
}, Qn = {
|
|
5040
5456
|
id: "auth",
|
|
5041
5457
|
label: "Accounts",
|
|
5042
5458
|
category: "Apps",
|
|
5043
5459
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
5044
5460
|
ssr: "shell",
|
|
5045
5461
|
settings: ["site.authRedirect"]
|
|
5046
|
-
},
|
|
5462
|
+
}, $n = t({
|
|
5047
5463
|
user: null,
|
|
5048
5464
|
status: "idle",
|
|
5049
5465
|
ensure: () => {},
|
|
5050
5466
|
refresh: () => {},
|
|
5051
5467
|
signOut: () => {}
|
|
5052
|
-
})
|
|
5053
|
-
|
|
5468
|
+
});
|
|
5469
|
+
function er(e, t) {
|
|
5470
|
+
return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
|
|
5471
|
+
}
|
|
5472
|
+
function tr(e) {
|
|
5473
|
+
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);
|
|
5474
|
+
return {
|
|
5475
|
+
mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
|
|
5476
|
+
url: i,
|
|
5477
|
+
mePath: a,
|
|
5478
|
+
logoutPath: o,
|
|
5479
|
+
meUrl: er(i, a),
|
|
5480
|
+
logoutUrl: er(i, o),
|
|
5481
|
+
loginPage: r(n.loginPage),
|
|
5482
|
+
userPath: r(n.userPath),
|
|
5483
|
+
auth: n.auth === "bearer" ? "bearer" : "cookies",
|
|
5484
|
+
tokenKey: r(n.tokenKey) || "webim_session_token"
|
|
5485
|
+
};
|
|
5486
|
+
}
|
|
5487
|
+
function nr(e, t) {
|
|
5488
|
+
if (!t) return e ?? null;
|
|
5489
|
+
let n = e;
|
|
5490
|
+
for (let e of t.split(".")) {
|
|
5491
|
+
if (!n || typeof n != "object") return null;
|
|
5492
|
+
n = n[e];
|
|
5493
|
+
}
|
|
5494
|
+
return n ?? null;
|
|
5495
|
+
}
|
|
5496
|
+
function rr(e) {
|
|
5497
|
+
try {
|
|
5498
|
+
return window.localStorage.getItem(e) || "";
|
|
5499
|
+
} catch {
|
|
5500
|
+
return "";
|
|
5501
|
+
}
|
|
5502
|
+
}
|
|
5503
|
+
function ir(e) {
|
|
5504
|
+
try {
|
|
5505
|
+
window.localStorage.removeItem(e);
|
|
5506
|
+
} catch {}
|
|
5507
|
+
}
|
|
5508
|
+
var ar = () => {
|
|
5509
|
+
let e = r($n);
|
|
5054
5510
|
return i(() => {
|
|
5055
5511
|
e.ensure();
|
|
5056
5512
|
}, [e]), e;
|
|
5057
5513
|
};
|
|
5058
|
-
function
|
|
5059
|
-
let f = r(
|
|
5514
|
+
function or({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
|
|
5515
|
+
let f = r(Y), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => tr(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}`, {
|
|
5060
5516
|
...t,
|
|
5061
5517
|
credentials: "include",
|
|
5062
5518
|
headers: {
|
|
@@ -5064,61 +5520,93 @@ function Jn({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5064
5520
|
...m ? { "x-tenant": m } : {},
|
|
5065
5521
|
...t?.headers
|
|
5066
5522
|
}
|
|
5067
|
-
}), [p, m]),
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5523
|
+
}), [p, m]), S = n((e) => (_(e), y(e ? "user" : "guest"), e), []), C = n(() => {
|
|
5524
|
+
if (a) return Promise.resolve(null);
|
|
5525
|
+
if (h.mode === "off") return Promise.resolve(S(null));
|
|
5526
|
+
if (h.mode === "custom") {
|
|
5527
|
+
let e = h.auth === "bearer" ? rr(h.tokenKey) : "";
|
|
5528
|
+
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) => {
|
|
5529
|
+
let t = nr(e, h.userPath);
|
|
5530
|
+
return S(t && typeof t == "object" ? t : null);
|
|
5531
|
+
}).catch(() => S(null));
|
|
5532
|
+
}
|
|
5533
|
+
return x("/site/me").then((e) => e.ok ? e.json() : null).then((e) => S(e?.payload ?? null)).catch(() => S(null));
|
|
5534
|
+
}, [
|
|
5535
|
+
x,
|
|
5536
|
+
h,
|
|
5537
|
+
a,
|
|
5538
|
+
S
|
|
5539
|
+
]), w = n(() => {
|
|
5540
|
+
if (h.mode === "off") return S(null), Promise.resolve();
|
|
5541
|
+
if (h.mode === "custom") {
|
|
5542
|
+
let e = h.auth === "bearer" ? rr(h.tokenKey) : "";
|
|
5543
|
+
return (h.logoutUrl ? fetch(h.logoutUrl, {
|
|
5544
|
+
method: "post",
|
|
5545
|
+
...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
|
|
5546
|
+
}).catch(() => {}) : Promise.resolve()).then(() => {
|
|
5547
|
+
h.auth === "bearer" && ir(h.tokenKey), S(null);
|
|
5548
|
+
});
|
|
5549
|
+
}
|
|
5550
|
+
return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
|
|
5551
|
+
S(null);
|
|
5552
|
+
});
|
|
5553
|
+
}, [
|
|
5554
|
+
x,
|
|
5555
|
+
h,
|
|
5556
|
+
S
|
|
5557
|
+
]), T = n(() => {
|
|
5558
|
+
b.current || a || t || (b.current = !0, y("loading"), C());
|
|
5074
5559
|
}, [
|
|
5075
5560
|
a,
|
|
5076
5561
|
t,
|
|
5077
|
-
|
|
5078
|
-
]),
|
|
5079
|
-
user:
|
|
5080
|
-
status:
|
|
5081
|
-
ensure:
|
|
5082
|
-
refresh:
|
|
5083
|
-
signOut:
|
|
5562
|
+
C
|
|
5563
|
+
]), E = o(() => ({
|
|
5564
|
+
user: g,
|
|
5565
|
+
status: v,
|
|
5566
|
+
ensure: T,
|
|
5567
|
+
refresh: C,
|
|
5568
|
+
signOut: w
|
|
5084
5569
|
}), [
|
|
5085
|
-
|
|
5086
|
-
|
|
5570
|
+
g,
|
|
5571
|
+
v,
|
|
5572
|
+
T,
|
|
5087
5573
|
C,
|
|
5088
|
-
|
|
5089
|
-
S
|
|
5574
|
+
w
|
|
5090
5575
|
]);
|
|
5091
5576
|
return i(() => {
|
|
5092
5577
|
a || typeof window > "u" || (window.webim = {
|
|
5093
5578
|
...window.webim,
|
|
5094
|
-
user:
|
|
5095
|
-
status:
|
|
5096
|
-
|
|
5097
|
-
|
|
5579
|
+
user: g,
|
|
5580
|
+
status: v,
|
|
5581
|
+
loginUrl: h.loginPage || null,
|
|
5582
|
+
requireUser: () => b.current || t ? Promise.resolve(g) : C(),
|
|
5583
|
+
refresh: C,
|
|
5584
|
+
signOut: w
|
|
5098
5585
|
}, window.dispatchEvent(new CustomEvent("webim:session", { detail: {
|
|
5099
|
-
user:
|
|
5100
|
-
status:
|
|
5586
|
+
user: g,
|
|
5587
|
+
status: v
|
|
5101
5588
|
} })));
|
|
5102
5589
|
}, [
|
|
5103
5590
|
a,
|
|
5104
|
-
|
|
5105
|
-
|
|
5591
|
+
g,
|
|
5592
|
+
v,
|
|
5106
5593
|
t,
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5594
|
+
h.loginPage,
|
|
5595
|
+
C,
|
|
5596
|
+
w
|
|
5597
|
+
]), /* @__PURE__ */ u($n.Provider, {
|
|
5598
|
+
value: E,
|
|
5111
5599
|
children: e
|
|
5112
5600
|
});
|
|
5113
5601
|
}
|
|
5114
|
-
function
|
|
5115
|
-
let { status: n } =
|
|
5602
|
+
function sr({ when: e, children: t }) {
|
|
5603
|
+
let { status: n } = ar();
|
|
5116
5604
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5117
5605
|
}
|
|
5118
5606
|
//#endregion
|
|
5119
5607
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5120
|
-
function
|
|
5121
|
-
let { tenant: h, apiUrl: g, settings: _ } = r(
|
|
5608
|
+
function cr({ 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 }) {
|
|
5609
|
+
let { tenant: h, apiUrl: g, settings: _ } = r(Y), [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) => {
|
|
5122
5610
|
if (e.preventDefault(), f) return;
|
|
5123
5611
|
let n = new FormData(e.currentTarget);
|
|
5124
5612
|
C(!0), x("");
|
|
@@ -5166,20 +5654,20 @@ function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5166
5654
|
children: [
|
|
5167
5655
|
w ? /* @__PURE__ */ d("label", {
|
|
5168
5656
|
style: {
|
|
5169
|
-
...
|
|
5657
|
+
...Mt,
|
|
5170
5658
|
display: "grid",
|
|
5171
5659
|
gap: 6
|
|
5172
5660
|
},
|
|
5173
5661
|
children: [a, /* @__PURE__ */ u("input", {
|
|
5174
5662
|
name: "name",
|
|
5175
5663
|
type: "text",
|
|
5176
|
-
style:
|
|
5177
|
-
...
|
|
5664
|
+
style: Nt,
|
|
5665
|
+
...Ft(f)
|
|
5178
5666
|
})]
|
|
5179
5667
|
}) : null,
|
|
5180
5668
|
/* @__PURE__ */ d("label", {
|
|
5181
5669
|
style: {
|
|
5182
|
-
...
|
|
5670
|
+
...Mt,
|
|
5183
5671
|
display: "grid",
|
|
5184
5672
|
gap: 6
|
|
5185
5673
|
},
|
|
@@ -5187,13 +5675,13 @@ function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5187
5675
|
name: "email",
|
|
5188
5676
|
type: "email",
|
|
5189
5677
|
required: !f,
|
|
5190
|
-
style:
|
|
5191
|
-
...
|
|
5678
|
+
style: Nt,
|
|
5679
|
+
...Ft(f)
|
|
5192
5680
|
})]
|
|
5193
5681
|
}),
|
|
5194
5682
|
/* @__PURE__ */ d("label", {
|
|
5195
5683
|
style: {
|
|
5196
|
-
...
|
|
5684
|
+
...Mt,
|
|
5197
5685
|
display: "grid",
|
|
5198
5686
|
gap: 6
|
|
5199
5687
|
},
|
|
@@ -5201,8 +5689,8 @@ function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5201
5689
|
name: "password",
|
|
5202
5690
|
type: "password",
|
|
5203
5691
|
required: !f,
|
|
5204
|
-
style:
|
|
5205
|
-
...
|
|
5692
|
+
style: Nt,
|
|
5693
|
+
...Ft(f)
|
|
5206
5694
|
})]
|
|
5207
5695
|
}),
|
|
5208
5696
|
/* @__PURE__ */ u("button", {
|
|
@@ -5241,8 +5729,8 @@ function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5241
5729
|
]
|
|
5242
5730
|
});
|
|
5243
5731
|
}
|
|
5244
|
-
function
|
|
5245
|
-
let { user: c, status: l, signOut: f } =
|
|
5732
|
+
function lr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
5733
|
+
let { user: c, status: l, signOut: f } = ar(), p = a ? s || "user" : l, m = a ? {
|
|
5246
5734
|
name: "Ada Lovelace",
|
|
5247
5735
|
email: "ada@example.com"
|
|
5248
5736
|
} : c;
|
|
@@ -5263,7 +5751,7 @@ function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5263
5751
|
children: [
|
|
5264
5752
|
/* @__PURE__ */ d("span", {
|
|
5265
5753
|
style: {
|
|
5266
|
-
...
|
|
5754
|
+
...Mt,
|
|
5267
5755
|
fontWeight: 600
|
|
5268
5756
|
},
|
|
5269
5757
|
children: [
|
|
@@ -5274,7 +5762,7 @@ function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5274
5762
|
}),
|
|
5275
5763
|
n && m?.email ? /* @__PURE__ */ u("span", {
|
|
5276
5764
|
style: {
|
|
5277
|
-
...
|
|
5765
|
+
...Mt,
|
|
5278
5766
|
opacity: .7
|
|
5279
5767
|
},
|
|
5280
5768
|
children: m.email
|
|
@@ -5290,7 +5778,7 @@ function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5290
5778
|
fontSize: 14,
|
|
5291
5779
|
cursor: a ? "default" : "pointer"
|
|
5292
5780
|
},
|
|
5293
|
-
...
|
|
5781
|
+
...Ft(a),
|
|
5294
5782
|
children: t
|
|
5295
5783
|
})
|
|
5296
5784
|
]
|
|
@@ -5307,40 +5795,40 @@ function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5307
5795
|
}
|
|
5308
5796
|
//#endregion
|
|
5309
5797
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5310
|
-
var
|
|
5798
|
+
var ur = {
|
|
5311
5799
|
id: "consent",
|
|
5312
5800
|
label: "Cookie consent",
|
|
5313
5801
|
category: "Apps",
|
|
5314
5802
|
keys: ["CookieConsent"],
|
|
5315
5803
|
ssr: "shell",
|
|
5316
5804
|
settings: []
|
|
5317
|
-
},
|
|
5318
|
-
function
|
|
5805
|
+
}, dr = "webim.cookie_consent";
|
|
5806
|
+
function fr() {
|
|
5319
5807
|
try {
|
|
5320
|
-
let e = window.localStorage.getItem(
|
|
5808
|
+
let e = window.localStorage.getItem(dr), t = e ? JSON.parse(e) : null;
|
|
5321
5809
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5322
5810
|
} catch {
|
|
5323
5811
|
return "";
|
|
5324
5812
|
}
|
|
5325
5813
|
}
|
|
5326
|
-
function
|
|
5814
|
+
function pr(e) {
|
|
5327
5815
|
try {
|
|
5328
5816
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5329
5817
|
} catch {}
|
|
5330
5818
|
}
|
|
5331
|
-
function
|
|
5819
|
+
function mr(e) {
|
|
5332
5820
|
try {
|
|
5333
|
-
window.localStorage.setItem(
|
|
5821
|
+
window.localStorage.setItem(dr, JSON.stringify({
|
|
5334
5822
|
choice: e,
|
|
5335
5823
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5336
5824
|
}));
|
|
5337
5825
|
} catch {}
|
|
5338
|
-
|
|
5826
|
+
pr(e);
|
|
5339
5827
|
try {
|
|
5340
5828
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5341
5829
|
} catch {}
|
|
5342
5830
|
}
|
|
5343
|
-
var
|
|
5831
|
+
var hr = {
|
|
5344
5832
|
bottom: {
|
|
5345
5833
|
left: 0,
|
|
5346
5834
|
right: 0,
|
|
@@ -5362,18 +5850,18 @@ var rr = {
|
|
|
5362
5850
|
maxWidth: 400
|
|
5363
5851
|
}
|
|
5364
5852
|
};
|
|
5365
|
-
function
|
|
5853
|
+
function gr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
|
|
5366
5854
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
5367
5855
|
y(e), typeof m == "function" && m(e);
|
|
5368
5856
|
};
|
|
5369
5857
|
if (i(() => {
|
|
5370
5858
|
if (h) return;
|
|
5371
|
-
let e =
|
|
5372
|
-
e ?
|
|
5859
|
+
let e = fr();
|
|
5860
|
+
e ? pr(e) : _(!0);
|
|
5373
5861
|
}, [h, v]), !g) return null;
|
|
5374
5862
|
let x = (e) => () => {
|
|
5375
|
-
h || (
|
|
5376
|
-
}, S =
|
|
5863
|
+
h || (mr(e), _(!1));
|
|
5864
|
+
}, S = hr[s] ?? hr.bottom, C = {
|
|
5377
5865
|
appearance: "none",
|
|
5378
5866
|
font: "inherit",
|
|
5379
5867
|
fontSize: 14,
|
|
@@ -5453,37 +5941,37 @@ function ir({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
5453
5941
|
}
|
|
5454
5942
|
//#endregion
|
|
5455
5943
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
5456
|
-
var
|
|
5944
|
+
var _r = {
|
|
5457
5945
|
id: "language",
|
|
5458
5946
|
label: "Language",
|
|
5459
5947
|
category: "Apps",
|
|
5460
5948
|
keys: ["SiteLanguagePicker"],
|
|
5461
5949
|
ssr: "prefetch",
|
|
5462
5950
|
settings: ["locales"]
|
|
5463
|
-
},
|
|
5951
|
+
}, vr = {
|
|
5464
5952
|
id: "search",
|
|
5465
5953
|
label: "Search",
|
|
5466
5954
|
category: "Apps",
|
|
5467
5955
|
keys: ["SiteSearch"],
|
|
5468
5956
|
ssr: "prefetch",
|
|
5469
5957
|
settings: []
|
|
5470
|
-
},
|
|
5471
|
-
function
|
|
5958
|
+
}, yr = 50, br = 2e3;
|
|
5959
|
+
function xr() {
|
|
5472
5960
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
5473
5961
|
}
|
|
5474
|
-
function
|
|
5962
|
+
function Sr(e, t) {
|
|
5475
5963
|
let n = e?.data ?? {}, r = [];
|
|
5476
5964
|
for (let e of Object.values(n)) {
|
|
5477
|
-
let t = e == null ? "" :
|
|
5478
|
-
if (t && r.push(t), r.join(" ").length >
|
|
5965
|
+
let t = e == null ? "" : Te(e);
|
|
5966
|
+
if (t && r.push(t), r.join(" ").length > br) break;
|
|
5479
5967
|
}
|
|
5480
|
-
return r.join(" ").slice(0,
|
|
5968
|
+
return r.join(" ").slice(0, br).toLocaleLowerCase(t || void 0);
|
|
5481
5969
|
}
|
|
5482
|
-
function
|
|
5483
|
-
let { tenant: b, apiUrl: x, locale: S } = r(
|
|
5970
|
+
function Cr({ 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 }) {
|
|
5971
|
+
let { tenant: b, apiUrl: x, locale: S } = r(Y), [C, w] = c(() => xr()), [T, E] = c(() => xr()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
|
|
5484
5972
|
i(() => {
|
|
5485
5973
|
let e = () => {
|
|
5486
|
-
let e =
|
|
5974
|
+
let e = xr();
|
|
5487
5975
|
w(e), E(e);
|
|
5488
5976
|
};
|
|
5489
5977
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -5534,8 +6022,8 @@ function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5534
6022
|
});
|
|
5535
6023
|
}
|
|
5536
6024
|
else for (let t of e.rows) {
|
|
5537
|
-
if (!
|
|
5538
|
-
let n = t?.data ?? {}, r =
|
|
6025
|
+
if (!Sr(t, S).includes(P)) continue;
|
|
6026
|
+
let n = t?.data ?? {}, r = Te(n.name) || "Untitled", i = Te(n.slug);
|
|
5539
6027
|
F.push({
|
|
5540
6028
|
key: `entry:${t.id}`,
|
|
5541
6029
|
title: r,
|
|
@@ -5543,7 +6031,7 @@ function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5543
6031
|
kind: "entry"
|
|
5544
6032
|
});
|
|
5545
6033
|
}
|
|
5546
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
6034
|
+
let I = F.slice(0, Math.min(Math.max(1, p), yr)), L = (e) => {
|
|
5547
6035
|
if (v) {
|
|
5548
6036
|
e.preventDefault(), w(T), j(!0);
|
|
5549
6037
|
return;
|
|
@@ -5625,7 +6113,7 @@ function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5625
6113
|
onChange: (e) => E(e.target.value),
|
|
5626
6114
|
onFocus: () => P && j(!0),
|
|
5627
6115
|
style: {
|
|
5628
|
-
...
|
|
6116
|
+
...Nt,
|
|
5629
6117
|
flexGrow: 1,
|
|
5630
6118
|
minWidth: 0
|
|
5631
6119
|
}
|
|
@@ -5683,21 +6171,21 @@ function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5683
6171
|
}
|
|
5684
6172
|
//#endregion
|
|
5685
6173
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
5686
|
-
function
|
|
6174
|
+
function wr(e) {
|
|
5687
6175
|
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());
|
|
5688
6176
|
return [...new Set(n.map((e) => e.trim()))];
|
|
5689
6177
|
}
|
|
5690
|
-
var
|
|
5691
|
-
function
|
|
6178
|
+
var Tr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
6179
|
+
function Er(e, t) {
|
|
5692
6180
|
let n = String(e ?? "").toUpperCase();
|
|
5693
6181
|
if (t === "code") return n;
|
|
5694
6182
|
let r = "";
|
|
5695
6183
|
try {
|
|
5696
|
-
r =
|
|
6184
|
+
r = Tr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
5697
6185
|
} catch {}
|
|
5698
6186
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
5699
6187
|
}
|
|
5700
|
-
function
|
|
6188
|
+
function Dr(e, t) {
|
|
5701
6189
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
5702
6190
|
if (typeof window > "u") return n || "?";
|
|
5703
6191
|
try {
|
|
@@ -5707,8 +6195,8 @@ function hr(e, t) {
|
|
|
5707
6195
|
return n || "/";
|
|
5708
6196
|
}
|
|
5709
6197
|
}
|
|
5710
|
-
function
|
|
5711
|
-
let c = r(
|
|
6198
|
+
function Or({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
|
|
6199
|
+
let c = r(Y), l = wr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
|
|
5712
6200
|
display: "inline-flex",
|
|
5713
6201
|
alignItems: "center",
|
|
5714
6202
|
gap: 8,
|
|
@@ -5743,7 +6231,7 @@ function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5743
6231
|
style: { opacity: .4 },
|
|
5744
6232
|
children: n ?? "·"
|
|
5745
6233
|
}), /* @__PURE__ */ u("a", {
|
|
5746
|
-
href:
|
|
6234
|
+
href: Dr(e, e === f),
|
|
5747
6235
|
hrefLang: e,
|
|
5748
6236
|
"aria-current": e === p ? "true" : void 0,
|
|
5749
6237
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -5753,7 +6241,7 @@ function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5753
6241
|
textDecoration: "none",
|
|
5754
6242
|
cursor: s ? "default" : "pointer"
|
|
5755
6243
|
},
|
|
5756
|
-
children:
|
|
6244
|
+
children: Er(e, t)
|
|
5757
6245
|
})]
|
|
5758
6246
|
}, e))]
|
|
5759
6247
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -5764,7 +6252,7 @@ function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5764
6252
|
value: p,
|
|
5765
6253
|
onChange: s ? void 0 : (e) => {
|
|
5766
6254
|
let t = e.target.value;
|
|
5767
|
-
window.location.assign(
|
|
6255
|
+
window.location.assign(Dr(t, t === f));
|
|
5768
6256
|
},
|
|
5769
6257
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
5770
6258
|
style: {
|
|
@@ -5778,57 +6266,57 @@ function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5778
6266
|
},
|
|
5779
6267
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
5780
6268
|
value: e,
|
|
5781
|
-
children:
|
|
6269
|
+
children: Er(e, t)
|
|
5782
6270
|
}, e))
|
|
5783
6271
|
})]
|
|
5784
6272
|
});
|
|
5785
6273
|
}
|
|
5786
6274
|
//#endregion
|
|
5787
6275
|
//#region ../ui/src/components/builder/apps/index.js
|
|
5788
|
-
var
|
|
5789
|
-
Gn,
|
|
5790
|
-
ar,
|
|
6276
|
+
var kr = [
|
|
5791
6277
|
Qn,
|
|
5792
|
-
|
|
5793
|
-
|
|
5794
|
-
|
|
5795
|
-
|
|
5796
|
-
|
|
5797
|
-
|
|
5798
|
-
|
|
6278
|
+
_r,
|
|
6279
|
+
ur,
|
|
6280
|
+
vr
|
|
6281
|
+
], Ar = {
|
|
6282
|
+
SiteLoginForm: cr,
|
|
6283
|
+
SiteAccountMenu: lr,
|
|
6284
|
+
SiteLanguagePicker: Or,
|
|
6285
|
+
CookieConsent: gr,
|
|
6286
|
+
SiteSearch: Cr
|
|
5799
6287
|
};
|
|
5800
|
-
new Set(
|
|
6288
|
+
new Set(kr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
5801
6289
|
//#endregion
|
|
5802
6290
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
5803
|
-
var
|
|
5804
|
-
function
|
|
5805
|
-
if (
|
|
6291
|
+
var jr = /* @__PURE__ */ new Map();
|
|
6292
|
+
function Mr(e) {
|
|
6293
|
+
if (jr.has(e)) return jr.get(e);
|
|
5806
6294
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
5807
6295
|
/* @vite-ignore */
|
|
5808
6296
|
/* webpackIgnore: true */
|
|
5809
6297
|
t
|
|
5810
6298
|
).finally(() => URL.revokeObjectURL(t));
|
|
5811
|
-
return
|
|
6299
|
+
return jr.set(e, n), n;
|
|
5812
6300
|
}
|
|
5813
|
-
function
|
|
6301
|
+
function Nr(e) {
|
|
5814
6302
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
5815
6303
|
return n && typeof n == "object" ? n : {};
|
|
5816
6304
|
}
|
|
5817
6305
|
//#endregion
|
|
5818
6306
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
5819
|
-
async function
|
|
5820
|
-
let n = await
|
|
6307
|
+
async function Pr(e, t) {
|
|
6308
|
+
let n = await Mr(e);
|
|
5821
6309
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
5822
6310
|
}
|
|
5823
|
-
var
|
|
6311
|
+
var Fr = {
|
|
5824
6312
|
padding: "10px 12px",
|
|
5825
6313
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
5826
6314
|
borderRadius: 8,
|
|
5827
6315
|
fontSize: 12,
|
|
5828
6316
|
opacity: .6
|
|
5829
6317
|
};
|
|
5830
|
-
function
|
|
5831
|
-
let c = r(
|
|
6318
|
+
function Ir({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
6319
|
+
let c = r(Y), l = Nr(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
5832
6320
|
tenant: c?.tenant ?? "",
|
|
5833
6321
|
apiUrl: c?.apiUrl ?? "/api",
|
|
5834
6322
|
locale: c?.locale ?? "",
|
|
@@ -5840,7 +6328,7 @@ function wr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5840
6328
|
let e = f.current;
|
|
5841
6329
|
if (!l?.code || !e) return;
|
|
5842
6330
|
let n = !0;
|
|
5843
|
-
return
|
|
6331
|
+
return Pr(l.code, t).then((e) => {
|
|
5844
6332
|
if (!(!n || !e || !f.current)) {
|
|
5845
6333
|
p.current = e;
|
|
5846
6334
|
try {
|
|
@@ -5870,7 +6358,7 @@ function wr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5870
6358
|
}) : /* @__PURE__ */ d("div", {
|
|
5871
6359
|
ref: o,
|
|
5872
6360
|
style: {
|
|
5873
|
-
...
|
|
6361
|
+
...Fr,
|
|
5874
6362
|
...A(a)
|
|
5875
6363
|
},
|
|
5876
6364
|
children: [
|
|
@@ -5882,12 +6370,12 @@ function wr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5882
6370
|
}
|
|
5883
6371
|
//#endregion
|
|
5884
6372
|
//#region ../ui/src/components/builder/render.jsx
|
|
5885
|
-
var
|
|
5886
|
-
...
|
|
5887
|
-
...
|
|
5888
|
-
PluginBlock:
|
|
6373
|
+
var Lr = {
|
|
6374
|
+
...Zn,
|
|
6375
|
+
...Ar,
|
|
6376
|
+
PluginBlock: Ir
|
|
5889
6377
|
};
|
|
5890
|
-
function
|
|
6378
|
+
function Rr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
5891
6379
|
let o = n[t];
|
|
5892
6380
|
if (!o || o.hidden) return null;
|
|
5893
6381
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -5895,11 +6383,11 @@ function Er(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5895
6383
|
let n = o.props?.componentId, s = r?.[n];
|
|
5896
6384
|
if (!s?.template || i.has(n)) return null;
|
|
5897
6385
|
let c = new Set(i).add(n);
|
|
5898
|
-
return /* @__PURE__ */ u(e, { children:
|
|
6386
|
+
return /* @__PURE__ */ u(e, { children: Rr(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
5899
6387
|
}
|
|
5900
|
-
let l =
|
|
6388
|
+
let l = Lr[s];
|
|
5901
6389
|
if (!l) return null;
|
|
5902
|
-
let d = (o.nodes ?? []).map((e) =>
|
|
6390
|
+
let d = (o.nodes ?? []).map((e) => Rr(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Rr(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
5903
6391
|
...c,
|
|
5904
6392
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
5905
6393
|
linked: p,
|
|
@@ -5908,16 +6396,16 @@ function Er(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5908
6396
|
},
|
|
5909
6397
|
children: d.length ? d : void 0
|
|
5910
6398
|
}, t);
|
|
5911
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
6399
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(sr, {
|
|
5912
6400
|
when: c.when,
|
|
5913
6401
|
children: m
|
|
5914
6402
|
}, t) : m;
|
|
5915
6403
|
}
|
|
5916
6404
|
//#endregion
|
|
5917
6405
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
5918
|
-
var
|
|
6406
|
+
var zr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Br = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ue(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
5919
6407
|
.webim-page[data-webim-mode="dark"] { ${Object.entries(ue(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
5920
|
-
function
|
|
6408
|
+
function Vr({ 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 }) {
|
|
5921
6409
|
let b = s?.js?.trim();
|
|
5922
6410
|
if (i(() => {
|
|
5923
6411
|
if (!b) return;
|
|
@@ -5926,28 +6414,28 @@ function kr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5926
6414
|
}, [b]), !e?.ROOT) return null;
|
|
5927
6415
|
let x = {
|
|
5928
6416
|
lang: m || void 0,
|
|
5929
|
-
dir:
|
|
6417
|
+
dir: ye(h, m)
|
|
5930
6418
|
}, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
|
|
5931
6419
|
minHeight: "100%",
|
|
5932
6420
|
display: "flex",
|
|
5933
6421
|
flexDirection: "column"
|
|
5934
|
-
}, w =
|
|
6422
|
+
}, w = Rr("ROOT", e, n), T = o(() => ({ render: (t, r) => Rr(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = G(e, n), O = W(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" && !q[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
|
|
5935
6423
|
rel: "stylesheet",
|
|
5936
6424
|
precedence: "default",
|
|
5937
6425
|
href: g(e)
|
|
5938
|
-
}, e)), P =
|
|
5939
|
-
return r === "auto" ? /* @__PURE__ */ u(
|
|
6426
|
+
}, e)), P = Br(j);
|
|
6427
|
+
return r === "auto" ? /* @__PURE__ */ u(Y.Provider, {
|
|
5940
6428
|
value: {
|
|
5941
6429
|
tenant: l || "",
|
|
5942
6430
|
apiUrl: f || "/api",
|
|
5943
6431
|
locale: m || "",
|
|
5944
6432
|
settings: _ ?? null
|
|
5945
6433
|
},
|
|
5946
|
-
children: /* @__PURE__ */ u(
|
|
6434
|
+
children: /* @__PURE__ */ u(or, {
|
|
5947
6435
|
initialUser: v,
|
|
5948
|
-
children: /* @__PURE__ */ u(
|
|
6436
|
+
children: /* @__PURE__ */ u(be.Provider, {
|
|
5949
6437
|
value: p ?? null,
|
|
5950
|
-
children: /* @__PURE__ */ u(
|
|
6438
|
+
children: /* @__PURE__ */ u(Z.Provider, {
|
|
5951
6439
|
value: T,
|
|
5952
6440
|
children: /* @__PURE__ */ d("div", {
|
|
5953
6441
|
...x,
|
|
@@ -5958,8 +6446,8 @@ function kr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5958
6446
|
...a
|
|
5959
6447
|
},
|
|
5960
6448
|
children: [
|
|
5961
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
5962
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
6449
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${zr(ue(j.light))} }
|
|
6450
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${zr(ue(j.dark))} } }` }),
|
|
5963
6451
|
/* @__PURE__ */ u("style", { children: P }),
|
|
5964
6452
|
N,
|
|
5965
6453
|
/* @__PURE__ */ u("style", { children: S }),
|
|
@@ -5972,18 +6460,18 @@ function kr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5972
6460
|
})
|
|
5973
6461
|
})
|
|
5974
6462
|
})
|
|
5975
|
-
}) : /* @__PURE__ */ u(
|
|
6463
|
+
}) : /* @__PURE__ */ u(Y.Provider, {
|
|
5976
6464
|
value: {
|
|
5977
6465
|
tenant: l || "",
|
|
5978
6466
|
apiUrl: f || "/api",
|
|
5979
6467
|
locale: m || "",
|
|
5980
6468
|
settings: _ ?? null
|
|
5981
6469
|
},
|
|
5982
|
-
children: /* @__PURE__ */ u(
|
|
6470
|
+
children: /* @__PURE__ */ u(or, {
|
|
5983
6471
|
initialUser: v,
|
|
5984
|
-
children: /* @__PURE__ */ u(
|
|
6472
|
+
children: /* @__PURE__ */ u(be.Provider, {
|
|
5985
6473
|
value: p ?? null,
|
|
5986
|
-
children: /* @__PURE__ */ u(
|
|
6474
|
+
children: /* @__PURE__ */ u(Z.Provider, {
|
|
5987
6475
|
value: T,
|
|
5988
6476
|
children: /* @__PURE__ */ d("div", {
|
|
5989
6477
|
...x,
|
|
@@ -6012,8 +6500,8 @@ function kr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
6012
6500
|
}
|
|
6013
6501
|
//#endregion
|
|
6014
6502
|
//#region src/WebimContent.jsx
|
|
6015
|
-
function
|
|
6016
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
6503
|
+
function Hr({ bundle: e, mode: t = "auto", style: n }) {
|
|
6504
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(Vr, {
|
|
6017
6505
|
blocks: e.blocks,
|
|
6018
6506
|
theme: e.theme,
|
|
6019
6507
|
components: e.components,
|
|
@@ -6025,13 +6513,13 @@ function Ar({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
6025
6513
|
locale: e.locale,
|
|
6026
6514
|
direction: e.direction,
|
|
6027
6515
|
settings: e.settings,
|
|
6028
|
-
mode:
|
|
6516
|
+
mode: pe(t, e.scheme),
|
|
6029
6517
|
style: n
|
|
6030
6518
|
}) : null;
|
|
6031
6519
|
}
|
|
6032
6520
|
//#endregion
|
|
6033
6521
|
//#region src/WebimPage.jsx
|
|
6034
|
-
function
|
|
6522
|
+
function Ur({ 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 }) {
|
|
6035
6523
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
6036
6524
|
onLoad: m,
|
|
6037
6525
|
onError: h
|
|
@@ -6041,7 +6529,7 @@ function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
6041
6529
|
onError: h
|
|
6042
6530
|
}, i(() => {
|
|
6043
6531
|
let i = !0;
|
|
6044
|
-
return _({ status: "loading" }),
|
|
6532
|
+
return _({ status: "loading" }), ge({
|
|
6045
6533
|
apiUrl: e,
|
|
6046
6534
|
tenant: t,
|
|
6047
6535
|
slug: n,
|
|
@@ -6068,11 +6556,11 @@ function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
6068
6556
|
r,
|
|
6069
6557
|
a,
|
|
6070
6558
|
o
|
|
6071
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
6559
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Hr, {
|
|
6072
6560
|
bundle: g.bundle,
|
|
6073
6561
|
mode: l,
|
|
6074
6562
|
style: d
|
|
6075
6563
|
});
|
|
6076
6564
|
}
|
|
6077
6565
|
//#endregion
|
|
6078
|
-
export {
|
|
6566
|
+
export { Vr as PageRenderer, Hr as WebimContent, Ur as WebimPage, ge as fetchPage, We as renderRichContent, J as resolveTheme };
|