webim-adapter 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -254,30 +254,30 @@ function A(e) {
254
254
  R !== void 0 && U.push(`blur(${O(R)})`), z !== void 0 && U.push(`grayscale(${z}%)`), B !== void 0 && U.push(`brightness(${B}%)`), V !== void 0 && U.push(`contrast(${V}%)`), H !== void 0 && U.push(`saturate(${H}%)`), U.length && (t.filter = U.join(" "));
255
255
  let ee = F(L);
256
256
  ee.length && (t.backdropFilter = ee.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
257
- let { textStrokeWidth: W, textStrokeColor: te } = t;
258
- delete t.textStrokeWidth, delete t.textStrokeColor, (W !== void 0 || te !== void 0) && (t.WebkitTextStroke = `${O(W ?? 1)} ${te || "currentColor"}`);
259
- let { clipText: ne } = t;
260
- delete t.clipText, ne && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
261
- let { transitions: re, transitionDuration: ie, transitionEasing: ae, transitionProperty: G } = t, oe = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
257
+ let { textStrokeWidth: te, textStrokeColor: ne } = t;
258
+ delete t.textStrokeWidth, delete t.textStrokeColor, (te !== void 0 || ne !== void 0) && (t.WebkitTextStroke = `${O(te ?? 1)} ${ne || "currentColor"}`);
259
+ let { clipText: re } = t;
260
+ delete t.clipText, re && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
261
+ let { transitions: W, transitionDuration: G, transitionEasing: K, transitionProperty: ie } = t, ae = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
262
262
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
263
- let se = (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 && se.push(`${G || "all"} ${oe(ie)} ${ae || "ease"}`), se.length && (t.transition = se.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
263
+ let oe = (Array.isArray(W) ? W : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ae(e.duration ?? 200)} ${e.easing || "ease"}`);
264
+ if (G !== void 0 && oe.push(`${ie || "all"} ${ae(G)} ${K || "ease"}`), oe.length && (t.transition = oe.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
265
265
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
266
266
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
267
267
  }
268
268
  delete t.backgroundVideo;
269
- let { overlayColor: ce, overlayOpacity: le } = t;
270
- if (delete t.overlayColor, delete t.overlayOpacity, ce) {
271
- let e = `color-mix(in srgb, ${ce} ${le ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
269
+ let { overlayColor: q, overlayOpacity: se } = t;
270
+ if (delete t.overlayColor, delete t.overlayOpacity, q) {
271
+ let e = `color-mix(in srgb, ${q} ${se ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
272
272
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
273
273
  }
274
274
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
275
- let { backgroundLayers: ue } = t;
275
+ let { backgroundLayers: ce } = t;
276
276
  delete t.backgroundLayers;
277
- let K = (Array.isArray(ue) ? ue : []).filter((e) => e && e.on !== !1);
278
- if (K.length) {
277
+ let le = (Array.isArray(ce) ? ce : []).filter((e) => e && e.on !== !1);
278
+ if (le.length) {
279
279
  let e = [], n = [], r = [], i = [], a = [];
280
- for (let t of K) 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");
280
+ for (let t of le) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
281
281
  else if (t.kind === "radial") e.push(`radial-gradient(circle, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
282
282
  else {
283
283
  if (!t.src) continue;
@@ -377,7 +377,7 @@ function U(e, t, n, r = !1) {
377
377
  function ee(e, t, n) {
378
378
  return Object.entries(j).map(([r, i]) => U(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
379
379
  }
380
- var W = [
380
+ var te = [
381
381
  {
382
382
  key: "tablet",
383
383
  max: 991
@@ -390,17 +390,17 @@ var W = [
390
390
  key: "mobile",
391
391
  max: 478
392
392
  }
393
- ], te = (e) => Object.entries(A(e)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
394
- function ne(e, t) {
395
- return W.map(({ key: n, max: r }) => {
396
- let i = t?.[n] ? te(t[n]) : "";
393
+ ], ne = (e) => Object.entries(A(e)).map(([e, t]) => `${H(e)}: ${t} !important;`).join(" ");
394
+ function re(e, t) {
395
+ return te.map(({ key: n, max: r }) => {
396
+ let i = t?.[n] ? ne(t[n]) : "";
397
397
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
398
398
  }).filter(Boolean).join("\n");
399
399
  }
400
- function re(e, t) {
400
+ function W(e, t) {
401
401
  let n = [], r = (e) => {
402
402
  for (let [t, r] of Object.entries(e || {})) {
403
- let e = ne(t, r.props);
403
+ let e = re(t, r.props);
404
404
  e && n.push(e);
405
405
  }
406
406
  };
@@ -408,7 +408,7 @@ function re(e, t) {
408
408
  for (let e of Object.values(t || {})) r(e.template?.nodes);
409
409
  return n.join("\n");
410
410
  }
411
- function ie(e, t) {
411
+ function G(e, t) {
412
412
  let n = [], r = (e) => {
413
413
  for (let [t, r] of Object.entries(e || {})) {
414
414
  let e = ee(t, r.props);
@@ -419,7 +419,15 @@ function ie(e, t) {
419
419
  for (let e of Object.values(t || {})) r(e.template?.nodes);
420
420
  return n.join("\n");
421
421
  }
422
- var ae = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", G = {
422
+ var K = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", ie = {
423
+ fontFamily: K,
424
+ fontStyle: "normal",
425
+ fontWeight: 400,
426
+ letterSpacing: "normal",
427
+ textTransform: "none",
428
+ lineHeight: 1.4,
429
+ textShadow: "none"
430
+ }, ae = {
423
431
  light: {
424
432
  background: "#f2f2f2",
425
433
  surface: "#f2f2f2",
@@ -463,20 +471,20 @@ var ae = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ar
463
471
  }, oe = {
464
472
  font: "system",
465
473
  headingFont: "inherit",
466
- light: G.light,
467
- dark: G.dark
468
- }, se = {
474
+ light: ae.light,
475
+ dark: ae.dark
476
+ }, q = {
469
477
  system: {
470
478
  label: "System",
471
- value: ae
479
+ value: K
472
480
  },
473
481
  inter: {
474
482
  label: "Inter",
475
- value: `"Inter", ${ae}`
483
+ value: `"Inter", ${K}`
476
484
  },
477
485
  outfit: {
478
486
  label: "Outfit",
479
- value: `"Outfit", ${ae}`
487
+ value: `"Outfit", ${K}`
480
488
  },
481
489
  serif: {
482
490
  label: "Serif",
@@ -486,7 +494,7 @@ var ae = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ar
486
494
  label: "Mono",
487
495
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
488
496
  }
489
- }, ce = (e, t) => se[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), le = (e, ...t) => {
497
+ }, se = (e, t) => q[e]?.value ?? v(e) ?? (typeof e == "string" && e.trim() ? `"${e.trim()}", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif` : t), ce = (e, ...t) => {
490
498
  let n = Object.assign({}, e, ...t);
491
499
  return n.primary = {
492
500
  ...e.primary,
@@ -502,20 +510,20 @@ var ae = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ar
502
510
  }), {})
503
511
  }, n;
504
512
  };
505
- function ue(e) {
513
+ function le(e) {
506
514
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
507
515
  return {
508
516
  font: r ?? oe.font,
509
517
  headingFont: i ?? oe.headingFont,
510
- light: le(G.light, a, t),
511
- dark: le(G.dark, n)
518
+ light: ce(ae.light, a, t),
519
+ dark: ce(ae.dark, n)
512
520
  };
513
521
  }
514
- function K(e) {
522
+ function ue(e) {
515
523
  return {
516
524
  "--page-bg": e.background,
517
525
  "--page-surface": e.surface ?? e.background,
518
- "--page-border": e.border ?? G.light.border,
526
+ "--page-border": e.border ?? ae.light.border,
519
527
  "--page-text": e.text,
520
528
  "--page-accent": e.accent,
521
529
  "--page-accent-text": e.accentText,
@@ -530,30 +538,30 @@ function K(e) {
530
538
  };
531
539
  }
532
540
  function de(e) {
533
- let t = ue(e);
541
+ let t = le(e);
534
542
  return {
535
543
  backgroundColor: "var(--page-bg)",
536
544
  color: "var(--page-text)",
537
- fontFamily: ce(t.font, ae),
538
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : ce(t.headingFont, "inherit")
545
+ fontFamily: se(t.font, K),
546
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : se(t.headingFont, "inherit")
539
547
  };
540
548
  }
541
549
  function fe(e, t = "light") {
542
- let n = ue(e);
550
+ let n = le(e);
543
551
  return {
544
552
  ...de(e),
545
- ...K(n[t] ?? n.light)
553
+ ...ue(n[t] ?? n.light)
546
554
  };
547
555
  }
548
- function pe(e, t) {
556
+ function J(e, t) {
549
557
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
550
558
  }
551
- function me(e, t) {
559
+ function pe(e, t) {
552
560
  return e === "light" || e === "dark" ? e : t === "light" || t === "dark" ? t : "auto";
553
561
  }
554
562
  //#endregion
555
563
  //#region src/bundle.js
556
- function he({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
564
+ function me({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
557
565
  let a = {
558
566
  ...t?.global ?? {},
559
567
  ...t?.tenant ?? {}
@@ -563,7 +571,7 @@ function he({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
563
571
  title: e.title,
564
572
  slug: e.slug,
565
573
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
566
- theme: pe(o, a.builder_themes?.themes),
574
+ theme: J(o, a.builder_themes?.themes),
567
575
  components: a.builder_components?.components ?? {},
568
576
  custom: o.custom,
569
577
  animations: o.animations,
@@ -579,18 +587,18 @@ function he({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
579
587
  }
580
588
  //#endregion
581
589
  //#region src/fetchPage.js
582
- var ge = async (e) => {
590
+ var he = async (e) => {
583
591
  let t = await e.json().catch(() => null);
584
592
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
585
593
  return t?.payload ?? t;
586
594
  };
587
- async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
595
+ async function ge({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, page: o, fetch: s }) {
588
596
  if (!e) throw Error("fetchPage: apiUrl is required");
589
597
  if (!n) throw Error("fetchPage: slug is required");
590
598
  let c = s ?? fetch, l = e.replace(/\/$/, ""), u = {
591
599
  ...t ? { "x-tenant": t } : {},
592
600
  ...a ? { authorization: `Bearer ${a}` } : {}
593
- }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(ge), c(`${l}/settings/public`, { headers: u }).then(ge)]), p = he({
601
+ }, [d, f] = await Promise.all([c(`${l}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: u }).then(he), c(`${l}/settings/public`, { headers: u }).then(he)]), p = me({
594
602
  page: d,
595
603
  settings: f,
596
604
  tenant: t,
@@ -601,10 +609,11 @@ async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
601
609
  "OrgChartBlock",
602
610
  "NavbarBlock",
603
611
  "CalendarBlock",
604
- "MasonryBlock"
612
+ "MasonryBlock",
613
+ "LogoCarousel"
605
614
  ].includes(e?.type?.resolvedName) ? e.props?.source : null).filter(Boolean))];
606
615
  if (m.length) {
607
- let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(ge).then((e) => {
616
+ let e = (e) => e.startsWith("api:") ? `${l}/data/${encodeURIComponent(e.slice(4))}` : `${l}/dynamic/${encodeURIComponent(e)}?all=1${r ? `&locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(m.map((t) => c(e(t), { headers: u }).then(he).then((e) => {
608
617
  let n = Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : [], r = Number(e?.total?.filtered ?? e?.total?.all ?? n.length);
609
618
  return [[t, n], [`${t}:total`, Number.isFinite(r) ? r : n.length]];
610
619
  }).catch(() => [[t, []]])));
@@ -618,7 +627,7 @@ async function _e({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
618
627
  }
619
628
  //#endregion
620
629
  //#region ../ui/src/components/builder/locale.js
621
- var ve = /* @__PURE__ */ new Set([
630
+ var _e = /* @__PURE__ */ new Set([
622
631
  "ar",
623
632
  "he",
624
633
  "fa",
@@ -629,34 +638,34 @@ var ve = /* @__PURE__ */ new Set([
629
638
  "yi",
630
639
  "dv",
631
640
  "ckb"
632
- ]), 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({
641
+ ]), ve = (e) => _e.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", ye = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ve(t) : void 0, Y = t({
633
642
  tenant: "",
634
643
  apiUrl: "/api",
635
644
  locale: "",
636
645
  settings: null
637
- }), xe = t(null), Se = (e) => {
646
+ }), be = t(null), xe = (e) => {
638
647
  let t = Number(e?.__page);
639
648
  if (Number.isFinite(t) && t >= 1) return Math.floor(t);
640
649
  if (typeof window > "u") return 1;
641
650
  let n = Number(new URLSearchParams(window.location.search).get("page"));
642
651
  return Number.isFinite(n) && n >= 1 ? Math.floor(n) : 1;
643
- }, Ce = () => {
652
+ }, Se = () => {
644
653
  if (typeof window > "u") return {};
645
654
  let e = {};
646
655
  return new URLSearchParams(window.location.search).forEach((t, n) => {
647
656
  n.startsWith("f_") && n.length > 2 && t !== "" && (e[n.slice(2)] = t);
648
657
  }), e;
649
- }, we = (e) => {
658
+ }, X = (e) => {
650
659
  let t = {
651
660
  ...e && typeof e == "object" && !Array.isArray(e) ? e : {},
652
- ...Ce()
661
+ ...Se()
653
662
  };
654
663
  return Object.fromEntries(Object.entries(t).filter(([, e]) => typeof e == "string" && e.trim() !== ""));
655
- }, J = t(null), Y = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
656
- function Te(e, t) {
664
+ }, Z = t(null), Q = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
665
+ function Ce(e, t) {
657
666
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
658
667
  }
659
- var X = (e) => {
668
+ var we = (e) => {
660
669
  let t = [];
661
670
  for (let [n, r] of Object.entries(e ?? {})) {
662
671
  if (!/^[\w-]+$/.test(n)) continue;
@@ -666,13 +675,13 @@ var X = (e) => {
666
675
  }
667
676
  return t;
668
677
  };
669
- function Z(e) {
678
+ function Te(e) {
670
679
  return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : typeof e == "object" && !Array.isArray(e) && ("label" in e || "name" in e || "slug" in e) ? String(e.label ?? e.name ?? e.slug ?? "") : typeof e == "object" && !Array.isArray(e) && Number.isFinite(Number(e.lat)) && Number.isFinite(Number(e.lng)) ? `${e.lat}, ${e.lng}` : Array.isArray(e) ? e.map((e) => typeof e == "string" ? e : Array.isArray(e?.parts) ? e.parts.map((e) => e?.text ?? "").join("") : Array.isArray(e?.items) ? e.items.map((e) => e?.text ?? "").join(" ") : e && (e.label != null || e.name != null || e.slug != null) ? String(e.label ?? e.name ?? e.slug) : "").filter(Boolean).join(" ") : "";
671
680
  }
672
681
  function Ee(e, t) {
673
- let n = t?.data ?? {}, r = X(n);
682
+ let n = t?.data ?? {}, r = we(n);
674
683
  if (!r.length) return e;
675
- let i = RegExp(`:(${r.map(Y).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Z(Te(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
684
+ let i = RegExp(`:(${r.map(Q).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => Te(Ce(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
676
685
  return a(e);
677
686
  }
678
687
  var De = {
@@ -771,7 +780,7 @@ function Le({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a
771
780
  });
772
781
  }
773
782
  var Re = {
774
- fontFamily: se.mono.value,
783
+ fontFamily: q.mono.value,
775
784
  background: "rgba(148, 163, 184, 0.18)",
776
785
  padding: "1px 5px",
777
786
  borderRadius: 4,
@@ -1449,23 +1458,23 @@ function pt({ slides: e = [], linked: t, ...n }) {
1449
1458
  }
1450
1459
  }) : null;
1451
1460
  }
1452
- var Q = 256, mt = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), ht = (e, t, n) => {
1453
- let r = Q * 2 ** n;
1461
+ var mt = 256, ht = (e) => Math.log(Math.tan(Math.PI / 4 + Math.max(-85, Math.min(85, e)) * Math.PI / 360)), gt = (e, t, n) => {
1462
+ let r = mt * 2 ** n;
1454
1463
  return {
1455
1464
  x: (Number(t) + 180) / 360 * r,
1456
- y: (.5 - mt(Number(e)) / (2 * Math.PI)) * r
1465
+ y: (.5 - ht(Number(e)) / (2 * Math.PI)) * r
1457
1466
  };
1458
1467
  }, $ = (e, t) => {
1459
1468
  if (e === "" || e == null) return null;
1460
1469
  let n = Number(e);
1461
1470
  return Number.isFinite(n) && Math.abs(n) <= t ? n : null;
1462
- }, gt = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
1463
- function _t(e, t, n = "directions", r = "") {
1471
+ }, _t = (e) => !!e && $(e.lat, 90) !== null && $(e.lng, 180) !== null;
1472
+ function vt(e, t, n = "directions", r = "") {
1464
1473
  let i = `${e},${t}`;
1465
1474
  return n === "place" ? `https://www.google.com/maps/search/?api=1&query=${encodeURIComponent(i)}${r ? "&query_place_id=" : ""}` : `https://www.google.com/maps/dir/?api=1&destination=${encodeURIComponent(i)}`;
1466
1475
  }
1467
- var vt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
1468
- function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize: o = 22, pinLink: l = "directions", link: f = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
1476
+ var yt = (e, t, n = 13) => `https://www.openstreetmap.org/?mlat=${e}&mlon=${t}#map=${Math.round(Number(n) || 13)}/${e}/${t}`;
1477
+ function bt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize: o = 22, pinLink: l = "directions", link: f = !1, label: p = "", style: m, nodeRef: h, inert: g }) {
1469
1478
  let _ = s(null), [v, y] = c(1200);
1470
1479
  i(() => {
1471
1480
  let e = _.current;
@@ -1475,7 +1484,7 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1475
1484
  let n = new ResizeObserver(t);
1476
1485
  return n.observe(e), () => n.disconnect();
1477
1486
  }, []);
1478
- let b = (Array.isArray(e) ? e : []).filter(gt), x = gt({
1487
+ let b = (Array.isArray(e) ? e : []).filter(_t), x = _t({
1479
1488
  lat: t,
1480
1489
  lng: n
1481
1490
  }) ? {
@@ -1487,7 +1496,7 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1487
1496
  } : null, S = Math.max(80, Number(a) || 320), C = $(r, 19) ? Math.min(Math.max(Math.round(Number(r)), 1), 19) : (() => {
1488
1497
  if (b.length < 2) return 13;
1489
1498
  for (let e = 19; e >= 1; e--) {
1490
- let t = b.map((t) => ht($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
1499
+ let t = b.map((t) => gt($(t.lat, 90), $(t.lng, 180), e)), n = Math.max(...t.map((e) => e.x)) - Math.min(...t.map((e) => e.x)), r = Math.max(...t.map((e) => e.y)) - Math.min(...t.map((e) => e.y));
1491
1500
  if (n <= v * .8 && r <= S * .7) return e;
1492
1501
  }
1493
1502
  return 1;
@@ -1511,12 +1520,12 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1511
1520
  },
1512
1521
  children: "Set the coordinates in Settings"
1513
1522
  });
1514
- let T = ht(x.lat, x.lng, C), E = {
1523
+ let T = gt(x.lat, x.lng, C), E = {
1515
1524
  x: T.x - v / 2,
1516
1525
  y: T.y - S / 2
1517
1526
  }, D = [], O = [];
1518
- for (let e = Math.floor(E.x / Q); e <= Math.floor((E.x + v) / Q); e++) D.push(e);
1519
- for (let e = Math.floor(E.y / Q); e <= Math.floor((E.y + S) / Q); e++) O.push(e);
1527
+ for (let e = Math.floor(E.x / mt); e <= Math.floor((E.x + v) / mt); e++) D.push(e);
1528
+ for (let e = Math.floor(E.y / mt); e <= Math.floor((E.y + S) / mt); e++) O.push(e);
1520
1529
  let k = 2 ** C;
1521
1530
  return /* @__PURE__ */ d("div", {
1522
1531
  ref: (e) => {
@@ -1539,22 +1548,22 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1539
1548
  return e < 0 || e >= k ? null : /* @__PURE__ */ u("img", {
1540
1549
  src: `https://tile.openstreetmap.org/${C}/${n}/${e}.png`,
1541
1550
  alt: "",
1542
- width: Q,
1543
- height: Q,
1551
+ width: mt,
1552
+ height: mt,
1544
1553
  loading: "lazy",
1545
1554
  style: {
1546
1555
  position: "absolute",
1547
- left: Math.round(t * Q - E.x),
1548
- top: Math.round(e * Q - E.y),
1549
- width: Q,
1550
- height: Q,
1556
+ left: Math.round(t * mt - E.x),
1557
+ top: Math.round(e * mt - E.y),
1558
+ width: mt,
1559
+ height: mt,
1551
1560
  userSelect: "none",
1552
1561
  pointerEvents: "none"
1553
1562
  }
1554
1563
  }, `${t}-${e}`);
1555
1564
  })),
1556
1565
  b.map((e, t) => {
1557
- let n = ht($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", s = l === "none" || g ? null : _t($(e.lat, 90), $(e.lng, 180), l, e.title);
1566
+ let n = gt($(e.lat, 90), $(e.lng, 180), C), r = n.x - E.x, i = n.y - E.y, a = e.color || "var(--page-accent, #dc2626)", s = l === "none" || g ? null : vt($(e.lat, 90), $(e.lng, 180), l, e.title);
1558
1567
  return /* @__PURE__ */ d(s ? "a" : "span", {
1559
1568
  href: s || void 0,
1560
1569
  target: s ? "_blank" : void 0,
@@ -1593,8 +1602,8 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1593
1602
  viewBox: "0 0 24 24",
1594
1603
  fill: a,
1595
1604
  style: { display: "block" },
1596
- children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), bt[e.icon] ? /* @__PURE__ */ u("path", {
1597
- d: bt[e.icon],
1605
+ children: [/* @__PURE__ */ u("path", { d: "M12 22s7-6 7-11a7 7 0 1 0-14 0c0 5 7 11 7 11z" }), xt[e.icon] ? /* @__PURE__ */ u("path", {
1606
+ d: xt[e.icon],
1598
1607
  transform: "translate(12 10.5) scale(0.46) translate(-12 -12)",
1599
1608
  fill: "none",
1600
1609
  stroke: "#fff",
@@ -1630,7 +1639,7 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1630
1639
  })
1631
1640
  ]
1632
1641
  }), f ? /* @__PURE__ */ u("a", {
1633
- href: vt(x.lat, x.lng, C),
1642
+ href: yt(x.lat, x.lng, C),
1634
1643
  target: "_blank",
1635
1644
  rel: "noopener noreferrer",
1636
1645
  onClick: g ? (e) => e.preventDefault() : void 0,
@@ -1644,7 +1653,7 @@ function yt({ markers: e, lat: t, lng: n, zoom: r = "", height: a = 320, pinSize
1644
1653
  }) : null]
1645
1654
  });
1646
1655
  }
1647
- var bt = {
1656
+ var xt = {
1648
1657
  check: "M4 12l5 5L20 6",
1649
1658
  close: "M6 6l12 12M18 6L6 18",
1650
1659
  plus: "M12 5v14M5 12h14",
@@ -1741,8 +1750,8 @@ var bt = {
1741
1750
  droplet: "M12 3s6 6.4 6 10.5a6 6 0 0 1-12 0C6 9.4 12 3 12 3z",
1742
1751
  leaf: "M4 20c0-8 6-14 16-14 0 10-6 14-12 14H4zM8 16c2-4 5-6 8-7"
1743
1752
  };
1744
- function xt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: d, inert: f }) {
1745
- let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [bt[e] ?? bt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
1753
+ function St({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i = 2, color: a = "", href: o = "", target: s = "", label: c = "", style: l, nodeRef: d, inert: f }) {
1754
+ let p = Array.isArray(t) ? t.filter((e) => typeof e == "string" && e.trim()) : [], m = n && p.length > 0, h = p.length ? p : [xt[e] ?? xt.star], g = Math.min(Math.max(Number(r) || 24, 8), 240), _ = a === "accent" ? "var(--page-accent, currentColor)" : a || "currentColor", v = /* @__PURE__ */ u("svg", {
1746
1755
  viewBox: "0 0 24 24",
1747
1756
  width: g,
1748
1757
  height: g,
@@ -1778,10 +1787,10 @@ function xt({ name: e = "star", paths: t, fill: n = !1, size: r = 24, stroke: i
1778
1787
  children: v
1779
1788
  });
1780
1789
  }
1781
- function St(e, t = {}, n = 0) {
1782
- 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 = [];
1790
+ function Ct(e, t = {}, n = 0) {
1791
+ let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], i = (e) => e == null ? "" : Te(e), a = Math.max(0, Number(n) || 0), o = [];
1783
1792
  for (let e of r) {
1784
- let n = e.data ?? e, r = Te(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(Te(n, t.nameField)) : i(n.name), l = t.hrefField ? i(Te(n, t.hrefField)) : "";
1793
+ let n = e.data ?? e, r = Ce(n, t.imageField), s = (Array.isArray(r) ? r : [r]).map((e) => e && typeof e == "object" ? e.url ?? e.src ?? "" : e).filter((e) => typeof e == "string" && e.trim()), c = t.nameField ? i(Ce(n, t.nameField)) : i(n.name), l = t.hrefField ? i(Ce(n, t.hrefField)) : "";
1785
1794
  for (let e of s) if (o.push({
1786
1795
  src: e,
1787
1796
  name: c,
@@ -1791,8 +1800,8 @@ function St(e, t = {}, n = 0) {
1791
1800
  }
1792
1801
  return o;
1793
1802
  }
1794
- 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 }) {
1795
- let { tenant: x, apiUrl: S } = r(q), C = r(xe)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
1803
+ function wt({ images: e = [], source: t = "", entry: n = "", imageField: a = "", nameField: o = "", hrefField: s = "", limit: f = 0, emptyText: p = "", columns: m = 3, gap: h = 8, showNames: g = !1, lightbox: _ = !0, style: v, nodeRef: y, inert: b }) {
1804
+ let { tenant: x, apiUrl: S } = r(Y), C = r(be)?.[t], [w, T] = c(null), [E, D] = c(() => /* @__PURE__ */ new Set());
1796
1805
  i(() => {
1797
1806
  if (!t || C) return;
1798
1807
  let e = !0;
@@ -1809,7 +1818,7 @@ function Ct({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
1809
1818
  C
1810
1819
  ]);
1811
1820
  let O = C ?? w ?? [], k = n ? O.filter((e) => e?.id === n || e?.data?.slug === n || e?.slug === n) : O, j = Math.max(0, Number(f) || 0), M = t ? (() => {
1812
- let e = St(k, {
1821
+ let e = Ct(k, {
1813
1822
  imageField: a,
1814
1823
  nameField: o,
1815
1824
  hrefField: s
@@ -2014,20 +2023,20 @@ function Ct({ images: e = [], source: t = "", entry: n = "", imageField: a = "",
2014
2023
  ]
2015
2024
  });
2016
2025
  }
2017
- var wt = {
2026
+ var Tt = {
2018
2027
  color: "inherit",
2019
2028
  textDecoration: "none",
2020
2029
  fontSize: 14,
2021
2030
  opacity: .85
2022
- }, Tt = {
2031
+ }, Et = {
2023
2032
  background: "var(--page-surface, #f2f2f2)",
2024
2033
  color: "var(--page-text, #111827)",
2025
2034
  border: "1px solid rgba(148, 163, 184, 0.25)",
2026
2035
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
2027
2036
  zIndex: 60
2028
2037
  };
2029
- function Et(e, t = {}, n = "dropdown") {
2030
- 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) => {
2038
+ function Dt(e, t = {}, n = "dropdown") {
2039
+ let r = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], i = (e) => Array.isArray(e) ? e[0] : e, a = (e) => e == null ? "" : Te(e), o = r.map((e) => {
2031
2040
  let n = e.data ?? {}, r = t.parentField ? i(n[t.parentField]) : null;
2032
2041
  return {
2033
2042
  key: e.id,
@@ -2068,8 +2077,8 @@ function Et(e, t = {}, n = "dropdown") {
2068
2077
  type: e.children.length ? n : "link"
2069
2078
  }));
2070
2079
  }
2071
- 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" }) {
2072
- 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);
2080
+ function Ot({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], style: f, nodeRef: p, menu: m = "auto", breakpoint: h = 768, source: g = "", labelField: _ = "", hrefField: v = "", imageField: y = "", descField: b = "", parentField: x = "", submenu: S = "dropdown" }) {
2081
+ let [C, w] = c(null), [T, E] = c(!1), [D, O] = c(!1), [k, j] = c(null), { tenant: M, apiUrl: N } = r(Y), P = r(be)?.[g], [F, I] = c(null);
2073
2082
  i(() => {
2074
2083
  if (!g || P) return;
2075
2084
  let e = !0;
@@ -2089,7 +2098,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2089
2098
  let e = new ResizeObserver(() => E(C.offsetWidth < h));
2090
2099
  return e.observe(C), () => e.disconnect();
2091
2100
  }, [C, h]);
2092
- let L = g ? Et(P ?? F ?? [], {
2101
+ let L = g ? Dt(P ?? F ?? [], {
2093
2102
  labelField: _,
2094
2103
  hrefField: v,
2095
2104
  imageField: y,
@@ -2118,7 +2127,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2118
2127
  return /* @__PURE__ */ d("a", {
2119
2128
  href: e.href || "#",
2120
2129
  style: {
2121
- ...wt,
2130
+ ...Tt,
2122
2131
  display: n ? "block" : "flex",
2123
2132
  alignItems: n ? void 0 : "center",
2124
2133
  gap: n ? void 0 : 10,
@@ -2215,7 +2224,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2215
2224
  let t = e.children ?? [];
2216
2225
  if (!t.length) return /* @__PURE__ */ u("a", {
2217
2226
  href: e.href || "#",
2218
- style: wt,
2227
+ style: Tt,
2219
2228
  children: e.label
2220
2229
  }, e.key);
2221
2230
  let n = e.type === "mega";
@@ -2229,7 +2238,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2229
2238
  children: [/* @__PURE__ */ d("a", {
2230
2239
  href: e.href || "#",
2231
2240
  style: {
2232
- ...wt,
2241
+ ...Tt,
2233
2242
  cursor: "pointer"
2234
2243
  },
2235
2244
  children: [
@@ -2245,7 +2254,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2245
2254
  ]
2246
2255
  }), k === e.key && (n ? /* @__PURE__ */ u("div", {
2247
2256
  style: {
2248
- ...Tt,
2257
+ ...Et,
2249
2258
  position: "absolute",
2250
2259
  left: 0,
2251
2260
  right: 0,
@@ -2261,7 +2270,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2261
2270
  }, !0))
2262
2271
  }) : /* @__PURE__ */ u("div", {
2263
2272
  style: {
2264
- ...Tt,
2273
+ ...Et,
2265
2274
  position: "absolute",
2266
2275
  top: "100%",
2267
2276
  left: 0,
@@ -2290,7 +2299,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2290
2299
  children: L.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
2291
2300
  href: t.href || "#",
2292
2301
  style: {
2293
- ...wt,
2302
+ ...Tt,
2294
2303
  padding: "10px 4px",
2295
2304
  fontWeight: (t.children ?? []).length ? 600 : 400,
2296
2305
  opacity: 1
@@ -2301,7 +2310,7 @@ function Dt({ brand: t, logo: n, brandHref: a, brandTarget: o, links: s = [], st
2301
2310
  ]
2302
2311
  });
2303
2312
  }
2304
- function Ot({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2313
+ function kt({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2305
2314
  let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
2306
2315
  return e.length ? /* @__PURE__ */ d("div", {
2307
2316
  ref: r,
@@ -2341,13 +2350,13 @@ function Ot({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
2341
2350
  }, e.key))]
2342
2351
  }) : null;
2343
2352
  }
2344
- function kt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: l, openColor: f, borderColor: p, style: m, nodeRef: h }) {
2353
+ function At({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i, padY: a, headerBg: o, headerColor: s, openBg: l, openColor: f, borderColor: p, style: m, nodeRef: h }) {
2345
2354
  let [g, _] = c(() => new Set(e.length ? [e[0].key] : []));
2346
2355
  if (!e.length) return null;
2347
2356
  let v = (e, t) => typeof e == "string" && e ? e : t, y = (e, t) => {
2348
2357
  let n = Number(e);
2349
2358
  return e === "" || e == null || !Number.isFinite(n) ? t : n;
2350
- }, b = bt[r], x = (e) => _((t) => {
2359
+ }, b = xt[r], x = (e) => _((t) => {
2351
2360
  let r = new Set(n ? t : []);
2352
2361
  return t.has(e) ? r.delete(e) : r.add(e), r;
2353
2362
  });
@@ -2422,15 +2431,15 @@ function kt({ items: e = [], linked: t, multiple: n = !1, icon: r = "", padX: i,
2422
2431
  })
2423
2432
  });
2424
2433
  }
2425
- var At = {
2434
+ var jt = {
2426
2435
  display: "flex",
2427
2436
  flexDirection: "column",
2428
2437
  gap: "12px"
2429
- }, jt = {
2438
+ }, Mt = {
2430
2439
  fontSize: "14px",
2431
2440
  fontWeight: 500,
2432
2441
  color: "var(--page-text, #111827)"
2433
- }, Mt = {
2442
+ }, Nt = {
2434
2443
  padding: "10px 12px",
2435
2444
  border: "1px solid var(--page-border, #d1d5db)",
2436
2445
  borderRadius: "6px",
@@ -2440,18 +2449,18 @@ var At = {
2440
2449
  boxSizing: "border-box",
2441
2450
  backgroundColor: "var(--page-surface, #f2f2f2)",
2442
2451
  color: "var(--page-text, #111827)"
2443
- }, Nt = {
2452
+ }, Pt = {
2444
2453
  display: "flex",
2445
2454
  alignItems: "center",
2446
2455
  gap: "8px",
2447
2456
  fontSize: "14px",
2448
2457
  color: "var(--page-text, #111827)"
2449
- }, Pt = (e) => e ? {
2458
+ }, Ft = (e) => e ? {
2450
2459
  readOnly: !0,
2451
2460
  tabIndex: -1,
2452
2461
  onMouseDown: (e) => e.preventDefault()
2453
2462
  } : {};
2454
- function Ft(e, t) {
2463
+ function It(e, t) {
2455
2464
  if (!e) return !0;
2456
2465
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
2457
2466
  switch (e.op) {
@@ -2465,11 +2474,11 @@ function Ft(e, t) {
2465
2474
  default: return !1;
2466
2475
  }
2467
2476
  }
2468
- var It = {
2477
+ var Lt = {
2469
2478
  display: "flex",
2470
2479
  flexDirection: "column",
2471
2480
  gap: 6
2472
- }, Lt = {
2481
+ }, Rt = {
2473
2482
  font: "inherit",
2474
2483
  fontSize: 15,
2475
2484
  padding: "10px 12px",
@@ -2480,17 +2489,17 @@ var It = {
2480
2489
  width: "100%",
2481
2490
  boxSizing: "border-box"
2482
2491
  };
2483
- function Rt(e, t) {
2492
+ function zt(e, t) {
2484
2493
  let n = Array.isArray(e?.options) ? e.options : [];
2485
2494
  if (!e?.parentField) return n;
2486
2495
  let r = t?.[e.parentField];
2487
2496
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
2488
2497
  }
2489
- var zt = "g-recaptcha-response", Bt = (e) => e?.type === "recaptcha" ? zt : e?.name;
2490
- function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2498
+ var Bt = "g-recaptcha-response", Vt = (e) => e?.type === "recaptcha" ? Bt : e?.name;
2499
+ function Ht({ field: e, value: t, onChange: n, inert: r, values: i }) {
2491
2500
  let a = /* @__PURE__ */ d("span", {
2492
2501
  style: {
2493
- ...jt,
2502
+ ...Mt,
2494
2503
  fontSize: 14
2495
2504
  },
2496
2505
  children: [e.label, e.required ? " *" : ""]
@@ -2499,7 +2508,7 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2499
2508
  required: e.required || void 0,
2500
2509
  placeholder: e.placeholder || void 0,
2501
2510
  disabled: r || void 0,
2502
- style: Lt,
2511
+ style: Rt,
2503
2512
  value: t ?? "",
2504
2513
  onChange: (t) => n(e.name, t.target.value)
2505
2514
  };
@@ -2528,11 +2537,11 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2528
2537
  borderRadius: 8,
2529
2538
  display: "block"
2530
2539
  }
2531
- }) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(Kt, {
2540
+ }) : null : e.type === "recaptcha" ? /* @__PURE__ */ u(qt, {
2532
2541
  theme: e.captchaTheme,
2533
2542
  size: e.captchaSize,
2534
2543
  inert: r,
2535
- onChange: (e) => n(zt, e)
2544
+ onChange: (e) => n(Bt, e)
2536
2545
  }) : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(nt, {
2537
2546
  url: e.src,
2538
2547
  style: { width: "100%" }
@@ -2545,14 +2554,14 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2545
2554
  display: "block"
2546
2555
  }
2547
2556
  }) : null : /* @__PURE__ */ d("label", {
2548
- style: It,
2557
+ style: Lt,
2549
2558
  children: [
2550
2559
  a,
2551
2560
  e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
2552
2561
  ...o,
2553
2562
  rows: 4,
2554
2563
  style: {
2555
- ...Lt,
2564
+ ...Rt,
2556
2565
  resize: "vertical"
2557
2566
  }
2558
2567
  }) : e.type === "select" ? /* @__PURE__ */ d("select", {
@@ -2561,7 +2570,7 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2561
2570
  children: [/* @__PURE__ */ u("option", {
2562
2571
  value: "",
2563
2572
  children: e.placeholder || "—"
2564
- }), Rt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
2573
+ }), zt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
2565
2574
  value: typeof e == "string" ? e : e.value,
2566
2575
  children: typeof e == "string" ? e : e.label ?? e.value
2567
2576
  }, t))]
@@ -2608,8 +2617,8 @@ function Vt({ field: e, value: t, onChange: n, inert: r, values: i }) {
2608
2617
  ]
2609
2618
  });
2610
2619
  }
2611
- 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 }) {
2612
- 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;
2620
+ function Ut({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
2621
+ let { tenant: y, apiUrl: b } = r(Y), [x, S] = c("form"), [C, w] = c(null), [T, E] = c({}), [D, O] = c(0), k = h ? v || "form" : x;
2613
2622
  i(() => {
2614
2623
  if (!f || !s) return;
2615
2624
  let e = !0;
@@ -2630,11 +2639,11 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2630
2639
  section: e,
2631
2640
  fields: []
2632
2641
  }) : j[j.length - 1].fields.push(e);
2633
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Ft(e.section.condition, T)).map((e) => ({
2642
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || It(e.section.condition, T)).map((e) => ({
2634
2643
  ...e,
2635
- fields: e.fields.filter((e) => Ft(e.condition, T))
2644
+ fields: e.fields.filter((e) => It(e.condition, T))
2636
2645
  })), P = M.length > 1, F = Math.min(D, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
2637
- let t = T[Bt(e)];
2646
+ let t = T[Vt(e)];
2638
2647
  return e.required && (t == null || t === "" || t === !1);
2639
2648
  }), R = F >= N.length - 1, z = (e, t) => E((n) => {
2640
2649
  let r = {
@@ -2690,11 +2699,11 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2690
2699
  }
2691
2700
  },
2692
2701
  style: {
2693
- ...At,
2702
+ ...jt,
2694
2703
  display: k === "success" ? "none" : "flex"
2695
2704
  },
2696
2705
  children: f && s ? /* @__PURE__ */ d(l, { children: [
2697
- P && /* @__PURE__ */ u(_n, {
2706
+ P && /* @__PURE__ */ u(vn, {
2698
2707
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
2699
2708
  active: F + 1,
2700
2709
  style: { marginBottom: 8 }
@@ -2707,9 +2716,9 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2707
2716
  },
2708
2717
  children: N[F].section.help
2709
2718
  }),
2710
- I.map((e) => /* @__PURE__ */ u(Vt, {
2719
+ I.map((e) => /* @__PURE__ */ u(Ht, {
2711
2720
  field: e,
2712
- value: T[Bt(e)],
2721
+ value: T[Vt(e)],
2713
2722
  values: T,
2714
2723
  onChange: z,
2715
2724
  inert: h
@@ -2780,10 +2789,10 @@ function Ht({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s,
2780
2789
  ]
2781
2790
  });
2782
2791
  }
2783
- var Ut = null, Wt = null, Gt = (e) => {
2792
+ var Wt = null, Gt = null, Kt = (e) => {
2784
2793
  let t = typeof e == "string" && e.trim() ? e.trim() : "";
2785
- if (Ut && Wt === t) return Ut;
2786
- if (Ut && typeof window < "u") {
2794
+ if (Wt && Gt === t) return Wt;
2795
+ if (Wt && typeof window < "u") {
2787
2796
  for (let e of ["grecaptcha", "___grecaptcha_cfg"]) try {
2788
2797
  delete window[e];
2789
2798
  } catch {
@@ -2791,22 +2800,22 @@ var Ut = null, Wt = null, Gt = (e) => {
2791
2800
  }
2792
2801
  document.querySelectorAll("script[src*=\"recaptcha\"]").forEach((e) => e.remove());
2793
2802
  }
2794
- return Wt = t, Ut = new Promise((e) => {
2803
+ return Gt = t, Wt = new Promise((e) => {
2795
2804
  if (typeof window > "u") return;
2796
2805
  if (window.grecaptcha?.render) return e(window.grecaptcha);
2797
2806
  window.__webimRecaptchaReady = () => e(window.grecaptcha);
2798
2807
  let n = document.createElement("script");
2799
2808
  n.src = `https://www.google.com/recaptcha/api.js?onload=__webimRecaptchaReady&render=explicit${t ? `&hl=${encodeURIComponent(t)}` : ""}`, n.async = !0, document.head.appendChild(n);
2800
- }), Ut;
2809
+ }), Wt;
2801
2810
  };
2802
- function Kt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
2803
- 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);
2811
+ function qt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert: l, onChange: f }) {
2812
+ let p = r(Y), m = p?.settings && typeof p.settings == "object" ? p.settings["google.recaptchaKey"] : "", h = typeof e == "string" && e.trim() || (typeof m == "string" ? m.trim() : ""), g = s(null), _ = s(f);
2804
2813
  if (_.current = f, i(() => {
2805
2814
  if (l || !h || !g.current) return;
2806
2815
  let e = !0, r = (t) => {
2807
2816
  e && typeof _.current == "function" && _.current(t);
2808
2817
  };
2809
- return Gt(a).then((i) => {
2818
+ return Kt(a).then((i) => {
2810
2819
  if (!(!e || !g.current || !i?.render)) {
2811
2820
  g.current.innerHTML = "", r("");
2812
2821
  try {
@@ -2888,17 +2897,17 @@ function Kt({ siteKey: e, theme: t, size: n, hl: a, style: o, nodeRef: c, inert:
2888
2897
  children: /* @__PURE__ */ u("div", { ref: g })
2889
2898
  }) : null;
2890
2899
  }
2891
- function qt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2900
+ function Jt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
2892
2901
  return /* @__PURE__ */ u("label", {
2893
2902
  ref: r,
2894
2903
  style: {
2895
- ...jt,
2904
+ ...Mt,
2896
2905
  ...A(n)
2897
2906
  },
2898
2907
  children: Be(t, e, i)
2899
2908
  });
2900
2909
  }
2901
- function Jt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2910
+ function Yt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
2902
2911
  return /* @__PURE__ */ u("input", {
2903
2912
  ref: a,
2904
2913
  type: e,
@@ -2906,13 +2915,13 @@ function Jt({ type: e = "text", name: t, placeholder: n, required: r, style: i,
2906
2915
  placeholder: n,
2907
2916
  required: !o && !!r,
2908
2917
  style: {
2909
- ...Mt,
2918
+ ...Nt,
2910
2919
  ...A(i)
2911
2920
  },
2912
- ...Pt(o)
2921
+ ...Ft(o)
2913
2922
  });
2914
2923
  }
2915
- function Yt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2924
+ function Xt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
2916
2925
  return /* @__PURE__ */ u("textarea", {
2917
2926
  ref: a,
2918
2927
  name: e || void 0,
@@ -2920,18 +2929,18 @@ function Yt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeR
2920
2929
  rows: n,
2921
2930
  required: !o && !!r,
2922
2931
  style: {
2923
- ...Mt,
2932
+ ...Nt,
2924
2933
  resize: "vertical",
2925
2934
  ...A(i)
2926
2935
  },
2927
- ...Pt(o)
2936
+ ...Ft(o)
2928
2937
  });
2929
2938
  }
2930
- function Xt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2939
+ function Zt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
2931
2940
  return /* @__PURE__ */ d("label", {
2932
2941
  ref: o,
2933
2942
  style: {
2934
- ...Nt,
2943
+ ...Pt,
2935
2944
  ...A(a)
2936
2945
  },
2937
2946
  children: [/* @__PURE__ */ u("input", {
@@ -2948,7 +2957,7 @@ function Xt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
2948
2957
  }), t]
2949
2958
  });
2950
2959
  }
2951
- function Zt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2960
+ function Qt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
2952
2961
  return /* @__PURE__ */ d("select", {
2953
2962
  ref: a,
2954
2963
  name: e || void 0,
@@ -2957,7 +2966,7 @@ function Zt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2957
2966
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
2958
2967
  tabIndex: o ? -1 : void 0,
2959
2968
  style: {
2960
- ...Mt,
2969
+ ...Nt,
2961
2970
  appearance: "auto",
2962
2971
  ...A(i)
2963
2972
  },
@@ -2971,12 +2980,12 @@ function Zt({ name: e, placeholder: t, options: n = [], required: r, style: i, n
2971
2980
  }, t))]
2972
2981
  });
2973
2982
  }
2974
- function Qt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2983
+ function $t({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
2975
2984
  let [s, l] = c(null);
2976
2985
  return /* @__PURE__ */ d("label", {
2977
2986
  ref: a,
2978
2987
  style: {
2979
- ...Mt,
2988
+ ...Nt,
2980
2989
  display: "flex",
2981
2990
  alignItems: "center",
2982
2991
  gap: "8px",
@@ -3003,7 +3012,7 @@ function Qt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
3003
3012
  ]
3004
3013
  });
3005
3014
  }
3006
- function $t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3015
+ function en({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3007
3016
  return /* @__PURE__ */ u("button", {
3008
3017
  ref: n,
3009
3018
  type: r ? "button" : "submit",
@@ -3023,7 +3032,7 @@ function $t({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
3023
3032
  children: e
3024
3033
  });
3025
3034
  }
3026
- function en({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3035
+ function tn({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3027
3036
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
3028
3037
  return /* @__PURE__ */ u("div", {
3029
3038
  ref: r,
@@ -3040,8 +3049,8 @@ function en({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
3040
3049
  }, t))
3041
3050
  });
3042
3051
  }
3043
- 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: _ }) {
3044
- let { tenant: v, apiUrl: y, locale: b } = r(q), x = r(J), S = r(xe), [, C] = c(0);
3052
+ function nn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, paged: m, filters: h, style: g, nodeRef: _ }) {
3053
+ let { tenant: v, apiUrl: y, locale: b } = r(Y), x = r(Z), S = r(be), [, C] = c(0);
3045
3054
  i(() => {
3046
3055
  if (typeof window > "u") return;
3047
3056
  let e = () => C((e) => e + 1);
@@ -3049,7 +3058,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
3049
3058
  window.removeEventListener("popstate", e), window.removeEventListener("webim:urlchange", e);
3050
3059
  };
3051
3060
  }, []);
3052
- let w = we(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? Se(S) : 1, [k, j] = c(null);
3061
+ let w = X(h), T = JSON.stringify(w), E = T !== "{}" && !e?.startsWith?.("api:"), D = E ? null : S?.[e], O = m ? xe(S) : 1, [k, j] = c(null);
3053
3062
  if (i(() => {
3054
3063
  if (!e || D) return;
3055
3064
  let n = !0, r = new URLSearchParams();
@@ -3104,7 +3113,7 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
3104
3113
  ...A(g)
3105
3114
  },
3106
3115
  children: N.map((e) => {
3107
- let t = o ? Te(e?.data, o) : null, r = s ? Z(Te(e?.data, s)) : null, i = l ? Te(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : Z(i), f = n === "list";
3116
+ let t = o ? Ce(e?.data, o) : null, r = s ? Te(Ce(e?.data, s)) : null, i = l ? Ce(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : Te(i), f = n === "list";
3108
3117
  return /* @__PURE__ */ d("div", {
3109
3118
  style: {
3110
3119
  display: "flex",
@@ -3159,8 +3168,8 @@ function tn({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
3159
3168
  })
3160
3169
  });
3161
3170
  }
3162
- function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
3163
- let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Ce(), s = {
3171
+ function rn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, inert: i }) {
3172
+ let a = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && typeof e.name == "string" && e.name) : [], o = i ? {} : Se(), s = {
3164
3173
  height: 34,
3165
3174
  padding: "0 12px",
3166
3175
  borderRadius: 8,
@@ -3208,7 +3217,7 @@ function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3208
3217
  name: `f_${e.name}`,
3209
3218
  defaultValue: o[e.name] ?? "",
3210
3219
  style: s,
3211
- ...Pt(i),
3220
+ ...Ft(i),
3212
3221
  children: [/* @__PURE__ */ u("option", {
3213
3222
  value: "",
3214
3223
  children: e.label || e.name
@@ -3223,7 +3232,7 @@ function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3223
3232
  name: `f_${e.name}`,
3224
3233
  defaultValue: o[e.name] ?? "",
3225
3234
  style: s,
3226
- ...Pt(i),
3235
+ ...Ft(i),
3227
3236
  children: [
3228
3237
  /* @__PURE__ */ u("option", {
3229
3238
  value: "",
@@ -3244,7 +3253,7 @@ function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3244
3253
  defaultValue: o[e.name] ?? "",
3245
3254
  placeholder: e.label || e.name,
3246
3255
  style: s,
3247
- ...Pt(i)
3256
+ ...Ft(i)
3248
3257
  }, e.name)), /* @__PURE__ */ u("button", {
3249
3258
  type: "submit",
3250
3259
  style: {
@@ -3257,12 +3266,12 @@ function nn({ fields: e = [], buttonLabel: t = "Search", style: n, nodeRef: r, i
3257
3266
  fontWeight: 600,
3258
3267
  cursor: i ? "default" : "pointer"
3259
3268
  },
3260
- ...Pt(i),
3269
+ ...Ft(i),
3261
3270
  children: t
3262
3271
  })]
3263
3272
  });
3264
3273
  }
3265
- function rn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3274
+ function an({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3266
3275
  return e.length ? /* @__PURE__ */ u("nav", {
3267
3276
  ref: r,
3268
3277
  "aria-label": "Breadcrumb",
@@ -3312,8 +3321,8 @@ function rn({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
3312
3321
  })
3313
3322
  }) : null;
3314
3323
  }
3315
- 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 }) {
3316
- let { tenant: g, apiUrl: _ } = r(q), v = r(xe), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
3324
+ function on({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", source: o, pageSize: s = 6, align: l, hideEmpty: f, inert: p, style: m, nodeRef: h }) {
3325
+ let { tenant: g, apiUrl: _ } = r(Y), v = r(be), [y, b] = c(null), x = o ? Number(v?.[`${o}:total`]) : NaN;
3317
3326
  i(() => {
3318
3327
  if (!o || Number.isFinite(x)) return;
3319
3328
  let e = !0, t = o.startsWith("api:") ? `${_}/data/${encodeURIComponent(o.slice(4))}` : `${_}/dynamic/${encodeURIComponent(o)}?limit=1`;
@@ -3332,7 +3341,7 @@ function an({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
3332
3341
  ]);
3333
3342
  let S = Math.max(1, Number(s) || 6), C = Number.isFinite(x) ? x : y;
3334
3343
  if (o && C === null || o && f && !(C > 0)) return null;
3335
- 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) => {
3344
+ let w = Math.min(Math.max(o ? Math.ceil(C / S) : Number(e) || 1, 1), 50), T = Math.min(Math.max(o ? xe(v) : Number(t) || 1, 1), w), E = (e) => {
3336
3345
  if (o) {
3337
3346
  if (typeof window < "u") {
3338
3347
  let t = new URLSearchParams(window.location.search);
@@ -3397,15 +3406,15 @@ function an({ pages: e = 5, current: t = 1, prevNext: n = !0, href: a = "#", sou
3397
3406
  ]
3398
3407
  });
3399
3408
  }
3400
- var on = "webim.page_mode", sn = () => {
3409
+ var sn = "webim.page_mode", cn = () => {
3401
3410
  if (typeof window > "u") return "auto";
3402
3411
  try {
3403
- let e = window.localStorage.getItem(on);
3412
+ let e = window.localStorage.getItem(sn);
3404
3413
  return e === "light" || e === "dark" ? e : "auto";
3405
3414
  } catch {
3406
3415
  return "auto";
3407
3416
  }
3408
- }, cn = (e) => {
3417
+ }, ln = (e) => {
3409
3418
  let t = {
3410
3419
  width: 16,
3411
3420
  height: 16,
@@ -3437,13 +3446,13 @@ var on = "webim.page_mode", sn = () => {
3437
3446
  rx: "2"
3438
3447
  }), /* @__PURE__ */ u("path", { d: "M8 21h8M12 17v4" })]
3439
3448
  });
3440
- }, ln = {
3449
+ }, un = {
3441
3450
  light: "Light theme",
3442
3451
  dark: "Dark theme",
3443
3452
  auto: "Follow the device theme"
3444
3453
  };
3445
- function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3446
- let [o, l] = c(a ? "auto" : sn), d = s(null), f = (e) => {
3454
+ function dn({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3455
+ let [o, l] = c(a ? "auto" : cn), d = s(null), f = (e) => {
3447
3456
  d.current = e, typeof r == "function" && r(e);
3448
3457
  };
3449
3458
  i(() => {
@@ -3451,7 +3460,7 @@ function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3451
3460
  let e = d.current?.closest?.(".webim-page");
3452
3461
  e && (o === "light" || o === "dark" ? e.setAttribute("data-webim-mode", o) : e.removeAttribute("data-webim-mode"));
3453
3462
  try {
3454
- o === "auto" ? window.localStorage.removeItem(on) : window.localStorage.setItem(on, o);
3463
+ o === "auto" ? window.localStorage.removeItem(sn) : window.localStorage.setItem(sn, o);
3455
3464
  } catch {}
3456
3465
  }, [o, a]);
3457
3466
  let p = t === !1 ? ["light", "dark"] : [
@@ -3486,8 +3495,8 @@ function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3486
3495
  },
3487
3496
  children: p.map((e) => /* @__PURE__ */ u("button", {
3488
3497
  type: "button",
3489
- title: ln[e],
3490
- "aria-label": ln[e],
3498
+ title: un[e],
3499
+ "aria-label": un[e],
3491
3500
  "aria-pressed": e === m,
3492
3501
  onClick: a ? void 0 : () => l(e),
3493
3502
  style: {
@@ -3498,15 +3507,15 @@ function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3498
3507
  background: e === m ? "var(--page-accent, #111827)" : "transparent",
3499
3508
  opacity: e === m ? 1 : .7
3500
3509
  },
3501
- children: cn(e)
3510
+ children: ln(e)
3502
3511
  }, e))
3503
3512
  });
3504
3513
  let g = p[(p.indexOf(m) + 1) % p.length];
3505
3514
  return /* @__PURE__ */ u("button", {
3506
3515
  ref: f,
3507
3516
  type: "button",
3508
- title: ln[m],
3509
- "aria-label": `Theme: ${ln[m]} — switch to ${ln[g]}`,
3517
+ title: un[m],
3518
+ "aria-label": `Theme: ${un[m]} — switch to ${un[g]}`,
3510
3519
  onClick: a ? void 0 : () => l(g),
3511
3520
  style: {
3512
3521
  ...h,
@@ -3515,10 +3524,10 @@ function un({ variant: e, showSystem: t, style: n, nodeRef: r, inert: a }) {
3515
3524
  border: "1px solid rgba(148, 163, 184, 0.4)",
3516
3525
  ...A(n)
3517
3526
  },
3518
- children: cn(m)
3527
+ children: ln(m)
3519
3528
  });
3520
3529
  }
3521
- function dn(e) {
3530
+ function fn(e) {
3522
3531
  let t = e?.parentElement;
3523
3532
  for (; t && t !== document.body;) {
3524
3533
  let e = getComputedStyle(t).overflowY;
@@ -3527,7 +3536,7 @@ function dn(e) {
3527
3536
  }
3528
3537
  return window;
3529
3538
  }
3530
- var fn = (e) => e === window ? window.scrollY : e.scrollTop, pn = {
3539
+ var pn = (e) => e === window ? window.scrollY : e.scrollTop, mn = {
3531
3540
  "bottom-right": (e) => ({
3532
3541
  right: e,
3533
3542
  bottom: e
@@ -3542,7 +3551,7 @@ var fn = (e) => e === window ? window.scrollY : e.scrollTop, pn = {
3542
3551
  transform: "translateX(-50%)"
3543
3552
  })
3544
3553
  };
3545
- function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
3554
+ function hn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth: o, bg: s, fg: l, style: f, nodeRef: p, inert: m, frame: h, builder: g }) {
3546
3555
  let [_, v] = c(!!m), [y, b] = c(null), x = (e) => {
3547
3556
  b(e), typeof p == "function" && p(e);
3548
3557
  };
@@ -3553,8 +3562,8 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3553
3562
  }
3554
3563
  if (!y) return;
3555
3564
  let e = Number(a) >= 0 ? Number(a) : 300, t = () => {
3556
- let t = dn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
3557
- v(n || fn(t) > e);
3565
+ let t = fn(y), n = g && !(t === window ? document.documentElement.scrollHeight > window.innerHeight : t.scrollHeight > t.clientHeight);
3566
+ v(n || pn(t) > e);
3558
3567
  };
3559
3568
  return t(), document.addEventListener("scroll", t, {
3560
3569
  capture: !0,
@@ -3568,7 +3577,7 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3568
3577
  ]);
3569
3578
  let S = () => {
3570
3579
  if (m) return;
3571
- let e = dn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
3580
+ let e = fn(y), t = window.matchMedia?.("(prefers-reduced-motion: reduce)").matches, n = o === !1 || t ? "auto" : "smooth";
3572
3581
  e === window ? window.scrollTo({
3573
3582
  top: 0,
3574
3583
  behavior: n
@@ -3576,7 +3585,7 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3576
3585
  top: 0,
3577
3586
  behavior: n
3578
3587
  });
3579
- }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = pn[n] ? n : "bottom-right", D = h ? {
3588
+ }, C = Number(r) >= 0 ? Number(r) : 24, w = e === "pill", T = t || "Top", E = mn[n] ? n : "bottom-right", D = h ? {
3580
3589
  position: "fixed",
3581
3590
  zIndex: 5,
3582
3591
  bottom: (h.bottom ?? 0) + C,
@@ -3589,7 +3598,7 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3589
3598
  } : {
3590
3599
  position: "fixed",
3591
3600
  zIndex: 2147482e3,
3592
- ...pn[E](C)
3601
+ ...mn[E](C)
3593
3602
  };
3594
3603
  return /* @__PURE__ */ d("button", {
3595
3604
  ref: x,
@@ -3640,7 +3649,7 @@ function mn({ variant: e, label: t, position: n, offset: r, showAfter: a, smooth
3640
3649
  }), w ? /* @__PURE__ */ u("span", { children: T }) : null]
3641
3650
  });
3642
3651
  }
3643
- var hn = {
3652
+ var gn = {
3644
3653
  facebook: {
3645
3654
  label: "Facebook",
3646
3655
  color: "#1877f2",
@@ -3707,8 +3716,8 @@ var hn = {
3707
3716
  d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zm6.93 6h-2.95c-.32-1.25-.78-2.45-1.38-3.56 1.84.63 3.37 1.91 4.33 3.56zM12 4.04c.83 1.2 1.48 2.53 1.91 3.96h-3.82c.43-1.43 1.08-2.76 1.91-3.96zM4.26 14C4.1 13.36 4 12.69 4 12s.1-1.36.26-2h3.38c-.08.66-.14 1.32-.14 2 0 .68.06 1.34.14 2H4.26zm.82 2h2.95c.32 1.25.78 2.45 1.38 3.56-1.84-.63-3.37-1.9-4.33-3.56zm2.95-8H5.08c.96-1.66 2.49-2.93 4.33-3.56C8.81 5.55 8.35 6.75 8.03 8zM12 19.96c-.83-1.2-1.48-2.53-1.91-3.96h3.82c-.43 1.43-1.08 2.76-1.91 3.96zM14.34 14H9.66c-.09-.66-.16-1.32-.16-2 0-.68.07-1.35.16-2h4.68c.09.65.16 1.32.16 2 0 .68-.07 1.34-.16 2zm.25 5.56c.6-1.11 1.06-2.31 1.38-3.56h2.95c-.96 1.65-2.49 2.93-4.33 3.56zM16.36 14c.08-.66.14-1.32.14-2 0-.68-.06-1.34-.14-2h3.38c.16.64.26 1.31.26 2s-.1 1.36-.26 2h-3.38z"
3708
3717
  }
3709
3718
  };
3710
- function gn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3711
- let l = Array.isArray(e) ? e.filter((e) => e && hn[e.network]) : [];
3719
+ function _n({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, style: o, nodeRef: s, inert: c }) {
3720
+ let l = Array.isArray(e) ? e.filter((e) => e && gn[e.network]) : [];
3712
3721
  if (!l.length) return null;
3713
3722
  let d = Math.min(Math.max(Number(r) || 18, 10), 64), f = Math.round(d * 1.9), p = Number.isFinite(Number(i)) ? Number(i) : 10, m = (e) => n === "accent" ? "var(--page-accent, #111827)" : n === "inherit" ? "currentColor" : e.color, h = c ? (e) => e.preventDefault() : void 0;
3714
3723
  return /* @__PURE__ */ u("div", {
@@ -3721,7 +3730,7 @@ function gn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
3721
3730
  ...A(o)
3722
3731
  },
3723
3732
  children: l.map((e, r) => {
3724
- let i = hn[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
3733
+ let i = gn[e.network], o = t !== "outline" && t !== "plain", s = o ? n === "accent" ? "var(--page-accent-text, #ffffff)" : n === "inherit" ? "var(--page-bg, #ffffff)" : "#ffffff" : m(i);
3725
3734
  return /* @__PURE__ */ u("a", {
3726
3735
  href: e.url || "#",
3727
3736
  onClick: h,
@@ -3755,7 +3764,7 @@ function gn({ links: e = [], variant: t, color: n, size: r, gap: i, newTab: a, s
3755
3764
  })
3756
3765
  });
3757
3766
  }
3758
- function _n({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3767
+ function vn({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
3759
3768
  if (!t.length) return null;
3760
3769
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
3761
3770
  width: 32,
@@ -3833,7 +3842,7 @@ function _n({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
3833
3842
  })
3834
3843
  });
3835
3844
  }
3836
- var vn = {
3845
+ var yn = {
3837
3846
  small: {
3838
3847
  w: 132,
3839
3848
  h: 46,
@@ -3855,74 +3864,123 @@ var vn = {
3855
3864
  title: 12.5,
3856
3865
  avatar: 46
3857
3866
  }
3858
- }, yn = (e) => vn[e] ?? vn.medium;
3859
- vn.medium.w, vn.medium.h;
3860
- function bn(e, { size: t = "medium", horizontal: n = !1 } = {}) {
3861
- let r = yn(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
3862
- for (let e of s) e.parent && c.has(e.parent) && e.parent !== e.id ? (l.has(e.parent) || l.set(e.parent, []), l.get(e.parent).push(e)) : u.push(e);
3863
- let d = /* @__PURE__ */ new Map(), f = (e, t) => {
3867
+ }, bn = (e) => yn[e] ?? yn.medium;
3868
+ yn.medium.w, yn.medium.h;
3869
+ var xn = (e) => String(e?.group ?? "").trim(), Sn = (e) => {
3870
+ let t = [], n = /* @__PURE__ */ new Map();
3871
+ return e.forEach((e, r) => {
3872
+ let i = xn(e) || `#${r}`;
3873
+ n.has(i) || (n.set(i, []), t.push(i)), n.get(i).push(e);
3874
+ }), t.flatMap((e) => n.get(e));
3875
+ };
3876
+ function Cn(e, { size: t = "medium", horizontal: n = !1, groupTitles: r = "top" } = {}) {
3877
+ let i = bn(t), a = n ? i.h : i.w, o = n ? 16 : 20, s = (n ? i.w : i.h) + (n ? 56 : 48), c = Array.isArray(e) ? e.filter((e) => e && e.id) : [], l = new Set(c.map((e) => e.id)), u = /* @__PURE__ */ new Map(), d = [];
3878
+ for (let e of c) e.parent && l.has(e.parent) && e.parent !== e.id ? (u.has(e.parent) || u.set(e.parent, []), u.get(e.parent).push(e)) : d.push(e);
3879
+ d = Sn(d);
3880
+ for (let [e, t] of u) u.set(e, Sn(t));
3881
+ let f = (e, t) => o + (xn(e) !== xn(t) && (xn(e) || xn(t)) ? 24 : 0), p = /* @__PURE__ */ new Map(), m = (e, t) => {
3864
3882
  if (t.has(e.id)) return 0;
3865
3883
  t.add(e.id);
3866
- let n = (l.get(e.id) ?? []).reduce((e, n, r) => e + f(n, t) + (r ? a : 0), 0), r = Math.max(i, n);
3867
- return d.set(e.id, r), r;
3884
+ let n = u.get(e.id) ?? [], r = n.reduce((e, r, i) => e + m(r, t) + (i ? f(n[i - 1], r) : 0), 0), i = Math.max(a, r);
3885
+ return p.set(e.id, i), i;
3868
3886
  };
3869
- u.forEach((e) => f(e, /* @__PURE__ */ new Set()));
3870
- let p = [], m = [], h = 0, g = (e, t, s, c) => {
3871
- if (c.has(e.id)) return;
3872
- c.add(e.id);
3873
- let u = t + ((d.get(e.id) ?? i) - i) / 2, f = s * o, _ = n ? f : u, v = n ? u : f;
3874
- p.push({
3887
+ d.forEach((e) => m(e, /* @__PURE__ */ new Set()));
3888
+ let h = [], g = [], _ = /* @__PURE__ */ new Map(), v = 0, y = (e, t, r, o) => {
3889
+ if (o.has(e.id)) return;
3890
+ o.add(e.id);
3891
+ let c = t + ((p.get(e.id) ?? a) - a) / 2, d = r * s, m = n ? d : c, b = n ? c : d;
3892
+ h.push({
3875
3893
  node: e,
3876
- x: _,
3877
- y: v
3878
- }), h = Math.max(h, f + (n ? r.w : r.h));
3879
- let y = t;
3880
- for (let t of l.get(e.id) ?? []) {
3881
- let e = y + ((d.get(t.id) ?? i) - i) / 2 + i / 2, l = (s + 1) * o;
3882
- m.push(n ? {
3894
+ x: m,
3895
+ y: b
3896
+ });
3897
+ let x = xn(e);
3898
+ if (x) {
3899
+ let t = `${e.parent && l.has(e.parent) && e.parent !== e.id ? e.parent : ""}|${x}`;
3900
+ _.has(t) || _.set(t, {
3901
+ title: x,
3902
+ color: "",
3903
+ members: []
3904
+ });
3905
+ let n = _.get(t);
3906
+ !n.color && e.groupColor && (n.color = e.groupColor), n.members.push({
3907
+ x: m,
3908
+ y: b
3909
+ });
3910
+ }
3911
+ v = Math.max(v, d + (n ? i.w : i.h));
3912
+ let S = t, C = u.get(e.id) ?? [];
3913
+ C.forEach((e, t) => {
3914
+ t && (S += f(C[t - 1], e));
3915
+ let l = S + ((p.get(e.id) ?? a) - a) / 2 + a / 2, u = (r + 1) * s;
3916
+ g.push(n ? {
3883
3917
  from: {
3884
- x: f + r.w,
3885
- y: u + r.h / 2
3918
+ x: d + i.w,
3919
+ y: c + i.h / 2
3886
3920
  },
3887
3921
  to: {
3888
- x: l,
3889
- y: e
3922
+ x: u,
3923
+ y: l
3890
3924
  }
3891
3925
  } : {
3892
3926
  from: {
3893
- x: u + r.w / 2,
3894
- y: f + r.h
3927
+ x: c + i.w / 2,
3928
+ y: d + i.h
3895
3929
  },
3896
3930
  to: {
3897
- x: e,
3898
- y: l
3931
+ x: l,
3932
+ y: u
3899
3933
  }
3900
- }), g(t, y, s + 1, c), y += (d.get(t.id) ?? i) + a;
3901
- }
3902
- }, _ = 0, v = /* @__PURE__ */ new Set();
3903
- for (let e of u) g(e, _, 0, v), _ += (d.get(e.id) ?? i) + a;
3904
- let y = Math.max(_ - a, i);
3934
+ }), y(e, S, r + 1, o), S += p.get(e.id) ?? a;
3935
+ });
3936
+ }, b = 0, x = /* @__PURE__ */ new Set();
3937
+ d.forEach((e, t) => {
3938
+ t && (b += f(d[t - 1], e)), y(e, b, 0, x), b += p.get(e.id) ?? a;
3939
+ });
3940
+ let S = Math.max(b, a), C = r === "hidden" ? 0 : 22, w = [..._.values()].map((e) => {
3941
+ let t = Math.min(...e.members.map((e) => e.x)) - 12, n = Math.max(...e.members.map((e) => e.x)) + i.w + 12, a = Math.min(...e.members.map((e) => e.y)) - 12 - (r === "bottom" ? 0 : C), o = Math.max(...e.members.map((e) => e.y)) + i.h + 12 + (r === "bottom" ? C : 0);
3942
+ return {
3943
+ x: t,
3944
+ y: a,
3945
+ width: n - t,
3946
+ height: o - a,
3947
+ title: e.title,
3948
+ color: e.color
3949
+ };
3950
+ }), T = n ? Math.max(v, i.w) : S, E = n ? S : Math.max(v, i.h), D = Math.max(0, ...w.map((e) => -e.x)), O = Math.max(0, ...w.map((e) => -e.y));
3951
+ if (w.length && (T = Math.max(T, ...w.map((e) => e.x + e.width)) + D, E = Math.max(E, ...w.map((e) => e.y + e.height)) + O, D || O)) {
3952
+ for (let e of h) e.x += D, e.y += O;
3953
+ for (let e of g) e.from = {
3954
+ x: e.from.x + D,
3955
+ y: e.from.y + O
3956
+ }, e.to = {
3957
+ x: e.to.x + D,
3958
+ y: e.to.y + O
3959
+ };
3960
+ for (let e of w) e.x += D, e.y += O;
3961
+ }
3905
3962
  return {
3906
- boxes: p,
3907
- links: m,
3908
- width: n ? Math.max(h, r.w) : y,
3909
- height: n ? y : Math.max(h, r.h),
3963
+ boxes: h,
3964
+ links: g,
3965
+ groups: w,
3966
+ width: T,
3967
+ height: E,
3910
3968
  horizontal: n
3911
3969
  };
3912
3970
  }
3913
- var xn = (e, t) => {
3971
+ var wn = (e, t) => {
3914
3972
  let n = String(e ?? "");
3915
3973
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
3916
- }, Sn = (e) => {
3974
+ }, Tn = (e) => {
3917
3975
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
3918
3976
  if (!t) return "#ffffff";
3919
3977
  let n = t[1];
3920
3978
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
3921
3979
  let r = parseInt(n, 16);
3922
3980
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
3923
- }, Cn = (e) => !!(e?.cv?.trim?.() || e?.photo);
3924
- function wn(e, t = {}) {
3925
- 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);
3981
+ }, En = (e) => !!(e?.cv?.trim?.() || e?.photo);
3982
+ function Dn(e, t = {}) {
3983
+ let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : Te(e);
3926
3984
  return n.map((e) => {
3927
3985
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
3928
3986
  return {
@@ -3932,15 +3990,16 @@ function wn(e, t = {}) {
3932
3990
  photo: t.photoField && r(n[t.photoField]) || "",
3933
3991
  parent: t.parentField ? o : null,
3934
3992
  cv: t.cvField ? i(n[t.cvField]) : "",
3935
- href: t.hrefField ? i(n[t.hrefField]) : ""
3993
+ href: t.hrefField ? i(n[t.hrefField]) : "",
3994
+ group: t.groupField ? i(n[t.groupField]) : ""
3936
3995
  };
3937
3996
  });
3938
3997
  }
3939
- var Tn = {
3998
+ var On = {
3940
3999
  size: 36,
3941
4000
  pad: 10
3942
4001
  };
3943
- function En({ node: e, onClose: t }) {
4002
+ function kn({ node: e, onClose: t }) {
3944
4003
  return i(() => {
3945
4004
  let e = (e) => e.key === "Escape" && t();
3946
4005
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
@@ -4061,36 +4120,38 @@ function En({ node: e, onClose: t }) {
4061
4120
  })
4062
4121
  });
4063
4122
  }
4064
- 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 }) {
4065
- let b = a(), [x, S] = c(null), { tenant: C, apiUrl: w } = r(q), T = r(xe)?.[t], [E, D] = c(null);
4123
+ function An({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, groupField: h, groupTitles: g = "top", groupBg: _ = "", size: v = "medium", horizontal: y = !1, style: b, nodeRef: x, interactive: S = !0 }) {
4124
+ let C = a(), [w, T] = c(null), { tenant: E, apiUrl: D } = r(Y), O = r(be)?.[t], [k, j] = c(null);
4066
4125
  i(() => {
4067
- if (!t || T) return;
4126
+ if (!t || O) return;
4068
4127
  let e = !0;
4069
- return fetch(`${w}/dynamic/${encodeURIComponent(t)}`, { headers: C ? { "x-tenant": C } : {} }).then((e) => e.json()).then((t) => {
4128
+ return fetch(`${D}/dynamic/${encodeURIComponent(t)}`, { headers: E ? { "x-tenant": E } : {} }).then((e) => e.json()).then((t) => {
4070
4129
  let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
4071
- e && D(n);
4072
- }).catch(() => e && D([])), () => {
4130
+ e && j(n);
4131
+ }).catch(() => e && j([])), () => {
4073
4132
  e = !1;
4074
4133
  };
4075
4134
  }, [
4076
4135
  t,
4077
- C,
4078
- w,
4079
- T
4136
+ E,
4137
+ D,
4138
+ O
4080
4139
  ]);
4081
- let O = t ? wn(T ?? E ?? [], {
4140
+ let M = t ? Dn(O ?? k ?? [], {
4082
4141
  nameField: n,
4083
4142
  titleField: o,
4084
4143
  photoField: s,
4085
4144
  parentField: f,
4086
4145
  cvField: p,
4087
- hrefField: m
4088
- }) : e, k = yn(h), { boxes: j, links: M, width: N, height: P } = bn(O, {
4089
- size: h,
4090
- horizontal: g
4146
+ hrefField: m,
4147
+ groupField: h
4148
+ }) : e, N = bn(v), { boxes: P, links: F, groups: I, width: L, height: R } = Cn(M, {
4149
+ size: v,
4150
+ horizontal: y,
4151
+ groupTitles: g
4091
4152
  });
4092
- if (!j.length) return !y && t ? /* @__PURE__ */ d("div", {
4093
- ref: v,
4153
+ if (!P.length) return !S && t ? /* @__PURE__ */ d("div", {
4154
+ ref: x,
4094
4155
  style: {
4095
4156
  padding: 18,
4096
4157
  border: "1px dashed rgba(148, 163, 184, 0.6)",
@@ -4098,7 +4159,7 @@ function Dn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4098
4159
  fontSize: 13,
4099
4160
  opacity: .7,
4100
4161
  textAlign: "center",
4101
- ...A(_)
4162
+ ...A(b)
4102
4163
  },
4103
4164
  children: [
4104
4165
  "Org Chart — no published entries in “",
@@ -4106,151 +4167,174 @@ function Dn({ nodes: e = [], source: t, nameField: n, titleField: o, photoField:
4106
4167
  "” yet"
4107
4168
  ]
4108
4169
  }) : null;
4109
- let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
4170
+ let z = new Set(P.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
4110
4171
  return /* @__PURE__ */ d("div", {
4111
- ref: v,
4172
+ ref: x,
4112
4173
  style: {
4113
4174
  maxWidth: "100%",
4114
4175
  overflowX: "auto",
4115
- ...A(_)
4176
+ ...A(b)
4116
4177
  },
4117
4178
  children: [/* @__PURE__ */ d("svg", {
4118
- viewBox: `0 0 ${N} ${P}`,
4179
+ viewBox: `0 0 ${L} ${R}`,
4119
4180
  role: "img",
4120
4181
  "aria-label": "Organization chart",
4121
4182
  style: {
4122
4183
  display: "block",
4123
4184
  width: "100%",
4124
- maxWidth: N,
4185
+ maxWidth: L,
4125
4186
  height: "auto",
4126
4187
  margin: "0 auto"
4127
4188
  },
4128
- children: [M.map((e, t) => /* @__PURE__ */ u("path", {
4129
- d: g ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
4130
- fill: "none",
4131
- stroke: "rgba(148, 163, 184, 0.7)",
4132
- strokeWidth: "1.5"
4133
- }, t)), j.map(({ node: e, x: t, y: n }) => {
4134
- let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Sn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Sn(e.color2) : s, f = y && (Cn(e) || e.href), p = () => Cn(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Tn.pad + k.avatar + 8 : t + k.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((k.w - k.avatar - 26) / 7) : Math.floor(k.w / 7.6), _ = k.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
4135
- return /* @__PURE__ */ d("g", {
4136
- onClick: f ? p : void 0,
4137
- style: f ? { cursor: "pointer" } : void 0,
4138
- role: f ? "button" : void 0,
4139
- "aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
4140
- children: [
4141
- i && e.gradient ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("linearGradient", {
4142
- id: `${b}-${e.id}-grad`,
4143
- x1: "0",
4144
- y1: "0",
4145
- x2: "0",
4146
- y2: "1",
4147
- children: [/* @__PURE__ */ u("stop", {
4148
- offset: "0%",
4149
- stopColor: e.color || "var(--page-accent, #4f46e5)"
4150
- }), /* @__PURE__ */ u("stop", {
4151
- offset: "100%",
4152
- stopColor: e.color2
4153
- })]
4154
- }), /* @__PURE__ */ u("rect", {
4155
- x: t,
4156
- y: n,
4157
- width: k.w,
4158
- height: k.h,
4159
- rx: "10",
4160
- fill: `url(#${b}-${e.id}-grad)`
4161
- })] }) : i ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
4162
- id: `${b}-${e.id}-box`,
4163
- children: /* @__PURE__ */ u("rect", {
4189
+ children: [
4190
+ I.map((e, t) => {
4191
+ let n = e.color || _ || "rgba(148, 163, 184, 0.16)", r = !!(e.color || _);
4192
+ return /* @__PURE__ */ d("g", { children: [/* @__PURE__ */ u("rect", {
4193
+ x: e.x,
4194
+ y: e.y,
4195
+ width: e.width,
4196
+ height: e.height,
4197
+ rx: "16",
4198
+ fill: n
4199
+ }), g !== "hidden" && e.title && /* @__PURE__ */ u("text", {
4200
+ x: e.x + e.width / 2,
4201
+ y: g === "bottom" ? e.y + e.height - 22 * .42 : e.y + 22 * .78,
4202
+ textAnchor: "middle",
4203
+ fontSize: N.title + 1,
4204
+ fontWeight: "600",
4205
+ opacity: "0.55",
4206
+ fill: r ? Tn(e.color || _) : "var(--page-text, #111827)",
4207
+ children: wn(e.title, Math.floor(e.width / 7))
4208
+ })] }, `group-${t}`);
4209
+ }),
4210
+ F.map((e, t) => /* @__PURE__ */ u("path", {
4211
+ d: y ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
4212
+ fill: "none",
4213
+ stroke: "rgba(148, 163, 184, 0.7)",
4214
+ strokeWidth: "1.5"
4215
+ }, t)),
4216
+ P.map(({ node: e, x: t, y: n }) => {
4217
+ let r = z.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? Tn(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Tn(e.color2) : s, f = S && (En(e) || e.href), p = () => En(e) ? T(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + On.pad + N.avatar + 8 : t + N.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((N.w - N.avatar - 26) / 7) : Math.floor(N.w / 7.6), _ = N.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
4218
+ return /* @__PURE__ */ d("g", {
4219
+ onClick: f ? p : void 0,
4220
+ style: f ? { cursor: "pointer" } : void 0,
4221
+ role: f ? "button" : void 0,
4222
+ "aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
4223
+ children: [
4224
+ i && e.gradient ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("linearGradient", {
4225
+ id: `${C}-${e.id}-grad`,
4226
+ x1: "0",
4227
+ y1: "0",
4228
+ x2: "0",
4229
+ y2: "1",
4230
+ children: [/* @__PURE__ */ u("stop", {
4231
+ offset: "0%",
4232
+ stopColor: e.color || "var(--page-accent, #4f46e5)"
4233
+ }), /* @__PURE__ */ u("stop", {
4234
+ offset: "100%",
4235
+ stopColor: e.color2
4236
+ })]
4237
+ }), /* @__PURE__ */ u("rect", {
4164
4238
  x: t,
4165
4239
  y: n,
4166
- width: k.w,
4167
- height: k.h,
4168
- rx: "10"
4169
- })
4170
- }), /* @__PURE__ */ d("g", {
4171
- clipPath: `url(#${b}-${e.id}-box)`,
4172
- children: [/* @__PURE__ */ u("rect", {
4240
+ width: N.w,
4241
+ height: N.h,
4242
+ rx: "10",
4243
+ fill: `url(#${C}-${e.id}-grad)`
4244
+ })] }) : i ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
4245
+ id: `${C}-${e.id}-box`,
4246
+ children: /* @__PURE__ */ u("rect", {
4247
+ x: t,
4248
+ y: n,
4249
+ width: N.w,
4250
+ height: N.h,
4251
+ rx: "10"
4252
+ })
4253
+ }), /* @__PURE__ */ d("g", {
4254
+ clipPath: `url(#${C}-${e.id}-box)`,
4255
+ children: [/* @__PURE__ */ u("rect", {
4256
+ x: t,
4257
+ y: n,
4258
+ width: N.w,
4259
+ height: _,
4260
+ fill: o
4261
+ }), /* @__PURE__ */ u("rect", {
4262
+ x: t,
4263
+ y: n + _,
4264
+ width: N.w,
4265
+ height: N.h - _,
4266
+ fill: e.color2
4267
+ })]
4268
+ })] }) : /* @__PURE__ */ u("rect", {
4173
4269
  x: t,
4174
4270
  y: n,
4175
- width: k.w,
4176
- height: _,
4177
- fill: o
4178
- }), /* @__PURE__ */ u("rect", {
4179
- x: t,
4180
- y: n + _,
4181
- width: k.w,
4182
- height: k.h - _,
4183
- fill: e.color2
4184
- })]
4185
- })] }) : /* @__PURE__ */ u("rect", {
4186
- x: t,
4187
- y: n,
4188
- width: k.w,
4189
- height: k.h,
4190
- rx: "10",
4191
- fill: o,
4192
- stroke: a ? "none" : "var(--page-accent, #4f46e5)",
4193
- strokeWidth: a ? 0 : 1.5
4194
- }),
4195
- e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
4196
- id: `${b}-${e.id}`,
4197
- children: /* @__PURE__ */ u("circle", {
4198
- cx: t + Tn.pad + k.avatar / 2,
4199
- cy: n + k.h / 2,
4200
- r: k.avatar / 2
4201
- })
4202
- }), /* @__PURE__ */ u("image", {
4203
- href: e.photo,
4204
- x: t + Tn.pad,
4205
- y: n + (k.h - k.avatar) / 2,
4206
- width: k.avatar,
4207
- height: k.avatar,
4208
- preserveAspectRatio: "xMidYMid slice",
4209
- clipPath: `url(#${b}-${e.id})`
4210
- })] }),
4211
- i && !e.gradient ? /* @__PURE__ */ d(l, { children: [e.title && /* @__PURE__ */ u("text", {
4212
- x: m,
4213
- y: n + _ / 2 + k.title * .35,
4214
- textAnchor: h,
4215
- fontSize: k.title,
4216
- fontWeight: "600",
4217
- fill: s,
4218
- children: xn(e.title, g + 4)
4219
- }), e.name && /* @__PURE__ */ u("text", {
4220
- x: m,
4221
- y: n + _ + _ / 2 + k.name * .35,
4222
- textAnchor: h,
4223
- fontSize: k.name,
4224
- fontWeight: "600",
4225
- fill: c,
4226
- children: xn(e.name, g)
4227
- })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
4228
- x: m,
4229
- y: n + (v[1] ? k.h * .43 : k.h * .57),
4230
- textAnchor: h,
4231
- fontSize: k.name,
4232
- fontWeight: "600",
4233
- fill: s,
4234
- children: xn(v[0], g)
4235
- }), v[1] && /* @__PURE__ */ u("text", {
4236
- x: m,
4237
- y: n + k.h * .73,
4238
- textAnchor: h,
4239
- fontSize: k.title,
4240
- opacity: "0.7",
4241
- fill: s,
4242
- children: xn(v[1], g + 4)
4243
- })] })
4244
- ]
4245
- }, e.id);
4246
- })]
4247
- }), x && /* @__PURE__ */ u(En, {
4248
- node: x,
4249
- onClose: () => S(null)
4271
+ width: N.w,
4272
+ height: N.h,
4273
+ rx: "10",
4274
+ fill: o,
4275
+ stroke: a ? "none" : "var(--page-accent, #4f46e5)",
4276
+ strokeWidth: a ? 0 : 1.5
4277
+ }),
4278
+ e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
4279
+ id: `${C}-${e.id}`,
4280
+ children: /* @__PURE__ */ u("circle", {
4281
+ cx: t + On.pad + N.avatar / 2,
4282
+ cy: n + N.h / 2,
4283
+ r: N.avatar / 2
4284
+ })
4285
+ }), /* @__PURE__ */ u("image", {
4286
+ href: e.photo,
4287
+ x: t + On.pad,
4288
+ y: n + (N.h - N.avatar) / 2,
4289
+ width: N.avatar,
4290
+ height: N.avatar,
4291
+ preserveAspectRatio: "xMidYMid slice",
4292
+ clipPath: `url(#${C}-${e.id})`
4293
+ })] }),
4294
+ i && !e.gradient ? /* @__PURE__ */ d(l, { children: [e.title && /* @__PURE__ */ u("text", {
4295
+ x: m,
4296
+ y: n + _ / 2 + N.title * .35,
4297
+ textAnchor: h,
4298
+ fontSize: N.title,
4299
+ fontWeight: "600",
4300
+ fill: s,
4301
+ children: wn(e.title, g + 4)
4302
+ }), e.name && /* @__PURE__ */ u("text", {
4303
+ x: m,
4304
+ y: n + _ + _ / 2 + N.name * .35,
4305
+ textAnchor: h,
4306
+ fontSize: N.name,
4307
+ fontWeight: "600",
4308
+ fill: c,
4309
+ children: wn(e.name, g)
4310
+ })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
4311
+ x: m,
4312
+ y: n + (v[1] ? N.h * .43 : N.h * .57),
4313
+ textAnchor: h,
4314
+ fontSize: N.name,
4315
+ fontWeight: "600",
4316
+ fill: s,
4317
+ children: wn(v[0], g)
4318
+ }), v[1] && /* @__PURE__ */ u("text", {
4319
+ x: m,
4320
+ y: n + N.h * .73,
4321
+ textAnchor: h,
4322
+ fontSize: N.title,
4323
+ opacity: "0.7",
4324
+ fill: s,
4325
+ children: wn(v[1], g + 4)
4326
+ })] })
4327
+ ]
4328
+ }, e.id);
4329
+ })
4330
+ ]
4331
+ }), w && /* @__PURE__ */ u(kn, {
4332
+ node: w,
4333
+ onClose: () => T(null)
4250
4334
  })]
4251
4335
  });
4252
4336
  }
4253
- function On({ value: e, onCommit: t, style: n, hint: r }) {
4337
+ function jn({ value: e, onCommit: t, style: n, hint: r }) {
4254
4338
  let [a, o] = c(!1), l = s(null);
4255
4339
  return i(() => {
4256
4340
  if (!a || !l.current) return;
@@ -4280,7 +4364,7 @@ function On({ value: e, onCommit: t, style: n, hint: r }) {
4280
4364
  children: e ?? ""
4281
4365
  });
4282
4366
  }
4283
- 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) => {
4367
+ var Mn = 360, Nn = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;\n font-size: 11px;\n line-height: 16px;\n min-width: 20px;\n text-align: center;\n padding: 1px 4px;\n user-select: none;\n color: #e2e8f0;\n background: rgba(148, 163, 184, 0.16);\n}\n.wb-tedit-btn:hover { background: #4f46e5; color: #fff; }\n.wb-tedit-btn[data-hint] { position: relative; }\n.wb-tedit-btn[data-hint]:hover::after {\n content: attr(data-hint);\n position: absolute;\n bottom: calc(100% + 6px);\n left: 50%;\n transform: translateX(-50%);\n padding: 3px 6px;\n border-radius: 5px;\n background: #1e293b;\n border: 1px solid rgba(148, 163, 184, 0.35);\n color: #e2e8f0;\n font-size: 10px;\n line-height: 14px;\n white-space: nowrap;\n pointer-events: none;\n z-index: 6;\n}\n.wb-tedit-grip { position: absolute; top: 0; right: -3px; width: 6px; height: 100%; cursor: col-resize; }\n.wb-tedit-grip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-rowgrip { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; }\n.wb-tedit-rowgrip:hover { background: rgba(99, 102, 241, 0.55); }\n.wb-tedit-cellon { outline: 2px solid rgba(99, 102, 241, 0.75); outline-offset: -2px; }\n.wb-tedit-bar {\n position: absolute;\n z-index: 5;\n display: flex;\n align-items: center;\n gap: 3px;\n padding: 4px 5px;\n border-radius: 8px;\n background: #0f172a;\n border: 1px solid rgba(148, 163, 184, 0.35);\n box-shadow: 0 6px 18px rgba(15, 23, 42, 0.35);\n white-space: nowrap;\n}\n.wb-tedit-sep { width: 1px; align-self: stretch; margin: 0 2px; background: rgba(148, 163, 184, 0.3); }\n.wb-tedit-at { font-size: 10px; color: #94a3b8; padding-right: 2px; }\n", Pn = (e, t) => e && t ? `cell-${e}-${t}` : "", Fn = (e) => {
4284
4368
  if (!e || typeof e != "object") return e ?? "";
4285
4369
  let t = String(e.text ?? "");
4286
4370
  return typeof e.href == "string" && e.href ? /* @__PURE__ */ u("a", {
@@ -4291,7 +4375,7 @@ var kn = 360, An = "\n.wb-tedit-btn {\n cursor: pointer;\n border-radius: 4px;
4291
4375
  children: t
4292
4376
  }) : t;
4293
4377
  };
4294
- 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, borderColor: k, maxHeight: j, style: M, nodeRef: N, edit: P }) {
4378
+ function In({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], colKeys: o = [], heights: f = [], spans: p, linked: m, source: h, limit: g = 10, header: _ = !0, striped: v = !0, bordered: y = !1, compact: b = !1, padX: x, padY: S, paged: C, emptyText: w, stickyHeader: T, headerBg: E, headerColor: D, headerAlign: O, borderColor: k, maxHeight: j, style: M, nodeRef: N, edit: P }) {
4295
4379
  let F = s(null), I = s(null), [L, R] = c(null), [z, B] = c(null), V = (e, t) => () => R({
4296
4380
  r: e,
4297
4381
  c: t
@@ -4305,7 +4389,7 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4305
4389
  }
4306
4390
  let n = e.getBoundingClientRect(), r = t.getBoundingClientRect(), i = {
4307
4391
  top: r.bottom - n.top + 4,
4308
- left: Math.max(0, Math.min(r.left - n.left, n.width - kn))
4392
+ left: Math.max(0, Math.min(r.left - n.left, n.width - Mn))
4309
4393
  };
4310
4394
  (z?.top !== i.top || z?.left !== i.left) && B(i);
4311
4395
  }), i(() => {
@@ -4315,58 +4399,58 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4315
4399
  };
4316
4400
  return document.addEventListener("mousedown", e, !0), () => document.removeEventListener("mousedown", e, !0);
4317
4401
  }, [P, L]);
4318
- let { tenant: H, apiUrl: U } = r(q), ee = r(xe), W = ee?.[h], te = C ? Se(ee) : 1, [ne, re] = c(null);
4402
+ let { tenant: H, apiUrl: U } = r(Y), ee = r(be), te = ee?.[h], ne = C ? xe(ee) : 1, [re, W] = c(null);
4319
4403
  if (i(() => {
4320
- if (!h || W) return;
4321
- let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(te - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
4404
+ if (!h || te) return;
4405
+ let e = !0, t = Math.max(1, Number(g) || 10), n = C && !h.startsWith("api:") ? `?offset=${(ne - 1) * t}&limit=${t}` : "", r = h.startsWith("api:") ? `${U}/data/${encodeURIComponent(h.slice(4))}` : `${U}/dynamic/${encodeURIComponent(h)}${n}`;
4322
4406
  return fetch(r, { headers: H ? { "x-tenant": H } : {} }).then((e) => e.json()).then((t) => {
4323
4407
  let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
4324
- return e && re(n);
4325
- }).catch(() => e && re([])), () => {
4408
+ return e && W(n);
4409
+ }).catch(() => e && W([])), () => {
4326
4410
  e = !1;
4327
4411
  };
4328
4412
  }, [
4329
4413
  h,
4330
4414
  H,
4331
4415
  U,
4332
- W,
4333
- C,
4334
4416
  te,
4417
+ C,
4418
+ ne,
4335
4419
  g
4336
4420
  ]), !e.length) return null;
4337
- let ie = Math.max(1, Number(g) || 10), ae = h ? C ? W || h.startsWith("api:") ? (W ?? ne ?? []).slice((te - 1) * ie, te * ie) : (ne ?? []).slice(0, ie) : (W ?? ne ?? []).slice(0, ie) : null, G = ae ? ae.map((t) => e.map((e) => Z(Te(t?.data, e.field)))) : t, oe = !!h && !(h && !W && ne === null) && G.length === 0, se = b ? {
4421
+ let G = Math.max(1, Number(g) || 10), K = h ? C ? te || h.startsWith("api:") ? (te ?? re ?? []).slice((ne - 1) * G, ne * G) : (re ?? []).slice(0, G) : (te ?? re ?? []).slice(0, G) : null, ie = K ? K.map((t) => e.map((e) => Te(Ce(t?.data, e.field)))) : t, ae = !!h && !(h && !te && re === null) && ie.length === 0, oe = b ? {
4338
4422
  y: 6,
4339
4423
  x: 10
4340
4424
  } : {
4341
4425
  y: 10,
4342
4426
  x: 14
4343
- }, ce = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : se.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : se.x}px`, le = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, ue = y ? { border: le } : { borderBottom: le }, K = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), de = [
4427
+ }, q = `${Number.isFinite(Number(S)) && S !== "" ? Number(S) : oe.y}px ${Number.isFinite(Number(x)) && x !== "" ? Number(x) : oe.x}px`, se = `1px solid ${typeof k == "string" && k ? k : "rgba(148, 163, 184, 0.35)"}`, ce = y ? { border: se } : { borderBottom: se }, le = Array.isArray(n) && n.length === e.length && n.every((e) => Number.isFinite(e) && e > 0), ue = [
4344
4428
  "left",
4345
4429
  "center",
4346
4430
  "right"
4347
- ], fe = (t) => de.includes(e[t]?.align) ? e[t].align : "", pe = (e) => fe(e) || (de.includes(O) ? O : "left"), me = Number.isFinite(Number(j)) && Number(j) > 0 ? Number(j) : 0, he = A(M), ge = !me && he && he.maxHeight !== void 0 ? he.maxHeight : 0, _e = me || ge, ve = ge ? {
4348
- ...he,
4431
+ ], de = (t) => ue.includes(e[t]?.align) ? e[t].align : "", fe = (e) => de(e) || (ue.includes(O) ? O : "left"), J = Number.isFinite(Number(j)) && Number(j) > 0 ? Number(j) : 0, pe = A(M), me = !J && pe && pe.maxHeight !== void 0 ? pe.maxHeight : 0, he = J || me, ge = me ? {
4432
+ ...pe,
4349
4433
  maxHeight: void 0
4350
- } : he, ye = !!P && P.rows !== !1, be = (t) => (r) => {
4434
+ } : pe, _e = !!P && P.rows !== !1, ve = (t) => (r) => {
4351
4435
  if (!P?.resize || t >= e.length - 1) return;
4352
4436
  r.preventDefault(), r.stopPropagation();
4353
4437
  let i = F.current, a = i ? i.clientWidth : 0;
4354
4438
  if (!a) return;
4355
- let o = K ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
4439
+ let o = le ? [...n] : e.map(() => 100 / e.length), s = r.clientX, c = o[t] + o[t + 1], l = (e) => {
4356
4440
  let n = (e.clientX - s) / a * 100, r = Math.min(c - 5, Math.max(5, o[t] + n)), i = [...o];
4357
4441
  i[t] = Math.round(r * 10) / 10, i[t + 1] = Math.round((c - r) * 10) / 10, P.resize(i);
4358
4442
  }, u = () => {
4359
4443
  window.removeEventListener("pointermove", l), window.removeEventListener("pointerup", u);
4360
4444
  };
4361
4445
  window.addEventListener("pointermove", l), window.addEventListener("pointerup", u);
4362
- }, Ce = /* @__PURE__ */ new Set();
4363
- p && G.forEach((t, n) => e.forEach((e, t) => {
4364
- let r = p[jn(a[n], o[t])];
4446
+ }, ye = /* @__PURE__ */ new Set();
4447
+ p && ie.forEach((t, n) => e.forEach((e, t) => {
4448
+ let r = p[Pn(a[n], o[t])];
4365
4449
  if (!r) return;
4366
4450
  let i = Math.max(1, Number(r.c) || 1), s = Math.max(1, Number(r.r) || 1);
4367
- for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && Ce.add(`${n + e},${t + r}`);
4451
+ for (let e = 0; e < s; e++) for (let r = 0; r < i; r++) (e || r) && ye.add(`${n + e},${t + r}`);
4368
4452
  }));
4369
- let we = (e) => (t) => {
4453
+ let Se = (e) => (t) => {
4370
4454
  if (!P?.resizeRow) return;
4371
4455
  t.preventDefault(), t.stopPropagation();
4372
4456
  let n = t.currentTarget.closest("tr");
@@ -4375,7 +4459,7 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4375
4459
  window.removeEventListener("pointermove", a), window.removeEventListener("pointerup", o);
4376
4460
  };
4377
4461
  window.addEventListener("pointermove", a), window.addEventListener("pointerup", o);
4378
- }, J = (e, t, n, r) => r ? null : /* @__PURE__ */ u("span", {
4462
+ }, X = (e, t, n, r) => r ? null : /* @__PURE__ */ u("span", {
4379
4463
  className: "wb-tedit-btn",
4380
4464
  role: "button",
4381
4465
  "data-hint": t,
@@ -4384,7 +4468,7 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4384
4468
  },
4385
4469
  onClick: n,
4386
4470
  children: e
4387
- }, t), Y = L && L.r < G.length && L.c < e.length ? L : null, X = (e, t) => P?.labels?.[e] ?? t, Ee = Y ? p?.[jn(a[Y.r], o[Y.c])] : null, De = Math.max(1, Number(Ee?.c) || 1), Oe = Math.max(1, Number(Ee?.r) || 1);
4471
+ }, t), Z = L && L.r < ie.length && L.c < e.length ? L : null, Q = (e, t) => P?.labels?.[e] ?? t, we = Z ? p?.[Pn(a[Z.r], o[Z.c])] : null, Ee = Math.max(1, Number(we?.c) || 1), De = Math.max(1, Number(we?.r) || 1);
4388
4472
  return /* @__PURE__ */ d("div", {
4389
4473
  ref: (e) => {
4390
4474
  I.current = e, typeof N == "function" && N(e);
@@ -4392,11 +4476,11 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4392
4476
  style: {
4393
4477
  width: "100%",
4394
4478
  ...P ? { position: "relative" } : null,
4395
- ...ve
4479
+ ...ge
4396
4480
  },
4397
4481
  children: [
4398
- P && /* @__PURE__ */ u("style", { children: An }),
4399
- P && Y && z && /* @__PURE__ */ d("div", {
4482
+ P && /* @__PURE__ */ u("style", { children: Nn }),
4483
+ P && Z && z && /* @__PURE__ */ d("div", {
4400
4484
  className: "wb-tedit-bar",
4401
4485
  style: {
4402
4486
  top: z.top,
@@ -4406,31 +4490,31 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4406
4490
  children: [
4407
4491
  /* @__PURE__ */ u("span", {
4408
4492
  className: "wb-tedit-at",
4409
- children: `R${Y.r + 1}·C${Y.c + 1}`
4493
+ children: `R${Z.r + 1}·C${Z.c + 1}`
4410
4494
  }),
4411
- J("+↑", X("rowAbove", "Insert row above"), () => P.addRow(Y.r - 1)),
4412
- J("+↓", X("rowBelow", "Insert row below"), () => P.addRow(Y.r)),
4413
- J("↑", X("rowUp", "Move row up"), () => P.moveRow(Y.r, -1), Y.r === 0),
4414
- J("↓", X("rowDown", "Move row down"), () => P.moveRow(Y.r, 1), Y.r >= G.length - 1),
4415
- J("✕ row", X("rowDelete", "Delete row"), () => P.dropRow(Y.r), G.length <= 1),
4495
+ X("+↑", Q("rowAbove", "Insert row above"), () => P.addRow(Z.r - 1)),
4496
+ X("+↓", Q("rowBelow", "Insert row below"), () => P.addRow(Z.r)),
4497
+ X("↑", Q("rowUp", "Move row up"), () => P.moveRow(Z.r, -1), Z.r === 0),
4498
+ X("↓", Q("rowDown", "Move row down"), () => P.moveRow(Z.r, 1), Z.r >= ie.length - 1),
4499
+ X("✕ row", Q("rowDelete", "Delete row"), () => P.dropRow(Z.r), ie.length <= 1),
4416
4500
  /* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
4417
- J("+←", X("colLeft", "Insert column left"), () => P.addColumn(Y.c - 1)),
4418
- J("+→", X("colRight", "Insert column right"), () => P.addColumn(Y.c)),
4419
- J("←", X("colMoveLeft", "Move column left"), () => P.moveColumn(Y.c, -1), Y.c === 0),
4420
- J("→", X("colMoveRight", "Move column right"), () => P.moveColumn(Y.c, 1), Y.c >= e.length - 1),
4421
- J("✕ col", X("colDelete", "Delete column"), () => P.dropColumn(Y.c), e.length <= 1),
4501
+ X("+←", Q("colLeft", "Insert column left"), () => P.addColumn(Z.c - 1)),
4502
+ X("+→", Q("colRight", "Insert column right"), () => P.addColumn(Z.c)),
4503
+ X("←", Q("colMoveLeft", "Move column left"), () => P.moveColumn(Z.c, -1), Z.c === 0),
4504
+ X("→", Q("colMoveRight", "Move column right"), () => P.moveColumn(Z.c, 1), Z.c >= e.length - 1),
4505
+ X("✕ col", Q("colDelete", "Delete column"), () => P.dropColumn(Z.c), e.length <= 1),
4422
4506
  /* @__PURE__ */ u("span", { className: "wb-tedit-sep" }),
4423
- J("↔", X("mergeRight", "Merge with the cell on the right"), () => P.merge(Y.r, Y.c, "right"), Y.c + De >= e.length),
4424
- J("↕", X("mergeDown", "Merge with the cell below"), () => P.merge(Y.r, Y.c, "down"), Y.r + Oe >= G.length),
4425
- J("⤫", X("split", "Split this cell"), () => P.split(Y.r, Y.c), De === 1 && Oe === 1)
4507
+ X("↔", Q("mergeRight", "Merge with the cell on the right"), () => P.merge(Z.r, Z.c, "right"), Z.c + Ee >= e.length),
4508
+ X("↕", Q("mergeDown", "Merge with the cell below"), () => P.merge(Z.r, Z.c, "down"), Z.r + De >= ie.length),
4509
+ X("⤫", Q("split", "Split this cell"), () => P.split(Z.r, Z.c), Ee === 1 && De === 1)
4426
4510
  ]
4427
4511
  }),
4428
4512
  /* @__PURE__ */ u("div", {
4429
4513
  style: {
4430
4514
  width: "100%",
4431
4515
  overflowX: "auto",
4432
- ..._e ? {
4433
- maxHeight: _e,
4516
+ ...he ? {
4517
+ maxHeight: he,
4434
4518
  overflowY: "auto"
4435
4519
  } : null
4436
4520
  },
@@ -4441,17 +4525,17 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4441
4525
  borderCollapse: T && _ !== !1 ? "separate" : "collapse",
4442
4526
  borderSpacing: 0,
4443
4527
  fontSize: 14,
4444
- ...K ? { tableLayout: "fixed" } : null,
4445
- ...y ? { border: le } : {}
4528
+ ...le ? { tableLayout: "fixed" } : null,
4529
+ ...y ? { border: se } : {}
4446
4530
  },
4447
4531
  children: [
4448
- K && /* @__PURE__ */ u("colgroup", { children: n.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
4532
+ le && /* @__PURE__ */ u("colgroup", { children: n.map((e, t) => /* @__PURE__ */ u("col", { style: { width: `${e}%` } }, t)) }),
4449
4533
  _ === !1 ? null : /* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((t, n) => /* @__PURE__ */ u("th", {
4450
4534
  className: P ? "wb-tedit-head" : void 0,
4451
4535
  style: {
4452
- textAlign: pe(n),
4536
+ textAlign: fe(n),
4453
4537
  fontWeight: 600,
4454
- padding: ce,
4538
+ padding: q,
4455
4539
  ...typeof D == "string" && D ? { color: D } : null,
4456
4540
  background: typeof E == "string" && E ? E : T ? "var(--page-surface, #f2f2f2)" : "rgba(148, 163, 184, 0.12)",
4457
4541
  ...T ? {
@@ -4459,53 +4543,53 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4459
4543
  top: 0,
4460
4544
  zIndex: 2
4461
4545
  } : P ? { position: "relative" } : null,
4462
- ...ue
4546
+ ...ce
4463
4547
  },
4464
- children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(On, {
4548
+ children: P ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(jn, {
4465
4549
  value: t.label ?? t,
4466
4550
  onCommit: (e) => P.header(n, e),
4467
- hint: X("editCell", "Double-click to edit"),
4551
+ hint: Q("editCell", "Double-click to edit"),
4468
4552
  style: { paddingRight: 6 }
4469
4553
  }), n < e.length - 1 && /* @__PURE__ */ u("span", {
4470
4554
  className: "wb-tedit-grip",
4471
- title: X("colWidth", "Drag to resize the column"),
4472
- onPointerDown: be(n)
4555
+ title: Q("colWidth", "Drag to resize the column"),
4556
+ onPointerDown: ve(n)
4473
4557
  })] }) : t.label ?? t
4474
4558
  }, n)) }) }),
4475
- /* @__PURE__ */ d("tbody", { children: [oe && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
4559
+ /* @__PURE__ */ d("tbody", { children: [ae && /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
4476
4560
  colSpan: e.length,
4477
4561
  style: {
4478
- padding: ce,
4562
+ padding: q,
4479
4563
  textAlign: "center",
4480
4564
  opacity: .6,
4481
- ...ue
4565
+ ...ce
4482
4566
  },
4483
4567
  children: w || "No data yet"
4484
- }) }), G.map((t, n) => /* @__PURE__ */ u("tr", {
4568
+ }) }), ie.map((t, n) => /* @__PURE__ */ u("tr", {
4485
4569
  className: P ? "wb-tedit-row" : void 0,
4486
4570
  style: {
4487
4571
  ...v && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : null,
4488
4572
  ...Number.isFinite(Number(f?.[n])) && f[n] > 0 ? { height: f[n] } : null
4489
4573
  },
4490
4574
  children: e.map((e, r) => {
4491
- if (Ce.has(`${n},${r}`)) return null;
4492
- 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);
4575
+ if (ye.has(`${n},${r}`)) return null;
4576
+ let i = Pn(a[n], o[r]), s = m?.[i], c = p?.[i], l = Math.max(1, Number(c?.c) || 1), f = Math.max(1, Number(c?.r) || 1);
4493
4577
  return /* @__PURE__ */ d("td", {
4494
4578
  className: P ? `wb-tedit-cell${L?.r === n && L?.c === r ? " wb-tedit-cellon" : ""}` : void 0,
4495
- onMouseDownCapture: ye ? V(n, r) : void 0,
4579
+ onMouseDownCapture: _e ? V(n, r) : void 0,
4496
4580
  "data-cell": P ? `${n}-${r}` : void 0,
4497
4581
  colSpan: l > 1 ? l : void 0,
4498
4582
  rowSpan: f > 1 ? f : void 0,
4499
4583
  style: {
4500
- padding: ce,
4501
- ...fe(r) ? { textAlign: fe(r) } : null,
4584
+ padding: q,
4585
+ ...de(r) ? { textAlign: de(r) } : null,
4502
4586
  ...P ? { position: "relative" } : null,
4503
- ...ue
4587
+ ...ce
4504
4588
  },
4505
- children: [s ?? Mn(t?.[r]), P && ye && /* @__PURE__ */ u("span", {
4589
+ children: [s ?? Fn(t?.[r]), P && _e && /* @__PURE__ */ u("span", {
4506
4590
  className: "wb-tedit-rowgrip",
4507
- title: X("rowHeight", "Drag to set the row height — double-click to fit the content"),
4508
- onPointerDown: we(n),
4591
+ title: Q("rowHeight", "Drag to set the row height — double-click to fit the content"),
4592
+ onPointerDown: Se(n),
4509
4593
  onDoubleClick: () => P.resizeRow(n, 0)
4510
4594
  })]
4511
4595
  }, r);
@@ -4517,7 +4601,7 @@ function Nn({ columns: e = [], rows: t = [], widths: n = [], rowKeys: a = [], co
4517
4601
  ]
4518
4602
  });
4519
4603
  }
4520
- var Pn = {
4604
+ var Ln = {
4521
4605
  small: {
4522
4606
  cell: 62,
4523
4607
  font: 10.5,
@@ -4542,9 +4626,9 @@ var Pn = {
4542
4626
  pad: 8,
4543
4627
  gap: 4
4544
4628
  }
4545
- }, 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;
4546
- function Rn(e, t = {}) {
4547
- 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) => {
4629
+ }, Rn = (e) => `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`, zn = (e) => new Date(e.getFullYear(), e.getMonth(), e.getDate()), Bn = 366;
4630
+ function Vn(e, t = {}) {
4631
+ let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : Te(e), a = (e) => {
4548
4632
  let t = i(r(e)), n = t ? new Date(t) : null;
4549
4633
  return n && !Number.isNaN(n.getTime()) ? n : null;
4550
4634
  };
@@ -4560,7 +4644,7 @@ function Rn(e, t = {}) {
4560
4644
  } : null;
4561
4645
  }).filter(Boolean);
4562
4646
  }
4563
- function zn(e) {
4647
+ function Hn(e) {
4564
4648
  return (Array.isArray(e) ? e : []).map((e, t) => {
4565
4649
  let n = e?.start ? new Date(e.start) : null;
4566
4650
  if (!n || Number.isNaN(n.getTime())) return null;
@@ -4575,20 +4659,20 @@ function zn(e) {
4575
4659
  };
4576
4660
  }).filter(Boolean);
4577
4661
  }
4578
- function Bn(e) {
4662
+ function Un(e) {
4579
4663
  let t = /* @__PURE__ */ new Map();
4580
4664
  for (let n of e) {
4581
- let e = In(n.start), r = n.end ? In(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Ln);
4665
+ let e = zn(n.start), r = n.end ? zn(n.end) : e, i = Math.min(Math.max(0, Math.round((r - e) / 864e5)), Bn);
4582
4666
  for (let r = 0; r <= i; r += 1) {
4583
- let i = Fn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
4667
+ let i = Rn(new Date(e.getFullYear(), e.getMonth(), e.getDate() + r));
4584
4668
  t.has(i) || t.set(i, []), t.get(i).push(n);
4585
4669
  }
4586
4670
  }
4587
4671
  for (let e of t.values()) e.sort((e, t) => e.start - t.start);
4588
4672
  return t;
4589
4673
  }
4590
- 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 }) {
4591
- let { tenant: T, apiUrl: E, locale: D } = r(q), O = r(xe)?.[t], [k, j] = c(null), [M, N] = c(() => {
4674
+ function Wn({ events: e = [], source: t = "", titleField: n = "", startField: a = "", endField: o = "", hrefField: s = "", colorField: f = "", variant: p = "month", size: m = "medium", accent: h = "", eventBg: g = "", eventText: _ = "", borderColor: v = "", weekStart: y = "monday", max: b = 3, emptyText: x = "No events", style: S, nodeRef: C, interactive: w = !0 }) {
4675
+ let { tenant: T, apiUrl: E, locale: D } = r(Y), O = r(be)?.[t], [k, j] = c(null), [M, N] = c(() => {
4592
4676
  let e = /* @__PURE__ */ new Date();
4593
4677
  return {
4594
4678
  year: e.getFullYear(),
@@ -4610,13 +4694,13 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
4610
4694
  E,
4611
4695
  O
4612
4696
  ]);
4613
- 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 ?? [], {
4697
+ let P = Ln[m] ?? Ln.medium, F = h || "var(--page-accent, #4f46e5)", I = v || "var(--page-border, rgba(148, 163, 184, 0.35))", L = g || F, R = _ || "var(--page-accent-text, #ffffff)", z = t ? Vn(O ?? k ?? [], {
4614
4698
  titleField: n,
4615
4699
  startField: a,
4616
4700
  endField: o,
4617
4701
  hrefField: s,
4618
4702
  colorField: f
4619
- }) : zn(e), B = Bn(z), V = D || void 0, H = (e, t) => {
4703
+ }) : Hn(e), B = Un(z), V = D || void 0, H = (e, t) => {
4620
4704
  let n = /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("span", { style: {
4621
4705
  width: 6,
4622
4706
  height: 6,
@@ -4663,7 +4747,7 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
4663
4747
  year: n.getFullYear(),
4664
4748
  month: n.getMonth()
4665
4749
  };
4666
- }), W = (e, t) => /* @__PURE__ */ u("button", {
4750
+ }), te = (e, t) => /* @__PURE__ */ u("button", {
4667
4751
  type: "button",
4668
4752
  "aria-label": e,
4669
4753
  onClick: () => ee(t),
@@ -4678,7 +4762,7 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
4678
4762
  padding: "4px 8px"
4679
4763
  },
4680
4764
  children: t < 0 ? "‹" : "›"
4681
- }), te = /* @__PURE__ */ d("div", {
4765
+ }), ne = /* @__PURE__ */ d("div", {
4682
4766
  style: {
4683
4767
  display: "flex",
4684
4768
  alignItems: "center",
@@ -4695,8 +4779,8 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
4695
4779
  },
4696
4780
  children: U
4697
4781
  }),
4698
- W("Previous month", -1),
4699
- W("Next month", 1)
4782
+ te("Previous month", -1),
4783
+ te("Next month", 1)
4700
4784
  ]
4701
4785
  });
4702
4786
  if (p === "list") {
@@ -4712,7 +4796,7 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
4712
4796
  width: "100%",
4713
4797
  ...A(S)
4714
4798
  },
4715
- children: [te, e.length ? /* @__PURE__ */ u("div", {
4799
+ children: [ne, e.length ? /* @__PURE__ */ u("div", {
4716
4800
  style: {
4717
4801
  display: "flex",
4718
4802
  flexDirection: "column",
@@ -4748,10 +4832,10 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
4748
4832
  })]
4749
4833
  });
4750
4834
  }
4751
- let ne = new Date(M.year, M.month, 1), re = y === "sunday" ? 0 : 1, ie = (ne.getDay() - re + 7) % 7, ae = new Date(M.year, M.month + 1, 0).getDate(), G = Math.ceil((ie + ae) / 7), oe = Fn(/* @__PURE__ */ new Date()), se = new Intl.DateTimeFormat(V, { weekday: "short" }), ce = [];
4752
- for (let e = 0; e < G * 7; e += 1) {
4753
- let t = e - ie + 1, n = t >= 1 && t <= ae, 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;
4754
- ce.push(/* @__PURE__ */ d("div", {
4835
+ let re = new Date(M.year, M.month, 1), W = y === "sunday" ? 0 : 1, G = (re.getDay() - W + 7) % 7, K = new Date(M.year, M.month + 1, 0).getDate(), ie = Math.ceil((G + K) / 7), ae = Rn(/* @__PURE__ */ new Date()), oe = new Intl.DateTimeFormat(V, { weekday: "short" }), q = [];
4836
+ for (let e = 0; e < ie * 7; e += 1) {
4837
+ let t = e - G + 1, n = t >= 1 && t <= K, r = Rn(new Date(M.year, M.month, t)), i = n ? B.get(r) ?? [] : [], a = i.slice(0, Math.max(1, b)), o = n && r === ae;
4838
+ q.push(/* @__PURE__ */ d("div", {
4755
4839
  style: {
4756
4840
  minHeight: P.cell,
4757
4841
  borderTop: `1px solid ${I}`,
@@ -4794,7 +4878,7 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
4794
4878
  ...A(S)
4795
4879
  },
4796
4880
  children: [
4797
- te,
4881
+ ne,
4798
4882
  /* @__PURE__ */ d("div", {
4799
4883
  style: {
4800
4884
  display: "grid",
@@ -4808,20 +4892,315 @@ function Vn({ events: e = [], source: t = "", titleField: n = "", startField: a
4808
4892
  textAlign: "center",
4809
4893
  padding: `0 0 ${P.pad}px`
4810
4894
  },
4811
- children: se.format(new Date(2024, 0, 7 + re + t))
4812
- }, `head-${t}`)), ce]
4895
+ children: oe.format(new Date(2024, 0, 7 + W + t))
4896
+ }, `head-${t}`)), q]
4813
4897
  }),
4814
4898
  /* @__PURE__ */ u("div", { style: { borderTop: `1px solid ${I}` } })
4815
4899
  ]
4816
4900
  });
4817
4901
  }
4818
- var Hn = {
4902
+ var Gn = {
4903
+ small: 36,
4904
+ medium: 56,
4905
+ large: 88
4906
+ };
4907
+ function Kn(e, t = {}) {
4908
+ let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object") : [], r = (e) => e == null ? "" : Te(e);
4909
+ return n.map((e) => {
4910
+ let n = e.data ?? e, i = Ce(n, t.imageField), a = Array.isArray(i) ? i[0] : i, o = a && typeof a == "object" ? a.url ?? a.src ?? "" : a, s = t.nameField ? r(Ce(n, t.nameField)) : r(n.name);
4911
+ return {
4912
+ src: typeof o == "string" ? o.trim() : "",
4913
+ alt: s,
4914
+ href: t.hrefField ? r(Ce(n, t.hrefField)) : ""
4915
+ };
4916
+ }).filter((e) => e.src);
4917
+ }
4918
+ function qn({ logos: e = [], source: t = "", imageField: n = "", nameField: a = "", hrefField: o = "", variant: f = "step", size: p = "medium", perView: m = 5, gap: h = 48, hold: g = 3, slideMs: _ = 500, direction: v = "left", arrows: y = "show", pauseOnHover: b = !0, grayscale: x = !0, newTab: S = !0, emptyText: C = "", style: w, nodeRef: T, inert: E }) {
4919
+ let { tenant: D, apiUrl: O } = r(Y), k = r(be)?.[t], [j, M] = c(null), N = s(null), P = s(null), [F, I] = c(0), [L, R] = c(0), [z, B] = c(0), [V, H] = c(!0), [U, ee] = c(!1), [te, ne] = c(!1);
4920
+ i(() => {
4921
+ if (!t || k) return;
4922
+ let e = !0;
4923
+ return fetch(`${O}/dynamic/${encodeURIComponent(t)}`, { headers: D ? { "x-tenant": D } : {} }).then((e) => e.json()).then((t) => {
4924
+ let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
4925
+ e && M(n);
4926
+ }).catch(() => e && M([])), () => {
4927
+ e = !1;
4928
+ };
4929
+ }, [
4930
+ t,
4931
+ D,
4932
+ O,
4933
+ k
4934
+ ]), i(() => {
4935
+ if (typeof window > "u" || !window.matchMedia) return;
4936
+ let e = window.matchMedia("(prefers-reduced-motion: reduce)"), t = () => ne(e.matches);
4937
+ return t(), e.addEventListener?.("change", t), () => e.removeEventListener?.("change", t);
4938
+ }, []), i(() => {
4939
+ let e = P.current;
4940
+ if (!e) return;
4941
+ let t = () => I(e.clientWidth);
4942
+ if (t(), typeof ResizeObserver > "u") return;
4943
+ let n = new ResizeObserver(t);
4944
+ return n.observe(e), () => n.disconnect();
4945
+ }, []), i(() => {
4946
+ let e = N.current;
4947
+ if (!e) return;
4948
+ let t = !0, n = () => {
4949
+ let n = [...e.querySelectorAll("img")].filter((e) => e.complete && e.naturalHeight).map((e) => e.naturalWidth / e.naturalHeight * G);
4950
+ t && n.length && R(Math.ceil(Math.max(...n)));
4951
+ };
4952
+ n();
4953
+ let r = [...e.querySelectorAll("img")].filter((e) => !e.complete);
4954
+ return r.forEach((e) => e.addEventListener("load", n)), () => {
4955
+ t = !1, r.forEach((e) => e.removeEventListener("load", n));
4956
+ };
4957
+ });
4958
+ let re = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.src) : [], W = t ? Kn(k ?? j ?? [], {
4959
+ imageField: n,
4960
+ nameField: a,
4961
+ hrefField: o
4962
+ }) : re, G = Gn[p] ?? Gn.medium, K = Number.isFinite(Number(h)) ? Math.max(0, Number(h)) : 48, ae = f === "marquee" ? "step" : f, oe = Math.min(3e4, Math.max(300, (Number(g) || 3) * 1e3)), q = Math.min(3e3, Math.max(100, Number(_) || 500)), se = Math.min(12, Math.max(1, Math.round(Number(m) || 5))), ce = (L || G * 3) + K, le = F ? Math.max(1, Math.floor(F / ce)) : se, ue = Math.min(se, le), de = F ? Math.min(ce, F / ue) : ce;
4963
+ if (!W.length) return /* @__PURE__ */ u("div", {
4964
+ ref: T,
4965
+ style: {
4966
+ width: "100%",
4967
+ ...A(w)
4968
+ },
4969
+ children: E ? /* @__PURE__ */ u("div", {
4970
+ style: {
4971
+ display: "flex",
4972
+ alignItems: "center",
4973
+ justifyContent: "center",
4974
+ flexWrap: "wrap",
4975
+ gap: K
4976
+ },
4977
+ children: [
4978
+ 0,
4979
+ 1,
4980
+ 2,
4981
+ 3,
4982
+ 4
4983
+ ].map((e) => /* @__PURE__ */ u("div", {
4984
+ style: {
4985
+ height: G,
4986
+ width: G * 3,
4987
+ border: "1px dashed var(--page-border, rgba(148, 163, 184, 0.5))",
4988
+ borderRadius: 6,
4989
+ display: "flex",
4990
+ alignItems: "center",
4991
+ justifyContent: "center",
4992
+ fontSize: Math.max(10, Math.round(G / 4)),
4993
+ opacity: .45,
4994
+ ...ie
4995
+ },
4996
+ children: "LOGO"
4997
+ }, e))
4998
+ }) : C ? /* @__PURE__ */ u("div", {
4999
+ style: {
5000
+ fontSize: 13,
5001
+ opacity: .6,
5002
+ textAlign: "center",
5003
+ padding: 16
5004
+ },
5005
+ children: C
5006
+ }) : null
5007
+ });
5008
+ let fe = W.length, J = ae === "step" && fe > ue, pe = ae === "slider", me = J && !E && !U && !te, he = v === "right", ge = he ? fe : 0, _e = J ? [...W, ...W] : W, ve = J ? z * de : 0, ye = (e, t, n) => {
5009
+ let r = /* @__PURE__ */ u("img", {
5010
+ src: e.src,
5011
+ alt: e.alt ?? "",
5012
+ style: {
5013
+ height: G,
5014
+ width: "auto",
5015
+ maxWidth: "100%",
5016
+ objectFit: "contain",
5017
+ display: "block"
5018
+ }
5019
+ }), i = J ? {
5020
+ width: de,
5021
+ flex: "0 0 auto",
5022
+ padding: `0 ${K / 2}px`,
5023
+ justifyContent: "center"
5024
+ } : {};
5025
+ return e.href && !E ? /* @__PURE__ */ u("a", {
5026
+ href: e.href,
5027
+ className: "wb-logo",
5028
+ title: e.alt || void 0,
5029
+ style: i,
5030
+ ...S === !1 ? {} : {
5031
+ target: "_blank",
5032
+ rel: "noopener noreferrer"
5033
+ },
5034
+ ...n ? {
5035
+ "aria-hidden": "true",
5036
+ tabIndex: -1
5037
+ } : {},
5038
+ children: r
5039
+ }, `${n ? "c" : "o"}-${t}`) : /* @__PURE__ */ u("div", {
5040
+ className: "wb-logo",
5041
+ style: i,
5042
+ ...n ? { "aria-hidden": "true" } : {},
5043
+ children: r
5044
+ }, `${n ? "c" : "o"}-${t}`);
5045
+ }, xe = /* @__PURE__ */ u("div", {
5046
+ ref: N,
5047
+ className: "wb-logos-track",
5048
+ style: {
5049
+ display: "flex",
5050
+ alignItems: "center",
5051
+ ...J ? {
5052
+ width: _e.length * de,
5053
+ transform: `translateX(-${ve}px)`,
5054
+ transition: V ? `transform ${q}ms ease` : "none"
5055
+ } : pe ? {
5056
+ gap: K,
5057
+ overflowX: "auto",
5058
+ scrollBehavior: "smooth",
5059
+ scrollSnapType: "x proximity"
5060
+ } : {
5061
+ gap: K,
5062
+ flexWrap: "wrap",
5063
+ justifyContent: "center"
5064
+ }
5065
+ },
5066
+ children: _e.map((e, t) => ye(e, t, J && t >= fe))
5067
+ }), Se = (e) => {
5068
+ if (pe) {
5069
+ let t = N.current;
5070
+ t && t.scrollBy({
5071
+ left: e * Math.max(120, t.clientWidth * .8),
5072
+ behavior: "smooth"
5073
+ });
5074
+ return;
5075
+ }
5076
+ let t = z + e;
5077
+ if (t >= 0 && t <= fe) {
5078
+ H(!0), B(t);
5079
+ return;
5080
+ }
5081
+ let n = t < 0 ? fe : 0;
5082
+ H(!1), B(n), requestAnimationFrame(() => requestAnimationFrame(() => {
5083
+ H(!0), B(n + e);
5084
+ }));
5085
+ }, X = y === !1 || y === "off" ? "off" : y === "hover" ? "hover" : "show", Z = X !== "off" && (pe ? F > 0 : J), Q = (e) => /* @__PURE__ */ u("button", {
5086
+ type: "button",
5087
+ "aria-label": e < 0 ? "Previous logos" : "Next logos",
5088
+ onClick: () => Se(e),
5089
+ className: `wb-logos-arrow${X === "hover" ? " wb-logos-arrow-shy" : ""}`,
5090
+ style: { [e < 0 ? "left" : "right"]: 0 },
5091
+ children: e < 0 ? "‹" : "›"
5092
+ });
5093
+ return /* @__PURE__ */ d("div", {
5094
+ ref: (e) => {
5095
+ P.current = e, T && T(e);
5096
+ },
5097
+ className: "wb-logos",
5098
+ style: {
5099
+ width: "100%",
5100
+ position: "relative",
5101
+ overflow: "hidden",
5102
+ ...A(w)
5103
+ },
5104
+ onMouseEnter: b === !1 ? void 0 : () => ee(!0),
5105
+ onMouseLeave: b === !1 ? void 0 : () => ee(!1),
5106
+ children: [
5107
+ /* @__PURE__ */ u("style", { children: `
5108
+ .wb-logos .wb-logo { display: flex; align-items: center; flex-shrink: 0; text-decoration: none; box-sizing: border-box; }
5109
+ .wb-logos .wb-logo img { filter: ${x === !1 ? "none" : "grayscale(1)"}; opacity: ${x === !1 ? 1 : .7}; transition: filter .2s ease, opacity .2s ease; }
5110
+ .wb-logos .wb-logo:hover img { filter: none; opacity: 1; }
5111
+ .wb-logos .wb-logos-track::-webkit-scrollbar { display: none; }
5112
+ .wb-logos .wb-logos-track { scrollbar-width: none; }
5113
+ .wb-logos .wb-logo { scroll-snap-align: start; }
5114
+ /* Shy arrows fade in with the pointer — and with KEYBOARD focus, or they
5115
+ would be unreachable without a mouse. */
5116
+ .wb-logos .wb-logos-arrow-shy { opacity: 0; transition: opacity .18s ease; }
5117
+ .wb-logos:hover .wb-logos-arrow-shy,
5118
+ .wb-logos:focus-within .wb-logos-arrow-shy { opacity: 1; }
5119
+ .wb-logos-arrow {
5120
+ position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
5121
+ width: 30px; height: 30px; border-radius: 999px; cursor: pointer; line-height: 1; font-size: 18px;
5122
+ display: flex; align-items: center; justify-content: center;
5123
+ color: inherit; background: var(--page-surface, #f2f2f2);
5124
+ border: 1px solid var(--page-border, rgba(148, 163, 184, 0.5));
5125
+ }
5126
+ ` }),
5127
+ J ? /* @__PURE__ */ d("div", {
5128
+ style: {
5129
+ position: "relative",
5130
+ width: ue * de,
5131
+ maxWidth: "100%",
5132
+ margin: "0 auto"
5133
+ },
5134
+ children: [
5135
+ Z ? Q(-1) : null,
5136
+ /* @__PURE__ */ u("div", {
5137
+ style: { overflow: "hidden" },
5138
+ children: xe
5139
+ }),
5140
+ Z ? Q(1) : null
5141
+ ]
5142
+ }) : /* @__PURE__ */ d(l, { children: [
5143
+ Z ? Q(-1) : null,
5144
+ xe,
5145
+ Z ? Q(1) : null
5146
+ ] }),
5147
+ /* @__PURE__ */ u(Jn, {
5148
+ running: me,
5149
+ every: oe + q,
5150
+ slide: q,
5151
+ step: he ? -1 : 1,
5152
+ index: z,
5153
+ total: fe,
5154
+ home: ge,
5155
+ setIndex: B,
5156
+ setAnimate: H
5157
+ })
5158
+ ]
5159
+ });
5160
+ }
5161
+ function Jn({ running: e, every: t, slide: n, step: r, index: a, total: o, home: s, setIndex: c, setAnimate: l }) {
5162
+ i(() => {
5163
+ if (!e) return;
5164
+ let n = setInterval(() => {
5165
+ l(!0), c((e) => e + r);
5166
+ }, t);
5167
+ return () => clearInterval(n);
5168
+ }, [
5169
+ e,
5170
+ t,
5171
+ r,
5172
+ c,
5173
+ l
5174
+ ]), i(() => {
5175
+ l(!1), c(s);
5176
+ }, [
5177
+ s,
5178
+ c,
5179
+ l
5180
+ ]);
5181
+ let u = r > 0 ? a >= o : a <= 0;
5182
+ return i(() => {
5183
+ if (!u || a === s) return;
5184
+ let e = setTimeout(() => {
5185
+ l(!1), c(s);
5186
+ }, n);
5187
+ return () => clearTimeout(e);
5188
+ }, [
5189
+ u,
5190
+ a,
5191
+ n,
5192
+ s,
5193
+ c,
5194
+ l
5195
+ ]), null;
5196
+ }
5197
+ var Yn = {
4819
5198
  small: 380,
4820
5199
  medium: 560,
4821
5200
  large: 820,
4822
5201
  full: "100%"
4823
5202
  };
4824
- 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 }) {
5203
+ function Xn({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open", openOn: r = "trigger", delay: a = 0, size: o = "medium", title: l = "", showClose: f = !0, backdropClose: p = !0, position: m = "center", actions: h = [], showCloseAction: g = !1, closeLabel: _ = "Close", actionsAlign: v = "right", linked: y, style: b, nodeRef: x, inert: S = !1 }) {
4825
5204
  let [C, w] = c(!1), T = s(null);
4826
5205
  i(() => {
4827
5206
  if (S || !e) return;
@@ -4846,7 +5225,7 @@ function Un({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
4846
5225
  document.removeEventListener("keydown", e), document.body.style.overflow = t;
4847
5226
  };
4848
5227
  }, [S, C]);
4849
- let E = Hn[o] ?? Hn.medium, D = (e) => {
5228
+ let E = Yn[o] ?? Yn.medium, D = (e) => {
4850
5229
  let t = {
4851
5230
  padding: "9px 16px",
4852
5231
  borderRadius: 6,
@@ -5015,10 +5394,11 @@ function Un({ dialogId: e = "", trigger: t = "button", triggerLabel: n = "Open",
5015
5394
  })]
5016
5395
  });
5017
5396
  }
5018
- var Wn = {
5397
+ var Zn = {
5019
5398
  PageRoot: Pe,
5020
- CalendarBlock: Vn,
5021
- DialogBlock: Un,
5399
+ CalendarBlock: Wn,
5400
+ LogoCarousel: qn,
5401
+ DialogBlock: Xn,
5022
5402
  Section: Fe,
5023
5403
  Container: Ie,
5024
5404
  Heading: Le,
@@ -5029,23 +5409,23 @@ var Wn = {
5029
5409
  Divider: ot,
5030
5410
  SliderBlock: ft,
5031
5411
  CanvasSlider: pt,
5032
- TabsBlock: Ot,
5033
- QuickStack: en,
5034
- CollectionList: tn,
5035
- CollectionSearch: nn,
5036
- BreadcrumbsBlock: rn,
5037
- PaginationBlock: an,
5038
- StepperBlock: _n,
5039
- SocialLinksBlock: gn,
5040
- ThemeModeBlock: un,
5041
- ScrollTopBlock: mn,
5042
- OrgChartBlock: Dn,
5043
- TableBlock: Nn,
5044
- IconBlock: xt,
5045
- MapBlock: yt,
5046
- MasonryBlock: Ct,
5047
- AccordionBlock: kt,
5048
- NavbarBlock: Dt,
5412
+ TabsBlock: kt,
5413
+ QuickStack: tn,
5414
+ CollectionList: nn,
5415
+ CollectionSearch: rn,
5416
+ BreadcrumbsBlock: an,
5417
+ PaginationBlock: on,
5418
+ StepperBlock: vn,
5419
+ SocialLinksBlock: _n,
5420
+ ThemeModeBlock: dn,
5421
+ ScrollTopBlock: hn,
5422
+ OrgChartBlock: An,
5423
+ TableBlock: In,
5424
+ IconBlock: St,
5425
+ MapBlock: bt,
5426
+ MasonryBlock: wt,
5427
+ AccordionBlock: At,
5428
+ NavbarBlock: Ot,
5049
5429
  ListBlock: Je,
5050
5430
  TextSpan: Ve,
5051
5431
  QuoteBlock: qe,
@@ -5056,43 +5436,83 @@ var Wn = {
5056
5436
  YouTubeBlock: nt,
5057
5437
  IframeBlock: rt,
5058
5438
  EmbedBlock: it,
5059
- FormBlock: Ht,
5060
- FormLabel: qt,
5061
- FormInput: Jt,
5062
- FormTextarea: Yt,
5063
- FormCheckbox: (e) => /* @__PURE__ */ u(Xt, {
5439
+ FormBlock: Ut,
5440
+ FormLabel: Jt,
5441
+ FormInput: Yt,
5442
+ FormTextarea: Xt,
5443
+ FormCheckbox: (e) => /* @__PURE__ */ u(Zt, {
5064
5444
  kind: "checkbox",
5065
5445
  ...e
5066
5446
  }),
5067
- FormRadio: (e) => /* @__PURE__ */ u(Xt, {
5447
+ FormRadio: (e) => /* @__PURE__ */ u(Zt, {
5068
5448
  kind: "radio",
5069
5449
  ...e
5070
5450
  }),
5071
- FormSelect: Zt,
5072
- FormFile: Qt,
5073
- FormRecaptcha: Kt,
5074
- FormSubmit: $t
5075
- }, Gn = {
5451
+ FormSelect: Qt,
5452
+ FormFile: $t,
5453
+ FormRecaptcha: qt,
5454
+ FormSubmit: en
5455
+ }, Qn = {
5076
5456
  id: "auth",
5077
5457
  label: "Accounts",
5078
5458
  category: "Apps",
5079
5459
  keys: ["SiteLoginForm", "SiteAccountMenu"],
5080
5460
  ssr: "shell",
5081
5461
  settings: ["site.authRedirect"]
5082
- }, Kn = t({
5462
+ }, $n = t({
5083
5463
  user: null,
5084
5464
  status: "idle",
5085
5465
  ensure: () => {},
5086
5466
  refresh: () => {},
5087
5467
  signOut: () => {}
5088
- }), qn = () => {
5089
- let e = r(Kn);
5468
+ });
5469
+ function er(e, t) {
5470
+ return t ? /^https?:\/\//i.test(t) ? t : `${e.replace(/\/+$/, "")}${t.startsWith("/") ? t : `/${t}`}` : "";
5471
+ }
5472
+ function tr(e) {
5473
+ let t = e && typeof e == "object" ? e["site.session"] : null, n = t && typeof t == "object" && !Array.isArray(t) ? t : {}, r = (e) => typeof e == "string" ? e.trim() : "", i = r(n.url), a = r(n.mePath), o = r(n.logoutPath);
5474
+ return {
5475
+ mode: n.mode === "custom" || n.mode === "off" ? n.mode : "system",
5476
+ url: i,
5477
+ mePath: a,
5478
+ logoutPath: o,
5479
+ meUrl: er(i, a),
5480
+ logoutUrl: er(i, o),
5481
+ loginPage: r(n.loginPage),
5482
+ userPath: r(n.userPath),
5483
+ auth: n.auth === "bearer" ? "bearer" : "cookies",
5484
+ tokenKey: r(n.tokenKey) || "webim_session_token"
5485
+ };
5486
+ }
5487
+ function nr(e, t) {
5488
+ if (!t) return e ?? null;
5489
+ let n = e;
5490
+ for (let e of t.split(".")) {
5491
+ if (!n || typeof n != "object") return null;
5492
+ n = n[e];
5493
+ }
5494
+ return n ?? null;
5495
+ }
5496
+ function rr(e) {
5497
+ try {
5498
+ return window.localStorage.getItem(e) || "";
5499
+ } catch {
5500
+ return "";
5501
+ }
5502
+ }
5503
+ function ir(e) {
5504
+ try {
5505
+ window.localStorage.removeItem(e);
5506
+ } catch {}
5507
+ }
5508
+ var ar = () => {
5509
+ let e = r($n);
5090
5510
  return i(() => {
5091
5511
  e.ensure();
5092
5512
  }, [e]), e;
5093
5513
  };
5094
- function Jn({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
5095
- 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}`, {
5514
+ function or({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d }) {
5515
+ let f = r(Y), p = l || f?.apiUrl || "/api", m = d || f?.tenant || "", h = o(() => tr(f?.settings), [f?.settings]), [g, _] = c(t ?? null), [v, y] = c(t ? "user" : a ? "guest" : "idle"), b = s(!1), x = n((e, t) => fetch(`${p}${e}`, {
5096
5516
  ...t,
5097
5517
  credentials: "include",
5098
5518
  headers: {
@@ -5100,61 +5520,93 @@ function Jn({ children: e, initialUser: t, disabled: a, apiUrl: l, tenant: d })
5100
5520
  ...m ? { "x-tenant": m } : {},
5101
5521
  ...t?.headers
5102
5522
  }
5103
- }), [p, m]), x = n(() => a ? Promise.resolve(null) : b("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
5104
- let t = e?.payload ?? null;
5105
- return g(t), v(t ? "user" : "guest"), t;
5106
- }).catch(() => (g(null), v("guest"), null)), [b, a]), S = n(() => b("/site/logout", { method: "post" }).catch(() => {}).then(() => {
5107
- g(null), v("guest");
5108
- }), [b]), C = n(() => {
5109
- y.current || a || t || (y.current = !0, v("loading"), x());
5523
+ }), [p, m]), S = n((e) => (_(e), y(e ? "user" : "guest"), e), []), C = n(() => {
5524
+ if (a) return Promise.resolve(null);
5525
+ if (h.mode === "off") return Promise.resolve(S(null));
5526
+ if (h.mode === "custom") {
5527
+ let e = h.auth === "bearer" ? rr(h.tokenKey) : "";
5528
+ return !h.meUrl || h.auth === "bearer" && !e ? Promise.resolve(S(null)) : fetch(h.meUrl, { ...h.auth === "bearer" ? { headers: { authorization: `Bearer ${e}` } } : { credentials: "include" } }).then((e) => e.ok ? e.json() : null).then((e) => {
5529
+ let t = nr(e, h.userPath);
5530
+ return S(t && typeof t == "object" ? t : null);
5531
+ }).catch(() => S(null));
5532
+ }
5533
+ return x("/site/me").then((e) => e.ok ? e.json() : null).then((e) => S(e?.payload ?? null)).catch(() => S(null));
5534
+ }, [
5535
+ x,
5536
+ h,
5537
+ a,
5538
+ S
5539
+ ]), w = n(() => {
5540
+ if (h.mode === "off") return S(null), Promise.resolve();
5541
+ if (h.mode === "custom") {
5542
+ let e = h.auth === "bearer" ? rr(h.tokenKey) : "";
5543
+ return (h.logoutUrl ? fetch(h.logoutUrl, {
5544
+ method: "post",
5545
+ ...h.auth === "bearer" ? { headers: e ? { authorization: `Bearer ${e}` } : {} } : { credentials: "include" }
5546
+ }).catch(() => {}) : Promise.resolve()).then(() => {
5547
+ h.auth === "bearer" && ir(h.tokenKey), S(null);
5548
+ });
5549
+ }
5550
+ return x("/site/logout", { method: "post" }).catch(() => {}).then(() => {
5551
+ S(null);
5552
+ });
5553
+ }, [
5554
+ x,
5555
+ h,
5556
+ S
5557
+ ]), T = n(() => {
5558
+ b.current || a || t || (b.current = !0, y("loading"), C());
5110
5559
  }, [
5111
5560
  a,
5112
5561
  t,
5113
- x
5114
- ]), w = o(() => ({
5115
- user: h,
5116
- status: _,
5117
- ensure: C,
5118
- refresh: x,
5119
- signOut: S
5562
+ C
5563
+ ]), E = o(() => ({
5564
+ user: g,
5565
+ status: v,
5566
+ ensure: T,
5567
+ refresh: C,
5568
+ signOut: w
5120
5569
  }), [
5121
- h,
5122
- _,
5570
+ g,
5571
+ v,
5572
+ T,
5123
5573
  C,
5124
- x,
5125
- S
5574
+ w
5126
5575
  ]);
5127
5576
  return i(() => {
5128
5577
  a || typeof window > "u" || (window.webim = {
5129
5578
  ...window.webim,
5130
- user: h,
5131
- status: _,
5132
- requireUser: () => y.current || t ? Promise.resolve(h) : x(),
5133
- signOut: S
5579
+ user: g,
5580
+ status: v,
5581
+ loginUrl: h.loginPage || null,
5582
+ requireUser: () => b.current || t ? Promise.resolve(g) : C(),
5583
+ refresh: C,
5584
+ signOut: w
5134
5585
  }, window.dispatchEvent(new CustomEvent("webim:session", { detail: {
5135
- user: h,
5136
- status: _
5586
+ user: g,
5587
+ status: v
5137
5588
  } })));
5138
5589
  }, [
5139
5590
  a,
5140
- h,
5141
- _,
5591
+ g,
5592
+ v,
5142
5593
  t,
5143
- x,
5144
- S
5145
- ]), /* @__PURE__ */ u(Kn.Provider, {
5146
- value: w,
5594
+ h.loginPage,
5595
+ C,
5596
+ w
5597
+ ]), /* @__PURE__ */ u($n.Provider, {
5598
+ value: E,
5147
5599
  children: e
5148
5600
  });
5149
5601
  }
5150
- function Yn({ when: e, children: t }) {
5151
- let { status: n } = qn();
5602
+ function sr({ when: e, children: t }) {
5603
+ let { status: n } = ar();
5152
5604
  return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
5153
5605
  }
5154
5606
  //#endregion
5155
5607
  //#region ../ui/src/components/builder/apps/auth/views.jsx
5156
- 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 }) {
5157
- 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) => {
5608
+ function cr({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: i = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
5609
+ let { tenant: h, apiUrl: g, settings: _ } = r(Y), [v, y] = c("form"), [b, x] = c(""), [S, C] = c(!1), w = e === "register", T = f ? m || "form" : v, E = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", D = async (e) => {
5158
5610
  if (e.preventDefault(), f) return;
5159
5611
  let n = new FormData(e.currentTarget);
5160
5612
  C(!0), x("");
@@ -5202,20 +5654,20 @@ function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5202
5654
  children: [
5203
5655
  w ? /* @__PURE__ */ d("label", {
5204
5656
  style: {
5205
- ...jt,
5657
+ ...Mt,
5206
5658
  display: "grid",
5207
5659
  gap: 6
5208
5660
  },
5209
5661
  children: [a, /* @__PURE__ */ u("input", {
5210
5662
  name: "name",
5211
5663
  type: "text",
5212
- style: Mt,
5213
- ...Pt(f)
5664
+ style: Nt,
5665
+ ...Ft(f)
5214
5666
  })]
5215
5667
  }) : null,
5216
5668
  /* @__PURE__ */ d("label", {
5217
5669
  style: {
5218
- ...jt,
5670
+ ...Mt,
5219
5671
  display: "grid",
5220
5672
  gap: 6
5221
5673
  },
@@ -5223,13 +5675,13 @@ function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5223
5675
  name: "email",
5224
5676
  type: "email",
5225
5677
  required: !f,
5226
- style: Mt,
5227
- ...Pt(f)
5678
+ style: Nt,
5679
+ ...Ft(f)
5228
5680
  })]
5229
5681
  }),
5230
5682
  /* @__PURE__ */ d("label", {
5231
5683
  style: {
5232
- ...jt,
5684
+ ...Mt,
5233
5685
  display: "grid",
5234
5686
  gap: 6
5235
5687
  },
@@ -5237,8 +5689,8 @@ function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5237
5689
  name: "password",
5238
5690
  type: "password",
5239
5691
  required: !f,
5240
- style: Mt,
5241
- ...Pt(f)
5692
+ style: Nt,
5693
+ ...Ft(f)
5242
5694
  })]
5243
5695
  }),
5244
5696
  /* @__PURE__ */ u("button", {
@@ -5277,8 +5729,8 @@ function Xn({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
5277
5729
  ]
5278
5730
  });
5279
5731
  }
5280
- function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
5281
- let { user: c, status: l, signOut: f } = qn(), p = a ? s || "user" : l, m = a ? {
5732
+ function lr({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
5733
+ let { user: c, status: l, signOut: f } = ar(), p = a ? s || "user" : l, m = a ? {
5282
5734
  name: "Ada Lovelace",
5283
5735
  email: "ada@example.com"
5284
5736
  } : c;
@@ -5299,7 +5751,7 @@ function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5299
5751
  children: [
5300
5752
  /* @__PURE__ */ d("span", {
5301
5753
  style: {
5302
- ...jt,
5754
+ ...Mt,
5303
5755
  fontWeight: 600
5304
5756
  },
5305
5757
  children: [
@@ -5310,7 +5762,7 @@ function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5310
5762
  }),
5311
5763
  n && m?.email ? /* @__PURE__ */ u("span", {
5312
5764
  style: {
5313
- ...jt,
5765
+ ...Mt,
5314
5766
  opacity: .7
5315
5767
  },
5316
5768
  children: m.email
@@ -5326,7 +5778,7 @@ function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5326
5778
  fontSize: 14,
5327
5779
  cursor: a ? "default" : "pointer"
5328
5780
  },
5329
- ...Pt(a),
5781
+ ...Ft(a),
5330
5782
  children: t
5331
5783
  })
5332
5784
  ]
@@ -5343,40 +5795,40 @@ function Zn({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
5343
5795
  }
5344
5796
  //#endregion
5345
5797
  //#region ../ui/src/components/builder/apps/consent/manifest.js
5346
- var Qn = {
5798
+ var ur = {
5347
5799
  id: "consent",
5348
5800
  label: "Cookie consent",
5349
5801
  category: "Apps",
5350
5802
  keys: ["CookieConsent"],
5351
5803
  ssr: "shell",
5352
5804
  settings: []
5353
- }, $n = "webim.cookie_consent";
5354
- function er() {
5805
+ }, dr = "webim.cookie_consent";
5806
+ function fr() {
5355
5807
  try {
5356
- let e = window.localStorage.getItem($n), t = e ? JSON.parse(e) : null;
5808
+ let e = window.localStorage.getItem(dr), t = e ? JSON.parse(e) : null;
5357
5809
  return t?.choice === "accepted" || t?.choice === "declined" ? t.choice : "";
5358
5810
  } catch {
5359
5811
  return "";
5360
5812
  }
5361
5813
  }
5362
- function tr(e) {
5814
+ function pr(e) {
5363
5815
  try {
5364
5816
  document.querySelectorAll(".webim-page").forEach((t) => t.setAttribute("data-webim-consent", e));
5365
5817
  } catch {}
5366
5818
  }
5367
- function nr(e) {
5819
+ function mr(e) {
5368
5820
  try {
5369
- window.localStorage.setItem($n, JSON.stringify({
5821
+ window.localStorage.setItem(dr, JSON.stringify({
5370
5822
  choice: e,
5371
5823
  at: (/* @__PURE__ */ new Date()).toISOString()
5372
5824
  }));
5373
5825
  } catch {}
5374
- tr(e);
5826
+ pr(e);
5375
5827
  try {
5376
5828
  window.dispatchEvent(new CustomEvent("webim:consent", { detail: { choice: e } }));
5377
5829
  } catch {}
5378
5830
  }
5379
- var rr = {
5831
+ var hr = {
5380
5832
  bottom: {
5381
5833
  left: 0,
5382
5834
  right: 0,
@@ -5398,18 +5850,18 @@ var rr = {
5398
5850
  maxWidth: 400
5399
5851
  }
5400
5852
  };
5401
- function ir({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
5853
+ function gr({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLabel: a, linkHref: o, position: s, linked: f, style: p, nodeRef: m, inert: h }) {
5402
5854
  let [g, _] = c(!!h), [v, y] = c(null), b = (e) => {
5403
5855
  y(e), typeof m == "function" && m(e);
5404
5856
  };
5405
5857
  if (i(() => {
5406
5858
  if (h) return;
5407
- let e = er();
5408
- e ? tr(e) : _(!0);
5859
+ let e = fr();
5860
+ e ? pr(e) : _(!0);
5409
5861
  }, [h, v]), !g) return null;
5410
5862
  let x = (e) => () => {
5411
- h || (nr(e), _(!1));
5412
- }, S = rr[s] ?? rr.bottom, C = {
5863
+ h || (mr(e), _(!1));
5864
+ }, S = hr[s] ?? hr.bottom, C = {
5413
5865
  appearance: "none",
5414
5866
  font: "inherit",
5415
5867
  fontSize: 14,
@@ -5489,37 +5941,37 @@ function ir({ message: e, acceptLabel: t, rejectLabel: n, showReject: r, linkLab
5489
5941
  }
5490
5942
  //#endregion
5491
5943
  //#region ../ui/src/components/builder/apps/language/manifest.js
5492
- var ar = {
5944
+ var _r = {
5493
5945
  id: "language",
5494
5946
  label: "Language",
5495
5947
  category: "Apps",
5496
5948
  keys: ["SiteLanguagePicker"],
5497
5949
  ssr: "prefetch",
5498
5950
  settings: ["locales"]
5499
- }, or = {
5951
+ }, vr = {
5500
5952
  id: "search",
5501
5953
  label: "Search",
5502
5954
  category: "Apps",
5503
5955
  keys: ["SiteSearch"],
5504
5956
  ssr: "prefetch",
5505
5957
  settings: []
5506
- }, sr = 50, cr = 2e3;
5507
- function lr() {
5958
+ }, yr = 50, br = 2e3;
5959
+ function xr() {
5508
5960
  return typeof window > "u" ? "" : new URLSearchParams(window.location.search).get("q") ?? "";
5509
5961
  }
5510
- function ur(e, t) {
5962
+ function Sr(e, t) {
5511
5963
  let n = e?.data ?? {}, r = [];
5512
5964
  for (let e of Object.values(n)) {
5513
- let t = e == null ? "" : Z(e);
5514
- if (t && r.push(t), r.join(" ").length > cr) break;
5965
+ let t = e == null ? "" : Te(e);
5966
+ if (t && r.push(t), r.join(" ").length > br) break;
5515
5967
  }
5516
- return r.join(" ").slice(0, cr).toLocaleLowerCase(t || void 0);
5968
+ return r.join(" ").slice(0, br).toLocaleLowerCase(t || void 0);
5517
5969
  }
5518
- 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 }) {
5519
- 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";
5970
+ function Cr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButton: n = !0, live: a = !1, layout: o = "inline", includePages: l = !0, collections: f = [], limit: p = 10, emptyText: m = "Nothing found", hint: h = "", style: g, nodeRef: _, inert: v = !1, sample: y = !1 }) {
5971
+ let { tenant: b, apiUrl: x, locale: S } = r(Y), [C, w] = c(() => xr()), [T, E] = c(() => xr()), [D, O] = c(null), [k, j] = c(!1), M = s(null), N = o === "popup";
5520
5972
  i(() => {
5521
5973
  let e = () => {
5522
- let e = lr();
5974
+ let e = xr();
5523
5975
  w(e), E(e);
5524
5976
  };
5525
5977
  return window.addEventListener("popstate", e), window.addEventListener("webim:urlchange", e), () => {
@@ -5570,8 +6022,8 @@ function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
5570
6022
  });
5571
6023
  }
5572
6024
  else for (let t of e.rows) {
5573
- if (!ur(t, S).includes(P)) continue;
5574
- let n = t?.data ?? {}, r = Z(n.name) || "Untitled", i = Z(n.slug);
6025
+ if (!Sr(t, S).includes(P)) continue;
6026
+ let n = t?.data ?? {}, r = Te(n.name) || "Untitled", i = Te(n.slug);
5575
6027
  F.push({
5576
6028
  key: `entry:${t.id}`,
5577
6029
  title: r,
@@ -5579,7 +6031,7 @@ function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
5579
6031
  kind: "entry"
5580
6032
  });
5581
6033
  }
5582
- let I = F.slice(0, Math.min(Math.max(1, p), sr)), L = (e) => {
6034
+ let I = F.slice(0, Math.min(Math.max(1, p), yr)), L = (e) => {
5583
6035
  if (v) {
5584
6036
  e.preventDefault(), w(T), j(!0);
5585
6037
  return;
@@ -5661,7 +6113,7 @@ function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
5661
6113
  onChange: (e) => E(e.target.value),
5662
6114
  onFocus: () => P && j(!0),
5663
6115
  style: {
5664
- ...Mt,
6116
+ ...Nt,
5665
6117
  flexGrow: 1,
5666
6118
  minWidth: 0
5667
6119
  }
@@ -5719,21 +6171,21 @@ function dr({ placeholder: e = "Search…", buttonLabel: t = "Search", showButto
5719
6171
  }
5720
6172
  //#endregion
5721
6173
  //#region ../ui/src/components/builder/apps/language/views.jsx
5722
- function fr(e) {
6174
+ function wr(e) {
5723
6175
  let t = e?.locales, n = [typeof t?.default == "string" && t.default.trim() ? t.default.trim() : "", ...Array.isArray(t?.enabled) ? t.enabled : []].filter((e) => typeof e == "string" && e.trim());
5724
6176
  return [...new Set(n.map((e) => e.trim()))];
5725
6177
  }
5726
- var pr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
5727
- function mr(e, t) {
6178
+ var Tr = (e) => e && e.charAt(0).toUpperCase() + e.slice(1);
6179
+ function Er(e, t) {
5728
6180
  let n = String(e ?? "").toUpperCase();
5729
6181
  if (t === "code") return n;
5730
6182
  let r = "";
5731
6183
  try {
5732
- r = pr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
6184
+ r = Tr(new Intl.DisplayNames([e], { type: "language" }).of(e) ?? "");
5733
6185
  } catch {}
5734
6186
  return !r || r.toUpperCase() === n ? n : t === "both" ? `${n} — ${r}` : r;
5735
6187
  }
5736
- function hr(e, t) {
6188
+ function Dr(e, t) {
5737
6189
  let n = t ? "" : `?locale=${encodeURIComponent(e)}`;
5738
6190
  if (typeof window > "u") return n || "?";
5739
6191
  try {
@@ -5743,8 +6195,8 @@ function hr(e, t) {
5743
6195
  return n || "/";
5744
6196
  }
5745
6197
  }
5746
- function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
5747
- let c = r(q), l = fr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
6198
+ function Or({ variant: e, display: t, separator: n, label: i, style: a, nodeRef: o, inert: s }) {
6199
+ let c = r(Y), l = wr(c?.settings), f = l[0] ?? "", p = l.includes(c?.locale) ? c.locale : f, m = {
5748
6200
  display: "inline-flex",
5749
6201
  alignItems: "center",
5750
6202
  gap: 8,
@@ -5779,7 +6231,7 @@ function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
5779
6231
  style: { opacity: .4 },
5780
6232
  children: n ?? "·"
5781
6233
  }), /* @__PURE__ */ u("a", {
5782
- href: hr(e, e === f),
6234
+ href: Dr(e, e === f),
5783
6235
  hrefLang: e,
5784
6236
  "aria-current": e === p ? "true" : void 0,
5785
6237
  onClick: s ? (e) => e.preventDefault() : void 0,
@@ -5789,7 +6241,7 @@ function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
5789
6241
  textDecoration: "none",
5790
6242
  cursor: s ? "default" : "pointer"
5791
6243
  },
5792
- children: mr(e, t)
6244
+ children: Er(e, t)
5793
6245
  })]
5794
6246
  }, e))]
5795
6247
  }) : /* @__PURE__ */ d("div", {
@@ -5800,7 +6252,7 @@ function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
5800
6252
  value: p,
5801
6253
  onChange: s ? void 0 : (e) => {
5802
6254
  let t = e.target.value;
5803
- window.location.assign(hr(t, t === f));
6255
+ window.location.assign(Dr(t, t === f));
5804
6256
  },
5805
6257
  onKeyDown: s ? (e) => e.preventDefault() : void 0,
5806
6258
  style: {
@@ -5814,57 +6266,57 @@ function gr({ variant: e, display: t, separator: n, label: i, style: a, nodeRef:
5814
6266
  },
5815
6267
  children: l.map((e) => /* @__PURE__ */ u("option", {
5816
6268
  value: e,
5817
- children: mr(e, t)
6269
+ children: Er(e, t)
5818
6270
  }, e))
5819
6271
  })]
5820
6272
  });
5821
6273
  }
5822
6274
  //#endregion
5823
6275
  //#region ../ui/src/components/builder/apps/index.js
5824
- var _r = [
5825
- Gn,
5826
- ar,
6276
+ var kr = [
5827
6277
  Qn,
5828
- or
5829
- ], vr = {
5830
- SiteLoginForm: Xn,
5831
- SiteAccountMenu: Zn,
5832
- SiteLanguagePicker: gr,
5833
- CookieConsent: ir,
5834
- SiteSearch: dr
6278
+ _r,
6279
+ ur,
6280
+ vr
6281
+ ], Ar = {
6282
+ SiteLoginForm: cr,
6283
+ SiteAccountMenu: lr,
6284
+ SiteLanguagePicker: Or,
6285
+ CookieConsent: gr,
6286
+ SiteSearch: Cr
5835
6287
  };
5836
- new Set(_r.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
6288
+ new Set(kr.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
5837
6289
  //#endregion
5838
6290
  //#region ../ui/src/components/builder/plugins/runtime.js
5839
- var yr = /* @__PURE__ */ new Map();
5840
- function br(e) {
5841
- if (yr.has(e)) return yr.get(e);
6291
+ var jr = /* @__PURE__ */ new Map();
6292
+ function Mr(e) {
6293
+ if (jr.has(e)) return jr.get(e);
5842
6294
  let t = URL.createObjectURL(new Blob([e], { type: "text/javascript" })), n = import(
5843
6295
  /* @vite-ignore */
5844
6296
  /* webpackIgnore: true */
5845
6297
  t
5846
6298
  ).finally(() => URL.revokeObjectURL(t));
5847
- return yr.set(e, n), n;
6299
+ return jr.set(e, n), n;
5848
6300
  }
5849
- function xr(e) {
6301
+ function Nr(e) {
5850
6302
  let t = e && typeof e == "object" ? e.builder_plugins : null, n = t && typeof t == "object" ? t.plugins : null;
5851
6303
  return n && typeof n == "object" ? n : {};
5852
6304
  }
5853
6305
  //#endregion
5854
6306
  //#region ../ui/src/components/builder/plugins/view.jsx
5855
- async function Sr(e, t) {
5856
- let n = await br(e);
6307
+ async function Pr(e, t) {
6308
+ let n = await Mr(e);
5857
6309
  return (Array.isArray(n?.default?.blocks) ? n.default.blocks : []).find((e) => e?.id === t && typeof e.mount == "function") ?? null;
5858
6310
  }
5859
- var Cr = {
6311
+ var Fr = {
5860
6312
  padding: "10px 12px",
5861
6313
  border: "1px dashed rgba(148, 163, 184, 0.5)",
5862
6314
  borderRadius: 8,
5863
6315
  fontSize: 12,
5864
6316
  opacity: .6
5865
6317
  };
5866
- function wr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
5867
- let c = r(q), l = xr(c?.settings)[e], f = s(null), p = s(null), m = {
6318
+ function Ir({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
6319
+ let c = r(Y), l = Nr(c?.settings)[e], f = s(null), p = s(null), m = {
5868
6320
  tenant: c?.tenant ?? "",
5869
6321
  apiUrl: c?.apiUrl ?? "/api",
5870
6322
  locale: c?.locale ?? "",
@@ -5876,7 +6328,7 @@ function wr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
5876
6328
  let e = f.current;
5877
6329
  if (!l?.code || !e) return;
5878
6330
  let n = !0;
5879
- return Sr(l.code, t).then((e) => {
6331
+ return Pr(l.code, t).then((e) => {
5880
6332
  if (!(!n || !e || !f.current)) {
5881
6333
  p.current = e;
5882
6334
  try {
@@ -5906,7 +6358,7 @@ function wr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
5906
6358
  }) : /* @__PURE__ */ d("div", {
5907
6359
  ref: o,
5908
6360
  style: {
5909
- ...Cr,
6361
+ ...Fr,
5910
6362
  ...A(a)
5911
6363
  },
5912
6364
  children: [
@@ -5918,12 +6370,12 @@ function wr({ pluginId: e, blockId: t, props: n, style: a, nodeRef: o }) {
5918
6370
  }
5919
6371
  //#endregion
5920
6372
  //#region ../ui/src/components/builder/render.jsx
5921
- var Tr = {
5922
- ...Wn,
5923
- ...vr,
5924
- PluginBlock: wr
6373
+ var Lr = {
6374
+ ...Zn,
6375
+ ...Ar,
6376
+ PluginBlock: Ir
5925
6377
  };
5926
- function Er(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
6378
+ function Rr(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
5927
6379
  let o = n[t];
5928
6380
  if (!o || o.hidden) return null;
5929
6381
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -5931,11 +6383,11 @@ function Er(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
5931
6383
  let n = o.props?.componentId, s = r?.[n];
5932
6384
  if (!s?.template || i.has(n)) return null;
5933
6385
  let c = new Set(i).add(n);
5934
- return /* @__PURE__ */ u(e, { children: Er(s.template.rootId, s.template.nodes, r, c, a) }, t);
6386
+ return /* @__PURE__ */ u(e, { children: Rr(s.template.rootId, s.template.nodes, r, c, a) }, t);
5935
6387
  }
5936
- let l = Tr[s];
6388
+ let l = Lr[s];
5937
6389
  if (!l) return null;
5938
- 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, {
6390
+ let d = (o.nodes ?? []).map((e) => Rr(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Rr(t, n, r, i, a)])) : void 0, m = /* @__PURE__ */ u(l, {
5939
6391
  ...c,
5940
6392
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
5941
6393
  linked: p,
@@ -5944,16 +6396,16 @@ function Er(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
5944
6396
  },
5945
6397
  children: d.length ? d : void 0
5946
6398
  }, t);
5947
- return c.when && c.when !== "always" ? /* @__PURE__ */ u(Yn, {
6399
+ return c.when && c.when !== "always" ? /* @__PURE__ */ u(sr, {
5948
6400
  when: c.when,
5949
6401
  children: m
5950
6402
  }, t) : m;
5951
6403
  }
5952
6404
  //#endregion
5953
6405
  //#region ../ui/src/components/builder/PageRenderer.jsx
5954
- var Dr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Or = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(K(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
5955
- .webim-page[data-webim-mode="dark"] { ${Object.entries(K(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
5956
- 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 }) {
6406
+ var zr = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" "), Br = (e) => `.webim-page[data-webim-mode="light"] { ${Object.entries(ue(e.light)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }
6407
+ .webim-page[data-webim-mode="dark"] { ${Object.entries(ue(e.dark)).map(([e, t]) => `${e}: ${t} !important;`).join(" ")} }`;
6408
+ function Vr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, animations: c, tenant: l, apiUrl: f, datasets: p, locale: m, direction: h, settings: _, siteUser: v }) {
5957
6409
  let b = s?.js?.trim();
5958
6410
  if (i(() => {
5959
6411
  if (!b) return;
@@ -5962,28 +6414,28 @@ function kr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
5962
6414
  }, [b]), !e?.ROOT) return null;
5963
6415
  let x = {
5964
6416
  lang: m || void 0,
5965
- dir: be(h, m)
6417
+ dir: ye(h, m)
5966
6418
  }, S = ".webim-page, .webim-page *, .webim-page *::before, .webim-page *::after { box-sizing: border-box; }", C = {
5967
6419
  minHeight: "100%",
5968
6420
  display: "flex",
5969
6421
  flexDirection: "column"
5970
- }, 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 = ue(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !se[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
6422
+ }, w = Rr("ROOT", e, n), T = o(() => ({ render: (t, r) => Rr(t, e, n, void 0, { mapProps: r }) }), [e, n]), D = G(e, n), O = W(e, n), k = s?.css?.trim(), A = E(c), j = le(t), M = [j.font, j.headingFont].filter((e) => typeof e == "string" && e.trim() && e !== "inherit" && !q[e]), N = [.../* @__PURE__ */ new Set([...y(e, n), ...M])].map((e) => /* @__PURE__ */ u("link", {
5971
6423
  rel: "stylesheet",
5972
6424
  precedence: "default",
5973
6425
  href: g(e)
5974
- }, e)), P = Or(j);
5975
- return r === "auto" ? /* @__PURE__ */ u(q.Provider, {
6426
+ }, e)), P = Br(j);
6427
+ return r === "auto" ? /* @__PURE__ */ u(Y.Provider, {
5976
6428
  value: {
5977
6429
  tenant: l || "",
5978
6430
  apiUrl: f || "/api",
5979
6431
  locale: m || "",
5980
6432
  settings: _ ?? null
5981
6433
  },
5982
- children: /* @__PURE__ */ u(Jn, {
6434
+ children: /* @__PURE__ */ u(or, {
5983
6435
  initialUser: v,
5984
- children: /* @__PURE__ */ u(xe.Provider, {
6436
+ children: /* @__PURE__ */ u(be.Provider, {
5985
6437
  value: p ?? null,
5986
- children: /* @__PURE__ */ u(J.Provider, {
6438
+ children: /* @__PURE__ */ u(Z.Provider, {
5987
6439
  value: T,
5988
6440
  children: /* @__PURE__ */ d("div", {
5989
6441
  ...x,
@@ -5994,8 +6446,8 @@ function kr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
5994
6446
  ...a
5995
6447
  },
5996
6448
  children: [
5997
- /* @__PURE__ */ u("style", { children: `.webim-page { ${Dr(K(j.light))} }
5998
- @media (prefers-color-scheme: dark) { .webim-page { ${Dr(K(j.dark))} } }` }),
6449
+ /* @__PURE__ */ u("style", { children: `.webim-page { ${zr(ue(j.light))} }
6450
+ @media (prefers-color-scheme: dark) { .webim-page { ${zr(ue(j.dark))} } }` }),
5999
6451
  /* @__PURE__ */ u("style", { children: P }),
6000
6452
  N,
6001
6453
  /* @__PURE__ */ u("style", { children: S }),
@@ -6008,18 +6460,18 @@ function kr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
6008
6460
  })
6009
6461
  })
6010
6462
  })
6011
- }) : /* @__PURE__ */ u(q.Provider, {
6463
+ }) : /* @__PURE__ */ u(Y.Provider, {
6012
6464
  value: {
6013
6465
  tenant: l || "",
6014
6466
  apiUrl: f || "/api",
6015
6467
  locale: m || "",
6016
6468
  settings: _ ?? null
6017
6469
  },
6018
- children: /* @__PURE__ */ u(Jn, {
6470
+ children: /* @__PURE__ */ u(or, {
6019
6471
  initialUser: v,
6020
- children: /* @__PURE__ */ u(xe.Provider, {
6472
+ children: /* @__PURE__ */ u(be.Provider, {
6021
6473
  value: p ?? null,
6022
- children: /* @__PURE__ */ u(J.Provider, {
6474
+ children: /* @__PURE__ */ u(Z.Provider, {
6023
6475
  value: T,
6024
6476
  children: /* @__PURE__ */ d("div", {
6025
6477
  ...x,
@@ -6048,8 +6500,8 @@ function kr({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, cu
6048
6500
  }
6049
6501
  //#endregion
6050
6502
  //#region src/WebimContent.jsx
6051
- function Ar({ bundle: e, mode: t = "auto", style: n }) {
6052
- return e?.blocks?.ROOT ? /* @__PURE__ */ u(kr, {
6503
+ function Hr({ bundle: e, mode: t = "auto", style: n }) {
6504
+ return e?.blocks?.ROOT ? /* @__PURE__ */ u(Vr, {
6053
6505
  blocks: e.blocks,
6054
6506
  theme: e.theme,
6055
6507
  components: e.components,
@@ -6061,13 +6513,13 @@ function Ar({ bundle: e, mode: t = "auto", style: n }) {
6061
6513
  locale: e.locale,
6062
6514
  direction: e.direction,
6063
6515
  settings: e.settings,
6064
- mode: me(t, e.scheme),
6516
+ mode: pe(t, e.scheme),
6065
6517
  style: n
6066
6518
  }) : null;
6067
6519
  }
6068
6520
  //#endregion
6069
6521
  //#region src/WebimPage.jsx
6070
- 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 }) {
6522
+ function Ur({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mode: l = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
6071
6523
  let [g, _] = c({ status: "loading" }), v = s({
6072
6524
  onLoad: m,
6073
6525
  onError: h
@@ -6077,7 +6529,7 @@ function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
6077
6529
  onError: h
6078
6530
  }, i(() => {
6079
6531
  let i = !0;
6080
- return _({ status: "loading" }), _e({
6532
+ return _({ status: "loading" }), ge({
6081
6533
  apiUrl: e,
6082
6534
  tenant: t,
6083
6535
  slug: n,
@@ -6104,11 +6556,11 @@ function jr({ apiUrl: e, tenant: t, slug: n, locale: r, preview: a, token: o, mo
6104
6556
  r,
6105
6557
  a,
6106
6558
  o
6107
- ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Ar, {
6559
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Hr, {
6108
6560
  bundle: g.bundle,
6109
6561
  mode: l,
6110
6562
  style: d
6111
6563
  });
6112
6564
  }
6113
6565
  //#endregion
6114
- export { kr as PageRenderer, Ar as WebimContent, jr as WebimPage, _e as fetchPage, We as renderRichContent, pe as resolveTheme };
6566
+ export { Vr as PageRenderer, Hr as WebimContent, Ur as WebimPage, ge as fetchPage, We as renderRichContent, J as resolveTheme };