webim-adapter 0.8.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,36 +1,36 @@
1
- import { Fragment as e, createContext as t, useContext as n, useEffect as r, useId as i, useMemo as a, useRef as o, useState as s } from "react";
2
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
1
+ import { Fragment as e, createContext as t, useCallback as n, useContext as r, useEffect as i, useId as a, useMemo as o, useRef as s, useState as c } from "react";
2
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
3
3
  //#region ../ui/src/components/builder/styles.js
4
- var d = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), f = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, p = [
4
+ var f = /* @__PURE__ */ new Set(/* @__PURE__ */ "marginTop.marginRight.marginBottom.marginLeft.paddingTop.paddingRight.paddingBottom.paddingLeft.gap.rowGap.columnGap.flexBasis.fontSize.borderRadius.borderTopLeftRadius.borderTopRightRadius.borderBottomRightRadius.borderBottomLeftRadius.borderWidth.borderTopWidth.borderRightWidth.borderBottomWidth.borderLeftWidth.letterSpacing.textDecorationThickness.textUnderlineOffset.top.right.bottom.left".split(".")), p = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, m = [
5
5
  "borderWidth",
6
6
  "borderStyle",
7
7
  "borderColor",
8
8
  "borderRadius",
9
9
  "gap"
10
10
  ];
11
- function m(e) {
11
+ function h(e) {
12
12
  let t = {};
13
- for (let n of p) {
13
+ for (let n of m) {
14
14
  let r = e?.[n];
15
- r != null && r !== "" && (t[n] = d.has(n) ? f(r) : r);
15
+ r != null && r !== "" && (t[n] = f.has(n) ? p(r) : r);
16
16
  }
17
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || p.includes(n) || (t[n] = d.has(n) ? f(r) : r);
17
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || m.includes(n) || (t[n] = f.has(n) ? p(r) : r);
18
18
  let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
19
19
  delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
20
20
  let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
21
21
  delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
22
- let m = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${f(e.x ?? 0)} ${f(e.y ?? 0)} ${f(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
22
+ let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${p(e.x ?? 0)} ${p(e.y ?? 0)} ${p(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
23
23
  [
24
24
  s,
25
25
  c,
26
26
  l,
27
27
  u
28
- ].some((e) => e !== void 0) && m.push(`${f(s ?? 0)} ${f(c ?? 0)} ${f(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), m.length && (t.textShadow = m.join(", "));
29
- let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${f(e.x ?? 0)}, ${f(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${h(e.a ?? 0)})` : e.type === "skew" ? `skew(${h(e.x ?? 0)}, ${h(e.y ?? 0)})` : null, { transforms: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY: C } = t;
28
+ ].some((e) => e !== void 0) && d.push(`${p(s ?? 0)} ${p(c ?? 0)} ${p(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
29
+ let h = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, g = (e) => e.type === "move" ? `translate(${p(e.x ?? 0)}, ${p(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${h(e.a ?? 0)})` : e.type === "skew" ? `skew(${h(e.x ?? 0)}, ${h(e.y ?? 0)})` : null, { transforms: _, translateX: v, translateY: y, scale: b, rotate: x, skewX: S, skewY: C } = t;
30
30
  delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
31
31
  let w = (Array.isArray(_) ? _ : []).filter((e) => e && e.on !== !1).map(g).filter(Boolean);
32
- (v !== void 0 || y !== void 0) && w.push(`translate(${f(v ?? 0)}, ${f(y ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), x !== void 0 && w.push(`rotate(${h(x)})`), (S !== void 0 || C !== void 0) && w.push(`skew(${h(S ?? 0)}, ${h(C ?? 0)})`), w.length && (t.transform = w.join(" "));
33
- let T = (e) => `${e.inset ? "inset " : ""}${f(e.x ?? 0)} ${f(e.y ?? 0)} ${f(e.blur ?? 0)} ${f(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: E, boxShadowX: D, boxShadowY: O, boxShadowBlur: k, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
32
+ (v !== void 0 || y !== void 0) && w.push(`translate(${p(v ?? 0)}, ${p(y ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), x !== void 0 && w.push(`rotate(${h(x)})`), (S !== void 0 || C !== void 0) && w.push(`skew(${h(S ?? 0)}, ${h(C ?? 0)})`), w.length && (t.transform = w.join(" "));
33
+ let T = (e) => `${e.inset ? "inset " : ""}${p(e.x ?? 0)} ${p(e.y ?? 0)} ${p(e.blur ?? 0)} ${p(e.spread ?? 0)} ${e.color || "rgba(15, 23, 42, 0.2)"}`, { shadows: E, boxShadowX: D, boxShadowY: O, boxShadowBlur: k, boxShadowSpread: A, boxShadowColor: j, boxShadowInset: M } = t;
34
34
  delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
35
35
  let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
36
36
  [
@@ -48,76 +48,76 @@ function m(e) {
48
48
  color: j,
49
49
  inset: M
50
50
  })), N.length && (t.boxShadow = N.join(", "));
51
- let P = (e) => e.type === "blur" ? `blur(${f(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: ee, filterGrayscale: R, filterBrightness: z, filterContrast: te, filterSaturate: ne } = t;
51
+ let P = (e) => e.type === "blur" ? `blur(${p(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${h(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: ee, filterBrightness: z, filterContrast: B, filterSaturate: te } = t;
52
52
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
53
- let B = F(I);
54
- ee !== void 0 && B.push(`blur(${f(ee)})`), R !== void 0 && B.push(`grayscale(${R}%)`), z !== void 0 && B.push(`brightness(${z}%)`), te !== void 0 && B.push(`contrast(${te}%)`), ne !== void 0 && B.push(`saturate(${ne}%)`), B.length && (t.filter = B.join(" "));
55
- let re = F(L);
56
- re.length && (t.backdropFilter = re.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
- let { textStrokeWidth: ie, textStrokeColor: ae } = t;
58
- delete t.textStrokeWidth, delete t.textStrokeColor, (ie !== void 0 || ae !== void 0) && (t.WebkitTextStroke = `${f(ie ?? 1)} ${ae || "currentColor"}`);
59
- let { clipText: oe } = t;
60
- delete t.clipText, oe && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
- let { transitions: V, transitionDuration: H, transitionEasing: U, transitionProperty: se } = t, W = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
53
+ let V = F(I);
54
+ R !== void 0 && V.push(`blur(${p(R)})`), ee !== void 0 && V.push(`grayscale(${ee}%)`), z !== void 0 && V.push(`brightness(${z}%)`), B !== void 0 && V.push(`contrast(${B}%)`), te !== void 0 && V.push(`saturate(${te}%)`), V.length && (t.filter = V.join(" "));
55
+ let ne = F(L);
56
+ ne.length && (t.backdropFilter = ne.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
57
+ let { textStrokeWidth: re, textStrokeColor: ie } = t;
58
+ delete t.textStrokeWidth, delete t.textStrokeColor, (re !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${p(re ?? 1)} ${ie || "currentColor"}`);
59
+ let { clipText: ae } = t;
60
+ delete t.clipText, ae && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
61
+ let { transitions: oe, transitionDuration: H, transitionEasing: U, transitionProperty: W } = t, se = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
62
62
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
63
- let G = (Array.isArray(V) ? V : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${W(e.duration ?? 200)} ${e.easing || "ease"}`);
64
- if (H !== void 0 && G.push(`${se || "all"} ${W(H)} ${U || "ease"}`), G.length && (t.transition = G.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
63
+ let G = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${se(e.duration ?? 200)} ${e.easing || "ease"}`);
64
+ if (H !== void 0 && G.push(`${W || "all"} ${se(H)} ${U || "ease"}`), G.length && (t.transition = G.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
65
65
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
66
66
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
67
67
  }
68
68
  delete t.backgroundVideo;
69
- let { overlayColor: K, overlayOpacity: ce } = t;
70
- if (delete t.overlayColor, delete t.overlayOpacity, K) {
71
- let e = `color-mix(in srgb, ${K} ${ce ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
69
+ let { overlayColor: ce, overlayOpacity: K } = t;
70
+ if (delete t.overlayColor, delete t.overlayOpacity, ce) {
71
+ let e = `color-mix(in srgb, ${ce} ${K ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
72
72
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
73
73
  }
74
74
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
75
- let { backgroundLayers: q } = t;
75
+ let { backgroundLayers: le } = t;
76
76
  delete t.backgroundLayers;
77
- let J = (Array.isArray(q) ? q : []).filter((e) => e && e.on !== !1);
78
- if (J.length) {
77
+ let q = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
78
+ if (q.length) {
79
79
  let e = [], n = [], r = [], i = [], a = [];
80
- for (let t of J) 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");
80
+ for (let t of q) 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");
81
81
  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");
82
82
  else {
83
83
  if (!t.src) continue;
84
- e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${f(t.w ?? "auto")} ${f(t.h ?? "auto")}` : t.size || "cover"), r.push(`${f(t.posX ?? 0)} ${f(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
84
+ e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${p(t.w ?? "auto")} ${p(t.h ?? "auto")}` : t.size || "cover"), r.push(`${p(t.posX ?? 0)} ${p(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
85
85
  }
86
86
  e.length && (t.backgroundImage && (e.push(t.backgroundImage), n.push(t.backgroundSize || "cover"), r.push(t.backgroundPosition || "center"), i.push(t.backgroundRepeat || "no-repeat"), a.push("scroll")), t.backgroundImage = e.join(", "), t.backgroundSize = n.join(", "), t.backgroundPosition = r.join(", "), t.backgroundRepeat = i.join(", "), t.backgroundAttachment = a.join(", "));
87
87
  }
88
88
  return t;
89
89
  }
90
- var h = {
90
+ var g = {
91
91
  hover: ":hover",
92
92
  pressed: ":active",
93
93
  focused: ":focus"
94
- }, g = /* @__PURE__ */ new Set([
94
+ }, _ = /* @__PURE__ */ new Set([
95
95
  "style",
96
96
  "class",
97
97
  "id",
98
98
  "data-wb",
99
99
  "data-wb-class",
100
100
  "data-slot"
101
- ]), _ = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !g.has(e.toLowerCase());
102
- function v(e, t, n = []) {
101
+ ]), v = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !_.has(e.toLowerCase());
102
+ function y(e, t, n = []) {
103
103
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
104
104
  for (let t of n) e.removeAttribute(t);
105
105
  let r = [];
106
106
  for (let n of t.attributes ?? []) {
107
107
  let t = String(n?.name ?? "").trim();
108
- _(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
108
+ v(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
109
109
  }
110
110
  return r;
111
111
  }
112
- var y = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
113
- function b(e, t, n, r = !1) {
114
- let i = Object.entries(m(t)).map(([e, t]) => `${y(e)}: ${t} !important;`).join(" ");
112
+ var b = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
113
+ function x(e, t, n, r = !1) {
114
+ let i = Object.entries(h(t)).map(([e, t]) => `${b(e)}: ${t} !important;`).join(" ");
115
115
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
116
116
  }
117
- function x(e, t, n) {
118
- return Object.entries(h).map(([r, i]) => b(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
117
+ function S(e, t, n) {
118
+ return Object.entries(g).map(([r, i]) => x(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
119
119
  }
120
- var S = [
120
+ var C = [
121
121
  {
122
122
  key: "tablet",
123
123
  max: 991
@@ -130,17 +130,17 @@ var S = [
130
130
  key: "mobile",
131
131
  max: 478
132
132
  }
133
- ], C = (e) => Object.entries(m(e)).map(([e, t]) => `${y(e)}: ${t} !important;`).join(" ");
134
- function w(e, t) {
135
- return S.map(({ key: n, max: r }) => {
136
- let i = t?.[n] ? C(t[n]) : "";
133
+ ], w = (e) => Object.entries(h(e)).map(([e, t]) => `${b(e)}: ${t} !important;`).join(" ");
134
+ function T(e, t) {
135
+ return C.map(({ key: n, max: r }) => {
136
+ let i = t?.[n] ? w(t[n]) : "";
137
137
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
138
138
  }).filter(Boolean).join("\n");
139
139
  }
140
- function T(e, t) {
140
+ function E(e, t) {
141
141
  let n = [], r = (e) => {
142
142
  for (let [t, r] of Object.entries(e || {})) {
143
- let e = w(t, r.props);
143
+ let e = T(t, r.props);
144
144
  e && n.push(e);
145
145
  }
146
146
  };
@@ -148,10 +148,10 @@ function T(e, t) {
148
148
  for (let e of Object.values(t || {})) r(e.template?.nodes);
149
149
  return n.join("\n");
150
150
  }
151
- function E(e, t) {
151
+ function D(e, t) {
152
152
  let n = [], r = (e) => {
153
153
  for (let [t, r] of Object.entries(e || {})) {
154
- let e = x(t, r.props);
154
+ let e = S(t, r.props);
155
155
  e && n.push(e);
156
156
  }
157
157
  };
@@ -159,7 +159,7 @@ function E(e, t) {
159
159
  for (let e of Object.values(t || {})) r(e.template?.nodes);
160
160
  return n.join("\n");
161
161
  }
162
- var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", O = {
162
+ var O = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", k = {
163
163
  light: {
164
164
  background: "#ffffff",
165
165
  text: "#111827",
@@ -196,23 +196,23 @@ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
196
196
  contrastText: "#052e2b"
197
197
  }
198
198
  }
199
- }, k = {
199
+ }, A = {
200
200
  font: "system",
201
201
  headingFont: "inherit",
202
- light: O.light,
203
- dark: O.dark
204
- }, A = {
202
+ light: k.light,
203
+ dark: k.dark
204
+ }, j = {
205
205
  system: {
206
206
  label: "System",
207
- value: D
207
+ value: O
208
208
  },
209
209
  inter: {
210
210
  label: "Inter",
211
- value: `"Inter", ${D}`
211
+ value: `"Inter", ${O}`
212
212
  },
213
213
  outfit: {
214
214
  label: "Outfit",
215
- value: `"Outfit", ${D}`
215
+ value: `"Outfit", ${O}`
216
216
  },
217
217
  serif: {
218
218
  label: "Serif",
@@ -222,7 +222,7 @@ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
222
222
  label: "Mono",
223
223
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
224
224
  }
225
- }, j = (e, t) => A[e]?.value ?? t, M = (e, ...t) => {
225
+ }, M = (e, t) => j[e]?.value ?? t, N = (e, ...t) => {
226
226
  let n = Object.assign({}, e, ...t);
227
227
  return n.primary = {
228
228
  ...e.primary,
@@ -238,16 +238,16 @@ var D = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
238
238
  }), {})
239
239
  }, n;
240
240
  };
241
- function N(e) {
241
+ function P(e) {
242
242
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
243
243
  return {
244
- font: r ?? k.font,
245
- headingFont: i ?? k.headingFont,
246
- light: M(O.light, a, t),
247
- dark: M(O.dark, n)
244
+ font: r ?? A.font,
245
+ headingFont: i ?? A.headingFont,
246
+ light: N(k.light, a, t),
247
+ dark: N(k.dark, n)
248
248
  };
249
249
  }
250
- function P(e) {
250
+ function F(e) {
251
251
  return {
252
252
  "--page-bg": e.background,
253
253
  "--page-text": e.text,
@@ -263,23 +263,23 @@ function P(e) {
263
263
  "--page-secondary-contrast": e.secondary.contrastText
264
264
  };
265
265
  }
266
- function F(e) {
267
- let t = N(e);
266
+ function I(e) {
267
+ let t = P(e);
268
268
  return {
269
269
  backgroundColor: "var(--page-bg)",
270
270
  color: "var(--page-text)",
271
- fontFamily: j(t.font, D),
272
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : j(t.headingFont, "inherit")
271
+ fontFamily: M(t.font, O),
272
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : M(t.headingFont, "inherit")
273
273
  };
274
274
  }
275
- function I(e, t = "light") {
276
- let n = N(e);
275
+ function L(e, t = "light") {
276
+ let n = P(e);
277
277
  return {
278
- ...F(e),
279
- ...P(n[t] ?? n.light)
278
+ ...I(e),
279
+ ...F(n[t] ?? n.light)
280
280
  };
281
281
  }
282
- function L(e, t) {
282
+ function R(e, t) {
283
283
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
284
284
  }
285
285
  //#endregion
@@ -294,7 +294,7 @@ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
294
294
  title: e.title,
295
295
  slug: e.slug,
296
296
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
297
- theme: L(o, a.builder_themes?.themes),
297
+ theme: R(o, a.builder_themes?.themes),
298
298
  components: a.builder_components?.components ?? {},
299
299
  custom: o.custom,
300
300
  seo: o.seo,
@@ -302,23 +302,24 @@ function ee({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
302
302
  locale: i || a.locales?.default,
303
303
  locales: a.locales,
304
304
  tenant: n ?? "",
305
- apiUrl: r ?? ""
305
+ apiUrl: r ?? "",
306
+ settings: a
306
307
  };
307
308
  }
308
309
  //#endregion
309
310
  //#region src/fetchPage.js
310
- var R = async (e) => {
311
+ var z = async (e) => {
311
312
  let t = await e.json().catch(() => null);
312
313
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
313
314
  return t?.payload ?? t;
314
315
  };
315
- async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
316
+ async function B({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
316
317
  if (!e) throw Error("fetchPage: apiUrl is required");
317
318
  if (!n) throw Error("fetchPage: slug is required");
318
319
  let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
319
320
  ...t ? { "x-tenant": t } : {},
320
321
  ...a ? { authorization: `Bearer ${a}` } : {}
321
- }, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(R), s(`${c}/settings/public`, { headers: l }).then(R)]), f = ee({
322
+ }, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(z), s(`${c}/settings/public`, { headers: l }).then(z)]), f = ee({
322
323
  page: u,
323
324
  settings: d,
324
325
  tenant: t,
@@ -326,7 +327,7 @@ async function z({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
326
327
  locale: r
327
328
  }), p = [...new Set(Object.values(f.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" || e?.type?.resolvedName === "OrgChartBlock" ? e.props?.source : null).filter(Boolean))];
328
329
  if (p.length) {
329
- let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(R).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
330
+ let e = (e) => e.startsWith("api:") ? `${c}/data/${encodeURIComponent(e.slice(4))}` : `${c}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(p.map((t) => s(e(t), { headers: l }).then(z).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
330
331
  f.datasets = Object.fromEntries(t);
331
332
  }
332
333
  return f;
@@ -440,7 +441,7 @@ new Map([
440
441
  function te(e) {
441
442
  return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
442
443
  }
443
- var ne = (e) => te([e]), B = (e) => {
444
+ var V = (e) => te([e]), ne = (e) => {
444
445
  let t = typeof e == "string" && e.match(/^"([^"]+)"/);
445
446
  return t ? t[1] : null;
446
447
  };
@@ -452,7 +453,7 @@ function re(e, t) {
452
453
  "pressed",
453
454
  "focused"
454
455
  ]) {
455
- let r = B(t.props?.[e]?.fontFamily);
456
+ let r = ne(t.props?.[e]?.fontFamily);
456
457
  r && n.add(r);
457
458
  }
458
459
  };
@@ -473,15 +474,16 @@ var ie = /* @__PURE__ */ new Set([
473
474
  "yi",
474
475
  "dv",
475
476
  "ckb"
476
- ]), ae = (e) => ie.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", oe = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ae(t) : void 0, V = t({
477
+ ]), ae = (e) => ie.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", oe = (e, t) => e === "ltr" || e === "rtl" ? e : t ? ae(t) : void 0, H = t({
477
478
  tenant: "",
478
479
  apiUrl: "/api",
479
- locale: ""
480
- }), H = t(null), U = t(null), se = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
481
- function W(e, t) {
480
+ locale: "",
481
+ settings: null
482
+ }), U = t(null), W = t(null), se = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
483
+ function G(e, t) {
482
484
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
483
485
  }
484
- var G = (e) => {
486
+ var ce = (e) => {
485
487
  let t = [];
486
488
  for (let [n, r] of Object.entries(e ?? {})) {
487
489
  if (!/^[\w-]+$/.test(n)) continue;
@@ -494,10 +496,10 @@ var G = (e) => {
494
496
  function K(e) {
495
497
  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 ?? "") : 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(" ") : "";
496
498
  }
497
- function ce(e, t) {
498
- let n = t?.data ?? {}, r = G(n);
499
+ function le(e, t) {
500
+ let n = t?.data ?? {}, r = ce(n);
499
501
  if (!r.length) return e;
500
- let i = RegExp(`:(${r.map(se).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(W(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
502
+ let i = RegExp(`:(${r.map(se).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(G(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
501
503
  return a(e);
502
504
  }
503
505
  var q = {
@@ -505,22 +507,22 @@ var q = {
505
507
  fontWeight: 700,
506
508
  lineHeight: 1.2,
507
509
  fontFamily: "var(--page-heading-font, inherit)"
508
- }, J = { margin: 0 }, Y = {
510
+ }, ue = { margin: 0 }, J = {
509
511
  display: "inline-block",
510
512
  textDecoration: "none",
511
513
  cursor: "pointer",
512
514
  backgroundColor: "var(--page-accent, #111827)",
513
515
  color: "var(--page-accent-text, #ffffff)"
514
- }, le = {
516
+ }, de = {
515
517
  flexGrow: 1,
516
518
  display: "flex",
517
519
  flexDirection: "column",
518
520
  position: "relative"
519
- }, ue = {
521
+ }, fe = {
520
522
  display: "flex",
521
523
  flexDirection: "column"
522
524
  };
523
- function de({ style: e }) {
525
+ function pe({ style: e }) {
524
526
  let t = e?.backgroundVideo;
525
527
  if (!t) return null;
526
528
  let n = {
@@ -531,7 +533,7 @@ function de({ style: e }) {
531
533
  zIndex: -1,
532
534
  pointerEvents: "none"
533
535
  }, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
534
- return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("video", {
536
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("video", {
535
537
  src: t,
536
538
  autoPlay: !0,
537
539
  muted: !0,
@@ -541,73 +543,73 @@ function de({ style: e }) {
541
543
  ...n,
542
544
  objectFit: "cover"
543
545
  }
544
- }), r && /* @__PURE__ */ l("div", { style: {
546
+ }), r && /* @__PURE__ */ u("div", { style: {
545
547
  ...n,
546
548
  background: r
547
549
  } })] });
548
550
  }
549
- var fe = (e, t) => e?.backgroundVideo ? {
551
+ var me = (e, t) => e?.backgroundVideo ? {
550
552
  position: "relative",
551
553
  ...t,
552
- ...m(e)
554
+ ...h(e)
553
555
  } : {
554
556
  ...t,
555
- ...m(e)
557
+ ...h(e)
556
558
  };
557
- function pe({ style: e, nodeRef: t, children: n }) {
558
- return /* @__PURE__ */ u("div", {
559
+ function he({ style: e, nodeRef: t, children: n }) {
560
+ return /* @__PURE__ */ d("div", {
559
561
  ref: t,
560
562
  style: {
561
- ...le,
562
- ...m(e)
563
+ ...de,
564
+ ...h(e)
563
565
  },
564
- children: [/* @__PURE__ */ l(de, { style: e }), n]
566
+ children: [/* @__PURE__ */ u(pe, { style: e }), n]
565
567
  });
566
568
  }
567
- function me({ style: e, nodeRef: t, children: n }) {
568
- return /* @__PURE__ */ u("section", {
569
+ function ge({ style: e, nodeRef: t, children: n }) {
570
+ return /* @__PURE__ */ d("section", {
569
571
  ref: t,
570
- style: fe(e, ue),
571
- children: [/* @__PURE__ */ l(de, { style: e }), n]
572
+ style: me(e, fe),
573
+ children: [/* @__PURE__ */ u(pe, { style: e }), n]
572
574
  });
573
575
  }
574
- function he({ style: e, freeLayout: t, nodeRef: n, children: r }) {
576
+ function _e({ style: e, freeLayout: t, nodeRef: n, children: r }) {
575
577
  let i = t ? {
576
578
  position: "relative",
577
579
  minHeight: 240
578
580
  } : null;
579
- return /* @__PURE__ */ u("div", {
581
+ return /* @__PURE__ */ d("div", {
580
582
  ref: n,
581
583
  style: i ? {
582
584
  ...i,
583
- ...fe(e)
584
- } : fe(e),
585
- children: [/* @__PURE__ */ l(de, { style: e }), r]
585
+ ...me(e)
586
+ } : me(e),
587
+ children: [/* @__PURE__ */ u(pe, { style: e }), r]
586
588
  });
587
589
  }
588
- function ge({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
589
- return /* @__PURE__ */ l(n, {
590
+ function ve({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
591
+ return /* @__PURE__ */ u(n, {
590
592
  ref: a,
591
593
  style: {
592
594
  ...q,
593
- ...m(r)
595
+ ...h(r)
594
596
  },
595
- children: X(t, e, i)
597
+ children: Y(t, e, i)
596
598
  });
597
599
  }
598
- var _e = {
599
- fontFamily: A.mono.value,
600
+ var ye = {
601
+ fontFamily: j.mono.value,
600
602
  background: "rgba(148, 163, 184, 0.18)",
601
603
  padding: "1px 5px",
602
604
  borderRadius: 4,
603
605
  fontSize: "0.9em"
604
606
  };
605
- function ve(e, t = [], n, r) {
607
+ function be(e, t = [], n, r) {
606
608
  let i = e;
607
- return t.includes("sup") ? i = /* @__PURE__ */ l("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ l("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ l("code", {
608
- style: _e,
609
+ return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
610
+ style: ye,
609
611
  children: i
610
- })), t.includes("strike") && (i = /* @__PURE__ */ l("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ l("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ l("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ l("strong", { children: i })), n && (i = /* @__PURE__ */ l("a", {
612
+ })), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n && (i = /* @__PURE__ */ u("a", {
611
613
  href: n,
612
614
  target: r || void 0,
613
615
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
@@ -615,36 +617,36 @@ function ve(e, t = [], n, r) {
615
617
  children: i
616
618
  })), i;
617
619
  }
618
- function X(t, n, r) {
620
+ function Y(t, n, r) {
619
621
  return t?.length ? t.map((t, n) => {
620
- if (t.slot) return /* @__PURE__ */ l(e, { children: r?.[t.slot] ?? null }, n);
621
- if (t.parts) return /* @__PURE__ */ l(e, { children: X(t.parts, "", r) }, n);
622
+ if (t.slot) return /* @__PURE__ */ u(e, { children: r?.[t.slot] ?? null }, n);
623
+ if (t.parts) return /* @__PURE__ */ u(e, { children: Y(t.parts, "", r) }, n);
622
624
  let i = t.text;
623
- return t.sup ? i = /* @__PURE__ */ l("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ l("sub", { children: i })), t.code && (i = /* @__PURE__ */ l("code", {
624
- style: _e,
625
+ return t.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : t.sub && (i = /* @__PURE__ */ u("sub", { children: i })), t.code && (i = /* @__PURE__ */ u("code", {
626
+ style: ye,
625
627
  children: i
626
- })), t.strike && (i = /* @__PURE__ */ l("s", { children: i })), t.underline && (i = /* @__PURE__ */ l("u", { children: i })), t.italic && (i = /* @__PURE__ */ l("em", { children: i })), t.bold && (i = /* @__PURE__ */ l("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ l("span", {
628
+ })), t.strike && (i = /* @__PURE__ */ u("s", { children: i })), t.underline && (i = /* @__PURE__ */ u("u", { children: i })), t.italic && (i = /* @__PURE__ */ u("em", { children: i })), t.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (t.color || t.background) && (i = /* @__PURE__ */ u("span", {
627
629
  style: {
628
630
  ...t.color && { color: t.color },
629
631
  ...t.background && { backgroundColor: t.background }
630
632
  },
631
633
  children: i
632
- })), t.href && (i = /* @__PURE__ */ l("a", {
634
+ })), t.href && (i = /* @__PURE__ */ u("a", {
633
635
  href: t.href,
634
636
  target: t.target || void 0,
635
637
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
636
638
  style: { color: t.color ?? "inherit" },
637
639
  children: i
638
- })), /* @__PURE__ */ l(e, { children: i }, n);
640
+ })), /* @__PURE__ */ u(e, { children: i }, n);
639
641
  }) : n;
640
642
  }
641
- function ye({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
642
- return /* @__PURE__ */ l("span", {
643
- style: m(a),
644
- children: e?.length ? X(e, t) : ve(t, n, r, i)
643
+ function xe({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
644
+ return /* @__PURE__ */ u("span", {
645
+ style: h(a),
646
+ children: e?.length ? Y(e, t) : be(t, n, r, i)
645
647
  });
646
648
  }
647
- var be = {
649
+ var Se = {
648
650
  h1: 40,
649
651
  h2: 32,
650
652
  h3: 26,
@@ -652,7 +654,7 @@ var be = {
652
654
  h5: 19,
653
655
  h6: 16
654
656
  };
655
- function xe({ align: e = "center", width: t, wrap: n } = {}) {
657
+ function Ce({ align: e = "center", width: t, wrap: n } = {}) {
656
658
  let r = t ? `${t}%` : void 0;
657
659
  if (e === "full") return { width: "100%" };
658
660
  let i = e === "left" || e === "right";
@@ -686,8 +688,8 @@ function xe({ align: e = "center", width: t, wrap: n } = {}) {
686
688
  marginRight: "auto"
687
689
  };
688
690
  }
689
- function Se(e = [], t, n) {
690
- let r = n ?? ((e, n) => X(e, n, t));
691
+ function we(e = [], t, n) {
692
+ let r = n ?? ((e, n) => Y(e, n, t));
691
693
  return e.map((t, n) => {
692
694
  let i = {
693
695
  marginTop: 0,
@@ -695,7 +697,7 @@ function Se(e = [], t, n) {
695
697
  };
696
698
  if (t.type === "image") {
697
699
  if (!t.src) return null;
698
- let e = /* @__PURE__ */ l("img", {
700
+ let e = /* @__PURE__ */ u("img", {
699
701
  src: t.src,
700
702
  alt: t.alt || "",
701
703
  style: {
@@ -704,20 +706,20 @@ function Se(e = [], t, n) {
704
706
  borderRadius: 6
705
707
  }
706
708
  });
707
- return /* @__PURE__ */ u("figure", {
709
+ return /* @__PURE__ */ d("figure", {
708
710
  style: {
709
711
  marginLeft: 0,
710
712
  marginRight: 0,
711
713
  ...i,
712
- ...xe(t)
714
+ ...Ce(t)
713
715
  },
714
- children: [t.href ? /* @__PURE__ */ l("a", {
716
+ children: [t.href ? /* @__PURE__ */ u("a", {
715
717
  href: t.href,
716
718
  target: t.target || void 0,
717
719
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
718
720
  style: { display: "block" },
719
721
  children: e
720
- }) : e, t.caption && /* @__PURE__ */ l("figcaption", {
722
+ }) : e, t.caption && /* @__PURE__ */ u("figcaption", {
721
723
  style: {
722
724
  fontSize: 13,
723
725
  opacity: .65,
@@ -728,16 +730,16 @@ function Se(e = [], t, n) {
728
730
  })]
729
731
  }, n);
730
732
  }
731
- if (t.type === "video") return Ne(t.url) ? /* @__PURE__ */ l("div", {
733
+ if (t.type === "video") return Fe(t.url) ? /* @__PURE__ */ u("div", {
732
734
  style: {
733
735
  ...i,
734
- ...xe({
736
+ ...Ce({
735
737
  align: t.align,
736
738
  wrap: t.wrap,
737
739
  width: t.width ?? 100
738
740
  })
739
741
  },
740
- children: /* @__PURE__ */ l(Pe, {
742
+ children: /* @__PURE__ */ u(Ie, {
741
743
  url: t.url,
742
744
  autoplay: t.autoplay,
743
745
  muted: t.muted,
@@ -746,146 +748,146 @@ function Se(e = [], t, n) {
746
748
  start: t.start
747
749
  })
748
750
  }, n) : null;
749
- if (t.type === "divider") return /* @__PURE__ */ l("hr", { style: {
751
+ if (t.type === "divider") return /* @__PURE__ */ u("hr", { style: {
750
752
  ...i,
751
753
  border: 0,
752
754
  borderTop: "1px solid rgba(148, 163, 184, 0.4)"
753
755
  } }, n);
754
756
  if (t.type === "ul" || t.type === "ol") {
755
757
  let e = t.type;
756
- return /* @__PURE__ */ l(e, {
758
+ return /* @__PURE__ */ u(e, {
757
759
  style: {
758
760
  ...i,
759
761
  paddingLeft: 24
760
762
  },
761
- children: (t.items ?? []).map((e, t) => /* @__PURE__ */ l("li", {
763
+ children: (t.items ?? []).map((e, t) => /* @__PURE__ */ u("li", {
762
764
  style: { marginBottom: 4 },
763
765
  children: r(e.parts, e.text)
764
766
  }, t))
765
767
  }, n);
766
768
  }
767
- if (t.type === "quote") return /* @__PURE__ */ l("blockquote", {
769
+ if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
768
770
  style: {
769
- ...we,
771
+ ...Ee,
770
772
  ...i
771
773
  },
772
774
  children: r(t.parts, t.text)
773
775
  }, n);
774
- if (be[t.type]) {
776
+ if (Se[t.type]) {
775
777
  let e = t.type;
776
- return /* @__PURE__ */ l(e, {
778
+ return /* @__PURE__ */ u(e, {
777
779
  style: {
778
780
  ...q,
779
- fontSize: be[t.type],
781
+ fontSize: Se[t.type],
780
782
  ...i
781
783
  },
782
784
  children: r(t.parts, t.text)
783
785
  }, n);
784
786
  }
785
- return /* @__PURE__ */ l("p", {
787
+ return /* @__PURE__ */ u("p", {
786
788
  style: {
787
- ...J,
789
+ ...ue,
788
790
  ...i
789
791
  },
790
792
  children: r(t.parts, t.text)
791
793
  }, n);
792
794
  });
793
795
  }
794
- function Ce({ content: e, style: t, linked: n, nodeRef: r }) {
795
- return /* @__PURE__ */ l("div", {
796
+ function Te({ content: e, style: t, linked: n, nodeRef: r }) {
797
+ return /* @__PURE__ */ u("div", {
796
798
  ref: r,
797
799
  style: {
798
800
  display: "flow-root",
799
- ...m(t)
801
+ ...h(t)
800
802
  },
801
- children: Se(e, n)
803
+ children: we(e, n)
802
804
  });
803
805
  }
804
- var we = {
806
+ var Ee = {
805
807
  margin: 0,
806
808
  padding: "8px 0 8px 20px",
807
809
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
808
810
  };
809
- function Te({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
810
- return /* @__PURE__ */ l("blockquote", {
811
+ function De({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
812
+ return /* @__PURE__ */ u("blockquote", {
811
813
  ref: i,
812
814
  style: {
813
- ...we,
814
- ...m(n)
815
+ ...Ee,
816
+ ...h(n)
815
817
  },
816
- children: X(t, e, r)
818
+ children: Y(t, e, r)
817
819
  });
818
820
  }
819
- function Ee({ ordered: e, items: t = [], style: n, nodeRef: r }) {
820
- return /* @__PURE__ */ l(e ? "ol" : "ul", {
821
+ function Oe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
822
+ return /* @__PURE__ */ u(e ? "ol" : "ul", {
821
823
  ref: r,
822
824
  style: {
823
825
  margin: 0,
824
826
  paddingLeft: 24,
825
- ...m(n)
827
+ ...h(n)
826
828
  },
827
- children: t.map((e, t) => /* @__PURE__ */ l("li", {
829
+ children: t.map((e, t) => /* @__PURE__ */ u("li", {
828
830
  style: { marginBottom: 4 },
829
- children: X(e.parts, e.text)
831
+ children: Y(e.parts, e.text)
830
832
  }, t))
831
833
  });
832
834
  }
833
- function De({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
834
- return /* @__PURE__ */ l("p", {
835
+ function ke({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
836
+ return /* @__PURE__ */ u("p", {
835
837
  ref: i,
836
838
  style: {
837
- ...J,
838
- ...m(n)
839
+ ...ue,
840
+ ...h(n)
839
841
  },
840
- children: X(t, e, r)
842
+ children: Y(t, e, r)
841
843
  });
842
844
  }
843
- var Oe = {
845
+ var Ae = {
844
846
  color: "var(--page-accent, inherit)",
845
847
  textDecoration: "underline",
846
848
  textUnderlineOffset: 3,
847
849
  cursor: "pointer"
848
850
  };
849
- function ke({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
850
- return /* @__PURE__ */ l("a", {
851
+ function je({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
852
+ return /* @__PURE__ */ u("a", {
851
853
  ref: o,
852
854
  href: n || "#",
853
855
  target: r || void 0,
854
856
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
855
857
  style: {
856
- ...Oe,
857
- ...m(i)
858
+ ...Ae,
859
+ ...h(i)
858
860
  },
859
- children: X(t, e, a)
861
+ children: Y(t, e, a)
860
862
  });
861
863
  }
862
- function Ae({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
863
- return /* @__PURE__ */ l("a", {
864
+ function Me({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
865
+ return /* @__PURE__ */ u("a", {
864
866
  ref: o,
865
867
  href: n || "#",
866
868
  target: r || void 0,
867
869
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
868
870
  style: {
869
- ...Y,
870
- ...m(i)
871
+ ...J,
872
+ ...h(i)
871
873
  },
872
- children: X(t, e, a)
874
+ children: Y(t, e, a)
873
875
  });
874
876
  }
875
- function je({ src: e, alt: t, style: n, nodeRef: r }) {
876
- return e ? /* @__PURE__ */ l("img", {
877
+ function Ne({ src: e, alt: t, style: n, nodeRef: r }) {
878
+ return e ? /* @__PURE__ */ u("img", {
877
879
  ref: r,
878
880
  src: e,
879
881
  alt: t || "",
880
882
  style: {
881
883
  display: "block",
882
884
  maxWidth: "100%",
883
- ...m(n)
885
+ ...h(n)
884
886
  }
885
887
  }) : null;
886
888
  }
887
- function Me({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
888
- return e ? /* @__PURE__ */ l("video", {
889
+ function Pe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
890
+ return e ? /* @__PURE__ */ u("video", {
889
891
  ref: s,
890
892
  src: e,
891
893
  poster: t || void 0,
@@ -898,25 +900,25 @@ function Me({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
898
900
  display: "block",
899
901
  width: "100%",
900
902
  maxWidth: "100%",
901
- ...m(o)
903
+ ...h(o)
902
904
  }
903
905
  }) : null;
904
906
  }
905
- var Ne = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
906
- function Pe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
907
- let c = Ne(e);
907
+ var Fe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
908
+ function Ie({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
909
+ let c = Fe(e);
908
910
  if (!c) return null;
909
- let u = new URLSearchParams({ rel: "0" });
910
- return t && u.set("autoplay", "1"), (n || t) && u.set("mute", "1"), i || u.set("controls", "0"), r && (u.set("loop", "1"), u.set("playlist", c)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ l("div", {
911
+ let l = new URLSearchParams({ rel: "0" });
912
+ return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ u("div", {
911
913
  ref: s,
912
914
  style: {
913
915
  position: "relative",
914
916
  width: "100%",
915
917
  paddingTop: "56.25%",
916
- ...m(o)
918
+ ...h(o)
917
919
  },
918
- children: /* @__PURE__ */ l("iframe", {
919
- src: `https://www.youtube-nocookie.com/embed/${c}?${u}`,
920
+ children: /* @__PURE__ */ u("iframe", {
921
+ src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
920
922
  title: "YouTube video",
921
923
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
922
924
  allowFullScreen: !0,
@@ -930,8 +932,8 @@ function Pe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
930
932
  })
931
933
  });
932
934
  }
933
- function Fe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
934
- return e ? /* @__PURE__ */ l("iframe", {
935
+ function Le({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
936
+ return e ? /* @__PURE__ */ u("iframe", {
935
937
  ref: i,
936
938
  src: e,
937
939
  title: t || "Embedded frame",
@@ -942,13 +944,13 @@ function Fe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
942
944
  width: "100%",
943
945
  height: 300,
944
946
  border: 0,
945
- ...m(r)
947
+ ...h(r)
946
948
  }
947
949
  }) : null;
948
950
  }
949
- function Ie({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
950
- let [a, o] = s(null);
951
- return r(() => {
951
+ function Re({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
952
+ let [a, o] = c(null);
953
+ return i(() => {
952
954
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
953
955
  let t = document.createElement("script");
954
956
  for (let { name: n, value: r } of e.attributes) t.setAttribute(n, r);
@@ -958,15 +960,15 @@ function Ie({ code: e, runScripts: t = !0, style: n, nodeRef: i }) {
958
960
  a,
959
961
  e,
960
962
  t
961
- ]), /* @__PURE__ */ l("div", {
963
+ ]), /* @__PURE__ */ u("div", {
962
964
  ref: (e) => {
963
- o(e), i && i(e);
965
+ o(e), r && r(e);
964
966
  },
965
- style: m(n)
967
+ style: h(n)
966
968
  });
967
969
  }
968
- function Le({ height: e, nodeRef: t }) {
969
- return /* @__PURE__ */ l("div", {
970
+ function ze({ height: e, nodeRef: t }) {
971
+ return /* @__PURE__ */ u("div", {
970
972
  ref: t,
971
973
  style: {
972
974
  height: e || 32,
@@ -975,18 +977,18 @@ function Le({ height: e, nodeRef: t }) {
975
977
  }
976
978
  });
977
979
  }
978
- function Re({ style: e, nodeRef: t }) {
979
- return /* @__PURE__ */ l("div", {
980
+ function Be({ style: e, nodeRef: t }) {
981
+ return /* @__PURE__ */ u("div", {
980
982
  ref: t,
981
983
  style: {
982
984
  height: 1,
983
985
  alignSelf: "stretch",
984
986
  flexShrink: 0,
985
- ...m(e)
987
+ ...h(e)
986
988
  }
987
989
  });
988
990
  }
989
- var ze = {
991
+ var Ve = {
990
992
  position: "absolute",
991
993
  top: "50%",
992
994
  transform: "translateY(-50%)",
@@ -1003,7 +1005,7 @@ var ze = {
1003
1005
  alignItems: "center",
1004
1006
  justifyContent: "center",
1005
1007
  padding: 0
1006
- }, Be = {
1008
+ }, He = {
1007
1009
  bottom: {
1008
1010
  inset: "auto 0 0 0",
1009
1011
  padding: "40px 24px 20px",
@@ -1022,26 +1024,26 @@ var ze = {
1022
1024
  padding: 24,
1023
1025
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
1024
1026
  }
1025
- }, Ve = 48;
1026
- function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, height: a = 320, swipe: o = !0, style: d, nodeRef: f }) {
1027
- let [p, h] = s(0), [g, _] = s(!1), [v, y] = s(null), b = e ? Math.min(p, e - 1) : 0;
1028
- if (r(() => {
1027
+ }, Ue = 48;
1028
+ function We({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: s, nodeRef: f }) {
1029
+ let [p, m] = c(0), [g, _] = c(!1), [v, y] = c(null), b = e ? Math.min(p, e - 1) : 0;
1030
+ if (i(() => {
1029
1031
  if (!n || g || v || e < 2) return;
1030
- let t = setInterval(() => h((t) => (t + 1) % e), Math.max(2, Number(i) || 5) * 1e3);
1032
+ let t = setInterval(() => m((t) => (t + 1) % e), Math.max(2, Number(r) || 5) * 1e3);
1031
1033
  return () => clearInterval(t);
1032
1034
  }, [
1033
1035
  n,
1034
1036
  g,
1035
1037
  v,
1036
- i,
1038
+ r,
1037
1039
  e
1038
1040
  ]), !e) return null;
1039
- let x = (t) => h((t + e) % e), S = () => {
1041
+ let x = (t) => m((t + e) % e), S = () => {
1040
1042
  if (!v) return;
1041
1043
  let { dx: e } = v;
1042
- y(null), e < -48 ? x(b + 1) : e > Ve && x(b - 1);
1044
+ y(null), e < -48 ? x(b + 1) : e > Ue && x(b - 1);
1043
1045
  };
1044
- return /* @__PURE__ */ u("div", {
1046
+ return /* @__PURE__ */ d("div", {
1045
1047
  ref: f,
1046
1048
  onMouseEnter: () => _(!0),
1047
1049
  onMouseLeave: () => _(!1),
@@ -1064,16 +1066,16 @@ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1064
1066
  touchAction: "pan-y",
1065
1067
  userSelect: v ? "none" : void 0,
1066
1068
  cursor: v ? "grabbing" : void 0,
1067
- ...m(d)
1069
+ ...h(s)
1068
1070
  },
1069
- children: [/* @__PURE__ */ l("div", {
1071
+ children: [/* @__PURE__ */ u("div", {
1070
1072
  style: {
1071
1073
  display: "flex",
1072
1074
  height: a,
1073
1075
  transform: `translateX(calc(${-b * 100}% + ${v?.dx ?? 0}px))`,
1074
1076
  transition: v ? "none" : "transform 450ms ease"
1075
1077
  },
1076
- children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ l("div", {
1078
+ children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ u("div", {
1077
1079
  style: {
1078
1080
  position: "relative",
1079
1081
  width: "100%",
@@ -1082,28 +1084,28 @@ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1082
1084
  },
1083
1085
  children: t(n)
1084
1086
  }, n))
1085
- }), e > 1 && /* @__PURE__ */ u(c, { children: [
1086
- /* @__PURE__ */ l("button", {
1087
+ }), e > 1 && /* @__PURE__ */ d(l, { children: [
1088
+ /* @__PURE__ */ u("button", {
1087
1089
  type: "button",
1088
1090
  "aria-label": "Previous slide",
1089
1091
  style: {
1090
- ...ze,
1092
+ ...Ve,
1091
1093
  left: 12
1092
1094
  },
1093
1095
  onClick: () => x(b - 1),
1094
1096
  children: "‹"
1095
1097
  }),
1096
- /* @__PURE__ */ l("button", {
1098
+ /* @__PURE__ */ u("button", {
1097
1099
  type: "button",
1098
1100
  "aria-label": "Next slide",
1099
1101
  style: {
1100
- ...ze,
1102
+ ...Ve,
1101
1103
  right: 12
1102
1104
  },
1103
1105
  onClick: () => x(b + 1),
1104
1106
  children: "›"
1105
1107
  }),
1106
- /* @__PURE__ */ l("div", {
1108
+ /* @__PURE__ */ u("div", {
1107
1109
  style: {
1108
1110
  position: "absolute",
1109
1111
  bottom: 10,
@@ -1113,7 +1115,7 @@ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1113
1115
  justifyContent: "center",
1114
1116
  gap: 6
1115
1117
  },
1116
- children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ l("button", {
1118
+ children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ u("button", {
1117
1119
  type: "button",
1118
1120
  "aria-label": `Go to slide ${t + 1}`,
1119
1121
  onClick: () => x(t),
@@ -1131,7 +1133,7 @@ function He({ count: e, renderSlide: t, autoplay: n = !0, interval: i = 5, heigh
1131
1133
  ] })]
1132
1134
  });
1133
1135
  }
1134
- var Ue = (e, t) => ({
1136
+ var Ge = (e, t) => ({
1135
1137
  position: "absolute",
1136
1138
  inset: 0,
1137
1139
  backgroundImage: e ? `url(${e})` : "none",
@@ -1139,26 +1141,26 @@ var Ue = (e, t) => ({
1139
1141
  backgroundSize: "cover",
1140
1142
  backgroundPosition: "center"
1141
1143
  });
1142
- function We({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1143
- return e.length ? /* @__PURE__ */ l(He, {
1144
+ function Ke({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1145
+ return e.length ? /* @__PURE__ */ u(We, {
1144
1146
  ...r,
1145
1147
  count: e.length,
1146
1148
  renderSlide: (r) => {
1147
1149
  let i = e[r];
1148
- return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: Ue(i.image) }), (i.title || i.text) && /* @__PURE__ */ u("div", {
1150
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ge(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1149
1151
  style: {
1150
1152
  position: "absolute",
1151
1153
  color: "#fff",
1152
1154
  textAlign: n,
1153
- ...Be[t] ?? Be.bottom
1155
+ ...He[t] ?? He.bottom
1154
1156
  },
1155
- children: [i.title && /* @__PURE__ */ l("div", {
1157
+ children: [i.title && /* @__PURE__ */ u("div", {
1156
1158
  style: {
1157
1159
  fontSize: 22,
1158
1160
  fontWeight: 700
1159
1161
  },
1160
1162
  children: i.title
1161
- }), i.text && /* @__PURE__ */ l("div", {
1163
+ }), i.text && /* @__PURE__ */ u("div", {
1162
1164
  style: {
1163
1165
  fontSize: 14,
1164
1166
  opacity: .9,
@@ -1170,13 +1172,13 @@ function We({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1170
1172
  }
1171
1173
  }) : null;
1172
1174
  }
1173
- function Ge({ slides: e = [], linked: t, ...n }) {
1174
- return e.length ? /* @__PURE__ */ l(He, {
1175
+ function qe({ slides: e = [], linked: t, ...n }) {
1176
+ return e.length ? /* @__PURE__ */ u(We, {
1175
1177
  ...n,
1176
1178
  count: e.length,
1177
1179
  renderSlide: (n) => {
1178
1180
  let r = e[n];
1179
- return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: Ue(r.image, r.color) }), /* @__PURE__ */ l("div", {
1181
+ return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: Ge(r.image, r.color) }), /* @__PURE__ */ u("div", {
1180
1182
  style: {
1181
1183
  position: "absolute",
1182
1184
  inset: 0,
@@ -1188,33 +1190,33 @@ function Ge({ slides: e = [], linked: t, ...n }) {
1188
1190
  }
1189
1191
  }) : null;
1190
1192
  }
1191
- var Z = {
1193
+ var Je = {
1192
1194
  color: "inherit",
1193
1195
  textDecoration: "none",
1194
1196
  fontSize: 14,
1195
1197
  opacity: .85
1196
- }, Ke = {
1198
+ }, Ye = {
1197
1199
  background: "var(--page-bg, #ffffff)",
1198
1200
  color: "var(--page-text, #111827)",
1199
1201
  border: "1px solid rgba(148, 163, 184, 0.25)",
1200
1202
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1201
1203
  zIndex: 60
1202
1204
  };
1203
- function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c = "auto", breakpoint: d = 768 }) {
1204
- let [f, p] = s(null), [h, g] = s(!1), [_, v] = s(!1), [y, b] = s(null);
1205
- r(() => {
1205
+ function Xe({ brand: t, logo: n, links: r = [], style: a, nodeRef: o, menu: s = "auto", breakpoint: l = 768 }) {
1206
+ let [f, p] = c(null), [m, g] = c(!1), [_, v] = c(!1), [y, b] = c(null);
1207
+ i(() => {
1206
1208
  if (!f) return;
1207
- let e = new ResizeObserver(() => g(f.offsetWidth < d));
1209
+ let e = new ResizeObserver(() => g(f.offsetWidth < l));
1208
1210
  return e.observe(f), () => e.disconnect();
1209
- }, [f, d]);
1210
- let x = c === "hamburger" || c === "auto" && h, S = (e, t) => /* @__PURE__ */ u("a", {
1211
+ }, [f, l]);
1212
+ let x = s === "hamburger" || s === "auto" && m, S = (e, t) => /* @__PURE__ */ d("a", {
1211
1213
  href: e.href || "#",
1212
1214
  style: {
1213
- ...Z,
1215
+ ...Je,
1214
1216
  display: "block",
1215
1217
  ...t
1216
1218
  },
1217
- children: [e.label, e.desc && /* @__PURE__ */ l("span", {
1219
+ children: [e.label, e.desc && /* @__PURE__ */ u("span", {
1218
1220
  style: {
1219
1221
  display: "block",
1220
1222
  fontSize: 12,
@@ -1224,7 +1226,7 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1224
1226
  children: e.desc
1225
1227
  })]
1226
1228
  }, e.key);
1227
- return /* @__PURE__ */ u("nav", {
1229
+ return /* @__PURE__ */ d("nav", {
1228
1230
  ref: (e) => {
1229
1231
  p(e), o && o(e);
1230
1232
  },
@@ -1236,10 +1238,10 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1236
1238
  padding: "14px 24px",
1237
1239
  width: "100%",
1238
1240
  position: "relative",
1239
- ...m(a)
1241
+ ...h(a)
1240
1242
  },
1241
1243
  children: [
1242
- n && /* @__PURE__ */ l("img", {
1244
+ n && /* @__PURE__ */ u("img", {
1243
1245
  src: n,
1244
1246
  alt: t || "Logo",
1245
1247
  style: {
@@ -1247,7 +1249,7 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1247
1249
  display: "block"
1248
1250
  }
1249
1251
  }),
1250
- t && /* @__PURE__ */ l("div", {
1252
+ t && /* @__PURE__ */ u("div", {
1251
1253
  style: {
1252
1254
  fontWeight: 700,
1253
1255
  fontSize: 18,
@@ -1255,8 +1257,8 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1255
1257
  },
1256
1258
  children: t
1257
1259
  }),
1258
- /* @__PURE__ */ l("div", { style: { flexGrow: 1 } }),
1259
- x ? /* @__PURE__ */ l("button", {
1260
+ /* @__PURE__ */ u("div", { style: { flexGrow: 1 } }),
1261
+ x ? /* @__PURE__ */ u("button", {
1260
1262
  type: "button",
1261
1263
  "aria-label": _ ? "Close menu" : "Open menu",
1262
1264
  onClick: () => v(!_),
@@ -1270,38 +1272,38 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1270
1272
  padding: 4
1271
1273
  },
1272
1274
  children: _ ? "✕" : "☰"
1273
- }) : /* @__PURE__ */ l("div", {
1275
+ }) : /* @__PURE__ */ u("div", {
1274
1276
  style: {
1275
1277
  display: "flex",
1276
1278
  gap: 20,
1277
1279
  alignItems: "center",
1278
1280
  flexWrap: "wrap"
1279
1281
  },
1280
- children: i.map((e) => {
1282
+ children: r.map((e) => {
1281
1283
  let t = e.children ?? [];
1282
- if (!t.length) return /* @__PURE__ */ l("a", {
1284
+ if (!t.length) return /* @__PURE__ */ u("a", {
1283
1285
  href: e.href || "#",
1284
- style: Z,
1286
+ style: Je,
1285
1287
  children: e.label
1286
1288
  }, e.key);
1287
1289
  let n = e.type === "mega";
1288
- return /* @__PURE__ */ u("span", {
1290
+ return /* @__PURE__ */ d("span", {
1289
1291
  style: {
1290
1292
  position: n ? "static" : "relative",
1291
1293
  display: "inline-flex"
1292
1294
  },
1293
1295
  onMouseEnter: () => b(e.key),
1294
1296
  onMouseLeave: () => b(null),
1295
- children: [/* @__PURE__ */ u("a", {
1297
+ children: [/* @__PURE__ */ d("a", {
1296
1298
  href: e.href || "#",
1297
1299
  style: {
1298
- ...Z,
1300
+ ...Je,
1299
1301
  cursor: "pointer"
1300
1302
  },
1301
1303
  children: [
1302
1304
  e.label,
1303
1305
  " ",
1304
- /* @__PURE__ */ l("span", {
1306
+ /* @__PURE__ */ u("span", {
1305
1307
  style: {
1306
1308
  fontSize: 9,
1307
1309
  opacity: .6
@@ -1309,9 +1311,9 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1309
1311
  children: "▼"
1310
1312
  })
1311
1313
  ]
1312
- }), y === e.key && (n ? /* @__PURE__ */ l("div", {
1314
+ }), y === e.key && (n ? /* @__PURE__ */ u("div", {
1313
1315
  style: {
1314
- ...Ke,
1316
+ ...Ye,
1315
1317
  position: "absolute",
1316
1318
  left: 0,
1317
1319
  right: 0,
@@ -1325,9 +1327,9 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1325
1327
  padding: "6px 8px",
1326
1328
  borderRadius: 6
1327
1329
  }))
1328
- }) : /* @__PURE__ */ l("div", {
1330
+ }) : /* @__PURE__ */ u("div", {
1329
1331
  style: {
1330
- ...Ke,
1332
+ ...Ye,
1331
1333
  position: "absolute",
1332
1334
  top: "100%",
1333
1335
  left: 0,
@@ -1345,7 +1347,7 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1345
1347
  }, e.key);
1346
1348
  })
1347
1349
  }),
1348
- x && _ && /* @__PURE__ */ l("div", {
1350
+ x && _ && /* @__PURE__ */ u("div", {
1349
1351
  style: {
1350
1352
  flexBasis: "100%",
1351
1353
  width: "100%",
@@ -1353,10 +1355,10 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1353
1355
  flexDirection: "column",
1354
1356
  paddingTop: 10
1355
1357
  },
1356
- children: i.map((t) => /* @__PURE__ */ u(e, { children: [/* @__PURE__ */ l("a", {
1358
+ children: r.map((t) => /* @__PURE__ */ d(e, { children: [/* @__PURE__ */ u("a", {
1357
1359
  href: t.href || "#",
1358
1360
  style: {
1359
- ...Z,
1361
+ ...Je,
1360
1362
  padding: "10px 4px",
1361
1363
  fontWeight: (t.children ?? []).length ? 600 : 400,
1362
1364
  opacity: 1
@@ -1367,21 +1369,21 @@ function qe({ brand: t, logo: n, links: i = [], style: a, nodeRef: o, menu: c =
1367
1369
  ]
1368
1370
  });
1369
1371
  }
1370
- function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1371
- let [i, a] = s(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1372
- return e.length ? /* @__PURE__ */ u("div", {
1372
+ function Ze({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1373
+ let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1374
+ return e.length ? /* @__PURE__ */ d("div", {
1373
1375
  ref: r,
1374
1376
  style: {
1375
1377
  width: "100%",
1376
- ...m(n)
1378
+ ...h(n)
1377
1379
  },
1378
- children: [/* @__PURE__ */ l("div", {
1380
+ children: [/* @__PURE__ */ u("div", {
1379
1381
  style: {
1380
1382
  display: "flex",
1381
1383
  gap: 4,
1382
1384
  borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
1383
1385
  },
1384
- children: e.map((e, t) => /* @__PURE__ */ l("button", {
1386
+ children: e.map((e, t) => /* @__PURE__ */ u("button", {
1385
1387
  type: "button",
1386
1388
  onClick: () => a(t),
1387
1389
  style: {
@@ -1398,7 +1400,7 @@ function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1398
1400
  },
1399
1401
  children: e.label || `Tab ${t + 1}`
1400
1402
  }, e.key))
1401
- }), e.map((e, n) => /* @__PURE__ */ l("div", {
1403
+ }), e.map((e, n) => /* @__PURE__ */ u("div", {
1402
1404
  style: {
1403
1405
  display: n === o ? "flex" : "none",
1404
1406
  flexDirection: "column"
@@ -1407,26 +1409,26 @@ function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1407
1409
  }, e.key))]
1408
1410
  }) : null;
1409
1411
  }
1410
- function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1411
- let [a, o] = s(() => new Set(e.length ? [e[0].key] : []));
1412
+ function Qe({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1413
+ let [a, o] = c(() => new Set(e.length ? [e[0].key] : []));
1412
1414
  if (!e.length) return null;
1413
- let c = (e) => o((t) => {
1415
+ let s = (e) => o((t) => {
1414
1416
  let r = new Set(n ? t : []);
1415
1417
  return t.has(e) ? r.delete(e) : r.add(e), r;
1416
1418
  });
1417
- return /* @__PURE__ */ l("div", {
1419
+ return /* @__PURE__ */ u("div", {
1418
1420
  ref: i,
1419
1421
  style: {
1420
1422
  width: "100%",
1421
- ...m(r)
1423
+ ...h(r)
1422
1424
  },
1423
1425
  children: e.map((n, r) => {
1424
1426
  let i = a.has(n.key);
1425
- return /* @__PURE__ */ u("div", {
1427
+ return /* @__PURE__ */ d("div", {
1426
1428
  style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
1427
- children: [/* @__PURE__ */ u("button", {
1429
+ children: [/* @__PURE__ */ d("button", {
1428
1430
  type: "button",
1429
- onClick: () => c(n.key),
1431
+ onClick: () => s(n.key),
1430
1432
  style: {
1431
1433
  width: "100%",
1432
1434
  display: "flex",
@@ -1443,7 +1445,7 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1443
1445
  textAlign: "left",
1444
1446
  cursor: "pointer"
1445
1447
  },
1446
- children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ l("span", {
1448
+ children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ u("span", {
1447
1449
  "aria-hidden": !0,
1448
1450
  style: {
1449
1451
  fontSize: 12,
@@ -1453,7 +1455,7 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1453
1455
  },
1454
1456
  children: "▼"
1455
1457
  })]
1456
- }), /* @__PURE__ */ l("div", {
1458
+ }), /* @__PURE__ */ u("div", {
1457
1459
  style: {
1458
1460
  display: i ? "flex" : "none",
1459
1461
  flexDirection: "column"
@@ -1464,15 +1466,15 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1464
1466
  })
1465
1467
  });
1466
1468
  }
1467
- var Xe = {
1469
+ var $e = {
1468
1470
  display: "flex",
1469
1471
  flexDirection: "column",
1470
1472
  gap: "12px"
1471
- }, Ze = {
1473
+ }, X = {
1472
1474
  fontSize: "14px",
1473
1475
  fontWeight: 500,
1474
1476
  color: "var(--page-text, #111827)"
1475
- }, Q = {
1477
+ }, Z = {
1476
1478
  padding: "10px 12px",
1477
1479
  border: "1px solid #d1d5db",
1478
1480
  borderRadius: "6px",
@@ -1482,18 +1484,18 @@ var Xe = {
1482
1484
  boxSizing: "border-box",
1483
1485
  backgroundColor: "#ffffff",
1484
1486
  color: "#111827"
1485
- }, Qe = {
1487
+ }, et = {
1486
1488
  display: "flex",
1487
1489
  alignItems: "center",
1488
1490
  gap: "8px",
1489
1491
  fontSize: "14px",
1490
1492
  color: "var(--page-text, #111827)"
1491
- }, $e = (e) => e ? {
1493
+ }, Q = (e) => e ? {
1492
1494
  readOnly: !0,
1493
1495
  tabIndex: -1,
1494
1496
  onMouseDown: (e) => e.preventDefault()
1495
1497
  } : {};
1496
- function et(e, t) {
1498
+ function tt(e, t) {
1497
1499
  if (!e) return !0;
1498
1500
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1499
1501
  switch (e.op) {
@@ -1507,11 +1509,11 @@ function et(e, t) {
1507
1509
  default: return !1;
1508
1510
  }
1509
1511
  }
1510
- var tt = {
1512
+ var nt = {
1511
1513
  display: "flex",
1512
1514
  flexDirection: "column",
1513
1515
  gap: 6
1514
- }, nt = {
1516
+ }, rt = {
1515
1517
  font: "inherit",
1516
1518
  fontSize: 15,
1517
1519
  padding: "10px 12px",
@@ -1522,16 +1524,16 @@ var tt = {
1522
1524
  width: "100%",
1523
1525
  boxSizing: "border-box"
1524
1526
  };
1525
- function rt(e, t) {
1527
+ function it(e, t) {
1526
1528
  let n = Array.isArray(e?.options) ? e.options : [];
1527
1529
  if (!e?.parentField) return n;
1528
1530
  let r = t?.[e.parentField];
1529
1531
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
1530
1532
  }
1531
- function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
1532
- let a = /* @__PURE__ */ u("span", {
1533
+ function at({ field: e, value: t, onChange: n, inert: r, values: i }) {
1534
+ let a = /* @__PURE__ */ d("span", {
1533
1535
  style: {
1534
- ...Ze,
1536
+ ...X,
1535
1537
  fontSize: 14
1536
1538
  },
1537
1539
  children: [e.label, e.required ? " *" : ""]
@@ -1540,11 +1542,11 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
1540
1542
  required: e.required || void 0,
1541
1543
  placeholder: e.placeholder || void 0,
1542
1544
  disabled: r || void 0,
1543
- style: nt,
1545
+ style: rt,
1544
1546
  value: t ?? "",
1545
1547
  onChange: (t) => n(e.name, t.target.value)
1546
1548
  };
1547
- return e.type === "display" ? /* @__PURE__ */ l(e.variant && e.variant !== "p" ? e.variant : "p", {
1549
+ return e.type === "display" ? /* @__PURE__ */ u(e.variant && e.variant !== "p" ? e.variant : "p", {
1548
1550
  style: {
1549
1551
  margin: 0,
1550
1552
  color: e.color || "inherit",
@@ -1561,7 +1563,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
1561
1563
  lineHeight: 1.35
1562
1564
  },
1563
1565
  children: e.label
1564
- }) : e.type === "image" ? e.src ? /* @__PURE__ */ l("img", {
1566
+ }) : e.type === "image" ? e.src ? /* @__PURE__ */ u("img", {
1565
1567
  src: e.src,
1566
1568
  alt: e.label ?? "",
1567
1569
  style: {
@@ -1569,10 +1571,10 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
1569
1571
  borderRadius: 8,
1570
1572
  display: "block"
1571
1573
  }
1572
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ l(Pe, {
1574
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Ie, {
1573
1575
  url: e.src,
1574
1576
  style: { width: "100%" }
1575
- }) : /* @__PURE__ */ l("video", {
1577
+ }) : /* @__PURE__ */ u("video", {
1576
1578
  src: e.src,
1577
1579
  controls: !0,
1578
1580
  style: {
@@ -1580,28 +1582,28 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
1580
1582
  borderRadius: 8,
1581
1583
  display: "block"
1582
1584
  }
1583
- }) : null : /* @__PURE__ */ u("label", {
1584
- style: tt,
1585
+ }) : null : /* @__PURE__ */ d("label", {
1586
+ style: nt,
1585
1587
  children: [
1586
1588
  a,
1587
- e.type === "textarea" || e.multiline ? /* @__PURE__ */ l("textarea", {
1589
+ e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
1588
1590
  ...o,
1589
1591
  rows: 4,
1590
1592
  style: {
1591
- ...nt,
1593
+ ...rt,
1592
1594
  resize: "vertical"
1593
1595
  }
1594
- }) : e.type === "select" ? /* @__PURE__ */ u("select", {
1596
+ }) : e.type === "select" ? /* @__PURE__ */ d("select", {
1595
1597
  ...o,
1596
1598
  disabled: o.disabled || !!e.parentField && !i?.[e.parentField],
1597
- children: [/* @__PURE__ */ l("option", {
1599
+ children: [/* @__PURE__ */ u("option", {
1598
1600
  value: "",
1599
1601
  children: e.placeholder || "—"
1600
- }), rt(e, i).map((e, t) => /* @__PURE__ */ l("option", {
1602
+ }), it(e, i).map((e, t) => /* @__PURE__ */ u("option", {
1601
1603
  value: typeof e == "string" ? e : e.value,
1602
1604
  children: typeof e == "string" ? e : e.label ?? e.value
1603
1605
  }, t))]
1604
- }) : e.type === "checkbox" ? /* @__PURE__ */ l("input", {
1606
+ }) : e.type === "checkbox" ? /* @__PURE__ */ u("input", {
1605
1607
  type: "checkbox",
1606
1608
  name: e.name,
1607
1609
  required: e.required || void 0,
@@ -1612,7 +1614,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
1612
1614
  width: 18,
1613
1615
  height: 18
1614
1616
  }
1615
- }) : e.type === "upload" ? /* @__PURE__ */ l("input", {
1617
+ }) : e.type === "upload" ? /* @__PURE__ */ u("input", {
1616
1618
  type: "file",
1617
1619
  name: e.name,
1618
1620
  accept: e.accept || void 0,
@@ -1623,7 +1625,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
1623
1625
  font: "inherit",
1624
1626
  fontSize: 14
1625
1627
  }
1626
- }) : /* @__PURE__ */ l("input", {
1628
+ }) : /* @__PURE__ */ u("input", {
1627
1629
  ...o,
1628
1630
  type: {
1629
1631
  email: "email",
@@ -1634,7 +1636,7 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
1634
1636
  link: "url"
1635
1637
  }[e.type] ?? "text"
1636
1638
  }),
1637
- e.help && /* @__PURE__ */ l("span", {
1639
+ e.help && /* @__PURE__ */ u("span", {
1638
1640
  style: {
1639
1641
  fontSize: 12,
1640
1642
  opacity: .65
@@ -1644,17 +1646,17 @@ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
1644
1646
  ]
1645
1647
  });
1646
1648
  }
1647
- function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d, auto: f, submitLabel: p, nodeRef: h, inert: g, children: _, linked: v, show: y }) {
1648
- let { tenant: b, apiUrl: x } = n(V), [S, C] = s("form"), [w, T] = s(null), [E, D] = s({}), [O, k] = s(0), A = g ? y || "form" : S;
1649
- r(() => {
1650
- if (!f || !d) return;
1649
+ function ot({ style: e, action: t, method: n, name: a, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: g, children: _, linked: v, show: y }) {
1650
+ let { tenant: b, apiUrl: x } = r(H), [S, C] = c("form"), [w, T] = c(null), [E, D] = c({}), [O, k] = c(0), A = g ? y || "form" : S;
1651
+ i(() => {
1652
+ if (!f || !s) return;
1651
1653
  let e = !0;
1652
- return fetch(`${x || "/api"}/forms/${encodeURIComponent(d)}`, { headers: b ? { "x-tenant": b } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
1654
+ return fetch(`${x || "/api"}/forms/${encodeURIComponent(s)}`, { headers: b ? { "x-tenant": b } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
1653
1655
  e = !1;
1654
1656
  };
1655
1657
  }, [
1656
1658
  f,
1657
- d,
1659
+ s,
1658
1660
  b,
1659
1661
  x
1660
1662
  ]);
@@ -1666,13 +1668,13 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1666
1668
  section: e,
1667
1669
  fields: []
1668
1670
  }) : j[j.length - 1].fields.push(e);
1669
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || et(e.section.condition, E)).map((e) => ({
1671
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || tt(e.section.condition, E)).map((e) => ({
1670
1672
  ...e,
1671
- fields: e.fields.filter((e) => et(e.condition, E))
1673
+ fields: e.fields.filter((e) => tt(e.condition, E))
1672
1674
  })), P = M.length > 1, F = Math.min(O, Math.max(0, N.length - 1)), I = P ? N[F]?.fields ?? [] : N.flatMap((e) => e.fields), L = I.filter((e) => {
1673
1675
  let t = E[e.name];
1674
1676
  return e.required && (t == null || t === "" || t === !1);
1675
- }), ee = F >= N.length - 1, R = (e, t) => D((n) => {
1677
+ }), R = F >= N.length - 1, ee = (e, t) => D((n) => {
1676
1678
  let r = {
1677
1679
  ...n,
1678
1680
  [e]: t
@@ -1680,23 +1682,23 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1680
1682
  for (let t of Array.isArray(w?.fields) ? w.fields : []) t?.parentField === e && delete r[t.name];
1681
1683
  return r;
1682
1684
  });
1683
- return /* @__PURE__ */ u("div", {
1684
- ref: h,
1685
- style: m(e),
1685
+ return /* @__PURE__ */ d("div", {
1686
+ ref: m,
1687
+ style: h(e),
1686
1688
  children: [
1687
- /* @__PURE__ */ l("form", {
1689
+ /* @__PURE__ */ u("form", {
1688
1690
  action: t || void 0,
1689
- method: i || "post",
1691
+ method: n || "post",
1690
1692
  name: a || void 0,
1691
1693
  encType: o || void 0,
1692
1694
  onSubmit: async (e) => {
1693
1695
  if (e.preventDefault(), !g) {
1694
- if (d) {
1696
+ if (s) {
1695
1697
  let t = {};
1696
1698
  if (f) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
1697
1699
  else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
1698
1700
  try {
1699
- let e = await fetch(`${x || "/api"}/forms/${d}/submit`, {
1701
+ let e = await fetch(`${x || "/api"}/forms/${s}/submit`, {
1700
1702
  method: "post",
1701
1703
  headers: {
1702
1704
  "content-type": "application/json",
@@ -1715,27 +1717,27 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1715
1717
  return;
1716
1718
  }
1717
1719
  try {
1718
- let n = await fetch(t, {
1719
- method: i || "post",
1720
+ let r = await fetch(t, {
1721
+ method: n || "post",
1720
1722
  body: new FormData(e.currentTarget)
1721
1723
  });
1722
- C(n.ok ? "success" : "error");
1724
+ C(r.ok ? "success" : "error");
1723
1725
  } catch {
1724
1726
  C("error");
1725
1727
  }
1726
1728
  }
1727
1729
  },
1728
1730
  style: {
1729
- ...Xe,
1731
+ ...$e,
1730
1732
  display: A === "success" ? "none" : "flex"
1731
1733
  },
1732
- children: f && d ? /* @__PURE__ */ u(c, { children: [
1733
- P && /* @__PURE__ */ l(_t, {
1734
+ children: f && s ? /* @__PURE__ */ d(l, { children: [
1735
+ P && /* @__PURE__ */ u(vt, {
1734
1736
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1735
1737
  active: F + 1,
1736
1738
  style: { marginBottom: 8 }
1737
1739
  }),
1738
- P && N[F]?.section?.help && /* @__PURE__ */ l("p", {
1740
+ P && N[F]?.section?.help && /* @__PURE__ */ u("p", {
1739
1741
  style: {
1740
1742
  margin: 0,
1741
1743
  fontSize: 14,
@@ -1743,26 +1745,26 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1743
1745
  },
1744
1746
  children: N[F].section.help
1745
1747
  }),
1746
- I.map((e) => /* @__PURE__ */ l(it, {
1748
+ I.map((e) => /* @__PURE__ */ u(at, {
1747
1749
  field: e,
1748
1750
  value: E[e.name],
1749
1751
  values: E,
1750
- onChange: R,
1752
+ onChange: ee,
1751
1753
  inert: g
1752
1754
  }, e.name)),
1753
- /* @__PURE__ */ u("div", {
1755
+ /* @__PURE__ */ d("div", {
1754
1756
  style: {
1755
1757
  display: "flex",
1756
1758
  gap: 10,
1757
1759
  alignItems: "center",
1758
1760
  marginTop: 4
1759
1761
  },
1760
- children: [P && F > 0 && /* @__PURE__ */ l("button", {
1762
+ children: [P && F > 0 && /* @__PURE__ */ u("button", {
1761
1763
  type: "button",
1762
1764
  disabled: g || void 0,
1763
1765
  onClick: () => k(F - 1),
1764
1766
  style: {
1765
- ...Y,
1767
+ ...J,
1766
1768
  background: "transparent",
1767
1769
  color: "inherit",
1768
1770
  border: 0,
@@ -1770,12 +1772,12 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1770
1772
  cursor: "pointer"
1771
1773
  },
1772
1774
  children: "Back"
1773
- }), P && !ee ? /* @__PURE__ */ l("button", {
1775
+ }), P && !R ? /* @__PURE__ */ u("button", {
1774
1776
  type: "button",
1775
1777
  disabled: g || L.length > 0,
1776
1778
  onClick: () => k(F + 1),
1777
1779
  style: {
1778
- ...Y,
1780
+ ...J,
1779
1781
  border: 0,
1780
1782
  padding: "10px 22px",
1781
1783
  borderRadius: 8,
@@ -1785,11 +1787,11 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1785
1787
  opacity: L.length ? .5 : 1
1786
1788
  },
1787
1789
  children: "Next"
1788
- }) : /* @__PURE__ */ l("button", {
1790
+ }) : /* @__PURE__ */ u("button", {
1789
1791
  type: "submit",
1790
1792
  disabled: g || void 0,
1791
1793
  style: {
1792
- ...Y,
1794
+ ...J,
1793
1795
  border: 0,
1794
1796
  padding: "10px 22px",
1795
1797
  borderRadius: 8,
@@ -1802,11 +1804,11 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1802
1804
  })
1803
1805
  ] }) : _
1804
1806
  }),
1805
- /* @__PURE__ */ l("div", {
1807
+ /* @__PURE__ */ u("div", {
1806
1808
  style: { display: A === "success" ? "block" : "none" },
1807
1809
  children: v?.success ?? null
1808
1810
  }),
1809
- /* @__PURE__ */ l("div", {
1811
+ /* @__PURE__ */ u("div", {
1810
1812
  style: {
1811
1813
  display: A === "error" ? "block" : "none",
1812
1814
  marginTop: 12
@@ -1816,53 +1818,53 @@ function at({ style: e, action: t, method: i, name: a, enctype: o, formSlug: d,
1816
1818
  ]
1817
1819
  });
1818
1820
  }
1819
- function ot({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1820
- return /* @__PURE__ */ l("label", {
1821
+ function st({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1822
+ return /* @__PURE__ */ u("label", {
1821
1823
  ref: r,
1822
1824
  style: {
1823
- ...Ze,
1824
- ...m(n)
1825
+ ...X,
1826
+ ...h(n)
1825
1827
  },
1826
- children: X(t, e, i)
1828
+ children: Y(t, e, i)
1827
1829
  });
1828
1830
  }
1829
- function st({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1830
- return /* @__PURE__ */ l("input", {
1831
+ function ct({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1832
+ return /* @__PURE__ */ u("input", {
1831
1833
  ref: a,
1832
1834
  type: e,
1833
1835
  name: t || void 0,
1834
1836
  placeholder: n,
1835
1837
  required: !o && !!r,
1836
1838
  style: {
1837
- ...Q,
1838
- ...m(i)
1839
+ ...Z,
1840
+ ...h(i)
1839
1841
  },
1840
- ...$e(o)
1842
+ ...Q(o)
1841
1843
  });
1842
1844
  }
1843
- function ct({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1844
- return /* @__PURE__ */ l("textarea", {
1845
+ function lt({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1846
+ return /* @__PURE__ */ u("textarea", {
1845
1847
  ref: a,
1846
1848
  name: e || void 0,
1847
1849
  placeholder: t,
1848
1850
  rows: n,
1849
1851
  required: !o && !!r,
1850
1852
  style: {
1851
- ...Q,
1853
+ ...Z,
1852
1854
  resize: "vertical",
1853
- ...m(i)
1855
+ ...h(i)
1854
1856
  },
1855
- ...$e(o)
1857
+ ...Q(o)
1856
1858
  });
1857
1859
  }
1858
- function lt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1859
- return /* @__PURE__ */ u("label", {
1860
+ function ut({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1861
+ return /* @__PURE__ */ d("label", {
1860
1862
  ref: o,
1861
1863
  style: {
1862
- ...Qe,
1863
- ...m(a)
1864
+ ...et,
1865
+ ...h(a)
1864
1866
  },
1865
- children: [/* @__PURE__ */ l("input", {
1867
+ children: [/* @__PURE__ */ u("input", {
1866
1868
  type: e,
1867
1869
  name: n || void 0,
1868
1870
  value: r || void 0,
@@ -1876,8 +1878,8 @@ function lt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1876
1878
  }), t]
1877
1879
  });
1878
1880
  }
1879
- function ut({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1880
- return /* @__PURE__ */ u("select", {
1881
+ function dt({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1882
+ return /* @__PURE__ */ d("select", {
1881
1883
  ref: a,
1882
1884
  name: e || void 0,
1883
1885
  required: !o && !!r,
@@ -1885,58 +1887,58 @@ function ut({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1885
1887
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
1886
1888
  tabIndex: o ? -1 : void 0,
1887
1889
  style: {
1888
- ...Q,
1890
+ ...Z,
1889
1891
  appearance: "auto",
1890
- ...m(i)
1892
+ ...h(i)
1891
1893
  },
1892
- children: [t !== "" && /* @__PURE__ */ l("option", {
1894
+ children: [t !== "" && /* @__PURE__ */ u("option", {
1893
1895
  value: "",
1894
1896
  disabled: !0,
1895
1897
  children: t ?? "Select…"
1896
- }), n.map((e, t) => /* @__PURE__ */ l("option", {
1898
+ }), n.map((e, t) => /* @__PURE__ */ u("option", {
1897
1899
  value: e,
1898
1900
  children: e
1899
1901
  }, t))]
1900
1902
  });
1901
1903
  }
1902
- function dt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
1903
- let [c, d] = s(null);
1904
- return /* @__PURE__ */ u("label", {
1904
+ function ft({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
1905
+ let [s, l] = c(null);
1906
+ return /* @__PURE__ */ d("label", {
1905
1907
  ref: a,
1906
1908
  style: {
1907
- ...Q,
1909
+ ...Z,
1908
1910
  display: "flex",
1909
1911
  alignItems: "center",
1910
1912
  gap: "8px",
1911
1913
  cursor: o ? "default" : "pointer",
1912
1914
  borderStyle: "dashed",
1913
- color: c ? "#111827" : "#6b7280",
1914
- ...m(i)
1915
+ color: s ? "#111827" : "#6b7280",
1916
+ ...h(i)
1915
1917
  },
1916
1918
  children: [
1917
- /* @__PURE__ */ l("input", {
1919
+ /* @__PURE__ */ u("input", {
1918
1920
  type: "file",
1919
1921
  name: e || void 0,
1920
1922
  accept: t || void 0,
1921
1923
  required: !o && !!n,
1922
1924
  disabled: !!o,
1923
- onChange: (e) => d(e.target.files?.[0]?.name ?? null),
1925
+ onChange: (e) => l(e.target.files?.[0]?.name ?? null),
1924
1926
  style: { display: "none" }
1925
1927
  }),
1926
- /* @__PURE__ */ l("span", {
1928
+ /* @__PURE__ */ u("span", {
1927
1929
  "aria-hidden": !0,
1928
1930
  children: "📎"
1929
1931
  }),
1930
- c ?? r
1932
+ s ?? r
1931
1933
  ]
1932
1934
  });
1933
1935
  }
1934
- function ft({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1935
- return /* @__PURE__ */ l("button", {
1936
+ function pt({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1937
+ return /* @__PURE__ */ u("button", {
1936
1938
  ref: n,
1937
1939
  type: r ? "button" : "submit",
1938
1940
  style: {
1939
- ...Y,
1941
+ ...J,
1940
1942
  border: 0,
1941
1943
  cursor: "pointer",
1942
1944
  alignSelf: "flex-start",
@@ -1946,31 +1948,31 @@ function ft({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1946
1948
  fontWeight: 600,
1947
1949
  lineHeight: 1.4,
1948
1950
  fontFamily: "inherit",
1949
- ...m(t)
1951
+ ...h(t)
1950
1952
  },
1951
1953
  children: e
1952
1954
  });
1953
1955
  }
1954
- function pt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1956
+ function mt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1955
1957
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1956
- return /* @__PURE__ */ l("div", {
1958
+ return /* @__PURE__ */ u("div", {
1957
1959
  ref: r,
1958
1960
  style: {
1959
1961
  display: "grid",
1960
1962
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
1961
1963
  gap: 16,
1962
1964
  width: "100%",
1963
- ...m(n)
1965
+ ...h(n)
1964
1966
  },
1965
- children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ l("div", {
1967
+ children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ u("div", {
1966
1968
  style: { minWidth: 0 },
1967
1969
  children: i?.[`cell-${t}`] ?? null
1968
1970
  }, t))
1969
1971
  });
1970
1972
  }
1971
- function mt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, imageField: o, titleField: c = "name", textField: d, custom: f, templateId: p, style: h, nodeRef: g }) {
1972
- let { tenant: _, apiUrl: v, locale: y } = n(V), b = n(U), x = n(H)?.[e], [S, C] = s(null);
1973
- if (r(() => {
1973
+ function ht({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, style: m, nodeRef: g }) {
1974
+ let { tenant: _, apiUrl: v, locale: y } = r(H), b = r(W), x = r(U)?.[e], [S, C] = c(null);
1975
+ if (i(() => {
1974
1976
  if (!e || x) return;
1975
1977
  let t = !0, n = e.startsWith("api:") ? `${v}/data/${encodeURIComponent(e.slice(4))}` : `${v}/dynamic/${encodeURIComponent(e)}${y ? `?locale=${encodeURIComponent(y)}` : ""}`;
1976
1978
  return fetch(n, { headers: _ ? { "x-tenant": _ } : {} }).then((e) => e.json()).then((e) => {
@@ -1986,7 +1988,7 @@ function mt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
1986
1988
  y,
1987
1989
  x
1988
1990
  ]), !e) return null;
1989
- let w = (x ?? S ?? []).slice(0, Math.max(1, Number(t) || 6)), T = Math.min(Math.max(Number(a) || 3, 1), 6), E = i === "list" ? {
1991
+ let w = (x ?? S ?? []).slice(0, Math.max(1, Number(t) || 6)), T = Math.min(Math.max(Number(a) || 3, 1), 6), E = n === "list" ? {
1990
1992
  display: "flex",
1991
1993
  flexDirection: "column",
1992
1994
  gap: 20
@@ -1995,27 +1997,27 @@ function mt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
1995
1997
  gridTemplateColumns: `repeat(${T}, minmax(0, 1fr))`,
1996
1998
  gap: 24
1997
1999
  };
1998
- return f && p && b?.render ? /* @__PURE__ */ l("div", {
2000
+ return f && p && b?.render ? /* @__PURE__ */ u("div", {
1999
2001
  ref: g,
2000
2002
  style: {
2001
2003
  width: "100%",
2002
2004
  ...E,
2003
- ...m(h)
2005
+ ...h(m)
2004
2006
  },
2005
- children: w.map((e) => /* @__PURE__ */ l("div", {
2007
+ children: w.map((e) => /* @__PURE__ */ u("div", {
2006
2008
  style: { minWidth: 0 },
2007
- children: b.render(p, (t) => ce(t, e))
2009
+ children: b.render(p, (t) => le(t, e))
2008
2010
  }, e.id ?? e?.data?.slug))
2009
- }) : /* @__PURE__ */ l("div", {
2011
+ }) : /* @__PURE__ */ u("div", {
2010
2012
  ref: g,
2011
2013
  style: {
2012
2014
  width: "100%",
2013
2015
  ...E,
2014
- ...m(h)
2016
+ ...h(m)
2015
2017
  },
2016
2018
  children: w.map((e) => {
2017
- let t = o ? W(e?.data, o) : null, n = c ? K(W(e?.data, c)) : null, r = d ? W(e?.data, d) : null, a = Array.isArray(r) ? r : null, s = a || r == null ? null : K(r), f = i === "list";
2018
- return /* @__PURE__ */ u("div", {
2019
+ let t = o ? G(e?.data, o) : null, r = s ? K(G(e?.data, s)) : null, i = l ? G(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : K(i), f = n === "list";
2020
+ return /* @__PURE__ */ d("div", {
2019
2021
  style: {
2020
2022
  display: "flex",
2021
2023
  flexDirection: f ? "row" : "column",
@@ -2023,9 +2025,9 @@ function mt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2023
2025
  alignItems: f ? "center" : "stretch",
2024
2026
  minWidth: 0
2025
2027
  },
2026
- children: [t && /* @__PURE__ */ l("img", {
2028
+ children: [t && /* @__PURE__ */ u("img", {
2027
2029
  src: t,
2028
- alt: n ?? "",
2030
+ alt: r ?? "",
2029
2031
  style: {
2030
2032
  width: f ? 160 : "100%",
2031
2033
  aspectRatio: "3 / 2",
@@ -2034,34 +2036,34 @@ function mt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2034
2036
  flexShrink: 0,
2035
2037
  display: "block"
2036
2038
  }
2037
- }), /* @__PURE__ */ u("div", {
2039
+ }), /* @__PURE__ */ d("div", {
2038
2040
  style: { minWidth: 0 },
2039
2041
  children: [
2040
- n && /* @__PURE__ */ l("h3", {
2042
+ r && /* @__PURE__ */ u("h3", {
2041
2043
  style: {
2042
2044
  margin: 0,
2043
2045
  fontSize: 18,
2044
2046
  fontWeight: 700
2045
2047
  },
2046
- children: n
2048
+ children: r
2047
2049
  }),
2048
- s && /* @__PURE__ */ l("p", {
2050
+ c && /* @__PURE__ */ u("p", {
2049
2051
  style: {
2050
2052
  margin: "6px 0 0",
2051
2053
  fontSize: 14,
2052
2054
  lineHeight: 1.55,
2053
2055
  opacity: .75
2054
2056
  },
2055
- children: s
2057
+ children: c
2056
2058
  }),
2057
- a && /* @__PURE__ */ l("div", {
2059
+ a && /* @__PURE__ */ u("div", {
2058
2060
  style: {
2059
2061
  marginTop: 6,
2060
2062
  fontSize: 14,
2061
2063
  lineHeight: 1.55,
2062
2064
  opacity: .85
2063
2065
  },
2064
- children: Se(a)
2066
+ children: we(a)
2065
2067
  })
2066
2068
  ]
2067
2069
  })]
@@ -2069,12 +2071,12 @@ function mt({ collection: e, limit: t = 6, layout: i = "grid", columns: a = 3, i
2069
2071
  })
2070
2072
  });
2071
2073
  }
2072
- function ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2073
- return e.length ? /* @__PURE__ */ l("nav", {
2074
+ function gt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2075
+ return e.length ? /* @__PURE__ */ u("nav", {
2074
2076
  ref: r,
2075
2077
  "aria-label": "Breadcrumb",
2076
- style: { ...m(n) },
2077
- children: /* @__PURE__ */ l("ol", {
2078
+ style: { ...h(n) },
2079
+ children: /* @__PURE__ */ u("ol", {
2078
2080
  style: {
2079
2081
  display: "flex",
2080
2082
  flexWrap: "wrap",
@@ -2087,25 +2089,25 @@ function ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2087
2089
  },
2088
2090
  children: e.map((n, r) => {
2089
2091
  let i = r === e.length - 1;
2090
- return /* @__PURE__ */ u("li", {
2092
+ return /* @__PURE__ */ d("li", {
2091
2093
  style: {
2092
2094
  display: "flex",
2093
2095
  alignItems: "center",
2094
2096
  gap: 8,
2095
2097
  minWidth: 0
2096
2098
  },
2097
- children: [r > 0 && /* @__PURE__ */ l("span", {
2099
+ children: [r > 0 && /* @__PURE__ */ u("span", {
2098
2100
  style: { opacity: .4 },
2099
2101
  "aria-hidden": !0,
2100
2102
  children: t
2101
- }), i || !n.href ? /* @__PURE__ */ l("span", {
2103
+ }), i || !n.href ? /* @__PURE__ */ u("span", {
2102
2104
  style: {
2103
2105
  fontWeight: i ? 600 : 400,
2104
2106
  opacity: i ? 1 : .7
2105
2107
  },
2106
2108
  "aria-current": i ? "page" : void 0,
2107
2109
  children: n.label
2108
- }) : /* @__PURE__ */ l("a", {
2110
+ }) : /* @__PURE__ */ u("a", {
2109
2111
  href: n.href,
2110
2112
  style: {
2111
2113
  color: "inherit",
@@ -2119,8 +2121,8 @@ function ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2119
2121
  })
2120
2122
  }) : null;
2121
2123
  }
2122
- function gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2123
- let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), c = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", d = (e) => ({
2124
+ function _t({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2125
+ let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), c = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", l = (e) => ({
2124
2126
  display: "inline-flex",
2125
2127
  alignItems: "center",
2126
2128
  justifyContent: "center",
@@ -2134,7 +2136,7 @@ function gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2134
2136
  background: e ? "var(--page-accent, #111827)" : "transparent",
2135
2137
  border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
2136
2138
  });
2137
- return /* @__PURE__ */ u("nav", {
2139
+ return /* @__PURE__ */ d("nav", {
2138
2140
  ref: a,
2139
2141
  "aria-label": "Pagination",
2140
2142
  style: {
@@ -2142,29 +2144,29 @@ function gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2142
2144
  flexWrap: "wrap",
2143
2145
  gap: 8,
2144
2146
  alignItems: "center",
2145
- ...m(i)
2147
+ ...h(i)
2146
2148
  },
2147
2149
  children: [
2148
- n && /* @__PURE__ */ l("a", {
2150
+ n && /* @__PURE__ */ u("a", {
2149
2151
  href: s > 1 ? c(s - 1) : "#",
2150
2152
  "aria-label": "Previous",
2151
2153
  style: {
2152
- ...d(!1),
2154
+ ...l(!1),
2153
2155
  opacity: s > 1 ? 1 : .4
2154
2156
  },
2155
2157
  children: "‹"
2156
2158
  }),
2157
- Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ l("a", {
2159
+ Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
2158
2160
  href: c(e),
2159
2161
  "aria-current": e === s ? "page" : void 0,
2160
- style: d(e === s),
2162
+ style: l(e === s),
2161
2163
  children: e
2162
2164
  }, e)),
2163
- n && /* @__PURE__ */ l("a", {
2165
+ n && /* @__PURE__ */ u("a", {
2164
2166
  href: s < o ? c(s + 1) : "#",
2165
2167
  "aria-label": "Next",
2166
2168
  style: {
2167
- ...d(!1),
2169
+ ...l(!1),
2168
2170
  opacity: s < o ? 1 : .4
2169
2171
  },
2170
2172
  children: "›"
@@ -2172,7 +2174,7 @@ function gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2172
2174
  ]
2173
2175
  });
2174
2176
  }
2175
- function _t({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2177
+ function vt({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2176
2178
  if (!t.length) return null;
2177
2179
  let o = Math.min(Math.max(Number(n) || 1, 1), t.length), s = (e) => ({
2178
2180
  width: 32,
@@ -2203,21 +2205,21 @@ function _t({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2203
2205
  minWidth: 24
2204
2206
  }
2205
2207
  });
2206
- return /* @__PURE__ */ l("div", {
2208
+ return /* @__PURE__ */ u("div", {
2207
2209
  ref: a,
2208
2210
  style: {
2209
2211
  display: "flex",
2210
2212
  flexDirection: r ? "column" : "row",
2211
2213
  alignItems: r ? "stretch" : "flex-start",
2212
2214
  gap: r ? 4 : 8,
2213
- ...m(i)
2215
+ ...h(i)
2214
2216
  },
2215
2217
  children: t.map((t, n) => {
2216
2218
  let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
2217
- return /* @__PURE__ */ u(e, { children: [n > 0 && /* @__PURE__ */ l("div", {
2219
+ return /* @__PURE__ */ d(e, { children: [n > 0 && /* @__PURE__ */ u("div", {
2218
2220
  style: c(i <= o),
2219
2221
  "aria-hidden": !0
2220
- }), /* @__PURE__ */ u("div", {
2222
+ }), /* @__PURE__ */ d("div", {
2221
2223
  style: {
2222
2224
  display: "flex",
2223
2225
  flexDirection: r ? "row" : "column",
@@ -2226,19 +2228,19 @@ function _t({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2226
2228
  minWidth: 0,
2227
2229
  textAlign: r ? "left" : "center"
2228
2230
  },
2229
- children: [/* @__PURE__ */ l("div", {
2231
+ children: [/* @__PURE__ */ u("div", {
2230
2232
  style: s(a),
2231
2233
  children: a === "done" ? "✓" : i
2232
- }), /* @__PURE__ */ u("div", {
2234
+ }), /* @__PURE__ */ d("div", {
2233
2235
  style: { minWidth: 0 },
2234
- children: [/* @__PURE__ */ l("div", {
2236
+ children: [/* @__PURE__ */ u("div", {
2235
2237
  style: {
2236
2238
  fontSize: 13,
2237
2239
  fontWeight: a === "active" ? 700 : 500,
2238
2240
  opacity: a === "todo" ? .6 : 1
2239
2241
  },
2240
2242
  children: t.label
2241
- }), t.description && /* @__PURE__ */ l("div", {
2243
+ }), t.description && /* @__PURE__ */ u("div", {
2242
2244
  style: {
2243
2245
  fontSize: 12,
2244
2246
  opacity: .6
@@ -2250,7 +2252,7 @@ function _t({ steps: t = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2250
2252
  })
2251
2253
  });
2252
2254
  }
2253
- var vt = {
2255
+ var yt = {
2254
2256
  small: {
2255
2257
  w: 132,
2256
2258
  h: 46,
@@ -2272,10 +2274,10 @@ var vt = {
2272
2274
  title: 12.5,
2273
2275
  avatar: 46
2274
2276
  }
2275
- }, yt = (e) => vt[e] ?? vt.medium;
2276
- vt.medium.w, vt.medium.h;
2277
- function bt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2278
- let r = yt(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 = [];
2277
+ }, bt = (e) => yt[e] ?? yt.medium;
2278
+ yt.medium.w, yt.medium.h;
2279
+ function xt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2280
+ let r = bt(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 = [];
2279
2281
  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);
2280
2282
  let d = /* @__PURE__ */ new Map(), f = (e, t) => {
2281
2283
  if (t.has(e.id)) return 0;
@@ -2327,18 +2329,18 @@ function bt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2327
2329
  horizontal: n
2328
2330
  };
2329
2331
  }
2330
- var xt = (e, t) => {
2332
+ var St = (e, t) => {
2331
2333
  let n = String(e ?? "");
2332
2334
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
2333
- }, St = (e) => {
2335
+ }, Ct = (e) => {
2334
2336
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
2335
2337
  if (!t) return "#ffffff";
2336
2338
  let n = t[1];
2337
2339
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
2338
2340
  let r = parseInt(n, 16);
2339
2341
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
2340
- }, Ct = (e) => !!(e?.cv?.trim?.() || e?.photo);
2341
- function wt(e, t = {}) {
2342
+ }, wt = (e) => !!(e?.cv?.trim?.() || e?.photo);
2343
+ function Tt(e, t = {}) {
2342
2344
  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 ? "" : K(e);
2343
2345
  return n.map((e) => {
2344
2346
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
@@ -2353,15 +2355,15 @@ function wt(e, t = {}) {
2353
2355
  };
2354
2356
  });
2355
2357
  }
2356
- var Tt = {
2358
+ var Et = {
2357
2359
  size: 36,
2358
2360
  pad: 10
2359
2361
  };
2360
- function Et({ node: e, onClose: t }) {
2361
- return r(() => {
2362
+ function Dt({ node: e, onClose: t }) {
2363
+ return i(() => {
2362
2364
  let e = (e) => e.key === "Escape" && t();
2363
2365
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
2364
- }, [t]), /* @__PURE__ */ l("div", {
2366
+ }, [t]), /* @__PURE__ */ u("div", {
2365
2367
  onClick: t,
2366
2368
  role: "dialog",
2367
2369
  "aria-modal": "true",
@@ -2376,7 +2378,7 @@ function Et({ node: e, onClose: t }) {
2376
2378
  justifyContent: "center",
2377
2379
  padding: 16
2378
2380
  },
2379
- children: /* @__PURE__ */ u("div", {
2381
+ children: /* @__PURE__ */ d("div", {
2380
2382
  onClick: (e) => e.stopPropagation(),
2381
2383
  style: {
2382
2384
  background: "var(--page-bg, #ffffff)",
@@ -2391,7 +2393,7 @@ function Et({ node: e, onClose: t }) {
2391
2393
  boxShadow: "0 24px 64px rgba(15, 23, 42, 0.35)"
2392
2394
  },
2393
2395
  children: [
2394
- /* @__PURE__ */ l("button", {
2396
+ /* @__PURE__ */ u("button", {
2395
2397
  type: "button",
2396
2398
  "aria-label": "Close",
2397
2399
  onClick: t,
@@ -2412,14 +2414,14 @@ function Et({ node: e, onClose: t }) {
2412
2414
  },
2413
2415
  children: "×"
2414
2416
  }),
2415
- /* @__PURE__ */ u("div", {
2417
+ /* @__PURE__ */ d("div", {
2416
2418
  style: {
2417
2419
  display: "flex",
2418
2420
  alignItems: "center",
2419
2421
  gap: 14,
2420
2422
  marginBottom: e.cv ? 14 : 0
2421
2423
  },
2422
- children: [e.photo && /* @__PURE__ */ l("img", {
2424
+ children: [e.photo && /* @__PURE__ */ u("img", {
2423
2425
  src: e.photo,
2424
2426
  alt: "",
2425
2427
  style: {
@@ -2429,15 +2431,15 @@ function Et({ node: e, onClose: t }) {
2429
2431
  objectFit: "cover",
2430
2432
  flexShrink: 0
2431
2433
  }
2432
- }), /* @__PURE__ */ u("div", {
2434
+ }), /* @__PURE__ */ d("div", {
2433
2435
  style: { minWidth: 0 },
2434
- children: [/* @__PURE__ */ l("div", {
2436
+ children: [/* @__PURE__ */ u("div", {
2435
2437
  style: {
2436
2438
  fontSize: 18,
2437
2439
  fontWeight: 700
2438
2440
  },
2439
2441
  children: e.name
2440
- }), e.title && /* @__PURE__ */ l("div", {
2442
+ }), e.title && /* @__PURE__ */ u("div", {
2441
2443
  style: {
2442
2444
  fontSize: 13,
2443
2445
  opacity: .65
@@ -2446,7 +2448,7 @@ function Et({ node: e, onClose: t }) {
2446
2448
  })]
2447
2449
  })]
2448
2450
  }),
2449
- e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ l("p", {
2451
+ e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ u("p", {
2450
2452
  style: {
2451
2453
  fontSize: 14,
2452
2454
  lineHeight: 1.6,
@@ -2454,7 +2456,7 @@ function Et({ node: e, onClose: t }) {
2454
2456
  },
2455
2457
  children: e
2456
2458
  }, t)),
2457
- e.href && /* @__PURE__ */ l("a", {
2459
+ e.href && /* @__PURE__ */ u("a", {
2458
2460
  href: e.href,
2459
2461
  target: "_blank",
2460
2462
  rel: "noopener noreferrer",
@@ -2475,9 +2477,9 @@ function Et({ node: e, onClose: t }) {
2475
2477
  })
2476
2478
  });
2477
2479
  }
2478
- function Dt({ nodes: e = [], source: t, nameField: a, titleField: o, photoField: d, parentField: f, cvField: p, hrefField: h, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
2479
- let x = i(), [S, C] = s(null), { tenant: w, apiUrl: T } = n(V), E = n(H)?.[t], [D, O] = s(null);
2480
- r(() => {
2480
+ function Ot({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: s, parentField: f, cvField: p, hrefField: m, size: g = "medium", horizontal: _ = !1, style: v, nodeRef: y, interactive: b = !0 }) {
2481
+ let x = a(), [S, C] = c(null), { tenant: w, apiUrl: T } = r(H), E = r(U)?.[t], [D, O] = c(null);
2482
+ i(() => {
2481
2483
  if (!t || E) return;
2482
2484
  let e = !0;
2483
2485
  return fetch(`${T}/dynamic/${encodeURIComponent(t)}`, { headers: w ? { "x-tenant": w } : {} }).then((e) => e.json()).then((t) => {
@@ -2492,18 +2494,18 @@ function Dt({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
2492
2494
  T,
2493
2495
  E
2494
2496
  ]);
2495
- let k = t ? wt(E ?? D ?? [], {
2496
- nameField: a,
2497
+ let k = t ? Tt(E ?? D ?? [], {
2498
+ nameField: n,
2497
2499
  titleField: o,
2498
- photoField: d,
2500
+ photoField: s,
2499
2501
  parentField: f,
2500
2502
  cvField: p,
2501
- hrefField: h
2502
- }) : e, A = yt(g), { boxes: j, links: M, width: N, height: P } = bt(k, {
2503
+ hrefField: m
2504
+ }) : e, A = bt(g), { boxes: j, links: M, width: N, height: P } = xt(k, {
2503
2505
  size: g,
2504
2506
  horizontal: _
2505
2507
  });
2506
- if (!j.length) return !b && t ? /* @__PURE__ */ u("div", {
2508
+ if (!j.length) return !b && t ? /* @__PURE__ */ d("div", {
2507
2509
  ref: y,
2508
2510
  style: {
2509
2511
  padding: 18,
@@ -2512,7 +2514,7 @@ function Dt({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
2512
2514
  fontSize: 13,
2513
2515
  opacity: .7,
2514
2516
  textAlign: "center",
2515
- ...m(v)
2517
+ ...h(v)
2516
2518
  },
2517
2519
  children: [
2518
2520
  "Org Chart — no published entries in “",
@@ -2521,14 +2523,14 @@ function Dt({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
2521
2523
  ]
2522
2524
  }) : null;
2523
2525
  let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
2524
- return /* @__PURE__ */ u("div", {
2526
+ return /* @__PURE__ */ d("div", {
2525
2527
  ref: y,
2526
2528
  style: {
2527
2529
  maxWidth: "100%",
2528
2530
  overflowX: "auto",
2529
- ...m(v)
2531
+ ...h(v)
2530
2532
  },
2531
- children: [/* @__PURE__ */ u("svg", {
2533
+ children: [/* @__PURE__ */ d("svg", {
2532
2534
  viewBox: `0 0 ${N} ${P}`,
2533
2535
  role: "img",
2534
2536
  "aria-label": "Organization chart",
@@ -2539,64 +2541,64 @@ function Dt({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
2539
2541
  height: "auto",
2540
2542
  margin: "0 auto"
2541
2543
  },
2542
- children: [M.map((e, t) => /* @__PURE__ */ l("path", {
2544
+ children: [M.map((e, t) => /* @__PURE__ */ u("path", {
2543
2545
  d: _ ? `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}`,
2544
2546
  fill: "none",
2545
2547
  stroke: "rgba(148, 163, 184, 0.7)",
2546
2548
  strokeWidth: "1.5"
2547
2549
  }, t)), j.map(({ node: e, x: t, y: n }) => {
2548
- 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 ? St(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", d = i ? St(e.color2) : s, f = b && (Ct(e) || e.href), p = () => Ct(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Tt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
2549
- return /* @__PURE__ */ u("g", {
2550
+ 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 ? Ct(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? Ct(e.color2) : s, f = b && (wt(e) || e.href), p = () => wt(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Et.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
2551
+ return /* @__PURE__ */ d("g", {
2550
2552
  onClick: f ? p : void 0,
2551
2553
  style: f ? { cursor: "pointer" } : void 0,
2552
2554
  role: f ? "button" : void 0,
2553
2555
  "aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
2554
2556
  children: [
2555
- i && e.gradient ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("linearGradient", {
2557
+ i && e.gradient ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("linearGradient", {
2556
2558
  id: `${x}-${e.id}-grad`,
2557
2559
  x1: "0",
2558
2560
  y1: "0",
2559
2561
  x2: "0",
2560
2562
  y2: "1",
2561
- children: [/* @__PURE__ */ l("stop", {
2563
+ children: [/* @__PURE__ */ u("stop", {
2562
2564
  offset: "0%",
2563
2565
  stopColor: e.color || "var(--page-accent, #4f46e5)"
2564
- }), /* @__PURE__ */ l("stop", {
2566
+ }), /* @__PURE__ */ u("stop", {
2565
2567
  offset: "100%",
2566
2568
  stopColor: e.color2
2567
2569
  })]
2568
- }), /* @__PURE__ */ l("rect", {
2570
+ }), /* @__PURE__ */ u("rect", {
2569
2571
  x: t,
2570
2572
  y: n,
2571
2573
  width: A.w,
2572
2574
  height: A.h,
2573
2575
  rx: "10",
2574
2576
  fill: `url(#${x}-${e.id}-grad)`
2575
- })] }) : i ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
2577
+ })] }) : i ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
2576
2578
  id: `${x}-${e.id}-box`,
2577
- children: /* @__PURE__ */ l("rect", {
2579
+ children: /* @__PURE__ */ u("rect", {
2578
2580
  x: t,
2579
2581
  y: n,
2580
2582
  width: A.w,
2581
2583
  height: A.h,
2582
2584
  rx: "10"
2583
2585
  })
2584
- }), /* @__PURE__ */ u("g", {
2586
+ }), /* @__PURE__ */ d("g", {
2585
2587
  clipPath: `url(#${x}-${e.id}-box)`,
2586
- children: [/* @__PURE__ */ l("rect", {
2588
+ children: [/* @__PURE__ */ u("rect", {
2587
2589
  x: t,
2588
2590
  y: n,
2589
2591
  width: A.w,
2590
2592
  height: _,
2591
2593
  fill: o
2592
- }), /* @__PURE__ */ l("rect", {
2594
+ }), /* @__PURE__ */ u("rect", {
2593
2595
  x: t,
2594
2596
  y: n + _,
2595
2597
  width: A.w,
2596
2598
  height: A.h - _,
2597
2599
  fill: e.color2
2598
2600
  })]
2599
- })] }) : /* @__PURE__ */ l("rect", {
2601
+ })] }) : /* @__PURE__ */ u("rect", {
2600
2602
  x: t,
2601
2603
  y: n,
2602
2604
  width: A.w,
@@ -2606,94 +2608,94 @@ function Dt({ nodes: e = [], source: t, nameField: a, titleField: o, photoField:
2606
2608
  stroke: a ? "none" : "var(--page-accent, #4f46e5)",
2607
2609
  strokeWidth: a ? 0 : 1.5
2608
2610
  }),
2609
- e.photo && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
2611
+ e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
2610
2612
  id: `${x}-${e.id}`,
2611
- children: /* @__PURE__ */ l("circle", {
2612
- cx: t + Tt.pad + A.avatar / 2,
2613
+ children: /* @__PURE__ */ u("circle", {
2614
+ cx: t + Et.pad + A.avatar / 2,
2613
2615
  cy: n + A.h / 2,
2614
2616
  r: A.avatar / 2
2615
2617
  })
2616
- }), /* @__PURE__ */ l("image", {
2618
+ }), /* @__PURE__ */ u("image", {
2617
2619
  href: e.photo,
2618
- x: t + Tt.pad,
2620
+ x: t + Et.pad,
2619
2621
  y: n + (A.h - A.avatar) / 2,
2620
2622
  width: A.avatar,
2621
2623
  height: A.avatar,
2622
2624
  preserveAspectRatio: "xMidYMid slice",
2623
2625
  clipPath: `url(#${x}-${e.id})`
2624
2626
  })] }),
2625
- i && !e.gradient ? /* @__PURE__ */ u(c, { children: [e.title && /* @__PURE__ */ l("text", {
2627
+ i && !e.gradient ? /* @__PURE__ */ d(l, { children: [e.title && /* @__PURE__ */ u("text", {
2626
2628
  x: m,
2627
2629
  y: n + _ / 2 + A.title * .35,
2628
2630
  textAnchor: h,
2629
2631
  fontSize: A.title,
2630
2632
  fontWeight: "600",
2631
2633
  fill: s,
2632
- children: xt(e.title, g + 4)
2633
- }), e.name && /* @__PURE__ */ l("text", {
2634
+ children: St(e.title, g + 4)
2635
+ }), e.name && /* @__PURE__ */ u("text", {
2634
2636
  x: m,
2635
2637
  y: n + _ + _ / 2 + A.name * .35,
2636
2638
  textAnchor: h,
2637
2639
  fontSize: A.name,
2638
2640
  fontWeight: "600",
2639
- fill: d,
2640
- children: xt(e.name, g)
2641
- })] }) : /* @__PURE__ */ u(c, { children: [v[0] && /* @__PURE__ */ l("text", {
2641
+ fill: c,
2642
+ children: St(e.name, g)
2643
+ })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
2642
2644
  x: m,
2643
2645
  y: n + (v[1] ? A.h * .43 : A.h * .57),
2644
2646
  textAnchor: h,
2645
2647
  fontSize: A.name,
2646
2648
  fontWeight: "600",
2647
2649
  fill: s,
2648
- children: xt(v[0], g)
2649
- }), v[1] && /* @__PURE__ */ l("text", {
2650
+ children: St(v[0], g)
2651
+ }), v[1] && /* @__PURE__ */ u("text", {
2650
2652
  x: m,
2651
2653
  y: n + A.h * .73,
2652
2654
  textAnchor: h,
2653
2655
  fontSize: A.title,
2654
2656
  opacity: "0.7",
2655
2657
  fill: s,
2656
- children: xt(v[1], g + 4)
2658
+ children: St(v[1], g + 4)
2657
2659
  })] })
2658
2660
  ]
2659
2661
  }, e.id);
2660
2662
  })]
2661
- }), S && /* @__PURE__ */ l(Et, {
2663
+ }), S && /* @__PURE__ */ u(Dt, {
2662
2664
  node: S,
2663
2665
  onClose: () => C(null)
2664
2666
  })]
2665
2667
  });
2666
2668
  }
2667
- function Ot({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped: o = !0, bordered: c = !1, compact: d = !1, style: f, nodeRef: p }) {
2668
- let { tenant: h, apiUrl: g } = n(V), _ = n(H)?.[i], [v, y] = s(null);
2669
- if (r(() => {
2670
- if (!i || _) return;
2671
- let e = !0, t = i.startsWith("api:") ? `${g}/data/${encodeURIComponent(i.slice(4))}` : `${g}/dynamic/${encodeURIComponent(i)}`;
2672
- return fetch(t, { headers: h ? { "x-tenant": h } : {} }).then((e) => e.json()).then((t) => e && y(Array.isArray(t?.payload) ? t.payload : [])).catch(() => e && y([])), () => {
2669
+ function kt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: s = !1, compact: l = !1, style: f, nodeRef: p }) {
2670
+ let { tenant: m, apiUrl: g } = r(H), _ = r(U)?.[n], [v, y] = c(null);
2671
+ if (i(() => {
2672
+ if (!n || _) return;
2673
+ let e = !0, t = n.startsWith("api:") ? `${g}/data/${encodeURIComponent(n.slice(4))}` : `${g}/dynamic/${encodeURIComponent(n)}`;
2674
+ return fetch(t, { headers: m ? { "x-tenant": m } : {} }).then((e) => e.json()).then((t) => e && y(Array.isArray(t?.payload) ? t.payload : [])).catch(() => e && y([])), () => {
2673
2675
  e = !1;
2674
2676
  };
2675
2677
  }, [
2676
- i,
2677
- h,
2678
+ n,
2679
+ m,
2678
2680
  g,
2679
2681
  _
2680
2682
  ]), !e.length) return null;
2681
- let b = i ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => K(W(t?.data, e.field)))) : t, S = d ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = c ? { border: C } : { borderBottom: C };
2682
- return /* @__PURE__ */ l("div", {
2683
+ let b = n ? (_ ?? v ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = b ? b.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, S = l ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = s ? { border: C } : { borderBottom: C };
2684
+ return /* @__PURE__ */ u("div", {
2683
2685
  ref: p,
2684
2686
  style: {
2685
2687
  width: "100%",
2686
2688
  overflowX: "auto",
2687
- ...m(f)
2689
+ ...h(f)
2688
2690
  },
2689
- children: /* @__PURE__ */ u("table", {
2691
+ children: /* @__PURE__ */ d("table", {
2690
2692
  style: {
2691
2693
  width: "100%",
2692
2694
  borderCollapse: "collapse",
2693
2695
  fontSize: 14,
2694
- ...c ? { border: C } : {}
2696
+ ...s ? { border: C } : {}
2695
2697
  },
2696
- children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ l("tr", { children: e.map((e, t) => /* @__PURE__ */ l("th", {
2698
+ children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("th", {
2697
2699
  style: {
2698
2700
  textAlign: "left",
2699
2701
  fontWeight: 600,
@@ -2702,9 +2704,9 @@ function Ot({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
2702
2704
  ...w
2703
2705
  },
2704
2706
  children: e.label ?? e
2705
- }, t)) }) }), /* @__PURE__ */ l("tbody", { children: x.map((t, n) => /* @__PURE__ */ l("tr", {
2707
+ }, t)) }) }), /* @__PURE__ */ u("tbody", { children: x.map((t, n) => /* @__PURE__ */ u("tr", {
2706
2708
  style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2707
- children: e.map((e, n) => /* @__PURE__ */ l("td", {
2709
+ children: e.map((e, n) => /* @__PURE__ */ u("td", {
2708
2710
  style: {
2709
2711
  padding: S,
2710
2712
  ...w
@@ -2715,56 +2717,317 @@ function Ot({ columns: e = [], rows: t = [], source: i, limit: a = 10, striped:
2715
2717
  })
2716
2718
  });
2717
2719
  }
2718
- var kt = {
2719
- PageRoot: pe,
2720
- Section: me,
2721
- Container: he,
2722
- Heading: ge,
2723
- TextBlock: De,
2724
- ButtonBlock: Ae,
2725
- ImageBlock: je,
2726
- Spacer: Le,
2727
- Divider: Re,
2728
- SliderBlock: We,
2729
- CanvasSlider: Ge,
2730
- TabsBlock: Je,
2731
- QuickStack: pt,
2732
- CollectionList: mt,
2733
- BreadcrumbsBlock: ht,
2734
- PaginationBlock: gt,
2735
- StepperBlock: _t,
2736
- OrgChartBlock: Dt,
2737
- TableBlock: Ot,
2738
- AccordionBlock: Ye,
2739
- NavbarBlock: qe,
2740
- ListBlock: Ee,
2741
- TextSpan: ye,
2742
- QuoteBlock: Te,
2743
- TextLink: ke,
2744
- RichTextBlock: Ce,
2745
- RichContentBlock: Ce,
2746
- VideoBlock: Me,
2747
- YouTubeBlock: Pe,
2748
- IframeBlock: Fe,
2749
- EmbedBlock: Ie,
2750
- FormBlock: at,
2751
- FormLabel: ot,
2752
- FormInput: st,
2753
- FormTextarea: ct,
2754
- FormCheckbox: (e) => /* @__PURE__ */ l(lt, {
2720
+ var At = {
2721
+ PageRoot: he,
2722
+ Section: ge,
2723
+ Container: _e,
2724
+ Heading: ve,
2725
+ TextBlock: ke,
2726
+ ButtonBlock: Me,
2727
+ ImageBlock: Ne,
2728
+ Spacer: ze,
2729
+ Divider: Be,
2730
+ SliderBlock: Ke,
2731
+ CanvasSlider: qe,
2732
+ TabsBlock: Ze,
2733
+ QuickStack: mt,
2734
+ CollectionList: ht,
2735
+ BreadcrumbsBlock: gt,
2736
+ PaginationBlock: _t,
2737
+ StepperBlock: vt,
2738
+ OrgChartBlock: Ot,
2739
+ TableBlock: kt,
2740
+ AccordionBlock: Qe,
2741
+ NavbarBlock: Xe,
2742
+ ListBlock: Oe,
2743
+ TextSpan: xe,
2744
+ QuoteBlock: De,
2745
+ TextLink: je,
2746
+ RichTextBlock: Te,
2747
+ RichContentBlock: Te,
2748
+ VideoBlock: Pe,
2749
+ YouTubeBlock: Ie,
2750
+ IframeBlock: Le,
2751
+ EmbedBlock: Re,
2752
+ FormBlock: ot,
2753
+ FormLabel: st,
2754
+ FormInput: ct,
2755
+ FormTextarea: lt,
2756
+ FormCheckbox: (e) => /* @__PURE__ */ u(ut, {
2755
2757
  kind: "checkbox",
2756
2758
  ...e
2757
2759
  }),
2758
- FormRadio: (e) => /* @__PURE__ */ l(lt, {
2760
+ FormRadio: (e) => /* @__PURE__ */ u(ut, {
2759
2761
  kind: "radio",
2760
2762
  ...e
2761
2763
  }),
2762
- FormSelect: ut,
2763
- FormFile: dt,
2764
- FormSubmit: ft
2764
+ FormSelect: dt,
2765
+ FormFile: ft,
2766
+ FormSubmit: pt
2767
+ }, jt = {
2768
+ id: "auth",
2769
+ label: "Accounts",
2770
+ category: "Apps",
2771
+ keys: ["SiteLoginForm", "SiteAccountMenu"],
2772
+ ssr: "shell",
2773
+ settings: ["apps.auth.redirect"]
2774
+ }, Mt = t({
2775
+ user: null,
2776
+ status: "idle",
2777
+ ensure: () => {},
2778
+ refresh: () => {},
2779
+ signOut: () => {}
2780
+ }), Nt = () => {
2781
+ let e = r(Mt);
2782
+ return i(() => {
2783
+ e.ensure();
2784
+ }, [e]), e;
2765
2785
  };
2786
+ function Pt({ children: e, initialUser: t, disabled: i, apiUrl: a, tenant: l }) {
2787
+ let d = r(H), f = a || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : i ? "guest" : "idle"), v = s(!1), y = n((e, t) => fetch(`${f}${e}`, {
2788
+ ...t,
2789
+ credentials: "include",
2790
+ headers: {
2791
+ "content-type": "application/json",
2792
+ ...p ? { "x-tenant": p } : {},
2793
+ ...t?.headers
2794
+ }
2795
+ }), [f, p]), b = n(() => i ? Promise.resolve(null) : y("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
2796
+ let t = e?.payload ?? null;
2797
+ return h(t), _(t ? "user" : "guest"), t;
2798
+ }).catch(() => (h(null), _("guest"), null)), [y, i]), x = n(() => y("/site/logout", { method: "post" }).catch(() => {}).then(() => {
2799
+ h(null), _("guest");
2800
+ }), [y]), S = n(() => {
2801
+ v.current || i || t || (v.current = !0, _("loading"), b());
2802
+ }, [
2803
+ i,
2804
+ t,
2805
+ b
2806
+ ]), C = o(() => ({
2807
+ user: m,
2808
+ status: g,
2809
+ ensure: S,
2810
+ refresh: b,
2811
+ signOut: x
2812
+ }), [
2813
+ m,
2814
+ g,
2815
+ S,
2816
+ b,
2817
+ x
2818
+ ]);
2819
+ return /* @__PURE__ */ u(Mt.Provider, {
2820
+ value: C,
2821
+ children: e
2822
+ });
2823
+ }
2824
+ function Ft({ when: e, children: t }) {
2825
+ let { status: n } = Nt();
2826
+ return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
2827
+ }
2828
+ //#endregion
2829
+ //#region ../ui/src/components/builder/apps/auth/views.jsx
2830
+ function It({ 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 }) {
2831
+ let { tenant: g, apiUrl: _, settings: v } = r(H), [y, b] = c("form"), [x, S] = c(""), [C, w] = c(!1), T = e === "register", E = f ? m || "form" : y, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
2832
+ if (e.preventDefault(), f) return;
2833
+ let n = new FormData(e.currentTarget);
2834
+ w(!0), S("");
2835
+ try {
2836
+ let e = await fetch(`${_ || "/api"}/site/${T ? "register" : "login"}`, {
2837
+ method: "post",
2838
+ headers: {
2839
+ "content-type": "application/json",
2840
+ ...g ? { "x-tenant": g } : {}
2841
+ },
2842
+ credentials: "same-origin",
2843
+ body: JSON.stringify({
2844
+ email: n.get("email"),
2845
+ password: n.get("password"),
2846
+ ...T ? { name: n.get("name") || "" } : {}
2847
+ })
2848
+ }), r = await e.json().catch(() => null);
2849
+ if (!e.ok || r?.success === !1) {
2850
+ S(r?.error?.message || "Sign-in failed"), b("error"), w(!1);
2851
+ return;
2852
+ }
2853
+ if (b("success"), typeof window < "u") {
2854
+ let e = D(t) || D(new URLSearchParams(window.location.search).get("next")) || D(v?.["apps.auth.redirect"]) || "/";
2855
+ window.location.assign(e);
2856
+ }
2857
+ } catch {
2858
+ S("Sign-in failed"), b("error"), w(!1);
2859
+ }
2860
+ };
2861
+ return /* @__PURE__ */ d("div", {
2862
+ ref: l,
2863
+ style: {
2864
+ display: "grid",
2865
+ gap: 12,
2866
+ maxWidth: 360,
2867
+ ...h(s)
2868
+ },
2869
+ children: [
2870
+ /* @__PURE__ */ d("form", {
2871
+ onSubmit: O,
2872
+ style: {
2873
+ display: E === "form" ? "grid" : "none",
2874
+ gap: 10
2875
+ },
2876
+ children: [
2877
+ T ? /* @__PURE__ */ d("label", {
2878
+ style: {
2879
+ ...X,
2880
+ display: "grid",
2881
+ gap: 6
2882
+ },
2883
+ children: [a, /* @__PURE__ */ u("input", {
2884
+ name: "name",
2885
+ type: "text",
2886
+ style: Z,
2887
+ ...Q(f)
2888
+ })]
2889
+ }) : null,
2890
+ /* @__PURE__ */ d("label", {
2891
+ style: {
2892
+ ...X,
2893
+ display: "grid",
2894
+ gap: 6
2895
+ },
2896
+ children: [n, /* @__PURE__ */ u("input", {
2897
+ name: "email",
2898
+ type: "email",
2899
+ required: !f,
2900
+ style: Z,
2901
+ ...Q(f)
2902
+ })]
2903
+ }),
2904
+ /* @__PURE__ */ d("label", {
2905
+ style: {
2906
+ ...X,
2907
+ display: "grid",
2908
+ gap: 6
2909
+ },
2910
+ children: [i, /* @__PURE__ */ u("input", {
2911
+ name: "password",
2912
+ type: "password",
2913
+ required: !f,
2914
+ style: Z,
2915
+ ...Q(f)
2916
+ })]
2917
+ }),
2918
+ /* @__PURE__ */ u("button", {
2919
+ type: f ? "button" : "submit",
2920
+ disabled: C || void 0,
2921
+ style: {
2922
+ ...J,
2923
+ border: 0,
2924
+ padding: "10px 22px",
2925
+ borderRadius: 8,
2926
+ fontSize: 15,
2927
+ fontWeight: 600,
2928
+ cursor: "pointer",
2929
+ opacity: C ? .6 : 1
2930
+ },
2931
+ children: o || (T ? "Create account" : "Sign in")
2932
+ }),
2933
+ x ? /* @__PURE__ */ u("p", {
2934
+ style: {
2935
+ margin: 0,
2936
+ fontSize: 14,
2937
+ color: "#dc2626"
2938
+ },
2939
+ children: x
2940
+ }) : null
2941
+ ]
2942
+ }),
2943
+ /* @__PURE__ */ u("div", {
2944
+ style: { display: E === "success" ? "block" : "none" },
2945
+ children: p?.success ?? null
2946
+ }),
2947
+ /* @__PURE__ */ u("div", {
2948
+ style: { display: E === "error" ? "block" : "none" },
2949
+ children: p?.error ?? null
2950
+ })
2951
+ ]
2952
+ });
2953
+ }
2954
+ function Lt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
2955
+ let { user: c, status: l, signOut: f } = Nt(), p = a ? s || "user" : l, m = a ? {
2956
+ name: "Ada Lovelace",
2957
+ email: "ada@example.com"
2958
+ } : c;
2959
+ return p === "loading" ? /* @__PURE__ */ u("div", {
2960
+ ref: i,
2961
+ style: {
2962
+ minHeight: 24,
2963
+ ...h(r)
2964
+ }
2965
+ }) : p === "user" ? /* @__PURE__ */ d("div", {
2966
+ ref: i,
2967
+ style: {
2968
+ display: "flex",
2969
+ alignItems: "center",
2970
+ gap: 10,
2971
+ ...h(r)
2972
+ },
2973
+ children: [
2974
+ /* @__PURE__ */ d("span", {
2975
+ style: {
2976
+ ...X,
2977
+ fontWeight: 600
2978
+ },
2979
+ children: [
2980
+ e,
2981
+ " ",
2982
+ m?.name || m?.email || ""
2983
+ ]
2984
+ }),
2985
+ n && m?.email ? /* @__PURE__ */ u("span", {
2986
+ style: {
2987
+ ...X,
2988
+ opacity: .7
2989
+ },
2990
+ children: m.email
2991
+ }) : null,
2992
+ /* @__PURE__ */ u("button", {
2993
+ type: "button",
2994
+ onClick: a ? void 0 : f,
2995
+ style: {
2996
+ ...J,
2997
+ border: 0,
2998
+ padding: "8px 16px",
2999
+ borderRadius: 8,
3000
+ fontSize: 14,
3001
+ cursor: a ? "default" : "pointer"
3002
+ },
3003
+ ...Q(a),
3004
+ children: t
3005
+ })
3006
+ ]
3007
+ }) : /* @__PURE__ */ u("div", {
3008
+ ref: i,
3009
+ style: {
3010
+ display: "flex",
3011
+ alignItems: "center",
3012
+ gap: 10,
3013
+ ...h(r)
3014
+ },
3015
+ children: o?.signedOut ?? null
3016
+ });
3017
+ }
3018
+ //#endregion
3019
+ //#region ../ui/src/components/builder/apps/index.js
3020
+ var Rt = [jt], zt = {
3021
+ SiteLoginForm: It,
3022
+ SiteAccountMenu: Lt
3023
+ };
3024
+ new Set(Rt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
2766
3025
  //#endregion
2767
3026
  //#region ../ui/src/components/builder/render.jsx
3027
+ var Bt = {
3028
+ ...At,
3029
+ ...zt
3030
+ };
2768
3031
  function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2769
3032
  let o = n[t];
2770
3033
  if (!o || o.hidden) return null;
@@ -2773,99 +3036,110 @@ function $(t, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2773
3036
  let n = o.props?.componentId, s = r?.[n];
2774
3037
  if (!s?.template || i.has(n)) return null;
2775
3038
  let c = new Set(i).add(n);
2776
- return /* @__PURE__ */ l(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
3039
+ return /* @__PURE__ */ u(e, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, t);
2777
3040
  }
2778
- let u = kt[s];
2779
- if (!u) return null;
2780
- let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0;
2781
- return /* @__PURE__ */ l(u, {
3041
+ let l = Bt[s];
3042
+ if (!l) return null;
3043
+ let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
2782
3044
  ...c,
2783
3045
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
2784
3046
  linked: p,
2785
3047
  nodeRef: (e) => {
2786
- e && (e.setAttribute("data-wb", t), v(e, c));
3048
+ e && (e.setAttribute("data-wb", t), y(e, c));
2787
3049
  },
2788
3050
  children: d.length ? d : void 0
2789
3051
  }, t);
3052
+ return c.when && c.when !== "always" ? /* @__PURE__ */ u(Ft, {
3053
+ when: c.when,
3054
+ children: m
3055
+ }, t) : m;
2790
3056
  }
2791
3057
  //#endregion
2792
3058
  //#region ../ui/src/components/builder/PageRenderer.jsx
2793
- var At = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2794
- function jt({ blocks: e, theme: t, components: n, mode: i = "auto", style: o, custom: s, tenant: c, apiUrl: d, datasets: f, locale: p, direction: m }) {
2795
- let h = s?.js?.trim();
2796
- if (r(() => {
2797
- if (!h) return;
3059
+ var Vt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
3060
+ function Ht({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: l, datasets: f, locale: p, direction: m, settings: h, siteUser: g }) {
3061
+ let _ = s?.js?.trim();
3062
+ if (i(() => {
3063
+ if (!_) return;
2798
3064
  let e = document.createElement("script");
2799
- return e.text = h, document.body.appendChild(e), () => e.remove();
2800
- }, [h]), !e?.ROOT) return null;
2801
- let g = {
3065
+ return e.text = _, document.body.appendChild(e), () => e.remove();
3066
+ }, [_]), !e?.ROOT) return null;
3067
+ let v = {
2802
3068
  lang: p || void 0,
2803
3069
  dir: oe(m, p)
2804
- }, _ = {
3070
+ }, y = {
2805
3071
  minHeight: "100%",
2806
3072
  display: "flex",
2807
3073
  flexDirection: "column"
2808
- }, v = $("ROOT", e, n), y = a(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), b = E(e, n), x = T(e, n), S = s?.css?.trim(), C = re(e, n).map((e) => /* @__PURE__ */ l("link", {
3074
+ }, b = $("ROOT", e, n), x = o(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), S = D(e, n), C = E(e, n), w = s?.css?.trim(), T = re(e, n).map((e) => /* @__PURE__ */ u("link", {
2809
3075
  rel: "stylesheet",
2810
3076
  precedence: "default",
2811
- href: ne(e)
3077
+ href: V(e)
2812
3078
  }, e));
2813
- if (i !== "auto") return /* @__PURE__ */ l(V.Provider, {
3079
+ if (r !== "auto") return /* @__PURE__ */ u(H.Provider, {
2814
3080
  value: {
2815
3081
  tenant: c || "",
2816
- apiUrl: d || "/api",
2817
- locale: p || ""
3082
+ apiUrl: l || "/api",
3083
+ locale: p || "",
3084
+ settings: h ?? null
2818
3085
  },
2819
- children: /* @__PURE__ */ l(H.Provider, {
2820
- value: f ?? null,
2821
- children: /* @__PURE__ */ l(U.Provider, {
2822
- value: y,
2823
- children: /* @__PURE__ */ u("div", {
2824
- ...g,
2825
- style: {
2826
- ..._,
2827
- ...I(t, i),
2828
- ...o
2829
- },
2830
- children: [
2831
- C,
2832
- b && /* @__PURE__ */ l("style", { children: b }),
2833
- x && /* @__PURE__ */ l("style", { children: x }),
2834
- S && /* @__PURE__ */ l("style", { children: S }),
2835
- v
2836
- ]
3086
+ children: /* @__PURE__ */ u(Pt, {
3087
+ initialUser: g,
3088
+ children: /* @__PURE__ */ u(U.Provider, {
3089
+ value: f ?? null,
3090
+ children: /* @__PURE__ */ u(W.Provider, {
3091
+ value: x,
3092
+ children: /* @__PURE__ */ d("div", {
3093
+ ...v,
3094
+ style: {
3095
+ ...y,
3096
+ ...L(t, r),
3097
+ ...a
3098
+ },
3099
+ children: [
3100
+ T,
3101
+ S && /* @__PURE__ */ u("style", { children: S }),
3102
+ C && /* @__PURE__ */ u("style", { children: C }),
3103
+ w && /* @__PURE__ */ u("style", { children: w }),
3104
+ b
3105
+ ]
3106
+ })
2837
3107
  })
2838
3108
  })
2839
3109
  })
2840
3110
  });
2841
- let w = N(t);
2842
- return /* @__PURE__ */ l(V.Provider, {
3111
+ let O = P(t);
3112
+ return /* @__PURE__ */ u(H.Provider, {
2843
3113
  value: {
2844
3114
  tenant: c || "",
2845
- apiUrl: d || "/api",
2846
- locale: p || ""
3115
+ apiUrl: l || "/api",
3116
+ locale: p || "",
3117
+ settings: h ?? null
2847
3118
  },
2848
- children: /* @__PURE__ */ l(H.Provider, {
2849
- value: f ?? null,
2850
- children: /* @__PURE__ */ l(U.Provider, {
2851
- value: y,
2852
- children: /* @__PURE__ */ u("div", {
2853
- ...g,
2854
- className: "webim-page",
2855
- style: {
2856
- ..._,
2857
- ...F(t),
2858
- ...o
2859
- },
2860
- children: [
2861
- /* @__PURE__ */ l("style", { children: `.webim-page { ${At(P(w.light))} }
2862
- @media (prefers-color-scheme: dark) { .webim-page { ${At(P(w.dark))} } }` }),
2863
- C,
2864
- b && /* @__PURE__ */ l("style", { children: b }),
2865
- x && /* @__PURE__ */ l("style", { children: x }),
2866
- S && /* @__PURE__ */ l("style", { children: S }),
2867
- v
2868
- ]
3119
+ children: /* @__PURE__ */ u(Pt, {
3120
+ initialUser: g,
3121
+ children: /* @__PURE__ */ u(U.Provider, {
3122
+ value: f ?? null,
3123
+ children: /* @__PURE__ */ u(W.Provider, {
3124
+ value: x,
3125
+ children: /* @__PURE__ */ d("div", {
3126
+ ...v,
3127
+ className: "webim-page",
3128
+ style: {
3129
+ ...y,
3130
+ ...I(t),
3131
+ ...a
3132
+ },
3133
+ children: [
3134
+ /* @__PURE__ */ u("style", { children: `.webim-page { ${Vt(F(O.light))} }
3135
+ @media (prefers-color-scheme: dark) { .webim-page { ${Vt(F(O.dark))} } }` }),
3136
+ T,
3137
+ S && /* @__PURE__ */ u("style", { children: S }),
3138
+ C && /* @__PURE__ */ u("style", { children: C }),
3139
+ w && /* @__PURE__ */ u("style", { children: w }),
3140
+ b
3141
+ ]
3142
+ })
2869
3143
  })
2870
3144
  })
2871
3145
  })
@@ -2873,8 +3147,8 @@ function jt({ blocks: e, theme: t, components: n, mode: i = "auto", style: o, cu
2873
3147
  }
2874
3148
  //#endregion
2875
3149
  //#region src/WebimContent.jsx
2876
- function Mt({ bundle: e, mode: t = "auto", style: n }) {
2877
- return e?.blocks?.ROOT ? /* @__PURE__ */ l(jt, {
3150
+ function Ut({ bundle: e, mode: t = "auto", style: n }) {
3151
+ return e?.blocks?.ROOT ? /* @__PURE__ */ u(Ht, {
2878
3152
  blocks: e.blocks,
2879
3153
  theme: e.theme,
2880
3154
  components: e.components,
@@ -2884,54 +3158,55 @@ function Mt({ bundle: e, mode: t = "auto", style: n }) {
2884
3158
  datasets: e.datasets,
2885
3159
  locale: e.locale,
2886
3160
  direction: e.direction,
3161
+ settings: e.settings,
2887
3162
  mode: t,
2888
3163
  style: n
2889
3164
  }) : null;
2890
3165
  }
2891
3166
  //#endregion
2892
3167
  //#region src/WebimPage.jsx
2893
- function Nt({ apiUrl: e, tenant: t, slug: n, locale: i, preview: a, token: c, mode: u = "auto", style: d, fallback: f = null, errorFallback: p = null, onLoad: m, onError: h }) {
2894
- let [g, _] = s({ status: "loading" }), v = o({
3168
+ function Wt({ 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 }) {
3169
+ let [g, _] = c({ status: "loading" }), v = s({
2895
3170
  onLoad: m,
2896
3171
  onError: h
2897
3172
  });
2898
3173
  return v.current = {
2899
3174
  onLoad: m,
2900
3175
  onError: h
2901
- }, r(() => {
2902
- let r = !0;
2903
- return _({ status: "loading" }), z({
3176
+ }, i(() => {
3177
+ let i = !0;
3178
+ return _({ status: "loading" }), B({
2904
3179
  apiUrl: e,
2905
3180
  tenant: t,
2906
3181
  slug: n,
2907
- locale: i,
3182
+ locale: r,
2908
3183
  preview: a,
2909
- token: c
3184
+ token: o
2910
3185
  }).then((e) => {
2911
- r && (_({
3186
+ i && (_({
2912
3187
  status: "ready",
2913
3188
  bundle: e
2914
3189
  }), v.current.onLoad?.(e));
2915
3190
  }).catch((e) => {
2916
- r && (_({
3191
+ i && (_({
2917
3192
  status: "error",
2918
3193
  error: e
2919
3194
  }), v.current.onError?.(e));
2920
3195
  }), () => {
2921
- r = !1;
3196
+ i = !1;
2922
3197
  };
2923
3198
  }, [
2924
3199
  e,
2925
3200
  t,
2926
3201
  n,
2927
- i,
3202
+ r,
2928
3203
  a,
2929
- c
2930
- ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ l(Mt, {
3204
+ o
3205
+ ]), g.status === "loading" ? f : g.status === "error" ? typeof p == "function" ? p(g.error) : p : /* @__PURE__ */ u(Ut, {
2931
3206
  bundle: g.bundle,
2932
- mode: u,
3207
+ mode: l,
2933
3208
  style: d
2934
3209
  });
2935
3210
  }
2936
3211
  //#endregion
2937
- export { jt as PageRenderer, Mt as WebimContent, Nt as WebimPage, z as fetchPage, Se as renderRichContent, L as resolveTheme };
3212
+ export { Ht as PageRenderer, Ut as WebimContent, Wt as WebimPage, B as fetchPage, we as renderRichContent, R as resolveTheme };