webim-adapter 0.6.0 → 0.8.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,8 +1,8 @@
1
1
  import { renderToStaticMarkup as e } from "react-dom/server";
2
- import { Fragment as t, createContext as n, useContext as r, useEffect as i, useMemo as a, useState as o } from "react";
3
- import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
2
+ import { Fragment as t, createContext as n, useContext as r, useEffect as i, useId as a, useMemo as o, useState as s } from "react";
3
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
4
4
  //#region ../ui/src/components/builder/locale.js
5
- var u = /* @__PURE__ */ new Set([
5
+ var d = /* @__PURE__ */ new Set([
6
6
  "ar",
7
7
  "he",
8
8
  "fa",
@@ -13,7 +13,7 @@ var u = /* @__PURE__ */ new Set([
13
13
  "yi",
14
14
  "dv",
15
15
  "ckb"
16
- ]), d = (e) => u.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", f = (e, t) => e === "ltr" || e === "rtl" ? e : t ? d(t) : void 0;
16
+ ]), f = (e) => d.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", p = (e, t) => e === "ltr" || e === "rtl" ? e : t ? f(t) : void 0;
17
17
  new Map([
18
18
  {
19
19
  family: "Bebas Neue",
@@ -120,14 +120,14 @@ new Map([
120
120
  fallback: "sans-serif"
121
121
  }
122
122
  ].map((e) => [e.family, e]));
123
- function p(e) {
123
+ function m(e) {
124
124
  return e.length ? `https://fonts.googleapis.com/css2?${e.map((e) => `family=${e.replace(/ /g, "+")}:wght@100..900`).join("&")}&display=swap` : null;
125
125
  }
126
- var m = (e) => p([e]), h = (e) => {
126
+ var h = (e) => m([e]), g = (e) => {
127
127
  let t = typeof e == "string" && e.match(/^"([^"]+)"/);
128
128
  return t ? t[1] : null;
129
129
  };
130
- function g(e, t) {
130
+ function _(e, t) {
131
131
  let n = /* @__PURE__ */ new Set(), r = (e) => {
132
132
  for (let t of Object.values(e || {})) for (let e of [
133
133
  "style",
@@ -135,7 +135,7 @@ function g(e, t) {
135
135
  "pressed",
136
136
  "focused"
137
137
  ]) {
138
- let r = h(t.props?.[e]?.fontFamily);
138
+ let r = g(t.props?.[e]?.fontFamily);
139
139
  r && n.add(r);
140
140
  }
141
141
  };
@@ -145,36 +145,36 @@ function g(e, t) {
145
145
  }
146
146
  //#endregion
147
147
  //#region ../ui/src/components/builder/styles.js
148
- var _ = /* @__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(".")), v = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, y = [
148
+ var v = /* @__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(".")), y = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, b = [
149
149
  "borderWidth",
150
150
  "borderStyle",
151
151
  "borderColor",
152
152
  "borderRadius",
153
153
  "gap"
154
154
  ];
155
- function b(e) {
155
+ function x(e) {
156
156
  let t = {};
157
- for (let n of y) {
157
+ for (let n of b) {
158
158
  let r = e?.[n];
159
- r != null && r !== "" && (t[n] = _.has(n) ? v(r) : r);
159
+ r != null && r !== "" && (t[n] = v.has(n) ? y(r) : r);
160
160
  }
161
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || y.includes(n) || (t[n] = _.has(n) ? v(r) : r);
161
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || b.includes(n) || (t[n] = v.has(n) ? y(r) : r);
162
162
  let { gradientType: n, gradientAngle: r, gradientFrom: i, gradientTo: a } = t;
163
163
  delete t.gradientType, delete t.gradientAngle, delete t.gradientFrom, delete t.gradientTo;
164
164
  let { textShadows: o, textShadowX: s, textShadowY: c, textShadowBlur: l, textShadowColor: u } = t;
165
165
  delete t.textShadows, delete t.textShadowX, delete t.textShadowY, delete t.textShadowBlur, delete t.textShadowColor;
166
- let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${v(e.x ?? 0)} ${v(e.y ?? 0)} ${v(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
166
+ let d = (Array.isArray(o) ? o : []).filter((e) => e && e.on !== !1).map((e) => `${y(e.x ?? 0)} ${y(e.y ?? 0)} ${y(e.blur ?? 0)} ${e.color || "rgba(0, 0, 0, 0.35)"}`);
167
167
  [
168
168
  s,
169
169
  c,
170
170
  l,
171
171
  u
172
- ].some((e) => e !== void 0) && d.push(`${v(s ?? 0)} ${v(c ?? 0)} ${v(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
173
- let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${v(e.x ?? 0)}, ${v(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${f(e.a ?? 0)})` : e.type === "skew" ? `skew(${f(e.x ?? 0)}, ${f(e.y ?? 0)})` : null, { transforms: m, translateX: h, translateY: g, scale: b, rotate: x, skewX: S, skewY: C } = t;
172
+ ].some((e) => e !== void 0) && d.push(`${y(s ?? 0)} ${y(c ?? 0)} ${y(l ?? 0)} ${u || "rgba(0, 0, 0, 0.35)"}`), d.length && (t.textShadow = d.join(", "));
173
+ let f = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}deg` : e, p = (e) => e.type === "move" ? `translate(${y(e.x ?? 0)}, ${y(e.y ?? 0)})` : e.type === "scale" ? `scale(${e.v ?? 1})` : e.type === "rotate" ? `rotate(${f(e.a ?? 0)})` : e.type === "skew" ? `skew(${f(e.x ?? 0)}, ${f(e.y ?? 0)})` : null, { transforms: m, translateX: h, translateY: g, scale: _, rotate: x, skewX: S, skewY: C } = t;
174
174
  delete t.transforms, delete t.translateX, delete t.translateY, delete t.scale, delete t.rotate, delete t.skewX, delete t.skewY;
175
175
  let w = (Array.isArray(m) ? m : []).filter((e) => e && e.on !== !1).map(p).filter(Boolean);
176
- (h !== void 0 || g !== void 0) && w.push(`translate(${v(h ?? 0)}, ${v(g ?? 0)})`), b !== void 0 && w.push(`scale(${b})`), x !== void 0 && w.push(`rotate(${f(x)})`), (S !== void 0 || C !== void 0) && w.push(`skew(${f(S ?? 0)}, ${f(C ?? 0)})`), w.length && (t.transform = w.join(" "));
177
- let T = (e) => `${e.inset ? "inset " : ""}${v(e.x ?? 0)} ${v(e.y ?? 0)} ${v(e.blur ?? 0)} ${v(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;
176
+ (h !== void 0 || g !== void 0) && w.push(`translate(${y(h ?? 0)}, ${y(g ?? 0)})`), _ !== void 0 && w.push(`scale(${_})`), x !== void 0 && w.push(`rotate(${f(x)})`), (S !== void 0 || C !== void 0) && w.push(`skew(${f(S ?? 0)}, ${f(C ?? 0)})`), w.length && (t.transform = w.join(" "));
177
+ let T = (e) => `${e.inset ? "inset " : ""}${y(e.x ?? 0)} ${y(e.y ?? 0)} ${y(e.blur ?? 0)} ${y(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;
178
178
  delete t.shadows, delete t.boxShadowX, delete t.boxShadowY, delete t.boxShadowBlur, delete t.boxShadowSpread, delete t.boxShadowColor, delete t.boxShadowInset;
179
179
  let N = (Array.isArray(E) ? E : []).filter((e) => e && e.on !== !1).map(T);
180
180
  [
@@ -192,76 +192,76 @@ function b(e) {
192
192
  color: j,
193
193
  inset: M
194
194
  })), N.length && (t.boxShadow = N.join(", "));
195
- let P = (e) => e.type === "blur" ? `blur(${v(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: V, filterSaturate: ee } = t;
195
+ let P = (e) => e.type === "blur" ? `blur(${y(e.v ?? 0)})` : e.type === "hue-rotate" ? `hue-rotate(${f(e.v ?? 0)})` : `${e.type}(${e.v ?? 100}%)`, F = (e) => (Array.isArray(e) ? e : []).filter((e) => e && e.on !== !1 && e.type).map(P), { filters: I, backdropFilters: L, filterBlur: R, filterGrayscale: z, filterBrightness: B, filterContrast: V, filterSaturate: ee } = t;
196
196
  delete t.filters, delete t.backdropFilters, delete t.filterBlur, delete t.filterGrayscale, delete t.filterBrightness, delete t.filterContrast, delete t.filterSaturate;
197
197
  let H = F(I);
198
- R !== void 0 && H.push(`blur(${v(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), B !== void 0 && H.push(`brightness(${B}%)`), V !== void 0 && H.push(`contrast(${V}%)`), ee !== void 0 && H.push(`saturate(${ee}%)`), H.length && (t.filter = H.join(" "));
199
- let U = F(L);
200
- U.length && (t.backdropFilter = U.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
201
- let { textStrokeWidth: W, textStrokeColor: G } = t;
202
- delete t.textStrokeWidth, delete t.textStrokeColor, (W !== void 0 || G !== void 0) && (t.WebkitTextStroke = `${v(W ?? 1)} ${G || "currentColor"}`);
203
- let { clipText: te } = t;
204
- delete t.clipText, te && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
205
- let { transitions: K, transitionDuration: ne, transitionEasing: q, transitionProperty: re } = t, ie = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
198
+ R !== void 0 && H.push(`blur(${y(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), B !== void 0 && H.push(`brightness(${B}%)`), V !== void 0 && H.push(`contrast(${V}%)`), ee !== void 0 && H.push(`saturate(${ee}%)`), H.length && (t.filter = H.join(" "));
199
+ let te = F(L);
200
+ te.length && (t.backdropFilter = te.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
201
+ let { textStrokeWidth: U, textStrokeColor: W } = t;
202
+ delete t.textStrokeWidth, delete t.textStrokeColor, (U !== void 0 || W !== void 0) && (t.WebkitTextStroke = `${y(U ?? 1)} ${W || "currentColor"}`);
203
+ let { clipText: G } = t;
204
+ delete t.clipText, G && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
205
+ let { transitions: ne, transitionDuration: K, transitionEasing: re, transitionProperty: q } = t, ie = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
206
206
  delete t.transitions, delete t.transitionDuration, delete t.transitionEasing, delete t.transitionProperty;
207
- let J = (Array.isArray(K) ? K : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ie(e.duration ?? 200)} ${e.easing || "ease"}`);
208
- if (ne !== void 0 && J.push(`${re || "all"} ${ie(ne)} ${q || "ease"}`), J.length && (t.transition = J.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
207
+ let J = (Array.isArray(ne) ? ne : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${ie(e.duration ?? 200)} ${e.easing || "ease"}`);
208
+ if (K !== void 0 && J.push(`${q || "all"} ${ie(K)} ${re || "ease"}`), J.length && (t.transition = J.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
209
209
  let e = `${i || "rgba(0,0,0,0.5)"}, ${a || "transparent"}`, o = n === "radial" ? `radial-gradient(circle, ${e})` : `linear-gradient(${r ?? 180}deg, ${e})`;
210
210
  t.backgroundImage = t.backgroundImage ? `${o}, ${t.backgroundImage}` : o;
211
211
  }
212
212
  delete t.backgroundVideo;
213
- let { overlayColor: Y, overlayOpacity: ae } = t;
213
+ let { overlayColor: Y, overlayOpacity: X } = t;
214
214
  if (delete t.overlayColor, delete t.overlayOpacity, Y) {
215
- let e = `color-mix(in srgb, ${Y} ${ae ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
215
+ let e = `color-mix(in srgb, ${Y} ${X ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
216
216
  t.backgroundImage = t.backgroundImage ? `${n}, ${t.backgroundImage}` : n;
217
217
  }
218
218
  t.backgroundImage && (t.backgroundSize ??= "cover", t.backgroundPosition ??= "center", t.backgroundRepeat ??= "no-repeat");
219
- let { backgroundLayers: oe } = t;
219
+ let { backgroundLayers: ae } = t;
220
220
  delete t.backgroundLayers;
221
- let X = (Array.isArray(oe) ? oe : []).filter((e) => e && e.on !== !1);
222
- if (X.length) {
221
+ let oe = (Array.isArray(ae) ? ae : []).filter((e) => e && e.on !== !1);
222
+ if (oe.length) {
223
223
  let e = [], n = [], r = [], i = [], a = [];
224
- for (let t of X) 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");
224
+ for (let t of oe) 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");
225
225
  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");
226
226
  else {
227
227
  if (!t.src) continue;
228
- e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${v(t.w ?? "auto")} ${v(t.h ?? "auto")}` : t.size || "cover"), r.push(`${v(t.posX ?? 0)} ${v(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
228
+ e.push(`url("${t.src}")`), n.push(t.size === "custom" ? `${y(t.w ?? "auto")} ${y(t.h ?? "auto")}` : t.size || "cover"), r.push(`${y(t.posX ?? 0)} ${y(t.posY ?? 0)}`), i.push(t.repeat || "no-repeat"), a.push(t.fixed ? "fixed" : "scroll");
229
229
  }
230
230
  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(", "));
231
231
  }
232
232
  return t;
233
233
  }
234
- var x = {
234
+ var S = {
235
235
  hover: ":hover",
236
236
  pressed: ":active",
237
237
  focused: ":focus"
238
- }, S = /* @__PURE__ */ new Set([
238
+ }, C = /* @__PURE__ */ new Set([
239
239
  "style",
240
240
  "class",
241
241
  "id",
242
242
  "data-wb",
243
243
  "data-wb-class",
244
244
  "data-slot"
245
- ]), C = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !S.has(e.toLowerCase());
246
- function w(e, t, n = []) {
245
+ ]), w = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !C.has(e.toLowerCase());
246
+ function T(e, t, n = []) {
247
247
  t.htmlId ? e.id = t.htmlId : e.removeAttribute("id");
248
248
  for (let t of n) e.removeAttribute(t);
249
249
  let r = [];
250
250
  for (let n of t.attributes ?? []) {
251
251
  let t = String(n?.name ?? "").trim();
252
- C(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
252
+ w(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
253
253
  }
254
254
  return r;
255
255
  }
256
- var T = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
257
- function E(e, t, n, r = !1) {
258
- let i = Object.entries(b(t)).map(([e, t]) => `${T(e)}: ${t} !important;`).join(" ");
256
+ var E = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
257
+ function D(e, t, n, r = !1) {
258
+ let i = Object.entries(x(t)).map(([e, t]) => `${E(e)}: ${t} !important;`).join(" ");
259
259
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
260
260
  }
261
- function D(e, t, n) {
262
- return Object.entries(x).map(([r, i]) => E(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
261
+ function O(e, t, n) {
262
+ return Object.entries(S).map(([r, i]) => D(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
263
263
  }
264
- var O = [
264
+ var k = [
265
265
  {
266
266
  key: "tablet",
267
267
  max: 991
@@ -274,17 +274,17 @@ var O = [
274
274
  key: "mobile",
275
275
  max: 478
276
276
  }
277
- ], k = (e) => Object.entries(b(e)).map(([e, t]) => `${T(e)}: ${t} !important;`).join(" ");
278
- function A(e, t) {
279
- return O.map(({ key: n, max: r }) => {
280
- let i = t?.[n] ? k(t[n]) : "";
277
+ ], A = (e) => Object.entries(x(e)).map(([e, t]) => `${E(e)}: ${t} !important;`).join(" ");
278
+ function j(e, t) {
279
+ return k.map(({ key: n, max: r }) => {
280
+ let i = t?.[n] ? A(t[n]) : "";
281
281
  return i ? `@media (max-width: ${r}px) { [data-wb="${e}"] { ${i} } }` : "";
282
282
  }).filter(Boolean).join("\n");
283
283
  }
284
- function j(e, t) {
284
+ function M(e, t) {
285
285
  let n = [], r = (e) => {
286
286
  for (let [t, r] of Object.entries(e || {})) {
287
- let e = A(t, r.props);
287
+ let e = j(t, r.props);
288
288
  e && n.push(e);
289
289
  }
290
290
  };
@@ -292,10 +292,10 @@ function j(e, t) {
292
292
  for (let e of Object.values(t || {})) r(e.template?.nodes);
293
293
  return n.join("\n");
294
294
  }
295
- function M(e, t) {
295
+ function N(e, t) {
296
296
  let n = [], r = (e) => {
297
297
  for (let [t, r] of Object.entries(e || {})) {
298
- let e = D(t, r.props);
298
+ let e = O(t, r.props);
299
299
  e && n.push(e);
300
300
  }
301
301
  };
@@ -303,7 +303,7 @@ function M(e, t) {
303
303
  for (let e of Object.values(t || {})) r(e.template?.nodes);
304
304
  return n.join("\n");
305
305
  }
306
- var N = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", P = {
306
+ var P = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", F = {
307
307
  light: {
308
308
  background: "#ffffff",
309
309
  text: "#111827",
@@ -340,23 +340,23 @@ var N = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
340
340
  contrastText: "#052e2b"
341
341
  }
342
342
  }
343
- }, F = {
343
+ }, I = {
344
344
  font: "system",
345
345
  headingFont: "inherit",
346
- light: P.light,
347
- dark: P.dark
348
- }, I = {
346
+ light: F.light,
347
+ dark: F.dark
348
+ }, L = {
349
349
  system: {
350
350
  label: "System",
351
- value: N
351
+ value: P
352
352
  },
353
353
  inter: {
354
354
  label: "Inter",
355
- value: `"Inter", ${N}`
355
+ value: `"Inter", ${P}`
356
356
  },
357
357
  outfit: {
358
358
  label: "Outfit",
359
- value: `"Outfit", ${N}`
359
+ value: `"Outfit", ${P}`
360
360
  },
361
361
  serif: {
362
362
  label: "Serif",
@@ -366,7 +366,7 @@ var N = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
366
366
  label: "Mono",
367
367
  value: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace"
368
368
  }
369
- }, L = (e, t) => I[e]?.value ?? t, R = (e, ...t) => {
369
+ }, R = (e, t) => L[e]?.value ?? t, z = (e, ...t) => {
370
370
  let n = Object.assign({}, e, ...t);
371
371
  return n.primary = {
372
372
  ...e.primary,
@@ -382,16 +382,16 @@ var N = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
382
382
  }), {})
383
383
  }, n;
384
384
  };
385
- function z(e) {
385
+ function B(e) {
386
386
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
387
387
  return {
388
- font: r ?? F.font,
389
- headingFont: i ?? F.headingFont,
390
- light: R(P.light, a, t),
391
- dark: R(P.dark, n)
388
+ font: r ?? I.font,
389
+ headingFont: i ?? I.headingFont,
390
+ light: z(F.light, a, t),
391
+ dark: z(F.dark, n)
392
392
  };
393
393
  }
394
- function B(e) {
394
+ function V(e) {
395
395
  return {
396
396
  "--page-bg": e.background,
397
397
  "--page-text": e.text,
@@ -407,35 +407,36 @@ function B(e) {
407
407
  "--page-secondary-contrast": e.secondary.contrastText
408
408
  };
409
409
  }
410
- function V(e) {
411
- let t = z(e);
410
+ function ee(e) {
411
+ let t = B(e);
412
412
  return {
413
413
  backgroundColor: "var(--page-bg)",
414
414
  color: "var(--page-text)",
415
- fontFamily: L(t.font, N),
416
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : L(t.headingFont, "inherit")
415
+ fontFamily: R(t.font, P),
416
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : R(t.headingFont, "inherit")
417
417
  };
418
418
  }
419
- function ee(e, t = "light") {
420
- let n = z(e);
419
+ function H(e, t = "light") {
420
+ let n = B(e);
421
421
  return {
422
- ...V(e),
423
- ...B(n[t] ?? n.light)
422
+ ...ee(e),
423
+ ...V(n[t] ?? n.light)
424
424
  };
425
425
  }
426
- function H(e, t) {
426
+ function te(e, t) {
427
427
  return e?.themeRef && t?.[e.themeRef] || e?.theme;
428
428
  }
429
429
  //#endregion
430
430
  //#region ../ui/src/components/builder/views.jsx
431
431
  var U = n({
432
432
  tenant: "",
433
- apiUrl: "/api"
434
- }), W = n(null), G = n(null), te = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
433
+ apiUrl: "/api",
434
+ locale: ""
435
+ }), W = n(null), G = n(null), ne = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
435
436
  function K(e, t) {
436
437
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
437
438
  }
438
- var ne = (e) => {
439
+ var re = (e) => {
439
440
  let t = [];
440
441
  for (let [n, r] of Object.entries(e ?? {})) {
441
442
  if (!/^[\w-]+$/.test(n)) continue;
@@ -446,20 +447,20 @@ var ne = (e) => {
446
447
  return t;
447
448
  };
448
449
  function q(e) {
449
- return e == null ? "" : typeof e == "string" || typeof e == "number" || typeof e == "boolean" ? String(e) : 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(" ") : "").filter(Boolean).join(" ") : "";
450
+ 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(" ") : "";
450
451
  }
451
- function re(e, t) {
452
- let n = t?.data ?? {}, r = ne(n);
452
+ function ie(e, t) {
453
+ let n = t?.data ?? {}, r = re(n);
453
454
  if (!r.length) return e;
454
- let i = RegExp(`:(${r.map(te).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => q(K(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
455
+ let i = RegExp(`:(${r.map(ne).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => q(K(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
455
456
  return a(e);
456
457
  }
457
- var ie = {
458
+ var J = {
458
459
  margin: 0,
459
460
  fontWeight: 700,
460
461
  lineHeight: 1.2,
461
462
  fontFamily: "var(--page-heading-font, inherit)"
462
- }, J = { margin: 0 }, Y = {
463
+ }, Y = { margin: 0 }, X = {
463
464
  display: "inline-block",
464
465
  textDecoration: "none",
465
466
  cursor: "pointer",
@@ -474,7 +475,7 @@ var ie = {
474
475
  display: "flex",
475
476
  flexDirection: "column"
476
477
  };
477
- function X({ style: e }) {
478
+ function se({ style: e }) {
478
479
  let t = e?.backgroundVideo;
479
480
  if (!t) return null;
480
481
  let n = {
@@ -485,7 +486,7 @@ function X({ style: e }) {
485
486
  zIndex: -1,
486
487
  pointerEvents: "none"
487
488
  }, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
488
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("video", {
489
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("video", {
489
490
  src: t,
490
491
  autoPlay: !0,
491
492
  muted: !0,
@@ -495,73 +496,73 @@ function X({ style: e }) {
495
496
  ...n,
496
497
  objectFit: "cover"
497
498
  }
498
- }), r && /* @__PURE__ */ c("div", { style: {
499
+ }), r && /* @__PURE__ */ l("div", { style: {
499
500
  ...n,
500
501
  background: r
501
502
  } })] });
502
503
  }
503
- var se = (e, t) => e?.backgroundVideo ? {
504
+ var ce = (e, t) => e?.backgroundVideo ? {
504
505
  position: "relative",
505
506
  ...t,
506
- ...b(e)
507
+ ...x(e)
507
508
  } : {
508
509
  ...t,
509
- ...b(e)
510
+ ...x(e)
510
511
  };
511
- function ce({ style: e, nodeRef: t, children: n }) {
512
- return /* @__PURE__ */ l("div", {
512
+ function le({ style: e, nodeRef: t, children: n }) {
513
+ return /* @__PURE__ */ u("div", {
513
514
  ref: t,
514
515
  style: {
515
516
  ...ae,
516
- ...b(e)
517
+ ...x(e)
517
518
  },
518
- children: [/* @__PURE__ */ c(X, { style: e }), n]
519
+ children: [/* @__PURE__ */ l(se, { style: e }), n]
519
520
  });
520
521
  }
521
- function le({ style: e, nodeRef: t, children: n }) {
522
- return /* @__PURE__ */ l("section", {
522
+ function ue({ style: e, nodeRef: t, children: n }) {
523
+ return /* @__PURE__ */ u("section", {
523
524
  ref: t,
524
- style: se(e, oe),
525
- children: [/* @__PURE__ */ c(X, { style: e }), n]
525
+ style: ce(e, oe),
526
+ children: [/* @__PURE__ */ l(se, { style: e }), n]
526
527
  });
527
528
  }
528
- function ue({ style: e, freeLayout: t, nodeRef: n, children: r }) {
529
+ function de({ style: e, freeLayout: t, nodeRef: n, children: r }) {
529
530
  let i = t ? {
530
531
  position: "relative",
531
532
  minHeight: 240
532
533
  } : null;
533
- return /* @__PURE__ */ l("div", {
534
+ return /* @__PURE__ */ u("div", {
534
535
  ref: n,
535
536
  style: i ? {
536
537
  ...i,
537
- ...se(e)
538
- } : se(e),
539
- children: [/* @__PURE__ */ c(X, { style: e }), r]
538
+ ...ce(e)
539
+ } : ce(e),
540
+ children: [/* @__PURE__ */ l(se, { style: e }), r]
540
541
  });
541
542
  }
542
- function de({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
543
- return /* @__PURE__ */ c(n, {
543
+ function fe({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
544
+ return /* @__PURE__ */ l(n, {
544
545
  ref: a,
545
546
  style: {
546
- ...ie,
547
- ...b(r)
547
+ ...J,
548
+ ...x(r)
548
549
  },
549
550
  children: Z(t, e, i)
550
551
  });
551
552
  }
552
- var fe = {
553
- fontFamily: I.mono.value,
553
+ var pe = {
554
+ fontFamily: L.mono.value,
554
555
  background: "rgba(148, 163, 184, 0.18)",
555
556
  padding: "1px 5px",
556
557
  borderRadius: 4,
557
558
  fontSize: "0.9em"
558
559
  };
559
- function pe(e, t = [], n, r) {
560
+ function me(e, t = [], n, r) {
560
561
  let i = e;
561
- return t.includes("sup") ? i = /* @__PURE__ */ c("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ c("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ c("code", {
562
- style: fe,
562
+ 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", {
563
+ style: pe,
563
564
  children: i
564
- })), t.includes("strike") && (i = /* @__PURE__ */ c("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ c("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ c("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ c("strong", { children: i })), n && (i = /* @__PURE__ */ c("a", {
565
+ })), 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", {
565
566
  href: n,
566
567
  target: r || void 0,
567
568
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
@@ -571,34 +572,34 @@ function pe(e, t = [], n, r) {
571
572
  }
572
573
  function Z(e, n, r) {
573
574
  return e?.length ? e.map((e, n) => {
574
- if (e.slot) return /* @__PURE__ */ c(t, { children: r?.[e.slot] ?? null }, n);
575
- if (e.parts) return /* @__PURE__ */ c(t, { children: Z(e.parts, "", r) }, n);
575
+ if (e.slot) return /* @__PURE__ */ l(t, { children: r?.[e.slot] ?? null }, n);
576
+ if (e.parts) return /* @__PURE__ */ l(t, { children: Z(e.parts, "", r) }, n);
576
577
  let i = e.text;
577
- return e.sup ? i = /* @__PURE__ */ c("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ c("sub", { children: i })), e.code && (i = /* @__PURE__ */ c("code", {
578
- style: fe,
578
+ return e.sup ? i = /* @__PURE__ */ l("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ l("sub", { children: i })), e.code && (i = /* @__PURE__ */ l("code", {
579
+ style: pe,
579
580
  children: i
580
- })), e.strike && (i = /* @__PURE__ */ c("s", { children: i })), e.underline && (i = /* @__PURE__ */ c("u", { children: i })), e.italic && (i = /* @__PURE__ */ c("em", { children: i })), e.bold && (i = /* @__PURE__ */ c("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ c("span", {
581
+ })), e.strike && (i = /* @__PURE__ */ l("s", { children: i })), e.underline && (i = /* @__PURE__ */ l("u", { children: i })), e.italic && (i = /* @__PURE__ */ l("em", { children: i })), e.bold && (i = /* @__PURE__ */ l("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ l("span", {
581
582
  style: {
582
583
  ...e.color && { color: e.color },
583
584
  ...e.background && { backgroundColor: e.background }
584
585
  },
585
586
  children: i
586
- })), e.href && (i = /* @__PURE__ */ c("a", {
587
+ })), e.href && (i = /* @__PURE__ */ l("a", {
587
588
  href: e.href,
588
589
  target: e.target || void 0,
589
590
  rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
590
591
  style: { color: e.color ?? "inherit" },
591
592
  children: i
592
- })), /* @__PURE__ */ c(t, { children: i }, n);
593
+ })), /* @__PURE__ */ l(t, { children: i }, n);
593
594
  }) : n;
594
595
  }
595
- function me({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
596
- return /* @__PURE__ */ c("span", {
597
- style: b(a),
598
- children: e?.length ? Z(e, t) : pe(t, n, r, i)
596
+ function he({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
597
+ return /* @__PURE__ */ l("span", {
598
+ style: x(a),
599
+ children: e?.length ? Z(e, t) : me(t, n, r, i)
599
600
  });
600
601
  }
601
- var he = {
602
+ var ge = {
602
603
  h1: 40,
603
604
  h2: 32,
604
605
  h3: 26,
@@ -606,7 +607,7 @@ var he = {
606
607
  h5: 19,
607
608
  h6: 16
608
609
  };
609
- function ge({ align: e = "center", width: t, wrap: n } = {}) {
610
+ function _e({ align: e = "center", width: t, wrap: n } = {}) {
610
611
  let r = t ? `${t}%` : void 0;
611
612
  if (e === "full") return { width: "100%" };
612
613
  let i = e === "left" || e === "right";
@@ -640,7 +641,7 @@ function ge({ align: e = "center", width: t, wrap: n } = {}) {
640
641
  marginRight: "auto"
641
642
  };
642
643
  }
643
- function _e(e = [], t, n) {
644
+ function ve(e = [], t, n) {
644
645
  let r = n ?? ((e, n) => Z(e, n, t));
645
646
  return e.map((t, n) => {
646
647
  let i = {
@@ -649,7 +650,7 @@ function _e(e = [], t, n) {
649
650
  };
650
651
  if (t.type === "image") {
651
652
  if (!t.src) return null;
652
- let e = /* @__PURE__ */ c("img", {
653
+ let e = /* @__PURE__ */ l("img", {
653
654
  src: t.src,
654
655
  alt: t.alt || "",
655
656
  style: {
@@ -658,20 +659,20 @@ function _e(e = [], t, n) {
658
659
  borderRadius: 6
659
660
  }
660
661
  });
661
- return /* @__PURE__ */ l("figure", {
662
+ return /* @__PURE__ */ u("figure", {
662
663
  style: {
663
664
  marginLeft: 0,
664
665
  marginRight: 0,
665
666
  ...i,
666
- ...ge(t)
667
+ ..._e(t)
667
668
  },
668
- children: [t.href ? /* @__PURE__ */ c("a", {
669
+ children: [t.href ? /* @__PURE__ */ l("a", {
669
670
  href: t.href,
670
671
  target: t.target || void 0,
671
672
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
672
673
  style: { display: "block" },
673
674
  children: e
674
- }) : e, t.caption && /* @__PURE__ */ c("figcaption", {
675
+ }) : e, t.caption && /* @__PURE__ */ l("figcaption", {
675
676
  style: {
676
677
  fontSize: 13,
677
678
  opacity: .65,
@@ -682,16 +683,16 @@ function _e(e = [], t, n) {
682
683
  })]
683
684
  }, n);
684
685
  }
685
- if (t.type === "video") return Oe(t.url) ? /* @__PURE__ */ c("div", {
686
+ if (t.type === "video") return ke(t.url) ? /* @__PURE__ */ l("div", {
686
687
  style: {
687
688
  ...i,
688
- ...ge({
689
+ ..._e({
689
690
  align: t.align,
690
691
  wrap: t.wrap,
691
692
  width: t.width ?? 100
692
693
  })
693
694
  },
694
- children: /* @__PURE__ */ c(ke, {
695
+ children: /* @__PURE__ */ l(Ae, {
695
696
  url: t.url,
696
697
  autoplay: t.autoplay,
697
698
  muted: t.muted,
@@ -700,146 +701,146 @@ function _e(e = [], t, n) {
700
701
  start: t.start
701
702
  })
702
703
  }, n) : null;
703
- if (t.type === "divider") return /* @__PURE__ */ c("hr", { style: {
704
+ if (t.type === "divider") return /* @__PURE__ */ l("hr", { style: {
704
705
  ...i,
705
706
  border: 0,
706
707
  borderTop: "1px solid rgba(148, 163, 184, 0.4)"
707
708
  } }, n);
708
709
  if (t.type === "ul" || t.type === "ol") {
709
710
  let e = t.type;
710
- return /* @__PURE__ */ c(e, {
711
+ return /* @__PURE__ */ l(e, {
711
712
  style: {
712
713
  ...i,
713
714
  paddingLeft: 24
714
715
  },
715
- children: (t.items ?? []).map((e, t) => /* @__PURE__ */ c("li", {
716
+ children: (t.items ?? []).map((e, t) => /* @__PURE__ */ l("li", {
716
717
  style: { marginBottom: 4 },
717
718
  children: r(e.parts, e.text)
718
719
  }, t))
719
720
  }, n);
720
721
  }
721
- if (t.type === "quote") return /* @__PURE__ */ c("blockquote", {
722
+ if (t.type === "quote") return /* @__PURE__ */ l("blockquote", {
722
723
  style: {
723
- ...ye,
724
+ ...be,
724
725
  ...i
725
726
  },
726
727
  children: r(t.parts, t.text)
727
728
  }, n);
728
- if (he[t.type]) {
729
+ if (ge[t.type]) {
729
730
  let e = t.type;
730
- return /* @__PURE__ */ c(e, {
731
+ return /* @__PURE__ */ l(e, {
731
732
  style: {
732
- ...ie,
733
- fontSize: he[t.type],
733
+ ...J,
734
+ fontSize: ge[t.type],
734
735
  ...i
735
736
  },
736
737
  children: r(t.parts, t.text)
737
738
  }, n);
738
739
  }
739
- return /* @__PURE__ */ c("p", {
740
+ return /* @__PURE__ */ l("p", {
740
741
  style: {
741
- ...J,
742
+ ...Y,
742
743
  ...i
743
744
  },
744
745
  children: r(t.parts, t.text)
745
746
  }, n);
746
747
  });
747
748
  }
748
- function ve({ content: e, style: t, linked: n, nodeRef: r }) {
749
- return /* @__PURE__ */ c("div", {
749
+ function ye({ content: e, style: t, linked: n, nodeRef: r }) {
750
+ return /* @__PURE__ */ l("div", {
750
751
  ref: r,
751
752
  style: {
752
753
  display: "flow-root",
753
- ...b(t)
754
+ ...x(t)
754
755
  },
755
- children: _e(e, n)
756
+ children: ve(e, n)
756
757
  });
757
758
  }
758
- var ye = {
759
+ var be = {
759
760
  margin: 0,
760
761
  padding: "8px 0 8px 20px",
761
762
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
762
763
  };
763
- function be({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
764
- return /* @__PURE__ */ c("blockquote", {
764
+ function xe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
765
+ return /* @__PURE__ */ l("blockquote", {
765
766
  ref: i,
766
767
  style: {
767
- ...ye,
768
- ...b(n)
768
+ ...be,
769
+ ...x(n)
769
770
  },
770
771
  children: Z(t, e, r)
771
772
  });
772
773
  }
773
- function xe({ ordered: e, items: t = [], style: n, nodeRef: r }) {
774
- return /* @__PURE__ */ c(e ? "ol" : "ul", {
774
+ function Se({ ordered: e, items: t = [], style: n, nodeRef: r }) {
775
+ return /* @__PURE__ */ l(e ? "ol" : "ul", {
775
776
  ref: r,
776
777
  style: {
777
778
  margin: 0,
778
779
  paddingLeft: 24,
779
- ...b(n)
780
+ ...x(n)
780
781
  },
781
- children: t.map((e, t) => /* @__PURE__ */ c("li", {
782
+ children: t.map((e, t) => /* @__PURE__ */ l("li", {
782
783
  style: { marginBottom: 4 },
783
784
  children: Z(e.parts, e.text)
784
785
  }, t))
785
786
  });
786
787
  }
787
- function Se({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
788
- return /* @__PURE__ */ c("p", {
788
+ function Ce({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
789
+ return /* @__PURE__ */ l("p", {
789
790
  ref: i,
790
791
  style: {
791
- ...J,
792
- ...b(n)
792
+ ...Y,
793
+ ...x(n)
793
794
  },
794
795
  children: Z(t, e, r)
795
796
  });
796
797
  }
797
- var Ce = {
798
+ var we = {
798
799
  color: "var(--page-accent, inherit)",
799
800
  textDecoration: "underline",
800
801
  textUnderlineOffset: 3,
801
802
  cursor: "pointer"
802
803
  };
803
- function we({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
804
- return /* @__PURE__ */ c("a", {
804
+ function Te({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
805
+ return /* @__PURE__ */ l("a", {
805
806
  ref: o,
806
807
  href: n || "#",
807
808
  target: r || void 0,
808
809
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
809
810
  style: {
810
- ...Ce,
811
- ...b(i)
811
+ ...we,
812
+ ...x(i)
812
813
  },
813
814
  children: Z(t, e, a)
814
815
  });
815
816
  }
816
- function Te({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
817
- return /* @__PURE__ */ c("a", {
817
+ function Ee({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
818
+ return /* @__PURE__ */ l("a", {
818
819
  ref: o,
819
820
  href: n || "#",
820
821
  target: r || void 0,
821
822
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
822
823
  style: {
823
- ...Y,
824
- ...b(i)
824
+ ...X,
825
+ ...x(i)
825
826
  },
826
827
  children: Z(t, e, a)
827
828
  });
828
829
  }
829
- function Ee({ src: e, alt: t, style: n, nodeRef: r }) {
830
- return e ? /* @__PURE__ */ c("img", {
830
+ function De({ src: e, alt: t, style: n, nodeRef: r }) {
831
+ return e ? /* @__PURE__ */ l("img", {
831
832
  ref: r,
832
833
  src: e,
833
834
  alt: t || "",
834
835
  style: {
835
836
  display: "block",
836
837
  maxWidth: "100%",
837
- ...b(n)
838
+ ...x(n)
838
839
  }
839
840
  }) : null;
840
841
  }
841
- function De({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
842
- return e ? /* @__PURE__ */ c("video", {
842
+ function Oe({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
843
+ return e ? /* @__PURE__ */ l("video", {
843
844
  ref: s,
844
845
  src: e,
845
846
  poster: t || void 0,
@@ -852,25 +853,25 @@ function De({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
852
853
  display: "block",
853
854
  width: "100%",
854
855
  maxWidth: "100%",
855
- ...b(o)
856
+ ...x(o)
856
857
  }
857
858
  }) : null;
858
859
  }
859
- var Oe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
860
- function ke({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
861
- let l = Oe(e);
862
- if (!l) return null;
860
+ var ke = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
861
+ function Ae({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
862
+ let c = ke(e);
863
+ if (!c) return null;
863
864
  let u = new URLSearchParams({ rel: "0" });
864
- 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", l)), Number(a) > 0 && u.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ c("div", {
865
+ 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", {
865
866
  ref: s,
866
867
  style: {
867
868
  position: "relative",
868
869
  width: "100%",
869
870
  paddingTop: "56.25%",
870
- ...b(o)
871
+ ...x(o)
871
872
  },
872
- children: /* @__PURE__ */ c("iframe", {
873
- src: `https://www.youtube-nocookie.com/embed/${l}?${u}`,
873
+ children: /* @__PURE__ */ l("iframe", {
874
+ src: `https://www.youtube-nocookie.com/embed/${c}?${u}`,
874
875
  title: "YouTube video",
875
876
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
876
877
  allowFullScreen: !0,
@@ -884,8 +885,8 @@ function ke({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
884
885
  })
885
886
  });
886
887
  }
887
- function Ae({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
888
- return e ? /* @__PURE__ */ c("iframe", {
888
+ function je({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
889
+ return e ? /* @__PURE__ */ l("iframe", {
889
890
  ref: i,
890
891
  src: e,
891
892
  title: t || "Embedded frame",
@@ -896,12 +897,12 @@ function Ae({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
896
897
  width: "100%",
897
898
  height: 300,
898
899
  border: 0,
899
- ...b(r)
900
+ ...x(r)
900
901
  }
901
902
  }) : null;
902
903
  }
903
- function je({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
904
- let [a, s] = o(null);
904
+ function Me({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
905
+ let [a, o] = s(null);
905
906
  return i(() => {
906
907
  a && (a.innerHTML = e || "", t && a.querySelectorAll("script").forEach((e) => {
907
908
  let t = document.createElement("script");
@@ -912,15 +913,15 @@ function je({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
912
913
  a,
913
914
  e,
914
915
  t
915
- ]), /* @__PURE__ */ c("div", {
916
+ ]), /* @__PURE__ */ l("div", {
916
917
  ref: (e) => {
917
- s(e), r && r(e);
918
+ o(e), r && r(e);
918
919
  },
919
- style: b(n)
920
+ style: x(n)
920
921
  });
921
922
  }
922
- function Me({ height: e, nodeRef: t }) {
923
- return /* @__PURE__ */ c("div", {
923
+ function Ne({ height: e, nodeRef: t }) {
924
+ return /* @__PURE__ */ l("div", {
924
925
  ref: t,
925
926
  style: {
926
927
  height: e || 32,
@@ -929,18 +930,18 @@ function Me({ height: e, nodeRef: t }) {
929
930
  }
930
931
  });
931
932
  }
932
- function Ne({ style: e, nodeRef: t }) {
933
- return /* @__PURE__ */ c("div", {
933
+ function Pe({ style: e, nodeRef: t }) {
934
+ return /* @__PURE__ */ l("div", {
934
935
  ref: t,
935
936
  style: {
936
937
  height: 1,
937
938
  alignSelf: "stretch",
938
939
  flexShrink: 0,
939
- ...b(e)
940
+ ...x(e)
940
941
  }
941
942
  });
942
943
  }
943
- var Pe = {
944
+ var Fe = {
944
945
  position: "absolute",
945
946
  top: "50%",
946
947
  transform: "translateY(-50%)",
@@ -957,7 +958,7 @@ var Pe = {
957
958
  alignItems: "center",
958
959
  justifyContent: "center",
959
960
  padding: 0
960
- }, Fe = {
961
+ }, Ie = {
961
962
  bottom: {
962
963
  inset: "auto 0 0 0",
963
964
  padding: "40px 24px 20px",
@@ -976,9 +977,9 @@ var Pe = {
976
977
  padding: 24,
977
978
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
978
979
  }
979
- }, Ie = 48;
980
- function Le({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: u = !0, style: d, nodeRef: f }) {
981
- let [p, m] = o(0), [h, g] = o(!1), [_, v] = o(null), y = e ? Math.min(p, e - 1) : 0;
980
+ }, Le = 48;
981
+ function Re({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: a = 320, swipe: o = !0, style: d, nodeRef: f }) {
982
+ let [p, m] = s(0), [h, g] = s(!1), [_, v] = s(null), y = e ? Math.min(p, e - 1) : 0;
982
983
  if (i(() => {
983
984
  if (!n || h || _ || e < 2) return;
984
985
  let t = setInterval(() => m((t) => (t + 1) % e), Math.max(2, Number(r) || 5) * 1e3);
@@ -990,16 +991,16 @@ function Le({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
990
991
  r,
991
992
  e
992
993
  ]), !e) return null;
993
- let x = (t) => m((t + e) % e), S = () => {
994
+ let b = (t) => m((t + e) % e), S = () => {
994
995
  if (!_) return;
995
996
  let { dx: e } = _;
996
- v(null), e < -48 ? x(y + 1) : e > Ie && x(y - 1);
997
+ v(null), e < -48 ? b(y + 1) : e > Le && b(y - 1);
997
998
  };
998
- return /* @__PURE__ */ l("div", {
999
+ return /* @__PURE__ */ u("div", {
999
1000
  ref: f,
1000
1001
  onMouseEnter: () => g(!0),
1001
1002
  onMouseLeave: () => g(!1),
1002
- onPointerDown: u && e > 1 ? (e) => {
1003
+ onPointerDown: o && e > 1 ? (e) => {
1003
1004
  e.pointerType === "mouse" && e.button !== 0 || e.target.closest("button") || (e.currentTarget.setPointerCapture(e.pointerId), v({
1004
1005
  startX: e.clientX,
1005
1006
  dx: 0
@@ -1018,16 +1019,16 @@ function Le({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1018
1019
  touchAction: "pan-y",
1019
1020
  userSelect: _ ? "none" : void 0,
1020
1021
  cursor: _ ? "grabbing" : void 0,
1021
- ...b(d)
1022
+ ...x(d)
1022
1023
  },
1023
- children: [/* @__PURE__ */ c("div", {
1024
+ children: [/* @__PURE__ */ l("div", {
1024
1025
  style: {
1025
1026
  display: "flex",
1026
1027
  height: a,
1027
1028
  transform: `translateX(calc(${-y * 100}% + ${_?.dx ?? 0}px))`,
1028
1029
  transition: _ ? "none" : "transform 450ms ease"
1029
1030
  },
1030
- children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ c("div", {
1031
+ children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ l("div", {
1031
1032
  style: {
1032
1033
  position: "relative",
1033
1034
  width: "100%",
@@ -1036,28 +1037,28 @@ function Le({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1036
1037
  },
1037
1038
  children: t(n)
1038
1039
  }, n))
1039
- }), e > 1 && /* @__PURE__ */ l(s, { children: [
1040
- /* @__PURE__ */ c("button", {
1040
+ }), e > 1 && /* @__PURE__ */ u(c, { children: [
1041
+ /* @__PURE__ */ l("button", {
1041
1042
  type: "button",
1042
1043
  "aria-label": "Previous slide",
1043
1044
  style: {
1044
- ...Pe,
1045
+ ...Fe,
1045
1046
  left: 12
1046
1047
  },
1047
- onClick: () => x(y - 1),
1048
+ onClick: () => b(y - 1),
1048
1049
  children: "‹"
1049
1050
  }),
1050
- /* @__PURE__ */ c("button", {
1051
+ /* @__PURE__ */ l("button", {
1051
1052
  type: "button",
1052
1053
  "aria-label": "Next slide",
1053
1054
  style: {
1054
- ...Pe,
1055
+ ...Fe,
1055
1056
  right: 12
1056
1057
  },
1057
- onClick: () => x(y + 1),
1058
+ onClick: () => b(y + 1),
1058
1059
  children: "›"
1059
1060
  }),
1060
- /* @__PURE__ */ c("div", {
1061
+ /* @__PURE__ */ l("div", {
1061
1062
  style: {
1062
1063
  position: "absolute",
1063
1064
  bottom: 10,
@@ -1067,10 +1068,10 @@ function Le({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1067
1068
  justifyContent: "center",
1068
1069
  gap: 6
1069
1070
  },
1070
- children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ c("button", {
1071
+ children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ l("button", {
1071
1072
  type: "button",
1072
1073
  "aria-label": `Go to slide ${t + 1}`,
1073
- onClick: () => x(t),
1074
+ onClick: () => b(t),
1074
1075
  style: {
1075
1076
  width: 8,
1076
1077
  height: 8,
@@ -1085,7 +1086,7 @@ function Le({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1085
1086
  ] })]
1086
1087
  });
1087
1088
  }
1088
- var Re = (e, t) => ({
1089
+ var ze = (e, t) => ({
1089
1090
  position: "absolute",
1090
1091
  inset: 0,
1091
1092
  backgroundImage: e ? `url(${e})` : "none",
@@ -1093,26 +1094,26 @@ var Re = (e, t) => ({
1093
1094
  backgroundSize: "cover",
1094
1095
  backgroundPosition: "center"
1095
1096
  });
1096
- function ze({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1097
- return e.length ? /* @__PURE__ */ c(Le, {
1097
+ function Be({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1098
+ return e.length ? /* @__PURE__ */ l(Re, {
1098
1099
  ...r,
1099
1100
  count: e.length,
1100
1101
  renderSlide: (r) => {
1101
1102
  let i = e[r];
1102
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Re(i.image) }), (i.title || i.text) && /* @__PURE__ */ l("div", {
1103
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: ze(i.image) }), (i.title || i.text) && /* @__PURE__ */ u("div", {
1103
1104
  style: {
1104
1105
  position: "absolute",
1105
1106
  color: "#fff",
1106
1107
  textAlign: n,
1107
- ...Fe[t] ?? Fe.bottom
1108
+ ...Ie[t] ?? Ie.bottom
1108
1109
  },
1109
- children: [i.title && /* @__PURE__ */ c("div", {
1110
+ children: [i.title && /* @__PURE__ */ l("div", {
1110
1111
  style: {
1111
1112
  fontSize: 22,
1112
1113
  fontWeight: 700
1113
1114
  },
1114
1115
  children: i.title
1115
- }), i.text && /* @__PURE__ */ c("div", {
1116
+ }), i.text && /* @__PURE__ */ l("div", {
1116
1117
  style: {
1117
1118
  fontSize: 14,
1118
1119
  opacity: .9,
@@ -1124,13 +1125,13 @@ function ze({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1124
1125
  }
1125
1126
  }) : null;
1126
1127
  }
1127
- function Be({ slides: e = [], linked: t, ...n }) {
1128
- return e.length ? /* @__PURE__ */ c(Le, {
1128
+ function Ve({ slides: e = [], linked: t, ...n }) {
1129
+ return e.length ? /* @__PURE__ */ l(Re, {
1129
1130
  ...n,
1130
1131
  count: e.length,
1131
1132
  renderSlide: (n) => {
1132
1133
  let r = e[n];
1133
- return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("div", { style: Re(r.image, r.color) }), /* @__PURE__ */ c("div", {
1134
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("div", { style: ze(r.image, r.color) }), /* @__PURE__ */ l("div", {
1134
1135
  style: {
1135
1136
  position: "absolute",
1136
1137
  inset: 0,
@@ -1142,33 +1143,33 @@ function Be({ slides: e = [], linked: t, ...n }) {
1142
1143
  }
1143
1144
  }) : null;
1144
1145
  }
1145
- var Ve = {
1146
+ var He = {
1146
1147
  color: "inherit",
1147
1148
  textDecoration: "none",
1148
1149
  fontSize: 14,
1149
1150
  opacity: .85
1150
- }, He = {
1151
+ }, Ue = {
1151
1152
  background: "var(--page-bg, #ffffff)",
1152
1153
  color: "var(--page-text, #111827)",
1153
1154
  border: "1px solid rgba(148, 163, 184, 0.25)",
1154
1155
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1155
1156
  zIndex: 60
1156
1157
  };
1157
- function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u = "auto", breakpoint: d = 768 }) {
1158
- let [f, p] = o(null), [m, h] = o(!1), [g, _] = o(!1), [v, y] = o(null);
1158
+ function We({ brand: e, logo: n, links: r = [], style: a, nodeRef: o, menu: c = "auto", breakpoint: d = 768 }) {
1159
+ let [f, p] = s(null), [m, h] = s(!1), [g, _] = s(!1), [v, y] = s(null);
1159
1160
  i(() => {
1160
1161
  if (!f) return;
1161
1162
  let e = new ResizeObserver(() => h(f.offsetWidth < d));
1162
1163
  return e.observe(f), () => e.disconnect();
1163
1164
  }, [f, d]);
1164
- let x = u === "hamburger" || u === "auto" && m, S = (e, t) => /* @__PURE__ */ l("a", {
1165
+ let b = c === "hamburger" || c === "auto" && m, S = (e, t) => /* @__PURE__ */ u("a", {
1165
1166
  href: e.href || "#",
1166
1167
  style: {
1167
- ...Ve,
1168
+ ...He,
1168
1169
  display: "block",
1169
1170
  ...t
1170
1171
  },
1171
- children: [e.label, e.desc && /* @__PURE__ */ c("span", {
1172
+ children: [e.label, e.desc && /* @__PURE__ */ l("span", {
1172
1173
  style: {
1173
1174
  display: "block",
1174
1175
  fontSize: 12,
@@ -1178,9 +1179,9 @@ function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1178
1179
  children: e.desc
1179
1180
  })]
1180
1181
  }, e.key);
1181
- return /* @__PURE__ */ l("nav", {
1182
+ return /* @__PURE__ */ u("nav", {
1182
1183
  ref: (e) => {
1183
- p(e), s && s(e);
1184
+ p(e), o && o(e);
1184
1185
  },
1185
1186
  style: {
1186
1187
  display: "flex",
@@ -1190,10 +1191,10 @@ function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1190
1191
  padding: "14px 24px",
1191
1192
  width: "100%",
1192
1193
  position: "relative",
1193
- ...b(a)
1194
+ ...x(a)
1194
1195
  },
1195
1196
  children: [
1196
- n && /* @__PURE__ */ c("img", {
1197
+ n && /* @__PURE__ */ l("img", {
1197
1198
  src: n,
1198
1199
  alt: e || "Logo",
1199
1200
  style: {
@@ -1201,7 +1202,7 @@ function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1201
1202
  display: "block"
1202
1203
  }
1203
1204
  }),
1204
- e && /* @__PURE__ */ c("div", {
1205
+ e && /* @__PURE__ */ l("div", {
1205
1206
  style: {
1206
1207
  fontWeight: 700,
1207
1208
  fontSize: 18,
@@ -1209,8 +1210,8 @@ function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1209
1210
  },
1210
1211
  children: e
1211
1212
  }),
1212
- /* @__PURE__ */ c("div", { style: { flexGrow: 1 } }),
1213
- x ? /* @__PURE__ */ c("button", {
1213
+ /* @__PURE__ */ l("div", { style: { flexGrow: 1 } }),
1214
+ b ? /* @__PURE__ */ l("button", {
1214
1215
  type: "button",
1215
1216
  "aria-label": g ? "Close menu" : "Open menu",
1216
1217
  onClick: () => _(!g),
@@ -1224,7 +1225,7 @@ function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1224
1225
  padding: 4
1225
1226
  },
1226
1227
  children: g ? "✕" : "☰"
1227
- }) : /* @__PURE__ */ c("div", {
1228
+ }) : /* @__PURE__ */ l("div", {
1228
1229
  style: {
1229
1230
  display: "flex",
1230
1231
  gap: 20,
@@ -1233,29 +1234,29 @@ function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1233
1234
  },
1234
1235
  children: r.map((e) => {
1235
1236
  let t = e.children ?? [];
1236
- if (!t.length) return /* @__PURE__ */ c("a", {
1237
+ if (!t.length) return /* @__PURE__ */ l("a", {
1237
1238
  href: e.href || "#",
1238
- style: Ve,
1239
+ style: He,
1239
1240
  children: e.label
1240
1241
  }, e.key);
1241
1242
  let n = e.type === "mega";
1242
- return /* @__PURE__ */ l("span", {
1243
+ return /* @__PURE__ */ u("span", {
1243
1244
  style: {
1244
1245
  position: n ? "static" : "relative",
1245
1246
  display: "inline-flex"
1246
1247
  },
1247
1248
  onMouseEnter: () => y(e.key),
1248
1249
  onMouseLeave: () => y(null),
1249
- children: [/* @__PURE__ */ l("a", {
1250
+ children: [/* @__PURE__ */ u("a", {
1250
1251
  href: e.href || "#",
1251
1252
  style: {
1252
- ...Ve,
1253
+ ...He,
1253
1254
  cursor: "pointer"
1254
1255
  },
1255
1256
  children: [
1256
1257
  e.label,
1257
1258
  " ",
1258
- /* @__PURE__ */ c("span", {
1259
+ /* @__PURE__ */ l("span", {
1259
1260
  style: {
1260
1261
  fontSize: 9,
1261
1262
  opacity: .6
@@ -1263,9 +1264,9 @@ function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1263
1264
  children: "▼"
1264
1265
  })
1265
1266
  ]
1266
- }), v === e.key && (n ? /* @__PURE__ */ c("div", {
1267
+ }), v === e.key && (n ? /* @__PURE__ */ l("div", {
1267
1268
  style: {
1268
- ...He,
1269
+ ...Ue,
1269
1270
  position: "absolute",
1270
1271
  left: 0,
1271
1272
  right: 0,
@@ -1279,9 +1280,9 @@ function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1279
1280
  padding: "6px 8px",
1280
1281
  borderRadius: 6
1281
1282
  }))
1282
- }) : /* @__PURE__ */ c("div", {
1283
+ }) : /* @__PURE__ */ l("div", {
1283
1284
  style: {
1284
- ...He,
1285
+ ...Ue,
1285
1286
  position: "absolute",
1286
1287
  top: "100%",
1287
1288
  left: 0,
@@ -1299,7 +1300,7 @@ function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1299
1300
  }, e.key);
1300
1301
  })
1301
1302
  }),
1302
- x && g && /* @__PURE__ */ c("div", {
1303
+ b && g && /* @__PURE__ */ l("div", {
1303
1304
  style: {
1304
1305
  flexBasis: "100%",
1305
1306
  width: "100%",
@@ -1307,10 +1308,10 @@ function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1307
1308
  flexDirection: "column",
1308
1309
  paddingTop: 10
1309
1310
  },
1310
- children: r.map((e) => /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c("a", {
1311
+ children: r.map((e) => /* @__PURE__ */ u(t, { children: [/* @__PURE__ */ l("a", {
1311
1312
  href: e.href || "#",
1312
1313
  style: {
1313
- ...Ve,
1314
+ ...He,
1314
1315
  padding: "10px 4px",
1315
1316
  fontWeight: (e.children ?? []).length ? 600 : 400,
1316
1317
  opacity: 1
@@ -1321,21 +1322,21 @@ function Ue({ brand: e, logo: n, links: r = [], style: a, nodeRef: s, menu: u =
1321
1322
  ]
1322
1323
  });
1323
1324
  }
1324
- function We({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1325
- let [i, a] = o(0), s = e.length ? Math.min(i, e.length - 1) : 0;
1326
- return e.length ? /* @__PURE__ */ l("div", {
1325
+ function Ge({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1326
+ let [i, a] = s(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1327
+ return e.length ? /* @__PURE__ */ u("div", {
1327
1328
  ref: r,
1328
1329
  style: {
1329
1330
  width: "100%",
1330
- ...b(n)
1331
+ ...x(n)
1331
1332
  },
1332
- children: [/* @__PURE__ */ c("div", {
1333
+ children: [/* @__PURE__ */ l("div", {
1333
1334
  style: {
1334
1335
  display: "flex",
1335
1336
  gap: 4,
1336
1337
  borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
1337
1338
  },
1338
- children: e.map((e, t) => /* @__PURE__ */ c("button", {
1339
+ children: e.map((e, t) => /* @__PURE__ */ l("button", {
1339
1340
  type: "button",
1340
1341
  onClick: () => a(t),
1341
1342
  style: {
@@ -1346,41 +1347,41 @@ function We({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1346
1347
  fontFamily: "inherit",
1347
1348
  color: "inherit",
1348
1349
  cursor: "pointer",
1349
- opacity: t === s ? 1 : .6,
1350
- fontWeight: t === s ? 600 : 500,
1351
- boxShadow: t === s ? "inset 0 -2px 0 var(--page-accent, #111827)" : "none"
1350
+ opacity: t === o ? 1 : .6,
1351
+ fontWeight: t === o ? 600 : 500,
1352
+ boxShadow: t === o ? "inset 0 -2px 0 var(--page-accent, #111827)" : "none"
1352
1353
  },
1353
1354
  children: e.label || `Tab ${t + 1}`
1354
1355
  }, e.key))
1355
- }), e.map((e, n) => /* @__PURE__ */ c("div", {
1356
+ }), e.map((e, n) => /* @__PURE__ */ l("div", {
1356
1357
  style: {
1357
- display: n === s ? "flex" : "none",
1358
+ display: n === o ? "flex" : "none",
1358
1359
  flexDirection: "column"
1359
1360
  },
1360
1361
  children: t?.[e.key] ?? null
1361
1362
  }, e.key))]
1362
1363
  }) : null;
1363
1364
  }
1364
- function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1365
- let [a, s] = o(() => new Set(e.length ? [e[0].key] : []));
1365
+ function Ke({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1366
+ let [a, o] = s(() => new Set(e.length ? [e[0].key] : []));
1366
1367
  if (!e.length) return null;
1367
- let u = (e) => s((t) => {
1368
+ let c = (e) => o((t) => {
1368
1369
  let r = new Set(n ? t : []);
1369
1370
  return t.has(e) ? r.delete(e) : r.add(e), r;
1370
1371
  });
1371
- return /* @__PURE__ */ c("div", {
1372
+ return /* @__PURE__ */ l("div", {
1372
1373
  ref: i,
1373
1374
  style: {
1374
1375
  width: "100%",
1375
- ...b(r)
1376
+ ...x(r)
1376
1377
  },
1377
1378
  children: e.map((n, r) => {
1378
1379
  let i = a.has(n.key);
1379
- return /* @__PURE__ */ l("div", {
1380
+ return /* @__PURE__ */ u("div", {
1380
1381
  style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
1381
- children: [/* @__PURE__ */ l("button", {
1382
+ children: [/* @__PURE__ */ u("button", {
1382
1383
  type: "button",
1383
- onClick: () => u(n.key),
1384
+ onClick: () => c(n.key),
1384
1385
  style: {
1385
1386
  width: "100%",
1386
1387
  display: "flex",
@@ -1397,7 +1398,7 @@ function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1397
1398
  textAlign: "left",
1398
1399
  cursor: "pointer"
1399
1400
  },
1400
- children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ c("span", {
1401
+ children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ l("span", {
1401
1402
  "aria-hidden": !0,
1402
1403
  style: {
1403
1404
  fontSize: 12,
@@ -1407,7 +1408,7 @@ function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1407
1408
  },
1408
1409
  children: "▼"
1409
1410
  })]
1410
- }), /* @__PURE__ */ c("div", {
1411
+ }), /* @__PURE__ */ l("div", {
1411
1412
  style: {
1412
1413
  display: i ? "flex" : "none",
1413
1414
  flexDirection: "column"
@@ -1418,15 +1419,15 @@ function Ge({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1418
1419
  })
1419
1420
  });
1420
1421
  }
1421
- var Ke = {
1422
+ var qe = {
1422
1423
  display: "flex",
1423
1424
  flexDirection: "column",
1424
1425
  gap: "12px"
1425
- }, qe = {
1426
+ }, Je = {
1426
1427
  fontSize: "14px",
1427
1428
  fontWeight: 500,
1428
1429
  color: "var(--page-text, #111827)"
1429
- }, Je = {
1430
+ }, Ye = {
1430
1431
  padding: "10px 12px",
1431
1432
  border: "1px solid #d1d5db",
1432
1433
  borderRadius: "6px",
@@ -1436,18 +1437,18 @@ var Ke = {
1436
1437
  boxSizing: "border-box",
1437
1438
  backgroundColor: "#ffffff",
1438
1439
  color: "#111827"
1439
- }, Ye = {
1440
+ }, Xe = {
1440
1441
  display: "flex",
1441
1442
  alignItems: "center",
1442
1443
  gap: "8px",
1443
1444
  fontSize: "14px",
1444
1445
  color: "var(--page-text, #111827)"
1445
- }, Xe = (e) => e ? {
1446
+ }, Ze = (e) => e ? {
1446
1447
  readOnly: !0,
1447
1448
  tabIndex: -1,
1448
1449
  onMouseDown: (e) => e.preventDefault()
1449
1450
  } : {};
1450
- function Ze(e, t) {
1451
+ function Qe(e, t) {
1451
1452
  if (!e) return !0;
1452
1453
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1453
1454
  switch (e.op) {
@@ -1461,11 +1462,11 @@ function Ze(e, t) {
1461
1462
  default: return !1;
1462
1463
  }
1463
1464
  }
1464
- var Qe = {
1465
+ var $e = {
1465
1466
  display: "flex",
1466
1467
  flexDirection: "column",
1467
1468
  gap: 6
1468
- }, $e = {
1469
+ }, et = {
1469
1470
  font: "inherit",
1470
1471
  fontSize: 15,
1471
1472
  padding: "10px 12px",
@@ -1476,23 +1477,29 @@ var Qe = {
1476
1477
  width: "100%",
1477
1478
  boxSizing: "border-box"
1478
1479
  };
1479
- function et({ field: e, value: t, onChange: n, inert: r }) {
1480
- let i = /* @__PURE__ */ l("span", {
1480
+ function tt(e, t) {
1481
+ let n = Array.isArray(e?.options) ? e.options : [];
1482
+ if (!e?.parentField) return n;
1483
+ let r = t?.[e.parentField];
1484
+ return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
1485
+ }
1486
+ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1487
+ let a = /* @__PURE__ */ u("span", {
1481
1488
  style: {
1482
- ...qe,
1489
+ ...Je,
1483
1490
  fontSize: 14
1484
1491
  },
1485
1492
  children: [e.label, e.required ? " *" : ""]
1486
- }), a = {
1493
+ }), o = {
1487
1494
  name: e.name,
1488
1495
  required: e.required || void 0,
1489
1496
  placeholder: e.placeholder || void 0,
1490
1497
  disabled: r || void 0,
1491
- style: $e,
1498
+ style: et,
1492
1499
  value: t ?? "",
1493
1500
  onChange: (t) => n(e.name, t.target.value)
1494
1501
  };
1495
- return e.type === "display" ? /* @__PURE__ */ c(e.variant && e.variant !== "p" ? e.variant : "p", {
1502
+ return e.type === "display" ? /* @__PURE__ */ l(e.variant && e.variant !== "p" ? e.variant : "p", {
1496
1503
  style: {
1497
1504
  margin: 0,
1498
1505
  color: e.color || "inherit",
@@ -1509,7 +1516,7 @@ function et({ field: e, value: t, onChange: n, inert: r }) {
1509
1516
  lineHeight: 1.35
1510
1517
  },
1511
1518
  children: e.label
1512
- }) : e.type === "image" ? e.src ? /* @__PURE__ */ c("img", {
1519
+ }) : e.type === "image" ? e.src ? /* @__PURE__ */ l("img", {
1513
1520
  src: e.src,
1514
1521
  alt: e.label ?? "",
1515
1522
  style: {
@@ -1517,10 +1524,10 @@ function et({ field: e, value: t, onChange: n, inert: r }) {
1517
1524
  borderRadius: 8,
1518
1525
  display: "block"
1519
1526
  }
1520
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ c(ke, {
1527
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ l(Ae, {
1521
1528
  url: e.src,
1522
1529
  style: { width: "100%" }
1523
- }) : /* @__PURE__ */ c("video", {
1530
+ }) : /* @__PURE__ */ l("video", {
1524
1531
  src: e.src,
1525
1532
  controls: !0,
1526
1533
  style: {
@@ -1528,27 +1535,28 @@ function et({ field: e, value: t, onChange: n, inert: r }) {
1528
1535
  borderRadius: 8,
1529
1536
  display: "block"
1530
1537
  }
1531
- }) : null : /* @__PURE__ */ l("label", {
1532
- style: Qe,
1538
+ }) : null : /* @__PURE__ */ u("label", {
1539
+ style: $e,
1533
1540
  children: [
1534
- i,
1535
- e.type === "textarea" || e.multiline ? /* @__PURE__ */ c("textarea", {
1536
- ...a,
1541
+ a,
1542
+ e.type === "textarea" || e.multiline ? /* @__PURE__ */ l("textarea", {
1543
+ ...o,
1537
1544
  rows: 4,
1538
1545
  style: {
1539
- ...$e,
1546
+ ...et,
1540
1547
  resize: "vertical"
1541
1548
  }
1542
- }) : e.type === "select" ? /* @__PURE__ */ l("select", {
1543
- ...a,
1544
- children: [/* @__PURE__ */ c("option", {
1549
+ }) : e.type === "select" ? /* @__PURE__ */ u("select", {
1550
+ ...o,
1551
+ disabled: o.disabled || !!e.parentField && !i?.[e.parentField],
1552
+ children: [/* @__PURE__ */ l("option", {
1545
1553
  value: "",
1546
1554
  children: e.placeholder || "—"
1547
- }), (e.options ?? []).map((e, t) => /* @__PURE__ */ c("option", {
1555
+ }), tt(e, i).map((e, t) => /* @__PURE__ */ l("option", {
1548
1556
  value: typeof e == "string" ? e : e.value,
1549
1557
  children: typeof e == "string" ? e : e.label ?? e.value
1550
1558
  }, t))]
1551
- }) : e.type === "checkbox" ? /* @__PURE__ */ c("input", {
1559
+ }) : e.type === "checkbox" ? /* @__PURE__ */ l("input", {
1552
1560
  type: "checkbox",
1553
1561
  name: e.name,
1554
1562
  required: e.required || void 0,
@@ -1559,7 +1567,7 @@ function et({ field: e, value: t, onChange: n, inert: r }) {
1559
1567
  width: 18,
1560
1568
  height: 18
1561
1569
  }
1562
- }) : e.type === "upload" ? /* @__PURE__ */ c("input", {
1570
+ }) : e.type === "upload" ? /* @__PURE__ */ l("input", {
1563
1571
  type: "file",
1564
1572
  name: e.name,
1565
1573
  accept: e.accept || void 0,
@@ -1570,8 +1578,8 @@ function et({ field: e, value: t, onChange: n, inert: r }) {
1570
1578
  font: "inherit",
1571
1579
  fontSize: 14
1572
1580
  }
1573
- }) : /* @__PURE__ */ c("input", {
1574
- ...a,
1581
+ }) : /* @__PURE__ */ l("input", {
1582
+ ...o,
1575
1583
  type: {
1576
1584
  email: "email",
1577
1585
  number: "number",
@@ -1581,7 +1589,7 @@ function et({ field: e, value: t, onChange: n, inert: r }) {
1581
1589
  link: "url"
1582
1590
  }[e.type] ?? "text"
1583
1591
  }),
1584
- e.help && /* @__PURE__ */ c("span", {
1592
+ e.help && /* @__PURE__ */ l("span", {
1585
1593
  style: {
1586
1594
  fontSize: 12,
1587
1595
  opacity: .65
@@ -1591,19 +1599,19 @@ function et({ field: e, value: t, onChange: n, inert: r }) {
1591
1599
  ]
1592
1600
  });
1593
1601
  }
1594
- function tt({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
1595
- let { tenant: y, apiUrl: x } = r(U), [S, C] = o("form"), [w, T] = o(null), [E, D] = o({}), [O, k] = o(0), A = h ? v || "form" : S;
1602
+ function rt({ style: e, action: t, method: n, name: a, enctype: o, formSlug: d, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
1603
+ let { tenant: y, apiUrl: b } = r(U), [S, C] = s("form"), [w, T] = s(null), [E, D] = s({}), [O, k] = s(0), A = h ? v || "form" : S;
1596
1604
  i(() => {
1597
1605
  if (!f || !d) return;
1598
1606
  let e = !0;
1599
- return fetch(`${x || "/api"}/forms/${encodeURIComponent(d)}`, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
1607
+ return fetch(`${b || "/api"}/forms/${encodeURIComponent(d)}`, { headers: y ? { "x-tenant": y } : {} }).then((e) => e.json()).then((t) => e && T(t?.payload && typeof t.payload == "object" ? t.payload : null)).catch(() => e && T(null)), () => {
1600
1608
  e = !1;
1601
1609
  };
1602
1610
  }, [
1603
1611
  f,
1604
1612
  d,
1605
1613
  y,
1606
- x
1614
+ b
1607
1615
  ]);
1608
1616
  let j = [{
1609
1617
  section: null,
@@ -1613,25 +1621,29 @@ function tt({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1613
1621
  section: e,
1614
1622
  fields: []
1615
1623
  }) : j[j.length - 1].fields.push(e);
1616
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Ze(e.section.condition, E)).map((e) => ({
1624
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Qe(e.section.condition, E)).map((e) => ({
1617
1625
  ...e,
1618
- fields: e.fields.filter((e) => Ze(e.condition, E))
1626
+ fields: e.fields.filter((e) => Qe(e.condition, E))
1619
1627
  })), 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) => {
1620
1628
  let t = E[e.name];
1621
1629
  return e.required && (t == null || t === "" || t === !1);
1622
- }), R = F >= N.length - 1, z = (e, t) => D((n) => ({
1623
- ...n,
1624
- [e]: t
1625
- }));
1626
- return /* @__PURE__ */ l("div", {
1630
+ }), R = F >= N.length - 1, z = (e, t) => D((n) => {
1631
+ let r = {
1632
+ ...n,
1633
+ [e]: t
1634
+ };
1635
+ for (let t of Array.isArray(w?.fields) ? w.fields : []) t?.parentField === e && delete r[t.name];
1636
+ return r;
1637
+ });
1638
+ return /* @__PURE__ */ u("div", {
1627
1639
  ref: m,
1628
- style: b(e),
1640
+ style: x(e),
1629
1641
  children: [
1630
- /* @__PURE__ */ c("form", {
1642
+ /* @__PURE__ */ l("form", {
1631
1643
  action: t || void 0,
1632
1644
  method: n || "post",
1633
1645
  name: a || void 0,
1634
- encType: u || void 0,
1646
+ encType: o || void 0,
1635
1647
  onSubmit: async (e) => {
1636
1648
  if (e.preventDefault(), !h) {
1637
1649
  if (d) {
@@ -1639,7 +1651,7 @@ function tt({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1639
1651
  if (f) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
1640
1652
  else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
1641
1653
  try {
1642
- let e = await fetch(`${x || "/api"}/forms/${d}/submit`, {
1654
+ let e = await fetch(`${b || "/api"}/forms/${d}/submit`, {
1643
1655
  method: "post",
1644
1656
  headers: {
1645
1657
  "content-type": "application/json",
@@ -1669,16 +1681,16 @@ function tt({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1669
1681
  }
1670
1682
  },
1671
1683
  style: {
1672
- ...Ke,
1684
+ ...qe,
1673
1685
  display: A === "success" ? "none" : "flex"
1674
1686
  },
1675
- children: f && d ? /* @__PURE__ */ l(s, { children: [
1676
- P && /* @__PURE__ */ c(pt, {
1687
+ children: f && d ? /* @__PURE__ */ u(c, { children: [
1688
+ P && /* @__PURE__ */ l(ht, {
1677
1689
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1678
1690
  active: F + 1,
1679
1691
  style: { marginBottom: 8 }
1680
1692
  }),
1681
- P && N[F]?.section?.help && /* @__PURE__ */ c("p", {
1693
+ P && N[F]?.section?.help && /* @__PURE__ */ l("p", {
1682
1694
  style: {
1683
1695
  margin: 0,
1684
1696
  fontSize: 14,
@@ -1686,25 +1698,26 @@ function tt({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1686
1698
  },
1687
1699
  children: N[F].section.help
1688
1700
  }),
1689
- I.map((e) => /* @__PURE__ */ c(et, {
1701
+ I.map((e) => /* @__PURE__ */ l(nt, {
1690
1702
  field: e,
1691
1703
  value: E[e.name],
1704
+ values: E,
1692
1705
  onChange: z,
1693
1706
  inert: h
1694
1707
  }, e.name)),
1695
- /* @__PURE__ */ l("div", {
1708
+ /* @__PURE__ */ u("div", {
1696
1709
  style: {
1697
1710
  display: "flex",
1698
1711
  gap: 10,
1699
1712
  alignItems: "center",
1700
1713
  marginTop: 4
1701
1714
  },
1702
- children: [P && F > 0 && /* @__PURE__ */ c("button", {
1715
+ children: [P && F > 0 && /* @__PURE__ */ l("button", {
1703
1716
  type: "button",
1704
1717
  disabled: h || void 0,
1705
1718
  onClick: () => k(F - 1),
1706
1719
  style: {
1707
- ...Y,
1720
+ ...X,
1708
1721
  background: "transparent",
1709
1722
  color: "inherit",
1710
1723
  border: 0,
@@ -1712,12 +1725,12 @@ function tt({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1712
1725
  cursor: "pointer"
1713
1726
  },
1714
1727
  children: "Back"
1715
- }), P && !R ? /* @__PURE__ */ c("button", {
1728
+ }), P && !R ? /* @__PURE__ */ l("button", {
1716
1729
  type: "button",
1717
1730
  disabled: h || L.length > 0,
1718
1731
  onClick: () => k(F + 1),
1719
1732
  style: {
1720
- ...Y,
1733
+ ...X,
1721
1734
  border: 0,
1722
1735
  padding: "10px 22px",
1723
1736
  borderRadius: 8,
@@ -1727,11 +1740,11 @@ function tt({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1727
1740
  opacity: L.length ? .5 : 1
1728
1741
  },
1729
1742
  children: "Next"
1730
- }) : /* @__PURE__ */ c("button", {
1743
+ }) : /* @__PURE__ */ l("button", {
1731
1744
  type: "submit",
1732
1745
  disabled: h || void 0,
1733
1746
  style: {
1734
- ...Y,
1747
+ ...X,
1735
1748
  border: 0,
1736
1749
  padding: "10px 22px",
1737
1750
  borderRadius: 8,
@@ -1744,11 +1757,11 @@ function tt({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1744
1757
  })
1745
1758
  ] }) : g
1746
1759
  }),
1747
- /* @__PURE__ */ c("div", {
1760
+ /* @__PURE__ */ l("div", {
1748
1761
  style: { display: A === "success" ? "block" : "none" },
1749
1762
  children: _?.success ?? null
1750
1763
  }),
1751
- /* @__PURE__ */ c("div", {
1764
+ /* @__PURE__ */ l("div", {
1752
1765
  style: {
1753
1766
  display: A === "error" ? "block" : "none",
1754
1767
  marginTop: 12
@@ -1758,53 +1771,53 @@ function tt({ style: e, action: t, method: n, name: a, enctype: u, formSlug: d,
1758
1771
  ]
1759
1772
  });
1760
1773
  }
1761
- function nt({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1762
- return /* @__PURE__ */ c("label", {
1774
+ function it({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1775
+ return /* @__PURE__ */ l("label", {
1763
1776
  ref: r,
1764
1777
  style: {
1765
- ...qe,
1766
- ...b(n)
1778
+ ...Je,
1779
+ ...x(n)
1767
1780
  },
1768
1781
  children: Z(t, e, i)
1769
1782
  });
1770
1783
  }
1771
- function rt({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1772
- return /* @__PURE__ */ c("input", {
1784
+ function at({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1785
+ return /* @__PURE__ */ l("input", {
1773
1786
  ref: a,
1774
1787
  type: e,
1775
1788
  name: t || void 0,
1776
1789
  placeholder: n,
1777
1790
  required: !o && !!r,
1778
1791
  style: {
1779
- ...Je,
1780
- ...b(i)
1792
+ ...Ye,
1793
+ ...x(i)
1781
1794
  },
1782
- ...Xe(o)
1795
+ ...Ze(o)
1783
1796
  });
1784
1797
  }
1785
- function it({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1786
- return /* @__PURE__ */ c("textarea", {
1798
+ function ot({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1799
+ return /* @__PURE__ */ l("textarea", {
1787
1800
  ref: a,
1788
1801
  name: e || void 0,
1789
1802
  placeholder: t,
1790
1803
  rows: n,
1791
1804
  required: !o && !!r,
1792
1805
  style: {
1793
- ...Je,
1806
+ ...Ye,
1794
1807
  resize: "vertical",
1795
- ...b(i)
1808
+ ...x(i)
1796
1809
  },
1797
- ...Xe(o)
1810
+ ...Ze(o)
1798
1811
  });
1799
1812
  }
1800
- function at({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1801
- return /* @__PURE__ */ l("label", {
1813
+ function st({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1814
+ return /* @__PURE__ */ u("label", {
1802
1815
  ref: o,
1803
1816
  style: {
1804
- ...Ye,
1805
- ...b(a)
1817
+ ...Xe,
1818
+ ...x(a)
1806
1819
  },
1807
- children: [/* @__PURE__ */ c("input", {
1820
+ children: [/* @__PURE__ */ l("input", {
1808
1821
  type: e,
1809
1822
  name: n || void 0,
1810
1823
  value: r || void 0,
@@ -1818,8 +1831,8 @@ function at({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1818
1831
  }), t]
1819
1832
  });
1820
1833
  }
1821
- function ot({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1822
- return /* @__PURE__ */ l("select", {
1834
+ function ct({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1835
+ return /* @__PURE__ */ u("select", {
1823
1836
  ref: a,
1824
1837
  name: e || void 0,
1825
1838
  required: !o && !!r,
@@ -1827,58 +1840,58 @@ function ot({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1827
1840
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
1828
1841
  tabIndex: o ? -1 : void 0,
1829
1842
  style: {
1830
- ...Je,
1843
+ ...Ye,
1831
1844
  appearance: "auto",
1832
- ...b(i)
1845
+ ...x(i)
1833
1846
  },
1834
- children: [t !== "" && /* @__PURE__ */ c("option", {
1847
+ children: [t !== "" && /* @__PURE__ */ l("option", {
1835
1848
  value: "",
1836
1849
  disabled: !0,
1837
1850
  children: t ?? "Select…"
1838
- }), n.map((e, t) => /* @__PURE__ */ c("option", {
1851
+ }), n.map((e, t) => /* @__PURE__ */ l("option", {
1839
1852
  value: e,
1840
1853
  children: e
1841
1854
  }, t))]
1842
1855
  });
1843
1856
  }
1844
- function st({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: s }) {
1845
- let [u, d] = o(null);
1846
- return /* @__PURE__ */ l("label", {
1857
+ function lt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
1858
+ let [c, d] = s(null);
1859
+ return /* @__PURE__ */ u("label", {
1847
1860
  ref: a,
1848
1861
  style: {
1849
- ...Je,
1862
+ ...Ye,
1850
1863
  display: "flex",
1851
1864
  alignItems: "center",
1852
1865
  gap: "8px",
1853
- cursor: s ? "default" : "pointer",
1866
+ cursor: o ? "default" : "pointer",
1854
1867
  borderStyle: "dashed",
1855
- color: u ? "#111827" : "#6b7280",
1856
- ...b(i)
1868
+ color: c ? "#111827" : "#6b7280",
1869
+ ...x(i)
1857
1870
  },
1858
1871
  children: [
1859
- /* @__PURE__ */ c("input", {
1872
+ /* @__PURE__ */ l("input", {
1860
1873
  type: "file",
1861
1874
  name: e || void 0,
1862
1875
  accept: t || void 0,
1863
- required: !s && !!n,
1864
- disabled: !!s,
1876
+ required: !o && !!n,
1877
+ disabled: !!o,
1865
1878
  onChange: (e) => d(e.target.files?.[0]?.name ?? null),
1866
1879
  style: { display: "none" }
1867
1880
  }),
1868
- /* @__PURE__ */ c("span", {
1881
+ /* @__PURE__ */ l("span", {
1869
1882
  "aria-hidden": !0,
1870
1883
  children: "📎"
1871
1884
  }),
1872
- u ?? r
1885
+ c ?? r
1873
1886
  ]
1874
1887
  });
1875
1888
  }
1876
- function ct({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1877
- return /* @__PURE__ */ c("button", {
1889
+ function ut({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1890
+ return /* @__PURE__ */ l("button", {
1878
1891
  ref: n,
1879
1892
  type: r ? "button" : "submit",
1880
1893
  style: {
1881
- ...Y,
1894
+ ...X,
1882
1895
  border: 0,
1883
1896
  cursor: "pointer",
1884
1897
  alignSelf: "flex-start",
@@ -1888,72 +1901,76 @@ function ct({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1888
1901
  fontWeight: 600,
1889
1902
  lineHeight: 1.4,
1890
1903
  fontFamily: "inherit",
1891
- ...b(t)
1904
+ ...x(t)
1892
1905
  },
1893
1906
  children: e
1894
1907
  });
1895
1908
  }
1896
- function lt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1909
+ function dt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1897
1910
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1898
- return /* @__PURE__ */ c("div", {
1911
+ return /* @__PURE__ */ l("div", {
1899
1912
  ref: r,
1900
1913
  style: {
1901
1914
  display: "grid",
1902
1915
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
1903
1916
  gap: 16,
1904
1917
  width: "100%",
1905
- ...b(n)
1918
+ ...x(n)
1906
1919
  },
1907
- children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ c("div", {
1920
+ children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ l("div", {
1908
1921
  style: { minWidth: 0 },
1909
1922
  children: i?.[`cell-${t}`] ?? null
1910
1923
  }, t))
1911
1924
  });
1912
1925
  }
1913
- function ut({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: s, titleField: u = "name", textField: d, custom: f, templateId: p, style: m, nodeRef: h }) {
1914
- let { tenant: g, apiUrl: _ } = r(U), v = r(G), y = r(W)?.[e], [x, S] = o(null);
1926
+ function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, imageField: o, titleField: c = "name", textField: d, custom: f, templateId: p, style: m, nodeRef: h }) {
1927
+ let { tenant: g, apiUrl: _, locale: v } = r(U), y = r(G), b = r(W)?.[e], [S, C] = s(null);
1915
1928
  if (i(() => {
1916
- if (!e || y) return;
1917
- let t = !0, n = e.startsWith("api:") ? `${_}/data/${encodeURIComponent(e.slice(4))}` : `${_}/dynamic/${encodeURIComponent(e)}`;
1918
- return fetch(n, { headers: g ? { "x-tenant": g } : {} }).then((e) => e.json()).then((e) => t && S(Array.isArray(e?.payload) ? e.payload.filter((e) => e && typeof e == "object") : [])).catch(() => t && S([])), () => {
1929
+ if (!e || b) return;
1930
+ let t = !0, n = e.startsWith("api:") ? `${_}/data/${encodeURIComponent(e.slice(4))}` : `${_}/dynamic/${encodeURIComponent(e)}${v ? `?locale=${encodeURIComponent(v)}` : ""}`;
1931
+ return fetch(n, { headers: g ? { "x-tenant": g } : {} }).then((e) => e.json()).then((e) => {
1932
+ let n = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
1933
+ return t && C(n.filter((e) => e && typeof e == "object"));
1934
+ }).catch(() => t && C([])), () => {
1919
1935
  t = !1;
1920
1936
  };
1921
1937
  }, [
1922
1938
  e,
1923
1939
  g,
1924
1940
  _,
1925
- y
1941
+ v,
1942
+ b
1926
1943
  ]), !e) return null;
1927
- let C = (y ?? x ?? []).slice(0, Math.max(1, Number(t) || 6)), w = Math.min(Math.max(Number(a) || 3, 1), 6), T = n === "list" ? {
1944
+ let w = (b ?? S ?? []).slice(0, Math.max(1, Number(t) || 6)), T = Math.min(Math.max(Number(a) || 3, 1), 6), E = n === "list" ? {
1928
1945
  display: "flex",
1929
1946
  flexDirection: "column",
1930
1947
  gap: 20
1931
1948
  } : {
1932
1949
  display: "grid",
1933
- gridTemplateColumns: `repeat(${w}, minmax(0, 1fr))`,
1950
+ gridTemplateColumns: `repeat(${T}, minmax(0, 1fr))`,
1934
1951
  gap: 24
1935
1952
  };
1936
- return f && p && v?.render ? /* @__PURE__ */ c("div", {
1953
+ return f && p && y?.render ? /* @__PURE__ */ l("div", {
1937
1954
  ref: h,
1938
1955
  style: {
1939
1956
  width: "100%",
1940
- ...T,
1941
- ...b(m)
1957
+ ...E,
1958
+ ...x(m)
1942
1959
  },
1943
- children: C.map((e) => /* @__PURE__ */ c("div", {
1960
+ children: w.map((e) => /* @__PURE__ */ l("div", {
1944
1961
  style: { minWidth: 0 },
1945
- children: v.render(p, (t) => re(t, e))
1962
+ children: y.render(p, (t) => ie(t, e))
1946
1963
  }, e.id ?? e?.data?.slug))
1947
- }) : /* @__PURE__ */ c("div", {
1964
+ }) : /* @__PURE__ */ l("div", {
1948
1965
  ref: h,
1949
1966
  style: {
1950
1967
  width: "100%",
1951
- ...T,
1952
- ...b(m)
1968
+ ...E,
1969
+ ...x(m)
1953
1970
  },
1954
- children: C.map((e) => {
1955
- let t = s ? K(e?.data, s) : null, r = u ? q(K(e?.data, u)) : null, i = d ? K(e?.data, d) : null, a = Array.isArray(i) ? i : null, o = a || i == null ? null : q(i), f = n === "list";
1956
- return /* @__PURE__ */ l("div", {
1971
+ children: w.map((e) => {
1972
+ let t = o ? K(e?.data, o) : null, r = c ? q(K(e?.data, c)) : null, i = d ? K(e?.data, d) : null, a = Array.isArray(i) ? i : null, s = a || i == null ? null : q(i), f = n === "list";
1973
+ return /* @__PURE__ */ u("div", {
1957
1974
  style: {
1958
1975
  display: "flex",
1959
1976
  flexDirection: f ? "row" : "column",
@@ -1961,7 +1978,7 @@ function ut({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
1961
1978
  alignItems: f ? "center" : "stretch",
1962
1979
  minWidth: 0
1963
1980
  },
1964
- children: [t && /* @__PURE__ */ c("img", {
1981
+ children: [t && /* @__PURE__ */ l("img", {
1965
1982
  src: t,
1966
1983
  alt: r ?? "",
1967
1984
  style: {
@@ -1972,10 +1989,10 @@ function ut({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
1972
1989
  flexShrink: 0,
1973
1990
  display: "block"
1974
1991
  }
1975
- }), /* @__PURE__ */ l("div", {
1992
+ }), /* @__PURE__ */ u("div", {
1976
1993
  style: { minWidth: 0 },
1977
1994
  children: [
1978
- r && /* @__PURE__ */ c("h3", {
1995
+ r && /* @__PURE__ */ l("h3", {
1979
1996
  style: {
1980
1997
  margin: 0,
1981
1998
  fontSize: 18,
@@ -1983,23 +2000,23 @@ function ut({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
1983
2000
  },
1984
2001
  children: r
1985
2002
  }),
1986
- o && /* @__PURE__ */ c("p", {
2003
+ s && /* @__PURE__ */ l("p", {
1987
2004
  style: {
1988
2005
  margin: "6px 0 0",
1989
2006
  fontSize: 14,
1990
2007
  lineHeight: 1.55,
1991
2008
  opacity: .75
1992
2009
  },
1993
- children: o
2010
+ children: s
1994
2011
  }),
1995
- a && /* @__PURE__ */ c("div", {
2012
+ a && /* @__PURE__ */ l("div", {
1996
2013
  style: {
1997
2014
  marginTop: 6,
1998
2015
  fontSize: 14,
1999
2016
  lineHeight: 1.55,
2000
2017
  opacity: .85
2001
2018
  },
2002
- children: _e(a)
2019
+ children: ve(a)
2003
2020
  })
2004
2021
  ]
2005
2022
  })]
@@ -2007,12 +2024,12 @@ function ut({ collection: e, limit: t = 6, layout: n = "grid", columns: a = 3, i
2007
2024
  })
2008
2025
  });
2009
2026
  }
2010
- function dt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2011
- return e.length ? /* @__PURE__ */ c("nav", {
2027
+ function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2028
+ return e.length ? /* @__PURE__ */ l("nav", {
2012
2029
  ref: r,
2013
2030
  "aria-label": "Breadcrumb",
2014
- style: { ...b(n) },
2015
- children: /* @__PURE__ */ c("ol", {
2031
+ style: { ...x(n) },
2032
+ children: /* @__PURE__ */ l("ol", {
2016
2033
  style: {
2017
2034
  display: "flex",
2018
2035
  flexWrap: "wrap",
@@ -2025,25 +2042,25 @@ function dt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2025
2042
  },
2026
2043
  children: e.map((n, r) => {
2027
2044
  let i = r === e.length - 1;
2028
- return /* @__PURE__ */ l("li", {
2045
+ return /* @__PURE__ */ u("li", {
2029
2046
  style: {
2030
2047
  display: "flex",
2031
2048
  alignItems: "center",
2032
2049
  gap: 8,
2033
2050
  minWidth: 0
2034
2051
  },
2035
- children: [r > 0 && /* @__PURE__ */ c("span", {
2052
+ children: [r > 0 && /* @__PURE__ */ l("span", {
2036
2053
  style: { opacity: .4 },
2037
2054
  "aria-hidden": !0,
2038
2055
  children: t
2039
- }), i || !n.href ? /* @__PURE__ */ c("span", {
2056
+ }), i || !n.href ? /* @__PURE__ */ l("span", {
2040
2057
  style: {
2041
2058
  fontWeight: i ? 600 : 400,
2042
2059
  opacity: i ? 1 : .7
2043
2060
  },
2044
2061
  "aria-current": i ? "page" : void 0,
2045
2062
  children: n.label
2046
- }) : /* @__PURE__ */ c("a", {
2063
+ }) : /* @__PURE__ */ l("a", {
2047
2064
  href: n.href,
2048
2065
  style: {
2049
2066
  color: "inherit",
@@ -2057,8 +2074,8 @@ function dt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2057
2074
  })
2058
2075
  }) : null;
2059
2076
  }
2060
- function ft({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2061
- let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), u = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", d = (e) => ({
2077
+ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2078
+ 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) => ({
2062
2079
  display: "inline-flex",
2063
2080
  alignItems: "center",
2064
2081
  justifyContent: "center",
@@ -2072,7 +2089,7 @@ function ft({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2072
2089
  background: e ? "var(--page-accent, #111827)" : "transparent",
2073
2090
  border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
2074
2091
  });
2075
- return /* @__PURE__ */ l("nav", {
2092
+ return /* @__PURE__ */ u("nav", {
2076
2093
  ref: a,
2077
2094
  "aria-label": "Pagination",
2078
2095
  style: {
@@ -2080,11 +2097,11 @@ function ft({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2080
2097
  flexWrap: "wrap",
2081
2098
  gap: 8,
2082
2099
  alignItems: "center",
2083
- ...b(i)
2100
+ ...x(i)
2084
2101
  },
2085
2102
  children: [
2086
- n && /* @__PURE__ */ c("a", {
2087
- href: s > 1 ? u(s - 1) : "#",
2103
+ n && /* @__PURE__ */ l("a", {
2104
+ href: s > 1 ? c(s - 1) : "#",
2088
2105
  "aria-label": "Previous",
2089
2106
  style: {
2090
2107
  ...d(!1),
@@ -2092,14 +2109,14 @@ function ft({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2092
2109
  },
2093
2110
  children: "‹"
2094
2111
  }),
2095
- Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ c("a", {
2096
- href: u(e),
2112
+ Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ l("a", {
2113
+ href: c(e),
2097
2114
  "aria-current": e === s ? "page" : void 0,
2098
2115
  style: d(e === s),
2099
2116
  children: e
2100
2117
  }, e)),
2101
- n && /* @__PURE__ */ c("a", {
2102
- href: s < o ? u(s + 1) : "#",
2118
+ n && /* @__PURE__ */ l("a", {
2119
+ href: s < o ? c(s + 1) : "#",
2103
2120
  "aria-label": "Next",
2104
2121
  style: {
2105
2122
  ...d(!1),
@@ -2110,7 +2127,7 @@ function ft({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2110
2127
  ]
2111
2128
  });
2112
2129
  }
2113
- function pt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2130
+ function ht({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2114
2131
  if (!e.length) return null;
2115
2132
  let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
2116
2133
  width: 32,
@@ -2127,7 +2144,7 @@ function pt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2127
2144
  border: e === "todo" ? "1px solid rgba(148, 163, 184, 0.5)" : "1px solid transparent",
2128
2145
  opacity: e === "todo" ? .6 : 1,
2129
2146
  boxShadow: e === "active" ? "0 0 0 4px rgba(99, 102, 241, 0.2)" : "none"
2130
- }), u = (e) => ({
2147
+ }), c = (e) => ({
2131
2148
  flexGrow: 1,
2132
2149
  alignSelf: "center",
2133
2150
  background: e ? "var(--page-accent, #111827)" : "rgba(148, 163, 184, 0.4)",
@@ -2141,21 +2158,21 @@ function pt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2141
2158
  minWidth: 24
2142
2159
  }
2143
2160
  });
2144
- return /* @__PURE__ */ c("div", {
2161
+ return /* @__PURE__ */ l("div", {
2145
2162
  ref: a,
2146
2163
  style: {
2147
2164
  display: "flex",
2148
2165
  flexDirection: r ? "column" : "row",
2149
2166
  alignItems: r ? "stretch" : "flex-start",
2150
2167
  gap: r ? 4 : 8,
2151
- ...b(i)
2168
+ ...x(i)
2152
2169
  },
2153
2170
  children: e.map((e, n) => {
2154
2171
  let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
2155
- return /* @__PURE__ */ l(t, { children: [n > 0 && /* @__PURE__ */ c("div", {
2156
- style: u(i <= o),
2172
+ return /* @__PURE__ */ u(t, { children: [n > 0 && /* @__PURE__ */ l("div", {
2173
+ style: c(i <= o),
2157
2174
  "aria-hidden": !0
2158
- }), /* @__PURE__ */ l("div", {
2175
+ }), /* @__PURE__ */ u("div", {
2159
2176
  style: {
2160
2177
  display: "flex",
2161
2178
  flexDirection: r ? "row" : "column",
@@ -2164,19 +2181,19 @@ function pt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2164
2181
  minWidth: 0,
2165
2182
  textAlign: r ? "left" : "center"
2166
2183
  },
2167
- children: [/* @__PURE__ */ c("div", {
2184
+ children: [/* @__PURE__ */ l("div", {
2168
2185
  style: s(a),
2169
2186
  children: a === "done" ? "✓" : i
2170
- }), /* @__PURE__ */ l("div", {
2187
+ }), /* @__PURE__ */ u("div", {
2171
2188
  style: { minWidth: 0 },
2172
- children: [/* @__PURE__ */ c("div", {
2189
+ children: [/* @__PURE__ */ l("div", {
2173
2190
  style: {
2174
2191
  fontSize: 13,
2175
2192
  fontWeight: a === "active" ? 700 : 500,
2176
2193
  opacity: a === "todo" ? .6 : 1
2177
2194
  },
2178
2195
  children: e.label
2179
- }), e.description && /* @__PURE__ */ c("div", {
2196
+ }), e.description && /* @__PURE__ */ l("div", {
2180
2197
  style: {
2181
2198
  fontSize: 12,
2182
2199
  opacity: .6
@@ -2188,8 +2205,422 @@ function pt({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2188
2205
  })
2189
2206
  });
2190
2207
  }
2191
- function mt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: s = !0, bordered: u = !1, compact: d = !1, style: f, nodeRef: p }) {
2192
- let { tenant: m, apiUrl: h } = r(U), g = r(W)?.[n], [_, v] = o(null);
2208
+ var gt = {
2209
+ small: {
2210
+ w: 132,
2211
+ h: 46,
2212
+ name: 11.5,
2213
+ title: 10,
2214
+ avatar: 28
2215
+ },
2216
+ medium: {
2217
+ w: 168,
2218
+ h: 56,
2219
+ name: 13,
2220
+ title: 11,
2221
+ avatar: 36
2222
+ },
2223
+ large: {
2224
+ w: 210,
2225
+ h: 70,
2226
+ name: 15.5,
2227
+ title: 12.5,
2228
+ avatar: 46
2229
+ }
2230
+ }, _t = (e) => gt[e] ?? gt.medium;
2231
+ gt.medium.w, gt.medium.h;
2232
+ function vt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2233
+ let r = _t(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 = [];
2234
+ 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);
2235
+ let d = /* @__PURE__ */ new Map(), f = (e, t) => {
2236
+ if (t.has(e.id)) return 0;
2237
+ t.add(e.id);
2238
+ let n = (l.get(e.id) ?? []).reduce((e, n, r) => e + f(n, t) + (r ? a : 0), 0), r = Math.max(i, n);
2239
+ return d.set(e.id, r), r;
2240
+ };
2241
+ u.forEach((e) => f(e, /* @__PURE__ */ new Set()));
2242
+ let p = [], m = [], h = 0, g = (e, t, s, c) => {
2243
+ if (c.has(e.id)) return;
2244
+ c.add(e.id);
2245
+ let u = t + ((d.get(e.id) ?? i) - i) / 2, f = s * o, _ = n ? f : u, v = n ? u : f;
2246
+ p.push({
2247
+ node: e,
2248
+ x: _,
2249
+ y: v
2250
+ }), h = Math.max(h, f + (n ? r.w : r.h));
2251
+ let y = t;
2252
+ for (let t of l.get(e.id) ?? []) {
2253
+ let e = y + ((d.get(t.id) ?? i) - i) / 2 + i / 2, l = (s + 1) * o;
2254
+ m.push(n ? {
2255
+ from: {
2256
+ x: f + r.w,
2257
+ y: u + r.h / 2
2258
+ },
2259
+ to: {
2260
+ x: l,
2261
+ y: e
2262
+ }
2263
+ } : {
2264
+ from: {
2265
+ x: u + r.w / 2,
2266
+ y: f + r.h
2267
+ },
2268
+ to: {
2269
+ x: e,
2270
+ y: l
2271
+ }
2272
+ }), g(t, y, s + 1, c), y += (d.get(t.id) ?? i) + a;
2273
+ }
2274
+ }, _ = 0, v = /* @__PURE__ */ new Set();
2275
+ for (let e of u) g(e, _, 0, v), _ += (d.get(e.id) ?? i) + a;
2276
+ let y = Math.max(_ - a, i);
2277
+ return {
2278
+ boxes: p,
2279
+ links: m,
2280
+ width: n ? Math.max(h, r.w) : y,
2281
+ height: n ? y : Math.max(h, r.h),
2282
+ horizontal: n
2283
+ };
2284
+ }
2285
+ var yt = (e, t) => {
2286
+ let n = String(e ?? "");
2287
+ return n.length > t ? `${n.slice(0, t - 1)}…` : n;
2288
+ }, bt = (e) => {
2289
+ let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
2290
+ if (!t) return "#ffffff";
2291
+ let n = t[1];
2292
+ n.length === 3 && (n = [...n].map((e) => e + e).join(""));
2293
+ let r = parseInt(n, 16);
2294
+ return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
2295
+ }, xt = (e) => !!(e?.cv?.trim?.() || e?.photo);
2296
+ function St(e, t = {}) {
2297
+ 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 ? "" : q(e);
2298
+ return n.map((e) => {
2299
+ let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
2300
+ return {
2301
+ id: e.id,
2302
+ name: i(n[t.nameField || "name"]) || i(n.name) || "Untitled",
2303
+ title: t.titleField ? i(n[t.titleField]) : "",
2304
+ photo: t.photoField && r(n[t.photoField]) || "",
2305
+ parent: t.parentField ? o : null,
2306
+ cv: t.cvField ? i(n[t.cvField]) : "",
2307
+ href: t.hrefField ? i(n[t.hrefField]) : ""
2308
+ };
2309
+ });
2310
+ }
2311
+ var Ct = {
2312
+ size: 36,
2313
+ pad: 10
2314
+ };
2315
+ function wt({ node: e, onClose: t }) {
2316
+ return i(() => {
2317
+ let e = (e) => e.key === "Escape" && t();
2318
+ return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
2319
+ }, [t]), /* @__PURE__ */ l("div", {
2320
+ onClick: t,
2321
+ role: "dialog",
2322
+ "aria-modal": "true",
2323
+ "aria-label": e.name,
2324
+ style: {
2325
+ position: "fixed",
2326
+ inset: 0,
2327
+ zIndex: 1e3,
2328
+ background: "rgba(15, 23, 42, 0.55)",
2329
+ display: "flex",
2330
+ alignItems: "center",
2331
+ justifyContent: "center",
2332
+ padding: 16
2333
+ },
2334
+ children: /* @__PURE__ */ u("div", {
2335
+ onClick: (e) => e.stopPropagation(),
2336
+ style: {
2337
+ background: "var(--page-bg, #ffffff)",
2338
+ color: "var(--page-text, #111827)",
2339
+ borderRadius: 14,
2340
+ maxWidth: 420,
2341
+ width: "100%",
2342
+ maxHeight: "80vh",
2343
+ overflowY: "auto",
2344
+ padding: 24,
2345
+ position: "relative",
2346
+ boxShadow: "0 24px 64px rgba(15, 23, 42, 0.35)"
2347
+ },
2348
+ children: [
2349
+ /* @__PURE__ */ l("button", {
2350
+ type: "button",
2351
+ "aria-label": "Close",
2352
+ onClick: t,
2353
+ style: {
2354
+ position: "absolute",
2355
+ top: 10,
2356
+ right: 10,
2357
+ width: 30,
2358
+ height: 30,
2359
+ border: 0,
2360
+ borderRadius: 8,
2361
+ background: "transparent",
2362
+ color: "inherit",
2363
+ fontSize: 18,
2364
+ lineHeight: 1,
2365
+ cursor: "pointer",
2366
+ opacity: .6
2367
+ },
2368
+ children: "×"
2369
+ }),
2370
+ /* @__PURE__ */ u("div", {
2371
+ style: {
2372
+ display: "flex",
2373
+ alignItems: "center",
2374
+ gap: 14,
2375
+ marginBottom: e.cv ? 14 : 0
2376
+ },
2377
+ children: [e.photo && /* @__PURE__ */ l("img", {
2378
+ src: e.photo,
2379
+ alt: "",
2380
+ style: {
2381
+ width: 72,
2382
+ height: 72,
2383
+ borderRadius: "50%",
2384
+ objectFit: "cover",
2385
+ flexShrink: 0
2386
+ }
2387
+ }), /* @__PURE__ */ u("div", {
2388
+ style: { minWidth: 0 },
2389
+ children: [/* @__PURE__ */ l("div", {
2390
+ style: {
2391
+ fontSize: 18,
2392
+ fontWeight: 700
2393
+ },
2394
+ children: e.name
2395
+ }), e.title && /* @__PURE__ */ l("div", {
2396
+ style: {
2397
+ fontSize: 13,
2398
+ opacity: .65
2399
+ },
2400
+ children: e.title
2401
+ })]
2402
+ })]
2403
+ }),
2404
+ e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ l("p", {
2405
+ style: {
2406
+ fontSize: 14,
2407
+ lineHeight: 1.6,
2408
+ margin: "0 0 10px"
2409
+ },
2410
+ children: e
2411
+ }, t)),
2412
+ e.href && /* @__PURE__ */ l("a", {
2413
+ href: e.href,
2414
+ target: "_blank",
2415
+ rel: "noopener noreferrer",
2416
+ style: {
2417
+ display: "inline-block",
2418
+ marginTop: 6,
2419
+ padding: "8px 14px",
2420
+ borderRadius: 8,
2421
+ fontSize: 13,
2422
+ fontWeight: 600,
2423
+ textDecoration: "none",
2424
+ background: "var(--page-accent, #4f46e5)",
2425
+ color: "var(--page-accent-text, #ffffff)"
2426
+ },
2427
+ children: "Open profile ↗"
2428
+ })
2429
+ ]
2430
+ })
2431
+ });
2432
+ }
2433
+ function Tt({ nodes: e = [], source: t, nameField: n, titleField: o, photoField: d, parentField: f, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
2434
+ let b = a(), [S, C] = s(null), { tenant: w, apiUrl: T } = r(U), E = r(W)?.[t], [D, O] = s(null);
2435
+ i(() => {
2436
+ if (!t || E) return;
2437
+ let e = !0;
2438
+ return fetch(`${T}/dynamic/${encodeURIComponent(t)}`, { headers: w ? { "x-tenant": w } : {} }).then((e) => e.json()).then((t) => {
2439
+ let n = Array.isArray(t?.payload) ? t.payload : Array.isArray(t?.payload?.data) ? t.payload.data : [];
2440
+ e && O(n);
2441
+ }).catch(() => e && O([])), () => {
2442
+ e = !1;
2443
+ };
2444
+ }, [
2445
+ t,
2446
+ w,
2447
+ T,
2448
+ E
2449
+ ]);
2450
+ let k = t ? St(E ?? D ?? [], {
2451
+ nameField: n,
2452
+ titleField: o,
2453
+ photoField: d,
2454
+ parentField: f,
2455
+ cvField: p,
2456
+ hrefField: m
2457
+ }) : e, A = _t(h), { boxes: j, links: M, width: N, height: P } = vt(k, {
2458
+ size: h,
2459
+ horizontal: g
2460
+ });
2461
+ if (!j.length) return !y && t ? /* @__PURE__ */ u("div", {
2462
+ ref: v,
2463
+ style: {
2464
+ padding: 18,
2465
+ border: "1px dashed rgba(148, 163, 184, 0.6)",
2466
+ borderRadius: 10,
2467
+ fontSize: 13,
2468
+ opacity: .7,
2469
+ textAlign: "center",
2470
+ ...x(_)
2471
+ },
2472
+ children: [
2473
+ "Org Chart — no published entries in “",
2474
+ t,
2475
+ "” yet"
2476
+ ]
2477
+ }) : null;
2478
+ let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
2479
+ return /* @__PURE__ */ u("div", {
2480
+ ref: v,
2481
+ style: {
2482
+ maxWidth: "100%",
2483
+ overflowX: "auto",
2484
+ ...x(_)
2485
+ },
2486
+ children: [/* @__PURE__ */ u("svg", {
2487
+ viewBox: `0 0 ${N} ${P}`,
2488
+ role: "img",
2489
+ "aria-label": "Organization chart",
2490
+ style: {
2491
+ display: "block",
2492
+ width: "100%",
2493
+ maxWidth: N,
2494
+ height: "auto",
2495
+ margin: "0 auto"
2496
+ },
2497
+ children: [M.map((e, t) => /* @__PURE__ */ l("path", {
2498
+ d: g ? `M ${e.from.x} ${e.from.y} H ${(e.from.x + e.to.x) / 2} V ${e.to.y} H ${e.to.x}` : `M ${e.from.x} ${e.from.y} V ${(e.from.y + e.to.y) / 2} H ${e.to.x} V ${e.to.y}`,
2499
+ fill: "none",
2500
+ stroke: "rgba(148, 163, 184, 0.7)",
2501
+ strokeWidth: "1.5"
2502
+ }, t)), j.map(({ node: e, x: t, y: n }) => {
2503
+ 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 ? bt(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", d = i ? bt(e.color2) : s, f = y && (xt(e) || e.href), p = () => xt(e) ? C(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Ct.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);
2504
+ return /* @__PURE__ */ u("g", {
2505
+ onClick: f ? p : void 0,
2506
+ style: f ? { cursor: "pointer" } : void 0,
2507
+ role: f ? "button" : void 0,
2508
+ "aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
2509
+ children: [
2510
+ i && e.gradient ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("linearGradient", {
2511
+ id: `${b}-${e.id}-grad`,
2512
+ x1: "0",
2513
+ y1: "0",
2514
+ x2: "0",
2515
+ y2: "1",
2516
+ children: [/* @__PURE__ */ l("stop", {
2517
+ offset: "0%",
2518
+ stopColor: e.color || "var(--page-accent, #4f46e5)"
2519
+ }), /* @__PURE__ */ l("stop", {
2520
+ offset: "100%",
2521
+ stopColor: e.color2
2522
+ })]
2523
+ }), /* @__PURE__ */ l("rect", {
2524
+ x: t,
2525
+ y: n,
2526
+ width: A.w,
2527
+ height: A.h,
2528
+ rx: "10",
2529
+ fill: `url(#${b}-${e.id}-grad)`
2530
+ })] }) : i ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
2531
+ id: `${b}-${e.id}-box`,
2532
+ children: /* @__PURE__ */ l("rect", {
2533
+ x: t,
2534
+ y: n,
2535
+ width: A.w,
2536
+ height: A.h,
2537
+ rx: "10"
2538
+ })
2539
+ }), /* @__PURE__ */ u("g", {
2540
+ clipPath: `url(#${b}-${e.id}-box)`,
2541
+ children: [/* @__PURE__ */ l("rect", {
2542
+ x: t,
2543
+ y: n,
2544
+ width: A.w,
2545
+ height: _,
2546
+ fill: o
2547
+ }), /* @__PURE__ */ l("rect", {
2548
+ x: t,
2549
+ y: n + _,
2550
+ width: A.w,
2551
+ height: A.h - _,
2552
+ fill: e.color2
2553
+ })]
2554
+ })] }) : /* @__PURE__ */ l("rect", {
2555
+ x: t,
2556
+ y: n,
2557
+ width: A.w,
2558
+ height: A.h,
2559
+ rx: "10",
2560
+ fill: o,
2561
+ stroke: a ? "none" : "var(--page-accent, #4f46e5)",
2562
+ strokeWidth: a ? 0 : 1.5
2563
+ }),
2564
+ e.photo && /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l("clipPath", {
2565
+ id: `${b}-${e.id}`,
2566
+ children: /* @__PURE__ */ l("circle", {
2567
+ cx: t + Ct.pad + A.avatar / 2,
2568
+ cy: n + A.h / 2,
2569
+ r: A.avatar / 2
2570
+ })
2571
+ }), /* @__PURE__ */ l("image", {
2572
+ href: e.photo,
2573
+ x: t + Ct.pad,
2574
+ y: n + (A.h - A.avatar) / 2,
2575
+ width: A.avatar,
2576
+ height: A.avatar,
2577
+ preserveAspectRatio: "xMidYMid slice",
2578
+ clipPath: `url(#${b}-${e.id})`
2579
+ })] }),
2580
+ i && !e.gradient ? /* @__PURE__ */ u(c, { children: [e.title && /* @__PURE__ */ l("text", {
2581
+ x: m,
2582
+ y: n + _ / 2 + A.title * .35,
2583
+ textAnchor: h,
2584
+ fontSize: A.title,
2585
+ fontWeight: "600",
2586
+ fill: s,
2587
+ children: yt(e.title, g + 4)
2588
+ }), e.name && /* @__PURE__ */ l("text", {
2589
+ x: m,
2590
+ y: n + _ + _ / 2 + A.name * .35,
2591
+ textAnchor: h,
2592
+ fontSize: A.name,
2593
+ fontWeight: "600",
2594
+ fill: d,
2595
+ children: yt(e.name, g)
2596
+ })] }) : /* @__PURE__ */ u(c, { children: [v[0] && /* @__PURE__ */ l("text", {
2597
+ x: m,
2598
+ y: n + (v[1] ? A.h * .43 : A.h * .57),
2599
+ textAnchor: h,
2600
+ fontSize: A.name,
2601
+ fontWeight: "600",
2602
+ fill: s,
2603
+ children: yt(v[0], g)
2604
+ }), v[1] && /* @__PURE__ */ l("text", {
2605
+ x: m,
2606
+ y: n + A.h * .73,
2607
+ textAnchor: h,
2608
+ fontSize: A.title,
2609
+ opacity: "0.7",
2610
+ fill: s,
2611
+ children: yt(v[1], g + 4)
2612
+ })] })
2613
+ ]
2614
+ }, e.id);
2615
+ })]
2616
+ }), S && /* @__PURE__ */ l(wt, {
2617
+ node: S,
2618
+ onClose: () => C(null)
2619
+ })]
2620
+ });
2621
+ }
2622
+ function Et({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped: o = !0, bordered: c = !1, compact: d = !1, style: f, nodeRef: p }) {
2623
+ let { tenant: m, apiUrl: h } = r(U), g = r(W)?.[n], [_, v] = s(null);
2193
2624
  if (i(() => {
2194
2625
  if (!n || g) return;
2195
2626
  let e = !0, t = n.startsWith("api:") ? `${h}/data/${encodeURIComponent(n.slice(4))}` : `${h}/dynamic/${encodeURIComponent(n)}`;
@@ -2202,22 +2633,22 @@ function mt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
2202
2633
  h,
2203
2634
  g
2204
2635
  ]), !e.length) return null;
2205
- let y = n ? (g ?? _ ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, x = y ? y.map((t) => e.map((e) => q(K(t?.data, e.field)))) : t, S = d ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = u ? { border: C } : { borderBottom: C };
2206
- return /* @__PURE__ */ c("div", {
2636
+ let y = n ? (g ?? _ ?? []).slice(0, Math.max(1, Number(a) || 10)) : null, b = y ? y.map((t) => e.map((e) => q(K(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 };
2637
+ return /* @__PURE__ */ l("div", {
2207
2638
  ref: p,
2208
2639
  style: {
2209
2640
  width: "100%",
2210
2641
  overflowX: "auto",
2211
- ...b(f)
2642
+ ...x(f)
2212
2643
  },
2213
- children: /* @__PURE__ */ l("table", {
2644
+ children: /* @__PURE__ */ u("table", {
2214
2645
  style: {
2215
2646
  width: "100%",
2216
2647
  borderCollapse: "collapse",
2217
2648
  fontSize: 14,
2218
- ...u ? { border: C } : {}
2649
+ ...c ? { border: C } : {}
2219
2650
  },
2220
- children: [/* @__PURE__ */ c("thead", { children: /* @__PURE__ */ c("tr", { children: e.map((e, t) => /* @__PURE__ */ c("th", {
2651
+ children: [/* @__PURE__ */ l("thead", { children: /* @__PURE__ */ l("tr", { children: e.map((e, t) => /* @__PURE__ */ l("th", {
2221
2652
  style: {
2222
2653
  textAlign: "left",
2223
2654
  fontWeight: 600,
@@ -2226,9 +2657,9 @@ function mt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
2226
2657
  ...w
2227
2658
  },
2228
2659
  children: e.label ?? e
2229
- }, t)) }) }), /* @__PURE__ */ c("tbody", { children: x.map((t, n) => /* @__PURE__ */ c("tr", {
2230
- style: s && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2231
- children: e.map((e, n) => /* @__PURE__ */ c("td", {
2660
+ }, t)) }) }), /* @__PURE__ */ l("tbody", { children: b.map((t, n) => /* @__PURE__ */ l("tr", {
2661
+ style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2662
+ children: e.map((e, n) => /* @__PURE__ */ l("td", {
2232
2663
  style: {
2233
2664
  padding: S,
2234
2665
  ...w
@@ -2239,82 +2670,83 @@ function mt({ columns: e = [], rows: t = [], source: n, limit: a = 10, striped:
2239
2670
  })
2240
2671
  });
2241
2672
  }
2242
- var ht = {
2243
- PageRoot: ce,
2244
- Section: le,
2245
- Container: ue,
2246
- Heading: de,
2247
- TextBlock: Se,
2248
- ButtonBlock: Te,
2249
- ImageBlock: Ee,
2250
- Spacer: Me,
2251
- Divider: Ne,
2252
- SliderBlock: ze,
2253
- CanvasSlider: Be,
2254
- TabsBlock: We,
2255
- QuickStack: lt,
2256
- CollectionList: ut,
2257
- BreadcrumbsBlock: dt,
2258
- PaginationBlock: ft,
2259
- StepperBlock: pt,
2260
- TableBlock: mt,
2261
- AccordionBlock: Ge,
2262
- NavbarBlock: Ue,
2263
- ListBlock: xe,
2264
- TextSpan: me,
2265
- QuoteBlock: be,
2266
- TextLink: we,
2267
- RichTextBlock: ve,
2268
- RichContentBlock: ve,
2269
- VideoBlock: De,
2270
- YouTubeBlock: ke,
2271
- IframeBlock: Ae,
2272
- EmbedBlock: je,
2273
- FormBlock: tt,
2274
- FormLabel: nt,
2275
- FormInput: rt,
2276
- FormTextarea: it,
2277
- FormCheckbox: (e) => /* @__PURE__ */ c(at, {
2673
+ var Dt = {
2674
+ PageRoot: le,
2675
+ Section: ue,
2676
+ Container: de,
2677
+ Heading: fe,
2678
+ TextBlock: Ce,
2679
+ ButtonBlock: Ee,
2680
+ ImageBlock: De,
2681
+ Spacer: Ne,
2682
+ Divider: Pe,
2683
+ SliderBlock: Be,
2684
+ CanvasSlider: Ve,
2685
+ TabsBlock: Ge,
2686
+ QuickStack: dt,
2687
+ CollectionList: ft,
2688
+ BreadcrumbsBlock: pt,
2689
+ PaginationBlock: mt,
2690
+ StepperBlock: ht,
2691
+ OrgChartBlock: Tt,
2692
+ TableBlock: Et,
2693
+ AccordionBlock: Ke,
2694
+ NavbarBlock: We,
2695
+ ListBlock: Se,
2696
+ TextSpan: he,
2697
+ QuoteBlock: xe,
2698
+ TextLink: Te,
2699
+ RichTextBlock: ye,
2700
+ RichContentBlock: ye,
2701
+ VideoBlock: Oe,
2702
+ YouTubeBlock: Ae,
2703
+ IframeBlock: je,
2704
+ EmbedBlock: Me,
2705
+ FormBlock: rt,
2706
+ FormLabel: it,
2707
+ FormInput: at,
2708
+ FormTextarea: ot,
2709
+ FormCheckbox: (e) => /* @__PURE__ */ l(st, {
2278
2710
  kind: "checkbox",
2279
2711
  ...e
2280
2712
  }),
2281
- FormRadio: (e) => /* @__PURE__ */ c(at, {
2713
+ FormRadio: (e) => /* @__PURE__ */ l(st, {
2282
2714
  kind: "radio",
2283
2715
  ...e
2284
2716
  }),
2285
- FormSelect: ot,
2286
- FormFile: st,
2287
- FormSubmit: ct
2717
+ FormSelect: ct,
2718
+ FormFile: lt,
2719
+ FormSubmit: ut
2288
2720
  };
2289
2721
  //#endregion
2290
2722
  //#region ../ui/src/components/builder/render.jsx
2291
2723
  function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2292
2724
  let o = n[e];
2293
2725
  if (!o || o.hidden) return null;
2294
- let s = o.type?.resolvedName, l = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
2726
+ let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
2295
2727
  if (s === "ComponentInstance") {
2296
2728
  let n = o.props?.componentId, s = r?.[n];
2297
2729
  if (!s?.template || i.has(n)) return null;
2298
- let l = new Set(i).add(n);
2299
- return /* @__PURE__ */ c(t, { children: Q(s.template.rootId, s.template.nodes, r, l, a) }, e);
2730
+ let c = new Set(i).add(n);
2731
+ return /* @__PURE__ */ l(t, { children: Q(s.template.rootId, s.template.nodes, r, c, a) }, e);
2300
2732
  }
2301
- let u = ht[s];
2733
+ let u = Dt[s];
2302
2734
  if (!u) return null;
2303
2735
  let d = (o.nodes ?? []).map((e) => Q(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, Q(t, n, r, i)])) : void 0;
2304
- return /* @__PURE__ */ c(u, {
2305
- ...l,
2736
+ return /* @__PURE__ */ l(u, {
2737
+ ...c,
2306
2738
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
2307
2739
  linked: p,
2308
2740
  nodeRef: (t) => {
2309
- t && (t.setAttribute("data-wb", e), w(t, l));
2741
+ t && (t.setAttribute("data-wb", e), T(t, c));
2310
2742
  },
2311
2743
  children: d.length ? d : void 0
2312
2744
  }, e);
2313
2745
  }
2314
2746
  //#endregion
2315
2747
  //#region ../ui/src/components/builder/PageRenderer.jsx
2316
- var gt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2317
- function _t({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, custom: s, tenant: u, apiUrl: d, datasets: p, locale: h, direction: _ }) {
2748
+ var Ot = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
2749
+ function kt({ blocks: e, theme: t, components: n, mode: r = "auto", style: a, custom: s, tenant: c, apiUrl: d, datasets: f, locale: m, direction: g }) {
2318
2750
  let v = s?.js?.trim();
2319
2751
  if (i(() => {
2320
2752
  if (!v) return;
@@ -2322,69 +2754,71 @@ function _t({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, cu
2322
2754
  return e.text = v, document.body.appendChild(e), () => e.remove();
2323
2755
  }, [v]), !e?.ROOT) return null;
2324
2756
  let y = {
2325
- lang: h || void 0,
2326
- dir: f(_, h)
2757
+ lang: m || void 0,
2758
+ dir: p(g, m)
2327
2759
  }, b = {
2328
2760
  minHeight: "100%",
2329
2761
  display: "flex",
2330
2762
  flexDirection: "column"
2331
- }, x = Q("ROOT", e, n), S = a(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), C = M(e, n), w = j(e, n), T = s?.css?.trim(), E = g(e, n).map((e) => /* @__PURE__ */ c("link", {
2763
+ }, x = Q("ROOT", e, n), S = o(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), C = N(e, n), w = M(e, n), T = s?.css?.trim(), E = _(e, n).map((e) => /* @__PURE__ */ l("link", {
2332
2764
  rel: "stylesheet",
2333
2765
  precedence: "default",
2334
- href: m(e)
2766
+ href: h(e)
2335
2767
  }, e));
2336
- if (r !== "auto") return /* @__PURE__ */ c(U.Provider, {
2768
+ if (r !== "auto") return /* @__PURE__ */ l(U.Provider, {
2337
2769
  value: {
2338
- tenant: u || "",
2339
- apiUrl: d || "/api"
2770
+ tenant: c || "",
2771
+ apiUrl: d || "/api",
2772
+ locale: m || ""
2340
2773
  },
2341
- children: /* @__PURE__ */ c(W.Provider, {
2342
- value: p ?? null,
2343
- children: /* @__PURE__ */ c(G.Provider, {
2774
+ children: /* @__PURE__ */ l(W.Provider, {
2775
+ value: f ?? null,
2776
+ children: /* @__PURE__ */ l(G.Provider, {
2344
2777
  value: S,
2345
- children: /* @__PURE__ */ l("div", {
2778
+ children: /* @__PURE__ */ u("div", {
2346
2779
  ...y,
2347
2780
  style: {
2348
2781
  ...b,
2349
- ...ee(t, r),
2350
- ...o
2782
+ ...H(t, r),
2783
+ ...a
2351
2784
  },
2352
2785
  children: [
2353
2786
  E,
2354
- C && /* @__PURE__ */ c("style", { children: C }),
2355
- w && /* @__PURE__ */ c("style", { children: w }),
2356
- T && /* @__PURE__ */ c("style", { children: T }),
2787
+ C && /* @__PURE__ */ l("style", { children: C }),
2788
+ w && /* @__PURE__ */ l("style", { children: w }),
2789
+ T && /* @__PURE__ */ l("style", { children: T }),
2357
2790
  x
2358
2791
  ]
2359
2792
  })
2360
2793
  })
2361
2794
  })
2362
2795
  });
2363
- let D = z(t);
2364
- return /* @__PURE__ */ c(U.Provider, {
2796
+ let D = B(t);
2797
+ return /* @__PURE__ */ l(U.Provider, {
2365
2798
  value: {
2366
- tenant: u || "",
2367
- apiUrl: d || "/api"
2799
+ tenant: c || "",
2800
+ apiUrl: d || "/api",
2801
+ locale: m || ""
2368
2802
  },
2369
- children: /* @__PURE__ */ c(W.Provider, {
2370
- value: p ?? null,
2371
- children: /* @__PURE__ */ c(G.Provider, {
2803
+ children: /* @__PURE__ */ l(W.Provider, {
2804
+ value: f ?? null,
2805
+ children: /* @__PURE__ */ l(G.Provider, {
2372
2806
  value: S,
2373
- children: /* @__PURE__ */ l("div", {
2807
+ children: /* @__PURE__ */ u("div", {
2374
2808
  ...y,
2375
2809
  className: "webim-page",
2376
2810
  style: {
2377
2811
  ...b,
2378
- ...V(t),
2379
- ...o
2812
+ ...ee(t),
2813
+ ...a
2380
2814
  },
2381
2815
  children: [
2382
- /* @__PURE__ */ c("style", { children: `.webim-page { ${gt(B(D.light))} }
2383
- @media (prefers-color-scheme: dark) { .webim-page { ${gt(B(D.dark))} } }` }),
2816
+ /* @__PURE__ */ l("style", { children: `.webim-page { ${Ot(V(D.light))} }
2817
+ @media (prefers-color-scheme: dark) { .webim-page { ${Ot(V(D.dark))} } }` }),
2384
2818
  E,
2385
- C && /* @__PURE__ */ c("style", { children: C }),
2386
- w && /* @__PURE__ */ c("style", { children: w }),
2387
- T && /* @__PURE__ */ c("style", { children: T }),
2819
+ C && /* @__PURE__ */ l("style", { children: C }),
2820
+ w && /* @__PURE__ */ l("style", { children: w }),
2821
+ T && /* @__PURE__ */ l("style", { children: T }),
2388
2822
  x
2389
2823
  ]
2390
2824
  })
@@ -2394,8 +2828,8 @@ function _t({ blocks: e, theme: t, components: n, mode: r = "auto", style: o, cu
2394
2828
  }
2395
2829
  //#endregion
2396
2830
  //#region src/WebimContent.jsx
2397
- function vt({ bundle: e, mode: t = "auto", style: n }) {
2398
- return e?.blocks?.ROOT ? /* @__PURE__ */ c(_t, {
2831
+ function At({ bundle: e, mode: t = "auto", style: n }) {
2832
+ return e?.blocks?.ROOT ? /* @__PURE__ */ l(kt, {
2399
2833
  blocks: e.blocks,
2400
2834
  theme: e.theme,
2401
2835
  components: e.components,
@@ -2411,7 +2845,7 @@ function vt({ bundle: e, mode: t = "auto", style: n }) {
2411
2845
  }
2412
2846
  //#endregion
2413
2847
  //#region src/bundle.js
2414
- function yt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2848
+ function jt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2415
2849
  let a = {
2416
2850
  ...t?.global ?? {},
2417
2851
  ...t?.tenant ?? {}
@@ -2421,7 +2855,7 @@ function yt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2421
2855
  title: e.title,
2422
2856
  slug: e.slug,
2423
2857
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
2424
- theme: H(o, a.builder_themes?.themes),
2858
+ theme: te(o, a.builder_themes?.themes),
2425
2859
  components: a.builder_components?.components ?? {},
2426
2860
  custom: o.custom,
2427
2861
  seo: o.seo,
@@ -2434,26 +2868,29 @@ function yt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
2434
2868
  }
2435
2869
  //#endregion
2436
2870
  //#region src/fetchPage.js
2437
- var bt = async (e) => {
2871
+ var Mt = async (e) => {
2438
2872
  let t = await e.json().catch(() => null);
2439
2873
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
2440
2874
  return t?.payload ?? t;
2441
2875
  };
2442
- async function xt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, fetch: a }) {
2876
+ async function Nt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
2443
2877
  if (!e) throw Error("fetchPage: apiUrl is required");
2444
2878
  if (!n) throw Error("fetchPage: slug is required");
2445
- let o = a ?? fetch, s = e.replace(/\/$/, ""), c = t ? { "x-tenant": t } : {}, [l, u] = await Promise.all([o(`${s}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: c }).then(bt), o(`${s}/settings/public`, { headers: c }).then(bt)]), d = yt({
2446
- page: l,
2447
- settings: u,
2879
+ let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
2880
+ ...t ? { "x-tenant": t } : {},
2881
+ ...a ? { authorization: `Bearer ${a}` } : {}
2882
+ }, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(Mt), s(`${c}/settings/public`, { headers: l }).then(Mt)]), f = jt({
2883
+ page: u,
2884
+ settings: d,
2448
2885
  tenant: t,
2449
- apiUrl: s,
2886
+ apiUrl: c,
2450
2887
  locale: r
2451
- }), f = [...new Set(Object.values(d.blocks ?? {}).map((e) => e?.type?.resolvedName === "CollectionList" ? e.props?.collection : e?.type?.resolvedName === "TableBlock" ? e.props?.source : null).filter(Boolean))];
2452
- if (f.length) {
2453
- let e = (e) => e.startsWith("api:") ? `${s}/data/${encodeURIComponent(e.slice(4))}` : `${s}/dynamic/${encodeURIComponent(e)}${r ? `?locale=${encodeURIComponent(r)}` : ""}`, t = await Promise.all(f.map((t) => o(e(t), { headers: c }).then(bt).then((e) => [t, Array.isArray(e) ? e : []]).catch(() => [t, []])));
2454
- d.datasets = Object.fromEntries(t);
2888
+ }), 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))];
2889
+ if (p.length) {
2890
+ 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(Mt).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
2891
+ f.datasets = Object.fromEntries(t);
2455
2892
  }
2456
- return d;
2893
+ return f;
2457
2894
  }
2458
2895
  //#endregion
2459
2896
  //#region src/ssr.jsx
@@ -2463,15 +2900,15 @@ var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
2463
2900
  ">": "&gt;",
2464
2901
  "\"": "&quot;"
2465
2902
  })[e]);
2466
- function St(t, { mode: n = "auto", style: r } = {}) {
2467
- return e(/* @__PURE__ */ c(vt, {
2903
+ function Pt(t, { mode: n = "auto", style: r } = {}) {
2904
+ return e(/* @__PURE__ */ l(At, {
2468
2905
  bundle: t,
2469
2906
  mode: n,
2470
2907
  style: r
2471
2908
  }));
2472
2909
  }
2473
- function Ct(e, { mode: t = "auto", lang: n } = {}) {
2474
- let r = e.seo ?? {}, i = n || e.locale || "en", a = f(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
2910
+ function Ft(e, { mode: t = "auto", lang: n } = {}) {
2911
+ let r = e.seo ?? {}, i = n || e.locale || "en", a = p(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
2475
2912
  "<meta charset=\"utf-8\"/>",
2476
2913
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
2477
2914
  `<title>${$(o)}</title>`,
@@ -2487,10 +2924,10 @@ function Ct(e, { mode: t = "auto", lang: n } = {}) {
2487
2924
  ${c}
2488
2925
  </head>
2489
2926
  <body>
2490
- ${St(e, { mode: t })}
2927
+ ${Pt(e, { mode: t })}
2491
2928
  ${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
2492
2929
  </body>
2493
2930
  </html>`;
2494
2931
  }
2495
2932
  //#endregion
2496
- export { yt as assembleBundle, xt as fetchPage, St as renderBundleHtml, Ct as renderPageDocument };
2933
+ export { jt as assembleBundle, Nt as fetchPage, Pt as renderBundleHtml, Ft as renderPageDocument };