webim-adapter 0.9.0 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,8 @@
1
1
  import { renderToStaticMarkup as e } from "react-dom/server";
2
- import { Fragment as t, createContext as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s, useState as c } from "react";
3
- import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
2
+ import { Fragment as t, createContext as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s, useRef as c, useState as l } from "react";
3
+ import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
4
4
  //#region ../ui/src/components/builder/locale.js
5
- var f = /* @__PURE__ */ new Set([
5
+ var p = /* @__PURE__ */ new Set([
6
6
  "ar",
7
7
  "he",
8
8
  "fa",
@@ -13,7 +13,7 @@ var f = /* @__PURE__ */ new Set([
13
13
  "yi",
14
14
  "dv",
15
15
  "ckb"
16
- ]), p = (e) => f.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", m = (e, t) => e === "ltr" || e === "rtl" ? e : t ? p(t) : void 0;
16
+ ]), m = (e) => p.has(String(e || "").toLowerCase().split(/[-_]/)[0]) ? "rtl" : "ltr", h = (e, t) => e === "ltr" || e === "rtl" ? e : t ? m(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 h(e) {
123
+ function g(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 g = (e) => h([e]), _ = (e) => {
126
+ var _ = (e) => g([e]), v = (e) => {
127
127
  let t = typeof e == "string" && e.match(/^"([^"]+)"/);
128
128
  return t ? t[1] : null;
129
129
  };
130
- function v(e, t) {
130
+ function y(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 v(e, t) {
135
135
  "pressed",
136
136
  "focused"
137
137
  ]) {
138
- let r = _(t.props?.[e]?.fontFamily);
138
+ let r = v(t.props?.[e]?.fontFamily);
139
139
  r && n.add(r);
140
140
  }
141
141
  };
@@ -145,36 +145,36 @@ function v(e, t) {
145
145
  }
146
146
  //#endregion
147
147
  //#region ../ui/src/components/builder/styles.js
148
- var y = /* @__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(".")), b = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, x = [
148
+ var b = /* @__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(".")), x = (e) => typeof e == "number" || typeof e == "string" && e.trim() !== "" && !Number.isNaN(Number(e)) ? `${Number(e)}px` : e, S = [
149
149
  "borderWidth",
150
150
  "borderStyle",
151
151
  "borderColor",
152
152
  "borderRadius",
153
153
  "gap"
154
154
  ];
155
- function S(e) {
155
+ function C(e) {
156
156
  let t = {};
157
- for (let n of x) {
157
+ for (let n of S) {
158
158
  let r = e?.[n];
159
- r != null && r !== "" && (t[n] = y.has(n) ? b(r) : r);
159
+ r != null && r !== "" && (t[n] = b.has(n) ? x(r) : r);
160
160
  }
161
- for (let [n, r] of Object.entries(e || {})) r == null || r === "" || x.includes(n) || (t[n] = y.has(n) ? b(r) : r);
161
+ for (let [n, r] of Object.entries(e || {})) r == null || r === "" || S.includes(n) || (t[n] = b.has(n) ? x(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) => `${b(e.x ?? 0)} ${b(e.y ?? 0)} ${b(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) => `${x(e.x ?? 0)} ${x(e.y ?? 0)} ${x(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(`${b(s ?? 0)} ${b(c ?? 0)} ${b(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(${b(e.x ?? 0)}, ${b(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: v, skewX: S, skewY: C } = t;
172
+ ].some((e) => e !== void 0) && d.push(`${x(s ?? 0)} ${x(c ?? 0)} ${x(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(${x(e.x ?? 0)}, ${x(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: v, skewX: y, 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(${b(h ?? 0)}, ${b(g ?? 0)})`), _ !== void 0 && w.push(`scale(${_})`), v !== void 0 && w.push(`rotate(${f(v)})`), (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 " : ""}${b(e.x ?? 0)} ${b(e.y ?? 0)} ${b(e.blur ?? 0)} ${b(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(${x(h ?? 0)}, ${x(g ?? 0)})`), _ !== void 0 && w.push(`scale(${_})`), v !== void 0 && w.push(`rotate(${f(v)})`), (y !== void 0 || C !== void 0) && w.push(`skew(${f(y ?? 0)}, ${f(C ?? 0)})`), w.length && (t.transform = w.join(" "));
177
+ let T = (e) => `${e.inset ? "inset " : ""}${x(e.x ?? 0)} ${x(e.y ?? 0)} ${x(e.blur ?? 0)} ${x(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 S(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(${b(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: ee, filterContrast: B, filterSaturate: V } = t;
195
+ let P = (e) => e.type === "blur" ? `blur(${x(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: ee, filterContrast: te, filterSaturate: B } = 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
- let H = F(I);
198
- R !== void 0 && H.push(`blur(${b(R)})`), z !== void 0 && H.push(`grayscale(${z}%)`), ee !== void 0 && H.push(`brightness(${ee}%)`), B !== void 0 && H.push(`contrast(${B}%)`), V !== void 0 && H.push(`saturate(${V}%)`), 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: ne, textStrokeColor: U } = t;
202
- delete t.textStrokeWidth, delete t.textStrokeColor, (ne !== void 0 || U !== void 0) && (t.WebkitTextStroke = `${b(ne ?? 1)} ${U || "currentColor"}`);
203
- let { clipText: W } = t;
204
- delete t.clipText, W && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
205
- let { transitions: G, transitionDuration: re, transitionEasing: K, transitionProperty: ie } = t, q = (e) => typeof e == "number" || !Number.isNaN(Number(e)) ? `${Number(e)}ms` : e;
197
+ let V = F(I);
198
+ R !== void 0 && V.push(`blur(${x(R)})`), z !== void 0 && V.push(`grayscale(${z}%)`), ee !== void 0 && V.push(`brightness(${ee}%)`), te !== void 0 && V.push(`contrast(${te}%)`), B !== void 0 && V.push(`saturate(${B}%)`), V.length && (t.filter = V.join(" "));
199
+ let ne = F(L);
200
+ ne.length && (t.backdropFilter = ne.join(" "), t.WebkitBackdropFilter = t.backdropFilter);
201
+ let { textStrokeWidth: re, textStrokeColor: ie } = t;
202
+ delete t.textStrokeWidth, delete t.textStrokeColor, (re !== void 0 || ie !== void 0) && (t.WebkitTextStroke = `${x(re ?? 1)} ${ie || "currentColor"}`);
203
+ let { clipText: H } = t;
204
+ delete t.clipText, H && (t.WebkitBackgroundClip = "text", t.backgroundClip = "text", t.WebkitTextFillColor = "transparent");
205
+ let { transitions: U, transitionDuration: W, transitionEasing: ae, transitionProperty: G } = t, oe = (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 ae = (Array.isArray(G) ? G : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${q(e.duration ?? 200)} ${e.easing || "ease"}`);
208
- if (re !== void 0 && ae.push(`${ie || "all"} ${q(re)} ${K || "ease"}`), ae.length && (t.transition = ae.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 K = (Array.isArray(U) ? U : []).filter((e) => e && e.on !== !1).map((e) => `${e.property || "all"} ${oe(e.duration ?? 200)} ${e.easing || "ease"}`);
208
+ if (W !== void 0 && K.push(`${G || "all"} ${oe(W)} ${ae || "ease"}`), K.length && (t.transition = K.join(", ")), t.textDecoration !== void 0 && (t.textDecorationLine = t.textDecoration, delete t.textDecoration), t.backgroundImage && !String(t.backgroundImage).includes("(") && (t.backgroundImage = `url("${t.backgroundImage}")`), n) {
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: oe, overlayOpacity: se } = t;
214
- if (delete t.overlayColor, delete t.overlayOpacity, oe) {
215
- let e = `color-mix(in srgb, ${oe} ${se ?? 50}%, transparent)`, n = `linear-gradient(${e}, ${e})`;
213
+ let { overlayColor: se, overlayOpacity: ce } = t;
214
+ if (delete t.overlayColor, delete t.overlayOpacity, se) {
215
+ let e = `color-mix(in srgb, ${se} ${ce ?? 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: J } = t;
219
+ let { backgroundLayers: le } = t;
220
220
  delete t.backgroundLayers;
221
- let ce = (Array.isArray(J) ? J : []).filter((e) => e && e.on !== !1);
222
- if (ce.length) {
221
+ let q = (Array.isArray(le) ? le : []).filter((e) => e && e.on !== !1);
222
+ if (q.length) {
223
223
  let e = [], n = [], r = [], i = [], a = [];
224
- for (let t of ce) 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 q) if (t.kind === "linear") e.push(`linear-gradient(${t.angle ?? 180}deg, ${t.from || "rgba(0,0,0,0.5)"}, ${t.to || "transparent"})`), n.push("auto"), r.push("0% 0%"), i.push("repeat"), a.push("scroll");
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" ? `${b(t.w ?? "auto")} ${b(t.h ?? "auto")}` : t.size || "cover"), r.push(`${b(t.posX ?? 0)} ${b(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" ? `${x(t.w ?? "auto")} ${x(t.h ?? "auto")}` : t.size || "cover"), r.push(`${x(t.posX ?? 0)} ${x(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 C = {
234
+ var w = {
235
235
  hover: ":hover",
236
236
  pressed: ":active",
237
237
  focused: ":focus"
238
- }, w = /* @__PURE__ */ new Set([
238
+ }, T = /* @__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
- ]), T = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !w.has(e.toLowerCase());
246
- function E(e, t, n = []) {
245
+ ]), E = (e) => /^[a-zA-Z_][\w-]*$/.test(e) && !/^on/i.test(e) && !T.has(e.toLowerCase());
246
+ function D(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
- T(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
252
+ E(t) && (e.setAttribute(t, n.value ?? ""), r.push(t));
253
253
  }
254
254
  return r;
255
255
  }
256
- var D = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
257
- function O(e, t, n, r = !1) {
258
- let i = Object.entries(S(t)).map(([e, t]) => `${D(e)}: ${t} !important;`).join(" ");
256
+ var O = (e) => e.replace(/[A-Z]/g, (e) => `-${e.toLowerCase()}`);
257
+ function k(e, t, n, r = !1) {
258
+ let i = Object.entries(C(t)).map(([e, t]) => `${O(e)}: ${t} !important;`).join(" ");
259
259
  return i ? `[data-wb="${e}"]${r ? "" : n} { ${i} }` : "";
260
260
  }
261
- function k(e, t, n) {
262
- return Object.entries(C).map(([r, i]) => O(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
261
+ function A(e, t, n) {
262
+ return Object.entries(w).map(([r, i]) => k(e, t?.[r], i, n === r)).filter(Boolean).join("\n");
263
263
  }
264
- var A = [
264
+ var j = [
265
265
  {
266
266
  key: "tablet",
267
267
  max: 991
@@ -274,17 +274,17 @@ var A = [
274
274
  key: "mobile",
275
275
  max: 478
276
276
  }
277
- ], j = (e) => Object.entries(S(e)).map(([e, t]) => `${D(e)}: ${t} !important;`).join(" ");
278
- function M(e, t) {
279
- return A.map(({ key: n, max: r }) => {
280
- let i = t?.[n] ? j(t[n]) : "";
277
+ ], M = (e) => Object.entries(C(e)).map(([e, t]) => `${O(e)}: ${t} !important;`).join(" ");
278
+ function N(e, t) {
279
+ return j.map(({ key: n, max: r }) => {
280
+ let i = t?.[n] ? M(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 N(e, t) {
284
+ function P(e, t) {
285
285
  let n = [], r = (e) => {
286
286
  for (let [t, r] of Object.entries(e || {})) {
287
- let e = M(t, r.props);
287
+ let e = N(t, r.props);
288
288
  e && n.push(e);
289
289
  }
290
290
  };
@@ -292,10 +292,10 @@ function N(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 P(e, t) {
295
+ function F(e, t) {
296
296
  let n = [], r = (e) => {
297
297
  for (let [t, r] of Object.entries(e || {})) {
298
- let e = k(t, r.props);
298
+ let e = A(t, r.props);
299
299
  e && n.push(e);
300
300
  }
301
301
  };
@@ -303,7 +303,7 @@ function P(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 F = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", I = {
306
+ var I = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif", L = {
307
307
  light: {
308
308
  background: "#ffffff",
309
309
  text: "#111827",
@@ -340,23 +340,23 @@ var F = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
340
340
  contrastText: "#052e2b"
341
341
  }
342
342
  }
343
- }, L = {
343
+ }, R = {
344
344
  font: "system",
345
345
  headingFont: "inherit",
346
- light: I.light,
347
- dark: I.dark
348
- }, R = {
346
+ light: L.light,
347
+ dark: L.dark
348
+ }, z = {
349
349
  system: {
350
350
  label: "System",
351
- value: F
351
+ value: I
352
352
  },
353
353
  inter: {
354
354
  label: "Inter",
355
- value: `"Inter", ${F}`
355
+ value: `"Inter", ${I}`
356
356
  },
357
357
  outfit: {
358
358
  label: "Outfit",
359
- value: `"Outfit", ${F}`
359
+ value: `"Outfit", ${I}`
360
360
  },
361
361
  serif: {
362
362
  label: "Serif",
@@ -366,7 +366,7 @@ var F = "-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
- }, z = (e, t) => R[e]?.value ?? t, ee = (e, ...t) => {
369
+ }, ee = (e, t) => z[e]?.value ?? t, te = (e, ...t) => {
370
370
  let n = Object.assign({}, e, ...t);
371
371
  return n.primary = {
372
372
  ...e.primary,
@@ -385,10 +385,10 @@ var F = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Ari
385
385
  function B(e) {
386
386
  let { light: t, dark: n, font: r, headingFont: i, ...a } = e ?? {};
387
387
  return {
388
- font: r ?? L.font,
389
- headingFont: i ?? L.headingFont,
390
- light: ee(I.light, a, t),
391
- dark: ee(I.dark, n)
388
+ font: r ?? R.font,
389
+ headingFont: i ?? R.headingFont,
390
+ light: te(L.light, a, t),
391
+ dark: te(L.dark, n)
392
392
  };
393
393
  }
394
394
  function V(e) {
@@ -407,37 +407,37 @@ function V(e) {
407
407
  "--page-secondary-contrast": e.secondary.contrastText
408
408
  };
409
409
  }
410
- function H(e) {
410
+ function ne(e) {
411
411
  let t = B(e);
412
412
  return {
413
413
  backgroundColor: "var(--page-bg)",
414
414
  color: "var(--page-text)",
415
- fontFamily: z(t.font, F),
416
- "--page-heading-font": t.headingFont === "inherit" ? "inherit" : z(t.headingFont, "inherit")
415
+ fontFamily: ee(t.font, I),
416
+ "--page-heading-font": t.headingFont === "inherit" ? "inherit" : ee(t.headingFont, "inherit")
417
417
  };
418
418
  }
419
- function te(e, t = "light") {
419
+ function re(e, t = "light") {
420
420
  let n = B(e);
421
421
  return {
422
- ...H(e),
422
+ ...ne(e),
423
423
  ...V(n[t] ?? n.light)
424
424
  };
425
425
  }
426
- function ne(e, t) {
426
+ function ie(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
- var U = n({
431
+ var H = n({
432
432
  tenant: "",
433
433
  apiUrl: "/api",
434
434
  locale: "",
435
435
  settings: null
436
- }), W = n(null), G = n(null), re = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
437
- function K(e, t) {
436
+ }), U = n(null), W = n(null), ae = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
437
+ function G(e, t) {
438
438
  if (t) return t.includes(".") ? t.split(".").reduce((e, t) => e && typeof e == "object" ? e[t] : void 0, e) : e?.[t];
439
439
  }
440
- var ie = (e) => {
440
+ var oe = (e) => {
441
441
  let t = [];
442
442
  for (let [n, r] of Object.entries(e ?? {})) {
443
443
  if (!/^[\w-]+$/.test(n)) continue;
@@ -447,36 +447,36 @@ var ie = (e) => {
447
447
  }
448
448
  return t;
449
449
  };
450
- function q(e) {
450
+ function K(e) {
451
451
  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(" ") : "";
452
452
  }
453
- function ae(e, t) {
454
- let n = t?.data ?? {}, r = ie(n);
453
+ function se(e, t) {
454
+ let n = t?.data ?? {}, r = oe(n);
455
455
  if (!r.length) return e;
456
- let i = RegExp(`:(${r.map(re).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;
456
+ let i = RegExp(`:(${r.map(ae).sort((e, t) => t.length - e.length).join("|")})`, "g"), a = (e) => typeof e == "string" ? e.replace(i, (e, t) => K(G(n, t))) : Array.isArray(e) ? e.map(a) : e && typeof e == "object" ? Object.fromEntries(Object.entries(e).map(([e, t]) => [e, a(t)])) : e;
457
457
  return a(e);
458
458
  }
459
- var oe = {
459
+ var ce = {
460
460
  margin: 0,
461
461
  fontWeight: 700,
462
462
  lineHeight: 1.2,
463
463
  fontFamily: "var(--page-heading-font, inherit)"
464
- }, se = { margin: 0 }, J = {
464
+ }, le = { margin: 0 }, q = {
465
465
  display: "inline-block",
466
466
  textDecoration: "none",
467
467
  cursor: "pointer",
468
468
  backgroundColor: "var(--page-accent, #111827)",
469
469
  color: "var(--page-accent-text, #ffffff)"
470
- }, ce = {
470
+ }, ue = {
471
471
  flexGrow: 1,
472
472
  display: "flex",
473
473
  flexDirection: "column",
474
474
  position: "relative"
475
- }, le = {
475
+ }, de = {
476
476
  display: "flex",
477
477
  flexDirection: "column"
478
478
  };
479
- function ue({ style: e }) {
479
+ function fe({ style: e }) {
480
480
  let t = e?.backgroundVideo;
481
481
  if (!t) return null;
482
482
  let n = {
@@ -487,7 +487,7 @@ function ue({ style: e }) {
487
487
  zIndex: -1,
488
488
  pointerEvents: "none"
489
489
  }, r = e?.overlayColor ? `color-mix(in srgb, ${e.overlayColor} ${e.overlayOpacity ?? 50}%, transparent)` : null;
490
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("video", {
490
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("video", {
491
491
  src: t,
492
492
  autoPlay: !0,
493
493
  muted: !0,
@@ -497,73 +497,73 @@ function ue({ style: e }) {
497
497
  ...n,
498
498
  objectFit: "cover"
499
499
  }
500
- }), r && /* @__PURE__ */ u("div", { style: {
500
+ }), r && /* @__PURE__ */ d("div", { style: {
501
501
  ...n,
502
502
  background: r
503
503
  } })] });
504
504
  }
505
- var de = (e, t) => e?.backgroundVideo ? {
505
+ var pe = (e, t) => e?.backgroundVideo ? {
506
506
  position: "relative",
507
507
  ...t,
508
- ...S(e)
508
+ ...C(e)
509
509
  } : {
510
510
  ...t,
511
- ...S(e)
511
+ ...C(e)
512
512
  };
513
- function fe({ style: e, nodeRef: t, children: n }) {
514
- return /* @__PURE__ */ d("div", {
513
+ function me({ style: e, nodeRef: t, children: n }) {
514
+ return /* @__PURE__ */ f("div", {
515
515
  ref: t,
516
516
  style: {
517
- ...ce,
518
- ...S(e)
517
+ ...ue,
518
+ ...C(e)
519
519
  },
520
- children: [/* @__PURE__ */ u(ue, { style: e }), n]
520
+ children: [/* @__PURE__ */ d(fe, { style: e }), n]
521
521
  });
522
522
  }
523
- function pe({ style: e, nodeRef: t, children: n }) {
524
- return /* @__PURE__ */ d("section", {
523
+ function he({ style: e, nodeRef: t, children: n }) {
524
+ return /* @__PURE__ */ f("section", {
525
525
  ref: t,
526
- style: de(e, le),
527
- children: [/* @__PURE__ */ u(ue, { style: e }), n]
526
+ style: pe(e, de),
527
+ children: [/* @__PURE__ */ d(fe, { style: e }), n]
528
528
  });
529
529
  }
530
- function me({ style: e, freeLayout: t, nodeRef: n, children: r }) {
530
+ function ge({ style: e, freeLayout: t, nodeRef: n, children: r }) {
531
531
  let i = t ? {
532
532
  position: "relative",
533
533
  minHeight: 240
534
534
  } : null;
535
- return /* @__PURE__ */ d("div", {
535
+ return /* @__PURE__ */ f("div", {
536
536
  ref: n,
537
537
  style: i ? {
538
538
  ...i,
539
- ...de(e)
540
- } : de(e),
541
- children: [/* @__PURE__ */ u(ue, { style: e }), r]
539
+ ...pe(e)
540
+ } : pe(e),
541
+ children: [/* @__PURE__ */ d(fe, { style: e }), r]
542
542
  });
543
543
  }
544
- function he({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
545
- return /* @__PURE__ */ u(n, {
544
+ function _e({ text: e, parts: t, tag: n = "h2", style: r, linked: i, nodeRef: a }) {
545
+ return /* @__PURE__ */ d(n, {
546
546
  ref: a,
547
547
  style: {
548
- ...oe,
549
- ...S(r)
548
+ ...ce,
549
+ ...C(r)
550
550
  },
551
- children: Y(t, e, i)
551
+ children: J(t, e, i)
552
552
  });
553
553
  }
554
- var ge = {
555
- fontFamily: R.mono.value,
554
+ var ve = {
555
+ fontFamily: z.mono.value,
556
556
  background: "rgba(148, 163, 184, 0.18)",
557
557
  padding: "1px 5px",
558
558
  borderRadius: 4,
559
559
  fontSize: "0.9em"
560
560
  };
561
- function _e(e, t = [], n, r) {
561
+ function ye(e, t = [], n, r) {
562
562
  let i = e;
563
- return t.includes("sup") ? i = /* @__PURE__ */ u("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ u("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ u("code", {
564
- style: ge,
563
+ return t.includes("sup") ? i = /* @__PURE__ */ d("sup", { children: i }) : t.includes("sub") && (i = /* @__PURE__ */ d("sub", { children: i })), t.includes("code") && (i = /* @__PURE__ */ d("code", {
564
+ style: ve,
565
565
  children: i
566
- })), t.includes("strike") && (i = /* @__PURE__ */ u("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ u("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ u("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ u("strong", { children: i })), n && (i = /* @__PURE__ */ u("a", {
566
+ })), t.includes("strike") && (i = /* @__PURE__ */ d("s", { children: i })), t.includes("underline") && (i = /* @__PURE__ */ d("u", { children: i })), t.includes("italic") && (i = /* @__PURE__ */ d("em", { children: i })), t.includes("bold") && (i = /* @__PURE__ */ d("strong", { children: i })), n && (i = /* @__PURE__ */ d("a", {
567
567
  href: n,
568
568
  target: r || void 0,
569
569
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
@@ -571,36 +571,36 @@ function _e(e, t = [], n, r) {
571
571
  children: i
572
572
  })), i;
573
573
  }
574
- function Y(e, n, r) {
574
+ function J(e, n, r) {
575
575
  return e?.length ? e.map((e, n) => {
576
- if (e.slot) return /* @__PURE__ */ u(t, { children: r?.[e.slot] ?? null }, n);
577
- if (e.parts) return /* @__PURE__ */ u(t, { children: Y(e.parts, "", r) }, n);
576
+ if (e.slot) return /* @__PURE__ */ d(t, { children: r?.[e.slot] ?? null }, n);
577
+ if (e.parts) return /* @__PURE__ */ d(t, { children: J(e.parts, "", r) }, n);
578
578
  let i = e.text;
579
- return e.sup ? i = /* @__PURE__ */ u("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ u("sub", { children: i })), e.code && (i = /* @__PURE__ */ u("code", {
580
- style: ge,
579
+ return e.sup ? i = /* @__PURE__ */ d("sup", { children: i }) : e.sub && (i = /* @__PURE__ */ d("sub", { children: i })), e.code && (i = /* @__PURE__ */ d("code", {
580
+ style: ve,
581
581
  children: i
582
- })), e.strike && (i = /* @__PURE__ */ u("s", { children: i })), e.underline && (i = /* @__PURE__ */ u("u", { children: i })), e.italic && (i = /* @__PURE__ */ u("em", { children: i })), e.bold && (i = /* @__PURE__ */ u("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ u("span", {
582
+ })), e.strike && (i = /* @__PURE__ */ d("s", { children: i })), e.underline && (i = /* @__PURE__ */ d("u", { children: i })), e.italic && (i = /* @__PURE__ */ d("em", { children: i })), e.bold && (i = /* @__PURE__ */ d("strong", { children: i })), (e.color || e.background) && (i = /* @__PURE__ */ d("span", {
583
583
  style: {
584
584
  ...e.color && { color: e.color },
585
585
  ...e.background && { backgroundColor: e.background }
586
586
  },
587
587
  children: i
588
- })), e.href && (i = /* @__PURE__ */ u("a", {
588
+ })), e.href && (i = /* @__PURE__ */ d("a", {
589
589
  href: e.href,
590
590
  target: e.target || void 0,
591
591
  rel: e.target === "_blank" ? "noopener noreferrer" : void 0,
592
592
  style: { color: e.color ?? "inherit" },
593
593
  children: i
594
- })), /* @__PURE__ */ u(t, { children: i }, n);
594
+ })), /* @__PURE__ */ d(t, { children: i }, n);
595
595
  }) : n;
596
596
  }
597
- function ve({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
598
- return /* @__PURE__ */ u("span", {
599
- style: S(a),
600
- children: e?.length ? Y(e, t) : _e(t, n, r, i)
597
+ function be({ parts: e, text: t, marks: n, href: r, target: i, style: a }) {
598
+ return /* @__PURE__ */ d("span", {
599
+ style: C(a),
600
+ children: e?.length ? J(e, t) : ye(t, n, r, i)
601
601
  });
602
602
  }
603
- var ye = {
603
+ var xe = {
604
604
  h1: 40,
605
605
  h2: 32,
606
606
  h3: 26,
@@ -608,7 +608,7 @@ var ye = {
608
608
  h5: 19,
609
609
  h6: 16
610
610
  };
611
- function be({ align: e = "center", width: t, wrap: n } = {}) {
611
+ function Se({ align: e = "center", width: t, wrap: n } = {}) {
612
612
  let r = t ? `${t}%` : void 0;
613
613
  if (e === "full") return { width: "100%" };
614
614
  let i = e === "left" || e === "right";
@@ -642,8 +642,8 @@ function be({ align: e = "center", width: t, wrap: n } = {}) {
642
642
  marginRight: "auto"
643
643
  };
644
644
  }
645
- function xe(e = [], t, n) {
646
- let r = n ?? ((e, n) => Y(e, n, t));
645
+ function Ce(e = [], t, n) {
646
+ let r = n ?? ((e, n) => J(e, n, t));
647
647
  return e.map((t, n) => {
648
648
  let i = {
649
649
  marginTop: 0,
@@ -651,7 +651,7 @@ function xe(e = [], t, n) {
651
651
  };
652
652
  if (t.type === "image") {
653
653
  if (!t.src) return null;
654
- let e = /* @__PURE__ */ u("img", {
654
+ let e = /* @__PURE__ */ d("img", {
655
655
  src: t.src,
656
656
  alt: t.alt || "",
657
657
  style: {
@@ -660,20 +660,20 @@ function xe(e = [], t, n) {
660
660
  borderRadius: 6
661
661
  }
662
662
  });
663
- return /* @__PURE__ */ d("figure", {
663
+ return /* @__PURE__ */ f("figure", {
664
664
  style: {
665
665
  marginLeft: 0,
666
666
  marginRight: 0,
667
667
  ...i,
668
- ...be(t)
668
+ ...Se(t)
669
669
  },
670
- children: [t.href ? /* @__PURE__ */ u("a", {
670
+ children: [t.href ? /* @__PURE__ */ d("a", {
671
671
  href: t.href,
672
672
  target: t.target || void 0,
673
673
  rel: t.target === "_blank" ? "noopener noreferrer" : void 0,
674
674
  style: { display: "block" },
675
675
  children: e
676
- }) : e, t.caption && /* @__PURE__ */ u("figcaption", {
676
+ }) : e, t.caption && /* @__PURE__ */ d("figcaption", {
677
677
  style: {
678
678
  fontSize: 13,
679
679
  opacity: .65,
@@ -684,16 +684,16 @@ function xe(e = [], t, n) {
684
684
  })]
685
685
  }, n);
686
686
  }
687
- if (t.type === "video") return Me(t.url) ? /* @__PURE__ */ u("div", {
687
+ if (t.type === "video") return Pe(t.url) ? /* @__PURE__ */ d("div", {
688
688
  style: {
689
689
  ...i,
690
- ...be({
690
+ ...Se({
691
691
  align: t.align,
692
692
  wrap: t.wrap,
693
693
  width: t.width ?? 100
694
694
  })
695
695
  },
696
- children: /* @__PURE__ */ u(Ne, {
696
+ children: /* @__PURE__ */ d(Fe, {
697
697
  url: t.url,
698
698
  autoplay: t.autoplay,
699
699
  muted: t.muted,
@@ -702,146 +702,146 @@ function xe(e = [], t, n) {
702
702
  start: t.start
703
703
  })
704
704
  }, n) : null;
705
- if (t.type === "divider") return /* @__PURE__ */ u("hr", { style: {
705
+ if (t.type === "divider") return /* @__PURE__ */ d("hr", { style: {
706
706
  ...i,
707
707
  border: 0,
708
708
  borderTop: "1px solid rgba(148, 163, 184, 0.4)"
709
709
  } }, n);
710
710
  if (t.type === "ul" || t.type === "ol") {
711
711
  let e = t.type;
712
- return /* @__PURE__ */ u(e, {
712
+ return /* @__PURE__ */ d(e, {
713
713
  style: {
714
714
  ...i,
715
715
  paddingLeft: 24
716
716
  },
717
- children: (t.items ?? []).map((e, t) => /* @__PURE__ */ u("li", {
717
+ children: (t.items ?? []).map((e, t) => /* @__PURE__ */ d("li", {
718
718
  style: { marginBottom: 4 },
719
719
  children: r(e.parts, e.text)
720
720
  }, t))
721
721
  }, n);
722
722
  }
723
- if (t.type === "quote") return /* @__PURE__ */ u("blockquote", {
723
+ if (t.type === "quote") return /* @__PURE__ */ d("blockquote", {
724
724
  style: {
725
- ...Ce,
725
+ ...Te,
726
726
  ...i
727
727
  },
728
728
  children: r(t.parts, t.text)
729
729
  }, n);
730
- if (ye[t.type]) {
730
+ if (xe[t.type]) {
731
731
  let e = t.type;
732
- return /* @__PURE__ */ u(e, {
732
+ return /* @__PURE__ */ d(e, {
733
733
  style: {
734
- ...oe,
735
- fontSize: ye[t.type],
734
+ ...ce,
735
+ fontSize: xe[t.type],
736
736
  ...i
737
737
  },
738
738
  children: r(t.parts, t.text)
739
739
  }, n);
740
740
  }
741
- return /* @__PURE__ */ u("p", {
741
+ return /* @__PURE__ */ d("p", {
742
742
  style: {
743
- ...se,
743
+ ...le,
744
744
  ...i
745
745
  },
746
746
  children: r(t.parts, t.text)
747
747
  }, n);
748
748
  });
749
749
  }
750
- function Se({ content: e, style: t, linked: n, nodeRef: r }) {
751
- return /* @__PURE__ */ u("div", {
750
+ function we({ content: e, style: t, linked: n, nodeRef: r }) {
751
+ return /* @__PURE__ */ d("div", {
752
752
  ref: r,
753
753
  style: {
754
754
  display: "flow-root",
755
- ...S(t)
755
+ ...C(t)
756
756
  },
757
- children: xe(e, n)
757
+ children: Ce(e, n)
758
758
  });
759
759
  }
760
- var Ce = {
760
+ var Te = {
761
761
  margin: 0,
762
762
  padding: "8px 0 8px 20px",
763
763
  borderLeft: "4px solid var(--page-accent, rgba(148, 163, 184, 0.6))"
764
764
  };
765
- function we({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
766
- return /* @__PURE__ */ u("blockquote", {
765
+ function Ee({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
766
+ return /* @__PURE__ */ d("blockquote", {
767
767
  ref: i,
768
768
  style: {
769
- ...Ce,
770
- ...S(n)
769
+ ...Te,
770
+ ...C(n)
771
771
  },
772
- children: Y(t, e, r)
772
+ children: J(t, e, r)
773
773
  });
774
774
  }
775
- function Te({ ordered: e, items: t = [], style: n, nodeRef: r }) {
776
- return /* @__PURE__ */ u(e ? "ol" : "ul", {
775
+ function De({ ordered: e, items: t = [], style: n, nodeRef: r }) {
776
+ return /* @__PURE__ */ d(e ? "ol" : "ul", {
777
777
  ref: r,
778
778
  style: {
779
779
  margin: 0,
780
780
  paddingLeft: 24,
781
- ...S(n)
781
+ ...C(n)
782
782
  },
783
- children: t.map((e, t) => /* @__PURE__ */ u("li", {
783
+ children: t.map((e, t) => /* @__PURE__ */ d("li", {
784
784
  style: { marginBottom: 4 },
785
- children: Y(e.parts, e.text)
785
+ children: J(e.parts, e.text)
786
786
  }, t))
787
787
  });
788
788
  }
789
- function Ee({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
790
- return /* @__PURE__ */ u("p", {
789
+ function Oe({ text: e, parts: t, style: n, linked: r, nodeRef: i }) {
790
+ return /* @__PURE__ */ d("p", {
791
791
  ref: i,
792
792
  style: {
793
- ...se,
794
- ...S(n)
793
+ ...le,
794
+ ...C(n)
795
795
  },
796
- children: Y(t, e, r)
796
+ children: J(t, e, r)
797
797
  });
798
798
  }
799
- var De = {
799
+ var ke = {
800
800
  color: "var(--page-accent, inherit)",
801
801
  textDecoration: "underline",
802
802
  textUnderlineOffset: 3,
803
803
  cursor: "pointer"
804
804
  };
805
- function Oe({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
806
- return /* @__PURE__ */ u("a", {
805
+ function Ae({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
806
+ return /* @__PURE__ */ d("a", {
807
807
  ref: o,
808
808
  href: n || "#",
809
809
  target: r || void 0,
810
810
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
811
811
  style: {
812
- ...De,
813
- ...S(i)
812
+ ...ke,
813
+ ...C(i)
814
814
  },
815
- children: Y(t, e, a)
815
+ children: J(t, e, a)
816
816
  });
817
817
  }
818
- function ke({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
819
- return /* @__PURE__ */ u("a", {
818
+ function je({ text: e, parts: t, href: n, target: r, style: i, linked: a, nodeRef: o }) {
819
+ return /* @__PURE__ */ d("a", {
820
820
  ref: o,
821
821
  href: n || "#",
822
822
  target: r || void 0,
823
823
  rel: r === "_blank" ? "noopener noreferrer" : void 0,
824
824
  style: {
825
- ...J,
826
- ...S(i)
825
+ ...q,
826
+ ...C(i)
827
827
  },
828
- children: Y(t, e, a)
828
+ children: J(t, e, a)
829
829
  });
830
830
  }
831
- function Ae({ src: e, alt: t, style: n, nodeRef: r }) {
832
- return e ? /* @__PURE__ */ u("img", {
831
+ function Me({ src: e, alt: t, style: n, nodeRef: r }) {
832
+ return e ? /* @__PURE__ */ d("img", {
833
833
  ref: r,
834
834
  src: e,
835
835
  alt: t || "",
836
836
  style: {
837
837
  display: "block",
838
838
  maxWidth: "100%",
839
- ...S(n)
839
+ ...C(n)
840
840
  }
841
841
  }) : null;
842
842
  }
843
- function je({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
844
- return e ? /* @__PURE__ */ u("video", {
843
+ function Ne({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !1, muted: a = !1, style: o, nodeRef: s }) {
844
+ return e ? /* @__PURE__ */ d("video", {
845
845
  ref: s,
846
846
  src: e,
847
847
  poster: t || void 0,
@@ -854,24 +854,24 @@ function je({ src: e, poster: t, controls: n = !0, autoplay: r = !1, loop: i = !
854
854
  display: "block",
855
855
  width: "100%",
856
856
  maxWidth: "100%",
857
- ...S(o)
857
+ ...C(o)
858
858
  }
859
859
  }) : null;
860
860
  }
861
- var Me = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
862
- function Ne({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
863
- let c = Me(e);
861
+ var Pe = (e = "") => (e.match(/(?:youtu\.be\/|v=|embed\/|shorts\/|live\/)([\w-]{11})/) || e.match(/^([\w-]{11})$/))?.[1];
862
+ function Fe({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i = !0, start: a, style: o, nodeRef: s }) {
863
+ let c = Pe(e);
864
864
  if (!c) return null;
865
865
  let l = new URLSearchParams({ rel: "0" });
866
- return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ u("div", {
866
+ return t && l.set("autoplay", "1"), (n || t) && l.set("mute", "1"), i || l.set("controls", "0"), r && (l.set("loop", "1"), l.set("playlist", c)), Number(a) > 0 && l.set("start", String(Math.floor(Number(a)))), /* @__PURE__ */ d("div", {
867
867
  ref: s,
868
868
  style: {
869
869
  position: "relative",
870
870
  width: "100%",
871
871
  paddingTop: "56.25%",
872
- ...S(o)
872
+ ...C(o)
873
873
  },
874
- children: /* @__PURE__ */ u("iframe", {
874
+ children: /* @__PURE__ */ d("iframe", {
875
875
  src: `https://www.youtube-nocookie.com/embed/${c}?${l}`,
876
876
  title: "YouTube video",
877
877
  allow: "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",
@@ -886,8 +886,8 @@ function Ne({ url: e, autoplay: t = !1, muted: n = !1, loop: r = !1, controls: i
886
886
  })
887
887
  });
888
888
  }
889
- function Pe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
890
- return e ? /* @__PURE__ */ u("iframe", {
889
+ function Ie({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i }) {
890
+ return e ? /* @__PURE__ */ d("iframe", {
891
891
  ref: i,
892
892
  src: e,
893
893
  title: t || "Embedded frame",
@@ -898,12 +898,12 @@ function Pe({ src: e, title: t, allowFullscreen: n = !0, style: r, nodeRef: i })
898
898
  width: "100%",
899
899
  height: 300,
900
900
  border: 0,
901
- ...S(r)
901
+ ...C(r)
902
902
  }
903
903
  }) : null;
904
904
  }
905
- function Fe({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
906
- let [i, o] = c(null);
905
+ function Le({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
906
+ let [i, o] = l(null);
907
907
  return a(() => {
908
908
  i && (i.innerHTML = e || "", t && i.querySelectorAll("script").forEach((e) => {
909
909
  let t = document.createElement("script");
@@ -914,15 +914,15 @@ function Fe({ code: e, runScripts: t = !0, style: n, nodeRef: r }) {
914
914
  i,
915
915
  e,
916
916
  t
917
- ]), /* @__PURE__ */ u("div", {
917
+ ]), /* @__PURE__ */ d("div", {
918
918
  ref: (e) => {
919
919
  o(e), r && r(e);
920
920
  },
921
- style: S(n)
921
+ style: C(n)
922
922
  });
923
923
  }
924
- function Ie({ height: e, nodeRef: t }) {
925
- return /* @__PURE__ */ u("div", {
924
+ function Re({ height: e, nodeRef: t }) {
925
+ return /* @__PURE__ */ d("div", {
926
926
  ref: t,
927
927
  style: {
928
928
  height: e || 32,
@@ -931,18 +931,18 @@ function Ie({ height: e, nodeRef: t }) {
931
931
  }
932
932
  });
933
933
  }
934
- function Le({ style: e, nodeRef: t }) {
935
- return /* @__PURE__ */ u("div", {
934
+ function ze({ style: e, nodeRef: t }) {
935
+ return /* @__PURE__ */ d("div", {
936
936
  ref: t,
937
937
  style: {
938
938
  height: 1,
939
939
  alignSelf: "stretch",
940
940
  flexShrink: 0,
941
- ...S(e)
941
+ ...C(e)
942
942
  }
943
943
  });
944
944
  }
945
- var Re = {
945
+ var Be = {
946
946
  position: "absolute",
947
947
  top: "50%",
948
948
  transform: "translateY(-50%)",
@@ -959,7 +959,7 @@ var Re = {
959
959
  alignItems: "center",
960
960
  justifyContent: "center",
961
961
  padding: 0
962
- }, ze = {
962
+ }, Ve = {
963
963
  bottom: {
964
964
  inset: "auto 0 0 0",
965
965
  padding: "40px 24px 20px",
@@ -978,9 +978,9 @@ var Re = {
978
978
  padding: 24,
979
979
  textShadow: "0 2px 12px rgba(0, 0, 0, 0.6)"
980
980
  }
981
- }, Be = 48;
982
- function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: f }) {
983
- let [p, m] = c(0), [h, g] = c(!1), [_, v] = c(null), y = e ? Math.min(p, e - 1) : 0;
981
+ }, He = 48;
982
+ function Ue({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, height: i = 320, swipe: o = !0, style: s, nodeRef: c }) {
983
+ let [p, m] = l(0), [h, g] = l(!1), [_, v] = l(null), y = e ? Math.min(p, e - 1) : 0;
984
984
  if (a(() => {
985
985
  if (!n || h || _ || e < 2) return;
986
986
  let t = setInterval(() => m((t) => (t + 1) % e), Math.max(2, Number(r) || 5) * 1e3);
@@ -995,10 +995,10 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
995
995
  let b = (t) => m((t + e) % e), x = () => {
996
996
  if (!_) return;
997
997
  let { dx: e } = _;
998
- v(null), e < -48 ? b(y + 1) : e > Be && b(y - 1);
998
+ v(null), e < -48 ? b(y + 1) : e > He && b(y - 1);
999
999
  };
1000
- return /* @__PURE__ */ d("div", {
1001
- ref: f,
1000
+ return /* @__PURE__ */ f("div", {
1001
+ ref: c,
1002
1002
  onMouseEnter: () => g(!0),
1003
1003
  onMouseLeave: () => g(!1),
1004
1004
  onPointerDown: o && e > 1 ? (e) => {
@@ -1020,16 +1020,16 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1020
1020
  touchAction: "pan-y",
1021
1021
  userSelect: _ ? "none" : void 0,
1022
1022
  cursor: _ ? "grabbing" : void 0,
1023
- ...S(s)
1023
+ ...C(s)
1024
1024
  },
1025
- children: [/* @__PURE__ */ u("div", {
1025
+ children: [/* @__PURE__ */ d("div", {
1026
1026
  style: {
1027
1027
  display: "flex",
1028
1028
  height: i,
1029
1029
  transform: `translateX(calc(${-y * 100}% + ${_?.dx ?? 0}px))`,
1030
1030
  transition: _ ? "none" : "transform 450ms ease"
1031
1031
  },
1032
- children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ u("div", {
1032
+ children: Array.from({ length: e }, (e, n) => /* @__PURE__ */ d("div", {
1033
1033
  style: {
1034
1034
  position: "relative",
1035
1035
  width: "100%",
@@ -1038,28 +1038,28 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1038
1038
  },
1039
1039
  children: t(n)
1040
1040
  }, n))
1041
- }), e > 1 && /* @__PURE__ */ d(l, { children: [
1042
- /* @__PURE__ */ u("button", {
1041
+ }), e > 1 && /* @__PURE__ */ f(u, { children: [
1042
+ /* @__PURE__ */ d("button", {
1043
1043
  type: "button",
1044
1044
  "aria-label": "Previous slide",
1045
1045
  style: {
1046
- ...Re,
1046
+ ...Be,
1047
1047
  left: 12
1048
1048
  },
1049
1049
  onClick: () => b(y - 1),
1050
1050
  children: "‹"
1051
1051
  }),
1052
- /* @__PURE__ */ u("button", {
1052
+ /* @__PURE__ */ d("button", {
1053
1053
  type: "button",
1054
1054
  "aria-label": "Next slide",
1055
1055
  style: {
1056
- ...Re,
1056
+ ...Be,
1057
1057
  right: 12
1058
1058
  },
1059
1059
  onClick: () => b(y + 1),
1060
1060
  children: "›"
1061
1061
  }),
1062
- /* @__PURE__ */ u("div", {
1062
+ /* @__PURE__ */ d("div", {
1063
1063
  style: {
1064
1064
  position: "absolute",
1065
1065
  bottom: 10,
@@ -1069,7 +1069,7 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1069
1069
  justifyContent: "center",
1070
1070
  gap: 6
1071
1071
  },
1072
- children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ u("button", {
1072
+ children: Array.from({ length: e }, (e, t) => /* @__PURE__ */ d("button", {
1073
1073
  type: "button",
1074
1074
  "aria-label": `Go to slide ${t + 1}`,
1075
1075
  onClick: () => b(t),
@@ -1087,7 +1087,7 @@ function Ve({ count: e, renderSlide: t, autoplay: n = !0, interval: r = 5, heigh
1087
1087
  ] })]
1088
1088
  });
1089
1089
  }
1090
- var He = (e, t) => ({
1090
+ var We = (e, t) => ({
1091
1091
  position: "absolute",
1092
1092
  inset: 0,
1093
1093
  backgroundImage: e ? `url(${e})` : "none",
@@ -1095,26 +1095,26 @@ var He = (e, t) => ({
1095
1095
  backgroundSize: "cover",
1096
1096
  backgroundPosition: "center"
1097
1097
  });
1098
- function Ue({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1099
- return e.length ? /* @__PURE__ */ u(Ve, {
1098
+ function Ge({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "left", ...r }) {
1099
+ return e.length ? /* @__PURE__ */ d(Ue, {
1100
1100
  ...r,
1101
1101
  count: e.length,
1102
1102
  renderSlide: (r) => {
1103
1103
  let i = e[r];
1104
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: He(i.image) }), (i.title || i.text) && /* @__PURE__ */ d("div", {
1104
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: We(i.image) }), (i.title || i.text) && /* @__PURE__ */ f("div", {
1105
1105
  style: {
1106
1106
  position: "absolute",
1107
1107
  color: "#fff",
1108
1108
  textAlign: n,
1109
- ...ze[t] ?? ze.bottom
1109
+ ...Ve[t] ?? Ve.bottom
1110
1110
  },
1111
- children: [i.title && /* @__PURE__ */ u("div", {
1111
+ children: [i.title && /* @__PURE__ */ d("div", {
1112
1112
  style: {
1113
1113
  fontSize: 22,
1114
1114
  fontWeight: 700
1115
1115
  },
1116
1116
  children: i.title
1117
- }), i.text && /* @__PURE__ */ u("div", {
1117
+ }), i.text && /* @__PURE__ */ d("div", {
1118
1118
  style: {
1119
1119
  fontSize: 14,
1120
1120
  opacity: .9,
@@ -1126,13 +1126,13 @@ function Ue({ slides: e = [], captionPosition: t = "bottom", captionAlign: n = "
1126
1126
  }
1127
1127
  }) : null;
1128
1128
  }
1129
- function We({ slides: e = [], linked: t, ...n }) {
1130
- return e.length ? /* @__PURE__ */ u(Ve, {
1129
+ function Ke({ slides: e = [], linked: t, ...n }) {
1130
+ return e.length ? /* @__PURE__ */ d(Ue, {
1131
1131
  ...n,
1132
1132
  count: e.length,
1133
1133
  renderSlide: (n) => {
1134
1134
  let r = e[n];
1135
- return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("div", { style: He(r.image, r.color) }), /* @__PURE__ */ u("div", {
1135
+ return /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("div", { style: We(r.image, r.color) }), /* @__PURE__ */ d("div", {
1136
1136
  style: {
1137
1137
  position: "absolute",
1138
1138
  inset: 0,
@@ -1144,33 +1144,33 @@ function We({ slides: e = [], linked: t, ...n }) {
1144
1144
  }
1145
1145
  }) : null;
1146
1146
  }
1147
- var Ge = {
1147
+ var qe = {
1148
1148
  color: "inherit",
1149
1149
  textDecoration: "none",
1150
1150
  fontSize: 14,
1151
1151
  opacity: .85
1152
- }, Ke = {
1152
+ }, Je = {
1153
1153
  background: "var(--page-bg, #ffffff)",
1154
1154
  color: "var(--page-text, #111827)",
1155
1155
  border: "1px solid rgba(148, 163, 184, 0.25)",
1156
1156
  boxShadow: "0 16px 40px rgba(15, 23, 42, 0.16)",
1157
1157
  zIndex: 60
1158
1158
  };
1159
- function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s = "auto", breakpoint: l = 768 }) {
1160
- let [f, p] = c(null), [m, h] = c(!1), [g, _] = c(!1), [v, y] = c(null);
1159
+ function Ye({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s = "auto", breakpoint: c = 768 }) {
1160
+ let [u, p] = l(null), [m, h] = l(!1), [g, _] = l(!1), [v, y] = l(null);
1161
1161
  a(() => {
1162
- if (!f) return;
1163
- let e = new ResizeObserver(() => h(f.offsetWidth < l));
1164
- return e.observe(f), () => e.disconnect();
1165
- }, [f, l]);
1166
- let b = s === "hamburger" || s === "auto" && m, x = (e, t) => /* @__PURE__ */ d("a", {
1162
+ if (!u) return;
1163
+ let e = new ResizeObserver(() => h(u.offsetWidth < c));
1164
+ return e.observe(u), () => e.disconnect();
1165
+ }, [u, c]);
1166
+ let b = s === "hamburger" || s === "auto" && m, x = (e, t) => /* @__PURE__ */ f("a", {
1167
1167
  href: e.href || "#",
1168
1168
  style: {
1169
- ...Ge,
1169
+ ...qe,
1170
1170
  display: "block",
1171
1171
  ...t
1172
1172
  },
1173
- children: [e.label, e.desc && /* @__PURE__ */ u("span", {
1173
+ children: [e.label, e.desc && /* @__PURE__ */ d("span", {
1174
1174
  style: {
1175
1175
  display: "block",
1176
1176
  fontSize: 12,
@@ -1180,7 +1180,7 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
1180
1180
  children: e.desc
1181
1181
  })]
1182
1182
  }, e.key);
1183
- return /* @__PURE__ */ d("nav", {
1183
+ return /* @__PURE__ */ f("nav", {
1184
1184
  ref: (e) => {
1185
1185
  p(e), o && o(e);
1186
1186
  },
@@ -1192,10 +1192,10 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
1192
1192
  padding: "14px 24px",
1193
1193
  width: "100%",
1194
1194
  position: "relative",
1195
- ...S(i)
1195
+ ...C(i)
1196
1196
  },
1197
1197
  children: [
1198
- n && /* @__PURE__ */ u("img", {
1198
+ n && /* @__PURE__ */ d("img", {
1199
1199
  src: n,
1200
1200
  alt: e || "Logo",
1201
1201
  style: {
@@ -1203,7 +1203,7 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
1203
1203
  display: "block"
1204
1204
  }
1205
1205
  }),
1206
- e && /* @__PURE__ */ u("div", {
1206
+ e && /* @__PURE__ */ d("div", {
1207
1207
  style: {
1208
1208
  fontWeight: 700,
1209
1209
  fontSize: 18,
@@ -1211,8 +1211,8 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
1211
1211
  },
1212
1212
  children: e
1213
1213
  }),
1214
- /* @__PURE__ */ u("div", { style: { flexGrow: 1 } }),
1215
- b ? /* @__PURE__ */ u("button", {
1214
+ /* @__PURE__ */ d("div", { style: { flexGrow: 1 } }),
1215
+ b ? /* @__PURE__ */ d("button", {
1216
1216
  type: "button",
1217
1217
  "aria-label": g ? "Close menu" : "Open menu",
1218
1218
  onClick: () => _(!g),
@@ -1226,7 +1226,7 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
1226
1226
  padding: 4
1227
1227
  },
1228
1228
  children: g ? "✕" : "☰"
1229
- }) : /* @__PURE__ */ u("div", {
1229
+ }) : /* @__PURE__ */ d("div", {
1230
1230
  style: {
1231
1231
  display: "flex",
1232
1232
  gap: 20,
@@ -1235,29 +1235,29 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
1235
1235
  },
1236
1236
  children: r.map((e) => {
1237
1237
  let t = e.children ?? [];
1238
- if (!t.length) return /* @__PURE__ */ u("a", {
1238
+ if (!t.length) return /* @__PURE__ */ d("a", {
1239
1239
  href: e.href || "#",
1240
- style: Ge,
1240
+ style: qe,
1241
1241
  children: e.label
1242
1242
  }, e.key);
1243
1243
  let n = e.type === "mega";
1244
- return /* @__PURE__ */ d("span", {
1244
+ return /* @__PURE__ */ f("span", {
1245
1245
  style: {
1246
1246
  position: n ? "static" : "relative",
1247
1247
  display: "inline-flex"
1248
1248
  },
1249
1249
  onMouseEnter: () => y(e.key),
1250
1250
  onMouseLeave: () => y(null),
1251
- children: [/* @__PURE__ */ d("a", {
1251
+ children: [/* @__PURE__ */ f("a", {
1252
1252
  href: e.href || "#",
1253
1253
  style: {
1254
- ...Ge,
1254
+ ...qe,
1255
1255
  cursor: "pointer"
1256
1256
  },
1257
1257
  children: [
1258
1258
  e.label,
1259
1259
  " ",
1260
- /* @__PURE__ */ u("span", {
1260
+ /* @__PURE__ */ d("span", {
1261
1261
  style: {
1262
1262
  fontSize: 9,
1263
1263
  opacity: .6
@@ -1265,9 +1265,9 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
1265
1265
  children: "▼"
1266
1266
  })
1267
1267
  ]
1268
- }), v === e.key && (n ? /* @__PURE__ */ u("div", {
1268
+ }), v === e.key && (n ? /* @__PURE__ */ d("div", {
1269
1269
  style: {
1270
- ...Ke,
1270
+ ...Je,
1271
1271
  position: "absolute",
1272
1272
  left: 0,
1273
1273
  right: 0,
@@ -1281,9 +1281,9 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
1281
1281
  padding: "6px 8px",
1282
1282
  borderRadius: 6
1283
1283
  }))
1284
- }) : /* @__PURE__ */ u("div", {
1284
+ }) : /* @__PURE__ */ d("div", {
1285
1285
  style: {
1286
- ...Ke,
1286
+ ...Je,
1287
1287
  position: "absolute",
1288
1288
  top: "100%",
1289
1289
  left: 0,
@@ -1301,7 +1301,7 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
1301
1301
  }, e.key);
1302
1302
  })
1303
1303
  }),
1304
- b && g && /* @__PURE__ */ u("div", {
1304
+ b && g && /* @__PURE__ */ d("div", {
1305
1305
  style: {
1306
1306
  flexBasis: "100%",
1307
1307
  width: "100%",
@@ -1309,10 +1309,10 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
1309
1309
  flexDirection: "column",
1310
1310
  paddingTop: 10
1311
1311
  },
1312
- children: r.map((e) => /* @__PURE__ */ d(t, { children: [/* @__PURE__ */ u("a", {
1312
+ children: r.map((e) => /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d("a", {
1313
1313
  href: e.href || "#",
1314
1314
  style: {
1315
- ...Ge,
1315
+ ...qe,
1316
1316
  padding: "10px 4px",
1317
1317
  fontWeight: (e.children ?? []).length ? 600 : 400,
1318
1318
  opacity: 1
@@ -1323,21 +1323,21 @@ function qe({ brand: e, logo: n, links: r = [], style: i, nodeRef: o, menu: s =
1323
1323
  ]
1324
1324
  });
1325
1325
  }
1326
- function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1327
- let [i, a] = c(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1328
- return e.length ? /* @__PURE__ */ d("div", {
1326
+ function Xe({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1327
+ let [i, a] = l(0), o = e.length ? Math.min(i, e.length - 1) : 0;
1328
+ return e.length ? /* @__PURE__ */ f("div", {
1329
1329
  ref: r,
1330
1330
  style: {
1331
1331
  width: "100%",
1332
- ...S(n)
1332
+ ...C(n)
1333
1333
  },
1334
- children: [/* @__PURE__ */ u("div", {
1334
+ children: [/* @__PURE__ */ d("div", {
1335
1335
  style: {
1336
1336
  display: "flex",
1337
1337
  gap: 4,
1338
1338
  borderBottom: "1px solid rgba(148, 163, 184, 0.35)"
1339
1339
  },
1340
- children: e.map((e, t) => /* @__PURE__ */ u("button", {
1340
+ children: e.map((e, t) => /* @__PURE__ */ d("button", {
1341
1341
  type: "button",
1342
1342
  onClick: () => a(t),
1343
1343
  style: {
@@ -1354,7 +1354,7 @@ function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1354
1354
  },
1355
1355
  children: e.label || `Tab ${t + 1}`
1356
1356
  }, e.key))
1357
- }), e.map((e, n) => /* @__PURE__ */ u("div", {
1357
+ }), e.map((e, n) => /* @__PURE__ */ d("div", {
1358
1358
  style: {
1359
1359
  display: n === o ? "flex" : "none",
1360
1360
  flexDirection: "column"
@@ -1363,24 +1363,24 @@ function Je({ tabs: e = [], linked: t, style: n, nodeRef: r }) {
1363
1363
  }, e.key))]
1364
1364
  }) : null;
1365
1365
  }
1366
- function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1367
- let [a, o] = c(() => new Set(e.length ? [e[0].key] : []));
1366
+ function Ze({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }) {
1367
+ let [a, o] = l(() => new Set(e.length ? [e[0].key] : []));
1368
1368
  if (!e.length) return null;
1369
1369
  let s = (e) => o((t) => {
1370
1370
  let r = new Set(n ? t : []);
1371
1371
  return t.has(e) ? r.delete(e) : r.add(e), r;
1372
1372
  });
1373
- return /* @__PURE__ */ u("div", {
1373
+ return /* @__PURE__ */ d("div", {
1374
1374
  ref: i,
1375
1375
  style: {
1376
1376
  width: "100%",
1377
- ...S(r)
1377
+ ...C(r)
1378
1378
  },
1379
1379
  children: e.map((n, r) => {
1380
1380
  let i = a.has(n.key);
1381
- return /* @__PURE__ */ d("div", {
1381
+ return /* @__PURE__ */ f("div", {
1382
1382
  style: { borderBottom: r < e.length - 1 ? "1px solid rgba(148, 163, 184, 0.35)" : "none" },
1383
- children: [/* @__PURE__ */ d("button", {
1383
+ children: [/* @__PURE__ */ f("button", {
1384
1384
  type: "button",
1385
1385
  onClick: () => s(n.key),
1386
1386
  style: {
@@ -1399,7 +1399,7 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1399
1399
  textAlign: "left",
1400
1400
  cursor: "pointer"
1401
1401
  },
1402
- children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ u("span", {
1402
+ children: [n.title || `Item ${r + 1}`, /* @__PURE__ */ d("span", {
1403
1403
  "aria-hidden": !0,
1404
1404
  style: {
1405
1405
  fontSize: 12,
@@ -1409,7 +1409,7 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1409
1409
  },
1410
1410
  children: "▼"
1411
1411
  })]
1412
- }), /* @__PURE__ */ u("div", {
1412
+ }), /* @__PURE__ */ d("div", {
1413
1413
  style: {
1414
1414
  display: i ? "flex" : "none",
1415
1415
  flexDirection: "column"
@@ -1420,15 +1420,15 @@ function Ye({ items: e = [], linked: t, multiple: n = !1, style: r, nodeRef: i }
1420
1420
  })
1421
1421
  });
1422
1422
  }
1423
- var Xe = {
1423
+ var Qe = {
1424
1424
  display: "flex",
1425
1425
  flexDirection: "column",
1426
1426
  gap: "12px"
1427
- }, X = {
1427
+ }, Y = {
1428
1428
  fontSize: "14px",
1429
1429
  fontWeight: 500,
1430
1430
  color: "var(--page-text, #111827)"
1431
- }, Z = {
1431
+ }, X = {
1432
1432
  padding: "10px 12px",
1433
1433
  border: "1px solid #d1d5db",
1434
1434
  borderRadius: "6px",
@@ -1438,18 +1438,18 @@ var Xe = {
1438
1438
  boxSizing: "border-box",
1439
1439
  backgroundColor: "#ffffff",
1440
1440
  color: "#111827"
1441
- }, Ze = {
1441
+ }, $e = {
1442
1442
  display: "flex",
1443
1443
  alignItems: "center",
1444
1444
  gap: "8px",
1445
1445
  fontSize: "14px",
1446
1446
  color: "var(--page-text, #111827)"
1447
- }, Q = (e) => e ? {
1447
+ }, Z = (e) => e ? {
1448
1448
  readOnly: !0,
1449
1449
  tabIndex: -1,
1450
1450
  onMouseDown: (e) => e.preventDefault()
1451
1451
  } : {};
1452
- function Qe(e, t) {
1452
+ function et(e, t) {
1453
1453
  if (!e) return !0;
1454
1454
  let n = t[e.field], r = n == null || n === "" ? "" : String(n), i = e.value ?? "";
1455
1455
  switch (e.op) {
@@ -1463,11 +1463,11 @@ function Qe(e, t) {
1463
1463
  default: return !1;
1464
1464
  }
1465
1465
  }
1466
- var $e = {
1466
+ var tt = {
1467
1467
  display: "flex",
1468
1468
  flexDirection: "column",
1469
1469
  gap: 6
1470
- }, et = {
1470
+ }, nt = {
1471
1471
  font: "inherit",
1472
1472
  fontSize: 15,
1473
1473
  padding: "10px 12px",
@@ -1478,16 +1478,16 @@ var $e = {
1478
1478
  width: "100%",
1479
1479
  boxSizing: "border-box"
1480
1480
  };
1481
- function tt(e, t) {
1481
+ function rt(e, t) {
1482
1482
  let n = Array.isArray(e?.options) ? e.options : [];
1483
1483
  if (!e?.parentField) return n;
1484
1484
  let r = t?.[e.parentField];
1485
1485
  return r ? n.filter((e) => typeof e == "string" ? !1 : !e.parent || e.parent === r) : [];
1486
1486
  }
1487
- function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1488
- let a = /* @__PURE__ */ d("span", {
1487
+ function it({ field: e, value: t, onChange: n, inert: r, values: i }) {
1488
+ let a = /* @__PURE__ */ f("span", {
1489
1489
  style: {
1490
- ...X,
1490
+ ...Y,
1491
1491
  fontSize: 14
1492
1492
  },
1493
1493
  children: [e.label, e.required ? " *" : ""]
@@ -1496,11 +1496,11 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1496
1496
  required: e.required || void 0,
1497
1497
  placeholder: e.placeholder || void 0,
1498
1498
  disabled: r || void 0,
1499
- style: et,
1499
+ style: nt,
1500
1500
  value: t ?? "",
1501
1501
  onChange: (t) => n(e.name, t.target.value)
1502
1502
  };
1503
- return e.type === "display" ? /* @__PURE__ */ u(e.variant && e.variant !== "p" ? e.variant : "p", {
1503
+ return e.type === "display" ? /* @__PURE__ */ d(e.variant && e.variant !== "p" ? e.variant : "p", {
1504
1504
  style: {
1505
1505
  margin: 0,
1506
1506
  color: e.color || "inherit",
@@ -1517,7 +1517,7 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1517
1517
  lineHeight: 1.35
1518
1518
  },
1519
1519
  children: e.label
1520
- }) : e.type === "image" ? e.src ? /* @__PURE__ */ u("img", {
1520
+ }) : e.type === "image" ? e.src ? /* @__PURE__ */ d("img", {
1521
1521
  src: e.src,
1522
1522
  alt: e.label ?? "",
1523
1523
  style: {
@@ -1525,10 +1525,10 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1525
1525
  borderRadius: 8,
1526
1526
  display: "block"
1527
1527
  }
1528
- }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ u(Ne, {
1528
+ }) : null : e.type === "video" ? e.src ? /youtube\.com|youtu\.be|vimeo\.com/i.test(e.src) ? /* @__PURE__ */ d(Fe, {
1529
1529
  url: e.src,
1530
1530
  style: { width: "100%" }
1531
- }) : /* @__PURE__ */ u("video", {
1531
+ }) : /* @__PURE__ */ d("video", {
1532
1532
  src: e.src,
1533
1533
  controls: !0,
1534
1534
  style: {
@@ -1536,28 +1536,28 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1536
1536
  borderRadius: 8,
1537
1537
  display: "block"
1538
1538
  }
1539
- }) : null : /* @__PURE__ */ d("label", {
1540
- style: $e,
1539
+ }) : null : /* @__PURE__ */ f("label", {
1540
+ style: tt,
1541
1541
  children: [
1542
1542
  a,
1543
- e.type === "textarea" || e.multiline ? /* @__PURE__ */ u("textarea", {
1543
+ e.type === "textarea" || e.multiline ? /* @__PURE__ */ d("textarea", {
1544
1544
  ...o,
1545
1545
  rows: 4,
1546
1546
  style: {
1547
- ...et,
1547
+ ...nt,
1548
1548
  resize: "vertical"
1549
1549
  }
1550
- }) : e.type === "select" ? /* @__PURE__ */ d("select", {
1550
+ }) : e.type === "select" ? /* @__PURE__ */ f("select", {
1551
1551
  ...o,
1552
1552
  disabled: o.disabled || !!e.parentField && !i?.[e.parentField],
1553
- children: [/* @__PURE__ */ u("option", {
1553
+ children: [/* @__PURE__ */ d("option", {
1554
1554
  value: "",
1555
1555
  children: e.placeholder || "—"
1556
- }), tt(e, i).map((e, t) => /* @__PURE__ */ u("option", {
1556
+ }), rt(e, i).map((e, t) => /* @__PURE__ */ d("option", {
1557
1557
  value: typeof e == "string" ? e : e.value,
1558
1558
  children: typeof e == "string" ? e : e.label ?? e.value
1559
1559
  }, t))]
1560
- }) : e.type === "checkbox" ? /* @__PURE__ */ u("input", {
1560
+ }) : e.type === "checkbox" ? /* @__PURE__ */ d("input", {
1561
1561
  type: "checkbox",
1562
1562
  name: e.name,
1563
1563
  required: e.required || void 0,
@@ -1568,7 +1568,7 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1568
1568
  width: 18,
1569
1569
  height: 18
1570
1570
  }
1571
- }) : e.type === "upload" ? /* @__PURE__ */ u("input", {
1571
+ }) : e.type === "upload" ? /* @__PURE__ */ d("input", {
1572
1572
  type: "file",
1573
1573
  name: e.name,
1574
1574
  accept: e.accept || void 0,
@@ -1579,7 +1579,7 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1579
1579
  font: "inherit",
1580
1580
  fontSize: 14
1581
1581
  }
1582
- }) : /* @__PURE__ */ u("input", {
1582
+ }) : /* @__PURE__ */ d("input", {
1583
1583
  ...o,
1584
1584
  type: {
1585
1585
  email: "email",
@@ -1590,7 +1590,7 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1590
1590
  link: "url"
1591
1591
  }[e.type] ?? "text"
1592
1592
  }),
1593
- e.help && /* @__PURE__ */ u("span", {
1593
+ e.help && /* @__PURE__ */ d("span", {
1594
1594
  style: {
1595
1595
  fontSize: 12,
1596
1596
  opacity: .65
@@ -1600,16 +1600,16 @@ function nt({ field: e, value: t, onChange: n, inert: r, values: i }) {
1600
1600
  ]
1601
1601
  });
1602
1602
  }
1603
- function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: f, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
1604
- let { tenant: y, apiUrl: b } = i(U), [x, C] = c("form"), [w, T] = c(null), [E, D] = c({}), [O, k] = c(0), A = h ? v || "form" : x;
1603
+ function at({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s, auto: c, submitLabel: p, nodeRef: m, inert: h, children: g, linked: _, show: v }) {
1604
+ let { tenant: y, apiUrl: b } = i(H), [x, S] = l("form"), [w, T] = l(null), [E, D] = l({}), [O, k] = l(0), A = h ? v || "form" : x;
1605
1605
  a(() => {
1606
- if (!f || !s) return;
1606
+ if (!c || !s) return;
1607
1607
  let e = !0;
1608
1608
  return fetch(`${b || "/api"}/forms/${encodeURIComponent(s)}`, { 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)), () => {
1609
1609
  e = !1;
1610
1610
  };
1611
1611
  }, [
1612
- f,
1612
+ c,
1613
1613
  s,
1614
1614
  y,
1615
1615
  b
@@ -1622,9 +1622,9 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1622
1622
  section: e,
1623
1623
  fields: []
1624
1624
  }) : j[j.length - 1].fields.push(e);
1625
- let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || Qe(e.section.condition, E)).map((e) => ({
1625
+ let M = j.filter((e) => e.section || e.fields.length), N = M.filter((e) => !e.section || et(e.section.condition, E)).map((e) => ({
1626
1626
  ...e,
1627
- fields: e.fields.filter((e) => Qe(e.condition, E))
1627
+ fields: e.fields.filter((e) => et(e.condition, E))
1628
1628
  })), 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) => {
1629
1629
  let t = E[e.name];
1630
1630
  return e.required && (t == null || t === "" || t === !1);
@@ -1636,11 +1636,11 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1636
1636
  for (let t of Array.isArray(w?.fields) ? w.fields : []) t?.parentField === e && delete r[t.name];
1637
1637
  return r;
1638
1638
  });
1639
- return /* @__PURE__ */ d("div", {
1639
+ return /* @__PURE__ */ f("div", {
1640
1640
  ref: m,
1641
- style: S(e),
1641
+ style: C(e),
1642
1642
  children: [
1643
- /* @__PURE__ */ u("form", {
1643
+ /* @__PURE__ */ d("form", {
1644
1644
  action: t || void 0,
1645
1645
  method: n || "post",
1646
1646
  name: r || void 0,
@@ -1649,7 +1649,7 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1649
1649
  if (e.preventDefault(), !h) {
1650
1650
  if (s) {
1651
1651
  let t = {};
1652
- if (f) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
1652
+ if (c) for (let [e, n] of Object.entries(E)) n != null && n !== "" && (t[e] = n);
1653
1653
  else for (let [n, r] of new FormData(e.currentTarget).entries()) typeof r == "string" && (t[n] = r === "on" || r);
1654
1654
  try {
1655
1655
  let e = await fetch(`${b || "/api"}/forms/${s}/submit`, {
@@ -1660,14 +1660,14 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1660
1660
  },
1661
1661
  body: JSON.stringify(t)
1662
1662
  }), n = await e.json().catch(() => null);
1663
- C(e.ok && n?.success !== !1 ? "success" : "error");
1663
+ S(e.ok && n?.success !== !1 ? "success" : "error");
1664
1664
  } catch {
1665
- C("error");
1665
+ S("error");
1666
1666
  }
1667
1667
  return;
1668
1668
  }
1669
1669
  if (!t) {
1670
- C("success");
1670
+ S("success");
1671
1671
  return;
1672
1672
  }
1673
1673
  try {
@@ -1675,23 +1675,23 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1675
1675
  method: n || "post",
1676
1676
  body: new FormData(e.currentTarget)
1677
1677
  });
1678
- C(r.ok ? "success" : "error");
1678
+ S(r.ok ? "success" : "error");
1679
1679
  } catch {
1680
- C("error");
1680
+ S("error");
1681
1681
  }
1682
1682
  }
1683
1683
  },
1684
1684
  style: {
1685
- ...Xe,
1685
+ ...Qe,
1686
1686
  display: A === "success" ? "none" : "flex"
1687
1687
  },
1688
- children: f && s ? /* @__PURE__ */ d(l, { children: [
1689
- P && /* @__PURE__ */ u(ht, {
1688
+ children: c && s ? /* @__PURE__ */ f(u, { children: [
1689
+ P && /* @__PURE__ */ d(_t, {
1690
1690
  steps: N.map((e) => ({ label: e.section?.label ?? "Start" })),
1691
1691
  active: F + 1,
1692
1692
  style: { marginBottom: 8 }
1693
1693
  }),
1694
- P && N[F]?.section?.help && /* @__PURE__ */ u("p", {
1694
+ P && N[F]?.section?.help && /* @__PURE__ */ d("p", {
1695
1695
  style: {
1696
1696
  margin: 0,
1697
1697
  fontSize: 14,
@@ -1699,26 +1699,26 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1699
1699
  },
1700
1700
  children: N[F].section.help
1701
1701
  }),
1702
- I.map((e) => /* @__PURE__ */ u(nt, {
1702
+ I.map((e) => /* @__PURE__ */ d(it, {
1703
1703
  field: e,
1704
1704
  value: E[e.name],
1705
1705
  values: E,
1706
1706
  onChange: z,
1707
1707
  inert: h
1708
1708
  }, e.name)),
1709
- /* @__PURE__ */ d("div", {
1709
+ /* @__PURE__ */ f("div", {
1710
1710
  style: {
1711
1711
  display: "flex",
1712
1712
  gap: 10,
1713
1713
  alignItems: "center",
1714
1714
  marginTop: 4
1715
1715
  },
1716
- children: [P && F > 0 && /* @__PURE__ */ u("button", {
1716
+ children: [P && F > 0 && /* @__PURE__ */ d("button", {
1717
1717
  type: "button",
1718
1718
  disabled: h || void 0,
1719
1719
  onClick: () => k(F - 1),
1720
1720
  style: {
1721
- ...J,
1721
+ ...q,
1722
1722
  background: "transparent",
1723
1723
  color: "inherit",
1724
1724
  border: 0,
@@ -1726,12 +1726,12 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1726
1726
  cursor: "pointer"
1727
1727
  },
1728
1728
  children: "Back"
1729
- }), P && !R ? /* @__PURE__ */ u("button", {
1729
+ }), P && !R ? /* @__PURE__ */ d("button", {
1730
1730
  type: "button",
1731
1731
  disabled: h || L.length > 0,
1732
1732
  onClick: () => k(F + 1),
1733
1733
  style: {
1734
- ...J,
1734
+ ...q,
1735
1735
  border: 0,
1736
1736
  padding: "10px 22px",
1737
1737
  borderRadius: 8,
@@ -1741,11 +1741,11 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1741
1741
  opacity: L.length ? .5 : 1
1742
1742
  },
1743
1743
  children: "Next"
1744
- }) : /* @__PURE__ */ u("button", {
1744
+ }) : /* @__PURE__ */ d("button", {
1745
1745
  type: "submit",
1746
1746
  disabled: h || void 0,
1747
1747
  style: {
1748
- ...J,
1748
+ ...q,
1749
1749
  border: 0,
1750
1750
  padding: "10px 22px",
1751
1751
  borderRadius: 8,
@@ -1758,11 +1758,11 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1758
1758
  })
1759
1759
  ] }) : g
1760
1760
  }),
1761
- /* @__PURE__ */ u("div", {
1761
+ /* @__PURE__ */ d("div", {
1762
1762
  style: { display: A === "success" ? "block" : "none" },
1763
1763
  children: _?.success ?? null
1764
1764
  }),
1765
- /* @__PURE__ */ u("div", {
1765
+ /* @__PURE__ */ d("div", {
1766
1766
  style: {
1767
1767
  display: A === "error" ? "block" : "none",
1768
1768
  marginTop: 12
@@ -1772,53 +1772,53 @@ function rt({ style: e, action: t, method: n, name: r, enctype: o, formSlug: s,
1772
1772
  ]
1773
1773
  });
1774
1774
  }
1775
- function it({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1776
- return /* @__PURE__ */ u("label", {
1775
+ function ot({ text: e, parts: t, style: n, nodeRef: r, linked: i }) {
1776
+ return /* @__PURE__ */ d("label", {
1777
1777
  ref: r,
1778
1778
  style: {
1779
- ...X,
1780
- ...S(n)
1779
+ ...Y,
1780
+ ...C(n)
1781
1781
  },
1782
- children: Y(t, e, i)
1782
+ children: J(t, e, i)
1783
1783
  });
1784
1784
  }
1785
- function at({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1786
- return /* @__PURE__ */ u("input", {
1785
+ function st({ type: e = "text", name: t, placeholder: n, required: r, style: i, nodeRef: a, inert: o }) {
1786
+ return /* @__PURE__ */ d("input", {
1787
1787
  ref: a,
1788
1788
  type: e,
1789
1789
  name: t || void 0,
1790
1790
  placeholder: n,
1791
1791
  required: !o && !!r,
1792
1792
  style: {
1793
- ...Z,
1794
- ...S(i)
1793
+ ...X,
1794
+ ...C(i)
1795
1795
  },
1796
- ...Q(o)
1796
+ ...Z(o)
1797
1797
  });
1798
1798
  }
1799
- function ot({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1800
- return /* @__PURE__ */ u("textarea", {
1799
+ function ct({ name: e, placeholder: t, rows: n = 4, required: r, style: i, nodeRef: a, inert: o }) {
1800
+ return /* @__PURE__ */ d("textarea", {
1801
1801
  ref: a,
1802
1802
  name: e || void 0,
1803
1803
  placeholder: t,
1804
1804
  rows: n,
1805
1805
  required: !o && !!r,
1806
1806
  style: {
1807
- ...Z,
1807
+ ...X,
1808
1808
  resize: "vertical",
1809
- ...S(i)
1809
+ ...C(i)
1810
1810
  },
1811
- ...Q(o)
1811
+ ...Z(o)
1812
1812
  });
1813
1813
  }
1814
- function st({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1815
- return /* @__PURE__ */ d("label", {
1814
+ function lt({ kind: e = "checkbox", label: t, name: n, value: r, required: i, style: a, nodeRef: o, inert: s }) {
1815
+ return /* @__PURE__ */ f("label", {
1816
1816
  ref: o,
1817
1817
  style: {
1818
- ...Ze,
1819
- ...S(a)
1818
+ ...$e,
1819
+ ...C(a)
1820
1820
  },
1821
- children: [/* @__PURE__ */ u("input", {
1821
+ children: [/* @__PURE__ */ d("input", {
1822
1822
  type: e,
1823
1823
  name: n || void 0,
1824
1824
  value: r || void 0,
@@ -1832,8 +1832,8 @@ function st({ kind: e = "checkbox", label: t, name: n, value: r, required: i, st
1832
1832
  }), t]
1833
1833
  });
1834
1834
  }
1835
- function ct({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1836
- return /* @__PURE__ */ d("select", {
1835
+ function ut({ name: e, placeholder: t, options: n = [], required: r, style: i, nodeRef: a, inert: o }) {
1836
+ return /* @__PURE__ */ f("select", {
1837
1837
  ref: a,
1838
1838
  name: e || void 0,
1839
1839
  required: !o && !!r,
@@ -1841,45 +1841,45 @@ function ct({ name: e, placeholder: t, options: n = [], required: r, style: i, n
1841
1841
  onMouseDown: o ? (e) => e.preventDefault() : void 0,
1842
1842
  tabIndex: o ? -1 : void 0,
1843
1843
  style: {
1844
- ...Z,
1844
+ ...X,
1845
1845
  appearance: "auto",
1846
- ...S(i)
1846
+ ...C(i)
1847
1847
  },
1848
- children: [t !== "" && /* @__PURE__ */ u("option", {
1848
+ children: [t !== "" && /* @__PURE__ */ d("option", {
1849
1849
  value: "",
1850
1850
  disabled: !0,
1851
1851
  children: t ?? "Select…"
1852
- }), n.map((e, t) => /* @__PURE__ */ u("option", {
1852
+ }), n.map((e, t) => /* @__PURE__ */ d("option", {
1853
1853
  value: e,
1854
1854
  children: e
1855
1855
  }, t))]
1856
1856
  });
1857
1857
  }
1858
- function lt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
1859
- let [s, l] = c(null);
1860
- return /* @__PURE__ */ d("label", {
1858
+ function dt({ name: e, accept: t, required: n, text: r = "Choose a file…", style: i, nodeRef: a, inert: o }) {
1859
+ let [s, c] = l(null);
1860
+ return /* @__PURE__ */ f("label", {
1861
1861
  ref: a,
1862
1862
  style: {
1863
- ...Z,
1863
+ ...X,
1864
1864
  display: "flex",
1865
1865
  alignItems: "center",
1866
1866
  gap: "8px",
1867
1867
  cursor: o ? "default" : "pointer",
1868
1868
  borderStyle: "dashed",
1869
1869
  color: s ? "#111827" : "#6b7280",
1870
- ...S(i)
1870
+ ...C(i)
1871
1871
  },
1872
1872
  children: [
1873
- /* @__PURE__ */ u("input", {
1873
+ /* @__PURE__ */ d("input", {
1874
1874
  type: "file",
1875
1875
  name: e || void 0,
1876
1876
  accept: t || void 0,
1877
1877
  required: !o && !!n,
1878
1878
  disabled: !!o,
1879
- onChange: (e) => l(e.target.files?.[0]?.name ?? null),
1879
+ onChange: (e) => c(e.target.files?.[0]?.name ?? null),
1880
1880
  style: { display: "none" }
1881
1881
  }),
1882
- /* @__PURE__ */ u("span", {
1882
+ /* @__PURE__ */ d("span", {
1883
1883
  "aria-hidden": !0,
1884
1884
  children: "📎"
1885
1885
  }),
@@ -1887,12 +1887,12 @@ function lt({ name: e, accept: t, required: n, text: r = "Choose a file…", sty
1887
1887
  ]
1888
1888
  });
1889
1889
  }
1890
- function ut({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1891
- return /* @__PURE__ */ u("button", {
1890
+ function ft({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1891
+ return /* @__PURE__ */ d("button", {
1892
1892
  ref: n,
1893
1893
  type: r ? "button" : "submit",
1894
1894
  style: {
1895
- ...J,
1895
+ ...q,
1896
1896
  border: 0,
1897
1897
  cursor: "pointer",
1898
1898
  alignSelf: "flex-start",
@@ -1902,37 +1902,37 @@ function ut({ text: e = "Submit", style: t, nodeRef: n, inert: r }) {
1902
1902
  fontWeight: 600,
1903
1903
  lineHeight: 1.4,
1904
1904
  fontFamily: "inherit",
1905
- ...S(t)
1905
+ ...C(t)
1906
1906
  },
1907
1907
  children: e
1908
1908
  });
1909
1909
  }
1910
- function dt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1910
+ function pt({ cols: e = 2, rows: t = 1, style: n, nodeRef: r, linked: i }) {
1911
1911
  let a = Math.max(1, (Number(e) || 1) * (Number(t) || 1));
1912
- return /* @__PURE__ */ u("div", {
1912
+ return /* @__PURE__ */ d("div", {
1913
1913
  ref: r,
1914
1914
  style: {
1915
1915
  display: "grid",
1916
1916
  gridTemplateColumns: `repeat(${Math.max(1, Number(e) || 1)}, minmax(0, 1fr))`,
1917
1917
  gap: 16,
1918
1918
  width: "100%",
1919
- ...S(n)
1919
+ ...C(n)
1920
1920
  },
1921
- children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ u("div", {
1921
+ children: Array.from({ length: a }, (e, t) => /* @__PURE__ */ d("div", {
1922
1922
  style: { minWidth: 0 },
1923
1923
  children: i?.[`cell-${t}`] ?? null
1924
1924
  }, t))
1925
1925
  });
1926
1926
  }
1927
- function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: l, custom: f, templateId: p, style: m, nodeRef: h }) {
1928
- let { tenant: g, apiUrl: _, locale: v } = i(U), y = i(G), b = i(W)?.[e], [x, C] = c(null);
1927
+ function mt({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, imageField: o, titleField: s = "name", textField: c, custom: u, templateId: p, style: m, nodeRef: h }) {
1928
+ let { tenant: g, apiUrl: _, locale: v } = i(H), y = i(W), b = i(U)?.[e], [x, S] = l(null);
1929
1929
  if (a(() => {
1930
1930
  if (!e || b) return;
1931
1931
  let t = !0, n = e.startsWith("api:") ? `${_}/data/${encodeURIComponent(e.slice(4))}` : `${_}/dynamic/${encodeURIComponent(e)}${v ? `?locale=${encodeURIComponent(v)}` : ""}`;
1932
1932
  return fetch(n, { headers: g ? { "x-tenant": g } : {} }).then((e) => e.json()).then((e) => {
1933
1933
  let n = Array.isArray(e?.payload) ? e.payload : Array.isArray(e?.payload?.data) ? e.payload.data : [];
1934
- return t && C(n.filter((e) => e && typeof e == "object"));
1935
- }).catch(() => t && C([])), () => {
1934
+ return t && S(n.filter((e) => e && typeof e == "object"));
1935
+ }).catch(() => t && S([])), () => {
1936
1936
  t = !1;
1937
1937
  };
1938
1938
  }, [
@@ -1951,49 +1951,49 @@ function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
1951
1951
  gridTemplateColumns: `repeat(${T}, minmax(0, 1fr))`,
1952
1952
  gap: 24
1953
1953
  };
1954
- return f && p && y?.render ? /* @__PURE__ */ u("div", {
1954
+ return u && p && y?.render ? /* @__PURE__ */ d("div", {
1955
1955
  ref: h,
1956
1956
  style: {
1957
1957
  width: "100%",
1958
1958
  ...E,
1959
- ...S(m)
1959
+ ...C(m)
1960
1960
  },
1961
- children: w.map((e) => /* @__PURE__ */ u("div", {
1961
+ children: w.map((e) => /* @__PURE__ */ d("div", {
1962
1962
  style: { minWidth: 0 },
1963
- children: y.render(p, (t) => ae(t, e))
1963
+ children: y.render(p, (t) => se(t, e))
1964
1964
  }, e.id ?? e?.data?.slug))
1965
- }) : /* @__PURE__ */ u("div", {
1965
+ }) : /* @__PURE__ */ d("div", {
1966
1966
  ref: h,
1967
1967
  style: {
1968
1968
  width: "100%",
1969
1969
  ...E,
1970
- ...S(m)
1970
+ ...C(m)
1971
1971
  },
1972
1972
  children: w.map((e) => {
1973
- let t = o ? K(e?.data, o) : null, r = s ? q(K(e?.data, s)) : null, i = l ? K(e?.data, l) : null, a = Array.isArray(i) ? i : null, c = a || i == null ? null : q(i), f = n === "list";
1974
- return /* @__PURE__ */ d("div", {
1973
+ let t = o ? G(e?.data, o) : null, r = s ? K(G(e?.data, s)) : null, i = c ? G(e?.data, c) : null, a = Array.isArray(i) ? i : null, l = a || i == null ? null : K(i), u = n === "list";
1974
+ return /* @__PURE__ */ f("div", {
1975
1975
  style: {
1976
1976
  display: "flex",
1977
- flexDirection: f ? "row" : "column",
1978
- gap: f ? 20 : 12,
1979
- alignItems: f ? "center" : "stretch",
1977
+ flexDirection: u ? "row" : "column",
1978
+ gap: u ? 20 : 12,
1979
+ alignItems: u ? "center" : "stretch",
1980
1980
  minWidth: 0
1981
1981
  },
1982
- children: [t && /* @__PURE__ */ u("img", {
1982
+ children: [t && /* @__PURE__ */ d("img", {
1983
1983
  src: t,
1984
1984
  alt: r ?? "",
1985
1985
  style: {
1986
- width: f ? 160 : "100%",
1986
+ width: u ? 160 : "100%",
1987
1987
  aspectRatio: "3 / 2",
1988
1988
  objectFit: "cover",
1989
1989
  borderRadius: 10,
1990
1990
  flexShrink: 0,
1991
1991
  display: "block"
1992
1992
  }
1993
- }), /* @__PURE__ */ d("div", {
1993
+ }), /* @__PURE__ */ f("div", {
1994
1994
  style: { minWidth: 0 },
1995
1995
  children: [
1996
- r && /* @__PURE__ */ u("h3", {
1996
+ r && /* @__PURE__ */ d("h3", {
1997
1997
  style: {
1998
1998
  margin: 0,
1999
1999
  fontSize: 18,
@@ -2001,23 +2001,23 @@ function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
2001
2001
  },
2002
2002
  children: r
2003
2003
  }),
2004
- c && /* @__PURE__ */ u("p", {
2004
+ l && /* @__PURE__ */ d("p", {
2005
2005
  style: {
2006
2006
  margin: "6px 0 0",
2007
2007
  fontSize: 14,
2008
2008
  lineHeight: 1.55,
2009
2009
  opacity: .75
2010
2010
  },
2011
- children: c
2011
+ children: l
2012
2012
  }),
2013
- a && /* @__PURE__ */ u("div", {
2013
+ a && /* @__PURE__ */ d("div", {
2014
2014
  style: {
2015
2015
  marginTop: 6,
2016
2016
  fontSize: 14,
2017
2017
  lineHeight: 1.55,
2018
2018
  opacity: .85
2019
2019
  },
2020
- children: xe(a)
2020
+ children: Ce(a)
2021
2021
  })
2022
2022
  ]
2023
2023
  })]
@@ -2025,12 +2025,12 @@ function ft({ collection: e, limit: t = 6, layout: n = "grid", columns: r = 3, i
2025
2025
  })
2026
2026
  });
2027
2027
  }
2028
- function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2029
- return e.length ? /* @__PURE__ */ u("nav", {
2028
+ function ht({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2029
+ return e.length ? /* @__PURE__ */ d("nav", {
2030
2030
  ref: r,
2031
2031
  "aria-label": "Breadcrumb",
2032
- style: { ...S(n) },
2033
- children: /* @__PURE__ */ u("ol", {
2032
+ style: { ...C(n) },
2033
+ children: /* @__PURE__ */ d("ol", {
2034
2034
  style: {
2035
2035
  display: "flex",
2036
2036
  flexWrap: "wrap",
@@ -2043,25 +2043,25 @@ function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2043
2043
  },
2044
2044
  children: e.map((n, r) => {
2045
2045
  let i = r === e.length - 1;
2046
- return /* @__PURE__ */ d("li", {
2046
+ return /* @__PURE__ */ f("li", {
2047
2047
  style: {
2048
2048
  display: "flex",
2049
2049
  alignItems: "center",
2050
2050
  gap: 8,
2051
2051
  minWidth: 0
2052
2052
  },
2053
- children: [r > 0 && /* @__PURE__ */ u("span", {
2053
+ children: [r > 0 && /* @__PURE__ */ d("span", {
2054
2054
  style: { opacity: .4 },
2055
2055
  "aria-hidden": !0,
2056
2056
  children: t
2057
- }), i || !n.href ? /* @__PURE__ */ u("span", {
2057
+ }), i || !n.href ? /* @__PURE__ */ d("span", {
2058
2058
  style: {
2059
2059
  fontWeight: i ? 600 : 400,
2060
2060
  opacity: i ? 1 : .7
2061
2061
  },
2062
2062
  "aria-current": i ? "page" : void 0,
2063
2063
  children: n.label
2064
- }) : /* @__PURE__ */ u("a", {
2064
+ }) : /* @__PURE__ */ d("a", {
2065
2065
  href: n.href,
2066
2066
  style: {
2067
2067
  color: "inherit",
@@ -2075,7 +2075,7 @@ function pt({ items: e = [], separator: t = "/", style: n, nodeRef: r }) {
2075
2075
  })
2076
2076
  }) : null;
2077
2077
  }
2078
- function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2078
+ function gt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", style: i, nodeRef: a }) {
2079
2079
  let o = Math.min(Math.max(Number(e) || 1, 1), 50), s = Math.min(Math.max(Number(t) || 1, 1), o), c = (e) => r && r !== "#" ? r.replace("{page}", String(e)) : "#", l = (e) => ({
2080
2080
  display: "inline-flex",
2081
2081
  alignItems: "center",
@@ -2090,7 +2090,7 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2090
2090
  background: e ? "var(--page-accent, #111827)" : "transparent",
2091
2091
  border: e ? "1px solid transparent" : "1px solid rgba(148, 163, 184, 0.4)"
2092
2092
  });
2093
- return /* @__PURE__ */ d("nav", {
2093
+ return /* @__PURE__ */ f("nav", {
2094
2094
  ref: a,
2095
2095
  "aria-label": "Pagination",
2096
2096
  style: {
@@ -2098,10 +2098,10 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2098
2098
  flexWrap: "wrap",
2099
2099
  gap: 8,
2100
2100
  alignItems: "center",
2101
- ...S(i)
2101
+ ...C(i)
2102
2102
  },
2103
2103
  children: [
2104
- n && /* @__PURE__ */ u("a", {
2104
+ n && /* @__PURE__ */ d("a", {
2105
2105
  href: s > 1 ? c(s - 1) : "#",
2106
2106
  "aria-label": "Previous",
2107
2107
  style: {
@@ -2110,13 +2110,13 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2110
2110
  },
2111
2111
  children: "‹"
2112
2112
  }),
2113
- Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ u("a", {
2113
+ Array.from({ length: o }, (e, t) => t + 1).map((e) => /* @__PURE__ */ d("a", {
2114
2114
  href: c(e),
2115
2115
  "aria-current": e === s ? "page" : void 0,
2116
2116
  style: l(e === s),
2117
2117
  children: e
2118
2118
  }, e)),
2119
- n && /* @__PURE__ */ u("a", {
2119
+ n && /* @__PURE__ */ d("a", {
2120
2120
  href: s < o ? c(s + 1) : "#",
2121
2121
  "aria-label": "Next",
2122
2122
  style: {
@@ -2128,7 +2128,7 @@ function mt({ pages: e = 5, current: t = 1, prevNext: n = !0, href: r = "#", sty
2128
2128
  ]
2129
2129
  });
2130
2130
  }
2131
- function ht({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2131
+ function _t({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef: a }) {
2132
2132
  if (!e.length) return null;
2133
2133
  let o = Math.min(Math.max(Number(n) || 1, 1), e.length), s = (e) => ({
2134
2134
  width: 32,
@@ -2159,21 +2159,21 @@ function ht({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2159
2159
  minWidth: 24
2160
2160
  }
2161
2161
  });
2162
- return /* @__PURE__ */ u("div", {
2162
+ return /* @__PURE__ */ d("div", {
2163
2163
  ref: a,
2164
2164
  style: {
2165
2165
  display: "flex",
2166
2166
  flexDirection: r ? "column" : "row",
2167
2167
  alignItems: r ? "stretch" : "flex-start",
2168
2168
  gap: r ? 4 : 8,
2169
- ...S(i)
2169
+ ...C(i)
2170
2170
  },
2171
2171
  children: e.map((e, n) => {
2172
2172
  let i = n + 1, a = i < o ? "done" : i === o ? "active" : "todo";
2173
- return /* @__PURE__ */ d(t, { children: [n > 0 && /* @__PURE__ */ u("div", {
2173
+ return /* @__PURE__ */ f(t, { children: [n > 0 && /* @__PURE__ */ d("div", {
2174
2174
  style: c(i <= o),
2175
2175
  "aria-hidden": !0
2176
- }), /* @__PURE__ */ d("div", {
2176
+ }), /* @__PURE__ */ f("div", {
2177
2177
  style: {
2178
2178
  display: "flex",
2179
2179
  flexDirection: r ? "row" : "column",
@@ -2182,19 +2182,19 @@ function ht({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2182
2182
  minWidth: 0,
2183
2183
  textAlign: r ? "left" : "center"
2184
2184
  },
2185
- children: [/* @__PURE__ */ u("div", {
2185
+ children: [/* @__PURE__ */ d("div", {
2186
2186
  style: s(a),
2187
2187
  children: a === "done" ? "✓" : i
2188
- }), /* @__PURE__ */ d("div", {
2188
+ }), /* @__PURE__ */ f("div", {
2189
2189
  style: { minWidth: 0 },
2190
- children: [/* @__PURE__ */ u("div", {
2190
+ children: [/* @__PURE__ */ d("div", {
2191
2191
  style: {
2192
2192
  fontSize: 13,
2193
2193
  fontWeight: a === "active" ? 700 : 500,
2194
2194
  opacity: a === "todo" ? .6 : 1
2195
2195
  },
2196
2196
  children: e.label
2197
- }), e.description && /* @__PURE__ */ u("div", {
2197
+ }), e.description && /* @__PURE__ */ d("div", {
2198
2198
  style: {
2199
2199
  fontSize: 12,
2200
2200
  opacity: .6
@@ -2206,7 +2206,7 @@ function ht({ steps: e = [], active: n = 1, vertical: r = !1, style: i, nodeRef:
2206
2206
  })
2207
2207
  });
2208
2208
  }
2209
- var gt = {
2209
+ var vt = {
2210
2210
  small: {
2211
2211
  w: 132,
2212
2212
  h: 46,
@@ -2228,10 +2228,10 @@ var gt = {
2228
2228
  title: 12.5,
2229
2229
  avatar: 46
2230
2230
  }
2231
- }, _t = (e) => gt[e] ?? gt.medium;
2232
- gt.medium.w, gt.medium.h;
2233
- function vt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2234
- 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 = [];
2231
+ }, yt = (e) => vt[e] ?? vt.medium;
2232
+ vt.medium.w, vt.medium.h;
2233
+ function bt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2234
+ let r = yt(t), i = n ? r.h : r.w, a = n ? 16 : 20, o = (n ? r.w : r.h) + (n ? 56 : 48), s = Array.isArray(e) ? e.filter((e) => e && e.id) : [], c = new Set(s.map((e) => e.id)), l = /* @__PURE__ */ new Map(), u = [];
2235
2235
  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);
2236
2236
  let d = /* @__PURE__ */ new Map(), f = (e, t) => {
2237
2237
  if (t.has(e.id)) return 0;
@@ -2283,19 +2283,19 @@ function vt(e, { size: t = "medium", horizontal: n = !1 } = {}) {
2283
2283
  horizontal: n
2284
2284
  };
2285
2285
  }
2286
- var yt = (e, t) => {
2286
+ var xt = (e, t) => {
2287
2287
  let n = String(e ?? "");
2288
2288
  return n.length > t ? `${n.slice(0, t - 1)}…` : n;
2289
- }, bt = (e) => {
2289
+ }, St = (e) => {
2290
2290
  let t = /^#([0-9a-f]{6}|[0-9a-f]{3})$/i.exec(String(e ?? "").trim());
2291
2291
  if (!t) return "#ffffff";
2292
2292
  let n = t[1];
2293
2293
  n.length === 3 && (n = [...n].map((e) => e + e).join(""));
2294
2294
  let r = parseInt(n, 16);
2295
2295
  return .299 * (r >> 16 & 255) + .587 * (r >> 8 & 255) + .114 * (r & 255) > 150 ? "#111827" : "#ffffff";
2296
- }, xt = (e) => !!(e?.cv?.trim?.() || e?.photo);
2297
- function St(e, t = {}) {
2298
- 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);
2296
+ }, Ct = (e) => !!(e?.cv?.trim?.() || e?.photo);
2297
+ function wt(e, t = {}) {
2298
+ let n = Array.isArray(e) ? e.filter((e) => e && typeof e == "object" && e.id) : [], r = (e) => Array.isArray(e) ? e[0] : e, i = (e) => e == null ? "" : K(e);
2299
2299
  return n.map((e) => {
2300
2300
  let n = e.data ?? {}, a = r(n[t.parentField]), o = a && typeof a == "object" ? a.id ?? null : a || null;
2301
2301
  return {
@@ -2309,15 +2309,15 @@ function St(e, t = {}) {
2309
2309
  };
2310
2310
  });
2311
2311
  }
2312
- var Ct = {
2312
+ var Tt = {
2313
2313
  size: 36,
2314
2314
  pad: 10
2315
2315
  };
2316
- function wt({ node: e, onClose: t }) {
2316
+ function Et({ node: e, onClose: t }) {
2317
2317
  return a(() => {
2318
2318
  let e = (e) => e.key === "Escape" && t();
2319
2319
  return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
2320
- }, [t]), /* @__PURE__ */ u("div", {
2320
+ }, [t]), /* @__PURE__ */ d("div", {
2321
2321
  onClick: t,
2322
2322
  role: "dialog",
2323
2323
  "aria-modal": "true",
@@ -2332,7 +2332,7 @@ function wt({ node: e, onClose: t }) {
2332
2332
  justifyContent: "center",
2333
2333
  padding: 16
2334
2334
  },
2335
- children: /* @__PURE__ */ d("div", {
2335
+ children: /* @__PURE__ */ f("div", {
2336
2336
  onClick: (e) => e.stopPropagation(),
2337
2337
  style: {
2338
2338
  background: "var(--page-bg, #ffffff)",
@@ -2347,7 +2347,7 @@ function wt({ node: e, onClose: t }) {
2347
2347
  boxShadow: "0 24px 64px rgba(15, 23, 42, 0.35)"
2348
2348
  },
2349
2349
  children: [
2350
- /* @__PURE__ */ u("button", {
2350
+ /* @__PURE__ */ d("button", {
2351
2351
  type: "button",
2352
2352
  "aria-label": "Close",
2353
2353
  onClick: t,
@@ -2368,14 +2368,14 @@ function wt({ node: e, onClose: t }) {
2368
2368
  },
2369
2369
  children: "×"
2370
2370
  }),
2371
- /* @__PURE__ */ d("div", {
2371
+ /* @__PURE__ */ f("div", {
2372
2372
  style: {
2373
2373
  display: "flex",
2374
2374
  alignItems: "center",
2375
2375
  gap: 14,
2376
2376
  marginBottom: e.cv ? 14 : 0
2377
2377
  },
2378
- children: [e.photo && /* @__PURE__ */ u("img", {
2378
+ children: [e.photo && /* @__PURE__ */ d("img", {
2379
2379
  src: e.photo,
2380
2380
  alt: "",
2381
2381
  style: {
@@ -2385,15 +2385,15 @@ function wt({ node: e, onClose: t }) {
2385
2385
  objectFit: "cover",
2386
2386
  flexShrink: 0
2387
2387
  }
2388
- }), /* @__PURE__ */ d("div", {
2388
+ }), /* @__PURE__ */ f("div", {
2389
2389
  style: { minWidth: 0 },
2390
- children: [/* @__PURE__ */ u("div", {
2390
+ children: [/* @__PURE__ */ d("div", {
2391
2391
  style: {
2392
2392
  fontSize: 18,
2393
2393
  fontWeight: 700
2394
2394
  },
2395
2395
  children: e.name
2396
- }), e.title && /* @__PURE__ */ u("div", {
2396
+ }), e.title && /* @__PURE__ */ d("div", {
2397
2397
  style: {
2398
2398
  fontSize: 13,
2399
2399
  opacity: .65
@@ -2402,7 +2402,7 @@ function wt({ node: e, onClose: t }) {
2402
2402
  })]
2403
2403
  })]
2404
2404
  }),
2405
- e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ u("p", {
2405
+ e.cv && String(e.cv).split(/\n+/).map((e, t) => /* @__PURE__ */ d("p", {
2406
2406
  style: {
2407
2407
  fontSize: 14,
2408
2408
  lineHeight: 1.6,
@@ -2410,7 +2410,7 @@ function wt({ node: e, onClose: t }) {
2410
2410
  },
2411
2411
  children: e
2412
2412
  }, t)),
2413
- e.href && /* @__PURE__ */ u("a", {
2413
+ e.href && /* @__PURE__ */ d("a", {
2414
2414
  href: e.href,
2415
2415
  target: "_blank",
2416
2416
  rel: "noopener noreferrer",
@@ -2431,8 +2431,8 @@ function wt({ node: e, onClose: t }) {
2431
2431
  })
2432
2432
  });
2433
2433
  }
2434
- function Tt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: f, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
2435
- let b = o(), [x, C] = c(null), { tenant: w, apiUrl: T } = i(U), E = i(W)?.[t], [D, O] = c(null);
2434
+ function Dt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField: s, parentField: c, cvField: p, hrefField: m, size: h = "medium", horizontal: g = !1, style: _, nodeRef: v, interactive: y = !0 }) {
2435
+ let b = o(), [x, S] = l(null), { tenant: w, apiUrl: T } = i(H), E = i(U)?.[t], [D, O] = l(null);
2436
2436
  a(() => {
2437
2437
  if (!t || E) return;
2438
2438
  let e = !0;
@@ -2448,18 +2448,18 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
2448
2448
  T,
2449
2449
  E
2450
2450
  ]);
2451
- let k = t ? St(E ?? D ?? [], {
2451
+ let k = t ? wt(E ?? D ?? [], {
2452
2452
  nameField: n,
2453
2453
  titleField: r,
2454
2454
  photoField: s,
2455
- parentField: f,
2455
+ parentField: c,
2456
2456
  cvField: p,
2457
2457
  hrefField: m
2458
- }) : e, A = _t(h), { boxes: j, links: M, width: N, height: P } = vt(k, {
2458
+ }) : e, A = yt(h), { boxes: j, links: M, width: N, height: P } = bt(k, {
2459
2459
  size: h,
2460
2460
  horizontal: g
2461
2461
  });
2462
- if (!j.length) return !y && t ? /* @__PURE__ */ d("div", {
2462
+ if (!j.length) return !y && t ? /* @__PURE__ */ f("div", {
2463
2463
  ref: v,
2464
2464
  style: {
2465
2465
  padding: 18,
@@ -2468,7 +2468,7 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
2468
2468
  fontSize: 13,
2469
2469
  opacity: .7,
2470
2470
  textAlign: "center",
2471
- ...S(_)
2471
+ ...C(_)
2472
2472
  },
2473
2473
  children: [
2474
2474
  "Org Chart — no published entries in “",
@@ -2477,14 +2477,14 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
2477
2477
  ]
2478
2478
  }) : null;
2479
2479
  let F = new Set(j.filter((e) => e.node.parent == null || e.node.parent === "").map((e) => e.node.id));
2480
- return /* @__PURE__ */ d("div", {
2480
+ return /* @__PURE__ */ f("div", {
2481
2481
  ref: v,
2482
2482
  style: {
2483
2483
  maxWidth: "100%",
2484
2484
  overflowX: "auto",
2485
- ...S(_)
2485
+ ...C(_)
2486
2486
  },
2487
- children: [/* @__PURE__ */ d("svg", {
2487
+ children: [/* @__PURE__ */ f("svg", {
2488
2488
  viewBox: `0 0 ${N} ${P}`,
2489
2489
  role: "img",
2490
2490
  "aria-label": "Organization chart",
@@ -2495,64 +2495,64 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
2495
2495
  height: "auto",
2496
2496
  margin: "0 auto"
2497
2497
  },
2498
- children: [M.map((e, t) => /* @__PURE__ */ u("path", {
2498
+ children: [M.map((e, t) => /* @__PURE__ */ d("path", {
2499
2499
  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}`,
2500
2500
  fill: "none",
2501
2501
  stroke: "rgba(148, 163, 184, 0.7)",
2502
2502
  strokeWidth: "1.5"
2503
2503
  }, t)), j.map(({ node: e, x: t, y: n }) => {
2504
- 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)", c = 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);
2505
- return /* @__PURE__ */ d("g", {
2506
- onClick: f ? p : void 0,
2507
- style: f ? { cursor: "pointer" } : void 0,
2508
- role: f ? "button" : void 0,
2509
- "aria-label": f ? `Open ${e.name || e.title}'s profile` : void 0,
2504
+ let r = F.has(e.id), i = !!e.color2, a = !!e.color || r || i, o = e.color || (r ? "var(--page-accent, #4f46e5)" : "var(--page-bg, #ffffff)"), s = e.color ? St(e.color) : r ? "var(--page-accent-text, #ffffff)" : "var(--page-text, #111827)", c = i ? St(e.color2) : s, l = y && (Ct(e) || e.href), p = () => Ct(e) ? S(e) : window.open(e.href, "_blank", "noreferrer"), m = e.photo ? t + Tt.pad + A.avatar + 8 : t + A.w / 2, h = e.photo ? "start" : "middle", g = e.photo ? Math.floor((A.w - A.avatar - 26) / 7) : Math.floor(A.w / 7.6), _ = A.h / 2, v = [e.name, e.title].map((e) => String(e ?? "").trim()).filter(Boolean);
2505
+ return /* @__PURE__ */ f("g", {
2506
+ onClick: l ? p : void 0,
2507
+ style: l ? { cursor: "pointer" } : void 0,
2508
+ role: l ? "button" : void 0,
2509
+ "aria-label": l ? `Open ${e.name || e.title}'s profile` : void 0,
2510
2510
  children: [
2511
- i && e.gradient ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d("linearGradient", {
2511
+ i && e.gradient ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ f("linearGradient", {
2512
2512
  id: `${b}-${e.id}-grad`,
2513
2513
  x1: "0",
2514
2514
  y1: "0",
2515
2515
  x2: "0",
2516
2516
  y2: "1",
2517
- children: [/* @__PURE__ */ u("stop", {
2517
+ children: [/* @__PURE__ */ d("stop", {
2518
2518
  offset: "0%",
2519
2519
  stopColor: e.color || "var(--page-accent, #4f46e5)"
2520
- }), /* @__PURE__ */ u("stop", {
2520
+ }), /* @__PURE__ */ d("stop", {
2521
2521
  offset: "100%",
2522
2522
  stopColor: e.color2
2523
2523
  })]
2524
- }), /* @__PURE__ */ u("rect", {
2524
+ }), /* @__PURE__ */ d("rect", {
2525
2525
  x: t,
2526
2526
  y: n,
2527
2527
  width: A.w,
2528
2528
  height: A.h,
2529
2529
  rx: "10",
2530
2530
  fill: `url(#${b}-${e.id}-grad)`
2531
- })] }) : i ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
2531
+ })] }) : i ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
2532
2532
  id: `${b}-${e.id}-box`,
2533
- children: /* @__PURE__ */ u("rect", {
2533
+ children: /* @__PURE__ */ d("rect", {
2534
2534
  x: t,
2535
2535
  y: n,
2536
2536
  width: A.w,
2537
2537
  height: A.h,
2538
2538
  rx: "10"
2539
2539
  })
2540
- }), /* @__PURE__ */ d("g", {
2540
+ }), /* @__PURE__ */ f("g", {
2541
2541
  clipPath: `url(#${b}-${e.id}-box)`,
2542
- children: [/* @__PURE__ */ u("rect", {
2542
+ children: [/* @__PURE__ */ d("rect", {
2543
2543
  x: t,
2544
2544
  y: n,
2545
2545
  width: A.w,
2546
2546
  height: _,
2547
2547
  fill: o
2548
- }), /* @__PURE__ */ u("rect", {
2548
+ }), /* @__PURE__ */ d("rect", {
2549
2549
  x: t,
2550
2550
  y: n + _,
2551
2551
  width: A.w,
2552
2552
  height: A.h - _,
2553
2553
  fill: e.color2
2554
2554
  })]
2555
- })] }) : /* @__PURE__ */ u("rect", {
2555
+ })] }) : /* @__PURE__ */ d("rect", {
2556
2556
  x: t,
2557
2557
  y: n,
2558
2558
  width: A.w,
@@ -2562,66 +2562,66 @@ function Tt({ nodes: e = [], source: t, nameField: n, titleField: r, photoField:
2562
2562
  stroke: a ? "none" : "var(--page-accent, #4f46e5)",
2563
2563
  strokeWidth: a ? 0 : 1.5
2564
2564
  }),
2565
- e.photo && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("clipPath", {
2565
+ e.photo && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("clipPath", {
2566
2566
  id: `${b}-${e.id}`,
2567
- children: /* @__PURE__ */ u("circle", {
2568
- cx: t + Ct.pad + A.avatar / 2,
2567
+ children: /* @__PURE__ */ d("circle", {
2568
+ cx: t + Tt.pad + A.avatar / 2,
2569
2569
  cy: n + A.h / 2,
2570
2570
  r: A.avatar / 2
2571
2571
  })
2572
- }), /* @__PURE__ */ u("image", {
2572
+ }), /* @__PURE__ */ d("image", {
2573
2573
  href: e.photo,
2574
- x: t + Ct.pad,
2574
+ x: t + Tt.pad,
2575
2575
  y: n + (A.h - A.avatar) / 2,
2576
2576
  width: A.avatar,
2577
2577
  height: A.avatar,
2578
2578
  preserveAspectRatio: "xMidYMid slice",
2579
2579
  clipPath: `url(#${b}-${e.id})`
2580
2580
  })] }),
2581
- i && !e.gradient ? /* @__PURE__ */ d(l, { children: [e.title && /* @__PURE__ */ u("text", {
2581
+ i && !e.gradient ? /* @__PURE__ */ f(u, { children: [e.title && /* @__PURE__ */ d("text", {
2582
2582
  x: m,
2583
2583
  y: n + _ / 2 + A.title * .35,
2584
2584
  textAnchor: h,
2585
2585
  fontSize: A.title,
2586
2586
  fontWeight: "600",
2587
2587
  fill: s,
2588
- children: yt(e.title, g + 4)
2589
- }), e.name && /* @__PURE__ */ u("text", {
2588
+ children: xt(e.title, g + 4)
2589
+ }), e.name && /* @__PURE__ */ d("text", {
2590
2590
  x: m,
2591
2591
  y: n + _ + _ / 2 + A.name * .35,
2592
2592
  textAnchor: h,
2593
2593
  fontSize: A.name,
2594
2594
  fontWeight: "600",
2595
2595
  fill: c,
2596
- children: yt(e.name, g)
2597
- })] }) : /* @__PURE__ */ d(l, { children: [v[0] && /* @__PURE__ */ u("text", {
2596
+ children: xt(e.name, g)
2597
+ })] }) : /* @__PURE__ */ f(u, { children: [v[0] && /* @__PURE__ */ d("text", {
2598
2598
  x: m,
2599
2599
  y: n + (v[1] ? A.h * .43 : A.h * .57),
2600
2600
  textAnchor: h,
2601
2601
  fontSize: A.name,
2602
2602
  fontWeight: "600",
2603
2603
  fill: s,
2604
- children: yt(v[0], g)
2605
- }), v[1] && /* @__PURE__ */ u("text", {
2604
+ children: xt(v[0], g)
2605
+ }), v[1] && /* @__PURE__ */ d("text", {
2606
2606
  x: m,
2607
2607
  y: n + A.h * .73,
2608
2608
  textAnchor: h,
2609
2609
  fontSize: A.title,
2610
2610
  opacity: "0.7",
2611
2611
  fill: s,
2612
- children: yt(v[1], g + 4)
2612
+ children: xt(v[1], g + 4)
2613
2613
  })] })
2614
2614
  ]
2615
2615
  }, e.id);
2616
2616
  })]
2617
- }), x && /* @__PURE__ */ u(wt, {
2617
+ }), x && /* @__PURE__ */ d(Et, {
2618
2618
  node: x,
2619
- onClose: () => C(null)
2619
+ onClose: () => S(null)
2620
2620
  })]
2621
2621
  });
2622
2622
  }
2623
- function Et({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: l = !1, style: f, nodeRef: p }) {
2624
- let { tenant: m, apiUrl: h } = i(U), g = i(W)?.[n], [_, v] = c(null);
2623
+ function Ot({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped: o = !0, bordered: s = !1, compact: c = !1, style: u, nodeRef: p }) {
2624
+ let { tenant: m, apiUrl: h } = i(H), g = i(U)?.[n], [_, v] = l(null);
2625
2625
  if (a(() => {
2626
2626
  if (!n || g) return;
2627
2627
  let e = !0, t = n.startsWith("api:") ? `${h}/data/${encodeURIComponent(n.slice(4))}` : `${h}/dynamic/${encodeURIComponent(n)}`;
@@ -2634,22 +2634,22 @@ function Et({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
2634
2634
  h,
2635
2635
  g
2636
2636
  ]), !e.length) return null;
2637
- let y = n ? (g ?? _ ?? []).slice(0, Math.max(1, Number(r) || 10)) : null, b = y ? y.map((t) => e.map((e) => q(K(t?.data, e.field)))) : t, x = l ? "6px 10px" : "10px 14px", C = "1px solid rgba(148, 163, 184, 0.35)", w = s ? { border: C } : { borderBottom: C };
2638
- return /* @__PURE__ */ u("div", {
2637
+ let y = n ? (g ?? _ ?? []).slice(0, Math.max(1, Number(r) || 10)) : null, b = y ? y.map((t) => e.map((e) => K(G(t?.data, e.field)))) : t, x = c ? "6px 10px" : "10px 14px", S = "1px solid rgba(148, 163, 184, 0.35)", w = s ? { border: S } : { borderBottom: S };
2638
+ return /* @__PURE__ */ d("div", {
2639
2639
  ref: p,
2640
2640
  style: {
2641
2641
  width: "100%",
2642
2642
  overflowX: "auto",
2643
- ...S(f)
2643
+ ...C(u)
2644
2644
  },
2645
- children: /* @__PURE__ */ d("table", {
2645
+ children: /* @__PURE__ */ f("table", {
2646
2646
  style: {
2647
2647
  width: "100%",
2648
2648
  borderCollapse: "collapse",
2649
2649
  fontSize: 14,
2650
- ...s ? { border: C } : {}
2650
+ ...s ? { border: S } : {}
2651
2651
  },
2652
- children: [/* @__PURE__ */ u("thead", { children: /* @__PURE__ */ u("tr", { children: e.map((e, t) => /* @__PURE__ */ u("th", {
2652
+ children: [/* @__PURE__ */ d("thead", { children: /* @__PURE__ */ d("tr", { children: e.map((e, t) => /* @__PURE__ */ d("th", {
2653
2653
  style: {
2654
2654
  textAlign: "left",
2655
2655
  fontWeight: 600,
@@ -2658,9 +2658,9 @@ function Et({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
2658
2658
  ...w
2659
2659
  },
2660
2660
  children: e.label ?? e
2661
- }, t)) }) }), /* @__PURE__ */ u("tbody", { children: b.map((t, n) => /* @__PURE__ */ u("tr", {
2661
+ }, t)) }) }), /* @__PURE__ */ d("tbody", { children: b.map((t, n) => /* @__PURE__ */ d("tr", {
2662
2662
  style: o && n % 2 == 1 ? { background: "rgba(148, 163, 184, 0.07)" } : void 0,
2663
- children: e.map((e, n) => /* @__PURE__ */ u("td", {
2663
+ children: e.map((e, n) => /* @__PURE__ */ d("td", {
2664
2664
  style: {
2665
2665
  padding: x,
2666
2666
  ...w
@@ -2671,68 +2671,74 @@ function Et({ columns: e = [], rows: t = [], source: n, limit: r = 10, striped:
2671
2671
  })
2672
2672
  });
2673
2673
  }
2674
- var Dt = {
2675
- PageRoot: fe,
2676
- Section: pe,
2677
- Container: me,
2678
- Heading: he,
2679
- TextBlock: Ee,
2680
- ButtonBlock: ke,
2681
- ImageBlock: Ae,
2682
- Spacer: Ie,
2683
- Divider: Le,
2684
- SliderBlock: Ue,
2685
- CanvasSlider: We,
2686
- TabsBlock: Je,
2687
- QuickStack: dt,
2688
- CollectionList: ft,
2689
- BreadcrumbsBlock: pt,
2690
- PaginationBlock: mt,
2691
- StepperBlock: ht,
2692
- OrgChartBlock: Tt,
2693
- TableBlock: Et,
2694
- AccordionBlock: Ye,
2695
- NavbarBlock: qe,
2696
- ListBlock: Te,
2697
- TextSpan: ve,
2698
- QuoteBlock: we,
2699
- TextLink: Oe,
2700
- RichTextBlock: Se,
2701
- RichContentBlock: Se,
2702
- VideoBlock: je,
2703
- YouTubeBlock: Ne,
2704
- IframeBlock: Pe,
2705
- EmbedBlock: Fe,
2706
- FormBlock: rt,
2707
- FormLabel: it,
2708
- FormInput: at,
2709
- FormTextarea: ot,
2710
- FormCheckbox: (e) => /* @__PURE__ */ u(st, {
2674
+ var kt = {
2675
+ PageRoot: me,
2676
+ Section: he,
2677
+ Container: ge,
2678
+ Heading: _e,
2679
+ TextBlock: Oe,
2680
+ ButtonBlock: je,
2681
+ ImageBlock: Me,
2682
+ Spacer: Re,
2683
+ Divider: ze,
2684
+ SliderBlock: Ge,
2685
+ CanvasSlider: Ke,
2686
+ TabsBlock: Xe,
2687
+ QuickStack: pt,
2688
+ CollectionList: mt,
2689
+ BreadcrumbsBlock: ht,
2690
+ PaginationBlock: gt,
2691
+ StepperBlock: _t,
2692
+ OrgChartBlock: Dt,
2693
+ TableBlock: Ot,
2694
+ AccordionBlock: Ze,
2695
+ NavbarBlock: Ye,
2696
+ ListBlock: De,
2697
+ TextSpan: be,
2698
+ QuoteBlock: Ee,
2699
+ TextLink: Ae,
2700
+ RichTextBlock: we,
2701
+ RichContentBlock: we,
2702
+ VideoBlock: Ne,
2703
+ YouTubeBlock: Fe,
2704
+ IframeBlock: Ie,
2705
+ EmbedBlock: Le,
2706
+ FormBlock: at,
2707
+ FormLabel: ot,
2708
+ FormInput: st,
2709
+ FormTextarea: ct,
2710
+ FormCheckbox: (e) => /* @__PURE__ */ d(lt, {
2711
2711
  kind: "checkbox",
2712
2712
  ...e
2713
2713
  }),
2714
- FormRadio: (e) => /* @__PURE__ */ u(st, {
2714
+ FormRadio: (e) => /* @__PURE__ */ d(lt, {
2715
2715
  kind: "radio",
2716
2716
  ...e
2717
2717
  }),
2718
- FormSelect: ct,
2719
- FormFile: lt,
2720
- FormSubmit: ut
2721
- }, Ot = {
2718
+ FormSelect: ut,
2719
+ FormFile: dt,
2720
+ FormSubmit: ft
2721
+ }, At = {
2722
2722
  id: "auth",
2723
2723
  label: "Accounts",
2724
2724
  category: "Apps",
2725
2725
  keys: ["SiteLoginForm", "SiteAccountMenu"],
2726
2726
  ssr: "shell",
2727
2727
  settings: ["apps.auth.redirect"]
2728
- }, kt = n({
2728
+ }, jt = n({
2729
2729
  user: null,
2730
- status: "loading",
2730
+ status: "idle",
2731
+ ensure: () => {},
2731
2732
  refresh: () => {},
2732
2733
  signOut: () => {}
2733
- }), At = () => i(kt);
2734
- function jt({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: l }) {
2735
- let d = i(U), f = o || d?.apiUrl || "/api", p = l || d?.tenant || "", [m, h] = c(t ?? null), [g, _] = c(t ? "user" : n ? "guest" : "loading"), v = r((e, t) => fetch(`${f}${e}`, {
2734
+ }), Mt = () => {
2735
+ let e = i(jt);
2736
+ return a(() => {
2737
+ e.ensure();
2738
+ }, [e]), e;
2739
+ };
2740
+ function Nt({ children: e, initialUser: t, disabled: n, apiUrl: a, tenant: o }) {
2741
+ let u = i(H), f = a || u?.apiUrl || "/api", p = o || u?.tenant || "", [m, h] = l(t ?? null), [g, _] = l(t ? "user" : n ? "guest" : "idle"), v = c(!1), y = r((e, t) => fetch(`${f}${e}`, {
2736
2742
  ...t,
2737
2743
  credentials: "include",
2738
2744
  headers: {
@@ -2740,44 +2746,44 @@ function jt({ children: e, initialUser: t, disabled: n, apiUrl: o, tenant: l })
2740
2746
  ...p ? { "x-tenant": p } : {},
2741
2747
  ...t?.headers
2742
2748
  }
2743
- }), [f, p]), y = r(() => n ? Promise.resolve(null) : v("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
2749
+ }), [f, p]), b = r(() => n ? Promise.resolve(null) : y("/site/me").then((e) => e.ok ? e.json() : null).then((e) => {
2744
2750
  let t = e?.payload ?? null;
2745
2751
  return h(t), _(t ? "user" : "guest"), t;
2746
- }).catch(() => (h(null), _("guest"), null)), [v, n]), b = r(() => v("/site/logout", { method: "post" }).catch(() => {}).then(() => {
2752
+ }).catch(() => (h(null), _("guest"), null)), [y, n]), x = r(() => y("/site/logout", { method: "post" }).catch(() => {}).then(() => {
2747
2753
  h(null), _("guest");
2748
- }), [v]);
2749
- a(() => {
2750
- n || t || y();
2754
+ }), [y]), S = r(() => {
2755
+ v.current || n || t || (v.current = !0, _("loading"), b());
2751
2756
  }, [
2752
2757
  n,
2753
2758
  t,
2754
- y
2755
- ]);
2756
- let x = s(() => ({
2759
+ b
2760
+ ]), C = s(() => ({
2757
2761
  user: m,
2758
2762
  status: g,
2759
- refresh: y,
2760
- signOut: b
2763
+ ensure: S,
2764
+ refresh: b,
2765
+ signOut: x
2761
2766
  }), [
2762
2767
  m,
2763
2768
  g,
2764
- y,
2765
- b
2769
+ S,
2770
+ b,
2771
+ x
2766
2772
  ]);
2767
- return /* @__PURE__ */ u(kt.Provider, {
2768
- value: x,
2773
+ return /* @__PURE__ */ d(jt.Provider, {
2774
+ value: C,
2769
2775
  children: e
2770
2776
  });
2771
2777
  }
2772
- function Mt({ when: e, children: t }) {
2773
- let { status: n } = At();
2774
- return !e || e === "always" ? t : n === "loading" ? null : e === "user" == (n === "user") ? t : null;
2778
+ function Pt({ when: e, children: t }) {
2779
+ let { status: n } = Mt();
2780
+ return !e || e === "always" ? t : n === "idle" || n === "loading" ? null : e === "user" == (n === "user") ? t : null;
2775
2781
  }
2776
2782
  //#endregion
2777
2783
  //#region ../ui/src/components/builder/apps/auth/views.jsx
2778
- function Nt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: l, inert: f, linked: p, show: m }) {
2779
- let { tenant: h, apiUrl: g, settings: _ } = i(U), [v, y] = c("form"), [b, x] = c(""), [C, w] = c(!1), T = e === "register", E = f ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
2780
- if (e.preventDefault(), f) return;
2784
+ function Ft({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordLabel: r = "Password", nameLabel: a = "Name", submitLabel: o, style: s, nodeRef: c, inert: u, linked: p, show: m }) {
2785
+ let { tenant: h, apiUrl: g, settings: _ } = i(H), [v, y] = l("form"), [b, x] = l(""), [S, w] = l(!1), T = e === "register", E = u ? m || "form" : v, D = (e) => typeof e == "string" && e.startsWith("/") && !e.startsWith("//") ? e : "", O = async (e) => {
2786
+ if (e.preventDefault(), u) return;
2781
2787
  let n = new FormData(e.currentTarget);
2782
2788
  w(!0), x("");
2783
2789
  try {
@@ -2806,79 +2812,79 @@ function Nt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
2806
2812
  x("Sign-in failed"), y("error"), w(!1);
2807
2813
  }
2808
2814
  };
2809
- return /* @__PURE__ */ d("div", {
2810
- ref: l,
2815
+ return /* @__PURE__ */ f("div", {
2816
+ ref: c,
2811
2817
  style: {
2812
2818
  display: "grid",
2813
2819
  gap: 12,
2814
2820
  maxWidth: 360,
2815
- ...S(s)
2821
+ ...C(s)
2816
2822
  },
2817
2823
  children: [
2818
- /* @__PURE__ */ d("form", {
2824
+ /* @__PURE__ */ f("form", {
2819
2825
  onSubmit: O,
2820
2826
  style: {
2821
2827
  display: E === "form" ? "grid" : "none",
2822
2828
  gap: 10
2823
2829
  },
2824
2830
  children: [
2825
- T ? /* @__PURE__ */ d("label", {
2831
+ T ? /* @__PURE__ */ f("label", {
2826
2832
  style: {
2827
- ...X,
2833
+ ...Y,
2828
2834
  display: "grid",
2829
2835
  gap: 6
2830
2836
  },
2831
- children: [a, /* @__PURE__ */ u("input", {
2837
+ children: [a, /* @__PURE__ */ d("input", {
2832
2838
  name: "name",
2833
2839
  type: "text",
2834
- style: Z,
2835
- ...Q(f)
2840
+ style: X,
2841
+ ...Z(u)
2836
2842
  })]
2837
2843
  }) : null,
2838
- /* @__PURE__ */ d("label", {
2844
+ /* @__PURE__ */ f("label", {
2839
2845
  style: {
2840
- ...X,
2846
+ ...Y,
2841
2847
  display: "grid",
2842
2848
  gap: 6
2843
2849
  },
2844
- children: [n, /* @__PURE__ */ u("input", {
2850
+ children: [n, /* @__PURE__ */ d("input", {
2845
2851
  name: "email",
2846
2852
  type: "email",
2847
- required: !f,
2848
- style: Z,
2849
- ...Q(f)
2853
+ required: !u,
2854
+ style: X,
2855
+ ...Z(u)
2850
2856
  })]
2851
2857
  }),
2852
- /* @__PURE__ */ d("label", {
2858
+ /* @__PURE__ */ f("label", {
2853
2859
  style: {
2854
- ...X,
2860
+ ...Y,
2855
2861
  display: "grid",
2856
2862
  gap: 6
2857
2863
  },
2858
- children: [r, /* @__PURE__ */ u("input", {
2864
+ children: [r, /* @__PURE__ */ d("input", {
2859
2865
  name: "password",
2860
2866
  type: "password",
2861
- required: !f,
2862
- style: Z,
2863
- ...Q(f)
2867
+ required: !u,
2868
+ style: X,
2869
+ ...Z(u)
2864
2870
  })]
2865
2871
  }),
2866
- /* @__PURE__ */ u("button", {
2867
- type: f ? "button" : "submit",
2868
- disabled: C || void 0,
2872
+ /* @__PURE__ */ d("button", {
2873
+ type: u ? "button" : "submit",
2874
+ disabled: S || void 0,
2869
2875
  style: {
2870
- ...J,
2876
+ ...q,
2871
2877
  border: 0,
2872
2878
  padding: "10px 22px",
2873
2879
  borderRadius: 8,
2874
2880
  fontSize: 15,
2875
2881
  fontWeight: 600,
2876
2882
  cursor: "pointer",
2877
- opacity: C ? .6 : 1
2883
+ opacity: S ? .6 : 1
2878
2884
  },
2879
2885
  children: o || (T ? "Create account" : "Sign in")
2880
2886
  }),
2881
- b ? /* @__PURE__ */ u("p", {
2887
+ b ? /* @__PURE__ */ d("p", {
2882
2888
  style: {
2883
2889
  margin: 0,
2884
2890
  fontSize: 14,
@@ -2888,40 +2894,40 @@ function Nt({ mode: e = "login", redirect: t, emailLabel: n = "Email", passwordL
2888
2894
  }) : null
2889
2895
  ]
2890
2896
  }),
2891
- /* @__PURE__ */ u("div", {
2897
+ /* @__PURE__ */ d("div", {
2892
2898
  style: { display: E === "success" ? "block" : "none" },
2893
2899
  children: p?.success ?? null
2894
2900
  }),
2895
- /* @__PURE__ */ u("div", {
2901
+ /* @__PURE__ */ d("div", {
2896
2902
  style: { display: E === "error" ? "block" : "none" },
2897
2903
  children: p?.error ?? null
2898
2904
  })
2899
2905
  ]
2900
2906
  });
2901
2907
  }
2902
- function Pt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
2903
- let { user: c, status: l, signOut: f } = At(), p = a ? s || "user" : l, m = a ? {
2908
+ function It({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !1, style: r, nodeRef: i, inert: a, linked: o, show: s }) {
2909
+ let { user: c, status: l, signOut: u } = Mt(), p = a ? s || "user" : l, m = a ? {
2904
2910
  name: "Ada Lovelace",
2905
2911
  email: "ada@example.com"
2906
2912
  } : c;
2907
- return p === "loading" ? /* @__PURE__ */ u("div", {
2913
+ return p === "loading" ? /* @__PURE__ */ d("div", {
2908
2914
  ref: i,
2909
2915
  style: {
2910
2916
  minHeight: 24,
2911
- ...S(r)
2917
+ ...C(r)
2912
2918
  }
2913
- }) : p === "user" ? /* @__PURE__ */ d("div", {
2919
+ }) : p === "user" ? /* @__PURE__ */ f("div", {
2914
2920
  ref: i,
2915
2921
  style: {
2916
2922
  display: "flex",
2917
2923
  alignItems: "center",
2918
2924
  gap: 10,
2919
- ...S(r)
2925
+ ...C(r)
2920
2926
  },
2921
2927
  children: [
2922
- /* @__PURE__ */ d("span", {
2928
+ /* @__PURE__ */ f("span", {
2923
2929
  style: {
2924
- ...X,
2930
+ ...Y,
2925
2931
  fontWeight: 600
2926
2932
  },
2927
2933
  children: [
@@ -2930,53 +2936,53 @@ function Pt({ greeting: e = "Hi", signOutLabel: t = "Sign out", showEmail: n = !
2930
2936
  m?.name || m?.email || ""
2931
2937
  ]
2932
2938
  }),
2933
- n && m?.email ? /* @__PURE__ */ u("span", {
2939
+ n && m?.email ? /* @__PURE__ */ d("span", {
2934
2940
  style: {
2935
- ...X,
2941
+ ...Y,
2936
2942
  opacity: .7
2937
2943
  },
2938
2944
  children: m.email
2939
2945
  }) : null,
2940
- /* @__PURE__ */ u("button", {
2946
+ /* @__PURE__ */ d("button", {
2941
2947
  type: "button",
2942
- onClick: a ? void 0 : f,
2948
+ onClick: a ? void 0 : u,
2943
2949
  style: {
2944
- ...J,
2950
+ ...q,
2945
2951
  border: 0,
2946
2952
  padding: "8px 16px",
2947
2953
  borderRadius: 8,
2948
2954
  fontSize: 14,
2949
2955
  cursor: a ? "default" : "pointer"
2950
2956
  },
2951
- ...Q(a),
2957
+ ...Z(a),
2952
2958
  children: t
2953
2959
  })
2954
2960
  ]
2955
- }) : /* @__PURE__ */ u("div", {
2961
+ }) : /* @__PURE__ */ d("div", {
2956
2962
  ref: i,
2957
2963
  style: {
2958
2964
  display: "flex",
2959
2965
  alignItems: "center",
2960
2966
  gap: 10,
2961
- ...S(r)
2967
+ ...C(r)
2962
2968
  },
2963
2969
  children: o?.signedOut ?? null
2964
2970
  });
2965
2971
  }
2966
2972
  //#endregion
2967
2973
  //#region ../ui/src/components/builder/apps/index.js
2968
- var Ft = [Ot], It = {
2969
- SiteLoginForm: Nt,
2970
- SiteAccountMenu: Pt
2974
+ var Lt = [At], Rt = {
2975
+ SiteLoginForm: Ft,
2976
+ SiteAccountMenu: It
2971
2977
  };
2972
- new Set(Ft.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
2978
+ new Set(Lt.filter((e) => e.ssr === "shell").flatMap((e) => e.keys));
2973
2979
  //#endregion
2974
2980
  //#region ../ui/src/components/builder/render.jsx
2975
- var Lt = {
2976
- ...Dt,
2977
- ...It
2981
+ var zt = {
2982
+ ...kt,
2983
+ ...Rt
2978
2984
  };
2979
- function $(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2985
+ function Q(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2980
2986
  let o = n[e];
2981
2987
  if (!o || o.hidden) return null;
2982
2988
  let s = o.type?.resolvedName, c = a?.mapProps ? a.mapProps(o.props ?? {}, s) : o.props ?? {};
@@ -2984,28 +2990,28 @@ function $(e, n, r, i = /* @__PURE__ */ new Set(), a = void 0) {
2984
2990
  let n = o.props?.componentId, s = r?.[n];
2985
2991
  if (!s?.template || i.has(n)) return null;
2986
2992
  let c = new Set(i).add(n);
2987
- return /* @__PURE__ */ u(t, { children: $(s.template.rootId, s.template.nodes, r, c, a) }, e);
2993
+ return /* @__PURE__ */ d(t, { children: Q(s.template.rootId, s.template.nodes, r, c, a) }, e);
2988
2994
  }
2989
- let l = Lt[s];
2995
+ let l = zt[s];
2990
2996
  if (!l) return null;
2991
- let d = (o.nodes ?? []).map((e) => $(e, n, r, i, a)).filter(Boolean), f = Object.entries(o.linkedNodes ?? {}), p = f.length ? Object.fromEntries(f.map(([e, t]) => [e, $(t, n, r, i)])) : void 0, m = /* @__PURE__ */ u(l, {
2997
+ let u = (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, m = /* @__PURE__ */ d(l, {
2992
2998
  ...c,
2993
2999
  ...s === "CollectionList" ? { templateId: o.linkedNodes?.card } : null,
2994
3000
  linked: p,
2995
3001
  nodeRef: (t) => {
2996
- t && (t.setAttribute("data-wb", e), E(t, c));
3002
+ t && (t.setAttribute("data-wb", e), D(t, c));
2997
3003
  },
2998
- children: d.length ? d : void 0
3004
+ children: u.length ? u : void 0
2999
3005
  }, e);
3000
- return c.when && c.when !== "always" ? /* @__PURE__ */ u(Mt, {
3006
+ return c.when && c.when !== "always" ? /* @__PURE__ */ d(Pt, {
3001
3007
  when: c.when,
3002
3008
  children: m
3003
3009
  }, e) : m;
3004
3010
  }
3005
3011
  //#endregion
3006
3012
  //#region ../ui/src/components/builder/PageRenderer.jsx
3007
- var Rt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
3008
- function zt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, tenant: c, apiUrl: l, datasets: f, locale: p, direction: h, settings: _, siteUser: y }) {
3013
+ var Bt = (e) => Object.entries(e).map(([e, t]) => `${e}: ${t};`).join(" ");
3014
+ function Vt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, custom: o, tenant: c, apiUrl: l, datasets: u, locale: p, direction: m, settings: g, siteUser: v }) {
3009
3015
  let b = o?.js?.trim();
3010
3016
  if (a(() => {
3011
3017
  if (!b) return;
@@ -3014,41 +3020,41 @@ function zt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
3014
3020
  }, [b]), !e?.ROOT) return null;
3015
3021
  let x = {
3016
3022
  lang: p || void 0,
3017
- dir: m(h, p)
3023
+ dir: h(m, p)
3018
3024
  }, S = {
3019
3025
  minHeight: "100%",
3020
3026
  display: "flex",
3021
3027
  flexDirection: "column"
3022
- }, C = $("ROOT", e, n), w = s(() => ({ render: (t, r) => $(t, e, n, void 0, { mapProps: r }) }), [e, n]), T = P(e, n), E = N(e, n), D = o?.css?.trim(), O = v(e, n).map((e) => /* @__PURE__ */ u("link", {
3028
+ }, C = Q("ROOT", e, n), w = s(() => ({ render: (t, r) => Q(t, e, n, void 0, { mapProps: r }) }), [e, n]), T = F(e, n), E = P(e, n), D = o?.css?.trim(), O = y(e, n).map((e) => /* @__PURE__ */ d("link", {
3023
3029
  rel: "stylesheet",
3024
3030
  precedence: "default",
3025
- href: g(e)
3031
+ href: _(e)
3026
3032
  }, e));
3027
- if (r !== "auto") return /* @__PURE__ */ u(U.Provider, {
3033
+ if (r !== "auto") return /* @__PURE__ */ d(H.Provider, {
3028
3034
  value: {
3029
3035
  tenant: c || "",
3030
3036
  apiUrl: l || "/api",
3031
3037
  locale: p || "",
3032
- settings: _ ?? null
3038
+ settings: g ?? null
3033
3039
  },
3034
- children: /* @__PURE__ */ u(jt, {
3035
- initialUser: y,
3036
- children: /* @__PURE__ */ u(W.Provider, {
3037
- value: f ?? null,
3038
- children: /* @__PURE__ */ u(G.Provider, {
3040
+ children: /* @__PURE__ */ d(Nt, {
3041
+ initialUser: v,
3042
+ children: /* @__PURE__ */ d(U.Provider, {
3043
+ value: u ?? null,
3044
+ children: /* @__PURE__ */ d(W.Provider, {
3039
3045
  value: w,
3040
- children: /* @__PURE__ */ d("div", {
3046
+ children: /* @__PURE__ */ f("div", {
3041
3047
  ...x,
3042
3048
  style: {
3043
3049
  ...S,
3044
- ...te(t, r),
3050
+ ...re(t, r),
3045
3051
  ...i
3046
3052
  },
3047
3053
  children: [
3048
3054
  O,
3049
- T && /* @__PURE__ */ u("style", { children: T }),
3050
- E && /* @__PURE__ */ u("style", { children: E }),
3051
- D && /* @__PURE__ */ u("style", { children: D }),
3055
+ T && /* @__PURE__ */ d("style", { children: T }),
3056
+ E && /* @__PURE__ */ d("style", { children: E }),
3057
+ D && /* @__PURE__ */ d("style", { children: D }),
3052
3058
  C
3053
3059
  ]
3054
3060
  })
@@ -3057,34 +3063,34 @@ function zt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
3057
3063
  })
3058
3064
  });
3059
3065
  let k = B(t);
3060
- return /* @__PURE__ */ u(U.Provider, {
3066
+ return /* @__PURE__ */ d(H.Provider, {
3061
3067
  value: {
3062
3068
  tenant: c || "",
3063
3069
  apiUrl: l || "/api",
3064
3070
  locale: p || "",
3065
- settings: _ ?? null
3071
+ settings: g ?? null
3066
3072
  },
3067
- children: /* @__PURE__ */ u(jt, {
3068
- initialUser: y,
3069
- children: /* @__PURE__ */ u(W.Provider, {
3070
- value: f ?? null,
3071
- children: /* @__PURE__ */ u(G.Provider, {
3073
+ children: /* @__PURE__ */ d(Nt, {
3074
+ initialUser: v,
3075
+ children: /* @__PURE__ */ d(U.Provider, {
3076
+ value: u ?? null,
3077
+ children: /* @__PURE__ */ d(W.Provider, {
3072
3078
  value: w,
3073
- children: /* @__PURE__ */ d("div", {
3079
+ children: /* @__PURE__ */ f("div", {
3074
3080
  ...x,
3075
3081
  className: "webim-page",
3076
3082
  style: {
3077
3083
  ...S,
3078
- ...H(t),
3084
+ ...ne(t),
3079
3085
  ...i
3080
3086
  },
3081
3087
  children: [
3082
- /* @__PURE__ */ u("style", { children: `.webim-page { ${Rt(V(k.light))} }
3083
- @media (prefers-color-scheme: dark) { .webim-page { ${Rt(V(k.dark))} } }` }),
3088
+ /* @__PURE__ */ d("style", { children: `.webim-page { ${Bt(V(k.light))} }
3089
+ @media (prefers-color-scheme: dark) { .webim-page { ${Bt(V(k.dark))} } }` }),
3084
3090
  O,
3085
- T && /* @__PURE__ */ u("style", { children: T }),
3086
- E && /* @__PURE__ */ u("style", { children: E }),
3087
- D && /* @__PURE__ */ u("style", { children: D }),
3091
+ T && /* @__PURE__ */ d("style", { children: T }),
3092
+ E && /* @__PURE__ */ d("style", { children: E }),
3093
+ D && /* @__PURE__ */ d("style", { children: D }),
3088
3094
  C
3089
3095
  ]
3090
3096
  })
@@ -3095,8 +3101,8 @@ function zt({ blocks: e, theme: t, components: n, mode: r = "auto", style: i, cu
3095
3101
  }
3096
3102
  //#endregion
3097
3103
  //#region src/WebimContent.jsx
3098
- function Bt({ bundle: e, mode: t = "auto", style: n }) {
3099
- return e?.blocks?.ROOT ? /* @__PURE__ */ u(zt, {
3104
+ function Ht({ bundle: e, mode: t = "auto", style: n }) {
3105
+ return e?.blocks?.ROOT ? /* @__PURE__ */ d(Vt, {
3100
3106
  blocks: e.blocks,
3101
3107
  theme: e.theme,
3102
3108
  components: e.components,
@@ -3113,7 +3119,7 @@ function Bt({ bundle: e, mode: t = "auto", style: n }) {
3113
3119
  }
3114
3120
  //#endregion
3115
3121
  //#region src/bundle.js
3116
- function Vt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
3122
+ function Ut({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
3117
3123
  let a = {
3118
3124
  ...t?.global ?? {},
3119
3125
  ...t?.tenant ?? {}
@@ -3123,7 +3129,7 @@ function Vt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
3123
3129
  title: e.title,
3124
3130
  slug: e.slug,
3125
3131
  blocks: i && o.i18n?.[i]?.blocks || e.blocks,
3126
- theme: ne(o, a.builder_themes?.themes),
3132
+ theme: ie(o, a.builder_themes?.themes),
3127
3133
  components: a.builder_components?.components ?? {},
3128
3134
  custom: o.custom,
3129
3135
  seo: o.seo,
@@ -3137,18 +3143,18 @@ function Vt({ page: e, settings: t, tenant: n, apiUrl: r, locale: i }) {
3137
3143
  }
3138
3144
  //#endregion
3139
3145
  //#region src/fetchPage.js
3140
- var Ht = async (e) => {
3146
+ var Wt = async (e) => {
3141
3147
  let t = await e.json().catch(() => null);
3142
3148
  if (!e.ok || t?.success === !1) throw Error(t?.error?.message || `Request failed (${e.status})`);
3143
3149
  return t?.payload ?? t;
3144
3150
  };
3145
- async function Ut({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
3151
+ async function Gt({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token: a, fetch: o }) {
3146
3152
  if (!e) throw Error("fetchPage: apiUrl is required");
3147
3153
  if (!n) throw Error("fetchPage: slug is required");
3148
3154
  let s = o ?? fetch, c = e.replace(/\/$/, ""), l = {
3149
3155
  ...t ? { "x-tenant": t } : {},
3150
3156
  ...a ? { authorization: `Bearer ${a}` } : {}
3151
- }, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(Ht), s(`${c}/settings/public`, { headers: l }).then(Ht)]), f = Vt({
3157
+ }, [u, d] = await Promise.all([s(`${c}/render/${encodeURIComponent(n)}${i ? `?preview=${encodeURIComponent(i)}` : ""}`, { headers: l }).then(Wt), s(`${c}/settings/public`, { headers: l }).then(Wt)]), f = Ut({
3152
3158
  page: u,
3153
3159
  settings: d,
3154
3160
  tenant: t,
@@ -3156,47 +3162,47 @@ async function Ut({ apiUrl: e, tenant: t, slug: n, locale: r, preview: i, token:
3156
3162
  locale: r
3157
3163
  }), 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))];
3158
3164
  if (p.length) {
3159
- 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(Ht).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
3165
+ 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(Wt).then((e) => [t, Array.isArray(e) ? e : Array.isArray(e?.data) ? e.data : []]).catch(() => [t, []])));
3160
3166
  f.datasets = Object.fromEntries(t);
3161
3167
  }
3162
3168
  return f;
3163
3169
  }
3164
3170
  //#endregion
3165
3171
  //#region src/ssr.jsx
3166
- var Wt = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
3172
+ var $ = (e) => String(e ?? "").replace(/[&<>"]/g, (e) => ({
3167
3173
  "&": "&amp;",
3168
3174
  "<": "&lt;",
3169
3175
  ">": "&gt;",
3170
3176
  "\"": "&quot;"
3171
3177
  })[e]);
3172
- function Gt(t, { mode: n = "auto", style: r } = {}) {
3173
- return e(/* @__PURE__ */ u(Bt, {
3178
+ function Kt(t, { mode: n = "auto", style: r } = {}) {
3179
+ return e(/* @__PURE__ */ d(Ht, {
3174
3180
  bundle: t,
3175
3181
  mode: n,
3176
3182
  style: r
3177
3183
  }));
3178
3184
  }
3179
- function Kt(e, { mode: t = "auto", lang: n } = {}) {
3180
- let r = e.seo ?? {}, i = n || e.locale || "en", a = m(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
3185
+ function qt(e, { mode: t = "auto", lang: n } = {}) {
3186
+ let r = e.seo ?? {}, i = n || e.locale || "en", a = h(e.direction, i), o = r.title || e.title || e.slug || "Page", s = e.custom?.js?.trim(), c = [
3181
3187
  "<meta charset=\"utf-8\"/>",
3182
3188
  "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>",
3183
- `<title>${Wt(o)}</title>`,
3184
- r.description && `<meta name="description" content="${Wt(r.description)}"/>`,
3185
- `<meta property="og:title" content="${Wt(o)}"/>`,
3186
- r.image && `<meta property="og:image" content="${Wt(r.image)}"/>`,
3189
+ `<title>${$(o)}</title>`,
3190
+ r.description && `<meta name="description" content="${$(r.description)}"/>`,
3191
+ `<meta property="og:title" content="${$(o)}"/>`,
3192
+ r.image && `<meta property="og:image" content="${$(r.image)}"/>`,
3187
3193
  r.noindex && "<meta name=\"robots\" content=\"noindex\"/>",
3188
3194
  "<style>html,body{margin:0;height:100%}</style>"
3189
3195
  ].filter(Boolean).join("\n");
3190
3196
  return `<!doctype html>
3191
- <html lang="${Wt(i)}"${a ? ` dir="${a}"` : ""}>
3197
+ <html lang="${$(i)}"${a ? ` dir="${a}"` : ""}>
3192
3198
  <head>
3193
3199
  ${c}
3194
3200
  </head>
3195
3201
  <body>
3196
- ${Gt(e, { mode: t })}
3202
+ ${Kt(e, { mode: t })}
3197
3203
  ${s ? `<script>${s.replaceAll("<\/script", "<\\/script")}<\/script>` : ""}
3198
3204
  </body>
3199
3205
  </html>`;
3200
3206
  }
3201
3207
  //#endregion
3202
- export { Vt as assembleBundle, Ut as fetchPage, Gt as renderBundleHtml, Kt as renderPageDocument };
3208
+ export { Ut as assembleBundle, Gt as fetchPage, Kt as renderBundleHtml, qt as renderPageDocument };