webim-adapter 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/webim-adapter.js +445 -376
- package/build/webim-bundle.js +223 -0
- package/build/webim-embed.js +10 -10
- package/build/webim-ssr.js +595 -526
- package/bundle.d.ts +11 -0
- package/package.json +7 -2
package/build/webim-adapter.js
CHANGED
|
@@ -248,36 +248,36 @@ function A(e) {
|
|
|
248
248
|
color: j,
|
|
249
249
|
inset: M
|
|
250
250
|
})), N.length && (t.boxShadow = N.join(", "));
|
|
251
|
-
let P = (e) => e.type === "blur" ? `blur(${O(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: V, filterSaturate:
|
|
251
|
+
let P = (e) => e.type === "blur" ? `blur(${O(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: V, filterSaturate: H } = t;
|
|
252
252
|
delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
|
|
253
|
-
let
|
|
254
|
-
R !== void 0 &&
|
|
255
|
-
let
|
|
256
|
-
|
|
257
|
-
let { textStrokeWidth:
|
|
258
|
-
delete t.textStrokeWidth, delete t.textStrokeColor, (
|
|
259
|
-
let { clipText:
|
|
260
|
-
delete t.clipText,
|
|
261
|
-
let { transitions:
|
|
253
|
+
let U = F(I);
|
|
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 W = F(L);
|
|
256
|
+
W.length && (t.backdropFilter = W.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
|
|
257
|
+
let { textStrokeWidth: ee, textStrokeColor: te } = t;
|
|
258
|
+
delete t.textStrokeWidth, delete t.textStrokeColor, (ee !== void 0 || te !== void 0) && (t.WebkitTextStroke = `${O(ee ?? 1)} ${te || "currentColor"}`);
|
|
259
|
+
let { clipText: ne } = t;
|
|
260
|
+
delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
|
|
261
|
+
let { transitions: re, transitionDuration: ie, transitionEasing: G, transitionProperty: ae } = t, oe = (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 K = (Array.isArray(re) ? re : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${oe(e.duration ?? 200)} ${e.easing || "ease"}`);
|
|
264
|
+
if (ie !== void 0 && K.push(`${ae || "all"} ${oe(ie)} ${G || "ease"}`), K.length && (t.transition = K.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: se, overlayOpacity: ce } = t;
|
|
270
|
+
if (delete t.overlayColor, delete t.overlayOpacity, se) {
|
|
271
|
+
let e = `color-mix(in srgb, ${se} ${ce ?? 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: le } = t;
|
|
276
276
|
delete t.backgroundLayers;
|
|
277
|
-
let
|
|
278
|
-
if (
|
|
277
|
+
let ue = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
|
|
278
|
+
if (ue.length) {
|
|
279
279
|
let e = [], n = [], r = [], i = [], a = [];
|
|
280
|
-
for (let t of
|
|
280
|
+
for (let t of ue) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
|
|
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;
|
|
@@ -369,15 +369,15 @@ function V(e, t, n = []) {
|
|
|
369
369
|
}
|
|
370
370
|
return a;
|
|
371
371
|
}
|
|
372
|
-
var
|
|
373
|
-
function
|
|
374
|
-
let i = Object.entries(A(t)).map(([e, t]) => `${
|
|
372
|
+
var H = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
|
|
373
|
+
function U(e, t, n, r = !1) {
|
|
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
|
|
378
|
-
return Object.entries(j).map(([r, i]) =>
|
|
377
|
+
function W(e, t, n) {
|
|
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 ee = [
|
|
381
381
|
{
|
|
382
382
|
key: "tablet",
|
|
383
383
|
max: 991
|
|
@@ -390,17 +390,17 @@ var U = [
|
|
|
390
390
|
key: "mobile",
|
|
391
391
|
max: 478
|
|
392
392
|
}
|
|
393
|
-
],
|
|
394
|
-
function
|
|
395
|
-
return
|
|
396
|
-
let i = t?.[n] ?
|
|
393
|
+
], te = (e) => Object.entries(A(e)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
|
|
394
|
+
function ne(e, t) {
|
|
395
|
+
return ee.map(({ key: n, max: r }) => {
|
|
396
|
+
let i = t?.[n] ? te(t[n]) : "";
|
|
397
397
|
return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
|
|
398
398
|
}).filter(Boolean).join("\n");
|
|
399
399
|
}
|
|
400
|
-
function
|
|
400
|
+
function re(e, t) {
|
|
401
401
|
let n = [], r = (e) => {
|
|
402
402
|
for (let [t, r] of Object.entries(e || {})) {
|
|
403
|
-
let e =
|
|
403
|
+
let e = ne(t, r.props);
|
|
404
404
|
e && n.push(e);
|
|
405
405
|
}
|
|
406
406
|
};
|
|
@@ -408,10 +408,10 @@ function ie(e, t) {
|
|
|
408
408
|
for (let e of Object.values(t || {})) r(e.template?.nodes);
|
|
409
409
|
return n.join("\n");
|
|
410
410
|
}
|
|
411
|
-
function
|
|
411
|
+
function ie(e, t) {
|
|
412
412
|
let n = [], r = (e) => {
|
|
413
413
|
for (let [t, r] of Object.entries(e || {})) {
|
|
414
|
-
let e =
|
|
414
|
+
let e = W(t, r.props);
|
|
415
415
|
e && n.push(e);
|
|
416
416
|
}
|
|
417
417
|
};
|
|
@@ -419,7 +419,7 @@ function ae(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 G = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", ae = {
|
|
423
423
|
light: {
|
|
424
424
|
background: "#f2f2f2",
|
|
425
425
|
surface: "#f2f2f2",
|
|
@@ -463,20 +463,20 @@ var W = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
463
463
|
}, oe = {
|
|
464
464
|
font: "system",
|
|
465
465
|
headingFont: "inherit",
|
|
466
|
-
light:
|
|
467
|
-
dark:
|
|
468
|
-
},
|
|
466
|
+
light: ae.light,
|
|
467
|
+
dark: ae.dark
|
|
468
|
+
}, K = {
|
|
469
469
|
system: {
|
|
470
470
|
label: "System",
|
|
471
|
-
value:
|
|
471
|
+
value: G
|
|
472
472
|
},
|
|
473
473
|
inter: {
|
|
474
474
|
label: "Inter",
|
|
475
|
-
value: `"Inter", ${
|
|
475
|
+
value: `"Inter", ${G}`
|
|
476
476
|
},
|
|
477
477
|
outfit: {
|
|
478
478
|
label: "Outfit",
|
|
479
|
-
value: `"Outfit", ${
|
|
479
|
+
value: `"Outfit", ${G}`
|
|
480
480
|
},
|
|
481
481
|
serif: {
|
|
482
482
|
label: "Serif",
|
|
@@ -486,7 +486,7 @@ var W = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
486
486
|
label: "Mono",
|
|
487
487
|
value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
|
|
488
488
|
}
|
|
489
|
-
},
|
|
489
|
+
}, se = (e, t) => K[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
490
|
let n = Object.assign({}, e, ...t);
|
|
491
491
|
return n.primary = {
|
|
492
492
|
...e.primary,
|
|
@@ -502,20 +502,20 @@ var W = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
|
|
|
502
502
|
}), {})
|
|
503
503
|
}, n;
|
|
504
504
|
};
|
|
505
|
-
function
|
|
505
|
+
function le(e) {
|
|
506
506
|
let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
|
|
507
507
|
return {
|
|
508
508
|
font: r ?? oe.font,
|
|
509
509
|
headingFont: i ?? oe.headingFont,
|
|
510
|
-
light:
|
|
511
|
-
dark:
|
|
510
|
+
light: ce(ae.light, a, t),
|
|
511
|
+
dark: ce(ae.dark, n)
|
|
512
512
|
};
|
|
513
513
|
}
|
|
514
|
-
function
|
|
514
|
+
function ue(e) {
|
|
515
515
|
return {
|
|
516
516
|
"--page-bg": e.background,
|
|
517
517
|
"--page-surface": e.surface ?? e.background,
|
|
518
|
-
"--page-border": e.border ??
|
|
518
|
+
"--page-border": e.border ?? ae.light.border,
|
|
519
519
|
"--page-text": e.text,
|
|
520
520
|
"--page-accent": e.accent,
|
|
521
521
|
"--page-accent-text": e.accentText,
|
|
@@ -529,31 +529,31 @@ function q(e) {
|
|
|
529
529
|
"--page-secondary-contrast": e.secondary.contrastText
|
|
530
530
|
};
|
|
531
531
|
}
|
|
532
|
-
function
|
|
533
|
-
let t =
|
|
532
|
+
function de(e) {
|
|
533
|
+
let t = le(e);
|
|
534
534
|
return {
|
|
535
535
|
backgroundColor: "var(--page-bg)",
|
|
536
536
|
color: "var(--page-text)",
|
|
537
|
-
fontFamily:
|
|
538
|
-
"--page-heading-font": t.headingFont === "inherit" ? "inherit" :
|
|
537
|
+
fontFamily: se(t.font, G),
|
|
538
|
+
"--page-heading-font": t.headingFont === "inherit" ? "inherit" : se(t.headingFont, "inherit")
|
|
539
539
|
};
|
|
540
540
|
}
|
|
541
|
-
function
|
|
542
|
-
let n =
|
|
541
|
+
function fe(e, t = "light") {
|
|
542
|
+
let n = le(e);
|
|
543
543
|
return {
|
|
544
|
-
...
|
|
545
|
-
...
|
|
544
|
+
...de(e),
|
|
545
|
+
...ue(n[t] ?? n.light)
|
|
546
546
|
};
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function pe(e, t) {
|
|
549
549
|
return e?.themeRef && t?.[e.themeRef] || e?.theme;
|
|
550
550
|
}
|
|
551
|
-
function
|
|
551
|
+
function me(e, t) {
|
|
552
552
|
return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
|
|
553
553
|
}
|
|
554
554
|
//#endregion
|
|
555
555
|
//#region src/bundle.js
|
|
556
|
-
function
|
|
556
|
+
function he({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
557
557
|
let a = {
|
|
558
558
|
...t?.global ?? {},
|
|
559
559
|
...t?.tenant ?? {}
|
|
@@ -563,7 +563,7 @@ function pe({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
563
563
|
title: e.title,
|
|
564
564
|
slug: e.slug,
|
|
565
565
|
blocks: i && o.i18n?.[i]?.blocks || e.blocks,
|
|
566
|
-
theme:
|
|
566
|
+
theme: pe(o, a.builder_themes?.themes),
|
|
567
567
|
components: a.builder_components?.components ?? {},
|
|
568
568
|
custom: o.custom,
|
|
569
569
|
animations: o.animations,
|
|
@@ -579,18 +579,18 @@ function pe({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
|
|
|
579
579
|
}
|
|
580
580
|
//#endregion
|
|
581
581
|
//#region src/fetchPage.js
|
|
582
|
-
var
|
|
582
|
+
var ge = async (e) => {
|
|
583
583
|
let t = await e.json().catch(() => null);
|
|
584
584
|
if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
|
|
585
585
|
return t?.payload ?? t;
|
|
586
586
|
};
|
|
587
|
-
async function
|
|
587
|
+
async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
|
|
588
588
|
if (!e) throw Error("fetchPage: apiUrl is required");
|
|
589
589
|
if (!n) throw Error("fetchPage: slug is required");
|
|
590
590
|
let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
|
|
591
591
|
...t ? { "x-tenant": t } : {},
|
|
592
592
|
...a ? { authorization: `Bearer ${a}` } : {}
|
|
593
|
-
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(
|
|
593
|
+
}, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(ge), c(`${l}/settings/public`, { headers: u }).then(ge)]), p = he({
|
|
594
594
|
page: d,
|
|
595
595
|
settings: f,
|
|
596
596
|
tenant: t,
|
|
@@ -604,7 +604,7 @@ async function he({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
604
604
|
"MasonryBlock"
|
|
605
605
|
].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
|
|
606
606
|
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(
|
|
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(ge).then((e) => {
|
|
608
608
|
let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
|
|
609
609
|
return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
|
|
610
610
|
}).catch(() => [[t, []]])));
|
|
@@ -618,7 +618,7 @@ async function he({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
|
|
|
618
618
|
}
|
|
619
619
|
//#endregion
|
|
620
620
|
//#region ../ui/src/components/builder/locale.js
|
|
621
|
-
var
|
|
621
|
+
var ve = /* @__PURE__ */ new Set([
|
|
622
622
|
"ar",
|
|
623
623
|
"he",
|
|
624
624
|
"fa",
|
|
@@ -629,34 +629,34 @@ var ge = /* @__PURE__ */ new Set([
|
|
|
629
629
|
"yi",
|
|
630
630
|
"dv",
|
|
631
631
|
"ckb"
|
|
632
|
-
]),
|
|
632
|
+
]), ye = (e) => ve.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", be = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ye(t) : void 0, q = t({
|
|
633
633
|
tenant: "",
|
|
634
634
|
apiUrl: "/api",
|
|
635
635
|
locale: "",
|
|
636
636
|
settings: null
|
|
637
|
-
}),
|
|
637
|
+
}), xe = t(null), Se = (e) => {
|
|
638
638
|
let t = Number(e?.__page);
|
|
639
639
|
if (Number.isFinite(t) && t >= 1) return Math.floor(t);
|
|
640
640
|
if (typeof window > "u") return 1;
|
|
641
641
|
let n = Number(new URLSearchParams(window.location.search).get("page"));
|
|
642
642
|
return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
|
|
643
|
-
},
|
|
643
|
+
}, Ce = () => {
|
|
644
644
|
if (typeof window > "u") return {};
|
|
645
645
|
let e = {};
|
|
646
646
|
return new URLSearchParams(window.location.search).forEach((t, n) => {
|
|
647
647
|
n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
|
|
648
648
|
}), e;
|
|
649
|
-
},
|
|
649
|
+
}, J = (e) => {
|
|
650
650
|
let t = {
|
|
651
651
|
...e && typeof e == "object" && !Array.isArray(e) ? e : {},
|
|
652
|
-
...
|
|
652
|
+
...Ce()
|
|
653
653
|
};
|
|
654
654
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
|
|
655
|
-
},
|
|
656
|
-
function
|
|
655
|
+
}, Y = t(null), X = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
656
|
+
function we(e, t) {
|
|
657
657
|
if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
|
|
658
658
|
}
|
|
659
|
-
var
|
|
659
|
+
var Te = (e) => {
|
|
660
660
|
let t = [];
|
|
661
661
|
for (let [n, r] of Object.entries(e ?? {})) {
|
|
662
662
|
if (!/^[\w-]+$/.test(n)) continue;
|
|
@@ -666,36 +666,36 @@ var Ee = (e) => {
|
|
|
666
666
|
}
|
|
667
667
|
return t;
|
|
668
668
|
};
|
|
669
|
-
function
|
|
669
|
+
function Z(e) {
|
|
670
670
|
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
671
|
}
|
|
672
|
-
function
|
|
673
|
-
let n = t?.data ?? {}, r =
|
|
672
|
+
function Ee(e, t) {
|
|
673
|
+
let n = t?.data ?? {}, r = Te(n);
|
|
674
674
|
if (!r.length) return e;
|
|
675
|
-
let i = RegExp(`:(${r.map(
|
|
675
|
+
let i = RegExp(`:(${r.map(X).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Z(we(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
676
|
return a(e);
|
|
677
677
|
}
|
|
678
|
-
var
|
|
678
|
+
var De = {
|
|
679
679
|
margin: 0,
|
|
680
680
|
fontWeight: 700,
|
|
681
681
|
lineHeight: 1.2,
|
|
682
682
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
683
|
-
},
|
|
683
|
+
}, Oe = { margin: 0 }, ke = {
|
|
684
684
|
display: "inline-block",
|
|
685
685
|
textDecoration: "none",
|
|
686
686
|
cursor: "pointer",
|
|
687
687
|
backgroundColor: "var(--page-accent, #111827)",
|
|
688
688
|
color: "var(--page-accent-text, #ffffff)"
|
|
689
|
-
},
|
|
689
|
+
}, Ae = {
|
|
690
690
|
flexGrow: 1,
|
|
691
691
|
display: "flex",
|
|
692
692
|
flexDirection: "column",
|
|
693
693
|
position: "relative"
|
|
694
|
-
},
|
|
694
|
+
}, je = {
|
|
695
695
|
display: "flex",
|
|
696
696
|
flexDirection: "column"
|
|
697
697
|
};
|
|
698
|
-
function
|
|
698
|
+
function Me({ style: e }) {
|
|
699
699
|
let t = e?.backgroundVideo;
|
|
700
700
|
if (!t) return null;
|
|
701
701
|
let n = {
|
|
@@ -721,7 +721,7 @@ function Ne({ style: e }) {
|
|
|
721
721
|
background: r
|
|
722
722
|
} })] });
|
|
723
723
|
}
|
|
724
|
-
var
|
|
724
|
+
var Ne = (e, t) => e?.backgroundVideo ? {
|
|
725
725
|
position: "relative",
|
|
726
726
|
...t,
|
|
727
727
|
...A(e)
|
|
@@ -729,24 +729,24 @@ var Pe = (e, t) => e?.backgroundVideo ? {
|
|
|
729
729
|
...t,
|
|
730
730
|
...A(e)
|
|
731
731
|
};
|
|
732
|
-
function
|
|
732
|
+
function Pe({ style: e, nodeRef: t, children: n }) {
|
|
733
733
|
return /* @__PURE__ */ d("div", {
|
|
734
734
|
ref: t,
|
|
735
735
|
style: {
|
|
736
|
-
...
|
|
736
|
+
...Ae,
|
|
737
737
|
...A(e)
|
|
738
738
|
},
|
|
739
|
-
children: [/* @__PURE__ */ u(
|
|
739
|
+
children: [/* @__PURE__ */ u(Me, { style: e }), n]
|
|
740
740
|
});
|
|
741
741
|
}
|
|
742
|
-
function
|
|
742
|
+
function Fe({ style: e, nodeRef: t, children: n }) {
|
|
743
743
|
return /* @__PURE__ */ d("section", {
|
|
744
744
|
ref: t,
|
|
745
|
-
style:
|
|
746
|
-
children: [/* @__PURE__ */ u(
|
|
745
|
+
style: Ne(e, je),
|
|
746
|
+
children: [/* @__PURE__ */ u(Me, { style: e }), n]
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
|
-
function
|
|
749
|
+
function Ie({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
750
750
|
let i = t ? {
|
|
751
751
|
position: "relative",
|
|
752
752
|
minHeight: 240
|
|
@@ -755,32 +755,32 @@ function Le({ style: e, freeLayout: t, nodeRef: n, children: r }) {
|
|
|
755
755
|
ref: n,
|
|
756
756
|
style: i ? {
|
|
757
757
|
...i,
|
|
758
|
-
...
|
|
759
|
-
} :
|
|
760
|
-
children: [/* @__PURE__ */ u(
|
|
758
|
+
...Ne(e)
|
|
759
|
+
} : Ne(e),
|
|
760
|
+
children: [/* @__PURE__ */ u(Me, { style: e }), r]
|
|
761
761
|
});
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function Le({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
|
|
764
764
|
return /* @__PURE__ */ u(n, {
|
|
765
765
|
ref: a,
|
|
766
766
|
style: {
|
|
767
|
-
...
|
|
767
|
+
...De,
|
|
768
768
|
...A(r)
|
|
769
769
|
},
|
|
770
|
-
children:
|
|
770
|
+
children: Be(t, e, i)
|
|
771
771
|
});
|
|
772
772
|
}
|
|
773
|
-
var
|
|
774
|
-
fontFamily:
|
|
773
|
+
var Re = {
|
|
774
|
+
fontFamily: K.mono.value,
|
|
775
775
|
background: "rgba(148, 163, 184, 0.18)",
|
|
776
776
|
padding: "1px 5px",
|
|
777
777
|
borderRadius: 4,
|
|
778
778
|
fontSize: "0.9em"
|
|
779
779
|
};
|
|
780
|
-
function
|
|
780
|
+
function ze(e, t = [], n, r) {
|
|
781
781
|
let i = e;
|
|
782
782
|
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
|
-
style:
|
|
783
|
+
style: Re,
|
|
784
784
|
children: i
|
|
785
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 && (i = /* @__PURE__ */ u("a", {
|
|
786
786
|
href: n,
|
|
@@ -790,13 +790,13 @@ function Be(e, t = [], n, r) {
|
|
|
790
790
|
children: i
|
|
791
791
|
})), i;
|
|
792
792
|
}
|
|
793
|
-
function
|
|
793
|
+
function Be(t, n, r) {
|
|
794
794
|
return t?.length ? t.map((t, n) => {
|
|
795
795
|
if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
|
|
796
|
-
if (t.parts) return /* @__PURE__ */ u(e, { children:
|
|
796
|
+
if (t.parts) return /* @__PURE__ */ u(e, { children: Be(t.parts, "", r) }, n);
|
|
797
797
|
let i = t.text;
|
|
798
798
|
return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
|
|
799
|
-
style:
|
|
799
|
+
style: Re,
|
|
800
800
|
children: i
|
|
801
801
|
})), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
|
|
802
802
|
style: {
|
|
@@ -816,7 +816,7 @@ function Z(t, n, r) {
|
|
|
816
816
|
function Ve({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
|
|
817
817
|
return /* @__PURE__ */ u("span", {
|
|
818
818
|
style: A(a),
|
|
819
|
-
children: e?.length ?
|
|
819
|
+
children: e?.length ? Be(e, t) : ze(t, n, r, i)
|
|
820
820
|
});
|
|
821
821
|
}
|
|
822
822
|
var He = {
|
|
@@ -862,7 +862,7 @@ function Ue({ align: e = "center", width: t, wrap: n } = {}) {
|
|
|
862
862
|
};
|
|
863
863
|
}
|
|
864
864
|
function We(e = [], t, n) {
|
|
865
|
-
let r = n ?? ((e, n) =>
|
|
865
|
+
let r = n ?? ((e, n) => Be(e, n, t));
|
|
866
866
|
return e.map((t, n) => {
|
|
867
867
|
let i = {
|
|
868
868
|
marginTop: 0,
|
|
@@ -921,6 +921,47 @@ function We(e = [], t, n) {
|
|
|
921
921
|
start: t.start
|
|
922
922
|
})
|
|
923
923
|
}, n) : null;
|
|
924
|
+
if (t.type === "button") {
|
|
925
|
+
if (!(typeof t.label == "string" && t.label.trim())) return null;
|
|
926
|
+
let e = Number.isFinite(Number(t.radius)) ? Number(t.radius) : 8, r = ["center", "right"].includes(t.align) ? t.align : "left";
|
|
927
|
+
return /* @__PURE__ */ u("div", {
|
|
928
|
+
style: {
|
|
929
|
+
...i,
|
|
930
|
+
textAlign: r
|
|
931
|
+
},
|
|
932
|
+
children: /* @__PURE__ */ u("table", {
|
|
933
|
+
role: "presentation",
|
|
934
|
+
cellPadding: 0,
|
|
935
|
+
cellSpacing: 0,
|
|
936
|
+
style: {
|
|
937
|
+
borderCollapse: "separate",
|
|
938
|
+
display: "inline-table"
|
|
939
|
+
},
|
|
940
|
+
children: /* @__PURE__ */ u("tbody", { children: /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
941
|
+
style: {
|
|
942
|
+
backgroundColor: t.bg || "var(--page-accent, #4f46e5)",
|
|
943
|
+
borderRadius: e
|
|
944
|
+
},
|
|
945
|
+
children: /* @__PURE__ */ u("a", {
|
|
946
|
+
href: t.href || "#",
|
|
947
|
+
target: t.target || void 0,
|
|
948
|
+
rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
949
|
+
style: {
|
|
950
|
+
display: "inline-block",
|
|
951
|
+
padding: "13px 24px",
|
|
952
|
+
color: t.color || "#ffffff",
|
|
953
|
+
fontSize: 15,
|
|
954
|
+
fontWeight: 600,
|
|
955
|
+
lineHeight: 1.2,
|
|
956
|
+
textDecoration: "none",
|
|
957
|
+
borderRadius: e
|
|
958
|
+
},
|
|
959
|
+
children: t.label
|
|
960
|
+
})
|
|
961
|
+
}) }) })
|
|
962
|
+
})
|
|
963
|
+
}, n);
|
|
964
|
+
}
|
|
924
965
|
if (t.type === "divider") return /* @__PURE__ */ u("hr", { style: {
|
|
925
966
|
...i,
|
|
926
967
|
border: 0,
|
|
@@ -983,7 +1024,7 @@ function We(e = [], t, n) {
|
|
|
983
1024
|
let e = t.type;
|
|
984
1025
|
return /* @__PURE__ */ u(e, {
|
|
985
1026
|
style: {
|
|
986
|
-
...
|
|
1027
|
+
...De,
|
|
987
1028
|
fontSize: He[t.type],
|
|
988
1029
|
...i
|
|
989
1030
|
},
|
|
@@ -992,7 +1033,7 @@ function We(e = [], t, n) {
|
|
|
992
1033
|
}
|
|
993
1034
|
return /* @__PURE__ */ u("p", {
|
|
994
1035
|
style: {
|
|
995
|
-
...
|
|
1036
|
+
...Oe,
|
|
996
1037
|
...i
|
|
997
1038
|
},
|
|
998
1039
|
children: r(t.parts, t.text)
|
|
@@ -1021,7 +1062,7 @@ function qe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
|
1021
1062
|
...Ke,
|
|
1022
1063
|
...A(n)
|
|
1023
1064
|
},
|
|
1024
|
-
children:
|
|
1065
|
+
children: Be(t, e, r)
|
|
1025
1066
|
});
|
|
1026
1067
|
}
|
|
1027
1068
|
function Je({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
@@ -1034,7 +1075,7 @@ function Je({ ordered: e, items: t = [], style: n, nodeRef: r }) {
|
|
|
1034
1075
|
},
|
|
1035
1076
|
children: t.map((e, t) => /* @__PURE__ */ u("li", {
|
|
1036
1077
|
style: { marginBottom: 4 },
|
|
1037
|
-
children:
|
|
1078
|
+
children: Be(e.parts, e.text)
|
|
1038
1079
|
}, t))
|
|
1039
1080
|
});
|
|
1040
1081
|
}
|
|
@@ -1042,10 +1083,10 @@ function Ye({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
|
|
|
1042
1083
|
return /* @__PURE__ */ u("p", {
|
|
1043
1084
|
ref: i,
|
|
1044
1085
|
style: {
|
|
1045
|
-
...
|
|
1086
|
+
...Oe,
|
|
1046
1087
|
...A(n)
|
|
1047
1088
|
},
|
|
1048
|
-
children:
|
|
1089
|
+
children: Be(t, e, r)
|
|
1049
1090
|
});
|
|
1050
1091
|
}
|
|
1051
1092
|
var Xe = {
|
|
@@ -1064,7 +1105,7 @@ function Ze({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRe
|
|
|
1064
1105
|
...Xe,
|
|
1065
1106
|
...A(i)
|
|
1066
1107
|
},
|
|
1067
|
-
children:
|
|
1108
|
+
children: Be(t, e, a)
|
|
1068
1109
|
});
|
|
1069
1110
|
}
|
|
1070
1111
|
function Qe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
|
|
@@ -1074,10 +1115,10 @@ function Qe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRe
|
|
|
1074
1115
|
target: r || void 0,
|
|
1075
1116
|
rel: r === "_blank" ? "noopener noreferrer" : void 0,
|
|
1076
1117
|
style: {
|
|
1077
|
-
...
|
|
1118
|
+
...ke,
|
|
1078
1119
|
...A(i)
|
|
1079
1120
|
},
|
|
1080
|
-
children:
|
|
1121
|
+
children: Be(t, e, a)
|
|
1081
1122
|
});
|
|
1082
1123
|
}
|
|
1083
1124
|
function $e({ src: e, alt: t, style: n, nodeRef: r }) {
|
|
@@ -1726,9 +1767,9 @@ function xt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
|
|
|
1726
1767
|
});
|
|
1727
1768
|
}
|
|
1728
1769
|
function St(e, t = {}, n = 0) {
|
|
1729
|
-
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" :
|
|
1770
|
+
let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Z(e), a = Math.max(0, Number(n) || 0), o = [];
|
|
1730
1771
|
for (let e of r) {
|
|
1731
|
-
let n = e.data ?? e, r =
|
|
1772
|
+
let n = e.data ?? e, r = we(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(we(n, t.nameField)) : i(n.name), l = t.hrefField ? i(we(n, t.hrefField)) : "";
|
|
1732
1773
|
for (let e of s) if (o.push({
|
|
1733
1774
|
src: e,
|
|
1734
1775
|
name: c,
|
|
@@ -1739,7 +1780,7 @@ function St(e, t = {}, n = 0) {
|
|
|
1739
1780
|
return o;
|
|
1740
1781
|
}
|
|
1741
1782
|
function Ct({ 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 }) {
|
|
1742
|
-
let { tenant: x, apiUrl: S } = r(
|
|
1783
|
+
let { tenant: x, apiUrl: S } = r(q), C = r(xe)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
|
|
1743
1784
|
i(() => {
|
|
1744
1785
|
if (!t || C) return;
|
|
1745
1786
|
let e = !0;
|
|
@@ -1974,7 +2015,7 @@ var wt = {
|
|
|
1974
2015
|
zIndex: 60
|
|
1975
2016
|
};
|
|
1976
2017
|
function Et(e, t = {}, n = "dropdown") {
|
|
1977
|
-
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 ? "" :
|
|
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 ? "" : Z(e), o = r.map((e) => {
|
|
1978
2019
|
let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
|
|
1979
2020
|
return {
|
|
1980
2021
|
key: e.id,
|
|
@@ -2016,7 +2057,7 @@ function Et(e, t = {}, n = "dropdown") {
|
|
|
2016
2057
|
}));
|
|
2017
2058
|
}
|
|
2018
2059
|
function Dt({ 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" }) {
|
|
2019
|
-
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(
|
|
2060
|
+
let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(q), P = r(xe)?.[g], [F, I] = c(null);
|
|
2020
2061
|
i(() => {
|
|
2021
2062
|
if (!g || P) return;
|
|
2022
2063
|
let e = !0;
|
|
@@ -2532,7 +2573,7 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
|
|
|
2532
2573
|
});
|
|
2533
2574
|
}
|
|
2534
2575
|
function Ht({ 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 }) {
|
|
2535
|
-
let { tenant: y, apiUrl: b } = r(
|
|
2576
|
+
let { tenant: y, apiUrl: b } = r(q), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
|
|
2536
2577
|
i(() => {
|
|
2537
2578
|
if (!f || !s) return;
|
|
2538
2579
|
let e = !0;
|
|
@@ -2649,7 +2690,7 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2649
2690
|
disabled: h || void 0,
|
|
2650
2691
|
onClick: () => O(F - 1),
|
|
2651
2692
|
style: {
|
|
2652
|
-
...
|
|
2693
|
+
...ke,
|
|
2653
2694
|
background: "transparent",
|
|
2654
2695
|
color: "inherit",
|
|
2655
2696
|
border: 0,
|
|
@@ -2662,7 +2703,7 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2662
2703
|
disabled: h || L.length > 0,
|
|
2663
2704
|
onClick: () => O(F + 1),
|
|
2664
2705
|
style: {
|
|
2665
|
-
...
|
|
2706
|
+
...ke,
|
|
2666
2707
|
border: 0,
|
|
2667
2708
|
padding: "10px 22px",
|
|
2668
2709
|
borderRadius: 8,
|
|
@@ -2676,7 +2717,7 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
|
|
|
2676
2717
|
type: "submit",
|
|
2677
2718
|
disabled: h || void 0,
|
|
2678
2719
|
style: {
|
|
2679
|
-
...
|
|
2720
|
+
...ke,
|
|
2680
2721
|
border: 0,
|
|
2681
2722
|
padding: "10px 22px",
|
|
2682
2723
|
borderRadius: 8,
|
|
@@ -2723,7 +2764,7 @@ var Ut = null, Wt = null, Gt = (e) => {
|
|
|
2723
2764
|
}), Ut;
|
|
2724
2765
|
};
|
|
2725
2766
|
function Kt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
|
|
2726
|
-
let p = r(
|
|
2767
|
+
let p = r(q), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
|
|
2727
2768
|
if (_.current = f, i(() => {
|
|
2728
2769
|
if (l || !h || !g.current) return;
|
|
2729
2770
|
let e = !0, r = (t) => {
|
|
@@ -2818,7 +2859,7 @@ function qt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
|
|
|
2818
2859
|
...jt,
|
|
2819
2860
|
...A(n)
|
|
2820
2861
|
},
|
|
2821
|
-
children:
|
|
2862
|
+
children: Be(t, e, i)
|
|
2822
2863
|
});
|
|
2823
2864
|
}
|
|
2824
2865
|
function Jt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
|
|
@@ -2931,7 +2972,7 @@ function $t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
|
|
|
2931
2972
|
ref: n,
|
|
2932
2973
|
type: r ? "button" : "submit",
|
|
2933
2974
|
style: {
|
|
2934
|
-
...
|
|
2975
|
+
...ke,
|
|
2935
2976
|
border: 0,
|
|
2936
2977
|
cursor: "pointer",
|
|
2937
2978
|
alignSelf: "flex-start",
|
|
@@ -2964,7 +3005,7 @@ function en({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
|
|
|
2964
3005
|
});
|
|
2965
3006
|
}
|
|
2966
3007
|
function tn({ 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: _ }) {
|
|
2967
|
-
let { tenant: v, apiUrl: y, locale: b } = r(
|
|
3008
|
+
let { tenant: v, apiUrl: y, locale: b } = r(q), x = r(Y), S = r(xe), [, C] = c(0);
|
|
2968
3009
|
i(() => {
|
|
2969
3010
|
if (typeof window > "u") return;
|
|
2970
3011
|
let e = () => C((e) => e + 1);
|
|
@@ -2972,7 +3013,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
2972
3013
|
window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
|
|
2973
3014
|
};
|
|
2974
3015
|
}, []);
|
|
2975
|
-
let w =
|
|
3016
|
+
let w = J(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? Se(S) : 1, [k, j] = c(null);
|
|
2976
3017
|
if (i(() => {
|
|
2977
3018
|
if (!e || D) return;
|
|
2978
3019
|
let n = !0, r = new URLSearchParams();
|
|
@@ -3017,7 +3058,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3017
3058
|
},
|
|
3018
3059
|
children: N.map((e) => /* @__PURE__ */ u("div", {
|
|
3019
3060
|
style: { minWidth: 0 },
|
|
3020
|
-
children: x.render(p, (t) =>
|
|
3061
|
+
children: x.render(p, (t) => Ee(t, e))
|
|
3021
3062
|
}, e.id ?? e?.data?.slug))
|
|
3022
3063
|
}) : /* @__PURE__ */ u("div", {
|
|
3023
3064
|
ref: _,
|
|
@@ -3027,7 +3068,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3027
3068
|
...A(g)
|
|
3028
3069
|
},
|
|
3029
3070
|
children: N.map((e) => {
|
|
3030
|
-
let t = o ?
|
|
3071
|
+
let t = o ? we(e?.data, o) : null, r = s ? Z(we(e?.data, s)) : null, i = l ? we(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : Z(i), f = n === "list";
|
|
3031
3072
|
return /* @__PURE__ */ d("div", {
|
|
3032
3073
|
style: {
|
|
3033
3074
|
display: "flex",
|
|
@@ -3083,7 +3124,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
|
|
|
3083
3124
|
});
|
|
3084
3125
|
}
|
|
3085
3126
|
function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
|
|
3086
|
-
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} :
|
|
3127
|
+
let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Ce(), s = {
|
|
3087
3128
|
height: 34,
|
|
3088
3129
|
padding: "0 12px",
|
|
3089
3130
|
borderRadius: 8,
|
|
@@ -3236,7 +3277,7 @@ function rn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
|
|
|
3236
3277
|
}) : null;
|
|
3237
3278
|
}
|
|
3238
3279
|
function an({ 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 }) {
|
|
3239
|
-
let { tenant: g, apiUrl: _ } = r(
|
|
3280
|
+
let { tenant: g, apiUrl: _ } = r(q), v = r(xe), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
|
|
3240
3281
|
i(() => {
|
|
3241
3282
|
if (!o || Number.isFinite(x)) return;
|
|
3242
3283
|
let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
|
|
@@ -3255,7 +3296,7 @@ function an({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
|
|
|
3255
3296
|
]);
|
|
3256
3297
|
let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
|
|
3257
3298
|
if (o && C === null || o && f && !(C > 0)) return null;
|
|
3258
|
-
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ?
|
|
3299
|
+
let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? Se(v) : Number(t) || 1, 1), w), E = (e) => {
|
|
3259
3300
|
if (o) {
|
|
3260
3301
|
if (typeof window < "u") {
|
|
3261
3302
|
let t = new URLSearchParams(window.location.search);
|
|
@@ -3845,7 +3886,7 @@ var xn = (e, t) => {
|
|
|
3845
3886
|
return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
|
|
3846
3887
|
}, Cn = (e) => !!(e?.cv?.trim?.() || e?.photo);
|
|
3847
3888
|
function wn(e, t = {}) {
|
|
3848
|
-
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 ? "" :
|
|
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 ? "" : Z(e);
|
|
3849
3890
|
return n.map((e) => {
|
|
3850
3891
|
let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
|
|
3851
3892
|
return {
|
|
@@ -3985,7 +4026,7 @@ function En({ node: e, onClose: t }) {
|
|
|
3985
4026
|
});
|
|
3986
4027
|
}
|
|
3987
4028
|
function Dn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
|
|
3988
|
-
let b = a(), [x, S] = c(null), { tenant: C, apiUrl: w } = r(
|
|
4029
|
+
let b = a(), [x, S] = c(null), { tenant: C, apiUrl: w } = r(q), T = r(xe)?.[t], [E, D] = c(null);
|
|
3989
4030
|
i(() => {
|
|
3990
4031
|
if (!t || T) return;
|
|
3991
4032
|
let e = !0;
|
|
@@ -4203,85 +4244,102 @@ function On({ value: e, onCommit: t, style: n, hint: r }) {
|
|
|
4203
4244
|
children: e ?? ""
|
|
4204
4245
|
});
|
|
4205
4246
|
}
|
|
4206
|
-
var kn = 360, An = "\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", jn = (e, t) => e && t ? `cell-${e}-${t}` : ""
|
|
4207
|
-
|
|
4208
|
-
let
|
|
4247
|
+
var kn = 360, An = "\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", jn = (e, t) => e && t ? `cell-${e}-${t}` : "", Mn = (e) => {
|
|
4248
|
+
if (!e || typeof e != "object") return e ?? "";
|
|
4249
|
+
let t = String(e.text ?? "");
|
|
4250
|
+
return typeof e.href == "string" && e.href ? /* @__PURE__ */ u("a", {
|
|
4251
|
+
href: e.href,
|
|
4252
|
+
target: "_blank",
|
|
4253
|
+
rel: "noopener noreferrer",
|
|
4254
|
+
style: { color: "var(--page-accent, #4f46e5)" },
|
|
4255
|
+
children: t
|
|
4256
|
+
}) : t;
|
|
4257
|
+
};
|
|
4258
|
+
function Nn({ 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, maxHeight: k, style: j, nodeRef: M, edit: N }) {
|
|
4259
|
+
let P = s(null), F = s(null), [I, L] = c(null), [R, z] = c(null), B = (e, t) => () => L({
|
|
4209
4260
|
r: e,
|
|
4210
4261
|
c: t
|
|
4211
4262
|
});
|
|
4212
4263
|
i(() => {
|
|
4213
|
-
if (!
|
|
4214
|
-
let e =
|
|
4264
|
+
if (!N) return;
|
|
4265
|
+
let e = F.current, t = I && e?.querySelector(`[data-cell="${I.r}-${I.c}"]`);
|
|
4215
4266
|
if (!t) {
|
|
4216
|
-
|
|
4267
|
+
R && z(null);
|
|
4217
4268
|
return;
|
|
4218
4269
|
}
|
|
4219
4270
|
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
|
|
4220
4271
|
top: r.bottom - n.top + 4,
|
|
4221
4272
|
left: Math.max(0, Math.min(r.left - n.left, n.width - kn))
|
|
4222
4273
|
};
|
|
4223
|
-
(
|
|
4274
|
+
(R?.top !== i.top || R?.left !== i.left) && z(i);
|
|
4224
4275
|
}), i(() => {
|
|
4225
|
-
if (!
|
|
4276
|
+
if (!N || !I) return;
|
|
4226
4277
|
let e = (e) => {
|
|
4227
|
-
|
|
4278
|
+
F.current?.contains(e.target) || L(null);
|
|
4228
4279
|
};
|
|
4229
4280
|
return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
|
|
4230
|
-
}, [
|
|
4231
|
-
let { tenant:
|
|
4281
|
+
}, [N, I]);
|
|
4282
|
+
let { tenant: V, apiUrl: H } = r(q), U = r(xe), W = U?.[h], ee = C ? Se(U) : 1, [te, ne] = c(null);
|
|
4232
4283
|
if (i(() => {
|
|
4233
|
-
if (!h ||
|
|
4234
|
-
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(
|
|
4235
|
-
return fetch(r, { headers:
|
|
4284
|
+
if (!h || W) return;
|
|
4285
|
+
let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(ee - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${H}/data/${encodeURIComponent(h.slice(4))}` : `${H}/dynamic/${encodeURIComponent(h)}${n}`;
|
|
4286
|
+
return fetch(r, { headers: V ? { "x-tenant": V } : {} }).then((e) => e.json()).then((t) => {
|
|
4236
4287
|
let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
|
|
4237
|
-
return e &&
|
|
4238
|
-
}).catch(() => e &&
|
|
4288
|
+
return e && ne(n);
|
|
4289
|
+
}).catch(() => e && ne([])), () => {
|
|
4239
4290
|
e = !1;
|
|
4240
4291
|
};
|
|
4241
4292
|
}, [
|
|
4242
4293
|
h,
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4294
|
+
V,
|
|
4295
|
+
H,
|
|
4296
|
+
W,
|
|
4246
4297
|
C,
|
|
4247
|
-
|
|
4298
|
+
ee,
|
|
4248
4299
|
g
|
|
4249
4300
|
]), !e.length) return null;
|
|
4250
|
-
let
|
|
4301
|
+
let re = Math.max(1, Number(g) || 10), ie = h ? C ? W || h.startsWith("api:") ? (W ?? te ?? []).slice((ee - 1) * re, ee * re) : (te ?? []).slice(0, re) : (W ?? te ?? []).slice(0, re) : null, G = ie ? ie.map((t) => e.map((e) => Z(we(t?.data, e.field)))) : t, ae = !!h && !(h && !W && te === null) && G.length === 0, oe = b ? {
|
|
4251
4302
|
y: 6,
|
|
4252
4303
|
x: 10
|
|
4253
4304
|
} : {
|
|
4254
4305
|
y: 10,
|
|
4255
4306
|
x: 14
|
|
4256
|
-
},
|
|
4257
|
-
|
|
4307
|
+
}, K = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : oe.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : oe.x}px`, se = "1px solid 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
|
+
"left",
|
|
4309
|
+
"center",
|
|
4310
|
+
"right"
|
|
4311
|
+
], de = (t) => ue.includes(e[t]?.align) ? e[t].align : "", fe = (e) => de(e) || (ue.includes(O) ? O : "left"), pe = Number.isFinite(Number(k)) && Number(k) > 0 ? Number(k) : 0, me = A(j), he = !pe && me && me.maxHeight !== void 0 ? me.maxHeight : 0, ge = pe || he, _e = he ? {
|
|
4312
|
+
...me,
|
|
4313
|
+
maxHeight: void 0
|
|
4314
|
+
} : me, ve = !!N && N.rows !== !1, ye = (t) => (r) => {
|
|
4315
|
+
if (!N?.resize || t >= e.length - 1) return;
|
|
4258
4316
|
r.preventDefault(), r.stopPropagation();
|
|
4259
|
-
let i =
|
|
4317
|
+
let i = P.current, a = i ? i.clientWidth : 0;
|
|
4260
4318
|
if (!a) return;
|
|
4261
|
-
let o =
|
|
4319
|
+
let o = le ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
|
|
4262
4320
|
let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
|
|
4263
|
-
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10,
|
|
4321
|
+
i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, N.resize(i);
|
|
4264
4322
|
}, u = () => {
|
|
4265
4323
|
window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
|
|
4266
4324
|
};
|
|
4267
4325
|
window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
|
|
4268
|
-
},
|
|
4269
|
-
p &&
|
|
4326
|
+
}, be = /* @__PURE__ */ new Set();
|
|
4327
|
+
p && G.forEach((t, n) => e.forEach((e, t) => {
|
|
4270
4328
|
let r = p[jn(a[n], o[t])];
|
|
4271
4329
|
if (!r) return;
|
|
4272
4330
|
let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
|
|
4273
|
-
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) &&
|
|
4331
|
+
for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && be.add(`${n + e},${t + r}`);
|
|
4274
4332
|
}));
|
|
4275
|
-
let
|
|
4276
|
-
if (!
|
|
4333
|
+
let Ce = (e) => (t) => {
|
|
4334
|
+
if (!N?.resizeRow) return;
|
|
4277
4335
|
t.preventDefault(), t.stopPropagation();
|
|
4278
4336
|
let n = t.currentTarget.closest("tr");
|
|
4279
4337
|
if (!n) return;
|
|
4280
|
-
let r = t.clientY, i = n.offsetHeight, a = (t) =>
|
|
4338
|
+
let r = t.clientY, i = n.offsetHeight, a = (t) => N.resizeRow(e, Math.max(20, Math.round(i + (t.clientY - r)))), o = () => {
|
|
4281
4339
|
window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
|
|
4282
4340
|
};
|
|
4283
4341
|
window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
|
|
4284
|
-
},
|
|
4342
|
+
}, J = (e, t, n, r) => r ? null : /* @__PURE__ */ u("span", {
|
|
4285
4343
|
className: "wb-tedit-btn",
|
|
4286
4344
|
role: "button",
|
|
4287
4345
|
"data-hint": t,
|
|
@@ -4290,118 +4348,129 @@ function Mn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4290
4348
|
},
|
|
4291
4349
|
onClick: n,
|
|
4292
4350
|
children: e
|
|
4293
|
-
}, t),
|
|
4351
|
+
}, t), Y = I && I.r < G.length && I.c < e.length ? I : null, X = (e, t) => N?.labels?.[e] ?? t, Te = Y ? p?.[jn(a[Y.r], o[Y.c])] : null, Ee = Math.max(1, Number(Te?.c) || 1), De = Math.max(1, Number(Te?.r) || 1);
|
|
4294
4352
|
return /* @__PURE__ */ d("div", {
|
|
4295
4353
|
ref: (e) => {
|
|
4296
|
-
|
|
4354
|
+
F.current = e, typeof M == "function" && M(e);
|
|
4297
4355
|
},
|
|
4298
4356
|
style: {
|
|
4299
4357
|
width: "100%",
|
|
4300
|
-
...
|
|
4301
|
-
...
|
|
4358
|
+
...N ? { position: "relative" } : null,
|
|
4359
|
+
..._e
|
|
4302
4360
|
},
|
|
4303
4361
|
children: [
|
|
4304
|
-
|
|
4305
|
-
|
|
4362
|
+
N && /* @__PURE__ */ u("style", { children: An }),
|
|
4363
|
+
N && Y && R && /* @__PURE__ */ d("div", {
|
|
4306
4364
|
className: "wb-tedit-bar",
|
|
4307
4365
|
style: {
|
|
4308
|
-
top:
|
|
4309
|
-
left:
|
|
4366
|
+
top: R.top,
|
|
4367
|
+
left: R.left
|
|
4310
4368
|
},
|
|
4311
4369
|
onMouseDown: (e) => e.stopPropagation(),
|
|
4312
4370
|
children: [
|
|
4313
4371
|
/* @__PURE__ */ u("span", {
|
|
4314
4372
|
className: "wb-tedit-at",
|
|
4315
|
-
children: `R${
|
|
4373
|
+
children: `R${Y.r + 1}·C${Y.c + 1}`
|
|
4316
4374
|
}),
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4321
|
-
|
|
4375
|
+
J("+↑", X("rowAbove", "Insert row above"), () => N.addRow(Y.r - 1)),
|
|
4376
|
+
J("+↓", X("rowBelow", "Insert row below"), () => N.addRow(Y.r)),
|
|
4377
|
+
J("↑", X("rowUp", "Move row up"), () => N.moveRow(Y.r, -1), Y.r === 0),
|
|
4378
|
+
J("↓", X("rowDown", "Move row down"), () => N.moveRow(Y.r, 1), Y.r >= G.length - 1),
|
|
4379
|
+
J("✕ row", X("rowDelete", "Delete row"), () => N.dropRow(Y.r), G.length <= 1),
|
|
4322
4380
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4381
|
+
J("+←", X("colLeft", "Insert column left"), () => N.addColumn(Y.c - 1)),
|
|
4382
|
+
J("+→", X("colRight", "Insert column right"), () => N.addColumn(Y.c)),
|
|
4383
|
+
J("←", X("colMoveLeft", "Move column left"), () => N.moveColumn(Y.c, -1), Y.c === 0),
|
|
4384
|
+
J("→", X("colMoveRight", "Move column right"), () => N.moveColumn(Y.c, 1), Y.c >= e.length - 1),
|
|
4385
|
+
J("✕ col", X("colDelete", "Delete column"), () => N.dropColumn(Y.c), e.length <= 1),
|
|
4328
4386
|
/* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
|
|
4329
|
-
|
|
4330
|
-
|
|
4331
|
-
|
|
4387
|
+
J("↔", X("mergeRight", "Merge with the cell on the right"), () => N.merge(Y.r, Y.c, "right"), Y.c + Ee >= e.length),
|
|
4388
|
+
J("↕", X("mergeDown", "Merge with the cell below"), () => N.merge(Y.r, Y.c, "down"), Y.r + De >= G.length),
|
|
4389
|
+
J("⤫", X("split", "Split this cell"), () => N.split(Y.r, Y.c), Ee === 1 && De === 1)
|
|
4332
4390
|
]
|
|
4333
4391
|
}),
|
|
4334
4392
|
/* @__PURE__ */ u("div", {
|
|
4335
4393
|
style: {
|
|
4336
4394
|
width: "100%",
|
|
4337
|
-
overflowX: "auto"
|
|
4395
|
+
overflowX: "auto",
|
|
4396
|
+
...ge ? {
|
|
4397
|
+
maxHeight: ge,
|
|
4398
|
+
overflowY: "auto"
|
|
4399
|
+
} : null
|
|
4338
4400
|
},
|
|
4339
4401
|
children: /* @__PURE__ */ d("table", {
|
|
4340
|
-
ref:
|
|
4402
|
+
ref: P,
|
|
4341
4403
|
style: {
|
|
4342
4404
|
width: "100%",
|
|
4343
|
-
borderCollapse: "collapse",
|
|
4405
|
+
borderCollapse: T && _ !== !1 ? "separate" : "collapse",
|
|
4406
|
+
borderSpacing: 0,
|
|
4344
4407
|
fontSize: 14,
|
|
4345
|
-
...
|
|
4346
|
-
...y ? { border:
|
|
4408
|
+
...le ? { tableLayout: "fixed" } : null,
|
|
4409
|
+
...y ? { border: se } : {}
|
|
4347
4410
|
},
|
|
4348
4411
|
children: [
|
|
4349
|
-
|
|
4412
|
+
le && /* @__PURE__ */ u("colgroup", { children: n.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
|
|
4350
4413
|
_ === !1 ? null : /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((t, n) => /* @__PURE__ */ u("th", {
|
|
4351
|
-
className:
|
|
4414
|
+
className: N ? "wb-tedit-head" : void 0,
|
|
4352
4415
|
style: {
|
|
4353
|
-
textAlign:
|
|
4416
|
+
textAlign: fe(n),
|
|
4354
4417
|
fontWeight: 600,
|
|
4355
|
-
padding:
|
|
4356
|
-
|
|
4357
|
-
|
|
4358
|
-
...
|
|
4418
|
+
padding: K,
|
|
4419
|
+
...typeof D == "string" && D ? { color: D } : null,
|
|
4420
|
+
background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
|
|
4421
|
+
...T ? {
|
|
4422
|
+
position: "sticky",
|
|
4423
|
+
top: 0,
|
|
4424
|
+
zIndex: 2
|
|
4425
|
+
} : N ? { position: "relative" } : null,
|
|
4426
|
+
...ce
|
|
4359
4427
|
},
|
|
4360
|
-
children:
|
|
4428
|
+
children: N ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(On, {
|
|
4361
4429
|
value: t.label ?? t,
|
|
4362
|
-
onCommit: (e) =>
|
|
4363
|
-
hint:
|
|
4430
|
+
onCommit: (e) => N.header(n, e),
|
|
4431
|
+
hint: X("editCell", "Double-click to edit"),
|
|
4364
4432
|
style: { paddingRight: 6 }
|
|
4365
4433
|
}), n < e.length - 1 && /* @__PURE__ */ u("span", {
|
|
4366
4434
|
className: "wb-tedit-grip",
|
|
4367
|
-
title:
|
|
4368
|
-
onPointerDown:
|
|
4435
|
+
title: X("colWidth", "Drag to resize the column"),
|
|
4436
|
+
onPointerDown: ye(n)
|
|
4369
4437
|
})] }) : t.label ?? t
|
|
4370
4438
|
}, n)) }) }),
|
|
4371
|
-
/* @__PURE__ */ d("tbody", { children: [
|
|
4439
|
+
/* @__PURE__ */ d("tbody", { children: [ae && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
4372
4440
|
colSpan: e.length,
|
|
4373
4441
|
style: {
|
|
4374
|
-
padding:
|
|
4442
|
+
padding: K,
|
|
4375
4443
|
textAlign: "center",
|
|
4376
4444
|
opacity: .6,
|
|
4377
|
-
...
|
|
4445
|
+
...ce
|
|
4378
4446
|
},
|
|
4379
4447
|
children: w || "No data yet"
|
|
4380
|
-
}) }),
|
|
4381
|
-
className:
|
|
4448
|
+
}) }), G.map((t, n) => /* @__PURE__ */ u("tr", {
|
|
4449
|
+
className: N ? "wb-tedit-row" : void 0,
|
|
4382
4450
|
style: {
|
|
4383
4451
|
...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
|
|
4384
4452
|
...Number.isFinite(Number(f?.[n])) && f[n] > 0 ? { height: f[n] } : null
|
|
4385
4453
|
},
|
|
4386
4454
|
children: e.map((e, r) => {
|
|
4387
|
-
if (
|
|
4455
|
+
if (be.has(`${n},${r}`)) return null;
|
|
4388
4456
|
let i = jn(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);
|
|
4389
4457
|
return /* @__PURE__ */ d("td", {
|
|
4390
|
-
className:
|
|
4391
|
-
onMouseDownCapture:
|
|
4392
|
-
"data-cell":
|
|
4458
|
+
className: N ? `wb-tedit-cell${I?.r === n && I?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
|
|
4459
|
+
onMouseDownCapture: ve ? B(n, r) : void 0,
|
|
4460
|
+
"data-cell": N ? `${n}-${r}` : void 0,
|
|
4393
4461
|
colSpan: l > 1 ? l : void 0,
|
|
4394
4462
|
rowSpan: f > 1 ? f : void 0,
|
|
4395
4463
|
style: {
|
|
4396
|
-
padding:
|
|
4397
|
-
...
|
|
4398
|
-
...
|
|
4464
|
+
padding: K,
|
|
4465
|
+
...de(r) ? { textAlign: de(r) } : null,
|
|
4466
|
+
...N ? { position: "relative" } : null,
|
|
4467
|
+
...ce
|
|
4399
4468
|
},
|
|
4400
|
-
children: [s ?? t?.[r]
|
|
4469
|
+
children: [s ?? Mn(t?.[r]), N && ve && /* @__PURE__ */ u("span", {
|
|
4401
4470
|
className: "wb-tedit-rowgrip",
|
|
4402
|
-
title:
|
|
4403
|
-
onPointerDown:
|
|
4404
|
-
onDoubleClick: () =>
|
|
4471
|
+
title: X("rowHeight", "Drag to set the row height — double-click to fit the content"),
|
|
4472
|
+
onPointerDown: Ce(n),
|
|
4473
|
+
onDoubleClick: () => N.resizeRow(n, 0)
|
|
4405
4474
|
})]
|
|
4406
4475
|
}, r);
|
|
4407
4476
|
})
|
|
@@ -4412,7 +4481,7 @@ function Mn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
|
|
|
4412
4481
|
]
|
|
4413
4482
|
});
|
|
4414
4483
|
}
|
|
4415
|
-
var
|
|
4484
|
+
var Pn = {
|
|
4416
4485
|
small: {
|
|
4417
4486
|
cell: 62,
|
|
4418
4487
|
font: 10.5,
|
|
@@ -4437,9 +4506,9 @@ var Nn = {
|
|
|
4437
4506
|
pad: 8,
|
|
4438
4507
|
gap: 4
|
|
4439
4508
|
}
|
|
4440
|
-
},
|
|
4441
|
-
function
|
|
4442
|
-
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 ? "" :
|
|
4509
|
+
}, Fn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, In = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Ln = 366;
|
|
4510
|
+
function Rn(e, t = {}) {
|
|
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 ? "" : Z(e), a = (e) => {
|
|
4443
4512
|
let t = i(r(e)), n = t ? new Date(t) : null;
|
|
4444
4513
|
return n && !Number.isNaN(n.getTime()) ? n : null;
|
|
4445
4514
|
};
|
|
@@ -4455,7 +4524,7 @@ function Ln(e, t = {}) {
|
|
|
4455
4524
|
} : null;
|
|
4456
4525
|
}).filter(Boolean);
|
|
4457
4526
|
}
|
|
4458
|
-
function
|
|
4527
|
+
function zn(e) {
|
|
4459
4528
|
return (Array.isArray(e) ? e : []).map((e, t) => {
|
|
4460
4529
|
let n = e?.start ? new Date(e.start) : null;
|
|
4461
4530
|
if (!n || Number.isNaN(n.getTime())) return null;
|
|
@@ -4470,20 +4539,20 @@ function Rn(e) {
|
|
|
4470
4539
|
};
|
|
4471
4540
|
}).filter(Boolean);
|
|
4472
4541
|
}
|
|
4473
|
-
function
|
|
4542
|
+
function Bn(e) {
|
|
4474
4543
|
let t = /* @__PURE__ */ new Map();
|
|
4475
4544
|
for (let n of e) {
|
|
4476
|
-
let e =
|
|
4545
|
+
let e = In(n.start), r = n.end ? In(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Ln);
|
|
4477
4546
|
for (let r = 0; r <= i; r += 1) {
|
|
4478
|
-
let i =
|
|
4547
|
+
let i = Fn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
|
|
4479
4548
|
t.has(i) || t.set(i, []), t.get(i).push(n);
|
|
4480
4549
|
}
|
|
4481
4550
|
}
|
|
4482
4551
|
for (let e of t.values()) e.sort((e, t) => e.start - t.start);
|
|
4483
4552
|
return t;
|
|
4484
4553
|
}
|
|
4485
|
-
function
|
|
4486
|
-
let { tenant: T, apiUrl: E, locale: D } = r(
|
|
4554
|
+
function Vn({ 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 }) {
|
|
4555
|
+
let { tenant: T, apiUrl: E, locale: D } = r(q), O = r(xe)?.[t], [k, j] = c(null), [M, N] = c(() => {
|
|
4487
4556
|
let e = /* @__PURE__ */ new Date();
|
|
4488
4557
|
return {
|
|
4489
4558
|
year: e.getFullYear(),
|
|
@@ -4505,13 +4574,13 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4505
4574
|
E,
|
|
4506
4575
|
O
|
|
4507
4576
|
]);
|
|
4508
|
-
let P =
|
|
4577
|
+
let P = Pn[m] ?? Pn.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 ? Rn(O ?? k ?? [], {
|
|
4509
4578
|
titleField: n,
|
|
4510
4579
|
startField: a,
|
|
4511
4580
|
endField: o,
|
|
4512
4581
|
hrefField: s,
|
|
4513
4582
|
colorField: f
|
|
4514
|
-
}) :
|
|
4583
|
+
}) : zn(e), B = Bn(z), V = D || void 0, H = (e, t) => {
|
|
4515
4584
|
let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
|
|
4516
4585
|
width: 6,
|
|
4517
4586
|
height: 6,
|
|
@@ -4549,19 +4618,19 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4549
4618
|
title: e.title,
|
|
4550
4619
|
children: n
|
|
4551
4620
|
}, e.key);
|
|
4552
|
-
},
|
|
4621
|
+
}, U = new Intl.DateTimeFormat(V, {
|
|
4553
4622
|
month: "long",
|
|
4554
4623
|
year: "numeric"
|
|
4555
|
-
}).format(new Date(M.year, M.month, 1)),
|
|
4624
|
+
}).format(new Date(M.year, M.month, 1)), W = (e) => N((t) => {
|
|
4556
4625
|
let n = new Date(t.year, t.month + e, 1);
|
|
4557
4626
|
return {
|
|
4558
4627
|
year: n.getFullYear(),
|
|
4559
4628
|
month: n.getMonth()
|
|
4560
4629
|
};
|
|
4561
|
-
}),
|
|
4630
|
+
}), ee = (e, t) => /* @__PURE__ */ u("button", {
|
|
4562
4631
|
type: "button",
|
|
4563
4632
|
"aria-label": e,
|
|
4564
|
-
onClick: () =>
|
|
4633
|
+
onClick: () => W(t),
|
|
4565
4634
|
style: {
|
|
4566
4635
|
background: "transparent",
|
|
4567
4636
|
border: `1px solid ${I}`,
|
|
@@ -4573,7 +4642,7 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4573
4642
|
padding: "4px 8px"
|
|
4574
4643
|
},
|
|
4575
4644
|
children: t < 0 ? "‹" : "›"
|
|
4576
|
-
}),
|
|
4645
|
+
}), te = /* @__PURE__ */ d("div", {
|
|
4577
4646
|
style: {
|
|
4578
4647
|
display: "flex",
|
|
4579
4648
|
alignItems: "center",
|
|
@@ -4588,10 +4657,10 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4588
4657
|
flexGrow: 1,
|
|
4589
4658
|
fontFamily: "var(--page-heading-font, inherit)"
|
|
4590
4659
|
},
|
|
4591
|
-
children:
|
|
4660
|
+
children: U
|
|
4592
4661
|
}),
|
|
4593
|
-
|
|
4594
|
-
|
|
4662
|
+
ee("Previous month", -1),
|
|
4663
|
+
ee("Next month", 1)
|
|
4595
4664
|
]
|
|
4596
4665
|
});
|
|
4597
4666
|
if (p === "list") {
|
|
@@ -4607,7 +4676,7 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4607
4676
|
width: "100%",
|
|
4608
4677
|
...A(S)
|
|
4609
4678
|
},
|
|
4610
|
-
children: [
|
|
4679
|
+
children: [te, e.length ? /* @__PURE__ */ u("div", {
|
|
4611
4680
|
style: {
|
|
4612
4681
|
display: "flex",
|
|
4613
4682
|
flexDirection: "column",
|
|
@@ -4628,7 +4697,7 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4628
4697
|
minWidth: 96
|
|
4629
4698
|
},
|
|
4630
4699
|
children: t.format(e.start)
|
|
4631
|
-
}),
|
|
4700
|
+
}), H(e, {
|
|
4632
4701
|
flexGrow: 1,
|
|
4633
4702
|
minWidth: 0
|
|
4634
4703
|
})]
|
|
@@ -4643,10 +4712,10 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4643
4712
|
})]
|
|
4644
4713
|
});
|
|
4645
4714
|
}
|
|
4646
|
-
let
|
|
4647
|
-
for (let e = 0; e <
|
|
4648
|
-
let t = e -
|
|
4649
|
-
|
|
4715
|
+
let ne = new Date(M.year, M.month, 1), re = y === "sunday" ? 0 : 1, ie = (ne.getDay() - re + 7) % 7, G = new Date(M.year, M.month + 1, 0).getDate(), ae = Math.ceil((ie + G) / 7), oe = Fn(/* @__PURE__ */ new Date()), K = new Intl.DateTimeFormat(V, { weekday: "short" }), se = [];
|
|
4716
|
+
for (let e = 0; e < ae * 7; e += 1) {
|
|
4717
|
+
let t = e - ie + 1, n = t >= 1 && t <= G, r = Fn(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === oe;
|
|
4718
|
+
se.push(/* @__PURE__ */ d("div", {
|
|
4650
4719
|
style: {
|
|
4651
4720
|
minHeight: P.cell,
|
|
4652
4721
|
borderTop: `1px solid ${I}`,
|
|
@@ -4671,7 +4740,7 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4671
4740
|
},
|
|
4672
4741
|
children: n ? t : new Date(M.year, M.month, t).getDate()
|
|
4673
4742
|
}),
|
|
4674
|
-
a.map((e) =>
|
|
4743
|
+
a.map((e) => H(e)),
|
|
4675
4744
|
i.length > a.length && /* @__PURE__ */ u("span", {
|
|
4676
4745
|
style: {
|
|
4677
4746
|
fontSize: P.font,
|
|
@@ -4689,7 +4758,7 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4689
4758
|
...A(S)
|
|
4690
4759
|
},
|
|
4691
4760
|
children: [
|
|
4692
|
-
|
|
4761
|
+
te,
|
|
4693
4762
|
/* @__PURE__ */ d("div", {
|
|
4694
4763
|
style: {
|
|
4695
4764
|
display: "grid",
|
|
@@ -4703,20 +4772,20 @@ function Bn({ events: e = [], source: t = "", titleField: n = "", startField: a
|
|
|
4703
4772
|
textAlign: "center",
|
|
4704
4773
|
padding: `0 0 ${P.pad}px`
|
|
4705
4774
|
},
|
|
4706
|
-
children:
|
|
4707
|
-
}, `head-${t}`)),
|
|
4775
|
+
children: K.format(new Date(2024, 0, 7 + re + t))
|
|
4776
|
+
}, `head-${t}`)), se]
|
|
4708
4777
|
}),
|
|
4709
4778
|
/* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
|
|
4710
4779
|
]
|
|
4711
4780
|
});
|
|
4712
4781
|
}
|
|
4713
|
-
var
|
|
4782
|
+
var Hn = {
|
|
4714
4783
|
small: 380,
|
|
4715
4784
|
medium: 560,
|
|
4716
4785
|
large: 820,
|
|
4717
4786
|
full: "100%"
|
|
4718
4787
|
};
|
|
4719
|
-
function
|
|
4788
|
+
function Un({ 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 }) {
|
|
4720
4789
|
let [C, w] = c(!1), T = s(null);
|
|
4721
4790
|
i(() => {
|
|
4722
4791
|
if (S || !e) return;
|
|
@@ -4741,7 +4810,7 @@ function Hn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4741
4810
|
document.removeEventListener("keydown", e), document.body.style.overflow = t;
|
|
4742
4811
|
};
|
|
4743
4812
|
}, [S, C]);
|
|
4744
|
-
let E =
|
|
4813
|
+
let E = Hn[o] ?? Hn.medium, D = (e) => {
|
|
4745
4814
|
let t = {
|
|
4746
4815
|
padding: "9px 16px",
|
|
4747
4816
|
borderRadius: 6,
|
|
@@ -4910,13 +4979,13 @@ function Hn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
|
|
|
4910
4979
|
})]
|
|
4911
4980
|
});
|
|
4912
4981
|
}
|
|
4913
|
-
var
|
|
4914
|
-
PageRoot:
|
|
4915
|
-
CalendarBlock:
|
|
4916
|
-
DialogBlock:
|
|
4917
|
-
Section:
|
|
4918
|
-
Container:
|
|
4919
|
-
Heading:
|
|
4982
|
+
var Wn = {
|
|
4983
|
+
PageRoot: Pe,
|
|
4984
|
+
CalendarBlock: Vn,
|
|
4985
|
+
DialogBlock: Un,
|
|
4986
|
+
Section: Fe,
|
|
4987
|
+
Container: Ie,
|
|
4988
|
+
Heading: Le,
|
|
4920
4989
|
TextBlock: Ye,
|
|
4921
4990
|
ButtonBlock: Qe,
|
|
4922
4991
|
ImageBlock: $e,
|
|
@@ -4935,7 +5004,7 @@ var Un = {
|
|
|
4935
5004
|
ThemeModeBlock: un,
|
|
4936
5005
|
ScrollTopBlock: mn,
|
|
4937
5006
|
OrgChartBlock: Dn,
|
|
4938
|
-
TableBlock:
|
|
5007
|
+
TableBlock: Nn,
|
|
4939
5008
|
IconBlock: xt,
|
|
4940
5009
|
MapBlock: yt,
|
|
4941
5010
|
MasonryBlock: Ct,
|
|
@@ -4967,27 +5036,27 @@ var Un = {
|
|
|
4967
5036
|
FormFile: Qt,
|
|
4968
5037
|
FormRecaptcha: Kt,
|
|
4969
5038
|
FormSubmit: $t
|
|
4970
|
-
},
|
|
5039
|
+
}, Gn = {
|
|
4971
5040
|
id: "auth",
|
|
4972
5041
|
label: "Accounts",
|
|
4973
5042
|
category: "Apps",
|
|
4974
5043
|
keys: ["SiteLoginForm", "SiteAccountMenu"],
|
|
4975
5044
|
ssr: "shell",
|
|
4976
5045
|
settings: ["site.authRedirect"]
|
|
4977
|
-
},
|
|
5046
|
+
}, Kn = t({
|
|
4978
5047
|
user: null,
|
|
4979
5048
|
status: "idle",
|
|
4980
5049
|
ensure: () => {},
|
|
4981
5050
|
refresh: () => {},
|
|
4982
5051
|
signOut: () => {}
|
|
4983
|
-
}),
|
|
4984
|
-
let e = r(
|
|
5052
|
+
}), qn = () => {
|
|
5053
|
+
let e = r(Kn);
|
|
4985
5054
|
return i(() => {
|
|
4986
5055
|
e.ensure();
|
|
4987
5056
|
}, [e]), e;
|
|
4988
5057
|
};
|
|
4989
|
-
function
|
|
4990
|
-
let f = r(
|
|
5058
|
+
function Jn({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
|
|
5059
|
+
let f = r(q), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", [h, g] = c(t ?? null), [_, v] = c(t ? "user" : a ? "guest" : "idle"), y = s(!1), b = n((e, t) => fetch(`${p}${e}`, {
|
|
4991
5060
|
...t,
|
|
4992
5061
|
credentials: "include",
|
|
4993
5062
|
headers: {
|
|
@@ -5037,19 +5106,19 @@ function qn({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
|
|
|
5037
5106
|
t,
|
|
5038
5107
|
x,
|
|
5039
5108
|
S
|
|
5040
|
-
]), /* @__PURE__ */ u(
|
|
5109
|
+
]), /* @__PURE__ */ u(Kn.Provider, {
|
|
5041
5110
|
value: w,
|
|
5042
5111
|
children: e
|
|
5043
5112
|
});
|
|
5044
5113
|
}
|
|
5045
|
-
function
|
|
5046
|
-
let { status: n } =
|
|
5114
|
+
function Yn({ when: e, children: t }) {
|
|
5115
|
+
let { status: n } = qn();
|
|
5047
5116
|
return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
|
|
5048
5117
|
}
|
|
5049
5118
|
//#endregion
|
|
5050
5119
|
//#region ../ui/src/components/builder/apps/auth/views.jsx
|
|
5051
|
-
function
|
|
5052
|
-
let { tenant: h, apiUrl: g, settings: _ } = r(
|
|
5120
|
+
function Xn({ 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 }) {
|
|
5121
|
+
let { tenant: h, apiUrl: g, settings: _ } = r(q), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
|
|
5053
5122
|
if (e.preventDefault(), f) return;
|
|
5054
5123
|
let n = new FormData(e.currentTarget);
|
|
5055
5124
|
C(!0), x("");
|
|
@@ -5140,7 +5209,7 @@ function Yn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5140
5209
|
type: f ? "button" : "submit",
|
|
5141
5210
|
disabled: S || void 0,
|
|
5142
5211
|
style: {
|
|
5143
|
-
...
|
|
5212
|
+
...ke,
|
|
5144
5213
|
border: 0,
|
|
5145
5214
|
padding: "10px 22px",
|
|
5146
5215
|
borderRadius: 8,
|
|
@@ -5172,8 +5241,8 @@ function Yn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
|
|
|
5172
5241
|
]
|
|
5173
5242
|
});
|
|
5174
5243
|
}
|
|
5175
|
-
function
|
|
5176
|
-
let { user: c, status: l, signOut: f } =
|
|
5244
|
+
function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
|
|
5245
|
+
let { user: c, status: l, signOut: f } = qn(), p = a ? s || "user" : l, m = a ? {
|
|
5177
5246
|
name: "Ada Lovelace",
|
|
5178
5247
|
email: "ada@example.com"
|
|
5179
5248
|
} : c;
|
|
@@ -5214,7 +5283,7 @@ function Xn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5214
5283
|
type: "button",
|
|
5215
5284
|
onClick: a ? void 0 : f,
|
|
5216
5285
|
style: {
|
|
5217
|
-
...
|
|
5286
|
+
...ke,
|
|
5218
5287
|
border: 0,
|
|
5219
5288
|
padding: "8px 16px",
|
|
5220
5289
|
borderRadius: 8,
|
|
@@ -5238,40 +5307,40 @@ function Xn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
|
|
|
5238
5307
|
}
|
|
5239
5308
|
//#endregion
|
|
5240
5309
|
//#region ../ui/src/components/builder/apps/consent/manifest.js
|
|
5241
|
-
var
|
|
5310
|
+
var Qn = {
|
|
5242
5311
|
id: "consent",
|
|
5243
5312
|
label: "Cookie consent",
|
|
5244
5313
|
category: "Apps",
|
|
5245
5314
|
keys: ["CookieConsent"],
|
|
5246
5315
|
ssr: "shell",
|
|
5247
5316
|
settings: []
|
|
5248
|
-
},
|
|
5249
|
-
function
|
|
5317
|
+
}, $n = "webim.cookie_consent";
|
|
5318
|
+
function er() {
|
|
5250
5319
|
try {
|
|
5251
|
-
let e = window.localStorage.getItem(
|
|
5320
|
+
let e = window.localStorage.getItem($n), t = e ? JSON.parse(e) : null;
|
|
5252
5321
|
return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
|
|
5253
5322
|
} catch {
|
|
5254
5323
|
return "";
|
|
5255
5324
|
}
|
|
5256
5325
|
}
|
|
5257
|
-
function
|
|
5326
|
+
function tr(e) {
|
|
5258
5327
|
try {
|
|
5259
5328
|
document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
|
|
5260
5329
|
} catch {}
|
|
5261
5330
|
}
|
|
5262
|
-
function
|
|
5331
|
+
function nr(e) {
|
|
5263
5332
|
try {
|
|
5264
|
-
window.localStorage.setItem(
|
|
5333
|
+
window.localStorage.setItem($n, JSON.stringify({
|
|
5265
5334
|
choice: e,
|
|
5266
5335
|
at: (/* @__PURE__ */ new Date()).toISOString()
|
|
5267
5336
|
}));
|
|
5268
5337
|
} catch {}
|
|
5269
|
-
|
|
5338
|
+
tr(e);
|
|
5270
5339
|
try {
|
|
5271
5340
|
window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
|
|
5272
5341
|
} catch {}
|
|
5273
5342
|
}
|
|
5274
|
-
var
|
|
5343
|
+
var rr = {
|
|
5275
5344
|
bottom: {
|
|
5276
5345
|
left: 0,
|
|
5277
5346
|
right: 0,
|
|
@@ -5293,18 +5362,18 @@ var nr = {
|
|
|
5293
5362
|
maxWidth: 400
|
|
5294
5363
|
}
|
|
5295
5364
|
};
|
|
5296
|
-
function
|
|
5365
|
+
function ir({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
|
|
5297
5366
|
let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
|
|
5298
5367
|
y(e), typeof m == "function" && m(e);
|
|
5299
5368
|
};
|
|
5300
5369
|
if (i(() => {
|
|
5301
5370
|
if (h) return;
|
|
5302
|
-
let e =
|
|
5303
|
-
e ?
|
|
5371
|
+
let e = er();
|
|
5372
|
+
e ? tr(e) : _(!0);
|
|
5304
5373
|
}, [h, v]), !g) return null;
|
|
5305
5374
|
let x = (e) => () => {
|
|
5306
|
-
h || (
|
|
5307
|
-
}, S =
|
|
5375
|
+
h || (nr(e), _(!1));
|
|
5376
|
+
}, S = rr[s] ?? rr.bottom, C = {
|
|
5308
5377
|
appearance: "none",
|
|
5309
5378
|
font: "inherit",
|
|
5310
5379
|
fontSize: 14,
|
|
@@ -5384,37 +5453,37 @@ function rr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
|
|
|
5384
5453
|
}
|
|
5385
5454
|
//#endregion
|
|
5386
5455
|
//#region ../ui/src/components/builder/apps/language/manifest.js
|
|
5387
|
-
var
|
|
5456
|
+
var ar = {
|
|
5388
5457
|
id: "language",
|
|
5389
5458
|
label: "Language",
|
|
5390
5459
|
category: "Apps",
|
|
5391
5460
|
keys: ["SiteLanguagePicker"],
|
|
5392
5461
|
ssr: "prefetch",
|
|
5393
5462
|
settings: ["locales"]
|
|
5394
|
-
},
|
|
5463
|
+
}, or = {
|
|
5395
5464
|
id: "search",
|
|
5396
5465
|
label: "Search",
|
|
5397
5466
|
category: "Apps",
|
|
5398
5467
|
keys: ["SiteSearch"],
|
|
5399
5468
|
ssr: "prefetch",
|
|
5400
5469
|
settings: []
|
|
5401
|
-
},
|
|
5402
|
-
function
|
|
5470
|
+
}, sr = 50, cr = 2e3;
|
|
5471
|
+
function lr() {
|
|
5403
5472
|
return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
|
|
5404
5473
|
}
|
|
5405
|
-
function
|
|
5474
|
+
function ur(e, t) {
|
|
5406
5475
|
let n = e?.data ?? {}, r = [];
|
|
5407
5476
|
for (let e of Object.values(n)) {
|
|
5408
|
-
let t = e == null ? "" :
|
|
5409
|
-
if (t && r.push(t), r.join(" ").length >
|
|
5477
|
+
let t = e == null ? "" : Z(e);
|
|
5478
|
+
if (t && r.push(t), r.join(" ").length > cr) break;
|
|
5410
5479
|
}
|
|
5411
|
-
return r.join(" ").slice(0,
|
|
5480
|
+
return r.join(" ").slice(0, cr).toLocaleLowerCase(t || void 0);
|
|
5412
5481
|
}
|
|
5413
|
-
function
|
|
5414
|
-
let { tenant: b, apiUrl: x, locale: S } = r(
|
|
5482
|
+
function dr({ 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 }) {
|
|
5483
|
+
let { tenant: b, apiUrl: x, locale: S } = r(q), [C, w] = c(() => lr()), [T, E] = c(() => lr()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
|
|
5415
5484
|
i(() => {
|
|
5416
5485
|
let e = () => {
|
|
5417
|
-
let e =
|
|
5486
|
+
let e = lr();
|
|
5418
5487
|
w(e), E(e);
|
|
5419
5488
|
};
|
|
5420
5489
|
return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
|
|
@@ -5465,8 +5534,8 @@ function ur({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5465
5534
|
});
|
|
5466
5535
|
}
|
|
5467
5536
|
else for (let t of e.rows) {
|
|
5468
|
-
if (!
|
|
5469
|
-
let n = t?.data ?? {}, r =
|
|
5537
|
+
if (!ur(t, S).includes(P)) continue;
|
|
5538
|
+
let n = t?.data ?? {}, r = Z(n.name) || "Untitled", i = Z(n.slug);
|
|
5470
5539
|
F.push({
|
|
5471
5540
|
key: `entry:${t.id}`,
|
|
5472
5541
|
title: r,
|
|
@@ -5474,7 +5543,7 @@ function ur({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5474
5543
|
kind: "entry"
|
|
5475
5544
|
});
|
|
5476
5545
|
}
|
|
5477
|
-
let I = F.slice(0, Math.min(Math.max(1, p),
|
|
5546
|
+
let I = F.slice(0, Math.min(Math.max(1, p), sr)), L = (e) => {
|
|
5478
5547
|
if (v) {
|
|
5479
5548
|
e.preventDefault(), w(T), j(!0);
|
|
5480
5549
|
return;
|
|
@@ -5495,7 +5564,7 @@ function ur({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5495
5564
|
title: "Spring collection",
|
|
5496
5565
|
url: "/blog/spring",
|
|
5497
5566
|
kind: "entry"
|
|
5498
|
-
}] : null, z = R ?? I, B = !R && P && D && !I.length, V = !N || k && (z.length > 0 || B),
|
|
5567
|
+
}] : null, z = R ?? I, B = !R && P && D && !I.length, V = !N || k && (z.length > 0 || B), H = z.length > 0 && /* @__PURE__ */ u("ul", {
|
|
5499
5568
|
style: {
|
|
5500
5569
|
listStyle: "none",
|
|
5501
5570
|
margin: 0,
|
|
@@ -5599,7 +5668,7 @@ function ur({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5599
5668
|
background: "var(--page-surface, #f2f2f2)",
|
|
5600
5669
|
boxShadow: "0 12px 32px rgba(15, 23, 42, 0.18)"
|
|
5601
5670
|
} : { marginTop: 14 },
|
|
5602
|
-
children: [
|
|
5671
|
+
children: [H, B && /* @__PURE__ */ u("div", {
|
|
5603
5672
|
style: {
|
|
5604
5673
|
fontSize: 14,
|
|
5605
5674
|
opacity: .65,
|
|
@@ -5614,21 +5683,21 @@ function ur({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
|
|
|
5614
5683
|
}
|
|
5615
5684
|
//#endregion
|
|
5616
5685
|
//#region ../ui/src/components/builder/apps/language/views.jsx
|
|
5617
|
-
function
|
|
5686
|
+
function fr(e) {
|
|
5618
5687
|
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());
|
|
5619
5688
|
return [...new Set(n.map((e) => e.trim()))];
|
|
5620
5689
|
}
|
|
5621
|
-
var
|
|
5622
|
-
function
|
|
5690
|
+
var pr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
|
|
5691
|
+
function mr(e, t) {
|
|
5623
5692
|
let n = String(e ?? "").toUpperCase();
|
|
5624
5693
|
if (t === "code") return n;
|
|
5625
5694
|
let r = "";
|
|
5626
5695
|
try {
|
|
5627
|
-
r =
|
|
5696
|
+
r = pr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
|
|
5628
5697
|
} catch {}
|
|
5629
5698
|
return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
|
|
5630
5699
|
}
|
|
5631
|
-
function
|
|
5700
|
+
function hr(e, t) {
|
|
5632
5701
|
let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
|
|
5633
5702
|
if (typeof window > "u") return n || "?";
|
|
5634
5703
|
try {
|
|
@@ -5638,8 +5707,8 @@ function mr(e, t) {
|
|
|
5638
5707
|
return n || "/";
|
|
5639
5708
|
}
|
|
5640
5709
|
}
|
|
5641
|
-
function
|
|
5642
|
-
let c = r(
|
|
5710
|
+
function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
|
|
5711
|
+
let c = r(q), l = fr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
|
|
5643
5712
|
display: "inline-flex",
|
|
5644
5713
|
alignItems: "center",
|
|
5645
5714
|
gap: 8,
|
|
@@ -5674,7 +5743,7 @@ function hr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5674
5743
|
style: { opacity: .4 },
|
|
5675
5744
|
children: n ?? "·"
|
|
5676
5745
|
}), /* @__PURE__ */ u("a", {
|
|
5677
|
-
href:
|
|
5746
|
+
href: hr(e, e === f),
|
|
5678
5747
|
hrefLang: e,
|
|
5679
5748
|
"aria-current": e === p ? "true" : void 0,
|
|
5680
5749
|
onClick: s ? (e) => e.preventDefault() : void 0,
|
|
@@ -5684,7 +5753,7 @@ function hr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5684
5753
|
textDecoration: "none",
|
|
5685
5754
|
cursor: s ? "default" : "pointer"
|
|
5686
5755
|
},
|
|
5687
|
-
children:
|
|
5756
|
+
children: mr(e, t)
|
|
5688
5757
|
})]
|
|
5689
5758
|
}, e))]
|
|
5690
5759
|
}) : /* @__PURE__ */ d("div", {
|
|
@@ -5695,7 +5764,7 @@ function hr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5695
5764
|
value: p,
|
|
5696
5765
|
onChange: s ? void 0 : (e) => {
|
|
5697
5766
|
let t = e.target.value;
|
|
5698
|
-
window.location.assign(
|
|
5767
|
+
window.location.assign(hr(t, t === f));
|
|
5699
5768
|
},
|
|
5700
5769
|
onKeyDown: s ? (e) => e.preventDefault() : void 0,
|
|
5701
5770
|
style: {
|
|
@@ -5709,57 +5778,57 @@ function hr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
|
|
|
5709
5778
|
},
|
|
5710
5779
|
children: l.map((e) => /* @__PURE__ */ u("option", {
|
|
5711
5780
|
value: e,
|
|
5712
|
-
children:
|
|
5781
|
+
children: mr(e, t)
|
|
5713
5782
|
}, e))
|
|
5714
5783
|
})]
|
|
5715
5784
|
});
|
|
5716
5785
|
}
|
|
5717
5786
|
//#endregion
|
|
5718
5787
|
//#region ../ui/src/components/builder/apps/index.js
|
|
5719
|
-
var
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
],
|
|
5725
|
-
SiteLoginForm:
|
|
5726
|
-
SiteAccountMenu:
|
|
5727
|
-
SiteLanguagePicker:
|
|
5728
|
-
CookieConsent:
|
|
5729
|
-
SiteSearch:
|
|
5788
|
+
var _r = [
|
|
5789
|
+
Gn,
|
|
5790
|
+
ar,
|
|
5791
|
+
Qn,
|
|
5792
|
+
or
|
|
5793
|
+
], vr = {
|
|
5794
|
+
SiteLoginForm: Xn,
|
|
5795
|
+
SiteAccountMenu: Zn,
|
|
5796
|
+
SiteLanguagePicker: gr,
|
|
5797
|
+
CookieConsent: ir,
|
|
5798
|
+
SiteSearch: dr
|
|
5730
5799
|
};
|
|
5731
|
-
new Set(
|
|
5800
|
+
new Set(_r.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
|
|
5732
5801
|
//#endregion
|
|
5733
5802
|
//#region ../ui/src/components/builder/plugins/runtime.js
|
|
5734
|
-
var
|
|
5735
|
-
function
|
|
5736
|
-
if (
|
|
5803
|
+
var yr = /* @__PURE__ */ new Map();
|
|
5804
|
+
function br(e) {
|
|
5805
|
+
if (yr.has(e)) return yr.get(e);
|
|
5737
5806
|
let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
|
|
5738
5807
|
/* @vite-ignore */
|
|
5739
5808
|
/* webpackIgnore: true */
|
|
5740
5809
|
t
|
|
5741
5810
|
).finally(() => URL.revokeObjectURL(t));
|
|
5742
|
-
return
|
|
5811
|
+
return yr.set(e, n), n;
|
|
5743
5812
|
}
|
|
5744
|
-
function
|
|
5813
|
+
function xr(e) {
|
|
5745
5814
|
let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
|
|
5746
5815
|
return n && typeof n == "object" ? n : {};
|
|
5747
5816
|
}
|
|
5748
5817
|
//#endregion
|
|
5749
5818
|
//#region ../ui/src/components/builder/plugins/view.jsx
|
|
5750
|
-
async function
|
|
5751
|
-
let n = await
|
|
5819
|
+
async function Sr(e, t) {
|
|
5820
|
+
let n = await br(e);
|
|
5752
5821
|
return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
|
|
5753
5822
|
}
|
|
5754
|
-
var
|
|
5823
|
+
var Cr = {
|
|
5755
5824
|
padding: "10px 12px",
|
|
5756
5825
|
border: "1px dashed rgba(148, 163, 184, 0.5)",
|
|
5757
5826
|
borderRadius: 8,
|
|
5758
5827
|
fontSize: 12,
|
|
5759
5828
|
opacity: .6
|
|
5760
5829
|
};
|
|
5761
|
-
function
|
|
5762
|
-
let c = r(
|
|
5830
|
+
function wr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
5831
|
+
let c = r(q), l = xr(c?.settings)[e], f = s(null), p = s(null), m = {
|
|
5763
5832
|
tenant: c?.tenant ?? "",
|
|
5764
5833
|
apiUrl: c?.apiUrl ?? "/api",
|
|
5765
5834
|
locale: c?.locale ?? "",
|
|
@@ -5771,7 +5840,7 @@ function Cr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5771
5840
|
let e = f.current;
|
|
5772
5841
|
if (!l?.code || !e) return;
|
|
5773
5842
|
let n = !0;
|
|
5774
|
-
return
|
|
5843
|
+
return Sr(l.code, t).then((e) => {
|
|
5775
5844
|
if (!(!n || !e || !f.current)) {
|
|
5776
5845
|
p.current = e;
|
|
5777
5846
|
try {
|
|
@@ -5801,7 +5870,7 @@ function Cr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5801
5870
|
}) : /* @__PURE__ */ d("div", {
|
|
5802
5871
|
ref: o,
|
|
5803
5872
|
style: {
|
|
5804
|
-
...
|
|
5873
|
+
...Cr,
|
|
5805
5874
|
...A(a)
|
|
5806
5875
|
},
|
|
5807
5876
|
children: [
|
|
@@ -5813,12 +5882,12 @@ function Cr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
|
|
|
5813
5882
|
}
|
|
5814
5883
|
//#endregion
|
|
5815
5884
|
//#region ../ui/src/components/builder/render.jsx
|
|
5816
|
-
var
|
|
5817
|
-
...
|
|
5818
|
-
...
|
|
5819
|
-
PluginBlock:
|
|
5885
|
+
var Tr = {
|
|
5886
|
+
...Wn,
|
|
5887
|
+
...vr,
|
|
5888
|
+
PluginBlock: wr
|
|
5820
5889
|
};
|
|
5821
|
-
function
|
|
5890
|
+
function Er(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
5822
5891
|
let o = n[t];
|
|
5823
5892
|
if (!o || o.hidden) return null;
|
|
5824
5893
|
let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
|
|
@@ -5826,11 +5895,11 @@ function Tr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5826
5895
|
let n = o.props?.componentId, s = r?.[n];
|
|
5827
5896
|
if (!s?.template || i.has(n)) return null;
|
|
5828
5897
|
let c = new Set(i).add(n);
|
|
5829
|
-
return /* @__PURE__ */ u(e, { children:
|
|
5898
|
+
return /* @__PURE__ */ u(e, { children: Er(s.template.rootId, s.template.nodes, r, c, a) }, t);
|
|
5830
5899
|
}
|
|
5831
|
-
let l =
|
|
5900
|
+
let l = Tr[s];
|
|
5832
5901
|
if (!l) return null;
|
|
5833
|
-
let d = (o.nodes ?? []).map((e) =>
|
|
5902
|
+
let d = (o.nodes ?? []).map((e) => Er(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Er(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
|
|
5834
5903
|
...c,
|
|
5835
5904
|
...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
|
|
5836
5905
|
linked: p,
|
|
@@ -5839,16 +5908,16 @@ function Tr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
|
|
|
5839
5908
|
},
|
|
5840
5909
|
children: d.length ? d : void 0
|
|
5841
5910
|
}, t);
|
|
5842
|
-
return c.when && c.when !== "always" ? /* @__PURE__ */ u(
|
|
5911
|
+
return c.when && c.when !== "always" ? /* @__PURE__ */ u(Yn, {
|
|
5843
5912
|
when: c.when,
|
|
5844
5913
|
children: m
|
|
5845
5914
|
}, t) : m;
|
|
5846
5915
|
}
|
|
5847
5916
|
//#endregion
|
|
5848
5917
|
//#region ../ui/src/components/builder/PageRenderer.jsx
|
|
5849
|
-
var
|
|
5850
|
-
.webim-page[data-webim-mode="dark"] { ${Object.entries(
|
|
5851
|
-
function
|
|
5918
|
+
var Dr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Or = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ue(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
|
|
5919
|
+
.webim-page[data-webim-mode="dark"] { ${Object.entries(ue(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
|
|
5920
|
+
function kr({ 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 }) {
|
|
5852
5921
|
let b = s?.js?.trim();
|
|
5853
5922
|
if (i(() => {
|
|
5854
5923
|
if (!b) return;
|
|
@@ -5857,40 +5926,40 @@ function Or({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5857
5926
|
}, [b]), !e?.ROOT) return null;
|
|
5858
5927
|
let x = {
|
|
5859
5928
|
lang: m || void 0,
|
|
5860
|
-
dir:
|
|
5929
|
+
dir: be(h, m)
|
|
5861
5930
|
}, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
|
|
5862
5931
|
minHeight: "100%",
|
|
5863
5932
|
display: "flex",
|
|
5864
5933
|
flexDirection: "column"
|
|
5865
|
-
}, w =
|
|
5934
|
+
}, w = Er("ROOT", e, n), T = o(() => ({ render: (t, r) => Er(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = ie(e, n), O = re(e, n), k = s?.css?.trim(), A = E(c), j = le(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !K[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
|
|
5866
5935
|
rel: "stylesheet",
|
|
5867
5936
|
precedence: "default",
|
|
5868
5937
|
href: g(e)
|
|
5869
|
-
}, e)), P =
|
|
5870
|
-
return r === "auto" ? /* @__PURE__ */ u(
|
|
5938
|
+
}, e)), P = Or(j);
|
|
5939
|
+
return r === "auto" ? /* @__PURE__ */ u(q.Provider, {
|
|
5871
5940
|
value: {
|
|
5872
5941
|
tenant: l || "",
|
|
5873
5942
|
apiUrl: f || "/api",
|
|
5874
5943
|
locale: m || "",
|
|
5875
5944
|
settings: _ ?? null
|
|
5876
5945
|
},
|
|
5877
|
-
children: /* @__PURE__ */ u(
|
|
5946
|
+
children: /* @__PURE__ */ u(Jn, {
|
|
5878
5947
|
initialUser: v,
|
|
5879
|
-
children: /* @__PURE__ */ u(
|
|
5948
|
+
children: /* @__PURE__ */ u(xe.Provider, {
|
|
5880
5949
|
value: p ?? null,
|
|
5881
|
-
children: /* @__PURE__ */ u(
|
|
5950
|
+
children: /* @__PURE__ */ u(Y.Provider, {
|
|
5882
5951
|
value: T,
|
|
5883
5952
|
children: /* @__PURE__ */ d("div", {
|
|
5884
5953
|
...x,
|
|
5885
5954
|
className: "webim-page",
|
|
5886
5955
|
style: {
|
|
5887
5956
|
...C,
|
|
5888
|
-
...
|
|
5957
|
+
...de(t),
|
|
5889
5958
|
...a
|
|
5890
5959
|
},
|
|
5891
5960
|
children: [
|
|
5892
|
-
/* @__PURE__ */ u("style", { children: `.webim-page { ${
|
|
5893
|
-
@media (prefers-color-scheme: dark) { .webim-page { ${
|
|
5961
|
+
/* @__PURE__ */ u("style", { children: `.webim-page { ${Dr(ue(j.light))} }
|
|
5962
|
+
@media (prefers-color-scheme: dark) { .webim-page { ${Dr(ue(j.dark))} } }` }),
|
|
5894
5963
|
/* @__PURE__ */ u("style", { children: P }),
|
|
5895
5964
|
N,
|
|
5896
5965
|
/* @__PURE__ */ u("style", { children: S }),
|
|
@@ -5903,25 +5972,25 @@ function Or({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5903
5972
|
})
|
|
5904
5973
|
})
|
|
5905
5974
|
})
|
|
5906
|
-
}) : /* @__PURE__ */ u(
|
|
5975
|
+
}) : /* @__PURE__ */ u(q.Provider, {
|
|
5907
5976
|
value: {
|
|
5908
5977
|
tenant: l || "",
|
|
5909
5978
|
apiUrl: f || "/api",
|
|
5910
5979
|
locale: m || "",
|
|
5911
5980
|
settings: _ ?? null
|
|
5912
5981
|
},
|
|
5913
|
-
children: /* @__PURE__ */ u(
|
|
5982
|
+
children: /* @__PURE__ */ u(Jn, {
|
|
5914
5983
|
initialUser: v,
|
|
5915
|
-
children: /* @__PURE__ */ u(
|
|
5984
|
+
children: /* @__PURE__ */ u(xe.Provider, {
|
|
5916
5985
|
value: p ?? null,
|
|
5917
|
-
children: /* @__PURE__ */ u(
|
|
5986
|
+
children: /* @__PURE__ */ u(Y.Provider, {
|
|
5918
5987
|
value: T,
|
|
5919
5988
|
children: /* @__PURE__ */ d("div", {
|
|
5920
5989
|
...x,
|
|
5921
5990
|
className: "webim-page",
|
|
5922
5991
|
style: {
|
|
5923
5992
|
...C,
|
|
5924
|
-
...
|
|
5993
|
+
...fe(t, r),
|
|
5925
5994
|
...a
|
|
5926
5995
|
},
|
|
5927
5996
|
children: [
|
|
@@ -5943,8 +6012,8 @@ function Or({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
|
|
|
5943
6012
|
}
|
|
5944
6013
|
//#endregion
|
|
5945
6014
|
//#region src/WebimContent.jsx
|
|
5946
|
-
function
|
|
5947
|
-
return e?.blocks?.ROOT ? /* @__PURE__ */ u(
|
|
6015
|
+
function Ar({ bundle: e, mode: t = "auto", style: n }) {
|
|
6016
|
+
return e?.blocks?.ROOT ? /* @__PURE__ */ u(kr, {
|
|
5948
6017
|
blocks: e.blocks,
|
|
5949
6018
|
theme: e.theme,
|
|
5950
6019
|
components: e.components,
|
|
@@ -5956,13 +6025,13 @@ function kr({ bundle: e, mode: t = "auto", style: n }) {
|
|
|
5956
6025
|
locale: e.locale,
|
|
5957
6026
|
direction: e.direction,
|
|
5958
6027
|
settings: e.settings,
|
|
5959
|
-
mode:
|
|
6028
|
+
mode: me(t, e.scheme),
|
|
5960
6029
|
style: n
|
|
5961
6030
|
}) : null;
|
|
5962
6031
|
}
|
|
5963
6032
|
//#endregion
|
|
5964
6033
|
//#region src/WebimPage.jsx
|
|
5965
|
-
function
|
|
6034
|
+
function jr({ 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 }) {
|
|
5966
6035
|
let [g, _] = c({ status: "loading" }), v = s({
|
|
5967
6036
|
onLoad: m,
|
|
5968
6037
|
onError: h
|
|
@@ -5972,7 +6041,7 @@ function Ar({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
5972
6041
|
onError: h
|
|
5973
6042
|
}, i(() => {
|
|
5974
6043
|
let i = !0;
|
|
5975
|
-
return _({ status: "loading" }),
|
|
6044
|
+
return _({ status: "loading" }), _e({
|
|
5976
6045
|
apiUrl: e,
|
|
5977
6046
|
tenant: t,
|
|
5978
6047
|
slug: n,
|
|
@@ -5999,11 +6068,11 @@ function Ar({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
|
|
|
5999
6068
|
r,
|
|
6000
6069
|
a,
|
|
6001
6070
|
o
|
|
6002
|
-
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(
|
|
6071
|
+
]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Ar, {
|
|
6003
6072
|
bundle: g.bundle,
|
|
6004
6073
|
mode: l,
|
|
6005
6074
|
style: d
|
|
6006
6075
|
});
|
|
6007
6076
|
}
|
|
6008
6077
|
//#endregion
|
|
6009
|
-
export {
|
|
6078
|
+
export { kr as PageRenderer, Ar as WebimContent, jr as WebimPage, _e as fetchPage, We as renderRichContent, pe as resolveTheme };
|